@trii/types 2.10.678 → 2.10.679
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/AI/MapPolygon.js +2 -0
- package/dist/Conversations/Conversation.d.ts +8 -8
- 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/InboxMongo.d.ts +12 -12
- package/dist/Conversations/Routing.d.ts +14 -13
- package/dist/Presence/ChannelRoutingState.d.ts +17 -0
- package/dist/Presence/ChannelRoutingState.js +9 -0
- package/dist/Spaces/spaces.d.ts +2 -2
- package/dist/Tickets/AccessLevel.d.ts +5 -0
- package/dist/Tickets/AccessLevel.js +9 -0
- package/dist/index.d.ts +22 -22
- package/dist/index.js +58 -58
- 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 +9 -0
- 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 +234 -52
- 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/InboxMongo.d.ts +154 -0
- package/dist/src/Conversations/InboxMongo.js +128 -0
- package/dist/src/Conversations/InboxProjection.d.ts +162 -0
- 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 +66 -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/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 +8 -1
- package/dist/src/Conversations/index.js +8 -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 +60 -0
- 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 +2 -0
- package/dist/src/index.js +3 -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
|
@@ -0,0 +1,164 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { OutboxEvent } from './Outbox';
|
|
2
|
+
import { AssignmentActorReference, AssignmentStateReference, ConversationAssignmentReason } from './Assignment';
|
|
3
|
+
import { ID } from './Conversation';
|
|
4
|
+
export type TransferConversationReason = Extract<ConversationAssignmentReason, 'manual_transfer' | 'flow_routing' | 'sla_escalation' | 'system_recovery'>;
|
|
5
|
+
export type TransferConversationTarget = {
|
|
6
|
+
type: 'queue';
|
|
7
|
+
queueId: ID;
|
|
8
|
+
} | {
|
|
9
|
+
type: 'user';
|
|
10
|
+
queueId: ID;
|
|
11
|
+
userId: ID;
|
|
12
|
+
};
|
|
13
|
+
export interface TransferConversationCommand {
|
|
14
|
+
commandId: ID;
|
|
15
|
+
spaceId: ID;
|
|
16
|
+
conversationId: ID;
|
|
17
|
+
target: TransferConversationTarget;
|
|
18
|
+
expectedConversationVersion: number;
|
|
19
|
+
actor: AssignmentActorReference;
|
|
20
|
+
reason: TransferConversationReason;
|
|
21
|
+
requestedAt: Date;
|
|
22
|
+
}
|
|
23
|
+
export type TransferConversationRejectionCode = 'conversation_not_found' | 'target_queue_not_found' | 'target_queue_disabled' | 'target_user_not_found' | 'target_user_not_authorized' | 'target_user_not_available' | 'target_user_has_no_capacity' | 'channel_not_supported' | 'same_queue' | 'same_owner' | 'actor_not_authorized' | 'conversation_not_transferable';
|
|
24
|
+
export type TransferConversationResult = {
|
|
25
|
+
status: 'transferred';
|
|
26
|
+
commandId: ID;
|
|
27
|
+
conversationId: ID;
|
|
28
|
+
previousVersion: number;
|
|
29
|
+
conversationVersion: number;
|
|
30
|
+
previous: AssignmentStateReference;
|
|
31
|
+
current: AssignmentStateReference;
|
|
32
|
+
assignmentEventId: ID;
|
|
33
|
+
outboxEventId: ID;
|
|
34
|
+
} | {
|
|
35
|
+
status: 'already_applied';
|
|
36
|
+
commandId: ID;
|
|
37
|
+
conversationId: ID;
|
|
38
|
+
conversationVersion: number;
|
|
39
|
+
assignmentEventId: ID;
|
|
40
|
+
outboxEventId: ID;
|
|
41
|
+
} | {
|
|
42
|
+
status: 'version_conflict';
|
|
43
|
+
commandId: ID;
|
|
44
|
+
conversationId: ID;
|
|
45
|
+
expectedVersion: number;
|
|
46
|
+
currentVersion: number;
|
|
47
|
+
} | {
|
|
48
|
+
status: 'rejected';
|
|
49
|
+
commandId: ID;
|
|
50
|
+
conversationId: ID;
|
|
51
|
+
code: TransferConversationRejectionCode;
|
|
52
|
+
};
|
|
53
|
+
export interface ConversationAssignmentChanged {
|
|
54
|
+
eventId: ID;
|
|
55
|
+
sourceEventId: ID;
|
|
56
|
+
type: 'conversation.assignment.changed';
|
|
57
|
+
schemaVersion: 1;
|
|
58
|
+
spaceId: ID;
|
|
59
|
+
conversationId: ID;
|
|
60
|
+
conversationVersion: number;
|
|
61
|
+
reason: ConversationAssignmentReason;
|
|
62
|
+
previous?: AssignmentStateReference;
|
|
63
|
+
current: AssignmentStateReference;
|
|
64
|
+
actor: AssignmentActorReference;
|
|
65
|
+
correlationId: ID;
|
|
66
|
+
causationId: ID;
|
|
67
|
+
occurredAt: Date;
|
|
68
|
+
}
|
|
69
|
+
export type ConversationAssignmentChangedOutboxEvent = OutboxEvent<ConversationAssignmentChanged> & {
|
|
70
|
+
aggregateType: 'conversation';
|
|
71
|
+
eventType: 'conversation.assignment.changed';
|
|
72
|
+
schemaVersion: 1;
|
|
73
|
+
};
|
|
@@ -5,7 +5,7 @@ import { AuthType } from '../Common/API/AuthType';
|
|
|
5
5
|
import { Method } from '../Common/API/Method';
|
|
6
6
|
interface IWebhook {
|
|
7
7
|
id?: string | null;
|
|
8
|
-
|
|
8
|
+
spaceId?: string | null;
|
|
9
9
|
name?: string | null;
|
|
10
10
|
apiUrl?: string | null;
|
|
11
11
|
apiMethod?: Method | null;
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
export * as Flows from './Flows/index';
|
|
2
2
|
export * as Groups from './Groups/Group';
|
|
3
|
+
export * from './Assignment';
|
|
3
4
|
export * from './Conversation';
|
|
5
|
+
export * from './InboxMongo';
|
|
6
|
+
export * from './InboxProjection';
|
|
7
|
+
export * from './Outbox';
|
|
4
8
|
export * from './Ending';
|
|
5
9
|
export * from './Label';
|
|
6
10
|
export * from './WebHook';
|
|
7
11
|
export * from './SocialWalls';
|
|
8
12
|
export * from './QuickResponse';
|
|
9
13
|
export * from './DashBoard/dashboard';
|
|
10
|
-
export * from '
|
|
14
|
+
export * from '../Forms/API';
|
|
11
15
|
export * from './DashBoard/dashboardChannels';
|
|
12
16
|
export * from './DashBoard/dashboardMessages';
|
|
13
17
|
export * from './Survey';
|
|
18
|
+
export * from './Queue';
|
|
19
|
+
export * from './Routing';
|
|
20
|
+
export * from './Transfer';
|
|
@@ -39,14 +39,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.Groups = exports.Flows = void 0;
|
|
40
40
|
exports.Flows = __importStar(require("./Flows/index"));
|
|
41
41
|
exports.Groups = __importStar(require("./Groups/Group"));
|
|
42
|
+
__exportStar(require("./Assignment"), exports);
|
|
42
43
|
__exportStar(require("./Conversation"), exports);
|
|
44
|
+
__exportStar(require("./InboxMongo"), exports);
|
|
45
|
+
__exportStar(require("./InboxProjection"), exports);
|
|
46
|
+
__exportStar(require("./Outbox"), exports);
|
|
43
47
|
__exportStar(require("./Ending"), exports);
|
|
44
48
|
__exportStar(require("./Label"), exports);
|
|
45
49
|
__exportStar(require("./WebHook"), exports);
|
|
46
50
|
__exportStar(require("./SocialWalls"), exports);
|
|
47
51
|
__exportStar(require("./QuickResponse"), exports);
|
|
48
52
|
__exportStar(require("./DashBoard/dashboard"), exports);
|
|
49
|
-
__exportStar(require("
|
|
53
|
+
__exportStar(require("../Forms/API"), exports);
|
|
50
54
|
__exportStar(require("./DashBoard/dashboardChannels"), exports);
|
|
51
55
|
__exportStar(require("./DashBoard/dashboardMessages"), exports);
|
|
52
56
|
__exportStar(require("./Survey"), exports);
|
|
57
|
+
__exportStar(require("./Queue"), exports);
|
|
58
|
+
__exportStar(require("./Routing"), exports);
|
|
59
|
+
__exportStar(require("./Transfer"), exports);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { FormItemType } from "../Common/Channels/Form";
|
|
2
|
+
import { FormAnswerV2, FormTag } from "./SubmittedForm";
|
|
3
|
+
export interface RequestInfo {
|
|
4
|
+
formId: string;
|
|
5
|
+
timeStart: Date | null;
|
|
6
|
+
timeEnd: Date | null;
|
|
7
|
+
skip: number | null;
|
|
8
|
+
limit: number | null;
|
|
9
|
+
}
|
|
10
|
+
export interface SummaryInfo {
|
|
11
|
+
formId: string;
|
|
12
|
+
timeStart: Date | null;
|
|
13
|
+
timeEnd: Date | null;
|
|
14
|
+
completedForms: number;
|
|
15
|
+
records: QuestionSummary[];
|
|
16
|
+
}
|
|
17
|
+
export interface QuestionSummary {
|
|
18
|
+
questionId: string;
|
|
19
|
+
question: string;
|
|
20
|
+
type: FormItemType;
|
|
21
|
+
fieldType: string;
|
|
22
|
+
count: number;
|
|
23
|
+
responses: ResponseSummary[];
|
|
24
|
+
}
|
|
25
|
+
export interface ResponseSummary {
|
|
26
|
+
count: number;
|
|
27
|
+
responseTitle: string;
|
|
28
|
+
}
|
|
29
|
+
export interface SubmittedFormsInfo {
|
|
30
|
+
formId: string;
|
|
31
|
+
timeStart: Date | null;
|
|
32
|
+
timeEnd: Date | null;
|
|
33
|
+
completedForms: number;
|
|
34
|
+
records: SubmittedFormRecord[];
|
|
35
|
+
}
|
|
36
|
+
export interface SubmittedFormRecord {
|
|
37
|
+
id: string;
|
|
38
|
+
tags: FormTag[];
|
|
39
|
+
responses: SubmittedFormResponse[];
|
|
40
|
+
expireAt: Date | null;
|
|
41
|
+
createdAt: Date;
|
|
42
|
+
completedAt: Date | null;
|
|
43
|
+
contractVersion: number;
|
|
44
|
+
formRevision: number;
|
|
45
|
+
}
|
|
46
|
+
export interface SubmittedFormResponse {
|
|
47
|
+
type: FormItemType;
|
|
48
|
+
fieldType: string;
|
|
49
|
+
questionId: string;
|
|
50
|
+
question: string;
|
|
51
|
+
response: unknown | null;
|
|
52
|
+
answer?: FormAnswerV2 | null;
|
|
53
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { FormItemType } from "../Common/Channels/Form";
|
|
2
|
+
export interface SubmittedForm {
|
|
3
|
+
id: string;
|
|
4
|
+
shardKey: string;
|
|
5
|
+
spaceId: string;
|
|
6
|
+
formId: string;
|
|
7
|
+
contractVersion: number;
|
|
8
|
+
formRevision: number;
|
|
9
|
+
schemaHash: string | null;
|
|
10
|
+
tags: FormTag[];
|
|
11
|
+
/** Compatibilidad con formularios V1. */
|
|
12
|
+
responses?: FormResponse[] | null;
|
|
13
|
+
answers: FormAnswerV2[];
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
expireAt: Date | null;
|
|
16
|
+
completedAt: Date | null;
|
|
17
|
+
}
|
|
18
|
+
export interface FormTag {
|
|
19
|
+
name: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}
|
|
22
|
+
export declare enum FormStatus {
|
|
23
|
+
pending = 0,
|
|
24
|
+
completed = 1,
|
|
25
|
+
expired = 2
|
|
26
|
+
}
|
|
27
|
+
export interface FormResponse {
|
|
28
|
+
questionId: string;
|
|
29
|
+
type: FormItemType;
|
|
30
|
+
response: unknown;
|
|
31
|
+
}
|
|
32
|
+
export interface FormAnswerV2 {
|
|
33
|
+
fieldId: string;
|
|
34
|
+
fieldType: string;
|
|
35
|
+
/** Snapshot útil para exportaciones históricas. */
|
|
36
|
+
fieldLabel: string | null;
|
|
37
|
+
textValue: string | null;
|
|
38
|
+
numericValue: number | null;
|
|
39
|
+
/** Formatos canónicos: yyyy-MM-dd y HH:mm:ss. */
|
|
40
|
+
dateValue: string | null;
|
|
41
|
+
timeValue: string | null;
|
|
42
|
+
selectedOptions: FormSelectedOption[] | null;
|
|
43
|
+
files: FormSubmittedFile[] | null;
|
|
44
|
+
}
|
|
45
|
+
export interface FormSelectedOption {
|
|
46
|
+
id: string;
|
|
47
|
+
/** Snapshot histórico de la etiqueta. */
|
|
48
|
+
label: string | null;
|
|
49
|
+
}
|
|
50
|
+
export interface FormSubmittedFile {
|
|
51
|
+
storageId: string;
|
|
52
|
+
fileName: string;
|
|
53
|
+
contentType: string | null;
|
|
54
|
+
sizeBytes: number;
|
|
55
|
+
url: string | null;
|
|
56
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FormStatus = void 0;
|
|
4
|
+
var FormStatus;
|
|
5
|
+
(function (FormStatus) {
|
|
6
|
+
FormStatus[FormStatus["pending"] = 0] = "pending";
|
|
7
|
+
FormStatus[FormStatus["completed"] = 1] = "completed";
|
|
8
|
+
FormStatus[FormStatus["expired"] = 2] = "expired";
|
|
9
|
+
})(FormStatus || (exports.FormStatus = FormStatus = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./API"), exports);
|
|
18
|
+
__exportStar(require("./SubmittedForm"), exports);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface AgentPause {
|
|
2
|
+
id: string;
|
|
3
|
+
spaceId: string;
|
|
4
|
+
userId: string;
|
|
5
|
+
reason: PauseReason;
|
|
6
|
+
startedAt: Date;
|
|
7
|
+
startedByUserId?: string;
|
|
8
|
+
startedBy: PauseActorType;
|
|
9
|
+
endedAt?: Date;
|
|
10
|
+
}
|
|
11
|
+
export declare enum PauseReason {
|
|
12
|
+
LUNCH = 0,
|
|
13
|
+
RESTROOM = 1,
|
|
14
|
+
BREAK = 2,
|
|
15
|
+
MEETING = 3,
|
|
16
|
+
TRAINING = 4,
|
|
17
|
+
ADMINISTRATIVE_WORK = 5,
|
|
18
|
+
OTHER = 6
|
|
19
|
+
}
|
|
20
|
+
export declare enum PauseActorType {
|
|
21
|
+
AGENT = 0,
|
|
22
|
+
SUPERVISOR = 1,
|
|
23
|
+
SYSTEM = 2
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PauseActorType = exports.PauseReason = void 0;
|
|
4
|
+
var PauseReason;
|
|
5
|
+
(function (PauseReason) {
|
|
6
|
+
PauseReason[PauseReason["LUNCH"] = 0] = "LUNCH";
|
|
7
|
+
PauseReason[PauseReason["RESTROOM"] = 1] = "RESTROOM";
|
|
8
|
+
PauseReason[PauseReason["BREAK"] = 2] = "BREAK";
|
|
9
|
+
PauseReason[PauseReason["MEETING"] = 3] = "MEETING";
|
|
10
|
+
PauseReason[PauseReason["TRAINING"] = 4] = "TRAINING";
|
|
11
|
+
PauseReason[PauseReason["ADMINISTRATIVE_WORK"] = 5] = "ADMINISTRATIVE_WORK";
|
|
12
|
+
PauseReason[PauseReason["OTHER"] = 6] = "OTHER";
|
|
13
|
+
})(PauseReason || (exports.PauseReason = PauseReason = {}));
|
|
14
|
+
var PauseActorType;
|
|
15
|
+
(function (PauseActorType) {
|
|
16
|
+
PauseActorType[PauseActorType["AGENT"] = 0] = "AGENT";
|
|
17
|
+
PauseActorType[PauseActorType["SUPERVISOR"] = 1] = "SUPERVISOR";
|
|
18
|
+
PauseActorType[PauseActorType["SYSTEM"] = 2] = "SYSTEM";
|
|
19
|
+
})(PauseActorType || (exports.PauseActorType = PauseActorType = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ConversationQueueInfo } from "../Conversations/Queue";
|
|
2
|
+
export interface QueueParticipation {
|
|
3
|
+
spaceId: string;
|
|
4
|
+
userId: string;
|
|
5
|
+
queueId: string;
|
|
6
|
+
authorized: boolean;
|
|
7
|
+
active: boolean;
|
|
8
|
+
updatedAt: Date;
|
|
9
|
+
updatedByUserId?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface QueueParticipationDto {
|
|
12
|
+
queueId: string;
|
|
13
|
+
authorized: boolean;
|
|
14
|
+
active: boolean;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
queue?: ConversationQueueInfo | null;
|
|
17
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ConversationQueueInfo } from "../Conversations/Queue";
|
|
2
|
+
export interface QueueRoutingState {
|
|
3
|
+
spaceId: string;
|
|
4
|
+
userId: string;
|
|
5
|
+
queueId: string;
|
|
6
|
+
isEligible: boolean;
|
|
7
|
+
presenceStatus: RoutingPresenceStatus;
|
|
8
|
+
activeJobCount: number;
|
|
9
|
+
maxCapacity?: number;
|
|
10
|
+
notRespondingDetectedAt?: Date;
|
|
11
|
+
updatedAt: Date;
|
|
12
|
+
}
|
|
13
|
+
export declare enum RoutingPresenceStatus {
|
|
14
|
+
IDLE = 0,
|
|
15
|
+
INTERACTING = 1,
|
|
16
|
+
BUSY = 2
|
|
17
|
+
}
|
|
18
|
+
export interface RoutingStateDto {
|
|
19
|
+
queueId: string;
|
|
20
|
+
queue?: ConversationQueueInfo | null;
|
|
21
|
+
isEligible: boolean;
|
|
22
|
+
presenceStatus?: RoutingPresenceStatus;
|
|
23
|
+
activeJobCount: number;
|
|
24
|
+
maxCapacity?: number | null;
|
|
25
|
+
notRespondingDetectedAt?: Date;
|
|
26
|
+
updatedAt?: Date;
|
|
27
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RoutingPresenceStatus = void 0;
|
|
4
|
+
var RoutingPresenceStatus;
|
|
5
|
+
(function (RoutingPresenceStatus) {
|
|
6
|
+
RoutingPresenceStatus[RoutingPresenceStatus["IDLE"] = 0] = "IDLE";
|
|
7
|
+
RoutingPresenceStatus[RoutingPresenceStatus["INTERACTING"] = 1] = "INTERACTING";
|
|
8
|
+
RoutingPresenceStatus[RoutingPresenceStatus["BUSY"] = 2] = "BUSY";
|
|
9
|
+
})(RoutingPresenceStatus || (exports.RoutingPresenceStatus = RoutingPresenceStatus = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./AgentPause"), exports);
|
|
18
|
+
__exportStar(require("./QueueParticipation"), exports);
|
|
19
|
+
__exportStar(require("./QueueRoutingState"), exports);
|
|
@@ -51,3 +51,21 @@ export interface IUpdateTicketCategoryDto {
|
|
|
51
51
|
fieldDefinitionIds?: string[] | null;
|
|
52
52
|
layoutIds?: string[] | null;
|
|
53
53
|
}
|
|
54
|
+
export interface ICreateTicketResolutionTypeDto {
|
|
55
|
+
name: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
enabled?: boolean;
|
|
58
|
+
order?: number;
|
|
59
|
+
formRequirements?: ITicketFormRequirement[];
|
|
60
|
+
fieldDefinitionIds?: string[];
|
|
61
|
+
layoutIds?: string[];
|
|
62
|
+
}
|
|
63
|
+
export interface IUpdateTicketResolutionTypeDto {
|
|
64
|
+
name?: string;
|
|
65
|
+
description?: string | null;
|
|
66
|
+
enabled?: boolean;
|
|
67
|
+
order?: number;
|
|
68
|
+
formRequirements?: ITicketFormRequirement[] | null;
|
|
69
|
+
fieldDefinitionIds?: string[] | null;
|
|
70
|
+
layoutIds?: string[] | null;
|
|
71
|
+
}
|