@webitel/api-services 26.12.23 → 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/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/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/index.ts +10 -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/index.ts +3 -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/types/.tsbuildinfo +1 -1
- package/types/api/clients/_shared/generatePermissionsApi.d.ts +31 -0
- 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/index.d.ts +5 -1
- package/types/scripts/resolveGrants/resolveGrants.d.ts +11 -0
- package/types/validations/changelog/changelog.validations.d.ts +15 -0
- package/types/validations/index.d.ts +3 -0
- package/types/validations/role/role.validations.d.ts +34 -0
- package/types/validations/schemaVariable/schemaVariable.validations.d.ts +18 -0
package/package.json
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { toAclFields } from '../generatePermissionsApi';
|
|
4
|
+
|
|
5
|
+
describe('toAclFields', () => {
|
|
6
|
+
it('asks for one `granted` in place of the rule columns, and never for `id`', () => {
|
|
7
|
+
expect(
|
|
8
|
+
toAclFields({
|
|
9
|
+
fields: [
|
|
10
|
+
'id',
|
|
11
|
+
'grantee',
|
|
12
|
+
'r',
|
|
13
|
+
'w',
|
|
14
|
+
'd',
|
|
15
|
+
],
|
|
16
|
+
sort: '+w',
|
|
17
|
+
}),
|
|
18
|
+
).toEqual({
|
|
19
|
+
fields: [
|
|
20
|
+
'grantee',
|
|
21
|
+
'granted',
|
|
22
|
+
],
|
|
23
|
+
sort: '+w',
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('leaves missing `fields` as is', () => {
|
|
28
|
+
expect(
|
|
29
|
+
toAclFields({
|
|
30
|
+
sort: '+w',
|
|
31
|
+
}),
|
|
32
|
+
).toEqual({
|
|
33
|
+
fields: undefined,
|
|
34
|
+
sort: '+w',
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AccessRuleName } from '../../../enums/AccessRuleName/AccessRuleName';
|
|
1
2
|
import {
|
|
2
3
|
getDefaultGetListResponse,
|
|
3
4
|
getDefaultGetParams,
|
|
@@ -18,7 +19,7 @@ import type { ApiId, ApiParams, PatchItemParams } from './types';
|
|
|
18
19
|
|
|
19
20
|
const permissionsUrl = 'acl';
|
|
20
21
|
|
|
21
|
-
const handlePermissionsList = (items: ApiParams[]) => {
|
|
22
|
+
export const handlePermissionsList = (items: ApiParams[]) => {
|
|
22
23
|
return items.map((item) => ({
|
|
23
24
|
...item,
|
|
24
25
|
access: {
|
|
@@ -42,6 +43,29 @@ const handlePermissionsList = (items: ApiParams[]) => {
|
|
|
42
43
|
}));
|
|
43
44
|
};
|
|
44
45
|
|
|
46
|
+
const ruleFields: string[] = Object.values(AccessRuleName).filter(
|
|
47
|
+
(rule) => rule !== AccessRuleName.X,
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* [Claude] table stores always ask for `id`, but an acl row has no such attribute
|
|
52
|
+
* and the endpoint answers `400 app.search.fields.invalid` — a row is addressed
|
|
53
|
+
* by its grantee.
|
|
54
|
+
* The rule columns are keyed by their letter (`r`, `w`, `d`), so each sorts on
|
|
55
|
+
* its own, but the endpoint has no such attributes in `fields`: it returns the
|
|
56
|
+
* three rules merged into one `granted` string, asked for once.
|
|
57
|
+
*/
|
|
58
|
+
export const toAclFields = (params: ApiParams) => ({
|
|
59
|
+
...params,
|
|
60
|
+
fields: params.fields && [
|
|
61
|
+
...new Set(
|
|
62
|
+
(params.fields as string[])
|
|
63
|
+
.filter((field) => field !== 'id')
|
|
64
|
+
.map((field) => (ruleFields.includes(field) ? 'granted' : field)),
|
|
65
|
+
),
|
|
66
|
+
],
|
|
67
|
+
});
|
|
68
|
+
|
|
45
69
|
export const generatePermissionsApi = (baseUrl: string) => {
|
|
46
70
|
const instance = getDefaultInstance();
|
|
47
71
|
|
|
@@ -71,6 +95,7 @@ export const generatePermissionsApi = (baseUrl: string) => {
|
|
|
71
95
|
...params,
|
|
72
96
|
q: params.search,
|
|
73
97
|
}),
|
|
98
|
+
toAclFields,
|
|
74
99
|
sanitize(fieldsToSend),
|
|
75
100
|
camelToSnake(),
|
|
76
101
|
generateUrl(`${baseUrl}/${parentId}/${permissionsUrl}`),
|
package/src/api/clients/index.ts
CHANGED
|
@@ -63,6 +63,7 @@ export * from './media/media';
|
|
|
63
63
|
export * from './messageService/messageService';
|
|
64
64
|
export * from './oauthApps/oauthApps';
|
|
65
65
|
export * from './object/object';
|
|
66
|
+
export * from './objectClasses/objectClasses';
|
|
66
67
|
export * from './onlineSkills/onlineSkills';
|
|
67
68
|
export * from './outboundResourceGroups/outboundResourceGroups';
|
|
68
69
|
export * from './outboundResourceGroups/resourcesInGroup';
|
|
@@ -82,10 +83,11 @@ export * from './queues/queueState';
|
|
|
82
83
|
export * from './queues/queues';
|
|
83
84
|
export * from './quickReplies/quickReplies';
|
|
84
85
|
export * from './regions/regions';
|
|
86
|
+
export * from './ringtones/ringtones';
|
|
87
|
+
export * from './roles/roles';
|
|
85
88
|
export * from './schemaVariables/schemaVariables';
|
|
86
89
|
export * from './shiftTemplates/shiftTemplates';
|
|
87
90
|
export * from './skills/skillAgents';
|
|
88
|
-
// export * from './roles/roles'; fixme: ApplicationAccess import
|
|
89
91
|
export * from './skills/skills';
|
|
90
92
|
export * from './slaConditions/slaConditions';
|
|
91
93
|
export * from './slas/slas';
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getShallowFieldsToSendFromZodSchema } from '@webitel/api-services/gen/utils';
|
|
2
|
+
import {
|
|
3
|
+
getLoggerService,
|
|
4
|
+
LoggerServiceSearchLogByConfigIdQueryParams,
|
|
5
|
+
LoggerServiceSearchLogByUserIdQueryParams,
|
|
6
|
+
} from '../../../gen-wire';
|
|
2
7
|
import { normalizeDatetimeRange } from '../../../scripts';
|
|
3
8
|
import { getDefaultGetListResponse, getDefaultGetParams } from '../../defaults';
|
|
4
9
|
import {
|
|
5
10
|
applyTransform,
|
|
11
|
+
camelToSnake,
|
|
6
12
|
merge,
|
|
7
13
|
notify,
|
|
8
|
-
|
|
14
|
+
sanitizeToWire,
|
|
9
15
|
snakeToCamel,
|
|
10
16
|
starToSearch,
|
|
11
17
|
} from '../../transformers';
|
|
@@ -17,60 +23,50 @@ import type { ApiParams, GetItemParams } from '../_shared/types';
|
|
|
17
23
|
*/
|
|
18
24
|
const DEFAULT_SORT = '-date';
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
'fields',
|
|
28
|
-
'action',
|
|
29
|
-
'object',
|
|
30
|
-
'date',
|
|
31
|
-
'userIp',
|
|
32
|
-
];
|
|
33
|
-
|
|
34
|
-
const {
|
|
35
|
-
parentId,
|
|
36
|
-
page,
|
|
37
|
-
size,
|
|
38
|
-
search,
|
|
39
|
-
sort,
|
|
40
|
-
fields,
|
|
41
|
-
action,
|
|
42
|
-
object,
|
|
43
|
-
date,
|
|
44
|
-
userIp,
|
|
45
|
-
} = applyTransform(params, [
|
|
46
|
-
sanitize(fieldsToSend),
|
|
26
|
+
/**
|
|
27
|
+
* [Claude] The datalist's params, as the logger list endpoints take them: the
|
|
28
|
+
* date filter is a range, split into its bounds; anything the endpoint does
|
|
29
|
+
* not declare is dropped.
|
|
30
|
+
*/
|
|
31
|
+
const toLogsListParams = (params: ApiParams, wireFields: string[]) =>
|
|
32
|
+
applyTransform(params, [
|
|
47
33
|
merge(getDefaultGetParams()),
|
|
48
|
-
({ date, ...rest }) => ({
|
|
49
|
-
...rest,
|
|
50
|
-
date: normalizeDatetimeRange(date),
|
|
51
|
-
}),
|
|
52
34
|
starToSearch('search'),
|
|
35
|
+
({ date, ...rest }: ApiParams) => {
|
|
36
|
+
const range = normalizeDatetimeRange(date);
|
|
37
|
+
return {
|
|
38
|
+
...rest,
|
|
39
|
+
// the generated param is `q`; `search` is what the datalist store sends
|
|
40
|
+
q: rest.q ?? rest.search,
|
|
41
|
+
sort: rest.sort || DEFAULT_SORT,
|
|
42
|
+
dateFrom: range?.from,
|
|
43
|
+
dateTo: range?.to,
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
sanitizeToWire(wireFields),
|
|
47
|
+
camelToSnake(),
|
|
53
48
|
]);
|
|
54
49
|
|
|
50
|
+
const getLogsByUserList = async ({ parentId, ...params }: ApiParams) => {
|
|
51
|
+
const requestParams = toLogsListParams(
|
|
52
|
+
{
|
|
53
|
+
...params,
|
|
54
|
+
// [Claude] the rows link to their changelog, whatever columns are shown
|
|
55
|
+
fields: params.fields && [
|
|
56
|
+
...params.fields,
|
|
57
|
+
'config_id',
|
|
58
|
+
],
|
|
59
|
+
objectId: params.object,
|
|
60
|
+
},
|
|
61
|
+
getShallowFieldsToSendFromZodSchema(
|
|
62
|
+
LoggerServiceSearchLogByUserIdQueryParams,
|
|
63
|
+
),
|
|
64
|
+
);
|
|
65
|
+
|
|
55
66
|
try {
|
|
56
67
|
const response = await getLoggerService().loggerServiceSearchLogByUserId(
|
|
57
68
|
Number(parentId),
|
|
58
|
-
|
|
59
|
-
page,
|
|
60
|
-
size,
|
|
61
|
-
// the generated param is `q`; `search` is what the datalist store sends
|
|
62
|
-
q: search,
|
|
63
|
-
sort: sort || DEFAULT_SORT,
|
|
64
|
-
fields: fields && [
|
|
65
|
-
...fields,
|
|
66
|
-
'config_id',
|
|
67
|
-
],
|
|
68
|
-
object_id: object,
|
|
69
|
-
action,
|
|
70
|
-
user_ip: userIp,
|
|
71
|
-
date_from: date?.from,
|
|
72
|
-
date_to: date?.to,
|
|
73
|
-
},
|
|
69
|
+
requestParams,
|
|
74
70
|
);
|
|
75
71
|
const { items, next } = applyTransform(response.data, [
|
|
76
72
|
snakeToCamel(),
|
|
@@ -87,55 +83,21 @@ const getLogsByUserList = async (params: ApiParams) => {
|
|
|
87
83
|
}
|
|
88
84
|
};
|
|
89
85
|
|
|
90
|
-
const getLogsByConfigList = async (params: ApiParams) => {
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
'from',
|
|
101
|
-
'to',
|
|
102
|
-
'userIp',
|
|
103
|
-
];
|
|
104
|
-
|
|
105
|
-
const {
|
|
106
|
-
parentId,
|
|
107
|
-
page,
|
|
108
|
-
size,
|
|
109
|
-
search,
|
|
110
|
-
sort,
|
|
111
|
-
fields,
|
|
112
|
-
action,
|
|
113
|
-
user,
|
|
114
|
-
from,
|
|
115
|
-
to,
|
|
116
|
-
userIp,
|
|
117
|
-
} = applyTransform(params, [
|
|
118
|
-
sanitize(fieldsToSend),
|
|
119
|
-
merge(getDefaultGetParams()),
|
|
120
|
-
starToSearch('search'),
|
|
121
|
-
]);
|
|
86
|
+
const getLogsByConfigList = async ({ parentId, ...params }: ApiParams) => {
|
|
87
|
+
const requestParams = toLogsListParams(
|
|
88
|
+
{
|
|
89
|
+
...params,
|
|
90
|
+
userId: params.user,
|
|
91
|
+
},
|
|
92
|
+
getShallowFieldsToSendFromZodSchema(
|
|
93
|
+
LoggerServiceSearchLogByConfigIdQueryParams,
|
|
94
|
+
),
|
|
95
|
+
);
|
|
122
96
|
|
|
123
97
|
try {
|
|
124
98
|
const response = await getLoggerService().loggerServiceSearchLogByConfigId(
|
|
125
99
|
Number(parentId),
|
|
126
|
-
|
|
127
|
-
page,
|
|
128
|
-
size,
|
|
129
|
-
// the generated param is `q`; `search` is what the datalist store sends
|
|
130
|
-
q: search,
|
|
131
|
-
sort: sort || DEFAULT_SORT,
|
|
132
|
-
fields,
|
|
133
|
-
user_id: user,
|
|
134
|
-
action,
|
|
135
|
-
user_ip: userIp,
|
|
136
|
-
date_from: from,
|
|
137
|
-
date_to: to,
|
|
138
|
-
},
|
|
100
|
+
requestParams,
|
|
139
101
|
);
|
|
140
102
|
const { items, next } = applyTransform(response.data, [
|
|
141
103
|
snakeToCamel(),
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { getShallowFieldsToSendFromZodSchema } from '@webitel/api-services/gen/utils';
|
|
2
|
+
import {
|
|
3
|
+
type AccessStoreToggleDefaultAccessBody,
|
|
4
|
+
type ClassesUpdateClassBody,
|
|
5
|
+
getAccessStore,
|
|
6
|
+
getClasses,
|
|
7
|
+
ListDefaultAccessQueryParams,
|
|
8
|
+
SearchClassesQueryParams,
|
|
9
|
+
} from '../../../gen-wire';
|
|
10
|
+
import { getDefaultGetListResponse, getDefaultGetParams } from '../../defaults';
|
|
11
|
+
import {
|
|
12
|
+
applyTransform,
|
|
13
|
+
camelToSnake,
|
|
14
|
+
merge,
|
|
15
|
+
mergeEach,
|
|
16
|
+
notify,
|
|
17
|
+
sanitizeToWire,
|
|
18
|
+
snakeToCamel,
|
|
19
|
+
starToSearch,
|
|
20
|
+
} from '../../transformers';
|
|
21
|
+
import {
|
|
22
|
+
generatePermissionsApi,
|
|
23
|
+
handlePermissionsList,
|
|
24
|
+
toAclFields,
|
|
25
|
+
} from '../_shared/generatePermissionsApi';
|
|
26
|
+
import type {
|
|
27
|
+
ApiId,
|
|
28
|
+
ApiParams,
|
|
29
|
+
GetItemParams,
|
|
30
|
+
PatchItemParams,
|
|
31
|
+
} from '../_shared/types';
|
|
32
|
+
|
|
33
|
+
const baseUrl = '/objclass';
|
|
34
|
+
|
|
35
|
+
/** [Claude] the "default" (RBAC) access of a class lives in the acl store, under this object name */
|
|
36
|
+
const rbacObjectName = 'objclass';
|
|
37
|
+
|
|
38
|
+
/*
|
|
39
|
+
[Claude] the gateway maps request and response bodies to one field (`body: "class"`,
|
|
40
|
+
`body: "list"`), so the wire carries that field's value itself: a plain class
|
|
41
|
+
object, a plain array of changes. The generated types describe the envelope,
|
|
42
|
+
hence the casts below.
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
const getObjectClassesList = async (params: ApiParams) => {
|
|
46
|
+
const defaultObject = {
|
|
47
|
+
class: '',
|
|
48
|
+
obac: false,
|
|
49
|
+
rbac: false,
|
|
50
|
+
id: 0,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const requestParams = applyTransform(params, [
|
|
54
|
+
merge(getDefaultGetParams()),
|
|
55
|
+
starToSearch('search'),
|
|
56
|
+
(params: ApiParams) => ({
|
|
57
|
+
...params,
|
|
58
|
+
class: params.search,
|
|
59
|
+
// [Claude] the endpoint declares `sort` as string[]; the datalist sends a single string
|
|
60
|
+
sort:
|
|
61
|
+
typeof params.sort === 'string'
|
|
62
|
+
? [
|
|
63
|
+
params.sort,
|
|
64
|
+
]
|
|
65
|
+
: params.sort,
|
|
66
|
+
}),
|
|
67
|
+
sanitizeToWire(
|
|
68
|
+
getShallowFieldsToSendFromZodSchema(SearchClassesQueryParams),
|
|
69
|
+
),
|
|
70
|
+
camelToSnake(),
|
|
71
|
+
]);
|
|
72
|
+
try {
|
|
73
|
+
const response = await getClasses().searchClasses(requestParams);
|
|
74
|
+
const { items, next } = applyTransform(response.data, [
|
|
75
|
+
snakeToCamel(),
|
|
76
|
+
merge(getDefaultGetListResponse()),
|
|
77
|
+
]);
|
|
78
|
+
return {
|
|
79
|
+
items: applyTransform(items, [
|
|
80
|
+
mergeEach(defaultObject),
|
|
81
|
+
]),
|
|
82
|
+
next,
|
|
83
|
+
};
|
|
84
|
+
} catch (err) {
|
|
85
|
+
throw applyTransform(err, [
|
|
86
|
+
notify,
|
|
87
|
+
]);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const getObjectClass = async ({ itemId: id }: GetItemParams) => {
|
|
92
|
+
try {
|
|
93
|
+
const response = await getClasses().readClass(String(id));
|
|
94
|
+
return applyTransform(response.data, [
|
|
95
|
+
snakeToCamel(),
|
|
96
|
+
]);
|
|
97
|
+
} catch (err) {
|
|
98
|
+
throw applyTransform(err, [
|
|
99
|
+
notify,
|
|
100
|
+
]);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const patchObjectClass = async ({ changes, id }: PatchItemParams) => {
|
|
105
|
+
const body = applyTransform(changes, [
|
|
106
|
+
camelToSnake(),
|
|
107
|
+
]);
|
|
108
|
+
try {
|
|
109
|
+
const response = await getClasses().updateClass2(
|
|
110
|
+
String(id),
|
|
111
|
+
body as ClassesUpdateClassBody,
|
|
112
|
+
);
|
|
113
|
+
return applyTransform(response.data, [
|
|
114
|
+
snakeToCamel(),
|
|
115
|
+
]);
|
|
116
|
+
} catch (err) {
|
|
117
|
+
throw applyTransform(err, [
|
|
118
|
+
notify,
|
|
119
|
+
]);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/** [Claude] RBAC rows: which grantee gets which rights on the objects created by a grantor */
|
|
124
|
+
const getObjectClassRbacList = async ({
|
|
125
|
+
parentId,
|
|
126
|
+
...params
|
|
127
|
+
}: {
|
|
128
|
+
parentId: ApiId;
|
|
129
|
+
} & ApiParams) => {
|
|
130
|
+
const requestParams = applyTransform(params, [
|
|
131
|
+
merge(getDefaultGetParams()),
|
|
132
|
+
starToSearch('search'),
|
|
133
|
+
(params: ApiParams) => ({
|
|
134
|
+
...params,
|
|
135
|
+
q: params.search,
|
|
136
|
+
// [Claude] the endpoint declares `sort` as string[]; the datalist sends a single string
|
|
137
|
+
sort:
|
|
138
|
+
typeof params.sort === 'string'
|
|
139
|
+
? [
|
|
140
|
+
params.sort,
|
|
141
|
+
]
|
|
142
|
+
: params.sort,
|
|
143
|
+
}),
|
|
144
|
+
toAclFields,
|
|
145
|
+
sanitizeToWire(
|
|
146
|
+
getShallowFieldsToSendFromZodSchema(ListDefaultAccessQueryParams),
|
|
147
|
+
),
|
|
148
|
+
camelToSnake(),
|
|
149
|
+
]);
|
|
150
|
+
try {
|
|
151
|
+
const response = await getAccessStore().listDefaultAccess(
|
|
152
|
+
rbacObjectName,
|
|
153
|
+
String(parentId),
|
|
154
|
+
requestParams,
|
|
155
|
+
);
|
|
156
|
+
const { items, next } = applyTransform(response.data, [
|
|
157
|
+
snakeToCamel(),
|
|
158
|
+
merge(getDefaultGetListResponse()),
|
|
159
|
+
]);
|
|
160
|
+
return {
|
|
161
|
+
items: applyTransform(items, [
|
|
162
|
+
handlePermissionsList,
|
|
163
|
+
]),
|
|
164
|
+
next,
|
|
165
|
+
};
|
|
166
|
+
} catch (err) {
|
|
167
|
+
throw applyTransform(err, [
|
|
168
|
+
notify,
|
|
169
|
+
]);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const patchObjectClassRbac = async ({
|
|
174
|
+
parentId,
|
|
175
|
+
grantorId,
|
|
176
|
+
changes,
|
|
177
|
+
}: {
|
|
178
|
+
parentId: ApiId;
|
|
179
|
+
grantorId: ApiId;
|
|
180
|
+
changes: ApiParams[];
|
|
181
|
+
}) => {
|
|
182
|
+
const body = applyTransform(changes, [
|
|
183
|
+
camelToSnake(),
|
|
184
|
+
]);
|
|
185
|
+
try {
|
|
186
|
+
const response = await getAccessStore().toggleDefaultAccess(
|
|
187
|
+
rbacObjectName,
|
|
188
|
+
String(parentId),
|
|
189
|
+
String(grantorId),
|
|
190
|
+
body as AccessStoreToggleDefaultAccessBody,
|
|
191
|
+
);
|
|
192
|
+
return applyTransform(response.data, [
|
|
193
|
+
snakeToCamel(),
|
|
194
|
+
]);
|
|
195
|
+
} catch (err) {
|
|
196
|
+
throw applyTransform(err, [
|
|
197
|
+
notify,
|
|
198
|
+
]);
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export const ObjectClassesAPI = {
|
|
203
|
+
getList: getObjectClassesList,
|
|
204
|
+
get: getObjectClass,
|
|
205
|
+
patch: patchObjectClass,
|
|
206
|
+
|
|
207
|
+
getRbacList: getObjectClassRbacList,
|
|
208
|
+
patchRbac: patchObjectClassRbac,
|
|
209
|
+
|
|
210
|
+
...generatePermissionsApi(baseUrl),
|
|
211
|
+
};
|
|
@@ -428,7 +428,7 @@ export const QueuesAPI = {
|
|
|
428
428
|
getLookup: getQueuesLookup,
|
|
429
429
|
getQueuesTags,
|
|
430
430
|
getReportGeneral: getQueuesReportGeneral,
|
|
431
|
-
// `getPermissionsList` + `patchPermissions`, the pair
|
|
432
|
-
//
|
|
431
|
+
// `getPermissionsList` + `patchPermissions`, the pair createPermissionsStore
|
|
432
|
+
// of ui-datalist/permissions takes as its api.
|
|
433
433
|
...generatePermissionsApi(baseUrl),
|
|
434
434
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { applyTransform, notify } from '../../transformers';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* [Claude] not a backend api: a static index of the ringtones served from VITE_RINGTONES_URL
|
|
5
|
+
*/
|
|
6
|
+
export interface Ringtone {
|
|
7
|
+
name: string;
|
|
8
|
+
label: string;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const getRingtonesList = async (): Promise<Ringtone[]> => {
|
|
13
|
+
const url = `${import.meta.env.VITE_RINGTONES_URL}/index.json`;
|
|
14
|
+
try {
|
|
15
|
+
const response = await fetch(url);
|
|
16
|
+
if (!response.ok) {
|
|
17
|
+
throw new Error("Response from '...ringtones/index.json' was not ok");
|
|
18
|
+
}
|
|
19
|
+
const ringtones = await response.json();
|
|
20
|
+
return ringtones.ringtones;
|
|
21
|
+
} catch (err) {
|
|
22
|
+
throw applyTransform(err, [
|
|
23
|
+
notify,
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const RingtonesAPI = {
|
|
29
|
+
getList: getRingtonesList,
|
|
30
|
+
};
|