@webex/cc-task 1.28.0-next.4 → 1.28.0-next.41
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/index.js +7162 -2917
- package/dist/index.js.LICENSE.txt +72 -0
- package/dist/types/OutdialCall/index.d.ts +2 -1
- package/dist/types/RealTimeTranscript/index.d.ts +4 -0
- package/dist/types/Utils/constants.d.ts +11 -0
- package/dist/types/Utils/main-cad-hold.util.d.ts +20 -0
- package/dist/types/Utils/task-util.d.ts +36 -116
- package/dist/types/Utils/timer-utils.d.ts +56 -0
- package/dist/types/Utils/useHoldTimer.d.ts +4 -0
- package/dist/types/helper.d.ts +24 -54
- package/dist/types/index.d.ts +2 -1
- package/dist/types/task.types.d.ts +35 -11
- package/package.json +4 -4
|
@@ -1,5 +1,69 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/*!
|
|
6
|
+
* Copyright (c) 2015-2024 Cisco Systems, Inc. See LICENSE file.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/*!
|
|
10
|
+
* Platform.js v1.3.6
|
|
11
|
+
* Copyright 2014-2020 Benjamin Tan
|
|
12
|
+
* Copyright 2011-2013 John-David Dalton
|
|
13
|
+
* Available under MIT license
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/*!
|
|
17
|
+
* The buffer module from node.js, for the browser.
|
|
18
|
+
*
|
|
19
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
20
|
+
* @license MIT
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/*!
|
|
24
|
+
* js-logger - http://github.com/jonnyreeves/js-logger
|
|
25
|
+
* Jonny Reeves, http://jonnyreeves.co.uk/
|
|
26
|
+
* js-logger may be freely distributed under the MIT license.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/*!
|
|
30
|
+
* urlsafe-base64
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/*! *****************************************************************************
|
|
34
|
+
Copyright (c) Microsoft Corporation.
|
|
35
|
+
|
|
36
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
37
|
+
purpose with or without fee is hereby granted.
|
|
38
|
+
|
|
39
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
40
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
41
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
42
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
43
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
44
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
45
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
46
|
+
***************************************************************************** */
|
|
47
|
+
|
|
1
48
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
49
|
|
|
50
|
+
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
51
|
+
|
|
52
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
53
|
+
|
|
54
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
55
|
+
|
|
56
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @license
|
|
60
|
+
* Lodash <https://lodash.com/>
|
|
61
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
62
|
+
* Released under MIT license <https://lodash.com/license>
|
|
63
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
64
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
65
|
+
*/
|
|
66
|
+
|
|
3
67
|
/**
|
|
4
68
|
* @license React
|
|
5
69
|
* use-sync-external-store-shim.production.js
|
|
@@ -9,3 +73,11 @@
|
|
|
9
73
|
* This source code is licensed under the MIT license found in the
|
|
10
74
|
* LICENSE file in the root directory of this source tree.
|
|
11
75
|
*/
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* core-decorators.js
|
|
79
|
+
* (c) 2017 Jay Phelps and contributors
|
|
80
|
+
* MIT Licensed
|
|
81
|
+
* https://github.com/jayphelps/core-decorators.js
|
|
82
|
+
* @license
|
|
83
|
+
*/
|
|
@@ -2,3 +2,14 @@ export declare const MEDIA_TYPE_TELEPHONY = "telephony";
|
|
|
2
2
|
export declare const MEDIA_TYPE_CHAT = "chat";
|
|
3
3
|
export declare const MEDIA_TYPE_EMAIL = "email";
|
|
4
4
|
export declare const MAX_PARTICIPANTS_IN_MULTIPARTY_CONFERENCE = 7;
|
|
5
|
+
export declare enum DestinationAgentType {
|
|
6
|
+
EP_DN = "EpDn",
|
|
7
|
+
EPDN = "EPDN",
|
|
8
|
+
ENTRY_POINT = "EntryPoint",
|
|
9
|
+
EP = "EP"
|
|
10
|
+
}
|
|
11
|
+
export declare const TIMER_LABEL_WRAP_UP = "Wrap Up";
|
|
12
|
+
export declare const TIMER_LABEL_POST_CALL = "Post Call";
|
|
13
|
+
export declare const TIMER_LABEL_CONSULT_ON_HOLD = "Consult on Hold";
|
|
14
|
+
export declare const TIMER_LABEL_CONSULT_REQUESTED = "Consult Requested";
|
|
15
|
+
export declare const TIMER_LABEL_CONSULTING = "Consulting";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ITask } from '@webex/cc-store';
|
|
2
|
+
import { Interaction, TaskUIControls } from '@webex/contact-center';
|
|
3
|
+
export type MainCadHoldInputs = {
|
|
4
|
+
currentTask: ITask | null;
|
|
5
|
+
controls: TaskUIControls;
|
|
6
|
+
agentId?: string;
|
|
7
|
+
holdDataVersion?: number;
|
|
8
|
+
};
|
|
9
|
+
export type MainCadHoldResult = {
|
|
10
|
+
isHeld: boolean;
|
|
11
|
+
interaction: Interaction | undefined;
|
|
12
|
+
holdTimestampMs: number | null;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Single source of truth for main CAD "On Hold" chip + timer inputs.
|
|
16
|
+
*
|
|
17
|
+
* Covers: simple consult (Agent 2), EP/DN consult, conference nested consult,
|
|
18
|
+
* plain conference hold, and refresh timer continuity (via resolveMainCadHoldTimestampMs).
|
|
19
|
+
*/
|
|
20
|
+
export declare function deriveMainCadHoldState({ currentTask, controls, agentId, holdDataVersion, }: MainCadHoldInputs): MainCadHoldResult;
|
|
@@ -1,125 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ITask
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export declare
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Get visibility for Hold/Resume button
|
|
23
|
-
*/
|
|
24
|
-
export declare function getHoldResumeButtonVisibility(isTelephonySupported: boolean, isCall: boolean, isConferenceInProgress: boolean, isConsultInProgress: boolean, isHeld: boolean, isBeingConsulted: boolean, isConsultCompleted: boolean): Visibility;
|
|
25
|
-
/**
|
|
26
|
-
* Get visibility for Pause/Resume Recording button
|
|
27
|
-
*/
|
|
28
|
-
export declare function getPauseResumeRecordingButtonVisibility(isTelephonySupported: boolean, isCall: boolean, isConferenceInProgress: boolean, isConsultInitiatedOrAccepted: boolean): Visibility;
|
|
29
|
-
/**
|
|
30
|
-
* Get visibility for Recording Indicator
|
|
31
|
-
*/
|
|
32
|
-
export declare function getRecordingIndicatorVisibility(isCall: boolean): Visibility;
|
|
33
|
-
/**
|
|
34
|
-
* Get visibility for Transfer button
|
|
35
|
-
*/
|
|
36
|
-
export declare function getTransferButtonVisibility(isTransferVisibility: boolean, isConferenceInProgress: boolean, isConsultInitiatedOrAccepted: boolean): Visibility;
|
|
37
|
-
/**
|
|
38
|
-
* Get visibility for Conference button
|
|
39
|
-
*/
|
|
40
|
-
export declare function getConferenceButtonVisibility(isBrowser: boolean, webRtcEnabled: boolean, isCall: boolean, isChat: boolean, isBeingConsulted: boolean, conferenceEnabled: boolean): Visibility;
|
|
41
|
-
/**
|
|
42
|
-
* Get visibility for Exit Conference button
|
|
43
|
-
*/
|
|
44
|
-
export declare function getExitConferenceButtonVisibility(isConferenceInProgress: boolean, isConsultInitiatedOrAccepted: boolean, consultCallHeld: boolean, isHeld: boolean, isConsultCompleted: boolean, conferenceEnabled: boolean): Visibility;
|
|
45
|
-
/**
|
|
46
|
-
* Get visibility for Merge Conference button
|
|
47
|
-
*/
|
|
48
|
-
export declare function getMergeConferenceButtonVisibility(isConsultInitiatedOrAccepted: boolean, isConsultAccepted: boolean, consultCallHeld: boolean, isConferenceInProgress: boolean, isCustomerInCall: boolean, conferenceEnabled: boolean): Visibility;
|
|
49
|
-
/**
|
|
50
|
-
* Get visibility for Consult button
|
|
51
|
-
*/
|
|
52
|
-
export declare function getConsultButtonVisibility(isTelephonySupported: boolean, isCall: boolean, isConsultInProgress: boolean, isCustomerInCall: boolean, conferenceParticipantsCount: number, maxParticipantsInConference: number, isBeingConsulted: boolean, isHeld: boolean, isConsultCompleted: boolean, isConferenceInProgress: boolean): Visibility;
|
|
53
|
-
/**
|
|
54
|
-
* Get visibility for End Consult button
|
|
55
|
-
*/
|
|
56
|
-
export declare function getEndConsultButtonVisibility(isEndConsultEnabled: boolean, isTelephonySupported: boolean, isCall: boolean, isConsultInitiatedOrAccepted: boolean): Visibility;
|
|
57
|
-
/**
|
|
58
|
-
* Get visibility for Consult Transfer button
|
|
59
|
-
*/
|
|
60
|
-
export declare function getConsultTransferButtonVisibility(isConsultInitiatedOrAccepted: boolean, isConsultAccepted: boolean, consultCallHeld: boolean, isConferenceInProgress: boolean, isCustomerInCall: boolean): Visibility;
|
|
61
|
-
/**
|
|
62
|
-
* Get visibility for Merge Conference Consult button
|
|
63
|
-
*/
|
|
64
|
-
export declare function getMergeConferenceConsultButtonVisibility(isConsultAccepted: boolean, isConsultInitiated: boolean, consultCallHeld: boolean, isCustomerInCall: boolean, conferenceEnabled: boolean): Visibility;
|
|
65
|
-
/**
|
|
66
|
-
* Get visibility for Consult Transfer Consult button
|
|
67
|
-
*/
|
|
68
|
-
export declare function getConsultTransferConsultButtonVisibility(isConsultAccepted: boolean, isConsultInitiated: boolean, consultCallHeld: boolean, isCustomerInCall: boolean): Visibility;
|
|
69
|
-
/**
|
|
70
|
-
* Get visibility for Mute/Unmute Consult button
|
|
1
|
+
import { Interaction } from '@webex/contact-center';
|
|
2
|
+
import { ITask } from '@webex/cc-store';
|
|
3
|
+
type ConsultMediaEntry = {
|
|
4
|
+
holdTimestamp?: number | null;
|
|
5
|
+
};
|
|
6
|
+
export declare const getHoldAnchorStorageKey: (interactionId: string) => string;
|
|
7
|
+
export declare const getConsultHoldAnchorStorageKey: (interactionId: string) => string;
|
|
8
|
+
export declare const normalizeHoldTimestampMs: (raw: number) => number;
|
|
9
|
+
export declare const readHoldAnchor: (interactionId: string | undefined) => number | null;
|
|
10
|
+
export declare const writeHoldAnchor: (interactionId: string | undefined, timestampMs: number) => void;
|
|
11
|
+
export declare const clearHoldAnchor: (interactionId: string | undefined) => void;
|
|
12
|
+
export declare const readConsultHoldAnchor: (interactionId: string | undefined) => number | null;
|
|
13
|
+
export declare const writeConsultHoldAnchor: (interactionId: string | undefined, timestampMs: number) => void;
|
|
14
|
+
export declare const clearConsultHoldAnchor: (interactionId: string | undefined) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Finds the hold timestamp for a specific media type from an interaction.
|
|
17
|
+
* Used by useHoldTimer for hold duration display.
|
|
18
|
+
*
|
|
19
|
+
* Note: There is a separate findHoldTimestamp in @webex/cc-store that takes ITask.
|
|
20
|
+
* This one takes Interaction directly.
|
|
71
21
|
*/
|
|
72
|
-
export declare function
|
|
22
|
+
export declare function findHoldTimestamp(interaction: Interaction, mType?: string): number | null;
|
|
73
23
|
/**
|
|
74
|
-
*
|
|
24
|
+
* Resolve main CAD hold timer anchor in milliseconds.
|
|
25
|
+
* Prefers interaction media; falls back to session anchor for refresh continuity.
|
|
75
26
|
*/
|
|
76
|
-
export declare function
|
|
27
|
+
export declare function resolveMainCadHoldTimestampMs(interaction: Interaction | undefined, isHeld: boolean, interactionId?: string): number | null;
|
|
77
28
|
/**
|
|
78
|
-
*
|
|
29
|
+
* Resolve consult-leg hold timer anchor in milliseconds (Agent 1 initiator CAD).
|
|
79
30
|
*/
|
|
80
|
-
export declare function
|
|
31
|
+
export declare function resolveConsultHoldTimestampMs(consultMedia: ConsultMediaEntry | null | undefined, interactionId?: string): number;
|
|
81
32
|
/**
|
|
82
|
-
*
|
|
33
|
+
* Checks whether the given task is a campaign preview task based on
|
|
34
|
+
* its outboundType or callProcessingDetails.campaignType.
|
|
83
35
|
*/
|
|
84
|
-
export declare function
|
|
36
|
+
export declare function isCampaignPreviewTask(task: ITask): boolean;
|
|
85
37
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* @param conferenceEnabled Whether conference is enabled
|
|
92
|
-
* @param logger Optional logger instance
|
|
93
|
-
* @returns An object containing the visibility and state of various controls
|
|
38
|
+
* Checks whether the task is a campaign preview that the agent has not
|
|
39
|
+
* explicitly accepted. Uses the store's acceptedCampaignIds as the
|
|
40
|
+
* source of truth — the participants.hasJoined flag is unreliable
|
|
41
|
+
* because CampaignContactUpdated payloads can set it even when the
|
|
42
|
+
* agent only skipped or removed the preview.
|
|
94
43
|
*/
|
|
95
|
-
export declare function
|
|
96
|
-
|
|
97
|
-
}, task: ITask, agentId: string, conferenceEnabled: boolean, logger?: ILogger): {
|
|
98
|
-
accept: Visibility;
|
|
99
|
-
decline: Visibility;
|
|
100
|
-
end: Visibility;
|
|
101
|
-
muteUnmute: Visibility;
|
|
102
|
-
holdResume: Visibility;
|
|
103
|
-
pauseResumeRecording: Visibility;
|
|
104
|
-
recordingIndicator: Visibility;
|
|
105
|
-
transfer: Visibility;
|
|
106
|
-
conference: Visibility;
|
|
107
|
-
exitConference: Visibility;
|
|
108
|
-
mergeConference: Visibility;
|
|
109
|
-
consult: Visibility;
|
|
110
|
-
endConsult: Visibility;
|
|
111
|
-
consultTransfer: Visibility;
|
|
112
|
-
consultTransferConsult: Visibility;
|
|
113
|
-
mergeConferenceConsult: Visibility;
|
|
114
|
-
muteUnmuteConsult: Visibility;
|
|
115
|
-
switchToMainCall: Visibility;
|
|
116
|
-
switchToConsult: Visibility;
|
|
117
|
-
wrapup: Visibility;
|
|
118
|
-
isConferenceInProgress: boolean;
|
|
119
|
-
isConsultInitiated: boolean;
|
|
120
|
-
isConsultInitiatedAndAccepted: boolean;
|
|
121
|
-
isConsultReceived: boolean;
|
|
122
|
-
isConsultInitiatedOrAccepted: boolean;
|
|
123
|
-
isHeld: boolean;
|
|
124
|
-
consultCallHeld: boolean;
|
|
125
|
-
};
|
|
44
|
+
export declare function isUnacceptedCampaignPreview(task: ITask, acceptedCampaignIds: Set<string>): boolean;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ITask, TaskUIControls } from '@webex/cc-store';
|
|
2
|
+
import { Interaction } from '@webex/contact-center';
|
|
3
|
+
/**
|
|
4
|
+
* Timer data structure containing label and timestamp
|
|
5
|
+
*/
|
|
6
|
+
export interface TimerData {
|
|
7
|
+
label: string | null;
|
|
8
|
+
timestamp: number;
|
|
9
|
+
}
|
|
10
|
+
type MediaEntry = {
|
|
11
|
+
mType?: string;
|
|
12
|
+
isHold?: boolean;
|
|
13
|
+
holdTimestamp?: number | null;
|
|
14
|
+
lastUpdated?: number;
|
|
15
|
+
joinTimestamp?: number;
|
|
16
|
+
eventTime?: number;
|
|
17
|
+
createdAt?: number;
|
|
18
|
+
mediaResourceId?: string;
|
|
19
|
+
participants?: string[];
|
|
20
|
+
};
|
|
21
|
+
type InteractionParticipant = {
|
|
22
|
+
consultTimestamp?: number;
|
|
23
|
+
lastUpdated?: number;
|
|
24
|
+
consultState?: string;
|
|
25
|
+
isConsulted?: boolean;
|
|
26
|
+
isWrapUp?: boolean;
|
|
27
|
+
wrapUpTimestamp?: number | null;
|
|
28
|
+
currentState?: string | null;
|
|
29
|
+
currentStateTimestamp?: number | null;
|
|
30
|
+
};
|
|
31
|
+
type InteractionWithMedia = Interaction & {
|
|
32
|
+
media?: Record<string, MediaEntry>;
|
|
33
|
+
participants?: Record<string, InteractionParticipant>;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Find the latest (most recently added) consult media from the interaction.
|
|
37
|
+
*
|
|
38
|
+
* After transfer → re-consult the backend may leave the OLD consult media
|
|
39
|
+
* in the interaction alongside the NEW one. Prefer held consult entries when
|
|
40
|
+
* present (switch-to-main), otherwise pick the most recent consult leg.
|
|
41
|
+
*/
|
|
42
|
+
export declare function findLatestConsultMedia(interaction: InteractionWithMedia | undefined): MediaEntry | null;
|
|
43
|
+
/**
|
|
44
|
+
* Calculate state timer label and timestamp based on task state.
|
|
45
|
+
* Priority: Wrap Up > Post Call
|
|
46
|
+
*/
|
|
47
|
+
export declare function calculateStateTimerData(currentTask: ITask | null, controls: TaskUIControls | null, agentId: string): TimerData;
|
|
48
|
+
/**
|
|
49
|
+
* Calculate consult timer label and timestamp based on consult state.
|
|
50
|
+
* Handles consult on hold vs active consulting states.
|
|
51
|
+
*
|
|
52
|
+
* Derives consult on hold from consult media isHold (not uiControls alone).
|
|
53
|
+
* EP/DN and agent-name: isHold may be true before holdTimestamp arrives — still show Consult on Hold.
|
|
54
|
+
*/
|
|
55
|
+
export declare function calculateConsultTimerData(currentTask: ITask | null, controls: TaskUIControls | null, agentId: string): TimerData;
|
|
56
|
+
export {};
|
package/dist/types/helper.d.ts
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
import { ITask } from '@webex/contact-center';
|
|
2
|
-
import { useCallControlProps, UseTaskListProps, UseTaskProps, useOutdialCallProps } from './task.types';
|
|
3
|
-
import {
|
|
1
|
+
import { AddressBookEntriesResponse, AddressBookEntrySearchParams, ITask, TaskUIControls } from '@webex/contact-center';
|
|
2
|
+
import { useCallControlProps, UseTaskListProps, UseTaskProps, UseRealTimeTranscriptInternalProps, RealTimeTranscriptEntry, useOutdialCallProps, TargetType } from './task.types';
|
|
3
|
+
import { DestinationType, PaginatedListParams } from '@webex/cc-store';
|
|
4
4
|
import { OutdialAniEntriesResponse } from '@webex/contact-center/dist/types/services/config/types';
|
|
5
5
|
export declare const useTaskList: (props: UseTaskListProps) => {
|
|
6
6
|
taskList: Record<string, ITask>;
|
|
7
7
|
acceptTask: (task: ITask) => void;
|
|
8
8
|
declineTask: (task: ITask) => void;
|
|
9
9
|
onTaskSelect: (task: ITask) => void;
|
|
10
|
-
|
|
10
|
+
};
|
|
11
|
+
export declare const useRealTimeTranscript: (props: UseRealTimeTranscriptInternalProps) => {
|
|
12
|
+
liveTranscriptEntries: RealTimeTranscriptEntry[];
|
|
13
|
+
className: string;
|
|
11
14
|
};
|
|
12
15
|
export declare const useIncomingTask: (props: UseTaskProps) => {
|
|
13
16
|
incomingTask: ITask;
|
|
14
17
|
accept: () => void;
|
|
15
18
|
reject: () => void;
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
acceptControl: any;
|
|
20
|
+
declineControl: any;
|
|
18
21
|
};
|
|
19
22
|
export declare const useCallControl: (props: useCallControlProps) => {
|
|
20
23
|
currentTask: ITask;
|
|
24
|
+
isHeld: boolean;
|
|
21
25
|
endCall: () => void;
|
|
22
26
|
toggleHold: (hold: boolean) => void;
|
|
23
27
|
toggleRecording: () => void;
|
|
@@ -27,6 +31,7 @@ export declare const useCallControl: (props: useCallControlProps) => {
|
|
|
27
31
|
isRecording: boolean;
|
|
28
32
|
setIsRecording: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
29
33
|
buddyAgents: BuddyDetails[];
|
|
34
|
+
loadingBuddyAgents: boolean;
|
|
30
35
|
loadBuddyAgents: () => Promise<void>;
|
|
31
36
|
transferCall: (to: string, type: DestinationType) => Promise<void>;
|
|
32
37
|
consultCall: (consultDestination: string, destinationType: DestinationType, allowParticipantsToInteract: boolean) => Promise<void>;
|
|
@@ -40,60 +45,25 @@ export declare const useCallControl: (props: useCallControlProps) => {
|
|
|
40
45
|
setConsultAgentName: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
41
46
|
holdTime: number;
|
|
42
47
|
startTimestamp: number;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
pauseResumeRecording: import("@webex/cc-components").Visibility;
|
|
52
|
-
recordingIndicator: import("@webex/cc-components").Visibility;
|
|
53
|
-
transfer: import("@webex/cc-components").Visibility;
|
|
54
|
-
conference: import("@webex/cc-components").Visibility;
|
|
55
|
-
exitConference: import("@webex/cc-components").Visibility;
|
|
56
|
-
mergeConference: import("@webex/cc-components").Visibility;
|
|
57
|
-
consult: import("@webex/cc-components").Visibility;
|
|
58
|
-
endConsult: import("@webex/cc-components").Visibility;
|
|
59
|
-
consultTransfer: import("@webex/cc-components").Visibility;
|
|
60
|
-
consultTransferConsult: import("@webex/cc-components").Visibility;
|
|
61
|
-
mergeConferenceConsult: import("@webex/cc-components").Visibility;
|
|
62
|
-
muteUnmuteConsult: import("@webex/cc-components").Visibility;
|
|
63
|
-
switchToMainCall: import("@webex/cc-components").Visibility;
|
|
64
|
-
switchToConsult: import("@webex/cc-components").Visibility;
|
|
65
|
-
wrapup: import("@webex/cc-components").Visibility;
|
|
66
|
-
isConferenceInProgress: boolean;
|
|
67
|
-
isConsultInitiated: boolean;
|
|
68
|
-
isConsultInitiatedAndAccepted: boolean;
|
|
69
|
-
isConsultReceived: boolean;
|
|
70
|
-
isConsultInitiatedOrAccepted: boolean;
|
|
71
|
-
isHeld: boolean;
|
|
72
|
-
consultCallHeld: boolean;
|
|
73
|
-
};
|
|
48
|
+
stateTimerLabel: string;
|
|
49
|
+
stateTimerTimestamp: number;
|
|
50
|
+
consultTimerLabel: string;
|
|
51
|
+
consultTimerTimestamp: number;
|
|
52
|
+
lastTargetType: TargetType;
|
|
53
|
+
setLastTargetType: import("react").Dispatch<import("react").SetStateAction<TargetType>>;
|
|
54
|
+
controls: TaskUIControls;
|
|
55
|
+
conferenceEnabled: boolean;
|
|
74
56
|
secondsUntilAutoWrapup: number;
|
|
75
57
|
cancelAutoWrapup: () => void;
|
|
76
58
|
conferenceParticipants: Participant[];
|
|
77
|
-
getAddressBookEntries: ({ page, pageSize, search }: PaginatedListParams) => Promise<
|
|
78
|
-
getEntryPoints: ({ page, pageSize, search }: PaginatedListParams) => Promise<
|
|
79
|
-
getQueuesFetcher: ({ page, pageSize, search }: PaginatedListParams) => Promise<
|
|
80
|
-
|
|
81
|
-
meta: {
|
|
82
|
-
page: number;
|
|
83
|
-
pageSize: number;
|
|
84
|
-
total: number;
|
|
85
|
-
totalPages: number;
|
|
86
|
-
};
|
|
87
|
-
} | {
|
|
88
|
-
data: any[];
|
|
89
|
-
meta: {
|
|
90
|
-
page: number;
|
|
91
|
-
totalPages: number;
|
|
92
|
-
};
|
|
93
|
-
}>;
|
|
59
|
+
getAddressBookEntries: ({ page, pageSize, search }: PaginatedListParams) => Promise<any>;
|
|
60
|
+
getEntryPoints: ({ page, pageSize, search }: PaginatedListParams) => Promise<any>;
|
|
61
|
+
getQueuesFetcher: ({ page, pageSize, search }: PaginatedListParams) => Promise<any>;
|
|
62
|
+
isCampaignCall: boolean;
|
|
94
63
|
};
|
|
95
64
|
export declare const useOutdialCall: (props: useOutdialCallProps) => {
|
|
96
65
|
startOutdial: (destination: string, origin?: string) => void;
|
|
97
66
|
getOutdialANIEntries: () => Promise<OutdialAniEntriesResponse>;
|
|
67
|
+
getAddressBookEntries: (params: AddressBookEntrySearchParams) => Promise<AddressBookEntriesResponse>;
|
|
98
68
|
isTelephonyTaskActive: boolean;
|
|
99
69
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ import { TaskList } from './TaskList';
|
|
|
3
3
|
import { CallControl } from './CallControl';
|
|
4
4
|
import { OutdialCall } from './OutdialCall';
|
|
5
5
|
import { CallControlCAD } from './CallControlCAD';
|
|
6
|
-
|
|
6
|
+
import { RealTimeTranscript } from './RealTimeTranscript';
|
|
7
|
+
export { IncomingTask, TaskList, CallControl, OutdialCall, CallControlCAD, RealTimeTranscript };
|
|
@@ -1,16 +1,40 @@
|
|
|
1
|
-
import { TaskProps, ControlProps, OutdialCallProps } from '@webex/cc-components';
|
|
2
|
-
|
|
3
|
-
export type
|
|
1
|
+
import { TaskProps, ControlProps, OutdialCallProps, RealTimeTranscriptComponentProps, RealTimeTranscriptEntry } from '@webex/cc-components';
|
|
2
|
+
import { RealTimeTranscriptionData } from '@webex/cc-store';
|
|
3
|
+
export type UseTaskProps = Pick<TaskProps, 'incomingTask' | 'logger'> & Partial<Pick<TaskProps, 'onAccepted' | 'onRejected'>>;
|
|
4
|
+
export type UseTaskListProps = Pick<TaskProps, 'cc' | 'taskList' | 'logger'> & Partial<Pick<TaskProps, 'onTaskAccepted' | 'onTaskDeclined' | 'onTaskSelected'>>;
|
|
4
5
|
export type IncomingTaskProps = Pick<TaskProps, 'incomingTask'> & Partial<Pick<TaskProps, 'onAccepted' | 'onRejected'>>;
|
|
5
|
-
export type TaskListProps = Partial<Pick<TaskProps, 'onTaskAccepted' | 'onTaskDeclined' | 'onTaskSelected'
|
|
6
|
+
export type TaskListProps = Partial<Pick<TaskProps, 'onTaskAccepted' | 'onTaskDeclined' | 'onTaskSelected'>> & {
|
|
7
|
+
/**
|
|
8
|
+
* Flag to enable campaign preview task rendering.
|
|
9
|
+
* When true and the task is a campaign preview, CampaignTask is rendered.
|
|
10
|
+
* Defaults to true.
|
|
11
|
+
*/
|
|
12
|
+
hasCampaignPreviewEnabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type RealTimeTranscriptProps = Pick<RealTimeTranscriptComponentProps, 'liveTranscriptEntries' | 'className'>;
|
|
15
|
+
export type UseRealTimeTranscriptInternalProps = RealTimeTranscriptProps & {
|
|
16
|
+
currentTaskId?: string;
|
|
17
|
+
realtimeTranscriptionData?: Partial<RealTimeTranscriptionData>[];
|
|
18
|
+
};
|
|
6
19
|
export type CallControlProps = Partial<Pick<ControlProps, 'onHoldResume' | 'onEnd' | 'onWrapUp' | 'onRecordingToggle' | 'callControlClassName' | 'callControlConsultClassName' | 'onToggleMute' | 'conferenceEnabled' | 'consultTransferOptions'>>;
|
|
7
|
-
export type useCallControlProps = Pick<ControlProps, 'currentTask' | 'logger' | '
|
|
20
|
+
export type useCallControlProps = Pick<ControlProps, 'currentTask' | 'logger' | 'isMuted' | 'conferenceEnabled' | 'agentId'> & Partial<Pick<ControlProps, 'onHoldResume' | 'onEnd' | 'onWrapUp' | 'onRecordingToggle' | 'onToggleMute'>>;
|
|
8
21
|
export type useOutdialCallProps = Pick<OutdialCallProps, 'cc' | 'logger'>;
|
|
22
|
+
export { CAMPAIGN_PREVIEW_OUTBOUND_TYPES, CAMPAIGN_PREVIEW_CAMPAIGN_TYPES } from '@webex/cc-store';
|
|
23
|
+
export type { RealTimeTranscriptEntry };
|
|
24
|
+
export interface OutdialProps {
|
|
25
|
+
/**
|
|
26
|
+
* Flag to determine if the address book is enabled.
|
|
27
|
+
* Defaults to true if not provided.
|
|
28
|
+
*/
|
|
29
|
+
isAddressBookEnabled?: boolean;
|
|
30
|
+
}
|
|
9
31
|
/**
|
|
10
|
-
*
|
|
32
|
+
* Target types for consult/transfer operations
|
|
11
33
|
*/
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
34
|
+
export declare const TARGET_TYPE: {
|
|
35
|
+
readonly AGENT: "agent";
|
|
36
|
+
readonly QUEUE: "queue";
|
|
37
|
+
readonly ENTRY_POINT: "entryPoint";
|
|
38
|
+
readonly DIAL_NUMBER: "dialNumber";
|
|
39
|
+
};
|
|
40
|
+
export type TargetType = (typeof TARGET_TYPE)[keyof typeof TARGET_TYPE];
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@webex/cc-task",
|
|
3
3
|
"description": "Webex Contact Center Widgets: Task",
|
|
4
4
|
"license": "Cisco's General Terms (https://www.cisco.com/site/us/en/about/legal/contract-experience/index.html)",
|
|
5
|
-
"version": "1.28.0-next.
|
|
5
|
+
"version": "1.28.0-next.41",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/types/index.d.ts",
|
|
8
8
|
"publishConfig": {
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"build": "yarn run -T tsc",
|
|
19
19
|
"build:src": "yarn run clean:dist && webpack",
|
|
20
20
|
"build:watch": "webpack --watch",
|
|
21
|
-
"test:unit": "tsc --project tsconfig.test.json && jest --coverage",
|
|
21
|
+
"test:unit": "tsc --project tsconfig.test.json && NODE_ENV=test jest --coverage",
|
|
22
22
|
"test:styles": "eslint",
|
|
23
23
|
"deploy:npm": "yarn npm publish"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@webex/cc-components": "1.28.0-next.
|
|
27
|
-
"@webex/cc-store": "1.28.0-next.
|
|
26
|
+
"@webex/cc-components": "1.28.0-next.38",
|
|
27
|
+
"@webex/cc-store": "1.28.0-next.23",
|
|
28
28
|
"mobx-react-lite": "^4.1.0",
|
|
29
29
|
"react-error-boundary": "^6.0.0"
|
|
30
30
|
},
|