@webex/cc-task 1.28.0-ccwidgets.10
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 +381 -0
- package/dist/types/IncomingTask/incoming-task.presentational.d.ts +4 -0
- package/dist/types/IncomingTask/index.d.ts +4 -0
- package/dist/types/TaskList/index.d.ts +3 -0
- package/dist/types/TaskList/task-list.presentational.d.ts +4 -0
- package/dist/types/helper.d.ts +19 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/task.types.d.ts +100 -0
- package/package.json +62 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UseTaskListProps, UseTaskProps } from './task.types';
|
|
2
|
+
import { ITask } from '@webex/plugin-cc';
|
|
3
|
+
export declare const useTaskList: (props: UseTaskListProps) => {
|
|
4
|
+
taskList: ITask[];
|
|
5
|
+
acceptTask: (task: ITask) => void;
|
|
6
|
+
declineTask: (task: ITask) => void;
|
|
7
|
+
isBrowser: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const useIncomingTask: (props: UseTaskProps) => {
|
|
10
|
+
currentTask: any;
|
|
11
|
+
setCurrentTask: import("react").Dispatch<any>;
|
|
12
|
+
isAnswered: boolean;
|
|
13
|
+
isEnded: boolean;
|
|
14
|
+
isMissed: boolean;
|
|
15
|
+
accept: () => void;
|
|
16
|
+
decline: () => void;
|
|
17
|
+
isBrowser: boolean;
|
|
18
|
+
audioRef: import("react").MutableRefObject<HTMLAudioElement>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { ITask, IContactCenter } from '@webex/plugin-cc';
|
|
2
|
+
import { ILogger } from '@webex/cc-store';
|
|
3
|
+
/**
|
|
4
|
+
* Interface representing the TaskProps of a user.
|
|
5
|
+
*/
|
|
6
|
+
export interface TaskProps {
|
|
7
|
+
/**
|
|
8
|
+
* currentTask of the agent.
|
|
9
|
+
*/
|
|
10
|
+
currentTask: ITask;
|
|
11
|
+
/**
|
|
12
|
+
* CC SDK Instance.
|
|
13
|
+
*/
|
|
14
|
+
cc: IContactCenter;
|
|
15
|
+
/**
|
|
16
|
+
* Handler for task accepted
|
|
17
|
+
*/
|
|
18
|
+
onAccepted?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Handler for task declined
|
|
21
|
+
*/
|
|
22
|
+
onDeclined?: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Handler for task accepted in TaskList
|
|
25
|
+
*/
|
|
26
|
+
onTaskAccepted?: (task: ITask) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Handler for task declined in TaskList
|
|
29
|
+
*/
|
|
30
|
+
onTaskDeclined?: (task: ITask) => void;
|
|
31
|
+
/**
|
|
32
|
+
* accept incoming task action
|
|
33
|
+
*/
|
|
34
|
+
accept: () => void;
|
|
35
|
+
/**
|
|
36
|
+
* decline incoming task action
|
|
37
|
+
*/
|
|
38
|
+
decline: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* accept task from task list
|
|
41
|
+
*/
|
|
42
|
+
acceptTask: (task: ITask) => void;
|
|
43
|
+
/**
|
|
44
|
+
* decline task from tasklist
|
|
45
|
+
*/
|
|
46
|
+
declineTask: (task: ITask) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Flag to determine if the user is logged in with a browser option
|
|
49
|
+
*/
|
|
50
|
+
isBrowser: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Flag to determine if the task is answered
|
|
53
|
+
*/
|
|
54
|
+
isAnswered: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Flag to determine if the task is ended
|
|
57
|
+
*/
|
|
58
|
+
isEnded: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Flag to determine if the task is missed
|
|
61
|
+
*/
|
|
62
|
+
isMissed: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Selected login option
|
|
65
|
+
*/
|
|
66
|
+
selectedLoginOption: string;
|
|
67
|
+
/**
|
|
68
|
+
* List of tasks
|
|
69
|
+
*/
|
|
70
|
+
taskList: ITask[];
|
|
71
|
+
/**
|
|
72
|
+
* Audio reference
|
|
73
|
+
*/
|
|
74
|
+
audioRef: React.RefObject<HTMLAudioElement>;
|
|
75
|
+
/**
|
|
76
|
+
* The logger instance from SDK
|
|
77
|
+
*/
|
|
78
|
+
logger: ILogger;
|
|
79
|
+
}
|
|
80
|
+
export type UseTaskProps = Pick<TaskProps, 'cc' | 'onAccepted' | 'onDeclined' | 'selectedLoginOption' | 'logger'>;
|
|
81
|
+
export type UseTaskListProps = Pick<TaskProps, 'cc' | 'selectedLoginOption' | 'onTaskAccepted' | 'onTaskDeclined' | 'logger'>;
|
|
82
|
+
export type IncomingTaskPresentationalProps = Pick<TaskProps, 'currentTask' | 'isBrowser' | 'isAnswered' | 'isEnded' | 'isMissed' | 'accept' | 'decline' | 'audioRef'>;
|
|
83
|
+
export type IncomingTaskProps = Pick<TaskProps, 'onAccepted' | 'onDeclined'>;
|
|
84
|
+
export type TaskListProps = Pick<TaskProps, 'onTaskAccepted' | 'onTaskDeclined'>;
|
|
85
|
+
export type TaskListPresentationalProps = Pick<TaskProps, 'taskList' | 'isBrowser' | 'acceptTask' | 'declineTask'>;
|
|
86
|
+
export declare enum TASK_EVENTS {
|
|
87
|
+
TASK_INCOMING = "task:incoming",
|
|
88
|
+
TASK_ASSIGNED = "task:assigned",
|
|
89
|
+
TASK_MEDIA = "task:media",
|
|
90
|
+
TASK_UNASSIGNED = "task:unassigned",
|
|
91
|
+
TASK_HOLD = "task:hold",
|
|
92
|
+
TASK_UNHOLD = "task:unhold",
|
|
93
|
+
TASK_CONSULT = "task:consult",
|
|
94
|
+
TASK_CONSULT_END = "task:consultEnd",
|
|
95
|
+
TASK_CONSULT_ACCEPT = "task:consultAccepted",
|
|
96
|
+
TASK_PAUSE = "task:pause",
|
|
97
|
+
TASK_RESUME = "task:resume",
|
|
98
|
+
TASK_END = "task:end",
|
|
99
|
+
TASK_WRAPUP = "task:wrapup"
|
|
100
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@webex/cc-task",
|
|
3
|
+
"description": "Webex Contact Center Widgets: Task",
|
|
4
|
+
"version": "1.28.0-ccwidgets.10",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/",
|
|
11
|
+
"package.json"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"clean": "rm -rf dist && rm -rf node_modules",
|
|
15
|
+
"clean:dist": "rm -rf dist",
|
|
16
|
+
"build": "yarn run -T tsc",
|
|
17
|
+
"build:src": "yarn run clean:dist && webpack",
|
|
18
|
+
"build:watch": "webpack --watch",
|
|
19
|
+
"test:unit": "jest --coverage"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@webex/cc-store": "1.28.0-ccwidgets.10",
|
|
23
|
+
"mobx-react-lite": "^4.1.0",
|
|
24
|
+
"webex": "3.7.0-wxcc.5"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@babel/core": "7.25.2",
|
|
28
|
+
"@babel/preset-env": "7.25.4",
|
|
29
|
+
"@babel/preset-react": "7.24.7",
|
|
30
|
+
"@babel/preset-typescript": "7.25.9",
|
|
31
|
+
"@testing-library/dom": "10.4.0",
|
|
32
|
+
"@testing-library/jest-dom": "6.6.2",
|
|
33
|
+
"@testing-library/react": "16.0.1",
|
|
34
|
+
"@types/jest": "29.5.14",
|
|
35
|
+
"@types/react-test-renderer": "18",
|
|
36
|
+
"babel-jest": "29.7.0",
|
|
37
|
+
"babel-loader": "9.2.1",
|
|
38
|
+
"file-loader": "6.2.0",
|
|
39
|
+
"jest": "29.7.0",
|
|
40
|
+
"jest-environment-jsdom": "29.7.0",
|
|
41
|
+
"ts-loader": "9.5.1",
|
|
42
|
+
"typescript": "5.6.3",
|
|
43
|
+
"webpack": "5.94.0",
|
|
44
|
+
"webpack-cli": "5.1.4",
|
|
45
|
+
"webpack-merge": "6.0.1"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"react": ">=18.3.1",
|
|
49
|
+
"react-dom": ">=18.3.1"
|
|
50
|
+
},
|
|
51
|
+
"jest": {
|
|
52
|
+
"testEnvironment": "jsdom",
|
|
53
|
+
"testMatch": [
|
|
54
|
+
"**/tests/**/*.ts",
|
|
55
|
+
"**/tests/**/*.tsx"
|
|
56
|
+
],
|
|
57
|
+
"moduleNameMapper": {
|
|
58
|
+
"^.+\\.(css|less|scss)$": "babel-jest"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"stableVersion": "1.28.0-ccwidgets.9"
|
|
62
|
+
}
|