@webitel/api-services 26.12.23 → 26.12.25

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.
Files changed (374) hide show
  1. package/package.json +1 -1
  2. package/src/api/clients/_shared/__tests__/generatePermissionsApi.spec.ts +37 -0
  3. package/src/api/clients/_shared/generatePermissionsApi.ts +26 -1
  4. package/src/api/clients/index.ts +3 -1
  5. package/src/api/clients/logs/logs.ts +56 -94
  6. package/src/api/clients/objectClasses/objectClasses.ts +211 -0
  7. package/src/api/clients/queues/queues.ts +2 -2
  8. package/src/api/clients/ringtones/ringtones.ts +30 -0
  9. package/src/api/clients/roles/roles.ts +227 -0
  10. package/src/api/clients/schemaVariables/schemaVariables.ts +21 -17
  11. package/src/api/clients/triggers/triggers.ts +19 -11
  12. package/src/api/clients/userSettings/userSettings.ts +21 -0
  13. package/src/enums/AccessMode/AccessMode.ts +8 -0
  14. package/src/enums/AccessRuleColumn/AccessRuleColumn.ts +11 -0
  15. package/src/enums/AccessRuleName/AccessRuleName.ts +10 -0
  16. package/src/enums/WebitelApplications/AdminSections.ts +45 -0
  17. package/src/enums/WebitelApplications/AuditorSections.ts +6 -0
  18. package/src/enums/WebitelApplications/CrmSections.ts +21 -0
  19. package/src/enums/WebitelApplications/SupervisorSections.ts +8 -0
  20. package/src/enums/WebitelApplications/WfmSections.ts +12 -0
  21. package/src/enums/WebitelApplications/WtApplication.ts +13 -0
  22. package/src/enums/index.ts +18 -0
  23. package/src/gen/_models/webitelKbTreeNode.ts +3 -0
  24. package/src/gen-wire/_models/webitelKbTreeNode.ts +3 -0
  25. package/src/gen-wire/access-store/access-store.msw.ts +491 -0
  26. package/src/gen-wire/agent-absence-service/agent-absence-service.msw.ts +985 -0
  27. package/src/gen-wire/agent-chat-service/agent-chat-service.msw.ts +986 -0
  28. package/src/gen-wire/agent-chat-tag-service/agent-chat-tag-service.msw.ts +76 -0
  29. package/src/gen-wire/agent-pause-cause-service/agent-pause-cause-service.msw.ts +1029 -0
  30. package/src/gen-wire/agent-service/agent-service.msw.ts +4444 -0
  31. package/src/gen-wire/agent-skill-service/agent-skill-service.msw.ts +1347 -0
  32. package/src/gen-wire/agent-team-service/agent-team-service.msw.ts +875 -0
  33. package/src/gen-wire/agent-working-conditions-service/agent-working-conditions-service.msw.ts +196 -0
  34. package/src/gen-wire/agent-working-schedule-service/agent-working-schedule-service.msw.ts +846 -0
  35. package/src/gen-wire/articles/articles.msw.ts +5132 -0
  36. package/src/gen-wire/articles/articles.zod.ts +10 -0
  37. package/src/gen-wire/attachments/attachments.msw.ts +387 -0
  38. package/src/gen-wire/audit-form-service/audit-form-service.msw.ts +3169 -0
  39. package/src/gen-wire/auth/auth.msw.ts +801 -0
  40. package/src/gen-wire/backend-profile-service/backend-profile-service.msw.ts +1131 -0
  41. package/src/gen-wire/bucket-service/bucket-service.msw.ts +330 -0
  42. package/src/gen-wire/calendar-service/calendar-service.msw.ts +1526 -0
  43. package/src/gen-wire/call-service/call-service.msw.ts +6221 -0
  44. package/src/gen-wire/case-articles/case-articles.msw.ts +656 -0
  45. package/src/gen-wire/case-comments/case-comments.msw.ts +1164 -0
  46. package/src/gen-wire/case-communications/case-communications.msw.ts +279 -0
  47. package/src/gen-wire/case-files/case-files.msw.ts +295 -0
  48. package/src/gen-wire/case-links/case-links.msw.ts +1002 -0
  49. package/src/gen-wire/case-timeline/case-timeline.msw.ts +1012 -0
  50. package/src/gen-wire/cases/cases.msw.ts +14299 -0
  51. package/src/gen-wire/cases-chat-catalog/cases-chat-catalog.msw.ts +992 -0
  52. package/src/gen-wire/catalogs/catalogs.msw.ts +4088 -0
  53. package/src/gen-wire/classes/classes.msw.ts +309 -0
  54. package/src/gen-wire/close-reason-groups/close-reason-groups.msw.ts +803 -0
  55. package/src/gen-wire/close-reasons/close-reasons.msw.ts +845 -0
  56. package/src/gen-wire/cognitive-profile-service/cognitive-profile-service.msw.ts +942 -0
  57. package/src/gen-wire/comments/comments.msw.ts +900 -0
  58. package/src/gen-wire/communication-type-service/communication-type-service.msw.ts +549 -0
  59. package/src/gen-wire/config-service/config-service.msw.ts +687 -0
  60. package/src/gen-wire/contact-groups/contact-groups.msw.ts +1494 -0
  61. package/src/gen-wire/contact-linking-service/contact-linking-service.msw.ts +96 -0
  62. package/src/gen-wire/contacts/contacts.msw.ts +12671 -0
  63. package/src/gen-wire/contacts-chat-catalog/contacts-chat-catalog.msw.ts +1571 -0
  64. package/src/gen-wire/customer/customer.msw.ts +1376 -0
  65. package/src/gen-wire/customers/customers.msw.ts +2279 -0
  66. package/src/gen-wire/devices/devices.msw.ts +2119 -0
  67. package/src/gen-wire/dictionaries/dictionaries.msw.ts +7852 -0
  68. package/src/gen-wire/domains/domains.msw.ts +218 -0
  69. package/src/gen-wire/dynamic-conditions/dynamic-conditions.msw.ts +1229 -0
  70. package/src/gen-wire/dynamic-groups/dynamic-groups.msw.ts +1685 -0
  71. package/src/gen-wire/email-profile-service/email-profile-service.msw.ts +1832 -0
  72. package/src/gen-wire/emails/emails.msw.ts +1627 -0
  73. package/src/gen-wire/embedding-models/embedding-models.msw.ts +1048 -0
  74. package/src/gen-wire/extensions/extensions.msw.ts +5062 -0
  75. package/src/gen-wire/feedback-service/feedback-service.msw.ts +149 -0
  76. package/src/gen-wire/file-policies-service/file-policies-service.msw.ts +1310 -0
  77. package/src/gen-wire/file-service/file-service.msw.ts +1442 -0
  78. package/src/gen-wire/file-transcript-service/file-transcript-service.msw.ts +290 -0
  79. package/src/gen-wire/forecast-calculation-service/forecast-calculation-service.msw.ts +837 -0
  80. package/src/gen-wire/ftsservice/ftsservice.msw.ts +90 -0
  81. package/src/gen-wire/groups/groups.msw.ts +5778 -0
  82. package/src/gen-wire/im-service-provider-v1-telegrambotservice/im-service-provider-v1-telegrambotservice.msw.ts +390 -0
  83. package/src/gen-wire/imclients/imclients.msw.ts +541 -0
  84. package/src/gen-wire/import-template-service/import-template-service.msw.ts +603 -0
  85. package/src/gen-wire/index.msw.ts +152 -0
  86. package/src/gen-wire/index.ts +1 -0
  87. package/src/gen-wire/knowledgebase-search/knowledgebase-search.msw.ts +94 -0
  88. package/src/gen-wire/labels/labels.msw.ts +784 -0
  89. package/src/gen-wire/languages/languages.msw.ts +1504 -0
  90. package/src/gen-wire/ldap/ldap.msw.ts +6443 -0
  91. package/src/gen-wire/list-service/list-service.msw.ts +1359 -0
  92. package/src/gen-wire/logger-service/logger-service.msw.ts +620 -0
  93. package/src/gen-wire/managers/managers.msw.ts +1508 -0
  94. package/src/gen-wire/media-file-service/media-file-service.msw.ts +429 -0
  95. package/src/gen-wire/meeting-service/meeting-service.msw.ts +179 -0
  96. package/src/gen-wire/member-service/member-service.msw.ts +5742 -0
  97. package/src/gen-wire/messages/messages.msw.ts +3663 -0
  98. package/src/gen-wire/oauth2-federation/oauth2-federation.msw.ts +1446 -0
  99. package/src/gen-wire/online-skills/online-skills.msw.ts +882 -0
  100. package/src/gen-wire/outbound-resource-group-service/outbound-resource-group-service.msw.ts +1417 -0
  101. package/src/gen-wire/outbound-resource-service/outbound-resource-service.msw.ts +2093 -0
  102. package/src/gen-wire/pause-template-service/pause-template-service.msw.ts +823 -0
  103. package/src/gen-wire/pdf-service/pdf-service.msw.ts +851 -0
  104. package/src/gen-wire/permissions/permissions.msw.ts +98 -0
  105. package/src/gen-wire/phones/phones.msw.ts +1627 -0
  106. package/src/gen-wire/photos/photos.msw.ts +1369 -0
  107. package/src/gen-wire/presence/presence.msw.ts +485 -0
  108. package/src/gen-wire/preset-query-service/preset-query-service.msw.ts +522 -0
  109. package/src/gen-wire/priorities/priorities.msw.ts +719 -0
  110. package/src/gen-wire/queue-bucket-service/queue-bucket-service.msw.ts +492 -0
  111. package/src/gen-wire/queue-hook-service/queue-hook-service.msw.ts +582 -0
  112. package/src/gen-wire/queue-resources-service/queue-resources-service.msw.ts +475 -0
  113. package/src/gen-wire/queue-service/queue-service.msw.ts +3759 -0
  114. package/src/gen-wire/queue-skill-service/queue-skill-service.msw.ts +672 -0
  115. package/src/gen-wire/quick-replies-service/quick-replies-service.msw.ts +1254 -0
  116. package/src/gen-wire/records/records.msw.ts +1847 -0
  117. package/src/gen-wire/region-service/region-service.msw.ts +528 -0
  118. package/src/gen-wire/related-cases/related-cases.msw.ts +1428 -0
  119. package/src/gen-wire/retrieval/retrieval.msw.ts +805 -0
  120. package/src/gen-wire/routing-chat-plan-service/routing-chat-plan-service.msw.ts +522 -0
  121. package/src/gen-wire/routing-outbound-call-service/routing-outbound-call-service.msw.ts +1057 -0
  122. package/src/gen-wire/routing-schema-service/routing-schema-service.msw.ts +1045 -0
  123. package/src/gen-wire/routing-variable-service/routing-variable-service.msw.ts +374 -0
  124. package/src/gen-wire/schema-variables-service/schema-variables-service.msw.ts +333 -0
  125. package/src/gen-wire/services/services.msw.ts +2921 -0
  126. package/src/gen-wire/shift-template-service/shift-template-service.msw.ts +727 -0
  127. package/src/gen-wire/skill-service/skill-service.msw.ts +1299 -0
  128. package/src/gen-wire/slaconditions/slaconditions.msw.ts +1087 -0
  129. package/src/gen-wire/slas/slas.msw.ts +1145 -0
  130. package/src/gen-wire/sources/sources.msw.ts +689 -0
  131. package/src/gen-wire/spaces/spaces.msw.ts +2456 -0
  132. package/src/gen-wire/status-conditions/status-conditions.msw.ts +897 -0
  133. package/src/gen-wire/statuses/statuses.msw.ts +791 -0
  134. package/src/gen-wire/system-setting-service/system-setting-service.msw.ts +343 -0
  135. package/src/gen-wire/tags/tags.msw.ts +133 -0
  136. package/src/gen-wire/team-chat-tag-service/team-chat-tag-service.msw.ts +214 -0
  137. package/src/gen-wire/team-hook-service/team-hook-service.msw.ts +552 -0
  138. package/src/gen-wire/team-trigger-service/team-trigger-service.msw.ts +669 -0
  139. package/src/gen-wire/timeline/timeline.msw.ts +1109 -0
  140. package/src/gen-wire/timezones/timezones.msw.ts +1523 -0
  141. package/src/gen-wire/trigger-service/trigger-service.msw.ts +1113 -0
  142. package/src/gen-wire/two-factor-authentication/two-factor-authentication.msw.ts +160 -0
  143. package/src/gen-wire/types/types.msw.ts +1696 -0
  144. package/src/gen-wire/user-access-tokens/user-access-tokens.msw.ts +1357 -0
  145. package/src/gen-wire/user-helper-service/user-helper-service.msw.ts +472 -0
  146. package/src/gen-wire/users/users.msw.ts +5595 -0
  147. package/src/gen-wire/variables/variables.msw.ts +1189 -0
  148. package/src/gen-wire/versions/versions.msw.ts +441 -0
  149. package/src/gen-wire/web-hook-service/web-hook-service.msw.ts +1128 -0
  150. package/src/gen-wire/webitel-im-api-gateway-v1-account/webitel-im-api-gateway-v1-account.msw.ts +986 -0
  151. package/src/gen-wire/webitel-im-api-gateway-v1-bots/webitel-im-api-gateway-v1-bots.msw.ts +253 -0
  152. package/src/gen-wire/webitel-im-api-gateway-v1-contacts/webitel-im-api-gateway-v1-contacts.msw.ts +246 -0
  153. package/src/gen-wire/webitel-im-api-gateway-v1-contactsettingsmanagement/webitel-im-api-gateway-v1-contactsettingsmanagement.msw.ts +148 -0
  154. package/src/gen-wire/webitel-im-api-gateway-v1-message/webitel-im-api-gateway-v1-message.msw.ts +1289 -0
  155. package/src/gen-wire/webitel-im-api-gateway-v1-messagehistory/webitel-im-api-gateway-v1-messagehistory.msw.ts +7390 -0
  156. package/src/gen-wire/webitel-im-api-gateway-v1-threadmanagement/webitel-im-api-gateway-v1-threadmanagement.msw.ts +15159 -0
  157. package/src/gen-wire/webitel-im-api-gateway-v1-threadpermission/webitel-im-api-gateway-v1-threadpermission.msw.ts +220 -0
  158. package/src/gen-wire/webitel-im-api-gateway-v1-threadpreviewservice/webitel-im-api-gateway-v1-threadpreviewservice.msw.ts +777 -0
  159. package/src/gen-wire/webitel-im-api-gateway-v1-threadtagmanagement/webitel-im-api-gateway-v1-threadtagmanagement.msw.ts +315 -0
  160. package/src/gen-wire/webitel-im-api-gateway-v1-updates/webitel-im-api-gateway-v1-updates.msw.ts +7922 -0
  161. package/src/gen-wire/webitel-im-api-provider-v1-facebookservice/webitel-im-api-provider-v1-facebookservice.msw.ts +504 -0
  162. package/src/gen-wire/webitel-im-api-provider-v1-instagramservice/webitel-im-api-provider-v1-instagramservice.msw.ts +341 -0
  163. package/src/gen-wire/webitel-im-api-provider-v1-metaappservice/webitel-im-api-provider-v1-metaappservice.msw.ts +395 -0
  164. package/src/gen-wire/webitel-im-api-provider-v1-metaoauthservice/webitel-im-api-provider-v1-metaoauthservice.msw.ts +170 -0
  165. package/src/gen-wire/webitel-im-api-provider-v1-viberbmservice/webitel-im-api-provider-v1-viberbmservice.msw.ts +426 -0
  166. package/src/gen-wire/webitel-im-api-provider-v1-whatsappservice/webitel-im-api-provider-v1-whatsappservice.msw.ts +383 -0
  167. package/src/gen-wire/webitel-im-provider-v1-customservice/webitel-im-provider-v1-customservice.msw.ts +586 -0
  168. package/src/gen-wire/webitel-im-provider-v1-facebookservice/webitel-im-provider-v1-facebookservice.msw.ts +610 -0
  169. package/src/gen-wire/webitel-im-provider-v1-gateservice/webitel-im-provider-v1-gateservice.msw.ts +183 -0
  170. package/src/gen-wire/webitel-im-provider-v1-gatetemplateservice/webitel-im-provider-v1-gatetemplateservice.msw.ts +195 -0
  171. package/src/gen-wire/webitel-im-provider-v1-instagramservice/webitel-im-provider-v1-instagramservice.msw.ts +442 -0
  172. package/src/gen-wire/webitel-im-provider-v1-metaappservice/webitel-im-provider-v1-metaappservice.msw.ts +514 -0
  173. package/src/gen-wire/webitel-im-provider-v1-metaoauthservice/webitel-im-provider-v1-metaoauthservice.msw.ts +166 -0
  174. package/src/gen-wire/webitel-im-provider-v1-providermessageservice/webitel-im-provider-v1-providermessageservice.msw.ts +466 -0
  175. package/src/gen-wire/webitel-im-provider-v1-viberbmservice/webitel-im-provider-v1-viberbmservice.msw.ts +662 -0
  176. package/src/gen-wire/webitel-im-provider-v1-viberservice/webitel-im-provider-v1-viberservice.msw.ts +550 -0
  177. package/src/gen-wire/webitel-im-provider-v1-whatsappservice/webitel-im-provider-v1-whatsappservice.msw.ts +573 -0
  178. package/src/gen-wire/working-condition-service/working-condition-service.msw.ts +925 -0
  179. package/src/gen-wire/working-schedule-service/working-schedule-service.msw.ts +1450 -0
  180. package/src/scripts/applicationsAccess/ApplicationsAccess.ts +372 -0
  181. package/src/scripts/applicationsAccess/__tests__/ApplicationsAccess.spec.ts +43 -0
  182. package/src/scripts/index.ts +10 -0
  183. package/src/scripts/resolveGrants/resolveGrants.ts +42 -0
  184. package/src/validations/changelog/__tests__/changelog.validations.spec.ts +41 -0
  185. package/src/validations/changelog/changelog.validations.ts +22 -0
  186. package/src/validations/index.ts +3 -0
  187. package/src/validations/role/__tests__/role.validations.spec.ts +53 -0
  188. package/src/validations/role/role.validations.ts +42 -0
  189. package/src/validations/schemaVariable/__tests__/schemaVariable.validations.spec.ts +50 -0
  190. package/src/validations/schemaVariable/schemaVariable.validations.ts +35 -0
  191. package/types/.tsbuildinfo +1 -1
  192. package/types/api/clients/_shared/generatePermissionsApi.d.ts +31 -0
  193. package/types/api/clients/index.d.ts +3 -0
  194. package/types/api/clients/logs/logs.d.ts +2 -2
  195. package/types/api/clients/objectClasses/objectClasses.d.ts +27 -0
  196. package/types/api/clients/ringtones/ringtones.d.ts +8 -0
  197. package/types/api/clients/roles/roles.d.ts +19 -0
  198. package/types/api/clients/userSettings/userSettings.d.ts +5 -0
  199. package/types/enums/AccessMode/AccessMode.d.ts +7 -0
  200. package/types/enums/AccessRuleColumn/AccessRuleColumn.d.ts +8 -0
  201. package/types/enums/AccessRuleName/AccessRuleName.d.ts +8 -0
  202. package/types/enums/WebitelApplications/AdminSections.d.ts +44 -0
  203. package/types/enums/WebitelApplications/AuditorSections.d.ts +4 -0
  204. package/types/enums/WebitelApplications/CrmSections.d.ts +16 -0
  205. package/types/enums/WebitelApplications/SupervisorSections.d.ts +6 -0
  206. package/types/enums/WebitelApplications/WfmSections.d.ts +9 -0
  207. package/types/enums/WebitelApplications/WtApplication.d.ts +12 -0
  208. package/types/enums/index.d.ts +10 -1
  209. package/types/gen/_models/webitelKbTreeNode.d.ts +3 -0
  210. package/types/gen-wire/_models/webitelKbTreeNode.d.ts +3 -0
  211. package/types/gen-wire/access-store/access-store.msw.d.ts +12 -0
  212. package/types/gen-wire/agent-absence-service/agent-absence-service.msw.d.ts +18 -0
  213. package/types/gen-wire/agent-chat-service/agent-chat-service.msw.d.ts +10 -0
  214. package/types/gen-wire/agent-chat-tag-service/agent-chat-tag-service.msw.d.ts +6 -0
  215. package/types/gen-wire/agent-pause-cause-service/agent-pause-cause-service.msw.d.ts +16 -0
  216. package/types/gen-wire/agent-service/agent-service.msw.d.ts +44 -0
  217. package/types/gen-wire/agent-skill-service/agent-skill-service.msw.d.ts +24 -0
  218. package/types/gen-wire/agent-team-service/agent-team-service.msw.d.ts +14 -0
  219. package/types/gen-wire/agent-working-conditions-service/agent-working-conditions-service.msw.d.ts +8 -0
  220. package/types/gen-wire/agent-working-schedule-service/agent-working-schedule-service.msw.d.ts +8 -0
  221. package/types/gen-wire/articles/articles.msw.d.ts +44 -0
  222. package/types/gen-wire/articles/articles.zod.d.ts +7 -0
  223. package/types/gen-wire/attachments/attachments.msw.d.ts +10 -0
  224. package/types/gen-wire/audit-form-service/audit-form-service.msw.d.ts +26 -0
  225. package/types/gen-wire/auth/auth.msw.d.ts +10 -0
  226. package/types/gen-wire/backend-profile-service/backend-profile-service.msw.d.ts +16 -0
  227. package/types/gen-wire/bucket-service/bucket-service.msw.d.ts +14 -0
  228. package/types/gen-wire/calendar-service/calendar-service.msw.d.ts +16 -0
  229. package/types/gen-wire/call-service/call-service.msw.d.ts +44 -0
  230. package/types/gen-wire/case-articles/case-articles.msw.d.ts +12 -0
  231. package/types/gen-wire/case-comments/case-comments.msw.d.ts +16 -0
  232. package/types/gen-wire/case-communications/case-communications.msw.d.ts +10 -0
  233. package/types/gen-wire/case-files/case-files.msw.d.ts +8 -0
  234. package/types/gen-wire/case-links/case-links.msw.d.ts +16 -0
  235. package/types/gen-wire/case-timeline/case-timeline.msw.d.ts +10 -0
  236. package/types/gen-wire/cases/cases.msw.d.ts +22 -0
  237. package/types/gen-wire/cases-chat-catalog/cases-chat-catalog.msw.d.ts +6 -0
  238. package/types/gen-wire/catalogs/catalogs.msw.d.ts +16 -0
  239. package/types/gen-wire/classes/classes.msw.d.ts +12 -0
  240. package/types/gen-wire/close-reason-groups/close-reason-groups.msw.d.ts +16 -0
  241. package/types/gen-wire/close-reasons/close-reasons.msw.d.ts +16 -0
  242. package/types/gen-wire/cognitive-profile-service/cognitive-profile-service.msw.d.ts +18 -0
  243. package/types/gen-wire/comments/comments.msw.d.ts +12 -0
  244. package/types/gen-wire/communication-type-service/communication-type-service.msw.d.ts +16 -0
  245. package/types/gen-wire/config-service/config-service.msw.d.ts +18 -0
  246. package/types/gen-wire/config-service/config-service.zod.d.ts +4 -4
  247. package/types/gen-wire/contact-groups/contact-groups.msw.d.ts +20 -0
  248. package/types/gen-wire/contact-linking-service/contact-linking-service.msw.d.ts +8 -0
  249. package/types/gen-wire/contacts/contacts.msw.d.ts +16 -0
  250. package/types/gen-wire/contacts-chat-catalog/contacts-chat-catalog.msw.d.ts +8 -0
  251. package/types/gen-wire/customer/customer.msw.d.ts +12 -0
  252. package/types/gen-wire/customers/customers.msw.d.ts +18 -0
  253. package/types/gen-wire/devices/devices.msw.d.ts +20 -0
  254. package/types/gen-wire/dictionaries/dictionaries.msw.d.ts +32 -0
  255. package/types/gen-wire/domains/domains.msw.d.ts +8 -0
  256. package/types/gen-wire/dynamic-conditions/dynamic-conditions.msw.d.ts +16 -0
  257. package/types/gen-wire/dynamic-groups/dynamic-groups.msw.d.ts +16 -0
  258. package/types/gen-wire/email-profile-service/email-profile-service.msw.d.ts +20 -0
  259. package/types/gen-wire/emails/emails.msw.d.ts +20 -0
  260. package/types/gen-wire/embedding-models/embedding-models.msw.d.ts +18 -0
  261. package/types/gen-wire/extensions/extensions.msw.d.ts +16 -0
  262. package/types/gen-wire/feedback-service/feedback-service.msw.d.ts +8 -0
  263. package/types/gen-wire/file-policies-service/file-policies-service.msw.d.ts +22 -0
  264. package/types/gen-wire/file-service/file-service.msw.d.ts +26 -0
  265. package/types/gen-wire/file-transcript-service/file-transcript-service.msw.d.ts +12 -0
  266. package/types/gen-wire/forecast-calculation-service/forecast-calculation-service.msw.d.ts +16 -0
  267. package/types/gen-wire/ftsservice/ftsservice.msw.d.ts +6 -0
  268. package/types/gen-wire/groups/groups.msw.d.ts +20 -0
  269. package/types/gen-wire/im-service-provider-v1-telegrambotservice/im-service-provider-v1-telegrambotservice.msw.d.ts +12 -0
  270. package/types/gen-wire/imclients/imclients.msw.d.ts +10 -0
  271. package/types/gen-wire/import-template-service/import-template-service.msw.d.ts +16 -0
  272. package/types/gen-wire/index.d.ts +1 -1
  273. package/types/gen-wire/index.msw.d.ts +152 -0
  274. package/types/gen-wire/knowledgebase-search/knowledgebase-search.msw.d.ts +6 -0
  275. package/types/gen-wire/labels/labels.msw.d.ts +14 -0
  276. package/types/gen-wire/languages/languages.msw.d.ts +18 -0
  277. package/types/gen-wire/ldap/ldap.msw.d.ts +46 -0
  278. package/types/gen-wire/list-service/list-service.msw.d.ts +26 -0
  279. package/types/gen-wire/logger-service/logger-service.msw.d.ts +12 -0
  280. package/types/gen-wire/logger-service/logger-service.zod.d.ts +4 -4
  281. package/types/gen-wire/managers/managers.msw.d.ts +20 -0
  282. package/types/gen-wire/media-file-service/media-file-service.msw.d.ts +10 -0
  283. package/types/gen-wire/meeting-service/meeting-service.msw.d.ts +10 -0
  284. package/types/gen-wire/member-service/member-service.msw.d.ts +54 -0
  285. package/types/gen-wire/messages/messages.msw.d.ts +16 -0
  286. package/types/gen-wire/oauth2-federation/oauth2-federation.msw.d.ts +18 -0
  287. package/types/gen-wire/online-skills/online-skills.msw.d.ts +16 -0
  288. package/types/gen-wire/outbound-resource-group-service/outbound-resource-group-service.msw.d.ts +24 -0
  289. package/types/gen-wire/outbound-resource-service/outbound-resource-service.msw.d.ts +30 -0
  290. package/types/gen-wire/pause-template-service/pause-template-service.msw.d.ts +14 -0
  291. package/types/gen-wire/pdf-service/pdf-service.msw.d.ts +22 -0
  292. package/types/gen-wire/permissions/permissions.msw.d.ts +6 -0
  293. package/types/gen-wire/phones/phones.msw.d.ts +20 -0
  294. package/types/gen-wire/photos/photos.msw.d.ts +20 -0
  295. package/types/gen-wire/presence/presence.msw.d.ts +8 -0
  296. package/types/gen-wire/preset-query-service/preset-query-service.msw.d.ts +16 -0
  297. package/types/gen-wire/priorities/priorities.msw.d.ts +16 -0
  298. package/types/gen-wire/queue-bucket-service/queue-bucket-service.msw.d.ts +16 -0
  299. package/types/gen-wire/queue-hook-service/queue-hook-service.msw.d.ts +16 -0
  300. package/types/gen-wire/queue-resources-service/queue-resources-service.msw.d.ts +14 -0
  301. package/types/gen-wire/queue-service/queue-service.msw.d.ts +24 -0
  302. package/types/gen-wire/queue-skill-service/queue-skill-service.msw.d.ts +16 -0
  303. package/types/gen-wire/quick-replies-service/quick-replies-service.msw.d.ts +16 -0
  304. package/types/gen-wire/records/records.msw.d.ts +16 -0
  305. package/types/gen-wire/region-service/region-service.msw.d.ts +16 -0
  306. package/types/gen-wire/related-cases/related-cases.msw.d.ts +16 -0
  307. package/types/gen-wire/retrieval/retrieval.msw.d.ts +14 -0
  308. package/types/gen-wire/routing-chat-plan-service/routing-chat-plan-service.msw.d.ts +16 -0
  309. package/types/gen-wire/routing-outbound-call-service/routing-outbound-call-service.msw.d.ts +18 -0
  310. package/types/gen-wire/routing-schema-service/routing-schema-service.msw.d.ts +18 -0
  311. package/types/gen-wire/routing-variable-service/routing-variable-service.msw.d.ts +14 -0
  312. package/types/gen-wire/schema-variables-service/schema-variables-service.msw.d.ts +16 -0
  313. package/types/gen-wire/services/services.msw.d.ts +16 -0
  314. package/types/gen-wire/shift-template-service/shift-template-service.msw.d.ts +14 -0
  315. package/types/gen-wire/skill-service/skill-service.msw.d.ts +22 -0
  316. package/types/gen-wire/slaconditions/slaconditions.msw.d.ts +16 -0
  317. package/types/gen-wire/slas/slas.msw.d.ts +16 -0
  318. package/types/gen-wire/sources/sources.msw.d.ts +16 -0
  319. package/types/gen-wire/spaces/spaces.msw.d.ts +26 -0
  320. package/types/gen-wire/status-conditions/status-conditions.msw.d.ts +16 -0
  321. package/types/gen-wire/statuses/statuses.msw.d.ts +16 -0
  322. package/types/gen-wire/system-setting-service/system-setting-service.msw.d.ts +18 -0
  323. package/types/gen-wire/tags/tags.msw.d.ts +8 -0
  324. package/types/gen-wire/team-chat-tag-service/team-chat-tag-service.msw.d.ts +12 -0
  325. package/types/gen-wire/team-hook-service/team-hook-service.msw.d.ts +16 -0
  326. package/types/gen-wire/team-trigger-service/team-trigger-service.msw.d.ts +20 -0
  327. package/types/gen-wire/timeline/timeline.msw.d.ts +10 -0
  328. package/types/gen-wire/timezones/timezones.msw.d.ts +20 -0
  329. package/types/gen-wire/trigger-service/trigger-service.msw.d.ts +20 -0
  330. package/types/gen-wire/two-factor-authentication/two-factor-authentication.msw.d.ts +8 -0
  331. package/types/gen-wire/types/types.msw.d.ts +8 -0
  332. package/types/gen-wire/user-access-tokens/user-access-tokens.msw.d.ts +16 -0
  333. package/types/gen-wire/user-helper-service/user-helper-service.msw.d.ts +10 -0
  334. package/types/gen-wire/users/users.msw.d.ts +34 -0
  335. package/types/gen-wire/variables/variables.msw.d.ts +18 -0
  336. package/types/gen-wire/versions/versions.msw.d.ts +10 -0
  337. package/types/gen-wire/web-hook-service/web-hook-service.msw.d.ts +16 -0
  338. package/types/gen-wire/webitel-im-api-gateway-v1-account/webitel-im-api-gateway-v1-account.msw.d.ts +14 -0
  339. package/types/gen-wire/webitel-im-api-gateway-v1-bots/webitel-im-api-gateway-v1-bots.msw.d.ts +10 -0
  340. package/types/gen-wire/webitel-im-api-gateway-v1-contacts/webitel-im-api-gateway-v1-contacts.msw.d.ts +6 -0
  341. package/types/gen-wire/webitel-im-api-gateway-v1-contactsettingsmanagement/webitel-im-api-gateway-v1-contactsettingsmanagement.msw.d.ts +8 -0
  342. package/types/gen-wire/webitel-im-api-gateway-v1-message/webitel-im-api-gateway-v1-message.msw.d.ts +32 -0
  343. package/types/gen-wire/webitel-im-api-gateway-v1-messagehistory/webitel-im-api-gateway-v1-messagehistory.msw.d.ts +12 -0
  344. package/types/gen-wire/webitel-im-api-gateway-v1-threadmanagement/webitel-im-api-gateway-v1-threadmanagement.msw.d.ts +36 -0
  345. package/types/gen-wire/webitel-im-api-gateway-v1-threadpermission/webitel-im-api-gateway-v1-threadpermission.msw.d.ts +8 -0
  346. package/types/gen-wire/webitel-im-api-gateway-v1-threadpreviewservice/webitel-im-api-gateway-v1-threadpreviewservice.msw.d.ts +10 -0
  347. package/types/gen-wire/webitel-im-api-gateway-v1-threadtagmanagement/webitel-im-api-gateway-v1-threadtagmanagement.msw.d.ts +16 -0
  348. package/types/gen-wire/webitel-im-api-gateway-v1-updates/webitel-im-api-gateway-v1-updates.msw.d.ts +6 -0
  349. package/types/gen-wire/webitel-im-api-provider-v1-facebookservice/webitel-im-api-provider-v1-facebookservice.msw.d.ts +18 -0
  350. package/types/gen-wire/webitel-im-api-provider-v1-instagramservice/webitel-im-api-provider-v1-instagramservice.msw.d.ts +10 -0
  351. package/types/gen-wire/webitel-im-api-provider-v1-metaappservice/webitel-im-api-provider-v1-metaappservice.msw.d.ts +10 -0
  352. package/types/gen-wire/webitel-im-api-provider-v1-metaoauthservice/webitel-im-api-provider-v1-metaoauthservice.msw.d.ts +8 -0
  353. package/types/gen-wire/webitel-im-api-provider-v1-viberbmservice/webitel-im-api-provider-v1-viberbmservice.msw.d.ts +12 -0
  354. package/types/gen-wire/webitel-im-api-provider-v1-whatsappservice/webitel-im-api-provider-v1-whatsappservice.msw.d.ts +10 -0
  355. package/types/gen-wire/webitel-im-provider-v1-customservice/webitel-im-provider-v1-customservice.msw.d.ts +12 -0
  356. package/types/gen-wire/webitel-im-provider-v1-facebookservice/webitel-im-provider-v1-facebookservice.msw.d.ts +20 -0
  357. package/types/gen-wire/webitel-im-provider-v1-gateservice/webitel-im-provider-v1-gateservice.msw.d.ts +6 -0
  358. package/types/gen-wire/webitel-im-provider-v1-gatetemplateservice/webitel-im-provider-v1-gatetemplateservice.msw.d.ts +10 -0
  359. package/types/gen-wire/webitel-im-provider-v1-instagramservice/webitel-im-provider-v1-instagramservice.msw.d.ts +12 -0
  360. package/types/gen-wire/webitel-im-provider-v1-metaappservice/webitel-im-provider-v1-metaappservice.msw.d.ts +12 -0
  361. package/types/gen-wire/webitel-im-provider-v1-metaoauthservice/webitel-im-provider-v1-metaoauthservice.msw.d.ts +8 -0
  362. package/types/gen-wire/webitel-im-provider-v1-providermessageservice/webitel-im-provider-v1-providermessageservice.msw.d.ts +22 -0
  363. package/types/gen-wire/webitel-im-provider-v1-viberbmservice/webitel-im-provider-v1-viberbmservice.msw.d.ts +16 -0
  364. package/types/gen-wire/webitel-im-provider-v1-viberservice/webitel-im-provider-v1-viberservice.msw.d.ts +12 -0
  365. package/types/gen-wire/webitel-im-provider-v1-whatsappservice/webitel-im-provider-v1-whatsappservice.msw.d.ts +12 -0
  366. package/types/gen-wire/working-condition-service/working-condition-service.msw.d.ts +14 -0
  367. package/types/gen-wire/working-schedule-service/working-schedule-service.msw.d.ts +20 -0
  368. package/types/scripts/applicationsAccess/ApplicationsAccess.d.ts +45 -0
  369. package/types/scripts/index.d.ts +5 -1
  370. package/types/scripts/resolveGrants/resolveGrants.d.ts +11 -0
  371. package/types/validations/changelog/changelog.validations.d.ts +15 -0
  372. package/types/validations/index.d.ts +3 -0
  373. package/types/validations/role/role.validations.d.ts +34 -0
  374. package/types/validations/schemaVariable/schemaVariable.validations.d.ts +18 -0
@@ -0,0 +1,372 @@
1
+ import deepCopy from 'deep-copy';
2
+ import deepmerge from 'deepmerge';
3
+
4
+ import {
5
+ AdminSections,
6
+ AuditorSections,
7
+ CrmSections,
8
+ SupervisorSections,
9
+ WfmSections,
10
+ WtApplication,
11
+ } from '../../enums';
12
+
13
+ /** [Claude] every level optional, as the minified access the api keeps */
14
+ type PartialDeep<T> = {
15
+ [K in keyof T]?: T[K] extends object ? PartialDeep<T[K]> : T[K];
16
+ };
17
+
18
+ type BaseAccessSchema = {
19
+ _enabled: boolean;
20
+ _locale: string;
21
+ };
22
+
23
+ export type ApplicationsAccessSchema = {
24
+ [WtApplication.Agent]: BaseAccessSchema;
25
+ } & {
26
+ [WtApplication.History]: BaseAccessSchema;
27
+ } & {
28
+ [WtApplication.Analytics]: BaseAccessSchema;
29
+ } & {
30
+ [WtApplication.Supervisor]: BaseAccessSchema &
31
+ Partial<Record<SupervisorSections, BaseAccessSchema>>;
32
+ } & {
33
+ [WtApplication.Admin]: BaseAccessSchema &
34
+ Partial<Record<AdminSections, BaseAccessSchema>>;
35
+ } & {
36
+ [WtApplication.Audit]: BaseAccessSchema &
37
+ Partial<Record<AuditorSections, BaseAccessSchema>>;
38
+ } & {
39
+ [WtApplication.Crm]: BaseAccessSchema &
40
+ Partial<Record<CrmSections, BaseAccessSchema>>;
41
+ } & {
42
+ [WtApplication.Wfm]: BaseAccessSchema &
43
+ Partial<Record<WfmSections, BaseAccessSchema>>;
44
+ };
45
+
46
+ /**
47
+ * [Claude] The same tree walked by key, as the role access ui does: apps and
48
+ * sections are looked up by name, and crm adjunct types add `_custom` sections
49
+ * the schema above doesn't list.
50
+ */
51
+ // biome-ignore lint/suspicious/noExplicitAny: a node holds both its `_`-config and its sections
52
+ export type ApplicationsAccessTree = Record<string, Record<string, any>>;
53
+
54
+ const applicationsAccess = (value = true): ApplicationsAccessSchema => ({
55
+ [WtApplication.Agent]: {
56
+ _enabled: value,
57
+ _locale: `WtApplication.${WtApplication.Agent}.name`,
58
+ },
59
+ [WtApplication.History]: {
60
+ _enabled: value,
61
+ _locale: `WtApplication.${WtApplication.History}.name`,
62
+ },
63
+ [WtApplication.Analytics]: {
64
+ _enabled: value,
65
+ _locale: `WtApplication.${WtApplication.Analytics}.name`,
66
+ },
67
+ [WtApplication.Supervisor]: {
68
+ _enabled: value,
69
+ _locale: `WtApplication.${WtApplication.Supervisor}.name`,
70
+ [SupervisorSections.Queues]: {
71
+ _enabled: value,
72
+ _locale: `WtApplication.${WtApplication.Supervisor}.sections.${SupervisorSections.Queues}`,
73
+ },
74
+ [SupervisorSections.Agents]: {
75
+ _enabled: value,
76
+ _locale: `WtApplication.${WtApplication.Supervisor}.sections.${SupervisorSections.Agents}`,
77
+ },
78
+ [SupervisorSections.ActiveCalls]: {
79
+ _enabled: value,
80
+ _locale: `WtApplication.${WtApplication.Supervisor}.sections.${SupervisorSections.ActiveCalls}`,
81
+ },
82
+ },
83
+ [WtApplication.Admin]: {
84
+ _enabled: value,
85
+ _locale: `WtApplication.${WtApplication.Admin}.name`,
86
+ [AdminSections.License]: {
87
+ _enabled: value,
88
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.License}`,
89
+ },
90
+ [AdminSections.Users]: {
91
+ _enabled: value,
92
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Users}`,
93
+ },
94
+ [AdminSections.Devices]: {
95
+ _enabled: value,
96
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Devices}`,
97
+ },
98
+ [AdminSections.Flow]: {
99
+ _enabled: value,
100
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Flow}`,
101
+ },
102
+ [AdminSections.Dialplan]: {
103
+ _enabled: value,
104
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Dialplan}`,
105
+ },
106
+ [AdminSections.Gateways]: {
107
+ _enabled: value,
108
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Gateways}`,
109
+ },
110
+ [AdminSections.Chatplan]: {
111
+ _enabled: value,
112
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Chatplan}`,
113
+ },
114
+ [AdminSections.ChatGateways]: {
115
+ _enabled: value,
116
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.ChatGateways}`,
117
+ },
118
+ [AdminSections.Skills]: {
119
+ _enabled: value,
120
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Skills}`,
121
+ },
122
+ [AdminSections.Buckets]: {
123
+ _enabled: value,
124
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Buckets}`,
125
+ },
126
+ [AdminSections.Blacklist]: {
127
+ _enabled: value,
128
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Blacklist}`,
129
+ },
130
+ [AdminSections.Regions]: {
131
+ _enabled: value,
132
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Regions}`,
133
+ },
134
+ [AdminSections.Calendars]: {
135
+ _enabled: value,
136
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Calendars}`,
137
+ },
138
+ [AdminSections.Communications]: {
139
+ _enabled: value,
140
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Communications}`,
141
+ },
142
+ [AdminSections.PauseCause]: {
143
+ _enabled: value,
144
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.PauseCause}`,
145
+ },
146
+ [AdminSections.ActivityTypes]: {
147
+ _enabled: value,
148
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.ActivityTypes}`,
149
+ },
150
+ [AdminSections.Media]: {
151
+ _enabled: value,
152
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Media}`,
153
+ },
154
+ [AdminSections.QuickReplies]: {
155
+ _enabled: value,
156
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.QuickReplies}`,
157
+ },
158
+ [AdminSections.Agents]: {
159
+ _enabled: value,
160
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Agents}`,
161
+ },
162
+ [AdminSections.Teams]: {
163
+ _enabled: value,
164
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Teams}`,
165
+ },
166
+ [AdminSections.Resources]: {
167
+ _enabled: value,
168
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Resources}`,
169
+ },
170
+ [AdminSections.ResourceGroups]: {
171
+ _enabled: value,
172
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.ResourceGroups}`,
173
+ },
174
+ [AdminSections.Queues]: {
175
+ _enabled: value,
176
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Queues}`,
177
+ },
178
+ [AdminSections.Storage]: {
179
+ _enabled: value,
180
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Storage}`,
181
+ },
182
+ [AdminSections.StoragePolicies]: {
183
+ _enabled: value,
184
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.StoragePolicies}`,
185
+ },
186
+ [AdminSections.CognitiveProfiles]: {
187
+ _enabled: value,
188
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.CognitiveProfiles}`,
189
+ },
190
+ [AdminSections.EmailProfiles]: {
191
+ _enabled: value,
192
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.EmailProfiles}`,
193
+ },
194
+ [AdminSections.SingleSignOn]: {
195
+ _enabled: value,
196
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.SingleSignOn}`,
197
+ },
198
+ [AdminSections.ImportCsv]: {
199
+ _enabled: value,
200
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.ImportCsv}`,
201
+ },
202
+ [AdminSections.Triggers]: {
203
+ _enabled: value,
204
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Triggers}`,
205
+ },
206
+ [AdminSections.Roles]: {
207
+ _enabled: value,
208
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Roles}`,
209
+ },
210
+ [AdminSections.Objects]: {
211
+ _enabled: value,
212
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Objects}`,
213
+ },
214
+ [AdminSections.Changelogs]: {
215
+ _enabled: value,
216
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Changelogs}`,
217
+ },
218
+ [AdminSections.Configuration]: {
219
+ _enabled: value,
220
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Configuration}`,
221
+ },
222
+ [AdminSections.GlobalVariables]: {
223
+ _enabled: value,
224
+ _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.GlobalVariables}`,
225
+ },
226
+ },
227
+ [WtApplication.Audit]: {
228
+ _enabled: value,
229
+ _locale: `WtApplication.${WtApplication.Audit}.name`,
230
+ [AuditorSections.Scorecards]: {
231
+ _enabled: value,
232
+ _locale: `WtApplication.${WtApplication.Audit}.sections.${AuditorSections.Scorecards}`,
233
+ },
234
+ },
235
+ [WtApplication.Crm]: {
236
+ _enabled: value,
237
+ _locale: `WtApplication.${WtApplication.Crm}.name`,
238
+ [CrmSections.Contacts]: {
239
+ _enabled: value,
240
+ _locale: `WtApplication.${WtApplication.Crm}.sections.${CrmSections.Contacts}`,
241
+ },
242
+ [CrmSections.Cases]: {
243
+ _enabled: value,
244
+ _locale: `WtApplication.${WtApplication.Crm}.sections.${CrmSections.Cases}`,
245
+ },
246
+ [CrmSections.Slas]: {
247
+ _enabled: value,
248
+ _locale: `WtApplication.${WtApplication.Crm}.sections.${CrmSections.Slas}`,
249
+ },
250
+ [CrmSections.Sources]: {
251
+ _enabled: value,
252
+ _locale: `WtApplication.${WtApplication.Crm}.sections.${CrmSections.Sources}`,
253
+ },
254
+ [CrmSections.ServiceCatalogs]: {
255
+ _enabled: value,
256
+ _locale: `WtApplication.${WtApplication.Crm}.sections.${CrmSections.ServiceCatalogs}`,
257
+ },
258
+ [CrmSections.CloseReasonGroups]: {
259
+ _enabled: value,
260
+ _locale: `WtApplication.${WtApplication.Crm}.sections.${CrmSections.CloseReasonGroups}`,
261
+ },
262
+ [CrmSections.ContactGroups]: {
263
+ _enabled: value,
264
+ _locale: `WtApplication.${WtApplication.Crm}.sections.${CrmSections.ContactGroups}`,
265
+ },
266
+ [CrmSections.Priorities]: {
267
+ _enabled: value,
268
+ _locale: `WtApplication.${WtApplication.Crm}.sections.${CrmSections.Priorities}`,
269
+ },
270
+ [CrmSections.Statuses]: {
271
+ _enabled: value,
272
+ _locale: `WtApplication.${WtApplication.Crm}.sections.${CrmSections.Statuses}`,
273
+ },
274
+ [CrmSections.CasesExtensions]: {
275
+ _enabled: value,
276
+ _locale: `WtApplication.overrideApplicationsAccess.${WtApplication.Crm}.sections.${CrmSections.CasesExtensions}`,
277
+ },
278
+ [CrmSections.ContactsExtensions]: {
279
+ _enabled: value,
280
+ _locale: `WtApplication.overrideApplicationsAccess.${WtApplication.Crm}.sections.${CrmSections.ContactsExtensions}`,
281
+ },
282
+ [CrmSections.CustomLookups]: {
283
+ _enabled: value,
284
+ _locale: `WtApplication.overrideApplicationsAccess.${WtApplication.Crm}.sections.${CrmSections.CustomLookups}`,
285
+ },
286
+ },
287
+ [WtApplication.Wfm]: {
288
+ _enabled: value,
289
+ _locale: `WtApplication.${WtApplication.Wfm}.name`,
290
+ [WfmSections.Agents]: {
291
+ _enabled: value,
292
+ _locale: `WtApplication.${WtApplication.Wfm}.sections.${WfmSections.Agents}`,
293
+ },
294
+ [WfmSections.Schedules]: {
295
+ _enabled: value,
296
+ _locale: `WtApplication.${WtApplication.Wfm}.sections.${WfmSections.Schedules}`,
297
+ },
298
+ [WfmSections.ForecastCalculation]: {
299
+ _enabled: value,
300
+ _locale: `WtApplication.${WtApplication.Wfm}.sections.${WfmSections.ForecastCalculation}`,
301
+ },
302
+ [WfmSections.ShiftTemplates]: {
303
+ _enabled: value,
304
+ _locale: `WtApplication.${WtApplication.Wfm}.sections.${WfmSections.ShiftTemplates}`,
305
+ },
306
+ [WfmSections.PauseTemplates]: {
307
+ _enabled: value,
308
+ _locale: `WtApplication.${WtApplication.Wfm}.sections.${WfmSections.PauseTemplates}`,
309
+ },
310
+ [WfmSections.WorkingConditions]: {
311
+ _enabled: value,
312
+ _locale: `WtApplication.${WtApplication.Wfm}.sections.${WfmSections.WorkingConditions}`,
313
+ },
314
+ },
315
+ });
316
+
317
+ /**
318
+ */
319
+ export class ApplicationsAccess {
320
+ access: ApplicationsAccessSchema;
321
+
322
+ // value param could be passed to set same value for all options
323
+ constructor(
324
+ {
325
+ access,
326
+ value,
327
+ }: {
328
+ access?: PartialDeep<ApplicationsAccessSchema>;
329
+ value?: boolean;
330
+ } = {
331
+ value: true,
332
+ },
333
+ ) {
334
+ /* if access, deeply merge with falsy values schema
335
+ if no access, "not configured => full permissions" */
336
+ this.access = access
337
+ ? ApplicationsAccess.restore(access)
338
+ : applicationsAccess(value);
339
+ }
340
+
341
+ // minify schema for API sending
342
+ static minify(access: Record<string, unknown>) {
343
+ const rmEmptyKeys = (obj: Record<string, unknown>) => {
344
+ Object.keys(obj).forEach((key) => {
345
+ if (!obj[key] || key === '_locale') delete obj[key];
346
+ if (typeof obj[key] === 'object') {
347
+ const nested = obj[key] as Record<string, unknown>;
348
+ rmEmptyKeys(nested);
349
+
350
+ if (!Object.keys(nested).length) delete obj[key];
351
+ }
352
+ });
353
+ return obj;
354
+ };
355
+ return rmEmptyKeys(deepCopy(access));
356
+ }
357
+
358
+ // restore minified schema from API response
359
+ static restore(
360
+ access: PartialDeep<ApplicationsAccessSchema>,
361
+ ): ApplicationsAccessSchema {
362
+ return deepmerge(
363
+ applicationsAccess(false),
364
+ access,
365
+ ) as ApplicationsAccessSchema;
366
+ // return deepmerge(access, applicationsAccess(false));
367
+ }
368
+
369
+ getAccess() {
370
+ return this.access;
371
+ }
372
+ }
@@ -0,0 +1,43 @@
1
+ import { describe, expect, it } from 'vitest';
2
+
3
+ import { WfmSections, WtApplication } from '../../../enums';
4
+ import { ApplicationsAccess } from '../ApplicationsAccess';
5
+
6
+ const wfmSections = [
7
+ WfmSections.Agents,
8
+ WfmSections.Schedules,
9
+ WfmSections.ForecastCalculation,
10
+ WfmSections.ShiftTemplates,
11
+ WfmSections.PauseTemplates,
12
+ WfmSections.WorkingConditions,
13
+ ];
14
+
15
+ describe('ApplicationsAccess', () => {
16
+ it('includes WFM application with its sections', () => {
17
+ const { access } = new ApplicationsAccess();
18
+
19
+ expect(access[WtApplication.Wfm]._enabled).toBe(true);
20
+ expect(access[WtApplication.Wfm]._locale).toBe(
21
+ `WtApplication.${WtApplication.Wfm}.name`,
22
+ );
23
+ wfmSections.forEach((section) => {
24
+ expect(access[WtApplication.Wfm][section]).toEqual({
25
+ _enabled: true,
26
+ _locale: `WtApplication.${WtApplication.Wfm}.sections.${section}`,
27
+ });
28
+ });
29
+ });
30
+
31
+ it('restores WFM as disabled when it is missing from saved access', () => {
32
+ const { access } = new ApplicationsAccess({
33
+ access: {
34
+ [WtApplication.Crm]: {
35
+ _enabled: true,
36
+ },
37
+ },
38
+ });
39
+
40
+ expect(access[WtApplication.Wfm]._enabled).toBe(false);
41
+ expect(access[WtApplication.Wfm][WfmSections.Agents]?._enabled).toBe(false);
42
+ });
43
+ });
@@ -1,3 +1,8 @@
1
+ import {
2
+ ApplicationsAccess,
3
+ type ApplicationsAccessSchema,
4
+ type ApplicationsAccessTree,
5
+ } from './applicationsAccess/ApplicationsAccess';
1
6
  import convertDuration from './convertDuration/convertDuration';
2
7
  import convertDurationWithMilliseconds from './convertDuration/convertDurationWithMilliseconds';
3
8
  import { minToSec, secToMin } from './convertTimeUnits/convertTimeUnits';
@@ -8,6 +13,7 @@ import {
8
13
  normalizeDatetimeRange,
9
14
  normalizeToTimestamp,
10
15
  } from './normalizeDatetime/normalizeDatetime';
16
+ import { resolveGrants } from './resolveGrants/resolveGrants';
11
17
 
12
18
  export type {
13
19
  DatetimeRangeValue,
@@ -15,7 +21,10 @@ export type {
15
21
  NormalizeDatetimeValueParam,
16
22
  RelativeDatetimeRoundOption,
17
23
  } from './normalizeDatetime/normalizeDatetime';
24
+ export type { ResolveGrantsParams } from './resolveGrants/resolveGrants';
25
+ export type { ApplicationsAccessSchema, ApplicationsAccessTree };
18
26
  export {
27
+ ApplicationsAccess,
19
28
  convertDuration,
20
29
  convertDurationWithMilliseconds,
21
30
  downloadFile,
@@ -24,5 +33,6 @@ export {
24
33
  minToSec,
25
34
  normalizeDatetimeRange,
26
35
  normalizeToTimestamp,
36
+ resolveGrants,
27
37
  secToMin,
28
38
  };
@@ -0,0 +1,42 @@
1
+ import { AccessMode } from '../../enums/AccessMode/AccessMode';
2
+
3
+ export interface ResolveGrantsParams {
4
+ /** [Claude] what the row has for this rule now */
5
+ have: {
6
+ rule: string;
7
+ };
8
+ ruleName: string;
9
+ mode:
10
+ | {
11
+ id: number;
12
+ }
13
+ | number;
14
+ }
15
+
16
+ /*
17
+ [Claude] what to send for a rule, by what the row has and what is picked
18
+ has | patch | got
19
+ -----+-------+-----
20
+ - | w | w
21
+ w | w | -
22
+ - | ww | ww
23
+ w | ww | ww
24
+ ww | ww | w
25
+ ww | w | -
26
+ */
27
+ export const resolveGrants = ({
28
+ have,
29
+ ruleName,
30
+ mode,
31
+ }: ResolveGrantsParams): string | null => {
32
+ switch (typeof mode === 'number' ? mode : mode?.id) {
33
+ case AccessMode.Forbidden:
34
+ return ruleName;
35
+ case AccessMode.Allow:
36
+ return have.rule || ruleName;
37
+ case AccessMode.Manage:
38
+ return `${ruleName}${ruleName}`;
39
+ default:
40
+ return null;
41
+ }
42
+ };
@@ -0,0 +1,41 @@
1
+ import { getDefaultsFromZodSchema } from '@webitel/api-services/gen/utils';
2
+ import { describe, expect, it } from 'vitest';
3
+
4
+ import { changelogSchema } from '../changelog.validations';
5
+
6
+ const issuePaths = (result: ReturnType<typeof changelogSchema.safeParse>) =>
7
+ result.error?.issues.map(({ path }) => path.join('.')) ?? [];
8
+
9
+ const defaults = () => getDefaultsFromZodSchema(changelogSchema, {});
10
+
11
+ describe('changelogSchema', () => {
12
+ it('seeds a new changelog as a disabled weekly one kept for a week', () => {
13
+ expect(defaults()).toMatchObject({
14
+ daysToStore: 7,
15
+ period: 7,
16
+ enabled: false,
17
+ description: '',
18
+ });
19
+ });
20
+
21
+ it('requires the object', () => {
22
+ expect(issuePaths(changelogSchema.safeParse(defaults()))).toEqual([
23
+ 'object.id',
24
+ ]);
25
+ });
26
+
27
+ it('keeps the logs for a day at least', () => {
28
+ const result = changelogSchema.safeParse({
29
+ ...(defaults() as object),
30
+ object: {
31
+ id: 1,
32
+ name: 'schema',
33
+ },
34
+ daysToStore: 0,
35
+ });
36
+
37
+ expect(issuePaths(result)).toEqual([
38
+ 'daysToStore',
39
+ ]);
40
+ });
41
+ });
@@ -0,0 +1,22 @@
1
+ import type { LoggerConfig } from '@webitel/api-services/gen/models';
2
+ import { z } from 'zod';
3
+
4
+ import {
5
+ filledLookupSchema,
6
+ flexibleLookupSchema,
7
+ } from '../_shared/lookup.validations';
8
+ import type { ZodShape } from '../types';
9
+
10
+ export type ChangelogCard = LoggerConfig;
11
+
12
+ /** [Claude] Changelog card schema: which object is logged, where the logs go and for how long. */
13
+ export const changelogSchema = z.object<ZodShape<LoggerConfig>>({
14
+ id: z.number().optional(),
15
+ // [Claude] `.prefault`, not `.default`: zod 4's `.default({})` would skip the required check
16
+ object: filledLookupSchema.prefault({}),
17
+ storage: flexibleLookupSchema.optional().default({}),
18
+ daysToStore: z.number().min(1).default(7),
19
+ period: z.number().default(7),
20
+ enabled: z.boolean().default(false),
21
+ description: z.string().optional().default(''),
22
+ });
@@ -29,6 +29,7 @@ export * from './caseServiceCatalog/caseServiceCatalog.validations';
29
29
  export * from './caseSource/caseSource.validations';
30
30
  export * from './caseStatus/caseStatus.validations';
31
31
  export * from './caseStatusCondition/caseStatusCondition.validations';
32
+ export * from './changelog/changelog.validations';
32
33
  export * from './chatGateway/chatGateway.validations';
33
34
  export * from './chatplan/chatplan.validations';
34
35
  export * from './cognitiveProfile/cognitiveProfile.validations';
@@ -65,6 +66,8 @@ export * from './resource/resource.validations';
65
66
  export * from './resourceDisplay/resourceDisplay.validations';
66
67
  export * from './resourceGroup/resourceGroup.validations';
67
68
  export * from './resourceInGroup/resourceInGroup.validations';
69
+ export * from './role/role.validations';
70
+ export * from './schemaVariable/schemaVariable.validations';
68
71
  export * from './shiftTemplate/shiftTemplate.validations';
69
72
  export * from './skill/skill.validations';
70
73
  export * from './sla/sla.validations';
@@ -0,0 +1,53 @@
1
+ import { getDefaultsFromZodSchema } from '@webitel/api-services/gen/utils';
2
+ import { describe, expect, it } from 'vitest';
3
+
4
+ import { WtApplication } from '../../../enums';
5
+
6
+ import { roleSchema } from '../role.validations';
7
+
8
+ const issuePaths = (result: ReturnType<typeof roleSchema.safeParse>) =>
9
+ result.error?.issues.map(({ path }) => path.join('.')) ?? [];
10
+
11
+ const defaults = () => getDefaultsFromZodSchema(roleSchema, {});
12
+
13
+ describe('roleSchema', () => {
14
+ it('seeds a new role without permissions and with every app allowed', () => {
15
+ expect(defaults()).toMatchObject({
16
+ name: '',
17
+ description: '',
18
+ permissions: [],
19
+ metadata: {
20
+ access: {
21
+ [WtApplication.Admin]: {
22
+ _enabled: true,
23
+ },
24
+ },
25
+ },
26
+ });
27
+ });
28
+
29
+ it('requires the name', () => {
30
+ expect(issuePaths(roleSchema.safeParse(defaults()))).toEqual([
31
+ 'name',
32
+ ]);
33
+ });
34
+
35
+ it('keeps the access tree as is', () => {
36
+ const access = {
37
+ admin: {
38
+ _enabled: true,
39
+ users: {
40
+ _enabled: false,
41
+ },
42
+ },
43
+ };
44
+ const result = roleSchema.safeParse({
45
+ name: 'role',
46
+ metadata: {
47
+ access,
48
+ },
49
+ });
50
+
51
+ expect(result.data?.metadata.access).toEqual(access);
52
+ });
53
+ });
@@ -0,0 +1,42 @@
1
+ import { z } from 'zod';
2
+
3
+ import { ApplicationsAccess } from '../../scripts';
4
+
5
+ /** [Claude] a global action granted to the role, e.g. `playback_record_file` */
6
+ const rolePermissionSchema = z.looseObject({
7
+ id: z.string(),
8
+ name: z.string().optional(),
9
+ });
10
+
11
+ /**
12
+ * [Claude] The role's access to each app and its sections, as the tree built
13
+ * by `ApplicationsAccess`; a new role starts with everything allowed.
14
+ */
15
+ const roleMetadataSchema = z.looseObject({
16
+ access: z
17
+ .record(z.string(), z.unknown())
18
+ .default(() => new ApplicationsAccess().getAccess()),
19
+ });
20
+
21
+ export type RolePermission = z.infer<typeof rolePermissionSchema>;
22
+
23
+ export type RoleCard = {
24
+ id?: string | number;
25
+ name?: string;
26
+ description?: string;
27
+ permissions?: RolePermission[];
28
+ metadata?: z.infer<typeof roleMetadataSchema>;
29
+ };
30
+
31
+ export const roleSchema = z.object({
32
+ id: z
33
+ .union([
34
+ z.string(),
35
+ z.number(),
36
+ ])
37
+ .optional(),
38
+ name: z.string().min(1).default(''),
39
+ description: z.string().optional().default(''),
40
+ permissions: z.array(rolePermissionSchema).default([]),
41
+ metadata: roleMetadataSchema.prefault({}),
42
+ });