@webex/cc-task 1.28.0-next.2 → 1.28.0-next.21

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.
@@ -1,3 +1,4 @@
1
1
  import React from 'react';
2
- declare const OutdialCall: React.FunctionComponent;
2
+ import { OutdialProps } from '../task.types';
3
+ declare const OutdialCall: React.FunctionComponent<OutdialProps>;
3
4
  export { OutdialCall };
@@ -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";
@@ -11,9 +11,9 @@ export declare function getAcceptButtonVisibility(isBrowser: boolean, isPhoneDev
11
11
  */
12
12
  export declare function getDeclineButtonVisibility(isBrowser: boolean, webRtcEnabled: boolean, isCall: boolean): Visibility;
13
13
  /**
14
- * Get visibility for End button
14
+ * Get visibility for End button (matches Agent Desktop behavior)
15
15
  */
16
- export declare function getEndButtonVisibility(isBrowser: boolean, isEndCallEnabled: boolean, isCall: boolean, isConsultInitiatedOrAcceptedOrBeingConsulted: boolean, isConferenceInProgress: boolean, isConsultCompleted: boolean, isHeld: boolean): Visibility;
16
+ export declare function getEndButtonVisibility(isBrowser: boolean, isEndCallEnabled: boolean, isCall: boolean, isConsultInitiatedOrAcceptedOrBeingConsulted: boolean, isConferenceInProgress: boolean, isConsultCompleted: boolean, isHeld: boolean, consultCallHeld: boolean, task?: ITask, agentId?: string): Visibility;
17
17
  /**
18
18
  * Get visibility for Mute/Unmute button
19
19
  */
@@ -0,0 +1,29 @@
1
+ import { ITask } from '@webex/cc-store';
2
+ import { ControlVisibility } from '@webex/cc-components';
3
+ /**
4
+ * Timer data structure containing label and timestamp
5
+ */
6
+ export interface TimerData {
7
+ label: string | null;
8
+ timestamp: number;
9
+ }
10
+ /**
11
+ * Calculate state timer label and timestamp based on task state.
12
+ * Priority: Wrap Up > Post Call
13
+ *
14
+ * @param currentTask - The current task object
15
+ * @param controlVisibility - Control visibility flags
16
+ * @param agentId - The current agent ID
17
+ * @returns TimerData object with label and timestamp
18
+ */
19
+ export declare function calculateStateTimerData(currentTask: ITask | null, controlVisibility: ControlVisibility | null, agentId: string): TimerData;
20
+ /**
21
+ * Calculate consult timer label and timestamp based on consult state.
22
+ * Handles consult on hold vs active consulting states.
23
+ *
24
+ * @param currentTask - The current task object
25
+ * @param controlVisibility - Control visibility flags
26
+ * @param agentId - The current agent ID
27
+ * @returns TimerData object with label and timestamp
28
+ */
29
+ export declare function calculateConsultTimerData(currentTask: ITask | null, controlVisibility: ControlVisibility | null, agentId: string): TimerData;
@@ -0,0 +1,9 @@
1
+ import { ITask } from '@webex/cc-store';
2
+ /**
3
+ * Custom hook to manage hold timer using a Web Worker
4
+ * Prioritizes consult hold over main call hold
5
+ *
6
+ * @param currentTask - The current task object
7
+ * @returns holdTime - The elapsed time in seconds since the call was put on hold
8
+ */
9
+ export declare const useHoldTimer: (currentTask: ITask | null) => number;
@@ -1,5 +1,5 @@
1
- import { ITask } from '@webex/contact-center';
2
- import { useCallControlProps, UseTaskListProps, UseTaskProps, useOutdialCallProps } from './task.types';
1
+ import { AddressBookEntriesResponse, AddressBookEntrySearchParams, ITask } from '@webex/contact-center';
2
+ import { useCallControlProps, UseTaskListProps, UseTaskProps, useOutdialCallProps, TargetType } from './task.types';
3
3
  import { BuddyDetails, DestinationType, PaginatedListParams, Participant } 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) => {
@@ -14,6 +14,7 @@ export declare const useIncomingTask: (props: UseTaskProps) => {
14
14
  accept: () => void;
15
15
  reject: () => void;
16
16
  isBrowser: boolean;
17
+ isDeclineButtonEnabled: boolean;
17
18
  };
18
19
  export declare const useCallControl: (props: useCallControlProps) => {
19
20
  currentTask: ITask;
@@ -26,6 +27,7 @@ export declare const useCallControl: (props: useCallControlProps) => {
26
27
  isRecording: boolean;
27
28
  setIsRecording: import("react").Dispatch<import("react").SetStateAction<boolean>>;
28
29
  buddyAgents: BuddyDetails[];
30
+ loadingBuddyAgents: boolean;
29
31
  loadBuddyAgents: () => Promise<void>;
30
32
  transferCall: (to: string, type: DestinationType) => Promise<void>;
31
33
  consultCall: (consultDestination: string, destinationType: DestinationType, allowParticipantsToInteract: boolean) => Promise<void>;
@@ -39,8 +41,12 @@ export declare const useCallControl: (props: useCallControlProps) => {
39
41
  setConsultAgentName: import("react").Dispatch<import("react").SetStateAction<string>>;
40
42
  holdTime: number;
41
43
  startTimestamp: number;
42
- lastTargetType: "agent" | "queue";
43
- setLastTargetType: import("react").Dispatch<import("react").SetStateAction<"agent" | "queue">>;
44
+ stateTimerLabel: string;
45
+ stateTimerTimestamp: number;
46
+ consultTimerLabel: string;
47
+ consultTimerTimestamp: number;
48
+ lastTargetType: TargetType;
49
+ setLastTargetType: import("react").Dispatch<import("react").SetStateAction<TargetType>>;
44
50
  controlVisibility: {
45
51
  accept: import("@webex/cc-components").Visibility;
46
52
  decline: import("@webex/cc-components").Visibility;
@@ -73,7 +79,7 @@ export declare const useCallControl: (props: useCallControlProps) => {
73
79
  secondsUntilAutoWrapup: number;
74
80
  cancelAutoWrapup: () => void;
75
81
  conferenceParticipants: Participant[];
76
- getAddressBookEntries: ({ page, pageSize, search }: PaginatedListParams) => Promise<import("@webex/contact-center").AddressBookEntriesResponse>;
82
+ getAddressBookEntries: ({ page, pageSize, search }: PaginatedListParams) => Promise<AddressBookEntriesResponse>;
77
83
  getEntryPoints: ({ page, pageSize, search }: PaginatedListParams) => Promise<import("@webex/contact-center").EntryPointListResponse>;
78
84
  getQueuesFetcher: ({ page, pageSize, search }: PaginatedListParams) => Promise<{
79
85
  data: import("@webex/contact-center").ContactServiceQueue[];
@@ -94,4 +100,6 @@ export declare const useCallControl: (props: useCallControlProps) => {
94
100
  export declare const useOutdialCall: (props: useOutdialCallProps) => {
95
101
  startOutdial: (destination: string, origin?: string) => void;
96
102
  getOutdialANIEntries: () => Promise<OutdialAniEntriesResponse>;
103
+ getAddressBookEntries: (params: AddressBookEntrySearchParams) => Promise<AddressBookEntriesResponse>;
104
+ isTelephonyTaskActive: boolean;
97
105
  };
@@ -6,6 +6,13 @@ export type TaskListProps = Partial<Pick<TaskProps, 'onTaskAccepted' | 'onTaskDe
6
6
  export type CallControlProps = Partial<Pick<ControlProps, 'onHoldResume' | 'onEnd' | 'onWrapUp' | 'onRecordingToggle' | 'callControlClassName' | 'callControlConsultClassName' | 'onToggleMute' | 'conferenceEnabled' | 'consultTransferOptions'>>;
7
7
  export type useCallControlProps = Pick<ControlProps, 'currentTask' | 'logger' | 'deviceType' | 'featureFlags' | 'isMuted' | 'conferenceEnabled' | 'agentId'> & Partial<Pick<ControlProps, 'onHoldResume' | 'onEnd' | 'onWrapUp' | 'onRecordingToggle' | 'onToggleMute'>>;
8
8
  export type useOutdialCallProps = Pick<OutdialCallProps, 'cc' | 'logger'>;
9
+ export interface OutdialProps {
10
+ /**
11
+ * Flag to determine if the address book is enabled.
12
+ * Defaults to true if not provided.
13
+ */
14
+ isAddressBookEnabled?: boolean;
15
+ }
9
16
  /**
10
17
  * Helper interface for device type checks
11
18
  */
@@ -14,3 +21,13 @@ export interface DeviceTypeFlags {
14
21
  isAgentDN: boolean;
15
22
  isExtension: boolean;
16
23
  }
24
+ /**
25
+ * Target types for consult/transfer operations
26
+ */
27
+ export declare const TARGET_TYPE: {
28
+ readonly AGENT: "agent";
29
+ readonly QUEUE: "queue";
30
+ readonly ENTRY_POINT: "entryPoint";
31
+ readonly DIAL_NUMBER: "dialNumber";
32
+ };
33
+ 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.2",
5
+ "version": "1.28.0-next.21",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/types/index.d.ts",
8
8
  "publishConfig": {
@@ -23,8 +23,8 @@
23
23
  "deploy:npm": "yarn npm publish"
24
24
  },
25
25
  "dependencies": {
26
- "@webex/cc-components": "1.28.0-next.2",
27
- "@webex/cc-store": "1.28.0-next.1",
26
+ "@webex/cc-components": "1.28.0-next.19",
27
+ "@webex/cc-store": "1.28.0-next.11",
28
28
  "mobx-react-lite": "^4.1.0",
29
29
  "react-error-boundary": "^6.0.0"
30
30
  },
@@ -39,7 +39,7 @@
39
39
  "@testing-library/react": "16.0.1",
40
40
  "@types/jest": "29.5.14",
41
41
  "@types/react-test-renderer": "18",
42
- "@webex/test-fixtures": "0.0.0-next.0",
42
+ "@webex/test-fixtures": "0.0.0-next.1",
43
43
  "babel-jest": "29.7.0",
44
44
  "babel-loader": "9.2.1",
45
45
  "eslint": "^9.20.1",