@trii/types 2.10.765 → 2.10.767
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.
- package/dist/AI/MapPolygon.d.ts +22 -0
- package/dist/Automations/Events/Event.d.ts +3 -3
- package/dist/Common/Messages/Message.d.ts +1 -0
- package/dist/Contacts/CommunicationEndpoint.d.ts +8 -8
- package/dist/Conversations/Assignment.d.ts +11 -3
- package/dist/Conversations/Classifications/ConversationClassificationEvents.d.ts +2 -2
- package/dist/Conversations/Conversation.d.ts +67 -17
- package/dist/Conversations/ConversationAutomationState.d.ts +28 -6
- package/dist/Conversations/Flows/Nodes/NodeAIChatBot.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeAIChatBot.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeApi.d.ts +2 -0
- package/dist/Conversations/Flows/Nodes/NodeApi.js +183 -0
- package/dist/Conversations/Flows/Nodes/NodeBotIA.d.ts +15 -0
- package/dist/Conversations/Flows/Nodes/NodeBotIA.js +6 -0
- package/dist/Conversations/Flows/Nodes/NodeChatBotIA.d.ts +15 -0
- package/dist/Conversations/Flows/Nodes/NodeChatBotIA.js +6 -0
- package/dist/Conversations/Flows/Nodes/NodeConditional.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeConditional.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeContactSearch.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeContactSearch.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeContactUpdate.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeContactUpdate.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeConversationAssignTo.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeConversationAssignTo.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeConversationFinalize.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeConversationFinalize.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeConversationUpdate.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeConversationUpdate.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeFillForm.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeFillForm.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeFillTicket.d.ts +1 -0
- package/dist/Conversations/Flows/Nodes/NodeFillTicket.js +9 -0
- package/dist/Conversations/Flows/Nodes/NodeGoogleCalendar.d.ts +20 -0
- package/dist/Conversations/Flows/Nodes/NodeGoogleCalendar.js +2 -0
- package/dist/Conversations/Flows/Nodes/NodeGoogleMaps copy.d.ts +12 -0
- package/dist/Conversations/Flows/Nodes/NodeGoogleMaps copy.js +6 -0
- package/dist/Conversations/Flows/Nodes/NodeGoogleMaps.d.ts +15 -0
- package/dist/Conversations/Flows/Nodes/NodeGoogleMaps.js +2 -0
- package/dist/Conversations/Flows/Nodes/NodeMsgReply.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeMsgReply.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeMsgSend.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeMsgSend.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeMsgText.d.ts +1 -0
- package/dist/Conversations/Flows/Nodes/NodeMsgText.js +27 -0
- package/dist/Conversations/Flows/Nodes/NodeMsgWaitResponse.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeMsgWaitResponse.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeRedirect.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeRedirect.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeSendEmail.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeSendEmail.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeSqlQuery.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeSqlQuery.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeStart.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeStart.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeTimeScheduleControl.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeTimeScheduleControl.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeTimeTimer.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeTimeTimer.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeTimeWaitUntil.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeTimeWaitUntil.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeToolCalculator.d.ts +2 -0
- package/dist/Conversations/Flows/Nodes/NodeToolCalculator.js +37 -0
- package/dist/Conversations/Flows/Nodes/NodeToolContacts.d.ts +2 -0
- package/dist/Conversations/Flows/Nodes/NodeToolContacts.js +59 -0
- package/dist/Conversations/Flows/Nodes/NodeToolFunction.d.ts +2 -0
- package/dist/Conversations/Flows/Nodes/NodeToolFunction.js +45 -0
- package/dist/Conversations/Flows/Nodes/NodeToolGoogleCalendar.d.ts +2 -0
- package/dist/Conversations/Flows/Nodes/NodeToolGoogleCalendar.js +87 -0
- package/dist/Conversations/Flows/Nodes/NodeToolGoogleMaps.d.ts +1 -0
- package/dist/Conversations/Flows/Nodes/NodeToolGoogleMaps.js +2 -0
- package/dist/Conversations/Flows/Nodes/NodeToolKnowledge.d.ts +2 -0
- package/dist/Conversations/Flows/Nodes/NodeToolKnowledge.js +52 -0
- package/dist/Conversations/Flows/Nodes/NodeToolMapsCheckPolygon.d.ts +2 -0
- package/dist/Conversations/Flows/Nodes/NodeToolMapsCheckPolygon.js +59 -0
- package/dist/Conversations/Flows/Nodes/NodeToolMcpClient.d.ts +2 -0
- package/dist/Conversations/Flows/Nodes/NodeToolMcpClient.js +45 -0
- package/dist/Conversations/Flows/Nodes/NodeToolShoppingCart.d.ts +2 -0
- package/dist/Conversations/Flows/Nodes/NodeToolShoppingCart.js +81 -0
- package/dist/Conversations/Flows/Nodes/index.d.ts +24 -0
- package/dist/Conversations/Flows/Nodes/index.js +40 -0
- package/dist/Conversations/Routing.d.ts +10 -10
- package/dist/Events/DomainEventTypes.d.ts +23 -23
- package/dist/Presence/ChannelRoutingState.d.ts +17 -0
- package/dist/Presence/ChannelRoutingState.js +9 -0
- package/dist/Tickets/AccessLevel.d.ts +5 -0
- package/dist/Tickets/AccessLevel.js +9 -0
- package/dist/src/Automations/Capabilities/Capability.d.ts +48 -0
- package/dist/src/Automations/Capabilities/Capability.js +9 -0
- package/dist/src/Automations/Capabilities/index.d.ts +1 -0
- package/dist/src/Automations/Capabilities/index.js +17 -0
- package/dist/src/Automations/Common.d.ts +47 -0
- package/dist/src/Automations/Common.js +18 -0
- package/dist/src/Automations/Events/Event.d.ts +41 -0
- package/dist/src/Automations/Events/Event.js +2 -0
- package/dist/src/Automations/Events/index.d.ts +1 -0
- package/dist/src/Automations/Events/index.js +17 -0
- package/dist/src/Automations/Executions/Execution.d.ts +114 -0
- package/dist/src/Automations/Executions/Execution.js +23 -0
- package/dist/src/Automations/Executions/index.d.ts +1 -0
- package/dist/src/Automations/Executions/index.js +17 -0
- package/dist/src/Automations/Flows/Canvas.d.ts +86 -0
- package/dist/src/Automations/Flows/Canvas.js +34 -0
- package/dist/src/Automations/Flows/Flow.d.ts +102 -0
- package/dist/src/Automations/Flows/Flow.js +34 -0
- package/dist/src/Automations/Flows/Requests.d.ts +71 -0
- package/dist/src/Automations/Flows/Requests.js +2 -0
- package/dist/src/Automations/Flows/Validation.d.ts +28 -0
- package/dist/src/Automations/Flows/Validation.js +9 -0
- package/dist/src/Automations/Flows/index.d.ts +4 -0
- package/dist/src/Automations/Flows/index.js +20 -0
- package/dist/src/Automations/Nodes/Node.d.ts +75 -0
- package/dist/src/Automations/Nodes/Node.js +18 -0
- package/dist/src/Automations/Nodes/index.d.ts +1 -0
- package/dist/src/Automations/Nodes/index.js +17 -0
- package/dist/src/Automations/index.d.ts +6 -0
- package/dist/src/Automations/index.js +22 -0
- package/dist/src/Chats/Chat.d.ts +61 -0
- package/dist/src/Chats/Chat.js +28 -0
- package/dist/src/Common/Channels/Channel.d.ts +26 -1
- package/dist/src/Contacts/contacts.d.ts +2 -2
- package/dist/src/Conversations/Assignment.d.ts +81 -0
- package/dist/src/Conversations/Assignment.js +4 -0
- package/dist/src/Conversations/Conversation.d.ts +241 -48
- package/dist/src/Conversations/Conversation.js +14 -34
- package/dist/src/Conversations/DashBoard/dashboard.d.ts +2 -2
- package/dist/src/Conversations/Flows/Workflows/Workflow.d.ts +280 -123
- package/dist/src/Conversations/Flows/Workflows/Workflow.js +85 -35
- package/dist/src/Conversations/Groups/Group.d.ts +2 -8
- package/dist/src/Conversations/Groups/Group.js +0 -6
- package/dist/src/Conversations/InboxProjection.js +2 -0
- package/dist/src/Conversations/Label.d.ts +1 -1
- package/dist/src/Conversations/Outbox.d.ts +24 -0
- package/dist/src/Conversations/Outbox.js +4 -0
- package/dist/src/Conversations/Queue.d.ts +107 -0
- package/dist/src/Conversations/Queue.js +4 -0
- package/dist/src/Conversations/Routing.d.ts +164 -0
- package/dist/src/Conversations/Routing.js +2 -0
- package/dist/src/Conversations/Sla.d.ts +227 -0
- package/dist/src/Conversations/Sla.js +6 -0
- package/dist/src/Conversations/Transfer.d.ts +73 -0
- package/dist/src/Conversations/Transfer.js +2 -0
- package/dist/src/Conversations/WebHook.d.ts +1 -1
- package/dist/src/Conversations/index.d.ts +9 -1
- package/dist/src/Conversations/index.js +9 -1
- package/dist/src/Forms/API.d.ts +53 -0
- package/dist/src/Forms/API.js +2 -0
- package/dist/src/Forms/SubmittedForm.d.ts +56 -0
- package/dist/src/Forms/SubmittedForm.js +9 -0
- package/dist/src/Forms/index.d.ts +2 -0
- package/dist/src/Forms/index.js +18 -0
- package/dist/src/Presence/AgentPause.d.ts +24 -0
- package/dist/src/Presence/AgentPause.js +19 -0
- package/dist/src/Presence/QueueParticipation.d.ts +17 -0
- package/dist/src/Presence/QueueParticipation.js +2 -0
- package/dist/src/Presence/QueueRoutingState.d.ts +27 -0
- package/dist/src/Presence/QueueRoutingState.js +9 -0
- package/dist/src/Presence/index.d.ts +3 -0
- package/dist/src/Presence/index.js +19 -0
- package/dist/src/Tickets/Category.d.ts +18 -0
- package/dist/src/Tickets/Dashboard.d.ts +77 -0
- package/dist/src/Tickets/Dashboard.js +13 -1
- package/dist/src/Tickets/Fields.d.ts +1 -0
- package/dist/src/Tickets/Layouts.d.ts +3 -1
- package/dist/src/Tickets/Workflow.d.ts +20 -0
- package/dist/src/Users/UserTrii.d.ts +10 -0
- package/dist/src/Users/UserTrii.js +8 -1
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +4 -1
- package/package.json +1 -1
- package/dist/src/Conversations/DashBoard/dashboardForms.d.ts +0 -44
- package/dist/src/Conversations/DashBoard/dashboardForms.js +0 -24
- /package/dist/{Conversations/InboxProjection.js → AI/MapPolygon.js} +0 -0
- /package/dist/{Conversations → src/Conversations}/InboxMongo.d.ts +0 -0
- /package/dist/{Conversations → src/Conversations}/InboxMongo.js +0 -0
- /package/dist/{Conversations → src/Conversations}/InboxProjection.d.ts +0 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { ID } from './Conversation';
|
|
2
|
+
export declare const CONVERSATION_ASSIGNMENT_EVENTS_COLLECTION = "conversation_assignment_events";
|
|
3
|
+
export type ConversationAssignmentEventType = 'enqueued' | 'routing_started' | 'offered' | 'assigned' | 'accepted' | 'transferred' | 'released' | 'timed_out' | 'requeued';
|
|
4
|
+
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';
|
|
5
|
+
export type AssignmentOwnerReference = {
|
|
6
|
+
type: 'none';
|
|
7
|
+
id?: never;
|
|
8
|
+
} | {
|
|
9
|
+
type: 'user' | 'bot' | 'flow';
|
|
10
|
+
id: ID;
|
|
11
|
+
};
|
|
12
|
+
export type AssignmentStateReference = {
|
|
13
|
+
status: 'unrouted';
|
|
14
|
+
assignmentId?: never;
|
|
15
|
+
queueId?: never;
|
|
16
|
+
owner: {
|
|
17
|
+
type: 'none';
|
|
18
|
+
id?: never;
|
|
19
|
+
} | {
|
|
20
|
+
type: 'bot' | 'flow';
|
|
21
|
+
id: ID;
|
|
22
|
+
};
|
|
23
|
+
} | {
|
|
24
|
+
status: 'queued' | 'routing';
|
|
25
|
+
assignmentId: ID;
|
|
26
|
+
queueId: ID;
|
|
27
|
+
owner: {
|
|
28
|
+
type: 'none';
|
|
29
|
+
id?: never;
|
|
30
|
+
};
|
|
31
|
+
} | {
|
|
32
|
+
status: 'offered' | 'assigned' | 'accepted';
|
|
33
|
+
assignmentId: ID;
|
|
34
|
+
queueId: ID;
|
|
35
|
+
owner: {
|
|
36
|
+
type: 'user';
|
|
37
|
+
id: ID;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export type AssignmentActorReference = {
|
|
41
|
+
type: 'system';
|
|
42
|
+
id?: never;
|
|
43
|
+
} | {
|
|
44
|
+
type: 'user' | 'bot' | 'flow';
|
|
45
|
+
id: ID;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Immutable domain event stored in conversation_assignment_events.
|
|
49
|
+
*
|
|
50
|
+
* Events must only be inserted. Corrections are represented by a new event.
|
|
51
|
+
*/
|
|
52
|
+
export interface ConversationAssignmentEvent {
|
|
53
|
+
id: ID;
|
|
54
|
+
spaceId: ID;
|
|
55
|
+
conversationId: ID;
|
|
56
|
+
/**
|
|
57
|
+
* Monotonic order within a conversation.
|
|
58
|
+
*/
|
|
59
|
+
sequence: number;
|
|
60
|
+
eventType: ConversationAssignmentEventType;
|
|
61
|
+
reason: ConversationAssignmentReason;
|
|
62
|
+
/**
|
|
63
|
+
* Undefined only when no previous assignment state existed.
|
|
64
|
+
*/
|
|
65
|
+
previous?: AssignmentStateReference;
|
|
66
|
+
current: AssignmentStateReference;
|
|
67
|
+
actor: AssignmentActorReference;
|
|
68
|
+
routingDecisionId?: ID;
|
|
69
|
+
/**
|
|
70
|
+
* Version of conversations after applying the transition.
|
|
71
|
+
*/
|
|
72
|
+
conversationVersion: number;
|
|
73
|
+
correlationId?: ID;
|
|
74
|
+
causationId?: ID;
|
|
75
|
+
idempotencyKey: string;
|
|
76
|
+
/**
|
|
77
|
+
* Domain time and persistence time, respectively.
|
|
78
|
+
*/
|
|
79
|
+
occurredAt: Date;
|
|
80
|
+
recordedAt: Date;
|
|
81
|
+
}
|
|
@@ -4,16 +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";
|
|
7
8
|
export interface IConversation {
|
|
8
9
|
id: string;
|
|
9
|
-
/**only for Front-End */
|
|
10
|
-
idLocal?: number;
|
|
11
10
|
spaceId: string;
|
|
11
|
+
version: number;
|
|
12
|
+
/** @deprecated Use assignment.owner. */
|
|
12
13
|
type: ChatType;
|
|
13
|
-
|
|
14
|
+
/**only for Front-End */
|
|
14
15
|
chatName: string;
|
|
15
16
|
chatImage: string;
|
|
16
|
-
chatMembers: IChatMemeber[];
|
|
17
17
|
chatMembersCount: number;
|
|
18
18
|
whatsappGroupInfo?: IWhatsAppGroupInfo;
|
|
19
19
|
contactInfo?: IContactInfo;
|
|
@@ -21,48 +21,55 @@ export interface IConversation {
|
|
|
21
21
|
remoteAddress: string;
|
|
22
22
|
remoteAddressId: string;
|
|
23
23
|
channelInfo: Channels.IChannelInfo;
|
|
24
|
+
status: ConversationStatus;
|
|
25
|
+
priority: 'low' | 'normal' | 'high' | 'urgent';
|
|
26
|
+
assignment: ConversationAssignmentSnapshot;
|
|
27
|
+
/** @deprecated Use owner and assignment.*/
|
|
28
|
+
assignedTo?: ConversationAssigned;
|
|
29
|
+
sla: {
|
|
30
|
+
status: 'none' | 'running' | 'warning' | 'breached' | 'met';
|
|
31
|
+
deadlineAt?: Date;
|
|
32
|
+
policyId?: string;
|
|
33
|
+
version: number;
|
|
34
|
+
};
|
|
24
35
|
lastMessage: string;
|
|
25
36
|
lastMessageId?: string;
|
|
26
37
|
newMessagesCount: number;
|
|
27
38
|
newMessagesUnread: boolean;
|
|
39
|
+
lastActivityAt: Date;
|
|
40
|
+
lastCustomerActivityAt?: Date;
|
|
41
|
+
lastAgentActivityAt?: Date;
|
|
28
42
|
labels: ILabel[];
|
|
29
43
|
pinned: boolean;
|
|
44
|
+
/** @deprecated A transfer is represented by an event and the resulting current state. */
|
|
30
45
|
transferBy?: string;
|
|
46
|
+
/** @deprecated A transfer is represented by an event and the resulting current state. */
|
|
31
47
|
transferTo?: ConversationAssigned;
|
|
32
48
|
expired: boolean;
|
|
49
|
+
/** @deprecated Expiration does not own a separate assignment snapshot.*/
|
|
33
50
|
expiredAssignedTo: ConversationAssigned;
|
|
34
|
-
status: ConversationSatus;
|
|
35
|
-
assignedTo?: ConversationAssigned;
|
|
36
51
|
participants: UserInfo[];
|
|
37
52
|
archived: boolean;
|
|
53
|
+
spam: boolean;
|
|
38
54
|
externalMessagingWindowEndAt?: Date;
|
|
39
55
|
workflowId?: string;
|
|
40
56
|
botStatus: ConversationBotStatus;
|
|
41
57
|
botVars: ConversationBotVar[];
|
|
42
58
|
metadata: IConversationMetadata;
|
|
43
59
|
/** Domain objects discussed or served by this conversation. */
|
|
44
|
-
contextReferences?: IConversationContextReference[];
|
|
45
|
-
finalizedAt: Date;
|
|
46
|
-
finalizedBy?: string;
|
|
47
60
|
finalizedOnWebChat: Date;
|
|
48
61
|
ending?: IEnding;
|
|
49
62
|
qualityEvaluation?: IInteractionQualityEvaluation;
|
|
50
63
|
reOpenAt?: Date;
|
|
64
|
+
reOpenByUserId?: string;
|
|
65
|
+
reOpenPolicyId?: string;
|
|
51
66
|
createdAt: Date;
|
|
52
67
|
updatedAt: Date;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
DEBT = "DEBT"
|
|
59
|
-
}
|
|
60
|
-
export interface IConversationContextReference {
|
|
61
|
-
entityType: ConversationContextType;
|
|
62
|
-
entityId: string;
|
|
63
|
-
role?: string;
|
|
64
|
-
linkedAt: Date;
|
|
65
|
-
linkedBy?: string;
|
|
68
|
+
resolvedAt?: Date;
|
|
69
|
+
resolvedByUserId?: string;
|
|
70
|
+
resolutionReasonId?: string;
|
|
71
|
+
finalizedAt: Date;
|
|
72
|
+
finalizedBy?: string;
|
|
66
73
|
}
|
|
67
74
|
export interface IWhatsAppGroupInfo {
|
|
68
75
|
whatsappGroupId: string;
|
|
@@ -122,29 +129,14 @@ export declare enum ConversationBotStatus {
|
|
|
122
129
|
FINALIZED = 4,
|
|
123
130
|
CANCELED = 5
|
|
124
131
|
}
|
|
125
|
-
export
|
|
132
|
+
export interface ConversationBotVar {
|
|
126
133
|
title: string;
|
|
127
134
|
value: string;
|
|
128
135
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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 {
|
|
136
|
+
/**
|
|
137
|
+
* @deprecated Legacy channel assignment configuration. Use QueueRoutingConfig.
|
|
138
|
+
*/
|
|
139
|
+
export interface ConversationAssigned {
|
|
148
140
|
groupInfo?: GroupInfo;
|
|
149
141
|
userInfo?: UserInfo;
|
|
150
142
|
userIds?: string[];
|
|
@@ -153,15 +145,216 @@ export declare enum ConversationDirection {
|
|
|
153
145
|
INBOUND = 1,
|
|
154
146
|
OUTBOUND = 2
|
|
155
147
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
FINALIZED = 3,
|
|
160
|
-
ARCHIVED = 4
|
|
161
|
-
}
|
|
148
|
+
/**
|
|
149
|
+
* @deprecated Use QueueDistributionMode and QueueRoutingStrategy.
|
|
150
|
+
*/
|
|
162
151
|
export declare enum AssignMethod {
|
|
163
152
|
ALL = 0,
|
|
164
153
|
ROUND_ROBIN = 1,
|
|
165
154
|
RANDOM = 2,
|
|
166
155
|
LEAST_BUSY = 3
|
|
167
156
|
}
|
|
157
|
+
export declare enum ConversationStatus {
|
|
158
|
+
NEW = 1,
|
|
159
|
+
OPEN = 2,
|
|
160
|
+
ACTIVE = 2,// Alias for OPEN
|
|
161
|
+
RESOLVED = 3,
|
|
162
|
+
FINALIZED = 3,// Alias for RESOLVED
|
|
163
|
+
WAITING = 10
|
|
164
|
+
}
|
|
165
|
+
export type InboxViewId = 'pending' | 'following' | 'sla_warning' | 'sla_breached' | 'team_sla_breached' | 'resolved';
|
|
166
|
+
export type OwnerType = 'user' | 'bot' | 'flow' | 'none';
|
|
167
|
+
export interface NoConversationOwner {
|
|
168
|
+
type: 'none';
|
|
169
|
+
id?: never;
|
|
170
|
+
displayName?: never;
|
|
171
|
+
avatarUrl?: never;
|
|
172
|
+
}
|
|
173
|
+
export interface UserConversationOwner {
|
|
174
|
+
type: 'user';
|
|
175
|
+
id: ID;
|
|
176
|
+
displayName?: string;
|
|
177
|
+
avatarUrl?: string;
|
|
178
|
+
}
|
|
179
|
+
export interface BotConversationOwner {
|
|
180
|
+
type: 'bot';
|
|
181
|
+
id: ID;
|
|
182
|
+
displayName?: string;
|
|
183
|
+
avatarUrl?: string;
|
|
184
|
+
}
|
|
185
|
+
export interface FlowConversationOwner {
|
|
186
|
+
type: 'flow';
|
|
187
|
+
id: ID;
|
|
188
|
+
displayName?: string;
|
|
189
|
+
avatarUrl?: string;
|
|
190
|
+
}
|
|
191
|
+
export type ConversationOwner = NoConversationOwner | UserConversationOwner | BotConversationOwner | FlowConversationOwner;
|
|
192
|
+
export type ConversationAssignmentStatus = 'unrouted' | 'queued' | 'routing' | 'offered' | 'assigned' | 'accepted';
|
|
193
|
+
export type ConversationAssignmentSource = 'routing' | 'manual' | 'transfer' | 'requeue';
|
|
194
|
+
interface QueuedConversationAssignmentBase {
|
|
195
|
+
assignmentId: ID;
|
|
196
|
+
queueId: ID;
|
|
197
|
+
source: ConversationAssignmentSource;
|
|
198
|
+
queuedAt: Date;
|
|
199
|
+
lastRoutingDecisionId?: ID;
|
|
200
|
+
}
|
|
201
|
+
export type ConversationAssignmentSnapshot = {
|
|
202
|
+
status: 'unrouted';
|
|
203
|
+
assignmentId?: never;
|
|
204
|
+
queueId?: never;
|
|
205
|
+
owner: NoConversationOwner | BotConversationOwner | FlowConversationOwner;
|
|
206
|
+
source?: never;
|
|
207
|
+
queuedAt?: never;
|
|
208
|
+
lastRoutingDecisionId?: never;
|
|
209
|
+
offeredAt?: never;
|
|
210
|
+
offerExpiresAt?: never;
|
|
211
|
+
assignedAt?: never;
|
|
212
|
+
acceptedAt?: never;
|
|
213
|
+
} | (QueuedConversationAssignmentBase & {
|
|
214
|
+
status: 'queued' | 'routing';
|
|
215
|
+
owner: NoConversationOwner;
|
|
216
|
+
offeredAt?: never;
|
|
217
|
+
offerExpiresAt?: never;
|
|
218
|
+
assignedAt?: never;
|
|
219
|
+
acceptedAt?: never;
|
|
220
|
+
}) | (QueuedConversationAssignmentBase & {
|
|
221
|
+
status: 'offered';
|
|
222
|
+
owner: UserConversationOwner;
|
|
223
|
+
offeredAt: Date;
|
|
224
|
+
offerExpiresAt?: Date;
|
|
225
|
+
assignedAt?: never;
|
|
226
|
+
acceptedAt?: never;
|
|
227
|
+
}) | (QueuedConversationAssignmentBase & {
|
|
228
|
+
status: 'assigned';
|
|
229
|
+
owner: UserConversationOwner;
|
|
230
|
+
offeredAt?: Date;
|
|
231
|
+
offerExpiresAt?: Date;
|
|
232
|
+
assignedAt: Date;
|
|
233
|
+
acceptedAt?: never;
|
|
234
|
+
}) | (QueuedConversationAssignmentBase & {
|
|
235
|
+
status: 'accepted';
|
|
236
|
+
owner: UserConversationOwner;
|
|
237
|
+
offeredAt?: Date;
|
|
238
|
+
offerExpiresAt?: Date;
|
|
239
|
+
assignedAt: Date;
|
|
240
|
+
acceptedAt: Date;
|
|
241
|
+
});
|
|
242
|
+
export type ActorType = 'user' | 'contact' | 'bot' | 'flow' | 'system';
|
|
243
|
+
export type ParticipantRole = 'owner' | 'collaborator' | 'follower' | 'mentioned' | 'supervisor' | 'bot' | 'flow' | 'historical';
|
|
244
|
+
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';
|
|
245
|
+
export type ID = string;
|
|
246
|
+
export type ConversationSubscriptionSource = 'manual' | 'assigned' | 'participated' | 'mentioned' | 'supervisor' | 'rule';
|
|
247
|
+
export type ConversationSubscriptionNotificationEvent = 'customer_message' | 'internal_mention' | 'assignment_change' | 'acceptance' | 'resolution' | 'reopen';
|
|
248
|
+
export type ConversationSubscriptionNotifications = {
|
|
249
|
+
mode: 'all' | 'muted';
|
|
250
|
+
events?: never;
|
|
251
|
+
} | {
|
|
252
|
+
mode: 'custom';
|
|
253
|
+
events: [
|
|
254
|
+
ConversationSubscriptionNotificationEvent,
|
|
255
|
+
...ConversationSubscriptionNotificationEvent[]
|
|
256
|
+
];
|
|
257
|
+
};
|
|
258
|
+
interface ConversationSubscriptionBase {
|
|
259
|
+
id: ID;
|
|
260
|
+
spaceId: string;
|
|
261
|
+
conversationId: ID;
|
|
262
|
+
userId: ID;
|
|
263
|
+
source: ConversationSubscriptionSource;
|
|
264
|
+
notifications: ConversationSubscriptionNotifications;
|
|
265
|
+
createdAt: Date;
|
|
266
|
+
updatedAt: Date;
|
|
267
|
+
version: number;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Current following state for one user/conversation pair.
|
|
271
|
+
*
|
|
272
|
+
* A subscription is persistent product intent. Assignment or participation
|
|
273
|
+
* visibility must not create it unless an explicit auto-follow policy applies.
|
|
274
|
+
*/
|
|
275
|
+
export type ConversationSubscription = (ConversationSubscriptionBase & {
|
|
276
|
+
status: 'following';
|
|
277
|
+
followedAt: Date;
|
|
278
|
+
unfollowedAt?: never;
|
|
279
|
+
}) | (ConversationSubscriptionBase & {
|
|
280
|
+
status: 'unfollowed';
|
|
281
|
+
followedAt: Date;
|
|
282
|
+
unfollowedAt: Date;
|
|
283
|
+
});
|
|
284
|
+
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';
|
|
285
|
+
export interface ConversationInboxSnapshot {
|
|
286
|
+
interactionKind: 'private' | 'wall_post' | 'comment' | 'mention';
|
|
287
|
+
channelType: string;
|
|
288
|
+
contact: {
|
|
289
|
+
id?: ID;
|
|
290
|
+
displayName: string;
|
|
291
|
+
initials?: string;
|
|
292
|
+
};
|
|
293
|
+
status: ConversationStatus;
|
|
294
|
+
owner: ConversationOwner;
|
|
295
|
+
queueId?: ID;
|
|
296
|
+
preview?: string;
|
|
297
|
+
unreadCount: number;
|
|
298
|
+
priority: 'low' | 'normal' | 'high' | 'urgent';
|
|
299
|
+
sla: {
|
|
300
|
+
status: 'none' | 'running' | 'warning' | 'breached' | 'met';
|
|
301
|
+
deadlineAt?: Date;
|
|
302
|
+
};
|
|
303
|
+
lastActivityAt: Date;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Membership of one materialized conversation in one logical inbox view.
|
|
307
|
+
*
|
|
308
|
+
* visibilityReasons has set semantics: values must be unique and non-empty.
|
|
309
|
+
* Removing one reason preserves the view while at least one reason remains.
|
|
310
|
+
*/
|
|
311
|
+
export interface UserInboxItemView {
|
|
312
|
+
viewId: InboxViewId;
|
|
313
|
+
visibilityReasons: [
|
|
314
|
+
InboxVisibilityReason,
|
|
315
|
+
...InboxVisibilityReason[]
|
|
316
|
+
];
|
|
317
|
+
requiresAction: boolean;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Materialized read model. There is exactly one document for each
|
|
321
|
+
* spaceId + userId + conversationId tuple.
|
|
322
|
+
*
|
|
323
|
+
* views must contain unique viewId values. Delete the document when the last
|
|
324
|
+
* view is removed.
|
|
325
|
+
*/
|
|
326
|
+
export interface UserInboxItemDocument {
|
|
327
|
+
id: ID;
|
|
328
|
+
spaceId: ID;
|
|
329
|
+
userId: ID;
|
|
330
|
+
conversationId: ID;
|
|
331
|
+
views: UserInboxItemView[];
|
|
332
|
+
snapshot: ConversationInboxSnapshot;
|
|
333
|
+
pinned: boolean;
|
|
334
|
+
priorityScore: number;
|
|
335
|
+
sortAt: Date;
|
|
336
|
+
conversationVersion: number;
|
|
337
|
+
subscriptionVersion?: number;
|
|
338
|
+
projectionVersion: number;
|
|
339
|
+
lastSourceEventId: ID;
|
|
340
|
+
projectedAt: Date;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Materialized counters for exactly one user/view pair.
|
|
344
|
+
*
|
|
345
|
+
* total and requiresAction count conversations, never visibility reasons.
|
|
346
|
+
* unread counts conversations whose snapshot.unreadCount is greater than zero,
|
|
347
|
+
* not the number of unread messages.
|
|
348
|
+
*/
|
|
349
|
+
export interface UserInboxCounterDocument {
|
|
350
|
+
id: ID;
|
|
351
|
+
spaceId: ID;
|
|
352
|
+
userId: ID;
|
|
353
|
+
viewId: InboxViewId;
|
|
354
|
+
total: number;
|
|
355
|
+
requiresAction: number;
|
|
356
|
+
unread: number;
|
|
357
|
+
projectionVersion: number;
|
|
358
|
+
updatedAt: Date;
|
|
359
|
+
}
|
|
360
|
+
export {};
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
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 = {}));
|
|
3
|
+
exports.ConversationStatus = exports.AssignMethod = exports.ConversationDirection = exports.ConversationBotStatus = void 0;
|
|
11
4
|
var ConversationBotStatus;
|
|
12
5
|
(function (ConversationBotStatus) {
|
|
13
6
|
ConversationBotStatus[ConversationBotStatus["NONE"] = 0] = "NONE";
|
|
@@ -16,37 +9,14 @@ var ConversationBotStatus;
|
|
|
16
9
|
ConversationBotStatus[ConversationBotStatus["FINALIZED"] = 4] = "FINALIZED";
|
|
17
10
|
ConversationBotStatus[ConversationBotStatus["CANCELED"] = 5] = "CANCELED";
|
|
18
11
|
})(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;
|
|
38
12
|
var ConversationDirection;
|
|
39
13
|
(function (ConversationDirection) {
|
|
40
14
|
ConversationDirection[ConversationDirection["INBOUND"] = 1] = "INBOUND";
|
|
41
15
|
ConversationDirection[ConversationDirection["OUTBOUND"] = 2] = "OUTBOUND";
|
|
42
16
|
})(ConversationDirection || (exports.ConversationDirection = ConversationDirection = {}));
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
ConversationSatus[ConversationSatus["ACTIVE"] = 2] = "ACTIVE";
|
|
47
|
-
ConversationSatus[ConversationSatus["FINALIZED"] = 3] = "FINALIZED";
|
|
48
|
-
ConversationSatus[ConversationSatus["ARCHIVED"] = 4] = "ARCHIVED";
|
|
49
|
-
})(ConversationSatus || (exports.ConversationSatus = ConversationSatus = {}));
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use QueueDistributionMode and QueueRoutingStrategy.
|
|
19
|
+
*/
|
|
50
20
|
var AssignMethod;
|
|
51
21
|
(function (AssignMethod) {
|
|
52
22
|
AssignMethod[AssignMethod["ALL"] = 0] = "ALL";
|
|
@@ -54,3 +24,13 @@ var AssignMethod;
|
|
|
54
24
|
AssignMethod[AssignMethod["RANDOM"] = 2] = "RANDOM";
|
|
55
25
|
AssignMethod[AssignMethod["LEAST_BUSY"] = 3] = "LEAST_BUSY";
|
|
56
26
|
})(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
|
-
/**
|
|
21
|
-
|
|
20
|
+
/** Filters conversations by IConversation.assignment.owner.id. */
|
|
21
|
+
ownerUserId?: string | null;
|
|
22
22
|
}
|
|
23
23
|
export declare enum GeneralDashboardType {
|
|
24
24
|
UNASSIGNED = 0,
|