@webex/cc-store 1.28.0-eft.8 → 1.28.0-next.2
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 +2 -8
- package/dist/index.js.LICENSE.txt +71 -0
- package/dist/types/constants.d.ts +25 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/store.d.ts +39 -29
- package/dist/types/store.types.d.ts +243 -0
- package/dist/types/storeEventsWrapper.d.ts +121 -0
- package/dist/types/task-utils.d.ts +48 -0
- package/dist/types/util.d.ts +2 -0
- package/package.json +24 -12
- package/dist/index.js.map +0 -1
- package/dist/sdk.js +0 -71
- package/dist/sdk.js.map +0 -1
- package/dist/store.js +0 -27
- package/dist/store.js.map +0 -1
- package/dist/types/sdk.d.ts +0 -24
|
@@ -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";
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/store.d.ts
CHANGED
|
@@ -1,32 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
+
isDeclineButtonEnabled: boolean;
|
|
23
|
+
currentConsultQueueId: string;
|
|
24
|
+
consultStartTimeStamp: any;
|
|
25
|
+
lastStateChangeTimestamp?: number;
|
|
26
|
+
lastIdleCodeChangeTimestamp?: number;
|
|
27
|
+
showMultipleLoginAlert: boolean;
|
|
28
|
+
callControlAudio: MediaStream | null;
|
|
29
|
+
featureFlags: {
|
|
30
|
+
[key: string]: boolean;
|
|
26
31
|
};
|
|
32
|
+
isEndConsultEnabled: boolean;
|
|
33
|
+
isAddressBookEnabled: boolean;
|
|
34
|
+
allowConsultToQueue: boolean;
|
|
35
|
+
agentProfile: AgentLoginProfile;
|
|
36
|
+
isMuted: boolean;
|
|
27
37
|
constructor();
|
|
28
|
-
|
|
29
|
-
|
|
38
|
+
static getInstance(): Store;
|
|
39
|
+
registerCC(webex?: WithWebex['webex']): Promise<void>;
|
|
40
|
+
init(options: InitParams, setupEventListeners: any): Promise<void>;
|
|
30
41
|
}
|
|
31
|
-
|
|
32
|
-
export default store;
|
|
42
|
+
export default Store;
|
|
@@ -0,0 +1,243 @@
|
|
|
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
|
+
isDeclineButtonEnabled: boolean;
|
|
82
|
+
currentConsultQueueId: string;
|
|
83
|
+
consultStartTimeStamp?: number;
|
|
84
|
+
callControlAudio: MediaStream | null;
|
|
85
|
+
isEndConsultEnabled: boolean;
|
|
86
|
+
allowConsultToQueue: boolean;
|
|
87
|
+
agentProfile: AgentLoginProfile;
|
|
88
|
+
isMuted: boolean;
|
|
89
|
+
isAddressBookEnabled: boolean;
|
|
90
|
+
init(params: InitParams, callback: (ccSDK: IContactCenter) => void): Promise<void>;
|
|
91
|
+
registerCC(webex?: WithWebex['webex']): Promise<void>;
|
|
92
|
+
}
|
|
93
|
+
interface IStoreWrapper extends IStore {
|
|
94
|
+
store: IStore;
|
|
95
|
+
onErrorCallback?: (widgetName: string, error: Error) => void;
|
|
96
|
+
setCurrentTask(task: ITask): void;
|
|
97
|
+
refreshTaskList(): void;
|
|
98
|
+
getBuddyAgents(mediaType?: string): Promise<BuddyDetails[]>;
|
|
99
|
+
getQueues(mediaType?: string, params?: ContactServiceQueueSearchParams): Promise<ContactServiceQueuesResponse>;
|
|
100
|
+
getEntryPoints(params?: EntryPointSearchParams): Promise<EntryPointListResponse>;
|
|
101
|
+
getAddressBookEntries(params?: AddressBookEntrySearchParams): Promise<AddressBookEntriesResponse>;
|
|
102
|
+
setDeviceType(option: string): void;
|
|
103
|
+
setDialNumber(input: string): void;
|
|
104
|
+
setCurrentState(state: string): void;
|
|
105
|
+
setLastStateChangeTimestamp(timestamp: number): void;
|
|
106
|
+
setLastIdleCodeChangeTimestamp(timestamp: number): void;
|
|
107
|
+
setShowMultipleLoginAlert(value: boolean): void;
|
|
108
|
+
setCurrentTheme(theme: string): void;
|
|
109
|
+
setIsAgentLoggedIn(value: boolean): void;
|
|
110
|
+
setWrapupCodes(wrapupCodes: IWrapupCode[]): void;
|
|
111
|
+
setState(state: IdleCode | ICustomState): void;
|
|
112
|
+
setConsultStartTimeStamp(timestamp: number): void;
|
|
113
|
+
setAgentProfile(profile: Profile): void;
|
|
114
|
+
setTeamId(id: string): void;
|
|
115
|
+
setIsMuted(value: boolean): void;
|
|
116
|
+
setIsDeclineButtonEnabled(value: boolean): void;
|
|
117
|
+
setOnError(callback: (widgetName: string, error: Error) => void): void;
|
|
118
|
+
}
|
|
119
|
+
interface IWrapupCode {
|
|
120
|
+
id: string;
|
|
121
|
+
name: string;
|
|
122
|
+
}
|
|
123
|
+
declare enum TASK_EVENTS {
|
|
124
|
+
TASK_INCOMING = "task:incoming",
|
|
125
|
+
TASK_ASSIGNED = "task:assigned",
|
|
126
|
+
TASK_MEDIA = "task:media",
|
|
127
|
+
TASK_HOLD = "task:hold",
|
|
128
|
+
TASK_UNHOLD = "task:unhold",
|
|
129
|
+
TASK_CONSULT = "task:consult",
|
|
130
|
+
TASK_CONSULT_END = "task:consultEnd",
|
|
131
|
+
TASK_CONSULT_ACCEPTED = "task:consultAccepted",
|
|
132
|
+
TASK_PAUSE = "task:pause",
|
|
133
|
+
TASK_RESUME = "task:resume",
|
|
134
|
+
TASK_END = "task:end",
|
|
135
|
+
TASK_WRAPUP = "task:wrapup",
|
|
136
|
+
TASK_REJECT = "task:rejected",
|
|
137
|
+
TASK_HYDRATE = "task:hydrate",
|
|
138
|
+
TASK_CONSULTING = "task:consulting",
|
|
139
|
+
TASK_CONSULT_QUEUE_CANCELLED = "task:consultQueueCancelled",
|
|
140
|
+
AGENT_CONTACT_ASSIGNED = "AgentContactAssigned",
|
|
141
|
+
CONTACT_RECORDING_PAUSED = "ContactRecordingPaused",
|
|
142
|
+
CONTACT_RECORDING_RESUMED = "ContactRecordingResumed",
|
|
143
|
+
AGENT_WRAPPEDUP = "AgentWrappedUp",
|
|
144
|
+
AGENT_OFFER_CONTACT = "AgentOfferContact",
|
|
145
|
+
AGENT_CONSULT_CREATED = "AgentConsultCreated",
|
|
146
|
+
TASK_RECORDING_PAUSED = "task:recordingPaused",
|
|
147
|
+
TASK_RECORDING_RESUMED = "task:recordingResumed",
|
|
148
|
+
TASK_OFFER_CONSULT = "task:offerConsult",
|
|
149
|
+
TASK_AUTO_ANSWERED = "task:autoAnswered",
|
|
150
|
+
TASK_CONFERENCE_ESTABLISHING = "task:conferenceEstablishing",
|
|
151
|
+
TASK_CONFERENCE_STARTED = "task:conferenceStarted",
|
|
152
|
+
TASK_CONFERENCE_FAILED = "task:conferenceFailed",
|
|
153
|
+
TASK_CONFERENCE_ENDED = "task:conferenceEnded",
|
|
154
|
+
TASK_PARTICIPANT_JOINED = "task:participantJoined",
|
|
155
|
+
TASK_PARTICIPANT_LEFT = "task:participantLeft",
|
|
156
|
+
TASK_CONFERENCE_TRANSFERRED = "task:conferenceTransferred",
|
|
157
|
+
TASK_CONFERENCE_TRANSFER_FAILED = "task:conferenceTransferFailed",
|
|
158
|
+
TASK_CONFERENCE_END_FAILED = "task:conferenceEndFailed",
|
|
159
|
+
TASK_PARTICIPANT_LEFT_FAILED = "task:participantLeftFailed",
|
|
160
|
+
TASK_MERGED = "task:merged",
|
|
161
|
+
TASK_POST_CALL_ACTIVITY = "task:postCallActivity",
|
|
162
|
+
TASK_OUTDIAL_FAILED = "task:outdialFailed"
|
|
163
|
+
}
|
|
164
|
+
declare enum CC_EVENTS {
|
|
165
|
+
AGENT_DN_REGISTERED = "agent:dnRegistered",
|
|
166
|
+
AGENT_LOGOUT_SUCCESS = "agent:logoutSuccess",
|
|
167
|
+
AGENT_STATION_LOGIN_SUCCESS = "agent:stationLoginSuccess",
|
|
168
|
+
AGENT_MULTI_LOGIN = "agent:multiLogin",
|
|
169
|
+
AGENT_STATE_CHANGE = "agent:stateChange",
|
|
170
|
+
AGENT_RELOGIN_SUCCESS = "agent:reloginSuccess",
|
|
171
|
+
AGENT_OFFER_CONSULT = "AgentOfferConsult"
|
|
172
|
+
}
|
|
173
|
+
interface ICustomStateSet {
|
|
174
|
+
name: string;
|
|
175
|
+
developerName: string;
|
|
176
|
+
}
|
|
177
|
+
interface ICustomStateReset {
|
|
178
|
+
reset: boolean;
|
|
179
|
+
}
|
|
180
|
+
type ICustomState = ICustomStateSet | ICustomStateReset;
|
|
181
|
+
declare const ENGAGED_LABEL = "ENGAGED";
|
|
182
|
+
declare const ENGAGED_USERNAME = "Engaged";
|
|
183
|
+
type AgentLoginProfile = {
|
|
184
|
+
agentName?: string;
|
|
185
|
+
orgId?: string;
|
|
186
|
+
profileType?: string;
|
|
187
|
+
deviceType?: string;
|
|
188
|
+
roles?: Array<string>;
|
|
189
|
+
mmProfile?: {
|
|
190
|
+
chat: number;
|
|
191
|
+
email: number;
|
|
192
|
+
social: number;
|
|
193
|
+
telephony: number;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
type PaginatedListParams = {
|
|
197
|
+
page: number;
|
|
198
|
+
pageSize: number;
|
|
199
|
+
search?: string;
|
|
200
|
+
};
|
|
201
|
+
type FetchPaginatedList<T> = (params: PaginatedListParams) => Promise<{
|
|
202
|
+
data: T[];
|
|
203
|
+
meta?: {
|
|
204
|
+
page?: number;
|
|
205
|
+
totalPages?: number;
|
|
206
|
+
};
|
|
207
|
+
}>;
|
|
208
|
+
type TransformPaginatedData<T, U> = (item: T, page: number, index: number) => U;
|
|
209
|
+
declare const DIAL_NUMBER: string;
|
|
210
|
+
declare const EXTENSION: string;
|
|
211
|
+
declare const DESKTOP: string;
|
|
212
|
+
declare const MEDIA_TYPE_TELEPHONY_LOWER = "telephony";
|
|
213
|
+
declare const MEDIA_TYPE_TELEPHONY_UPPER = "TELEPHONY";
|
|
214
|
+
declare const DEVICE_TYPE_BROWSER = "BROWSER";
|
|
215
|
+
declare const AGENT_STATE_AVAILABLE = "Available";
|
|
216
|
+
declare const LoginOptions: {
|
|
217
|
+
[key: string]: string;
|
|
218
|
+
};
|
|
219
|
+
declare const ERROR_TRIGGERING_IDLE_CODES: {
|
|
220
|
+
INVALID_NUMBER: string;
|
|
221
|
+
UNAVAILABLE: string;
|
|
222
|
+
DECLINED: string;
|
|
223
|
+
BUSY: string;
|
|
224
|
+
CHANNEL_FAILURE: string;
|
|
225
|
+
RONA: string;
|
|
226
|
+
};
|
|
227
|
+
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, };
|
|
228
|
+
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, };
|
|
229
|
+
export declare enum ConsultStatus {
|
|
230
|
+
NO_CONSULTATION_IN_PROGRESS = "No consultation in progress",
|
|
231
|
+
BEING_CONSULTED = "beingConsulted",
|
|
232
|
+
CONSULT_INITIATED = "consultInitiated",
|
|
233
|
+
BEING_CONSULTED_ACCEPTED = "beingConsultedAccepted",
|
|
234
|
+
CONSULT_ACCEPTED = "consultAccepted",
|
|
235
|
+
CONNECTED = "connected",
|
|
236
|
+
CONFERENCE = "conference",
|
|
237
|
+
CONSULT_COMPLETED = "consultCompleted"
|
|
238
|
+
}
|
|
239
|
+
export type Participant = {
|
|
240
|
+
id: string;
|
|
241
|
+
pType: 'Customer' | 'Agent' | string;
|
|
242
|
+
name?: string;
|
|
243
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
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 isDeclineButtonEnabled(): boolean;
|
|
39
|
+
get currentConsultQueueId(): string;
|
|
40
|
+
get isEndConsultEnabled(): boolean;
|
|
41
|
+
get allowConsultToQueue(): boolean;
|
|
42
|
+
get agentProfile(): AgentLoginProfile;
|
|
43
|
+
get isMuted(): boolean;
|
|
44
|
+
get isAddressBookEnabled(): boolean;
|
|
45
|
+
setIsMuted: (value: boolean) => void;
|
|
46
|
+
setCurrentTheme: (theme: string) => void;
|
|
47
|
+
setShowMultipleLoginAlert: (value: boolean) => void;
|
|
48
|
+
setDeviceType: (option: string) => void;
|
|
49
|
+
setTeamId: (id: string) => void;
|
|
50
|
+
setDialNumber: (input: string) => void;
|
|
51
|
+
setCurrentState: (state: string) => void;
|
|
52
|
+
setLastStateChangeTimestamp: (timestamp: number) => void;
|
|
53
|
+
setLastIdleCodeChangeTimestamp: (timestamp: number) => void;
|
|
54
|
+
setIsAgentLoggedIn: (value: boolean) => void;
|
|
55
|
+
setCurrentTask: (task: ITask | null, isClicked?: boolean) => void;
|
|
56
|
+
setOnError: (callback: (widgetName: string, error: Error) => void) => void;
|
|
57
|
+
refreshTaskList: () => void;
|
|
58
|
+
setWrapupCodes: (wrapupCodes: IWrapupCode[]) => void;
|
|
59
|
+
setConsultStartTimeStamp: (timestamp: number) => void;
|
|
60
|
+
setCallControlAudio: (audio: MediaStream | null) => void;
|
|
61
|
+
setIsQueueConsultInProgress: (value: boolean) => void;
|
|
62
|
+
setIsDeclineButtonEnabled: (value: boolean) => void;
|
|
63
|
+
setCurrentConsultQueueId: (queueId: string | null) => void;
|
|
64
|
+
setState: (state: ICustomState | IdleCode) => void;
|
|
65
|
+
setIncomingTaskCb: (callback: ({ task }: {
|
|
66
|
+
task: ITask;
|
|
67
|
+
}) => void) => void;
|
|
68
|
+
setTaskRejected: (callback: ((task: ITask, reason: string) => void) | undefined) => void;
|
|
69
|
+
setOutdialFailed: (callback: ((reason: string) => void) | undefined) => void;
|
|
70
|
+
setTaskAssigned: (callback: ((task: ITask) => void) | undefined) => void;
|
|
71
|
+
setTaskSelected: (callback: ((task: ITask, isClicked?: boolean) => void) | undefined) => void;
|
|
72
|
+
setCCCallback: (event: CC_EVENTS | TASK_EVENTS, callback: any) => void;
|
|
73
|
+
setTaskCallback: (event: TASK_EVENTS, callback: any, taskId: string) => void;
|
|
74
|
+
setAgentProfile: (profile: AgentLoginProfile) => void;
|
|
75
|
+
removeCCCallback: (event: CC_EVENTS) => void;
|
|
76
|
+
removeTaskCallback: (event: TASK_EVENTS, callback: any, taskId: string) => void;
|
|
77
|
+
init(options: InitParams): Promise<void>;
|
|
78
|
+
registerCC: (webex?: WithWebex["webex"]) => Promise<void>;
|
|
79
|
+
handleTaskRemove: (taskToRemove: ITask) => void;
|
|
80
|
+
handleTaskMuteState: (task: ITask) => void;
|
|
81
|
+
handleTaskEnd: () => void;
|
|
82
|
+
handleTaskAssigned: (event: any) => void;
|
|
83
|
+
handleTaskMedia: (track: any) => void;
|
|
84
|
+
handleConsultCreated: () => void;
|
|
85
|
+
handleConsulting: () => void;
|
|
86
|
+
handleConsultEnd: () => void;
|
|
87
|
+
handleConsultOffer: () => void;
|
|
88
|
+
handleAutoAnswer: () => void;
|
|
89
|
+
handleConsultAccepted: (event: any) => void;
|
|
90
|
+
handleConsultQueueCancelled: () => void;
|
|
91
|
+
handleConferenceStarted: () => void;
|
|
92
|
+
handleConferenceEnded: () => void;
|
|
93
|
+
/**
|
|
94
|
+
* Register all task event listeners
|
|
95
|
+
* @param task - The task to register event listeners for
|
|
96
|
+
*/
|
|
97
|
+
private registerTaskEventListeners;
|
|
98
|
+
handleIncomingTask: (event: any) => void;
|
|
99
|
+
handleStateChange: (data: any) => void;
|
|
100
|
+
handleMultiLoginCloseSession: (data: any) => void;
|
|
101
|
+
handleTaskMerged: (event: any) => void;
|
|
102
|
+
handleTaskHydrate: (event: any) => void;
|
|
103
|
+
handleTaskReject: (task: ITask, reason: string) => void;
|
|
104
|
+
handleOutdialFailed: (reason: string) => void;
|
|
105
|
+
getBuddyAgents: (mediaType?: string) => Promise<Array<BuddyDetails>>;
|
|
106
|
+
getQueues: (mediaType?: string, params?: ContactServiceQueueSearchParams) => Promise<{
|
|
107
|
+
data: ContactServiceQueue[];
|
|
108
|
+
meta: {
|
|
109
|
+
page: number;
|
|
110
|
+
pageSize: number;
|
|
111
|
+
total: number;
|
|
112
|
+
totalPages: number;
|
|
113
|
+
};
|
|
114
|
+
}>;
|
|
115
|
+
getEntryPoints: (params?: EntryPointSearchParams) => Promise<EntryPointListResponse>;
|
|
116
|
+
getAddressBookEntries: (params?: AddressBookEntrySearchParams) => Promise<AddressBookEntriesResponse>;
|
|
117
|
+
cleanUpStore: () => void;
|
|
118
|
+
setupIncomingTaskHandler: (ccSDK: IContactCenter) => void;
|
|
119
|
+
}
|
|
120
|
+
declare const storeWrapper: StoreWrapper;
|
|
121
|
+
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;
|
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
|
-
"
|
|
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
6
|
"main": "dist/index.js",
|
|
6
|
-
"
|
|
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": "
|
|
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.20",
|
|
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-next.1",
|
|
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.0.0"
|
|
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"}
|