@webex/contact-center 3.11.0 → 3.12.0-mobius-socket.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.
Files changed (126) hide show
  1. package/dist/cc.js +121 -28
  2. package/dist/cc.js.map +1 -1
  3. package/dist/constants.js +5 -1
  4. package/dist/constants.js.map +1 -1
  5. package/dist/index.js +7 -0
  6. package/dist/index.js.map +1 -1
  7. package/dist/metrics/behavioral-events.js +13 -0
  8. package/dist/metrics/behavioral-events.js.map +1 -1
  9. package/dist/metrics/constants.js +9 -1
  10. package/dist/metrics/constants.js.map +1 -1
  11. package/dist/services/ApiAiAssistant.js +173 -0
  12. package/dist/services/ApiAiAssistant.js.map +1 -0
  13. package/dist/services/agent/types.js.map +1 -1
  14. package/dist/services/config/Util.js +6 -2
  15. package/dist/services/config/Util.js.map +1 -1
  16. package/dist/services/config/constants.js +12 -0
  17. package/dist/services/config/constants.js.map +1 -1
  18. package/dist/services/config/index.js +41 -2
  19. package/dist/services/config/index.js.map +1 -1
  20. package/dist/services/config/types.js +19 -1
  21. package/dist/services/config/types.js.map +1 -1
  22. package/dist/services/constants.js +27 -1
  23. package/dist/services/constants.js.map +1 -1
  24. package/dist/services/core/Err.js.map +1 -1
  25. package/dist/services/core/Utils.js +28 -6
  26. package/dist/services/core/Utils.js.map +1 -1
  27. package/dist/services/core/aqm-reqs.js +92 -17
  28. package/dist/services/core/aqm-reqs.js.map +1 -1
  29. package/dist/services/core/websocket/WebSocketManager.js +20 -5
  30. package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
  31. package/dist/services/core/websocket/connection-service.js +3 -1
  32. package/dist/services/core/websocket/connection-service.js.map +1 -1
  33. package/dist/services/index.js +6 -0
  34. package/dist/services/index.js.map +1 -1
  35. package/dist/services/task/TaskManager.js +117 -24
  36. package/dist/services/task/TaskManager.js.map +1 -1
  37. package/dist/services/task/TaskUtils.js +16 -3
  38. package/dist/services/task/TaskUtils.js.map +1 -1
  39. package/dist/services/task/constants.js +15 -1
  40. package/dist/services/task/constants.js.map +1 -1
  41. package/dist/services/task/dialer.js +51 -0
  42. package/dist/services/task/dialer.js.map +1 -1
  43. package/dist/services/task/types.js +15 -0
  44. package/dist/services/task/types.js.map +1 -1
  45. package/dist/types/cc.d.ts +801 -0
  46. package/dist/types/config.d.ts +66 -0
  47. package/dist/types/constants.d.ts +50 -0
  48. package/dist/types/index.d.ts +184 -0
  49. package/dist/types/logger-proxy.d.ts +71 -0
  50. package/dist/types/metrics/MetricsManager.d.ts +223 -0
  51. package/dist/types/metrics/behavioral-events.d.ts +29 -0
  52. package/dist/types/metrics/constants.d.ts +161 -0
  53. package/dist/types/services/AddressBook.d.ts +74 -0
  54. package/dist/types/services/ApiAiAssistant.d.ts +31 -0
  55. package/dist/types/services/EntryPoint.d.ts +67 -0
  56. package/dist/types/services/Queue.d.ts +76 -0
  57. package/dist/types/services/WebCallingService.d.ts +1 -0
  58. package/dist/types/services/agent/index.d.ts +46 -0
  59. package/dist/types/services/agent/types.d.ts +413 -0
  60. package/dist/types/services/config/Util.d.ts +20 -0
  61. package/dist/types/services/config/constants.d.ts +249 -0
  62. package/dist/types/services/config/index.d.ts +177 -0
  63. package/dist/types/services/config/types.d.ts +1207 -0
  64. package/dist/types/services/constants.d.ts +110 -0
  65. package/dist/types/services/core/Err.d.ts +121 -0
  66. package/dist/types/services/core/GlobalTypes.d.ts +58 -0
  67. package/dist/types/services/core/Utils.d.ts +101 -0
  68. package/dist/types/services/core/WebexRequest.d.ts +22 -0
  69. package/dist/types/services/core/aqm-reqs.d.ts +65 -0
  70. package/dist/types/services/core/constants.d.ts +99 -0
  71. package/dist/types/services/core/types.d.ts +47 -0
  72. package/dist/types/services/core/websocket/WebSocketManager.d.ts +35 -0
  73. package/dist/types/services/core/websocket/connection-service.d.ts +27 -0
  74. package/dist/types/services/core/websocket/keepalive.worker.d.ts +2 -0
  75. package/dist/types/services/core/websocket/types.d.ts +37 -0
  76. package/dist/types/services/index.d.ts +54 -0
  77. package/dist/types/services/task/AutoWrapup.d.ts +40 -0
  78. package/dist/types/services/task/TaskManager.d.ts +1 -0
  79. package/dist/types/services/task/TaskUtils.d.ts +92 -0
  80. package/dist/types/services/task/constants.d.ts +84 -0
  81. package/dist/types/services/task/contact.d.ts +69 -0
  82. package/dist/types/services/task/dialer.d.ts +43 -0
  83. package/dist/types/services/task/index.d.ts +650 -0
  84. package/dist/types/services/task/types.d.ts +1319 -0
  85. package/dist/types/types.d.ts +643 -0
  86. package/dist/types/utils/PageCache.d.ts +173 -0
  87. package/dist/types/webex-config.d.ts +53 -0
  88. package/dist/types/webex.d.ts +7 -0
  89. package/dist/types.js +14 -1
  90. package/dist/types.js.map +1 -1
  91. package/dist/webex.js +1 -1
  92. package/package.json +9 -9
  93. package/src/cc.ts +157 -30
  94. package/src/constants.ts +4 -0
  95. package/src/index.ts +1 -0
  96. package/src/metrics/behavioral-events.ts +14 -0
  97. package/src/metrics/constants.ts +11 -0
  98. package/src/services/ApiAiAssistant.ts +217 -0
  99. package/src/services/agent/types.ts +1 -1
  100. package/src/services/config/Util.ts +8 -0
  101. package/src/services/config/constants.ts +12 -0
  102. package/src/services/config/index.ts +45 -1
  103. package/src/services/config/types.ts +67 -0
  104. package/src/services/constants.ts +29 -0
  105. package/src/services/core/Err.ts +1 -0
  106. package/src/services/core/Utils.ts +32 -5
  107. package/src/services/core/aqm-reqs.ts +100 -22
  108. package/src/services/core/websocket/WebSocketManager.ts +21 -6
  109. package/src/services/core/websocket/connection-service.ts +5 -1
  110. package/src/services/index.ts +4 -0
  111. package/src/services/task/TaskManager.ts +174 -27
  112. package/src/services/task/TaskUtils.ts +12 -0
  113. package/src/services/task/constants.ts +16 -0
  114. package/src/services/task/dialer.ts +56 -1
  115. package/src/services/task/types.ts +24 -0
  116. package/src/types.ts +40 -1
  117. package/test/unit/spec/cc.ts +163 -23
  118. package/test/unit/spec/services/ApiAiAssistant.ts +115 -0
  119. package/test/unit/spec/services/config/index.ts +56 -0
  120. package/test/unit/spec/services/core/Utils.ts +63 -1
  121. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +82 -12
  122. package/test/unit/spec/services/core/websocket/connection-service.ts +3 -1
  123. package/test/unit/spec/services/task/TaskManager.ts +1119 -251
  124. package/test/unit/spec/services/task/dialer.ts +198 -112
  125. package/umd/contact-center.min.js +2 -2
  126. package/umd/contact-center.min.js.map +1 -1
@@ -0,0 +1,1319 @@
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 an outdial call fails
318
+ * @example
319
+ * ```typescript
320
+ * task.on(TASK_EVENTS.TASK_OUTDIAL_FAILED, (reason: string) => {
321
+ * console.log('Outdial failed:', reason);
322
+ * // Handle outdial failure
323
+ * });
324
+ * ```
325
+ */
326
+ TASK_OUTDIAL_FAILED = "task:outdialFailed",
327
+ /**
328
+ * Triggered when a task is populated with data
329
+ * @example
330
+ * ```typescript
331
+ * task.on(TASK_EVENTS.TASK_HYDRATE, (task: ITask) => {
332
+ * console.log('Task hydrated:', task.data.interactionId);
333
+ * // Process task data
334
+ * });
335
+ * ```
336
+ */
337
+ TASK_HYDRATE = "task:hydrate",
338
+ /**
339
+ * Triggered when a new contact is offered
340
+ * @example
341
+ * ```typescript
342
+ * task.on(TASK_EVENTS.TASK_OFFER_CONTACT, (task: ITask) => {
343
+ * console.log('Contact offered:', task.data.interactionId);
344
+ * // Handle contact offer
345
+ * });
346
+ * ```
347
+ */
348
+ TASK_OFFER_CONTACT = "task:offerContact",
349
+ /**
350
+ * Triggered when a task has been successfully auto-answered
351
+ * This event is emitted after the SDK automatically accepts a task due to:
352
+ * - WebRTC calls with auto-answer enabled
353
+ * - Agent-initiated outdial calls
354
+ * - Other auto-answer scenarios
355
+ * @example
356
+ * ```typescript
357
+ * task.on(TASK_EVENTS.TASK_AUTO_ANSWERED, (task: ITask) => {
358
+ * console.log('Task auto-answered:', task.data.interactionId);
359
+ * // Update UI - enable cancel button, etc.
360
+ * });
361
+ * ```
362
+ */
363
+ TASK_AUTO_ANSWERED = "task:autoAnswered",
364
+ /**
365
+ * Triggered when a conference is being established
366
+ * @example
367
+ * ```typescript
368
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_ESTABLISHING, (task: ITask) => {
369
+ * console.log('Conference establishing:', task.data.interactionId);
370
+ * // Handle conference setup in progress
371
+ * });
372
+ * ```
373
+ */
374
+ TASK_CONFERENCE_ESTABLISHING = "task:conferenceEstablishing",
375
+ /**
376
+ * Triggered when a conference is started successfully
377
+ * @example
378
+ * ```typescript
379
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_STARTED, (task: ITask) => {
380
+ * console.log('Conference started:', task.data.interactionId);
381
+ * // Handle conference start
382
+ * });
383
+ * ```
384
+ */
385
+ TASK_CONFERENCE_STARTED = "task:conferenceStarted",
386
+ /**
387
+ * Triggered when a conference fails to start
388
+ * @example
389
+ * ```typescript
390
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_FAILED, (task: ITask) => {
391
+ * console.log('Conference failed:', task.data.interactionId);
392
+ * // Handle conference failure
393
+ * });
394
+ * ```
395
+ */
396
+ TASK_CONFERENCE_FAILED = "task:conferenceFailed",
397
+ /**
398
+ * Triggered when a conference is ended successfully
399
+ * @example
400
+ * ```typescript
401
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_ENDED, (task: ITask) => {
402
+ * console.log('Conference ended:', task.data.interactionId);
403
+ * // Handle conference end
404
+ * });
405
+ * ```
406
+ */
407
+ TASK_CONFERENCE_ENDED = "task:conferenceEnded",
408
+ /**
409
+ * Triggered when a participant joins the conference
410
+ * @example
411
+ * ```typescript
412
+ * task.on(TASK_EVENTS.TASK_PARTICIPANT_JOINED, (task: ITask) => {
413
+ * console.log('Participant joined conference:', task.data.interactionId);
414
+ * // Handle participant joining
415
+ * });
416
+ * ```
417
+ */
418
+ TASK_PARTICIPANT_JOINED = "task:participantJoined",
419
+ /**
420
+ * Triggered when a participant leaves the conference
421
+ * @example
422
+ * ```typescript
423
+ * task.on(TASK_EVENTS.TASK_PARTICIPANT_LEFT, (task: ITask) => {
424
+ * console.log('Participant left conference:', task.data.interactionId);
425
+ * // Handle participant leaving
426
+ * });
427
+ * ```
428
+ */
429
+ TASK_PARTICIPANT_LEFT = "task:participantLeft",
430
+ /**
431
+ * Triggered when conference transfer is successful
432
+ * @example
433
+ * ```typescript
434
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_TRANSFERRED, (task: ITask) => {
435
+ * console.log('Conference transferred:', task.data.interactionId);
436
+ * // Handle successful conference transfer
437
+ * });
438
+ * ```
439
+ */
440
+ TASK_CONFERENCE_TRANSFERRED = "task:conferenceTransferred",
441
+ /**
442
+ * Triggered when conference transfer fails
443
+ * @example
444
+ * ```typescript
445
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_TRANSFER_FAILED, (task: ITask) => {
446
+ * console.log('Conference transfer failed:', task.data.interactionId);
447
+ * // Handle failed conference transfer
448
+ * });
449
+ * ```
450
+ */
451
+ TASK_CONFERENCE_TRANSFER_FAILED = "task:conferenceTransferFailed",
452
+ /**
453
+ * Triggered when ending a conference fails
454
+ * @example
455
+ * ```typescript
456
+ * task.on(TASK_EVENTS.TASK_CONFERENCE_END_FAILED, (task: ITask) => {
457
+ * console.log('Conference end failed:', task.data.interactionId);
458
+ * // Handle failed conference end
459
+ * });
460
+ * ```
461
+ */
462
+ TASK_CONFERENCE_END_FAILED = "task:conferenceEndFailed",
463
+ /**
464
+ * Triggered when participant exit from conference fails
465
+ * @example
466
+ * ```typescript
467
+ * task.on(TASK_EVENTS.TASK_PARTICIPANT_LEFT_FAILED, (task: ITask) => {
468
+ * console.log('Participant failed to leave conference:', task.data.interactionId);
469
+ * // Handle failed participant exit
470
+ * });
471
+ * ```
472
+ */
473
+ TASK_PARTICIPANT_LEFT_FAILED = "task:participantLeftFailed",
474
+ /**
475
+ * Triggered when a contact is merged
476
+ * @example
477
+ * ```typescript
478
+ * task.on(TASK_EVENTS.TASK_MERGED, (task: ITask) => {
479
+ * console.log('Contact merged:', task.data.interactionId);
480
+ * // Handle contact merge
481
+ * });
482
+ * ```
483
+ */
484
+ TASK_MERGED = "task:merged",
485
+ /**
486
+ * Triggered when a participant enters post-call activity state
487
+ * @example
488
+ * ```typescript
489
+ * task.on(TASK_EVENTS.TASK_POST_CALL_ACTIVITY, (task: ITask) => {
490
+ * console.log('Participant in post-call activity:', task.data.interactionId);
491
+ * // Handle post-call activity
492
+ * });
493
+ * ```
494
+ */
495
+ TASK_POST_CALL_ACTIVITY = "task:postCallActivity",
496
+ /**
497
+ * Triggered when a campaign preview contact is offered to the agent
498
+ * @example
499
+ * ```typescript
500
+ * task.on(TASK_EVENTS.TASK_CAMPAIGN_PREVIEW_RESERVATION, (data: AgentContact) => {
501
+ * console.log('Campaign preview contact received:', data.interactionId);
502
+ * // Handle campaign preview reservation
503
+ * });
504
+ * ```
505
+ */
506
+ TASK_CAMPAIGN_PREVIEW_RESERVATION = "task:campaignPreviewReservation"
507
+ }
508
+ /**
509
+ * Represents a customer interaction within the contact center system
510
+ * Contains comprehensive details about an ongoing customer interaction
511
+ * @public
512
+ */
513
+ export type Interaction = {
514
+ /** Indicates if the interaction is managed by Flow Control */
515
+ isFcManaged: boolean;
516
+ /** Indicates if the interaction has been terminated */
517
+ isTerminated: boolean;
518
+ /** The type of media channel for this interaction */
519
+ mediaType: MEDIA_CHANNEL;
520
+ /** List of previous virtual teams that handled this interaction */
521
+ previousVTeams: string[];
522
+ /** Current state of the interaction */
523
+ state: string;
524
+ /** Current virtual team handling the interaction */
525
+ currentVTeam: string;
526
+ /** List of participants in the interaction */
527
+ participants: any;
528
+ /** Unique identifier for the interaction */
529
+ interactionId: string;
530
+ /** Organization identifier */
531
+ orgId: string;
532
+ /** Timestamp when the interaction was created */
533
+ createdTimestamp?: number;
534
+ /** Indicates if wrap-up assistance is enabled */
535
+ isWrapUpAssist?: boolean;
536
+ /** Detailed call processing information and metadata */
537
+ callProcessingDetails: {
538
+ /** Name of the Queue Manager handling this interaction */
539
+ QMgrName: string;
540
+ /** Indicates if the task should be self-serviced */
541
+ taskToBeSelfServiced: string;
542
+ /** Automatic Number Identification (caller's number) */
543
+ ani: string;
544
+ /** Display version of the ANI */
545
+ displayAni: string;
546
+ /** Dialed Number Identification Service number */
547
+ dnis: string;
548
+ /** Tenant identifier */
549
+ tenantId: string;
550
+ /** Queue identifier */
551
+ QueueId: string;
552
+ /** Virtual team identifier */
553
+ vteamId: string;
554
+ /** Indicates if pause/resume functionality is enabled */
555
+ pauseResumeEnabled?: string;
556
+ /** Duration of pause in seconds */
557
+ pauseDuration?: string;
558
+ /** Indicates if the interaction is currently paused */
559
+ isPaused?: string;
560
+ /** Indicates if recording is in progress */
561
+ recordInProgress?: string;
562
+ /** Indicates if recording has started */
563
+ recordingStarted?: string;
564
+ /** Indicates if Consult to Queue is in progress */
565
+ ctqInProgress?: string;
566
+ /** Indicates if outdial transfer to queue is enabled */
567
+ outdialTransferToQueueEnabled?: string;
568
+ /** IVR conversation transcript */
569
+ convIvrTranscript?: string;
570
+ /** Customer's name */
571
+ customerName: string;
572
+ /** Name of the virtual team */
573
+ virtualTeamName: string;
574
+ /** RONA (Redirection on No Answer) timeout in seconds */
575
+ ronaTimeout: string;
576
+ /** Category of the interaction */
577
+ category: string;
578
+ /** Reason for the interaction */
579
+ reason: string;
580
+ /** Source number for the interaction */
581
+ sourceNumber: string;
582
+ /** Source page that initiated the interaction */
583
+ sourcePage: string;
584
+ /** Application user identifier */
585
+ appUser: string;
586
+ /** Customer's contact number */
587
+ customerNumber: string;
588
+ /** Code indicating the reason for interaction */
589
+ reasonCode: string;
590
+ /** Path taken through the IVR system */
591
+ IvrPath: string;
592
+ /** Identifier for the IVR path */
593
+ pathId: string;
594
+ /** Email address or contact point that initiated the interaction */
595
+ fromAddress: string;
596
+ /** Identifier of the parent interaction for related interactions */
597
+ parentInteractionId?: string;
598
+ /** Identifier of the child interaction for related interactions */
599
+ childInteractionId?: string;
600
+ /** Type of relationship between parent and child interactions */
601
+ relationshipType?: string;
602
+ /** ANI of the parent interaction */
603
+ parent_ANI?: string;
604
+ /** DNIS of the parent interaction */
605
+ parent_DNIS?: string;
606
+ /** Indicates if the consulted destination agent has joined */
607
+ consultDestinationAgentJoined?: boolean | string;
608
+ /** Name of the destination agent for consultation */
609
+ consultDestinationAgentName?: string;
610
+ /** DN of the parent interaction's agent */
611
+ parent_Agent_DN?: string;
612
+ /** Name of the parent interaction's agent */
613
+ parent_Agent_Name?: string;
614
+ /** Team name of the parent interaction's agent */
615
+ parent_Agent_TeamName?: string;
616
+ /** Indicates if the interaction is in conference mode */
617
+ isConferencing?: string;
618
+ /** Type of monitoring being performed */
619
+ monitorType?: string;
620
+ /** Name of the workflow being executed */
621
+ workflowName?: string;
622
+ /** Identifier of the workflow */
623
+ workflowId?: string;
624
+ /** Indicates if monitoring is in invisible mode */
625
+ monitoringInvisibleMode?: string;
626
+ /** Identifier for the monitoring request */
627
+ monitoringRequestId?: string;
628
+ /** Timeout for participant invitation */
629
+ participantInviteTimeout?: string;
630
+ /** Filename for music on hold */
631
+ mohFileName?: string;
632
+ /** Flag for continuing recording during transfer */
633
+ CONTINUE_RECORDING_ON_TRANSFER?: string;
634
+ /** Entry point identifier */
635
+ EP_ID?: string;
636
+ /** Type of routing being used */
637
+ ROUTING_TYPE?: string;
638
+ /** Events registered with Flow Control Engine */
639
+ fceRegisteredEvents?: string;
640
+ /** Indicates if the interaction is parked */
641
+ isParked?: string;
642
+ /** Priority level of the interaction */
643
+ priority?: string;
644
+ /** Identifier for the routing strategy */
645
+ routingStrategyId?: string;
646
+ /** Current state of monitoring */
647
+ monitoringState?: string;
648
+ /** Indicates if blind transfer is in progress */
649
+ BLIND_TRANSFER_IN_PROGRESS?: boolean;
650
+ /** Desktop view configuration for Flow Control */
651
+ fcDesktopView?: string;
652
+ /** Agent ID who initiated the outdial call */
653
+ outdialAgentId?: string;
654
+ };
655
+ /** Main interaction identifier for related interactions */
656
+ mainInteractionId?: string;
657
+ /** Media-specific information for the interaction */
658
+ media: Record<string, {
659
+ /** Unique identifier for the media resource */
660
+ mediaResourceId: string;
661
+ /** Type of media channel */
662
+ mediaType: MEDIA_CHANNEL;
663
+ /** Media manager handling this media */
664
+ mediaMgr: string;
665
+ /** List of participant identifiers */
666
+ participants: string[];
667
+ /** Type of media */
668
+ mType: string;
669
+ /** Indicates if media is on hold */
670
+ isHold: boolean;
671
+ /** Timestamp when media was put on hold */
672
+ holdTimestamp: number | null;
673
+ }>;
674
+ /** Owner of the interaction */
675
+ owner: string;
676
+ /** Primary media channel for the interaction */
677
+ mediaChannel: MEDIA_CHANNEL;
678
+ /** Direction information for the contact */
679
+ contactDirection: {
680
+ type: string;
681
+ };
682
+ /** Type of outbound interaction */
683
+ outboundType?: string;
684
+ /** Parameters passed through the call flow */
685
+ callFlowParams: Record<string, {
686
+ /** Name of the parameter */
687
+ name: string;
688
+ /** Qualifier for the parameter */
689
+ qualifier: string;
690
+ /** Description of the parameter */
691
+ description: string;
692
+ /** Data type of the parameter value */
693
+ valueDataType: string;
694
+ /** Value of the parameter */
695
+ value: string;
696
+ }>;
697
+ };
698
+ /**
699
+ * Task payload containing detailed information about a contact center task
700
+ * This structure encapsulates all relevant data for task management
701
+ * @public
702
+ */
703
+ export type TaskData = {
704
+ /** Unique identifier for the media resource handling this task */
705
+ mediaResourceId: string;
706
+ /** Type of event that triggered this task data */
707
+ eventType: string;
708
+ /** Timestamp when the event occurred */
709
+ eventTime?: number;
710
+ /** Identifier of the agent handling the task */
711
+ agentId: string;
712
+ /** Identifier of the destination agent for transfers/consults */
713
+ destAgentId: string;
714
+ /** Unique tracking identifier for the task */
715
+ trackingId: string;
716
+ /** Media resource identifier for consultation operations */
717
+ consultMediaResourceId: string;
718
+ /** Detailed interaction information */
719
+ interaction: Interaction;
720
+ /** Unique identifier for the participant */
721
+ participantId?: string;
722
+ /** Indicates if the task is from the owner */
723
+ fromOwner?: boolean;
724
+ /** Indicates if the task is to the owner */
725
+ toOwner?: boolean;
726
+ /** Identifier for child interaction in consult/transfer scenarios */
727
+ childInteractionId?: string;
728
+ /** Unique identifier for the interaction */
729
+ interactionId: string;
730
+ /** Organization identifier */
731
+ orgId: string;
732
+ /** Current owner of the task */
733
+ owner: string;
734
+ /** Queue manager handling the task */
735
+ queueMgr: string;
736
+ /** Name of the queue where task is queued */
737
+ queueName?: string;
738
+ /** Type of the task */
739
+ type: string;
740
+ /** Timeout value for RONA (Redirection on No Answer) in seconds */
741
+ ronaTimeout?: number;
742
+ /** Indicates if the task is in consultation state */
743
+ isConsulted?: boolean;
744
+ /** Indicates if the task is in conference state */
745
+ isConferencing: boolean;
746
+ /** Indicates if a conference is currently in progress (2+ active agents) */
747
+ isConferenceInProgress?: boolean;
748
+ /** Identifier of agent who last updated the task */
749
+ updatedBy?: string;
750
+ /** Type of destination for transfer/consult */
751
+ destinationType?: string;
752
+ /** Indicates if the task was automatically resumed */
753
+ autoResumed?: boolean;
754
+ /** Code indicating the reason for an action */
755
+ reasonCode?: string | number;
756
+ /** Description of the reason for an action */
757
+ reason?: string;
758
+ /** Identifier of the consulting agent */
759
+ consultingAgentId?: string;
760
+ /** Unique identifier for the task */
761
+ taskId?: string;
762
+ /** Task details including state and media information */
763
+ task?: Interaction;
764
+ /** Unique identifier for monitoring offered events */
765
+ id?: string;
766
+ /** Indicates if the web call is muted */
767
+ isWebCallMute?: boolean;
768
+ /** Identifier for reservation interaction */
769
+ reservationInteractionId?: string;
770
+ /** Identifier for the reserved agent channel (used for campaign tasks) */
771
+ reservedAgentChannelId?: string;
772
+ /** Indicates if wrap-up is required for this task */
773
+ wrapUpRequired?: boolean;
774
+ /** Indicates if auto-answer is in progress for this task */
775
+ isAutoAnswering?: boolean;
776
+ /** Indicates if wrap-up is required for this task */
777
+ agentsPendingWrapUp?: string[];
778
+ };
779
+ /**
780
+ * Type representing an agent contact message within the contact center system
781
+ * Contains comprehensive interaction and task related details for agent operations
782
+ * @public
783
+ */
784
+ export type AgentContact = Msg<{
785
+ /** Unique identifier for the media resource */
786
+ mediaResourceId: string;
787
+ /** Type of the event (e.g., 'AgentDesktopMessage') */
788
+ eventType: string;
789
+ /** Timestamp when the event occurred */
790
+ eventTime?: number;
791
+ /** Unique identifier of the agent handling the contact */
792
+ agentId: string;
793
+ /** Identifier of the destination agent for transfers/consults */
794
+ destAgentId: string;
795
+ /** Unique tracking identifier for the contact */
796
+ trackingId: string;
797
+ /** Media resource identifier for consult operations */
798
+ consultMediaResourceId: string;
799
+ /** Detailed interaction information including media and participant data */
800
+ interaction: Interaction;
801
+ /** Unique identifier for the participant */
802
+ participantId?: string;
803
+ /** Indicates if the message is from the owner of the interaction */
804
+ fromOwner?: boolean;
805
+ /** Indicates if the message is to the owner of the interaction */
806
+ toOwner?: boolean;
807
+ /** Identifier for child interaction in case of consult/transfer */
808
+ childInteractionId?: string;
809
+ /** Unique identifier for the interaction */
810
+ interactionId: string;
811
+ /** Organization identifier */
812
+ orgId: string;
813
+ /** Current owner of the interaction */
814
+ owner: string;
815
+ /** Queue manager handling the interaction */
816
+ queueMgr: string;
817
+ /** Name of the queue where interaction is queued */
818
+ queueName?: string;
819
+ /** Type of the contact/interaction */
820
+ type: string;
821
+ /** Timeout value for RONA (Redirection on No Answer) in seconds */
822
+ ronaTimeout?: number;
823
+ /** Indicates if the interaction is in consult state */
824
+ isConsulted?: boolean;
825
+ /** Indicates if the interaction is in conference state */
826
+ isConferencing: boolean;
827
+ /** Identifier of the agent who last updated the interaction */
828
+ updatedBy?: string;
829
+ /** Type of destination for transfer/consult */
830
+ destinationType?: string;
831
+ /** Indicates if the interaction was automatically resumed */
832
+ autoResumed?: boolean;
833
+ /** Code indicating the reason for an action */
834
+ reasonCode?: string | number;
835
+ /** Description of the reason for an action */
836
+ reason?: string;
837
+ /** Identifier of the consulting agent */
838
+ consultingAgentId?: string;
839
+ /** Unique identifier for the task */
840
+ taskId?: string;
841
+ /** Task details including media and state information */
842
+ task?: Interaction;
843
+ /** Identifier of the supervisor monitoring the interaction */
844
+ supervisorId?: string;
845
+ /** Type of monitoring (e.g., 'SILENT', 'BARGE_IN') */
846
+ monitorType?: string;
847
+ /** Dial number of the supervisor */
848
+ supervisorDN?: string;
849
+ /** Unique identifier for monitoring offered events */
850
+ id?: string;
851
+ /** Indicates if the web call is muted */
852
+ isWebCallMute?: boolean;
853
+ /** Identifier for reservation interaction */
854
+ reservationInteractionId?: string;
855
+ /** Identifier for the reserved agent channel */
856
+ reservedAgentChannelId?: string;
857
+ /** Current monitoring state information */
858
+ monitoringState?: {
859
+ /** Type of monitoring state */
860
+ type: string;
861
+ };
862
+ /** Name of the supervisor monitoring the interaction */
863
+ supervisorName?: string;
864
+ }>;
865
+ /**
866
+ * Information about a virtual team in the contact center
867
+ * @ignore
868
+ */
869
+ export type VTeam = {
870
+ /** Profile ID of the agent in the virtual team */
871
+ agentProfileId: string;
872
+ /** Session ID of the agent in the virtual team */
873
+ agentSessionId: string;
874
+ /** Type of channel handled by the virtual team */
875
+ channelType: string;
876
+ /** Type of the virtual team */
877
+ type: string;
878
+ /** Optional tracking identifier */
879
+ trackingId?: string;
880
+ };
881
+ /**
882
+ * Detailed information about a virtual team configuration
883
+ * @ignore
884
+ */
885
+ export type VteamDetails = {
886
+ /** Name of the virtual team */
887
+ name: string;
888
+ /** Type of channel handled by the virtual team */
889
+ channelType: string;
890
+ /** Unique identifier for the virtual team */
891
+ id: string;
892
+ /** Type of the virtual team */
893
+ type: string;
894
+ /** ID of the analyzer associated with the team */
895
+ analyzerId: string;
896
+ };
897
+ /**
898
+ * Response type for successful virtual team operations
899
+ * Contains details about virtual teams and their capabilities
900
+ * @ignore
901
+ */
902
+ export type VTeamSuccess = Msg<{
903
+ /** Response data containing team information */
904
+ data: {
905
+ /** List of virtual team details */
906
+ vteamList: Array<VteamDetails>;
907
+ /** Whether queue consultation is allowed */
908
+ allowConsultToQueue: boolean;
909
+ };
910
+ /** Method name from JavaScript */
911
+ jsMethod: string;
912
+ /** Data related to the call */
913
+ callData: string;
914
+ /** Session ID of the agent */
915
+ agentSessionId: string;
916
+ }>;
917
+ /**
918
+ * Parameters for putting a task on hold or resuming from hold
919
+ * @public
920
+ */
921
+ export type HoldResumePayload = {
922
+ /** Unique identifier for the media resource to hold/resume */
923
+ mediaResourceId: string;
924
+ };
925
+ /**
926
+ * Parameters for resuming a task's recording
927
+ * @public
928
+ */
929
+ export type ResumeRecordingPayload = {
930
+ /** Indicates if the recording was automatically resumed */
931
+ autoResumed: boolean;
932
+ };
933
+ /**
934
+ * Parameters for transferring a task to another destination
935
+ * @public
936
+ */
937
+ export type TransferPayLoad = {
938
+ /** Destination identifier where the task will be transferred to */
939
+ to: string;
940
+ /** Type of the destination (queue, agent, etc.) */
941
+ destinationType: DestinationType;
942
+ };
943
+ /**
944
+ * Parameters for initiating a consultative transfer
945
+ * @public
946
+ */
947
+ export type ConsultTransferPayLoad = {
948
+ /** Destination identifier for the consultation transfer */
949
+ to: string;
950
+ /** Type of the consultation transfer destination */
951
+ destinationType: ConsultTransferDestinationType;
952
+ };
953
+ /**
954
+ * Parameters for initiating a consultation with another agent or queue
955
+ * @public
956
+ */
957
+ export type ConsultPayload = {
958
+ /** Destination identifier for the consultation */
959
+ to: string | undefined;
960
+ /** Type of the consultation destination (agent, queue, etc.) */
961
+ destinationType: DestinationType;
962
+ /** Whether to hold other participants during consultation (always true) */
963
+ holdParticipants?: boolean;
964
+ };
965
+ /**
966
+ * Parameters for ending a consultation task
967
+ * @public
968
+ */
969
+ export type ConsultEndPayload = {
970
+ /** Indicates if this is a consultation operation */
971
+ isConsult: boolean;
972
+ /** Indicates if this involves a secondary entry point or DN agent */
973
+ isSecondaryEpDnAgent?: boolean;
974
+ /** Optional queue identifier for the consultation */
975
+ queueId?: string;
976
+ /** Identifier of the task being consulted */
977
+ taskId: string;
978
+ };
979
+ /**
980
+ * Parameters for transferring a task to another destination
981
+ * @public
982
+ */
983
+ export type TransferPayload = {
984
+ /** Destination identifier where the task will be transferred */
985
+ to: string | undefined;
986
+ /** Type of the transfer destination */
987
+ destinationType: DestinationType;
988
+ };
989
+ /**
990
+ * API payload for ending a consultation
991
+ * This is the actual payload that is sent to the developer API
992
+ * @public
993
+ */
994
+ export type ConsultEndAPIPayload = {
995
+ /** Optional identifier of the queue involved in the consultation */
996
+ queueId?: string;
997
+ };
998
+ /**
999
+ * Data required for consulting and conferencing operations
1000
+ * @public
1001
+ */
1002
+ export type ConsultConferenceData = {
1003
+ /** Identifier of the agent initiating consult/conference */
1004
+ agentId?: string;
1005
+ /** Target destination for the consult/conference */
1006
+ to: string | undefined;
1007
+ /** Type of destination (e.g., 'agent', 'queue') */
1008
+ destinationType: string;
1009
+ };
1010
+ /**
1011
+ * Parameters required for cancelling a consult to queue operation
1012
+ * @public
1013
+ */
1014
+ export type cancelCtq = {
1015
+ /** Identifier of the agent cancelling the CTQ */
1016
+ agentId: string;
1017
+ /** Identifier of the queue where consult was initiated */
1018
+ queueId: string;
1019
+ };
1020
+ /**
1021
+ * Parameters required for declining a task
1022
+ * @public
1023
+ */
1024
+ export type declinePayload = {
1025
+ /** Identifier of the media resource to decline */
1026
+ mediaResourceId: string;
1027
+ };
1028
+ /**
1029
+ * Parameters for wrapping up a task with relevant completion details
1030
+ * @public
1031
+ */
1032
+ export type WrapupPayLoad = {
1033
+ /** The reason provided for wrapping up the task */
1034
+ wrapUpReason: string;
1035
+ /** Auxiliary code identifier associated with the wrap-up state */
1036
+ auxCodeId: string;
1037
+ };
1038
+ /**
1039
+ * Configuration parameters for initiating outbound dialer tasks
1040
+ * @public
1041
+ */
1042
+ export type DialerPayload = {
1043
+ /** An entryPointId for respective task */
1044
+ entryPointId: string;
1045
+ /** A valid customer DN, on which the response is expected, maximum length 36 characters */
1046
+ destination: string;
1047
+ /** The direction of the call */
1048
+ direction: 'OUTBOUND';
1049
+ /** Schema-free data tuples to pass specific data based on outboundType (max 30 tuples) */
1050
+ attributes: {
1051
+ [key: string]: string;
1052
+ };
1053
+ /** The media type for the request */
1054
+ mediaType: 'telephony' | 'chat' | 'social' | 'email';
1055
+ /** The outbound type for the task */
1056
+ outboundType: 'OUTDIAL' | 'CALLBACK' | 'EXECUTE_FLOW';
1057
+ /** The Outdial ANI number that will be used while making a call to the customer. */
1058
+ origin: string;
1059
+ };
1060
+ /**
1061
+ * Payload for campaign preview contact operations (accept, skip, remove)
1062
+ * @public
1063
+ */
1064
+ export type PreviewContactPayload = {
1065
+ /** The interaction ID from the campaign reservation */
1066
+ interactionId: string;
1067
+ /** The campaign name (not a UUID). Available from the reservation event at
1068
+ * `task.data.interaction.callProcessingDetails.campaignId` or `task.data.campaignId`. */
1069
+ campaignId: string;
1070
+ };
1071
+ /**
1072
+ * Data structure for cleaning up contact resources
1073
+ * @public
1074
+ */
1075
+ export type ContactCleanupData = {
1076
+ /** Type of cleanup operation being performed */
1077
+ type: string;
1078
+ /** Organization identifier where cleanup is occurring */
1079
+ orgId: string;
1080
+ /** Identifier of the agent associated with the contacts */
1081
+ agentId: string;
1082
+ /** Detailed data about the cleanup operation */
1083
+ data: {
1084
+ /** Type of event that triggered the cleanup */
1085
+ eventType: string;
1086
+ /** Identifier of the interaction being cleaned up */
1087
+ interactionId: string;
1088
+ /** Organization identifier */
1089
+ orgId: string;
1090
+ /** Media manager handling the cleanup */
1091
+ mediaMgr: string;
1092
+ /** Tracking identifier for the cleanup operation */
1093
+ trackingId: string;
1094
+ /** Type of media being cleaned up */
1095
+ mediaType: string;
1096
+ /** Optional destination information */
1097
+ destination?: string;
1098
+ /** Whether this is a broadcast cleanup */
1099
+ broadcast: boolean;
1100
+ /** Type of cleanup being performed */
1101
+ type: string;
1102
+ };
1103
+ };
1104
+ /**
1105
+ * Response type for task public methods
1106
+ * Can be an {@link AgentContact} object containing updated task state,
1107
+ * an Error in case of failure, or void for operations that don't return data
1108
+ * @public
1109
+ */
1110
+ export type TaskResponse = AgentContact | Error | void;
1111
+ /**
1112
+ * Interface for managing task-related operations in the contact center
1113
+ * Extends EventEmitter to support event-driven task updates
1114
+ */
1115
+ export interface ITask extends EventEmitter {
1116
+ /**
1117
+ * Event data received in the Contact Center events.
1118
+ * Contains detailed task information including interaction details, media resources,
1119
+ * and participant data as defined in {@link TaskData}
1120
+ */
1121
+ data: TaskData;
1122
+ /**
1123
+ * Map associating tasks with their corresponding call identifiers.
1124
+ */
1125
+ webCallMap: Record<TaskId, CallId>;
1126
+ /**
1127
+ * Auto-wrapup timer for the task
1128
+ * This is used to automatically wrap up tasks after a specified duration
1129
+ * as defined in {@link AutoWrapup}
1130
+ */
1131
+ autoWrapup?: AutoWrapup;
1132
+ /**
1133
+ * Cancels the auto-wrapup timer for the task.
1134
+ * This method stops the auto-wrapup process if it is currently active.
1135
+ * Note: This is supported only in single session mode. Not supported in multi-session mode.
1136
+ * @returns void
1137
+ */
1138
+ cancelAutoWrapupTimer(): void;
1139
+ /**
1140
+ * Deregisters all web call event listeners.
1141
+ * Used when cleaning up task resources.
1142
+ * @ignore
1143
+ */
1144
+ unregisterWebCallListeners(): void;
1145
+ /**
1146
+ * Updates the task data with new information
1147
+ * @param newData - Updated task data to apply, must conform to {@link TaskData} structure
1148
+ * @returns Updated task instance
1149
+ * @ignore
1150
+ */
1151
+ updateTaskData(newData: TaskData): ITask;
1152
+ /**
1153
+ * Answers or accepts an incoming task.
1154
+ * Once accepted, the task will be assigned to the agent and trigger a {@link TASK_EVENTS.TASK_ASSIGNED} event.
1155
+ * The response will contain updated agent contact information as defined in {@link AgentContact}.
1156
+ * @returns Promise<TaskResponse>
1157
+ * @example
1158
+ * ```typescript
1159
+ * await task.accept();
1160
+ * ```
1161
+ */
1162
+ accept(): Promise<TaskResponse>;
1163
+ /**
1164
+ * Declines an incoming task for Browser Login
1165
+ * @returns Promise<TaskResponse>
1166
+ * @example
1167
+ * ```typescript
1168
+ * await task.decline();
1169
+ * ```
1170
+ */
1171
+ decline(): Promise<TaskResponse>;
1172
+ /**
1173
+ * Places the current task on hold.
1174
+ * @param mediaResourceId - Optional media resource ID to use for the hold operation. If not provided, uses the task's current mediaResourceId
1175
+ * @returns Promise<TaskResponse>
1176
+ * @example
1177
+ * ```typescript
1178
+ * // Hold with default mediaResourceId
1179
+ * await task.hold();
1180
+ *
1181
+ * // Hold with custom mediaResourceId
1182
+ * await task.hold('custom-media-resource-id');
1183
+ * ```
1184
+ */
1185
+ hold(mediaResourceId?: string): Promise<TaskResponse>;
1186
+ /**
1187
+ * Resumes a task that was previously on hold.
1188
+ * @param mediaResourceId - Optional media resource ID to use for the resume operation. If not provided, uses the task's current mediaResourceId from interaction media
1189
+ * @returns Promise<TaskResponse>
1190
+ * @example
1191
+ * ```typescript
1192
+ * // Resume with default mediaResourceId
1193
+ * await task.resume();
1194
+ *
1195
+ * // Resume with custom mediaResourceId
1196
+ * await task.resume('custom-media-resource-id');
1197
+ * ```
1198
+ */
1199
+ resume(mediaResourceId?: string): Promise<TaskResponse>;
1200
+ /**
1201
+ * Ends/terminates the current task.
1202
+ * @returns Promise<TaskResponse>
1203
+ * @example
1204
+ * ```typescript
1205
+ * await task.end();
1206
+ * ```
1207
+ */
1208
+ end(): Promise<TaskResponse>;
1209
+ /**
1210
+ * Initiates wrap-up process for the task with specified details.
1211
+ * @param wrapupPayload - Wrap-up details including reason and auxiliary code
1212
+ * @returns Promise<TaskResponse>
1213
+ * @example
1214
+ * ```typescript
1215
+ * await task.wrapup({
1216
+ * wrapUpReason: "Customer issue resolved",
1217
+ * auxCodeId: "RESOLVED"
1218
+ * });
1219
+ * ```
1220
+ */
1221
+ wrapup(wrapupPayload: WrapupPayLoad): Promise<TaskResponse>;
1222
+ /**
1223
+ * Pauses the recording for current task.
1224
+ * @returns Promise<TaskResponse>
1225
+ * @example
1226
+ * ```typescript
1227
+ * await task.pauseRecording();
1228
+ * ```
1229
+ */
1230
+ pauseRecording(): Promise<TaskResponse>;
1231
+ /**
1232
+ * Resumes a previously paused recording.
1233
+ * @param resumeRecordingPayload - Parameters for resuming the recording
1234
+ * @returns Promise<TaskResponse>
1235
+ * @example
1236
+ * ```typescript
1237
+ * await task.resumeRecording({
1238
+ * autoResumed: false
1239
+ * });
1240
+ * ```
1241
+ */
1242
+ resumeRecording(resumeRecordingPayload: ResumeRecordingPayload): Promise<TaskResponse>;
1243
+ /**
1244
+ * Initiates a consultation with another agent or queue.
1245
+ * @param consultPayload - Consultation details including destination and type
1246
+ * @returns Promise<TaskResponse>
1247
+ * @example
1248
+ * ```typescript
1249
+ * await task.consult({ to: "agentId", destinationType: "agent" });
1250
+ * ```
1251
+ */
1252
+ consult(consultPayload: ConsultPayload): Promise<TaskResponse>;
1253
+ /**
1254
+ * Ends an ongoing consultation.
1255
+ * @param consultEndPayload - Details for ending the consultation
1256
+ * @returns Promise<TaskResponse>
1257
+ * @example
1258
+ * ```typescript
1259
+ * await task.endConsult({ isConsult: true, taskId: "taskId" });
1260
+ * ```
1261
+ */
1262
+ endConsult(consultEndPayload: ConsultEndPayload): Promise<TaskResponse>;
1263
+ /**
1264
+ * Transfers the task to another agent or queue.
1265
+ * @param transferPayload - Transfer details including destination and type
1266
+ * @returns Promise<TaskResponse>
1267
+ * @example
1268
+ * ```typescript
1269
+ * await task.transfer({ to: "queueId", destinationType: "queue" });
1270
+ * ```
1271
+ */
1272
+ transfer(transferPayload: TransferPayLoad): Promise<TaskResponse>;
1273
+ /**
1274
+ * Transfers the task after consultation.
1275
+ * @param consultTransferPayload - Details for consult transfer (optional)
1276
+ * @returns Promise<TaskResponse>
1277
+ * @example
1278
+ * ```typescript
1279
+ * await task.consultTransfer({ to: "agentId", destinationType: "agent" });
1280
+ * ```
1281
+ */
1282
+ consultTransfer(consultTransferPayload?: ConsultTransferPayLoad): Promise<TaskResponse>;
1283
+ /**
1284
+ * Initiates a consult conference (merge consult call with main call).
1285
+ * @returns Promise<TaskResponse>
1286
+ * @example
1287
+ * ```typescript
1288
+ * await task.consultConference();
1289
+ * ```
1290
+ */
1291
+ consultConference(): Promise<TaskResponse>;
1292
+ /**
1293
+ * Exits from an ongoing conference.
1294
+ * @returns Promise<TaskResponse>
1295
+ * @example
1296
+ * ```typescript
1297
+ * await task.exitConference();
1298
+ * ```
1299
+ */
1300
+ exitConference(): Promise<TaskResponse>;
1301
+ /**
1302
+ * Transfers the conference to another participant.
1303
+ * @returns Promise<TaskResponse>
1304
+ * @example
1305
+ * ```typescript
1306
+ * await task.transferConference();
1307
+ * ```
1308
+ */
1309
+ transferConference(): Promise<TaskResponse>;
1310
+ /**
1311
+ * Toggles mute/unmute for the local audio stream during a WebRTC task.
1312
+ * @returns Promise<void>
1313
+ * @example
1314
+ * ```typescript
1315
+ * await task.toggleMute();
1316
+ * ```
1317
+ */
1318
+ toggleMute(): Promise<void>;
1319
+ }