@webex/cc-task 1.28.0-ccwidgets.98 → 1.28.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +94 -94
- package/dist/types/Utils/constants.d.ts +4 -0
- package/dist/types/Utils/task-util.d.ts +118 -16
- package/dist/types/helper.d.ts +56 -23
- package/dist/types/task.types.d.ts +10 -7
- package/package.json +8 -5
|
@@ -1,23 +1,125 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ILogger } from '@webex/cc-store';
|
|
2
|
+
import { ITask, Interaction } from '@webex/contact-center';
|
|
3
|
+
import { Visibility } from '@webex/cc-components';
|
|
4
|
+
export declare function findHoldTimestamp(interaction: Interaction, mType?: string): number | null;
|
|
5
|
+
/**
|
|
6
|
+
* Get visibility for Accept button
|
|
7
|
+
*/
|
|
8
|
+
export declare function getAcceptButtonVisibility(isBrowser: boolean, isPhoneDevice: boolean, webRtcEnabled: boolean, isCall: boolean, isDigitalChannel: boolean): Visibility;
|
|
9
|
+
/**
|
|
10
|
+
* Get visibility for Decline button
|
|
11
|
+
*/
|
|
12
|
+
export declare function getDeclineButtonVisibility(isBrowser: boolean, webRtcEnabled: boolean, isCall: boolean): Visibility;
|
|
13
|
+
/**
|
|
14
|
+
* Get visibility for End button
|
|
15
|
+
*/
|
|
16
|
+
export declare function getEndButtonVisibility(isBrowser: boolean, isEndCallEnabled: boolean, isCall: boolean, isConsultInitiatedOrAcceptedOrBeingConsulted: boolean, isConferenceInProgress: boolean, isConsultCompleted: boolean, isHeld: boolean): Visibility;
|
|
17
|
+
/**
|
|
18
|
+
* Get visibility for Mute/Unmute button
|
|
19
|
+
*/
|
|
20
|
+
export declare function getMuteUnmuteButtonVisibility(isBrowser: boolean, webRtcEnabled: boolean, isCall: boolean, isBeingConsulted: boolean): Visibility;
|
|
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
|
|
71
|
+
*/
|
|
72
|
+
export declare function getMuteUnmuteConsultButtonVisibility(isBrowser: boolean, webRtcEnabled: boolean, isCall: boolean, isConsultInitiated: boolean, isBeingConsulted: boolean): Visibility;
|
|
73
|
+
/**
|
|
74
|
+
* Get visibility for Switch to Main Call button
|
|
75
|
+
*/
|
|
76
|
+
export declare function getSwitchToMainCallButtonVisibility(isBeingConsulted: boolean, isConsultAccepted: boolean, isConsultInitiated: boolean, consultCallHeld: boolean, isCustomerInCall: boolean, isConferenceInProgress: boolean): Visibility;
|
|
77
|
+
/**
|
|
78
|
+
* Get visibility for Switch to Consult button
|
|
79
|
+
*/
|
|
80
|
+
export declare function getSwitchToConsultButtonVisibility(isBeingConsulted: boolean, consultCallHeld: boolean): Visibility;
|
|
81
|
+
/**
|
|
82
|
+
* Get visibility for Wrapup button
|
|
83
|
+
*/
|
|
84
|
+
export declare function getWrapupButtonVisibility(task: ITask): Visibility;
|
|
2
85
|
/**
|
|
3
86
|
* This function determines the visibility of various controls based on the task's data.
|
|
87
|
+
* @param deviceType The device type (Browser, Extension, AgentDN)
|
|
88
|
+
* @param featureFlags Feature flags configuration object
|
|
4
89
|
* @param task The task object
|
|
5
|
-
* @
|
|
90
|
+
* @param agentId The agent ID
|
|
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
|
|
6
94
|
*/
|
|
7
95
|
export declare function getControlsVisibility(deviceType: string, featureFlags: {
|
|
8
96
|
[key: string]: boolean;
|
|
9
|
-
}, task: ITask): {
|
|
10
|
-
accept:
|
|
11
|
-
decline:
|
|
12
|
-
end:
|
|
13
|
-
muteUnmute:
|
|
14
|
-
holdResume:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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;
|
|
22
125
|
};
|
|
23
|
-
export declare function findHoldTimestamp(interaction: Interaction, mType?: string): number | null;
|
package/dist/types/helper.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ITask } from '@webex/
|
|
1
|
+
import { ITask } from '@webex/contact-center';
|
|
2
2
|
import { useCallControlProps, UseTaskListProps, UseTaskProps, useOutdialCallProps } from './task.types';
|
|
3
|
-
import { BuddyDetails, DestinationType,
|
|
3
|
+
import { BuddyDetails, DestinationType, PaginatedListParams, Participant } from '@webex/cc-store';
|
|
4
|
+
import { OutdialAniEntriesResponse } from '@webex/contact-center/dist/types/services/config/types';
|
|
4
5
|
export declare const useTaskList: (props: UseTaskListProps) => {
|
|
5
6
|
taskList: Record<string, ITask>;
|
|
6
7
|
acceptTask: (task: ITask) => void;
|
|
@@ -22,43 +23,75 @@ export declare const useCallControl: (props: useCallControlProps) => {
|
|
|
22
23
|
toggleMute: () => Promise<void>;
|
|
23
24
|
isMuted: boolean;
|
|
24
25
|
wrapupCall: (wrapUpReason: string, auxCodeId: string) => void;
|
|
25
|
-
isHeld: boolean;
|
|
26
|
-
setIsHeld: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
27
26
|
isRecording: boolean;
|
|
28
27
|
setIsRecording: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
29
28
|
buddyAgents: BuddyDetails[];
|
|
30
29
|
loadBuddyAgents: () => Promise<void>;
|
|
31
|
-
queues: ContactServiceQueue[];
|
|
32
|
-
loadQueues: () => Promise<void>;
|
|
33
30
|
transferCall: (to: string, type: DestinationType) => Promise<void>;
|
|
34
|
-
consultCall: (consultDestination: string, destinationType: DestinationType) => Promise<void>;
|
|
31
|
+
consultCall: (consultDestination: string, destinationType: DestinationType, allowParticipantsToInteract: boolean) => Promise<void>;
|
|
35
32
|
endConsultCall: () => Promise<void>;
|
|
36
|
-
consultTransfer: (
|
|
33
|
+
consultTransfer: () => Promise<void>;
|
|
34
|
+
consultConference: () => Promise<void>;
|
|
35
|
+
switchToMainCall: () => Promise<void>;
|
|
36
|
+
switchToConsult: () => Promise<void>;
|
|
37
|
+
exitConference: () => Promise<void>;
|
|
37
38
|
consultAgentName: string;
|
|
38
39
|
setConsultAgentName: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
39
|
-
consultAgentId: string;
|
|
40
|
-
setConsultAgentId: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
41
40
|
holdTime: number;
|
|
42
41
|
startTimestamp: number;
|
|
43
42
|
lastTargetType: "agent" | "queue";
|
|
44
43
|
setLastTargetType: import("react").Dispatch<import("react").SetStateAction<"agent" | "queue">>;
|
|
45
44
|
controlVisibility: {
|
|
46
|
-
accept:
|
|
47
|
-
decline:
|
|
48
|
-
end:
|
|
49
|
-
muteUnmute:
|
|
50
|
-
holdResume:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
45
|
+
accept: import("@webex/cc-components").Visibility;
|
|
46
|
+
decline: import("@webex/cc-components").Visibility;
|
|
47
|
+
end: import("@webex/cc-components").Visibility;
|
|
48
|
+
muteUnmute: import("@webex/cc-components").Visibility;
|
|
49
|
+
holdResume: import("@webex/cc-components").Visibility;
|
|
50
|
+
pauseResumeRecording: import("@webex/cc-components").Visibility;
|
|
51
|
+
recordingIndicator: import("@webex/cc-components").Visibility;
|
|
52
|
+
transfer: import("@webex/cc-components").Visibility;
|
|
53
|
+
conference: import("@webex/cc-components").Visibility;
|
|
54
|
+
exitConference: import("@webex/cc-components").Visibility;
|
|
55
|
+
mergeConference: import("@webex/cc-components").Visibility;
|
|
56
|
+
consult: import("@webex/cc-components").Visibility;
|
|
57
|
+
endConsult: import("@webex/cc-components").Visibility;
|
|
58
|
+
consultTransfer: import("@webex/cc-components").Visibility;
|
|
59
|
+
consultTransferConsult: import("@webex/cc-components").Visibility;
|
|
60
|
+
mergeConferenceConsult: import("@webex/cc-components").Visibility;
|
|
61
|
+
muteUnmuteConsult: import("@webex/cc-components").Visibility;
|
|
62
|
+
switchToMainCall: import("@webex/cc-components").Visibility;
|
|
63
|
+
switchToConsult: import("@webex/cc-components").Visibility;
|
|
64
|
+
wrapup: import("@webex/cc-components").Visibility;
|
|
65
|
+
isConferenceInProgress: boolean;
|
|
66
|
+
isConsultInitiated: boolean;
|
|
67
|
+
isConsultInitiatedAndAccepted: boolean;
|
|
68
|
+
isConsultReceived: boolean;
|
|
69
|
+
isConsultInitiatedOrAccepted: boolean;
|
|
70
|
+
isHeld: boolean;
|
|
71
|
+
consultCallHeld: boolean;
|
|
58
72
|
};
|
|
59
73
|
secondsUntilAutoWrapup: number;
|
|
60
74
|
cancelAutoWrapup: () => void;
|
|
75
|
+
conferenceParticipants: Participant[];
|
|
76
|
+
getAddressBookEntries: ({ page, pageSize, search }: PaginatedListParams) => Promise<import("@webex/contact-center").AddressBookEntriesResponse>;
|
|
77
|
+
getEntryPoints: ({ page, pageSize, search }: PaginatedListParams) => Promise<import("@webex/contact-center").EntryPointListResponse>;
|
|
78
|
+
getQueuesFetcher: ({ page, pageSize, search }: PaginatedListParams) => Promise<{
|
|
79
|
+
data: import("@webex/contact-center").ContactServiceQueue[];
|
|
80
|
+
meta: {
|
|
81
|
+
page: number;
|
|
82
|
+
pageSize: number;
|
|
83
|
+
total: number;
|
|
84
|
+
totalPages: number;
|
|
85
|
+
};
|
|
86
|
+
} | {
|
|
87
|
+
data: any[];
|
|
88
|
+
meta: {
|
|
89
|
+
page: number;
|
|
90
|
+
totalPages: number;
|
|
91
|
+
};
|
|
92
|
+
}>;
|
|
61
93
|
};
|
|
62
94
|
export declare const useOutdialCall: (props: useOutdialCallProps) => {
|
|
63
|
-
startOutdial: (destination: string) => void;
|
|
95
|
+
startOutdial: (destination: string, origin?: string) => void;
|
|
96
|
+
getOutdialANIEntries: () => Promise<OutdialAniEntriesResponse>;
|
|
64
97
|
};
|
|
@@ -3,11 +3,14 @@ export type UseTaskProps = Pick<TaskProps, 'incomingTask' | 'deviceType' | 'logg
|
|
|
3
3
|
export type UseTaskListProps = Pick<TaskProps, 'cc' | 'taskList' | 'deviceType' | 'logger'> & Partial<Pick<TaskProps, 'onTaskAccepted' | 'onTaskDeclined' | 'onTaskSelected'>>;
|
|
4
4
|
export type IncomingTaskProps = Pick<TaskProps, 'incomingTask'> & Partial<Pick<TaskProps, 'onAccepted' | 'onRejected'>>;
|
|
5
5
|
export type TaskListProps = Partial<Pick<TaskProps, 'onTaskAccepted' | 'onTaskDeclined' | 'onTaskSelected'>>;
|
|
6
|
-
export type CallControlProps = Partial<Pick<ControlProps, 'onHoldResume' | 'onEnd' | 'onWrapUp' | 'onRecordingToggle' | 'callControlClassName' | 'callControlConsultClassName' | 'onToggleMute'>>;
|
|
7
|
-
export type useCallControlProps = Pick<ControlProps, 'currentTask' | 'logger' | '
|
|
8
|
-
export type Participant = {
|
|
9
|
-
id: string;
|
|
10
|
-
pType: 'Customer' | 'Agent' | string;
|
|
11
|
-
name?: string;
|
|
12
|
-
};
|
|
6
|
+
export type CallControlProps = Partial<Pick<ControlProps, 'onHoldResume' | 'onEnd' | 'onWrapUp' | 'onRecordingToggle' | 'callControlClassName' | 'callControlConsultClassName' | 'onToggleMute' | 'conferenceEnabled' | 'consultTransferOptions'>>;
|
|
7
|
+
export type useCallControlProps = Pick<ControlProps, 'currentTask' | 'logger' | 'deviceType' | 'featureFlags' | 'isMuted' | 'conferenceEnabled' | 'agentId'> & Partial<Pick<ControlProps, 'onHoldResume' | 'onEnd' | 'onWrapUp' | 'onRecordingToggle' | 'onToggleMute'>>;
|
|
13
8
|
export type useOutdialCallProps = Pick<OutdialCallProps, 'cc' | 'logger'>;
|
|
9
|
+
/**
|
|
10
|
+
* Helper interface for device type checks
|
|
11
|
+
*/
|
|
12
|
+
export interface DeviceTypeFlags {
|
|
13
|
+
isBrowser: boolean;
|
|
14
|
+
isAgentDN: boolean;
|
|
15
|
+
isExtension: boolean;
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
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.1",
|
|
5
6
|
"main": "dist/index.js",
|
|
6
7
|
"types": "dist/types/index.d.ts",
|
|
7
8
|
"publishConfig": {
|
|
@@ -18,12 +19,14 @@
|
|
|
18
19
|
"build:src": "yarn run clean:dist && webpack",
|
|
19
20
|
"build:watch": "webpack --watch",
|
|
20
21
|
"test:unit": "tsc --project tsconfig.test.json && jest --coverage",
|
|
21
|
-
"test:styles": "eslint"
|
|
22
|
+
"test:styles": "eslint",
|
|
23
|
+
"deploy:npm": "yarn npm publish"
|
|
22
24
|
},
|
|
23
25
|
"dependencies": {
|
|
24
|
-
"@webex/cc-components": "1.28.0-
|
|
25
|
-
"@webex/cc-store": "1.28.0-
|
|
26
|
-
"mobx-react-lite": "^4.1.0"
|
|
26
|
+
"@webex/cc-components": "1.28.0-next.1",
|
|
27
|
+
"@webex/cc-store": "1.28.0-next.1",
|
|
28
|
+
"mobx-react-lite": "^4.1.0",
|
|
29
|
+
"react-error-boundary": "^6.0.0"
|
|
27
30
|
},
|
|
28
31
|
"devDependencies": {
|
|
29
32
|
"@babel/core": "7.25.2",
|