@trii/types 2.10.752 → 2.10.754

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 (135) hide show
  1. package/dist/AI/MapPolygon.d.ts +22 -0
  2. package/dist/Common/Messages/Message.d.ts +2 -0
  3. package/dist/Common/index.js +17 -7
  4. package/dist/Contacts/contacts.d.ts +6 -0
  5. package/dist/Conversations/Assignment.d.ts +0 -1
  6. package/dist/Conversations/Assignment.js +0 -2
  7. package/dist/Conversations/Classifications/ClassificationTaxonomy.d.ts +13 -2
  8. package/dist/Conversations/Classifications/ClassificationTaxonomy.js +0 -3
  9. package/dist/Conversations/Classifications/ConversationClassificationEvents.d.ts +2 -0
  10. package/dist/Conversations/Conversation.d.ts +38 -201
  11. package/dist/Conversations/ConversationPendingTransfer.d.ts +16 -0
  12. package/dist/Conversations/ConversationPendingTransfer.js +2 -0
  13. package/dist/Conversations/ConversationReadState.d.ts +16 -0
  14. package/dist/Conversations/ConversationReadState.js +2 -0
  15. package/dist/Conversations/ConversationSlaClockState.d.ts +45 -0
  16. package/dist/Conversations/ConversationSlaClockState.js +2 -0
  17. package/dist/Conversations/DashBoard/dashboardForms.d.ts +44 -0
  18. package/dist/Conversations/DashBoard/dashboardForms.js +24 -0
  19. package/dist/Conversations/Flows/Nodes/NodeAIChatBot.d.ts +0 -0
  20. package/dist/Conversations/Flows/Nodes/NodeAIChatBot.js +0 -0
  21. package/dist/Conversations/Flows/Nodes/NodeApi.d.ts +2 -0
  22. package/dist/Conversations/Flows/Nodes/NodeApi.js +183 -0
  23. package/dist/Conversations/Flows/Nodes/NodeBotIA.d.ts +15 -0
  24. package/dist/Conversations/Flows/Nodes/NodeBotIA.js +6 -0
  25. package/dist/Conversations/Flows/Nodes/NodeChatBotIA.d.ts +15 -0
  26. package/dist/Conversations/Flows/Nodes/NodeChatBotIA.js +6 -0
  27. package/dist/Conversations/Flows/Nodes/NodeConditional.d.ts +0 -0
  28. package/dist/Conversations/Flows/Nodes/NodeConditional.js +0 -0
  29. package/dist/Conversations/Flows/Nodes/NodeContactSearch.d.ts +0 -0
  30. package/dist/Conversations/Flows/Nodes/NodeContactSearch.js +0 -0
  31. package/dist/Conversations/Flows/Nodes/NodeContactUpdate.d.ts +0 -0
  32. package/dist/Conversations/Flows/Nodes/NodeContactUpdate.js +0 -0
  33. package/dist/Conversations/Flows/Nodes/NodeConversationAssignTo.d.ts +0 -0
  34. package/dist/Conversations/Flows/Nodes/NodeConversationAssignTo.js +0 -0
  35. package/dist/Conversations/Flows/Nodes/NodeConversationFinalize.d.ts +0 -0
  36. package/dist/Conversations/Flows/Nodes/NodeConversationFinalize.js +0 -0
  37. package/dist/Conversations/Flows/Nodes/NodeConversationUpdate.d.ts +0 -0
  38. package/dist/Conversations/Flows/Nodes/NodeConversationUpdate.js +0 -0
  39. package/dist/Conversations/Flows/Nodes/NodeFillForm.d.ts +0 -0
  40. package/dist/Conversations/Flows/Nodes/NodeFillForm.js +0 -0
  41. package/dist/Conversations/Flows/Nodes/NodeFillTicket.d.ts +1 -0
  42. package/dist/Conversations/Flows/Nodes/NodeFillTicket.js +9 -0
  43. package/dist/Conversations/Flows/Nodes/NodeGoogleCalendar.d.ts +20 -0
  44. package/dist/Conversations/Flows/Nodes/NodeGoogleCalendar.js +2 -0
  45. package/dist/Conversations/Flows/Nodes/NodeGoogleMaps copy.d.ts +12 -0
  46. package/dist/Conversations/Flows/Nodes/NodeGoogleMaps copy.js +6 -0
  47. package/dist/Conversations/Flows/Nodes/NodeGoogleMaps.d.ts +15 -0
  48. package/dist/Conversations/Flows/Nodes/NodeGoogleMaps.js +2 -0
  49. package/dist/Conversations/Flows/Nodes/NodeMsgReply.d.ts +0 -0
  50. package/dist/Conversations/Flows/Nodes/NodeMsgReply.js +0 -0
  51. package/dist/Conversations/Flows/Nodes/NodeMsgSend.d.ts +0 -0
  52. package/dist/Conversations/Flows/Nodes/NodeMsgSend.js +0 -0
  53. package/dist/Conversations/Flows/Nodes/NodeMsgText.d.ts +1 -0
  54. package/dist/Conversations/Flows/Nodes/NodeMsgText.js +27 -0
  55. package/dist/Conversations/Flows/Nodes/NodeMsgWaitResponse.d.ts +0 -0
  56. package/dist/Conversations/Flows/Nodes/NodeMsgWaitResponse.js +0 -0
  57. package/dist/Conversations/Flows/Nodes/NodeRedirect.d.ts +0 -0
  58. package/dist/Conversations/Flows/Nodes/NodeRedirect.js +0 -0
  59. package/dist/Conversations/Flows/Nodes/NodeSendEmail.d.ts +0 -0
  60. package/dist/Conversations/Flows/Nodes/NodeSendEmail.js +0 -0
  61. package/dist/Conversations/Flows/Nodes/NodeSqlQuery.d.ts +0 -0
  62. package/dist/Conversations/Flows/Nodes/NodeSqlQuery.js +0 -0
  63. package/dist/Conversations/Flows/Nodes/NodeStart.d.ts +0 -0
  64. package/dist/Conversations/Flows/Nodes/NodeStart.js +0 -0
  65. package/dist/Conversations/Flows/Nodes/NodeTimeScheduleControl.d.ts +0 -0
  66. package/dist/Conversations/Flows/Nodes/NodeTimeScheduleControl.js +0 -0
  67. package/dist/Conversations/Flows/Nodes/NodeTimeTimer.d.ts +0 -0
  68. package/dist/Conversations/Flows/Nodes/NodeTimeTimer.js +0 -0
  69. package/dist/Conversations/Flows/Nodes/NodeTimeWaitUntil.d.ts +0 -0
  70. package/dist/Conversations/Flows/Nodes/NodeTimeWaitUntil.js +0 -0
  71. package/dist/Conversations/Flows/Nodes/NodeToolCalculator.d.ts +2 -0
  72. package/dist/Conversations/Flows/Nodes/NodeToolCalculator.js +37 -0
  73. package/dist/Conversations/Flows/Nodes/NodeToolContacts.d.ts +2 -0
  74. package/dist/Conversations/Flows/Nodes/NodeToolContacts.js +59 -0
  75. package/dist/Conversations/Flows/Nodes/NodeToolFunction.d.ts +2 -0
  76. package/dist/Conversations/Flows/Nodes/NodeToolFunction.js +45 -0
  77. package/dist/Conversations/Flows/Nodes/NodeToolGoogleCalendar.d.ts +2 -0
  78. package/dist/Conversations/Flows/Nodes/NodeToolGoogleCalendar.js +87 -0
  79. package/dist/Conversations/Flows/Nodes/NodeToolGoogleMaps.d.ts +1 -0
  80. package/dist/Conversations/Flows/Nodes/NodeToolGoogleMaps.js +2 -0
  81. package/dist/Conversations/Flows/Nodes/NodeToolKnowledge.d.ts +2 -0
  82. package/dist/Conversations/Flows/Nodes/NodeToolKnowledge.js +52 -0
  83. package/dist/Conversations/Flows/Nodes/NodeToolMapsCheckPolygon.d.ts +2 -0
  84. package/dist/Conversations/Flows/Nodes/NodeToolMapsCheckPolygon.js +59 -0
  85. package/dist/Conversations/Flows/Nodes/NodeToolMcpClient.d.ts +2 -0
  86. package/dist/Conversations/Flows/Nodes/NodeToolMcpClient.js +45 -0
  87. package/dist/Conversations/Flows/Nodes/NodeToolShoppingCart.d.ts +2 -0
  88. package/dist/Conversations/Flows/Nodes/NodeToolShoppingCart.js +81 -0
  89. package/dist/Conversations/Flows/Nodes/index.d.ts +24 -0
  90. package/dist/Conversations/Flows/Nodes/index.js +40 -0
  91. package/dist/Conversations/InboxCounters.d.ts +18 -0
  92. package/dist/Conversations/InboxCounters.js +2 -0
  93. package/dist/Conversations/InboxQueries.d.ts +30 -0
  94. package/dist/Conversations/InboxQueries.js +2 -0
  95. package/dist/Conversations/Outbox.d.ts +0 -1
  96. package/dist/Conversations/Outbox.js +0 -2
  97. package/dist/Conversations/Queue.d.ts +1 -3
  98. package/dist/Conversations/Queue.js +0 -2
  99. package/dist/Conversations/Sla.d.ts +2 -5
  100. package/dist/Conversations/Sla.js +0 -4
  101. package/dist/Conversations/SocialWalls.d.ts +9 -51
  102. package/dist/Conversations/Transfer.d.ts +1 -0
  103. package/dist/Conversations/index.d.ts +4 -2
  104. package/dist/Conversations/index.js +21 -9
  105. package/dist/Presence/ChannelRoutingState.d.ts +17 -0
  106. package/dist/Presence/ChannelRoutingState.js +9 -0
  107. package/dist/Tickets/AccessLevel.d.ts +5 -0
  108. package/dist/Tickets/AccessLevel.js +9 -0
  109. package/dist/index.js +17 -7
  110. package/dist/src/Automations/Capabilities/Capability.d.ts +0 -33
  111. package/dist/src/Automations/Capabilities/Capability.js +1 -15
  112. package/dist/src/Automations/Common.d.ts +0 -47
  113. package/dist/src/Automations/Common.js +0 -22
  114. package/dist/src/Automations/Events/Event.d.ts +3 -31
  115. package/dist/src/Automations/Events/Event.js +0 -12
  116. package/dist/src/Automations/Executions/Execution.d.ts +4 -144
  117. package/dist/src/Automations/Executions/Execution.js +1 -40
  118. package/dist/src/Automations/Executions/index.d.ts +0 -1
  119. package/dist/src/Automations/Executions/index.js +0 -1
  120. package/dist/src/Automations/Flows/Canvas.d.ts +4 -21
  121. package/dist/src/Automations/Flows/Canvas.js +1 -5
  122. package/dist/src/Automations/Flows/Flow.d.ts +3 -48
  123. package/dist/src/Automations/Flows/Flow.js +1 -25
  124. package/dist/src/Automations/Nodes/Node.d.ts +3 -41
  125. package/dist/src/Automations/Nodes/Node.js +1 -10
  126. package/dist/src/Common/Channels/Channel.d.ts +4 -6
  127. package/dist/src/Conversations/Conversation.d.ts +0 -90
  128. package/dist/src/Tickets/Dashboard.d.ts +0 -1
  129. package/package.json +2 -5
  130. package/dist/Conversations/InboxMongo.d.ts +0 -154
  131. package/dist/Conversations/InboxMongo.js +0 -128
  132. package/dist/Conversations/InboxProjection.d.ts +0 -162
  133. package/dist/src/Automations/Executions/Testing.d.ts +0 -166
  134. package/dist/src/Automations/Executions/Testing.js +0 -54
  135. /package/dist/{Conversations/InboxProjection.js → AI/MapPolygon.js} +0 -0
@@ -0,0 +1,22 @@
1
+ export interface Map {
2
+ id?: string | null;
3
+ spaceId: string | "";
4
+ name: string | "";
5
+ description: string | "";
6
+ layers: MapLayer[];
7
+ createdAt: Date;
8
+ createdBy: string;
9
+ updatedAt?: Date | null;
10
+ updatedBy?: string | null;
11
+ deletedAt?: Date | null;
12
+ deletedBy?: string | null;
13
+ }
14
+ export interface MapLayer {
15
+ id?: string | null;
16
+ spaceId: string | "";
17
+ name: string | "";
18
+ fileName: string | "";
19
+ fileUrl: string | "";
20
+ data?: object | null;
21
+ polygons?: object | null;
22
+ }
@@ -415,6 +415,8 @@ export interface IMessage {
415
415
  idLocal?: number;
416
416
  spaceId: string;
417
417
  conversationId: string;
418
+ /** Deduplicated incoming ordinal within Conversation; null for outgoing/internal/legacy. */
419
+ conversationIncomingSequence?: number | null;
418
420
  workflowId?: string;
419
421
  /**only for Front-End */
420
422
  contactId?: string;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.QueueEvent = exports.Schedules = exports.Notifications = exports.Messages = exports.Channels = exports.API = void 0;
27
37
  exports.API = __importStar(require("./API/index"));
@@ -182,12 +182,18 @@ export interface IContactAddress {
182
182
  isFavorite: boolean;
183
183
  dateLastMsgIn?: Date;
184
184
  dateLastMsgOut?: Date;
185
+ channelActivities?: ContactAddressChannelActivity[];
185
186
  subscriptionsAllowed: string[];
186
187
  subscriptionsRejected: string[];
187
188
  createdAt: Date;
188
189
  verifiedAt?: Date;
189
190
  verifiedBy?: string;
190
191
  }
192
+ export interface ContactAddressChannelActivity {
193
+ externalChannelId: string;
194
+ dateLastMsgIn: Date | null;
195
+ dateLastMsgOut: Date | null;
196
+ }
191
197
  export interface IContactTelInfo {
192
198
  isMobile: boolean;
193
199
  country: string;
@@ -1,5 +1,4 @@
1
1
  import { ID } from './Conversation';
2
- export declare const CONVERSATION_ASSIGNMENT_EVENTS_COLLECTION = "conversation_assignment_events";
3
2
  export type ConversationAssignmentEventType = 'enqueued' | 'routing_started' | 'offered' | 'assigned' | 'accepted' | 'transferred' | 'released' | 'timed_out' | 'requeued';
4
3
  export type ConversationAssignmentReason = 'conversation_created' | 'routing_selected' | 'manual_assignment' | 'manual_transfer' | 'flow_routing' | 'offer_timeout' | 'assignment_timeout' | 'agent_accepted' | 'agent_released' | 'supervisor_released' | 'capacity_rebalance' | 'sla_escalation' | 'system_recovery' | 'transfer_cancelled' | 'transfer_declined';
5
4
  export type AssignmentOwnerReference = {
@@ -1,4 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CONVERSATION_ASSIGNMENT_EVENTS_COLLECTION = void 0;
4
- exports.CONVERSATION_ASSIGNMENT_EVENTS_COLLECTION = 'conversation_assignment_events';
@@ -1,6 +1,4 @@
1
1
  import type { ClassificationSeverity } from './ConversationClassificationEvaluation';
2
- export declare const CLASSIFICATION_TAXONOMY_VERSIONS_COLLECTION = "classification_taxonomy_versions";
3
- export declare const CONVERSATION_EVALUATIONS_COLLECTION = "conversation_evaluations";
4
2
  export type ConversationClassificationDimension = 'contact_reason' | 'incident' | 'outcome' | 'recovery';
5
3
  export type ClassificationTaxonomyStatus = 'draft' | 'published' | 'archived';
6
4
  /**
@@ -27,6 +25,7 @@ export interface ClassificationTaxonomy {
27
25
  export interface ClassificationDimensionConfiguration {
28
26
  dimension: ConversationClassificationDimension;
29
27
  enabled: boolean;
28
+ allowAiGeneratedCategory: boolean;
30
29
  categories: ClassificationCategory[];
31
30
  }
32
31
  export interface ClassificationCategory {
@@ -65,3 +64,15 @@ export interface SaveClassificationTaxonomyDraftRequest {
65
64
  export interface PublishClassificationTaxonomyRequest {
66
65
  expectedRevision: number;
67
66
  }
67
+ export interface ProcessHistoricalConversationClassificationsRequest {
68
+ /** Inclusive UTC start. */
69
+ from: Date;
70
+ /** Exclusive UTC end. */
71
+ to: Date;
72
+ }
73
+ export interface ProcessHistoricalConversationClassificationsResponse {
74
+ queuedConversations: number;
75
+ taxonomyVersion: number;
76
+ from: Date;
77
+ to: Date;
78
+ }
@@ -1,5 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CONVERSATION_EVALUATIONS_COLLECTION = exports.CLASSIFICATION_TAXONOMY_VERSIONS_COLLECTION = void 0;
4
- exports.CLASSIFICATION_TAXONOMY_VERSIONS_COLLECTION = 'classification_taxonomy_versions';
5
- exports.CONVERSATION_EVALUATIONS_COLLECTION = 'conversation_evaluations';
@@ -15,6 +15,8 @@ export interface ConversationResolvedForClassificationEvent {
15
15
  contactId?: string;
16
16
  resolvedAt: Date;
17
17
  correlationId: string;
18
+ /** Pins a published taxonomy for explicitly requested historical processing. */
19
+ taxonomyId?: string;
18
20
  }
19
21
  /** Payload emitted when evaluation reaches completed, failed or skipped. */
20
22
  export interface ConversationClassificationEvaluationFinishedEvent {
@@ -1,4 +1,7 @@
1
1
  import { UserInfo } from "../Users/UserTrii";
2
+ import type { ConversationReadState } from './ConversationReadState';
3
+ import type { ConversationPendingTransfer } from './ConversationPendingTransfer';
4
+ import type { ConversationSlaSnapshot, ConversationSlaStatus } from './ConversationSlaClockState';
2
5
  import { ILabel } from "./Label";
3
6
  import { GroupInfo } from "./Groups/Group";
4
7
  import { Channels } from "../Common/index";
@@ -38,39 +41,26 @@ export interface IConversation {
38
41
  status: ConversationStatus;
39
42
  priority: 'low' | 'normal' | 'high' | 'urgent';
40
43
  assignment: ConversationAssignmentSnapshot;
41
- /** @deprecated Use owner and assignment.*/
42
- assignedTo?: ConversationAssigned;
43
- sla: {
44
- status: 'none' | 'running' | 'warning' | 'breached' | 'met';
45
- deadlineAt?: Date;
46
- policyId?: string;
47
- version: number;
48
- };
44
+ /** Preserve assignment until acceptance atomically replaces it and clears this handoff. */
45
+ pendingTransfer?: ConversationPendingTransfer | null;
46
+ sla: ConversationSlaSnapshot;
49
47
  lastMessage: string;
50
48
  lastMessageId?: string;
51
- newMessagesCount: number;
52
- newMessagesUnread: boolean;
49
+ readState: ConversationReadState;
53
50
  lastActivityAt: Date;
54
51
  lastCustomerActivityAt?: Date;
55
52
  lastAgentActivityAt?: Date;
56
53
  labels: ILabel[];
57
- /**
58
- * Fijado/favorito. En chats internos (GROUP/DIRECT) el documento está duplicado por miembro
59
- * (`shardKey = "User|{userId}"`), por lo que este flag es por copia/usuario (B1), no del grupo.
60
- */
54
+ /** Shared pin for every viewer of this conversation. */
61
55
  pinned: boolean;
56
+ /** Shared outstanding work; reading does not answer or resolve it. */
57
+ requiresAction: boolean;
62
58
  /**
63
- * Silenciado hasta (B3). Por copia/usuario, igual que `pinned`. null/undefined = no silenciado.
59
+ * Legacy internal-chat preference. Not the shared pin or customer conversation state.
64
60
  * El front compara contra la hora actual; una fecha lejana representa "siempre".
65
61
  */
66
62
  mutedUntil?: Date | null;
67
- /** @deprecated A transfer is represented by an event and the resulting current state. */
68
- transferBy?: string;
69
- /** @deprecated A transfer is represented by an event and the resulting current state. */
70
- transferTo?: ConversationAssigned;
71
63
  expired: boolean;
72
- /** @deprecated Expiration does not own a separate assignment snapshot.*/
73
- expiredAssignedTo: ConversationAssigned;
74
64
  participants: UserInfo[];
75
65
  archived: boolean;
76
66
  spam: boolean;
@@ -93,7 +83,18 @@ export interface IConversation {
93
83
  resolutionReasonId?: string;
94
84
  finalizedAt: Date;
95
85
  finalizedBy?: string;
86
+ /** Presentation kind, not a separate lifecycle. Public conversations belong to one contact. */
87
+ interactionKind: InteractionKind;
88
+ /** Internal Post.id, required for public views. Null for private conversations. */
89
+ wallPostId?: string | null;
90
+ /** Stable internal WallMessage.id root; required for comment/mention, null for wall_post/private.
91
+ * Correlate by tenant/channel/contact/post/root, never by post alone.
92
+ */
93
+ wallRootCommentId?: string | null;
94
+ /** Mutable navigation focus in the public thread, not its identity. */
95
+ lastCommentId?: string | null;
96
96
  }
97
+ export type InteractionKind = 'private' | 'wall_post' | 'comment' | 'mention';
97
98
  export interface IWhatsAppGroupInfo {
98
99
  whatsappGroupId: string;
99
100
  groupInviteCode: string;
@@ -185,7 +186,7 @@ export declare enum ConversationStatus {
185
186
  FINALIZED = 3,// Alias for RESOLVED
186
187
  WAITING = 10
187
188
  }
188
- export type InboxViewId = 'pending' | 'following' | 'sla_warning' | 'sla_breached' | 'team_sla_breached' | 'resolved' | 'label';
189
+ export type InboxViewId = 'pending' | 'following' | 'sla_warning' | 'sla_breached' | 'team_sla_breached';
189
190
  export type OwnerType = 'user' | 'bot' | 'flow' | 'none';
190
191
  export interface NoConversationOwner {
191
192
  type: 'none';
@@ -308,194 +309,41 @@ export interface PutConversationSubscriptionRequest {
308
309
  expectedVersion?: number;
309
310
  notifications: ConversationSubscriptionNotifications;
310
311
  }
311
- export interface UserConversationState {
312
- id: ID;
313
- spaceId: ID;
314
- conversationId: ID;
315
- userId: ID;
316
- pinned: boolean;
317
- pinnedAt?: Date;
318
- lastReadMessageId?: ID;
319
- lastReadAt?: Date;
320
- updatedAt: Date;
321
- version: number;
322
- }
323
312
  export type ConversationReadStateMode = 'read' | 'unread';
324
313
  export interface PutConversationReadStateRequest {
325
314
  mode: ConversationReadStateMode;
326
- lastReadMessageId?: ID;
327
- lastReadAt?: Date;
315
+ commandId: string;
316
+ expectedConversationVersion: number;
317
+ /** Required for read, null for unread. Observed cursor, never silently server-latest. */
318
+ throughIncomingSequence?: number | null;
328
319
  }
329
320
  export interface PutConversationPinRequest {
321
+ commandId: string;
322
+ expectedConversationVersion: number;
330
323
  pinned: boolean;
331
324
  }
332
- 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' | 'labeled';
333
- export interface ConversationInboxSnapshot {
334
- interactionKind: 'private' | 'wall_post' | 'comment' | 'mention';
335
- channelType: string;
336
- channelId?: ID;
337
- contact: {
338
- id?: ID;
339
- displayName: string;
340
- initials?: string;
341
- isBusiness: boolean;
342
- };
343
- status: ConversationStatus;
344
- owner: ConversationOwner;
345
- queueId?: ID;
346
- preview?: string;
347
- lastMessageId?: ID;
348
- unreadCount: number;
349
- priority: 'low' | 'normal' | 'high' | 'urgent';
350
- sla: {
351
- status: 'none' | 'running' | 'warning' | 'breached' | 'met';
352
- deadlineAt?: Date;
353
- };
354
- lastActivityAt: Date;
355
- labels: {
356
- id: ID;
357
- name: string;
358
- color?: string;
359
- }[];
360
- /** Solo poblado para interactionKind='comment'|'mention' - el WallMessage.id del comentario mas
361
- * reciente, para abrir el hilo posicionado ahi (igual que lastMessageId para conversaciones). */
362
- commentId?: ID;
363
- participants: {
364
- id: ID;
365
- displayName?: string;
366
- avatarUrl?: string;
367
- }[];
368
- /**
369
- * Transferencia pendiente que nadie tomo todavia: el assignment vigente
370
- * tiene source='transfer' y status 'offered' o 'queued'.
371
- *
372
- * Resuelta POR USUARIO. `UserInboxItemDocument` es un documento por
373
- * espacio+usuario+conversacion, asi que el backend puede decir de que lado
374
- * queda cada uno — que es lo que la card previa a la migracion del inbox
375
- * calculaba en el cliente comparando el destino contra el uid propio:
376
- *
377
- * - 'in' -> se la transfirieron a este usuario; `counterpartName` es quien
378
- * la transfirio.
379
- * - 'out' -> la transferencia va hacia otro; `counterpartName` es el
380
- * destino (usuario o cola).
381
- *
382
- * Los dos nombres estan a mano en el momento de la transferencia, asi que
383
- * el proyector no necesita releer el historial de eventos.
384
- *
385
- * Ausente cuando no hay transferencia pendiente y en documentos anteriores
386
- * al campo. `counterpartName` no es opcional: sin nombre la fila no puede
387
- * rotular el icono y descarta el indicador, igual que hace con los
388
- * `participants` sin `displayName`.
389
- */
390
- pendingTransfer?: {
391
- direction: 'in' | 'out';
392
- counterpartName: string;
393
- };
394
- }
395
- /**
396
- * Membership of one materialized conversation in one logical inbox view.
397
- *
398
- * visibilityReasons has set semantics: values must be unique and non-empty.
399
- * Removing one reason preserves the view while at least one reason remains.
400
- *
401
- * labelId is only populated when viewId is 'label' - identifies which of the
402
- * space's labels this particular view entry represents (InboxViewId is a
403
- * fixed enum, but labels are dynamic per space).
404
- */
405
- export interface UserInboxItemView {
406
- viewId: InboxViewId;
407
- visibilityReasons: [
408
- InboxVisibilityReason,
409
- ...InboxVisibilityReason[]
410
- ];
411
- requiresAction: boolean;
412
- labelId?: ID;
413
- }
414
- /**
415
- * Materialized read model. There is exactly one document for each
416
- * spaceId + userId + conversationId tuple.
417
- *
418
- * views must contain unique viewId values, EXCEPT for viewId='label': a
419
- * conversation can carry multiple labels, so multiple entries with
420
- * viewId='label' are allowed as long as their labelId differs (unique
421
- * (viewId, labelId) pairs for that case). Delete the document when the last
422
- * view is removed.
423
- */
424
- export interface UserInboxItemDocument {
425
- id: ID;
426
- spaceId: ID;
427
- userId: ID;
428
- conversationId: ID;
429
- views: UserInboxItemView[];
430
- snapshot: ConversationInboxSnapshot;
431
- pinned: boolean;
432
- priorityScore: number;
433
- sortAt: Date;
434
- conversationVersion: number;
435
- subscriptionVersion?: number;
436
- projectionVersion: number;
437
- lastSourceEventId: ID;
438
- projectedAt: Date;
439
- }
440
- /**
441
- * Materialized counters for exactly one user/view pair (user/view/label when
442
- * viewId is 'label' - labelId becomes part of the logical key in that case).
443
- *
444
- * total and requiresAction count conversations, never visibility reasons.
445
- * unread counts conversations whose snapshot.unreadCount is greater than zero,
446
- * not the number of unread messages.
447
- */
448
- export interface UserInboxCounterDocument {
449
- id: ID;
450
- spaceId: ID;
451
- userId: ID;
452
- viewId: InboxViewId;
453
- labelId?: ID;
454
- total: number;
455
- requiresAction: number;
456
- unread: number;
457
- projectionVersion: number;
458
- updatedAt: Date;
459
- }
325
+ /** Conversation lists return CursorPage<IConversation> directly; authorization stays in backend. */
460
326
  export interface CursorPage<T> {
461
327
  items: T[];
462
- nextCursor?: string;
328
+ nextCursor?: string | null;
463
329
  hasMore: boolean;
464
330
  generatedAt: Date;
465
331
  }
466
- export interface ConversationCapabilitiesDto {
467
- canView: boolean;
468
- canReply: boolean;
469
- canFollow: boolean;
470
- canAbandon: boolean;
471
- canClaim: boolean;
472
- canAccept: boolean;
473
- canRelease: boolean;
474
- canTransfer: boolean;
475
- canResolve: boolean;
476
- canReopen: boolean;
477
- canChangePriority: boolean;
478
- canManageLabels: boolean;
479
- canManageSla: boolean;
480
- canViewAssignmentHistory: boolean;
481
- canViewRoutingDecisions: boolean;
482
- }
332
+ /** Counts distinct authorized conversations on demand; unread includes manual unread. */
483
333
  export interface InboxViewSummaryDto {
484
- id: InboxViewId | 'supervised_target' | `label:${string}`;
334
+ id: string;
485
335
  label: string;
486
- scope: 'personal' | 'supervision' | 'history' | 'labels';
336
+ scope: string;
487
337
  order: number;
488
338
  total: number;
489
339
  requiresAction: number;
490
340
  unread: number;
491
341
  enabled: boolean;
492
342
  targetRequired: boolean;
493
- capabilities: string[];
494
343
  }
495
344
  export interface InboxViewsResponse {
496
345
  views: InboxViewSummaryDto[];
497
346
  countersGeneratedAt: Date;
498
- projectionLagMs?: number;
499
347
  }
500
348
  export interface InboxFilterDto {
501
349
  text?: string;
@@ -504,7 +352,8 @@ export interface InboxFilterDto {
504
352
  channelTypes?: string[];
505
353
  statuses?: ConversationStatus[];
506
354
  priorities?: Array<'low' | 'normal' | 'high' | 'urgent'>;
507
- slaStatuses?: Array<'none' | 'running' | 'warning' | 'breached' | 'met'>;
355
+ slaStatuses?: ConversationSlaStatus[];
356
+ /** OR within the authorized view; labels never grant access. */
508
357
  labelIds?: ID[];
509
358
  unread?: boolean;
510
359
  requiresAction?: boolean;
@@ -519,16 +368,6 @@ export interface InboxFilterDto {
519
368
  type: 'priority';
520
369
  };
521
370
  }
522
- export type InboxConversationItemDto = Pick<UserInboxItemDocument, 'conversationId' | 'views' | 'snapshot' | 'pinned' | 'priorityScore' | 'sortAt'> & {
523
- capabilities: Pick<ConversationCapabilitiesDto, 'canView' | 'canReply' | 'canClaim' | 'canTransfer'>;
524
- };
525
- export interface InboxConversationPage extends CursorPage<InboxConversationItemDto> {
526
- appliedFilter: InboxFilterDto;
527
- facets?: unknown;
528
- }
529
- /**
530
- * DTO API - GET /inbox/views/{viewId}/filter-options.
531
- */
532
371
  export interface InboxFacetOptionDto {
533
372
  id: string;
534
373
  label: string;
@@ -541,9 +380,11 @@ export interface InboxFacetsDto {
541
380
  statuses: InboxFacetOptionDto[];
542
381
  priorities: InboxFacetOptionDto[];
543
382
  slaStatuses: InboxFacetOptionDto[];
383
+ /** Full selected view, before label filters/pagination; only positive counts, once per label/conversation. */
544
384
  labels: InboxFacetOptionDto[];
545
385
  }
546
386
  export interface InboxFilterOptionsResponse {
387
+ viewId: InboxViewId;
547
388
  facets: InboxFacetsDto;
548
389
  generatedAt: Date;
549
390
  }
@@ -558,14 +399,10 @@ export interface ConversationUserRelationDto {
558
399
  isOwner: boolean;
559
400
  isParticipant: boolean;
560
401
  isFollowing: boolean;
561
- isPinned: boolean;
562
- unreadCount: number;
563
402
  }
564
403
  export interface ConversationDetailResponse {
565
404
  conversation: IConversation;
566
405
  relation: ConversationUserRelationDto;
567
- capabilities: ConversationCapabilitiesDto;
568
- availableActions: string[];
569
406
  }
570
407
  export interface AddConversationParticipantRequest {
571
408
  userId: string;
@@ -0,0 +1,16 @@
1
+ import type { TransferConversationReason, TransferConversationTarget } from './Transfer';
2
+ /** Single current handoff, not history. Keep assignment unchanged until acceptance.
3
+ * Accept atomically with matching transferId, sourceAssignmentId and Conversation.version.
4
+ * First valid acceptance wins. Reject/cancel/expire clears this state without moving source.
5
+ * Resolve authorized target audience at query time, checking expiration even before cleanup.
6
+ */
7
+ export interface ConversationPendingTransfer {
8
+ transferId: string;
9
+ sourceAssignmentId: string;
10
+ target: TransferConversationTarget;
11
+ /** Null for automated requests; full actor is recorded in events. */
12
+ requestedByUserId?: string | null;
13
+ requestedAt: Date;
14
+ expiresAt?: Date | null;
15
+ reason: TransferConversationReason;
16
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ /** Shared state; 0 <= readThroughSequence <= lastIncomingSequence.
2
+ * Incoming ordinals are assigned once per deduplicated message in ingestion order.
3
+ * Reading advances only to the observed ordinal; manual unread preserves the cursor.
4
+ * Numeric counters must remain within JavaScript's safe integer range.
5
+ */
6
+ export interface ConversationReadState {
7
+ lastIncomingSequence: number;
8
+ readThroughSequence: number;
9
+ manuallyMarkedUnread: boolean;
10
+ changedAt?: Date | null;
11
+ changedByUserId?: string | null;
12
+ /** Derived by the backend; not persisted in BSON. */
13
+ readonly unreadCount: number;
14
+ /** Includes manual unread even when unreadCount is zero. */
15
+ readonly isUnread: boolean;
16
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,45 @@
1
+ import type { ConversationSlaMetric, ConversationSlaCycleStatus } from './Sla';
2
+ export type ConversationSlaStatus = 'none' | 'running' | 'warning' | 'breached' | 'met' | 'paused' | 'cancelled';
3
+ /** Current operational state, at most one clock per metric. No configuration/history.
4
+ * A replacement gets a new cycleId; archive the previous cycle outside Conversation.
5
+ * Updates use Conversation.version plus expected cycleId/SLA revision. All times UTC.
6
+ */
7
+ export interface ConversationSlaClockState {
8
+ cycleId: string;
9
+ metric: ConversationSlaMetric;
10
+ sequence: number;
11
+ /** breached is unfinished; late completion preserves breachedAt. */
12
+ status: ConversationSlaCycleStatus;
13
+ /** Immutable applied reference must resolve historical calendar/timezone rules. */
14
+ policyId: string;
15
+ policyVersion: number;
16
+ startedByEventId: string;
17
+ startedByMessageId?: string | null;
18
+ assignmentId?: string | null;
19
+ startedAt: Date;
20
+ deadlineAt?: Date | null;
21
+ nextWarningAt?: Date | null;
22
+ warningAt?: Date | null;
23
+ /** Current pause only; clear on resume. */
24
+ pausedAt?: Date | null;
25
+ /** Chargeable seconds through elapsedCalculatedAt, within JS safe integer range. */
26
+ elapsedSeconds: number;
27
+ /** Accounting watermark; on resume reset to resume time preserving consumed seconds. */
28
+ elapsedCalculatedAt: Date;
29
+ breachedAt?: Date | null;
30
+ completedAt?: Date | null;
31
+ cancelledAt?: Date | null;
32
+ }
33
+ /** Summary updated atomically with clocks; never an independent state source. */
34
+ export interface ConversationSlaSnapshot {
35
+ /** Precedence: breached, active warning, running, paused, met, cancelled, none. */
36
+ status: ConversationSlaStatus;
37
+ /** Earliest unfinished/unpaused deadline. Compare against UTC even if evaluator lags. */
38
+ deadlineAt?: Date | null;
39
+ /** Selection for new clocks; current clocks retain their applied references. */
40
+ policyId?: string | null;
41
+ policyVersion?: number | null;
42
+ clocks: ConversationSlaClockState[];
43
+ /** SLA state revision, not policy version. */
44
+ version: number;
45
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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;
@@ -0,0 +1,2 @@
1
+ import { INode } from "../Flow";
2
+ export declare const defaultNodeApi: INode;