@webex/cc-store 1.28.0-next.36 → 1.28.0-next.37

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,234 @@
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';
4
+ declare class StoreWrapper implements IStoreWrapper {
5
+ store: IStore;
6
+ onIncomingTask: ({ task }: {
7
+ task: ITask;
8
+ }) => void;
9
+ onTaskRejected?: (task: ITask, reason: string) => void;
10
+ onOutdialFailed?: (reason: string) => void;
11
+ onTaskAssigned?: (task: ITask) => void;
12
+ onTaskSelected?: (task: ITask, isClicked: boolean) => void;
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;
24
+ constructor();
25
+ get featureFlags(): {
26
+ [key: string]: boolean;
27
+ };
28
+ get teams(): import("node_modules/@webex/contact-center/dist/types/types").Team[];
29
+ get loginOptions(): string[];
30
+ get cc(): IContactCenter;
31
+ get logger(): import("./store.types").ILogger;
32
+ get idleCodes(): IdleCode[];
33
+ get agentId(): string;
34
+ get deviceType(): string;
35
+ get teamId(): string;
36
+ get dialNumber(): string;
37
+ get wrapupCodes(): IWrapupCode[];
38
+ get currentTask(): ITask;
39
+ get isAgentLoggedIn(): boolean;
40
+ get taskList(): Record<string, ITask>;
41
+ get currentState(): string;
42
+ get lastStateChangeTimestamp(): number;
43
+ get lastIdleCodeChangeTimestamp(): number;
44
+ get showMultipleLoginAlert(): boolean;
45
+ get currentTheme(): string;
46
+ get customState(): ICustomState;
47
+ get consultStartTimeStamp(): number;
48
+ get callControlAudio(): MediaStream;
49
+ get isQueueConsultInProgress(): boolean;
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;
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
+ };
75
+ get isEndConsultEnabled(): boolean;
76
+ get allowConsultToQueue(): boolean;
77
+ get agentProfile(): AgentLoginProfile;
78
+ get isMuted(): boolean;
79
+ get isAddressBookEnabled(): boolean;
80
+ setDigitalChannelsInitialized: (value: boolean) => void;
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>;
118
+ setCurrentTheme: (theme: string) => void;
119
+ setShowMultipleLoginAlert: (value: boolean) => void;
120
+ setDeviceType: (option: string) => void;
121
+ setTeamId: (id: string) => void;
122
+ setDialNumber: (input: string) => void;
123
+ setCurrentState: (state: string) => void;
124
+ setLastStateChangeTimestamp: (timestamp: number) => void;
125
+ setLastIdleCodeChangeTimestamp: (timestamp: number) => void;
126
+ setIsAgentLoggedIn: (value: boolean) => void;
127
+ private getCanonicalTask;
128
+ private isWxAppEngagedTelephonyTask;
129
+ private seedWxAppMuteFromTask;
130
+ setCurrentTask: (task: ITask | null, isClicked?: boolean) => void;
131
+ setOnError: (callback: (widgetName: string, error: Error) => void) => void;
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;
138
+ setWrapupCodes: (wrapupCodes: IWrapupCode[]) => void;
139
+ setConsultStartTimeStamp: (timestamp: number) => void;
140
+ setCallControlAudio: (audio: MediaStream | null) => void;
141
+ setIsQueueConsultInProgress: (value: boolean) => void;
142
+ setIsDeclineButtonEnabled: (value: boolean) => void;
143
+ setCurrentConsultQueueId: (queueId: string | null) => void;
144
+ setLastConsultDestination: (destination: {
145
+ to: string;
146
+ destinationType: string;
147
+ } | null) => void;
148
+ setState: (state: ICustomState | IdleCode) => void;
149
+ setIncomingTaskCb: (callback: ({ task }: {
150
+ task: ITask;
151
+ }) => void) => void;
152
+ setTaskRejected: (callback: ((task: ITask, reason: string) => void) | undefined) => void;
153
+ setOutdialFailed: (callback: ((reason: string) => void) | undefined) => void;
154
+ setTaskAssigned: (callback: ((task: ITask) => void) | undefined) => void;
155
+ setTaskSelected: (callback: ((task: ITask, isClicked?: boolean) => void) | undefined) => void;
156
+ setCCCallback: (event: CC_EVENTS | TASK_EVENTS, callback: any) => void;
157
+ setTaskCallback: (event: TASK_EVENTS, callback: any, taskId: string, task?: ITask) => void;
158
+ setAgentProfile: (profile: AgentLoginProfile) => void;
159
+ removeCCCallback: (event: CC_EVENTS) => void;
160
+ removeTaskCallback: (event: TASK_EVENTS, callback: any, taskId: string, task?: ITask) => void;
161
+ init(options: InitParams): Promise<void>;
162
+ registerCC: (webex?: WithWebex["webex"]) => Promise<void>;
163
+ handleTaskRemove: (taskToRemove: ITask) => void;
164
+ handleTaskMuteState: (task: ITask) => void;
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;
182
+ handleTaskAssigned: (event: any) => void;
183
+ handleTaskMedia: (track: any) => void;
184
+ handleRealTimeAssist: (interactionId: string, payload: RealTimeAssistPayload) => void;
185
+ clearRealTimeAssist: (interactionId: string) => void;
186
+ handleConsultCreated: () => void;
187
+ handleConsulting: () => void;
188
+ handleConsultEnd: () => void;
189
+ handleConsultOffer: () => void;
190
+ handleAutoAnswer: () => void;
191
+ handleConsultAccepted: (event: any) => void;
192
+ handleConsultQueueCancelled: () => void;
193
+ handleConferenceStarted: () => void;
194
+ handleConferenceEnded: () => void;
195
+ /**
196
+ * Register all task event listeners
197
+ * @param task - The task to register event listeners for
198
+ */
199
+ handleUIControlsUpdated: () => void;
200
+ handleWxAppMuteStateUpdated: (payload: {
201
+ muted: boolean;
202
+ }, task: ITask) => void;
203
+ handleSwitchCall: () => void;
204
+ private registerTaskEventListeners;
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;
215
+ handleStateChange: (data: any) => void;
216
+ handleMultiLoginCloseSession: (data: any) => void;
217
+ handleTaskMerged: (event: any) => void;
218
+ private getTaskInteractionId;
219
+ private getTaskInteractionState;
220
+ handleMultiLoginHydrate: (event: any) => void;
221
+ handleTaskHydrate: (event: any) => void;
222
+ handleTaskReject: (task: ITask, reason: string) => void;
223
+ handleOutdialFailed: (reason: string) => void;
224
+ handleRealtimeTranscription: (payload: RealTimeTranscriptionEventPayload) => void;
225
+ getBuddyAgents: (actionOrMediaType?: string) => Promise<Array<BuddyDetails>>;
226
+ getQueues: (mediaTypeOrParams?: string | ContactServiceQueueSearchParams, legacyParams?: ContactServiceQueueSearchParams) => Promise<ContactServiceQueuesResponse>;
227
+ getEntryPoints: (params?: EntryPointSearchParams) => Promise<EntryPointListResponse>;
228
+ getAddressBookEntries: (params?: AddressBookEntrySearchParams) => Promise<AddressBookEntriesResponse>;
229
+ getAccessToken: () => Promise<string>;
230
+ cleanUpStore: () => void;
231
+ setupIncomingTaskHandler: (ccSDK: IContactCenter) => void;
232
+ }
233
+ declare const storeWrapper: StoreWrapper;
234
+ export default storeWrapper;
@@ -0,0 +1,45 @@
1
+ import { ConferenceParticipantDropRoster, 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
+ /**
9
+ * Checks if the current agent is a secondary agent in a consultation scenario.
10
+ * Secondary agents are those who were consulted (not the original call owner).
11
+ * @param {Object} task - The task object containing interaction details
12
+ * @returns {boolean} True if this is a secondary agent (consulted party)
13
+ */
14
+ export declare function isSecondaryAgent(task: ITask): boolean;
15
+ /**
16
+ * Checks if the current agent is a secondary EP-DN (Entry Point Dial Number) agent.
17
+ * This is specifically for telephony consultations to external numbers/entry points.
18
+ */
19
+ export declare function isSecondaryEpDnAgent(task: ITask): boolean;
20
+ /**
21
+ * Retrieves the list of active conference participants excluding the current agent
22
+ * Filters out customers, supervisors, VVAs, and participants who have left
23
+ *
24
+ * @param task - The task object containing interaction data
25
+ * @param agentId - The ID of the current agent to exclude from results
26
+ * @returns Array of active agent participants in the conference
27
+ */
28
+ export declare const getConferenceParticipants: (task: ITask, agentId: string) => Participant[];
29
+ /**
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.
32
+ */
33
+ export declare const getConferenceParticipantDropRoster: (task: ITask, agentId: string) => ConferenceParticipantDropRoster | null;
34
+ export declare function isInteractionOnHold(task: ITask): boolean;
35
+ export declare const setmTypeForEPDN: (task: ITask, mType: string) => string;
36
+ export declare const findMediaResourceId: (task: ITask, mType: string) => string;
37
+ /**
38
+ * Finds the hold timestamp for a specific media type (mainCall, consult, etc.)
39
+ * Used for timer alignment in Consult & Conference scenarios to match Agent Desktop behavior.
40
+ *
41
+ * @param task - The task object containing interaction data
42
+ * @param mType - The media type to search for ('mainCall', 'consult', 'conference')
43
+ * @returns The hold timestamp in milliseconds or null if not on hold
44
+ */
45
+ export declare const findHoldTimestamp: (task: ITask, mType: string) => number | null;
@@ -0,0 +1,2 @@
1
+ import { Profile } from './store.types';
2
+ export declare function getFeatureFlags(agentProfile: Profile): {};
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-next.36",
5
+ "version": "1.28.0-next.37",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/types/index.d.ts",
8
8
  "publishConfig": {