@trii/types 2.10.761 → 2.10.762
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/Automations/Events/Event.d.ts +3 -3
- package/dist/Contacts/CommunicationEndpoint.d.ts +8 -8
- package/dist/Conversations/Classifications/ConversationClassificationEvents.d.ts +2 -2
- package/dist/Conversations/Conversation.d.ts +8 -8
- package/dist/Conversations/Routing.d.ts +10 -10
- package/dist/Events/DomainEventTypes.d.ts +23 -23
- package/dist/Tickets/Api.d.ts +16 -0
- package/dist/src/Common/Channels/Channel.d.ts +1 -26
- package/dist/src/Contacts/contacts.d.ts +2 -2
- package/dist/src/Conversations/Conversation.d.ts +48 -241
- package/dist/src/Conversations/Conversation.js +34 -14
- package/dist/src/Conversations/DashBoard/dashboard.d.ts +2 -2
- package/dist/src/Conversations/DashBoard/dashboardForms.d.ts +44 -0
- package/dist/src/Conversations/DashBoard/dashboardForms.js +24 -0
- package/dist/src/Conversations/Flows/Workflows/Workflow.d.ts +123 -280
- package/dist/src/Conversations/Flows/Workflows/Workflow.js +35 -85
- package/dist/src/Conversations/Groups/Group.d.ts +8 -2
- package/dist/src/Conversations/Groups/Group.js +6 -0
- package/dist/src/Conversations/Label.d.ts +1 -1
- package/dist/src/Conversations/WebHook.d.ts +1 -1
- package/dist/src/Conversations/index.d.ts +1 -9
- package/dist/src/Conversations/index.js +1 -9
- package/dist/src/Tickets/Category.d.ts +0 -18
- package/dist/src/Tickets/Dashboard.d.ts +0 -77
- package/dist/src/Tickets/Dashboard.js +1 -13
- package/dist/src/Tickets/Fields.d.ts +0 -1
- package/dist/src/Tickets/Layouts.d.ts +1 -3
- package/dist/src/Tickets/Workflow.d.ts +0 -20
- package/dist/src/Users/UserTrii.d.ts +0 -10
- package/dist/src/Users/UserTrii.js +1 -8
- package/dist/src/index.d.ts +0 -3
- package/dist/src/index.js +1 -4
- package/package.json +1 -1
- package/dist/AI/MapPolygon.d.ts +0 -22
- package/dist/AI/MapPolygon.js +0 -2
- 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 +0 -2
- package/dist/Conversations/Flows/Nodes/NodeApi.js +0 -183
- package/dist/Conversations/Flows/Nodes/NodeBotIA.d.ts +0 -15
- package/dist/Conversations/Flows/Nodes/NodeBotIA.js +0 -6
- package/dist/Conversations/Flows/Nodes/NodeChatBotIA.d.ts +0 -15
- package/dist/Conversations/Flows/Nodes/NodeChatBotIA.js +0 -6
- 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 +0 -1
- package/dist/Conversations/Flows/Nodes/NodeFillTicket.js +0 -9
- package/dist/Conversations/Flows/Nodes/NodeGoogleCalendar.d.ts +0 -20
- package/dist/Conversations/Flows/Nodes/NodeGoogleCalendar.js +0 -2
- package/dist/Conversations/Flows/Nodes/NodeGoogleMaps copy.d.ts +0 -12
- package/dist/Conversations/Flows/Nodes/NodeGoogleMaps copy.js +0 -6
- package/dist/Conversations/Flows/Nodes/NodeGoogleMaps.d.ts +0 -15
- package/dist/Conversations/Flows/Nodes/NodeGoogleMaps.js +0 -2
- 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 +0 -1
- package/dist/Conversations/Flows/Nodes/NodeMsgText.js +0 -27
- 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 +0 -2
- package/dist/Conversations/Flows/Nodes/NodeToolCalculator.js +0 -37
- package/dist/Conversations/Flows/Nodes/NodeToolContacts.d.ts +0 -2
- package/dist/Conversations/Flows/Nodes/NodeToolContacts.js +0 -59
- package/dist/Conversations/Flows/Nodes/NodeToolFunction.d.ts +0 -2
- package/dist/Conversations/Flows/Nodes/NodeToolFunction.js +0 -45
- package/dist/Conversations/Flows/Nodes/NodeToolGoogleCalendar.d.ts +0 -2
- package/dist/Conversations/Flows/Nodes/NodeToolGoogleCalendar.js +0 -87
- package/dist/Conversations/Flows/Nodes/NodeToolGoogleMaps.d.ts +0 -1
- package/dist/Conversations/Flows/Nodes/NodeToolGoogleMaps.js +0 -2
- package/dist/Conversations/Flows/Nodes/NodeToolKnowledge.d.ts +0 -2
- package/dist/Conversations/Flows/Nodes/NodeToolKnowledge.js +0 -52
- package/dist/Conversations/Flows/Nodes/NodeToolMapsCheckPolygon.d.ts +0 -2
- package/dist/Conversations/Flows/Nodes/NodeToolMapsCheckPolygon.js +0 -59
- package/dist/Conversations/Flows/Nodes/NodeToolMcpClient.d.ts +0 -2
- package/dist/Conversations/Flows/Nodes/NodeToolMcpClient.js +0 -45
- package/dist/Conversations/Flows/Nodes/NodeToolShoppingCart.d.ts +0 -2
- package/dist/Conversations/Flows/Nodes/NodeToolShoppingCart.js +0 -81
- package/dist/Conversations/Flows/Nodes/index.d.ts +0 -24
- package/dist/Conversations/Flows/Nodes/index.js +0 -40
- package/dist/Presence/ChannelRoutingState.d.ts +0 -17
- package/dist/Presence/ChannelRoutingState.js +0 -9
- package/dist/Tickets/AccessLevel.d.ts +0 -5
- package/dist/Tickets/AccessLevel.js +0 -9
- package/dist/src/Automations/Capabilities/Capability.d.ts +0 -48
- package/dist/src/Automations/Capabilities/Capability.js +0 -9
- package/dist/src/Automations/Capabilities/index.d.ts +0 -1
- package/dist/src/Automations/Capabilities/index.js +0 -17
- package/dist/src/Automations/Common.d.ts +0 -47
- package/dist/src/Automations/Common.js +0 -18
- package/dist/src/Automations/Events/Event.d.ts +0 -41
- package/dist/src/Automations/Events/Event.js +0 -2
- package/dist/src/Automations/Events/index.d.ts +0 -1
- package/dist/src/Automations/Events/index.js +0 -17
- package/dist/src/Automations/Executions/Execution.d.ts +0 -114
- package/dist/src/Automations/Executions/Execution.js +0 -23
- package/dist/src/Automations/Executions/index.d.ts +0 -1
- package/dist/src/Automations/Executions/index.js +0 -17
- package/dist/src/Automations/Flows/Canvas.d.ts +0 -86
- package/dist/src/Automations/Flows/Canvas.js +0 -34
- package/dist/src/Automations/Flows/Flow.d.ts +0 -102
- package/dist/src/Automations/Flows/Flow.js +0 -34
- package/dist/src/Automations/Flows/Requests.d.ts +0 -71
- package/dist/src/Automations/Flows/Requests.js +0 -2
- package/dist/src/Automations/Flows/Validation.d.ts +0 -28
- package/dist/src/Automations/Flows/Validation.js +0 -9
- package/dist/src/Automations/Flows/index.d.ts +0 -4
- package/dist/src/Automations/Flows/index.js +0 -20
- package/dist/src/Automations/Nodes/Node.d.ts +0 -75
- package/dist/src/Automations/Nodes/Node.js +0 -18
- package/dist/src/Automations/Nodes/index.d.ts +0 -1
- package/dist/src/Automations/Nodes/index.js +0 -17
- package/dist/src/Automations/index.d.ts +0 -6
- package/dist/src/Automations/index.js +0 -22
- package/dist/src/Chats/Chat.d.ts +0 -61
- package/dist/src/Chats/Chat.js +0 -28
- package/dist/src/Conversations/Assignment.d.ts +0 -81
- package/dist/src/Conversations/Assignment.js +0 -4
- package/dist/src/Conversations/Outbox.d.ts +0 -24
- package/dist/src/Conversations/Outbox.js +0 -4
- package/dist/src/Conversations/Queue.d.ts +0 -107
- package/dist/src/Conversations/Queue.js +0 -4
- package/dist/src/Conversations/Routing.d.ts +0 -164
- package/dist/src/Conversations/Routing.js +0 -2
- package/dist/src/Conversations/Sla.d.ts +0 -227
- package/dist/src/Conversations/Sla.js +0 -6
- package/dist/src/Conversations/Transfer.d.ts +0 -73
- package/dist/src/Conversations/Transfer.js +0 -2
- package/dist/src/Forms/API.d.ts +0 -53
- package/dist/src/Forms/API.js +0 -2
- package/dist/src/Forms/SubmittedForm.d.ts +0 -56
- package/dist/src/Forms/SubmittedForm.js +0 -9
- package/dist/src/Forms/index.d.ts +0 -2
- package/dist/src/Forms/index.js +0 -18
- package/dist/src/Presence/AgentPause.d.ts +0 -24
- package/dist/src/Presence/AgentPause.js +0 -19
- package/dist/src/Presence/QueueParticipation.d.ts +0 -17
- package/dist/src/Presence/QueueParticipation.js +0 -2
- package/dist/src/Presence/QueueRoutingState.d.ts +0 -27
- package/dist/src/Presence/QueueRoutingState.js +0 -9
- package/dist/src/Presence/index.d.ts +0 -3
- package/dist/src/Presence/index.js +0 -19
- /package/dist/{src/Conversations → Conversations}/InboxMongo.d.ts +0 -0
- /package/dist/{src/Conversations → Conversations}/InboxMongo.js +0 -0
- /package/dist/{src/Conversations → Conversations}/InboxProjection.d.ts +0 -0
- /package/dist/{src/Conversations → Conversations}/InboxProjection.js +0 -0
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./Node"), exports);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./Common"), exports);
|
|
18
|
-
__exportStar(require("./Flows"), exports);
|
|
19
|
-
__exportStar(require("./Capabilities"), exports);
|
|
20
|
-
__exportStar(require("./Executions"), exports);
|
|
21
|
-
__exportStar(require("./Nodes"), exports);
|
|
22
|
-
__exportStar(require("./Events"), exports);
|
package/dist/src/Chats/Chat.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { UserInfo } from "../Users/UserTrii";
|
|
2
|
-
export interface Chat {
|
|
3
|
-
id: string;
|
|
4
|
-
spaceId: string;
|
|
5
|
-
type: ChatType;
|
|
6
|
-
ownerId: string;
|
|
7
|
-
chatName: string;
|
|
8
|
-
chatImage: string;
|
|
9
|
-
chatMembers: IChatMemeber[];
|
|
10
|
-
chatMembersCount: number;
|
|
11
|
-
remoteAddress: string;
|
|
12
|
-
remoteAddressId: string;
|
|
13
|
-
lastMessage: string;
|
|
14
|
-
lastMessageId?: string;
|
|
15
|
-
newMessagesCount: number;
|
|
16
|
-
newMessagesUnread: boolean;
|
|
17
|
-
pinned: boolean;
|
|
18
|
-
status: ConversationSatus;
|
|
19
|
-
archived: boolean;
|
|
20
|
-
/** Domain objects discussed or served by this conversation. */
|
|
21
|
-
contextReferences?: ContextReference[];
|
|
22
|
-
finalizedAt: Date;
|
|
23
|
-
finalizedBy?: string;
|
|
24
|
-
createdAt: Date;
|
|
25
|
-
updatedAt: Date;
|
|
26
|
-
}
|
|
27
|
-
export interface ContextReference {
|
|
28
|
-
entityType: ContextType;
|
|
29
|
-
entityId: string;
|
|
30
|
-
role?: string;
|
|
31
|
-
linkedAt: Date;
|
|
32
|
-
linkedBy?: string;
|
|
33
|
-
}
|
|
34
|
-
export declare enum ContextType {
|
|
35
|
-
TICKET = "TICKET",
|
|
36
|
-
CONVERSATION = "CONVERSATION",
|
|
37
|
-
LEAD = "LEAD",
|
|
38
|
-
DEBT = "DEBT"
|
|
39
|
-
}
|
|
40
|
-
export declare enum ChatType {
|
|
41
|
-
/**messages between two users */
|
|
42
|
-
DIRECT = 1,
|
|
43
|
-
/**messages between multiple users */
|
|
44
|
-
GROUP = 2,
|
|
45
|
-
/**Messages to discuss a conversation */
|
|
46
|
-
DISCUSS_CONVERSATION = 11,
|
|
47
|
-
/**Messages to discuss a ticket */
|
|
48
|
-
DISCUSS_TICKET = 12
|
|
49
|
-
}
|
|
50
|
-
export interface IChatMemeber {
|
|
51
|
-
joinTimeStamp: Date;
|
|
52
|
-
isAdmin: boolean;
|
|
53
|
-
userId: string;
|
|
54
|
-
user: UserInfo;
|
|
55
|
-
}
|
|
56
|
-
export declare enum ConversationSatus {
|
|
57
|
-
NEW = 1,
|
|
58
|
-
ACTIVE = 2,
|
|
59
|
-
FINALIZED = 3,
|
|
60
|
-
ARCHIVED = 4
|
|
61
|
-
}
|
package/dist/src/Chats/Chat.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConversationSatus = exports.ChatType = exports.ContextType = void 0;
|
|
4
|
-
var ContextType;
|
|
5
|
-
(function (ContextType) {
|
|
6
|
-
ContextType["TICKET"] = "TICKET";
|
|
7
|
-
ContextType["CONVERSATION"] = "CONVERSATION";
|
|
8
|
-
ContextType["LEAD"] = "LEAD";
|
|
9
|
-
ContextType["DEBT"] = "DEBT";
|
|
10
|
-
})(ContextType || (exports.ContextType = ContextType = {}));
|
|
11
|
-
var ChatType;
|
|
12
|
-
(function (ChatType) {
|
|
13
|
-
/**messages between two users */
|
|
14
|
-
ChatType[ChatType["DIRECT"] = 1] = "DIRECT";
|
|
15
|
-
/**messages between multiple users */
|
|
16
|
-
ChatType[ChatType["GROUP"] = 2] = "GROUP";
|
|
17
|
-
/**Messages to discuss a conversation */
|
|
18
|
-
ChatType[ChatType["DISCUSS_CONVERSATION"] = 11] = "DISCUSS_CONVERSATION";
|
|
19
|
-
/**Messages to discuss a ticket */
|
|
20
|
-
ChatType[ChatType["DISCUSS_TICKET"] = 12] = "DISCUSS_TICKET";
|
|
21
|
-
})(ChatType || (exports.ChatType = ChatType = {}));
|
|
22
|
-
var ConversationSatus;
|
|
23
|
-
(function (ConversationSatus) {
|
|
24
|
-
ConversationSatus[ConversationSatus["NEW"] = 1] = "NEW";
|
|
25
|
-
ConversationSatus[ConversationSatus["ACTIVE"] = 2] = "ACTIVE";
|
|
26
|
-
ConversationSatus[ConversationSatus["FINALIZED"] = 3] = "FINALIZED";
|
|
27
|
-
ConversationSatus[ConversationSatus["ARCHIVED"] = 4] = "ARCHIVED";
|
|
28
|
-
})(ConversationSatus || (exports.ConversationSatus = ConversationSatus = {}));
|
|
@@ -1,81 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export declare const OUTBOX_EVENTS_COLLECTION = "outbox_events";
|
|
2
|
-
export type OutboxEventStatus = 'pending' | 'publishing' | 'published' | 'failed';
|
|
3
|
-
/**
|
|
4
|
-
* Transactional outbox record persisted with the aggregate mutation.
|
|
5
|
-
*/
|
|
6
|
-
export interface OutboxEvent<TPayload> {
|
|
7
|
-
id: string;
|
|
8
|
-
spaceId: string;
|
|
9
|
-
aggregateType: string;
|
|
10
|
-
aggregateId: string;
|
|
11
|
-
eventType: string;
|
|
12
|
-
schemaVersion: number;
|
|
13
|
-
payload: TPayload;
|
|
14
|
-
status: OutboxEventStatus;
|
|
15
|
-
attempts: number;
|
|
16
|
-
availableAt: Date;
|
|
17
|
-
lockedAt?: Date;
|
|
18
|
-
lockedUntil?: Date;
|
|
19
|
-
lockedBy?: string;
|
|
20
|
-
createdAt: Date;
|
|
21
|
-
lastAttemptAt?: Date;
|
|
22
|
-
publishedAt?: Date;
|
|
23
|
-
lastError?: string;
|
|
24
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { ID } from './Conversation';
|
|
2
|
-
import { QueueRoutingPolicy } from './Routing';
|
|
3
|
-
export declare const CONVERSATION_QUEUES_COLLECTION = "conversation_queues";
|
|
4
|
-
export type QueueSlaTransferBehavior = 'preserve' | 'restart' | 'recalculate';
|
|
5
|
-
export type ConversationQueueSlaConfig = {
|
|
6
|
-
enabled: false;
|
|
7
|
-
policyId?: never;
|
|
8
|
-
policyVersion?: never;
|
|
9
|
-
onTransferIn?: never;
|
|
10
|
-
} | {
|
|
11
|
-
enabled: true;
|
|
12
|
-
policyId: ID;
|
|
13
|
-
policyVersion: number;
|
|
14
|
-
onTransferIn: QueueSlaTransferBehavior;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* distribution:
|
|
18
|
-
* visibility follows shared, manual_pull or exclusive routing semantics.
|
|
19
|
-
* all_current:
|
|
20
|
-
* all authorized queue members can see current queue conversations.
|
|
21
|
-
*/
|
|
22
|
-
export type QueueMemberAudienceMode = 'distribution' | 'all_current' | 'none';
|
|
23
|
-
export type QueueSupervisorAudienceMode = 'all_current' | 'sla_only' | 'escalations_only' | 'none';
|
|
24
|
-
export interface ConversationQueueAudienceConfig {
|
|
25
|
-
members: {
|
|
26
|
-
mode: QueueMemberAudienceMode;
|
|
27
|
-
requireActiveParticipation: boolean;
|
|
28
|
-
includeResolved: boolean;
|
|
29
|
-
};
|
|
30
|
-
supervisors: {
|
|
31
|
-
mode: QueueSupervisorAudienceMode;
|
|
32
|
-
includeResolved: boolean;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export interface ConversationQueueInfo {
|
|
36
|
-
id: ID;
|
|
37
|
-
name: string;
|
|
38
|
-
color?: string;
|
|
39
|
-
enabled: boolean;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Conversation routing, supervision and reporting boundary.
|
|
43
|
-
* Groups only provide user membership; they never own conversations.
|
|
44
|
-
*/
|
|
45
|
-
export interface ConversationQueue {
|
|
46
|
-
id: ID;
|
|
47
|
-
spaceId: ID;
|
|
48
|
-
name: string;
|
|
49
|
-
description?: string;
|
|
50
|
-
color?: string;
|
|
51
|
-
enabled: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Higher values are evaluated first when multiple queues match.
|
|
54
|
-
*/
|
|
55
|
-
priority: number;
|
|
56
|
-
memberGroupIds: ID[];
|
|
57
|
-
supervisorGroupIds: ID[];
|
|
58
|
-
routing: QueueRoutingPolicy;
|
|
59
|
-
sla: ConversationQueueSlaConfig;
|
|
60
|
-
audience: ConversationQueueAudienceConfig;
|
|
61
|
-
version: number;
|
|
62
|
-
createdAt: Date;
|
|
63
|
-
createdByUserId?: ID;
|
|
64
|
-
updatedAt: Date;
|
|
65
|
-
updatedByUserId?: ID;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Editable Queue definition sent by clients.
|
|
69
|
-
*
|
|
70
|
-
* It excludes id, version and audit fields controlled by the backend. Nested
|
|
71
|
-
* routing, SLA and audience objects use full-replacement semantics.
|
|
72
|
-
*/
|
|
73
|
-
export interface ConversationQueueDefinitionInput {
|
|
74
|
-
name: string;
|
|
75
|
-
description?: string;
|
|
76
|
-
color?: string;
|
|
77
|
-
enabled: boolean;
|
|
78
|
-
priority: number;
|
|
79
|
-
memberGroupIds: ID[];
|
|
80
|
-
supervisorGroupIds: ID[];
|
|
81
|
-
routing: QueueRoutingPolicy;
|
|
82
|
-
sla: ConversationQueueSlaConfig;
|
|
83
|
-
audience: ConversationQueueAudienceConfig;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Creates a Queue. commandId makes retries idempotent. The backend assigns
|
|
87
|
-
* queue id, version and audit fields.
|
|
88
|
-
*/
|
|
89
|
-
export interface CreateConversationQueueRequest {
|
|
90
|
-
commandId: ID;
|
|
91
|
-
spaceId: ID;
|
|
92
|
-
definition: ConversationQueueDefinitionInput;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Replaces the editable definition of an existing Queue.
|
|
96
|
-
*
|
|
97
|
-
* expectedVersion is the version loaded by the client; it is not incremented
|
|
98
|
-
* by the client. The backend rejects stale writes and returns the updated
|
|
99
|
-
* ConversationQueue with its new version and audit fields.
|
|
100
|
-
*/
|
|
101
|
-
export interface UpdateConversationQueueRequest {
|
|
102
|
-
commandId: ID;
|
|
103
|
-
spaceId: ID;
|
|
104
|
-
queueId: ID;
|
|
105
|
-
expectedVersion: number;
|
|
106
|
-
definition: ConversationQueueDefinitionInput;
|
|
107
|
-
}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { ChannelType } from '../Common/Channels/ChannelType';
|
|
2
|
-
interface QueueRoutingPolicyBase {
|
|
3
|
-
requiredSkills?: string[];
|
|
4
|
-
optionalSkills?: string[];
|
|
5
|
-
acceptedChannelTypes: ChannelType[];
|
|
6
|
-
requireActiveParticipation: boolean;
|
|
7
|
-
requireAvailablePresence: boolean;
|
|
8
|
-
requireAcceptance: boolean;
|
|
9
|
-
capacityPolicy: {
|
|
10
|
-
maxConcurrentByChannelType: Partial<Record<ChannelType, number>>;
|
|
11
|
-
weightByChannelType: Partial<Record<ChannelType, number>>;
|
|
12
|
-
};
|
|
13
|
-
fallback: {
|
|
14
|
-
action: 'keep_queued' | 'overflow_queue' | 'assign_supervisor';
|
|
15
|
-
overflowQueueId?: string;
|
|
16
|
-
timeoutSeconds?: number;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Resolves the ownerUserId of the contact or business associated with the
|
|
21
|
-
* conversation. The resolved user is still subject to every Queue eligibility
|
|
22
|
-
* rule.
|
|
23
|
-
*/
|
|
24
|
-
export interface PartyOwnerAssigneeResolver {
|
|
25
|
-
type: 'party_owner';
|
|
26
|
-
mode: 'prefer' | 'required';
|
|
27
|
-
}
|
|
28
|
-
export type QueueOwnerAssigneeResolver = PartyOwnerAssigneeResolver;
|
|
29
|
-
export type QueueRoutingPolicy = (QueueRoutingPolicyBase & {
|
|
30
|
-
distributionMode: 'shared';
|
|
31
|
-
strategy?: never;
|
|
32
|
-
ownerResolver?: never;
|
|
33
|
-
}) | (QueueRoutingPolicyBase & {
|
|
34
|
-
distributionMode: 'manual_pull';
|
|
35
|
-
strategy?: never;
|
|
36
|
-
ownerResolver?: never;
|
|
37
|
-
}) | (QueueRoutingPolicyBase & {
|
|
38
|
-
distributionMode: 'exclusive';
|
|
39
|
-
strategy: QueueRoutingStrategy;
|
|
40
|
-
ownerResolver?: undefined | (PartyOwnerAssigneeResolver & {
|
|
41
|
-
mode: 'prefer';
|
|
42
|
-
});
|
|
43
|
-
}) | (QueueRoutingPolicyBase & {
|
|
44
|
-
distributionMode: 'exclusive';
|
|
45
|
-
strategy?: never;
|
|
46
|
-
ownerResolver: PartyOwnerAssigneeResolver & {
|
|
47
|
-
mode: 'required';
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
export type QueueRoutingConfig = QueueRoutingPolicy & {
|
|
51
|
-
queueId: string;
|
|
52
|
-
spaceId: string;
|
|
53
|
-
version: number;
|
|
54
|
-
updatedAt: Date;
|
|
55
|
-
};
|
|
56
|
-
export type QueueDistributionMode = 'shared' | 'exclusive' | 'manual_pull';
|
|
57
|
-
export type QueueRoutingStrategy = 'round_robin' | 'least_busy' | 'random' | 'highest_capacity' | 'skills' | 'account_affinity' | 'longest_idle' | 'manual';
|
|
58
|
-
export interface RoutingCandidate {
|
|
59
|
-
userId: string;
|
|
60
|
-
queueId: string;
|
|
61
|
-
authorized: boolean;
|
|
62
|
-
participating: boolean;
|
|
63
|
-
available: boolean;
|
|
64
|
-
channelEligible: boolean;
|
|
65
|
-
capacityUsed: number;
|
|
66
|
-
capacityTotal: number;
|
|
67
|
-
lastAssignedAt?: Date;
|
|
68
|
-
idleSince?: Date;
|
|
69
|
-
skills: string[];
|
|
70
|
-
accountAffinityScore?: number;
|
|
71
|
-
}
|
|
72
|
-
export type RoutingPartyType = 'contact' | 'business';
|
|
73
|
-
/**
|
|
74
|
-
* Snapshot resolved by the command producer. The routing worker must not read
|
|
75
|
-
* Contacts again to obtain ownerUserId.
|
|
76
|
-
*/
|
|
77
|
-
export type RoutingPartyContext = {
|
|
78
|
-
status: 'not_found';
|
|
79
|
-
partyType: RoutingPartyType;
|
|
80
|
-
partyId?: string;
|
|
81
|
-
ownerUserId?: never;
|
|
82
|
-
} | {
|
|
83
|
-
status: 'without_owner';
|
|
84
|
-
partyType: RoutingPartyType;
|
|
85
|
-
partyId: string;
|
|
86
|
-
ownerUserId?: never;
|
|
87
|
-
} | {
|
|
88
|
-
status: 'resolved';
|
|
89
|
-
partyType: RoutingPartyType;
|
|
90
|
-
partyId: string;
|
|
91
|
-
ownerUserId: string;
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* Idempotent request for routing a queued conversation.
|
|
95
|
-
*
|
|
96
|
-
* contact/business ownership is captured in party by the producer so the
|
|
97
|
-
* routing worker can evaluate it against candidates without another read.
|
|
98
|
-
*/
|
|
99
|
-
export interface RouteConversationCommand {
|
|
100
|
-
commandId: string;
|
|
101
|
-
sourceEventId: string;
|
|
102
|
-
spaceId: string;
|
|
103
|
-
conversationId: string;
|
|
104
|
-
queueId: string;
|
|
105
|
-
expectedConversationVersion: number;
|
|
106
|
-
queueConfigVersion: number;
|
|
107
|
-
party: RoutingPartyContext;
|
|
108
|
-
requestedAt: Date;
|
|
109
|
-
}
|
|
110
|
-
export type RoutingSelectionSource = 'party_owner' | 'strategy' | 'fallback';
|
|
111
|
-
export type PartyOwnerResolutionFailure = 'party_not_found' | 'party_without_owner' | 'owner_user_not_found' | 'not_authorized' | 'not_participating' | 'unavailable' | 'channel_ineligible' | 'capacity_exhausted';
|
|
112
|
-
type FailedPartyOwnerEvaluation = {
|
|
113
|
-
party: Extract<RoutingPartyContext, {
|
|
114
|
-
status: 'not_found';
|
|
115
|
-
}>;
|
|
116
|
-
outcome: 'party_not_found';
|
|
117
|
-
} | {
|
|
118
|
-
party: Extract<RoutingPartyContext, {
|
|
119
|
-
status: 'without_owner';
|
|
120
|
-
}>;
|
|
121
|
-
outcome: 'party_without_owner';
|
|
122
|
-
} | {
|
|
123
|
-
party: Extract<RoutingPartyContext, {
|
|
124
|
-
status: 'resolved';
|
|
125
|
-
}>;
|
|
126
|
-
outcome: Exclude<PartyOwnerResolutionFailure, 'party_not_found' | 'party_without_owner'>;
|
|
127
|
-
};
|
|
128
|
-
export type PartyOwnerAssigneeEvaluation = {
|
|
129
|
-
type: 'party_owner';
|
|
130
|
-
mode: PartyOwnerAssigneeResolver['mode'];
|
|
131
|
-
party: Extract<RoutingPartyContext, {
|
|
132
|
-
status: 'resolved';
|
|
133
|
-
}>;
|
|
134
|
-
outcome: 'selected';
|
|
135
|
-
nextStep?: never;
|
|
136
|
-
} | (FailedPartyOwnerEvaluation & {
|
|
137
|
-
type: 'party_owner';
|
|
138
|
-
mode: 'prefer';
|
|
139
|
-
nextStep: 'strategy';
|
|
140
|
-
}) | (FailedPartyOwnerEvaluation & {
|
|
141
|
-
type: 'party_owner';
|
|
142
|
-
mode: 'required';
|
|
143
|
-
nextStep: 'fallback';
|
|
144
|
-
});
|
|
145
|
-
export interface RoutingDecision {
|
|
146
|
-
decisionId: string;
|
|
147
|
-
spaceId: string;
|
|
148
|
-
conversationId: string;
|
|
149
|
-
queueId: string;
|
|
150
|
-
distributionMode: QueueDistributionMode;
|
|
151
|
-
strategy?: QueueRoutingStrategy;
|
|
152
|
-
eligibleUserIds: string[];
|
|
153
|
-
selectedUserId?: string;
|
|
154
|
-
selectionSource?: RoutingSelectionSource;
|
|
155
|
-
ownerEvaluation?: PartyOwnerAssigneeEvaluation;
|
|
156
|
-
rejected: Array<{
|
|
157
|
-
userId: string;
|
|
158
|
-
reasons: string[];
|
|
159
|
-
}>;
|
|
160
|
-
queueConfigVersion: number;
|
|
161
|
-
conversationVersion: number;
|
|
162
|
-
createdAt: Date;
|
|
163
|
-
}
|
|
164
|
-
export {};
|