@webitel/api-services 26.12.22 → 26.12.24
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 +1 -1
- package/src/api/clients/_shared/__tests__/generatePermissionsApi.spec.ts +37 -0
- package/src/api/clients/_shared/generatePermissionsApi.ts +26 -1
- package/src/api/clients/emailProfiles/emailProfiles.ts +6 -19
- package/src/api/clients/importTemplates/importTemplates.ts +36 -21
- package/src/api/clients/index.ts +3 -1
- package/src/api/clients/logs/logs.ts +56 -94
- package/src/api/clients/objectClasses/objectClasses.ts +211 -0
- package/src/api/clients/queues/queues.ts +2 -2
- package/src/api/clients/ringtones/ringtones.ts +30 -0
- package/src/api/clients/roles/roles.ts +227 -0
- package/src/api/clients/schemaVariables/schemaVariables.ts +21 -17
- package/src/api/clients/storagePolicies/storagePolicies.ts +24 -36
- package/src/api/clients/triggers/triggerJobs.ts +22 -12
- package/src/api/clients/triggers/triggers.ts +12 -37
- package/src/api/clients/userSettings/userSettings.ts +21 -0
- package/src/enums/AccessMode/AccessMode.ts +8 -0
- package/src/enums/AccessRuleColumn/AccessRuleColumn.ts +11 -0
- package/src/enums/AccessRuleName/AccessRuleName.ts +10 -0
- package/src/enums/WebitelApplications/AdminSections.ts +45 -0
- package/src/enums/WebitelApplications/AuditorSections.ts +6 -0
- package/src/enums/WebitelApplications/CrmSections.ts +21 -0
- package/src/enums/WebitelApplications/SupervisorSections.ts +8 -0
- package/src/enums/WebitelApplications/WfmSections.ts +12 -0
- package/src/enums/WebitelApplications/WtApplication.ts +13 -0
- package/src/enums/index.ts +18 -0
- package/src/gen/_models/webitelKbTreeNode.ts +3 -0
- package/src/gen-wire/_models/webitelKbTreeNode.ts +3 -0
- package/src/gen-wire/access-store/access-store.msw.ts +491 -0
- package/src/gen-wire/agent-absence-service/agent-absence-service.msw.ts +985 -0
- package/src/gen-wire/agent-chat-service/agent-chat-service.msw.ts +986 -0
- package/src/gen-wire/agent-chat-tag-service/agent-chat-tag-service.msw.ts +76 -0
- package/src/gen-wire/agent-pause-cause-service/agent-pause-cause-service.msw.ts +1029 -0
- package/src/gen-wire/agent-service/agent-service.msw.ts +4444 -0
- package/src/gen-wire/agent-skill-service/agent-skill-service.msw.ts +1347 -0
- package/src/gen-wire/agent-team-service/agent-team-service.msw.ts +875 -0
- package/src/gen-wire/agent-working-conditions-service/agent-working-conditions-service.msw.ts +196 -0
- package/src/gen-wire/agent-working-schedule-service/agent-working-schedule-service.msw.ts +846 -0
- package/src/gen-wire/articles/articles.msw.ts +5132 -0
- package/src/gen-wire/articles/articles.zod.ts +10 -0
- package/src/gen-wire/attachments/attachments.msw.ts +387 -0
- package/src/gen-wire/audit-form-service/audit-form-service.msw.ts +3169 -0
- package/src/gen-wire/auth/auth.msw.ts +801 -0
- package/src/gen-wire/backend-profile-service/backend-profile-service.msw.ts +1131 -0
- package/src/gen-wire/bucket-service/bucket-service.msw.ts +330 -0
- package/src/gen-wire/calendar-service/calendar-service.msw.ts +1526 -0
- package/src/gen-wire/call-service/call-service.msw.ts +6221 -0
- package/src/gen-wire/case-articles/case-articles.msw.ts +656 -0
- package/src/gen-wire/case-comments/case-comments.msw.ts +1164 -0
- package/src/gen-wire/case-communications/case-communications.msw.ts +279 -0
- package/src/gen-wire/case-files/case-files.msw.ts +295 -0
- package/src/gen-wire/case-links/case-links.msw.ts +1002 -0
- package/src/gen-wire/case-timeline/case-timeline.msw.ts +1012 -0
- package/src/gen-wire/cases/cases.msw.ts +14299 -0
- package/src/gen-wire/cases-chat-catalog/cases-chat-catalog.msw.ts +992 -0
- package/src/gen-wire/catalogs/catalogs.msw.ts +4088 -0
- package/src/gen-wire/classes/classes.msw.ts +309 -0
- package/src/gen-wire/close-reason-groups/close-reason-groups.msw.ts +803 -0
- package/src/gen-wire/close-reasons/close-reasons.msw.ts +845 -0
- package/src/gen-wire/cognitive-profile-service/cognitive-profile-service.msw.ts +942 -0
- package/src/gen-wire/comments/comments.msw.ts +900 -0
- package/src/gen-wire/communication-type-service/communication-type-service.msw.ts +549 -0
- package/src/gen-wire/config-service/config-service.msw.ts +687 -0
- package/src/gen-wire/contact-groups/contact-groups.msw.ts +1494 -0
- package/src/gen-wire/contact-linking-service/contact-linking-service.msw.ts +96 -0
- package/src/gen-wire/contacts/contacts.msw.ts +12671 -0
- package/src/gen-wire/contacts-chat-catalog/contacts-chat-catalog.msw.ts +1571 -0
- package/src/gen-wire/customer/customer.msw.ts +1376 -0
- package/src/gen-wire/customers/customers.msw.ts +2279 -0
- package/src/gen-wire/devices/devices.msw.ts +2119 -0
- package/src/gen-wire/dictionaries/dictionaries.msw.ts +7852 -0
- package/src/gen-wire/domains/domains.msw.ts +218 -0
- package/src/gen-wire/dynamic-conditions/dynamic-conditions.msw.ts +1229 -0
- package/src/gen-wire/dynamic-groups/dynamic-groups.msw.ts +1685 -0
- package/src/gen-wire/email-profile-service/email-profile-service.msw.ts +1832 -0
- package/src/gen-wire/emails/emails.msw.ts +1627 -0
- package/src/gen-wire/embedding-models/embedding-models.msw.ts +1048 -0
- package/src/gen-wire/extensions/extensions.msw.ts +5062 -0
- package/src/gen-wire/feedback-service/feedback-service.msw.ts +149 -0
- package/src/gen-wire/file-policies-service/file-policies-service.msw.ts +1310 -0
- package/src/gen-wire/file-service/file-service.msw.ts +1442 -0
- package/src/gen-wire/file-transcript-service/file-transcript-service.msw.ts +290 -0
- package/src/gen-wire/forecast-calculation-service/forecast-calculation-service.msw.ts +837 -0
- package/src/gen-wire/ftsservice/ftsservice.msw.ts +90 -0
- package/src/gen-wire/groups/groups.msw.ts +5778 -0
- package/src/gen-wire/im-service-provider-v1-telegrambotservice/im-service-provider-v1-telegrambotservice.msw.ts +390 -0
- package/src/gen-wire/imclients/imclients.msw.ts +541 -0
- package/src/gen-wire/import-template-service/import-template-service.msw.ts +603 -0
- package/src/gen-wire/index.msw.ts +152 -0
- package/src/gen-wire/index.ts +1 -0
- package/src/gen-wire/knowledgebase-search/knowledgebase-search.msw.ts +94 -0
- package/src/gen-wire/labels/labels.msw.ts +784 -0
- package/src/gen-wire/languages/languages.msw.ts +1504 -0
- package/src/gen-wire/ldap/ldap.msw.ts +6443 -0
- package/src/gen-wire/list-service/list-service.msw.ts +1359 -0
- package/src/gen-wire/logger-service/logger-service.msw.ts +620 -0
- package/src/gen-wire/managers/managers.msw.ts +1508 -0
- package/src/gen-wire/media-file-service/media-file-service.msw.ts +429 -0
- package/src/gen-wire/meeting-service/meeting-service.msw.ts +179 -0
- package/src/gen-wire/member-service/member-service.msw.ts +5742 -0
- package/src/gen-wire/messages/messages.msw.ts +3663 -0
- package/src/gen-wire/oauth2-federation/oauth2-federation.msw.ts +1446 -0
- package/src/gen-wire/online-skills/online-skills.msw.ts +882 -0
- package/src/gen-wire/outbound-resource-group-service/outbound-resource-group-service.msw.ts +1417 -0
- package/src/gen-wire/outbound-resource-service/outbound-resource-service.msw.ts +2093 -0
- package/src/gen-wire/pause-template-service/pause-template-service.msw.ts +823 -0
- package/src/gen-wire/pdf-service/pdf-service.msw.ts +851 -0
- package/src/gen-wire/permissions/permissions.msw.ts +98 -0
- package/src/gen-wire/phones/phones.msw.ts +1627 -0
- package/src/gen-wire/photos/photos.msw.ts +1369 -0
- package/src/gen-wire/presence/presence.msw.ts +485 -0
- package/src/gen-wire/preset-query-service/preset-query-service.msw.ts +522 -0
- package/src/gen-wire/priorities/priorities.msw.ts +719 -0
- package/src/gen-wire/queue-bucket-service/queue-bucket-service.msw.ts +492 -0
- package/src/gen-wire/queue-hook-service/queue-hook-service.msw.ts +582 -0
- package/src/gen-wire/queue-resources-service/queue-resources-service.msw.ts +475 -0
- package/src/gen-wire/queue-service/queue-service.msw.ts +3759 -0
- package/src/gen-wire/queue-skill-service/queue-skill-service.msw.ts +672 -0
- package/src/gen-wire/quick-replies-service/quick-replies-service.msw.ts +1254 -0
- package/src/gen-wire/records/records.msw.ts +1847 -0
- package/src/gen-wire/region-service/region-service.msw.ts +528 -0
- package/src/gen-wire/related-cases/related-cases.msw.ts +1428 -0
- package/src/gen-wire/retrieval/retrieval.msw.ts +805 -0
- package/src/gen-wire/routing-chat-plan-service/routing-chat-plan-service.msw.ts +522 -0
- package/src/gen-wire/routing-outbound-call-service/routing-outbound-call-service.msw.ts +1057 -0
- package/src/gen-wire/routing-schema-service/routing-schema-service.msw.ts +1045 -0
- package/src/gen-wire/routing-variable-service/routing-variable-service.msw.ts +374 -0
- package/src/gen-wire/schema-variables-service/schema-variables-service.msw.ts +333 -0
- package/src/gen-wire/services/services.msw.ts +2921 -0
- package/src/gen-wire/shift-template-service/shift-template-service.msw.ts +727 -0
- package/src/gen-wire/skill-service/skill-service.msw.ts +1299 -0
- package/src/gen-wire/slaconditions/slaconditions.msw.ts +1087 -0
- package/src/gen-wire/slas/slas.msw.ts +1145 -0
- package/src/gen-wire/sources/sources.msw.ts +689 -0
- package/src/gen-wire/spaces/spaces.msw.ts +2456 -0
- package/src/gen-wire/status-conditions/status-conditions.msw.ts +897 -0
- package/src/gen-wire/statuses/statuses.msw.ts +791 -0
- package/src/gen-wire/system-setting-service/system-setting-service.msw.ts +343 -0
- package/src/gen-wire/tags/tags.msw.ts +133 -0
- package/src/gen-wire/team-chat-tag-service/team-chat-tag-service.msw.ts +214 -0
- package/src/gen-wire/team-hook-service/team-hook-service.msw.ts +552 -0
- package/src/gen-wire/team-trigger-service/team-trigger-service.msw.ts +669 -0
- package/src/gen-wire/timeline/timeline.msw.ts +1109 -0
- package/src/gen-wire/timezones/timezones.msw.ts +1523 -0
- package/src/gen-wire/trigger-service/trigger-service.msw.ts +1113 -0
- package/src/gen-wire/two-factor-authentication/two-factor-authentication.msw.ts +160 -0
- package/src/gen-wire/types/types.msw.ts +1696 -0
- package/src/gen-wire/user-access-tokens/user-access-tokens.msw.ts +1357 -0
- package/src/gen-wire/user-helper-service/user-helper-service.msw.ts +472 -0
- package/src/gen-wire/users/users.msw.ts +5595 -0
- package/src/gen-wire/variables/variables.msw.ts +1189 -0
- package/src/gen-wire/versions/versions.msw.ts +441 -0
- package/src/gen-wire/web-hook-service/web-hook-service.msw.ts +1128 -0
- package/src/gen-wire/webitel-im-api-gateway-v1-account/webitel-im-api-gateway-v1-account.msw.ts +986 -0
- package/src/gen-wire/webitel-im-api-gateway-v1-bots/webitel-im-api-gateway-v1-bots.msw.ts +253 -0
- package/src/gen-wire/webitel-im-api-gateway-v1-contacts/webitel-im-api-gateway-v1-contacts.msw.ts +246 -0
- package/src/gen-wire/webitel-im-api-gateway-v1-contactsettingsmanagement/webitel-im-api-gateway-v1-contactsettingsmanagement.msw.ts +148 -0
- package/src/gen-wire/webitel-im-api-gateway-v1-message/webitel-im-api-gateway-v1-message.msw.ts +1289 -0
- package/src/gen-wire/webitel-im-api-gateway-v1-messagehistory/webitel-im-api-gateway-v1-messagehistory.msw.ts +7390 -0
- package/src/gen-wire/webitel-im-api-gateway-v1-threadmanagement/webitel-im-api-gateway-v1-threadmanagement.msw.ts +15159 -0
- package/src/gen-wire/webitel-im-api-gateway-v1-threadpermission/webitel-im-api-gateway-v1-threadpermission.msw.ts +220 -0
- package/src/gen-wire/webitel-im-api-gateway-v1-threadpreviewservice/webitel-im-api-gateway-v1-threadpreviewservice.msw.ts +777 -0
- package/src/gen-wire/webitel-im-api-gateway-v1-threadtagmanagement/webitel-im-api-gateway-v1-threadtagmanagement.msw.ts +315 -0
- package/src/gen-wire/webitel-im-api-gateway-v1-updates/webitel-im-api-gateway-v1-updates.msw.ts +7922 -0
- package/src/gen-wire/webitel-im-api-provider-v1-facebookservice/webitel-im-api-provider-v1-facebookservice.msw.ts +504 -0
- package/src/gen-wire/webitel-im-api-provider-v1-instagramservice/webitel-im-api-provider-v1-instagramservice.msw.ts +341 -0
- package/src/gen-wire/webitel-im-api-provider-v1-metaappservice/webitel-im-api-provider-v1-metaappservice.msw.ts +395 -0
- package/src/gen-wire/webitel-im-api-provider-v1-metaoauthservice/webitel-im-api-provider-v1-metaoauthservice.msw.ts +170 -0
- package/src/gen-wire/webitel-im-api-provider-v1-viberbmservice/webitel-im-api-provider-v1-viberbmservice.msw.ts +426 -0
- package/src/gen-wire/webitel-im-api-provider-v1-whatsappservice/webitel-im-api-provider-v1-whatsappservice.msw.ts +383 -0
- package/src/gen-wire/webitel-im-provider-v1-customservice/webitel-im-provider-v1-customservice.msw.ts +586 -0
- package/src/gen-wire/webitel-im-provider-v1-facebookservice/webitel-im-provider-v1-facebookservice.msw.ts +610 -0
- package/src/gen-wire/webitel-im-provider-v1-gateservice/webitel-im-provider-v1-gateservice.msw.ts +183 -0
- package/src/gen-wire/webitel-im-provider-v1-gatetemplateservice/webitel-im-provider-v1-gatetemplateservice.msw.ts +195 -0
- package/src/gen-wire/webitel-im-provider-v1-instagramservice/webitel-im-provider-v1-instagramservice.msw.ts +442 -0
- package/src/gen-wire/webitel-im-provider-v1-metaappservice/webitel-im-provider-v1-metaappservice.msw.ts +514 -0
- package/src/gen-wire/webitel-im-provider-v1-metaoauthservice/webitel-im-provider-v1-metaoauthservice.msw.ts +166 -0
- package/src/gen-wire/webitel-im-provider-v1-providermessageservice/webitel-im-provider-v1-providermessageservice.msw.ts +466 -0
- package/src/gen-wire/webitel-im-provider-v1-viberbmservice/webitel-im-provider-v1-viberbmservice.msw.ts +662 -0
- package/src/gen-wire/webitel-im-provider-v1-viberservice/webitel-im-provider-v1-viberservice.msw.ts +550 -0
- package/src/gen-wire/webitel-im-provider-v1-whatsappservice/webitel-im-provider-v1-whatsappservice.msw.ts +573 -0
- package/src/gen-wire/working-condition-service/working-condition-service.msw.ts +925 -0
- package/src/gen-wire/working-schedule-service/working-schedule-service.msw.ts +1450 -0
- package/src/scripts/applicationsAccess/ApplicationsAccess.ts +372 -0
- package/src/scripts/applicationsAccess/__tests__/ApplicationsAccess.spec.ts +43 -0
- package/src/scripts/convertDuration/__tests__/convertDurationWithMilliseconds.spec.ts +19 -0
- package/src/scripts/convertDuration/convertDurationWithMilliseconds.ts +18 -0
- package/src/scripts/index.ts +12 -0
- package/src/scripts/resolveGrants/resolveGrants.ts +42 -0
- package/src/validations/changelog/__tests__/changelog.validations.spec.ts +41 -0
- package/src/validations/changelog/changelog.validations.ts +22 -0
- package/src/validations/emailProfile/__tests__/emailProfile.validations.spec.ts +105 -0
- package/src/validations/emailProfile/emailProfile.validations.ts +113 -0
- package/src/validations/importTemplate/__tests__/importTemplate.validations.spec.ts +77 -0
- package/src/validations/importTemplate/importTemplate.validations.ts +56 -0
- package/src/validations/index.ts +7 -0
- package/src/validations/role/__tests__/role.validations.spec.ts +53 -0
- package/src/validations/role/role.validations.ts +42 -0
- package/src/validations/schemaVariable/__tests__/schemaVariable.validations.spec.ts +50 -0
- package/src/validations/schemaVariable/schemaVariable.validations.ts +35 -0
- package/src/validations/storagePolicy/__tests__/storagePolicy.validations.spec.ts +52 -0
- package/src/validations/storagePolicy/storagePolicy.validations.ts +36 -0
- package/src/validations/trigger/__tests__/trigger.validations.spec.ts +92 -0
- package/src/validations/trigger/trigger.validations.ts +82 -0
- package/types/.tsbuildinfo +1 -1
- package/types/api/clients/_shared/generatePermissionsApi.d.ts +31 -0
- package/types/api/clients/importTemplates/importTemplates.d.ts +2 -2
- package/types/api/clients/index.d.ts +3 -0
- package/types/api/clients/logs/logs.d.ts +2 -2
- package/types/api/clients/objectClasses/objectClasses.d.ts +27 -0
- package/types/api/clients/ringtones/ringtones.d.ts +8 -0
- package/types/api/clients/roles/roles.d.ts +19 -0
- package/types/api/clients/userSettings/userSettings.d.ts +5 -0
- package/types/enums/AccessMode/AccessMode.d.ts +7 -0
- package/types/enums/AccessRuleColumn/AccessRuleColumn.d.ts +8 -0
- package/types/enums/AccessRuleName/AccessRuleName.d.ts +8 -0
- package/types/enums/WebitelApplications/AdminSections.d.ts +44 -0
- package/types/enums/WebitelApplications/AuditorSections.d.ts +4 -0
- package/types/enums/WebitelApplications/CrmSections.d.ts +16 -0
- package/types/enums/WebitelApplications/SupervisorSections.d.ts +6 -0
- package/types/enums/WebitelApplications/WfmSections.d.ts +9 -0
- package/types/enums/WebitelApplications/WtApplication.d.ts +12 -0
- package/types/enums/index.d.ts +10 -1
- package/types/gen/_models/webitelKbTreeNode.d.ts +3 -0
- package/types/gen-wire/_models/webitelKbTreeNode.d.ts +3 -0
- package/types/gen-wire/access-store/access-store.msw.d.ts +12 -0
- package/types/gen-wire/agent-absence-service/agent-absence-service.msw.d.ts +18 -0
- package/types/gen-wire/agent-chat-service/agent-chat-service.msw.d.ts +10 -0
- package/types/gen-wire/agent-chat-tag-service/agent-chat-tag-service.msw.d.ts +6 -0
- package/types/gen-wire/agent-pause-cause-service/agent-pause-cause-service.msw.d.ts +16 -0
- package/types/gen-wire/agent-service/agent-service.msw.d.ts +44 -0
- package/types/gen-wire/agent-skill-service/agent-skill-service.msw.d.ts +24 -0
- package/types/gen-wire/agent-team-service/agent-team-service.msw.d.ts +14 -0
- package/types/gen-wire/agent-working-conditions-service/agent-working-conditions-service.msw.d.ts +8 -0
- package/types/gen-wire/agent-working-schedule-service/agent-working-schedule-service.msw.d.ts +8 -0
- package/types/gen-wire/articles/articles.msw.d.ts +44 -0
- package/types/gen-wire/articles/articles.zod.d.ts +7 -0
- package/types/gen-wire/attachments/attachments.msw.d.ts +10 -0
- package/types/gen-wire/audit-form-service/audit-form-service.msw.d.ts +26 -0
- package/types/gen-wire/auth/auth.msw.d.ts +10 -0
- package/types/gen-wire/backend-profile-service/backend-profile-service.msw.d.ts +16 -0
- package/types/gen-wire/bucket-service/bucket-service.msw.d.ts +14 -0
- package/types/gen-wire/calendar-service/calendar-service.msw.d.ts +16 -0
- package/types/gen-wire/call-service/call-service.msw.d.ts +44 -0
- package/types/gen-wire/case-articles/case-articles.msw.d.ts +12 -0
- package/types/gen-wire/case-comments/case-comments.msw.d.ts +16 -0
- package/types/gen-wire/case-communications/case-communications.msw.d.ts +10 -0
- package/types/gen-wire/case-files/case-files.msw.d.ts +8 -0
- package/types/gen-wire/case-links/case-links.msw.d.ts +16 -0
- package/types/gen-wire/case-timeline/case-timeline.msw.d.ts +10 -0
- package/types/gen-wire/cases/cases.msw.d.ts +22 -0
- package/types/gen-wire/cases-chat-catalog/cases-chat-catalog.msw.d.ts +6 -0
- package/types/gen-wire/catalogs/catalogs.msw.d.ts +16 -0
- package/types/gen-wire/classes/classes.msw.d.ts +12 -0
- package/types/gen-wire/close-reason-groups/close-reason-groups.msw.d.ts +16 -0
- package/types/gen-wire/close-reasons/close-reasons.msw.d.ts +16 -0
- package/types/gen-wire/cognitive-profile-service/cognitive-profile-service.msw.d.ts +18 -0
- package/types/gen-wire/comments/comments.msw.d.ts +12 -0
- package/types/gen-wire/communication-type-service/communication-type-service.msw.d.ts +16 -0
- package/types/gen-wire/config-service/config-service.msw.d.ts +18 -0
- package/types/gen-wire/config-service/config-service.zod.d.ts +4 -4
- package/types/gen-wire/contact-groups/contact-groups.msw.d.ts +20 -0
- package/types/gen-wire/contact-linking-service/contact-linking-service.msw.d.ts +8 -0
- package/types/gen-wire/contacts/contacts.msw.d.ts +16 -0
- package/types/gen-wire/contacts-chat-catalog/contacts-chat-catalog.msw.d.ts +8 -0
- package/types/gen-wire/customer/customer.msw.d.ts +12 -0
- package/types/gen-wire/customers/customers.msw.d.ts +18 -0
- package/types/gen-wire/devices/devices.msw.d.ts +20 -0
- package/types/gen-wire/dictionaries/dictionaries.msw.d.ts +32 -0
- package/types/gen-wire/domains/domains.msw.d.ts +8 -0
- package/types/gen-wire/dynamic-conditions/dynamic-conditions.msw.d.ts +16 -0
- package/types/gen-wire/dynamic-groups/dynamic-groups.msw.d.ts +16 -0
- package/types/gen-wire/email-profile-service/email-profile-service.msw.d.ts +20 -0
- package/types/gen-wire/emails/emails.msw.d.ts +20 -0
- package/types/gen-wire/embedding-models/embedding-models.msw.d.ts +18 -0
- package/types/gen-wire/extensions/extensions.msw.d.ts +16 -0
- package/types/gen-wire/feedback-service/feedback-service.msw.d.ts +8 -0
- package/types/gen-wire/file-policies-service/file-policies-service.msw.d.ts +22 -0
- package/types/gen-wire/file-service/file-service.msw.d.ts +26 -0
- package/types/gen-wire/file-transcript-service/file-transcript-service.msw.d.ts +12 -0
- package/types/gen-wire/forecast-calculation-service/forecast-calculation-service.msw.d.ts +16 -0
- package/types/gen-wire/ftsservice/ftsservice.msw.d.ts +6 -0
- package/types/gen-wire/groups/groups.msw.d.ts +20 -0
- package/types/gen-wire/im-service-provider-v1-telegrambotservice/im-service-provider-v1-telegrambotservice.msw.d.ts +12 -0
- package/types/gen-wire/imclients/imclients.msw.d.ts +10 -0
- package/types/gen-wire/import-template-service/import-template-service.msw.d.ts +16 -0
- package/types/gen-wire/index.d.ts +1 -1
- package/types/gen-wire/index.msw.d.ts +152 -0
- package/types/gen-wire/knowledgebase-search/knowledgebase-search.msw.d.ts +6 -0
- package/types/gen-wire/labels/labels.msw.d.ts +14 -0
- package/types/gen-wire/languages/languages.msw.d.ts +18 -0
- package/types/gen-wire/ldap/ldap.msw.d.ts +46 -0
- package/types/gen-wire/list-service/list-service.msw.d.ts +26 -0
- package/types/gen-wire/logger-service/logger-service.msw.d.ts +12 -0
- package/types/gen-wire/logger-service/logger-service.zod.d.ts +4 -4
- package/types/gen-wire/managers/managers.msw.d.ts +20 -0
- package/types/gen-wire/media-file-service/media-file-service.msw.d.ts +10 -0
- package/types/gen-wire/meeting-service/meeting-service.msw.d.ts +10 -0
- package/types/gen-wire/member-service/member-service.msw.d.ts +54 -0
- package/types/gen-wire/messages/messages.msw.d.ts +16 -0
- package/types/gen-wire/oauth2-federation/oauth2-federation.msw.d.ts +18 -0
- package/types/gen-wire/online-skills/online-skills.msw.d.ts +16 -0
- package/types/gen-wire/outbound-resource-group-service/outbound-resource-group-service.msw.d.ts +24 -0
- package/types/gen-wire/outbound-resource-service/outbound-resource-service.msw.d.ts +30 -0
- package/types/gen-wire/pause-template-service/pause-template-service.msw.d.ts +14 -0
- package/types/gen-wire/pdf-service/pdf-service.msw.d.ts +22 -0
- package/types/gen-wire/permissions/permissions.msw.d.ts +6 -0
- package/types/gen-wire/phones/phones.msw.d.ts +20 -0
- package/types/gen-wire/photos/photos.msw.d.ts +20 -0
- package/types/gen-wire/presence/presence.msw.d.ts +8 -0
- package/types/gen-wire/preset-query-service/preset-query-service.msw.d.ts +16 -0
- package/types/gen-wire/priorities/priorities.msw.d.ts +16 -0
- package/types/gen-wire/queue-bucket-service/queue-bucket-service.msw.d.ts +16 -0
- package/types/gen-wire/queue-hook-service/queue-hook-service.msw.d.ts +16 -0
- package/types/gen-wire/queue-resources-service/queue-resources-service.msw.d.ts +14 -0
- package/types/gen-wire/queue-service/queue-service.msw.d.ts +24 -0
- package/types/gen-wire/queue-skill-service/queue-skill-service.msw.d.ts +16 -0
- package/types/gen-wire/quick-replies-service/quick-replies-service.msw.d.ts +16 -0
- package/types/gen-wire/records/records.msw.d.ts +16 -0
- package/types/gen-wire/region-service/region-service.msw.d.ts +16 -0
- package/types/gen-wire/related-cases/related-cases.msw.d.ts +16 -0
- package/types/gen-wire/retrieval/retrieval.msw.d.ts +14 -0
- package/types/gen-wire/routing-chat-plan-service/routing-chat-plan-service.msw.d.ts +16 -0
- package/types/gen-wire/routing-outbound-call-service/routing-outbound-call-service.msw.d.ts +18 -0
- package/types/gen-wire/routing-schema-service/routing-schema-service.msw.d.ts +18 -0
- package/types/gen-wire/routing-variable-service/routing-variable-service.msw.d.ts +14 -0
- package/types/gen-wire/schema-variables-service/schema-variables-service.msw.d.ts +16 -0
- package/types/gen-wire/services/services.msw.d.ts +16 -0
- package/types/gen-wire/shift-template-service/shift-template-service.msw.d.ts +14 -0
- package/types/gen-wire/skill-service/skill-service.msw.d.ts +22 -0
- package/types/gen-wire/slaconditions/slaconditions.msw.d.ts +16 -0
- package/types/gen-wire/slas/slas.msw.d.ts +16 -0
- package/types/gen-wire/sources/sources.msw.d.ts +16 -0
- package/types/gen-wire/spaces/spaces.msw.d.ts +26 -0
- package/types/gen-wire/status-conditions/status-conditions.msw.d.ts +16 -0
- package/types/gen-wire/statuses/statuses.msw.d.ts +16 -0
- package/types/gen-wire/system-setting-service/system-setting-service.msw.d.ts +18 -0
- package/types/gen-wire/tags/tags.msw.d.ts +8 -0
- package/types/gen-wire/team-chat-tag-service/team-chat-tag-service.msw.d.ts +12 -0
- package/types/gen-wire/team-hook-service/team-hook-service.msw.d.ts +16 -0
- package/types/gen-wire/team-trigger-service/team-trigger-service.msw.d.ts +20 -0
- package/types/gen-wire/timeline/timeline.msw.d.ts +10 -0
- package/types/gen-wire/timezones/timezones.msw.d.ts +20 -0
- package/types/gen-wire/trigger-service/trigger-service.msw.d.ts +20 -0
- package/types/gen-wire/two-factor-authentication/two-factor-authentication.msw.d.ts +8 -0
- package/types/gen-wire/types/types.msw.d.ts +8 -0
- package/types/gen-wire/user-access-tokens/user-access-tokens.msw.d.ts +16 -0
- package/types/gen-wire/user-helper-service/user-helper-service.msw.d.ts +10 -0
- package/types/gen-wire/users/users.msw.d.ts +34 -0
- package/types/gen-wire/variables/variables.msw.d.ts +18 -0
- package/types/gen-wire/versions/versions.msw.d.ts +10 -0
- package/types/gen-wire/web-hook-service/web-hook-service.msw.d.ts +16 -0
- package/types/gen-wire/webitel-im-api-gateway-v1-account/webitel-im-api-gateway-v1-account.msw.d.ts +14 -0
- package/types/gen-wire/webitel-im-api-gateway-v1-bots/webitel-im-api-gateway-v1-bots.msw.d.ts +10 -0
- package/types/gen-wire/webitel-im-api-gateway-v1-contacts/webitel-im-api-gateway-v1-contacts.msw.d.ts +6 -0
- package/types/gen-wire/webitel-im-api-gateway-v1-contactsettingsmanagement/webitel-im-api-gateway-v1-contactsettingsmanagement.msw.d.ts +8 -0
- package/types/gen-wire/webitel-im-api-gateway-v1-message/webitel-im-api-gateway-v1-message.msw.d.ts +32 -0
- package/types/gen-wire/webitel-im-api-gateway-v1-messagehistory/webitel-im-api-gateway-v1-messagehistory.msw.d.ts +12 -0
- package/types/gen-wire/webitel-im-api-gateway-v1-threadmanagement/webitel-im-api-gateway-v1-threadmanagement.msw.d.ts +36 -0
- package/types/gen-wire/webitel-im-api-gateway-v1-threadpermission/webitel-im-api-gateway-v1-threadpermission.msw.d.ts +8 -0
- package/types/gen-wire/webitel-im-api-gateway-v1-threadpreviewservice/webitel-im-api-gateway-v1-threadpreviewservice.msw.d.ts +10 -0
- package/types/gen-wire/webitel-im-api-gateway-v1-threadtagmanagement/webitel-im-api-gateway-v1-threadtagmanagement.msw.d.ts +16 -0
- package/types/gen-wire/webitel-im-api-gateway-v1-updates/webitel-im-api-gateway-v1-updates.msw.d.ts +6 -0
- package/types/gen-wire/webitel-im-api-provider-v1-facebookservice/webitel-im-api-provider-v1-facebookservice.msw.d.ts +18 -0
- package/types/gen-wire/webitel-im-api-provider-v1-instagramservice/webitel-im-api-provider-v1-instagramservice.msw.d.ts +10 -0
- package/types/gen-wire/webitel-im-api-provider-v1-metaappservice/webitel-im-api-provider-v1-metaappservice.msw.d.ts +10 -0
- package/types/gen-wire/webitel-im-api-provider-v1-metaoauthservice/webitel-im-api-provider-v1-metaoauthservice.msw.d.ts +8 -0
- package/types/gen-wire/webitel-im-api-provider-v1-viberbmservice/webitel-im-api-provider-v1-viberbmservice.msw.d.ts +12 -0
- package/types/gen-wire/webitel-im-api-provider-v1-whatsappservice/webitel-im-api-provider-v1-whatsappservice.msw.d.ts +10 -0
- package/types/gen-wire/webitel-im-provider-v1-customservice/webitel-im-provider-v1-customservice.msw.d.ts +12 -0
- package/types/gen-wire/webitel-im-provider-v1-facebookservice/webitel-im-provider-v1-facebookservice.msw.d.ts +20 -0
- package/types/gen-wire/webitel-im-provider-v1-gateservice/webitel-im-provider-v1-gateservice.msw.d.ts +6 -0
- package/types/gen-wire/webitel-im-provider-v1-gatetemplateservice/webitel-im-provider-v1-gatetemplateservice.msw.d.ts +10 -0
- package/types/gen-wire/webitel-im-provider-v1-instagramservice/webitel-im-provider-v1-instagramservice.msw.d.ts +12 -0
- package/types/gen-wire/webitel-im-provider-v1-metaappservice/webitel-im-provider-v1-metaappservice.msw.d.ts +12 -0
- package/types/gen-wire/webitel-im-provider-v1-metaoauthservice/webitel-im-provider-v1-metaoauthservice.msw.d.ts +8 -0
- package/types/gen-wire/webitel-im-provider-v1-providermessageservice/webitel-im-provider-v1-providermessageservice.msw.d.ts +22 -0
- package/types/gen-wire/webitel-im-provider-v1-viberbmservice/webitel-im-provider-v1-viberbmservice.msw.d.ts +16 -0
- package/types/gen-wire/webitel-im-provider-v1-viberservice/webitel-im-provider-v1-viberservice.msw.d.ts +12 -0
- package/types/gen-wire/webitel-im-provider-v1-whatsappservice/webitel-im-provider-v1-whatsappservice.msw.d.ts +12 -0
- package/types/gen-wire/working-condition-service/working-condition-service.msw.d.ts +14 -0
- package/types/gen-wire/working-schedule-service/working-schedule-service.msw.d.ts +20 -0
- package/types/scripts/applicationsAccess/ApplicationsAccess.d.ts +45 -0
- package/types/scripts/convertDuration/convertDurationWithMilliseconds.d.ts +6 -0
- package/types/scripts/index.d.ts +6 -1
- package/types/scripts/resolveGrants/resolveGrants.d.ts +11 -0
- package/types/validations/changelog/changelog.validations.d.ts +15 -0
- package/types/validations/emailProfile/emailProfile.validations.d.ts +36 -0
- package/types/validations/importTemplate/importTemplate.validations.d.ts +62 -0
- package/types/validations/index.d.ts +7 -0
- package/types/validations/role/role.validations.d.ts +34 -0
- package/types/validations/schemaVariable/schemaVariable.validations.d.ts +18 -0
- package/types/validations/storagePolicy/storagePolicy.validations.d.ts +26 -0
- package/types/validations/trigger/trigger.validations.d.ts +38 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { getShallowFieldsToSendFromZodSchema } from '@webitel/api-services/gen/utils';
|
|
2
|
+
import { roleSchema } from '@webitel/api-services/validations';
|
|
3
|
+
import { GetPermissionsQueryParams, getPermissions } from '../../../gen-wire';
|
|
4
|
+
import { ApplicationsAccess } from '../../../scripts';
|
|
5
|
+
import {
|
|
6
|
+
getDefaultGetListResponse,
|
|
7
|
+
getDefaultGetParams,
|
|
8
|
+
getDefaultInstance,
|
|
9
|
+
} from '../../defaults';
|
|
10
|
+
import {
|
|
11
|
+
applyTransform,
|
|
12
|
+
camelToSnake,
|
|
13
|
+
merge,
|
|
14
|
+
notify,
|
|
15
|
+
sanitize,
|
|
16
|
+
sanitizeToWire,
|
|
17
|
+
snakeToCamel,
|
|
18
|
+
starToSearch,
|
|
19
|
+
translateError,
|
|
20
|
+
} from '../../transformers';
|
|
21
|
+
import type {
|
|
22
|
+
AddItemParams,
|
|
23
|
+
ApiParams,
|
|
24
|
+
DeleteItemParams,
|
|
25
|
+
GetItemParams,
|
|
26
|
+
UpdateItemParams,
|
|
27
|
+
} from '../_shared/types';
|
|
28
|
+
|
|
29
|
+
const instance = getDefaultInstance();
|
|
30
|
+
|
|
31
|
+
const baseUrl = '/roles';
|
|
32
|
+
|
|
33
|
+
/** [Claude] the card schema's fields */
|
|
34
|
+
const fieldsToSend = getShallowFieldsToSendFromZodSchema(roleSchema);
|
|
35
|
+
|
|
36
|
+
/** [Claude] the role's app access goes over the wire minified: only the granted nodes, without their ui `_locale` */
|
|
37
|
+
const preRequestHandler = (item: ApiParams) => ({
|
|
38
|
+
...item,
|
|
39
|
+
metadata: {
|
|
40
|
+
...item.metadata,
|
|
41
|
+
access: ApplicationsAccess.minify(item.metadata?.access ?? {}),
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
/** [Claude] the minified access is restored to the full tree of apps and sections */
|
|
46
|
+
const itemResponseHandler = (item: ApiParams) => ({
|
|
47
|
+
...item,
|
|
48
|
+
metadata: {
|
|
49
|
+
...item.metadata,
|
|
50
|
+
access: new ApplicationsAccess({
|
|
51
|
+
access: item.metadata?.access,
|
|
52
|
+
}).getAccess(),
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const getRoleList = async (params: ApiParams) => {
|
|
57
|
+
const { page, size, q, sort, fields, ids } = applyTransform(params, [
|
|
58
|
+
merge(getDefaultGetParams()),
|
|
59
|
+
starToSearch('search'),
|
|
60
|
+
(params: ApiParams) => {
|
|
61
|
+
const rawId = params.id ?? params.ids;
|
|
62
|
+
return {
|
|
63
|
+
...params,
|
|
64
|
+
ids: rawId ? [].concat(rawId) : undefined,
|
|
65
|
+
// the endpoint param is `q`; `search` is what the datalist store sends
|
|
66
|
+
q: params.search,
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
camelToSnake(),
|
|
70
|
+
]);
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
const response = await instance.get(baseUrl, {
|
|
74
|
+
params: {
|
|
75
|
+
page,
|
|
76
|
+
size,
|
|
77
|
+
q,
|
|
78
|
+
sort,
|
|
79
|
+
fields,
|
|
80
|
+
ids,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
const { items, next } = applyTransform(response.data, [
|
|
84
|
+
snakeToCamel(),
|
|
85
|
+
merge(getDefaultGetListResponse()),
|
|
86
|
+
]);
|
|
87
|
+
return {
|
|
88
|
+
items,
|
|
89
|
+
next,
|
|
90
|
+
};
|
|
91
|
+
} catch (err) {
|
|
92
|
+
throw applyTransform(err, [
|
|
93
|
+
notify,
|
|
94
|
+
]);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const getRole = async ({ itemId: id }: GetItemParams) => {
|
|
99
|
+
const defaultObject = {
|
|
100
|
+
name: '',
|
|
101
|
+
description: '',
|
|
102
|
+
permissions: [],
|
|
103
|
+
metadata: {},
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
try {
|
|
107
|
+
const response = await instance.get(`${baseUrl}/${id}`, {
|
|
108
|
+
params: {
|
|
109
|
+
fields: fieldsToSend,
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
return applyTransform(response.data, [
|
|
113
|
+
// snakeToCamel(), // prevent role "access" custom lookups from being converted to camelCase
|
|
114
|
+
merge(defaultObject),
|
|
115
|
+
itemResponseHandler,
|
|
116
|
+
]);
|
|
117
|
+
} catch (err) {
|
|
118
|
+
throw applyTransform(err, [
|
|
119
|
+
notify,
|
|
120
|
+
]);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const addRole = async ({ itemInstance }: AddItemParams) => {
|
|
125
|
+
const item = applyTransform(itemInstance, [
|
|
126
|
+
preRequestHandler,
|
|
127
|
+
sanitize(fieldsToSend),
|
|
128
|
+
// NOTE: prevent conversion of "access" custom lookups
|
|
129
|
+
// camelToSnake(), https://webitel.atlassian.net/browse/WTEL-7599
|
|
130
|
+
]);
|
|
131
|
+
try {
|
|
132
|
+
const response = await instance.post(baseUrl, item);
|
|
133
|
+
return response.data;
|
|
134
|
+
} catch (err) {
|
|
135
|
+
throw applyTransform(err, [
|
|
136
|
+
translateError,
|
|
137
|
+
notify,
|
|
138
|
+
]);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const updateRole = async ({ itemInstance, itemId: id }: UpdateItemParams) => {
|
|
143
|
+
const item = applyTransform(itemInstance, [
|
|
144
|
+
preRequestHandler,
|
|
145
|
+
sanitize(fieldsToSend),
|
|
146
|
+
// NOTE: prevent conversion of "access" custom lookups
|
|
147
|
+
// camelToSnake(), https://webitel.atlassian.net/browse/WTEL-7599
|
|
148
|
+
]);
|
|
149
|
+
try {
|
|
150
|
+
const response = await instance.put(`${baseUrl}/${id}`, item);
|
|
151
|
+
return response.data;
|
|
152
|
+
} catch (err) {
|
|
153
|
+
throw applyTransform(err, [
|
|
154
|
+
translateError,
|
|
155
|
+
notify,
|
|
156
|
+
]);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const deleteRole = async ({ id }: DeleteItemParams) => {
|
|
161
|
+
try {
|
|
162
|
+
const response = await instance.delete(`${baseUrl}/${id}`);
|
|
163
|
+
return response.data;
|
|
164
|
+
} catch (err) {
|
|
165
|
+
throw applyTransform(err, [
|
|
166
|
+
notify,
|
|
167
|
+
]);
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const getRolesLookup = (params: ApiParams) =>
|
|
172
|
+
getRoleList({
|
|
173
|
+
...params,
|
|
174
|
+
/** [Claude] `user` tells a user's own role from a group one (role selects show it as an icon) */
|
|
175
|
+
fields: params.fields || [
|
|
176
|
+
'id',
|
|
177
|
+
'name',
|
|
178
|
+
'user',
|
|
179
|
+
],
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
/** The global actions a role can be granted. */
|
|
183
|
+
const getPermissionsOptions = async (params: ApiParams) => {
|
|
184
|
+
const requestParams = applyTransform(params, [
|
|
185
|
+
merge(getDefaultGetParams()),
|
|
186
|
+
(params: ApiParams) => ({
|
|
187
|
+
...params,
|
|
188
|
+
q: params.search,
|
|
189
|
+
// [Claude] getPermissions declares `sort` as string[]; the datalist sends a single string
|
|
190
|
+
sort:
|
|
191
|
+
typeof params.sort === 'string'
|
|
192
|
+
? [
|
|
193
|
+
params.sort,
|
|
194
|
+
]
|
|
195
|
+
: params.sort,
|
|
196
|
+
}),
|
|
197
|
+
sanitizeToWire(
|
|
198
|
+
getShallowFieldsToSendFromZodSchema(GetPermissionsQueryParams),
|
|
199
|
+
),
|
|
200
|
+
camelToSnake(),
|
|
201
|
+
]);
|
|
202
|
+
try {
|
|
203
|
+
const response = await getPermissions().getPermissions(requestParams);
|
|
204
|
+
const { items, next } = applyTransform(response.data, [
|
|
205
|
+
snakeToCamel(),
|
|
206
|
+
merge(getDefaultGetListResponse()),
|
|
207
|
+
]);
|
|
208
|
+
return {
|
|
209
|
+
items,
|
|
210
|
+
next,
|
|
211
|
+
};
|
|
212
|
+
} catch (err) {
|
|
213
|
+
throw applyTransform(err, [
|
|
214
|
+
notify,
|
|
215
|
+
]);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
export const RolesAPI = {
|
|
220
|
+
getList: getRoleList,
|
|
221
|
+
get: getRole,
|
|
222
|
+
add: addRole,
|
|
223
|
+
update: updateRole,
|
|
224
|
+
delete: deleteRole,
|
|
225
|
+
getLookup: getRolesLookup,
|
|
226
|
+
getPermissionsOptions,
|
|
227
|
+
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getShallowFieldsToSendFromZodSchema } from '@webitel/api-services/gen/utils';
|
|
2
|
+
import { schemaVariableSchema } from '@webitel/api-services/validations';
|
|
3
|
+
import {
|
|
4
|
+
getSchemaVariablesService,
|
|
5
|
+
SearchSchemaVariableQueryParams,
|
|
6
|
+
} from '../../../gen-wire';
|
|
2
7
|
import { getDefaultGetListResponse, getDefaultGetParams } from '../../defaults';
|
|
3
8
|
import {
|
|
4
9
|
applyTransform,
|
|
@@ -6,6 +11,7 @@ import {
|
|
|
6
11
|
merge,
|
|
7
12
|
notify,
|
|
8
13
|
sanitize,
|
|
14
|
+
sanitizeToWire,
|
|
9
15
|
snakeToCamel,
|
|
10
16
|
starToSearch,
|
|
11
17
|
} from '../../transformers';
|
|
@@ -18,29 +24,27 @@ import type {
|
|
|
18
24
|
UpdateItemParams,
|
|
19
25
|
} from '../_shared/types';
|
|
20
26
|
|
|
21
|
-
/** "Global variables" in the admin UI. */
|
|
22
|
-
const fieldsToSend =
|
|
23
|
-
'id',
|
|
24
|
-
'name',
|
|
25
|
-
'value',
|
|
26
|
-
'encrypt',
|
|
27
|
-
];
|
|
27
|
+
/** "Global variables" in the admin UI. [Claude] The card schema's fields. */
|
|
28
|
+
const fieldsToSend = getShallowFieldsToSendFromZodSchema(schemaVariableSchema);
|
|
28
29
|
|
|
29
30
|
const getSchemaVariablesList = async (params: ApiParams) => {
|
|
30
|
-
const
|
|
31
|
+
const requestParams = applyTransform(params, [
|
|
31
32
|
merge(getDefaultGetParams()),
|
|
32
33
|
starToSearch('search'),
|
|
34
|
+
(params: ApiParams) => ({
|
|
35
|
+
...params,
|
|
36
|
+
// [Claude] the generated param is `q`; `search` is what the datalist store sends
|
|
37
|
+
q: params.q ?? params.search,
|
|
38
|
+
}),
|
|
39
|
+
sanitizeToWire(
|
|
40
|
+
getShallowFieldsToSendFromZodSchema(SearchSchemaVariableQueryParams),
|
|
41
|
+
),
|
|
42
|
+
camelToSnake(),
|
|
33
43
|
]);
|
|
34
44
|
|
|
35
45
|
try {
|
|
36
|
-
const response =
|
|
37
|
-
|
|
38
|
-
size,
|
|
39
|
-
// the generated param is `q`; `search` is what the datalist store sends
|
|
40
|
-
q: search,
|
|
41
|
-
sort,
|
|
42
|
-
fields,
|
|
43
|
-
});
|
|
46
|
+
const response =
|
|
47
|
+
await getSchemaVariablesService().searchSchemaVariable(requestParams);
|
|
44
48
|
const { items, next } = applyTransform(response.data, [
|
|
45
49
|
snakeToCamel(),
|
|
46
50
|
merge(getDefaultGetListResponse()),
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { getShallowFieldsToSendFromZodSchema } from '@webitel/api-services/gen/utils';
|
|
2
|
+
import { storagePolicySchema } from '@webitel/api-services/validations';
|
|
3
|
+
import {
|
|
4
|
+
getFilePoliciesService,
|
|
5
|
+
SearchFilePoliciesQueryParams,
|
|
6
|
+
} from '../../../gen-wire';
|
|
3
7
|
import { getDefaultGetListResponse, getDefaultGetParams } from '../../defaults';
|
|
4
8
|
import {
|
|
5
9
|
applyTransform,
|
|
@@ -8,6 +12,7 @@ import {
|
|
|
8
12
|
mergeEach,
|
|
9
13
|
notify,
|
|
10
14
|
sanitize,
|
|
15
|
+
sanitizeToWire,
|
|
11
16
|
snakeToCamel,
|
|
12
17
|
starToSearch,
|
|
13
18
|
} from '../../transformers';
|
|
@@ -21,18 +26,8 @@ import type {
|
|
|
21
26
|
UpdateItemParams,
|
|
22
27
|
} from '../_shared/types';
|
|
23
28
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
'description',
|
|
27
|
-
'channels',
|
|
28
|
-
'mimeTypes',
|
|
29
|
-
'retentionDays',
|
|
30
|
-
'speedDownload',
|
|
31
|
-
'speedUpload',
|
|
32
|
-
'maxUploadSize',
|
|
33
|
-
'enabled',
|
|
34
|
-
'encrypt',
|
|
35
|
-
];
|
|
29
|
+
/** [Claude] the card schema's fields */
|
|
30
|
+
const fieldsToSend = getShallowFieldsToSendFromZodSchema(storagePolicySchema);
|
|
36
31
|
|
|
37
32
|
/**
|
|
38
33
|
* The list endpoint returns nothing useful without an explicit field list, so
|
|
@@ -53,6 +48,7 @@ const listFields = [
|
|
|
53
48
|
'encrypt',
|
|
54
49
|
];
|
|
55
50
|
|
|
51
|
+
/** [Claude] the api leaves out zero values, a missing `enabled` or `encrypt` is `false` */
|
|
56
52
|
const defaultObject = {
|
|
57
53
|
name: '',
|
|
58
54
|
description: '',
|
|
@@ -64,34 +60,28 @@ const defaultObject = {
|
|
|
64
60
|
maxUploadSize: 0,
|
|
65
61
|
position: 0,
|
|
66
62
|
enabled: false,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const preRequestHandler = (item: ApiParams) => {
|
|
70
|
-
const copy = deepCopy(item);
|
|
71
|
-
return {
|
|
72
|
-
...copy,
|
|
73
|
-
channels: item.channels.map(
|
|
74
|
-
(channel: ApiParams) => channel.value || channel,
|
|
75
|
-
),
|
|
76
|
-
};
|
|
63
|
+
encrypt: false,
|
|
77
64
|
};
|
|
78
65
|
|
|
79
66
|
const getStoragePoliciesList = async (params: ApiParams) => {
|
|
80
|
-
const
|
|
67
|
+
const requestParams = applyTransform(params, [
|
|
81
68
|
merge(getDefaultGetParams()),
|
|
82
69
|
starToSearch('search'),
|
|
70
|
+
(params: ApiParams) => ({
|
|
71
|
+
...params,
|
|
72
|
+
// [Claude] the generated param is `q`; `search` is what the datalist store sends
|
|
73
|
+
q: params.q ?? params.search,
|
|
74
|
+
fields: listFields,
|
|
75
|
+
}),
|
|
76
|
+
sanitizeToWire(
|
|
77
|
+
getShallowFieldsToSendFromZodSchema(SearchFilePoliciesQueryParams),
|
|
78
|
+
),
|
|
79
|
+
camelToSnake(),
|
|
83
80
|
]);
|
|
84
81
|
|
|
85
82
|
try {
|
|
86
|
-
const response =
|
|
87
|
-
|
|
88
|
-
size,
|
|
89
|
-
// the generated param is `q`; `search` is what the datalist store sends
|
|
90
|
-
q: search,
|
|
91
|
-
sort,
|
|
92
|
-
fields: listFields,
|
|
93
|
-
id,
|
|
94
|
-
});
|
|
83
|
+
const response =
|
|
84
|
+
await getFilePoliciesService().searchFilePolicies(requestParams);
|
|
95
85
|
const { items, next } = applyTransform(response.data, [
|
|
96
86
|
snakeToCamel(),
|
|
97
87
|
merge(getDefaultGetListResponse()),
|
|
@@ -125,7 +115,6 @@ const getStoragePolicy = async ({ itemId: id }: GetItemParams) => {
|
|
|
125
115
|
|
|
126
116
|
const addStoragePolicy = async ({ itemInstance }: AddItemParams) => {
|
|
127
117
|
const item = applyTransform(itemInstance, [
|
|
128
|
-
preRequestHandler,
|
|
129
118
|
sanitize(fieldsToSend),
|
|
130
119
|
// `channels` values mirror the StorageUploadFileChannel enum and stay camelCase
|
|
131
120
|
camelToSnake([
|
|
@@ -149,7 +138,6 @@ const updateStoragePolicy = async ({
|
|
|
149
138
|
itemId: id,
|
|
150
139
|
}: UpdateItemParams) => {
|
|
151
140
|
const item = applyTransform(itemInstance, [
|
|
152
|
-
preRequestHandler,
|
|
153
141
|
sanitize(fieldsToSend),
|
|
154
142
|
// `channels` values mirror the StorageUploadFileChannel enum and stay camelCase
|
|
155
143
|
camelToSnake([
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getTriggerService } from '../../../gen-wire';
|
|
2
|
+
import { normalizeDatetimeRange } from '../../../scripts';
|
|
2
3
|
import { getDefaultGetListResponse, getDefaultGetParams } from '../../defaults';
|
|
3
4
|
import {
|
|
4
5
|
applyTransform,
|
|
@@ -9,21 +10,29 @@ import {
|
|
|
9
10
|
} from '../../transformers';
|
|
10
11
|
import type { ApiParams } from '../_shared/types';
|
|
11
12
|
|
|
13
|
+
/**
|
|
14
|
+
* [Claude] The params are the trigger logs datalist's filters: `startedAt` is
|
|
15
|
+
* a date range filter (a relative value or `{ from, to }`), `duration` a
|
|
16
|
+
* from-to range and `triggerJobState` the picked run states. The ranges are
|
|
17
|
+
* protobuf nested messages, so they only bind as dotted keys.
|
|
18
|
+
*/
|
|
12
19
|
const getTriggerJobsList = async (params: ApiParams) => {
|
|
13
20
|
const {
|
|
14
21
|
parentId,
|
|
15
22
|
page,
|
|
16
23
|
size,
|
|
17
|
-
|
|
24
|
+
search,
|
|
18
25
|
sort,
|
|
19
26
|
fields,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
durationTo,
|
|
24
|
-
result,
|
|
27
|
+
startedAt,
|
|
28
|
+
duration,
|
|
29
|
+
triggerJobState,
|
|
25
30
|
} = applyTransform(params, [
|
|
26
31
|
merge(getDefaultGetParams()),
|
|
32
|
+
({ startedAt, ...rest }) => ({
|
|
33
|
+
...rest,
|
|
34
|
+
startedAt: normalizeDatetimeRange(startedAt),
|
|
35
|
+
}),
|
|
27
36
|
starToSearch('search'),
|
|
28
37
|
]);
|
|
29
38
|
|
|
@@ -33,14 +42,15 @@ const getTriggerJobsList = async (params: ApiParams) => {
|
|
|
33
42
|
{
|
|
34
43
|
page,
|
|
35
44
|
size,
|
|
36
|
-
q
|
|
45
|
+
// [Claude] the generated param is `q`; `search` is what the datalist store sends
|
|
46
|
+
q: search,
|
|
37
47
|
sort,
|
|
38
48
|
fields,
|
|
39
|
-
'started_at.from':
|
|
40
|
-
'started_at.to':
|
|
41
|
-
'duration.from':
|
|
42
|
-
'duration.to':
|
|
43
|
-
state:
|
|
49
|
+
'started_at.from': startedAt?.from,
|
|
50
|
+
'started_at.to': startedAt?.to,
|
|
51
|
+
'duration.from': duration?.from,
|
|
52
|
+
'duration.to': duration?.to,
|
|
53
|
+
state: triggerJobState,
|
|
44
54
|
},
|
|
45
55
|
);
|
|
46
56
|
const { items, next } = applyTransform(response.data, [
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { getShallowFieldsToSendFromZodSchema } from '@webitel/api-services/gen/utils';
|
|
2
|
+
import { triggerSchema } from '@webitel/api-services/validations';
|
|
1
3
|
import deepCopy from 'deep-copy';
|
|
2
4
|
import { getTriggerService } from '../../../gen-wire';
|
|
3
5
|
import { getDefaultGetListResponse, getDefaultGetParams } from '../../defaults';
|
|
@@ -28,29 +30,13 @@ const doNotConvertKeys = [
|
|
|
28
30
|
'variables',
|
|
29
31
|
];
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
'enabled',
|
|
34
|
-
'id',
|
|
35
|
-
'name',
|
|
36
|
-
'schema',
|
|
37
|
-
'timeout',
|
|
38
|
-
'timezone',
|
|
39
|
-
'type',
|
|
40
|
-
'variables',
|
|
41
|
-
'expression',
|
|
42
|
-
'event',
|
|
43
|
-
'object',
|
|
44
|
-
];
|
|
33
|
+
/** [Claude] the card schema's fields */
|
|
34
|
+
const fieldsToSend = getShallowFieldsToSendFromZodSchema(triggerSchema);
|
|
45
35
|
|
|
46
|
-
/**
|
|
47
|
-
* The form binds `variables` as a `{ key, value }[]`, the API takes a map.
|
|
48
|
-
* `type`, `event` and `object` are bound as lookup objects; only the value
|
|
49
|
-
* goes over the wire.
|
|
50
|
-
*/
|
|
36
|
+
/** The form binds `variables` as a `{ key, value }[]`, the API takes a map. */
|
|
51
37
|
const preRequestHandler = (item: ApiParams) => {
|
|
52
38
|
const copy = deepCopy(item);
|
|
53
|
-
copy.variables = copy.variables.reduce(
|
|
39
|
+
copy.variables = (copy.variables ?? []).reduce(
|
|
54
40
|
(variables: ApiParams, variable: ApiParams) => {
|
|
55
41
|
if (!variable.key) return variables;
|
|
56
42
|
variables[variable.key] = variable.value;
|
|
@@ -58,12 +44,7 @@ const preRequestHandler = (item: ApiParams) => {
|
|
|
58
44
|
},
|
|
59
45
|
{},
|
|
60
46
|
);
|
|
61
|
-
return
|
|
62
|
-
...copy,
|
|
63
|
-
type: copy?.type?.value ?? copy?.type,
|
|
64
|
-
event: copy?.event?.value ?? copy?.event,
|
|
65
|
-
object: copy?.object?.value ?? copy?.object,
|
|
66
|
-
};
|
|
47
|
+
return copy;
|
|
67
48
|
};
|
|
68
49
|
|
|
69
50
|
const getTriggersList = async (params: ApiParams) => {
|
|
@@ -117,11 +98,6 @@ const getTriggersList = async (params: ApiParams) => {
|
|
|
117
98
|
}
|
|
118
99
|
};
|
|
119
100
|
|
|
120
|
-
/**
|
|
121
|
-
* Returns `type`, `event` and `object` as raw enum values. Mapping them onto
|
|
122
|
-
* localized lookup entries is the caller's job — the labels are app-side i18n
|
|
123
|
-
* keys.
|
|
124
|
-
*/
|
|
125
101
|
const getTrigger = async ({ itemId: id }: GetItemParams) => {
|
|
126
102
|
const defaultObject = {
|
|
127
103
|
timeout: 0,
|
|
@@ -130,12 +106,11 @@ const getTrigger = async ({ itemId: id }: GetItemParams) => {
|
|
|
130
106
|
|
|
131
107
|
const responseHandler = (response: ApiParams) => {
|
|
132
108
|
const copy = deepCopy(response);
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
109
|
+
// [Claude] a trigger without variables gets the default `{}`, which the form needs as `[]` too
|
|
110
|
+
copy.variables = Object.keys(copy.variables ?? {}).map((key) => ({
|
|
111
|
+
key,
|
|
112
|
+
value: copy.variables[key],
|
|
113
|
+
}));
|
|
139
114
|
return copy;
|
|
140
115
|
};
|
|
141
116
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isAxiosError } from 'axios';
|
|
1
2
|
import { getDefaultAxiosInstance } from '../../axios/genClient';
|
|
2
3
|
import { applyTransform, notify } from '../../transformers';
|
|
3
4
|
|
|
@@ -35,7 +36,27 @@ const setUserSettings = async ({
|
|
|
35
36
|
}
|
|
36
37
|
};
|
|
37
38
|
|
|
39
|
+
export interface WebPhoneSettings {
|
|
40
|
+
webrtc: boolean;
|
|
41
|
+
stun: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const getWebPhone = async (): Promise<WebPhoneSettings | undefined> => {
|
|
45
|
+
try {
|
|
46
|
+
const response = await getDefaultAxiosInstance().get(url('phone'));
|
|
47
|
+
return response.data;
|
|
48
|
+
} catch (err) {
|
|
49
|
+
// phone settings doesn't exist on backend if user is new, and we have to hide notification about this error
|
|
50
|
+
// https://webitel.atlassian.net/browse/WTEL-4346
|
|
51
|
+
if (isAxiosError(err) && err.response?.status === 404) return;
|
|
52
|
+
throw applyTransform(err, [
|
|
53
|
+
notify,
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
38
58
|
export const UserSettingsAPI = {
|
|
39
59
|
get: getUserSettings,
|
|
40
60
|
set: setUserSettings,
|
|
61
|
+
getWebPhone,
|
|
41
62
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AccessRuleName } from '../AccessRuleName/AccessRuleName';
|
|
2
|
+
|
|
3
|
+
/** [Claude] which access rule each permissions table column edits */
|
|
4
|
+
export const AccessRuleColumn = {
|
|
5
|
+
create: AccessRuleName.X,
|
|
6
|
+
read: AccessRuleName.R,
|
|
7
|
+
edit: AccessRuleName.W,
|
|
8
|
+
delete: AccessRuleName.D,
|
|
9
|
+
} as const;
|
|
10
|
+
|
|
11
|
+
export type AccessRuleColumn = keyof typeof AccessRuleColumn;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** [Claude] the acl rules, as letters of the `granted` string: create, read, write, delete */
|
|
2
|
+
export const AccessRuleName = {
|
|
3
|
+
X: 'x',
|
|
4
|
+
R: 'r',
|
|
5
|
+
W: 'w',
|
|
6
|
+
D: 'd',
|
|
7
|
+
} as const;
|
|
8
|
+
|
|
9
|
+
export type AccessRuleName =
|
|
10
|
+
(typeof AccessRuleName)[keyof typeof AccessRuleName];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @augments WtApplication
|
|
3
|
+
* represents ui sections in Admin WtApplication
|
|
4
|
+
* without any relation to WtObjects (?)
|
|
5
|
+
*/
|
|
6
|
+
export const AdminSections = {
|
|
7
|
+
Agents: 'agents',
|
|
8
|
+
Blacklist: 'blacklist',
|
|
9
|
+
Buckets: 'buckets',
|
|
10
|
+
Calendars: 'calendars',
|
|
11
|
+
Changelogs: 'changelogs',
|
|
12
|
+
ChatGateways: 'chat-gateways',
|
|
13
|
+
Chatplan: 'chatplan',
|
|
14
|
+
CognitiveProfiles: 'cognitive-profiles',
|
|
15
|
+
Communications: 'communications',
|
|
16
|
+
Configuration: 'configuration',
|
|
17
|
+
Dialplan: 'dialplan',
|
|
18
|
+
Devices: 'devices',
|
|
19
|
+
EmailProfiles: 'email-profiles',
|
|
20
|
+
Flow: 'flow',
|
|
21
|
+
Gateways: 'gateways',
|
|
22
|
+
GlobalVariables: 'global-variables',
|
|
23
|
+
ImportCsv: 'import-csv',
|
|
24
|
+
License: 'license',
|
|
25
|
+
Media: 'media',
|
|
26
|
+
Members: 'members',
|
|
27
|
+
Objects: 'objects',
|
|
28
|
+
PauseCause: 'pause-cause',
|
|
29
|
+
ActivityTypes: 'activity-types',
|
|
30
|
+
Queues: 'queues',
|
|
31
|
+
Regions: 'regions',
|
|
32
|
+
ResourceGroups: 'resource-groups',
|
|
33
|
+
Resources: 'resources',
|
|
34
|
+
Roles: 'roles',
|
|
35
|
+
SingleSignOn: 'single-sign-on',
|
|
36
|
+
Skills: 'skills',
|
|
37
|
+
Storage: 'storage',
|
|
38
|
+
StoragePolicies: 'storage-policies',
|
|
39
|
+
Teams: 'teams',
|
|
40
|
+
Triggers: 'triggers',
|
|
41
|
+
Users: 'users',
|
|
42
|
+
QuickReplies: 'quick-replies',
|
|
43
|
+
} as const;
|
|
44
|
+
|
|
45
|
+
export type AdminSections = (typeof AdminSections)[keyof typeof AdminSections];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const CrmSections = {
|
|
2
|
+
Contacts: 'contacts',
|
|
3
|
+
Cases: 'cases',
|
|
4
|
+
|
|
5
|
+
// CONFIGURATION - LOOKUPS
|
|
6
|
+
Slas: 'slas',
|
|
7
|
+
ServiceCatalogs: 'service-catalogs',
|
|
8
|
+
Priorities: 'priorities',
|
|
9
|
+
Statuses: 'statuses',
|
|
10
|
+
Sources: 'sources',
|
|
11
|
+
CloseReasonGroups: 'close-reason-groups',
|
|
12
|
+
ContactGroups: 'contact-groups',
|
|
13
|
+
CaseSources: 'case-sources',
|
|
14
|
+
|
|
15
|
+
// CUSTOMIZATION
|
|
16
|
+
CasesExtensions: 'ext-cases',
|
|
17
|
+
ContactsExtensions: 'ext-contacts',
|
|
18
|
+
CustomLookups: 'custom-lookups',
|
|
19
|
+
} as const;
|
|
20
|
+
|
|
21
|
+
export type CrmSections = (typeof CrmSections)[keyof typeof CrmSections];
|