@webex/cc-store 1.28.0-next.4 → 1.28.0-next.41
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 +1 -1
- package/dist/index.js.LICENSE.txt +4 -0
- package/dist/types/constants.d.ts +4 -10
- package/dist/types/store.d.ts +30 -1
- package/dist/types/store.types.d.ts +308 -58
- package/dist/types/storeEventsWrapper.d.ts +127 -14
- package/dist/types/task-utils.d.ts +4 -16
- package/package.json +9 -3
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { IStoreWrapper, IStore, InitParams, TASK_EVENTS, CC_EVENTS, IWrapupCode, WithWebex, ICustomState, IdleCode, IContactCenter, ITask, BuddyDetails,
|
|
1
|
+
import { IStoreWrapper, IStore, InitParams, TASK_EVENTS, CC_EVENTS, IWrapupCode, WithWebex, ICustomState, IdleCode, IContactCenter, ITask, BuddyDetails, ContactServiceQueuesResponse, ContactServiceQueueSearchParams, EntryPointListResponse, EntryPointSearchParams, AddressBookEntriesResponse, AddressBookEntrySearchParams, AgentLoginProfile, RealTimeTranscriptionEventPayload, RealTimeAssistPayload, OfferActionErrorDisplay, WellnessBreakEvent, WellnessBreakState, WidgetsBehavioralMetric } from './store.types';
|
|
2
|
+
import type { AISummaryEntry, AISummaryResponseSubmissionResult, AISummaryRole } from './store.types';
|
|
3
|
+
import type { AISummary, AISummaryAction, AISummaryFeedback, AISummaryResponse, AISummarySections } from '@webex/contact-center';
|
|
2
4
|
declare class StoreWrapper implements IStoreWrapper {
|
|
3
5
|
store: IStore;
|
|
4
6
|
onIncomingTask: ({ task }: {
|
|
@@ -9,6 +11,16 @@ declare class StoreWrapper implements IStoreWrapper {
|
|
|
9
11
|
onTaskAssigned?: (task: ITask) => void;
|
|
10
12
|
onTaskSelected?: (task: ITask, isClicked: boolean) => void;
|
|
11
13
|
onErrorCallback?: (widgetName: string, error: Error) => void;
|
|
14
|
+
private realtimeTranscriptionListeners;
|
|
15
|
+
private taskListRefreshScheduled;
|
|
16
|
+
private realTimeAssistListeners;
|
|
17
|
+
private wxAppMuteStateListeners;
|
|
18
|
+
private taskEndListeners;
|
|
19
|
+
private muteStateByInteractionId;
|
|
20
|
+
private aiSummaryTaskListeners;
|
|
21
|
+
private aiSummaryRequestGeneration;
|
|
22
|
+
private applyAISummaryEnablement;
|
|
23
|
+
private applyAISummaryConfig;
|
|
12
24
|
constructor();
|
|
13
25
|
get featureFlags(): {
|
|
14
26
|
[key: string]: boolean;
|
|
@@ -36,13 +48,73 @@ declare class StoreWrapper implements IStoreWrapper {
|
|
|
36
48
|
get callControlAudio(): MediaStream;
|
|
37
49
|
get isQueueConsultInProgress(): boolean;
|
|
38
50
|
get isDeclineButtonEnabled(): boolean;
|
|
51
|
+
get isDigitalChannelsInitialized(): boolean;
|
|
52
|
+
get dataCenter(): string;
|
|
53
|
+
get realtimeTranscriptionData(): Partial<import("./store.types").RealTimeTranscriptionData>[];
|
|
54
|
+
get acceptedCampaignIds(): Set<string>;
|
|
55
|
+
get showE911Modal(): boolean;
|
|
56
|
+
get isEmergencyModalAlreadyDisplayed(): boolean;
|
|
57
|
+
/** Read-only host init flag — see `webexConfig.cc.enableWxBetterTogether` at init. */
|
|
58
|
+
get enableWxBetterTogether(): boolean;
|
|
59
|
+
get realTimeAssist(): Record<string, RealTimeAssistPayload[]>;
|
|
60
|
+
get aiSummaries(): Record<string, Partial<Record<AISummaryRole, AISummaryEntry>>>;
|
|
61
|
+
get isWellnessBreakEnabled(): boolean;
|
|
62
|
+
get wellnessAgentSessionId(): string;
|
|
63
|
+
get wellbeingBreakIdleCode(): IdleCode;
|
|
64
|
+
get wellnessIdleCodeLookupPending(): boolean;
|
|
65
|
+
get wellnessBreakState(): WellnessBreakState;
|
|
66
|
+
get wellnessEventSequence(): number;
|
|
67
|
+
get legacyAgentState(): string;
|
|
68
|
+
get legacyAuxCodeId(): string;
|
|
69
|
+
setDataCenter: (value: string) => void;
|
|
39
70
|
get currentConsultQueueId(): string;
|
|
71
|
+
get lastConsultDestination(): {
|
|
72
|
+
to: string;
|
|
73
|
+
destinationType: import("node_modules/@webex/contact-center/dist/types/services/task/types").DestinationType;
|
|
74
|
+
};
|
|
40
75
|
get isEndConsultEnabled(): boolean;
|
|
41
76
|
get allowConsultToQueue(): boolean;
|
|
42
77
|
get agentProfile(): AgentLoginProfile;
|
|
43
78
|
get isMuted(): boolean;
|
|
44
79
|
get isAddressBookEnabled(): boolean;
|
|
80
|
+
setDigitalChannelsInitialized: (value: boolean) => void;
|
|
45
81
|
setIsMuted: (value: boolean) => void;
|
|
82
|
+
private isTelephonyTask;
|
|
83
|
+
private persistTelephonyMuteCacheForCurrentTask;
|
|
84
|
+
private clearTelephonyMuteCache;
|
|
85
|
+
private setIsMutedForTaskSwitch;
|
|
86
|
+
private restoreCachedMuteForTelephonyTask;
|
|
87
|
+
get offerActionErrors(): Record<string, OfferActionErrorDisplay>;
|
|
88
|
+
setOfferActionError: (interactionId: string, error: OfferActionErrorDisplay | null) => void;
|
|
89
|
+
clearOfferActionError: (interactionId: string) => void;
|
|
90
|
+
pruneOfferActionErrors: (activeInteractionIds: Set<string>) => void;
|
|
91
|
+
loadWellbeingBreakIdleCode: () => Promise<void>;
|
|
92
|
+
setWellnessBreakState: (state: WellnessBreakState) => void;
|
|
93
|
+
submitBehavioralMetric: ({ name, agent, target, verb, properties }: WidgetsBehavioralMetric) => void;
|
|
94
|
+
resetWellnessSession: () => void;
|
|
95
|
+
private captureWellnessSession;
|
|
96
|
+
handleWellnessBreak: (payload: WellnessBreakEvent) => void;
|
|
97
|
+
requestMidCallSummary: (action: AISummaryAction, task?: ITask) => Promise<AISummary | undefined>;
|
|
98
|
+
requestPostCallSummary: (task?: ITask) => Promise<AISummary | undefined>;
|
|
99
|
+
private requestAISummary;
|
|
100
|
+
private updateAISummaryResponse;
|
|
101
|
+
/** Keeps local edits in the response while retaining the displayed SDK summary as the baseline. */
|
|
102
|
+
editAISummary: (role: Exclude<AISummaryRole, "receiver">, key: keyof AISummarySections | "summaryText", value: string, expectedSummary: AISummary | undefined, task?: ITask) => boolean;
|
|
103
|
+
recordAISummaryCopied: (role: AISummaryRole, expectedSummary: AISummary | undefined, task?: ITask) => boolean;
|
|
104
|
+
/** Initiator and post-call feedback is kept locally until the owning call action submits it. */
|
|
105
|
+
setAISummaryFeedback: (role: Exclude<AISummaryRole, "receiver">, feedback: AISummaryFeedback, expectedSummary: AISummary | undefined, task?: ITask) => boolean;
|
|
106
|
+
/** Excluding a summary changes only the next action's local response; the SDK payload stays intact. */
|
|
107
|
+
setAISummaryExcluded: (excluded: boolean, expectedSummary: AISummary | undefined, task?: ITask) => boolean;
|
|
108
|
+
private sendReceiverSummaryAction;
|
|
109
|
+
/** Receiver actions belong to the displayed adaptive card, including earlier incoming summaries. */
|
|
110
|
+
setReceiverSummaryFeedback: (feedback: AISummaryFeedback, expectedSummary: AISummary, task?: ITask) => Promise<void>;
|
|
111
|
+
/**
|
|
112
|
+
* Reports the initiator's summary for the consult or transfer that is starting and returns the submission outcome.
|
|
113
|
+
* A failed send is reported without rejecting, so the consult or transfer can continue.
|
|
114
|
+
*/
|
|
115
|
+
sendMidCallSummaryResponse: (action: AISummaryAction, task?: ITask, state?: AISummaryResponse["state"]) => Promise<AISummaryResponseSubmissionResult>;
|
|
116
|
+
/** Adds the wrap-up code to the post-call response and sends it before the task is wrapped up. */
|
|
117
|
+
sendPostCallSummaryResponse: (wrapUpCode: string, task: ITask) => Promise<AISummaryResponseSubmissionResult>;
|
|
46
118
|
setCurrentTheme: (theme: string) => void;
|
|
47
119
|
setShowMultipleLoginAlert: (value: boolean) => void;
|
|
48
120
|
setDeviceType: (option: string) => void;
|
|
@@ -52,15 +124,27 @@ declare class StoreWrapper implements IStoreWrapper {
|
|
|
52
124
|
setLastStateChangeTimestamp: (timestamp: number) => void;
|
|
53
125
|
setLastIdleCodeChangeTimestamp: (timestamp: number) => void;
|
|
54
126
|
setIsAgentLoggedIn: (value: boolean) => void;
|
|
127
|
+
private getCanonicalTask;
|
|
128
|
+
private isWxAppEngagedTelephonyTask;
|
|
129
|
+
private seedWxAppMuteFromTask;
|
|
55
130
|
setCurrentTask: (task: ITask | null, isClicked?: boolean) => void;
|
|
56
131
|
setOnError: (callback: (widgetName: string, error: Error) => void) => void;
|
|
57
132
|
refreshTaskList: () => void;
|
|
133
|
+
/**
|
|
134
|
+
* Terminal task events are emitted before the SDK removes the task from its collection.
|
|
135
|
+
* Defer and coalesce that authoritative read so ended calls disappear without a page refresh.
|
|
136
|
+
*/
|
|
137
|
+
private scheduleTaskListRefresh;
|
|
58
138
|
setWrapupCodes: (wrapupCodes: IWrapupCode[]) => void;
|
|
59
139
|
setConsultStartTimeStamp: (timestamp: number) => void;
|
|
60
140
|
setCallControlAudio: (audio: MediaStream | null) => void;
|
|
61
141
|
setIsQueueConsultInProgress: (value: boolean) => void;
|
|
62
142
|
setIsDeclineButtonEnabled: (value: boolean) => void;
|
|
63
143
|
setCurrentConsultQueueId: (queueId: string | null) => void;
|
|
144
|
+
setLastConsultDestination: (destination: {
|
|
145
|
+
to: string;
|
|
146
|
+
destinationType: string;
|
|
147
|
+
} | null) => void;
|
|
64
148
|
setState: (state: ICustomState | IdleCode) => void;
|
|
65
149
|
setIncomingTaskCb: (callback: ({ task }: {
|
|
66
150
|
task: ITask;
|
|
@@ -70,17 +154,35 @@ declare class StoreWrapper implements IStoreWrapper {
|
|
|
70
154
|
setTaskAssigned: (callback: ((task: ITask) => void) | undefined) => void;
|
|
71
155
|
setTaskSelected: (callback: ((task: ITask, isClicked?: boolean) => void) | undefined) => void;
|
|
72
156
|
setCCCallback: (event: CC_EVENTS | TASK_EVENTS, callback: any) => void;
|
|
73
|
-
setTaskCallback: (event: TASK_EVENTS, callback: any, taskId: string) => void;
|
|
157
|
+
setTaskCallback: (event: TASK_EVENTS, callback: any, taskId: string, task?: ITask) => void;
|
|
74
158
|
setAgentProfile: (profile: AgentLoginProfile) => void;
|
|
75
159
|
removeCCCallback: (event: CC_EVENTS) => void;
|
|
76
|
-
removeTaskCallback: (event: TASK_EVENTS, callback: any, taskId: string) => void;
|
|
160
|
+
removeTaskCallback: (event: TASK_EVENTS, callback: any, taskId: string, task?: ITask) => void;
|
|
77
161
|
init(options: InitParams): Promise<void>;
|
|
78
162
|
registerCC: (webex?: WithWebex["webex"]) => Promise<void>;
|
|
79
163
|
handleTaskRemove: (taskToRemove: ITask) => void;
|
|
80
164
|
handleTaskMuteState: (task: ITask) => void;
|
|
81
|
-
|
|
165
|
+
/**
|
|
166
|
+
* Checks if a task is a campaign preview interaction.
|
|
167
|
+
* Matches agent desktop logic that checks both outboundType and campaignType.
|
|
168
|
+
*/
|
|
169
|
+
private isCampaignPreview;
|
|
170
|
+
/**
|
|
171
|
+
* Handles the campaign preview reservation event (agent accepted the preview).
|
|
172
|
+
* Transitions state from RESERVED to ENGAGED, matching agent desktop behavior.
|
|
173
|
+
*/
|
|
174
|
+
addAcceptedCampaign: (interactionId: string) => void;
|
|
175
|
+
removeAcceptedCampaign: (interactionId: string) => void;
|
|
176
|
+
setShowE911Modal: (value: boolean) => void;
|
|
177
|
+
setIsEmergencyModalAlreadyDisplayed: (value: boolean) => void;
|
|
178
|
+
fetchUserPreferences: () => Promise<void>;
|
|
179
|
+
updateEmergencyModalAcknowledgment: () => Promise<void>;
|
|
180
|
+
handleCampaignPreviewReservation: (event: ITask) => void;
|
|
181
|
+
handleTaskEnd: (endedTask: ITask) => void;
|
|
82
182
|
handleTaskAssigned: (event: any) => void;
|
|
83
183
|
handleTaskMedia: (track: any) => void;
|
|
184
|
+
handleRealTimeAssist: (interactionId: string, payload: RealTimeAssistPayload) => void;
|
|
185
|
+
clearRealTimeAssist: (interactionId: string) => void;
|
|
84
186
|
handleConsultCreated: () => void;
|
|
85
187
|
handleConsulting: () => void;
|
|
86
188
|
handleConsultEnd: () => void;
|
|
@@ -94,26 +196,37 @@ declare class StoreWrapper implements IStoreWrapper {
|
|
|
94
196
|
* Register all task event listeners
|
|
95
197
|
* @param task - The task to register event listeners for
|
|
96
198
|
*/
|
|
199
|
+
handleUIControlsUpdated: () => void;
|
|
200
|
+
handleWxAppMuteStateUpdated: (payload: {
|
|
201
|
+
muted: boolean;
|
|
202
|
+
}, task: ITask) => void;
|
|
203
|
+
handleSwitchCall: () => void;
|
|
97
204
|
private registerTaskEventListeners;
|
|
98
205
|
handleIncomingTask: (event: any) => void;
|
|
206
|
+
/**
|
|
207
|
+
* Handles the initial arrival of a campaign task.
|
|
208
|
+
* The SDK emits TASK_CAMPAIGN_PREVIEW_RESERVATION for all campaign types.
|
|
209
|
+
* Only standard and direct preview campaigns should enter RESERVED state
|
|
210
|
+
* (the agent must explicitly accept/skip the preview contact).
|
|
211
|
+
* Predictive and progressive campaigns go straight to the regular flow —
|
|
212
|
+
* they will transition directly to ENGAGED via handleTaskAssigned.
|
|
213
|
+
*/
|
|
214
|
+
handleIncomingCampaignPreview: (event: ITask) => void;
|
|
99
215
|
handleStateChange: (data: any) => void;
|
|
100
216
|
handleMultiLoginCloseSession: (data: any) => void;
|
|
101
217
|
handleTaskMerged: (event: any) => void;
|
|
218
|
+
private getTaskInteractionId;
|
|
219
|
+
private getTaskInteractionState;
|
|
220
|
+
handleMultiLoginHydrate: (event: any) => void;
|
|
102
221
|
handleTaskHydrate: (event: any) => void;
|
|
103
222
|
handleTaskReject: (task: ITask, reason: string) => void;
|
|
104
223
|
handleOutdialFailed: (reason: string) => void;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
meta: {
|
|
109
|
-
page: number;
|
|
110
|
-
pageSize: number;
|
|
111
|
-
total: number;
|
|
112
|
-
totalPages: number;
|
|
113
|
-
};
|
|
114
|
-
}>;
|
|
224
|
+
handleRealtimeTranscription: (payload: RealTimeTranscriptionEventPayload) => void;
|
|
225
|
+
getBuddyAgents: (actionOrMediaType?: string) => Promise<Array<BuddyDetails>>;
|
|
226
|
+
getQueues: (mediaTypeOrParams?: string | ContactServiceQueueSearchParams, legacyParams?: ContactServiceQueueSearchParams) => Promise<ContactServiceQueuesResponse>;
|
|
115
227
|
getEntryPoints: (params?: EntryPointSearchParams) => Promise<EntryPointListResponse>;
|
|
116
228
|
getAddressBookEntries: (params?: AddressBookEntrySearchParams) => Promise<AddressBookEntriesResponse>;
|
|
229
|
+
getAccessToken: () => Promise<string>;
|
|
117
230
|
cleanUpStore: () => void;
|
|
118
231
|
setupIncomingTaskHandler: (ccSDK: IContactCenter) => void;
|
|
119
232
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { ITask, Participant } from './store.types';
|
|
1
|
+
import { ConferenceParticipantDropRoster, ITask, Participant } from './store.types';
|
|
2
2
|
/**
|
|
3
3
|
* Determines if a task is an incoming task
|
|
4
4
|
* @param task - The task object
|
|
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
|
|
@@ -33,19 +27,13 @@ export declare function getIsConferenceInProgress(task: ITask): boolean;
|
|
|
33
27
|
*/
|
|
34
28
|
export declare const getConferenceParticipants: (task: ITask, agentId: string) => Participant[];
|
|
35
29
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* @param task - The task object containing interaction data
|
|
40
|
-
* @returns Count of active agent participants
|
|
30
|
+
* Derives the owner-aware participant Drop roster from the active main-call media leg.
|
|
31
|
+
* The viewing agent is never returned as a target and backend authorization remains authoritative.
|
|
41
32
|
*/
|
|
42
|
-
export declare
|
|
43
|
-
export declare function getIsCustomerInCall(task: ITask): boolean;
|
|
44
|
-
export declare function getIsConsultInProgress(task: ITask): boolean;
|
|
33
|
+
export declare const getConferenceParticipantDropRoster: (task: ITask, agentId: string) => ConferenceParticipantDropRoster | null;
|
|
45
34
|
export declare function isInteractionOnHold(task: ITask): boolean;
|
|
46
35
|
export declare const setmTypeForEPDN: (task: ITask, mType: string) => string;
|
|
47
36
|
export declare const findMediaResourceId: (task: ITask, mType: string) => string;
|
|
48
|
-
export declare const findHoldStatus: (task: ITask, mType: string, agentId: string) => boolean;
|
|
49
37
|
/**
|
|
50
38
|
* Finds the hold timestamp for a specific media type (mainCall, consult, etc.)
|
|
51
39
|
* Used for timer alignment in Consult & Conference scenarios to match Agent Desktop behavior.
|
package/package.json
CHANGED
|
@@ -2,7 +2,12 @@
|
|
|
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
|
-
"
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/webex/widgets.git",
|
|
8
|
+
"directory": "packages/contact-center/store"
|
|
9
|
+
},
|
|
10
|
+
"version": "1.28.0-next.41",
|
|
6
11
|
"main": "dist/index.js",
|
|
7
12
|
"types": "dist/types/index.d.ts",
|
|
8
13
|
"publishConfig": {
|
|
@@ -18,12 +23,12 @@
|
|
|
18
23
|
"build": "yarn run -T tsc",
|
|
19
24
|
"build:src": "yarn run clean:dist && webpack",
|
|
20
25
|
"build:watch": "webpack --watch",
|
|
21
|
-
"test:unit": "tsc --project tsconfig.test.json && jest --coverage",
|
|
26
|
+
"test:unit": "tsc --project tsconfig.test.json && NODE_ENV=test jest --coverage",
|
|
22
27
|
"test:styles": "eslint",
|
|
23
28
|
"deploy:npm": "yarn npm publish"
|
|
24
29
|
},
|
|
25
30
|
"dependencies": {
|
|
26
|
-
"@webex/contact-center": "3.
|
|
31
|
+
"@webex/contact-center": "3.13.0-next.9",
|
|
27
32
|
"mobx": "6.13.5",
|
|
28
33
|
"typescript": "5.6.3"
|
|
29
34
|
},
|
|
@@ -38,6 +43,7 @@
|
|
|
38
43
|
"@testing-library/react": "16.0.1",
|
|
39
44
|
"@types/jest": "29.5.14",
|
|
40
45
|
"@types/react-test-renderer": "18",
|
|
46
|
+
"@webex/event-dictionary-ts": "^1.0.2191",
|
|
41
47
|
"@webex/test-fixtures": "0.0.0-next.1",
|
|
42
48
|
"babel-jest": "29.7.0",
|
|
43
49
|
"babel-loader": "9.2.1",
|