@webex/contact-center 0.0.0-next.1
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/README.md +81 -0
- package/__mocks__/workerMock.js +15 -0
- package/babel.config.js +15 -0
- package/dist/cc.js +1416 -0
- package/dist/cc.js.map +1 -0
- package/dist/config.js +72 -0
- package/dist/config.js.map +1 -0
- package/dist/constants.js +58 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.js +142 -0
- package/dist/index.js.map +1 -0
- package/dist/logger-proxy.js +115 -0
- package/dist/logger-proxy.js.map +1 -0
- package/dist/metrics/MetricsManager.js +474 -0
- package/dist/metrics/MetricsManager.js.map +1 -0
- package/dist/metrics/behavioral-events.js +322 -0
- package/dist/metrics/behavioral-events.js.map +1 -0
- package/dist/metrics/constants.js +134 -0
- package/dist/metrics/constants.js.map +1 -0
- package/dist/services/WebCallingService.js +323 -0
- package/dist/services/WebCallingService.js.map +1 -0
- package/dist/services/agent/index.js +177 -0
- package/dist/services/agent/index.js.map +1 -0
- package/dist/services/agent/types.js +137 -0
- package/dist/services/agent/types.js.map +1 -0
- package/dist/services/config/Util.js +203 -0
- package/dist/services/config/Util.js.map +1 -0
- package/dist/services/config/constants.js +221 -0
- package/dist/services/config/constants.js.map +1 -0
- package/dist/services/config/index.js +607 -0
- package/dist/services/config/index.js.map +1 -0
- package/dist/services/config/types.js +334 -0
- package/dist/services/config/types.js.map +1 -0
- package/dist/services/constants.js +117 -0
- package/dist/services/constants.js.map +1 -0
- package/dist/services/core/Err.js +43 -0
- package/dist/services/core/Err.js.map +1 -0
- package/dist/services/core/GlobalTypes.js +6 -0
- package/dist/services/core/GlobalTypes.js.map +1 -0
- package/dist/services/core/Utils.js +126 -0
- package/dist/services/core/Utils.js.map +1 -0
- package/dist/services/core/WebexRequest.js +96 -0
- package/dist/services/core/WebexRequest.js.map +1 -0
- package/dist/services/core/aqm-reqs.js +246 -0
- package/dist/services/core/aqm-reqs.js.map +1 -0
- package/dist/services/core/constants.js +109 -0
- package/dist/services/core/constants.js.map +1 -0
- package/dist/services/core/types.js +6 -0
- package/dist/services/core/types.js.map +1 -0
- package/dist/services/core/websocket/WebSocketManager.js +187 -0
- package/dist/services/core/websocket/WebSocketManager.js.map +1 -0
- package/dist/services/core/websocket/connection-service.js +111 -0
- package/dist/services/core/websocket/connection-service.js.map +1 -0
- package/dist/services/core/websocket/keepalive.worker.js +94 -0
- package/dist/services/core/websocket/keepalive.worker.js.map +1 -0
- package/dist/services/core/websocket/types.js +6 -0
- package/dist/services/core/websocket/types.js.map +1 -0
- package/dist/services/index.js +78 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/task/AutoWrapup.js +88 -0
- package/dist/services/task/AutoWrapup.js.map +1 -0
- package/dist/services/task/TaskManager.js +369 -0
- package/dist/services/task/TaskManager.js.map +1 -0
- package/dist/services/task/constants.js +58 -0
- package/dist/services/task/constants.js.map +1 -0
- package/dist/services/task/contact.js +464 -0
- package/dist/services/task/contact.js.map +1 -0
- package/dist/services/task/dialer.js +60 -0
- package/dist/services/task/dialer.js.map +1 -0
- package/dist/services/task/index.js +1188 -0
- package/dist/services/task/index.js.map +1 -0
- package/dist/services/task/types.js +214 -0
- package/dist/services/task/types.js.map +1 -0
- package/dist/types/cc.d.ts +676 -0
- package/dist/types/config.d.ts +66 -0
- package/dist/types/constants.d.ts +45 -0
- package/dist/types/index.d.ts +178 -0
- package/dist/types/logger-proxy.d.ts +71 -0
- package/dist/types/metrics/MetricsManager.d.ts +223 -0
- package/dist/types/metrics/behavioral-events.d.ts +29 -0
- package/dist/types/metrics/constants.d.ts +127 -0
- package/dist/types/services/WebCallingService.d.ts +1 -0
- package/dist/types/services/agent/index.d.ts +46 -0
- package/dist/types/services/agent/types.d.ts +413 -0
- package/dist/types/services/config/Util.d.ts +19 -0
- package/dist/types/services/config/constants.d.ts +203 -0
- package/dist/types/services/config/index.d.ts +171 -0
- package/dist/types/services/config/types.d.ts +1113 -0
- package/dist/types/services/constants.d.ts +97 -0
- package/dist/types/services/core/Err.d.ts +119 -0
- package/dist/types/services/core/GlobalTypes.d.ts +33 -0
- package/dist/types/services/core/Utils.d.ts +36 -0
- package/dist/types/services/core/WebexRequest.d.ts +22 -0
- package/dist/types/services/core/aqm-reqs.d.ts +16 -0
- package/dist/types/services/core/constants.d.ts +85 -0
- package/dist/types/services/core/types.d.ts +47 -0
- package/dist/types/services/core/websocket/WebSocketManager.d.ts +34 -0
- package/dist/types/services/core/websocket/connection-service.d.ts +27 -0
- package/dist/types/services/core/websocket/keepalive.worker.d.ts +2 -0
- package/dist/types/services/core/websocket/types.d.ts +37 -0
- package/dist/types/services/index.d.ts +52 -0
- package/dist/types/services/task/AutoWrapup.d.ts +40 -0
- package/dist/types/services/task/TaskManager.d.ts +1 -0
- package/dist/types/services/task/constants.d.ts +46 -0
- package/dist/types/services/task/contact.d.ts +59 -0
- package/dist/types/services/task/dialer.d.ts +28 -0
- package/dist/types/services/task/index.d.ts +569 -0
- package/dist/types/services/task/types.d.ts +1041 -0
- package/dist/types/types.d.ts +452 -0
- package/dist/types/webex-config.d.ts +53 -0
- package/dist/types/webex.d.ts +7 -0
- package/dist/types.js +292 -0
- package/dist/types.js.map +1 -0
- package/dist/webex-config.js +60 -0
- package/dist/webex-config.js.map +1 -0
- package/dist/webex.js +99 -0
- package/dist/webex.js.map +1 -0
- package/jest.config.js +45 -0
- package/package.json +83 -0
- package/src/cc.ts +1618 -0
- package/src/config.ts +65 -0
- package/src/constants.ts +51 -0
- package/src/index.ts +220 -0
- package/src/logger-proxy.ts +110 -0
- package/src/metrics/MetricsManager.ts +512 -0
- package/src/metrics/behavioral-events.ts +332 -0
- package/src/metrics/constants.ts +135 -0
- package/src/services/WebCallingService.ts +351 -0
- package/src/services/agent/index.ts +149 -0
- package/src/services/agent/types.ts +440 -0
- package/src/services/config/Util.ts +261 -0
- package/src/services/config/constants.ts +249 -0
- package/src/services/config/index.ts +743 -0
- package/src/services/config/types.ts +1117 -0
- package/src/services/constants.ts +111 -0
- package/src/services/core/Err.ts +126 -0
- package/src/services/core/GlobalTypes.ts +34 -0
- package/src/services/core/Utils.ts +132 -0
- package/src/services/core/WebexRequest.ts +103 -0
- package/src/services/core/aqm-reqs.ts +272 -0
- package/src/services/core/constants.ts +106 -0
- package/src/services/core/types.ts +48 -0
- package/src/services/core/websocket/WebSocketManager.ts +196 -0
- package/src/services/core/websocket/connection-service.ts +142 -0
- package/src/services/core/websocket/keepalive.worker.js +88 -0
- package/src/services/core/websocket/types.ts +40 -0
- package/src/services/index.ts +71 -0
- package/src/services/task/AutoWrapup.ts +86 -0
- package/src/services/task/TaskManager.ts +420 -0
- package/src/services/task/constants.ts +52 -0
- package/src/services/task/contact.ts +429 -0
- package/src/services/task/dialer.ts +52 -0
- package/src/services/task/index.ts +1375 -0
- package/src/services/task/types.ts +1113 -0
- package/src/types.ts +639 -0
- package/src/webex-config.ts +54 -0
- package/src/webex.js +96 -0
- package/test/unit/spec/cc.ts +1985 -0
- package/test/unit/spec/metrics/MetricsManager.ts +491 -0
- package/test/unit/spec/metrics/behavioral-events.ts +102 -0
- package/test/unit/spec/services/WebCallingService.ts +416 -0
- package/test/unit/spec/services/agent/index.ts +65 -0
- package/test/unit/spec/services/config/index.ts +1035 -0
- package/test/unit/spec/services/core/Utils.ts +279 -0
- package/test/unit/spec/services/core/WebexRequest.ts +144 -0
- package/test/unit/spec/services/core/aqm-reqs.ts +570 -0
- package/test/unit/spec/services/core/websocket/WebSocketManager.ts +378 -0
- package/test/unit/spec/services/core/websocket/connection-service.ts +178 -0
- package/test/unit/spec/services/task/TaskManager.ts +1351 -0
- package/test/unit/spec/services/task/contact.ts +204 -0
- package/test/unit/spec/services/task/dialer.ts +157 -0
- package/test/unit/spec/services/task/index.ts +1474 -0
- package/tsconfig.json +6 -0
- package/typedoc.json +37 -0
- package/typedoc.md +240 -0
- package/umd/contact-center.min.js +3 -0
- package/umd/contact-center.min.js.map +1 -0
|
@@ -0,0 +1,1041 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { CallId } from '@webex/calling/dist/types/common/types';
|
|
3
|
+
import EventEmitter from 'events';
|
|
4
|
+
import { Msg } from '../core/GlobalTypes';
|
|
5
|
+
import AutoWrapup from './AutoWrapup';
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifier for a task in the contact center system
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export type TaskId = string;
|
|
11
|
+
/**
|
|
12
|
+
* Defines the valid destination types for routing tasks within the contact center
|
|
13
|
+
* Used to specify where a task should be directed
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export declare const DESTINATION_TYPE: {
|
|
17
|
+
/** Route task to a specific queue */
|
|
18
|
+
QUEUE: string;
|
|
19
|
+
/** Route task to a specific dial number */
|
|
20
|
+
DIALNUMBER: string;
|
|
21
|
+
/** Route task to a specific agent */
|
|
22
|
+
AGENT: string;
|
|
23
|
+
/** Route task to an entry point (supported only for consult operations) */
|
|
24
|
+
ENTRYPOINT: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Type representing valid destination types for task routing
|
|
28
|
+
* Derived from the DESTINATION_TYPE constant
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export type DestinationType = Enum<typeof DESTINATION_TYPE>;
|
|
32
|
+
/**
|
|
33
|
+
* Defines the valid destination types for consult transfer operations
|
|
34
|
+
* Used when transferring a task after consultation
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
export declare const CONSULT_TRANSFER_DESTINATION_TYPE: {
|
|
38
|
+
/** Transfer to a specific agent */
|
|
39
|
+
AGENT: string;
|
|
40
|
+
/** Transfer to an entry point */
|
|
41
|
+
ENTRYPOINT: string;
|
|
42
|
+
/** Transfer to a dial number */
|
|
43
|
+
DIALNUMBER: string;
|
|
44
|
+
/** Transfer to a queue */
|
|
45
|
+
QUEUE: string;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Type representing valid destination types for consult transfers
|
|
49
|
+
* Derived from the CONSULT_TRANSFER_DESTINATION_TYPE constant
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export type ConsultTransferDestinationType = Enum<typeof CONSULT_TRANSFER_DESTINATION_TYPE>;
|
|
53
|
+
/**
|
|
54
|
+
* Defines all supported media channel types for customer interactions
|
|
55
|
+
* These represent the different ways customers can communicate with agents
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
export declare const MEDIA_CHANNEL: {
|
|
59
|
+
/** Email-based communication channel */
|
|
60
|
+
readonly EMAIL: "email";
|
|
61
|
+
/** Web-based chat communication channel */
|
|
62
|
+
readonly CHAT: "chat";
|
|
63
|
+
/** Voice/phone communication channel */
|
|
64
|
+
readonly TELEPHONY: "telephony";
|
|
65
|
+
/** Social media platform communication channel */
|
|
66
|
+
readonly SOCIAL: "social";
|
|
67
|
+
/** SMS text messaging communication channel */
|
|
68
|
+
readonly SMS: "sms";
|
|
69
|
+
/** Facebook Messenger communication channel */
|
|
70
|
+
readonly FACEBOOK: "facebook";
|
|
71
|
+
/** WhatsApp messaging communication channel */
|
|
72
|
+
readonly WHATSAPP: "whatsapp";
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Type representing valid media channels
|
|
76
|
+
* Derived from the MEDIA_CHANNEL constant
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
export type MEDIA_CHANNEL = Enum<typeof MEDIA_CHANNEL>;
|
|
80
|
+
/**
|
|
81
|
+
* Enumeration of all task-related events that can occur in the contact center system
|
|
82
|
+
* These events represent different states and actions in the task lifecycle
|
|
83
|
+
* @public
|
|
84
|
+
*/
|
|
85
|
+
export declare enum TASK_EVENTS {
|
|
86
|
+
/**
|
|
87
|
+
* Triggered when a new task is received by the system
|
|
88
|
+
* @example
|
|
89
|
+
* ```typescript
|
|
90
|
+
* task.on(TASK_EVENTS.TASK_INCOMING, (task: ITask) => {
|
|
91
|
+
* console.log('New task received:', task.data.interactionId);
|
|
92
|
+
* // Handle incoming task
|
|
93
|
+
* });
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
TASK_INCOMING = "task:incoming",
|
|
97
|
+
/**
|
|
98
|
+
* Triggered when a task is successfully assigned to an agent
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* task.on(TASK_EVENTS.TASK_ASSIGNED, (task: ITask) => {
|
|
102
|
+
* console.log('Task assigned:', task.data.interactionId);
|
|
103
|
+
* // Begin handling the assigned task
|
|
104
|
+
* });
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
TASK_ASSIGNED = "task:assigned",
|
|
108
|
+
/**
|
|
109
|
+
* Triggered when the media state of a task changes
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* task.on(TASK_EVENTS.TASK_MEDIA, (track: MediaStreamTrack) => {
|
|
113
|
+
* // Handle media track updates
|
|
114
|
+
* });
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
TASK_MEDIA = "task:media",
|
|
118
|
+
/**
|
|
119
|
+
* Triggered when a task is removed from an agent
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* task.on(TASK_EVENTS.TASK_UNASSIGNED, (task: ITask) => {
|
|
123
|
+
* console.log('Task unassigned:', task.data.interactionId);
|
|
124
|
+
* // Clean up task resources
|
|
125
|
+
* });
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
TASK_UNASSIGNED = "task:unassigned",
|
|
129
|
+
/**
|
|
130
|
+
* Triggered when a task is placed on hold
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* task.on(TASK_EVENTS.TASK_HOLD, (task: ITask) => {
|
|
134
|
+
* console.log('Task placed on hold:', task.data.interactionId);
|
|
135
|
+
* // Update UI to show hold state
|
|
136
|
+
* });
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
TASK_HOLD = "task:hold",
|
|
140
|
+
/**
|
|
141
|
+
* Triggered when a task is resumed from hold
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* task.on(TASK_EVENTS.TASK_RESUME, (task: ITask) => {
|
|
145
|
+
* console.log('Task resumed from hold:', task.data.interactionId);
|
|
146
|
+
* // Update UI to show active state
|
|
147
|
+
* });
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
TASK_RESUME = "task:resume",
|
|
151
|
+
/**
|
|
152
|
+
* Triggered when a consultation session ends
|
|
153
|
+
* @example
|
|
154
|
+
* ```typescript
|
|
155
|
+
* task.on(TASK_EVENTS.TASK_CONSULT_END, (task: ITask) => {
|
|
156
|
+
* console.log('Consultation ended:', task.data.interactionId);
|
|
157
|
+
* // Clean up consultation resources
|
|
158
|
+
* });
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
TASK_CONSULT_END = "task:consultEnd",
|
|
162
|
+
/**
|
|
163
|
+
* Triggered when a queue consultation is cancelled
|
|
164
|
+
* @example
|
|
165
|
+
* ```typescript
|
|
166
|
+
* task.on(TASK_EVENTS.TASK_CONSULT_QUEUE_CANCELLED, (task: ITask) => {
|
|
167
|
+
* console.log('Queue consultation cancelled:', task.data.interactionId);
|
|
168
|
+
* // Handle consultation cancellation
|
|
169
|
+
* });
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
TASK_CONSULT_QUEUE_CANCELLED = "task:consultQueueCancelled",
|
|
173
|
+
/**
|
|
174
|
+
* Triggered when a queue consultation fails
|
|
175
|
+
* @example
|
|
176
|
+
* ```typescript
|
|
177
|
+
* task.on(TASK_EVENTS.TASK_CONSULT_QUEUE_FAILED, (task: ITask) => {
|
|
178
|
+
* console.log('Queue consultation failed:', task.data.interactionId);
|
|
179
|
+
* // Handle consultation failure
|
|
180
|
+
* });
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
TASK_CONSULT_QUEUE_FAILED = "task:consultQueueFailed",
|
|
184
|
+
/**
|
|
185
|
+
* Triggered when a consultation request is accepted
|
|
186
|
+
* @example
|
|
187
|
+
* ```typescript
|
|
188
|
+
* task.on(TASK_EVENTS.TASK_CONSULT_ACCEPTED, (task: ITask) => {
|
|
189
|
+
* console.log('Consultation accepted:', task.data.interactionId);
|
|
190
|
+
* // Begin consultation
|
|
191
|
+
* });
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
TASK_CONSULT_ACCEPTED = "task:consultAccepted",
|
|
195
|
+
/**
|
|
196
|
+
* Triggered when consultation is in progress
|
|
197
|
+
* @example
|
|
198
|
+
* ```typescript
|
|
199
|
+
* task.on(TASK_EVENTS.TASK_CONSULTING, (task: ITask) => {
|
|
200
|
+
* console.log('Consulting in progress:', task.data.interactionId);
|
|
201
|
+
* // Handle ongoing consultation
|
|
202
|
+
* });
|
|
203
|
+
* ```
|
|
204
|
+
*/
|
|
205
|
+
TASK_CONSULTING = "task:consulting",
|
|
206
|
+
/**
|
|
207
|
+
* Triggered when a new consultation is created
|
|
208
|
+
* @example
|
|
209
|
+
* ```typescript
|
|
210
|
+
* task.on(TASK_EVENTS.TASK_CONSULT_CREATED, (task: ITask) => {
|
|
211
|
+
* console.log('Consultation created:', task.data.interactionId);
|
|
212
|
+
* // Initialize consultation
|
|
213
|
+
* });
|
|
214
|
+
* ```
|
|
215
|
+
*/
|
|
216
|
+
TASK_CONSULT_CREATED = "task:consultCreated",
|
|
217
|
+
/**
|
|
218
|
+
* Triggered when a consultation is offered
|
|
219
|
+
* @example
|
|
220
|
+
* ```typescript
|
|
221
|
+
* task.on(TASK_EVENTS.TASK_OFFER_CONSULT, (task: ITask) => {
|
|
222
|
+
* console.log('Consultation offered:', task.data.interactionId);
|
|
223
|
+
* // Handle consultation offer
|
|
224
|
+
* });
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
227
|
+
TASK_OFFER_CONSULT = "task:offerConsult",
|
|
228
|
+
/**
|
|
229
|
+
* Triggered when a task is completed/terminated
|
|
230
|
+
* @example
|
|
231
|
+
* ```typescript
|
|
232
|
+
* task.on(TASK_EVENTS.TASK_END, (task: ITask) => {
|
|
233
|
+
* console.log('Task ended:', task.data.interactionId);
|
|
234
|
+
* // Clean up and finalize task
|
|
235
|
+
* });
|
|
236
|
+
* ```
|
|
237
|
+
*/
|
|
238
|
+
TASK_END = "task:end",
|
|
239
|
+
/**
|
|
240
|
+
* Triggered when a task enters wrap-up state
|
|
241
|
+
* @example
|
|
242
|
+
* ```typescript
|
|
243
|
+
* task.on(TASK_EVENTS.TASK_WRAPUP, (task: ITask) => {
|
|
244
|
+
* console.log('Task in wrap-up:', task.data.interactionId);
|
|
245
|
+
* // Begin wrap-up process
|
|
246
|
+
* });
|
|
247
|
+
* ```
|
|
248
|
+
*/
|
|
249
|
+
TASK_WRAPUP = "task:wrapup",
|
|
250
|
+
/**
|
|
251
|
+
* Triggered when task wrap-up is completed
|
|
252
|
+
* @example
|
|
253
|
+
* ```typescript
|
|
254
|
+
* task.on(TASK_EVENTS.TASK_WRAPPEDUP, (task: ITask) => {
|
|
255
|
+
* console.log('Task wrapped up:', task.data.interactionId);
|
|
256
|
+
* // Finalize task completion
|
|
257
|
+
* });
|
|
258
|
+
* ```
|
|
259
|
+
*/
|
|
260
|
+
TASK_WRAPPEDUP = "task:wrappedup",
|
|
261
|
+
/**
|
|
262
|
+
* Triggered when recording is paused
|
|
263
|
+
* @example
|
|
264
|
+
* ```typescript
|
|
265
|
+
* task.on(TASK_EVENTS.TASK_RECORDING_PAUSED, (task: ITask) => {
|
|
266
|
+
* console.log('Recording paused:', task.data.interactionId);
|
|
267
|
+
* // Update recording state
|
|
268
|
+
* });
|
|
269
|
+
* ```
|
|
270
|
+
*/
|
|
271
|
+
TASK_RECORDING_PAUSED = "task:recordingPaused",
|
|
272
|
+
/**
|
|
273
|
+
* Triggered when recording pause attempt fails
|
|
274
|
+
* @example
|
|
275
|
+
* ```typescript
|
|
276
|
+
* task.on(TASK_EVENTS.TASK_RECORDING_PAUSE_FAILED, (task: ITask) => {
|
|
277
|
+
* console.log('Recording pause failed:', task.data.interactionId);
|
|
278
|
+
* // Handle pause failure
|
|
279
|
+
* });
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
282
|
+
TASK_RECORDING_PAUSE_FAILED = "task:recordingPauseFailed",
|
|
283
|
+
/**
|
|
284
|
+
* Triggered when recording is resumed
|
|
285
|
+
* @example
|
|
286
|
+
* ```typescript
|
|
287
|
+
* task.on(TASK_EVENTS.TASK_RECORDING_RESUMED, (task: ITask) => {
|
|
288
|
+
* console.log('Recording resumed:', task.data.interactionId);
|
|
289
|
+
* // Update recording state
|
|
290
|
+
* });
|
|
291
|
+
* ```
|
|
292
|
+
*/
|
|
293
|
+
TASK_RECORDING_RESUMED = "task:recordingResumed",
|
|
294
|
+
/**
|
|
295
|
+
* Triggered when recording resume attempt fails
|
|
296
|
+
* @example
|
|
297
|
+
* ```typescript
|
|
298
|
+
* task.on(TASK_EVENTS.TASK_RECORDING_RESUME_FAILED, (task: ITask) => {
|
|
299
|
+
* console.log('Recording resume failed:', task.data.interactionId);
|
|
300
|
+
* // Handle resume failure
|
|
301
|
+
* });
|
|
302
|
+
* ```
|
|
303
|
+
*/
|
|
304
|
+
TASK_RECORDING_RESUME_FAILED = "task:recordingResumeFailed",
|
|
305
|
+
/**
|
|
306
|
+
* Triggered when a task is rejected/unanswered
|
|
307
|
+
* @example
|
|
308
|
+
* ```typescript
|
|
309
|
+
* task.on(TASK_EVENTS.TASK_REJECT, (task: ITask) => {
|
|
310
|
+
* console.log('Task rejected:', task.data.interactionId);
|
|
311
|
+
* // Handle task rejection
|
|
312
|
+
* });
|
|
313
|
+
* ```
|
|
314
|
+
*/
|
|
315
|
+
TASK_REJECT = "task:rejected",
|
|
316
|
+
/**
|
|
317
|
+
* Triggered when a task is populated with data
|
|
318
|
+
* @example
|
|
319
|
+
* ```typescript
|
|
320
|
+
* task.on(TASK_EVENTS.TASK_HYDRATE, (task: ITask) => {
|
|
321
|
+
* console.log('Task hydrated:', task.data.interactionId);
|
|
322
|
+
* // Process task data
|
|
323
|
+
* });
|
|
324
|
+
* ```
|
|
325
|
+
*/
|
|
326
|
+
TASK_HYDRATE = "task:hydrate",
|
|
327
|
+
/**
|
|
328
|
+
* Triggered when a new contact is offered
|
|
329
|
+
* @example
|
|
330
|
+
* ```typescript
|
|
331
|
+
* task.on(TASK_EVENTS.TASK_OFFER_CONTACT, (task: ITask) => {
|
|
332
|
+
* console.log('Contact offered:', task.data.interactionId);
|
|
333
|
+
* // Handle contact offer
|
|
334
|
+
* });
|
|
335
|
+
* ```
|
|
336
|
+
*/
|
|
337
|
+
TASK_OFFER_CONTACT = "task:offerContact"
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Represents a customer interaction within the contact center system
|
|
341
|
+
* Contains comprehensive details about an ongoing customer interaction
|
|
342
|
+
* @public
|
|
343
|
+
*/
|
|
344
|
+
export type Interaction = {
|
|
345
|
+
/** Indicates if the interaction is managed by Flow Control */
|
|
346
|
+
isFcManaged: boolean;
|
|
347
|
+
/** Indicates if the interaction has been terminated */
|
|
348
|
+
isTerminated: boolean;
|
|
349
|
+
/** The type of media channel for this interaction */
|
|
350
|
+
mediaType: MEDIA_CHANNEL;
|
|
351
|
+
/** List of previous virtual teams that handled this interaction */
|
|
352
|
+
previousVTeams: string[];
|
|
353
|
+
/** Current state of the interaction */
|
|
354
|
+
state: string;
|
|
355
|
+
/** Current virtual team handling the interaction */
|
|
356
|
+
currentVTeam: string;
|
|
357
|
+
/** List of participants in the interaction */
|
|
358
|
+
participants: any;
|
|
359
|
+
/** Unique identifier for the interaction */
|
|
360
|
+
interactionId: string;
|
|
361
|
+
/** Organization identifier */
|
|
362
|
+
orgId: string;
|
|
363
|
+
/** Timestamp when the interaction was created */
|
|
364
|
+
createdTimestamp?: number;
|
|
365
|
+
/** Indicates if wrap-up assistance is enabled */
|
|
366
|
+
isWrapUpAssist?: boolean;
|
|
367
|
+
/** Detailed call processing information and metadata */
|
|
368
|
+
callProcessingDetails: {
|
|
369
|
+
/** Name of the Queue Manager handling this interaction */
|
|
370
|
+
QMgrName: string;
|
|
371
|
+
/** Indicates if the task should be self-serviced */
|
|
372
|
+
taskToBeSelfServiced: string;
|
|
373
|
+
/** Automatic Number Identification (caller's number) */
|
|
374
|
+
ani: string;
|
|
375
|
+
/** Display version of the ANI */
|
|
376
|
+
displayAni: string;
|
|
377
|
+
/** Dialed Number Identification Service number */
|
|
378
|
+
dnis: string;
|
|
379
|
+
/** Tenant identifier */
|
|
380
|
+
tenantId: string;
|
|
381
|
+
/** Queue identifier */
|
|
382
|
+
QueueId: string;
|
|
383
|
+
/** Virtual team identifier */
|
|
384
|
+
vteamId: string;
|
|
385
|
+
/** Indicates if pause/resume functionality is enabled */
|
|
386
|
+
pauseResumeEnabled?: string;
|
|
387
|
+
/** Duration of pause in seconds */
|
|
388
|
+
pauseDuration?: string;
|
|
389
|
+
/** Indicates if the interaction is currently paused */
|
|
390
|
+
isPaused?: string;
|
|
391
|
+
/** Indicates if recording is in progress */
|
|
392
|
+
recordInProgress?: string;
|
|
393
|
+
/** Indicates if recording has started */
|
|
394
|
+
recordingStarted?: string;
|
|
395
|
+
/** Indicates if Consult to Queue is in progress */
|
|
396
|
+
ctqInProgress?: string;
|
|
397
|
+
/** Indicates if outdial transfer to queue is enabled */
|
|
398
|
+
outdialTransferToQueueEnabled?: string;
|
|
399
|
+
/** IVR conversation transcript */
|
|
400
|
+
convIvrTranscript?: string;
|
|
401
|
+
/** Customer's name */
|
|
402
|
+
customerName: string;
|
|
403
|
+
/** Name of the virtual team */
|
|
404
|
+
virtualTeamName: string;
|
|
405
|
+
/** RONA (Redirection on No Answer) timeout in seconds */
|
|
406
|
+
ronaTimeout: string;
|
|
407
|
+
/** Category of the interaction */
|
|
408
|
+
category: string;
|
|
409
|
+
/** Reason for the interaction */
|
|
410
|
+
reason: string;
|
|
411
|
+
/** Source number for the interaction */
|
|
412
|
+
sourceNumber: string;
|
|
413
|
+
/** Source page that initiated the interaction */
|
|
414
|
+
sourcePage: string;
|
|
415
|
+
/** Application user identifier */
|
|
416
|
+
appUser: string;
|
|
417
|
+
/** Customer's contact number */
|
|
418
|
+
customerNumber: string;
|
|
419
|
+
/** Code indicating the reason for interaction */
|
|
420
|
+
reasonCode: string;
|
|
421
|
+
/** Path taken through the IVR system */
|
|
422
|
+
IvrPath: string;
|
|
423
|
+
/** Identifier for the IVR path */
|
|
424
|
+
pathId: string;
|
|
425
|
+
/** Email address or contact point that initiated the interaction */
|
|
426
|
+
fromAddress: string;
|
|
427
|
+
/** Identifier of the parent interaction for related interactions */
|
|
428
|
+
parentInteractionId?: string;
|
|
429
|
+
/** Identifier of the child interaction for related interactions */
|
|
430
|
+
childInteractionId?: string;
|
|
431
|
+
/** Type of relationship between parent and child interactions */
|
|
432
|
+
relationshipType?: string;
|
|
433
|
+
/** ANI of the parent interaction */
|
|
434
|
+
parent_ANI?: string;
|
|
435
|
+
/** DNIS of the parent interaction */
|
|
436
|
+
parent_DNIS?: string;
|
|
437
|
+
/** Indicates if the consulted destination agent has joined */
|
|
438
|
+
consultDestinationAgentJoined?: boolean | string;
|
|
439
|
+
/** Name of the destination agent for consultation */
|
|
440
|
+
consultDestinationAgentName?: string;
|
|
441
|
+
/** DN of the parent interaction's agent */
|
|
442
|
+
parent_Agent_DN?: string;
|
|
443
|
+
/** Name of the parent interaction's agent */
|
|
444
|
+
parent_Agent_Name?: string;
|
|
445
|
+
/** Team name of the parent interaction's agent */
|
|
446
|
+
parent_Agent_TeamName?: string;
|
|
447
|
+
/** Indicates if the interaction is in conference mode */
|
|
448
|
+
isConferencing?: string;
|
|
449
|
+
/** Type of monitoring being performed */
|
|
450
|
+
monitorType?: string;
|
|
451
|
+
/** Name of the workflow being executed */
|
|
452
|
+
workflowName?: string;
|
|
453
|
+
/** Identifier of the workflow */
|
|
454
|
+
workflowId?: string;
|
|
455
|
+
/** Indicates if monitoring is in invisible mode */
|
|
456
|
+
monitoringInvisibleMode?: string;
|
|
457
|
+
/** Identifier for the monitoring request */
|
|
458
|
+
monitoringRequestId?: string;
|
|
459
|
+
/** Timeout for participant invitation */
|
|
460
|
+
participantInviteTimeout?: string;
|
|
461
|
+
/** Filename for music on hold */
|
|
462
|
+
mohFileName?: string;
|
|
463
|
+
/** Flag for continuing recording during transfer */
|
|
464
|
+
CONTINUE_RECORDING_ON_TRANSFER?: string;
|
|
465
|
+
/** Entry point identifier */
|
|
466
|
+
EP_ID?: string;
|
|
467
|
+
/** Type of routing being used */
|
|
468
|
+
ROUTING_TYPE?: string;
|
|
469
|
+
/** Events registered with Flow Control Engine */
|
|
470
|
+
fceRegisteredEvents?: string;
|
|
471
|
+
/** Indicates if the interaction is parked */
|
|
472
|
+
isParked?: string;
|
|
473
|
+
/** Priority level of the interaction */
|
|
474
|
+
priority?: string;
|
|
475
|
+
/** Identifier for the routing strategy */
|
|
476
|
+
routingStrategyId?: string;
|
|
477
|
+
/** Current state of monitoring */
|
|
478
|
+
monitoringState?: string;
|
|
479
|
+
/** Indicates if blind transfer is in progress */
|
|
480
|
+
BLIND_TRANSFER_IN_PROGRESS?: boolean;
|
|
481
|
+
/** Desktop view configuration for Flow Control */
|
|
482
|
+
fcDesktopView?: string;
|
|
483
|
+
};
|
|
484
|
+
/** Main interaction identifier for related interactions */
|
|
485
|
+
mainInteractionId?: string;
|
|
486
|
+
/** Media-specific information for the interaction */
|
|
487
|
+
media: Record<string, {
|
|
488
|
+
/** Unique identifier for the media resource */
|
|
489
|
+
mediaResourceId: string;
|
|
490
|
+
/** Type of media channel */
|
|
491
|
+
mediaType: MEDIA_CHANNEL;
|
|
492
|
+
/** Media manager handling this media */
|
|
493
|
+
mediaMgr: string;
|
|
494
|
+
/** List of participant identifiers */
|
|
495
|
+
participants: string[];
|
|
496
|
+
/** Type of media */
|
|
497
|
+
mType: string;
|
|
498
|
+
/** Indicates if media is on hold */
|
|
499
|
+
isHold: boolean;
|
|
500
|
+
/** Timestamp when media was put on hold */
|
|
501
|
+
holdTimestamp: number | null;
|
|
502
|
+
}>;
|
|
503
|
+
/** Owner of the interaction */
|
|
504
|
+
owner: string;
|
|
505
|
+
/** Primary media channel for the interaction */
|
|
506
|
+
mediaChannel: MEDIA_CHANNEL;
|
|
507
|
+
/** Direction information for the contact */
|
|
508
|
+
contactDirection: {
|
|
509
|
+
type: string;
|
|
510
|
+
};
|
|
511
|
+
/** Type of outbound interaction */
|
|
512
|
+
outboundType?: string;
|
|
513
|
+
/** Parameters passed through the call flow */
|
|
514
|
+
callFlowParams: Record<string, {
|
|
515
|
+
/** Name of the parameter */
|
|
516
|
+
name: string;
|
|
517
|
+
/** Qualifier for the parameter */
|
|
518
|
+
qualifier: string;
|
|
519
|
+
/** Description of the parameter */
|
|
520
|
+
description: string;
|
|
521
|
+
/** Data type of the parameter value */
|
|
522
|
+
valueDataType: string;
|
|
523
|
+
/** Value of the parameter */
|
|
524
|
+
value: string;
|
|
525
|
+
}>;
|
|
526
|
+
};
|
|
527
|
+
/**
|
|
528
|
+
* Task payload containing detailed information about a contact center task
|
|
529
|
+
* This structure encapsulates all relevant data for task management
|
|
530
|
+
* @public
|
|
531
|
+
*/
|
|
532
|
+
export type TaskData = {
|
|
533
|
+
/** Unique identifier for the media resource handling this task */
|
|
534
|
+
mediaResourceId: string;
|
|
535
|
+
/** Type of event that triggered this task data */
|
|
536
|
+
eventType: string;
|
|
537
|
+
/** Timestamp when the event occurred */
|
|
538
|
+
eventTime?: number;
|
|
539
|
+
/** Identifier of the agent handling the task */
|
|
540
|
+
agentId: string;
|
|
541
|
+
/** Identifier of the destination agent for transfers/consults */
|
|
542
|
+
destAgentId: string;
|
|
543
|
+
/** Unique tracking identifier for the task */
|
|
544
|
+
trackingId: string;
|
|
545
|
+
/** Media resource identifier for consultation operations */
|
|
546
|
+
consultMediaResourceId: string;
|
|
547
|
+
/** Detailed interaction information */
|
|
548
|
+
interaction: Interaction;
|
|
549
|
+
/** Unique identifier for the participant */
|
|
550
|
+
participantId?: string;
|
|
551
|
+
/** Indicates if the task is from the owner */
|
|
552
|
+
fromOwner?: boolean;
|
|
553
|
+
/** Indicates if the task is to the owner */
|
|
554
|
+
toOwner?: boolean;
|
|
555
|
+
/** Identifier for child interaction in consult/transfer scenarios */
|
|
556
|
+
childInteractionId?: string;
|
|
557
|
+
/** Unique identifier for the interaction */
|
|
558
|
+
interactionId: string;
|
|
559
|
+
/** Organization identifier */
|
|
560
|
+
orgId: string;
|
|
561
|
+
/** Current owner of the task */
|
|
562
|
+
owner: string;
|
|
563
|
+
/** Queue manager handling the task */
|
|
564
|
+
queueMgr: string;
|
|
565
|
+
/** Name of the queue where task is queued */
|
|
566
|
+
queueName?: string;
|
|
567
|
+
/** Type of the task */
|
|
568
|
+
type: string;
|
|
569
|
+
/** Timeout value for RONA (Redirection on No Answer) in seconds */
|
|
570
|
+
ronaTimeout?: number;
|
|
571
|
+
/** Indicates if the task is in consultation state */
|
|
572
|
+
isConsulted?: boolean;
|
|
573
|
+
/** Indicates if the task is in conference state */
|
|
574
|
+
isConferencing: boolean;
|
|
575
|
+
/** Identifier of agent who last updated the task */
|
|
576
|
+
updatedBy?: string;
|
|
577
|
+
/** Type of destination for transfer/consult */
|
|
578
|
+
destinationType?: string;
|
|
579
|
+
/** Indicates if the task was automatically resumed */
|
|
580
|
+
autoResumed?: boolean;
|
|
581
|
+
/** Code indicating the reason for an action */
|
|
582
|
+
reasonCode?: string | number;
|
|
583
|
+
/** Description of the reason for an action */
|
|
584
|
+
reason?: string;
|
|
585
|
+
/** Identifier of the consulting agent */
|
|
586
|
+
consultingAgentId?: string;
|
|
587
|
+
/** Unique identifier for the task */
|
|
588
|
+
taskId?: string;
|
|
589
|
+
/** Task details including state and media information */
|
|
590
|
+
task?: Interaction;
|
|
591
|
+
/** Unique identifier for monitoring offered events */
|
|
592
|
+
id?: string;
|
|
593
|
+
/** Indicates if the web call is muted */
|
|
594
|
+
isWebCallMute?: boolean;
|
|
595
|
+
/** Identifier for reservation interaction */
|
|
596
|
+
reservationInteractionId?: string;
|
|
597
|
+
/** Indicates if wrap-up is required for this task */
|
|
598
|
+
wrapUpRequired?: boolean;
|
|
599
|
+
};
|
|
600
|
+
/**
|
|
601
|
+
* Type representing an agent contact message within the contact center system
|
|
602
|
+
* Contains comprehensive interaction and task related details for agent operations
|
|
603
|
+
* @public
|
|
604
|
+
*/
|
|
605
|
+
export type AgentContact = Msg<{
|
|
606
|
+
/** Unique identifier for the media resource */
|
|
607
|
+
mediaResourceId: string;
|
|
608
|
+
/** Type of the event (e.g., 'AgentDesktopMessage') */
|
|
609
|
+
eventType: string;
|
|
610
|
+
/** Timestamp when the event occurred */
|
|
611
|
+
eventTime?: number;
|
|
612
|
+
/** Unique identifier of the agent handling the contact */
|
|
613
|
+
agentId: string;
|
|
614
|
+
/** Identifier of the destination agent for transfers/consults */
|
|
615
|
+
destAgentId: string;
|
|
616
|
+
/** Unique tracking identifier for the contact */
|
|
617
|
+
trackingId: string;
|
|
618
|
+
/** Media resource identifier for consult operations */
|
|
619
|
+
consultMediaResourceId: string;
|
|
620
|
+
/** Detailed interaction information including media and participant data */
|
|
621
|
+
interaction: Interaction;
|
|
622
|
+
/** Unique identifier for the participant */
|
|
623
|
+
participantId?: string;
|
|
624
|
+
/** Indicates if the message is from the owner of the interaction */
|
|
625
|
+
fromOwner?: boolean;
|
|
626
|
+
/** Indicates if the message is to the owner of the interaction */
|
|
627
|
+
toOwner?: boolean;
|
|
628
|
+
/** Identifier for child interaction in case of consult/transfer */
|
|
629
|
+
childInteractionId?: string;
|
|
630
|
+
/** Unique identifier for the interaction */
|
|
631
|
+
interactionId: string;
|
|
632
|
+
/** Organization identifier */
|
|
633
|
+
orgId: string;
|
|
634
|
+
/** Current owner of the interaction */
|
|
635
|
+
owner: string;
|
|
636
|
+
/** Queue manager handling the interaction */
|
|
637
|
+
queueMgr: string;
|
|
638
|
+
/** Name of the queue where interaction is queued */
|
|
639
|
+
queueName?: string;
|
|
640
|
+
/** Type of the contact/interaction */
|
|
641
|
+
type: string;
|
|
642
|
+
/** Timeout value for RONA (Redirection on No Answer) in seconds */
|
|
643
|
+
ronaTimeout?: number;
|
|
644
|
+
/** Indicates if the interaction is in consult state */
|
|
645
|
+
isConsulted?: boolean;
|
|
646
|
+
/** Indicates if the interaction is in conference state */
|
|
647
|
+
isConferencing: boolean;
|
|
648
|
+
/** Identifier of the agent who last updated the interaction */
|
|
649
|
+
updatedBy?: string;
|
|
650
|
+
/** Type of destination for transfer/consult */
|
|
651
|
+
destinationType?: string;
|
|
652
|
+
/** Indicates if the interaction was automatically resumed */
|
|
653
|
+
autoResumed?: boolean;
|
|
654
|
+
/** Code indicating the reason for an action */
|
|
655
|
+
reasonCode?: string | number;
|
|
656
|
+
/** Description of the reason for an action */
|
|
657
|
+
reason?: string;
|
|
658
|
+
/** Identifier of the consulting agent */
|
|
659
|
+
consultingAgentId?: string;
|
|
660
|
+
/** Unique identifier for the task */
|
|
661
|
+
taskId?: string;
|
|
662
|
+
/** Task details including media and state information */
|
|
663
|
+
task?: Interaction;
|
|
664
|
+
/** Identifier of the supervisor monitoring the interaction */
|
|
665
|
+
supervisorId?: string;
|
|
666
|
+
/** Type of monitoring (e.g., 'SILENT', 'BARGE_IN') */
|
|
667
|
+
monitorType?: string;
|
|
668
|
+
/** Dial number of the supervisor */
|
|
669
|
+
supervisorDN?: string;
|
|
670
|
+
/** Unique identifier for monitoring offered events */
|
|
671
|
+
id?: string;
|
|
672
|
+
/** Indicates if the web call is muted */
|
|
673
|
+
isWebCallMute?: boolean;
|
|
674
|
+
/** Identifier for reservation interaction */
|
|
675
|
+
reservationInteractionId?: string;
|
|
676
|
+
/** Identifier for the reserved agent channel */
|
|
677
|
+
reservedAgentChannelId?: string;
|
|
678
|
+
/** Current monitoring state information */
|
|
679
|
+
monitoringState?: {
|
|
680
|
+
/** Type of monitoring state */
|
|
681
|
+
type: string;
|
|
682
|
+
};
|
|
683
|
+
/** Name of the supervisor monitoring the interaction */
|
|
684
|
+
supervisorName?: string;
|
|
685
|
+
}>;
|
|
686
|
+
/**
|
|
687
|
+
* Information about a virtual team in the contact center
|
|
688
|
+
* @ignore
|
|
689
|
+
*/
|
|
690
|
+
export type VTeam = {
|
|
691
|
+
/** Profile ID of the agent in the virtual team */
|
|
692
|
+
agentProfileId: string;
|
|
693
|
+
/** Session ID of the agent in the virtual team */
|
|
694
|
+
agentSessionId: string;
|
|
695
|
+
/** Type of channel handled by the virtual team */
|
|
696
|
+
channelType: string;
|
|
697
|
+
/** Type of the virtual team */
|
|
698
|
+
type: string;
|
|
699
|
+
/** Optional tracking identifier */
|
|
700
|
+
trackingId?: string;
|
|
701
|
+
};
|
|
702
|
+
/**
|
|
703
|
+
* Detailed information about a virtual team configuration
|
|
704
|
+
* @ignore
|
|
705
|
+
*/
|
|
706
|
+
export type VteamDetails = {
|
|
707
|
+
/** Name of the virtual team */
|
|
708
|
+
name: string;
|
|
709
|
+
/** Type of channel handled by the virtual team */
|
|
710
|
+
channelType: string;
|
|
711
|
+
/** Unique identifier for the virtual team */
|
|
712
|
+
id: string;
|
|
713
|
+
/** Type of the virtual team */
|
|
714
|
+
type: string;
|
|
715
|
+
/** ID of the analyzer associated with the team */
|
|
716
|
+
analyzerId: string;
|
|
717
|
+
};
|
|
718
|
+
/**
|
|
719
|
+
* Response type for successful virtual team operations
|
|
720
|
+
* Contains details about virtual teams and their capabilities
|
|
721
|
+
* @ignore
|
|
722
|
+
*/
|
|
723
|
+
export type VTeamSuccess = Msg<{
|
|
724
|
+
/** Response data containing team information */
|
|
725
|
+
data: {
|
|
726
|
+
/** List of virtual team details */
|
|
727
|
+
vteamList: Array<VteamDetails>;
|
|
728
|
+
/** Whether queue consultation is allowed */
|
|
729
|
+
allowConsultToQueue: boolean;
|
|
730
|
+
};
|
|
731
|
+
/** Method name from JavaScript */
|
|
732
|
+
jsMethod: string;
|
|
733
|
+
/** Data related to the call */
|
|
734
|
+
callData: string;
|
|
735
|
+
/** Session ID of the agent */
|
|
736
|
+
agentSessionId: string;
|
|
737
|
+
}>;
|
|
738
|
+
/**
|
|
739
|
+
* Parameters for putting a task on hold or resuming from hold
|
|
740
|
+
* @public
|
|
741
|
+
*/
|
|
742
|
+
export type HoldResumePayload = {
|
|
743
|
+
/** Unique identifier for the media resource to hold/resume */
|
|
744
|
+
mediaResourceId: string;
|
|
745
|
+
};
|
|
746
|
+
/**
|
|
747
|
+
* Parameters for resuming a task's recording
|
|
748
|
+
* @public
|
|
749
|
+
*/
|
|
750
|
+
export type ResumeRecordingPayload = {
|
|
751
|
+
/** Indicates if the recording was automatically resumed */
|
|
752
|
+
autoResumed: boolean;
|
|
753
|
+
};
|
|
754
|
+
/**
|
|
755
|
+
* Parameters for transferring a task to another destination
|
|
756
|
+
* @public
|
|
757
|
+
*/
|
|
758
|
+
export type TransferPayLoad = {
|
|
759
|
+
/** Destination identifier where the task will be transferred to */
|
|
760
|
+
to: string;
|
|
761
|
+
/** Type of the destination (queue, agent, etc.) */
|
|
762
|
+
destinationType: DestinationType;
|
|
763
|
+
};
|
|
764
|
+
/**
|
|
765
|
+
* Parameters for initiating a consultative transfer
|
|
766
|
+
* @public
|
|
767
|
+
*/
|
|
768
|
+
export type ConsultTransferPayLoad = {
|
|
769
|
+
/** Destination identifier for the consultation transfer */
|
|
770
|
+
to: string;
|
|
771
|
+
/** Type of the consultation transfer destination */
|
|
772
|
+
destinationType: ConsultTransferDestinationType;
|
|
773
|
+
};
|
|
774
|
+
/**
|
|
775
|
+
* Parameters for initiating a consultation with another agent or queue
|
|
776
|
+
* @public
|
|
777
|
+
*/
|
|
778
|
+
export type ConsultPayload = {
|
|
779
|
+
/** Destination identifier for the consultation */
|
|
780
|
+
to: string | undefined;
|
|
781
|
+
/** Type of the consultation destination (agent, queue, etc.) */
|
|
782
|
+
destinationType: DestinationType;
|
|
783
|
+
/** Whether to hold other participants during consultation (always true) */
|
|
784
|
+
holdParticipants?: boolean;
|
|
785
|
+
};
|
|
786
|
+
/**
|
|
787
|
+
* Parameters for ending a consultation task
|
|
788
|
+
* @public
|
|
789
|
+
*/
|
|
790
|
+
export type ConsultEndPayload = {
|
|
791
|
+
/** Indicates if this is a consultation operation */
|
|
792
|
+
isConsult: boolean;
|
|
793
|
+
/** Indicates if this involves a secondary entry point or DN agent */
|
|
794
|
+
isSecondaryEpDnAgent?: boolean;
|
|
795
|
+
/** Optional queue identifier for the consultation */
|
|
796
|
+
queueId?: string;
|
|
797
|
+
/** Identifier of the task being consulted */
|
|
798
|
+
taskId: string;
|
|
799
|
+
};
|
|
800
|
+
/**
|
|
801
|
+
* Parameters for transferring a task to another destination
|
|
802
|
+
* @public
|
|
803
|
+
*/
|
|
804
|
+
export type TransferPayload = {
|
|
805
|
+
/** Destination identifier where the task will be transferred */
|
|
806
|
+
to: string | undefined;
|
|
807
|
+
/** Type of the transfer destination */
|
|
808
|
+
destinationType: DestinationType;
|
|
809
|
+
};
|
|
810
|
+
/**
|
|
811
|
+
* API payload for ending a consultation
|
|
812
|
+
* This is the actual payload that is sent to the developer API
|
|
813
|
+
* @public
|
|
814
|
+
*/
|
|
815
|
+
export type ConsultEndAPIPayload = {
|
|
816
|
+
/** Optional identifier of the queue involved in the consultation */
|
|
817
|
+
queueId?: string;
|
|
818
|
+
};
|
|
819
|
+
/**
|
|
820
|
+
* Data required for consulting and conferencing operations
|
|
821
|
+
* @public
|
|
822
|
+
*/
|
|
823
|
+
export type ConsultConferenceData = {
|
|
824
|
+
/** Identifier of the agent initiating consult/conference */
|
|
825
|
+
agentId?: string;
|
|
826
|
+
/** Target destination for the consult/conference */
|
|
827
|
+
to: string | undefined;
|
|
828
|
+
/** Type of destination (e.g., 'agent', 'queue') */
|
|
829
|
+
destinationType: string;
|
|
830
|
+
};
|
|
831
|
+
/**
|
|
832
|
+
* Parameters required for cancelling a consult to queue operation
|
|
833
|
+
* @public
|
|
834
|
+
*/
|
|
835
|
+
export type cancelCtq = {
|
|
836
|
+
/** Identifier of the agent cancelling the CTQ */
|
|
837
|
+
agentId: string;
|
|
838
|
+
/** Identifier of the queue where consult was initiated */
|
|
839
|
+
queueId: string;
|
|
840
|
+
};
|
|
841
|
+
/**
|
|
842
|
+
* Parameters required for declining a task
|
|
843
|
+
* @public
|
|
844
|
+
*/
|
|
845
|
+
export type declinePayload = {
|
|
846
|
+
/** Identifier of the media resource to decline */
|
|
847
|
+
mediaResourceId: string;
|
|
848
|
+
};
|
|
849
|
+
/**
|
|
850
|
+
* Parameters for wrapping up a task with relevant completion details
|
|
851
|
+
* @public
|
|
852
|
+
*/
|
|
853
|
+
export type WrapupPayLoad = {
|
|
854
|
+
/** The reason provided for wrapping up the task */
|
|
855
|
+
wrapUpReason: string;
|
|
856
|
+
/** Auxiliary code identifier associated with the wrap-up state */
|
|
857
|
+
auxCodeId: string;
|
|
858
|
+
};
|
|
859
|
+
/**
|
|
860
|
+
* Configuration parameters for initiating outbound dialer tasks
|
|
861
|
+
* @public
|
|
862
|
+
*/
|
|
863
|
+
export type DialerPayload = {
|
|
864
|
+
/** An entryPointId for respective task */
|
|
865
|
+
entryPointId: string;
|
|
866
|
+
/** A valid customer DN, on which the response is expected, maximum length 36 characters */
|
|
867
|
+
destination: string;
|
|
868
|
+
/** The direction of the call */
|
|
869
|
+
direction: 'OUTBOUND';
|
|
870
|
+
/** Schema-free data tuples to pass specific data based on outboundType (max 30 tuples) */
|
|
871
|
+
attributes: {
|
|
872
|
+
[key: string]: string;
|
|
873
|
+
};
|
|
874
|
+
/** The media type for the request */
|
|
875
|
+
mediaType: 'telephony' | 'chat' | 'social' | 'email';
|
|
876
|
+
/** The outbound type for the task */
|
|
877
|
+
outboundType: 'OUTDIAL' | 'CALLBACK' | 'EXECUTE_FLOW';
|
|
878
|
+
};
|
|
879
|
+
/**
|
|
880
|
+
* Data structure for cleaning up contact resources
|
|
881
|
+
* @public
|
|
882
|
+
*/
|
|
883
|
+
export type ContactCleanupData = {
|
|
884
|
+
/** Type of cleanup operation being performed */
|
|
885
|
+
type: string;
|
|
886
|
+
/** Organization identifier where cleanup is occurring */
|
|
887
|
+
orgId: string;
|
|
888
|
+
/** Identifier of the agent associated with the contacts */
|
|
889
|
+
agentId: string;
|
|
890
|
+
/** Detailed data about the cleanup operation */
|
|
891
|
+
data: {
|
|
892
|
+
/** Type of event that triggered the cleanup */
|
|
893
|
+
eventType: string;
|
|
894
|
+
/** Identifier of the interaction being cleaned up */
|
|
895
|
+
interactionId: string;
|
|
896
|
+
/** Organization identifier */
|
|
897
|
+
orgId: string;
|
|
898
|
+
/** Media manager handling the cleanup */
|
|
899
|
+
mediaMgr: string;
|
|
900
|
+
/** Tracking identifier for the cleanup operation */
|
|
901
|
+
trackingId: string;
|
|
902
|
+
/** Type of media being cleaned up */
|
|
903
|
+
mediaType: string;
|
|
904
|
+
/** Optional destination information */
|
|
905
|
+
destination?: string;
|
|
906
|
+
/** Whether this is a broadcast cleanup */
|
|
907
|
+
broadcast: boolean;
|
|
908
|
+
/** Type of cleanup being performed */
|
|
909
|
+
type: string;
|
|
910
|
+
};
|
|
911
|
+
};
|
|
912
|
+
/**
|
|
913
|
+
* Response type for task public methods
|
|
914
|
+
* Can be an {@link AgentContact} object containing updated task state,
|
|
915
|
+
* an Error in case of failure, or void for operations that don't return data
|
|
916
|
+
* @public
|
|
917
|
+
*/
|
|
918
|
+
export type TaskResponse = AgentContact | Error | void;
|
|
919
|
+
/**
|
|
920
|
+
* Interface for managing task-related operations in the contact center
|
|
921
|
+
* Extends EventEmitter to support event-driven task updates
|
|
922
|
+
*/
|
|
923
|
+
export interface ITask extends EventEmitter {
|
|
924
|
+
/**
|
|
925
|
+
* Event data received in the Contact Center events.
|
|
926
|
+
* Contains detailed task information including interaction details, media resources,
|
|
927
|
+
* and participant data as defined in {@link TaskData}
|
|
928
|
+
*/
|
|
929
|
+
data: TaskData;
|
|
930
|
+
/**
|
|
931
|
+
* Map associating tasks with their corresponding call identifiers.
|
|
932
|
+
*/
|
|
933
|
+
webCallMap: Record<TaskId, CallId>;
|
|
934
|
+
/**
|
|
935
|
+
* Auto-wrapup timer for the task
|
|
936
|
+
* This is used to automatically wrap up tasks after a specified duration
|
|
937
|
+
* as defined in {@link AutoWrapup}
|
|
938
|
+
*/
|
|
939
|
+
autoWrapup?: AutoWrapup;
|
|
940
|
+
/**
|
|
941
|
+
* cancels the auto-wrapup timer for the task
|
|
942
|
+
* This method stops the auto-wrapup process if it is currently active
|
|
943
|
+
* Note: This is supported only in single session mode. Not supported in multi-session mode.
|
|
944
|
+
* @returns void
|
|
945
|
+
*/
|
|
946
|
+
cancelAutoWrapupTimer(): void;
|
|
947
|
+
/**
|
|
948
|
+
* Deregisters all web call event listeners
|
|
949
|
+
* Used when cleaning up task resources
|
|
950
|
+
* @ignore
|
|
951
|
+
*/
|
|
952
|
+
unregisterWebCallListeners(): void;
|
|
953
|
+
/**
|
|
954
|
+
* Updates the task data with new information
|
|
955
|
+
* @param newData - Updated task data to apply, must conform to {@link TaskData} structure
|
|
956
|
+
* @returns Updated task instance
|
|
957
|
+
* @ignore
|
|
958
|
+
*/
|
|
959
|
+
updateTaskData(newData: TaskData): ITask;
|
|
960
|
+
/**
|
|
961
|
+
* Answers or accepts an incoming task.
|
|
962
|
+
* Once accepted, the task will be assigned to the agent and trigger a {@link TASK_EVENTS.TASK_ASSIGNED} event.
|
|
963
|
+
* The response will contain updated agent contact information as defined in {@link AgentContact}.
|
|
964
|
+
* @returns Promise<TaskResponse>
|
|
965
|
+
* @example
|
|
966
|
+
* ```typescript
|
|
967
|
+
* task.accept();
|
|
968
|
+
* ```
|
|
969
|
+
*/
|
|
970
|
+
accept(): Promise<TaskResponse>;
|
|
971
|
+
/**
|
|
972
|
+
* Declines an incoming task for Browser Login
|
|
973
|
+
* @returns Promise<TaskResponse>
|
|
974
|
+
* @example
|
|
975
|
+
* ```typescript
|
|
976
|
+
* task.decline();
|
|
977
|
+
* ```
|
|
978
|
+
*/
|
|
979
|
+
decline(): Promise<TaskResponse>;
|
|
980
|
+
/**
|
|
981
|
+
* Places the current task on hold
|
|
982
|
+
* @returns Promise<TaskResponse>
|
|
983
|
+
* @example
|
|
984
|
+
* ```typescript
|
|
985
|
+
* task.hold();
|
|
986
|
+
* ```
|
|
987
|
+
*/
|
|
988
|
+
hold(): Promise<TaskResponse>;
|
|
989
|
+
/**
|
|
990
|
+
* Resumes a task that was previously on hold
|
|
991
|
+
* @returns Promise<TaskResponse>
|
|
992
|
+
* @example
|
|
993
|
+
* ```typescript
|
|
994
|
+
* task.resume();
|
|
995
|
+
* ```
|
|
996
|
+
*/
|
|
997
|
+
resume(): Promise<TaskResponse>;
|
|
998
|
+
/**
|
|
999
|
+
* Ends/terminates the current task
|
|
1000
|
+
* @returns Promise<TaskResponse>
|
|
1001
|
+
* @example
|
|
1002
|
+
* ```typescript
|
|
1003
|
+
* task.end();
|
|
1004
|
+
* ```
|
|
1005
|
+
*/
|
|
1006
|
+
end(): Promise<TaskResponse>;
|
|
1007
|
+
/**
|
|
1008
|
+
* Initiates wrap-up process for the task with specified details
|
|
1009
|
+
* @param wrapupPayload - Wrap-up details including reason and auxiliary code
|
|
1010
|
+
* @returns Promise<TaskResponse>
|
|
1011
|
+
* @example
|
|
1012
|
+
* ```typescript
|
|
1013
|
+
* task.wrapup({
|
|
1014
|
+
* wrapUpReason: "Customer issue resolved",
|
|
1015
|
+
* auxCodeId: "RESOLVED"
|
|
1016
|
+
* });
|
|
1017
|
+
* ```
|
|
1018
|
+
*/
|
|
1019
|
+
wrapup(wrapupPayload: WrapupPayLoad): Promise<TaskResponse>;
|
|
1020
|
+
/**
|
|
1021
|
+
* Pauses the recording for current task
|
|
1022
|
+
* @returns Promise<TaskResponse>
|
|
1023
|
+
* @example
|
|
1024
|
+
* ```typescript
|
|
1025
|
+
* task.pauseRecording();
|
|
1026
|
+
* ```
|
|
1027
|
+
*/
|
|
1028
|
+
pauseRecording(): Promise<TaskResponse>;
|
|
1029
|
+
/**
|
|
1030
|
+
* Resumes a previously paused recording
|
|
1031
|
+
* @param resumeRecordingPayload - Parameters for resuming the recording
|
|
1032
|
+
* @returns Promise<TaskResponse>
|
|
1033
|
+
* @example
|
|
1034
|
+
* ```typescript
|
|
1035
|
+
* task.resumeRecording({
|
|
1036
|
+
* autoResumed: false
|
|
1037
|
+
* });
|
|
1038
|
+
* ```
|
|
1039
|
+
*/
|
|
1040
|
+
resumeRecording(resumeRecordingPayload: ResumeRecordingPayload): Promise<TaskResponse>;
|
|
1041
|
+
}
|