@webex/cc-store 1.28.0-rtt.2 → 1.28.0-task-refactor.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.
@@ -1,13 +1,3 @@
1
- export declare const TASK_STATE_CONSULT = "consult";
2
- export declare const TASK_STATE_CONSULTING = "consulting";
3
- export declare const TASK_STATE_CONSULT_COMPLETED = "consultCompleted";
4
- export declare const INTERACTION_STATE_WRAPUP = "wrapUp";
5
- export declare const INTERACTION_STATE_POST_CALL = "post_call";
6
- export declare const INTERACTION_STATE_CONNECTED = "connected";
7
- export declare const INTERACTION_STATE_CONFERENCE = "conference";
8
- export declare const CONSULT_STATE_INITIATED = "consultInitiated";
9
- export declare const CONSULT_STATE_COMPLETED = "consultCompleted";
10
- export declare const CONSULT_STATE_CONFERENCING = "conferencing";
11
1
  export declare const RELATIONSHIP_TYPE_CONSULT = "consult";
12
2
  export declare const AGENT = "Agent";
13
3
  export declare const CUSTOMER = "Customer";
@@ -1,5 +1,5 @@
1
1
  import { ITask } from '@webex/contact-center';
2
- import { IContactCenter, Team, IdleCode, InitParams, IStore, ILogger, IWrapupCode, ICustomState, AgentLoginProfile, WithWebex, RealtimeTranscriptionData, RealtimeTranscriptLine } from './store.types';
2
+ import { IContactCenter, Team, IdleCode, InitParams, IStore, ILogger, IWrapupCode, ICustomState, AgentLoginProfile, WithWebex } from './store.types';
3
3
  declare class Store implements IStore {
4
4
  private static instance;
5
5
  teams: Team[];
@@ -21,6 +21,10 @@ declare class Store implements IStore {
21
21
  isQueueConsultInProgress: boolean;
22
22
  isDeclineButtonEnabled: boolean;
23
23
  currentConsultQueueId: string;
24
+ lastConsultDestination: {
25
+ to: string;
26
+ destinationType: string;
27
+ } | null;
24
28
  consultStartTimeStamp: any;
25
29
  lastStateChangeTimestamp?: number;
26
30
  lastIdleCodeChangeTimestamp?: number;
@@ -36,8 +40,6 @@ declare class Store implements IStore {
36
40
  isMuted: boolean;
37
41
  isDigitalChannelsInitialized: boolean;
38
42
  dataCenter: string;
39
- realtimeTranscriptionData: RealtimeTranscriptionData;
40
- realtimeTranscriptLines: RealtimeTranscriptLine[];
41
43
  constructor();
42
44
  static getInstance(): Store;
43
45
  registerCC(webex?: WithWebex['webex']): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { AgentLogin, Profile, BuddyDetails, ContactServiceQueue, ITask, BuddyAgents, BuddyAgentsResponse, StateChange, Logout, EntryPointRecord, EntryPointListResponse, EntryPointSearchParams, AddressBookEntry, AddressBookEntriesResponse, AddressBookEntrySearchParams, ContactServiceQueuesResponse, ContactServiceQueueSearchParams, AddressBook } from '@webex/contact-center';
1
+ import { AgentLogin, Profile, BuddyDetails, ContactServiceQueue, ITask, BuddyAgents, BuddyAgentsResponse, StateChange, Logout, EntryPointRecord, EntryPointListResponse, EntryPointSearchParams, AddressBookEntry, AddressBookEntriesResponse, AddressBookEntrySearchParams, ContactServiceQueuesResponse, ContactServiceQueueSearchParams, AddressBook, TASK_EVENTS, TaskUIControls, TaskUIControlState, InteractionUIControls, TaskUILeg, getDefaultUIControls } from '@webex/contact-center';
2
2
  import { OutdialAniEntriesResponse, OutdialAniParams } from 'node_modules/@webex/contact-center/dist/types/services/config/types';
3
3
  import { DestinationType } from 'node_modules/@webex/contact-center/dist/types/services/task/types';
4
4
  import { AgentProfileUpdate, LogContext, SetStateResponse, StationLoginResponse, StationLogoutResponse, Team, UpdateDeviceTypeResponse } from 'node_modules/@webex/contact-center/dist/types/types';
@@ -55,43 +55,6 @@ type IdleCode = {
55
55
  isSystem: boolean;
56
56
  isDefault: boolean;
57
57
  };
58
- type RealtimeTranscriptionData = {
59
- content?: string;
60
- conversationId?: string;
61
- isFinal?: boolean;
62
- languageCode?: string;
63
- messageId?: string;
64
- orgId?: string;
65
- publishTimestamp?: number | string;
66
- role?: string;
67
- trackingId?: string;
68
- utteranceId?: string;
69
- };
70
- type RealtimeTranscriptionEventPayload = {
71
- data?: {
72
- agentId?: string;
73
- content?: string;
74
- publishTimestamp?: number | string;
75
- role?: string;
76
- data?: RealtimeTranscriptionData;
77
- notifDetails?: {
78
- actionEvent?: string;
79
- };
80
- notifType?: string;
81
- orgId?: string;
82
- };
83
- orgId?: string;
84
- trackingId?: string;
85
- type?: string;
86
- };
87
- type RealtimeTranscriptLine = {
88
- messageId: string;
89
- role: string;
90
- caller: string;
91
- content: string;
92
- publishTimestamp: number;
93
- conversationId?: string;
94
- };
95
58
  interface IStore {
96
59
  featureFlags: {
97
60
  [key: string]: boolean;
@@ -118,6 +81,10 @@ interface IStore {
118
81
  isQueueConsultInProgress: boolean;
119
82
  isDeclineButtonEnabled: boolean;
120
83
  currentConsultQueueId: string;
84
+ lastConsultDestination: {
85
+ to: string;
86
+ destinationType: DestinationType;
87
+ } | null;
121
88
  consultStartTimeStamp?: number;
122
89
  callControlAudio: MediaStream | null;
123
90
  isEndConsultEnabled: boolean;
@@ -127,8 +94,6 @@ interface IStore {
127
94
  isAddressBookEnabled: boolean;
128
95
  isDigitalChannelsInitialized: boolean;
129
96
  dataCenter: string;
130
- realtimeTranscriptionData: RealtimeTranscriptionData;
131
- realtimeTranscriptLines: RealtimeTranscriptLine[];
132
97
  init(params: InitParams, callback: (ccSDK: IContactCenter) => void): Promise<void>;
133
98
  registerCC(webex?: WithWebex['webex']): Promise<void>;
134
99
  }
@@ -165,48 +130,6 @@ interface IWrapupCode {
165
130
  id: string;
166
131
  name: string;
167
132
  }
168
- declare enum TASK_EVENTS {
169
- TASK_INCOMING = "task:incoming",
170
- TASK_ASSIGNED = "task:assigned",
171
- TASK_MEDIA = "task:media",
172
- TASK_HOLD = "task:hold",
173
- TASK_UNHOLD = "task:unhold",
174
- TASK_CONSULT = "task:consult",
175
- TASK_CONSULT_END = "task:consultEnd",
176
- TASK_CONSULT_ACCEPTED = "task:consultAccepted",
177
- TASK_PAUSE = "task:pause",
178
- TASK_RESUME = "task:resume",
179
- TASK_END = "task:end",
180
- TASK_WRAPUP = "task:wrapup",
181
- TASK_REJECT = "task:rejected",
182
- TASK_HYDRATE = "task:hydrate",
183
- TASK_CONSULTING = "task:consulting",
184
- TASK_CONSULT_QUEUE_CANCELLED = "task:consultQueueCancelled",
185
- AGENT_CONTACT_ASSIGNED = "AgentContactAssigned",
186
- CONTACT_RECORDING_PAUSED = "ContactRecordingPaused",
187
- CONTACT_RECORDING_RESUMED = "ContactRecordingResumed",
188
- AGENT_WRAPPEDUP = "AgentWrappedUp",
189
- AGENT_OFFER_CONTACT = "AgentOfferContact",
190
- AGENT_CONSULT_CREATED = "AgentConsultCreated",
191
- TASK_RECORDING_PAUSED = "task:recordingPaused",
192
- TASK_RECORDING_RESUMED = "task:recordingResumed",
193
- TASK_OFFER_CONSULT = "task:offerConsult",
194
- TASK_AUTO_ANSWERED = "task:autoAnswered",
195
- TASK_CONFERENCE_ESTABLISHING = "task:conferenceEstablishing",
196
- TASK_CONFERENCE_STARTED = "task:conferenceStarted",
197
- TASK_CONFERENCE_FAILED = "task:conferenceFailed",
198
- TASK_CONFERENCE_ENDED = "task:conferenceEnded",
199
- TASK_PARTICIPANT_JOINED = "task:participantJoined",
200
- TASK_PARTICIPANT_LEFT = "task:participantLeft",
201
- TASK_CONFERENCE_TRANSFERRED = "task:conferenceTransferred",
202
- TASK_CONFERENCE_TRANSFER_FAILED = "task:conferenceTransferFailed",
203
- TASK_CONFERENCE_END_FAILED = "task:conferenceEndFailed",
204
- TASK_PARTICIPANT_LEFT_FAILED = "task:participantLeftFailed",
205
- TASK_MERGED = "task:merged",
206
- TASK_POST_CALL_ACTIVITY = "task:postCallActivity",
207
- TASK_OUTDIAL_FAILED = "task:outdialFailed",
208
- REAL_TIME_TRANSCRIPTION = "REAL_TIME_TRANSCRIPTION"
209
- }
210
133
  declare enum CC_EVENTS {
211
134
  AGENT_DN_REGISTERED = "agent:dnRegistered",
212
135
  AGENT_LOGOUT_SUCCESS = "agent:logoutSuccess",
@@ -238,6 +161,7 @@ type AgentLoginProfile = {
238
161
  social: number;
239
162
  telephony: number;
240
163
  };
164
+ agentProfileID?: string;
241
165
  };
242
166
  type PaginatedListParams = {
243
167
  page: number;
@@ -270,18 +194,8 @@ declare const ERROR_TRIGGERING_IDLE_CODES: {
270
194
  CHANNEL_FAILURE: string;
271
195
  RONA: string;
272
196
  };
273
- export type { IContactCenter, ITask, Profile, Team, AgentLogin, WithWebex, IdleCode, InitParams, IStore, ILogger, IWrapupCode, IStoreWrapper, ICustomState, DestinationType, BuddyDetails, ContactServiceQueue, AgentLoginProfile, EntryPointRecord, EntryPointListResponse, EntryPointSearchParams, AddressBookEntry, AddressBookEntriesResponse, AddressBookEntrySearchParams, ContactServiceQueuesResponse, ContactServiceQueueSearchParams, IWebex, PaginatedListParams, FetchPaginatedList, TransformPaginatedData, RealtimeTranscriptionData, RealtimeTranscriptionEventPayload, RealtimeTranscriptLine, };
274
- export { CC_EVENTS, TASK_EVENTS, ENGAGED_LABEL, ENGAGED_USERNAME, DIAL_NUMBER, EXTENSION, DESKTOP, MEDIA_TYPE_TELEPHONY_LOWER, MEDIA_TYPE_TELEPHONY_UPPER, DEVICE_TYPE_BROWSER, AGENT_STATE_AVAILABLE, LoginOptions, ERROR_TRIGGERING_IDLE_CODES, };
275
- export declare enum ConsultStatus {
276
- NO_CONSULTATION_IN_PROGRESS = "No consultation in progress",
277
- BEING_CONSULTED = "beingConsulted",
278
- CONSULT_INITIATED = "consultInitiated",
279
- BEING_CONSULTED_ACCEPTED = "beingConsultedAccepted",
280
- CONSULT_ACCEPTED = "consultAccepted",
281
- CONNECTED = "connected",
282
- CONFERENCE = "conference",
283
- CONSULT_COMPLETED = "consultCompleted"
284
- }
197
+ export type { IContactCenter, ITask, Profile, Team, AgentLogin, WithWebex, IdleCode, InitParams, IStore, ILogger, IWrapupCode, IStoreWrapper, ICustomState, DestinationType, BuddyDetails, ContactServiceQueue, AgentLoginProfile, EntryPointRecord, EntryPointListResponse, EntryPointSearchParams, AddressBookEntry, AddressBookEntriesResponse, AddressBookEntrySearchParams, ContactServiceQueuesResponse, ContactServiceQueueSearchParams, IWebex, PaginatedListParams, FetchPaginatedList, TransformPaginatedData, TaskUIControls, TaskUIControlState, InteractionUIControls, TaskUILeg, };
198
+ export { CC_EVENTS, TASK_EVENTS, ENGAGED_LABEL, ENGAGED_USERNAME, DIAL_NUMBER, EXTENSION, DESKTOP, MEDIA_TYPE_TELEPHONY_LOWER, MEDIA_TYPE_TELEPHONY_UPPER, DEVICE_TYPE_BROWSER, AGENT_STATE_AVAILABLE, LoginOptions, ERROR_TRIGGERING_IDLE_CODES, getDefaultUIControls, };
285
199
  export type Participant = {
286
200
  id: string;
287
201
  pType: 'Customer' | 'Agent' | string;
@@ -1,4 +1,4 @@
1
- import { IStoreWrapper, IStore, InitParams, TASK_EVENTS, CC_EVENTS, IWrapupCode, WithWebex, ICustomState, IdleCode, IContactCenter, ITask, BuddyDetails, ContactServiceQueue, ContactServiceQueueSearchParams, EntryPointListResponse, EntryPointSearchParams, AddressBookEntriesResponse, AddressBookEntrySearchParams, AgentLoginProfile, RealtimeTranscriptionEventPayload } from './store.types';
1
+ import { IStoreWrapper, IStore, InitParams, TASK_EVENTS, CC_EVENTS, IWrapupCode, WithWebex, ICustomState, IdleCode, IContactCenter, ITask, BuddyDetails, ContactServiceQueue, ContactServiceQueueSearchParams, EntryPointListResponse, EntryPointSearchParams, AddressBookEntriesResponse, AddressBookEntrySearchParams, AgentLoginProfile } from './store.types';
2
2
  declare class StoreWrapper implements IStoreWrapper {
3
3
  store: IStore;
4
4
  onIncomingTask: ({ task }: {
@@ -9,7 +9,6 @@ declare class StoreWrapper implements IStoreWrapper {
9
9
  onTaskAssigned?: (task: ITask) => void;
10
10
  onTaskSelected?: (task: ITask, isClicked: boolean) => void;
11
11
  onErrorCallback?: (widgetName: string, error: Error) => void;
12
- private realtimeTranscriptionListeners;
13
12
  constructor();
14
13
  get featureFlags(): {
15
14
  [key: string]: boolean;
@@ -39,10 +38,12 @@ declare class StoreWrapper implements IStoreWrapper {
39
38
  get isDeclineButtonEnabled(): boolean;
40
39
  get isDigitalChannelsInitialized(): boolean;
41
40
  get dataCenter(): string;
42
- get realtimeTranscriptionData(): import("./store.types").RealtimeTranscriptionData;
43
- get realtimeTranscriptLines(): import("./store.types").RealtimeTranscriptLine[];
44
41
  setDataCenter: (value: string) => void;
45
42
  get currentConsultQueueId(): string;
43
+ get lastConsultDestination(): {
44
+ to: string;
45
+ destinationType: import("node_modules/@webex/contact-center/dist/types/services/task/types").DestinationType;
46
+ };
46
47
  get isEndConsultEnabled(): boolean;
47
48
  get allowConsultToQueue(): boolean;
48
49
  get agentProfile(): AgentLoginProfile;
@@ -68,6 +69,10 @@ declare class StoreWrapper implements IStoreWrapper {
68
69
  setIsQueueConsultInProgress: (value: boolean) => void;
69
70
  setIsDeclineButtonEnabled: (value: boolean) => void;
70
71
  setCurrentConsultQueueId: (queueId: string | null) => void;
72
+ setLastConsultDestination: (destination: {
73
+ to: string;
74
+ destinationType: string;
75
+ } | null) => void;
71
76
  setState: (state: ICustomState | IdleCode) => void;
72
77
  setIncomingTaskCb: (callback: ({ task }: {
73
78
  task: ITask;
@@ -101,6 +106,8 @@ declare class StoreWrapper implements IStoreWrapper {
101
106
  * Register all task event listeners
102
107
  * @param task - The task to register event listeners for
103
108
  */
109
+ handleUIControlsUpdated: () => void;
110
+ handleSwitchCall: () => void;
104
111
  private registerTaskEventListeners;
105
112
  handleIncomingTask: (event: any) => void;
106
113
  handleStateChange: (data: any) => void;
@@ -109,8 +116,6 @@ declare class StoreWrapper implements IStoreWrapper {
109
116
  handleTaskHydrate: (event: any) => void;
110
117
  handleTaskReject: (task: ITask, reason: string) => void;
111
118
  handleOutdialFailed: (reason: string) => void;
112
- private findTranscriptPosition;
113
- handleRealtimeTranscription: (payload: NonNullable<RealtimeTranscriptionEventPayload["data"]>) => void;
114
119
  getBuddyAgents: (mediaType?: string) => Promise<Array<BuddyDetails>>;
115
120
  getQueues: (mediaType?: string, params?: ContactServiceQueueSearchParams) => Promise<{
116
121
  data: ContactServiceQueue[];
@@ -5,7 +5,6 @@ import { ITask, Participant } from './store.types';
5
5
  * @returns Whether the task is incoming
6
6
  */
7
7
  export declare const isIncomingTask: (task: ITask, agentId: string) => boolean;
8
- export declare function getConsultMPCState(task: ITask, agentId: string): string;
9
8
  /**
10
9
  * Checks if the current agent is a secondary agent in a consultation scenario.
11
10
  * Secondary agents are those who were consulted (not the original call owner).
@@ -16,13 +15,8 @@ export declare function isSecondaryAgent(task: ITask): boolean;
16
15
  /**
17
16
  * Checks if the current agent is a secondary EP-DN (Entry Point Dial Number) agent.
18
17
  * This is specifically for telephony consultations to external numbers/entry points.
19
- * @param {Object} task - The task object containing interaction details
20
- * @returns {boolean} True if this is a secondary EP-DN agent in telephony consultation
21
18
  */
22
19
  export declare function isSecondaryEpDnAgent(task: ITask): boolean;
23
- export declare function getTaskStatus(task: ITask, agentId: string): string;
24
- export declare function getConsultStatus(task: ITask, agentId: string): string;
25
- export declare function getIsConferenceInProgress(task: ITask): boolean;
26
20
  /**
27
21
  * Retrieves the list of active conference participants excluding the current agent
28
22
  * Filters out customers, supervisors, VVAs, and participants who have left
@@ -32,20 +26,9 @@ export declare function getIsConferenceInProgress(task: ITask): boolean;
32
26
  * @returns Array of active agent participants in the conference
33
27
  */
34
28
  export declare const getConferenceParticipants: (task: ITask, agentId: string) => Participant[];
35
- /**
36
- * Counts the number of active agent participants in the conference
37
- * Excludes customers, supervisors, VVAs, and participants who have left
38
- *
39
- * @param task - The task object containing interaction data
40
- * @returns Count of active agent participants
41
- */
42
- export declare function getConferenceParticipantsCount(task: ITask): number;
43
- export declare function getIsCustomerInCall(task: ITask): boolean;
44
- export declare function getIsConsultInProgress(task: ITask): boolean;
45
29
  export declare function isInteractionOnHold(task: ITask): boolean;
46
30
  export declare const setmTypeForEPDN: (task: ITask, mType: string) => string;
47
31
  export declare const findMediaResourceId: (task: ITask, mType: string) => string;
48
- export declare const findHoldStatus: (task: ITask, mType: string, agentId: string) => boolean;
49
32
  /**
50
33
  * Finds the hold timestamp for a specific media type (mainCall, consult, etc.)
51
34
  * Used for timer alignment in Consult & Conference scenarios to match Agent Desktop behavior.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@webex/cc-store",
3
3
  "description": "Webex Contact Center Widgets: Widgets Store",
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-rtt.2",
5
+ "version": "1.28.0-task-refactor.1",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/types/index.d.ts",
8
8
  "publishConfig": {
@@ -23,7 +23,7 @@
23
23
  "deploy:npm": "yarn npm publish"
24
24
  },
25
25
  "dependencies": {
26
- "@webex/contact-center": "3.12.0-next.1",
26
+ "@webex/contact-center": "3.12.0-task-refactor.7",
27
27
  "mobx": "6.13.5",
28
28
  "typescript": "5.6.3"
29
29
  },
@@ -38,7 +38,7 @@
38
38
  "@testing-library/react": "16.0.1",
39
39
  "@types/jest": "29.5.14",
40
40
  "@types/react-test-renderer": "18",
41
- "@webex/test-fixtures": "0.0.0-rtt.1",
41
+ "@webex/test-fixtures": "0.0.0-task-refactor.1",
42
42
  "babel-jest": "29.7.0",
43
43
  "babel-loader": "9.2.1",
44
44
  "eslint": "^9.20.1",