@webitel/api-services 26.8.46 → 26.8.48

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 (232) hide show
  1. package/package.json +1 -1
  2. package/src/api/clients/catalog/__tests__/catalog.spec.ts +79 -0
  3. package/src/api/clients/catalog/catalog.ts +16 -3
  4. package/src/gen/_models/apiUserSetting.ts +1 -0
  5. package/src/gen/_models/deleteMediaFileParams.ts +1 -0
  6. package/src/gen/_models/deleteRoleParams.ts +17 -0
  7. package/src/gen/_models/engineAttemptHistory.ts +1 -0
  8. package/src/gen/_models/engineCreateRoutingSchemaRequest.ts +1 -0
  9. package/src/gen/_models/engineCreateSchemaVariableRequest.ts +1 -0
  10. package/src/gen/_models/engineCreateSystemSettingRequest.ts +1 -0
  11. package/src/gen/_models/engineQueueType.ts +24 -0
  12. package/src/gen/_models/engineRoutingSchema.ts +1 -0
  13. package/src/gen/_models/engineRoutingSchemaServicePatchRoutingSchemaBody.ts +1 -0
  14. package/src/gen/_models/engineRoutingSchemaServiceUpdateRoutingSchemaBody.ts +1 -0
  15. package/src/gen/_models/engineSchemaVariable.ts +1 -0
  16. package/src/gen/_models/engineSchemaVariablesServicePatchSchemaVariableBody.ts +1 -0
  17. package/src/gen/_models/engineSchemaVariablesServiceUpdateSchemaVariableBody.ts +1 -0
  18. package/src/gen/_models/engineSchemaVersion.ts +1 -0
  19. package/src/gen/_models/engineSearchHistoryCallRequest.ts +2 -0
  20. package/src/gen/_models/engineSystemSetting.ts +1 -0
  21. package/src/gen/_models/engineSystemSettingServicePatchSystemSettingBody.ts +1 -0
  22. package/src/gen/_models/engineSystemSettingServiceUpdateSystemSettingBody.ts +1 -1
  23. package/src/gen/_models/index.ts +25 -2
  24. package/src/gen/_models/locateArticleParams.ts +13 -0
  25. package/src/gen/_models/readRoleParams.ts +15 -0
  26. package/src/gen/_models/roleMetadataParams.ts +17 -0
  27. package/src/gen/_models/searchHistoryCallExcludedQueueTypesItem.ts +24 -0
  28. package/src/gen/_models/searchHistoryCallParams.ts +2 -0
  29. package/src/gen/_models/searchRecordAvailableRolesParams.ts +53 -0
  30. package/src/gen/_models/searchRetrievalParams.ts +3 -2
  31. package/src/gen/_models/searchRetrievalTagMatch.ts +1 -0
  32. package/src/gen/_models/searchRolesParams.ts +50 -0
  33. package/src/gen/_models/updateArticle2Params.ts +13 -0
  34. package/src/gen/_models/updateArticleParams.ts +13 -0
  35. package/src/gen/_models/updateModel2Params.ts +13 -0
  36. package/src/gen/_models/updateModelParams.ts +13 -0
  37. package/src/gen/_models/updateSpace2Params.ts +13 -0
  38. package/src/gen/_models/updateSpaceParams.ts +13 -0
  39. package/src/gen/_models/webitelCasesCaseTimelinePostprocessingResult.ts +13 -0
  40. package/src/gen/_models/webitelCasesCaseTimelineVariable.ts +11 -0
  41. package/src/gen/_models/webitelCasesGetTimelineItemInfoResponse.ts +13 -0
  42. package/src/gen/_models/webitelImApiGatewayV1GetUpdatesRequest.ts +11 -0
  43. package/src/gen/_models/webitelImApiGatewayV1GetUpdatesResponse.ts +19 -0
  44. package/src/gen/_models/webitelImApiGatewayV1HistoryMessage.ts +0 -10
  45. package/src/gen/_models/webitelImApiGatewayV1MemberReadState.ts +19 -0
  46. package/src/gen/_models/webitelImApiGatewayV1SearchMessageHistoryResponse.ts +2 -0
  47. package/src/gen/_models/webitelImApiGatewayV1SearchThreadResponse.ts +2 -0
  48. package/src/gen/_models/webitelImApiGatewayV1Thread.ts +8 -0
  49. package/src/gen/_models/webitelImApiGatewayV1ThreadMemberChange.ts +15 -0
  50. package/src/gen/_models/webitelImApiGatewayV1ThreadMemberChangeAction.ts +16 -0
  51. package/src/gen/_models/webitelImApiGatewayV1ThreadUpdates.ts +27 -0
  52. package/src/gen/_models/webitelImApiGatewayV1UpdatedMessage.ts +41 -0
  53. package/src/gen/_models/webitelImApiGatewayV1UpdatedMessageMetadata.ts +10 -0
  54. package/src/gen/_models/webitelKbArticle.ts +3 -0
  55. package/src/gen/_models/webitelKbSemanticSearchRequest.ts +1 -1
  56. package/src/gen/_models/webitelKbTagMatch.ts +3 -1
  57. package/src/gen-wire/_models/deleteMediaFileParams.ts +1 -0
  58. package/src/gen-wire/_models/engineAttemptHistory.ts +1 -0
  59. package/src/gen-wire/_models/engineQueueType.ts +24 -0
  60. package/src/gen-wire/_models/engineSearchHistoryCallRequest.ts +2 -0
  61. package/src/gen-wire/_models/index.ts +20 -2
  62. package/src/gen-wire/_models/locateArticleParams.ts +13 -0
  63. package/src/gen-wire/_models/searchHistoryCallExcludedQueueTypesItem.ts +24 -0
  64. package/src/gen-wire/_models/searchHistoryCallParams.ts +2 -0
  65. package/src/gen-wire/_models/searchRetrievalParams.ts +3 -2
  66. package/src/gen-wire/_models/searchRetrievalTagMatch.ts +1 -0
  67. package/src/gen-wire/_models/updateArticle2Params.ts +13 -0
  68. package/src/gen-wire/_models/updateArticleParams.ts +13 -0
  69. package/src/gen-wire/_models/updateModel2Params.ts +13 -0
  70. package/src/gen-wire/_models/updateModelParams.ts +13 -0
  71. package/src/gen-wire/_models/updateSpace2Params.ts +13 -0
  72. package/src/gen-wire/_models/updateSpaceParams.ts +13 -0
  73. package/src/gen-wire/_models/webitelCasesCaseTimelinePostprocessingResult.ts +13 -0
  74. package/src/gen-wire/_models/webitelCasesCaseTimelineVariable.ts +11 -0
  75. package/src/gen-wire/_models/webitelCasesGetTimelineItemInfoResponse.ts +13 -0
  76. package/src/gen-wire/_models/webitelImApiGatewayV1GetUpdatesRequest.ts +11 -0
  77. package/src/gen-wire/_models/webitelImApiGatewayV1GetUpdatesResponse.ts +19 -0
  78. package/src/gen-wire/_models/webitelImApiGatewayV1HistoryMessage.ts +0 -10
  79. package/src/gen-wire/_models/webitelImApiGatewayV1MemberReadState.ts +19 -0
  80. package/src/gen-wire/_models/webitelImApiGatewayV1SearchMessageHistoryResponse.ts +2 -0
  81. package/src/gen-wire/_models/webitelImApiGatewayV1SearchThreadResponse.ts +2 -0
  82. package/src/gen-wire/_models/webitelImApiGatewayV1Thread.ts +8 -0
  83. package/src/gen-wire/_models/webitelImApiGatewayV1ThreadMemberChange.ts +15 -0
  84. package/src/gen-wire/_models/webitelImApiGatewayV1ThreadMemberChangeAction.ts +16 -0
  85. package/src/gen-wire/_models/webitelImApiGatewayV1ThreadUpdates.ts +27 -0
  86. package/src/gen-wire/_models/webitelImApiGatewayV1UpdatedMessage.ts +41 -0
  87. package/src/gen-wire/_models/webitelImApiGatewayV1UpdatedMessageMetadata.ts +10 -0
  88. package/src/gen-wire/_models/webitelKbArticle.ts +3 -0
  89. package/src/gen-wire/_models/webitelKbSemanticSearchRequest.ts +1 -1
  90. package/src/gen-wire/_models/webitelKbTagMatch.ts +3 -1
  91. package/src/gen-wire/articles/articles.ts +42 -3
  92. package/src/gen-wire/articles/articles.zod.ts +586 -0
  93. package/src/gen-wire/call-service/call-service.zod.ts +40 -0
  94. package/src/gen-wire/case-timeline/case-timeline.ts +15 -0
  95. package/src/gen-wire/case-timeline/case-timeline.zod.ts +35 -0
  96. package/src/gen-wire/embedding-models/embedding-models.ts +18 -2
  97. package/src/gen-wire/embedding-models/embedding-models.zod.ts +18 -0
  98. package/src/gen-wire/index.ts +41 -17
  99. package/src/gen-wire/index.zod.ts +1 -0
  100. package/src/gen-wire/media-file-service/media-file-service.zod.ts +1 -0
  101. package/src/gen-wire/member-service/member-service.zod.ts +1 -0
  102. package/src/gen-wire/retrieval/retrieval.zod.ts +6 -4
  103. package/src/gen-wire/spaces/spaces.ts +18 -10
  104. package/src/gen-wire/spaces/spaces.zod.ts +18 -0
  105. package/src/gen-wire/timeline/timeline.ts +3 -3
  106. package/src/gen-wire/timeline/timeline.zod.ts +2 -2
  107. package/src/gen-wire/webitel-im-api-gateway-v1-messagehistory/webitel-im-api-gateway-v1-messagehistory.zod.ts +18 -189
  108. package/src/gen-wire/webitel-im-api-gateway-v1-threadmanagement/webitel-im-api-gateway-v1-threadmanagement.zod.ts +597 -309
  109. package/src/gen-wire/webitel-im-api-gateway-v1-updates/webitel-im-api-gateway-v1-updates.ts +47 -0
  110. package/src/gen-wire/webitel-im-api-gateway-v1-updates/webitel-im-api-gateway-v1-updates.zod.ts +3350 -0
  111. package/src/validations/agentSkill/__tests__/agentSkill.validations.spec.ts +67 -0
  112. package/src/validations/agentSkill/agentSkill.validations.ts +9 -0
  113. package/src/validations/index.ts +1 -0
  114. package/types/.tsbuildinfo +1 -1
  115. package/types/api/clients/catalog/catalog.d.ts +4 -1
  116. package/types/gen/_models/apiUserSetting.d.ts +1 -0
  117. package/types/gen/_models/deleteMediaFileParams.d.ts +1 -0
  118. package/types/gen/_models/deleteRoleParams.d.ts +16 -0
  119. package/types/gen/_models/engineAttemptHistory.d.ts +1 -0
  120. package/types/gen/_models/engineCreateRoutingSchemaRequest.d.ts +1 -0
  121. package/types/gen/_models/engineCreateSchemaVariableRequest.d.ts +1 -0
  122. package/types/gen/_models/engineCreateSystemSettingRequest.d.ts +1 -0
  123. package/types/gen/_models/engineQueueType.d.ts +21 -0
  124. package/types/gen/_models/engineRoutingSchema.d.ts +1 -0
  125. package/types/gen/_models/engineRoutingSchemaServicePatchRoutingSchemaBody.d.ts +1 -0
  126. package/types/gen/_models/engineRoutingSchemaServiceUpdateRoutingSchemaBody.d.ts +1 -0
  127. package/types/gen/_models/engineSchemaVariable.d.ts +1 -0
  128. package/types/gen/_models/engineSchemaVariablesServicePatchSchemaVariableBody.d.ts +1 -0
  129. package/types/gen/_models/engineSchemaVariablesServiceUpdateSchemaVariableBody.d.ts +1 -0
  130. package/types/gen/_models/engineSchemaVersion.d.ts +1 -0
  131. package/types/gen/_models/engineSearchHistoryCallRequest.d.ts +2 -0
  132. package/types/gen/_models/engineSystemSetting.d.ts +1 -0
  133. package/types/gen/_models/engineSystemSettingServicePatchSystemSettingBody.d.ts +1 -0
  134. package/types/gen/_models/engineSystemSettingServiceUpdateSystemSettingBody.d.ts +1 -1
  135. package/types/gen/_models/index.d.ts +25 -2
  136. package/types/gen/_models/locateArticleParams.d.ts +12 -0
  137. package/types/gen/_models/readRoleParams.d.ts +14 -0
  138. package/types/gen/_models/roleMetadataParams.d.ts +16 -0
  139. package/types/gen/_models/searchHistoryCallExcludedQueueTypesItem.d.ts +21 -0
  140. package/types/gen/_models/searchHistoryCallParams.d.ts +2 -0
  141. package/types/gen/_models/searchRecordAvailableRolesParams.d.ts +52 -0
  142. package/types/gen/_models/searchRetrievalParams.d.ts +3 -2
  143. package/types/gen/_models/searchRetrievalTagMatch.d.ts +1 -0
  144. package/types/gen/_models/searchRolesParams.d.ts +49 -0
  145. package/types/gen/_models/updateArticle2Params.d.ts +12 -0
  146. package/types/gen/_models/updateArticleParams.d.ts +12 -0
  147. package/types/gen/_models/updateModel2Params.d.ts +12 -0
  148. package/types/gen/_models/updateModelParams.d.ts +12 -0
  149. package/types/gen/_models/updateSpace2Params.d.ts +12 -0
  150. package/types/gen/_models/updateSpaceParams.d.ts +12 -0
  151. package/types/gen/_models/webitelCasesCaseTimelinePostprocessingResult.d.ts +12 -0
  152. package/types/gen/_models/webitelCasesCaseTimelineVariable.d.ts +10 -0
  153. package/types/gen/_models/webitelCasesGetTimelineItemInfoResponse.d.ts +12 -0
  154. package/types/gen/_models/webitelImApiGatewayV1GetUpdatesRequest.d.ts +10 -0
  155. package/types/gen/_models/webitelImApiGatewayV1GetUpdatesResponse.d.ts +18 -0
  156. package/types/gen/_models/webitelImApiGatewayV1HistoryMessage.d.ts +0 -10
  157. package/types/gen/_models/webitelImApiGatewayV1MemberReadState.d.ts +18 -0
  158. package/types/gen/_models/webitelImApiGatewayV1SearchMessageHistoryResponse.d.ts +2 -0
  159. package/types/gen/_models/webitelImApiGatewayV1SearchThreadResponse.d.ts +2 -0
  160. package/types/gen/_models/webitelImApiGatewayV1Thread.d.ts +8 -0
  161. package/types/gen/_models/webitelImApiGatewayV1ThreadMemberChange.d.ts +14 -0
  162. package/types/gen/_models/webitelImApiGatewayV1ThreadMemberChangeAction.d.ts +12 -0
  163. package/types/gen/_models/webitelImApiGatewayV1ThreadUpdates.d.ts +26 -0
  164. package/types/gen/_models/webitelImApiGatewayV1UpdatedMessage.d.ts +40 -0
  165. package/types/gen/_models/webitelImApiGatewayV1UpdatedMessageMetadata.d.ts +9 -0
  166. package/types/gen/_models/webitelKbArticle.d.ts +3 -0
  167. package/types/gen/_models/webitelKbSemanticSearchRequest.d.ts +1 -1
  168. package/types/gen/_models/webitelKbTagMatch.d.ts +3 -1
  169. package/types/gen-wire/_models/deleteMediaFileParams.d.ts +1 -0
  170. package/types/gen-wire/_models/engineAttemptHistory.d.ts +1 -0
  171. package/types/gen-wire/_models/engineQueueType.d.ts +21 -0
  172. package/types/gen-wire/_models/engineSearchHistoryCallRequest.d.ts +2 -0
  173. package/types/gen-wire/_models/index.d.ts +20 -2
  174. package/types/gen-wire/_models/locateArticleParams.d.ts +12 -0
  175. package/types/gen-wire/_models/searchHistoryCallExcludedQueueTypesItem.d.ts +21 -0
  176. package/types/gen-wire/_models/searchHistoryCallParams.d.ts +2 -0
  177. package/types/gen-wire/_models/searchRetrievalParams.d.ts +3 -2
  178. package/types/gen-wire/_models/searchRetrievalTagMatch.d.ts +1 -0
  179. package/types/gen-wire/_models/updateArticle2Params.d.ts +12 -0
  180. package/types/gen-wire/_models/updateArticleParams.d.ts +12 -0
  181. package/types/gen-wire/_models/updateModel2Params.d.ts +12 -0
  182. package/types/gen-wire/_models/updateModelParams.d.ts +12 -0
  183. package/types/gen-wire/_models/updateSpace2Params.d.ts +12 -0
  184. package/types/gen-wire/_models/updateSpaceParams.d.ts +12 -0
  185. package/types/gen-wire/_models/webitelCasesCaseTimelinePostprocessingResult.d.ts +12 -0
  186. package/types/gen-wire/_models/webitelCasesCaseTimelineVariable.d.ts +10 -0
  187. package/types/gen-wire/_models/webitelCasesGetTimelineItemInfoResponse.d.ts +12 -0
  188. package/types/gen-wire/_models/webitelImApiGatewayV1GetUpdatesRequest.d.ts +10 -0
  189. package/types/gen-wire/_models/webitelImApiGatewayV1GetUpdatesResponse.d.ts +18 -0
  190. package/types/gen-wire/_models/webitelImApiGatewayV1HistoryMessage.d.ts +0 -10
  191. package/types/gen-wire/_models/webitelImApiGatewayV1MemberReadState.d.ts +18 -0
  192. package/types/gen-wire/_models/webitelImApiGatewayV1SearchMessageHistoryResponse.d.ts +2 -0
  193. package/types/gen-wire/_models/webitelImApiGatewayV1SearchThreadResponse.d.ts +2 -0
  194. package/types/gen-wire/_models/webitelImApiGatewayV1Thread.d.ts +8 -0
  195. package/types/gen-wire/_models/webitelImApiGatewayV1ThreadMemberChange.d.ts +14 -0
  196. package/types/gen-wire/_models/webitelImApiGatewayV1ThreadMemberChangeAction.d.ts +12 -0
  197. package/types/gen-wire/_models/webitelImApiGatewayV1ThreadUpdates.d.ts +26 -0
  198. package/types/gen-wire/_models/webitelImApiGatewayV1UpdatedMessage.d.ts +40 -0
  199. package/types/gen-wire/_models/webitelImApiGatewayV1UpdatedMessageMetadata.d.ts +9 -0
  200. package/types/gen-wire/_models/webitelKbArticle.d.ts +3 -0
  201. package/types/gen-wire/_models/webitelKbSemanticSearchRequest.d.ts +1 -1
  202. package/types/gen-wire/_models/webitelKbTagMatch.d.ts +3 -1
  203. package/types/gen-wire/articles/articles.d.ts +6 -4
  204. package/types/gen-wire/articles/articles.zod.d.ts +221 -0
  205. package/types/gen-wire/call-service/call-service.zod.d.ts +29 -0
  206. package/types/gen-wire/case-timeline/case-timeline.d.ts +3 -1
  207. package/types/gen-wire/case-timeline/case-timeline.zod.d.ts +23 -0
  208. package/types/gen-wire/embedding-models/embedding-models.d.ts +3 -3
  209. package/types/gen-wire/embedding-models/embedding-models.zod.d.ts +6 -0
  210. package/types/gen-wire/index.d.ts +10 -8
  211. package/types/gen-wire/index.zod.d.ts +1 -0
  212. package/types/gen-wire/media-file-service/media-file-service.zod.d.ts +1 -0
  213. package/types/gen-wire/member-service/member-service.zod.d.ts +1 -0
  214. package/types/gen-wire/retrieval/retrieval.zod.d.ts +4 -2
  215. package/types/gen-wire/spaces/spaces.d.ts +3 -3
  216. package/types/gen-wire/spaces/spaces.zod.d.ts +6 -0
  217. package/types/gen-wire/timeline/timeline.d.ts +2 -2
  218. package/types/gen-wire/timeline/timeline.zod.d.ts +2 -2
  219. package/types/gen-wire/webitel-im-api-gateway-v1-messagehistory/webitel-im-api-gateway-v1-messagehistory.zod.d.ts +3 -72
  220. package/types/gen-wire/webitel-im-api-gateway-v1-threadmanagement/webitel-im-api-gateway-v1-threadmanagement.zod.d.ts +201 -96
  221. package/types/gen-wire/webitel-im-api-gateway-v1-updates/webitel-im-api-gateway-v1-updates.d.ts +13 -0
  222. package/types/gen-wire/webitel-im-api-gateway-v1-updates/webitel-im-api-gateway-v1-updates.zod.d.ts +1122 -0
  223. package/types/validations/agentSkill/agentSkill.validations.d.ts +9 -0
  224. package/types/validations/index.d.ts +1 -0
  225. package/src/gen/_models/webitelImApiGatewayV1MessageDeliveryStatus.ts +0 -27
  226. package/src/gen/_models/webitelImApiGatewayV1MessageRecipientStatus.ts +0 -24
  227. package/src/gen-wire/_models/webitelImApiGatewayV1MessageDeliveryStatus.ts +0 -27
  228. package/src/gen-wire/_models/webitelImApiGatewayV1MessageRecipientStatus.ts +0 -24
  229. package/types/gen/_models/webitelImApiGatewayV1MessageDeliveryStatus.d.ts +0 -24
  230. package/types/gen/_models/webitelImApiGatewayV1MessageRecipientStatus.d.ts +0 -23
  231. package/types/gen-wire/_models/webitelImApiGatewayV1MessageDeliveryStatus.d.ts +0 -24
  232. package/types/gen-wire/_models/webitelImApiGatewayV1MessageRecipientStatus.d.ts +0 -23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/api-services",
3
- "version": "26.8.46",
3
+ "version": "26.8.48",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -0,0 +1,79 @@
1
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
2
+
3
+ const catalogGetHistory = vi.fn(() =>
4
+ Promise.resolve({
5
+ data: {
6
+ messages: [
7
+ {
8
+ id: 'm1',
9
+ from: {
10
+ id: 1,
11
+ },
12
+ },
13
+ ],
14
+ peers: [
15
+ {
16
+ id: 'p1',
17
+ },
18
+ ],
19
+ next: true,
20
+ },
21
+ }),
22
+ );
23
+
24
+ vi.mock('../../../../gen-wire', async (importOriginal) => ({
25
+ ...(await importOriginal<Record<string, unknown>>()),
26
+ getMessages: () => ({
27
+ catalogGetHistory,
28
+ }),
29
+ }));
30
+
31
+ const { CatalogAPI } = await import('../catalog');
32
+
33
+ /**
34
+ * The endpoint pages with `limit` and an `offset.date` cursor. Dropping either
35
+ * silently returns the newest page every time, and dropping `next` leaves the
36
+ * caller unable to tell there is more (WTEL-10384).
37
+ */
38
+ describe('CatalogAPI.getChatMessagesList', () => {
39
+ beforeEach(() => catalogGetHistory.mockClear());
40
+
41
+ it('sends the cursor and limit when given, and neither when not', async () => {
42
+ await CatalogAPI.getChatMessagesList({
43
+ chatId: 'chat-1',
44
+ offsetDate: '1700000000000',
45
+ limit: 20,
46
+ });
47
+
48
+ expect(catalogGetHistory).toHaveBeenCalledWith('chat-1', {
49
+ 'offset.date': '1700000000000',
50
+ limit: 20,
51
+ });
52
+
53
+ await CatalogAPI.getChatMessagesList({
54
+ chatId: 'chat-1',
55
+ });
56
+
57
+ // not the string 'undefined', which is what String(offsetDate) would send
58
+ expect(catalogGetHistory).toHaveBeenLastCalledWith('chat-1', {
59
+ 'offset.date': undefined,
60
+ limit: undefined,
61
+ });
62
+ });
63
+
64
+ it('returns next alongside the merged messages', async () => {
65
+ const response = await CatalogAPI.getChatMessagesList({
66
+ chatId: 'chat-1',
67
+ });
68
+
69
+ expect(response.next).toBe(true);
70
+ expect(response.items).toEqual([
71
+ {
72
+ id: 'm1',
73
+ peer: {
74
+ id: 'p1',
75
+ },
76
+ },
77
+ ]);
78
+ });
79
+ });
@@ -2,7 +2,16 @@ import { getMessages } from '../../../gen-wire';
2
2
  import { applyTransform, notify, snakeToCamel } from '../../transformers';
3
3
  import type { ApiId, ApiParams } from '../_shared/types';
4
4
 
5
- const getChatMessagesList = async ({ chatId }: { chatId: ApiId }) => {
5
+ const getChatMessagesList = async ({
6
+ chatId,
7
+ offsetDate,
8
+ limit,
9
+ }: {
10
+ chatId: ApiId;
11
+ // messages sent strictly before this epoch(milli)
12
+ offsetDate?: ApiId;
13
+ limit?: number;
14
+ }) => {
6
15
  const mergeMessagesData = ({
7
16
  messages,
8
17
  peers,
@@ -20,8 +29,11 @@ const getChatMessagesList = async ({ chatId }: { chatId: ApiId }) => {
20
29
  };
21
30
 
22
31
  try {
23
- const response = await getMessages().catalogGetHistory(String(chatId));
24
- const { messages, peers } = applyTransform(response.data, [
32
+ const response = await getMessages().catalogGetHistory(String(chatId), {
33
+ 'offset.date': offsetDate ? String(offsetDate) : undefined,
34
+ limit,
35
+ });
36
+ const { messages, peers, next } = applyTransform(response.data, [
25
37
  snakeToCamel(),
26
38
  ]);
27
39
  return {
@@ -35,6 +47,7 @@ const getChatMessagesList = async ({ chatId }: { chatId: ApiId }) => {
35
47
  ],
36
48
  ),
37
49
  peers,
50
+ next: !!next,
38
51
  };
39
52
  } catch (err) {
40
53
  throw applyTransform(err, [
@@ -7,4 +7,5 @@
7
7
 
8
8
  export interface ApiUserSetting {
9
9
  key?: string;
10
+ value?: unknown;
10
11
  }
@@ -7,4 +7,5 @@
7
7
 
8
8
  export type DeleteMediaFileParams = {
9
9
  domainId?: string;
10
+ force?: boolean;
10
11
  };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Webitel API
5
+ * OpenAPI spec version: 24.04.0
6
+ */
7
+
8
+ export type DeleteRoleParams = {
9
+ /**
10
+ * POST /roles/delete {"ids"}
11
+ */
12
+ ids?: string[];
13
+ /**
14
+ * deleteOrMark 'deleted' ?
15
+ */
16
+ permanent?: boolean;
17
+ };
@@ -18,6 +18,7 @@ export interface EngineAttemptHistory {
18
18
  channel?: string;
19
19
  destination?: EngineMemberCommunication;
20
20
  display?: string;
21
+ duration?: string;
21
22
  id?: string;
22
23
  joinedAt?: string;
23
24
  leavingAt?: string;
@@ -13,5 +13,6 @@ export interface EngineCreateRoutingSchemaRequest {
13
13
  description?: string;
14
14
  editor?: boolean;
15
15
  name?: string;
16
+ schema?: unknown;
16
17
  type?: EngineRoutingSchemaType;
17
18
  }
@@ -8,4 +8,5 @@
8
8
  export interface EngineCreateSchemaVariableRequest {
9
9
  encrypt?: boolean;
10
10
  name?: string;
11
+ value?: unknown;
11
12
  }
@@ -8,4 +8,5 @@ import type { EngineSystemSettingName } from './engineSystemSettingName';
8
8
 
9
9
  export interface EngineCreateSystemSettingRequest {
10
10
  name?: EngineSystemSettingName;
11
+ value?: unknown;
11
12
  }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Webitel API
5
+ * OpenAPI spec version: 24.04.0
6
+ */
7
+
8
+ export type EngineQueueType =
9
+ (typeof EngineQueueType)[keyof typeof EngineQueueType];
10
+
11
+ export const EngineQueueType = {
12
+ QueueTypeUnspecified: 'QUEUE_TYPE_UNSPECIFIED',
13
+ QueueTypeOffline: 'QUEUE_TYPE_OFFLINE',
14
+ QueueTypeInboundCall: 'QUEUE_TYPE_INBOUND_CALL',
15
+ QueueTypeIvrCall: 'QUEUE_TYPE_IVR_CALL',
16
+ QueueTypePreviewCall: 'QUEUE_TYPE_PREVIEW_CALL',
17
+ QueueTypeProgressiveCall: 'QUEUE_TYPE_PROGRESSIVE_CALL',
18
+ QueueTypePredictiveCall: 'QUEUE_TYPE_PREDICTIVE_CALL',
19
+ QueueTypeInboundChat: 'QUEUE_TYPE_INBOUND_CHAT',
20
+ QueueTypeAgentTask: 'QUEUE_TYPE_AGENT_TASK',
21
+ QueueTypeOutboundTask: 'QUEUE_TYPE_OUTBOUND_TASK',
22
+ QueueTypeInboundIm: 'QUEUE_TYPE_INBOUND_IM',
23
+ QueueTypeOutboundCall: 'QUEUE_TYPE_OUTBOUND_CALL',
24
+ } as const;
@@ -17,6 +17,7 @@ export interface EngineRoutingSchema {
17
17
  editor?: boolean;
18
18
  id?: string;
19
19
  name?: string;
20
+ schema?: unknown;
20
21
  type?: EngineRoutingSchemaType;
21
22
  updatedAt?: string;
22
23
  updatedBy?: EngineLookup;
@@ -15,5 +15,6 @@ export interface EngineRoutingSchemaServicePatchRoutingSchemaBody {
15
15
  fields?: string[];
16
16
  name?: string;
17
17
  note?: string;
18
+ schema?: unknown;
18
19
  type?: EngineRoutingSchemaType;
19
20
  }
@@ -14,5 +14,6 @@ export interface EngineRoutingSchemaServiceUpdateRoutingSchemaBody {
14
14
  editor?: boolean;
15
15
  name?: string;
16
16
  note?: string;
17
+ schema?: unknown;
17
18
  type?: EngineRoutingSchemaType;
18
19
  }
@@ -9,4 +9,5 @@ export interface EngineSchemaVariable {
9
9
  encrypt?: boolean;
10
10
  id?: number;
11
11
  name?: string;
12
+ value?: unknown;
12
13
  }
@@ -9,4 +9,5 @@ export interface EngineSchemaVariablesServicePatchSchemaVariableBody {
9
9
  encrypt?: boolean;
10
10
  fields?: string[];
11
11
  name?: string;
12
+ value?: unknown;
12
13
  }
@@ -8,4 +8,5 @@
8
8
  export interface EngineSchemaVariablesServiceUpdateSchemaVariableBody {
9
9
  encrypt?: boolean;
10
10
  name?: string;
11
+ value?: unknown;
11
12
  }
@@ -11,6 +11,7 @@ export interface EngineSchemaVersion {
11
11
  createdBy?: EngineLookup;
12
12
  id?: string;
13
13
  note?: string;
14
+ schema?: unknown;
14
15
  schemaId?: string;
15
16
  version?: string;
16
17
  }
@@ -5,6 +5,7 @@
5
5
  * OpenAPI spec version: 24.04.0
6
6
  */
7
7
  import type { EngineFilterBetween } from './engineFilterBetween';
8
+ import type { EngineQueueType } from './engineQueueType';
8
9
  import type { EngineSearchHistoryCallRequestVariablesString } from './engineSearchHistoryCallRequestVariablesString';
9
10
 
10
11
  export interface EngineSearchHistoryCallRequest {
@@ -22,6 +23,7 @@ export interface EngineSearchHistoryCallRequest {
22
23
  directions?: string[];
23
24
  domainId?: string;
24
25
  duration?: EngineFilterBetween;
26
+ excludedQueueTypes?: EngineQueueType[];
25
27
  fields?: string[];
26
28
  fts?: string;
27
29
  gatewayId?: string[];
@@ -9,4 +9,5 @@ import type { EngineSystemSettingName } from './engineSystemSettingName';
9
9
  export interface EngineSystemSetting {
10
10
  id?: number;
11
11
  name?: EngineSystemSettingName;
12
+ value?: unknown;
12
13
  }
@@ -7,4 +7,5 @@
7
7
 
8
8
  export interface EngineSystemSettingServicePatchSystemSettingBody {
9
9
  fields?: string[];
10
+ value?: unknown;
10
11
  }
@@ -6,5 +6,5 @@
6
6
  */
7
7
 
8
8
  export interface EngineSystemSettingServiceUpdateSystemSettingBody {
9
- [key: string]: unknown;
9
+ value?: unknown;
10
10
  }
@@ -336,6 +336,7 @@ export * from './deletePhotoParams';
336
336
  export * from './deletePhotosParams';
337
337
  export * from './deleteQueueParams';
338
338
  export * from './deleteQueueResourceGroupParams';
339
+ export * from './deleteRoleParams';
339
340
  export * from './deleteRoutingOutboundCallParams';
340
341
  export * from './deleteRoutingSchemaParams';
341
342
  export * from './deleteRoutingVariableParams';
@@ -681,6 +682,7 @@ export * from './engineQueueSkill';
681
682
  export * from './engineQueueSkillServiceCreateQueueSkillBody';
682
683
  export * from './engineQueueSkillServicePatchQueueSkillBody';
683
684
  export * from './engineQueueSkillServiceUpdateQueueSkillBody';
685
+ export * from './engineQueueType';
684
686
  export * from './engineQueueVariables';
685
687
  export * from './engineQuickRepliesServicePatchQuickReplyBody';
686
688
  export * from './engineQuickRepliesServiceUpdateQuickReplyBody';
@@ -907,6 +909,7 @@ export * from './listUserAccessTokenParams';
907
909
  export * from './listVariablesParams';
908
910
  export * from './listVersionsParams';
909
911
  export * from './locateArticleArticlesParams';
912
+ export * from './locateArticleParams';
910
913
  export * from './locateCaseNeighborDirection';
911
914
  export * from './locateCaseNeighborParams';
912
915
  export * from './locateCaseParams';
@@ -1010,6 +1013,7 @@ export * from './readOutboundResourceParams';
1010
1013
  export * from './readPasswordSettingsParams';
1011
1014
  export * from './readQueueParams';
1012
1015
  export * from './readQueueResourceGroupParams';
1016
+ export * from './readRoleParams';
1013
1017
  export * from './readRoutingOutboundCallParams';
1014
1018
  export * from './readRoutingSchemaParams';
1015
1019
  export * from './readRoutingVariableParams';
@@ -1025,6 +1029,7 @@ export * from './resetMembersCountParams';
1025
1029
  export * from './resetPhonesParams';
1026
1030
  export * from './resetTimezonesParams';
1027
1031
  export * from './resetVariablesParams';
1032
+ export * from './roleMetadataParams';
1028
1033
  export * from './rolesUpdateRoleBody';
1029
1034
  export * from './rolesUpdateRoleBodyBody';
1030
1035
  export * from './rolesUpdateRoleBodyRole';
@@ -1076,6 +1081,7 @@ export * from './searchFilesByCallChannelItem';
1076
1081
  export * from './searchFilesByCallParams';
1077
1082
  export * from './searchFilesChannelItem';
1078
1083
  export * from './searchFilesParams';
1084
+ export * from './searchHistoryCallExcludedQueueTypesItem';
1079
1085
  export * from './searchHistoryCallParams';
1080
1086
  export * from './searchImportTemplateParams';
1081
1087
  export * from './searchLDAPCatalogParams';
@@ -1107,10 +1113,12 @@ export * from './searchQueueResourceGroupParams';
1107
1113
  export * from './searchQueueSkillParams';
1108
1114
  export * from './searchQueueTagsParams';
1109
1115
  export * from './searchQuickRepliesParams';
1116
+ export * from './searchRecordAvailableRolesParams';
1110
1117
  export * from './searchRecordsParams';
1111
1118
  export * from './searchRegionParams';
1112
1119
  export * from './searchRetrievalParams';
1113
1120
  export * from './searchRetrievalTagMatch';
1121
+ export * from './searchRolesParams';
1114
1122
  export * from './searchRoutingOutboundCallParams';
1115
1123
  export * from './searchRoutingSchemaParams';
1116
1124
  export * from './searchRoutingSchemaTagsParams';
@@ -1268,8 +1276,10 @@ export * from './update2Body';
1268
1276
  export * from './update2Params';
1269
1277
  export * from './update200';
1270
1278
  export * from './update2200';
1279
+ export * from './updateArticle2Params';
1271
1280
  export * from './updateArticleArticlesBody';
1272
1281
  export * from './updateArticleArticlesParams';
1282
+ export * from './updateArticleParams';
1273
1283
  export * from './updateBody';
1274
1284
  export * from './updateCase2Body';
1275
1285
  export * from './updateCase2BodyCustom';
@@ -1330,6 +1340,8 @@ export * from './updateManager2Params';
1330
1340
  export * from './updateManagerBody';
1331
1341
  export * from './updateManagerInputBody';
1332
1342
  export * from './updateManagerParams';
1343
+ export * from './updateModel2Params';
1344
+ export * from './updateModelParams';
1333
1345
  export * from './updateOAuthService2Params';
1334
1346
  export * from './updateOAuthServiceParams';
1335
1347
  export * from './updateParams';
@@ -1362,6 +1374,8 @@ export * from './updateSLAConditionParams';
1362
1374
  export * from './updateSLAParams';
1363
1375
  export * from './updateSource2Params';
1364
1376
  export * from './updateSourceParams';
1377
+ export * from './updateSpace2Params';
1378
+ export * from './updateSpaceParams';
1365
1379
  export * from './updateSpaceSpacesBody';
1366
1380
  export * from './updateSpaceSpacesParams';
1367
1381
  export * from './updateStatus2Params';
@@ -1411,6 +1425,8 @@ export * from './webitelCasesCaseLinkList';
1411
1425
  export * from './webitelCasesCaseList';
1412
1426
  export * from './webitelCasesCaseNavDirection';
1413
1427
  export * from './webitelCasesCaseTimelineEventType';
1428
+ export * from './webitelCasesCaseTimelinePostprocessingResult';
1429
+ export * from './webitelCasesCaseTimelineVariable';
1414
1430
  export * from './webitelCasesCatalog';
1415
1431
  export * from './webitelCasesCatalogList';
1416
1432
  export * from './webitelCasesChatEvent';
@@ -1427,6 +1443,7 @@ export * from './webitelCasesExportCasesResponse';
1427
1443
  export * from './webitelCasesFieldChange';
1428
1444
  export * from './webitelCasesFile';
1429
1445
  export * from './webitelCasesGetTimelineCounterResponse';
1446
+ export * from './webitelCasesGetTimelineItemInfoResponse';
1430
1447
  export * from './webitelCasesGetTimelineResponse';
1431
1448
  export * from './webitelCasesInputCase';
1432
1449
  export * from './webitelCasesInputCaseArticle';
@@ -1622,6 +1639,8 @@ export * from './webitelImApiGatewayV1GetContactSettingsResponse';
1622
1639
  export * from './webitelImApiGatewayV1GetMessageRevisionsResponse';
1623
1640
  export * from './webitelImApiGatewayV1GetThreadPermissionsResponse';
1624
1641
  export * from './webitelImApiGatewayV1GetUnreadSummaryResponse';
1642
+ export * from './webitelImApiGatewayV1GetUpdatesRequest';
1643
+ export * from './webitelImApiGatewayV1GetUpdatesResponse';
1625
1644
  export * from './webitelImApiGatewayV1HistoryMessage';
1626
1645
  export * from './webitelImApiGatewayV1HistoryMessageCursorRequest';
1627
1646
  export * from './webitelImApiGatewayV1HistoryMessageCursorResponse';
@@ -1645,13 +1664,12 @@ export * from './webitelImApiGatewayV1KeyboardMarkup';
1645
1664
  export * from './webitelImApiGatewayV1KeyboardRow';
1646
1665
  export * from './webitelImApiGatewayV1KeyboardRowWithSection';
1647
1666
  export * from './webitelImApiGatewayV1LogoutResponse';
1667
+ export * from './webitelImApiGatewayV1MemberReadState';
1648
1668
  export * from './webitelImApiGatewayV1MenuPlacement';
1649
1669
  export * from './webitelImApiGatewayV1MessageContact';
1650
- export * from './webitelImApiGatewayV1MessageDeliveryStatus';
1651
1670
  export * from './webitelImApiGatewayV1MessageEditMessageBody';
1652
1671
  export * from './webitelImApiGatewayV1MessageLocation';
1653
1672
  export * from './webitelImApiGatewayV1MessageReaction';
1654
- export * from './webitelImApiGatewayV1MessageRecipientStatus';
1655
1673
  export * from './webitelImApiGatewayV1MessageRevision';
1656
1674
  export * from './webitelImApiGatewayV1MessageRevisionAction';
1657
1675
  export * from './webitelImApiGatewayV1MessageSendInteractiveCallbackBody';
@@ -1700,16 +1718,21 @@ export * from './webitelImApiGatewayV1ThreadManagementFlushVariablesBody';
1700
1718
  export * from './webitelImApiGatewayV1ThreadManagementSetVariablesBody';
1701
1719
  export * from './webitelImApiGatewayV1ThreadManagementTransferBody';
1702
1720
  export * from './webitelImApiGatewayV1ThreadMember';
1721
+ export * from './webitelImApiGatewayV1ThreadMemberChange';
1722
+ export * from './webitelImApiGatewayV1ThreadMemberChangeAction';
1703
1723
  export * from './webitelImApiGatewayV1ThreadPermissions';
1704
1724
  export * from './webitelImApiGatewayV1ThreadRole';
1705
1725
  export * from './webitelImApiGatewayV1ThreadSettings';
1706
1726
  export * from './webitelImApiGatewayV1ThreadTagManagementAddTagBody';
1727
+ export * from './webitelImApiGatewayV1ThreadUpdates';
1707
1728
  export * from './webitelImApiGatewayV1ThreadVariables';
1708
1729
  export * from './webitelImApiGatewayV1ThreadVariablesVariables';
1709
1730
  export * from './webitelImApiGatewayV1TokenRequest';
1710
1731
  export * from './webitelImApiGatewayV1TransferResponse';
1711
1732
  export * from './webitelImApiGatewayV1UnregisterDeviceResponse';
1712
1733
  export * from './webitelImApiGatewayV1UpdateContactSettingsResponse';
1734
+ export * from './webitelImApiGatewayV1UpdatedMessage';
1735
+ export * from './webitelImApiGatewayV1UpdatedMessageMetadata';
1713
1736
  export * from './webitelImApiGatewayV1UpdateThreadPermissionsResponse';
1714
1737
  export * from './webitelImApiGatewayV1UserAgent';
1715
1738
  export * from './webitelImApiGatewayV1UserFilter';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Webitel API
5
+ * OpenAPI spec version: 24.04.0
6
+ */
7
+
8
+ export type LocateArticleParams = {
9
+ /**
10
+ * Set of fields to return.
11
+ */
12
+ fields?: string[];
13
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Webitel API
5
+ * OpenAPI spec version: 24.04.0
6
+ */
7
+
8
+ export type ReadRoleParams = {
9
+ /**
10
+ * select projection
11
+ *
12
+ * select: output (fields,...)
13
+ */
14
+ fields?: string[];
15
+ };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Webitel API
5
+ * OpenAPI spec version: 24.04.0
6
+ */
7
+
8
+ export type RoleMetadataParams = {
9
+ /**
10
+ * Optional. Unique ID of metadata role owner
11
+ */
12
+ id?: string;
13
+ /**
14
+ * Optional. Partial metadata document key name
15
+ */
16
+ key?: string;
17
+ };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Webitel API
5
+ * OpenAPI spec version: 24.04.0
6
+ */
7
+
8
+ export type SearchHistoryCallExcludedQueueTypesItem =
9
+ (typeof SearchHistoryCallExcludedQueueTypesItem)[keyof typeof SearchHistoryCallExcludedQueueTypesItem];
10
+
11
+ export const SearchHistoryCallExcludedQueueTypesItem = {
12
+ QueueTypeUnspecified: 'QUEUE_TYPE_UNSPECIFIED',
13
+ QueueTypeOffline: 'QUEUE_TYPE_OFFLINE',
14
+ QueueTypeInboundCall: 'QUEUE_TYPE_INBOUND_CALL',
15
+ QueueTypeIvrCall: 'QUEUE_TYPE_IVR_CALL',
16
+ QueueTypePreviewCall: 'QUEUE_TYPE_PREVIEW_CALL',
17
+ QueueTypeProgressiveCall: 'QUEUE_TYPE_PROGRESSIVE_CALL',
18
+ QueueTypePredictiveCall: 'QUEUE_TYPE_PREDICTIVE_CALL',
19
+ QueueTypeInboundChat: 'QUEUE_TYPE_INBOUND_CHAT',
20
+ QueueTypeAgentTask: 'QUEUE_TYPE_AGENT_TASK',
21
+ QueueTypeOutboundTask: 'QUEUE_TYPE_OUTBOUND_TASK',
22
+ QueueTypeInboundIm: 'QUEUE_TYPE_INBOUND_IM',
23
+ QueueTypeOutboundCall: 'QUEUE_TYPE_OUTBOUND_CALL',
24
+ } as const;
@@ -4,6 +4,7 @@
4
4
  * Webitel API
5
5
  * OpenAPI spec version: 24.04.0
6
6
  */
7
+ import type { SearchHistoryCallExcludedQueueTypesItem } from './searchHistoryCallExcludedQueueTypesItem';
7
8
 
8
9
  export type SearchHistoryCallParams = {
9
10
  page?: number;
@@ -63,4 +64,5 @@ export type SearchHistoryCallParams = {
63
64
  schemaId?: number[];
64
65
  hasTransfer?: boolean;
65
66
  timeline?: boolean;
67
+ excludedQueueTypes?: SearchHistoryCallExcludedQueueTypesItem[];
66
68
  };
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Webitel API
5
+ * OpenAPI spec version: 24.04.0
6
+ */
7
+
8
+ export type SearchRecordAvailableRolesParams = {
9
+ /**
10
+ * ----- Role-specific Filters ----------------- //
11
+ *
12
+ * filter: .id = any(:ids...)
13
+ */
14
+ ids?: string[];
15
+ /**
16
+ * filter: group name like
17
+ */
18
+ name?: string;
19
+ /**
20
+ * Object ID
21
+ */
22
+ userId?: string;
23
+ /**
24
+ * Display Name
25
+ */
26
+ userName?: string;
27
+ /**
28
+ * filter: term of search (name, description)
29
+ */
30
+ q?: string;
31
+ /**
32
+ * display name
33
+ */
34
+ recordName?: string;
35
+ /**
36
+ * controls
37
+ *
38
+ * output
39
+ */
40
+ fields?: string[];
41
+ /**
42
+ * sort: "field" asc; "!field" desc
43
+ */
44
+ sort?: string[];
45
+ /**
46
+ * page number
47
+ */
48
+ page?: number;
49
+ /**
50
+ * page size
51
+ */
52
+ size?: number;
53
+ };
@@ -20,9 +20,10 @@ export type SearchRetrievalParams = {
20
20
  */
21
21
  tags?: string[];
22
22
  /**
23
- * How to combine the tag filter.
23
+ * How to combine the tag filter; unspecified means any.
24
24
  *
25
- * - TAG_MATCH_ALL: Default: match articles having ALL listed tags (AND).
25
+ * - TAG_MATCH_UNSPECIFIED: Default mode: match articles having ANY listed tag (OR).
26
+ * - TAG_MATCH_ALL: Match articles having ALL listed tags (AND).
26
27
  * - TAG_MATCH_ANY: Match articles having ANY listed tag (OR).
27
28
  */
28
29
  tagMatch?: SearchRetrievalTagMatch;
@@ -9,6 +9,7 @@ export type SearchRetrievalTagMatch =
9
9
  (typeof SearchRetrievalTagMatch)[keyof typeof SearchRetrievalTagMatch];
10
10
 
11
11
  export const SearchRetrievalTagMatch = {
12
+ TagMatchUnspecified: 'TAG_MATCH_UNSPECIFIED',
12
13
  TagMatchAll: 'TAG_MATCH_ALL',
13
14
  TagMatchAny: 'TAG_MATCH_ANY',
14
15
  } as const;