@webex/cc-store 1.28.0-eft.7 → 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.
@@ -0,0 +1,71 @@
1
+ /*!
2
+ * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
+ */
4
+
5
+ /*!
6
+ * Copyright (c) 2015-2024 Cisco Systems, Inc. See LICENSE file.
7
+ */
8
+
9
+ /*!
10
+ * Platform.js v1.3.6
11
+ * Copyright 2014-2020 Benjamin Tan
12
+ * Copyright 2011-2013 John-David Dalton
13
+ * Available under MIT license
14
+ */
15
+
16
+ /*!
17
+ * The buffer module from node.js, for the browser.
18
+ *
19
+ * @author Feross Aboukhadijeh <https://feross.org>
20
+ * @license MIT
21
+ */
22
+
23
+ /*!
24
+ * js-logger - http://github.com/jonnyreeves/js-logger
25
+ * Jonny Reeves, http://jonnyreeves.co.uk/
26
+ * js-logger may be freely distributed under the MIT license.
27
+ */
28
+
29
+ /*!
30
+ * urlsafe-base64
31
+ */
32
+
33
+ /*! *****************************************************************************
34
+ Copyright (c) Microsoft Corporation.
35
+
36
+ Permission to use, copy, modify, and/or distribute this software for any
37
+ purpose with or without fee is hereby granted.
38
+
39
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
40
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
41
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
42
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
43
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
44
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
45
+ PERFORMANCE OF THIS SOFTWARE.
46
+ ***************************************************************************** */
47
+
48
+ /*! https://mths.be/punycode v1.4.1 by @mathias */
49
+
50
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
51
+
52
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
53
+
54
+ /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
55
+
56
+ /**
57
+ * @license
58
+ * Lodash <https://lodash.com/>
59
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
60
+ * Released under MIT license <https://lodash.com/license>
61
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
62
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
63
+ */
64
+
65
+ /**
66
+ * core-decorators.js
67
+ * (c) 2017 Jay Phelps and contributors
68
+ * MIT Licensed
69
+ * https://github.com/jayphelps/core-decorators.js
70
+ * @license
71
+ */
@@ -0,0 +1,25 @@
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
+ export declare const RELATIONSHIP_TYPE_CONSULT = "consult";
12
+ export declare const AGENT = "Agent";
13
+ export declare const CUSTOMER = "Customer";
14
+ export declare const SUPERVISOR = "Supervisor";
15
+ /**
16
+ * Virtual Voice Assistant (VVA) - Automated participant type
17
+ * Used to identify bot/automated participants in interactions
18
+ */
19
+ export declare const VVA = "VVA";
20
+ /**
21
+ * Participant types to exclude from active agent participant counts
22
+ * Used for filtering conference participants and consult operations
23
+ */
24
+ export declare const EXCLUDED_PARTICIPANT_TYPES: string[];
25
+ export declare const MEDIA_TYPE_CONSULT = "consult";
@@ -1,2 +1,4 @@
1
- import store from './store';
1
+ import store from './storeEventsWrapper';
2
+ export * from './store.types';
3
+ export * from './task-utils';
2
4
  export default store;
@@ -1,32 +1,41 @@
1
- declare class Store {
2
- loginState: string;
3
- isAvailable: boolean;
4
- ccSdk: {
5
- accessToken: string;
6
- callbacks: {};
7
- init: ({ accessToken }: {
8
- accessToken: any;
9
- }) => Promise<void>;
10
- logout: () => void;
11
- presence: {
12
- currentState: string;
13
- set: (state: any) => void;
14
- };
15
- callControls: {
16
- currentState: string;
17
- mute: () => void;
18
- unmute: () => void;
19
- };
20
- on: (eventName: any, callback: any) => {
21
- eventName: any;
22
- callback: any;
23
- };
24
- off: (eventName: any, callback: any) => void;
25
- emit: (eventName: any, payload: any) => void;
1
+ import { ITask } from '@webex/contact-center';
2
+ import { IContactCenter, Team, IdleCode, InitParams, IStore, ILogger, IWrapupCode, ICustomState, AgentLoginProfile, WithWebex } from './store.types';
3
+ declare class Store implements IStore {
4
+ private static instance;
5
+ teams: Team[];
6
+ loginOptions: string[];
7
+ cc: IContactCenter;
8
+ logger: ILogger;
9
+ idleCodes: IdleCode[];
10
+ agentId: string;
11
+ currentTheme: string;
12
+ wrapupCodes: IWrapupCode[];
13
+ currentTask: ITask;
14
+ isAgentLoggedIn: boolean;
15
+ deviceType: string;
16
+ teamId: string;
17
+ taskList: Record<string, ITask>;
18
+ dialNumber: string;
19
+ currentState: string;
20
+ customState: ICustomState;
21
+ isQueueConsultInProgress: boolean;
22
+ currentConsultQueueId: string;
23
+ consultStartTimeStamp: any;
24
+ lastStateChangeTimestamp?: number;
25
+ lastIdleCodeChangeTimestamp?: number;
26
+ showMultipleLoginAlert: boolean;
27
+ callControlAudio: MediaStream | null;
28
+ featureFlags: {
29
+ [key: string]: boolean;
26
30
  };
31
+ isEndConsultEnabled: boolean;
32
+ isAddressBookEnabled: boolean;
33
+ allowConsultToQueue: boolean;
34
+ agentProfile: AgentLoginProfile;
35
+ isMuted: boolean;
27
36
  constructor();
28
- setLoginState: (state: any) => void;
29
- setIsAvailable: (state: any) => void;
37
+ static getInstance(): Store;
38
+ registerCC(webex?: WithWebex['webex']): Promise<void>;
39
+ init(options: InitParams, setupEventListeners: any): Promise<void>;
30
40
  }
31
- declare const store: Store;
32
- export default store;
41
+ export default Store;
@@ -0,0 +1,240 @@
1
+ import { AgentLogin, Profile, BuddyDetails, ContactServiceQueue, ITask, BuddyAgents, BuddyAgentsResponse, StateChange, Logout, EntryPointRecord, EntryPointListResponse, EntryPointSearchParams, AddressBookEntry, AddressBookEntriesResponse, AddressBookEntrySearchParams, ContactServiceQueuesResponse, ContactServiceQueueSearchParams, AddressBook } from '@webex/contact-center';
2
+ import { OutdialAniEntriesResponse, OutdialAniParams } from 'node_modules/@webex/contact-center/dist/types/services/config/types';
3
+ import { DestinationType } from 'node_modules/@webex/contact-center/dist/types/services/task/types';
4
+ import { AgentProfileUpdate, LogContext, SetStateResponse, StationLoginResponse, StationLogoutResponse, Team, UpdateDeviceTypeResponse } from 'node_modules/@webex/contact-center/dist/types/types';
5
+ interface IContactCenter {
6
+ on: (event: string, callback: (data: any) => void) => void;
7
+ off: (event: string, callback?: (data: any) => void) => void;
8
+ updateAgentProfile(data: AgentProfileUpdate): Promise<UpdateDeviceTypeResponse>;
9
+ stationLogin(data: AgentLogin): Promise<StationLoginResponse>;
10
+ deregister(): Promise<void>;
11
+ stationLogout(data: Logout): Promise<StationLogoutResponse>;
12
+ LoggerProxy: ILogger;
13
+ register(): Promise<Profile>;
14
+ taskManager: {
15
+ getAllTasks: () => Record<string, ITask>;
16
+ };
17
+ getBuddyAgents(data: BuddyAgents): Promise<BuddyAgentsResponse>;
18
+ getQueues(params?: ContactServiceQueueSearchParams): Promise<ContactServiceQueuesResponse>;
19
+ getEntryPoints(params?: EntryPointSearchParams): Promise<EntryPointListResponse>;
20
+ addressBook: AddressBook;
21
+ agentConfig?: {
22
+ regexUS: RegExp | string;
23
+ agentId: string;
24
+ outdialANIId: string;
25
+ };
26
+ setAgentState(data: StateChange): Promise<SetStateResponse>;
27
+ getOutdialAniEntries(params: OutdialAniParams): Promise<OutdialAniEntriesResponse>;
28
+ }
29
+ type IWebex = {
30
+ cc: IContactCenter;
31
+ once: (event: string, callback: (data: any) => void) => void;
32
+ };
33
+ type ILogger = {
34
+ log: (message: string, context?: LogContext) => void;
35
+ info: (message: string, context?: LogContext) => void;
36
+ warn: (message: string, context?: LogContext) => void;
37
+ trace: (message: string, context?: LogContext) => void;
38
+ error: (message: string, context?: LogContext) => void;
39
+ };
40
+ type WithWebex = {
41
+ webex: {
42
+ cc: IContactCenter;
43
+ logger: ILogger;
44
+ };
45
+ };
46
+ type WithWebexConfig = {
47
+ webexConfig: any;
48
+ access_token: string;
49
+ };
50
+ type InitParams = WithWebex | WithWebexConfig;
51
+ type IdleCode = {
52
+ name: string;
53
+ id: string;
54
+ isSystem: boolean;
55
+ isDefault: boolean;
56
+ };
57
+ interface IStore {
58
+ featureFlags: {
59
+ [key: string]: boolean;
60
+ };
61
+ teams: Team[];
62
+ loginOptions: string[];
63
+ cc: IContactCenter;
64
+ idleCodes: IdleCode[];
65
+ agentId: string;
66
+ logger: ILogger;
67
+ wrapupCodes: IWrapupCode[];
68
+ currentTask: ITask;
69
+ taskList: Record<string, ITask>;
70
+ isAgentLoggedIn: boolean;
71
+ deviceType: string;
72
+ teamId: string;
73
+ dialNumber: string;
74
+ currentState: string;
75
+ lastStateChangeTimestamp?: number;
76
+ lastIdleCodeChangeTimestamp?: number;
77
+ showMultipleLoginAlert: boolean;
78
+ currentTheme: string;
79
+ customState: ICustomState;
80
+ isQueueConsultInProgress: boolean;
81
+ currentConsultQueueId: string;
82
+ consultStartTimeStamp?: number;
83
+ callControlAudio: MediaStream | null;
84
+ isEndConsultEnabled: boolean;
85
+ allowConsultToQueue: boolean;
86
+ agentProfile: AgentLoginProfile;
87
+ isMuted: boolean;
88
+ isAddressBookEnabled: boolean;
89
+ init(params: InitParams, callback: (ccSDK: IContactCenter) => void): Promise<void>;
90
+ registerCC(webex?: WithWebex['webex']): Promise<void>;
91
+ }
92
+ interface IStoreWrapper extends IStore {
93
+ store: IStore;
94
+ onErrorCallback?: (widgetName: string, error: Error) => void;
95
+ setCurrentTask(task: ITask): void;
96
+ refreshTaskList(): void;
97
+ getBuddyAgents(mediaType?: string): Promise<BuddyDetails[]>;
98
+ getQueues(mediaType?: string, params?: ContactServiceQueueSearchParams): Promise<ContactServiceQueuesResponse>;
99
+ getEntryPoints(params?: EntryPointSearchParams): Promise<EntryPointListResponse>;
100
+ getAddressBookEntries(params?: AddressBookEntrySearchParams): Promise<AddressBookEntriesResponse>;
101
+ setDeviceType(option: string): void;
102
+ setDialNumber(input: string): void;
103
+ setCurrentState(state: string): void;
104
+ setLastStateChangeTimestamp(timestamp: number): void;
105
+ setLastIdleCodeChangeTimestamp(timestamp: number): void;
106
+ setShowMultipleLoginAlert(value: boolean): void;
107
+ setCurrentTheme(theme: string): void;
108
+ setIsAgentLoggedIn(value: boolean): void;
109
+ setWrapupCodes(wrapupCodes: IWrapupCode[]): void;
110
+ setState(state: IdleCode | ICustomState): void;
111
+ setConsultStartTimeStamp(timestamp: number): void;
112
+ setAgentProfile(profile: Profile): void;
113
+ setTeamId(id: string): void;
114
+ setIsMuted(value: boolean): void;
115
+ setOnError(callback: (widgetName: string, error: Error) => void): void;
116
+ }
117
+ interface IWrapupCode {
118
+ id: string;
119
+ name: string;
120
+ }
121
+ declare enum TASK_EVENTS {
122
+ TASK_INCOMING = "task:incoming",
123
+ TASK_ASSIGNED = "task:assigned",
124
+ TASK_MEDIA = "task:media",
125
+ TASK_HOLD = "task:hold",
126
+ TASK_UNHOLD = "task:unhold",
127
+ TASK_CONSULT = "task:consult",
128
+ TASK_CONSULT_END = "task:consultEnd",
129
+ TASK_CONSULT_ACCEPTED = "task:consultAccepted",
130
+ TASK_PAUSE = "task:pause",
131
+ TASK_RESUME = "task:resume",
132
+ TASK_END = "task:end",
133
+ TASK_WRAPUP = "task:wrapup",
134
+ TASK_REJECT = "task:rejected",
135
+ TASK_HYDRATE = "task:hydrate",
136
+ TASK_CONSULTING = "task:consulting",
137
+ TASK_CONSULT_QUEUE_CANCELLED = "task:consultQueueCancelled",
138
+ AGENT_CONTACT_ASSIGNED = "AgentContactAssigned",
139
+ CONTACT_RECORDING_PAUSED = "ContactRecordingPaused",
140
+ CONTACT_RECORDING_RESUMED = "ContactRecordingResumed",
141
+ AGENT_WRAPPEDUP = "AgentWrappedUp",
142
+ AGENT_OFFER_CONTACT = "AgentOfferContact",
143
+ AGENT_CONSULT_CREATED = "AgentConsultCreated",
144
+ TASK_RECORDING_PAUSED = "task:recordingPaused",
145
+ TASK_RECORDING_RESUMED = "task:recordingResumed",
146
+ TASK_OFFER_CONSULT = "task:offerConsult",
147
+ TASK_CONFERENCE_ESTABLISHING = "task:conferenceEstablishing",
148
+ TASK_CONFERENCE_STARTED = "task:conferenceStarted",
149
+ TASK_CONFERENCE_FAILED = "task:conferenceFailed",
150
+ TASK_CONFERENCE_ENDED = "task:conferenceEnded",
151
+ TASK_PARTICIPANT_JOINED = "task:participantJoined",
152
+ TASK_PARTICIPANT_LEFT = "task:participantLeft",
153
+ TASK_CONFERENCE_TRANSFERRED = "task:conferenceTransferred",
154
+ TASK_CONFERENCE_TRANSFER_FAILED = "task:conferenceTransferFailed",
155
+ TASK_CONFERENCE_END_FAILED = "task:conferenceEndFailed",
156
+ TASK_PARTICIPANT_LEFT_FAILED = "task:participantLeftFailed",
157
+ TASK_MERGED = "task:merged",
158
+ TASK_POST_CALL_ACTIVITY = "task:postCallActivity",
159
+ TASK_OUTDIAL_FAILED = "task:outdialFailed"
160
+ }
161
+ declare enum CC_EVENTS {
162
+ AGENT_DN_REGISTERED = "agent:dnRegistered",
163
+ AGENT_LOGOUT_SUCCESS = "agent:logoutSuccess",
164
+ AGENT_STATION_LOGIN_SUCCESS = "agent:stationLoginSuccess",
165
+ AGENT_MULTI_LOGIN = "agent:multiLogin",
166
+ AGENT_STATE_CHANGE = "agent:stateChange",
167
+ AGENT_RELOGIN_SUCCESS = "agent:reloginSuccess",
168
+ AGENT_OFFER_CONSULT = "AgentOfferConsult"
169
+ }
170
+ interface ICustomStateSet {
171
+ name: string;
172
+ developerName: string;
173
+ }
174
+ interface ICustomStateReset {
175
+ reset: boolean;
176
+ }
177
+ type ICustomState = ICustomStateSet | ICustomStateReset;
178
+ declare const ENGAGED_LABEL = "ENGAGED";
179
+ declare const ENGAGED_USERNAME = "Engaged";
180
+ type AgentLoginProfile = {
181
+ agentName?: string;
182
+ orgId?: string;
183
+ profileType?: string;
184
+ deviceType?: string;
185
+ roles?: Array<string>;
186
+ mmProfile?: {
187
+ chat: number;
188
+ email: number;
189
+ social: number;
190
+ telephony: number;
191
+ };
192
+ };
193
+ type PaginatedListParams = {
194
+ page: number;
195
+ pageSize: number;
196
+ search?: string;
197
+ };
198
+ type FetchPaginatedList<T> = (params: PaginatedListParams) => Promise<{
199
+ data: T[];
200
+ meta?: {
201
+ page?: number;
202
+ totalPages?: number;
203
+ };
204
+ }>;
205
+ type TransformPaginatedData<T, U> = (item: T, page: number, index: number) => U;
206
+ declare const DIAL_NUMBER: string;
207
+ declare const EXTENSION: string;
208
+ declare const DESKTOP: string;
209
+ declare const MEDIA_TYPE_TELEPHONY_LOWER = "telephony";
210
+ declare const MEDIA_TYPE_TELEPHONY_UPPER = "TELEPHONY";
211
+ declare const DEVICE_TYPE_BROWSER = "BROWSER";
212
+ declare const AGENT_STATE_AVAILABLE = "Available";
213
+ declare const LoginOptions: {
214
+ [key: string]: string;
215
+ };
216
+ declare const ERROR_TRIGGERING_IDLE_CODES: {
217
+ INVALID_NUMBER: string;
218
+ UNAVAILABLE: string;
219
+ DECLINED: string;
220
+ BUSY: string;
221
+ CHANNEL_FAILURE: string;
222
+ RONA: string;
223
+ };
224
+ 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, };
225
+ 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, };
226
+ export declare enum ConsultStatus {
227
+ NO_CONSULTATION_IN_PROGRESS = "No consultation in progress",
228
+ BEING_CONSULTED = "beingConsulted",
229
+ CONSULT_INITIATED = "consultInitiated",
230
+ BEING_CONSULTED_ACCEPTED = "beingConsultedAccepted",
231
+ CONSULT_ACCEPTED = "consultAccepted",
232
+ CONNECTED = "connected",
233
+ CONFERENCE = "conference",
234
+ CONSULT_COMPLETED = "consultCompleted"
235
+ }
236
+ export type Participant = {
237
+ id: string;
238
+ pType: 'Customer' | 'Agent' | string;
239
+ name?: string;
240
+ };
@@ -0,0 +1,118 @@
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
+ declare class StoreWrapper implements IStoreWrapper {
3
+ store: IStore;
4
+ onIncomingTask: ({ task }: {
5
+ task: ITask;
6
+ }) => void;
7
+ onTaskRejected?: (task: ITask, reason: string) => void;
8
+ onOutdialFailed?: (reason: string) => void;
9
+ onTaskAssigned?: (task: ITask) => void;
10
+ onTaskSelected?: (task: ITask, isClicked: boolean) => void;
11
+ onErrorCallback?: (widgetName: string, error: Error) => void;
12
+ constructor();
13
+ get featureFlags(): {
14
+ [key: string]: boolean;
15
+ };
16
+ get teams(): import("node_modules/@webex/contact-center/dist/types/types").Team[];
17
+ get loginOptions(): string[];
18
+ get cc(): IContactCenter;
19
+ get logger(): import("./store.types").ILogger;
20
+ get idleCodes(): IdleCode[];
21
+ get agentId(): string;
22
+ get deviceType(): string;
23
+ get teamId(): string;
24
+ get dialNumber(): string;
25
+ get wrapupCodes(): IWrapupCode[];
26
+ get currentTask(): ITask;
27
+ get isAgentLoggedIn(): boolean;
28
+ get taskList(): Record<string, ITask>;
29
+ get currentState(): string;
30
+ get lastStateChangeTimestamp(): number;
31
+ get lastIdleCodeChangeTimestamp(): number;
32
+ get showMultipleLoginAlert(): boolean;
33
+ get currentTheme(): string;
34
+ get customState(): ICustomState;
35
+ get consultStartTimeStamp(): number;
36
+ get callControlAudio(): MediaStream;
37
+ get isQueueConsultInProgress(): boolean;
38
+ get currentConsultQueueId(): string;
39
+ get isEndConsultEnabled(): boolean;
40
+ get allowConsultToQueue(): boolean;
41
+ get agentProfile(): AgentLoginProfile;
42
+ get isMuted(): boolean;
43
+ get isAddressBookEnabled(): boolean;
44
+ setIsMuted: (value: boolean) => void;
45
+ setCurrentTheme: (theme: string) => void;
46
+ setShowMultipleLoginAlert: (value: boolean) => void;
47
+ setDeviceType: (option: string) => void;
48
+ setTeamId: (id: string) => void;
49
+ setDialNumber: (input: string) => void;
50
+ setCurrentState: (state: string) => void;
51
+ setLastStateChangeTimestamp: (timestamp: number) => void;
52
+ setLastIdleCodeChangeTimestamp: (timestamp: number) => void;
53
+ setIsAgentLoggedIn: (value: boolean) => void;
54
+ setCurrentTask: (task: ITask | null, isClicked?: boolean) => void;
55
+ setOnError: (callback: (widgetName: string, error: Error) => void) => void;
56
+ refreshTaskList: () => void;
57
+ setWrapupCodes: (wrapupCodes: IWrapupCode[]) => void;
58
+ setConsultStartTimeStamp: (timestamp: number) => void;
59
+ setCallControlAudio: (audio: MediaStream | null) => void;
60
+ setIsQueueConsultInProgress: (value: boolean) => void;
61
+ setCurrentConsultQueueId: (queueId: string | null) => void;
62
+ setState: (state: ICustomState | IdleCode) => void;
63
+ setIncomingTaskCb: (callback: ({ task }: {
64
+ task: ITask;
65
+ }) => void) => void;
66
+ setTaskRejected: (callback: ((task: ITask, reason: string) => void) | undefined) => void;
67
+ setOutdialFailed: (callback: ((reason: string) => void) | undefined) => void;
68
+ setTaskAssigned: (callback: ((task: ITask) => void) | undefined) => void;
69
+ setTaskSelected: (callback: ((task: ITask, isClicked?: boolean) => void) | undefined) => void;
70
+ setCCCallback: (event: CC_EVENTS | TASK_EVENTS, callback: any) => void;
71
+ setTaskCallback: (event: TASK_EVENTS, callback: any, taskId: string) => void;
72
+ setAgentProfile: (profile: AgentLoginProfile) => void;
73
+ removeCCCallback: (event: CC_EVENTS) => void;
74
+ removeTaskCallback: (event: TASK_EVENTS, callback: any, taskId: string) => void;
75
+ init(options: InitParams): Promise<void>;
76
+ registerCC: (webex?: WithWebex["webex"]) => Promise<void>;
77
+ handleTaskRemove: (taskToRemove: ITask) => void;
78
+ handleTaskMuteState: (task: ITask) => void;
79
+ handleTaskEnd: () => void;
80
+ handleTaskAssigned: (event: any) => void;
81
+ handleTaskMedia: (track: any) => void;
82
+ handleConsultCreated: () => void;
83
+ handleConsulting: () => void;
84
+ handleConsultEnd: () => void;
85
+ handleConsultOffer: () => void;
86
+ handleConsultAccepted: (event: any) => void;
87
+ handleConsultQueueCancelled: () => void;
88
+ handleConferenceStarted: () => void;
89
+ handleConferenceEnded: () => void;
90
+ /**
91
+ * Register all task event listeners
92
+ * @param task - The task to register event listeners for
93
+ */
94
+ private registerTaskEventListeners;
95
+ handleIncomingTask: (event: any) => void;
96
+ handleStateChange: (data: any) => void;
97
+ handleMultiLoginCloseSession: (data: any) => void;
98
+ handleTaskMerged: (event: any) => void;
99
+ handleTaskHydrate: (event: any) => void;
100
+ handleTaskReject: (task: ITask, reason: string) => void;
101
+ handleOutdialFailed: (reason: string) => void;
102
+ getBuddyAgents: (mediaType?: string) => Promise<Array<BuddyDetails>>;
103
+ getQueues: (mediaType?: string, params?: ContactServiceQueueSearchParams) => Promise<{
104
+ data: ContactServiceQueue[];
105
+ meta: {
106
+ page: number;
107
+ pageSize: number;
108
+ total: number;
109
+ totalPages: number;
110
+ };
111
+ }>;
112
+ getEntryPoints: (params?: EntryPointSearchParams) => Promise<EntryPointListResponse>;
113
+ getAddressBookEntries: (params?: AddressBookEntrySearchParams) => Promise<AddressBookEntriesResponse>;
114
+ cleanUpStore: () => void;
115
+ setupIncomingTaskHandler: (ccSDK: IContactCenter) => void;
116
+ }
117
+ declare const storeWrapper: StoreWrapper;
118
+ export default storeWrapper;
@@ -0,0 +1,48 @@
1
+ import { ITask, Participant } from './store.types';
2
+ /**
3
+ * Determines if a task is an incoming task
4
+ * @param task - The task object
5
+ * @returns Whether the task is incoming
6
+ */
7
+ export declare const isIncomingTask: (task: ITask, agentId: string) => boolean;
8
+ export declare function getConsultMPCState(task: ITask, agentId: string): string;
9
+ /**
10
+ * Checks if the current agent is a secondary agent in a consultation scenario.
11
+ * Secondary agents are those who were consulted (not the original call owner).
12
+ * @param {Object} task - The task object containing interaction details
13
+ * @returns {boolean} True if this is a secondary agent (consulted party)
14
+ */
15
+ export declare function isSecondaryAgent(task: ITask): boolean;
16
+ /**
17
+ * Checks if the current agent is a secondary EP-DN (Entry Point Dial Number) agent.
18
+ * 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
+ */
22
+ 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
+ /**
27
+ * Retrieves the list of active conference participants excluding the current agent
28
+ * Filters out customers, supervisors, VVAs, and participants who have left
29
+ *
30
+ * @param task - The task object containing interaction data
31
+ * @param agentId - The ID of the current agent to exclude from results
32
+ * @returns Array of active agent participants in the conference
33
+ */
34
+ 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
+ export declare function isInteractionOnHold(task: ITask): boolean;
46
+ export declare const setmTypeForEPDN: (task: ITask, mType: string) => string;
47
+ export declare const findMediaResourceId: (task: ITask, mType: string) => string;
48
+ export declare const findHoldStatus: (task: ITask, mType: string, agentId: string) => boolean;
@@ -0,0 +1,2 @@
1
+ import { Profile } from './store.types';
2
+ export declare function getFeatureFlags(agentProfile: Profile): {};
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@webex/cc-store",
3
3
  "description": "Webex Contact Center Widgets: Widgets Store",
4
- "version": "1.28.0-eft.7",
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
- "license": "MIT",
7
+ "types": "dist/types/index.d.ts",
7
8
  "publishConfig": {
8
9
  "access": "public"
9
10
  },
@@ -12,15 +13,18 @@
12
13
  "package.json"
13
14
  ],
14
15
  "scripts": {
16
+ "clean": "rm -rf dist && rm -rf node_modules",
17
+ "clean:dist": "rm -rf dist",
15
18
  "build": "yarn run -T tsc",
16
- "build:src": "webpack && yarn run build",
19
+ "build:src": "yarn run clean:dist && webpack",
17
20
  "build:watch": "webpack --watch",
18
- "test:unit": "jest"
21
+ "test:unit": "tsc --project tsconfig.test.json && jest --coverage",
22
+ "test:styles": "eslint",
23
+ "deploy:npm": "yarn npm publish"
19
24
  },
20
25
  "dependencies": {
26
+ "@webex/contact-center": "3.10.0-next.17",
21
27
  "mobx": "6.13.5",
22
- "react": "18.3.1",
23
- "react-dom": "18.3.1",
24
28
  "typescript": "5.6.3"
25
29
  },
26
30
  "devDependencies": {
@@ -28,24 +32,32 @@
28
32
  "@babel/preset-env": "7.25.4",
29
33
  "@babel/preset-react": "7.24.7",
30
34
  "@babel/preset-typescript": "7.25.9",
35
+ "@eslint/js": "^9.20.0",
31
36
  "@testing-library/dom": "10.4.0",
32
37
  "@testing-library/jest-dom": "6.6.2",
33
38
  "@testing-library/react": "16.0.1",
34
39
  "@types/jest": "29.5.14",
35
40
  "@types/react-test-renderer": "18",
41
+ "@webex/test-fixtures": "0.0.0",
36
42
  "babel-jest": "29.7.0",
37
43
  "babel-loader": "9.2.1",
44
+ "eslint": "^9.20.1",
45
+ "eslint-config-prettier": "^10.0.1",
46
+ "eslint-config-standard": "^17.1.0",
47
+ "eslint-plugin-import": "^2.25.2",
48
+ "eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
49
+ "eslint-plugin-prettier": "^5.2.3",
50
+ "eslint-plugin-promise": "^6.0.0",
51
+ "eslint-plugin-react": "^7.37.4",
38
52
  "file-loader": "6.2.0",
53
+ "globals": "^16.0.0",
39
54
  "jest": "29.7.0",
40
55
  "jest-environment-jsdom": "29.7.0",
56
+ "prettier": "^3.5.1",
41
57
  "ts-loader": "9.5.1",
58
+ "typescript-eslint": "^8.24.1",
42
59
  "webpack": "5.94.0",
43
60
  "webpack-cli": "5.1.4",
44
61
  "webpack-merge": "6.0.1"
45
- },
46
- "jest": {
47
- "testEnvironment": "jsdom",
48
- "passWithNoTests": true
49
- },
50
- "stableVersion": "1.28.0-eft.6"
62
+ }
51
63
  }
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAC5B,kBAAe,eAAK,CAAC"}