@webitel/api-services 26.8.64 → 26.8.66

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 (106) hide show
  1. package/package.json +1 -1
  2. package/src/api/clients/agents/agents.ts +28 -56
  3. package/src/enums/AgentStatus/AgentStatus.ts +8 -0
  4. package/src/enums/ChannelState/ChannelState.ts +16 -0
  5. package/src/enums/ChannelType/ChannelType.ts +10 -0
  6. package/src/enums/index.ts +6 -0
  7. package/src/gen/_models/engineListOfMemberCommunication.ts +12 -0
  8. package/src/gen/_models/googleProtobufNullValue.ts +8 -3
  9. package/src/gen/_models/index.ts +10 -1
  10. package/src/gen/_models/messageRead2Params.ts +14 -0
  11. package/src/gen/_models/searchMemberCommunicationParams.ts +13 -0
  12. package/src/gen/_models/{messageReadParams.ts → webitelImApiGatewayV1HandBackToBotResponse.ts} +3 -3
  13. package/src/gen/_models/webitelImApiGatewayV1MessageFailure.ts +17 -0
  14. package/src/gen/_models/webitelImApiGatewayV1MessageFailureError.ts +11 -0
  15. package/src/gen/_models/webitelImApiGatewayV1MessageReadBody.ts +13 -0
  16. package/src/gen/_models/webitelImApiGatewayV1SearchMessageHistoryResponse.ts +1 -1
  17. package/src/gen/_models/webitelImApiGatewayV1SearchThreadResponse.ts +1 -1
  18. package/{types/gen/_models/messageReadParams.d.ts → src/gen/_models/webitelImApiGatewayV1TakeOverFromBotResponse.ts} +4 -3
  19. package/src/gen/_models/webitelImApiGatewayV1Thread.ts +1 -1
  20. package/src/gen/_models/webitelImApiGatewayV1ThreadManagementHandBackToBotBody.ts +10 -0
  21. package/src/gen/_models/webitelImApiGatewayV1ThreadManagementTakeOverFromBotBody.ts +10 -0
  22. package/src/gen/_models/webitelImApiGatewayV1ThreadUpdates.ts +8 -2
  23. package/src/gen-wire/_models/engineListOfMemberCommunication.ts +12 -0
  24. package/src/gen-wire/_models/googleProtobufNullValue.ts +8 -3
  25. package/src/gen-wire/_models/index.ts +10 -1
  26. package/src/gen-wire/_models/messageRead2Params.ts +14 -0
  27. package/src/gen-wire/_models/searchMemberCommunicationParams.ts +13 -0
  28. package/src/gen-wire/_models/{messageReadParams.ts → webitelImApiGatewayV1HandBackToBotResponse.ts} +3 -3
  29. package/src/gen-wire/_models/webitelImApiGatewayV1MessageFailure.ts +17 -0
  30. package/src/gen-wire/_models/webitelImApiGatewayV1MessageFailureError.ts +11 -0
  31. package/src/gen-wire/_models/webitelImApiGatewayV1MessageReadBody.ts +13 -0
  32. package/src/gen-wire/_models/webitelImApiGatewayV1SearchMessageHistoryResponse.ts +1 -1
  33. package/src/gen-wire/_models/webitelImApiGatewayV1SearchThreadResponse.ts +1 -1
  34. package/{types/gen-wire/_models/messageReadParams.d.ts → src/gen-wire/_models/webitelImApiGatewayV1TakeOverFromBotResponse.ts} +4 -3
  35. package/src/gen-wire/_models/webitelImApiGatewayV1Thread.ts +1 -1
  36. package/src/gen-wire/_models/webitelImApiGatewayV1ThreadManagementHandBackToBotBody.ts +10 -0
  37. package/src/gen-wire/_models/webitelImApiGatewayV1ThreadManagementTakeOverFromBotBody.ts +10 -0
  38. package/src/gen-wire/_models/webitelImApiGatewayV1ThreadUpdates.ts +8 -2
  39. package/src/gen-wire/index.ts +13 -1
  40. package/src/gen-wire/member-service/member-service.ts +25 -0
  41. package/src/gen-wire/member-service/member-service.zod.ts +48 -0
  42. package/src/gen-wire/webitel-im-api-gateway-v1-message/webitel-im-api-gateway-v1-message.ts +28 -7
  43. package/src/gen-wire/webitel-im-api-gateway-v1-message/webitel-im-api-gateway-v1-message.zod.ts +39 -6
  44. package/src/gen-wire/webitel-im-api-gateway-v1-messagehistory/webitel-im-api-gateway-v1-messagehistory.zod.ts +3 -3
  45. package/src/gen-wire/webitel-im-api-gateway-v1-threadmanagement/webitel-im-api-gateway-v1-threadmanagement.ts +40 -0
  46. package/src/gen-wire/webitel-im-api-gateway-v1-threadmanagement/webitel-im-api-gateway-v1-threadmanagement.zod.ts +27 -5
  47. package/src/gen-wire/webitel-im-api-gateway-v1-updates/webitel-im-api-gateway-v1-updates.zod.ts +135 -3
  48. package/src/scripts/convertDuration/convertDuration.ts +0 -6
  49. package/src/validations/agent/__tests__/agent.validations.spec.ts +96 -0
  50. package/src/validations/agent/agent.validations.ts +25 -0
  51. package/src/validations/agentSubordinate/__tests__/agentSubordinate.validations.spec.ts +24 -0
  52. package/src/validations/agentSubordinate/agentSubordinate.validations.ts +7 -0
  53. package/src/validations/index.ts +2 -0
  54. package/types/.tsbuildinfo +1 -1
  55. package/types/enums/AgentStatus/AgentStatus.d.ts +7 -0
  56. package/types/enums/ChannelState/ChannelState.d.ts +15 -0
  57. package/types/enums/ChannelType/ChannelType.d.ts +9 -0
  58. package/types/enums/index.d.ts +4 -1
  59. package/types/gen/_models/engineListOfMemberCommunication.d.ts +11 -0
  60. package/types/gen/_models/googleProtobufNullValue.d.ts +8 -3
  61. package/types/gen/_models/index.d.ts +10 -1
  62. package/types/gen/_models/messageRead2Params.d.ts +13 -0
  63. package/types/gen/_models/searchMemberCommunicationParams.d.ts +12 -0
  64. package/types/gen/_models/webitelImApiGatewayV1HandBackToBotResponse.d.ts +9 -0
  65. package/types/gen/_models/webitelImApiGatewayV1MessageFailure.d.ts +16 -0
  66. package/types/gen/_models/webitelImApiGatewayV1MessageFailureError.d.ts +10 -0
  67. package/types/gen/_models/webitelImApiGatewayV1MessageReadBody.d.ts +12 -0
  68. package/types/gen/_models/webitelImApiGatewayV1SearchMessageHistoryResponse.d.ts +1 -1
  69. package/types/gen/_models/webitelImApiGatewayV1SearchThreadResponse.d.ts +1 -1
  70. package/types/gen/_models/webitelImApiGatewayV1TakeOverFromBotResponse.d.ts +9 -0
  71. package/types/gen/_models/webitelImApiGatewayV1Thread.d.ts +1 -1
  72. package/types/gen/_models/webitelImApiGatewayV1ThreadManagementHandBackToBotBody.d.ts +9 -0
  73. package/types/gen/_models/webitelImApiGatewayV1ThreadManagementTakeOverFromBotBody.d.ts +9 -0
  74. package/types/gen/_models/webitelImApiGatewayV1ThreadUpdates.d.ts +8 -2
  75. package/types/gen-wire/_models/engineListOfMemberCommunication.d.ts +11 -0
  76. package/types/gen-wire/_models/googleProtobufNullValue.d.ts +8 -3
  77. package/types/gen-wire/_models/index.d.ts +10 -1
  78. package/types/gen-wire/_models/messageRead2Params.d.ts +13 -0
  79. package/types/gen-wire/_models/searchMemberCommunicationParams.d.ts +12 -0
  80. package/types/gen-wire/_models/webitelImApiGatewayV1HandBackToBotResponse.d.ts +9 -0
  81. package/types/gen-wire/_models/webitelImApiGatewayV1MessageFailure.d.ts +16 -0
  82. package/types/gen-wire/_models/webitelImApiGatewayV1MessageFailureError.d.ts +10 -0
  83. package/types/gen-wire/_models/webitelImApiGatewayV1MessageReadBody.d.ts +12 -0
  84. package/types/gen-wire/_models/webitelImApiGatewayV1SearchMessageHistoryResponse.d.ts +1 -1
  85. package/types/gen-wire/_models/webitelImApiGatewayV1SearchThreadResponse.d.ts +1 -1
  86. package/types/gen-wire/_models/webitelImApiGatewayV1TakeOverFromBotResponse.d.ts +9 -0
  87. package/types/gen-wire/_models/webitelImApiGatewayV1Thread.d.ts +1 -1
  88. package/types/gen-wire/_models/webitelImApiGatewayV1ThreadManagementHandBackToBotBody.d.ts +9 -0
  89. package/types/gen-wire/_models/webitelImApiGatewayV1ThreadManagementTakeOverFromBotBody.d.ts +9 -0
  90. package/types/gen-wire/_models/webitelImApiGatewayV1ThreadUpdates.d.ts +8 -2
  91. package/types/gen-wire/call-service/call-service.zod.d.ts +3 -3
  92. package/types/gen-wire/case-timeline/case-timeline.zod.d.ts +3 -3
  93. package/types/gen-wire/index.d.ts +3 -3
  94. package/types/gen-wire/member-service/member-service.d.ts +3 -1
  95. package/types/gen-wire/member-service/member-service.zod.d.ts +37 -0
  96. package/types/gen-wire/routing-schema-service/routing-schema-service.zod.d.ts +11 -11
  97. package/types/gen-wire/timeline/timeline.zod.d.ts +3 -3
  98. package/types/gen-wire/trigger-service/trigger-service.zod.d.ts +12 -12
  99. package/types/gen-wire/webitel-im-api-gateway-v1-message/webitel-im-api-gateway-v1-message.d.ts +5 -3
  100. package/types/gen-wire/webitel-im-api-gateway-v1-message/webitel-im-api-gateway-v1-message.zod.d.ts +20 -5
  101. package/types/gen-wire/webitel-im-api-gateway-v1-threadmanagement/webitel-im-api-gateway-v1-threadmanagement.d.ts +5 -1
  102. package/types/gen-wire/webitel-im-api-gateway-v1-threadmanagement/webitel-im-api-gateway-v1-threadmanagement.zod.d.ts +16 -0
  103. package/types/gen-wire/webitel-im-api-gateway-v1-updates/webitel-im-api-gateway-v1-updates.zod.d.ts +51 -0
  104. package/types/validations/agent/agent.validations.d.ts +28 -0
  105. package/types/validations/agentSubordinate/agentSubordinate.validations.d.ts +7 -0
  106. package/types/validations/index.d.ts +2 -0
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Webitel API
5
+ * OpenAPI spec version: 24.04.0
6
+ */
7
+
8
+ export interface WebitelImApiGatewayV1MessageFailureError {
9
+ code?: string;
10
+ message?: string;
11
+ }
@@ -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 interface WebitelImApiGatewayV1MessageReadBody {
9
+ /** Message to read up to; resolved to its seq. Ignored when up_to_seq is set. */
10
+ id?: string;
11
+ /** Read up to this per-thread message seq (inclusive). */
12
+ up_to_seq?: string;
13
+ }
@@ -18,6 +18,6 @@ export interface WebitelImApiGatewayV1SearchMessageHistoryResponse {
18
18
  next_cursor?: WebitelImApiGatewayV1HistoryMessageCursorResponse;
19
19
  /** Cursor that represents position to get newest messages (used with 'before' param). */
20
20
  prev_cursor?: WebitelImApiGatewayV1HistoryMessageCursorResponse;
21
- /** GetUpdates cursor read before this page: every later change comes from GetUpdates(updates_cursor). */
21
+ /** The caller's GetUpdates cursor as of this read: every later change comes from GetUpdates(updates_cursor). */
22
22
  updates_cursor?: string;
23
23
  }
@@ -15,6 +15,6 @@ export interface WebitelImApiGatewayV1SearchThreadResponse {
15
15
  items?: WebitelImApiGatewayV1Thread[];
16
16
  /** Indicates whether there is a next page available. */
17
17
  next?: boolean;
18
- /** GetUpdates cursor read before this page: every later change comes from GetUpdates(updates_cursor). */
18
+ /** The caller's GetUpdates cursor as of this read: every later change comes from GetUpdates(updates_cursor). */
19
19
  updates_cursor?: string;
20
20
  }
@@ -4,6 +4,7 @@
4
4
  * Webitel API
5
5
  * OpenAPI spec version: 24.04.0
6
6
  */
7
- export type MessageReadParams = {
8
- thread_id?: string;
9
- };
7
+
8
+ export interface WebitelImApiGatewayV1TakeOverFromBotResponse {
9
+ [key: string]: unknown;
10
+ }
@@ -44,7 +44,7 @@ export interface WebitelImApiGatewayV1Thread {
44
44
  unread_count?: number;
45
45
  /** Last update timestamp (Unix time, milliseconds). */
46
46
  updated_at?: string;
47
- /** GetUpdates cursor read before this thread (set by Get; Search carries it on the response). */
47
+ /** The caller's GetUpdates cursor as of this read (set by Get; Search carries it on the response). */
48
48
  updates_cursor?: string;
49
49
  /** Optional variables associated with the thread. */
50
50
  variables?: WebitelImApiGatewayV1ThreadVariables;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Webitel API
5
+ * OpenAPI spec version: 24.04.0
6
+ */
7
+
8
+ export interface WebitelImApiGatewayV1ThreadManagementHandBackToBotBody {
9
+ [key: string]: unknown;
10
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Webitel API
5
+ * OpenAPI spec version: 24.04.0
6
+ */
7
+
8
+ export interface WebitelImApiGatewayV1ThreadManagementTakeOverFromBotBody {
9
+ [key: string]: unknown;
10
+ }
@@ -5,14 +5,20 @@
5
5
  * OpenAPI spec version: 24.04.0
6
6
  */
7
7
  import type { WebitelImApiGatewayV1MemberReadState } from './webitelImApiGatewayV1MemberReadState';
8
+ import type { WebitelImApiGatewayV1MessageFailure } from './webitelImApiGatewayV1MessageFailure';
8
9
  import type { WebitelImApiGatewayV1Thread } from './webitelImApiGatewayV1Thread';
9
10
  import type { WebitelImApiGatewayV1ThreadMemberChange } from './webitelImApiGatewayV1ThreadMemberChange';
10
11
  import type { WebitelImApiGatewayV1UpdatedMessage } from './webitelImApiGatewayV1UpdatedMessage';
11
12
 
12
13
  export interface WebitelImApiGatewayV1ThreadUpdates {
13
14
  deleted_message_ids?: string[];
14
- /** The thread itself, set when it is new to the caller (created or joined since cursor). */
15
+ /**
16
+ * The thread itself, set when it is new to the caller (created or joined since cursor).
17
+ * Same model as the thread list, except last_msg and updates_cursor are never set here.
18
+ */
15
19
  dialog?: WebitelImApiGatewayV1Thread;
20
+ /** Messages that failed to reach a member since the cursor. */
21
+ failures?: WebitelImApiGatewayV1MessageFailure[];
16
22
  /** The caller is no longer a member: drop the thread. */
17
23
  left?: boolean;
18
24
  member_changes?: WebitelImApiGatewayV1ThreadMemberChange[];
@@ -21,7 +27,7 @@ export interface WebitelImApiGatewayV1ThreadUpdates {
21
27
  /** Delivery/read horizons in message seq. */
22
28
  read_states?: WebitelImApiGatewayV1MemberReadState[];
23
29
  thread_id?: string;
24
- /** Newest message for the list preview; set with dialog. */
30
+ /** Newest message for the list preview, in place of dialog.last_msg; set with dialog. */
25
31
  top_message?: WebitelImApiGatewayV1UpdatedMessage;
26
32
  unread_count?: string;
27
33
  }
@@ -1524,6 +1524,9 @@ export {
1524
1524
  SearchMemberAttemptsParams,
1525
1525
  SearchMemberAttemptsQueryParams,
1526
1526
  SearchMemberAttemptsResponse,
1527
+ SearchMemberCommunicationParams,
1528
+ SearchMemberCommunicationQueryParams,
1529
+ SearchMemberCommunicationResponse,
1527
1530
  SearchMemberInQueueParams,
1528
1531
  SearchMemberInQueueQueryParams,
1529
1532
  SearchMemberInQueueResponse,
@@ -2629,8 +2632,11 @@ export {
2629
2632
  MessageEditMessageResponse,
2630
2633
  MessageForwardMessagesBody,
2631
2634
  MessageForwardMessagesResponse,
2635
+ MessageRead2Params,
2636
+ MessageRead2QueryParams,
2637
+ MessageRead2Response,
2638
+ MessageReadBody,
2632
2639
  MessageReadParams,
2633
- MessageReadQueryParams,
2634
2640
  MessageReadResponse,
2635
2641
  MessageSendContactBody,
2636
2642
  MessageSendContactResponse,
@@ -2712,6 +2718,9 @@ export {
2712
2718
  ThreadManagementGetQueryParams,
2713
2719
  ThreadManagementGetResponse,
2714
2720
  ThreadManagementGetUnreadSummaryResponse,
2721
+ ThreadManagementHandBackToBotBody,
2722
+ ThreadManagementHandBackToBotParams,
2723
+ ThreadManagementHandBackToBotResponse,
2715
2724
  ThreadManagementLocateVariablesParams,
2716
2725
  ThreadManagementLocateVariablesResponse,
2717
2726
  ThreadManagementRemoveMemberParams,
@@ -2725,6 +2734,9 @@ export {
2725
2734
  ThreadManagementSetVariablesBody,
2726
2735
  ThreadManagementSetVariablesParams,
2727
2736
  ThreadManagementSetVariablesResponse,
2737
+ ThreadManagementTakeOverFromBotBody,
2738
+ ThreadManagementTakeOverFromBotParams,
2739
+ ThreadManagementTakeOverFromBotResponse,
2728
2740
  ThreadManagementTransferBody,
2729
2741
  ThreadManagementTransferParams,
2730
2742
  ThreadManagementTransferResponse,
@@ -19,6 +19,7 @@ import type {
19
19
  EngineListHistoryAttempt,
20
20
  EngineListMember,
21
21
  EngineListMemberAttempt,
22
+ EngineListOfMemberCommunication,
22
23
  EngineMemberBulkResponse,
23
24
  EngineMemberInQueue,
24
25
  EngineMemberServiceAssignAttemptBody,
@@ -44,6 +45,7 @@ import type {
44
45
  SearchAttemptsHistoryParams,
45
46
  SearchAttemptsParams,
46
47
  SearchMemberAttemptsParams,
48
+ SearchMemberCommunicationParams,
47
49
  SearchMemberInQueueParams,
48
50
  SearchMembersParams,
49
51
  } from '../_models';
@@ -396,6 +398,26 @@ Can be used to preview the impact of a reset request.
396
398
  options,
397
399
  );
398
400
  };
401
+ /**
402
+ * @summary List of a member's communications
403
+ */
404
+ const searchMemberCommunication = (
405
+ queueId: string,
406
+ memberId: string,
407
+ params?: SearchMemberCommunicationParams,
408
+ options?: AxiosRequestConfig,
409
+ ): Promise<AxiosResponse<EngineListOfMemberCommunication>> => {
410
+ return axiosInstance.get(
411
+ `/call_center/queues/${queueId}/members/${memberId}/communications`,
412
+ {
413
+ ...options,
414
+ params: {
415
+ ...params,
416
+ ...options?.params,
417
+ },
418
+ },
419
+ );
420
+ };
399
421
 
400
422
  // --- footer start
401
423
  return {
@@ -422,6 +444,7 @@ Can be used to preview the impact of a reset request.
422
444
  searchMemberAttempts,
423
445
  createAttempt,
424
446
  attemptResult,
447
+ searchMemberCommunication,
425
448
  };
426
449
  };
427
450
  export type AttemptCallbackResult = AxiosResponse<EngineAttemptResultResponse>;
@@ -451,5 +474,7 @@ export type UpdateMemberResult = AxiosResponse<EngineMemberInQueue>;
451
474
  export type SearchMemberAttemptsResult = AxiosResponse<EngineListMemberAttempt>;
452
475
  export type CreateAttemptResult = AxiosResponse<EngineCreateAttemptResponse>;
453
476
  export type AttemptResultResult = AxiosResponse<EngineAttemptResultResponse>;
477
+ export type SearchMemberCommunicationResult =
478
+ AxiosResponse<EngineListOfMemberCommunication>;
454
479
 
455
480
  // --- footer end
@@ -1825,3 +1825,51 @@ export const AttemptResultBody = zod.object({
1825
1825
  export const AttemptResultResponse = zod.object({
1826
1826
  status: zod.string().optional(),
1827
1827
  });
1828
+
1829
+ /**
1830
+ * @summary List of a member's communications
1831
+ */
1832
+ export const SearchMemberCommunicationParams = zod.object({
1833
+ queue_id: zod.string(),
1834
+ member_id: zod.string(),
1835
+ });
1836
+
1837
+ export const SearchMemberCommunicationQueryParams = zod.object({
1838
+ page: zod.int().optional(),
1839
+ size: zod.int().optional(),
1840
+ sort: zod.string().optional(),
1841
+ fields: zod.array(zod.string()).optional(),
1842
+ });
1843
+
1844
+ export const SearchMemberCommunicationResponse = zod.object({
1845
+ items: zod
1846
+ .array(
1847
+ zod.object({
1848
+ attempts: zod.int().optional(),
1849
+ description: zod.string().optional(),
1850
+ destination: zod.string().optional(),
1851
+ display: zod.string().optional(),
1852
+ dtmf: zod.string().optional(),
1853
+ id: zod.string().optional(),
1854
+ last_activity_at: zod.string().optional(),
1855
+ last_cause: zod.string().optional(),
1856
+ priority: zod.int().optional(),
1857
+ resource: zod
1858
+ .object({
1859
+ id: zod.string().optional(),
1860
+ name: zod.string().optional(),
1861
+ })
1862
+ .optional(),
1863
+ state: zod.int().optional(),
1864
+ stop_at: zod.string().optional(),
1865
+ type: zod
1866
+ .object({
1867
+ id: zod.string().optional(),
1868
+ name: zod.string().optional(),
1869
+ })
1870
+ .optional(),
1871
+ }),
1872
+ )
1873
+ .optional(),
1874
+ next: zod.boolean().optional(),
1875
+ });
@@ -9,7 +9,7 @@ import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
9
9
  import axios from '../../api/axios/genClient';
10
10
 
11
11
  import type {
12
- MessageReadParams,
12
+ MessageRead2Params,
13
13
  WebitelImApiGatewayV1DeleteMessagesRequest,
14
14
  WebitelImApiGatewayV1DeleteMessagesResponse,
15
15
  WebitelImApiGatewayV1EditMessageResponse,
@@ -17,6 +17,7 @@ import type {
17
17
  WebitelImApiGatewayV1ForwardMessagesResponse,
18
18
  WebitelImApiGatewayV1InteractiveCallbackResponse,
19
19
  WebitelImApiGatewayV1MessageEditMessageBody,
20
+ WebitelImApiGatewayV1MessageReadBody,
20
21
  WebitelImApiGatewayV1MessageSendInteractiveCallbackBody,
21
22
  WebitelImApiGatewayV1MessageSendTypingBody,
22
23
  WebitelImApiGatewayV1MessageSetReactionBody,
@@ -188,12 +189,13 @@ We use the shared Request/Response types directly to avoid duplication.
188
189
  );
189
190
  };
190
191
  /**
191
- * @summary Marks the thread as read up to the given message (inclusive):
192
- every earlier unread message of the caller in the thread is covered.
192
+ * @summary Marks the thread as read up to the given message (inclusive): every earlier unread
193
+ message of the caller in the thread is covered. Prefer the thread route with up_to_seq;
194
+ the read horizon only moves forward.
193
195
  */
194
- const messageRead = (
196
+ const messageRead2 = (
195
197
  id: string,
196
- params?: MessageReadParams,
198
+ params?: MessageRead2Params,
197
199
  options?: AxiosRequestConfig,
198
200
  ): Promise<AxiosResponse<WebitelImApiGatewayV1ReadMessageResponse>> => {
199
201
  return axiosInstance.post(`/v1/messages/${id}/read`, undefined, {
@@ -219,6 +221,22 @@ every earlier unread message of the caller in the thread is covered.
219
221
  );
220
222
  };
221
223
  /**
224
+ * @summary Marks the thread as read up to the given message (inclusive): every earlier unread
225
+ message of the caller in the thread is covered. Prefer the thread route with up_to_seq;
226
+ the read horizon only moves forward.
227
+ */
228
+ const messageRead = (
229
+ threadId: string,
230
+ webitelImApiGatewayV1MessageReadBody: WebitelImApiGatewayV1MessageReadBody,
231
+ options?: AxiosRequestConfig,
232
+ ): Promise<AxiosResponse<WebitelImApiGatewayV1ReadMessageResponse>> => {
233
+ return axiosInstance.post(
234
+ `/v1/threads/${threadId}/read`,
235
+ webitelImApiGatewayV1MessageReadBody,
236
+ options,
237
+ );
238
+ };
239
+ /**
222
240
  * @summary Sends an ephemeral "…is typing" indicator to the other participants of a
223
241
  thread. Real-time only: it is never stored and never triggers a push. The
224
242
  typing member is the authenticated caller, resolved from the token.
@@ -247,8 +265,9 @@ typing member is the authenticated caller, resolved from the token.
247
265
  messageSendLocation,
248
266
  messageSendText,
249
267
  messageEditMessage,
250
- messageRead,
268
+ messageRead2,
251
269
  messageSetReaction,
270
+ messageRead,
252
271
  messageSendTyping,
253
272
  };
254
273
  };
@@ -272,10 +291,12 @@ export type MessageSendTextResult =
272
291
  AxiosResponse<WebitelImApiGatewayV1SendTextResponse>;
273
292
  export type MessageEditMessageResult =
274
293
  AxiosResponse<WebitelImApiGatewayV1EditMessageResponse>;
275
- export type MessageReadResult =
294
+ export type MessageRead2Result =
276
295
  AxiosResponse<WebitelImApiGatewayV1ReadMessageResponse>;
277
296
  export type MessageSetReactionResult =
278
297
  AxiosResponse<WebitelImApiGatewayV1SetReactionResponse>;
298
+ export type MessageReadResult =
299
+ AxiosResponse<WebitelImApiGatewayV1ReadMessageResponse>;
279
300
  export type MessageSendTypingResult =
280
301
  AxiosResponse<WebitelImApiGatewayV1SendTypingResponse>;
281
302
 
@@ -1190,18 +1190,27 @@ export const MessageEditMessageResponse = zod.object({
1190
1190
  });
1191
1191
 
1192
1192
  /**
1193
- * @summary Marks the thread as read up to the given message (inclusive):
1194
- every earlier unread message of the caller in the thread is covered.
1193
+ * @summary Marks the thread as read up to the given message (inclusive): every earlier unread
1194
+ message of the caller in the thread is covered. Prefer the thread route with up_to_seq;
1195
+ the read horizon only moves forward.
1195
1196
  */
1196
- export const MessageReadParams = zod.object({
1197
- id: zod.string(),
1197
+ export const MessageRead2Params = zod.object({
1198
+ id: zod
1199
+ .string()
1200
+ .describe(
1201
+ 'Message to read up to; resolved to its seq. Ignored when up_to_seq is set.',
1202
+ ),
1198
1203
  });
1199
1204
 
1200
- export const MessageReadQueryParams = zod.object({
1205
+ export const MessageRead2QueryParams = zod.object({
1201
1206
  thread_id: zod.string().optional(),
1207
+ up_to_seq: zod
1208
+ .string()
1209
+ .optional()
1210
+ .describe('Read up to this per-thread message seq (inclusive).'),
1202
1211
  });
1203
1212
 
1204
- export const MessageReadResponse = zod.looseObject({});
1213
+ export const MessageRead2Response = zod.looseObject({});
1205
1214
 
1206
1215
  /**
1207
1216
  * @summary Sets or clears the caller's emoji reaction on a single message.
@@ -1246,6 +1255,30 @@ export const MessageSetReactionResponse = zod.object({
1246
1255
  ),
1247
1256
  });
1248
1257
 
1258
+ /**
1259
+ * @summary Marks the thread as read up to the given message (inclusive): every earlier unread
1260
+ message of the caller in the thread is covered. Prefer the thread route with up_to_seq;
1261
+ the read horizon only moves forward.
1262
+ */
1263
+ export const MessageReadParams = zod.object({
1264
+ thread_id: zod.string(),
1265
+ });
1266
+
1267
+ export const MessageReadBody = zod.object({
1268
+ id: zod
1269
+ .string()
1270
+ .optional()
1271
+ .describe(
1272
+ 'Message to read up to; resolved to its seq. Ignored when up_to_seq is set.',
1273
+ ),
1274
+ up_to_seq: zod
1275
+ .string()
1276
+ .optional()
1277
+ .describe('Read up to this per-thread message seq (inclusive).'),
1278
+ });
1279
+
1280
+ export const MessageReadResponse = zod.looseObject({});
1281
+
1249
1282
  /**
1250
1283
  * @summary Sends an ephemeral "…is typing" indicator to the other participants of a
1251
1284
  thread. Real-time only: it is never stored and never triggers a push. The
@@ -1108,7 +1108,7 @@ export const MessageHistorySearchMessagesResponse = zod
1108
1108
  .string()
1109
1109
  .optional()
1110
1110
  .describe(
1111
- 'GetUpdates cursor read before this page: every later change comes from GetUpdates(updates_cursor).',
1111
+ "The caller's GetUpdates cursor as of this read: every later change comes from GetUpdates(updates_cursor).",
1112
1112
  ),
1113
1113
  })
1114
1114
  .describe(
@@ -2383,7 +2383,7 @@ export const MessageHistorySearchLeftThreadsMessagesHistoryResponse = zod
2383
2383
  .string()
2384
2384
  .optional()
2385
2385
  .describe(
2386
- 'GetUpdates cursor read before this page: every later change comes from GetUpdates(updates_cursor).',
2386
+ "The caller's GetUpdates cursor as of this read: every later change comes from GetUpdates(updates_cursor).",
2387
2387
  ),
2388
2388
  })
2389
2389
  .describe(
@@ -3486,7 +3486,7 @@ export const MessageHistorySearchThreadMessagesHistoryResponse = zod
3486
3486
  .string()
3487
3487
  .optional()
3488
3488
  .describe(
3489
- 'GetUpdates cursor read before this page: every later change comes from GetUpdates(updates_cursor).',
3489
+ "The caller's GetUpdates cursor as of this read: every later change comes from GetUpdates(updates_cursor).",
3490
3490
  ),
3491
3491
  })
3492
3492
  .describe(
@@ -15,16 +15,20 @@ import type {
15
15
  ThreadManagementSearchVariablesParams,
16
16
  WebitelImApiGatewayV1AddMemberResponse,
17
17
  WebitelImApiGatewayV1GetUnreadSummaryResponse,
18
+ WebitelImApiGatewayV1HandBackToBotResponse,
18
19
  WebitelImApiGatewayV1RemoveMemberResponse,
19
20
  WebitelImApiGatewayV1SearchLeftResponse,
20
21
  WebitelImApiGatewayV1SearchThreadResponse,
21
22
  WebitelImApiGatewayV1SearchVariablesResponse,
23
+ WebitelImApiGatewayV1TakeOverFromBotResponse,
22
24
  WebitelImApiGatewayV1Thread,
23
25
  WebitelImApiGatewayV1ThreadManagementAddMemberBody,
24
26
  WebitelImApiGatewayV1ThreadManagementCreateRequest,
25
27
  WebitelImApiGatewayV1ThreadManagementCreateResponse,
26
28
  WebitelImApiGatewayV1ThreadManagementFlushVariablesBody,
29
+ WebitelImApiGatewayV1ThreadManagementHandBackToBotBody,
27
30
  WebitelImApiGatewayV1ThreadManagementSetVariablesBody,
31
+ WebitelImApiGatewayV1ThreadManagementTakeOverFromBotBody,
28
32
  WebitelImApiGatewayV1ThreadManagementTransferBody,
29
33
  WebitelImApiGatewayV1ThreadVariables,
30
34
  WebitelImApiGatewayV1TransferResponse,
@@ -107,6 +111,36 @@ chats with unread messages and the total number of unread messages.
107
111
  },
108
112
  });
109
113
  };
114
+ /**
115
+ * @summary Hands the conversation to the thread's bot; the operator stays in the thread.
116
+ */
117
+ const threadManagementHandBackToBot = (
118
+ threadId: string,
119
+ webitelImApiGatewayV1ThreadManagementHandBackToBotBody: WebitelImApiGatewayV1ThreadManagementHandBackToBotBody,
120
+ options?: AxiosRequestConfig,
121
+ ): Promise<AxiosResponse<WebitelImApiGatewayV1HandBackToBotResponse>> => {
122
+ return axiosInstance.post(
123
+ `/v1/threads/${threadId}/bot/handback`,
124
+ webitelImApiGatewayV1ThreadManagementHandBackToBotBody,
125
+ options,
126
+ );
127
+ };
128
+ /**
129
+ * @summary Takes the conversation from the thread's bot back to the operator.
130
+ */
131
+ const threadManagementTakeOverFromBot = (
132
+ threadId: string,
133
+ webitelImApiGatewayV1ThreadManagementTakeOverFromBotBody: WebitelImApiGatewayV1ThreadManagementTakeOverFromBotBody,
134
+ options?: AxiosRequestConfig,
135
+ ): Promise<
136
+ AxiosResponse<WebitelImApiGatewayV1TakeOverFromBotResponse>
137
+ > => {
138
+ return axiosInstance.post(
139
+ `/v1/threads/${threadId}/bot/takeover`,
140
+ webitelImApiGatewayV1ThreadManagementTakeOverFromBotBody,
141
+ options,
142
+ );
143
+ };
110
144
  /**
111
145
  * @summary Add member to the thread.
112
146
  */
@@ -215,6 +249,8 @@ Supports pagination and field projection.
215
249
  threadManagementSearchLeft,
216
250
  threadManagementGetUnreadSummary,
217
251
  threadManagementGet,
252
+ threadManagementHandBackToBot,
253
+ threadManagementTakeOverFromBot,
218
254
  threadManagementAddMember,
219
255
  threadManagementRemoveMember,
220
256
  threadManagementTransfer,
@@ -234,6 +270,10 @@ export type ThreadManagementGetUnreadSummaryResult =
234
270
  AxiosResponse<WebitelImApiGatewayV1GetUnreadSummaryResponse>;
235
271
  export type ThreadManagementGetResult =
236
272
  AxiosResponse<WebitelImApiGatewayV1Thread>;
273
+ export type ThreadManagementHandBackToBotResult =
274
+ AxiosResponse<WebitelImApiGatewayV1HandBackToBotResponse>;
275
+ export type ThreadManagementTakeOverFromBotResult =
276
+ AxiosResponse<WebitelImApiGatewayV1TakeOverFromBotResponse>;
237
277
  export type ThreadManagementAddMemberResult =
238
278
  AxiosResponse<WebitelImApiGatewayV1AddMemberResponse>;
239
279
  export type ThreadManagementRemoveMemberResult =
@@ -1402,7 +1402,7 @@ export const ThreadManagementSearchResponse = zod
1402
1402
  .string()
1403
1403
  .optional()
1404
1404
  .describe(
1405
- 'GetUpdates cursor read before this thread (set by Get; Search carries it on the response).',
1405
+ "The caller's GetUpdates cursor as of this read (set by Get; Search carries it on the response).",
1406
1406
  ),
1407
1407
  variables: zod
1408
1408
  .object({
@@ -1528,7 +1528,7 @@ export const ThreadManagementSearchResponse = zod
1528
1528
  .string()
1529
1529
  .optional()
1530
1530
  .describe(
1531
- 'GetUpdates cursor read before this page: every later change comes from GetUpdates(updates_cursor).',
1531
+ "The caller's GetUpdates cursor as of this read: every later change comes from GetUpdates(updates_cursor).",
1532
1532
  ),
1533
1533
  })
1534
1534
  .describe(
@@ -2884,7 +2884,7 @@ export const ThreadManagementCreateResponse = zod
2884
2884
  .string()
2885
2885
  .optional()
2886
2886
  .describe(
2887
- 'GetUpdates cursor read before this thread (set by Get; Search carries it on the response).',
2887
+ "The caller's GetUpdates cursor as of this read (set by Get; Search carries it on the response).",
2888
2888
  ),
2889
2889
  variables: zod
2890
2890
  .object({
@@ -4370,7 +4370,7 @@ export const ThreadManagementSearchLeftResponse = zod.object({
4370
4370
  .string()
4371
4371
  .optional()
4372
4372
  .describe(
4373
- 'GetUpdates cursor read before this thread (set by Get; Search carries it on the response).',
4373
+ "The caller's GetUpdates cursor as of this read (set by Get; Search carries it on the response).",
4374
4374
  ),
4375
4375
  variables: zod
4376
4376
  .object({
@@ -5777,7 +5777,7 @@ export const ThreadManagementGetResponse = zod
5777
5777
  .string()
5778
5778
  .optional()
5779
5779
  .describe(
5780
- 'GetUpdates cursor read before this thread (set by Get; Search carries it on the response).',
5780
+ "The caller's GetUpdates cursor as of this read (set by Get; Search carries it on the response).",
5781
5781
  ),
5782
5782
  variables: zod
5783
5783
  .object({
@@ -5889,6 +5889,28 @@ export const ThreadManagementGetResponse = zod
5889
5889
  })
5890
5890
  .describe('Thread represents a thread (aka chat or conversation) entity.');
5891
5891
 
5892
+ /**
5893
+ * @summary Hands the conversation to the thread's bot; the operator stays in the thread.
5894
+ */
5895
+ export const ThreadManagementHandBackToBotParams = zod.object({
5896
+ thread_id: zod.string(),
5897
+ });
5898
+
5899
+ export const ThreadManagementHandBackToBotBody = zod.looseObject({});
5900
+
5901
+ export const ThreadManagementHandBackToBotResponse = zod.looseObject({});
5902
+
5903
+ /**
5904
+ * @summary Takes the conversation from the thread's bot back to the operator.
5905
+ */
5906
+ export const ThreadManagementTakeOverFromBotParams = zod.object({
5907
+ thread_id: zod.string(),
5908
+ });
5909
+
5910
+ export const ThreadManagementTakeOverFromBotBody = zod.looseObject({});
5911
+
5912
+ export const ThreadManagementTakeOverFromBotResponse = zod.looseObject({});
5913
+
5892
5914
  /**
5893
5915
  * @summary Add member to the thread.
5894
5916
  */