@webex/cc-task 1.28.0-ccwidgets.11 → 1.28.0-ccwidgets.110

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.
@@ -0,0 +1,11 @@
1
+ /*! For license information please see index.js.LICENSE.txt */
2
+
3
+ /**
4
+ * @license React
5
+ * use-sync-external-store-shim.production.js
6
+ *
7
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
8
+ *
9
+ * This source code is licensed under the MIT license found in the
10
+ * LICENSE file in the root directory of this source tree.
11
+ */
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { CallControlProps } from '../task.types';
3
+ declare const CallControl: React.FunctionComponent<CallControlProps>;
4
+ export { CallControl };
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { CallControlProps } from '../task.types';
3
+ declare const CallControlCAD: React.FunctionComponent<CallControlProps>;
4
+ export { CallControlCAD };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const OutdialCall: React.FunctionComponent;
3
+ export { OutdialCall };
@@ -1,3 +1,4 @@
1
1
  import React from 'react';
2
- declare const TaskList: React.FunctionComponent;
2
+ import { TaskListProps } from '../task.types';
3
+ declare const TaskList: React.FunctionComponent<TaskListProps>;
3
4
  export { TaskList };
@@ -0,0 +1,23 @@
1
+ import { ITask } from '@webex/plugin-cc';
2
+ /**
3
+ * This function determines the visibility of various controls based on the task's data.
4
+ * @param task The task object
5
+ * @returns An object containing the visibility of various controls based on the task's data
6
+ */
7
+ export declare function getControlsVisibility(deviceType: string, featureFlags: {
8
+ [key: string]: boolean;
9
+ }, task: ITask): {
10
+ accept: boolean;
11
+ decline: boolean;
12
+ end: boolean;
13
+ muteUnmute: boolean;
14
+ holdResume: boolean;
15
+ consult: boolean;
16
+ transfer: boolean;
17
+ conference: boolean;
18
+ wrapup: boolean;
19
+ pauseResumeRecording: boolean;
20
+ endConsult: boolean;
21
+ recordingIndicator: boolean;
22
+ };
23
+ export declare function findHoldTimestamp(interaction: Interaction, mType?: string): number | null;
@@ -1,19 +1,64 @@
1
- import { UseTaskListProps, UseTaskProps } from './task.types';
2
1
  import { ITask } from '@webex/plugin-cc';
2
+ import { useCallControlProps, UseTaskListProps, UseTaskProps, useOutdialCallProps } from './task.types';
3
+ import { BuddyDetails, DestinationType, ContactServiceQueue } from '@webex/cc-store';
3
4
  export declare const useTaskList: (props: UseTaskListProps) => {
4
- taskList: ITask[];
5
+ taskList: Record<string, ITask>;
5
6
  acceptTask: (task: ITask) => void;
6
7
  declineTask: (task: ITask) => void;
8
+ onTaskSelect: (task: ITask) => void;
7
9
  isBrowser: boolean;
8
10
  };
9
11
  export declare const useIncomingTask: (props: UseTaskProps) => {
10
- currentTask: any;
11
- setCurrentTask: import("react").Dispatch<any>;
12
- isAnswered: boolean;
13
- isEnded: boolean;
14
- isMissed: boolean;
12
+ incomingTask: ITask;
15
13
  accept: () => void;
16
- decline: () => void;
14
+ reject: () => void;
17
15
  isBrowser: boolean;
18
- audioRef: import("react").MutableRefObject<HTMLAudioElement>;
16
+ };
17
+ export declare const useCallControl: (props: useCallControlProps) => {
18
+ currentTask: ITask;
19
+ endCall: () => void;
20
+ toggleHold: (hold: boolean) => void;
21
+ toggleRecording: () => void;
22
+ toggleMute: () => Promise<void>;
23
+ isMuted: boolean;
24
+ wrapupCall: (wrapUpReason: string, auxCodeId: string) => void;
25
+ isHeld: boolean;
26
+ setIsHeld: import("react").Dispatch<import("react").SetStateAction<boolean>>;
27
+ isRecording: boolean;
28
+ setIsRecording: import("react").Dispatch<import("react").SetStateAction<boolean>>;
29
+ buddyAgents: BuddyDetails[];
30
+ loadBuddyAgents: () => Promise<void>;
31
+ queues: ContactServiceQueue[];
32
+ loadQueues: () => Promise<void>;
33
+ transferCall: (to: string, type: DestinationType) => Promise<void>;
34
+ consultCall: (consultDestination: string, destinationType: DestinationType) => Promise<void>;
35
+ endConsultCall: () => Promise<void>;
36
+ consultTransfer: (transferDestination: string, destinationType: DestinationType) => Promise<void>;
37
+ consultAgentName: string;
38
+ setConsultAgentName: import("react").Dispatch<import("react").SetStateAction<string>>;
39
+ consultAgentId: string;
40
+ setConsultAgentId: import("react").Dispatch<import("react").SetStateAction<string>>;
41
+ holdTime: number;
42
+ startTimestamp: number;
43
+ lastTargetType: "agent" | "queue";
44
+ setLastTargetType: import("react").Dispatch<import("react").SetStateAction<"agent" | "queue">>;
45
+ controlVisibility: {
46
+ accept: boolean;
47
+ decline: boolean;
48
+ end: boolean;
49
+ muteUnmute: boolean;
50
+ holdResume: boolean;
51
+ consult: boolean;
52
+ transfer: boolean;
53
+ conference: boolean;
54
+ wrapup: boolean;
55
+ pauseResumeRecording: boolean;
56
+ endConsult: boolean;
57
+ recordingIndicator: boolean;
58
+ };
59
+ secondsUntilAutoWrapup: number;
60
+ cancelAutoWrapup: () => void;
61
+ };
62
+ export declare const useOutdialCall: (props: useOutdialCallProps) => {
63
+ startOutdial: (destination: string) => void;
19
64
  };
@@ -1,3 +1,6 @@
1
1
  import { IncomingTask } from './IncomingTask/index';
2
2
  import { TaskList } from './TaskList';
3
- export { IncomingTask, TaskList };
3
+ import { CallControl } from './CallControl';
4
+ import { OutdialCall } from './OutdialCall';
5
+ import { CallControlCAD } from './CallControlCAD';
6
+ export { IncomingTask, TaskList, CallControl, OutdialCall, CallControlCAD };
@@ -1,100 +1,13 @@
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
- }
1
+ import { TaskProps, ControlProps, OutdialCallProps } from '@webex/cc-components';
2
+ export type UseTaskProps = Pick<TaskProps, 'incomingTask' | 'deviceType' | 'logger'> & Partial<Pick<TaskProps, 'onAccepted' | 'onRejected'>>;
3
+ export type UseTaskListProps = Pick<TaskProps, 'cc' | 'taskList' | 'deviceType' | 'logger'> & Partial<Pick<TaskProps, 'onTaskAccepted' | 'onTaskDeclined' | 'onTaskSelected'>>;
4
+ export type IncomingTaskProps = Pick<TaskProps, 'incomingTask'> & Partial<Pick<TaskProps, 'onAccepted' | 'onRejected'>>;
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' | 'consultInitiated' | 'deviceType' | 'featureFlags' | 'isMuted'> & Partial<Pick<ControlProps, 'onHoldResume' | 'onEnd' | 'onWrapUp' | 'onRecordingToggle' | 'onToggleMute'>>;
8
+ export type Participant = {
9
+ id: string;
10
+ pType: 'Customer' | 'Agent' | string;
11
+ name?: string;
12
+ };
13
+ export type useOutdialCallProps = Pick<OutdialCallProps, 'cc' | 'logger'>;
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@webex/cc-task",
3
3
  "description": "Webex Contact Center Widgets: Task",
4
- "version": "1.28.0-ccwidgets.11",
4
+ "version": "1.28.0-ccwidgets.110",
5
5
  "main": "dist/index.js",
6
+ "types": "dist/types/index.d.ts",
6
7
  "publishConfig": {
7
8
  "access": "public"
8
9
  },
@@ -16,47 +17,51 @@
16
17
  "build": "yarn run -T tsc",
17
18
  "build:src": "yarn run clean:dist && webpack",
18
19
  "build:watch": "webpack --watch",
19
- "test:unit": "jest --coverage"
20
+ "test:unit": "tsc --project tsconfig.test.json && jest --coverage",
21
+ "test:styles": "eslint"
20
22
  },
21
23
  "dependencies": {
22
- "@webex/cc-store": "1.28.0-ccwidgets.11",
23
- "mobx-react-lite": "^4.1.0",
24
- "webex": "3.7.0-wxcc.5"
24
+ "@webex/cc-components": "1.28.0-ccwidgets.110",
25
+ "@webex/cc-store": "1.28.0-ccwidgets.110",
26
+ "mobx-react-lite": "^4.1.0"
25
27
  },
26
28
  "devDependencies": {
27
29
  "@babel/core": "7.25.2",
28
30
  "@babel/preset-env": "7.25.4",
29
31
  "@babel/preset-react": "7.24.7",
30
32
  "@babel/preset-typescript": "7.25.9",
33
+ "@eslint/js": "^9.20.0",
31
34
  "@testing-library/dom": "10.4.0",
32
35
  "@testing-library/jest-dom": "6.6.2",
33
36
  "@testing-library/react": "16.0.1",
34
37
  "@types/jest": "29.5.14",
35
38
  "@types/react-test-renderer": "18",
39
+ "@webex/test-fixtures": "0.0.0",
36
40
  "babel-jest": "29.7.0",
37
41
  "babel-loader": "9.2.1",
42
+ "eslint": "^9.20.1",
43
+ "eslint-config-prettier": "^10.0.1",
44
+ "eslint-config-standard": "^17.1.0",
45
+ "eslint-plugin-import": "^2.25.2",
46
+ "eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
47
+ "eslint-plugin-prettier": "^5.2.3",
48
+ "eslint-plugin-promise": "^6.0.0",
49
+ "eslint-plugin-react": "^7.37.4",
38
50
  "file-loader": "6.2.0",
51
+ "globals": "^16.0.0",
39
52
  "jest": "29.7.0",
40
53
  "jest-environment-jsdom": "29.7.0",
54
+ "prettier": "^3.5.1",
41
55
  "ts-loader": "9.5.1",
42
56
  "typescript": "5.6.3",
57
+ "typescript-eslint": "^8.24.1",
43
58
  "webpack": "5.94.0",
44
59
  "webpack-cli": "5.1.4",
45
60
  "webpack-merge": "6.0.1"
46
61
  },
47
62
  "peerDependencies": {
63
+ "@momentum-ui/react-collaboration": ">=26.197.0",
48
64
  "react": ">=18.3.1",
49
65
  "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.10"
66
+ }
62
67
  }
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { IncomingTaskPresentationalProps } from '../task.types';
3
- declare const IncomingTaskPresentational: React.FunctionComponent<IncomingTaskPresentationalProps>;
4
- export default IncomingTaskPresentational;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { TaskListPresentationalProps } from '../task.types';
3
- declare const TaskListPresentational: React.FunctionComponent<TaskListPresentationalProps>;
4
- export default TaskListPresentational;