@trii/types 2.10.729 → 2.10.730

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 (144) hide show
  1. package/dist/Automations/Events/Event.d.ts +3 -3
  2. package/dist/Contacts/CommunicationEndpoint.d.ts +8 -8
  3. package/dist/Conversations/Conversation.d.ts +8 -8
  4. package/dist/Conversations/DashBoard/dashboardForms.d.ts +44 -0
  5. package/dist/Conversations/DashBoard/dashboardForms.js +24 -0
  6. package/dist/Conversations/InboxCounters.d.ts +18 -0
  7. package/dist/Conversations/InboxMongo.d.ts +12 -12
  8. package/dist/Conversations/Routing.d.ts +10 -10
  9. package/dist/Events/DomainEventTypes.d.ts +23 -23
  10. package/dist/Tickets/Common.d.ts +62 -0
  11. package/dist/Tickets/CustomerNotification.d.ts +192 -0
  12. package/dist/Tickets/CustomerNotification.js +54 -0
  13. package/dist/Tickets/Notes.d.ts +13 -0
  14. package/dist/Tickets/Notes.js +10 -0
  15. package/dist/Tickets/QuickResponse.d.ts +64 -0
  16. package/dist/Tickets/QuickResponse.js +41 -0
  17. package/dist/Tickets/Task.d.ts +11 -0
  18. package/dist/Tickets/Ticket.d.ts +2 -0
  19. package/dist/Tickets/index.d.ts +3 -0
  20. package/dist/Tickets/index.js +3 -0
  21. package/dist/src/Common/Channels/Channel.d.ts +1 -28
  22. package/dist/src/Common/Channels/Email.d.ts +0 -1
  23. package/dist/src/Common/Channels/Facebook.d.ts +0 -1
  24. package/dist/src/Common/Channels/Form.d.ts +0 -1
  25. package/dist/src/Common/Channels/GoogleBusiness.d.ts +0 -1
  26. package/dist/src/Common/Channels/Instagram.d.ts +0 -1
  27. package/dist/src/Common/Channels/MercadoLibre.d.ts +0 -1
  28. package/dist/src/Common/Channels/WebChat.d.ts +0 -1
  29. package/dist/src/Contacts/contacts.d.ts +2 -2
  30. package/dist/src/Contacts/index.d.ts +0 -2
  31. package/dist/src/Contacts/index.js +0 -2
  32. package/dist/src/Conversations/Conversation.d.ts +48 -410
  33. package/dist/src/Conversations/Conversation.js +34 -14
  34. package/dist/src/Conversations/DashBoard/dashboard.d.ts +2 -2
  35. package/dist/src/Conversations/DashBoard/dashboardForms.d.ts +44 -0
  36. package/dist/src/Conversations/DashBoard/dashboardForms.js +24 -0
  37. package/dist/src/Conversations/Flows/Workflows/Workflow.d.ts +123 -280
  38. package/dist/src/Conversations/Flows/Workflows/Workflow.js +35 -85
  39. package/dist/src/Conversations/Groups/Group.d.ts +8 -2
  40. package/dist/src/Conversations/Groups/Group.js +6 -0
  41. package/dist/src/Conversations/Label.d.ts +1 -1
  42. package/dist/src/Conversations/WebHook.d.ts +1 -1
  43. package/dist/src/Conversations/index.d.ts +1 -9
  44. package/dist/src/Conversations/index.js +1 -9
  45. package/dist/src/PublicAPI/apiKey.d.ts +3 -92
  46. package/dist/src/PublicAPI/apiKey.js +0 -27
  47. package/dist/src/Tickets/AI.d.ts +2 -50
  48. package/dist/src/Tickets/AdvancedApi.d.ts +2 -142
  49. package/dist/src/Tickets/AdvancedApi.js +1 -28
  50. package/dist/src/Tickets/Approval.d.ts +4 -20
  51. package/dist/src/Tickets/Automation.d.ts +2 -46
  52. package/dist/src/Tickets/Category.d.ts +0 -18
  53. package/dist/src/Tickets/Dashboard.d.ts +0 -78
  54. package/dist/src/Tickets/Dashboard.js +1 -13
  55. package/dist/src/Tickets/Fields.d.ts +0 -4
  56. package/dist/src/Tickets/Layouts.d.ts +1 -3
  57. package/dist/src/Tickets/Routing.d.ts +3 -105
  58. package/dist/src/Tickets/Routing.js +1 -7
  59. package/dist/src/Tickets/Security.d.ts +4 -271
  60. package/dist/src/Tickets/Security.js +1 -10
  61. package/dist/src/Tickets/SelfService.d.ts +0 -190
  62. package/dist/src/Tickets/Sla.d.ts +0 -140
  63. package/dist/src/Tickets/Workflow.d.ts +0 -20
  64. package/dist/src/Users/UserTrii.d.ts +0 -10
  65. package/dist/src/Users/UserTrii.js +1 -8
  66. package/dist/src/index.d.ts +0 -4
  67. package/dist/src/index.js +1 -5
  68. package/package.json +12 -12
  69. package/dist/src/Automations/Capabilities/Capability.d.ts +0 -81
  70. package/dist/src/Automations/Capabilities/Capability.js +0 -23
  71. package/dist/src/Automations/Capabilities/index.d.ts +0 -1
  72. package/dist/src/Automations/Capabilities/index.js +0 -17
  73. package/dist/src/Automations/Common.d.ts +0 -94
  74. package/dist/src/Automations/Common.js +0 -40
  75. package/dist/src/Automations/Events/Event.d.ts +0 -96
  76. package/dist/src/Automations/Events/Event.js +0 -19
  77. package/dist/src/Automations/Events/index.d.ts +0 -1
  78. package/dist/src/Automations/Events/index.js +0 -17
  79. package/dist/src/Automations/Executions/Execution.d.ts +0 -298
  80. package/dist/src/Automations/Executions/Execution.js +0 -76
  81. package/dist/src/Automations/Executions/Testing.d.ts +0 -166
  82. package/dist/src/Automations/Executions/Testing.js +0 -54
  83. package/dist/src/Automations/Executions/index.d.ts +0 -2
  84. package/dist/src/Automations/Executions/index.js +0 -18
  85. package/dist/src/Automations/Flows/Canvas.d.ts +0 -109
  86. package/dist/src/Automations/Flows/Canvas.js +0 -43
  87. package/dist/src/Automations/Flows/Flow.d.ts +0 -154
  88. package/dist/src/Automations/Flows/Flow.js +0 -58
  89. package/dist/src/Automations/Flows/Requests.d.ts +0 -71
  90. package/dist/src/Automations/Flows/Validation.d.ts +0 -28
  91. package/dist/src/Automations/Flows/Validation.js +0 -9
  92. package/dist/src/Automations/Flows/index.d.ts +0 -4
  93. package/dist/src/Automations/Flows/index.js +0 -20
  94. package/dist/src/Automations/Nodes/Node.d.ts +0 -116
  95. package/dist/src/Automations/Nodes/Node.js +0 -27
  96. package/dist/src/Automations/Nodes/index.d.ts +0 -1
  97. package/dist/src/Automations/Nodes/index.js +0 -17
  98. package/dist/src/Automations/Triggers/Trigger.d.ts +0 -112
  99. package/dist/src/Automations/Triggers/Trigger.js +0 -66
  100. package/dist/src/Automations/Triggers/index.d.ts +0 -1
  101. package/dist/src/Automations/Triggers/index.js +0 -17
  102. package/dist/src/Automations/index.d.ts +0 -7
  103. package/dist/src/Automations/index.js +0 -23
  104. package/dist/src/Chats/Chat.d.ts +0 -61
  105. package/dist/src/Chats/Chat.js +0 -28
  106. package/dist/src/Contacts/CommunicationEndpoint.d.ts +0 -107
  107. package/dist/src/Contacts/CommunicationEndpoint.js +0 -39
  108. package/dist/src/Contacts/CommunicationMethod.d.ts +0 -9
  109. package/dist/src/Contacts/CommunicationMethod.js +0 -2
  110. package/dist/src/Conversations/Assignment.d.ts +0 -181
  111. package/dist/src/Conversations/Assignment.js +0 -4
  112. package/dist/src/Conversations/InboxMongo.d.ts +0 -154
  113. package/dist/src/Conversations/InboxMongo.js +0 -128
  114. package/dist/src/Conversations/InboxProjection.d.ts +0 -162
  115. package/dist/src/Conversations/InboxProjection.js +0 -2
  116. package/dist/src/Conversations/Outbox.d.ts +0 -24
  117. package/dist/src/Conversations/Outbox.js +0 -4
  118. package/dist/src/Conversations/Queue.d.ts +0 -107
  119. package/dist/src/Conversations/Queue.js +0 -4
  120. package/dist/src/Conversations/Routing.d.ts +0 -164
  121. package/dist/src/Conversations/Routing.js +0 -2
  122. package/dist/src/Conversations/Sla.d.ts +0 -227
  123. package/dist/src/Conversations/Sla.js +0 -6
  124. package/dist/src/Conversations/Transfer.d.ts +0 -73
  125. package/dist/src/Conversations/Transfer.js +0 -2
  126. package/dist/src/Events/DomainEventTypes.d.ts +0 -51
  127. package/dist/src/Events/DomainEventTypes.js +0 -49
  128. package/dist/src/Events/index.d.ts +0 -1
  129. package/dist/src/Events/index.js +0 -17
  130. package/dist/src/Forms/API.d.ts +0 -53
  131. package/dist/src/Forms/API.js +0 -2
  132. package/dist/src/Forms/SubmittedForm.d.ts +0 -56
  133. package/dist/src/Forms/SubmittedForm.js +0 -9
  134. package/dist/src/Forms/index.d.ts +0 -2
  135. package/dist/src/Forms/index.js +0 -18
  136. package/dist/src/Presence/AgentPause.d.ts +0 -24
  137. package/dist/src/Presence/AgentPause.js +0 -19
  138. package/dist/src/Presence/QueueParticipation.d.ts +0 -17
  139. package/dist/src/Presence/QueueParticipation.js +0 -2
  140. package/dist/src/Presence/QueueRoutingState.d.ts +0 -27
  141. package/dist/src/Presence/QueueRoutingState.js +0 -9
  142. package/dist/src/Presence/index.d.ts +0 -3
  143. package/dist/src/Presence/index.js +0 -19
  144. /package/dist/{src/Automations/Flows/Requests.js → Conversations/InboxCounters.js} +0 -0
@@ -4,18 +4,16 @@ import { GroupInfo } from "./Groups/Group";
4
4
  import { Channels } from "../Common/index";
5
5
  import { IContactAddress, IContactInfo } from "../Contacts/contacts";
6
6
  import { IEnding } from "./Ending";
7
- import { ChatType } from "../Chats/Chat";
8
- import { TransferConversationCommand, TransferConversationResult } from "./Transfer";
9
- import { AcceptConversationAssignmentCommand, AcceptConversationAssignmentResult, DeclineConversationAssignmentCommand, DeclineConversationAssignmentResult, CancelConversationAssignmentCommand, CancelConversationAssignmentResult } from "./Assignment";
10
7
  export interface IConversation {
11
8
  id: string;
9
+ /**only for Front-End */
10
+ idLocal?: number;
12
11
  spaceId: string;
13
- version: number;
14
- /** @deprecated Use assignment.owner. */
15
12
  type: ChatType;
16
- /**only for Front-End */
13
+ ownerId: string;
17
14
  chatName: string;
18
15
  chatImage: string;
16
+ chatMembers: IChatMemeber[];
19
17
  chatMembersCount: number;
20
18
  whatsappGroupInfo?: IWhatsAppGroupInfo;
21
19
  contactInfo?: IContactInfo;
@@ -23,55 +21,48 @@ export interface IConversation {
23
21
  remoteAddress: string;
24
22
  remoteAddressId: string;
25
23
  channelInfo: Channels.IChannelInfo;
26
- status: ConversationStatus;
27
- priority: 'low' | 'normal' | 'high' | 'urgent';
28
- assignment: ConversationAssignmentSnapshot;
29
- /** @deprecated Use owner and assignment.*/
30
- assignedTo?: ConversationAssigned;
31
- sla: {
32
- status: 'none' | 'running' | 'warning' | 'breached' | 'met';
33
- deadlineAt?: Date;
34
- policyId?: string;
35
- version: number;
36
- };
37
24
  lastMessage: string;
38
25
  lastMessageId?: string;
39
26
  newMessagesCount: number;
40
27
  newMessagesUnread: boolean;
41
- lastActivityAt: Date;
42
- lastCustomerActivityAt?: Date;
43
- lastAgentActivityAt?: Date;
44
28
  labels: ILabel[];
45
29
  pinned: boolean;
46
- /** @deprecated A transfer is represented by an event and the resulting current state. */
47
30
  transferBy?: string;
48
- /** @deprecated A transfer is represented by an event and the resulting current state. */
49
31
  transferTo?: ConversationAssigned;
50
32
  expired: boolean;
51
- /** @deprecated Expiration does not own a separate assignment snapshot.*/
52
33
  expiredAssignedTo: ConversationAssigned;
34
+ status: ConversationSatus;
35
+ assignedTo?: ConversationAssigned;
53
36
  participants: UserInfo[];
54
37
  archived: boolean;
55
- spam: boolean;
56
38
  externalMessagingWindowEndAt?: Date;
57
39
  workflowId?: string;
58
40
  botStatus: ConversationBotStatus;
59
41
  botVars: ConversationBotVar[];
60
42
  metadata: IConversationMetadata;
61
43
  /** Domain objects discussed or served by this conversation. */
44
+ contextReferences?: IConversationContextReference[];
45
+ finalizedAt: Date;
46
+ finalizedBy?: string;
62
47
  finalizedOnWebChat: Date;
63
48
  ending?: IEnding;
64
49
  qualityEvaluation?: IInteractionQualityEvaluation;
65
50
  reOpenAt?: Date;
66
- reOpenByUserId?: string;
67
- reOpenPolicyId?: string;
68
51
  createdAt: Date;
69
52
  updatedAt: Date;
70
- resolvedAt?: Date;
71
- resolvedByUserId?: string;
72
- resolutionReasonId?: string;
73
- finalizedAt: Date;
74
- finalizedBy?: string;
53
+ }
54
+ export declare enum ConversationContextType {
55
+ TICKET = "TICKET",
56
+ CONVERSATION = "CONVERSATION",
57
+ LEAD = "LEAD",
58
+ DEBT = "DEBT"
59
+ }
60
+ export interface IConversationContextReference {
61
+ entityType: ConversationContextType;
62
+ entityId: string;
63
+ role?: string;
64
+ linkedAt: Date;
65
+ linkedBy?: string;
75
66
  }
76
67
  export interface IWhatsAppGroupInfo {
77
68
  whatsappGroupId: string;
@@ -131,14 +122,29 @@ export declare enum ConversationBotStatus {
131
122
  FINALIZED = 4,
132
123
  CANCELED = 5
133
124
  }
134
- export interface ConversationBotVar {
125
+ export declare class ConversationBotVar {
135
126
  title: string;
136
127
  value: string;
137
128
  }
138
- /**
139
- * @deprecated Legacy channel assignment configuration. Use QueueRoutingConfig.
140
- */
141
- export interface ConversationAssigned {
129
+ export declare enum ChatType {
130
+ /**Conversation with a external channel/contact */
131
+ EXTERNAL = 0,
132
+ /**messages between two users */
133
+ DIRECT = 1,
134
+ /**messages between multiple users */
135
+ GROUP = 2,
136
+ /**Messages to discuss a conversation */
137
+ DISCUSS_CONVERSATION = 11,
138
+ /**Messages to discuss a ticket */
139
+ DISCUSS_TICKET = 12
140
+ }
141
+ export interface IChatMemeber {
142
+ joinTimeStamp: Date;
143
+ isAdmin: boolean;
144
+ userId: string;
145
+ user: UserInfo;
146
+ }
147
+ export declare class ConversationAssigned {
142
148
  groupInfo?: GroupInfo;
143
149
  userInfo?: UserInfo;
144
150
  userIds?: string[];
@@ -147,383 +153,15 @@ export declare enum ConversationDirection {
147
153
  INBOUND = 1,
148
154
  OUTBOUND = 2
149
155
  }
150
- /**
151
- * @deprecated Use QueueDistributionMode and QueueRoutingStrategy.
152
- */
156
+ export declare enum ConversationSatus {
157
+ NEW = 1,
158
+ ACTIVE = 2,
159
+ FINALIZED = 3,
160
+ ARCHIVED = 4
161
+ }
153
162
  export declare enum AssignMethod {
154
163
  ALL = 0,
155
164
  ROUND_ROBIN = 1,
156
165
  RANDOM = 2,
157
166
  LEAST_BUSY = 3
158
167
  }
159
- export declare enum ConversationStatus {
160
- NEW = 1,
161
- OPEN = 2,
162
- ACTIVE = 2,// Alias for OPEN
163
- RESOLVED = 3,
164
- FINALIZED = 3,// Alias for RESOLVED
165
- WAITING = 10
166
- }
167
- export type InboxViewId = 'pending' | 'following' | 'sla_warning' | 'sla_breached' | 'team_sla_breached' | 'resolved';
168
- export type OwnerType = 'user' | 'bot' | 'flow' | 'none';
169
- export interface NoConversationOwner {
170
- type: 'none';
171
- id?: never;
172
- displayName?: never;
173
- avatarUrl?: never;
174
- }
175
- export interface UserConversationOwner {
176
- type: 'user';
177
- id: ID;
178
- displayName?: string;
179
- avatarUrl?: string;
180
- }
181
- export interface BotConversationOwner {
182
- type: 'bot';
183
- id: ID;
184
- displayName?: string;
185
- avatarUrl?: string;
186
- }
187
- export interface FlowConversationOwner {
188
- type: 'flow';
189
- id: ID;
190
- displayName?: string;
191
- avatarUrl?: string;
192
- }
193
- export type ConversationOwner = NoConversationOwner | UserConversationOwner | BotConversationOwner | FlowConversationOwner;
194
- export type ConversationAssignmentStatus = 'unrouted' | 'queued' | 'routing' | 'offered' | 'assigned' | 'accepted';
195
- export type ConversationAssignmentSource = 'routing' | 'manual' | 'transfer' | 'requeue';
196
- interface QueuedConversationAssignmentBase {
197
- assignmentId: ID;
198
- queueId: ID;
199
- source: ConversationAssignmentSource;
200
- queuedAt: Date;
201
- lastRoutingDecisionId?: ID;
202
- }
203
- export type ConversationAssignmentSnapshot = {
204
- status: 'unrouted';
205
- assignmentId?: never;
206
- queueId?: never;
207
- owner: NoConversationOwner | BotConversationOwner | FlowConversationOwner;
208
- source?: never;
209
- queuedAt?: never;
210
- lastRoutingDecisionId?: never;
211
- offeredAt?: never;
212
- offerExpiresAt?: never;
213
- assignedAt?: never;
214
- acceptedAt?: never;
215
- } | (QueuedConversationAssignmentBase & {
216
- status: 'queued' | 'routing';
217
- owner: NoConversationOwner;
218
- offeredAt?: never;
219
- offerExpiresAt?: never;
220
- assignedAt?: never;
221
- acceptedAt?: never;
222
- }) | (QueuedConversationAssignmentBase & {
223
- status: 'offered';
224
- owner: UserConversationOwner;
225
- offeredAt: Date;
226
- offerExpiresAt?: Date;
227
- assignedAt?: never;
228
- acceptedAt?: never;
229
- }) | (QueuedConversationAssignmentBase & {
230
- status: 'assigned';
231
- owner: UserConversationOwner;
232
- offeredAt?: Date;
233
- offerExpiresAt?: Date;
234
- assignedAt: Date;
235
- acceptedAt?: never;
236
- }) | (QueuedConversationAssignmentBase & {
237
- status: 'accepted';
238
- owner: UserConversationOwner;
239
- offeredAt?: Date;
240
- offerExpiresAt?: Date;
241
- assignedAt: Date;
242
- acceptedAt: Date;
243
- });
244
- export type ActorType = 'user' | 'contact' | 'bot' | 'flow' | 'system';
245
- export type ParticipantRole = 'owner' | 'collaborator' | 'follower' | 'mentioned' | 'supervisor' | 'bot' | 'flow' | 'historical';
246
- export type ConversationEventType = 'conversation_created' | 'queued' | 'assigned' | 'accepted' | 'transferred' | 'consult_requested' | 'collaborator_added' | 'participant_added' | 'participant_removed' | 'participation_abandoned' | 'follow_started' | 'follow_stopped' | 'message_sent' | 'message_received' | 'internal_note_added' | 'bot_started' | 'bot_finished' | 'flow_started' | 'flow_finished' | 'status_changed' | 'resolved' | 'reopened' | 'sla_warning' | 'sla_breached' | 'sla_started' | 'sla_paused' | 'sla_resumed' | 'sla_met' | 'sla_overridden';
247
- export type ID = string;
248
- export type ConversationSubscriptionSource = 'manual' | 'assigned' | 'participated' | 'mentioned' | 'supervisor' | 'rule';
249
- export type ConversationSubscriptionNotificationEvent = 'customer_message' | 'internal_mention' | 'assignment_change' | 'acceptance' | 'resolution' | 'reopen';
250
- export type ConversationSubscriptionNotifications = {
251
- mode: 'all' | 'muted';
252
- events?: never;
253
- } | {
254
- mode: 'custom';
255
- events: [
256
- ConversationSubscriptionNotificationEvent,
257
- ...ConversationSubscriptionNotificationEvent[]
258
- ];
259
- };
260
- interface ConversationSubscriptionBase {
261
- id: ID;
262
- spaceId: string;
263
- conversationId: ID;
264
- userId: ID;
265
- source: ConversationSubscriptionSource;
266
- notifications: ConversationSubscriptionNotifications;
267
- createdAt: Date;
268
- updatedAt: Date;
269
- version: number;
270
- }
271
- /**
272
- * Current following state for one user/conversation pair.
273
- *
274
- * A subscription is persistent product intent. Assignment or participation
275
- * visibility must not create it unless an explicit auto-follow policy applies.
276
- */
277
- export type ConversationSubscription = (ConversationSubscriptionBase & {
278
- status: 'following';
279
- followedAt: Date;
280
- unfollowedAt?: never;
281
- }) | (ConversationSubscriptionBase & {
282
- status: 'unfollowed';
283
- followedAt: Date;
284
- unfollowedAt: Date;
285
- });
286
- export interface PutConversationSubscriptionRequest {
287
- expectedVersion?: number;
288
- notifications: ConversationSubscriptionNotifications;
289
- }
290
- export interface UserConversationState {
291
- id: ID;
292
- spaceId: ID;
293
- conversationId: ID;
294
- userId: ID;
295
- pinned: boolean;
296
- pinnedAt?: Date;
297
- lastReadMessageId?: ID;
298
- lastReadAt?: Date;
299
- updatedAt: Date;
300
- version: number;
301
- }
302
- export type ConversationReadStateMode = 'read' | 'unread';
303
- export interface PutConversationReadStateRequest {
304
- mode: ConversationReadStateMode;
305
- lastReadMessageId?: ID;
306
- lastReadAt?: Date;
307
- }
308
- export interface PutConversationPinRequest {
309
- pinned: boolean;
310
- }
311
- export type InboxVisibilityReason = 'manual_follow' | 'assigned_to_user' | 'shared_queue_member' | 'queue_claimable' | 'active_participant' | 'sla_warning_owner' | 'sla_breached_owner' | 'supervised_queue_sla' | 'supervisor_escalation' | 'resolved_visible';
312
- export interface ConversationInboxSnapshot {
313
- interactionKind: 'private' | 'wall_post' | 'comment' | 'mention';
314
- channelType: string;
315
- channelId?: ID;
316
- contact: {
317
- id?: ID;
318
- displayName: string;
319
- initials?: string;
320
- isBusiness: boolean;
321
- };
322
- status: ConversationStatus;
323
- owner: ConversationOwner;
324
- queueId?: ID;
325
- preview?: string;
326
- lastMessageId?: ID;
327
- unreadCount: number;
328
- priority: 'low' | 'normal' | 'high' | 'urgent';
329
- sla: {
330
- status: 'none' | 'running' | 'warning' | 'breached' | 'met';
331
- deadlineAt?: Date;
332
- };
333
- lastActivityAt: Date;
334
- }
335
- /**
336
- * Membership of one materialized conversation in one logical inbox view.
337
- *
338
- * visibilityReasons has set semantics: values must be unique and non-empty.
339
- * Removing one reason preserves the view while at least one reason remains.
340
- */
341
- export interface UserInboxItemView {
342
- viewId: InboxViewId;
343
- visibilityReasons: [
344
- InboxVisibilityReason,
345
- ...InboxVisibilityReason[]
346
- ];
347
- requiresAction: boolean;
348
- }
349
- /**
350
- * Materialized read model. There is exactly one document for each
351
- * spaceId + userId + conversationId tuple.
352
- *
353
- * views must contain unique viewId values. Delete the document when the last
354
- * view is removed.
355
- */
356
- export interface UserInboxItemDocument {
357
- id: ID;
358
- spaceId: ID;
359
- userId: ID;
360
- conversationId: ID;
361
- views: UserInboxItemView[];
362
- snapshot: ConversationInboxSnapshot;
363
- pinned: boolean;
364
- priorityScore: number;
365
- sortAt: Date;
366
- conversationVersion: number;
367
- subscriptionVersion?: number;
368
- projectionVersion: number;
369
- lastSourceEventId: ID;
370
- projectedAt: Date;
371
- }
372
- /**
373
- * Materialized counters for exactly one user/view pair.
374
- *
375
- * total and requiresAction count conversations, never visibility reasons.
376
- * unread counts conversations whose snapshot.unreadCount is greater than zero,
377
- * not the number of unread messages.
378
- */
379
- export interface UserInboxCounterDocument {
380
- id: ID;
381
- spaceId: ID;
382
- userId: ID;
383
- viewId: InboxViewId;
384
- total: number;
385
- requiresAction: number;
386
- unread: number;
387
- projectionVersion: number;
388
- updatedAt: Date;
389
- }
390
- export interface CursorPage<T> {
391
- items: T[];
392
- nextCursor?: string;
393
- hasMore: boolean;
394
- generatedAt: Date;
395
- }
396
- export interface ConversationCapabilitiesDto {
397
- canView: boolean;
398
- canReply: boolean;
399
- canFollow: boolean;
400
- canAbandon: boolean;
401
- canClaim: boolean;
402
- canAccept: boolean;
403
- canRelease: boolean;
404
- canTransfer: boolean;
405
- canResolve: boolean;
406
- canReopen: boolean;
407
- canChangePriority: boolean;
408
- canManageLabels: boolean;
409
- canManageSla: boolean;
410
- canViewAssignmentHistory: boolean;
411
- canViewRoutingDecisions: boolean;
412
- }
413
- export interface InboxViewSummaryDto {
414
- id: InboxViewId | 'supervised_target';
415
- label: string;
416
- scope: 'personal' | 'supervision' | 'history';
417
- order: number;
418
- total: number;
419
- requiresAction: number;
420
- unread: number;
421
- enabled: boolean;
422
- targetRequired: boolean;
423
- capabilities: string[];
424
- }
425
- export interface InboxViewsResponse {
426
- views: InboxViewSummaryDto[];
427
- countersGeneratedAt: Date;
428
- projectionLagMs?: number;
429
- }
430
- export interface InboxFilterDto {
431
- text?: string;
432
- queueIds?: ID[];
433
- ownerUserIds?: ID[];
434
- channelTypes?: string[];
435
- statuses?: ConversationStatus[];
436
- priorities?: Array<'low' | 'normal' | 'high' | 'urgent'>;
437
- slaStatuses?: Array<'none' | 'running' | 'warning' | 'breached' | 'met'>;
438
- labelIds?: ID[];
439
- unread?: boolean;
440
- requiresAction?: boolean;
441
- pinned?: boolean;
442
- lastActivity?: {
443
- from?: Date;
444
- to?: Date;
445
- };
446
- sort: {
447
- type: 'activity';
448
- } | {
449
- type: 'priority';
450
- };
451
- }
452
- export type InboxConversationItemDto = Pick<UserInboxItemDocument, 'conversationId' | 'views' | 'snapshot' | 'pinned' | 'priorityScore' | 'sortAt'> & {
453
- capabilities: Pick<ConversationCapabilitiesDto, 'canView' | 'canReply' | 'canClaim' | 'canTransfer'>;
454
- };
455
- export interface InboxConversationPage extends CursorPage<InboxConversationItemDto> {
456
- appliedFilter: InboxFilterDto;
457
- facets?: unknown;
458
- }
459
- /**
460
- * DTO API - GET /inbox/views/{viewId}/filter-options.
461
- */
462
- export interface InboxFacetOptionDto {
463
- id: string;
464
- label: string;
465
- count: number;
466
- }
467
- export interface InboxFacetsDto {
468
- queues: InboxFacetOptionDto[];
469
- owners: InboxFacetOptionDto[];
470
- channels: InboxFacetOptionDto[];
471
- statuses: InboxFacetOptionDto[];
472
- priorities: InboxFacetOptionDto[];
473
- slaStatuses: InboxFacetOptionDto[];
474
- labels: InboxFacetOptionDto[];
475
- }
476
- export interface InboxFilterOptionsResponse {
477
- facets: InboxFacetsDto;
478
- generatedAt: Date;
479
- }
480
- export type ConversationTimelineItemType = 'assignment' | 'sla' | 'system';
481
- export interface ConversationTimelineItem {
482
- type: ConversationTimelineItemType;
483
- time: Date;
484
- text: string;
485
- conversationId: string;
486
- }
487
- export interface ConversationUserRelationDto {
488
- isOwner: boolean;
489
- isParticipant: boolean;
490
- isFollowing: boolean;
491
- isPinned: boolean;
492
- unreadCount: number;
493
- }
494
- export interface ConversationDetailResponse {
495
- conversation: IConversation;
496
- relation: ConversationUserRelationDto;
497
- capabilities: ConversationCapabilitiesDto;
498
- availableActions: string[];
499
- }
500
- export interface AddConversationParticipantRequest {
501
- userId: string;
502
- }
503
- export interface TransferQueueOptionDto {
504
- id: ID;
505
- name: string;
506
- color?: string;
507
- canTransfer: boolean;
508
- supportsCurrentChannel: boolean;
509
- }
510
- export interface TransferUserOptionDto {
511
- id: ID;
512
- displayName: string;
513
- available: boolean;
514
- capacityUsed: number;
515
- capacityTotal: number;
516
- }
517
- export interface TransferOptionsResponse {
518
- queues: TransferQueueOptionDto[];
519
- usersByQueue?: Record<ID, TransferUserOptionDto[]>;
520
- }
521
- export type StartTransferRequest = Pick<TransferConversationCommand, 'commandId' | 'target' | 'expectedConversationVersion' | 'reason'>;
522
- export type StartTransferResponse = TransferConversationResult;
523
- export type AcceptAssignmentRequest = Pick<AcceptConversationAssignmentCommand, 'commandId' | 'expectedConversationVersion'>;
524
- export type AcceptAssignmentResponse = AcceptConversationAssignmentResult;
525
- export type DeclineAssignmentRequest = Pick<DeclineConversationAssignmentCommand, 'commandId' | 'expectedConversationVersion'>;
526
- export type DeclineAssignmentResponse = DeclineConversationAssignmentResult;
527
- export type CancelAssignmentRequest = Pick<CancelConversationAssignmentCommand, 'commandId' | 'expectedConversationVersion'>;
528
- export type CancelAssignmentResponse = CancelConversationAssignmentResult;
529
- export {};
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConversationStatus = exports.AssignMethod = exports.ConversationDirection = exports.ConversationBotStatus = void 0;
3
+ exports.AssignMethod = exports.ConversationSatus = exports.ConversationDirection = exports.ConversationAssigned = exports.ChatType = exports.ConversationBotVar = exports.ConversationBotStatus = exports.ConversationContextType = void 0;
4
+ var ConversationContextType;
5
+ (function (ConversationContextType) {
6
+ ConversationContextType["TICKET"] = "TICKET";
7
+ ConversationContextType["CONVERSATION"] = "CONVERSATION";
8
+ ConversationContextType["LEAD"] = "LEAD";
9
+ ConversationContextType["DEBT"] = "DEBT";
10
+ })(ConversationContextType || (exports.ConversationContextType = ConversationContextType = {}));
4
11
  var ConversationBotStatus;
5
12
  (function (ConversationBotStatus) {
6
13
  ConversationBotStatus[ConversationBotStatus["NONE"] = 0] = "NONE";
@@ -9,14 +16,37 @@ var ConversationBotStatus;
9
16
  ConversationBotStatus[ConversationBotStatus["FINALIZED"] = 4] = "FINALIZED";
10
17
  ConversationBotStatus[ConversationBotStatus["CANCELED"] = 5] = "CANCELED";
11
18
  })(ConversationBotStatus || (exports.ConversationBotStatus = ConversationBotStatus = {}));
19
+ class ConversationBotVar {
20
+ }
21
+ exports.ConversationBotVar = ConversationBotVar;
22
+ var ChatType;
23
+ (function (ChatType) {
24
+ /**Conversation with a external channel/contact */
25
+ ChatType[ChatType["EXTERNAL"] = 0] = "EXTERNAL";
26
+ /**messages between two users */
27
+ ChatType[ChatType["DIRECT"] = 1] = "DIRECT";
28
+ /**messages between multiple users */
29
+ ChatType[ChatType["GROUP"] = 2] = "GROUP";
30
+ /**Messages to discuss a conversation */
31
+ ChatType[ChatType["DISCUSS_CONVERSATION"] = 11] = "DISCUSS_CONVERSATION";
32
+ /**Messages to discuss a ticket */
33
+ ChatType[ChatType["DISCUSS_TICKET"] = 12] = "DISCUSS_TICKET";
34
+ })(ChatType || (exports.ChatType = ChatType = {}));
35
+ class ConversationAssigned {
36
+ }
37
+ exports.ConversationAssigned = ConversationAssigned;
12
38
  var ConversationDirection;
13
39
  (function (ConversationDirection) {
14
40
  ConversationDirection[ConversationDirection["INBOUND"] = 1] = "INBOUND";
15
41
  ConversationDirection[ConversationDirection["OUTBOUND"] = 2] = "OUTBOUND";
16
42
  })(ConversationDirection || (exports.ConversationDirection = ConversationDirection = {}));
17
- /**
18
- * @deprecated Use QueueDistributionMode and QueueRoutingStrategy.
19
- */
43
+ var ConversationSatus;
44
+ (function (ConversationSatus) {
45
+ ConversationSatus[ConversationSatus["NEW"] = 1] = "NEW";
46
+ ConversationSatus[ConversationSatus["ACTIVE"] = 2] = "ACTIVE";
47
+ ConversationSatus[ConversationSatus["FINALIZED"] = 3] = "FINALIZED";
48
+ ConversationSatus[ConversationSatus["ARCHIVED"] = 4] = "ARCHIVED";
49
+ })(ConversationSatus || (exports.ConversationSatus = ConversationSatus = {}));
20
50
  var AssignMethod;
21
51
  (function (AssignMethod) {
22
52
  AssignMethod[AssignMethod["ALL"] = 0] = "ALL";
@@ -24,13 +54,3 @@ var AssignMethod;
24
54
  AssignMethod[AssignMethod["RANDOM"] = 2] = "RANDOM";
25
55
  AssignMethod[AssignMethod["LEAST_BUSY"] = 3] = "LEAST_BUSY";
26
56
  })(AssignMethod || (exports.AssignMethod = AssignMethod = {}));
27
- var ConversationStatus;
28
- (function (ConversationStatus) {
29
- ConversationStatus[ConversationStatus["NEW"] = 1] = "NEW";
30
- ConversationStatus[ConversationStatus["OPEN"] = 2] = "OPEN";
31
- ConversationStatus[ConversationStatus["ACTIVE"] = 2] = "ACTIVE";
32
- ConversationStatus[ConversationStatus["RESOLVED"] = 3] = "RESOLVED";
33
- ConversationStatus[ConversationStatus["FINALIZED"] = 3] = "FINALIZED";
34
- ConversationStatus[ConversationStatus["WAITING"] = 10] = "WAITING";
35
- // ARCHIVED = 4,
36
- })(ConversationStatus || (exports.ConversationStatus = ConversationStatus = {}));
@@ -17,8 +17,8 @@ export interface BodyDashboard {
17
17
  memberId: string | null;
18
18
  groupId: string;
19
19
  ending?: string | null;
20
- /** Filters conversations by IConversation.assignment.owner.id. */
21
- ownerUserId?: string | null;
20
+ /** For filter conversations with IConversation.assignedTo.userInfo.id */
21
+ assignedToUserId?: string | null;
22
22
  }
23
23
  export declare enum GeneralDashboardType {
24
24
  UNASSIGNED = 0,
@@ -0,0 +1,44 @@
1
+ import { FormItemType } from "../../Common/Channels/Form";
2
+ export declare class DashBoardFormsSummaryInfo {
3
+ formId: string;
4
+ timeStart: Date;
5
+ timeEnd: Date;
6
+ completedForms: number;
7
+ records: DashBoardFormsQuestionSummary[];
8
+ }
9
+ export declare class DashBoardFormsQuestionSummary {
10
+ questionId: string;
11
+ question: string;
12
+ type: FormItemType;
13
+ count: number;
14
+ responses: DashBoardFormsResponseSummary[];
15
+ }
16
+ export declare class DashBoardFormsResponseSummary {
17
+ count: number;
18
+ responseTitle: string;
19
+ }
20
+ export declare class DashBoardFormsSubmittedFormsInfo {
21
+ formId: string;
22
+ timeStart: Date;
23
+ timeEnd: Date;
24
+ completedForms: number;
25
+ records: DashBoardFormsSubmittedFormRecord[];
26
+ }
27
+ export declare class DashBoardFormsSubmittedFormRecord {
28
+ id: string;
29
+ tags: FormTag[];
30
+ responses: DashBoardFormsSubmittedFormResponse[];
31
+ expireAt: Date;
32
+ createdAt: Date;
33
+ completedAt: Date;
34
+ }
35
+ export declare class DashBoardFormsSubmittedFormResponse {
36
+ questionId: string;
37
+ question: string;
38
+ type: FormItemType;
39
+ response: any;
40
+ }
41
+ export declare class FormTag {
42
+ name: string;
43
+ value: string;
44
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormTag = exports.DashBoardFormsSubmittedFormResponse = exports.DashBoardFormsSubmittedFormRecord = exports.DashBoardFormsSubmittedFormsInfo = exports.DashBoardFormsResponseSummary = exports.DashBoardFormsQuestionSummary = exports.DashBoardFormsSummaryInfo = void 0;
4
+ class DashBoardFormsSummaryInfo {
5
+ }
6
+ exports.DashBoardFormsSummaryInfo = DashBoardFormsSummaryInfo;
7
+ class DashBoardFormsQuestionSummary {
8
+ }
9
+ exports.DashBoardFormsQuestionSummary = DashBoardFormsQuestionSummary;
10
+ class DashBoardFormsResponseSummary {
11
+ }
12
+ exports.DashBoardFormsResponseSummary = DashBoardFormsResponseSummary;
13
+ class DashBoardFormsSubmittedFormsInfo {
14
+ }
15
+ exports.DashBoardFormsSubmittedFormsInfo = DashBoardFormsSubmittedFormsInfo;
16
+ class DashBoardFormsSubmittedFormRecord {
17
+ }
18
+ exports.DashBoardFormsSubmittedFormRecord = DashBoardFormsSubmittedFormRecord;
19
+ class DashBoardFormsSubmittedFormResponse {
20
+ }
21
+ exports.DashBoardFormsSubmittedFormResponse = DashBoardFormsSubmittedFormResponse;
22
+ class FormTag {
23
+ }
24
+ exports.FormTag = FormTag;