@webex/cc-store 1.28.0-ccwidgets.55 → 1.28.0-ccwidgets.57

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 CHANGED
@@ -12357,7 +12357,7 @@ eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ?
12357
12357
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
12358
12358
 
12359
12359
  "use strict";
12360
- eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst mobx_1 = __webpack_require__(/*! mobx */ \"../../../node_modules/mobx/dist/mobx.esm.js\");\nconst contact_center_1 = __importDefault(__webpack_require__(/*! webex/contact-center */ \"./node_modules/webex/dist/contact-center.js\"));\nconst util_1 = __webpack_require__(/*! ./util */ \"./src/util.ts\");\nclass Store {\n constructor() {\n this.teams = [];\n this.loginOptions = [];\n this.idleCodes = [];\n this.agentId = '';\n this.currentTheme = 'LIGHT';\n this.wrapupCodes = [];\n this.currentTask = null;\n this.isAgentLoggedIn = false;\n this.deviceType = '';\n this.taskList = {};\n this.dialNumber = '';\n this.currentState = '';\n this.customState = null;\n this.consultCompleted = false;\n this.consultInitiated = false;\n this.consultAccepted = false;\n this.isQueueConsultInProgress = false;\n this.currentConsultQueueId = '';\n this.consultStartTimeStamp = undefined;\n this.showMultipleLoginAlert = false;\n this.callControlAudio = null;\n this.consultOfferReceived = false;\n this.featureFlags = {};\n this.isEndConsultEnabled = false;\n this.allowConsultToQueue = false;\n this.taskMetaData = {};\n (0, mobx_1.makeAutoObservable)(this, {\n cc: mobx_1.observable.ref,\n });\n }\n static getInstance() {\n if (!Store.instance) {\n console.log('Creating new store instance');\n Store.instance = new Store();\n }\n console.log('Returning store instance');\n return Store.instance;\n }\n registerCC(webex) {\n if (webex) {\n this.cc = webex.cc;\n }\n if (typeof webex === 'undefined' && typeof this.cc === 'undefined') {\n throw new Error('Webex SDK not initialized');\n }\n this.logger = this.cc.LoggerProxy;\n return this.cc\n .register()\n .then((response) => {\n var _a;\n this.featureFlags = (0, util_1.getFeatureFlags)(response);\n this.teams = response.teams;\n this.loginOptions = response.webRtcEnabled\n ? response.loginVoiceOptions\n : response.loginVoiceOptions.filter((option) => option !== 'BROWSER');\n this.idleCodes = response.idleCodes;\n this.agentId = response.agentId;\n this.wrapupCodes = response.wrapupCodes;\n this.isAgentLoggedIn = response.isAgentLoggedIn;\n this.deviceType = (_a = response.deviceType) !== null && _a !== void 0 ? _a : 'AGENT_DN';\n this.dialNumber = response.defaultDn;\n this.currentState = response.lastStateAuxCodeId;\n this.lastStateChangeTimestamp = response.lastStateChangeTimestamp;\n this.lastIdleCodeChangeTimestamp = response.lastIdleCodeChangeTimestamp;\n this.isEndConsultEnabled = response.isEndConsultEnabled;\n this.allowConsultToQueue = response.allowConsultToQueue;\n })\n .catch((error) => {\n this.logger.error(`Error registering contact center: ${error}`, {\n module: 'cc-store#store.ts',\n method: 'registerCC',\n });\n return Promise.reject(error);\n });\n }\n init(options, setupEventListeners) {\n if ('webex' in options) {\n // If devs decide to go with webex, they will have to listen to the ready event before calling init\n // This has to be documented\n setupEventListeners(options.webex.cc);\n return this.registerCC(options.webex);\n }\n return new Promise((resolve, reject) => {\n const timer = setTimeout(() => {\n reject(new Error('Webex SDK failed to initialize'));\n }, 6000);\n const webex = contact_center_1.default.init({\n config: options.webexConfig,\n credentials: {\n access_token: options.access_token,\n },\n });\n webex.once('ready', () => {\n setupEventListeners(webex.cc);\n clearTimeout(timer);\n this.registerCC(webex)\n .then(() => {\n resolve();\n })\n .catch((error) => {\n reject(error);\n });\n });\n });\n }\n}\nexports[\"default\"] = Store;\n\n\n//# sourceURL=webpack://@webex/cc-store/./src/store.ts?");
12360
+ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst mobx_1 = __webpack_require__(/*! mobx */ \"../../../node_modules/mobx/dist/mobx.esm.js\");\nconst contact_center_1 = __importDefault(__webpack_require__(/*! webex/contact-center */ \"./node_modules/webex/dist/contact-center.js\"));\nconst util_1 = __webpack_require__(/*! ./util */ \"./src/util.ts\");\nclass Store {\n constructor() {\n this.teams = [];\n this.loginOptions = [];\n this.idleCodes = [];\n this.agentId = '';\n this.currentTheme = 'LIGHT';\n this.wrapupCodes = [];\n this.currentTask = null;\n this.isAgentLoggedIn = false;\n this.deviceType = '';\n this.taskList = {};\n this.dialNumber = '';\n this.currentState = '';\n this.customState = null;\n this.consultCompleted = false;\n this.consultInitiated = false;\n this.consultAccepted = false;\n this.isQueueConsultInProgress = false;\n this.currentConsultQueueId = '';\n this.consultStartTimeStamp = undefined;\n this.showMultipleLoginAlert = false;\n this.callControlAudio = null;\n this.consultOfferReceived = false;\n this.featureFlags = {};\n this.isEndConsultEnabled = false;\n this.allowConsultToQueue = false;\n this.agentProfile = {};\n this.taskMetaData = {};\n (0, mobx_1.makeAutoObservable)(this, {\n cc: mobx_1.observable.ref,\n });\n }\n static getInstance() {\n if (!Store.instance) {\n console.log('Creating new store instance');\n Store.instance = new Store();\n }\n console.log('Returning store instance');\n return Store.instance;\n }\n registerCC(webex) {\n if (webex) {\n this.cc = webex.cc;\n }\n if (typeof webex === 'undefined' && typeof this.cc === 'undefined') {\n throw new Error('Webex SDK not initialized');\n }\n this.logger = this.cc.LoggerProxy;\n return this.cc\n .register()\n .then((response) => {\n var _a;\n this.featureFlags = (0, util_1.getFeatureFlags)(response);\n this.teams = response.teams;\n this.loginOptions = response.webRtcEnabled\n ? response.loginVoiceOptions\n : response.loginVoiceOptions.filter((option) => option !== 'BROWSER');\n this.idleCodes = response.idleCodes;\n this.agentId = response.agentId;\n this.wrapupCodes = response.wrapupCodes;\n this.isAgentLoggedIn = response.isAgentLoggedIn;\n this.deviceType = (_a = response.deviceType) !== null && _a !== void 0 ? _a : 'AGENT_DN';\n this.dialNumber = response.defaultDn;\n this.currentState = response.lastStateAuxCodeId;\n this.lastStateChangeTimestamp = response.lastStateChangeTimestamp;\n this.lastIdleCodeChangeTimestamp = response.lastIdleCodeChangeTimestamp;\n this.isEndConsultEnabled = response.isEndConsultEnabled;\n this.allowConsultToQueue = response.allowConsultToQueue;\n this.agentProfile.agentName = response.agentName;\n })\n .catch((error) => {\n this.logger.error(`Error registering contact center: ${error}`, {\n module: 'cc-store#store.ts',\n method: 'registerCC',\n });\n return Promise.reject(error);\n });\n }\n init(options, setupEventListeners) {\n if ('webex' in options) {\n // If devs decide to go with webex, they will have to listen to the ready event before calling init\n // This has to be documented\n setupEventListeners(options.webex.cc);\n return this.registerCC(options.webex);\n }\n return new Promise((resolve, reject) => {\n const timer = setTimeout(() => {\n reject(new Error('Webex SDK failed to initialize'));\n }, 6000);\n const webex = contact_center_1.default.init({\n config: options.webexConfig,\n credentials: {\n access_token: options.access_token,\n },\n });\n webex.once('ready', () => {\n setupEventListeners(webex.cc);\n clearTimeout(timer);\n this.registerCC(webex)\n .then(() => {\n resolve();\n })\n .catch((error) => {\n reject(error);\n });\n });\n });\n }\n}\nexports[\"default\"] = Store;\n\n\n//# sourceURL=webpack://@webex/cc-store/./src/store.ts?");
12361
12361
 
12362
12362
  /***/ }),
12363
12363
 
@@ -12368,7 +12368,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
12368
12368
  /***/ ((__unused_webpack_module, exports) => {
12369
12369
 
12370
12370
  "use strict";
12371
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ENGAGED_USERNAME = exports.ENGAGED_LABEL = exports.TASK_EVENTS = exports.CC_EVENTS = void 0;\nvar TASK_EVENTS;\n(function (TASK_EVENTS) {\n TASK_EVENTS[\"TASK_INCOMING\"] = \"task:incoming\";\n TASK_EVENTS[\"TASK_ASSIGNED\"] = \"task:assigned\";\n TASK_EVENTS[\"TASK_MEDIA\"] = \"task:media\";\n TASK_EVENTS[\"TASK_HOLD\"] = \"task:hold\";\n TASK_EVENTS[\"TASK_UNHOLD\"] = \"task:unhold\";\n TASK_EVENTS[\"TASK_CONSULT\"] = \"task:consult\";\n TASK_EVENTS[\"TASK_CONSULT_END\"] = \"task:consultEnd\";\n TASK_EVENTS[\"TASK_CONSULT_ACCEPTED\"] = \"task:consultAccepted\";\n TASK_EVENTS[\"TASK_PAUSE\"] = \"task:pause\";\n TASK_EVENTS[\"TASK_RESUME\"] = \"task:resume\";\n TASK_EVENTS[\"TASK_END\"] = \"task:end\";\n TASK_EVENTS[\"TASK_WRAPUP\"] = \"task:wrapup\";\n TASK_EVENTS[\"TASK_REJECT\"] = \"task:rejected\";\n TASK_EVENTS[\"TASK_HYDRATE\"] = \"task:hydrate\";\n TASK_EVENTS[\"TASK_CONSULTING\"] = \"task:consulting\";\n TASK_EVENTS[\"TASK_CONSULT_QUEUE_CANCELLED\"] = \"task:consultQueueCancelled\";\n TASK_EVENTS[\"AGENT_CONTACT_ASSIGNED\"] = \"AgentContactAssigned\";\n TASK_EVENTS[\"CONTACT_RECORDING_PAUSED\"] = \"ContactRecordingPaused\";\n TASK_EVENTS[\"CONTACT_RECORDING_RESUMED\"] = \"ContactRecordingResumed\";\n TASK_EVENTS[\"AGENT_WRAPPEDUP\"] = \"AgentWrappedUp\";\n TASK_EVENTS[\"AGENT_OFFER_CONTACT\"] = \"AgentOfferContact\";\n TASK_EVENTS[\"AGENT_CONSULT_CREATED\"] = \"AgentConsultCreated\";\n})(TASK_EVENTS || (exports.TASK_EVENTS = TASK_EVENTS = {})); // TODO: remove this once cc sdk exports this enum\n// Events that are received on the contact center SDK\n// TODO: Export & Import these constants from SDK\nvar CC_EVENTS;\n(function (CC_EVENTS) {\n CC_EVENTS[\"AGENT_DN_REGISTERED\"] = \"AgentDNRegistered\";\n CC_EVENTS[\"AGENT_LOGOUT_SUCCESS\"] = \"AgentLogoutSuccess\";\n CC_EVENTS[\"AGENT_STATION_LOGIN_SUCCESS\"] = \"AgentStationLoginSuccess\";\n CC_EVENTS[\"AGENT_MULTI_LOGIN\"] = \"agent:multiLogin\";\n CC_EVENTS[\"AGENT_STATE_CHANGE\"] = \"agent:stateChange\";\n CC_EVENTS[\"AGENT_RELOGIN_SUCCESS\"] = \"AgentReloginSuccess\";\n CC_EVENTS[\"AGENT_OFFER_CONSULT\"] = \"AgentOfferConsult\";\n})(CC_EVENTS || (exports.CC_EVENTS = CC_EVENTS = {}));\nconst ENGAGED_LABEL = 'ENGAGED';\nexports.ENGAGED_LABEL = ENGAGED_LABEL;\nconst ENGAGED_USERNAME = 'Engaged';\nexports.ENGAGED_USERNAME = ENGAGED_USERNAME;\n\n\n//# sourceURL=webpack://@webex/cc-store/./src/store.types.ts?");
12371
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ENGAGED_USERNAME = exports.ENGAGED_LABEL = exports.TASK_EVENTS = exports.CC_EVENTS = void 0;\nvar TASK_EVENTS;\n(function (TASK_EVENTS) {\n TASK_EVENTS[\"TASK_INCOMING\"] = \"task:incoming\";\n TASK_EVENTS[\"TASK_ASSIGNED\"] = \"task:assigned\";\n TASK_EVENTS[\"TASK_MEDIA\"] = \"task:media\";\n TASK_EVENTS[\"TASK_HOLD\"] = \"task:hold\";\n TASK_EVENTS[\"TASK_UNHOLD\"] = \"task:unhold\";\n TASK_EVENTS[\"TASK_CONSULT\"] = \"task:consult\";\n TASK_EVENTS[\"TASK_CONSULT_END\"] = \"task:consultEnd\";\n TASK_EVENTS[\"TASK_CONSULT_ACCEPTED\"] = \"task:consultAccepted\";\n TASK_EVENTS[\"TASK_PAUSE\"] = \"task:pause\";\n TASK_EVENTS[\"TASK_RESUME\"] = \"task:resume\";\n TASK_EVENTS[\"TASK_END\"] = \"task:end\";\n TASK_EVENTS[\"TASK_WRAPUP\"] = \"task:wrapup\";\n TASK_EVENTS[\"TASK_REJECT\"] = \"task:rejected\";\n TASK_EVENTS[\"TASK_HYDRATE\"] = \"task:hydrate\";\n TASK_EVENTS[\"TASK_CONSULTING\"] = \"task:consulting\";\n TASK_EVENTS[\"TASK_CONSULT_QUEUE_CANCELLED\"] = \"task:consultQueueCancelled\";\n TASK_EVENTS[\"AGENT_CONTACT_ASSIGNED\"] = \"AgentContactAssigned\";\n TASK_EVENTS[\"CONTACT_RECORDING_PAUSED\"] = \"ContactRecordingPaused\";\n TASK_EVENTS[\"CONTACT_RECORDING_RESUMED\"] = \"ContactRecordingResumed\";\n TASK_EVENTS[\"AGENT_WRAPPEDUP\"] = \"AgentWrappedUp\";\n TASK_EVENTS[\"AGENT_OFFER_CONTACT\"] = \"AgentOfferContact\";\n TASK_EVENTS[\"AGENT_CONSULT_CREATED\"] = \"AgentConsultCreated\";\n})(TASK_EVENTS || (exports.TASK_EVENTS = TASK_EVENTS = {})); // TODO: remove this once cc sdk exports this enum\n// Events that are received on the contact center SDK\n// TODO: Export & Import these constants from SDK\nvar CC_EVENTS;\n(function (CC_EVENTS) {\n CC_EVENTS[\"AGENT_DN_REGISTERED\"] = \"agent:dnRegistered\";\n CC_EVENTS[\"AGENT_LOGOUT_SUCCESS\"] = \"agent:logoutSuccess\";\n CC_EVENTS[\"AGENT_STATION_LOGIN_SUCCESS\"] = \"agent:stationLoginSuccess\";\n CC_EVENTS[\"AGENT_MULTI_LOGIN\"] = \"agent:multiLogin\";\n CC_EVENTS[\"AGENT_STATE_CHANGE\"] = \"agent:stateChange\";\n CC_EVENTS[\"AGENT_RELOGIN_SUCCESS\"] = \"agent:reloginSuccess\";\n CC_EVENTS[\"AGENT_OFFER_CONSULT\"] = \"AgentOfferConsult\";\n})(CC_EVENTS || (exports.CC_EVENTS = CC_EVENTS = {}));\nconst ENGAGED_LABEL = 'ENGAGED';\nexports.ENGAGED_LABEL = ENGAGED_LABEL;\nconst ENGAGED_USERNAME = 'Engaged';\nexports.ENGAGED_USERNAME = ENGAGED_USERNAME;\n\n\n//# sourceURL=webpack://@webex/cc-store/./src/store.types.ts?");
12372
12372
 
12373
12373
  /***/ }),
12374
12374
 
@@ -12379,7 +12379,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
12379
12379
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
12380
12380
 
12381
12381
  "use strict";
12382
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst store_types_1 = __webpack_require__(/*! ./store.types */ \"./src/store.types.ts\");\nconst store_1 = __importDefault(__webpack_require__(/*! ./store */ \"./src/store.ts\"));\nconst mobx_1 = __webpack_require__(/*! mobx */ \"../../../node_modules/mobx/dist/mobx.esm.js\");\nclass StoreWrapper {\n constructor() {\n this.setTaskMetaData = (taskId, data) => {\n this.store.taskMetaData[taskId] = data;\n };\n this.setCurrentTheme = (theme) => {\n this.store.currentTheme = theme;\n };\n this.setShowMultipleLoginAlert = (value) => {\n this.store.showMultipleLoginAlert = value;\n };\n this.setDeviceType = (option) => {\n this.store.deviceType = option;\n };\n this.setDialNumber = (input) => {\n this.store.dialNumber = input;\n };\n this.setCurrentState = (state) => {\n (0, mobx_1.runInAction)(() => {\n this.store.currentState = state;\n this.store.customState = null;\n });\n };\n this.setLastStateChangeTimestamp = (timestamp) => {\n (0, mobx_1.runInAction)(() => {\n this.store.lastStateChangeTimestamp = timestamp;\n });\n };\n this.setLastIdleCodeChangeTimestamp = (timestamp) => {\n (0, mobx_1.runInAction)(() => {\n this.store.lastIdleCodeChangeTimestamp = timestamp;\n });\n };\n this.setIsAgentLoggedIn = (value) => {\n this.store.isAgentLoggedIn = value;\n };\n this.setCurrentTask = (task) => {\n (0, mobx_1.runInAction)(() => {\n var _a, _b, _c;\n // Save data from the current task if it exists\n if (this.currentTask) {\n const interactionId = (_b = (_a = this.currentTask) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.interactionId;\n this.setTaskMetaData(interactionId, {\n consultCompleted: this.store.consultCompleted,\n consultInitiated: this.store.consultInitiated,\n consultAccepted: this.store.consultAccepted,\n isQueueConsultInProgress: this.store.isQueueConsultInProgress,\n currentConsultQueueId: this.store.currentConsultQueueId,\n consultStartTimeStamp: this.store.consultStartTimeStamp,\n consultOfferReceived: this.store.consultOfferReceived,\n });\n }\n // Update the current task\n this.store.currentTask = task ? Object.assign(Object.create(Object.getPrototypeOf(task)), task) : null;\n // Restore data for the new task if available\n const currentTaskMetaData = this.store.taskMetaData[(_c = task === null || task === void 0 ? void 0 : task.data) === null || _c === void 0 ? void 0 : _c.interactionId];\n if (currentTaskMetaData) {\n const { consultAccepted = false, consultInitiated = false, consultCompleted = false, isQueueConsultInProgress = false, currentConsultQueueId = null, consultStartTimeStamp = null, consultOfferReceived = false, } = currentTaskMetaData;\n this.setConsultAccepted(consultAccepted);\n this.setConsultInitiated(consultInitiated);\n this.setConsultCompleted(consultCompleted);\n this.setIsQueueConsultInProgress(isQueueConsultInProgress);\n this.setCurrentConsultQueueId(currentConsultQueueId);\n this.setConsultStartTimeStamp(consultStartTimeStamp);\n this.setConsultOfferReceived(consultOfferReceived);\n }\n });\n };\n this.refreshTaskList = () => {\n var _a, _b;\n (0, mobx_1.runInAction)(() => {\n this.store.taskList = this.store.cc.taskManager.getAllTasks();\n });\n if (this.currentTask) {\n this.setCurrentTask(this.taskList[(_b = (_a = this.currentTask) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.interactionId]);\n }\n else if (this.store.taskList.length > 0) {\n this.setCurrentTask(this.store.taskList[Object.keys(this.store.taskList)[0]]);\n }\n };\n this.setWrapupCodes = (wrapupCodes) => {\n this.store.wrapupCodes = wrapupCodes;\n };\n this.setConsultCompleted = (value) => {\n this.store.consultCompleted = value;\n };\n this.setConsultInitiated = (value) => {\n this.store.consultInitiated = value;\n };\n this.setConsultAccepted = (value) => {\n this.store.consultAccepted = value;\n };\n this.setConsultOfferReceived = (value) => {\n this.store.consultOfferReceived = value;\n };\n this.setConsultStartTimeStamp = (timestamp) => {\n this.store.consultStartTimeStamp = timestamp;\n };\n this.setCallControlAudio = (audio) => {\n this.store.callControlAudio = audio;\n };\n this.setIsQueueConsultInProgress = (value) => {\n (0, mobx_1.runInAction)(() => {\n this.store.isQueueConsultInProgress = value;\n });\n };\n this.setCurrentConsultQueueId = (queueId) => {\n (0, mobx_1.runInAction)(() => {\n this.store.currentConsultQueueId = queueId;\n });\n };\n this.setState = (state) => {\n if ('reset' in state) {\n (0, mobx_1.runInAction)(() => {\n this.store.customState = null;\n });\n return;\n }\n if ('id' in state) {\n (0, mobx_1.runInAction)(() => {\n this.setCurrentState(state.id);\n this.store.customState = null;\n });\n }\n else {\n (0, mobx_1.runInAction)(() => {\n this.store.customState = state;\n });\n }\n };\n this.setIncomingTaskCb = (callback) => {\n this.onIncomingTask = callback;\n };\n this.setTaskRejected = (callback) => {\n this.onTaskRejected = callback;\n };\n this.setTaskAssigned = (callback) => {\n this.onTaskAssigned = callback;\n };\n this.setCCCallback = (event, callback) => {\n if (!callback)\n return;\n this.store.cc.on(event, callback);\n };\n this.setTaskCallback = (event, callback, taskId) => {\n if (!callback)\n return;\n const task = this.store.taskList[taskId];\n if (!task)\n return;\n task.on(event, callback);\n };\n this.removeCCCallback = (event) => {\n this.store.cc.off(event);\n };\n this.removeTaskCallback = (event, callback, taskId) => {\n if (!callback)\n return;\n const task = this.store.taskList[taskId];\n if (!task)\n return;\n task.off(event, callback);\n };\n this.registerCC = (webex) => {\n return this.store.registerCC(webex);\n };\n this.handleTaskRemove = (taskId) => {\n const taskToRemove = this.store.taskList[taskId];\n if (taskToRemove) {\n taskToRemove.off(store_types_1.TASK_EVENTS.TASK_ASSIGNED, this.handleTaskAssigned);\n taskToRemove.off(store_types_1.TASK_EVENTS.TASK_END, this.handleTaskEnd);\n taskToRemove.off(store_types_1.TASK_EVENTS.TASK_REJECT, (reason) => this.handleTaskReject(taskToRemove, reason));\n taskToRemove.off(store_types_1.TASK_EVENTS.AGENT_WRAPPEDUP, this.handleTaskWrapUp);\n taskToRemove.off(store_types_1.TASK_EVENTS.TASK_CONSULTING, this.handleConsulting);\n taskToRemove.off(store_types_1.CC_EVENTS.AGENT_OFFER_CONSULT, this.handleConsultOffer);\n taskToRemove.off(store_types_1.TASK_EVENTS.TASK_CONSULT_END, this.handleConsultEnd);\n taskToRemove.off(store_types_1.TASK_EVENTS.TASK_CONSULT_ACCEPTED, this.handleConsultAccepted);\n taskToRemove.off(store_types_1.TASK_EVENTS.AGENT_CONSULT_CREATED, this.handleConsultCreated);\n taskToRemove.off(store_types_1.TASK_EVENTS.TASK_CONSULT_QUEUE_CANCELLED, this.handleConsultQueueCancelled);\n taskToRemove.off(store_types_1.TASK_EVENTS.AGENT_OFFER_CONTACT, this.refreshTaskList);\n if (this.deviceType === 'BROWSER') {\n taskToRemove.off(store_types_1.TASK_EVENTS.TASK_MEDIA, this.handleTaskMedia);\n this.setCallControlAudio(null);\n }\n }\n (0, mobx_1.runInAction)(() => {\n var _a;\n this.setConsultAccepted(false);\n this.setConsultInitiated(false);\n this.setConsultCompleted(false);\n delete this.taskMetaData[taskId];\n if (((_a = this.store.currentTask) === null || _a === void 0 ? void 0 : _a.data.interactionId) === taskId) {\n this.setCurrentTask(null);\n }\n this.setState({\n reset: true,\n });\n this.refreshTaskList();\n });\n };\n this.handleTaskEnd = () => {\n this.refreshTaskList();\n };\n this.handleTaskAssigned = (event) => {\n const task = event;\n if (this.onTaskAssigned) {\n this.onTaskAssigned(task);\n }\n (0, mobx_1.runInAction)(() => {\n var _a;\n if (this.currentTask) {\n this.setTaskMetaData(this.currentTask.data.interactionId, {\n consultCompleted: this.store.consultCompleted,\n consultInitiated: this.store.consultInitiated,\n consultAccepted: this.store.consultAccepted,\n isQueueConsultInProgress: this.store.isQueueConsultInProgress,\n currentConsultQueueId: this.store.currentConsultQueueId,\n consultStartTimeStamp: this.store.consultStartTimeStamp,\n consultOfferReceived: this.store.consultOfferReceived,\n });\n }\n else {\n this.setTaskMetaData((_a = task === null || task === void 0 ? void 0 : task.data) === null || _a === void 0 ? void 0 : _a.interactionId, {\n consultCompleted: false,\n consultInitiated: false,\n consultAccepted: false,\n isQueueConsultInProgress: false,\n currentConsultQueueId: '',\n consultStartTimeStamp: null,\n consultOfferReceived: false,\n });\n }\n if (this.consultAccepted) {\n this.setConsultAccepted(false);\n this.setConsultInitiated(false);\n this.setConsultCompleted(false);\n this.setConsultOfferReceived(false);\n }\n this.setCurrentTask(task);\n this.setState({\n developerName: store_types_1.ENGAGED_LABEL,\n name: store_types_1.ENGAGED_USERNAME,\n });\n });\n };\n this.handleTaskWrapUp = (task) => {\n var _a;\n this.handleTaskRemove((_a = task === null || task === void 0 ? void 0 : task.data) === null || _a === void 0 ? void 0 : _a.interactionId);\n };\n this.handleTaskMedia = (track) => {\n this.setCallControlAudio(new MediaStream([track]));\n };\n // Case to handle multi session\n this.handleConsultCreated = () => {\n this.setConsultInitiated(true);\n this.setConsultStartTimeStamp(Date.now());\n };\n this.handleConsulting = (event) => {\n this.setConsultCompleted(true);\n this.setCurrentTask(event);\n this.handleIncomingTask(event);\n this.setConsultStartTimeStamp(Date.now());\n };\n this.handleConsultEnd = (event) => {\n const task = event;\n this.setConsultInitiated(false);\n this.setIsQueueConsultInProgress(false);\n this.setCurrentConsultQueueId(null);\n if (this.consultAccepted) {\n this.setConsultAccepted(false);\n this.handleTaskRemove(task.data.interactionId);\n }\n else if (this.consultOfferReceived) {\n this.setConsultOfferReceived(false);\n this.handleTaskRemove(task.data.interactionId);\n }\n this.setConsultCompleted(false);\n this.setConsultStartTimeStamp(null);\n };\n this.handleConsultOffer = () => {\n this.setConsultOfferReceived(true);\n };\n this.handleConsultAccepted = (event) => {\n const task = event;\n (0, mobx_1.runInAction)(() => {\n this.setCurrentTask(task);\n this.setConsultAccepted(true);\n this.setConsultStartTimeStamp(Date.now());\n this.setConsultCompleted(true);\n this.setState({\n developerName: store_types_1.ENGAGED_LABEL,\n name: store_types_1.ENGAGED_USERNAME,\n });\n if (this.deviceType === 'BROWSER') {\n task.on(store_types_1.TASK_EVENTS.TASK_MEDIA, this.handleTaskMedia);\n }\n });\n };\n this.handleConsultQueueCancelled = () => {\n this.setConsultInitiated(false);\n this.setIsQueueConsultInProgress(false);\n this.setCurrentConsultQueueId(null);\n this.setConsultStartTimeStamp(null);\n };\n this.handleIncomingTask = (event) => {\n const task = event;\n // Attach event listeners to the task\n task.on(store_types_1.TASK_EVENTS.TASK_END, this.handleTaskEnd);\n // When we receive TASK_ASSIGNED the task was accepted by the agent and we need wrap up\n task.on(store_types_1.TASK_EVENTS.TASK_ASSIGNED, this.handleTaskAssigned);\n task.on(store_types_1.TASK_EVENTS.AGENT_OFFER_CONTACT, this.refreshTaskList);\n task.on(store_types_1.TASK_EVENTS.AGENT_CONSULT_CREATED, this.handleConsultCreated);\n task.on(store_types_1.TASK_EVENTS.TASK_CONSULT_QUEUE_CANCELLED, this.handleConsultQueueCancelled);\n if (this.deviceType === 'BROWSER') {\n task.on(store_types_1.TASK_EVENTS.TASK_MEDIA, this.handleTaskMedia);\n }\n // When we receive TASK_REJECT sdk changes the agent status\n // When we receive TASK_REJECT that means the task was not accepted by the agent and we wont need wrap up\n task.on(store_types_1.TASK_EVENTS.TASK_REJECT, (reason) => this.handleTaskReject(task, reason));\n task.on(store_types_1.TASK_EVENTS.AGENT_WRAPPEDUP, this.handleTaskWrapUp);\n task.on(store_types_1.TASK_EVENTS.TASK_CONSULTING, this.handleConsulting);\n task.on(store_types_1.TASK_EVENTS.TASK_CONSULT_ACCEPTED, this.handleConsultAccepted);\n task.on(store_types_1.CC_EVENTS.AGENT_OFFER_CONSULT, this.handleConsultOffer);\n task.on(store_types_1.TASK_EVENTS.TASK_CONSULT_END, this.handleConsultEnd);\n // In case of consulting we check if the task is already in the task list\n // If it is, we dont have to send the incoming task callback\n if (this.onIncomingTask && !this.taskList[task.data.interactionId]) {\n this.onIncomingTask({ task });\n }\n // We should update the task list in the store after sending the incoming task callback\n this.refreshTaskList();\n };\n this.handleStateChange = (data) => {\n var _a;\n if (data && typeof data === 'object' && data.type === 'AgentStateChangeSuccess') {\n const DEFAULT_CODE = '0'; // Default code when no aux code is present\n this.setCurrentState(((_a = data.auxCodeId) === null || _a === void 0 ? void 0 : _a.trim()) !== '' ? data.auxCodeId : DEFAULT_CODE);\n this.setLastStateChangeTimestamp(data.lastStateChangeTimestamp);\n this.setLastIdleCodeChangeTimestamp(data.lastIdleCodeChangeTimestamp);\n }\n };\n this.handleMultiLoginCloseSession = (data) => {\n if (data && typeof data === 'object' && data.type === 'AgentMultiLoginCloseSession') {\n this.setShowMultipleLoginAlert(true);\n }\n };\n this.handleTaskHydrate = (event) => {\n const task = event;\n task.on(store_types_1.TASK_EVENTS.TASK_END, this.handleTaskEnd);\n // When we receive TASK_ASSIGNED the task was accepted by the agent and we need wrap up\n task.on(store_types_1.TASK_EVENTS.TASK_ASSIGNED, this.handleTaskAssigned);\n task.on(store_types_1.TASK_EVENTS.AGENT_OFFER_CONTACT, this.refreshTaskList);\n task.on(store_types_1.TASK_EVENTS.TASK_CONSULT_ACCEPTED, this.handleConsultAccepted);\n task.on(store_types_1.TASK_EVENTS.AGENT_CONSULT_CREATED, this.handleConsultCreated);\n // When we receive TASK_REJECT sdk changes the agent status\n // When we receive TASK_REJECT that means the task was not accepted by the agent and we wont need wrap up\n task.on(store_types_1.TASK_EVENTS.TASK_REJECT, (reason) => this.handleTaskReject(task, reason));\n task.on(store_types_1.TASK_EVENTS.AGENT_WRAPPEDUP, this.handleTaskWrapUp);\n task.on(store_types_1.TASK_EVENTS.TASK_CONSULTING, this.handleConsulting);\n task.on(store_types_1.CC_EVENTS.AGENT_OFFER_CONSULT, this.handleConsultOffer);\n task.on(store_types_1.TASK_EVENTS.TASK_CONSULT_END, this.handleConsultEnd);\n task.on(store_types_1.TASK_EVENTS.TASK_CONSULT_QUEUE_CANCELLED, this.handleConsultQueueCancelled);\n if (this.deviceType === 'BROWSER') {\n task.on(store_types_1.TASK_EVENTS.TASK_MEDIA, this.handleTaskMedia);\n }\n this.refreshTaskList();\n this.setCurrentTask(task);\n if (task.data.interaction.state === 'consulting') {\n if (task.data.isConsulted) {\n this.setConsultAccepted(true);\n }\n else {\n this.setConsultInitiated(true);\n }\n this.setConsultStartTimeStamp(Date.now());\n this.setConsultCompleted(true);\n }\n this.setState({\n developerName: store_types_1.ENGAGED_LABEL,\n name: store_types_1.ENGAGED_USERNAME,\n });\n const { interaction } = task.data;\n const { isTerminated } = interaction;\n // Update call control states\n if (isTerminated) {\n if (!task.data.wrapUpRequired) {\n this.setState({\n reset: true,\n });\n }\n return;\n }\n };\n this.handleTaskReject = (task, reason) => {\n if (this.onTaskRejected) {\n this.onTaskRejected(task, reason || 'No reason provided');\n }\n this.handleTaskRemove(task.data.interactionId);\n };\n this.getBuddyAgents = () => __awaiter(this, void 0, void 0, function* () {\n try {\n const response = yield this.store.cc.getBuddyAgents({\n mediaType: 'telephony',\n state: 'Available',\n });\n return response.data.agentList;\n }\n catch (error) {\n return Promise.reject(error);\n }\n });\n this.getQueues = () => __awaiter(this, void 0, void 0, function* () {\n try {\n let queueList = yield this.store.cc.getQueues();\n queueList = queueList.filter((queue) => queue.channelType === 'TELEPHONY');\n return queueList;\n }\n catch (error) {\n console.error('Error fetching queues:', error);\n return Promise.reject(error);\n }\n });\n this.cleanUpStore = () => {\n (0, mobx_1.runInAction)(() => {\n this.setIsAgentLoggedIn(false);\n this.setDeviceType('AGENT_DN');\n this.setDialNumber('');\n this.setCurrentTask(null);\n this.refreshTaskList();\n this.setLastStateChangeTimestamp(undefined);\n this.setLastIdleCodeChangeTimestamp(undefined);\n this.setShowMultipleLoginAlert(false);\n this.setConsultStartTimeStamp(undefined);\n });\n };\n this.setupIncomingTaskHandler = (ccSDK) => {\n let listenersAdded = false;\n const handleLogOut = () => {\n this.cleanUpStore();\n removeEventListeners();\n listenersAdded = false;\n };\n const addEventListeners = () => {\n ccSDK.on(store_types_1.TASK_EVENTS.TASK_HYDRATE, this.handleTaskHydrate);\n ccSDK.on(store_types_1.CC_EVENTS.AGENT_STATE_CHANGE, this.handleStateChange);\n ccSDK.on(store_types_1.TASK_EVENTS.TASK_INCOMING, this.handleIncomingTask);\n ccSDK.on(store_types_1.CC_EVENTS.AGENT_MULTI_LOGIN, this.handleMultiLoginCloseSession);\n ccSDK.on(store_types_1.CC_EVENTS.AGENT_LOGOUT_SUCCESS, handleLogOut);\n };\n const removeEventListeners = () => {\n ccSDK.off(store_types_1.TASK_EVENTS.TASK_HYDRATE, this.handleTaskHydrate);\n ccSDK.off(store_types_1.CC_EVENTS.AGENT_STATE_CHANGE, this.handleStateChange);\n ccSDK.off(store_types_1.TASK_EVENTS.TASK_INCOMING, this.handleIncomingTask);\n ccSDK.off(store_types_1.CC_EVENTS.AGENT_MULTI_LOGIN, this.handleMultiLoginCloseSession);\n ccSDK.off(store_types_1.CC_EVENTS.AGENT_LOGOUT_SUCCESS, handleLogOut);\n };\n // TODO: https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-626777 Implement the de-register method and close the listener there\n const handleLogin = (payload) => {\n (0, mobx_1.runInAction)(() => {\n var _a;\n this.setIsAgentLoggedIn(true);\n this.setDeviceType(payload.deviceType);\n this.setDialNumber(payload.dn);\n this.setCurrentState(((_a = payload.auxCodeId) === null || _a === void 0 ? void 0 : _a.trim()) !== '' ? payload.auxCodeId : '0');\n this.setLastStateChangeTimestamp(payload.lastStateChangeTimestamp);\n this.setLastIdleCodeChangeTimestamp(payload.lastIdleCodeChangeTimestamp);\n });\n };\n ccSDK.on(store_types_1.CC_EVENTS.AGENT_STATION_LOGIN_SUCCESS, handleLogin);\n [store_types_1.CC_EVENTS.AGENT_DN_REGISTERED, store_types_1.CC_EVENTS.AGENT_RELOGIN_SUCCESS].forEach((event) => {\n ccSDK.on(`${event}`, () => {\n if (!listenersAdded) {\n addEventListeners();\n listenersAdded = true;\n }\n });\n });\n };\n this.store = store_1.default.getInstance();\n }\n // Proxy all methods and properties of the original store\n get featureFlags() {\n return this.store.featureFlags;\n }\n get teams() {\n return this.store.teams;\n }\n get loginOptions() {\n return this.store.loginOptions;\n }\n get cc() {\n return this.store.cc;\n }\n get logger() {\n return this.store.logger;\n }\n get idleCodes() {\n return this.store.idleCodes.filter((code) => {\n return code.name === 'RONA' || !code.isSystem;\n });\n }\n get agentId() {\n return this.store.agentId;\n }\n get deviceType() {\n return this.store.deviceType;\n }\n get dialNumber() {\n return this.store.dialNumber;\n }\n get wrapupCodes() {\n return this.store.wrapupCodes;\n }\n get currentTask() {\n return this.store.currentTask;\n }\n get isAgentLoggedIn() {\n return this.store.isAgentLoggedIn;\n }\n get taskList() {\n return this.store.taskList;\n }\n get currentState() {\n return this.store.currentState;\n }\n get lastStateChangeTimestamp() {\n return this.store.lastStateChangeTimestamp;\n }\n get lastIdleCodeChangeTimestamp() {\n return this.store.lastIdleCodeChangeTimestamp;\n }\n get showMultipleLoginAlert() {\n return this.store.showMultipleLoginAlert;\n }\n get currentTheme() {\n return this.store.currentTheme;\n }\n get customState() {\n return this.store.customState;\n }\n get consultCompleted() {\n return this.store.consultCompleted;\n }\n get consultInitiated() {\n return this.store.consultInitiated;\n }\n get consultAccepted() {\n return this.store.consultAccepted;\n }\n get consultStartTimeStamp() {\n return this.store.consultStartTimeStamp;\n }\n get callControlAudio() {\n return this.store.callControlAudio;\n }\n get consultOfferReceived() {\n return this.store.consultOfferReceived;\n }\n get isQueueConsultInProgress() {\n return this.store.isQueueConsultInProgress;\n }\n get currentConsultQueueId() {\n return this.store.currentConsultQueueId;\n }\n get isEndConsultEnabled() {\n return this.store.isEndConsultEnabled;\n }\n get allowConsultToQueue() {\n return this.store.allowConsultToQueue;\n }\n get taskMetaData() {\n return this.store.taskMetaData;\n }\n init(options) {\n return this.store.init(options, this.setupIncomingTaskHandler);\n }\n}\n// Create and export a single instance of the wrapper\nconst storeWrapper = new StoreWrapper();\nexports[\"default\"] = storeWrapper;\n\n\n//# sourceURL=webpack://@webex/cc-store/./src/storeEventsWrapper.ts?");
12382
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst store_types_1 = __webpack_require__(/*! ./store.types */ \"./src/store.types.ts\");\nconst store_1 = __importDefault(__webpack_require__(/*! ./store */ \"./src/store.ts\"));\nconst mobx_1 = __webpack_require__(/*! mobx */ \"../../../node_modules/mobx/dist/mobx.esm.js\");\nclass StoreWrapper {\n constructor() {\n this.setTaskMetaData = (taskId, data) => {\n this.store.taskMetaData[taskId] = data;\n };\n this.setCurrentTheme = (theme) => {\n this.store.currentTheme = theme;\n };\n this.setShowMultipleLoginAlert = (value) => {\n this.store.showMultipleLoginAlert = value;\n };\n this.setDeviceType = (option) => {\n this.store.deviceType = option;\n };\n this.setDialNumber = (input) => {\n this.store.dialNumber = input;\n };\n this.setCurrentState = (state) => {\n (0, mobx_1.runInAction)(() => {\n this.store.currentState = state;\n this.store.customState = null;\n });\n };\n this.setLastStateChangeTimestamp = (timestamp) => {\n (0, mobx_1.runInAction)(() => {\n this.store.lastStateChangeTimestamp = timestamp;\n });\n };\n this.setLastIdleCodeChangeTimestamp = (timestamp) => {\n (0, mobx_1.runInAction)(() => {\n this.store.lastIdleCodeChangeTimestamp = timestamp;\n });\n };\n this.setIsAgentLoggedIn = (value) => {\n this.store.isAgentLoggedIn = value;\n };\n this.setCurrentTask = (task) => {\n (0, mobx_1.runInAction)(() => {\n var _a, _b, _c;\n // Save data from the current task if it exists\n if (this.currentTask) {\n const interactionId = (_b = (_a = this.currentTask) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.interactionId;\n this.setTaskMetaData(interactionId, {\n consultCompleted: this.store.consultCompleted,\n consultInitiated: this.store.consultInitiated,\n consultAccepted: this.store.consultAccepted,\n isQueueConsultInProgress: this.store.isQueueConsultInProgress,\n currentConsultQueueId: this.store.currentConsultQueueId,\n consultStartTimeStamp: this.store.consultStartTimeStamp,\n consultOfferReceived: this.store.consultOfferReceived,\n });\n }\n // Update the current task\n this.store.currentTask = task ? Object.assign(Object.create(Object.getPrototypeOf(task)), task) : null;\n // Restore data for the new task if available\n const currentTaskMetaData = this.store.taskMetaData[(_c = task === null || task === void 0 ? void 0 : task.data) === null || _c === void 0 ? void 0 : _c.interactionId];\n if (currentTaskMetaData) {\n const { consultAccepted = false, consultInitiated = false, consultCompleted = false, isQueueConsultInProgress = false, currentConsultQueueId = null, consultStartTimeStamp = null, consultOfferReceived = false, } = currentTaskMetaData;\n this.setConsultAccepted(consultAccepted);\n this.setConsultInitiated(consultInitiated);\n this.setConsultCompleted(consultCompleted);\n this.setIsQueueConsultInProgress(isQueueConsultInProgress);\n this.setCurrentConsultQueueId(currentConsultQueueId);\n this.setConsultStartTimeStamp(consultStartTimeStamp);\n this.setConsultOfferReceived(consultOfferReceived);\n }\n });\n };\n this.refreshTaskList = () => {\n var _a, _b;\n (0, mobx_1.runInAction)(() => {\n this.store.taskList = this.store.cc.taskManager.getAllTasks();\n });\n if (this.currentTask) {\n this.setCurrentTask(this.taskList[(_b = (_a = this.currentTask) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.interactionId]);\n }\n else if (this.store.taskList.length > 0) {\n this.setCurrentTask(this.store.taskList[Object.keys(this.store.taskList)[0]]);\n }\n };\n this.setWrapupCodes = (wrapupCodes) => {\n this.store.wrapupCodes = wrapupCodes;\n };\n this.setConsultCompleted = (value) => {\n this.store.consultCompleted = value;\n };\n this.setConsultInitiated = (value) => {\n this.store.consultInitiated = value;\n };\n this.setConsultAccepted = (value) => {\n this.store.consultAccepted = value;\n };\n this.setConsultOfferReceived = (value) => {\n this.store.consultOfferReceived = value;\n };\n this.setConsultStartTimeStamp = (timestamp) => {\n this.store.consultStartTimeStamp = timestamp;\n };\n this.setCallControlAudio = (audio) => {\n this.store.callControlAudio = audio;\n };\n this.setIsQueueConsultInProgress = (value) => {\n (0, mobx_1.runInAction)(() => {\n this.store.isQueueConsultInProgress = value;\n });\n };\n this.setCurrentConsultQueueId = (queueId) => {\n (0, mobx_1.runInAction)(() => {\n this.store.currentConsultQueueId = queueId;\n });\n };\n this.setState = (state) => {\n if ('reset' in state) {\n (0, mobx_1.runInAction)(() => {\n this.store.customState = null;\n });\n return;\n }\n if ('id' in state) {\n (0, mobx_1.runInAction)(() => {\n this.setCurrentState(state.id);\n this.store.customState = null;\n });\n }\n else {\n (0, mobx_1.runInAction)(() => {\n this.store.customState = state;\n });\n }\n };\n this.setIncomingTaskCb = (callback) => {\n this.onIncomingTask = callback;\n };\n this.setTaskRejected = (callback) => {\n this.onTaskRejected = callback;\n };\n this.setTaskAssigned = (callback) => {\n this.onTaskAssigned = callback;\n };\n this.setCCCallback = (event, callback) => {\n if (!callback)\n return;\n this.store.cc.on(event, callback);\n };\n this.setTaskCallback = (event, callback, taskId) => {\n if (!callback)\n return;\n const task = this.store.taskList[taskId];\n if (!task)\n return;\n task.on(event, callback);\n };\n this.setAgentProfile = (profile) => {\n (0, mobx_1.runInAction)(() => {\n this.store.agentProfile = Object.assign(Object.assign({}, this.store.agentProfile), { profileType: profile.profileType || undefined, mmProfile: profile.mmProfile || undefined, orgId: profile.orgId || undefined, roles: profile.roles || undefined, deviceType: profile.deviceType || undefined });\n });\n };\n this.removeCCCallback = (event) => {\n this.store.cc.off(event);\n };\n this.removeTaskCallback = (event, callback, taskId) => {\n if (!callback)\n return;\n const task = this.store.taskList[taskId];\n if (!task)\n return;\n task.off(event, callback);\n };\n this.registerCC = (webex) => {\n return this.store.registerCC(webex);\n };\n this.handleTaskRemove = (taskId) => {\n const taskToRemove = this.store.taskList[taskId];\n if (taskToRemove) {\n taskToRemove.off(store_types_1.TASK_EVENTS.TASK_ASSIGNED, this.handleTaskAssigned);\n taskToRemove.off(store_types_1.TASK_EVENTS.TASK_END, this.handleTaskEnd);\n taskToRemove.off(store_types_1.TASK_EVENTS.TASK_REJECT, (reason) => this.handleTaskReject(taskToRemove, reason));\n taskToRemove.off(store_types_1.TASK_EVENTS.AGENT_WRAPPEDUP, this.handleTaskWrapUp);\n taskToRemove.off(store_types_1.TASK_EVENTS.TASK_CONSULTING, this.handleConsulting);\n taskToRemove.off(store_types_1.CC_EVENTS.AGENT_OFFER_CONSULT, this.handleConsultOffer);\n taskToRemove.off(store_types_1.TASK_EVENTS.TASK_CONSULT_END, this.handleConsultEnd);\n taskToRemove.off(store_types_1.TASK_EVENTS.TASK_CONSULT_ACCEPTED, this.handleConsultAccepted);\n taskToRemove.off(store_types_1.TASK_EVENTS.AGENT_CONSULT_CREATED, this.handleConsultCreated);\n taskToRemove.off(store_types_1.TASK_EVENTS.TASK_CONSULT_QUEUE_CANCELLED, this.handleConsultQueueCancelled);\n taskToRemove.off(store_types_1.TASK_EVENTS.AGENT_OFFER_CONTACT, this.refreshTaskList);\n if (this.deviceType === 'BROWSER') {\n taskToRemove.off(store_types_1.TASK_EVENTS.TASK_MEDIA, this.handleTaskMedia);\n this.setCallControlAudio(null);\n }\n }\n (0, mobx_1.runInAction)(() => {\n var _a;\n this.setConsultAccepted(false);\n this.setConsultInitiated(false);\n this.setConsultCompleted(false);\n delete this.taskMetaData[taskId];\n if (((_a = this.store.currentTask) === null || _a === void 0 ? void 0 : _a.data.interactionId) === taskId) {\n this.setCurrentTask(null);\n }\n this.setState({\n reset: true,\n });\n this.refreshTaskList();\n });\n };\n this.handleTaskEnd = () => {\n this.refreshTaskList();\n };\n this.handleTaskAssigned = (event) => {\n const task = event;\n if (this.onTaskAssigned) {\n this.onTaskAssigned(task);\n }\n (0, mobx_1.runInAction)(() => {\n var _a;\n if (this.currentTask) {\n this.setTaskMetaData(this.currentTask.data.interactionId, {\n consultCompleted: this.store.consultCompleted,\n consultInitiated: this.store.consultInitiated,\n consultAccepted: this.store.consultAccepted,\n isQueueConsultInProgress: this.store.isQueueConsultInProgress,\n currentConsultQueueId: this.store.currentConsultQueueId,\n consultStartTimeStamp: this.store.consultStartTimeStamp,\n consultOfferReceived: this.store.consultOfferReceived,\n });\n }\n else {\n this.setTaskMetaData((_a = task === null || task === void 0 ? void 0 : task.data) === null || _a === void 0 ? void 0 : _a.interactionId, {\n consultCompleted: false,\n consultInitiated: false,\n consultAccepted: false,\n isQueueConsultInProgress: false,\n currentConsultQueueId: '',\n consultStartTimeStamp: null,\n consultOfferReceived: false,\n });\n }\n if (this.consultAccepted) {\n this.setConsultAccepted(false);\n this.setConsultInitiated(false);\n this.setConsultCompleted(false);\n this.setConsultOfferReceived(false);\n }\n this.setCurrentTask(task);\n this.setState({\n developerName: store_types_1.ENGAGED_LABEL,\n name: store_types_1.ENGAGED_USERNAME,\n });\n });\n };\n this.handleTaskWrapUp = (task) => {\n var _a;\n this.handleTaskRemove((_a = task === null || task === void 0 ? void 0 : task.data) === null || _a === void 0 ? void 0 : _a.interactionId);\n };\n this.handleTaskMedia = (track) => {\n this.setCallControlAudio(new MediaStream([track]));\n };\n // Case to handle multi session\n this.handleConsultCreated = () => {\n this.setConsultInitiated(true);\n this.setConsultStartTimeStamp(Date.now());\n };\n this.handleConsulting = (event) => {\n this.setConsultCompleted(true);\n this.setCurrentTask(event);\n this.handleIncomingTask(event);\n this.setConsultStartTimeStamp(Date.now());\n };\n this.handleConsultEnd = (event) => {\n const task = event;\n this.setConsultInitiated(false);\n this.setIsQueueConsultInProgress(false);\n this.setCurrentConsultQueueId(null);\n if (this.consultAccepted) {\n this.setConsultAccepted(false);\n this.handleTaskRemove(task.data.interactionId);\n }\n else if (this.consultOfferReceived) {\n this.setConsultOfferReceived(false);\n this.handleTaskRemove(task.data.interactionId);\n }\n this.setConsultCompleted(false);\n this.setConsultStartTimeStamp(null);\n };\n this.handleConsultOffer = () => {\n this.setConsultOfferReceived(true);\n };\n this.handleConsultAccepted = (event) => {\n const task = event;\n (0, mobx_1.runInAction)(() => {\n this.setCurrentTask(task);\n this.setConsultAccepted(true);\n this.setConsultStartTimeStamp(Date.now());\n this.setConsultCompleted(true);\n this.setState({\n developerName: store_types_1.ENGAGED_LABEL,\n name: store_types_1.ENGAGED_USERNAME,\n });\n if (this.deviceType === 'BROWSER') {\n task.on(store_types_1.TASK_EVENTS.TASK_MEDIA, this.handleTaskMedia);\n }\n });\n };\n this.handleConsultQueueCancelled = () => {\n this.setConsultInitiated(false);\n this.setIsQueueConsultInProgress(false);\n this.setCurrentConsultQueueId(null);\n this.setConsultStartTimeStamp(null);\n };\n this.handleIncomingTask = (event) => {\n const task = event;\n // Attach event listeners to the task\n task.on(store_types_1.TASK_EVENTS.TASK_END, this.handleTaskEnd);\n // When we receive TASK_ASSIGNED the task was accepted by the agent and we need wrap up\n task.on(store_types_1.TASK_EVENTS.TASK_ASSIGNED, this.handleTaskAssigned);\n task.on(store_types_1.TASK_EVENTS.AGENT_OFFER_CONTACT, this.refreshTaskList);\n task.on(store_types_1.TASK_EVENTS.AGENT_CONSULT_CREATED, this.handleConsultCreated);\n task.on(store_types_1.TASK_EVENTS.TASK_CONSULT_QUEUE_CANCELLED, this.handleConsultQueueCancelled);\n if (this.deviceType === 'BROWSER') {\n task.on(store_types_1.TASK_EVENTS.TASK_MEDIA, this.handleTaskMedia);\n }\n // When we receive TASK_REJECT sdk changes the agent status\n // When we receive TASK_REJECT that means the task was not accepted by the agent and we wont need wrap up\n task.on(store_types_1.TASK_EVENTS.TASK_REJECT, (reason) => this.handleTaskReject(task, reason));\n task.on(store_types_1.TASK_EVENTS.AGENT_WRAPPEDUP, this.handleTaskWrapUp);\n task.on(store_types_1.TASK_EVENTS.TASK_CONSULTING, this.handleConsulting);\n task.on(store_types_1.TASK_EVENTS.TASK_CONSULT_ACCEPTED, this.handleConsultAccepted);\n task.on(store_types_1.CC_EVENTS.AGENT_OFFER_CONSULT, this.handleConsultOffer);\n task.on(store_types_1.TASK_EVENTS.TASK_CONSULT_END, this.handleConsultEnd);\n // In case of consulting we check if the task is already in the task list\n // If it is, we dont have to send the incoming task callback\n if (this.onIncomingTask && !this.taskList[task.data.interactionId]) {\n this.onIncomingTask({ task });\n }\n // We should update the task list in the store after sending the incoming task callback\n this.refreshTaskList();\n };\n this.handleStateChange = (data) => {\n var _a;\n if (data && typeof data === 'object' && data.type === 'AgentStateChangeSuccess') {\n const DEFAULT_CODE = '0'; // Default code when no aux code is present\n this.setCurrentState(((_a = data.auxCodeId) === null || _a === void 0 ? void 0 : _a.trim()) !== '' ? data.auxCodeId : DEFAULT_CODE);\n this.setLastStateChangeTimestamp(data.lastStateChangeTimestamp);\n this.setLastIdleCodeChangeTimestamp(data.lastIdleCodeChangeTimestamp);\n }\n };\n this.handleMultiLoginCloseSession = (data) => {\n if (data && typeof data === 'object' && data.type === 'AgentMultiLoginCloseSession') {\n this.setShowMultipleLoginAlert(true);\n }\n };\n this.handleTaskHydrate = (event) => {\n const task = event;\n task.on(store_types_1.TASK_EVENTS.TASK_END, this.handleTaskEnd);\n // When we receive TASK_ASSIGNED the task was accepted by the agent and we need wrap up\n task.on(store_types_1.TASK_EVENTS.TASK_ASSIGNED, this.handleTaskAssigned);\n task.on(store_types_1.TASK_EVENTS.AGENT_OFFER_CONTACT, this.refreshTaskList);\n task.on(store_types_1.TASK_EVENTS.TASK_CONSULT_ACCEPTED, this.handleConsultAccepted);\n task.on(store_types_1.TASK_EVENTS.AGENT_CONSULT_CREATED, this.handleConsultCreated);\n // When we receive TASK_REJECT sdk changes the agent status\n // When we receive TASK_REJECT that means the task was not accepted by the agent and we wont need wrap up\n task.on(store_types_1.TASK_EVENTS.TASK_REJECT, (reason) => this.handleTaskReject(task, reason));\n task.on(store_types_1.TASK_EVENTS.AGENT_WRAPPEDUP, this.handleTaskWrapUp);\n task.on(store_types_1.TASK_EVENTS.TASK_CONSULTING, this.handleConsulting);\n task.on(store_types_1.CC_EVENTS.AGENT_OFFER_CONSULT, this.handleConsultOffer);\n task.on(store_types_1.TASK_EVENTS.TASK_CONSULT_END, this.handleConsultEnd);\n task.on(store_types_1.TASK_EVENTS.TASK_CONSULT_QUEUE_CANCELLED, this.handleConsultQueueCancelled);\n if (this.deviceType === 'BROWSER') {\n task.on(store_types_1.TASK_EVENTS.TASK_MEDIA, this.handleTaskMedia);\n }\n this.refreshTaskList();\n this.setCurrentTask(task);\n if (task.data.interaction.state === 'consulting') {\n if (task.data.isConsulted) {\n this.setConsultAccepted(true);\n }\n else {\n this.setConsultInitiated(true);\n }\n this.setConsultStartTimeStamp(Date.now());\n this.setConsultCompleted(true);\n }\n this.setState({\n developerName: store_types_1.ENGAGED_LABEL,\n name: store_types_1.ENGAGED_USERNAME,\n });\n const { interaction } = task.data;\n const { isTerminated } = interaction;\n // Update call control states\n if (isTerminated) {\n if (!task.data.wrapUpRequired) {\n this.setState({\n reset: true,\n });\n }\n return;\n }\n };\n this.handleTaskReject = (task, reason) => {\n if (this.onTaskRejected) {\n this.onTaskRejected(task, reason || 'No reason provided');\n }\n this.handleTaskRemove(task.data.interactionId);\n };\n this.getBuddyAgents = (...args_1) => __awaiter(this, [...args_1], void 0, function* (mediaType = this.currentTask.data.interaction.mediaType) {\n try {\n const response = yield this.store.cc.getBuddyAgents({\n mediaType: mediaType !== null && mediaType !== void 0 ? mediaType : 'telephony',\n state: 'Available',\n });\n return response.data.agentList;\n }\n catch (error) {\n return Promise.reject(error);\n }\n });\n this.getQueues = (mediaType) => __awaiter(this, void 0, void 0, function* () {\n var _a;\n if (mediaType === void 0) { mediaType = (_a = this.currentTask.data.interaction.mediaType) !== null && _a !== void 0 ? _a : 'TELEPHONY'; }\n try {\n const upperMediaType = mediaType.toUpperCase();\n let queueList = yield this.store.cc.getQueues();\n queueList = queueList.filter((queue) => queue.channelType === upperMediaType);\n return queueList;\n }\n catch (error) {\n console.error('Error fetching queues:', error);\n return Promise.reject(error);\n }\n });\n this.cleanUpStore = () => {\n (0, mobx_1.runInAction)(() => {\n this.setIsAgentLoggedIn(false);\n this.setDeviceType('AGENT_DN');\n this.setDialNumber('');\n this.setCurrentTask(null);\n this.refreshTaskList();\n this.setLastStateChangeTimestamp(undefined);\n this.setLastIdleCodeChangeTimestamp(undefined);\n this.setShowMultipleLoginAlert(false);\n this.setConsultStartTimeStamp(undefined);\n });\n };\n this.setupIncomingTaskHandler = (ccSDK) => {\n let listenersAdded = false;\n const handleLogOut = () => {\n this.setAgentProfile({});\n this.cleanUpStore();\n removeEventListeners();\n listenersAdded = false;\n };\n const addEventListeners = () => {\n ccSDK.on(store_types_1.TASK_EVENTS.TASK_HYDRATE, this.handleTaskHydrate);\n ccSDK.on(store_types_1.CC_EVENTS.AGENT_STATE_CHANGE, this.handleStateChange);\n ccSDK.on(store_types_1.TASK_EVENTS.TASK_INCOMING, this.handleIncomingTask);\n ccSDK.on(store_types_1.CC_EVENTS.AGENT_MULTI_LOGIN, this.handleMultiLoginCloseSession);\n ccSDK.on(store_types_1.CC_EVENTS.AGENT_LOGOUT_SUCCESS, handleLogOut);\n };\n const removeEventListeners = () => {\n ccSDK.off(store_types_1.TASK_EVENTS.TASK_HYDRATE, this.handleTaskHydrate);\n ccSDK.off(store_types_1.CC_EVENTS.AGENT_STATE_CHANGE, this.handleStateChange);\n ccSDK.off(store_types_1.TASK_EVENTS.TASK_INCOMING, this.handleIncomingTask);\n ccSDK.off(store_types_1.CC_EVENTS.AGENT_MULTI_LOGIN, this.handleMultiLoginCloseSession);\n ccSDK.off(store_types_1.CC_EVENTS.AGENT_LOGOUT_SUCCESS, handleLogOut);\n };\n // TODO: https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-626777 Implement the de-register method and close the listener there\n const handleLogin = (payload) => {\n (0, mobx_1.runInAction)(() => {\n var _a;\n this.setAgentProfile(payload);\n this.setIsAgentLoggedIn(true);\n this.setDeviceType(payload.deviceType);\n this.setDialNumber(payload.dn);\n this.setCurrentState(((_a = payload.auxCodeId) === null || _a === void 0 ? void 0 : _a.trim()) !== '' ? payload.auxCodeId : '0');\n this.setLastStateChangeTimestamp(payload.lastStateChangeTimestamp);\n this.setLastIdleCodeChangeTimestamp(payload.lastIdleCodeChangeTimestamp);\n });\n };\n ccSDK.on(store_types_1.CC_EVENTS.AGENT_STATION_LOGIN_SUCCESS, handleLogin);\n [store_types_1.CC_EVENTS.AGENT_DN_REGISTERED, store_types_1.CC_EVENTS.AGENT_RELOGIN_SUCCESS].forEach((event) => {\n ccSDK.on(`${event}`, (payload) => {\n (0, mobx_1.runInAction)(() => {\n if (event === store_types_1.CC_EVENTS.AGENT_RELOGIN_SUCCESS) {\n this.setAgentProfile(payload);\n }\n });\n if (!listenersAdded) {\n addEventListeners();\n listenersAdded = true;\n }\n });\n });\n };\n this.store = store_1.default.getInstance();\n }\n // Proxy all methods and properties of the original store\n get featureFlags() {\n return this.store.featureFlags;\n }\n get teams() {\n return this.store.teams;\n }\n get loginOptions() {\n return this.store.loginOptions;\n }\n get cc() {\n return this.store.cc;\n }\n get logger() {\n return this.store.logger;\n }\n get idleCodes() {\n return this.store.idleCodes.filter((code) => {\n return code.name === 'RONA' || !code.isSystem;\n });\n }\n get agentId() {\n return this.store.agentId;\n }\n get deviceType() {\n return this.store.deviceType;\n }\n get dialNumber() {\n return this.store.dialNumber;\n }\n get wrapupCodes() {\n return this.store.wrapupCodes;\n }\n get currentTask() {\n return this.store.currentTask;\n }\n get isAgentLoggedIn() {\n return this.store.isAgentLoggedIn;\n }\n get taskList() {\n return this.store.taskList;\n }\n get currentState() {\n return this.store.currentState;\n }\n get lastStateChangeTimestamp() {\n return this.store.lastStateChangeTimestamp;\n }\n get lastIdleCodeChangeTimestamp() {\n return this.store.lastIdleCodeChangeTimestamp;\n }\n get showMultipleLoginAlert() {\n return this.store.showMultipleLoginAlert;\n }\n get currentTheme() {\n return this.store.currentTheme;\n }\n get customState() {\n return this.store.customState;\n }\n get consultCompleted() {\n return this.store.consultCompleted;\n }\n get consultInitiated() {\n return this.store.consultInitiated;\n }\n get consultAccepted() {\n return this.store.consultAccepted;\n }\n get consultStartTimeStamp() {\n return this.store.consultStartTimeStamp;\n }\n get callControlAudio() {\n return this.store.callControlAudio;\n }\n get consultOfferReceived() {\n return this.store.consultOfferReceived;\n }\n get isQueueConsultInProgress() {\n return this.store.isQueueConsultInProgress;\n }\n get currentConsultQueueId() {\n return this.store.currentConsultQueueId;\n }\n get isEndConsultEnabled() {\n return this.store.isEndConsultEnabled;\n }\n get allowConsultToQueue() {\n return this.store.allowConsultToQueue;\n }\n get taskMetaData() {\n return this.store.taskMetaData;\n }\n get agentProfile() {\n return this.store.agentProfile;\n }\n init(options) {\n return this.store.init(options, this.setupIncomingTaskHandler);\n }\n}\n// Create and export a single instance of the wrapper\nconst storeWrapper = new StoreWrapper();\nexports[\"default\"] = storeWrapper;\n\n\n//# sourceURL=webpack://@webex/cc-store/./src/storeEventsWrapper.ts?");
12383
12383
 
12384
12384
  /***/ }),
12385
12385
 
@@ -1,4 +1,4 @@
1
- import { IContactCenter, Team, WithWebex, IdleCode, InitParams, IStore, ILogger, IWrapupCode, ICustomState, TaskMetaData } from './store.types';
1
+ import { IContactCenter, Team, WithWebex, IdleCode, InitParams, IStore, ILogger, IWrapupCode, ICustomState, TaskMetaData, AgentLoginProfile } from './store.types';
2
2
  import { ITask } from '@webex/plugin-cc';
3
3
  declare class Store implements IStore {
4
4
  private static instance;
@@ -33,6 +33,7 @@ declare class Store implements IStore {
33
33
  };
34
34
  isEndConsultEnabled: boolean;
35
35
  allowConsultToQueue: boolean;
36
+ agentProfile: AgentLoginProfile;
36
37
  taskMetaData: Record<string, TaskMetaData>;
37
38
  constructor();
38
39
  static getInstance(): Store;
@@ -65,6 +65,7 @@ interface IStore {
65
65
  consultOfferReceived: boolean;
66
66
  isEndConsultEnabled: boolean;
67
67
  allowConsultToQueue: boolean;
68
+ agentProfile: AgentLoginProfile;
68
69
  init(params: InitParams, callback: (ccSDK: IContactCenter) => void): Promise<void>;
69
70
  registerCC(webex?: WithWebex['webex']): Promise<void>;
70
71
  }
@@ -86,6 +87,7 @@ interface IStoreWrapper extends IStore {
86
87
  setConsultInitiated(value: boolean): void;
87
88
  setConsultAccepted(value: boolean): void;
88
89
  setConsultStartTimeStamp(timestamp: number): void;
90
+ setAgentProfile(profile: Profile): void;
89
91
  }
90
92
  interface IWrapupCode {
91
93
  id: string;
@@ -116,12 +118,12 @@ declare enum TASK_EVENTS {
116
118
  AGENT_CONSULT_CREATED = "AgentConsultCreated"
117
119
  }
118
120
  declare enum CC_EVENTS {
119
- AGENT_DN_REGISTERED = "AgentDNRegistered",
120
- AGENT_LOGOUT_SUCCESS = "AgentLogoutSuccess",
121
- AGENT_STATION_LOGIN_SUCCESS = "AgentStationLoginSuccess",
121
+ AGENT_DN_REGISTERED = "agent:dnRegistered",
122
+ AGENT_LOGOUT_SUCCESS = "agent:logoutSuccess",
123
+ AGENT_STATION_LOGIN_SUCCESS = "agent:stationLoginSuccess",
122
124
  AGENT_MULTI_LOGIN = "agent:multiLogin",
123
125
  AGENT_STATE_CHANGE = "agent:stateChange",
124
- AGENT_RELOGIN_SUCCESS = "AgentReloginSuccess",
126
+ AGENT_RELOGIN_SUCCESS = "agent:reloginSuccess",
125
127
  AGENT_OFFER_CONSULT = "AgentOfferConsult"
126
128
  }
127
129
  interface ICustomStateSet {
@@ -134,5 +136,18 @@ interface ICustomStateReset {
134
136
  type ICustomState = ICustomStateSet | ICustomStateReset;
135
137
  declare const ENGAGED_LABEL = "ENGAGED";
136
138
  declare const ENGAGED_USERNAME = "Engaged";
137
- export type { IContactCenter, ITask, Profile, Team, AgentLogin, WithWebex, IdleCode, InitParams, IStore, ILogger, IWrapupCode, IStoreWrapper, ICustomState, DestinationType, BuddyDetails, ContactServiceQueue, TaskMetaData, };
139
+ type AgentLoginProfile = {
140
+ agentName?: string;
141
+ orgId?: string;
142
+ profileType?: string;
143
+ deviceType?: string;
144
+ roles?: Array<string>;
145
+ mmProfile?: {
146
+ chat: number;
147
+ email: number;
148
+ social: number;
149
+ telephony: number;
150
+ };
151
+ };
152
+ export type { IContactCenter, ITask, Profile, Team, AgentLogin, WithWebex, IdleCode, InitParams, IStore, ILogger, IWrapupCode, IStoreWrapper, ICustomState, DestinationType, BuddyDetails, ContactServiceQueue, TaskMetaData, AgentLoginProfile, };
138
153
  export { CC_EVENTS, TASK_EVENTS, ENGAGED_LABEL, ENGAGED_USERNAME };
@@ -1,4 +1,4 @@
1
- import { IStoreWrapper, IStore, InitParams, TASK_EVENTS, CC_EVENTS, IWrapupCode, WithWebex, ICustomState, IdleCode, IContactCenter, ITask, BuddyDetails, ContactServiceQueue, TaskMetaData } from './store.types';
1
+ import { IStoreWrapper, IStore, InitParams, TASK_EVENTS, CC_EVENTS, IWrapupCode, WithWebex, ICustomState, IdleCode, IContactCenter, ITask, BuddyDetails, ContactServiceQueue, TaskMetaData, AgentLoginProfile } from './store.types';
2
2
  declare class StoreWrapper implements IStoreWrapper {
3
3
  store: IStore;
4
4
  onIncomingTask: ({ task }: {
@@ -39,6 +39,7 @@ declare class StoreWrapper implements IStoreWrapper {
39
39
  get isEndConsultEnabled(): boolean;
40
40
  get allowConsultToQueue(): boolean;
41
41
  get taskMetaData(): Record<string, TaskMetaData>;
42
+ get agentProfile(): AgentLoginProfile;
42
43
  setTaskMetaData: (taskId: string, data: TaskMetaData) => void;
43
44
  setCurrentTheme: (theme: string) => void;
44
45
  setShowMultipleLoginAlert: (value: boolean) => void;
@@ -65,6 +66,7 @@ declare class StoreWrapper implements IStoreWrapper {
65
66
  setTaskAssigned: (callback: ((task: ITask) => void) | undefined) => void;
66
67
  setCCCallback: (event: CC_EVENTS | TASK_EVENTS, callback: any) => void;
67
68
  setTaskCallback: (event: TASK_EVENTS, callback: any, taskId: string) => void;
69
+ setAgentProfile: (profile: AgentLoginProfile) => void;
68
70
  removeCCCallback: (event: CC_EVENTS) => void;
69
71
  removeTaskCallback: (event: TASK_EVENTS, callback: any, taskId: string) => void;
70
72
  init(options: InitParams): Promise<void>;
@@ -85,8 +87,8 @@ declare class StoreWrapper implements IStoreWrapper {
85
87
  handleMultiLoginCloseSession: (data: any) => void;
86
88
  handleTaskHydrate: (event: any) => void;
87
89
  handleTaskReject: (task: ITask, reason: string) => void;
88
- getBuddyAgents: () => Promise<Array<BuddyDetails>>;
89
- getQueues: () => Promise<Array<ContactServiceQueue>>;
90
+ getBuddyAgents: (mediaType?: string) => Promise<Array<BuddyDetails>>;
91
+ getQueues: (mediaType?: string) => Promise<Array<ContactServiceQueue>>;
90
92
  cleanUpStore: () => void;
91
93
  setupIncomingTaskHandler: (ccSDK: IContactCenter) => void;
92
94
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@webex/cc-store",
3
3
  "description": "Webex Contact Center Widgets: Widgets Store",
4
- "version": "1.28.0-ccwidgets.55",
4
+ "version": "1.28.0-ccwidgets.57",
5
5
  "main": "dist/index.js",
6
6
  "license": "MIT",
7
7
  "publishConfig": {