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