@webex/contact-center 3.12.0-task-refactor.4 → 3.12.0-task-refactor.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/services/task/TaskManager.js +1 -0
- package/dist/services/task/TaskManager.js.map +1 -1
- package/dist/services/task/TaskUtils.js +8 -6
- package/dist/services/task/TaskUtils.js.map +1 -1
- package/dist/services/task/state-machine/TaskStateMachine.js +77 -14
- package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -1
- package/dist/services/task/state-machine/actions.js +85 -13
- package/dist/services/task/state-machine/actions.js.map +1 -1
- package/dist/services/task/state-machine/guards.js +35 -0
- package/dist/services/task/state-machine/guards.js.map +1 -1
- package/dist/services/task/state-machine/uiControlsComputer.js +76 -10
- package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -1
- package/dist/services/task/voice/Voice.js +10 -4
- package/dist/services/task/voice/Voice.js.map +1 -1
- package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +68 -8
- package/dist/types/services/task/state-machine/guards.d.ts +5 -0
- package/dist/types/services/task/voice/Voice.d.ts +18 -17
- package/dist/webex.js +1 -1
- package/package.json +1 -1
- package/src/services/task/TaskManager.ts +1 -1
- package/src/services/task/TaskUtils.ts +8 -6
- package/src/services/task/state-machine/TaskStateMachine.ts +101 -16
- package/src/services/task/state-machine/actions.ts +148 -24
- package/src/services/task/state-machine/guards.ts +46 -0
- package/src/services/task/state-machine/uiControlsComputer.ts +158 -15
- package/src/services/task/voice/Voice.ts +12 -5
- package/test/unit/spec/services/WebCallingService.ts +7 -1
- package/test/unit/spec/services/task/TaskManager.ts +26 -0
- package/test/unit/spec/services/task/TaskUtils.ts +16 -0
- package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +573 -0
- package/test/unit/spec/services/task/state-machine/guards.ts +88 -0
- package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +1023 -46
- package/test/unit/spec/services/task/voice/Voice.ts +44 -0
- package/umd/contact-center.min.js +2 -2
- package/umd/contact-center.min.js.map +1 -1
|
@@ -192,6 +192,94 @@ describe('State Machine Guards', () => {
|
|
|
192
192
|
false
|
|
193
193
|
);
|
|
194
194
|
});
|
|
195
|
+
|
|
196
|
+
it('isInteractionConsulting returns true for pending self consult on hydrate', () => {
|
|
197
|
+
const ctx = createContext();
|
|
198
|
+
const taskData = createTaskData({
|
|
199
|
+
isConsulted: false,
|
|
200
|
+
interaction: {
|
|
201
|
+
...createTaskData().interaction,
|
|
202
|
+
state: 'conference',
|
|
203
|
+
participants: {
|
|
204
|
+
'agent-123': {
|
|
205
|
+
...createParticipant('agent-123', 'Agent'),
|
|
206
|
+
consultState: 'consultInitiated',
|
|
207
|
+
isConsulted: false,
|
|
208
|
+
},
|
|
209
|
+
'agent-456': {
|
|
210
|
+
...createParticipant('agent-456', 'Agent'),
|
|
211
|
+
hasJoined: false,
|
|
212
|
+
consultState: 'consultReserved',
|
|
213
|
+
isConsulted: true,
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
media: {
|
|
217
|
+
[INTERACTION_ID]: {
|
|
218
|
+
mediaResourceId: INTERACTION_ID,
|
|
219
|
+
mediaType: 'telephony',
|
|
220
|
+
mediaMgr: 'media-mgr',
|
|
221
|
+
participants: ['agent-123'],
|
|
222
|
+
mType: 'mainCall',
|
|
223
|
+
isHold: true,
|
|
224
|
+
holdTimestamp: Date.now(),
|
|
225
|
+
},
|
|
226
|
+
'consult-media': {
|
|
227
|
+
mediaResourceId: 'consult-media',
|
|
228
|
+
mediaType: 'telephony',
|
|
229
|
+
mediaMgr: 'media-mgr',
|
|
230
|
+
participants: ['agent-123', 'agent-456'],
|
|
231
|
+
mType: 'consult',
|
|
232
|
+
isHold: false,
|
|
233
|
+
holdTimestamp: null,
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
} as any,
|
|
237
|
+
});
|
|
238
|
+
expect(
|
|
239
|
+
guards.isInteractionConsulting(createParams(ctx, createEventWithTaskData(taskData)))
|
|
240
|
+
).toBe(true);
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
it('isInteractionConsulting returns false for consulted agent pending consult state', () => {
|
|
244
|
+
const ctx = createContext();
|
|
245
|
+
const taskData = createTaskData({
|
|
246
|
+
isConsulted: true,
|
|
247
|
+
interaction: {
|
|
248
|
+
...createTaskData().interaction,
|
|
249
|
+
state: 'conference',
|
|
250
|
+
participants: {
|
|
251
|
+
'agent-123': {
|
|
252
|
+
...createParticipant('agent-123', 'Agent'),
|
|
253
|
+
consultState: 'consultInitiated',
|
|
254
|
+
isConsulted: true,
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
media: {
|
|
258
|
+
[INTERACTION_ID]: {
|
|
259
|
+
mediaResourceId: INTERACTION_ID,
|
|
260
|
+
mediaType: 'telephony',
|
|
261
|
+
mediaMgr: 'media-mgr',
|
|
262
|
+
participants: ['agent-123'],
|
|
263
|
+
mType: 'mainCall',
|
|
264
|
+
isHold: true,
|
|
265
|
+
holdTimestamp: Date.now(),
|
|
266
|
+
},
|
|
267
|
+
'consult-media': {
|
|
268
|
+
mediaResourceId: 'consult-media',
|
|
269
|
+
mediaType: 'telephony',
|
|
270
|
+
mediaMgr: 'media-mgr',
|
|
271
|
+
participants: ['agent-123'],
|
|
272
|
+
mType: 'consult',
|
|
273
|
+
isHold: false,
|
|
274
|
+
holdTimestamp: null,
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
} as any,
|
|
278
|
+
});
|
|
279
|
+
expect(
|
|
280
|
+
guards.isInteractionConsulting(createParams(ctx, createEventWithTaskData(taskData)))
|
|
281
|
+
).toBe(false);
|
|
282
|
+
});
|
|
195
283
|
});
|
|
196
284
|
|
|
197
285
|
describe('Wrap-up Guards', () => {
|