@ikatec/digisac-api-sdk 4.9.0 → 4.10.0

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 (283) hide show
  1. package/README.md +36 -12
  2. package/dist/apis/absence/AbsenceApi.cjs +12 -0
  3. package/dist/apis/absence/AbsenceApi.cjs.map +1 -1
  4. package/dist/apis/absence/AbsenceApi.d.ts +9 -0
  5. package/dist/apis/absence/AbsenceApi.d.ts.map +1 -1
  6. package/dist/apis/absence/AbsenceApi.mjs +12 -0
  7. package/dist/apis/absence/AbsenceApi.mjs.map +1 -1
  8. package/dist/apis/acceptanceTerms/AcceptanceTermsApi.cjs +8 -0
  9. package/dist/apis/acceptanceTerms/AcceptanceTermsApi.cjs.map +1 -1
  10. package/dist/apis/acceptanceTerms/AcceptanceTermsApi.d.ts +8 -1
  11. package/dist/apis/acceptanceTerms/AcceptanceTermsApi.d.ts.map +1 -1
  12. package/dist/apis/acceptanceTerms/AcceptanceTermsApi.mjs +8 -0
  13. package/dist/apis/acceptanceTerms/AcceptanceTermsApi.mjs.map +1 -1
  14. package/dist/apis/accounts/AccountsApi.cjs +5 -0
  15. package/dist/apis/accounts/AccountsApi.cjs.map +1 -1
  16. package/dist/apis/accounts/AccountsApi.d.ts +5 -0
  17. package/dist/apis/accounts/AccountsApi.d.ts.map +1 -1
  18. package/dist/apis/accounts/AccountsApi.mjs +5 -0
  19. package/dist/apis/accounts/AccountsApi.mjs.map +1 -1
  20. package/dist/apis/accounts/types.d.ts +2 -0
  21. package/dist/apis/accounts/types.d.ts.map +1 -1
  22. package/dist/apis/activityLog/ActivityLogApi.cjs +12 -0
  23. package/dist/apis/activityLog/ActivityLogApi.cjs.map +1 -1
  24. package/dist/apis/activityLog/ActivityLogApi.d.ts +8 -0
  25. package/dist/apis/activityLog/ActivityLogApi.d.ts.map +1 -1
  26. package/dist/apis/activityLog/ActivityLogApi.mjs +12 -0
  27. package/dist/apis/activityLog/ActivityLogApi.mjs.map +1 -1
  28. package/dist/apis/categories/CategoriesApi.cjs +7 -0
  29. package/dist/apis/categories/CategoriesApi.cjs.map +1 -1
  30. package/dist/apis/categories/CategoriesApi.d.ts +7 -1
  31. package/dist/apis/categories/CategoriesApi.d.ts.map +1 -1
  32. package/dist/apis/categories/CategoriesApi.mjs +7 -0
  33. package/dist/apis/categories/CategoriesApi.mjs.map +1 -1
  34. package/dist/apis/clientFeedback/ClientFeedbackApi.cjs +5 -1
  35. package/dist/apis/clientFeedback/ClientFeedbackApi.cjs.map +1 -1
  36. package/dist/apis/clientFeedback/ClientFeedbackApi.d.ts +5 -1
  37. package/dist/apis/clientFeedback/ClientFeedbackApi.d.ts.map +1 -1
  38. package/dist/apis/clientFeedback/ClientFeedbackApi.mjs +5 -1
  39. package/dist/apis/clientFeedback/ClientFeedbackApi.mjs.map +1 -1
  40. package/dist/apis/contactBlockLists/ContactBlockListsApi.cjs +8 -0
  41. package/dist/apis/contactBlockLists/ContactBlockListsApi.cjs.map +1 -1
  42. package/dist/apis/contactBlockLists/ContactBlockListsApi.d.ts +8 -1
  43. package/dist/apis/contactBlockLists/ContactBlockListsApi.d.ts.map +1 -1
  44. package/dist/apis/contactBlockLists/ContactBlockListsApi.mjs +8 -0
  45. package/dist/apis/contactBlockLists/ContactBlockListsApi.mjs.map +1 -1
  46. package/dist/apis/contactBlockListsControls/ContactBlockListsControlsApi.cjs +7 -0
  47. package/dist/apis/contactBlockListsControls/ContactBlockListsControlsApi.cjs.map +1 -1
  48. package/dist/apis/contactBlockListsControls/ContactBlockListsControlsApi.d.ts +7 -1
  49. package/dist/apis/contactBlockListsControls/ContactBlockListsControlsApi.d.ts.map +1 -1
  50. package/dist/apis/contactBlockListsControls/ContactBlockListsControlsApi.mjs +7 -0
  51. package/dist/apis/contactBlockListsControls/ContactBlockListsControlsApi.mjs.map +1 -1
  52. package/dist/apis/contacts/ContactsApi.cjs +16 -3
  53. package/dist/apis/contacts/ContactsApi.cjs.map +1 -1
  54. package/dist/apis/contacts/ContactsApi.d.ts +16 -5
  55. package/dist/apis/contacts/ContactsApi.d.ts.map +1 -1
  56. package/dist/apis/contacts/ContactsApi.mjs +16 -3
  57. package/dist/apis/contacts/ContactsApi.mjs.map +1 -1
  58. package/dist/apis/contacts/types.d.ts +6 -1
  59. package/dist/apis/contacts/types.d.ts.map +1 -1
  60. package/dist/apis/creditMovements/CreditMovementsApi.cjs +17 -0
  61. package/dist/apis/creditMovements/CreditMovementsApi.cjs.map +1 -1
  62. package/dist/apis/creditMovements/CreditMovementsApi.d.ts +11 -0
  63. package/dist/apis/creditMovements/CreditMovementsApi.d.ts.map +1 -1
  64. package/dist/apis/creditMovements/CreditMovementsApi.mjs +17 -0
  65. package/dist/apis/creditMovements/CreditMovementsApi.mjs.map +1 -1
  66. package/dist/apis/customFields/CustomFieldsApi.cjs +7 -0
  67. package/dist/apis/customFields/CustomFieldsApi.cjs.map +1 -1
  68. package/dist/apis/customFields/CustomFieldsApi.d.ts +7 -1
  69. package/dist/apis/customFields/CustomFieldsApi.d.ts.map +1 -1
  70. package/dist/apis/customFields/CustomFieldsApi.mjs +7 -0
  71. package/dist/apis/customFields/CustomFieldsApi.mjs.map +1 -1
  72. package/dist/apis/departments/DepartmentsApi.cjs +21 -0
  73. package/dist/apis/departments/DepartmentsApi.cjs.map +1 -1
  74. package/dist/apis/departments/DepartmentsApi.d.ts +20 -2
  75. package/dist/apis/departments/DepartmentsApi.d.ts.map +1 -1
  76. package/dist/apis/departments/DepartmentsApi.mjs +21 -0
  77. package/dist/apis/departments/DepartmentsApi.mjs.map +1 -1
  78. package/dist/apis/departments/types.d.ts +5 -0
  79. package/dist/apis/departments/types.d.ts.map +1 -1
  80. package/dist/apis/distribution/DistributionApi.cjs +7 -0
  81. package/dist/apis/distribution/DistributionApi.cjs.map +1 -1
  82. package/dist/apis/distribution/DistributionApi.d.ts +7 -1
  83. package/dist/apis/distribution/DistributionApi.d.ts.map +1 -1
  84. package/dist/apis/distribution/DistributionApi.mjs +7 -0
  85. package/dist/apis/distribution/DistributionApi.mjs.map +1 -1
  86. package/dist/apis/files/FilesApi.cjs +49 -0
  87. package/dist/apis/files/FilesApi.cjs.map +1 -1
  88. package/dist/apis/files/FilesApi.d.ts +45 -2
  89. package/dist/apis/files/FilesApi.d.ts.map +1 -1
  90. package/dist/apis/files/FilesApi.mjs +49 -0
  91. package/dist/apis/files/FilesApi.mjs.map +1 -1
  92. package/dist/apis/files/types.d.ts +45 -7
  93. package/dist/apis/files/types.d.ts.map +1 -1
  94. package/dist/apis/holiday/HolidayApi.cjs +7 -0
  95. package/dist/apis/holiday/HolidayApi.cjs.map +1 -1
  96. package/dist/apis/holiday/HolidayApi.d.ts +7 -1
  97. package/dist/apis/holiday/HolidayApi.d.ts.map +1 -1
  98. package/dist/apis/holiday/HolidayApi.mjs +7 -0
  99. package/dist/apis/holiday/HolidayApi.mjs.map +1 -1
  100. package/dist/apis/integrations/IntegrationsApi.cjs +7 -0
  101. package/dist/apis/integrations/IntegrationsApi.cjs.map +1 -1
  102. package/dist/apis/integrations/IntegrationsApi.d.ts +7 -1
  103. package/dist/apis/integrations/IntegrationsApi.d.ts.map +1 -1
  104. package/dist/apis/integrations/IntegrationsApi.mjs +7 -0
  105. package/dist/apis/integrations/IntegrationsApi.mjs.map +1 -1
  106. package/dist/apis/interactiveMessages/InteractiveMessagesApi.cjs +7 -0
  107. package/dist/apis/interactiveMessages/InteractiveMessagesApi.cjs.map +1 -1
  108. package/dist/apis/interactiveMessages/InteractiveMessagesApi.d.ts +7 -1
  109. package/dist/apis/interactiveMessages/InteractiveMessagesApi.d.ts.map +1 -1
  110. package/dist/apis/interactiveMessages/InteractiveMessagesApi.mjs +7 -0
  111. package/dist/apis/interactiveMessages/InteractiveMessagesApi.mjs.map +1 -1
  112. package/dist/apis/kanbanBoards/KanbanBoardsApi.cjs +7 -0
  113. package/dist/apis/kanbanBoards/KanbanBoardsApi.cjs.map +1 -1
  114. package/dist/apis/kanbanBoards/KanbanBoardsApi.d.ts +7 -1
  115. package/dist/apis/kanbanBoards/KanbanBoardsApi.d.ts.map +1 -1
  116. package/dist/apis/kanbanBoards/KanbanBoardsApi.mjs +7 -0
  117. package/dist/apis/kanbanBoards/KanbanBoardsApi.mjs.map +1 -1
  118. package/dist/apis/kanbanCards/KanbanCardsApi.cjs +7 -0
  119. package/dist/apis/kanbanCards/KanbanCardsApi.cjs.map +1 -1
  120. package/dist/apis/kanbanCards/KanbanCardsApi.d.ts +7 -1
  121. package/dist/apis/kanbanCards/KanbanCardsApi.d.ts.map +1 -1
  122. package/dist/apis/kanbanCards/KanbanCardsApi.mjs +7 -0
  123. package/dist/apis/kanbanCards/KanbanCardsApi.mjs.map +1 -1
  124. package/dist/apis/knowledgeBase/KnowledgeBaseApi.cjs +8 -0
  125. package/dist/apis/knowledgeBase/KnowledgeBaseApi.cjs.map +1 -1
  126. package/dist/apis/knowledgeBase/KnowledgeBaseApi.d.ts +8 -1
  127. package/dist/apis/knowledgeBase/KnowledgeBaseApi.d.ts.map +1 -1
  128. package/dist/apis/knowledgeBase/KnowledgeBaseApi.mjs +8 -0
  129. package/dist/apis/knowledgeBase/KnowledgeBaseApi.mjs.map +1 -1
  130. package/dist/apis/knowledgeBaseItem/KnowledgeBaseItemApi.cjs +8 -0
  131. package/dist/apis/knowledgeBaseItem/KnowledgeBaseItemApi.cjs.map +1 -1
  132. package/dist/apis/knowledgeBaseItem/KnowledgeBaseItemApi.d.ts +8 -1
  133. package/dist/apis/knowledgeBaseItem/KnowledgeBaseItemApi.d.ts.map +1 -1
  134. package/dist/apis/knowledgeBaseItem/KnowledgeBaseItemApi.mjs +8 -0
  135. package/dist/apis/knowledgeBaseItem/KnowledgeBaseItemApi.mjs.map +1 -1
  136. package/dist/apis/messages/MessagesApi.cjs +23 -3
  137. package/dist/apis/messages/MessagesApi.cjs.map +1 -1
  138. package/dist/apis/messages/MessagesApi.d.ts +19 -3
  139. package/dist/apis/messages/MessagesApi.d.ts.map +1 -1
  140. package/dist/apis/messages/MessagesApi.mjs +23 -3
  141. package/dist/apis/messages/MessagesApi.mjs.map +1 -1
  142. package/dist/apis/messages/types.d.ts +3 -0
  143. package/dist/apis/messages/types.d.ts.map +1 -1
  144. package/dist/apis/notifications/NotificationsApi.cjs +7 -0
  145. package/dist/apis/notifications/NotificationsApi.cjs.map +1 -1
  146. package/dist/apis/notifications/NotificationsApi.d.ts +7 -1
  147. package/dist/apis/notifications/NotificationsApi.d.ts.map +1 -1
  148. package/dist/apis/notifications/NotificationsApi.mjs +7 -0
  149. package/dist/apis/notifications/NotificationsApi.mjs.map +1 -1
  150. package/dist/apis/organizations/OrganizationsApi.cjs +7 -0
  151. package/dist/apis/organizations/OrganizationsApi.cjs.map +1 -1
  152. package/dist/apis/organizations/OrganizationsApi.d.ts +7 -1
  153. package/dist/apis/organizations/OrganizationsApi.d.ts.map +1 -1
  154. package/dist/apis/organizations/OrganizationsApi.mjs +7 -0
  155. package/dist/apis/organizations/OrganizationsApi.mjs.map +1 -1
  156. package/dist/apis/people/PeopleApi.cjs +7 -0
  157. package/dist/apis/people/PeopleApi.cjs.map +1 -1
  158. package/dist/apis/people/PeopleApi.d.ts +7 -1
  159. package/dist/apis/people/PeopleApi.d.ts.map +1 -1
  160. package/dist/apis/people/PeopleApi.mjs +7 -0
  161. package/dist/apis/people/PeopleApi.mjs.map +1 -1
  162. package/dist/apis/planAiHistory/PlanAiHistoryApi.cjs +16 -0
  163. package/dist/apis/planAiHistory/PlanAiHistoryApi.cjs.map +1 -1
  164. package/dist/apis/planAiHistory/PlanAiHistoryApi.d.ts +10 -0
  165. package/dist/apis/planAiHistory/PlanAiHistoryApi.d.ts.map +1 -1
  166. package/dist/apis/planAiHistory/PlanAiHistoryApi.mjs +16 -0
  167. package/dist/apis/planAiHistory/PlanAiHistoryApi.mjs.map +1 -1
  168. package/dist/apis/roles/RolesApi.cjs +7 -0
  169. package/dist/apis/roles/RolesApi.cjs.map +1 -1
  170. package/dist/apis/roles/RolesApi.d.ts +6 -1
  171. package/dist/apis/roles/RolesApi.d.ts.map +1 -1
  172. package/dist/apis/roles/RolesApi.mjs +7 -0
  173. package/dist/apis/roles/RolesApi.mjs.map +1 -1
  174. package/dist/apis/services/ServicesApi.cjs +68 -0
  175. package/dist/apis/services/ServicesApi.cjs.map +1 -1
  176. package/dist/apis/services/ServicesApi.d.ts +53 -1
  177. package/dist/apis/services/ServicesApi.d.ts.map +1 -1
  178. package/dist/apis/services/ServicesApi.mjs +68 -0
  179. package/dist/apis/services/ServicesApi.mjs.map +1 -1
  180. package/dist/apis/services/types.d.ts +15 -0
  181. package/dist/apis/services/types.d.ts.map +1 -1
  182. package/dist/apis/stickers/StickersApi.cjs +20 -0
  183. package/dist/apis/stickers/StickersApi.cjs.map +1 -1
  184. package/dist/apis/stickers/StickersApi.d.ts +15 -0
  185. package/dist/apis/stickers/StickersApi.d.ts.map +1 -1
  186. package/dist/apis/stickers/StickersApi.mjs +20 -0
  187. package/dist/apis/stickers/StickersApi.mjs.map +1 -1
  188. package/dist/apis/tags/TagsApi.cjs +7 -0
  189. package/dist/apis/tags/TagsApi.cjs.map +1 -1
  190. package/dist/apis/tags/TagsApi.d.ts +7 -1
  191. package/dist/apis/tags/TagsApi.d.ts.map +1 -1
  192. package/dist/apis/tags/TagsApi.mjs +7 -0
  193. package/dist/apis/tags/TagsApi.mjs.map +1 -1
  194. package/dist/apis/timetable/TimetableApi.cjs +7 -0
  195. package/dist/apis/timetable/TimetableApi.cjs.map +1 -1
  196. package/dist/apis/timetable/TimetableApi.d.ts +7 -1
  197. package/dist/apis/timetable/TimetableApi.d.ts.map +1 -1
  198. package/dist/apis/timetable/TimetableApi.mjs +7 -0
  199. package/dist/apis/timetable/TimetableApi.mjs.map +1 -1
  200. package/dist/apis/users/UsersApi.cjs +8 -0
  201. package/dist/apis/users/UsersApi.cjs.map +1 -1
  202. package/dist/apis/users/UsersApi.d.ts +8 -1
  203. package/dist/apis/users/UsersApi.d.ts.map +1 -1
  204. package/dist/apis/users/UsersApi.mjs +8 -0
  205. package/dist/apis/users/UsersApi.mjs.map +1 -1
  206. package/dist/apis/users/types.d.ts +15 -0
  207. package/dist/apis/users/types.d.ts.map +1 -1
  208. package/dist/apis/webhooks/WebhooksApi.cjs +7 -0
  209. package/dist/apis/webhooks/WebhooksApi.cjs.map +1 -1
  210. package/dist/apis/webhooks/WebhooksApi.d.ts +7 -1
  211. package/dist/apis/webhooks/WebhooksApi.d.ts.map +1 -1
  212. package/dist/apis/webhooks/WebhooksApi.mjs +7 -0
  213. package/dist/apis/webhooks/WebhooksApi.mjs.map +1 -1
  214. package/dist/core/ApiClient.d.ts +14 -0
  215. package/dist/core/ApiClient.d.ts.map +1 -1
  216. package/dist/core/ArchivableCrudApi.cjs.map +1 -1
  217. package/dist/core/ArchivableCrudApi.d.ts +1 -1
  218. package/dist/core/ArchivableCrudApi.d.ts.map +1 -1
  219. package/dist/core/ArchivableCrudApi.mjs.map +1 -1
  220. package/dist/core/BaseApiClient.cjs +24 -3
  221. package/dist/core/BaseApiClient.cjs.map +1 -1
  222. package/dist/core/BaseApiClient.d.ts +14 -0
  223. package/dist/core/BaseApiClient.d.ts.map +1 -1
  224. package/dist/core/BaseApiClient.mjs +24 -3
  225. package/dist/core/BaseApiClient.mjs.map +1 -1
  226. package/dist/core/requestExternal.cjs +33 -0
  227. package/dist/core/requestExternal.cjs.map +1 -0
  228. package/dist/core/requestExternal.d.ts +9 -0
  229. package/dist/core/requestExternal.d.ts.map +1 -0
  230. package/dist/core/requestExternal.mjs +32 -0
  231. package/dist/core/requestExternal.mjs.map +1 -0
  232. package/package.json +1 -1
  233. package/src/apis/absence/AbsenceApi.ts +19 -0
  234. package/src/apis/acceptanceTerms/AcceptanceTermsApi.ts +13 -1
  235. package/src/apis/accounts/AccountsApi.ts +5 -0
  236. package/src/apis/accounts/types.ts +2 -0
  237. package/src/apis/activityLog/ActivityLogApi.ts +18 -0
  238. package/src/apis/categories/CategoriesApi.ts +12 -1
  239. package/src/apis/clientFeedback/ClientFeedbackApi.ts +5 -1
  240. package/src/apis/contactBlockLists/ContactBlockListsApi.ts +13 -1
  241. package/src/apis/contactBlockListsControls/ContactBlockListsControlsApi.ts +12 -1
  242. package/src/apis/contacts/ContactsApi.test.ts +20 -4
  243. package/src/apis/contacts/ContactsApi.ts +24 -5
  244. package/src/apis/contacts/types.ts +7 -1
  245. package/src/apis/creditMovements/CreditMovementsApi.ts +27 -0
  246. package/src/apis/customFields/CustomFieldsApi.ts +12 -1
  247. package/src/apis/departments/DepartmentsApi.test.ts +88 -0
  248. package/src/apis/departments/DepartmentsApi.ts +41 -2
  249. package/src/apis/departments/types.ts +6 -0
  250. package/src/apis/distribution/DistributionApi.ts +12 -1
  251. package/src/apis/files/FilesApi.test.ts +122 -0
  252. package/src/apis/files/FilesApi.ts +107 -2
  253. package/src/apis/files/types.ts +48 -7
  254. package/src/apis/holiday/HolidayApi.ts +16 -1
  255. package/src/apis/integrations/IntegrationsApi.ts +12 -1
  256. package/src/apis/interactiveMessages/InteractiveMessagesApi.ts +12 -1
  257. package/src/apis/kanbanBoards/KanbanBoardsApi.ts +12 -1
  258. package/src/apis/kanbanCards/KanbanCardsApi.ts +12 -1
  259. package/src/apis/knowledgeBase/KnowledgeBaseApi.ts +13 -1
  260. package/src/apis/knowledgeBaseItem/KnowledgeBaseItemApi.ts +13 -1
  261. package/src/apis/messages/MessagesApi.test.ts +13 -7
  262. package/src/apis/messages/MessagesApi.ts +29 -3
  263. package/src/apis/messages/types.ts +3 -0
  264. package/src/apis/notifications/NotificationsApi.ts +12 -1
  265. package/src/apis/organizations/OrganizationsApi.ts +12 -1
  266. package/src/apis/payloads.test-d.ts +114 -0
  267. package/src/apis/people/PeopleApi.ts +16 -1
  268. package/src/apis/planAiHistory/PlanAiHistoryApi.ts +26 -0
  269. package/src/apis/roles/RolesApi.ts +10 -1
  270. package/src/apis/services/ServicesApi.test.ts +45 -0
  271. package/src/apis/services/ServicesApi.ts +91 -1
  272. package/src/apis/services/types.ts +16 -0
  273. package/src/apis/stickers/StickersApi.ts +32 -0
  274. package/src/apis/tags/TagsApi.ts +16 -1
  275. package/src/apis/timetable/TimetableApi.ts +12 -1
  276. package/src/apis/users/UsersApi.ts +17 -1
  277. package/src/apis/users/types.ts +11 -0
  278. package/src/apis/webhooks/WebhooksApi.ts +16 -1
  279. package/src/core/ApiClient.ts +24 -0
  280. package/src/core/ArchivableCrudApi.ts +2 -1
  281. package/src/core/BaseApiClient.test.ts +98 -0
  282. package/src/core/BaseApiClient.ts +49 -4
  283. package/src/core/requestExternal.ts +43 -0
@@ -46,6 +46,31 @@ import type { Ticket, TicketTransfer, TicketsCount, TicketsCounts } from './tick
46
46
  import { TimetableApi } from './timetable/TimetableApi'
47
47
  import { UsersApi } from './users/UsersApi'
48
48
 
49
+ import { AcceptanceTermsApi } from './acceptanceTerms/AcceptanceTermsApi'
50
+ import { CategoriesApi } from './categories/CategoriesApi'
51
+ import { ContactBlockListsApi } from './contactBlockLists/ContactBlockListsApi'
52
+ import { ContactBlockListsControlsApi } from './contactBlockListsControls/ContactBlockListsControlsApi'
53
+ import type { SummarizeTicketResult } from './contacts/types'
54
+ import { CustomFieldsApi } from './customFields/CustomFieldsApi'
55
+ import { DepartmentsApi } from './departments/DepartmentsApi'
56
+ import type { Department } from './departments/types'
57
+ import { DistributionApi } from './distribution/DistributionApi'
58
+ import { FilesApi } from './files/FilesApi'
59
+ import type { CreateToUploadResult, DeleteFileResult, File } from './files/types'
60
+ import { HolidayApi } from './holiday/HolidayApi'
61
+ import { IntegrationsApi } from './integrations/IntegrationsApi'
62
+ import { KanbanBoardsApi } from './kanbanBoards/KanbanBoardsApi'
63
+ import { KanbanCardsApi } from './kanbanCards/KanbanCardsApi'
64
+ import { KnowledgeBaseApi } from './knowledgeBase/KnowledgeBaseApi'
65
+ import { KnowledgeBaseItemApi } from './knowledgeBaseItem/KnowledgeBaseItemApi'
66
+ import { MessagesApi } from './messages/MessagesApi'
67
+ import { NotificationsApi } from './notifications/NotificationsApi'
68
+ import { OrganizationsApi } from './organizations/OrganizationsApi'
69
+ import { PeopleApi } from './people/PeopleApi'
70
+ import { ServicesApi } from './services/ServicesApi'
71
+ import type { UpdateUserPayload } from './users/types'
72
+ import { WebhooksApi } from './webhooks/WebhooksApi'
73
+
49
74
  declare const client: ApiClient
50
75
 
51
76
  // ── roles: the backend drops `permissionIds` in silence ─────────────
@@ -497,3 +522,92 @@ expectType<number | string | undefined>(listed.config.minInterval)
497
522
  expectType<CampaignMessage[] | undefined>(listed.messages)
498
523
  declare const campaignContact: CampaignContact
499
524
  expectType<string | null>(campaignContact.contactNumber)
525
+
526
+ // ── deleteById: what each route really answers ───────────────────────
527
+
528
+ expectType<Promise<'OK'>>(new DepartmentsApi(client).deleteById('d-1'))
529
+ expectType<Promise<'OK'>>(new UsersApi(client).deleteById('u-1'))
530
+ expectType<Promise<'OK'>>(new TagsApi(client).deleteById('t-1'))
531
+ expectType<Promise<'OK'>>(new KanbanBoardsApi(client).deleteById('b-1'))
532
+ expectType<Promise<'OK'>>(new KanbanCardsApi(client).deleteById('c-1'))
533
+ expectType<Promise<'OK'>>(new WebhooksApi(client).deleteById('w-1'))
534
+ expectType<Promise<'OK'>>(new CategoriesApi(client).deleteById('c-1'))
535
+ expectType<Promise<'OK'>>(new IntegrationsApi(client).deleteById('i-1'))
536
+ expectType<Promise<'OK'>>(new InteractiveMessagesApi(client).deleteById('i-1'))
537
+ expectType<Promise<'OK'>>(new NotificationsApi(client).deleteById('n-1'))
538
+ expectType<Promise<'OK'>>(new CustomFieldsApi(client).deleteById('f-1'))
539
+ expectType<Promise<'OK'>>(new HolidayApi(client).deleteById('h-1'))
540
+ expectType<Promise<'OK'>>(new PeopleApi(client).deleteById('p-1'))
541
+ expectType<Promise<'OK'>>(new OrganizationsApi(client).deleteById('o-1'))
542
+ expectType<Promise<'OK'>>(new TimetableApi(client).deleteById('t-1'))
543
+ expectType<Promise<'OK'>>(new ContactBlockListsApi(client).deleteById('l-1'))
544
+ expectType<Promise<'OK'>>(new ContactBlockListsControlsApi(client).deleteById('c-1'))
545
+ expectType<Promise<boolean>>(new RolesApi(client).deleteById('r-1'))
546
+ expectType<Promise<void>>(new AcceptanceTermsApi(client).deleteById('t-1'))
547
+ expectType<Promise<void>>(new DistributionApi(client).deleteById('d-1'))
548
+ expectType<Promise<false>>(new KnowledgeBaseApi(client).deleteById('k-1'))
549
+ expectType<Promise<false>>(new KnowledgeBaseItemApi(client).deleteById('k-1'))
550
+ expectType<Promise<DeleteFileResult>>(new FilesApi(client).deleteById('f-1'))
551
+
552
+ // ── services: archive through POST /:id/archive, with the type ───────
553
+
554
+ const services = new ServicesApi(client)
555
+ expectType<Promise<Record<string, never>>>(
556
+ services.archiveWithValidation('s-1', { archive: true, type: 'sms-wavy' }),
557
+ )
558
+ expectError(services.archiveWithValidation('s-1', { archive: true }))
559
+ expectType<Promise<'OK'>>(services.takeover('s-1'))
560
+ expectType<Promise<'OK'>>(services.logout('s-1'))
561
+ expectType<Promise<'OK'>>(services.shutdown('s-1'))
562
+ expectType<Promise<'OK'>>(services.start('s-1'))
563
+ expectType<Promise<'OK'>>(services.restart('s-1'))
564
+ expectAssignable<UpdateServicePayload>({ type: 'whatsapp', name: 'x', archivedAt: null })
565
+
566
+ // ── contacts, departments, messages, users ──────────────────────────
567
+
568
+ const contactsApi = new ContactsApi(client)
569
+ expectType<Promise<SummarizeTicketResult>>(contactsApi.summarizeTicket('c-1'))
570
+ expectType<Promise<string>>(contactsApi.exportTemplate({ serviceType: 'whatsapp' }))
571
+ expectType<Promise<Department>>(
572
+ new DepartmentsApi(client).archiveWithValidation('d-1', { archive: true }),
573
+ )
574
+ expectError(new DepartmentsApi(client).archiveWithValidation('d-1', {}))
575
+ new MessagesApi(client).updateById('m-1', { text: 'x', contactId: 'c-1', mentionedList: ['5511'] })
576
+ expectAssignable<UpdateUserPayload>({ restrictedServices: [{ value: 's-1' }], password: 'x' })
577
+ expectNotAssignable<UpdateUserPayload>({ restrictedServices: ['s-1'] })
578
+
579
+ // ── files: upload through a signed URL ──────────────────────────────
580
+
581
+ const files = new FilesApi(client)
582
+ expectType<Promise<CreateToUploadResult>>(
583
+ files.createToUpload({ name: 'a.txt', mimetype: 'text/plain' }),
584
+ )
585
+ expectError(files.createToUpload({ name: 'a.txt' }))
586
+ expectType<Promise<void>>(files.upload('https://storage/x', 'content', 'text/plain'))
587
+ expectAssignable<File>({
588
+ id: 'f-1',
589
+ url: 'https://x',
590
+ name: 'a.txt',
591
+ publicFilename: 'f-1.txt',
592
+ checksum: null,
593
+ mimetype: 'text/plain',
594
+ extension: 'txt',
595
+ data: {},
596
+ accountId: 'a-1',
597
+ createdAt: '2026-01-01T00:00:00Z',
598
+ updatedAt: '2026-01-01T00:00:00Z',
599
+ })
600
+
601
+ // ── a custom ApiClient without requestRaw is still an ApiClient ──────
602
+
603
+ expectAssignable<ApiClient>({
604
+ setAccessToken() {
605
+ return this
606
+ },
607
+ request: async <T>() => undefined as T,
608
+ get: async <T>() => undefined as T,
609
+ post: async <T>() => undefined as T,
610
+ put: async <T>() => undefined as T,
611
+ patch: async <T>() => undefined as T,
612
+ delete: async <T>() => undefined as T,
613
+ })
@@ -1,9 +1,24 @@
1
1
  import type { ApiClient } from '../../core/ApiClient'
2
+ import type { ListQuery } from '../../core/types'
2
3
  import { BaseCrudApi } from '../../core/BaseCrudApi'
3
4
  import type { Person, CreatePersonPayload, UpdatePersonPayload } from './types'
4
5
 
5
- export class PeopleApi extends BaseCrudApi<Person, CreatePersonPayload, UpdatePersonPayload> {
6
+ export class PeopleApi extends BaseCrudApi<
7
+ Person,
8
+ CreatePersonPayload,
9
+ UpdatePersonPayload,
10
+ ListQuery<Person>,
11
+ 'OK'
12
+ > {
6
13
  constructor(client: ApiClient) {
7
14
  super(client, '/people')
8
15
  }
16
+
17
+ /**
18
+ * Deletes a person. Resolves the text `'OK'`.
19
+ * @permissions people.view OR people.destroy
20
+ */
21
+ override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {
22
+ return super.deleteById(id, headers)
23
+ }
9
24
  }
@@ -2,6 +2,10 @@ import type { ApiClient } from '../../core/ApiClient'
2
2
  import { BaseCrudApi } from '../../core/BaseCrudApi'
3
3
  import type { PlanAiHistory, CreatePlanAiHistoryPayload, UpdatePlanAiHistoryPayload } from './types'
4
4
 
5
+ /**
6
+ * History of the AI products of the plan, only for reading: the records are written by super admin
7
+ * actions. The backend serves only `GET /plan-ai-history` and `GET /plan-ai-history/:id`.
8
+ */
5
9
  export class PlanAiHistoryApi extends BaseCrudApi<
6
10
  PlanAiHistory,
7
11
  CreatePlanAiHistoryPayload,
@@ -10,4 +14,26 @@ export class PlanAiHistoryApi extends BaseCrudApi<
10
14
  constructor(client: ApiClient) {
11
15
  super(client, '/plan-ai-history')
12
16
  }
17
+
18
+ /** @deprecated Not served: the backend has no POST /plan-ai-history, so this route answers 404. */
19
+ override create(
20
+ body: CreatePlanAiHistoryPayload,
21
+ headers?: Record<string, string>,
22
+ ): Promise<PlanAiHistory> {
23
+ return super.create(body, headers)
24
+ }
25
+
26
+ /** @deprecated Not served: the backend has no PUT /plan-ai-history/:id, so this route answers 404. */
27
+ override updateById(
28
+ id: string,
29
+ body: UpdatePlanAiHistoryPayload,
30
+ headers?: Record<string, string>,
31
+ ): Promise<PlanAiHistory> {
32
+ return super.updateById(id, body, headers)
33
+ }
34
+
35
+ /** @deprecated Not served: the backend has no DELETE /plan-ai-history/:id, so this route answers 404. */
36
+ override deleteById(id: string, headers?: Record<string, string>): Promise<PlanAiHistory> {
37
+ return super.deleteById(id, headers)
38
+ }
13
39
  }
@@ -6,9 +6,18 @@ export class RolesApi extends BaseCrudApi<
6
6
  Role,
7
7
  CreateRolePayload,
8
8
  UpdateRolePayload,
9
- RolesListQuery
9
+ RolesListQuery,
10
+ boolean
10
11
  > {
11
12
  constructor(client: ApiClient) {
12
13
  super(client, '/roles')
13
14
  }
15
+
16
+ /**
17
+ * Deletes a role. Resolves `true`.
18
+ * @permissions roles.destroy
19
+ */
20
+ override deleteById(id: string, headers?: Record<string, string>): Promise<boolean> {
21
+ return super.deleteById(id, headers)
22
+ }
14
23
  }
@@ -46,4 +46,49 @@ describe('ServicesApi', () => {
46
46
  expect(client.get).toHaveBeenCalledWith('/services/limits', headers)
47
47
  })
48
48
  })
49
+
50
+ describe('archiveWithValidation', () => {
51
+ it('calls client.post with /services/:id/archive, the archive flag and the type', async () => {
52
+ vi.mocked(client.post).mockResolvedValue({})
53
+ const result = await api.archiveWithValidation('svc-1', { archive: true, type: 'sms-wavy' })
54
+ expect(client.post).toHaveBeenCalledWith(
55
+ '/services/svc-1/archive',
56
+ { archive: true, type: 'sms-wavy' },
57
+ undefined,
58
+ )
59
+ expect(result).toEqual({})
60
+ })
61
+
62
+ it('restores with { archive: false } and forwards custom headers', async () => {
63
+ const headers = { 'X-Custom': 'value' }
64
+ await api.archiveWithValidation('svc-1', { archive: false, type: 'whatsapp' }, headers)
65
+ expect(client.post).toHaveBeenCalledWith(
66
+ '/services/svc-1/archive',
67
+ { archive: false, type: 'whatsapp' },
68
+ headers,
69
+ )
70
+ })
71
+ })
72
+
73
+ describe.each(['takeover', 'logout', 'shutdown', 'start', 'restart'] as const)(
74
+ '%s',
75
+ (operation) => {
76
+ it(`calls client.post with /services/:id/${operation} and resolves 'OK'`, async () => {
77
+ vi.mocked(client.post).mockResolvedValue('OK')
78
+ const result = await api[operation]('svc-1')
79
+ expect(client.post).toHaveBeenCalledWith(
80
+ `/services/svc-1/${operation}`,
81
+ undefined,
82
+ undefined,
83
+ )
84
+ expect(result).toBe('OK')
85
+ })
86
+
87
+ it('forwards custom headers', async () => {
88
+ const headers = { 'X-Custom': 'value' }
89
+ await api[operation]('svc-1', headers)
90
+ expect(client.post).toHaveBeenCalledWith(`/services/svc-1/${operation}`, undefined, headers)
91
+ })
92
+ },
93
+ )
49
94
  })
@@ -1,6 +1,12 @@
1
1
  import type { ApiClient } from '../../core/ApiClient'
2
2
  import { ArchivableCrudApi } from '../../core/ArchivableCrudApi'
3
- import type { Service, CreateServicePayload, ServiceLimits, UpdateServicePayload } from './types'
3
+ import type {
4
+ Service,
5
+ CreateServicePayload,
6
+ ServiceLimits,
7
+ UpdateServicePayload,
8
+ ArchiveServicePayload,
9
+ } from './types'
4
10
 
5
11
  export class ServicesApi extends ArchivableCrudApi<
6
12
  Service,
@@ -19,4 +25,88 @@ export class ServicesApi extends ArchivableCrudApi<
19
25
  getLimits(headers?: Record<string, string>): Promise<ServiceLimits> {
20
26
  return this.client.get<ServiceLimits>(`${this.basePath}/limits`, headers)
21
27
  }
28
+
29
+ /**
30
+ * @deprecated The backend does not archive a connection by `PUT { archivedAt }`: the PUT
31
+ * requires `type` (400 without it) and ignores `archivedAt`. Use {@link archiveWithValidation}.
32
+ */
33
+ override archive(id: string, headers?: Record<string, string>): Promise<Service> {
34
+ return super.archive(id, headers)
35
+ }
36
+
37
+ /**
38
+ * @deprecated The backend does not restore a connection by `PUT { archivedAt: null }`: the PUT
39
+ * requires `type` (400 without it) and ignores `archivedAt`. Use {@link archiveWithValidation}.
40
+ */
41
+ override unarchive(id: string, headers?: Record<string, string>): Promise<Service> {
42
+ return super.unarchive(id, headers)
43
+ }
44
+
45
+ /**
46
+ * Archives (`archive: true`) or restores (`archive: false`) a connection through the route used
47
+ * by the UI. Archiving shuts the connection down, closes its open tickets, marks its schedules
48
+ * as done and cancels its campaigns; restoring checks the plan limit of the `type` (400 when it
49
+ * is full).
50
+ *
51
+ * Resolves `{}` before the work is done (the route does not await it): poll `getById` until
52
+ * `archivedAt` changes. Send the `type` of the connection: without it the request is never
53
+ * answered.
54
+ * @permissions services.disabled
55
+ */
56
+ archiveWithValidation(
57
+ id: string,
58
+ body: ArchiveServicePayload,
59
+ headers?: Record<string, string>,
60
+ ): Promise<Record<string, never>> {
61
+ return this.client.post<Record<string, never>, ArchiveServicePayload>(
62
+ `${this.basePath}/${id}/archive`,
63
+ body,
64
+ headers,
65
+ )
66
+ }
67
+
68
+ /**
69
+ * Takes the session of the connection over to this server. Resolves the text `'OK'`; an
70
+ * unknown id answers 404 `Service not found.`.
71
+ * @permissions services.operate
72
+ */
73
+ takeover(id: string, headers?: Record<string, string>): Promise<'OK'> {
74
+ return this.client.post<'OK'>(`${this.basePath}/${id}/takeover`, undefined, headers)
75
+ }
76
+
77
+ /**
78
+ * Logs the connection out of the messaging service. Resolves the text `'OK'`; an unknown id
79
+ * answers 404 `Service not found.`.
80
+ * @permissions services.operate
81
+ */
82
+ logout(id: string, headers?: Record<string, string>): Promise<'OK'> {
83
+ return this.client.post<'OK'>(`${this.basePath}/${id}/logout`, undefined, headers)
84
+ }
85
+
86
+ /**
87
+ * Shuts the connection down. Resolves the text `'OK'`; an unknown id answers 404
88
+ * `Service not found.`.
89
+ * @permissions services.operate
90
+ */
91
+ shutdown(id: string, headers?: Record<string, string>): Promise<'OK'> {
92
+ return this.client.post<'OK'>(`${this.basePath}/${id}/shutdown`, undefined, headers)
93
+ }
94
+
95
+ /**
96
+ * Starts the connection. Resolves the text `'OK'`; an unknown id answers 404
97
+ * `Service not found.`.
98
+ * @permissions services.operate
99
+ */
100
+ start(id: string, headers?: Record<string, string>): Promise<'OK'> {
101
+ return this.client.post<'OK'>(`${this.basePath}/${id}/start`, undefined, headers)
102
+ }
103
+
104
+ /**
105
+ * Restarts the connection. Resolves the text `'OK'`; an unknown id answers 404
106
+ * `Service not found.`.
107
+ * @permissions services.operate
108
+ */
109
+ restart(id: string, headers?: Record<string, string>): Promise<'OK'> {
110
+ return this.client.post<'OK'>(`${this.basePath}/${id}/restart`, undefined, headers)
111
+ }
22
112
  }
@@ -253,6 +253,8 @@ export type ServiceRelationships = 'bot' | 'defaultDepartment'
253
253
  export type CreateServicePayload = {
254
254
  name: string
255
255
  type: ServiceType
256
+ /** Send `null`: without it the duplicate-name check never answers (SUS-3784). */
257
+ archivedAt?: null
256
258
  data?: ServiceData
257
259
  settings?: ServiceSettings
258
260
  defaultDepartmentId?: string
@@ -260,14 +262,28 @@ export type CreateServicePayload = {
260
262
  }
261
263
 
262
264
  export type UpdateServicePayload = {
265
+ /** Required by the backend (400 without it), although optional here for compatibility. */
266
+ type?: ServiceType
263
267
  name?: string
264
268
  data?: ServiceData
265
269
  settings?: ServiceSettings
266
270
  defaultDepartmentId?: string | null
267
271
  botId?: string | null
272
+ /**
273
+ * Ignored by the backend (archive through `ServicesApi.archiveWithValidation`). Send `null`
274
+ * with a `name`: without `archivedAt` the duplicate-name check never answers (SUS-3784).
275
+ */
268
276
  archivedAt?: string | null
269
277
  }
270
278
 
279
+ /** Body of `ServicesApi.archiveWithValidation`. */
280
+ export type ArchiveServicePayload = {
281
+ /** `true` archives, `false` restores. */
282
+ archive: boolean
283
+ /** The type of the connection, used by the plan limit check (the request hangs without it). */
284
+ type: ServiceType
285
+ }
286
+
271
287
  export type ServiceLimit = {
272
288
  used: number
273
289
  total: number
@@ -1,9 +1,41 @@
1
1
  import type { ApiClient } from '../../core/ApiClient'
2
2
  import { BaseCrudApi } from '../../core/BaseCrudApi'
3
+ import type { GetByIdQuery } from '../../core/types'
3
4
  import type { Sticker, CreateStickerPayload, UpdateStickerPayload } from './types'
4
5
 
6
+ /**
7
+ * Stickers of the account. The backend serves `GET /stickers` and `POST /stickers` (plus
8
+ * `GET /stickers/exist`, `POST /stickers/add` and `DELETE /stickers/remove/:stickerId`); there is
9
+ * no read by id, update nor `DELETE /stickers/:id`.
10
+ */
5
11
  export class StickersApi extends BaseCrudApi<Sticker, CreateStickerPayload, UpdateStickerPayload> {
6
12
  constructor(client: ApiClient) {
7
13
  super(client, '/stickers')
8
14
  }
15
+
16
+ /** @deprecated Not served: the backend has no GET /stickers/:id, so this route answers 404. */
17
+ override getById(
18
+ id: string,
19
+ query?: GetByIdQuery<Sticker>,
20
+ headers?: Record<string, string>,
21
+ ): Promise<Sticker> {
22
+ return super.getById(id, query, headers)
23
+ }
24
+
25
+ /** @deprecated Not served: the backend has no PUT /stickers/:id, so this route answers 404. */
26
+ override updateById(
27
+ id: string,
28
+ body: UpdateStickerPayload,
29
+ headers?: Record<string, string>,
30
+ ): Promise<Sticker> {
31
+ return super.updateById(id, body, headers)
32
+ }
33
+
34
+ /**
35
+ * @deprecated Not served: the backend has no DELETE /stickers/:id (it removes a sticker by
36
+ * `DELETE /stickers/remove/:stickerId`), so this route answers 404.
37
+ */
38
+ override deleteById(id: string, headers?: Record<string, string>): Promise<Sticker> {
39
+ return super.deleteById(id, headers)
40
+ }
9
41
  }
@@ -1,4 +1,5 @@
1
1
  import type { ApiClient } from '../../core/ApiClient'
2
+ import type { ListQuery } from '../../core/types'
2
3
  import { BaseCrudApi } from '../../core/BaseCrudApi'
3
4
  import type { ContactsSelection } from '../contacts/types'
4
5
  import type {
@@ -9,11 +10,25 @@ import type {
9
10
  UpdateTagPayload,
10
11
  } from './types'
11
12
 
12
- export class TagsApi extends BaseCrudApi<Tag, CreateTagPayload, UpdateTagPayload> {
13
+ export class TagsApi extends BaseCrudApi<
14
+ Tag,
15
+ CreateTagPayload,
16
+ UpdateTagPayload,
17
+ ListQuery<Tag>,
18
+ 'OK'
19
+ > {
13
20
  constructor(client: ApiClient) {
14
21
  super(client, '/tags')
15
22
  }
16
23
 
24
+ /**
25
+ * Deletes a tag. Resolves the text `'OK'`; an unknown id answers 500.
26
+ * @permissions tags.view OR tags.destroy
27
+ */
28
+ override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {
29
+ return super.deleteById(id, headers)
30
+ }
31
+
17
32
  /**
18
33
  * Adds the tag to every contact of the account that matches the selection. Resolves to `'OK'`,
19
34
  * or `false` when every contact already had the tag.
@@ -1,13 +1,24 @@
1
1
  import type { ApiClient } from '../../core/ApiClient'
2
+ import type { ListQuery } from '../../core/types'
2
3
  import { BaseCrudApi } from '../../core/BaseCrudApi'
3
4
  import type { Timetable, CreateTimetablePayload, UpdateTimetablePayload } from './types'
4
5
 
5
6
  export class TimetableApi extends BaseCrudApi<
6
7
  Timetable,
7
8
  CreateTimetablePayload,
8
- UpdateTimetablePayload
9
+ UpdateTimetablePayload,
10
+ ListQuery<Timetable>,
11
+ 'OK'
9
12
  > {
10
13
  constructor(client: ApiClient) {
11
14
  super(client, '/timetable')
12
15
  }
16
+
17
+ /**
18
+ * Deletes a timetable. Resolves the text `'OK'`.
19
+ * @permissions timetables.view OR timetables.destroy
20
+ */
21
+ override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {
22
+ return super.deleteById(id, headers)
23
+ }
13
24
  }
@@ -1,4 +1,5 @@
1
1
  import type { ApiClient } from '../../core/ApiClient'
2
+ import type { ListQuery } from '../../core/types'
2
3
  import { ArchivableCrudApi } from '../../core/ArchivableCrudApi'
3
4
  import type { Contact } from '../contacts/types'
4
5
  import type {
@@ -19,11 +20,26 @@ import type {
19
20
  ValidateUserImportResult,
20
21
  } from './types'
21
22
 
22
- export class UsersApi extends ArchivableCrudApi<User, CreateUserPayload, UpdateUserPayload> {
23
+ export class UsersApi extends ArchivableCrudApi<
24
+ User,
25
+ CreateUserPayload,
26
+ UpdateUserPayload,
27
+ ListQuery<User>,
28
+ 'OK'
29
+ > {
23
30
  constructor(client: ApiClient) {
24
31
  super(client, '/users')
25
32
  }
26
33
 
34
+ /**
35
+ * Deletes a user (removes it as the default user of the contacts and deletes its webhooks first).
36
+ * Resolves the text `'OK'`.
37
+ * @permissions users.destroy
38
+ */
39
+ override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {
40
+ return super.deleteById(id, headers)
41
+ }
42
+
27
43
  /**
28
44
  * Archives or restores a user through the dedicated route used by the UI, which also
29
45
  * sets the user offline and ends its sessions. The route enforces the business rules that
@@ -71,7 +71,10 @@ export type CreateUserPayload = {
71
71
  isClientUser?: boolean
72
72
  roles?: string[]
73
73
  departments?: string[]
74
+ /** @deprecated Not read by the backend: restrict the connections with `restrictedServices`. */
74
75
  services?: string[]
76
+ /** Connections the user cannot access, as `{ value: serviceId }`. */
77
+ restrictedServices?: { value: string }[]
75
78
  scheduleId?: string
76
79
  }
77
80
 
@@ -83,7 +86,15 @@ export type UpdateUserPayload = {
83
86
  isClientUser?: boolean
84
87
  roles?: string[]
85
88
  departments?: string[]
89
+ /** @deprecated Not read by the backend: restrict the connections with `restrictedServices`. */
86
90
  services?: string[]
91
+ /**
92
+ * Connections the user cannot access, as `{ value: serviceId }`. Every update without it (and
93
+ * every update of an admin) clears the restrictions of the user.
94
+ */
95
+ restrictedServices?: { value: string }[]
96
+ /** New password of the user. */
97
+ password?: string
87
98
  timetableId?: string | null
88
99
  preferences?: UserPreferences
89
100
  language?: string
@@ -1,9 +1,24 @@
1
1
  import type { ApiClient } from '../../core/ApiClient'
2
+ import type { ListQuery } from '../../core/types'
2
3
  import { BaseCrudApi } from '../../core/BaseCrudApi'
3
4
  import type { Webhook, CreateWebhookPayload, UpdateWebhookPayload } from './types'
4
5
 
5
- export class WebhooksApi extends BaseCrudApi<Webhook, CreateWebhookPayload, UpdateWebhookPayload> {
6
+ export class WebhooksApi extends BaseCrudApi<
7
+ Webhook,
8
+ CreateWebhookPayload,
9
+ UpdateWebhookPayload,
10
+ ListQuery<Webhook>,
11
+ 'OK'
12
+ > {
6
13
  constructor(client: ApiClient) {
7
14
  super(client, '/me/webhooks')
8
15
  }
16
+
17
+ /**
18
+ * Deletes a webhook. Resolves the text `'OK'`; an unknown id answers 500.
19
+ * @permissions settingsApi.update
20
+ */
21
+ override deleteById(id: string, headers?: Record<string, string>): Promise<'OK'> {
22
+ return super.deleteById(id, headers)
23
+ }
9
24
  }
@@ -32,4 +32,28 @@ export interface ApiClient {
32
32
  endpoint: string,
33
33
  headers?: Record<string, string>,
34
34
  ): Promise<TResponse>
35
+ /**
36
+ * Like {@link request}, but resolves the raw `Response` of a successful (2xx) call instead of
37
+ * the parsed body, for the routes whose headers matter (`Content-Type`, `Content-Disposition`)
38
+ * or whose body is binary (xlsx, pdf, files). Non-2xx still throws the `ApiError` subclass.
39
+ * Optional: a custom client without it cannot call the API methods that need the raw response.
40
+ */
41
+ requestRaw?<TBody = unknown>(
42
+ method: HttpMethod,
43
+ endpoint: string,
44
+ body?: TBody,
45
+ headers?: Record<string, string>,
46
+ ): Promise<Response>
47
+ /**
48
+ * Sends a request to an absolute URL outside the API (e.g. the signed storage URL of
49
+ * `FilesApi.upload`): no base URL, no `Authorization` header and no JSON serialization, `body`
50
+ * goes as is. Resolves the raw `Response` of a 2xx answer; non-2xx throws the `ApiError`
51
+ * subclass. Optional: without it, the API methods that need it send through the global `fetch`.
52
+ */
53
+ requestExternal?(
54
+ method: HttpMethod,
55
+ url: string,
56
+ body?: BodyInit,
57
+ headers?: Record<string, string>,
58
+ ): Promise<Response>
35
59
  }
@@ -17,7 +17,8 @@ export class ArchivableCrudApi<
17
17
  TCreate,
18
18
  TUpdate extends { archivedAt?: string | null } = TCreate & { archivedAt?: string | null },
19
19
  TQuery extends ListQuery<TResponse> = ListQuery<TResponse>,
20
- > extends BaseCrudApi<TResponse, TCreate, TUpdate, TQuery> {
20
+ TDeleteResponse = TResponse,
21
+ > extends BaseCrudApi<TResponse, TCreate, TUpdate, TQuery, TDeleteResponse> {
21
22
  constructor(client: ApiClient, basePath: string) {
22
23
  super(client, basePath)
23
24
  }