@webitel/ui-sdk 24.12.29 → 24.12.34
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/CHANGELOG.md +271 -131
- package/README.md +6 -0
- package/dist/img/sprite/index.js +8 -2
- package/dist/img/sprite/tree-collapse.svg +4 -0
- package/dist/img/sprite/tree-cross.svg +5 -0
- package/dist/img/sprite/tree-line.svg +10 -0
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +7736 -7442
- package/dist/ui-sdk.umd.cjs +17 -17
- package/package.json +13 -6
- package/src/api/axios/generateInstance.js +6 -2
- package/src/api/clients/agents/agentChats.js +18 -19
- package/src/api/clients/agents/agents.js +29 -7
- package/src/api/clients/buckets/buckets.js +16 -3
- package/src/api/clients/calendars/calendars.js +21 -3
- package/src/api/clients/catalog/catalog.js +1 -3
- package/src/api/clients/chatGateways/chatGateways.js +41 -12
- package/src/api/clients/communications/communications.js +25 -6
- package/src/api/clients/configurations/configurations.js +13 -3
- package/src/api/clients/flows/flow.js +20 -9
- package/src/api/clients/gateways/gateways.js +12 -3
- package/src/api/clients/lists/blacklists.js +16 -3
- package/src/api/clients/media/media.js +16 -3
- package/src/api/clients/queues/queues.js +16 -6
- package/src/api/clients/roles/roles.js +3 -1
- package/src/api/clients/skills/skills.js +16 -3
- package/src/api/clients/teams/teams.js +17 -7
- package/src/api/clients/users/__tests__/users.spec.js +3 -1
- package/src/api/clients/users/users.js +8 -2
- package/src/api/clients//321/201ontacts/contactChatMessagesHistory.js +21 -13
- package/src/api/clients//321/201ontacts/contacts.js +38 -15
- package/src/api/history/transcript/callTranscript.js +10 -2
- package/src/api/interceptors/request/updateToken.interceptor.js +2 -1
- package/src/api/transformers/applyTransform.js +5 -1
- package/src/api/transformers/camelToSnake/camelToSnake.transformer.js +2 -1
- package/src/api/transformers/snakeToCamel/snakeToCamel.transformer.js +2 -1
- package/src/assets/icons/sprite/index.js +8 -2
- package/src/assets/icons/sprite/tree-collapse.svg +4 -0
- package/src/assets/icons/sprite/tree-cross.svg +5 -0
- package/src/assets/icons/sprite/tree-line.svg +10 -0
- package/src/components/index.js +8 -12
- package/src/components/on-demand/wt-navigation-menu/components/_internals/nav-menu-lvl-1.vue +4 -2
- package/src/components/on-demand/wt-navigation-menu/components/_internals/nav-menu-lvl-2.vue +3 -4
- package/src/components/on-demand/wt-navigation-menu/components/wt-navigation-menu.vue +6 -6
- package/src/components/on-demand/wt-route-transition/wt-route-transition.vue +12 -12
- package/src/components/on-demand/wt-save-failed-popup/wt-save-failed-popup.vue +1 -3
- package/src/components/on-demand/wt-selection-popup/wt-selection-popup.vue +3 -3
- package/src/components/on-demand/wt-start-page/components/start-page-card.vue +4 -2
- package/src/components/on-demand/wt-start-page/components/start-page-logo.vue +1 -1
- package/src/components/on-demand/wt-start-page/components/wt-start-page.vue +2 -3
- package/src/components/on-demand/wt-table-transition/wt-table-transition.vue +7 -7
- package/src/components/wt-action-bar/wt-action-bar.vue +16 -12
- package/src/components/wt-app-header/__tests__/WtHeaderActions.spec.js +3 -1
- package/src/components/wt-app-header/_variables.scss +0 -1
- package/src/components/wt-app-header/wt-app-header.vue +4 -4
- package/src/components/wt-app-header/wt-app-navigator.vue +6 -7
- package/src/components/wt-app-header/wt-header-actions.vue +6 -8
- package/src/components/wt-avatar/wt-avatar.vue +4 -3
- package/src/components/wt-badge/wt-badge.vue +1 -2
- package/src/components/wt-button/wt-button.vue +3 -5
- package/src/components/wt-button-select/__tests__/WtButtonSelect.spec.js +6 -2
- package/src/components/wt-button-select/wt-button-select.vue +3 -4
- package/src/components/wt-checkbox/_variables.scss +1 -2
- package/src/components/wt-checkbox/wt-checkbox.vue +1 -2
- package/src/components/wt-chip/_variables.scss +0 -1
- package/src/components/wt-confirm-dialog/wt-confirm-dialog.vue +15 -5
- package/src/components/wt-context-menu/_variables.scss +3 -1
- package/src/components/wt-context-menu/wt-context-menu.vue +1 -3
- package/src/components/wt-copy-action/wt-copy-action.vue +1 -2
- package/src/components/wt-datepicker/_variables.scss +17 -5
- package/src/components/wt-datepicker/wt-datepicker.vue +2 -7
- package/src/components/wt-divider/_variables.scss +0 -1
- package/src/components/wt-divider/wt-divider.vue +5 -3
- package/src/components/wt-dual-panel/__tests__/WtDualPanel.js +2 -2
- package/src/components/wt-dual-panel/wt-dual-panel.vue +6 -5
- package/src/components/wt-dummy/_variables.scss +0 -1
- package/src/components/wt-dummy/wt-dummy.vue +1 -1
- package/src/components/wt-empty/wt-empty.vue +42 -34
- package/src/components/wt-error-page/_variables.scss +0 -1
- package/src/components/wt-error-page/wt-error-page.vue +2 -4
- package/src/components/wt-expansion-panel/_variables.scss +0 -1
- package/src/components/wt-expansion-panel/wt-expansion-panel.vue +3 -8
- package/src/components/wt-filters-panel-wrapper/__tests__/WtFiltersPanelWrapper.spec.js +12 -4
- package/src/components/wt-filters-panel-wrapper/wt-filters-panel-wrapper.vue +8 -7
- package/src/components/wt-headline/_variables.scss +0 -1
- package/src/components/wt-headline-nav/_variables.scss +0 -1
- package/src/components/wt-headline-nav/wt-headline-nav.vue +2 -1
- package/src/components/wt-hint/wt-hint.vue +1 -3
- package/src/components/wt-icon/_variables.scss +0 -1
- package/src/components/wt-icon-action/wt-icon-action.vue +13 -12
- package/src/components/wt-icon-btn/_variables.scss +0 -2
- package/src/components/wt-icon-btn/wt-icon-btn.vue +4 -6
- package/src/components/wt-image/wt-image.vue +14 -13
- package/src/components/wt-indicator/wt-indicator.vue +2 -7
- package/src/components/wt-input/_variables.scss +1 -2
- package/src/components/wt-input/wt-input.vue +13 -10
- package/src/components/wt-input-info/_variables.scss +0 -1
- package/src/components/wt-intersection-observer/__tests__/WtIntersectionObserver.spec.js +1 -1
- package/src/components/wt-intersection-observer/wt-intersection-observer.vue +9 -8
- package/src/components/wt-item-link/_variables.scss +0 -1
- package/src/components/wt-label/_variables.scss +0 -1
- package/src/components/wt-label/wt-label.vue +1 -4
- package/src/components/wt-load-bar/_variables.scss +0 -1
- package/src/components/wt-load-bar/wt-load-bar.vue +0 -1
- package/src/components/wt-loader/_variables.scss +0 -2
- package/src/components/wt-loader/wt-loader.vue +1 -3
- package/src/components/wt-logo/wt-logo.vue +1 -1
- package/src/components/wt-navigation-bar/__tests__/WtNavigationBar.spec.js +9 -3
- package/src/components/wt-navigation-bar/_variables.scss +9 -3
- package/src/components/wt-navigation-bar/wt-navigation-bar.vue +27 -11
- package/src/components/wt-notification/_variables.scss +0 -1
- package/src/components/wt-notifications-bar/__tests__/WtNotificationsBar.spec.js +1 -1
- package/src/components/wt-notifications-bar/_variables.scss +1 -2
- package/src/components/wt-notifications-bar/wt-notifications-bar.vue +4 -2
- package/src/components/wt-page-header/wt-page-header.vue +3 -2
- package/src/components/wt-page-wrapper/__tests__/WtPageWrapper.spec.js +3 -1
- package/src/components/wt-page-wrapper/_variables.scss +0 -1
- package/src/components/wt-page-wrapper/wt-page-wrapper.vue +0 -2
- package/src/components/wt-pagination/_variables.scss +1 -2
- package/src/components/wt-pagination/wt-pagination.vue +2 -1
- package/src/components/wt-player/_variables.scss +6 -2
- package/src/components/wt-player/wt-player.vue +52 -53
- package/src/components/wt-popup/_variables.scss +0 -1
- package/src/components/wt-popup/wt-popup.vue +2 -8
- package/src/components/wt-progress-bar/_variables.scss +0 -1
- package/src/components/wt-progress-bar/wt-progress-bar.vue +7 -6
- package/src/components/wt-radio/_variables.scss +1 -2
- package/src/components/wt-radio/wt-radio.vue +1 -2
- package/src/components/wt-rounded-action/_variables.scss +3 -1
- package/src/components/wt-search-bar/_variables.scss +4 -2
- package/src/components/wt-search-bar/wt-search-bar.vue +10 -4
- package/src/components/wt-select/_multiselect.scss +9 -15
- package/src/components/wt-select/_variables.scss +3 -2
- package/src/components/wt-select/mixins/multiselectMixin.js +2 -1
- package/src/components/wt-select/wt-select.vue +25 -26
- package/src/components/wt-slider/_variables.scss +0 -1
- package/src/components/wt-slider/wt-slider.vue +3 -3
- package/src/components/wt-status-select/_variables.scss +8 -4
- package/src/components/wt-stepper/_variables.scss +0 -1
- package/src/components/wt-stepper/wt-stepper.vue +5 -5
- package/src/components/wt-switcher/_variables.scss +0 -1
- package/src/components/wt-switcher/wt-switcher.vue +2 -3
- package/src/components/wt-table/__tests__/WtTable.spec.js +8 -2
- package/src/components/wt-table/_variables.scss +0 -1
- package/src/components/wt-table/types/table-header.ts +8 -0
- package/src/components/wt-table/wt-table.vue +111 -109
- package/src/components/wt-table-actions/_variables.scss +1 -2
- package/src/components/wt-table-actions/wt-table-actions.vue +1 -2
- package/src/components/wt-table-column-select/wt-table-column-select.vue +11 -8
- package/src/components/wt-tabs/_variables.scss +0 -1
- package/src/components/wt-tabs/wt-tabs.vue +6 -6
- package/src/components/wt-tags-input/__tests__/WtTagsInput.spec.js +6 -6
- package/src/components/wt-tags-input/mixin/taggableMixin.js +3 -1
- package/src/components/wt-tags-input/wt-tags-input.vue +8 -10
- package/src/components/wt-textarea/__tests__/WtTextarea.spec.js +6 -2
- package/src/components/wt-textarea/_variables.scss +0 -1
- package/src/components/wt-textarea/wt-textarea.vue +6 -7
- package/src/components/wt-time-input/wt-time-input.vue +1 -2
- package/src/components/wt-timepicker/_variables.scss +1 -2
- package/src/components/wt-timepicker/wt-timepicker.vue +10 -8
- package/src/components/wt-tooltip/_internals/useTooltipTriggerSubscriptions.js +6 -1
- package/src/components/wt-tooltip/_internals/wt-tooltip-floating.vue +1 -3
- package/src/components/wt-tooltip/_variables.scss +0 -1
- package/src/components/wt-tooltip/wt-tooltip.vue +13 -2
- package/src/components/wt-tree-table/_variables.scss +19 -0
- package/src/components/wt-tree-table/wt-tree-table.vue +323 -0
- package/src/components/wt-tree-table-row/wt-tree-table-row.vue +171 -0
- package/src/composables/useAccessControl/useAccessControl.js +12 -4
- package/src/composables/useCachedInterval/useCachedInterval.js +6 -2
- package/src/composables/useCachedItemInstanceName/useCachedItemInstanceName.js +4 -1
- package/src/composables/useCard/useCardComponent.js +10 -9
- package/src/composables/useCard/useCardTabs.js +6 -3
- package/src/composables/useRepresentableAgentPauseCause/__tests__/useRepresentableAgentPauseCause.spec.js +20 -10
- package/src/composables/useValidate/useValidate.js +1 -1
- package/src/composables/useWtTable/useWtTable.ts +25 -0
- package/src/css/main.scss +7 -1
- package/src/css/pages/table-page.scss +1 -2
- package/src/css/styleguide/border-radius/_border-radius.scss +1 -1
- package/src/css/styleguide/colors/_deprecated.scss +83 -24
- package/src/css/styleguide/colors/_palette.scss +1340 -251
- package/src/css/styleguide/colors/reusable/_text-field.scss +6 -2
- package/src/css/styleguide/fonts/_fonts.scss +36 -18
- package/src/css/styleguide/spacings/_spacings.scss +1 -1
- package/src/css/styleguide/transitions/_transitions.scss +1 -1
- package/src/css/styleguide/transitions/fade/_fade.scss +5 -4
- package/src/css/styleguide/viewport-breakpoints/_viewport-breakpoints.scss +0 -1
- package/src/enums/WebitelApplications/WebitelApplications.enum.js +7 -7
- package/src/enums/index.js +5 -10
- package/src/locale/en/en.js +5 -2
- package/src/locale/ru/ru.js +7 -3
- package/src/locale/ua/ua.js +7 -3
- package/src/mixins/dataFilterMixins/__tests__/apiFilterMixin.spec.js +2 -1
- package/src/mixins/dataFilterMixins/apiFilterMixin.js +3 -1
- package/src/mixins/dataFilterMixins/baseFilterMixin/baseFilterMixin.js +2 -1
- package/src/mixins/dataFilterMixins/enumFilterMixin.js +2 -1
- package/src/mixins/dataFilterMixins/paginationFilterMixin.js +4 -1
- package/src/mixins/dataFilterMixins/sortFilterMixin.js +2 -1
- package/src/mixins/validationMixin/useValidation.js +17 -7
- package/src/mixins/validationMixin/validationMixin.js +16 -8
- package/src/modules/AgentStatusSelect/api/pause-cause.js +4 -1
- package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-agent-status-select.spec.js +18 -6
- package/src/modules/AgentStatusSelect/components/_internals/wt-cc-pause-cause-popup.vue +3 -2
- package/src/modules/AgentStatusSelect/components/wt-cc-agent-status-select.vue +5 -2
- package/src/modules/Appearance/components/__tests__/wt-dark-mode-switcher.spec.js +6 -2
- package/src/modules/AuditForm/components/__tests__/audit-form-question-write-wrapper.spec.js +12 -4
- package/src/modules/AuditForm/components/__tests__/audit-form.spec.js +18 -5
- package/src/modules/AuditForm/components/audit-form-question-read-wrapper.vue +4 -2
- package/src/modules/AuditForm/components/audit-form-question-write-wrapper.vue +15 -5
- package/src/modules/AuditForm/components/audit-form-question.vue +10 -4
- package/src/modules/AuditForm/components/audit-form.vue +24 -7
- package/src/modules/AuditForm/components/questions/options/__tests__/audit-form-question-options.spec.js +6 -2
- package/src/modules/AuditForm/components/questions/options/audit-form-question-options.vue +5 -5
- package/src/modules/AuditForm/components/questions/score/audit-form-question-score.vue +9 -4
- package/src/modules/CSVExport/CSVExport.js +5 -2
- package/src/modules/CSVExport/XLSExport.js +7 -7
- package/src/modules/CSVExport/__tests__/CSVExport.spec.js +4 -1
- package/src/modules/CSVExport/mixins/exportCSVMixin.js +3 -1
- package/src/modules/CSVExport/mixins/exportXLSMixin.js +3 -1
- package/src/modules/CardStoreModule/composables/useCardStore.js +6 -2
- package/src/modules/DeleteConfirmationPopup/__tests__/delete-confirmation-popup.spec.js +3 -3
- package/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue +6 -3
- package/src/modules/FilesExport/__tests__/FilesExport.spec.js +6 -2
- package/src/modules/FilesExport/mixins/exportFilesMixin.js +6 -2
- package/src/modules/FilesExport/scripts/generateMediaURL.js +2 -1
- package/src/modules/Filters/classes/BaseFilterSchema.js +15 -6
- package/src/modules/Filters/components/filter-datetime.vue +7 -5
- package/src/modules/Filters/components/filter-pagination.vue +7 -5
- package/src/modules/Filters/components/filter-search.vue +4 -4
- package/src/modules/Filters/components/filter-select.vue +33 -24
- package/src/modules/Filters/components/filter-table-fields.vue +1 -3
- package/src/modules/Filters/composables/useTableFilters.js +3 -1
- package/src/modules/Filters/scripts/getters/localStorageGetter.js +6 -2
- package/src/modules/Filters/scripts/getters/queryGetter.js +2 -1
- package/src/modules/Filters/scripts/setters/localStorageSetter.js +6 -2
- package/src/modules/Filters/scripts/setters/querySetter.js +2 -1
- package/src/modules/Filters/scripts/utils/changeRouteQuery.js +2 -1
- package/src/modules/Filters/store/FiltersStoreModule.js +3 -3
- package/src/modules/Notifications/store/NotificationsStoreModule.js +14 -5
- package/src/modules/Notifications/store/__tests__/NotificationsStoreModule.actions.spec.js +10 -3
- package/src/modules/ObjectPermissions/_internals/components/permissions-role-row.vue +1 -3
- package/src/modules/ObjectPermissions/_internals/components/permissions-role-select.vue +1 -3
- package/src/modules/ObjectPermissions/_internals/components/permissions-tab-role-popup.vue +8 -5
- package/src/modules/ObjectPermissions/_internals/modules/filters/store/filters.store.js +3 -4
- package/src/modules/ObjectPermissions/_internals/store/helpers/createObjectPermissionsStoreModule.js +1 -2
- package/src/modules/ObjectPermissions/_internals/store/modules/objectPermissionsStoreModule.js +10 -14
- package/src/modules/ObjectPermissions/components/permissions-tab.vue +12 -12
- package/src/modules/ObjectPermissions/store/index.js +2 -6
- package/src/modules/QueryFilters/components/__tests__/filter-datetime.spec.js +3 -1
- package/src/modules/QueryFilters/components/__tests__/filter-from-to.spec.js +6 -2
- package/src/modules/QueryFilters/components/__tests__/filter-search.spec.js +7 -2
- package/src/modules/QueryFilters/components/abstract-api-filter.vue +15 -5
- package/src/modules/QueryFilters/components/abstract-enum-filter.vue +15 -5
- package/src/modules/QueryFilters/components/filter-datetime.vue +1 -3
- package/src/modules/QueryFilters/components/filter-from-to.vue +1 -1
- package/src/modules/QueryFilters/components/filter-search.vue +1 -3
- package/src/modules/QueryFilters/components/filter-table-fields.vue +1 -3
- package/src/modules/QueryFilters/mixins/__tests__/enumFilterMixin.spec.js +4 -1
- package/src/modules/QueryFilters/mixins/baseFilterMixin/baseFilterMixin.js +9 -3
- package/src/modules/QueryFilters/mixins/enumFilterMixin.js +10 -3
- package/src/modules/QueryFilters/mixins/paginationFilterMixin.js +4 -2
- package/src/modules/QueryFilters/mixins/sortFilterMixin.js +2 -1
- package/src/modules/QueryFilters/store/QueryFiltersStoreModule.js +2 -1
- package/src/modules/QueryFilters/store/__tests__/QueryFiltersStoreModule.spec.js +10 -3
- package/src/modules/TableComponentModule/composables/useTableEmpty.js +13 -4
- package/src/modules/TableStoreModule/composables/useTableStore.js +18 -6
- package/src/modules/TableStoreModule/store/TableStoreModule.js +36 -21
- package/src/modules/TableStoreModule/store/__tests__/TableStoreModule.spec.js +7 -2
- package/src/modules/Userinfo/api/userinfo.js +4 -1
- package/src/modules/Userinfo/classes/ApplicationsAccess.js +3 -1
- package/src/modules/Userinfo/store/UserinfoStoreModule.js +25 -9
- package/src/plugins/breakpoint/breakpoint.plugin.js +2 -1
- package/src/scripts/__tests__/caseConverters.spec.js +4 -1
- package/src/scripts/__tests__/updateObject.spec.js +6 -2
- package/src/scripts/caseConverters.js +37 -29
- package/src/scripts/compareSize.ts +9 -6
- package/src/scripts/debounce.js +2 -1
- package/src/scripts/index.js +2 -8
- package/src/scripts/logger.js +4 -4
- package/src/scripts/preventHiddenPageCallsDecorator.js +6 -2
- package/src/scripts/saveAsJSON.js +3 -1
- package/src/scripts/sortQueryAdapters.js +11 -0
- package/src/store/BaseStoreModules/ApiStoreModule.js +26 -7
- package/src/store/BaseStoreModules/BaseStoreModule.js +2 -1
- package/src/store/BaseStoreModules/__tests__/BaseStoreModule.spec.js +28 -7
- package/src/store/helpers/getNamespacedState.js +3 -1
- package/src/store/new/modules/apiStoreModule/apiStoreModule.js +19 -14
- package/src/store/new/modules/cardStoreModule/useCardStore.js +6 -2
- package/src/store/new/modules/tableStoreModule/__tests__/tableStoreModule.spec.js +6 -8
- package/src/store/new/modules/tableStoreModule/tableStoreModule.js +31 -28
- package/src/store/new/modules/tableStoreModule/useTableStore.js +18 -6
- package/src/validators/variableSearchValidator/__tests__/variableSearchValidator.spec.js +2 -1
- package/src/validators/websocketValidator/__tests__/websocketValidator.spec.js +3 -1
- package/src/components/wt-table/_internals/getSortOrder.js +0 -12
- /package/dist/img/sprite/{plus.svg → tree-expand.svg} +0 -0
- /package/src/assets/icons/sprite/{plus.svg → tree-expand.svg} +0 -0
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webitel/ui-sdk",
|
|
3
|
-
"version": "24.12.
|
|
3
|
+
"version": "24.12.34",
|
|
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
|
|
11
|
-
"lint
|
|
12
|
-
"lint
|
|
13
|
-
"lint:
|
|
10
|
+
"lint:js": "eslint",
|
|
11
|
+
"lint:prettier": "prettier --check .",
|
|
12
|
+
"lint": "npm run lint:js && npm run lint:prettier",
|
|
13
|
+
"lint:fix": "prettier --write --list-different . && npm run lint:js --fix",
|
|
14
14
|
"publish-lib": "npm run test:unit && npm run build && npm publish --access public",
|
|
15
15
|
"publish-lib:testless": "npm run build && npm publish --access public",
|
|
16
16
|
"docs:dev": "vitepress dev docs --port 8080",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"xlsx": "^0.18.5"
|
|
137
137
|
},
|
|
138
138
|
"devDependencies": {
|
|
139
|
-
"@
|
|
139
|
+
"@eslint/js": "^9.17.0",
|
|
140
140
|
"@tsconfig/node22": "^22.0.0",
|
|
141
141
|
"@types/node": "^22.9.1",
|
|
142
142
|
"@vitejs/plugin-vue": "^5.2.0",
|
|
@@ -145,6 +145,11 @@
|
|
|
145
145
|
"@vue/compiler-sfc": "^3.5.13",
|
|
146
146
|
"@vue/test-utils": "^2.4.6",
|
|
147
147
|
"@vue/tsconfig": "^0.6.0",
|
|
148
|
+
"eslint": "^9.17.0",
|
|
149
|
+
"eslint-config-prettier": "^9.1.0",
|
|
150
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
151
|
+
"eslint-plugin-vue": "^9.32.0",
|
|
152
|
+
"globals": "^15.14.0",
|
|
148
153
|
"globby": "^14.0.2",
|
|
149
154
|
"happy-dom": "^15.11.6",
|
|
150
155
|
"markdown-it": "^14.1.0",
|
|
@@ -152,9 +157,11 @@
|
|
|
152
157
|
"path": "^0.12.7",
|
|
153
158
|
"postcss": "^8.4.49",
|
|
154
159
|
"postcss-prefix-selector": "^2.1.0",
|
|
160
|
+
"prettier": "^3.4.2",
|
|
155
161
|
"prismjs": "^1.29.0",
|
|
156
162
|
"sass": "^1.81.0",
|
|
157
163
|
"typescript": "5.6.3",
|
|
164
|
+
"typescript-eslint": "^8.18.1",
|
|
158
165
|
"typescript-plugin-css-modules": "^5.1.0",
|
|
159
166
|
"vite": "^5.4.11",
|
|
160
167
|
"vite-plugin-checker": "^0.8.0",
|
|
@@ -12,10 +12,14 @@ const generateInstance = ({ interceptors, baseURL } = {}) => {
|
|
|
12
12
|
if (interceptors) {
|
|
13
13
|
const { request, response } = interceptors;
|
|
14
14
|
if (request) {
|
|
15
|
-
request.forEach((interceptor) =>
|
|
15
|
+
request.forEach((interceptor) =>
|
|
16
|
+
instance.interceptors.request.use(...interceptor),
|
|
17
|
+
);
|
|
16
18
|
}
|
|
17
19
|
if (response) {
|
|
18
|
-
response.forEach((interceptor) =>
|
|
20
|
+
response.forEach((interceptor) =>
|
|
21
|
+
instance.interceptors.response.use(...interceptor),
|
|
22
|
+
);
|
|
19
23
|
}
|
|
20
24
|
}
|
|
21
25
|
|
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
import applyTransform, {
|
|
8
8
|
merge,
|
|
9
9
|
notify,
|
|
10
|
-
snakeToCamel,
|
|
10
|
+
snakeToCamel,
|
|
11
|
+
starToSearch,
|
|
11
12
|
} from '../../transformers/index.js';
|
|
12
13
|
import i18n from '../../../locale/i18n.js';
|
|
13
14
|
|
|
@@ -16,15 +17,14 @@ const { t } = i18n.global;
|
|
|
16
17
|
const instance = getDefaultInstance();
|
|
17
18
|
const configuration = getDefaultOpenAPIConfig();
|
|
18
19
|
|
|
19
|
-
const agentChatsService = new AgentChatServiceApiFactory(
|
|
20
|
+
const agentChatsService = new AgentChatServiceApiFactory(
|
|
21
|
+
configuration,
|
|
22
|
+
'',
|
|
23
|
+
instance,
|
|
24
|
+
);
|
|
20
25
|
|
|
21
26
|
const getChatsList = async (params) => {
|
|
22
|
-
const {
|
|
23
|
-
size,
|
|
24
|
-
page,
|
|
25
|
-
onlyClosed,
|
|
26
|
-
onlyUnprocessed,
|
|
27
|
-
} = applyTransform(params, [
|
|
27
|
+
const { size, page, onlyClosed, onlyUnprocessed } = applyTransform(params, [
|
|
28
28
|
merge(getDefaultGetParams()),
|
|
29
29
|
]);
|
|
30
30
|
|
|
@@ -38,9 +38,7 @@ const getChatsList = async (params) => {
|
|
|
38
38
|
onlyClosed,
|
|
39
39
|
onlyUnprocessed,
|
|
40
40
|
);
|
|
41
|
-
const { items, next } = applyTransform(response.data, [
|
|
42
|
-
snakeToCamel(),
|
|
43
|
-
]);
|
|
41
|
+
const { items, next } = applyTransform(response.data, [snakeToCamel()]);
|
|
44
42
|
return {
|
|
45
43
|
items,
|
|
46
44
|
next,
|
|
@@ -50,18 +48,19 @@ const getChatsList = async (params) => {
|
|
|
50
48
|
}
|
|
51
49
|
};
|
|
52
50
|
|
|
53
|
-
const markChatProcessed = async (chatId) => {
|
|
51
|
+
const markChatProcessed = async (chatId) => {
|
|
52
|
+
// add to chat unprocessedClose: true
|
|
54
53
|
try {
|
|
55
54
|
const response = await agentChatsService.markChatProcessed(chatId);
|
|
56
|
-
return applyTransform(response.data, [
|
|
57
|
-
snakeToCamel(),
|
|
58
|
-
]);
|
|
55
|
+
return applyTransform(response.data, [snakeToCamel()]);
|
|
59
56
|
} catch (err) {
|
|
60
57
|
throw applyTransform(err, [
|
|
61
|
-
notify(({ callback }) =>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
notify(({ callback }) =>
|
|
59
|
+
callback({
|
|
60
|
+
type: 'error',
|
|
61
|
+
text: t('errorNotifications.markChatProcessed'),
|
|
62
|
+
}),
|
|
63
|
+
),
|
|
65
64
|
]);
|
|
66
65
|
}
|
|
67
66
|
};
|
|
@@ -47,7 +47,10 @@ const getAgentsList = async (params) => {
|
|
|
47
47
|
notTeamId,
|
|
48
48
|
supervisorId,
|
|
49
49
|
notSkillId,
|
|
50
|
-
} = applyTransform(params, [
|
|
50
|
+
} = applyTransform(params, [
|
|
51
|
+
merge(getDefaultGetParams()),
|
|
52
|
+
starToSearch('search'),
|
|
53
|
+
]);
|
|
51
54
|
|
|
52
55
|
try {
|
|
53
56
|
const response = await agentService.searchAgent(
|
|
@@ -101,7 +104,10 @@ const getAgent = async ({ itemId: id }) => {
|
|
|
101
104
|
|
|
102
105
|
try {
|
|
103
106
|
const response = await agentService.readAgent(id);
|
|
104
|
-
return applyTransform(response.data, [
|
|
107
|
+
return applyTransform(response.data, [
|
|
108
|
+
snakeToCamel(),
|
|
109
|
+
merge(defaultObject),
|
|
110
|
+
]);
|
|
105
111
|
} catch (err) {
|
|
106
112
|
throw applyTransform(err, [notify]);
|
|
107
113
|
}
|
|
@@ -121,7 +127,10 @@ const fieldsToSend = [
|
|
|
121
127
|
];
|
|
122
128
|
|
|
123
129
|
const addAgent = async ({ itemInstance }) => {
|
|
124
|
-
const item = applyTransform(itemInstance, [
|
|
130
|
+
const item = applyTransform(itemInstance, [
|
|
131
|
+
sanitize(fieldsToSend),
|
|
132
|
+
camelToSnake(),
|
|
133
|
+
]);
|
|
125
134
|
try {
|
|
126
135
|
const response = await agentService.createAgent(item);
|
|
127
136
|
return applyTransform(response.data, [snakeToCamel()]);
|
|
@@ -131,7 +140,10 @@ const addAgent = async ({ itemInstance }) => {
|
|
|
131
140
|
};
|
|
132
141
|
|
|
133
142
|
const patchAgent = async ({ changes, id }) => {
|
|
134
|
-
const body = applyTransform(changes, [
|
|
143
|
+
const body = applyTransform(changes, [
|
|
144
|
+
sanitize(fieldsToSend),
|
|
145
|
+
camelToSnake(),
|
|
146
|
+
]);
|
|
135
147
|
try {
|
|
136
148
|
const response = await agentService.patchAgent(id, body);
|
|
137
149
|
return applyTransform(response.data, [snakeToCamel()]);
|
|
@@ -141,7 +153,10 @@ const patchAgent = async ({ changes, id }) => {
|
|
|
141
153
|
};
|
|
142
154
|
|
|
143
155
|
const updateAgent = async ({ itemInstance, itemId: id }) => {
|
|
144
|
-
const item = applyTransform(itemInstance, [
|
|
156
|
+
const item = applyTransform(itemInstance, [
|
|
157
|
+
sanitize(fieldsToSend),
|
|
158
|
+
camelToSnake(),
|
|
159
|
+
]);
|
|
145
160
|
try {
|
|
146
161
|
const response = await agentService.updateAgent(id, item);
|
|
147
162
|
return applyTransform(response.data, [snakeToCamel()]);
|
|
@@ -173,7 +188,10 @@ const getAgentHistory = async (params) => {
|
|
|
173
188
|
page,
|
|
174
189
|
size,
|
|
175
190
|
sort = '-joined_at',
|
|
176
|
-
} = applyTransform(params, [
|
|
191
|
+
} = applyTransform(params, [
|
|
192
|
+
merge(getDefaultGetParams()),
|
|
193
|
+
starToSearch('search'),
|
|
194
|
+
]);
|
|
177
195
|
|
|
178
196
|
try {
|
|
179
197
|
const response = await agentService.searchAgentStateHistory(
|
|
@@ -204,7 +222,11 @@ const getAgentUsersOptions = async (params) => {
|
|
|
204
222
|
]);
|
|
205
223
|
|
|
206
224
|
try {
|
|
207
|
-
const response = await agentService.searchLookupUsersAgentNotExists(
|
|
225
|
+
const response = await agentService.searchLookupUsersAgentNotExists(
|
|
226
|
+
page,
|
|
227
|
+
size,
|
|
228
|
+
search,
|
|
229
|
+
);
|
|
208
230
|
const { items, next } = applyTransform(response.data, [
|
|
209
231
|
snakeToCamel(),
|
|
210
232
|
merge(getDefaultGetListResponse()),
|
|
@@ -26,7 +26,14 @@ const getBucketsList = async (params) => {
|
|
|
26
26
|
]);
|
|
27
27
|
|
|
28
28
|
try {
|
|
29
|
-
const response = await bucketService.searchBucket(
|
|
29
|
+
const response = await bucketService.searchBucket(
|
|
30
|
+
page,
|
|
31
|
+
size,
|
|
32
|
+
search,
|
|
33
|
+
sort,
|
|
34
|
+
fields,
|
|
35
|
+
id,
|
|
36
|
+
);
|
|
30
37
|
const { items, next } = applyTransform(response.data, [
|
|
31
38
|
snakeToCamel(),
|
|
32
39
|
merge(getDefaultGetListResponse()),
|
|
@@ -52,7 +59,10 @@ const getBucket = async ({ itemId: id }) => {
|
|
|
52
59
|
const fieldsToSend = ['name', 'description'];
|
|
53
60
|
|
|
54
61
|
const addBucket = async ({ itemInstance }) => {
|
|
55
|
-
const item = applyTransform(itemInstance, [
|
|
62
|
+
const item = applyTransform(itemInstance, [
|
|
63
|
+
sanitize(fieldsToSend),
|
|
64
|
+
camelToSnake(),
|
|
65
|
+
]);
|
|
56
66
|
try {
|
|
57
67
|
const response = await bucketService.createBucket(item);
|
|
58
68
|
return applyTransform(response.data, [snakeToCamel()]);
|
|
@@ -62,7 +72,10 @@ const addBucket = async ({ itemInstance }) => {
|
|
|
62
72
|
};
|
|
63
73
|
|
|
64
74
|
const updateBucket = async ({ itemInstance, itemId: id }) => {
|
|
65
|
-
const item = applyTransform(itemInstance, [
|
|
75
|
+
const item = applyTransform(itemInstance, [
|
|
76
|
+
sanitize(fieldsToSend),
|
|
77
|
+
camelToSnake(),
|
|
78
|
+
]);
|
|
66
79
|
try {
|
|
67
80
|
const response = await bucketService.updateBucket(id, item);
|
|
68
81
|
return applyTransform(response.data, [snakeToCamel()]);
|
|
@@ -18,7 +18,11 @@ import applyTransform, {
|
|
|
18
18
|
const instance = getDefaultInstance();
|
|
19
19
|
const configuration = getDefaultOpenAPIConfig();
|
|
20
20
|
|
|
21
|
-
const calendarService = new CalendarServiceApiFactory(
|
|
21
|
+
const calendarService = new CalendarServiceApiFactory(
|
|
22
|
+
configuration,
|
|
23
|
+
'',
|
|
24
|
+
instance,
|
|
25
|
+
);
|
|
22
26
|
|
|
23
27
|
const getCalendarList = async (params) => {
|
|
24
28
|
const { page, size, search, sort, fields, id } = applyTransform(params, [
|
|
@@ -27,7 +31,14 @@ const getCalendarList = async (params) => {
|
|
|
27
31
|
]);
|
|
28
32
|
|
|
29
33
|
try {
|
|
30
|
-
const response = await calendarService.searchCalendar(
|
|
34
|
+
const response = await calendarService.searchCalendar(
|
|
35
|
+
page,
|
|
36
|
+
size,
|
|
37
|
+
search,
|
|
38
|
+
sort,
|
|
39
|
+
fields,
|
|
40
|
+
id,
|
|
41
|
+
);
|
|
31
42
|
const { items, next } = applyTransform(response.data, [
|
|
32
43
|
snakeToCamel(),
|
|
33
44
|
merge(getDefaultGetListResponse()),
|
|
@@ -168,7 +179,14 @@ const getTimezonesLookup = async (params) => {
|
|
|
168
179
|
]);
|
|
169
180
|
|
|
170
181
|
try {
|
|
171
|
-
const response = await calendarService.searchTimezones(
|
|
182
|
+
const response = await calendarService.searchTimezones(
|
|
183
|
+
page,
|
|
184
|
+
size,
|
|
185
|
+
search,
|
|
186
|
+
sort,
|
|
187
|
+
fields,
|
|
188
|
+
id,
|
|
189
|
+
);
|
|
172
190
|
const { items, next } = applyTransform(response.data, [
|
|
173
191
|
snakeToCamel(),
|
|
174
192
|
merge(getDefaultGetListResponse()),
|
|
@@ -26,9 +26,7 @@ const getChatMessagesList = async ({ chatId }) => {
|
|
|
26
26
|
|
|
27
27
|
try {
|
|
28
28
|
const response = await catalogService.getHistory(chatId);
|
|
29
|
-
const { messages, peers } = applyTransform(response.data, [
|
|
30
|
-
snakeToCamel(),
|
|
31
|
-
]);
|
|
29
|
+
const { messages, peers } = applyTransform(response.data, [snakeToCamel()]);
|
|
32
30
|
return {
|
|
33
31
|
items: applyTransform({ messages, peers }, [mergeMessagesData]),
|
|
34
32
|
peers,
|
|
@@ -21,7 +21,15 @@ import webChatGateway from './defaults/webChatGateway.js';
|
|
|
21
21
|
const instance = getDefaultInstance();
|
|
22
22
|
|
|
23
23
|
const baseUrl = '/chat/bots';
|
|
24
|
-
const fieldsToSend = [
|
|
24
|
+
const fieldsToSend = [
|
|
25
|
+
'name',
|
|
26
|
+
'uri',
|
|
27
|
+
'flow',
|
|
28
|
+
'enabled',
|
|
29
|
+
'provider',
|
|
30
|
+
'metadata',
|
|
31
|
+
'updates',
|
|
32
|
+
];
|
|
25
33
|
|
|
26
34
|
const convertWebchatSeconds = (num) => `${num}s`;
|
|
27
35
|
|
|
@@ -31,13 +39,19 @@ const parseTimeoutSeconds = (item) =>
|
|
|
31
39
|
const webchatRequestConverter = (data) => {
|
|
32
40
|
const copy = deepCopy(data);
|
|
33
41
|
if (data.metadata.readTimeout) {
|
|
34
|
-
copy.metadata.readTimeout = convertWebchatSeconds(
|
|
42
|
+
copy.metadata.readTimeout = convertWebchatSeconds(
|
|
43
|
+
data.metadata.readTimeout,
|
|
44
|
+
);
|
|
35
45
|
}
|
|
36
46
|
if (data.metadata.writeTimeout) {
|
|
37
|
-
copy.metadata.writeTimeout = convertWebchatSeconds(
|
|
47
|
+
copy.metadata.writeTimeout = convertWebchatSeconds(
|
|
48
|
+
data.metadata.writeTimeout,
|
|
49
|
+
);
|
|
38
50
|
}
|
|
39
51
|
if (data.metadata.handshakeTimeout) {
|
|
40
|
-
copy.metadata.handshakeTimeout = convertWebchatSeconds(
|
|
52
|
+
copy.metadata.handshakeTimeout = convertWebchatSeconds(
|
|
53
|
+
data.metadata.handshakeTimeout,
|
|
54
|
+
);
|
|
41
55
|
}
|
|
42
56
|
if (data.metadata.allowOrigin) {
|
|
43
57
|
copy.metadata.allowOrigin = data.metadata.allowOrigin.join();
|
|
@@ -46,7 +60,9 @@ const webchatRequestConverter = (data) => {
|
|
|
46
60
|
copy.metadata.view = JSON.stringify(data.metadata.view);
|
|
47
61
|
copy.metadata.chat = JSON.stringify(data.metadata.chat);
|
|
48
62
|
copy.metadata.appointment = JSON.stringify(data.metadata.appointment);
|
|
49
|
-
copy.metadata.alternativeChannels = JSON.stringify(
|
|
63
|
+
copy.metadata.alternativeChannels = JSON.stringify(
|
|
64
|
+
data.metadata.alternativeChannels,
|
|
65
|
+
);
|
|
50
66
|
copy.metadata.call = JSON.stringify(data.metadata.call);
|
|
51
67
|
|
|
52
68
|
if (copy.metadata.captcha.enabled) {
|
|
@@ -76,15 +92,21 @@ const viberRequestConverter = (item) => {
|
|
|
76
92
|
|
|
77
93
|
const webChatResponseConverter = (data) => {
|
|
78
94
|
const copy = deepCopy(data);
|
|
79
|
-
copy.metadata.allowOrigin = data.metadata.allowOrigin
|
|
95
|
+
copy.metadata.allowOrigin = data.metadata.allowOrigin
|
|
96
|
+
? data.metadata.allowOrigin.split(',')
|
|
97
|
+
: [];
|
|
80
98
|
if (data.metadata.readTimeout) {
|
|
81
99
|
copy.metadata.readTimeout = parseTimeoutSeconds(data.metadata.readTimeout);
|
|
82
100
|
}
|
|
83
101
|
if (data.metadata.writeTimeout) {
|
|
84
|
-
copy.metadata.writeTimeout = parseTimeoutSeconds(
|
|
102
|
+
copy.metadata.writeTimeout = parseTimeoutSeconds(
|
|
103
|
+
data.metadata.writeTimeout,
|
|
104
|
+
);
|
|
85
105
|
}
|
|
86
106
|
if (data.metadata.handshakeTimeout) {
|
|
87
|
-
copy.metadata.handshakeTimeout = parseTimeoutSeconds(
|
|
107
|
+
copy.metadata.handshakeTimeout = parseTimeoutSeconds(
|
|
108
|
+
data.metadata.handshakeTimeout,
|
|
109
|
+
);
|
|
88
110
|
}
|
|
89
111
|
if (data.metadata.view) {
|
|
90
112
|
copy.metadata.view = JSON.parse(data.metadata.view);
|
|
@@ -96,7 +118,9 @@ const webChatResponseConverter = (data) => {
|
|
|
96
118
|
copy.metadata.appointment = JSON.parse(data.metadata.appointment);
|
|
97
119
|
}
|
|
98
120
|
if (data.metadata.alternativeChannels) {
|
|
99
|
-
copy.metadata.alternativeChannels = JSON.parse(
|
|
121
|
+
copy.metadata.alternativeChannels = JSON.parse(
|
|
122
|
+
data.metadata.alternativeChannels,
|
|
123
|
+
);
|
|
100
124
|
}
|
|
101
125
|
if (data.metadata.call) {
|
|
102
126
|
copy.metadata.call = JSON.parse(data.metadata.call);
|
|
@@ -118,8 +142,10 @@ const messengerResponseConverter = (item) => {
|
|
|
118
142
|
|
|
119
143
|
const viberResponseConverter = (item) => {
|
|
120
144
|
const copy = deepCopy(item);
|
|
121
|
-
if (item.metadata['btn.back.color'])
|
|
122
|
-
|
|
145
|
+
if (item.metadata['btn.back.color'])
|
|
146
|
+
copy.metadata.btnBackColor = item.metadata['btn.back.color'];
|
|
147
|
+
if (item.metadata['btn.font.color'])
|
|
148
|
+
copy.metadata.btnFontColor = item.metadata['btn.font.color'];
|
|
123
149
|
return copy;
|
|
124
150
|
};
|
|
125
151
|
|
|
@@ -233,7 +259,10 @@ const updateChatGateway = async ({ itemInstance, itemId: id }) => {
|
|
|
233
259
|
};
|
|
234
260
|
|
|
235
261
|
const patchChatGateway = async ({ changes, id }) => {
|
|
236
|
-
const body = applyTransform(changes, [
|
|
262
|
+
const body = applyTransform(changes, [
|
|
263
|
+
sanitize(fieldsToSend),
|
|
264
|
+
camelToSnake(),
|
|
265
|
+
]);
|
|
237
266
|
const url = `${baseUrl}/${id}`;
|
|
238
267
|
try {
|
|
239
268
|
const response = await instance.patch(url, body);
|
|
@@ -18,7 +18,11 @@ import applyTransform, {
|
|
|
18
18
|
const instance = getDefaultInstance();
|
|
19
19
|
const configuration = getDefaultOpenAPIConfig();
|
|
20
20
|
|
|
21
|
-
const communicationService = new CommunicationTypeServiceApiFactory(
|
|
21
|
+
const communicationService = new CommunicationTypeServiceApiFactory(
|
|
22
|
+
configuration,
|
|
23
|
+
'',
|
|
24
|
+
instance,
|
|
25
|
+
);
|
|
22
26
|
|
|
23
27
|
const getCommunicationsList = async (params) => {
|
|
24
28
|
const defaultObject = {
|
|
@@ -64,7 +68,10 @@ const getCommunication = async ({ itemId: id }) => {
|
|
|
64
68
|
const fieldsToSend = ['code', 'name', 'description', 'channel', 'default'];
|
|
65
69
|
|
|
66
70
|
const addCommunication = async ({ itemInstance }) => {
|
|
67
|
-
const item = applyTransform(itemInstance, [
|
|
71
|
+
const item = applyTransform(itemInstance, [
|
|
72
|
+
sanitize(fieldsToSend),
|
|
73
|
+
camelToSnake(),
|
|
74
|
+
]);
|
|
68
75
|
try {
|
|
69
76
|
const response = await communicationService.createCommunicationType(item);
|
|
70
77
|
return applyTransform(response.data, [snakeToCamel()]);
|
|
@@ -74,9 +81,15 @@ const addCommunication = async ({ itemInstance }) => {
|
|
|
74
81
|
};
|
|
75
82
|
|
|
76
83
|
const patchCommunication = async ({ changes, id }) => {
|
|
77
|
-
const body = applyTransform(changes, [
|
|
84
|
+
const body = applyTransform(changes, [
|
|
85
|
+
sanitize(fieldsToSend),
|
|
86
|
+
camelToSnake(),
|
|
87
|
+
]);
|
|
78
88
|
try {
|
|
79
|
-
const response = await communicationService.patchCommunicationType(
|
|
89
|
+
const response = await communicationService.patchCommunicationType(
|
|
90
|
+
id,
|
|
91
|
+
body,
|
|
92
|
+
);
|
|
80
93
|
return applyTransform(response.data, [snakeToCamel()]);
|
|
81
94
|
} catch (err) {
|
|
82
95
|
throw applyTransform(err, [notify]);
|
|
@@ -84,9 +97,15 @@ const patchCommunication = async ({ changes, id }) => {
|
|
|
84
97
|
};
|
|
85
98
|
|
|
86
99
|
const updateCommunication = async ({ itemInstance, itemId: id }) => {
|
|
87
|
-
const item = applyTransform(itemInstance, [
|
|
100
|
+
const item = applyTransform(itemInstance, [
|
|
101
|
+
sanitize(fieldsToSend),
|
|
102
|
+
camelToSnake(),
|
|
103
|
+
]);
|
|
88
104
|
try {
|
|
89
|
-
const response = await communicationService.updateCommunicationType(
|
|
105
|
+
const response = await communicationService.updateCommunicationType(
|
|
106
|
+
id,
|
|
107
|
+
item,
|
|
108
|
+
);
|
|
90
109
|
return applyTransform(response.data, [snakeToCamel()]);
|
|
91
110
|
} catch (err) {
|
|
92
111
|
throw applyTransform(err, [notify]);
|
|
@@ -17,7 +17,11 @@ import applyTransform, {
|
|
|
17
17
|
const instance = getDefaultInstance();
|
|
18
18
|
const configuration = getDefaultOpenAPIConfig();
|
|
19
19
|
|
|
20
|
-
const configurationService = new SystemSettingServiceApiFactory(
|
|
20
|
+
const configurationService = new SystemSettingServiceApiFactory(
|
|
21
|
+
configuration,
|
|
22
|
+
'',
|
|
23
|
+
instance,
|
|
24
|
+
);
|
|
21
25
|
|
|
22
26
|
const getList = async (params) => {
|
|
23
27
|
const { page, size, search, sort, fields, name } = applyTransform(params, [
|
|
@@ -59,7 +63,10 @@ const get = async ({ itemId: id }) => {
|
|
|
59
63
|
const fieldsToSend = ['id', 'name', 'value'];
|
|
60
64
|
|
|
61
65
|
const add = async ({ itemInstance }) => {
|
|
62
|
-
const item = applyTransform(itemInstance, [
|
|
66
|
+
const item = applyTransform(itemInstance, [
|
|
67
|
+
sanitize(fieldsToSend),
|
|
68
|
+
camelToSnake(),
|
|
69
|
+
]);
|
|
63
70
|
try {
|
|
64
71
|
const response = await configurationService.createSystemSetting(item);
|
|
65
72
|
return applyTransform(response.data, [snakeToCamel()]);
|
|
@@ -69,7 +76,10 @@ const add = async ({ itemInstance }) => {
|
|
|
69
76
|
};
|
|
70
77
|
|
|
71
78
|
const update = async ({ itemInstance, itemId: id }) => {
|
|
72
|
-
const item = applyTransform(itemInstance, [
|
|
79
|
+
const item = applyTransform(itemInstance, [
|
|
80
|
+
sanitize(fieldsToSend),
|
|
81
|
+
camelToSnake(),
|
|
82
|
+
]);
|
|
73
83
|
try {
|
|
74
84
|
const response = await configurationService.updateSystemSetting(id, item);
|
|
75
85
|
return applyTransform(response.data, [snakeToCamel()]);
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
EngineRoutingSchemaType,
|
|
3
|
+
RoutingSchemaServiceApiFactory,
|
|
4
|
+
} from 'webitel-sdk';
|
|
2
5
|
import {
|
|
3
6
|
getDefaultGetListResponse,
|
|
4
7
|
getDefaultGetParams,
|
|
@@ -18,7 +21,11 @@ import applyTransform, {
|
|
|
18
21
|
const instance = getDefaultInstance();
|
|
19
22
|
const configuration = getDefaultOpenAPIConfig();
|
|
20
23
|
|
|
21
|
-
const flowService = new RoutingSchemaServiceApiFactory(
|
|
24
|
+
const flowService = new RoutingSchemaServiceApiFactory(
|
|
25
|
+
configuration,
|
|
26
|
+
'',
|
|
27
|
+
instance,
|
|
28
|
+
);
|
|
22
29
|
|
|
23
30
|
/*
|
|
24
31
|
CONVERT "SCHEMA" FIELD TO JSON TO PREVENT ITS CHANGE
|
|
@@ -39,18 +46,21 @@ const getFlowList = async (params) => {
|
|
|
39
46
|
};
|
|
40
47
|
|
|
41
48
|
if (paramsCopy.type) {
|
|
42
|
-
const _type = Array.isArray(paramsCopy.type)
|
|
49
|
+
const _type = Array.isArray(paramsCopy.type)
|
|
50
|
+
? paramsCopy.type
|
|
51
|
+
: [paramsCopy.type];
|
|
43
52
|
if (!paramsCopy.type.includes(EngineRoutingSchemaType.Default)) {
|
|
44
53
|
_type.push(EngineRoutingSchemaType.Default);
|
|
45
54
|
}
|
|
46
55
|
paramsCopy.type = _type;
|
|
47
56
|
}
|
|
48
57
|
|
|
49
|
-
const { page, size, search, sort, fields, id, name, type, tags } =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
58
|
+
const { page, size, search, sort, fields, id, name, type, tags } =
|
|
59
|
+
applyTransform(paramsCopy, [
|
|
60
|
+
merge(getDefaultGetParams()),
|
|
61
|
+
starToSearch('search'),
|
|
62
|
+
camelToSnake(doNotConvertKeys),
|
|
63
|
+
]);
|
|
54
64
|
|
|
55
65
|
try {
|
|
56
66
|
const response = await flowService.searchRoutingSchema(
|
|
@@ -107,7 +117,8 @@ const getFlow = async ({ itemId: id }) => {
|
|
|
107
117
|
|
|
108
118
|
const preRequestHandler = (item) => ({
|
|
109
119
|
...item,
|
|
110
|
-
schema:
|
|
120
|
+
schema:
|
|
121
|
+
typeof item.schema === 'string' ? JSON.parse(item.schema) : item.schema,
|
|
111
122
|
});
|
|
112
123
|
|
|
113
124
|
const addFlow = async ({ itemInstance }) => {
|
|
@@ -105,7 +105,10 @@ const fieldsToSend = [
|
|
|
105
105
|
];
|
|
106
106
|
|
|
107
107
|
const addGateway = async ({ itemInstance }) => {
|
|
108
|
-
const item = applyTransform(itemInstance, [
|
|
108
|
+
const item = applyTransform(itemInstance, [
|
|
109
|
+
sanitize(fieldsToSend),
|
|
110
|
+
camelToSnake(),
|
|
111
|
+
]);
|
|
109
112
|
try {
|
|
110
113
|
const response = await instance.post(baseUrl, item);
|
|
111
114
|
return applyTransform(response.data, [snakeToCamel()]);
|
|
@@ -114,7 +117,10 @@ const addGateway = async ({ itemInstance }) => {
|
|
|
114
117
|
}
|
|
115
118
|
};
|
|
116
119
|
const updateGateway = async ({ itemInstance, itemId: id }) => {
|
|
117
|
-
const item = applyTransform(itemInstance, [
|
|
120
|
+
const item = applyTransform(itemInstance, [
|
|
121
|
+
sanitize(fieldsToSend),
|
|
122
|
+
camelToSnake(),
|
|
123
|
+
]);
|
|
118
124
|
|
|
119
125
|
const url = `${baseUrl}/${id}`;
|
|
120
126
|
try {
|
|
@@ -126,7 +132,10 @@ const updateGateway = async ({ itemInstance, itemId: id }) => {
|
|
|
126
132
|
};
|
|
127
133
|
|
|
128
134
|
const patchGateway = async ({ changes, id }) => {
|
|
129
|
-
const body = applyTransform(changes, [
|
|
135
|
+
const body = applyTransform(changes, [
|
|
136
|
+
sanitize(fieldsToSend),
|
|
137
|
+
camelToSnake(),
|
|
138
|
+
]);
|
|
130
139
|
const url = `${baseUrl}/${id}`;
|
|
131
140
|
try {
|
|
132
141
|
const response = await instance.patch(url, body);
|
|
@@ -33,7 +33,14 @@ const getBlacklistList = async (params) => {
|
|
|
33
33
|
]);
|
|
34
34
|
|
|
35
35
|
try {
|
|
36
|
-
const response = await listService.searchList(
|
|
36
|
+
const response = await listService.searchList(
|
|
37
|
+
page,
|
|
38
|
+
size,
|
|
39
|
+
search,
|
|
40
|
+
sort,
|
|
41
|
+
fields,
|
|
42
|
+
id,
|
|
43
|
+
);
|
|
37
44
|
const { items, next } = applyTransform(response.data, [
|
|
38
45
|
snakeToCamel(),
|
|
39
46
|
merge(getDefaultGetListResponse()),
|
|
@@ -59,7 +66,10 @@ const getBlacklist = async ({ itemId: id }) => {
|
|
|
59
66
|
const fieldsToSend = ['name', 'description'];
|
|
60
67
|
|
|
61
68
|
const addBlacklist = async ({ itemInstance }) => {
|
|
62
|
-
const item = applyTransform(itemInstance, [
|
|
69
|
+
const item = applyTransform(itemInstance, [
|
|
70
|
+
sanitize(fieldsToSend),
|
|
71
|
+
camelToSnake(),
|
|
72
|
+
]);
|
|
63
73
|
try {
|
|
64
74
|
const response = await listService.createList(item);
|
|
65
75
|
return applyTransform(response.data, [snakeToCamel()]);
|
|
@@ -69,7 +79,10 @@ const addBlacklist = async ({ itemInstance }) => {
|
|
|
69
79
|
};
|
|
70
80
|
|
|
71
81
|
const updateBlacklist = async ({ itemInstance, itemId: id }) => {
|
|
72
|
-
const item = applyTransform(itemInstance, [
|
|
82
|
+
const item = applyTransform(itemInstance, [
|
|
83
|
+
sanitize(fieldsToSend),
|
|
84
|
+
camelToSnake(),
|
|
85
|
+
]);
|
|
73
86
|
try {
|
|
74
87
|
const response = await listService.updateList(id, item);
|
|
75
88
|
return applyTransform(response.data, [snakeToCamel()]);
|