@webex/cc-store 1.28.0-ccwidgets.48 → 1.28.0-ccwidgets.49
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 +11 -11
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3688,7 +3688,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
3688
3688
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3689
3689
|
|
|
3690
3690
|
"use strict";
|
|
3691
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\nvar _webexCore = __webpack_require__(/*! @webex/webex-core */ \"../../../node_modules/@webex/webex-core/dist/index.js\");\nvar _events = _interopRequireDefault(__webpack_require__(/*! events */ \"../../../node_modules/events/events.js\"));\nvar _types = __webpack_require__(/*! ./types */ \"../../../node_modules/@webex/plugin-cc/dist/types.js\");\nvar _constants = __webpack_require__(/*! ./constants */ \"../../../node_modules/@webex/plugin-cc/dist/constants.js\");\nvar _constants2 = __webpack_require__(/*! ./services/constants */ \"../../../node_modules/@webex/plugin-cc/dist/services/constants.js\");\nvar _services = _interopRequireDefault(__webpack_require__(/*! ./services */ \"../../../node_modules/@webex/plugin-cc/dist/services/index.js\"));\nvar _WebexRequest = _interopRequireDefault(__webpack_require__(/*! ./services/core/WebexRequest */ \"../../../node_modules/@webex/plugin-cc/dist/services/core/WebexRequest.js\"));\nvar _loggerProxy = _interopRequireDefault(__webpack_require__(/*! ./logger-proxy */ \"../../../node_modules/@webex/plugin-cc/dist/logger-proxy.js\"));\nvar _Utils = __webpack_require__(/*! ./services/core/Utils */ \"../../../node_modules/@webex/plugin-cc/dist/services/core/Utils.js\");\nvar _types2 = __webpack_require__(/*! ./services/config/types */ \"../../../node_modules/@webex/plugin-cc/dist/services/config/types.js\");\nvar _constants3 = __webpack_require__(/*! ./services/config/constants */ \"../../../node_modules/@webex/plugin-cc/dist/services/config/constants.js\");\nvar _TaskManager = _interopRequireDefault(__webpack_require__(/*! ./services/task/TaskManager */ \"../../../node_modules/@webex/plugin-cc/dist/services/task/TaskManager.js\"));\nvar _WebCallingService = _interopRequireDefault(__webpack_require__(/*! ./services/WebCallingService */ \"../../../node_modules/@webex/plugin-cc/dist/services/WebCallingService.js\"));\nvar _types3 = __webpack_require__(/*! ./services/task/types */ \"../../../node_modules/@webex/plugin-cc/dist/services/task/types.js\");\nvar _MetricsManager = _interopRequireDefault(__webpack_require__(/*! ./metrics/MetricsManager */ \"../../../node_modules/@webex/plugin-cc/dist/metrics/MetricsManager.js\"));\nvar _constants4 = __webpack_require__(/*! ./metrics/constants */ \"../../../node_modules/@webex/plugin-cc/dist/metrics/constants.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nclass ContactCenter extends _webexCore.WebexPlugin {\n namespace = 'cc';\n LoggerProxy = _loggerProxy.default;\n constructor(...args) {\n super(...args);\n this.eventEmitter = new _events.default();\n // @ts-ignore\n this.$webex = this.webex;\n this.$webex.once(_constants.READY, () => {\n // @ts-ignore\n this.$config = this.config;\n\n /**\n * This is used for handling the async requests by sending webex.request and wait for corresponding websocket event.\n */\n this.webexRequest = _WebexRequest.default.getInstance({\n webex: this.$webex\n });\n this.services = _services.default.getInstance({\n webex: this.$webex,\n connectionConfig: this.getConnectionConfig()\n });\n // TODO: https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-626777 Implement the de-register method and close the listener there\n this.services.webSocketManager.on('message', this.handleWebSocketMessage);\n this.webCallingService = new _WebCallingService.default(this.$webex);\n this.metricsManager = _MetricsManager.default.getInstance({\n webex: this.$webex\n });\n this.taskManager = _TaskManager.default.getTaskManager(this.services.contact, this.webCallingService, this.services.webSocketManager);\n this.incomingTaskListener();\n _loggerProxy.default.initialize(this.$webex.logger);\n });\n }\n handleIncomingTask = task => {\n // @ts-ignore\n this.trigger(_types3.TASK_EVENTS.TASK_INCOMING, task);\n };\n handleTaskHydrate = task => {\n // @ts-ignore\n this.trigger(_types3.TASK_EVENTS.TASK_HYDRATE, task);\n };\n\n /**\n * An Incoming Call listener.\n */\n incomingTaskListener() {\n this.taskManager.on(_types3.TASK_EVENTS.TASK_INCOMING, this.handleIncomingTask);\n this.taskManager.on(_types3.TASK_EVENTS.TASK_HYDRATE, this.handleTaskHydrate);\n }\n\n /**\n * This is used for making the CC SDK ready by setting up the cc mercury connection.\n */\n async register() {\n try {\n this.metricsManager.timeEvent([_constants4.METRIC_EVENT_NAMES.WEBSOCKET_REGISTER_SUCCESS, _constants4.METRIC_EVENT_NAMES.WEBSOCKET_REGISTER_FAILED]);\n this.setupEventListeners();\n const resp = await this.connectWebsocket();\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.WEBSOCKET_REGISTER_SUCCESS, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(resp),\n deviceType: resp.deviceType || _constants.EMPTY_STRING\n }, ['operational']);\n return resp;\n } catch (error) {\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.WEBSOCKET_REGISTER_FAILED, {\n orgId: error.orgId\n }, ['operational']);\n _loggerProxy.default.error(`Error during register: ${error}`, {\n module: _constants.CC_FILE,\n method: this.register.name\n });\n throw error;\n }\n }\n\n /**\n * Returns the list of buddy agents in the given state and media according to agent profile settings\n *\n * @param {BuddyAgents} data - The data required to fetch buddy agents, including additional agent profile information.\n * @returns {Promise<BuddyAgentsResponse>} A promise that resolves to the response containing buddy agents information.\n * @throws Error\n * @example getBuddyAgents({state: 'Available', mediaType: 'telephony'})\n */\n async getBuddyAgents(data) {\n try {\n this.metricsManager.timeEvent([_constants4.METRIC_EVENT_NAMES.FETCH_BUDDY_AGENTS_SUCCESS, _constants4.METRIC_EVENT_NAMES.FETCH_BUDDY_AGENTS_FAILED]);\n const resp = await this.services.agent.buddyAgents({\n data: {\n agentProfileId: this.agentConfig.agentProfileID,\n ...data\n }\n });\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.FETCH_BUDDY_AGENTS_SUCCESS, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(resp),\n mediaType: data.mediaType,\n buddyAgentState: data.state,\n buddyAgentCount: resp.data.agentList.length\n }, ['operational']);\n return resp;\n } catch (error) {\n const failureResp = error.details;\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.FETCH_BUDDY_AGENTS_FAILED, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(failureResp),\n mediaType: data.mediaType,\n buddyAgentState: data.state\n }, ['operational']);\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'getBuddyAgents', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /**\n * This is used for connecting the websocket and fetching the agent profile.\n * @returns Promise<Profile>\n * @throws Error\n * @private\n */\n async connectWebsocket() {\n try {\n return this.services.webSocketManager.initWebSocket({\n body: this.getConnectionConfig()\n }).then(async data => {\n const agentId = data.agentId;\n const orgId = this.$webex.credentials.getOrgId();\n this.agentConfig = await this.services.config.getAgentConfig(orgId, agentId);\n _loggerProxy.default.log(`Agent config is fetched successfully`, {\n module: _constants.CC_FILE,\n method: this.connectWebsocket.name\n });\n if (this.agentConfig.webRtcEnabled && this.agentConfig.loginVoiceOptions.includes(_types.LoginOption.BROWSER)) {\n this.$webex.internal.mercury.connect().then(() => {\n _loggerProxy.default.info('Authentication: webex.internal.mercury.connect successful', {\n module: _constants.CC_FILE,\n method: this.connectWebsocket.name\n });\n }).catch(error => {\n _loggerProxy.default.error(`Error occurred during mercury.connect() ${error}`, {\n module: _constants.CC_FILE,\n method: this.connectWebsocket.name\n });\n });\n }\n if (this.$config && this.$config.allowAutomatedRelogin) {\n await this.silentRelogin();\n }\n return this.agentConfig;\n }).catch(error => {\n throw error;\n });\n } catch (error) {\n _loggerProxy.default.error(`Error during register: ${error}`, {\n module: _constants.CC_FILE,\n method: this.connectWebsocket.name\n });\n throw error;\n }\n }\n\n /**\n * This is used for agent login.\n * @param data\n * @returns Promise<StationLoginResponse>\n * @throws Error\n */\n async stationLogin(data) {\n try {\n this.metricsManager.timeEvent([_constants4.METRIC_EVENT_NAMES.STATION_LOGIN_SUCCESS, _constants4.METRIC_EVENT_NAMES.STATION_LOGIN_FAILED]);\n const loginResponse = this.services.agent.stationLogin({\n data: {\n dialNumber: data.loginOption === _types.LoginOption.BROWSER ? this.agentConfig.agentId : data.dialNumber,\n teamId: data.teamId,\n deviceType: data.loginOption,\n isExtension: data.loginOption === _types.LoginOption.EXTENSION,\n deviceId: this.getDeviceId(data.loginOption, data.dialNumber),\n roles: [_constants2.AGENT],\n // TODO: The public API should not have the following properties so filling them with empty values for now. If needed, we can add them in the future.\n teamName: _constants.EMPTY_STRING,\n siteId: _constants.EMPTY_STRING,\n usesOtherDN: false,\n auxCodeId: _constants.EMPTY_STRING\n }\n });\n if (this.agentConfig.webRtcEnabled && data.loginOption === _types.LoginOption.BROWSER) {\n await this.webCallingService.registerWebCallingLine();\n this.webCallingService.setLoginOption(data.loginOption);\n }\n const resp = await loginResponse;\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.STATION_LOGIN_SUCCESS, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(resp),\n loginType: data.loginOption,\n status: resp.data.status,\n // 'LoggedIn'\n type: resp.data.type,\n // 'AgentStationLoginSuccess'\n roles: resp.data.roles?.join(',') || _constants.EMPTY_STRING\n }, ['behavioral', 'business', 'operational']);\n\n // TODO: https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-626777 Implement the de-register method and close the listener there\n // this.services.webSocketManager.on('message', this.handleWebSocketMessage);\n // this.incomingTaskListener();\n\n return resp;\n } catch (error) {\n const failure = error.details;\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.STATION_LOGIN_FAILED, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(failure),\n loginType: data.loginOption\n }, ['behavioral', 'business', 'operational']);\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'stationLogin', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /** This is used for agent logout.\n * @param data\n * @returns Promise<StationLogoutResponse>\n * @throws Error\n */\n async stationLogout(data) {\n try {\n this.metricsManager.timeEvent([_constants4.METRIC_EVENT_NAMES.STATION_LOGOUT_SUCCESS, _constants4.METRIC_EVENT_NAMES.STATION_LOGOUT_FAILED]);\n const logoutResponse = this.services.agent.logout({\n data\n });\n const resp = await logoutResponse;\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.STATION_LOGOUT_SUCCESS, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(resp),\n logoutReason: data.logoutReason\n }, ['behavioral', 'business', 'operational']);\n if (this.webCallingService) {\n this.webCallingService.deregisterWebCallingLine();\n }\n\n // TODO: https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-626777 Implement the de-register method and close the listener there\n // this.services.webSocketManager.off('message', this.handleWebSocketMessage);\n // this.taskManager.unregisterIncomingCallEvent();\n // this.taskManager.off(TASK_EVENTS.TASK_INCOMING, this.handleIncomingTask);\n // this.taskManager.off(TASK_EVENTS.TASK_HYDRATE, this.handleTaskHydrate);\n\n return resp;\n } catch (error) {\n const failure = error.details;\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.STATION_LOGOUT_FAILED, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(failure),\n logoutReason: data.logoutReason\n }, ['behavioral', 'business', 'operational']);\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'stationLogout', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /* This is used for agent relogin.\n * @returns Promise<StationReLoginResponse>\n * @throws Error\n */\n async stationReLogin() {\n try {\n this.metricsManager.timeEvent([_constants4.METRIC_EVENT_NAMES.STATION_RELOGIN_SUCCESS, _constants4.METRIC_EVENT_NAMES.STATION_RELOGIN_FAILED]);\n const reLoginResponse = await this.services.agent.reload();\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.STATION_RELOGIN_SUCCESS, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(reLoginResponse)\n }, ['behavioral', 'business', 'operational']);\n return reLoginResponse;\n } catch (error) {\n const failure = error.details;\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.STATION_RELOGIN_FAILED, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(failure)\n }, ['behavioral', 'business', 'operational']);\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'stationReLogin', _constants.CC_FILE);\n throw detailedError;\n }\n }\n getDeviceId(loginOption, dialNumber) {\n if (loginOption === _types.LoginOption.EXTENSION || loginOption === _types.LoginOption.AGENT_DN) {\n return dialNumber;\n }\n return _constants2.WEB_RTC_PREFIX + this.agentConfig.agentId;\n }\n\n /**\n * This is used for setting agent state.\n * @param options\n * @returns Promise<SetStateResponse>\n * @throws Error\n */\n\n async setAgentState(data) {\n try {\n this.metricsManager.timeEvent([_constants4.METRIC_EVENT_NAMES.AGENT_STATE_CHANGE_SUCCESS, _constants4.METRIC_EVENT_NAMES.AGENT_STATE_CHANGE_FAILED]);\n const agentStatusResponse = await this.services.agent.stateChange({\n data: {\n ...data,\n agentId: data.agentId || this.agentConfig.agentId\n }\n });\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.AGENT_STATE_CHANGE_SUCCESS, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(agentStatusResponse),\n requestedState: data.state,\n teamId: this.agentConfig?.teams[0]?.teamId ?? _constants.EMPTY_STRING,\n status: agentStatusResponse.data?.status,\n subStatus: agentStatusResponse.data?.subStatus,\n auxCodeId: data.auxCodeId,\n lastStateChangeReason: data.lastStateChangeReason || _constants.EMPTY_STRING\n }, ['behavioral', 'business', 'operational']);\n _loggerProxy.default.log(`SET AGENT STATUS API SUCCESS`, {\n module: _constants.CC_FILE,\n method: this.setAgentState.name\n });\n return agentStatusResponse;\n } catch (error) {\n const failure = error.details;\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.AGENT_STATE_CHANGE_FAILED, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(failure),\n state: data.state,\n auxCodeId: data.auxCodeId,\n lastStateChangeReason: data.lastStateChangeReason || _constants.EMPTY_STRING\n }, ['behavioral', 'business', 'operational']);\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'setAgentState', _constants.CC_FILE);\n throw detailedError;\n }\n }\n handleWebSocketMessage = event => {\n const eventData = JSON.parse(event);\n // Re-emit the events related to agent\n if (Object.values(_types2.CC_AGENT_EVENTS).includes(eventData.data?.type)) {\n // @ts-ignore\n this.emit(eventData.data.type, eventData.data);\n }\n if (eventData.type === _types2.CC_EVENTS.AGENT_STATE_CHANGE) {\n // @ts-ignore\n this.emit(_constants.AGENT_STATE_CHANGE, eventData.data);\n }\n if (eventData.type === _types2.CC_EVENTS.AGENT_MULTI_LOGIN) {\n // @ts-ignore\n this.emit(_constants.AGENT_MULTI_LOGIN, eventData.data);\n }\n };\n\n /**\n * For setting up the Event Emitter listeners and handlers\n */\n setupEventListeners() {\n this.services.connectionService.on('connectionLost', this.handleConnectionLost.bind(this));\n }\n\n /**\n * This method returns the connection configuration.\n */\n getConnectionConfig() {\n return {\n force: this.$config?.force ?? true,\n isKeepAliveEnabled: this.$config?.isKeepAliveEnabled ?? false,\n clientType: this.$config?.clientType ?? 'WebexCCSDK',\n allowMultiLogin: this.$config?.allowMultiLogin ?? true\n };\n }\n\n /**\n * Called when the reconnection has been completed\n */\n async handleConnectionLost(msg) {\n if (msg.isConnectionLost) {\n // TODO: Emit an event saying connection is lost\n _loggerProxy.default.info('event=handleConnectionLost | Connection lost', {\n module: _constants.CC_FILE,\n method: this.handleConnectionLost.name\n });\n } else if (msg.isSocketReconnected) {\n // TODO: Emit an event saying connection is re-estabilished\n _loggerProxy.default.info('event=handleConnectionReconnect | Connection reconnected attempting to request silent relogin', {\n module: _constants.CC_FILE,\n method: this.handleConnectionLost.name\n });\n if (this.$config && this.$config.allowAutomatedRelogin) {\n await this.silentRelogin();\n }\n }\n }\n\n /**\n * Called when we finish registration to silently handle the errors\n */\n async silentRelogin() {\n try {\n const reLoginResponse = await this.services.agent.reload();\n const {\n agentId,\n lastStateChangeReason,\n deviceType,\n dn,\n lastStateChangeTimestamp,\n lastIdleCodeChangeTimestamp\n } = reLoginResponse.data;\n let {\n auxCodeId\n } = reLoginResponse.data;\n this.agentConfig.lastStateChangeTimestamp = lastStateChangeTimestamp;\n this.agentConfig.lastIdleCodeChangeTimestamp = lastIdleCodeChangeTimestamp;\n\n // To handle re-registration of event listeners on silent relogin\n // TODO: https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-626777 Implement the de-register method and close the listener there\n // this.incomingTaskListener();\n\n if (lastStateChangeReason === 'agent-wss-disconnect') {\n _loggerProxy.default.info('event=requestAutoStateChange | Requesting state change to available on socket reconnect', {\n module: _constants.CC_FILE,\n method: this.silentRelogin.name\n });\n auxCodeId = _constants3.AGENT_STATE_AVAILABLE_ID;\n const stateChangeData = {\n state: _constants3.AGENT_STATE_AVAILABLE,\n auxCodeId,\n lastStateChangeReason,\n agentId\n };\n try {\n const agentStatusResponse = await this.setAgentState(stateChangeData);\n this.agentConfig.lastStateChangeTimestamp = agentStatusResponse.data.lastStateChangeTimestamp;\n this.agentConfig.lastIdleCodeChangeTimestamp = agentStatusResponse.data.lastIdleCodeChangeTimestamp;\n } catch (error) {\n _loggerProxy.default.error(`event=requestAutoStateChange | Error requesting state change to available on socket reconnect: ${error}`, {\n module: _constants.CC_FILE,\n method: this.silentRelogin.name\n });\n }\n }\n this.agentConfig.lastStateAuxCodeId = auxCodeId;\n await this.handleDeviceType(deviceType, dn);\n this.agentConfig.isAgentLoggedIn = true;\n // TODO: https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-626777 Implement the de-register method and close the listener there\n this.services.webSocketManager.on('message', this.handleWebSocketMessage);\n } catch (error) {\n const {\n reason,\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'silentReLogin', _constants.CC_FILE);\n if (reason === 'AGENT_NOT_FOUND') {\n _loggerProxy.default.log('Agent not found during re-login, handling silently', {\n module: _constants.CC_FILE,\n method: 'silentRelogin'\n });\n return;\n }\n throw detailedError;\n }\n }\n\n /**\n * Handles the device type specific logic\n */\n async handleDeviceType(deviceType, dn) {\n switch (deviceType) {\n case _types.LoginOption.BROWSER:\n await this.webCallingService.registerWebCallingLine();\n break;\n case _types.LoginOption.AGENT_DN:\n case _types.LoginOption.EXTENSION:\n this.agentConfig.defaultDn = dn;\n break;\n default:\n _loggerProxy.default.error(`Unsupported device type: ${deviceType}`, {\n module: _constants.CC_FILE,\n method: this.handleDeviceType.name\n });\n throw new Error(`Unsupported device type: ${deviceType}`);\n }\n this.webCallingService.setLoginOption(deviceType);\n this.agentConfig.deviceType = deviceType;\n }\n\n /**\n * This is used for making the outdial call.\n * @param destination\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * const destination = '1234567890';\n * const result = await webex.cc.startOutdial(destination).then(()=>{}).catch(()=>{});\n * ```\n */\n\n async startOutdial(destination) {\n try {\n // Construct the outdial payload.\n const outDialPayload = {\n destination,\n entryPointId: this.agentConfig.outDialEp,\n direction: _constants.OUTDIAL_DIRECTION,\n attributes: _constants.ATTRIBUTES,\n mediaType: _constants.OUTDIAL_MEDIA_TYPE,\n outboundType: _constants.OUTBOUND_TYPE\n };\n const result = await this.services.dialer.startOutdial({\n data: outDialPayload\n });\n return result;\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'startOutdial', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /**\n * This is used for getting the list of queues.\n * @param search - optional\n * @param filter - optional\n * @param page - default is 0\n * @param pageSize - default is 100\n * @returns Promise<ContactServiceQueue[]>\n * @throws Error\n *\n * @example\n * ```typescript\n * const search = 'queue';\n * const filter = 'id == \"e23ad456-1ebd-1b43-b9d0-34f39c7dcb5e\"';\n * const page = 0;\n * const pageSize = 100;\n * const result = await webex.cc.getQueues(search, filter, page, pageSize);\n * ```\n */\n async getQueues(search, filter, page = _constants3.DEFAULT_PAGE, pageSize = _constants3.DEFAULT_PAGE_SIZE) {\n const orgId = this.$webex.credentials.getOrgId();\n if (!orgId) {\n _loggerProxy.default.error('Org ID not found.', {\n module: _constants.CC_FILE,\n method: this.getQueues.name\n });\n throw new Error('Org ID not found.');\n }\n return this.services.config.getQueues(orgId, page, pageSize, search, filter);\n }\n\n /**\n * Uploads logs to help troubleshoot SDK issues.\n *\n * This method collects the current SDK logs including network requests, WebSocket\n * messages, and client-side events, then securely submits them to Webex's diagnostics\n * service. The returned tracking ID, feedbackID can be provided to Webex support for faster\n * issue resolution.\n * @returns Promise<SubmitLogsResponse>\n * @throws Error\n */\n async uploadLogs() {\n return this.webexRequest.uploadLogs();\n }\n}\nexports[\"default\"] = ContactCenter;\n//# sourceMappingURL=cc.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/../../../node_modules/@webex/plugin-cc/dist/cc.js?");
|
|
3691
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\nvar _webexCore = __webpack_require__(/*! @webex/webex-core */ \"../../../node_modules/@webex/webex-core/dist/index.js\");\nvar _events = _interopRequireDefault(__webpack_require__(/*! events */ \"../../../node_modules/events/events.js\"));\nvar _types = __webpack_require__(/*! ./types */ \"../../../node_modules/@webex/plugin-cc/dist/types.js\");\nvar _constants = __webpack_require__(/*! ./constants */ \"../../../node_modules/@webex/plugin-cc/dist/constants.js\");\nvar _constants2 = __webpack_require__(/*! ./services/constants */ \"../../../node_modules/@webex/plugin-cc/dist/services/constants.js\");\nvar _services = _interopRequireDefault(__webpack_require__(/*! ./services */ \"../../../node_modules/@webex/plugin-cc/dist/services/index.js\"));\nvar _WebexRequest = _interopRequireDefault(__webpack_require__(/*! ./services/core/WebexRequest */ \"../../../node_modules/@webex/plugin-cc/dist/services/core/WebexRequest.js\"));\nvar _loggerProxy = _interopRequireDefault(__webpack_require__(/*! ./logger-proxy */ \"../../../node_modules/@webex/plugin-cc/dist/logger-proxy.js\"));\nvar _Utils = __webpack_require__(/*! ./services/core/Utils */ \"../../../node_modules/@webex/plugin-cc/dist/services/core/Utils.js\");\nvar _types2 = __webpack_require__(/*! ./services/config/types */ \"../../../node_modules/@webex/plugin-cc/dist/services/config/types.js\");\nvar _constants3 = __webpack_require__(/*! ./services/config/constants */ \"../../../node_modules/@webex/plugin-cc/dist/services/config/constants.js\");\nvar _TaskManager = _interopRequireDefault(__webpack_require__(/*! ./services/task/TaskManager */ \"../../../node_modules/@webex/plugin-cc/dist/services/task/TaskManager.js\"));\nvar _WebCallingService = _interopRequireDefault(__webpack_require__(/*! ./services/WebCallingService */ \"../../../node_modules/@webex/plugin-cc/dist/services/WebCallingService.js\"));\nvar _types3 = __webpack_require__(/*! ./services/task/types */ \"../../../node_modules/@webex/plugin-cc/dist/services/task/types.js\");\nvar _MetricsManager = _interopRequireDefault(__webpack_require__(/*! ./metrics/MetricsManager */ \"../../../node_modules/@webex/plugin-cc/dist/metrics/MetricsManager.js\"));\nvar _constants4 = __webpack_require__(/*! ./metrics/constants */ \"../../../node_modules/@webex/plugin-cc/dist/metrics/constants.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nclass ContactCenter extends _webexCore.WebexPlugin {\n namespace = 'cc';\n LoggerProxy = _loggerProxy.default;\n constructor(...args) {\n super(...args);\n this.eventEmitter = new _events.default();\n // @ts-ignore\n this.$webex = this.webex;\n this.$webex.once(_constants.READY, () => {\n // @ts-ignore\n this.$config = this.config;\n\n /**\n * This is used for handling the async requests by sending webex.request and wait for corresponding websocket event.\n */\n this.webexRequest = _WebexRequest.default.getInstance({\n webex: this.$webex\n });\n this.services = _services.default.getInstance({\n webex: this.$webex,\n connectionConfig: this.getConnectionConfig()\n });\n // TODO: https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-626777 Implement the de-register method and close the listener there\n this.services.webSocketManager.on('message', this.handleWebSocketMessage);\n this.webCallingService = new _WebCallingService.default(this.$webex);\n this.metricsManager = _MetricsManager.default.getInstance({\n webex: this.$webex\n });\n this.taskManager = _TaskManager.default.getTaskManager(this.services.contact, this.webCallingService, this.services.webSocketManager);\n this.incomingTaskListener();\n _loggerProxy.default.initialize(this.$webex.logger);\n });\n }\n handleIncomingTask = task => {\n // @ts-ignore\n this.trigger(_types3.TASK_EVENTS.TASK_INCOMING, task);\n };\n handleTaskHydrate = task => {\n // @ts-ignore\n this.trigger(_types3.TASK_EVENTS.TASK_HYDRATE, task);\n };\n\n /**\n * An Incoming Call listener.\n */\n incomingTaskListener() {\n this.taskManager.on(_types3.TASK_EVENTS.TASK_INCOMING, this.handleIncomingTask);\n this.taskManager.on(_types3.TASK_EVENTS.TASK_HYDRATE, this.handleTaskHydrate);\n }\n\n /**\n * This is used for making the CC SDK ready by setting up the cc mercury connection.\n */\n async register() {\n try {\n this.metricsManager.timeEvent([_constants4.METRIC_EVENT_NAMES.WEBSOCKET_REGISTER_SUCCESS, _constants4.METRIC_EVENT_NAMES.WEBSOCKET_REGISTER_FAILED]);\n this.setupEventListeners();\n const resp = await this.connectWebsocket();\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.WEBSOCKET_REGISTER_SUCCESS, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(resp),\n deviceType: resp.deviceType || _constants.EMPTY_STRING\n }, ['operational']);\n return resp;\n } catch (error) {\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.WEBSOCKET_REGISTER_FAILED, {\n orgId: error.orgId\n }, ['operational']);\n _loggerProxy.default.error(`Error during register: ${error}`, {\n module: _constants.CC_FILE,\n method: this.register.name\n });\n throw error;\n }\n }\n\n /**\n * Returns the list of buddy agents in the given state and media according to agent profile settings\n *\n * @param {BuddyAgents} data - The data required to fetch buddy agents, including additional agent profile information.\n * @returns {Promise<BuddyAgentsResponse>} A promise that resolves to the response containing buddy agents information.\n * @throws Error\n * @example getBuddyAgents({state: 'Available', mediaType: 'telephony'})\n */\n async getBuddyAgents(data) {\n try {\n this.metricsManager.timeEvent([_constants4.METRIC_EVENT_NAMES.FETCH_BUDDY_AGENTS_SUCCESS, _constants4.METRIC_EVENT_NAMES.FETCH_BUDDY_AGENTS_FAILED]);\n const resp = await this.services.agent.buddyAgents({\n data: {\n agentProfileId: this.agentConfig.agentProfileID,\n ...data\n }\n });\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.FETCH_BUDDY_AGENTS_SUCCESS, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(resp),\n mediaType: data.mediaType,\n buddyAgentState: data.state,\n buddyAgentCount: resp.data.agentList.length\n }, ['operational']);\n return resp;\n } catch (error) {\n const failureResp = error.details;\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.FETCH_BUDDY_AGENTS_FAILED, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(failureResp),\n mediaType: data.mediaType,\n buddyAgentState: data.state\n }, ['operational']);\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'getBuddyAgents', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /**\n * This is used for connecting the websocket and fetching the agent profile.\n * @returns Promise<Profile>\n * @throws Error\n * @private\n */\n async connectWebsocket() {\n try {\n return this.services.webSocketManager.initWebSocket({\n body: this.getConnectionConfig()\n }).then(async data => {\n const agentId = data.agentId;\n const orgId = this.$webex.credentials.getOrgId();\n this.agentConfig = await this.services.config.getAgentConfig(orgId, agentId);\n _loggerProxy.default.log(`Agent config is fetched successfully`, {\n module: _constants.CC_FILE,\n method: this.connectWebsocket.name\n });\n if (this.agentConfig.webRtcEnabled && this.agentConfig.loginVoiceOptions.includes(_types.LoginOption.BROWSER)) {\n this.$webex.internal.mercury.connect().then(() => {\n _loggerProxy.default.info('Authentication: webex.internal.mercury.connect successful', {\n module: _constants.CC_FILE,\n method: this.connectWebsocket.name\n });\n }).catch(error => {\n _loggerProxy.default.error(`Error occurred during mercury.connect() ${error}`, {\n module: _constants.CC_FILE,\n method: this.connectWebsocket.name\n });\n });\n }\n if (this.$config && this.$config.allowAutomatedRelogin) {\n await this.silentRelogin();\n }\n return this.agentConfig;\n }).catch(error => {\n throw error;\n });\n } catch (error) {\n _loggerProxy.default.error(`Error during register: ${error}`, {\n module: _constants.CC_FILE,\n method: this.connectWebsocket.name\n });\n throw error;\n }\n }\n\n /**\n * This is used for agent login.\n * @param data\n * @returns Promise<StationLoginResponse>\n * @throws Error\n */\n async stationLogin(data) {\n try {\n this.metricsManager.timeEvent([_constants4.METRIC_EVENT_NAMES.STATION_LOGIN_SUCCESS, _constants4.METRIC_EVENT_NAMES.STATION_LOGIN_FAILED]);\n const loginResponse = this.services.agent.stationLogin({\n data: {\n dialNumber: data.loginOption === _types.LoginOption.BROWSER ? this.agentConfig.agentId : data.dialNumber,\n teamId: data.teamId,\n deviceType: data.loginOption,\n isExtension: data.loginOption === _types.LoginOption.EXTENSION,\n deviceId: this.getDeviceId(data.loginOption, data.dialNumber),\n roles: [_constants2.AGENT],\n // TODO: The public API should not have the following properties so filling them with empty values for now. If needed, we can add them in the future.\n teamName: _constants.EMPTY_STRING,\n siteId: _constants.EMPTY_STRING,\n usesOtherDN: false,\n auxCodeId: _constants.EMPTY_STRING\n }\n });\n if (this.agentConfig.webRtcEnabled && data.loginOption === _types.LoginOption.BROWSER) {\n await this.webCallingService.registerWebCallingLine();\n }\n const resp = await loginResponse;\n const {\n channelsMap,\n ...loginData\n } = resp.data;\n const response = {\n ...loginData,\n mmProfile: {\n chat: channelsMap.chat?.length,\n email: channelsMap.email?.length,\n social: channelsMap.social?.length,\n telephony: channelsMap.telephony?.length\n },\n notifsTrackingId: resp.trackingId\n };\n this.webCallingService.setLoginOption(data.loginOption);\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.STATION_LOGIN_SUCCESS, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(resp),\n loginType: data.loginOption,\n status: resp.data.status,\n // 'LoggedIn'\n type: resp.data.type,\n // 'AgentStationLoginSuccess'\n roles: resp.data.roles?.join(',') || _constants.EMPTY_STRING\n }, ['behavioral', 'business', 'operational']);\n\n // TODO: https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-626777 Implement the de-register method and close the listener there\n // this.services.webSocketManager.on('message', this.handleWebSocketMessage);\n // this.incomingTaskListener();\n\n return response;\n } catch (error) {\n const failure = error.details;\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.STATION_LOGIN_FAILED, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(failure),\n loginType: data.loginOption\n }, ['behavioral', 'business', 'operational']);\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'stationLogin', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /** This is used for agent logout.\n * @param data\n * @returns Promise<StationLogoutResponse>\n * @throws Error\n */\n async stationLogout(data) {\n try {\n this.metricsManager.timeEvent([_constants4.METRIC_EVENT_NAMES.STATION_LOGOUT_SUCCESS, _constants4.METRIC_EVENT_NAMES.STATION_LOGOUT_FAILED]);\n const logoutResponse = this.services.agent.logout({\n data\n });\n const resp = await logoutResponse;\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.STATION_LOGOUT_SUCCESS, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(resp),\n logoutReason: data.logoutReason\n }, ['behavioral', 'business', 'operational']);\n if (this.webCallingService) {\n this.webCallingService.deregisterWebCallingLine();\n }\n\n // TODO: https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-626777 Implement the de-register method and close the listener there\n // this.services.webSocketManager.off('message', this.handleWebSocketMessage);\n // this.taskManager.unregisterIncomingCallEvent();\n // this.taskManager.off(TASK_EVENTS.TASK_INCOMING, this.handleIncomingTask);\n // this.taskManager.off(TASK_EVENTS.TASK_HYDRATE, this.handleTaskHydrate);\n\n return resp;\n } catch (error) {\n const failure = error.details;\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.STATION_LOGOUT_FAILED, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(failure),\n logoutReason: data.logoutReason\n }, ['behavioral', 'business', 'operational']);\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'stationLogout', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /* This is used for agent relogin.\n * @returns Promise<StationReLoginResponse>\n * @throws Error\n */\n async stationReLogin() {\n try {\n this.metricsManager.timeEvent([_constants4.METRIC_EVENT_NAMES.STATION_RELOGIN_SUCCESS, _constants4.METRIC_EVENT_NAMES.STATION_RELOGIN_FAILED]);\n const reLoginResponse = await this.services.agent.reload();\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.STATION_RELOGIN_SUCCESS, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(reLoginResponse)\n }, ['behavioral', 'business', 'operational']);\n return reLoginResponse;\n } catch (error) {\n const failure = error.details;\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.STATION_RELOGIN_FAILED, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(failure)\n }, ['behavioral', 'business', 'operational']);\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'stationReLogin', _constants.CC_FILE);\n throw detailedError;\n }\n }\n getDeviceId(loginOption, dialNumber) {\n if (loginOption === _types.LoginOption.EXTENSION || loginOption === _types.LoginOption.AGENT_DN) {\n return dialNumber;\n }\n return _constants2.WEB_RTC_PREFIX + this.agentConfig.agentId;\n }\n\n /**\n * This is used for setting agent state.\n * @param options\n * @returns Promise<SetStateResponse>\n * @throws Error\n */\n\n async setAgentState(data) {\n try {\n this.metricsManager.timeEvent([_constants4.METRIC_EVENT_NAMES.AGENT_STATE_CHANGE_SUCCESS, _constants4.METRIC_EVENT_NAMES.AGENT_STATE_CHANGE_FAILED]);\n const agentStatusResponse = await this.services.agent.stateChange({\n data: {\n ...data,\n agentId: data.agentId || this.agentConfig.agentId\n }\n });\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.AGENT_STATE_CHANGE_SUCCESS, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(agentStatusResponse),\n requestedState: data.state,\n teamId: this.agentConfig?.teams[0]?.teamId ?? _constants.EMPTY_STRING,\n status: agentStatusResponse.data?.status,\n subStatus: agentStatusResponse.data?.subStatus,\n auxCodeId: data.auxCodeId,\n lastStateChangeReason: data.lastStateChangeReason || _constants.EMPTY_STRING\n }, ['behavioral', 'business', 'operational']);\n _loggerProxy.default.log(`SET AGENT STATUS API SUCCESS`, {\n module: _constants.CC_FILE,\n method: this.setAgentState.name\n });\n return agentStatusResponse;\n } catch (error) {\n const failure = error.details;\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.AGENT_STATE_CHANGE_FAILED, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(failure),\n state: data.state,\n auxCodeId: data.auxCodeId,\n lastStateChangeReason: data.lastStateChangeReason || _constants.EMPTY_STRING\n }, ['behavioral', 'business', 'operational']);\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'setAgentState', _constants.CC_FILE);\n throw detailedError;\n }\n }\n handleWebSocketMessage = event => {\n const eventData = JSON.parse(event);\n // Re-emit the events related to agent\n if (Object.values(_types2.CC_AGENT_EVENTS).includes(eventData.data?.type)) {\n // @ts-ignore\n this.emit(eventData.data.type, eventData.data);\n }\n if (eventData.type === _types2.CC_EVENTS.AGENT_STATE_CHANGE) {\n // @ts-ignore\n this.emit(_constants.AGENT_STATE_CHANGE, eventData.data);\n }\n if (eventData.type === _types2.CC_EVENTS.AGENT_MULTI_LOGIN) {\n // @ts-ignore\n this.emit(_constants.AGENT_MULTI_LOGIN, eventData.data);\n }\n };\n\n /**\n * For setting up the Event Emitter listeners and handlers\n */\n setupEventListeners() {\n this.services.connectionService.on('connectionLost', this.handleConnectionLost.bind(this));\n }\n\n /**\n * This method returns the connection configuration.\n */\n getConnectionConfig() {\n return {\n force: this.$config?.force ?? true,\n isKeepAliveEnabled: this.$config?.isKeepAliveEnabled ?? false,\n clientType: this.$config?.clientType ?? 'WebexCCSDK',\n allowMultiLogin: this.$config?.allowMultiLogin ?? true\n };\n }\n\n /**\n * Called when the reconnection has been completed\n */\n async handleConnectionLost(msg) {\n if (msg.isConnectionLost) {\n // TODO: Emit an event saying connection is lost\n _loggerProxy.default.info('event=handleConnectionLost | Connection lost', {\n module: _constants.CC_FILE,\n method: this.handleConnectionLost.name\n });\n } else if (msg.isSocketReconnected) {\n // TODO: Emit an event saying connection is re-estabilished\n _loggerProxy.default.info('event=handleConnectionReconnect | Connection reconnected attempting to request silent relogin', {\n module: _constants.CC_FILE,\n method: this.handleConnectionLost.name\n });\n if (this.$config && this.$config.allowAutomatedRelogin) {\n await this.silentRelogin();\n }\n }\n }\n\n /**\n * Called when we finish registration to silently handle the errors\n */\n async silentRelogin() {\n try {\n const reLoginResponse = await this.services.agent.reload();\n const {\n agentId,\n lastStateChangeReason,\n deviceType,\n dn,\n lastStateChangeTimestamp,\n lastIdleCodeChangeTimestamp\n } = reLoginResponse.data;\n let {\n auxCodeId\n } = reLoginResponse.data;\n this.agentConfig.lastStateChangeTimestamp = lastStateChangeTimestamp;\n this.agentConfig.lastIdleCodeChangeTimestamp = lastIdleCodeChangeTimestamp;\n await this.handleDeviceType(deviceType, dn);\n\n // To handle re-registration of event listeners on silent relogin\n // TODO: https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-626777 Implement the de-register method and close the listener there\n // this.incomingTaskListener();\n\n if (lastStateChangeReason === 'agent-wss-disconnect') {\n _loggerProxy.default.info('event=requestAutoStateChange | Requesting state change to available on socket reconnect', {\n module: _constants.CC_FILE,\n method: this.silentRelogin.name\n });\n auxCodeId = _constants3.AGENT_STATE_AVAILABLE_ID;\n const stateChangeData = {\n state: _constants3.AGENT_STATE_AVAILABLE,\n auxCodeId,\n lastStateChangeReason,\n agentId\n };\n try {\n const agentStatusResponse = await this.setAgentState(stateChangeData);\n this.agentConfig.lastStateChangeTimestamp = agentStatusResponse.data.lastStateChangeTimestamp;\n this.agentConfig.lastIdleCodeChangeTimestamp = agentStatusResponse.data.lastIdleCodeChangeTimestamp;\n } catch (error) {\n _loggerProxy.default.error(`event=requestAutoStateChange | Error requesting state change to available on socket reconnect: ${error}`, {\n module: _constants.CC_FILE,\n method: this.silentRelogin.name\n });\n }\n }\n this.agentConfig.lastStateAuxCodeId = auxCodeId;\n this.agentConfig.isAgentLoggedIn = true;\n // TODO: https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-626777 Implement the de-register method and close the listener there\n this.services.webSocketManager.on('message', this.handleWebSocketMessage);\n } catch (error) {\n const {\n reason,\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'silentReLogin', _constants.CC_FILE);\n if (reason === 'AGENT_NOT_FOUND') {\n _loggerProxy.default.log('Agent not found during re-login, handling silently', {\n module: _constants.CC_FILE,\n method: 'silentRelogin'\n });\n return;\n }\n throw detailedError;\n }\n }\n\n /**\n * Handles the device type specific logic\n */\n async handleDeviceType(deviceType, dn) {\n this.webCallingService.setLoginOption(deviceType);\n this.agentConfig.deviceType = deviceType;\n switch (deviceType) {\n case _types.LoginOption.BROWSER:\n await this.webCallingService.registerWebCallingLine();\n break;\n case _types.LoginOption.AGENT_DN:\n case _types.LoginOption.EXTENSION:\n this.agentConfig.defaultDn = dn;\n break;\n default:\n _loggerProxy.default.error(`Unsupported device type: ${deviceType}`, {\n module: _constants.CC_FILE,\n method: this.handleDeviceType.name\n });\n throw new Error(`Unsupported device type: ${deviceType}`);\n }\n }\n\n /**\n * This is used for making the outdial call.\n * @param destination\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * const destination = '1234567890';\n * const result = await webex.cc.startOutdial(destination).then(()=>{}).catch(()=>{});\n * ```\n */\n\n async startOutdial(destination) {\n try {\n this.metricsManager.timeEvent([_constants4.METRIC_EVENT_NAMES.TASK_OUTDIAL_SUCCESS, _constants4.METRIC_EVENT_NAMES.TASK_OUTDIAL_FAILED]);\n\n // Construct the outdial payload.\n const outDialPayload = {\n destination,\n entryPointId: this.agentConfig.outDialEp,\n direction: _constants.OUTDIAL_DIRECTION,\n attributes: _constants.ATTRIBUTES,\n mediaType: _constants.OUTDIAL_MEDIA_TYPE,\n outboundType: _constants.OUTBOUND_TYPE\n };\n const result = await this.services.dialer.startOutdial({\n data: outDialPayload\n });\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.TASK_OUTDIAL_SUCCESS, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(result),\n destination,\n mediaType: _constants.OUTDIAL_MEDIA_TYPE\n }, ['behavioral', 'business', 'operational']);\n return result;\n } catch (error) {\n const failure = error.details;\n this.metricsManager.trackEvent(_constants4.METRIC_EVENT_NAMES.TASK_OUTDIAL_FAILED, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(failure),\n destination,\n mediaType: _constants.OUTDIAL_MEDIA_TYPE\n }, ['behavioral', 'business', 'operational']);\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'startOutdial', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /**\n * This is used for getting the list of queues.\n * @param search - optional\n * @param filter - optional\n * @param page - default is 0\n * @param pageSize - default is 100\n * @returns Promise<ContactServiceQueue[]>\n * @throws Error\n *\n * @example\n * ```typescript\n * const search = 'queue';\n * const filter = 'id == \"e23ad456-1ebd-1b43-b9d0-34f39c7dcb5e\"';\n * const page = 0;\n * const pageSize = 100;\n * const result = await webex.cc.getQueues(search, filter, page, pageSize);\n * ```\n */\n async getQueues(search, filter, page = _constants3.DEFAULT_PAGE, pageSize = _constants3.DEFAULT_PAGE_SIZE) {\n const orgId = this.$webex.credentials.getOrgId();\n if (!orgId) {\n _loggerProxy.default.error('Org ID not found.', {\n module: _constants.CC_FILE,\n method: this.getQueues.name\n });\n throw new Error('Org ID not found.');\n }\n return this.services.config.getQueues(orgId, page, pageSize, search, filter);\n }\n\n /**\n * Uploads logs to help troubleshoot SDK issues.\n *\n * This method collects the current SDK logs including network requests, WebSocket\n * messages, and client-side events, then securely submits them to Webex's diagnostics\n * service. The returned tracking ID, feedbackID can be provided to Webex support for faster\n * issue resolution.\n * @returns Promise<SubmitLogsResponse>\n * @throws Error\n */\n async uploadLogs() {\n return this.webexRequest.uploadLogs();\n }\n}\nexports[\"default\"] = ContactCenter;\n//# sourceMappingURL=cc.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/../../../node_modules/@webex/plugin-cc/dist/cc.js?");
|
|
3692
3692
|
|
|
3693
3693
|
/***/ }),
|
|
3694
3694
|
|
|
@@ -3754,7 +3754,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));
|
|
|
3754
3754
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3755
3755
|
|
|
3756
3756
|
"use strict";
|
|
3757
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.getEventTaxonomy = getEventTaxonomy;\nvar _constants = __webpack_require__(/*! ./constants */ \"../../../node_modules/@webex/plugin-cc/dist/metrics/constants.js\");\nvar _constants2 = __webpack_require__(/*! ../constants */ \"../../../node_modules/@webex/plugin-cc/dist/constants.js\");\
|
|
3757
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.getEventTaxonomy = getEventTaxonomy;\nvar _constants = __webpack_require__(/*! ./constants */ \"../../../node_modules/@webex/plugin-cc/dist/metrics/constants.js\");\nvar _constants2 = __webpack_require__(/*! ../constants */ \"../../../node_modules/@webex/plugin-cc/dist/constants.js\");\nconst product = _constants2.PRODUCT_NAME;\n\n// Adding new metrics? Please add them to the Cypher CC metrics wiki\n\nconst eventTaxonomyMap = {\n [_constants.METRIC_EVENT_NAMES.STATION_LOGIN_SUCCESS]: {\n product,\n agent: 'user',\n target: 'station_login',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.STATION_LOGIN_FAILED]: {\n product,\n agent: 'user',\n target: 'station_login',\n verb: 'fail'\n },\n [_constants.METRIC_EVENT_NAMES.STATION_LOGOUT_SUCCESS]: {\n product,\n agent: 'user',\n target: 'station_logout',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.STATION_LOGOUT_FAILED]: {\n product,\n agent: 'user',\n target: 'station_logout',\n verb: 'fail'\n },\n [_constants.METRIC_EVENT_NAMES.STATION_RELOGIN_SUCCESS]: {\n product,\n agent: 'user',\n target: 'station_relogin',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.STATION_RELOGIN_FAILED]: {\n product,\n agent: 'user',\n target: 'station_relogin',\n verb: 'fail'\n },\n [_constants.METRIC_EVENT_NAMES.AGENT_STATE_CHANGE_SUCCESS]: {\n product,\n agent: 'user',\n target: 'state_change',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.AGENT_STATE_CHANGE_FAILED]: {\n product,\n agent: 'user',\n target: 'state_change',\n verb: 'fail'\n },\n [_constants.METRIC_EVENT_NAMES.FETCH_BUDDY_AGENTS_SUCCESS]: {\n product,\n agent: 'user',\n target: 'buddy_agents_fetch',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.FETCH_BUDDY_AGENTS_FAILED]: {\n product,\n agent: 'user',\n target: 'buddy_agents_fetch',\n verb: 'fail'\n },\n [_constants.METRIC_EVENT_NAMES.WEBSOCKET_REGISTER_SUCCESS]: {\n product,\n agent: 'user',\n target: 'websocket_register',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.WEBSOCKET_REGISTER_FAILED]: {\n product,\n agent: 'user',\n target: 'websocket_register',\n verb: 'fail'\n },\n [_constants.METRIC_EVENT_NAMES.AGENT_RONA]: {\n product,\n agent: 'service',\n target: 'agent_rona',\n verb: 'set'\n },\n // Added Task events\n [_constants.METRIC_EVENT_NAMES.TASK_ACCEPT_SUCCESS]: {\n product,\n agent: 'user',\n target: 'task_accept',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_ACCEPT_FAILED]: {\n product,\n agent: 'user',\n target: 'task_accept',\n verb: 'fail'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_DECLINE_SUCCESS]: {\n product,\n agent: 'user',\n target: 'task_decline',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_DECLINE_FAILED]: {\n product,\n agent: 'user',\n target: 'task_decline',\n verb: 'fail'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_END_SUCCESS]: {\n product,\n agent: 'user',\n target: 'task_end',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_END_FAILED]: {\n product,\n agent: 'user',\n target: 'task_end',\n verb: 'fail'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_WRAPUP_SUCCESS]: {\n product,\n agent: 'user',\n target: 'task_wrapup',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_WRAPUP_FAILED]: {\n product,\n agent: 'user',\n target: 'task_wrapup',\n verb: 'fail'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_HOLD_SUCCESS]: {\n product,\n agent: 'user',\n target: 'task_hold',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_HOLD_FAILED]: {\n product,\n agent: 'user',\n target: 'task_hold',\n verb: 'fail'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_RESUME_SUCCESS]: {\n product,\n agent: 'user',\n target: 'task_resume',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_RESUME_FAILED]: {\n product,\n agent: 'user',\n target: 'task_resume',\n verb: 'fail'\n },\n // Advanced Tasks handling\n [_constants.METRIC_EVENT_NAMES.TASK_CONSULT_START_SUCCESS]: {\n product,\n agent: 'user',\n target: 'task_consult_start',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_CONSULT_START_FAILED]: {\n product,\n agent: 'user',\n target: 'task_consult_start',\n verb: 'fail'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_CONSULT_END_SUCCESS]: {\n product,\n agent: 'user',\n target: 'task_consult_end',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_CONSULT_END_FAILED]: {\n product,\n agent: 'user',\n target: 'task_consult_end',\n verb: 'fail'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_TRANSFER_SUCCESS]: {\n product,\n agent: 'user',\n target: 'task_transfer',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_TRANSFER_FAILED]: {\n product,\n agent: 'user',\n target: 'task_transfer',\n verb: 'fail'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_RESUME_RECORDING_SUCCESS]: {\n product,\n agent: 'user',\n target: 'task_resume_recording',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_RESUME_RECORDING_FAILED]: {\n product,\n agent: 'user',\n target: 'task_resume_recording',\n verb: 'fail'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_PAUSE_RECORDING_SUCCESS]: {\n product,\n agent: 'user',\n target: 'task_pause_recording',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_PAUSE_RECORDING_FAILED]: {\n product,\n agent: 'user',\n target: 'task_pause_recording',\n verb: 'fail'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_ACCEPT_CONSULT_SUCCESS]: {\n product,\n agent: 'user',\n target: 'task_accept_consult',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_ACCEPT_CONSULT_FAILED]: {\n product,\n agent: 'user',\n target: 'task_accept_consult',\n verb: 'fail'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_OUTDIAL_SUCCESS]: {\n product,\n agent: 'user',\n target: 'task_outdial',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.TASK_OUTDIAL_FAILED]: {\n product,\n agent: 'user',\n target: 'task_outdial',\n verb: 'fail'\n },\n // upload logs\n [_constants.METRIC_EVENT_NAMES.UPLOAD_LOGS_SUCCESS]: {\n product,\n agent: 'user',\n target: 'upload_logs',\n verb: 'complete'\n },\n [_constants.METRIC_EVENT_NAMES.UPLOAD_LOGS_FAILED]: {\n product,\n agent: 'user',\n target: 'upload_logs',\n verb: 'fail'\n }\n};\nfunction getEventTaxonomy(name) {\n return eventTaxonomyMap[name];\n}\n//# sourceMappingURL=behavioral-events.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/../../../node_modules/@webex/plugin-cc/dist/metrics/behavioral-events.js?");
|
|
3758
3758
|
|
|
3759
3759
|
/***/ }),
|
|
3760
3760
|
|
|
@@ -3765,7 +3765,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));
|
|
|
3765
3765
|
/***/ ((__unused_webpack_module, exports) => {
|
|
3766
3766
|
|
|
3767
3767
|
"use strict";
|
|
3768
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.METRIC_EVENT_NAMES = void 0;\nconst METRIC_EVENT_NAMES = exports.METRIC_EVENT_NAMES = {\n STATION_LOGIN_SUCCESS: 'Station Login Success',\n STATION_LOGIN_FAILED: 'Station Login Failed',\n STATION_LOGOUT_SUCCESS: 'Station Logout Success',\n STATION_LOGOUT_FAILED: 'Station Logout Failed',\n STATION_RELOGIN_SUCCESS: 'Station Relogin Success',\n STATION_RELOGIN_FAILED: 'Station Relogin Failed',\n AGENT_STATE_CHANGE_SUCCESS: 'Agent State Change Success',\n AGENT_STATE_CHANGE_FAILED: 'Agent State Change Failed',\n FETCH_BUDDY_AGENTS_SUCCESS: 'Fetch Buddy Agents Success',\n FETCH_BUDDY_AGENTS_FAILED: 'Fetch Buddy Agents Failed',\n WEBSOCKET_REGISTER_SUCCESS: 'Websocket Register Success',\n WEBSOCKET_REGISTER_FAILED: 'Websocket Register Failed',\n AGENT_RONA: 'Agent RONA',\n UPLOAD_LOGS_SUCCESS: 'Upload Logs Success',\n UPLOAD_LOGS_FAILED: 'Upload Logs Failed'\n};\n\n// Derive the type using the utility type\n//# sourceMappingURL=constants.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/../../../node_modules/@webex/plugin-cc/dist/metrics/constants.js?");
|
|
3768
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.METRIC_EVENT_NAMES = void 0;\nconst METRIC_EVENT_NAMES = exports.METRIC_EVENT_NAMES = {\n STATION_LOGIN_SUCCESS: 'Station Login Success',\n STATION_LOGIN_FAILED: 'Station Login Failed',\n STATION_LOGOUT_SUCCESS: 'Station Logout Success',\n STATION_LOGOUT_FAILED: 'Station Logout Failed',\n STATION_RELOGIN_SUCCESS: 'Station Relogin Success',\n STATION_RELOGIN_FAILED: 'Station Relogin Failed',\n AGENT_STATE_CHANGE_SUCCESS: 'Agent State Change Success',\n AGENT_STATE_CHANGE_FAILED: 'Agent State Change Failed',\n FETCH_BUDDY_AGENTS_SUCCESS: 'Fetch Buddy Agents Success',\n FETCH_BUDDY_AGENTS_FAILED: 'Fetch Buddy Agents Failed',\n WEBSOCKET_REGISTER_SUCCESS: 'Websocket Register Success',\n WEBSOCKET_REGISTER_FAILED: 'Websocket Register Failed',\n AGENT_RONA: 'Agent RONA',\n // Basic Tasks\n TASK_ACCEPT_SUCCESS: 'Task Accept Success',\n TASK_ACCEPT_FAILED: 'Task Accept Failed',\n TASK_DECLINE_SUCCESS: 'Task Decline Success',\n TASK_DECLINE_FAILED: 'Task Decline Failed',\n TASK_END_SUCCESS: 'Task End Success',\n TASK_END_FAILED: 'Task End Failed',\n TASK_WRAPUP_SUCCESS: 'Task Wrapup Success',\n TASK_WRAPUP_FAILED: 'Task Wrapup Failed',\n TASK_HOLD_SUCCESS: 'Task Hold Success',\n TASK_HOLD_FAILED: 'Task Hold Failed',\n TASK_RESUME_SUCCESS: 'Task Resume Success',\n TASK_RESUME_FAILED: 'Task Resume Failed',\n // Advanced Tasks\n TASK_CONSULT_START_SUCCESS: 'Task Consult Start Success',\n TASK_CONSULT_START_FAILED: 'Task Consult Start Failed',\n TASK_CONSULT_END_SUCCESS: 'Task Consult End Success',\n TASK_CONSULT_END_FAILED: 'Task Consult End Failed',\n TASK_TRANSFER_SUCCESS: 'Task Transfer Success',\n TASK_TRANSFER_FAILED: 'Task Transfer Failed',\n TASK_RESUME_RECORDING_SUCCESS: 'Task Resume Recording Success',\n TASK_RESUME_RECORDING_FAILED: 'Task Resume Recording Failed',\n TASK_PAUSE_RECORDING_SUCCESS: 'Task Pause Recording Success',\n TASK_PAUSE_RECORDING_FAILED: 'Task Pause Recording Failed',\n TASK_ACCEPT_CONSULT_SUCCESS: 'Task Accept Consult Success',\n TASK_ACCEPT_CONSULT_FAILED: 'Task Accept Consult Failed',\n TASK_OUTDIAL_SUCCESS: 'Task Outdial Success',\n TASK_OUTDIAL_FAILED: 'Task Outdial Failed',\n UPLOAD_LOGS_SUCCESS: 'Upload Logs Success',\n UPLOAD_LOGS_FAILED: 'Upload Logs Failed'\n};\n\n// Derive the type using the utility type\n//# sourceMappingURL=constants.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/../../../node_modules/@webex/plugin-cc/dist/metrics/constants.js?");
|
|
3769
3769
|
|
|
3770
3770
|
/***/ }),
|
|
3771
3771
|
|
|
@@ -3798,7 +3798,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));
|
|
|
3798
3798
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3799
3799
|
|
|
3800
3800
|
"use strict";
|
|
3801
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.parseAgentConfigs = parseAgentConfigs;\nvar _constants = __webpack_require__(/*! ../core/constants */ \"../../../node_modules/@webex/plugin-cc/dist/services/core/constants.js\");\nvar _types = __webpack_require__(/*! ./types */ \"../../../node_modules/@webex/plugin-cc/dist/services/config/types.js\");\n/**\n * Get the URL mapping for the given name\n * @param {Array<URLMapping>} urlMappings\n * @param {string} name\n * @returns {string}\n */\nconst getUrlMapping = (urlMappings, name) => {\n const mappedUrl = urlMappings.find(mapping => mapping.name === name)?.url;\n return mappedUrl || '';\n};\n\n/**\n * Get the MSFT and Webex configuration\n * @param {DesktopProfileResponse} agentProfileData\n * @returns {Object}\n */\nconst getMsftConfig = agentProfileData => {\n return {\n showUserDetailsMS: agentProfileData.showUserDetailsMS ?? false,\n stateSynchronizationMS: agentProfileData.stateSynchronizationMS ?? false\n };\n};\n\n/**\n * Get the Webex configuration\n * @param {DesktopProfileResponse} agentProfileData\n * @returns {Object}\n */\nconst getWebexConfig = agentProfileData => {\n return {\n showUserDetailsWebex: agentProfileData.showUserDetailsWebex ?? false,\n stateSynchronizationWebex: agentProfileData.stateSynchronizationWebex ?? false\n };\n};\n\n/**\n * Get the default agent DN\n * @param {string} agentDNValidation\n * @returns {boolean}\n */\nconst getDefaultAgentDN = agentDNValidation => {\n return agentDNValidation === 'PROVISIONED_VALUE';\n};\n\n/**\n * Get the filtered dialplan entries\n * @param {Array<DialPlanEntity>} dialPlanData\n * @param {Array<string>} profileDialPlans\n * @returns {Array<Entity>}\n */\nconst getFilteredDialplanEntries = (dialPlanData, profileDialPlans) => {\n const dialPlanEntries = [];\n dialPlanData.forEach(dailPlan => {\n if (profileDialPlans.includes(dailPlan.id)) {\n const filteredPlan = {\n regex: dailPlan.regularExpression,\n prefix: dailPlan.prefix,\n strippedChars: dailPlan.strippedChars,\n name: dailPlan.name\n };\n dialPlanEntries.push(filteredPlan);\n }\n });\n return dialPlanEntries;\n};\n\n/**\n * Get the filtered aux codes\n * @param {Array<AuxCode>} auxCodes\n * @param {AuxCodeType} type\n * @param {Array<string>} specificCodes\n * @returns {Array<Entity>}\n */\nconst getFilterAuxCodes = (auxCodes, type, specificCodes) => {\n const filteredAuxCodes = [];\n auxCodes.forEach(auxCode => {\n if (auxCode.workTypeCode === type && auxCode.active && (specificCodes.length === 0 || specificCodes.includes(auxCode.id))) {\n filteredAuxCodes.push({\n id: auxCode.id,\n name: auxCode.name,\n isSystem: auxCode.isSystemCode,\n isDefault: auxCode.defaultCode\n });\n }\n });\n return filteredAuxCodes;\n};\n\n/**\n * Get the default wrapup code\n * @param {Array<Entity>} wrapUpReasonList\n * @returns {Entity}\n */\nfunction getDefaultWrapUpCode(wrapUpReasonList) {\n return wrapUpReasonList?.find(c => c.isDefault);\n}\n\n/**\n * Parse the agent configurations\n * @param {Object} profileData\n * @returns {Profile}\n */\nfunction parseAgentConfigs(profileData) {\n const {\n userData,\n teamData,\n tenantData,\n orgInfoData,\n auxCodes,\n orgSettingsData,\n agentProfileData,\n dialPlanData,\n urlMapping\n } = profileData;\n const tenantDataTimeout = tenantData.timeoutDesktopInactivityEnabled ? tenantData.timeoutDesktopInactivityMins : null;\n const inactivityTimeoutTimer = agentProfileData.timeoutDesktopInactivityCustomEnabled ? agentProfileData.timeoutDesktopInactivityMins : tenantDataTimeout;\n const wrapupCodes = getFilterAuxCodes(auxCodes, _types.WRAP_UP_CODE, agentProfileData.accessWrapUpCode === 'ALL' ? [] : agentProfileData.wrapUpCodes);\n const idleCodes = getFilterAuxCodes(auxCodes, _types.IDLE_CODE, agentProfileData.accessIdleCode === 'ALL' ? [] : agentProfileData.idleCodes);\n idleCodes.push({\n id: '0',\n name: 'Available',\n isSystem: false,\n isDefault: false\n }); // pushing available state to idle codes\n\n const defaultWrapUpData = getDefaultWrapUpCode(wrapupCodes);\n const finalData = {\n teams: teamData,\n defaultDn: userData.defaultDialledNumber,\n forceDefaultDn: tenantData.forceDefaultDn,\n forceDefaultDnForAgent: getDefaultAgentDN(agentProfileData.agentDNValidation),\n regexUS: tenantData.dnDefaultRegex,\n regexOther: tenantData.dnOtherRegex,\n agentId: userData.ciUserId,\n agentName: `${userData.firstName} ${userData.lastName}`,\n agentMailId: userData.email,\n agentProfileID: userData.agentProfileId,\n dialPlan: agentProfileData.dialPlanEnabled ? {\n type: 'adhocDial',\n dialPlanEntity: getFilteredDialplanEntries(dialPlanData, agentProfileData.dialPlans)\n } : undefined,\n skillProfileId: userData.skillProfileId ? userData.skillProfileId : null,\n siteId: userData.siteId,\n enterpriseId: orgInfoData.tenantId,\n tenantTimezone: orgInfoData.timezone,\n privacyShieldVisible: tenantData.privacyShieldVisible,\n organizationIdleCodes: [],\n // TODO: for supervisor, getOrgFilteredIdleCodes(auxCodes, false),\n idleCodesAccess: agentProfileData.accessIdleCode,\n idleCodes,\n wrapupCodes,\n wrapUpData: {\n wrapUpProps: {\n autoWrapup: agentProfileData.autoWrapUp,\n autoWrapupInterval: agentProfileData.autoWrapAfterSeconds,\n lastAgentRoute: agentProfileData.lastAgentRouting,\n wrapUpCodeAccess: agentProfileData.accessWrapUpCode,\n wrapUpReasonList: wrapupCodes,\n allowCancelAutoWrapup: agentProfileData.allowAutoWrapUpExtension\n }\n },\n defaultWrapupCode: defaultWrapUpData?.id ?? '',\n isOutboundEnabledForTenant: tenantData.outdialEnabled,\n isOutboundEnabledForAgent: agentProfileData.outdialEnabled,\n isAdhocDialingEnabled: agentProfileData.dialPlanEnabled,\n isAgentAvailableAfterOutdial: agentProfileData.agentAvailableAfterOutdial,\n outDialEp: agentProfileData.outdialEntryPointId,\n isCampaignManagementEnabled: orgSettingsData.campaignManagerEnabled,\n isEndCallEnabled: tenantData.endCallEnabled,\n isEndConsultEnabled: tenantData.endConsultEnabled,\n callVariablesSuppressed: tenantData.callVariablesSuppressed,\n agentDbId: userData.dbId,\n allowConsultToQueue: agentProfileData.consultToQueue,\n agentPersonalStatsEnabled: agentProfileData.viewableStatistics ? agentProfileData.viewableStatistics.agentStats : false,\n addressBookId: agentProfileData.addressBookId,\n outdialANIId: agentProfileData.outdialANIId,\n analyserUserId: userData.id,\n urlMappings: {\n acqueonApiUrl: getUrlMapping(urlMapping, 'ACQUEON_API_URL'),\n acqueonConsoleUrl: getUrlMapping(urlMapping, 'ACQUEON_CONSOLE_URL')\n },\n isTimeoutDesktopInactivityEnabled: tenantData.timeoutDesktopInactivityEnabled,\n timeoutDesktopInactivityMins: inactivityTimeoutTimer,\n loginVoiceOptions: agentProfileData.loginVoiceOptions ?? [],\n webRtcEnabled: orgSettingsData.webRtcEnabled,\n maskSensitiveData: orgSettingsData.maskSensitiveData ? orgSettingsData.maskSensitiveData : false,\n microsoftConfig: getMsftConfig(agentProfileData),\n webexConfig: getWebexConfig(agentProfileData),\n lostConnectionRecoveryTimeout: tenantData.lostConnectionRecoveryTimeout || _constants.LOST_CONNECTION_RECOVERY_TIMEOUT\n };\n return finalData;\n}\n//# sourceMappingURL=Util.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/../../../node_modules/@webex/plugin-cc/dist/services/config/Util.js?");
|
|
3801
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.parseAgentConfigs = parseAgentConfigs;\nvar _constants = __webpack_require__(/*! ../core/constants */ \"../../../node_modules/@webex/plugin-cc/dist/services/core/constants.js\");\nvar _types = __webpack_require__(/*! ./types */ \"../../../node_modules/@webex/plugin-cc/dist/services/config/types.js\");\n/**\n * Get the URL mapping for the given name\n * @param {Array<URLMapping>} urlMappings\n * @param {string} name\n * @returns {string}\n */\nconst getUrlMapping = (urlMappings, name) => {\n const mappedUrl = urlMappings.find(mapping => mapping.name === name)?.url;\n return mappedUrl || '';\n};\n\n/**\n * Get the MSFT and Webex configuration\n * @param {DesktopProfileResponse} agentProfileData\n * @returns {Object}\n */\nconst getMsftConfig = agentProfileData => {\n return {\n showUserDetailsMS: agentProfileData.showUserDetailsMS ?? false,\n stateSynchronizationMS: agentProfileData.stateSynchronizationMS ?? false\n };\n};\n\n/**\n * Get the Webex configuration\n * @param {DesktopProfileResponse} agentProfileData\n * @returns {Object}\n */\nconst getWebexConfig = agentProfileData => {\n return {\n showUserDetailsWebex: agentProfileData.showUserDetailsWebex ?? false,\n stateSynchronizationWebex: agentProfileData.stateSynchronizationWebex ?? false\n };\n};\n\n/**\n * Get the default agent DN\n * @param {string} agentDNValidation\n * @returns {boolean}\n */\nconst getDefaultAgentDN = agentDNValidation => {\n return agentDNValidation === 'PROVISIONED_VALUE';\n};\n\n/**\n * Get the filtered dialplan entries\n * @param {Array<DialPlanEntity>} dialPlanData\n * @param {Array<string>} profileDialPlans\n * @returns {Array<Entity>}\n */\nconst getFilteredDialplanEntries = (dialPlanData, profileDialPlans) => {\n const dialPlanEntries = [];\n dialPlanData.forEach(dailPlan => {\n if (profileDialPlans.includes(dailPlan.id)) {\n const filteredPlan = {\n regex: dailPlan.regularExpression,\n prefix: dailPlan.prefix,\n strippedChars: dailPlan.strippedChars,\n name: dailPlan.name\n };\n dialPlanEntries.push(filteredPlan);\n }\n });\n return dialPlanEntries;\n};\n\n/**\n * Get the filtered aux codes\n * @param {Array<AuxCode>} auxCodes\n * @param {AuxCodeType} type\n * @param {Array<string>} specificCodes\n * @returns {Array<Entity>}\n */\nconst getFilterAuxCodes = (auxCodes, type, specificCodes) => {\n const filteredAuxCodes = [];\n auxCodes.forEach(auxCode => {\n if (auxCode.workTypeCode === type && auxCode.active && (specificCodes.length === 0 || specificCodes.includes(auxCode.id))) {\n filteredAuxCodes.push({\n id: auxCode.id,\n name: auxCode.name,\n isSystem: auxCode.isSystemCode,\n isDefault: auxCode.defaultCode\n });\n }\n });\n return filteredAuxCodes;\n};\n\n/**\n * Get the default wrapup code\n * @param {Array<Entity>} wrapUpReasonList\n * @returns {Entity}\n */\nfunction getDefaultWrapUpCode(wrapUpReasonList) {\n return wrapUpReasonList?.find(c => c.isDefault);\n}\n\n/**\n * Parse the agent configurations\n * @param {Object} profileData\n * @returns {Profile}\n */\nfunction parseAgentConfigs(profileData) {\n const {\n userData,\n teamData,\n tenantData,\n orgInfoData,\n auxCodes,\n orgSettingsData,\n agentProfileData,\n dialPlanData,\n urlMapping\n } = profileData;\n const tenantDataTimeout = tenantData.timeoutDesktopInactivityEnabled ? tenantData.timeoutDesktopInactivityMins : null;\n const inactivityTimeoutTimer = agentProfileData.timeoutDesktopInactivityCustomEnabled ? agentProfileData.timeoutDesktopInactivityMins : tenantDataTimeout;\n const wrapupCodes = getFilterAuxCodes(auxCodes, _types.WRAP_UP_CODE, agentProfileData.accessWrapUpCode === 'ALL' ? [] : agentProfileData.wrapUpCodes);\n const idleCodes = getFilterAuxCodes(auxCodes, _types.IDLE_CODE, agentProfileData.accessIdleCode === 'ALL' ? [] : agentProfileData.idleCodes);\n idleCodes.push({\n id: '0',\n name: 'Available',\n isSystem: false,\n isDefault: false\n }); // pushing available state to idle codes\n\n const defaultWrapUpData = getDefaultWrapUpCode(wrapupCodes);\n const finalData = {\n teams: teamData,\n defaultDn: userData.defaultDialledNumber,\n forceDefaultDn: tenantData.forceDefaultDn,\n forceDefaultDnForAgent: getDefaultAgentDN(agentProfileData.agentDNValidation),\n regexUS: tenantData.dnDefaultRegex,\n regexOther: tenantData.dnOtherRegex,\n agentId: userData.ciUserId,\n agentName: `${userData.firstName} ${userData.lastName}`,\n agentMailId: userData.email,\n agentProfileID: userData.agentProfileId,\n autoAnswer: agentProfileData.autoAnswer,\n dialPlan: agentProfileData.dialPlanEnabled ? {\n type: 'adhocDial',\n dialPlanEntity: getFilteredDialplanEntries(dialPlanData, agentProfileData.dialPlans)\n } : undefined,\n multimediaProfileId: profileData.multimediaProfileId,\n skillProfileId: userData.skillProfileId ? userData.skillProfileId : null,\n siteId: userData.siteId,\n enterpriseId: orgInfoData.tenantId,\n tenantTimezone: orgInfoData.timezone,\n privacyShieldVisible: tenantData.privacyShieldVisible,\n organizationIdleCodes: [],\n // TODO: for supervisor, getOrgFilteredIdleCodes(auxCodes, false),\n idleCodesAccess: agentProfileData.accessIdleCode,\n idleCodes,\n wrapupCodes,\n wrapUpData: {\n wrapUpProps: {\n autoWrapup: agentProfileData.autoWrapUp,\n autoWrapupInterval: agentProfileData.autoWrapAfterSeconds,\n lastAgentRoute: agentProfileData.lastAgentRouting,\n wrapUpCodeAccess: agentProfileData.accessWrapUpCode,\n wrapUpReasonList: wrapupCodes,\n allowCancelAutoWrapup: agentProfileData.allowAutoWrapUpExtension\n }\n },\n defaultWrapupCode: defaultWrapUpData?.id ?? '',\n isOutboundEnabledForTenant: tenantData.outdialEnabled,\n isOutboundEnabledForAgent: agentProfileData.outdialEnabled,\n isAdhocDialingEnabled: agentProfileData.dialPlanEnabled,\n isAgentAvailableAfterOutdial: agentProfileData.agentAvailableAfterOutdial,\n outDialEp: agentProfileData.outdialEntryPointId,\n isCampaignManagementEnabled: orgSettingsData.campaignManagerEnabled,\n isEndCallEnabled: tenantData.endCallEnabled,\n isEndConsultEnabled: tenantData.endConsultEnabled,\n callVariablesSuppressed: tenantData.callVariablesSuppressed,\n agentDbId: userData.dbId,\n allowConsultToQueue: agentProfileData.consultToQueue,\n agentPersonalStatsEnabled: agentProfileData.viewableStatistics ? agentProfileData.viewableStatistics.agentStats : false,\n addressBookId: agentProfileData.addressBookId,\n outdialANIId: agentProfileData.outdialANIId,\n analyserUserId: userData.id,\n urlMappings: {\n acqueonApiUrl: getUrlMapping(urlMapping, 'ACQUEON_API_URL'),\n acqueonConsoleUrl: getUrlMapping(urlMapping, 'ACQUEON_CONSOLE_URL')\n },\n isTimeoutDesktopInactivityEnabled: tenantData.timeoutDesktopInactivityEnabled,\n timeoutDesktopInactivityMins: inactivityTimeoutTimer,\n loginVoiceOptions: agentProfileData.loginVoiceOptions ?? [],\n webRtcEnabled: orgSettingsData.webRtcEnabled,\n maskSensitiveData: orgSettingsData.maskSensitiveData ? orgSettingsData.maskSensitiveData : false,\n microsoftConfig: getMsftConfig(agentProfileData),\n webexConfig: getWebexConfig(agentProfileData),\n lostConnectionRecoveryTimeout: tenantData.lostConnectionRecoveryTimeout || _constants.LOST_CONNECTION_RECOVERY_TIMEOUT\n };\n return finalData;\n}\n//# sourceMappingURL=Util.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/../../../node_modules/@webex/plugin-cc/dist/services/config/Util.js?");
|
|
3802
3802
|
|
|
3803
3803
|
/***/ }),
|
|
3804
3804
|
|
|
@@ -3809,7 +3809,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));
|
|
|
3809
3809
|
/***/ ((__unused_webpack_module, exports) => {
|
|
3810
3810
|
|
|
3811
3811
|
"use strict";
|
|
3812
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.endPointMap = exports.
|
|
3812
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.endPointMap = exports.DEFAULT_PAGE_SIZE = exports.DEFAULT_PAGE = exports.DEFAULT_AUXCODE_ATTRIBUTES = exports.AGENT_STATE_AVAILABLE_ID = exports.AGENT_STATE_AVAILABLE_DESCRIPTION = exports.AGENT_STATE_AVAILABLE = void 0;\n// making query params configurable for List Teams and List Aux Codes API\nconst DEFAULT_PAGE = exports.DEFAULT_PAGE = 0;\nconst DEFAULT_PAGE_SIZE = exports.DEFAULT_PAGE_SIZE = 100;\nconst AGENT_STATE_AVAILABLE_ID = exports.AGENT_STATE_AVAILABLE_ID = '0';\nconst AGENT_STATE_AVAILABLE = exports.AGENT_STATE_AVAILABLE = 'Available';\nconst AGENT_STATE_AVAILABLE_DESCRIPTION = exports.AGENT_STATE_AVAILABLE_DESCRIPTION = 'Agent is available to receive calls';\nconst DEFAULT_AUXCODE_ATTRIBUTES = exports.DEFAULT_AUXCODE_ATTRIBUTES = ['id', 'isSystemCode', 'name', 'defaultCode', 'workTypeCode', 'active'];\nconst endPointMap = exports.endPointMap = {\n userByCI: (orgId, agentId) => `organization/${orgId}/user/by-ci-user-id/${agentId}`,\n desktopProfile: (orgId, desktopProfileId) => `organization/${orgId}/agent-profile/${desktopProfileId}`,\n multimediaProfile: (orgId, multimediaProfileId) => `organization/${orgId}/multimedia-profile/${multimediaProfileId}`,\n listTeams: (orgId, page, pageSize, filter) => `organization/${orgId}/v2/team?page=${page}&pageSize=${pageSize}${filter && filter.length > 0 ? `&filter=id=in=(${filter})` : ''}`,\n listAuxCodes: (orgId, page, pageSize, filter, attributes) => `organization/${orgId}/v2/auxiliary-code?page=${page}&pageSize=${pageSize}${filter && filter.length > 0 ? `&filter=id=in=(${filter})` : ''}&attributes=${attributes}`,\n orgInfo: orgId => `organization/${orgId}`,\n orgSettings: orgId => `organization/${orgId}/v2/organization-setting?agentView=true`,\n siteInfo: (orgId, siteId) => `organization/${orgId}/site/${siteId}`,\n tenantData: orgId => `organization/${orgId}/v2/tenant-configuration?agentView=true`,\n urlMapping: orgId => `organization/${orgId}/v2/org-url-mapping?sort=name,ASC`,\n dialPlan: orgId => `organization/${orgId}/dial-plan?agentView=true`,\n queueList: (orgId, queryParams) => `organization/${orgId}/v2/contact-service-queue?${queryParams}`\n};\n//# sourceMappingURL=constants.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/../../../node_modules/@webex/plugin-cc/dist/services/config/constants.js?");
|
|
3813
3813
|
|
|
3814
3814
|
/***/ }),
|
|
3815
3815
|
|
|
@@ -3820,7 +3820,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));
|
|
|
3820
3820
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3821
3821
|
|
|
3822
3822
|
"use strict";
|
|
3823
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\nvar _types = __webpack_require__(/*! ../../types */ \"../../../node_modules/@webex/plugin-cc/dist/types.js\");\nvar _loggerProxy = _interopRequireDefault(__webpack_require__(/*! ../../logger-proxy */ \"../../../node_modules/@webex/plugin-cc/dist/logger-proxy.js\"));\nvar _WebexRequest = _interopRequireDefault(__webpack_require__(/*! ../core/WebexRequest */ \"../../../node_modules/@webex/plugin-cc/dist/services/core/WebexRequest.js\"));\nvar _constants = __webpack_require__(/*! ../constants */ \"../../../node_modules/@webex/plugin-cc/dist/services/constants.js\");\nvar _constants2 = __webpack_require__(/*! ../../constants */ \"../../../node_modules/@webex/plugin-cc/dist/constants.js\");\nvar _Util = __webpack_require__(/*! ./Util */ \"../../../node_modules/@webex/plugin-cc/dist/services/config/Util.js\");\nvar _constants3 = __webpack_require__(/*! ./constants */ \"../../../node_modules/@webex/plugin-cc/dist/services/config/constants.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n/*\nThe AgentConfigService class provides methods to fetch agent configuration data.\n*/\nclass AgentConfigService {\n constructor() {\n this.webexReq = _WebexRequest.default.getInstance();\n }\n\n /**\n * Fetches the agent configuration data for the given orgId and agentId.\n * @param {string} orgId\n * @param {string} agentId\n * @returns {Promise<Profile>}\n */\n async getAgentConfig(orgId, agentId) {\n try {\n const userConfigPromise = this.getUserUsingCI(orgId, agentId);\n const orgInfoPromise = this.getOrgInfo(orgId);\n const orgSettingsPromise = this.getOrganizationSetting(orgId);\n const tenantDataPromise = this.getTenantData(orgId);\n const urlMappingPromise = this.getURLMapping(orgId);\n const auxCodesPromise = this.getAllAuxCodes(orgId, _constants3.DEFAULT_PAGE_SIZE, [], _constants3.DEFAULT_AUXCODE_ATTRIBUTES);\n const userConfigData = await userConfigPromise;\n _loggerProxy.default.info('Fetched user data', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getAgentConfig'\n });\n const agentProfilePromise = this.getDesktopProfileById(orgId, userConfigData.agentProfileId);\n const userDialPlanPromise = agentProfilePromise.then(agentProfileConfigData => agentProfileConfigData.dialPlanEnabled ? this.getDialPlanData(orgId) : []);\n const userTeamPromise = userConfigData.teamIds ? this.getAllTeams(orgId, _constants3.DEFAULT_PAGE_SIZE, userConfigData.teamIds, _constants3.DEFAULT_TEAM_ATTRIBUTES) : Promise.resolve([]);\n const [agentProfileConfigData, userDialPlanData, userTeamData, orgInfo, orgSettingsData, tenantData, urlMappingData, auxCodesData] = await Promise.all([agentProfilePromise, userDialPlanPromise, userTeamPromise, orgInfoPromise, orgSettingsPromise, tenantDataPromise, urlMappingPromise, auxCodesPromise]);\n _loggerProxy.default.info('Fetched all required data', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getAgentConfig'\n });\n const response = (0, _Util.parseAgentConfigs)({\n userData: userConfigData,\n teamData: userTeamData,\n tenantData,\n orgInfoData: orgInfo,\n auxCodes: auxCodesData,\n orgSettingsData,\n agentProfileData: agentProfileConfigData,\n dialPlanData: userDialPlanData,\n urlMapping: urlMappingData\n });\n\n // replace CONFIG_FILE_NAME with CONFIG_FILE_NAME\n _loggerProxy.default.info('Parsing completed for agent-config', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getAgentConfig'\n });\n _loggerProxy.default.info('Fetched configuration data successfully', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getAgentConfig'\n });\n return response;\n } catch (error) {\n _loggerProxy.default.error(`getAgentConfig call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getAgentConfig'\n });\n throw error;\n }\n }\n\n /**\n * Fetches the agent configuration data for the given orgId and agentId.\n * @param {string} orgId\n * @param {string} agentId\n * @returns {Promise<AgentResponse>}\n */\n async getUserUsingCI(orgId, agentId) {\n try {\n const resource = _constants3.endPointMap.userByCI(orgId, agentId);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getUserUsingCI api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getUserUsingCI'\n });\n return Promise.resolve(response.body);\n } catch (error) {\n _loggerProxy.default.error(`getUserUsingCI API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getUserUsingCI'\n });\n throw error;\n }\n }\n\n /**\n * Fetches the desktop profile data for the given orgId and desktopProfileId.\n * @param {string} orgId\n * @param {string} desktopProfileId\n * @returns {Promise<DesktopProfileResponse>}\n */\n async getDesktopProfileById(orgId, desktopProfileId) {\n try {\n const resource = _constants3.endPointMap.desktopProfile(orgId, desktopProfileId);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getDesktopProfileById api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getDesktopProfileById'\n });\n return Promise.resolve(response.body);\n } catch (error) {\n _loggerProxy.default.error(`getDesktopProfileById API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getDesktopProfileById'\n });\n throw error;\n }\n }\n\n /**\n * fetches the list of teams for the given orgId.\n * @param {string} orgId\n * @param {number} page\n * @param {number} pageSize\n * @param {string[]} filter\n * @param {string[]} attributes\n * @returns {Promise<ListTeamsResponse>}\n */\n async getListOfTeams(orgId, page, pageSize, filter, attributes) {\n try {\n const resource = _constants3.endPointMap.listTeams(orgId, page, pageSize, filter, attributes);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getListOfTeams api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getListOfTeams'\n });\n return Promise.resolve(response.body);\n } catch (error) {\n _loggerProxy.default.error(`getListOfTeams API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getListOfTeams'\n });\n throw error;\n }\n }\n\n /**\n * Fetches all teams from all pages for the given orgId\n * @param {string} orgId\n * @param {number} pageSize\n * @param {string[]} filter\n * @param {string[]} attributes\n * @returns {Promise<TeamList[]>}\n */\n async getAllTeams(orgId, pageSize, filter, attributes) {\n try {\n let allTeams = [];\n let page = _constants3.DEFAULT_PAGE;\n const firstResponse = await this.getListOfTeams(orgId, page, pageSize, filter, attributes);\n const totalPages = firstResponse.meta.totalPages;\n allTeams = allTeams.concat(firstResponse.data);\n const requests = [];\n for (page = _constants3.DEFAULT_PAGE + 1; page < totalPages; page += 1) {\n requests.push(this.getListOfTeams(orgId, page, pageSize, filter, attributes));\n }\n const responses = await Promise.all(requests);\n for (const response of responses) {\n allTeams = allTeams.concat(response.data);\n }\n return allTeams;\n } catch (error) {\n _loggerProxy.default.error(`getAllTeams API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getAllTeams'\n });\n throw error;\n }\n }\n\n /**\n * fetches the list of aux codes for the given orgId.\n * @param {string} orgId\n * @param {number} page\n * @param {number} pageSize\n * @param {string[]} filter\n * @param {string[]} attributes\n * @returns {Promise<ListAuxCodesResponse>}\n */\n async getListOfAuxCodes(orgId, page, pageSize, filter, attributes) {\n try {\n const resource = _constants3.endPointMap.listAuxCodes(orgId, page, pageSize, filter, attributes);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getListOfAuxCodes api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getListOfAuxCodes'\n });\n return Promise.resolve(response.body);\n } catch (error) {\n _loggerProxy.default.error(`getListOfAuxCodes API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getListOfAuxCodes'\n });\n throw error;\n }\n }\n\n /**\n * Fetches all aux codes from all pages for the given orgId\n * @param {string} orgId\n * @param {number} pageSize\n * @param {string[]} filter\n * @param {string[]} attributes\n * @returns {Promise<AuxCode[]>}\n */\n async getAllAuxCodes(orgId, pageSize, filter, attributes) {\n try {\n let allAuxCodes = [];\n let page = _constants3.DEFAULT_PAGE;\n const firstResponse = await this.getListOfAuxCodes(orgId, page, pageSize, filter, attributes);\n allAuxCodes = allAuxCodes.concat(firstResponse.data);\n const totalPages = firstResponse.meta.totalPages;\n const promises = [];\n for (page = _constants3.DEFAULT_PAGE + 1; page < totalPages; page += 1) {\n promises.push(this.getListOfAuxCodes(orgId, page, pageSize, filter, attributes));\n }\n const responses = await Promise.all(promises);\n responses.forEach(response => {\n allAuxCodes = allAuxCodes.concat(response.data);\n });\n return allAuxCodes;\n } catch (error) {\n _loggerProxy.default.error(`getAllAuxCodes API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getAllAuxCodes'\n });\n throw error;\n }\n }\n\n /**\n * Fetches the organization info for the given orgId.\n * @param {string} orgId\n * @returns {Promise<OrgInfo>}\n */\n async getOrgInfo(orgId) {\n try {\n const resource = _constants3.endPointMap.orgInfo(orgId);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getOrgInfo api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getOrgInfo'\n });\n return Promise.resolve(response.body);\n } catch (error) {\n _loggerProxy.default.error(`getOrgInfo API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getOrgInfo'\n });\n throw error;\n }\n }\n\n /**\n * Fetches the organization settings for the given orgId.\n * @param {string} orgId\n * @returns {Promise<OrgSettings>}\n */\n async getOrganizationSetting(orgId) {\n try {\n const resource = _constants3.endPointMap.orgSettings(orgId);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getOrganizationSetting api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getOrganizationSetting'\n });\n return Promise.resolve(response.body.data[0]);\n } catch (error) {\n _loggerProxy.default.error(`getOrganizationSetting API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getOrganizationSetting'\n });\n throw error;\n }\n }\n\n /**\n * Fetches the tenant data for the given orgId.\n * @param {string} orgId\n * @returns {Promise<TenantData>}\n */\n async getTenantData(orgId) {\n try {\n const resource = _constants3.endPointMap.tenantData(orgId);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getTenantData api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getTenantData'\n });\n return Promise.resolve(response.body.data[0]);\n } catch (error) {\n _loggerProxy.default.error(`getTenantData API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getTenantData'\n });\n throw error;\n }\n }\n\n /**\n * Fetches the URL mapping data for the given orgId.\n * @param {string} orgId\n * @returns {Promise<URLMapping[]>}\n */\n async getURLMapping(orgId) {\n try {\n const resource = _constants3.endPointMap.urlMapping(orgId);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getURLMapping api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getURLMapping'\n });\n return Promise.resolve(response.body.data);\n } catch (error) {\n _loggerProxy.default.error(`getURLMapping API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getURLMapping'\n });\n throw error;\n }\n }\n\n /**\n * Fetches the dial plan data for the given orgId.\n * @param {string} orgId\n * @returns {Promise<DialPlanEntity[]>}\n */\n async getDialPlanData(orgId) {\n try {\n const resource = _constants3.endPointMap.dialPlan(orgId);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getDialPlanData api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getDialPlanData'\n });\n return Promise.resolve(response.body);\n } catch (error) {\n _loggerProxy.default.error(`getDialPlanData API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getDialPlanData'\n });\n throw error;\n }\n }\n\n /**\n * Fetches the list of queues for the given orgId.\n * @param {string} orgId\n * @param {number} page\n * @param {number} pageSize\n * @param {string} search - optional search string\n * @param {string} filter - optional filter string\n * @returns Promise<ContactServiceQueue[]>\n */\n async getQueues(orgId, page, pageSize, search, filter) {\n try {\n let queryParams = `page=${page}&pageSize=${pageSize}&desktopProfileFilter=true`;\n if (search) queryParams += `&search=${search}`;\n if (filter) queryParams += `&filter=${filter}`;\n const resource = _constants3.endPointMap.queueList(orgId, queryParams);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getQueues API success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getQueues'\n });\n return response.body?.data;\n } catch (error) {\n _loggerProxy.default.error(`getQueues API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getQueues'\n });\n throw error;\n }\n }\n}\nexports[\"default\"] = AgentConfigService;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/../../../node_modules/@webex/plugin-cc/dist/services/config/index.js?");
|
|
3823
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\nvar _types = __webpack_require__(/*! ../../types */ \"../../../node_modules/@webex/plugin-cc/dist/types.js\");\nvar _loggerProxy = _interopRequireDefault(__webpack_require__(/*! ../../logger-proxy */ \"../../../node_modules/@webex/plugin-cc/dist/logger-proxy.js\"));\nvar _WebexRequest = _interopRequireDefault(__webpack_require__(/*! ../core/WebexRequest */ \"../../../node_modules/@webex/plugin-cc/dist/services/core/WebexRequest.js\"));\nvar _constants = __webpack_require__(/*! ../constants */ \"../../../node_modules/@webex/plugin-cc/dist/services/constants.js\");\nvar _constants2 = __webpack_require__(/*! ../../constants */ \"../../../node_modules/@webex/plugin-cc/dist/constants.js\");\nvar _Util = __webpack_require__(/*! ./Util */ \"../../../node_modules/@webex/plugin-cc/dist/services/config/Util.js\");\nvar _constants3 = __webpack_require__(/*! ./constants */ \"../../../node_modules/@webex/plugin-cc/dist/services/config/constants.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n/*\nThe AgentConfigService class provides methods to fetch agent configuration data.\n*/\nclass AgentConfigService {\n constructor() {\n this.webexReq = _WebexRequest.default.getInstance();\n }\n\n /**\n * Fetches the agent configuration data for the given orgId and agentId.\n * @param {string} orgId\n * @param {string} agentId\n * @returns {Promise<Profile>}\n */\n async getAgentConfig(orgId, agentId) {\n try {\n const userConfigPromise = this.getUserUsingCI(orgId, agentId);\n const orgInfoPromise = this.getOrgInfo(orgId);\n const orgSettingsPromise = this.getOrganizationSetting(orgId);\n const tenantDataPromise = this.getTenantData(orgId);\n const urlMappingPromise = this.getURLMapping(orgId);\n const auxCodesPromise = this.getAllAuxCodes(orgId, _constants3.DEFAULT_PAGE_SIZE, [], _constants3.DEFAULT_AUXCODE_ATTRIBUTES);\n const userConfigData = await userConfigPromise;\n _loggerProxy.default.info('Fetched user data', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getAgentConfig'\n });\n const agentProfilePromise = this.getDesktopProfileById(orgId, userConfigData.agentProfileId);\n const siteInfoPromise = this.getSiteInfo(orgId, userConfigData.siteId);\n const userDialPlanPromise = agentProfilePromise.then(agentProfileConfigData => agentProfileConfigData.dialPlanEnabled ? this.getDialPlanData(orgId) : []);\n const userTeamPromise = userConfigData.teamIds ? this.getAllTeams(orgId, _constants3.DEFAULT_PAGE_SIZE, userConfigData.teamIds) : Promise.resolve([]);\n const [agentProfileConfigData, siteInfo, userDialPlanData, userTeamData, orgInfo, orgSettingsData, tenantData, urlMappingData, auxCodesData] = await Promise.all([agentProfilePromise, siteInfoPromise, userDialPlanPromise, userTeamPromise, orgInfoPromise, orgSettingsPromise, tenantDataPromise, urlMappingPromise, auxCodesPromise]);\n const multimediaProfileId = userConfigData.multimediaProfileId || userTeamData[0]?.multiMediaProfileId || siteInfo.multimediaProfileId;\n _loggerProxy.default.info('Fetched all required data', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getAgentConfig'\n });\n const response = (0, _Util.parseAgentConfigs)({\n userData: userConfigData,\n teamData: userTeamData,\n tenantData,\n orgInfoData: orgInfo,\n auxCodes: auxCodesData,\n orgSettingsData,\n agentProfileData: agentProfileConfigData,\n dialPlanData: userDialPlanData,\n urlMapping: urlMappingData,\n multimediaProfileId\n });\n\n // replace CONFIG_FILE_NAME with CONFIG_FILE_NAME\n _loggerProxy.default.info('Parsing completed for agent-config', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getAgentConfig'\n });\n _loggerProxy.default.info('Fetched configuration data successfully', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getAgentConfig'\n });\n return response;\n } catch (error) {\n _loggerProxy.default.error(`getAgentConfig call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getAgentConfig'\n });\n throw error;\n }\n }\n\n /**\n * Fetches the agent configuration data for the given orgId and agentId.\n * @param {string} orgId\n * @param {string} agentId\n * @returns {Promise<AgentResponse>}\n */\n async getUserUsingCI(orgId, agentId) {\n try {\n const resource = _constants3.endPointMap.userByCI(orgId, agentId);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getUserUsingCI api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getUserUsingCI'\n });\n return Promise.resolve(response.body);\n } catch (error) {\n _loggerProxy.default.error(`getUserUsingCI API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getUserUsingCI'\n });\n throw error;\n }\n }\n\n /**\n * Fetches the desktop profile data for the given orgId and desktopProfileId.\n * @param {string} orgId\n * @param {string} desktopProfileId\n * @returns {Promise<DesktopProfileResponse>}\n */\n async getDesktopProfileById(orgId, desktopProfileId) {\n try {\n const resource = _constants3.endPointMap.desktopProfile(orgId, desktopProfileId);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getDesktopProfileById api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getDesktopProfileById'\n });\n return Promise.resolve(response.body);\n } catch (error) {\n _loggerProxy.default.error(`getDesktopProfileById API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getDesktopProfileById'\n });\n throw error;\n }\n }\n\n /**\n * Fetches the multimedia profile data for the given orgId and multimediaProfileId.\n * @param {string} orgId\n * @param {string} multimediaProfileId\n * @returns {Promise<MultimediaProfileResponse>}\n */\n async getMultimediaProfileById(orgId, multimediaProfileId) {\n try {\n const resource = _constants3.endPointMap.multimediaProfile(orgId, multimediaProfileId);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getMultimediaProfileById API success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getMultimediaProfileById'\n });\n return Promise.resolve(response.body);\n } catch (error) {\n _loggerProxy.default.error(`getMultimediaProfileById API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getMultimediaProfileById'\n });\n throw error;\n }\n }\n\n /**\n * fetches the list of teams for the given orgId.\n * @param {string} orgId\n * @param {number} page\n * @param {number} pageSize\n * @param {string[]} filter\n * @param {string[]} attributes\n * @returns {Promise<ListTeamsResponse>}\n */\n async getListOfTeams(orgId, page, pageSize, filter) {\n try {\n const resource = _constants3.endPointMap.listTeams(orgId, page, pageSize, filter);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getListOfTeams api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getListOfTeams'\n });\n return Promise.resolve(response.body);\n } catch (error) {\n _loggerProxy.default.error(`getListOfTeams API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getListOfTeams'\n });\n throw error;\n }\n }\n\n /**\n * Fetches all teams from all pages for the given orgId\n * @param {string} orgId\n * @param {number} pageSize\n * @param {string[]} filter\n * @param {string[]} attributes\n * @returns {Promise<TeamList[]>}\n */\n async getAllTeams(orgId, pageSize, filter) {\n try {\n let allTeams = [];\n let page = _constants3.DEFAULT_PAGE;\n const firstResponse = await this.getListOfTeams(orgId, page, pageSize, filter);\n const totalPages = firstResponse.meta.totalPages;\n allTeams = allTeams.concat(firstResponse.data);\n const requests = [];\n for (page = _constants3.DEFAULT_PAGE + 1; page < totalPages; page += 1) {\n requests.push(this.getListOfTeams(orgId, page, pageSize, filter));\n }\n const responses = await Promise.all(requests);\n for (const response of responses) {\n allTeams = allTeams.concat(response.data);\n }\n return allTeams;\n } catch (error) {\n _loggerProxy.default.error(`getAllTeams API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getAllTeams'\n });\n throw error;\n }\n }\n\n /**\n * fetches the list of aux codes for the given orgId.\n * @param {string} orgId\n * @param {number} page\n * @param {number} pageSize\n * @param {string[]} filter\n * @param {string[]} attributes\n * @returns {Promise<ListAuxCodesResponse>}\n */\n async getListOfAuxCodes(orgId, page, pageSize, filter, attributes) {\n try {\n const resource = _constants3.endPointMap.listAuxCodes(orgId, page, pageSize, filter, attributes);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getListOfAuxCodes api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getListOfAuxCodes'\n });\n return Promise.resolve(response.body);\n } catch (error) {\n _loggerProxy.default.error(`getListOfAuxCodes API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getListOfAuxCodes'\n });\n throw error;\n }\n }\n\n /**\n * Fetches all aux codes from all pages for the given orgId\n * @param {string} orgId\n * @param {number} pageSize\n * @param {string[]} filter\n * @param {string[]} attributes\n * @returns {Promise<AuxCode[]>}\n */\n async getAllAuxCodes(orgId, pageSize, filter, attributes) {\n try {\n let allAuxCodes = [];\n let page = _constants3.DEFAULT_PAGE;\n const firstResponse = await this.getListOfAuxCodes(orgId, page, pageSize, filter, attributes);\n allAuxCodes = allAuxCodes.concat(firstResponse.data);\n const totalPages = firstResponse.meta.totalPages;\n const promises = [];\n for (page = _constants3.DEFAULT_PAGE + 1; page < totalPages; page += 1) {\n promises.push(this.getListOfAuxCodes(orgId, page, pageSize, filter, attributes));\n }\n const responses = await Promise.all(promises);\n responses.forEach(response => {\n allAuxCodes = allAuxCodes.concat(response.data);\n });\n return allAuxCodes;\n } catch (error) {\n _loggerProxy.default.error(`getAllAuxCodes API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getAllAuxCodes'\n });\n throw error;\n }\n }\n\n /**\n * Fetches the site data for the given orgId and siteId.\n * @param {string} orgId\n * @param {string} siteId\n * @returns {Promise<SiteInfo>}\n */\n async getSiteInfo(orgId, siteId) {\n try {\n const resource = _constants3.endPointMap.siteInfo(orgId, siteId);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getSiteInfo api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getSiteInfo'\n });\n return Promise.resolve(response.body);\n } catch (error) {\n _loggerProxy.default.error(`getSiteInfo API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getSiteInfo'\n });\n throw error;\n }\n }\n\n /**\n * Fetches the organization info for the given orgId.\n * @param {string} orgId\n * @returns {Promise<OrgInfo>}\n */\n async getOrgInfo(orgId) {\n try {\n const resource = _constants3.endPointMap.orgInfo(orgId);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getOrgInfo api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getOrgInfo'\n });\n return Promise.resolve(response.body);\n } catch (error) {\n _loggerProxy.default.error(`getOrgInfo API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getOrgInfo'\n });\n throw error;\n }\n }\n\n /**\n * Fetches the organization settings for the given orgId.\n * @param {string} orgId\n * @returns {Promise<OrgSettings>}\n */\n async getOrganizationSetting(orgId) {\n try {\n const resource = _constants3.endPointMap.orgSettings(orgId);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getOrganizationSetting api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getOrganizationSetting'\n });\n return Promise.resolve(response.body.data[0]);\n } catch (error) {\n _loggerProxy.default.error(`getOrganizationSetting API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getOrganizationSetting'\n });\n throw error;\n }\n }\n\n /**\n * Fetches the tenant data for the given orgId.\n * @param {string} orgId\n * @returns {Promise<TenantData>}\n */\n async getTenantData(orgId) {\n try {\n const resource = _constants3.endPointMap.tenantData(orgId);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getTenantData api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getTenantData'\n });\n return Promise.resolve(response.body.data[0]);\n } catch (error) {\n _loggerProxy.default.error(`getTenantData API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getTenantData'\n });\n throw error;\n }\n }\n\n /**\n * Fetches the URL mapping data for the given orgId.\n * @param {string} orgId\n * @returns {Promise<URLMapping[]>}\n */\n async getURLMapping(orgId) {\n try {\n const resource = _constants3.endPointMap.urlMapping(orgId);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getURLMapping api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getURLMapping'\n });\n return Promise.resolve(response.body.data);\n } catch (error) {\n _loggerProxy.default.error(`getURLMapping API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getURLMapping'\n });\n throw error;\n }\n }\n\n /**\n * Fetches the dial plan data for the given orgId.\n * @param {string} orgId\n * @returns {Promise<DialPlanEntity[]>}\n */\n async getDialPlanData(orgId) {\n try {\n const resource = _constants3.endPointMap.dialPlan(orgId);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getDialPlanData api success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getDialPlanData'\n });\n return Promise.resolve(response.body);\n } catch (error) {\n _loggerProxy.default.error(`getDialPlanData API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getDialPlanData'\n });\n throw error;\n }\n }\n\n /**\n * Fetches the list of queues for the given orgId.\n * @param {string} orgId\n * @param {number} page\n * @param {number} pageSize\n * @param {string} search - optional search string\n * @param {string} filter - optional filter string\n * @returns Promise<ContactServiceQueue[]>\n */\n async getQueues(orgId, page, pageSize, search, filter) {\n try {\n let queryParams = `page=${page}&pageSize=${pageSize}&desktopProfileFilter=true`;\n if (search) queryParams += `&search=${search}`;\n if (filter) queryParams += `&filter=${filter}`;\n const resource = _constants3.endPointMap.queueList(orgId, queryParams);\n const response = await this.webexReq.request({\n service: _constants.WCC_API_GATEWAY,\n resource,\n method: _types.HTTP_METHODS.GET\n });\n if (response.statusCode !== 200) {\n throw new Error(`API call failed with ${response.statusCode}`);\n }\n _loggerProxy.default.log('getQueues API success.', {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getQueues'\n });\n return response.body?.data;\n } catch (error) {\n _loggerProxy.default.error(`getQueues API call failed with ${error}`, {\n module: _constants2.CONFIG_FILE_NAME,\n method: 'getQueues'\n });\n throw error;\n }\n }\n}\nexports[\"default\"] = AgentConfigService;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/../../../node_modules/@webex/plugin-cc/dist/services/config/index.js?");
|
|
3824
3824
|
|
|
3825
3825
|
/***/ }),
|
|
3826
3826
|
|
|
@@ -3952,7 +3952,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));
|
|
|
3952
3952
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3953
3953
|
|
|
3954
3954
|
"use strict";
|
|
3955
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\nvar _events = _interopRequireDefault(__webpack_require__(/*! events */ \"../../../node_modules/events/events.js\"));\nvar _calling = __webpack_require__(/*! @webex/calling */ \"../../../node_modules/@webex/calling/dist/module/index.js\");\nvar _types = __webpack_require__(/*! ./types */ \"../../../node_modules/@webex/plugin-cc/dist/services/task/types.js\");\nvar _constants = __webpack_require__(/*! ../../constants */ \"../../../node_modules/@webex/plugin-cc/dist/constants.js\");\nvar _types2 = __webpack_require__(/*! ../config/types */ \"../../../node_modules/@webex/plugin-cc/dist/services/config/types.js\");\nvar _types3 = __webpack_require__(/*! ../../types */ \"../../../node_modules/@webex/plugin-cc/dist/types.js\");\nvar _loggerProxy = _interopRequireDefault(__webpack_require__(/*! ../../logger-proxy */ \"../../../node_modules/@webex/plugin-cc/dist/logger-proxy.js\"));\nvar _ = _interopRequireDefault(__webpack_require__(/*! . */ \"../../../node_modules/@webex/plugin-cc/dist/services/task/index.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nclass TaskManager extends _events.default {\n /**\n * @param contact - Routing Contact layer. Talks to AQMReq layer to convert events to promises\n * @param webCallingService - Webrtc Service Layer\n * @param webSocketManager - Websocket Manager to maintain websocket connection and keepalives\n */\n constructor(contact, webCallingService, webSocketManager) {\n super();\n this.contact = contact;\n this.taskCollection = {};\n this.webCallingService = webCallingService;\n this.webSocketManager = webSocketManager;\n this.registerTaskListeners();\n this.registerIncomingCallEvent();\n }\n handleIncomingWebCall = call => {\n if (this.currentTask) {\n if (this.currentTask.data.interaction.mediaChannel === 'telephony') {\n this.webCallingService.mapCallToTask(call.getCallId(), this.currentTask.data.interactionId);\n _loggerProxy.default.log('Call mapped to task', {\n module: _constants.TASK_MANAGER_FILE,\n method: 'handleIncomingWebCall'\n });\n }\n this.emit(_types.TASK_EVENTS.TASK_INCOMING, this.currentTask);\n }\n this.call = call;\n };\n registerIncomingCallEvent() {\n this.webCallingService.on(_calling.LINE_EVENTS.INCOMING_CALL, this.handleIncomingWebCall);\n }\n unregisterIncomingCallEvent() {\n this.webCallingService.off(_calling.LINE_EVENTS.INCOMING_CALL, this.handleIncomingWebCall);\n }\n registerTaskListeners() {\n this.webSocketManager.on('message', event => {\n const payload = JSON.parse(event);\n // Re-emit the task events to the task object\n if (payload.data?.type) {\n if (Object.values(_types2.CC_TASK_EVENTS).includes(payload.data.type)) {\n if (this.currentTask) {\n this.currentTask.emit(payload.data.type, payload.data);\n }\n }\n switch (payload.data.type) {\n case _types2.CC_EVENTS.AGENT_CONTACT:\n this.currentTask = new _.default(this.contact, this.webCallingService, payload.data);\n this.taskCollection[payload.data.interactionId] = this.currentTask;\n this.emit(_types.TASK_EVENTS.TASK_HYDRATE, this.currentTask);\n break;\n case _types2.CC_EVENTS.AGENT_CONTACT_RESERVED:\n this.currentTask = new _.default(this.contact, this.webCallingService, payload.data);\n this.currentTask.data = {\n ...this.currentTask.data,\n isConsulted: false\n }; // Ensure isConsulted prop exists\n this.taskCollection[payload.data.interactionId] = this.currentTask;\n if (this.webCallingService.loginOption !== _types3.LoginOption.BROWSER) {\n this.emit(_types.TASK_EVENTS.TASK_INCOMING, this.currentTask);\n } else if (this.call) {\n this.emit(_types.TASK_EVENTS.TASK_INCOMING, this.currentTask);\n }\n break;\n case _types2.CC_EVENTS.AGENT_OFFER_CONTACT:\n // We don't have to emit any event here since this will be result of promise.\n this.currentTask = this.currentTask.updateTaskData(payload.data);\n _loggerProxy.default.log('Agent offer contact', {\n module: _constants.TASK_MANAGER_FILE,\n method: 'registerTaskListeners'\n });\n break;\n case _types2.CC_EVENTS.AGENT_OUTBOUND_FAILED:\n // We don't have to emit any event here since this will be result of promise.\n if (this.currentTask.data) {\n this.removeCurrentTaskFromCollection();\n }\n _loggerProxy.default.log('Agent outbound failed', {\n module: _constants.TASK_MANAGER_FILE,\n method: 'registerTaskListeners'\n });\n break;\n case _types2.CC_EVENTS.AGENT_CONTACT_ASSIGNED:\n this.currentTask = this.currentTask.updateTaskData(payload.data);\n this.currentTask.emit(_types.TASK_EVENTS.TASK_ASSIGNED, this.currentTask);\n break;\n case _types2.CC_EVENTS.AGENT_CONTACT_UNASSIGNED:\n this.currentTask.emit(_types.TASK_EVENTS.TASK_END, {\n wrapupRequired: true\n });\n this.handleTaskCleanup();\n break;\n case _types2.CC_EVENTS.AGENT_CONTACT_OFFER_RONA:\n this.currentTask.emit(_types.TASK_EVENTS.TASK_REJECT, payload.data.reason);\n this.handleTaskCleanup();\n break;\n case _types2.CC_EVENTS.CONTACT_ENDED:\n this.currentTask.emit(_types.TASK_EVENTS.TASK_END, {\n wrapupRequired: payload.data.interaction.state !== 'new'\n });\n this.handleTaskCleanup();\n break;\n case _types2.CC_EVENTS.AGENT_CONTACT_HELD:\n // As soon as the main interaction is held, we need to emit TASK_HOLD\n this.updateCurrentTaskDataAndEmitEvent(payload.data, _types.TASK_EVENTS.TASK_HOLD);\n break;\n case _types2.CC_EVENTS.AGENT_CONTACT_UNHELD:\n // As soon as the main interaction is unheld, we need to emit TASK_RESUME\n this.updateCurrentTaskDataAndEmitEvent(payload.data, _types.TASK_EVENTS.TASK_RESUME);\n break;\n case _types2.CC_EVENTS.AGENT_VTEAM_TRANSFERRED:\n this.currentTask.emit(_types.TASK_EVENTS.TASK_END, {\n wrapupRequired: true\n });\n this.handleTaskCleanup();\n break;\n case _types2.CC_EVENTS.AGENT_CTQ_CANCEL_FAILED:\n this.updateCurrentTaskDataAndEmitEvent(payload.data, _types.TASK_EVENTS.TASK_CONSULT_QUEUE_FAILED);\n break;\n case _types2.CC_EVENTS.AGENT_CONSULT_CREATED:\n // Received when self agent initiates a consult\n this.currentTask = this.currentTask.updateTaskData(payload.data);\n // Do not emit anything since this be received only as a result of an API invocation(handled by a promise)\n break;\n case _types2.CC_EVENTS.AGENT_OFFER_CONSULT:\n {\n // Received when other agent sends us a consult offer\n this.currentTask = this.currentTask.updateTaskData({\n ...payload.data,\n isConsulted: true // This ensures that the task is marked as us being requested for a consult\n });\n\n break;\n }\n case _types2.CC_EVENTS.AGENT_CONSULTING:\n // Received when agent is in an active consult state\n this.currentTask = this.currentTask.updateTaskData(payload.data);\n if (this.currentTask.data.isConsulted) {\n // Fire only if you are the agent who received the consult request\n this.currentTask.emit(_types.TASK_EVENTS.TASK_CONSULT_ACCEPTED, this.currentTask);\n } else {\n // Fire only if you are the agent who initiated the consult\n this.currentTask.emit(_types.TASK_EVENTS.TASK_CONSULTING, this.currentTask);\n }\n break;\n case _types2.CC_EVENTS.AGENT_CONSULT_FAILED:\n // This can only be received by the agent who initiated the consult.\n // We need not emit any event here since this will be result of promise\n this.currentTask.updateTaskData(payload.data);\n break;\n case _types2.CC_EVENTS.AGENT_CONSULT_ENDED:\n this.updateCurrentTaskDataAndEmitEvent(payload.data, _types.TASK_EVENTS.TASK_CONSULT_END);\n if (this.currentTask.data.isConsulted) {\n // This will be the end state of the task as soon as we end the consult in case of\n // us being offered a consult\n this.removeCurrentTaskFromCollection();\n }\n break;\n case _types2.CC_EVENTS.AGENT_CTQ_CANCELLED:\n // This event is received when the consult using queue is cancelled using API\n this.updateCurrentTaskDataAndEmitEvent(payload.data, _types.TASK_EVENTS.TASK_CONSULT_QUEUE_CANCELLED);\n break;\n case _types2.CC_EVENTS.AGENT_WRAPUP:\n this.currentTask = this.currentTask.updateTaskData(payload.data);\n break;\n case _types2.CC_EVENTS.AGENT_WRAPPEDUP:\n this.removeCurrentTaskFromCollection();\n break;\n default:\n break;\n }\n }\n });\n }\n updateCurrentTaskDataAndEmitEvent(taskData, event) {\n this.currentTask = this.currentTask.updateTaskData(taskData);\n this.currentTask.emit(event, this.currentTask);\n }\n removeCurrentTaskFromCollection() {\n if (this.currentTask && this.currentTask.data && this.currentTask.data.interactionId) {\n delete this.taskCollection[this.currentTask.data.interactionId];\n _loggerProxy.default.info(`Task removed from collection: ${this.currentTask.data.interactionId}`, {\n module: _constants.TASK_MANAGER_FILE,\n method: 'removeCurrentTaskFromCollection'\n });\n }\n }\n handleTaskCleanup() {\n if (this.webCallingService.loginOption === _types3.LoginOption.BROWSER) {\n this.currentTask.unregisterWebCallListeners();\n this.webCallingService.cleanUpCall();\n }\n this.removeCurrentTaskFromCollection();\n }\n\n /**\n * @param taskId - Unique identifier for each task\n */\n getTask = taskId => {\n return this.taskCollection[taskId];\n };\n\n /**\n * @param taskId - Unique identifier for each task\n */\n getAllTasks = () => {\n return this.taskCollection;\n };\n\n /**\n * @param contact - Routing Contact layer. Talks to AQMReq layer to convert events to promises\n * @param webCallingService - Webrtc Service Layer\n * @param webSocketManager - Websocket Manager to maintain websocket connection and keepalives\n */\n static getTaskManager = (contact, webCallingService, webSocketManager) => {\n if (!this.taskManager) {\n this.taskManager = new TaskManager(contact, webCallingService, webSocketManager);\n }\n return this.taskManager;\n };\n}\nexports[\"default\"] = TaskManager;\n//# sourceMappingURL=TaskManager.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/../../../node_modules/@webex/plugin-cc/dist/services/task/TaskManager.js?");
|
|
3955
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\nvar _events = _interopRequireDefault(__webpack_require__(/*! events */ \"../../../node_modules/events/events.js\"));\nvar _calling = __webpack_require__(/*! @webex/calling */ \"../../../node_modules/@webex/calling/dist/module/index.js\");\nvar _types = __webpack_require__(/*! ./types */ \"../../../node_modules/@webex/plugin-cc/dist/services/task/types.js\");\nvar _constants = __webpack_require__(/*! ../../constants */ \"../../../node_modules/@webex/plugin-cc/dist/constants.js\");\nvar _types2 = __webpack_require__(/*! ../config/types */ \"../../../node_modules/@webex/plugin-cc/dist/services/config/types.js\");\nvar _types3 = __webpack_require__(/*! ../../types */ \"../../../node_modules/@webex/plugin-cc/dist/types.js\");\nvar _loggerProxy = _interopRequireDefault(__webpack_require__(/*! ../../logger-proxy */ \"../../../node_modules/@webex/plugin-cc/dist/logger-proxy.js\"));\nvar _ = _interopRequireDefault(__webpack_require__(/*! . */ \"../../../node_modules/@webex/plugin-cc/dist/services/task/index.js\"));\nvar _MetricsManager = _interopRequireDefault(__webpack_require__(/*! ../../metrics/MetricsManager */ \"../../../node_modules/@webex/plugin-cc/dist/metrics/MetricsManager.js\"));\nvar _constants2 = __webpack_require__(/*! ../../metrics/constants */ \"../../../node_modules/@webex/plugin-cc/dist/metrics/constants.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nclass TaskManager extends _events.default {\n /**\n * @param contact - Routing Contact layer. Talks to AQMReq layer to convert events to promises\n * @param webCallingService - Webrtc Service Layer\n * @param webSocketManager - Websocket Manager to maintain websocket connection and keepalives\n */\n constructor(contact, webCallingService, webSocketManager) {\n super();\n this.contact = contact;\n this.taskCollection = {};\n this.webCallingService = webCallingService;\n this.webSocketManager = webSocketManager;\n this.metricsManager = _MetricsManager.default.getInstance();\n this.registerTaskListeners();\n this.registerIncomingCallEvent();\n }\n handleIncomingWebCall = call => {\n const currentTask = Object.values(this.taskCollection).find(task => task.data.interaction.mediaType === 'telephony');\n if (currentTask) {\n this.webCallingService.mapCallToTask(call.getCallId(), currentTask.data.interactionId);\n _loggerProxy.default.log('Call mapped to task', {\n module: _constants.TASK_MANAGER_FILE,\n method: 'handleIncomingWebCall'\n });\n this.emit(_types.TASK_EVENTS.TASK_INCOMING, currentTask);\n }\n this.call = call;\n };\n registerIncomingCallEvent() {\n this.webCallingService.on(_calling.LINE_EVENTS.INCOMING_CALL, this.handleIncomingWebCall);\n }\n unregisterIncomingCallEvent() {\n this.webCallingService.off(_calling.LINE_EVENTS.INCOMING_CALL, this.handleIncomingWebCall);\n }\n registerTaskListeners() {\n this.webSocketManager.on('message', event => {\n const payload = JSON.parse(event);\n // Re-emit the task events to the task object\n let task;\n if (payload.data?.type) {\n if (Object.values(_types2.CC_TASK_EVENTS).includes(payload.data.type)) {\n task = this.taskCollection[payload.data.interactionId];\n if (task) {\n task.emit(payload.data.type, payload.data);\n }\n }\n switch (payload.data.type) {\n case _types2.CC_EVENTS.AGENT_CONTACT:\n task = new _.default(this.contact, this.webCallingService, {\n ...payload.data,\n wrapUpRequired: payload.data.interaction?.participants?.[payload.data.agentId]?.isWrapUp || false\n });\n this.taskCollection[payload.data.interactionId] = task;\n this.emit(_types.TASK_EVENTS.TASK_HYDRATE, task);\n break;\n case _types2.CC_EVENTS.AGENT_CONTACT_RESERVED:\n task = new _.default(this.contact, this.webCallingService, {\n ...payload.data,\n isConsulted: false\n }); // Ensure isConsulted prop exists\n this.taskCollection[payload.data.interactionId] = task;\n if (this.webCallingService.loginOption !== _types3.LoginOption.BROWSER || task.data.interaction.mediaType !== _types.MEDIA_CHANNEL.TELEPHONY // for digital channels\n ) {\n this.emit(_types.TASK_EVENTS.TASK_INCOMING, task);\n } else if (this.call) {\n this.emit(_types.TASK_EVENTS.TASK_INCOMING, task);\n }\n break;\n case _types2.CC_EVENTS.AGENT_OFFER_CONTACT:\n // We don't have to emit any event here since this will be result of promise.\n task = this.updateTaskData(task, payload.data);\n _loggerProxy.default.log('Agent offer contact', {\n module: _constants.TASK_MANAGER_FILE,\n method: 'registerTaskListeners'\n });\n break;\n case _types2.CC_EVENTS.AGENT_OUTBOUND_FAILED:\n // We don't have to emit any event here since this will be result of promise.\n if (task.data) {\n this.removeTaskFromCollection(task);\n }\n _loggerProxy.default.log('Agent outbound failed', {\n module: _constants.TASK_MANAGER_FILE,\n method: 'registerTaskListeners'\n });\n break;\n case _types2.CC_EVENTS.AGENT_CONTACT_ASSIGNED:\n task = this.updateTaskData(task, payload.data);\n task.emit(_types.TASK_EVENTS.TASK_ASSIGNED, task);\n break;\n case _types2.CC_EVENTS.AGENT_CONTACT_UNASSIGNED:\n task = this.updateTaskData(task, {\n ...payload.data,\n wrapUpRequired: true\n });\n this.handleTaskCleanup(task);\n task.emit(_types.TASK_EVENTS.TASK_END, task);\n break;\n case _types2.CC_EVENTS.AGENT_CONTACT_OFFER_RONA:\n task = this.updateTaskData(task, payload.data);\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.AGENT_RONA, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(payload.data),\n taskId: payload.data.interactionId,\n reason: payload.data.reason\n }, ['behavioral', 'operational']);\n this.handleTaskCleanup(task);\n task.emit(_types.TASK_EVENTS.TASK_REJECT, payload.data.reason);\n break;\n case _types2.CC_EVENTS.CONTACT_ENDED:\n task = this.updateTaskData(task, {\n ...payload.data,\n wrapUpRequired: payload.data.interaction.state !== 'new'\n });\n this.handleTaskCleanup(task);\n task.emit(_types.TASK_EVENTS.TASK_END, task);\n break;\n case _types2.CC_EVENTS.AGENT_CONTACT_HELD:\n // As soon as the main interaction is held, we need to emit TASK_HOLD\n task = this.updateTaskData(task, payload.data);\n task.emit(_types.TASK_EVENTS.TASK_HOLD, task);\n break;\n case _types2.CC_EVENTS.AGENT_CONTACT_UNHELD:\n // As soon as the main interaction is unheld, we need to emit TASK_RESUME\n task = this.updateTaskData(task, payload.data);\n task.emit(_types.TASK_EVENTS.TASK_RESUME, task);\n break;\n case _types2.CC_EVENTS.AGENT_VTEAM_TRANSFERRED:\n task = this.updateTaskData(task, {\n ...payload.data,\n wrapUpRequired: true\n });\n this.handleTaskCleanup(task);\n task.emit(_types.TASK_EVENTS.TASK_END, task);\n break;\n case _types2.CC_EVENTS.AGENT_CTQ_CANCEL_FAILED:\n task = this.updateTaskData(task, payload.data);\n task.emit(_types.TASK_EVENTS.TASK_CONSULT_QUEUE_FAILED, task);\n break;\n case _types2.CC_EVENTS.AGENT_CONSULT_CREATED:\n // Received when self agent initiates a consult\n task = this.updateTaskData(task, payload.data);\n // Do not emit anything since this be received only as a result of an API invocation(handled by a promise)\n break;\n case _types2.CC_EVENTS.AGENT_OFFER_CONSULT:\n // Received when other agent sends us a consult offer\n task = this.updateTaskData(task, {\n ...payload.data,\n isConsulted: true // This ensures that the task is marked as us being requested for a consult\n });\n\n break;\n case _types2.CC_EVENTS.AGENT_CONSULTING:\n // Received when agent is in an active consult state\n task = this.updateTaskData(task, payload.data);\n if (task.data.isConsulted) {\n // Fire only if you are the agent who received the consult request\n task.emit(_types.TASK_EVENTS.TASK_CONSULT_ACCEPTED, task);\n } else {\n // Fire only if you are the agent who initiated the consult\n task.emit(_types.TASK_EVENTS.TASK_CONSULTING, task);\n }\n break;\n case _types2.CC_EVENTS.AGENT_CONSULT_FAILED:\n // This can only be received by the agent who initiated the consult.\n // We need not emit any event here since this will be result of promise\n task = this.updateTaskData(task, payload.data);\n break;\n case _types2.CC_EVENTS.AGENT_CONSULT_ENDED:\n task = this.updateTaskData(task, payload.data);\n if (task.data.isConsulted) {\n // This will be the end state of the task as soon as we end the consult in case of\n // us being offered a consult\n this.removeTaskFromCollection(task);\n }\n task.emit(_types.TASK_EVENTS.TASK_CONSULT_END, task);\n break;\n case _types2.CC_EVENTS.AGENT_CTQ_CANCELLED:\n // This event is received when the consult using queue is cancelled using API\n task = this.updateTaskData(task, payload.data);\n task.emit(_types.TASK_EVENTS.TASK_CONSULT_QUEUE_CANCELLED, task);\n break;\n case _types2.CC_EVENTS.AGENT_WRAPUP:\n task = this.updateTaskData(task, payload.data);\n break;\n case _types2.CC_EVENTS.AGENT_WRAPPEDUP:\n this.removeTaskFromCollection(task);\n break;\n default:\n break;\n }\n }\n });\n }\n updateTaskData(task, taskData) {\n const currentTask = task.updateTaskData(taskData);\n this.taskCollection[taskData.interactionId] = currentTask;\n return currentTask;\n }\n removeTaskFromCollection(task) {\n if (task?.data?.interactionId) {\n delete this.taskCollection[task.data.interactionId];\n _loggerProxy.default.info(`Task removed from collection: ${task.data.interactionId}`, {\n module: _constants.TASK_MANAGER_FILE,\n method: 'removeTaskFromCollection'\n });\n }\n }\n handleTaskCleanup(task) {\n if (this.webCallingService.loginOption === _types3.LoginOption.BROWSER && task.data.interaction.mediaType === 'telephony') {\n task.unregisterWebCallListeners();\n this.webCallingService.cleanUpCall();\n }\n if (task.data.interaction.state === 'new') {\n // Only remove tasks in 'new' state immediately. For other states,\n // retain tasks until they complete wrap-up, unless the task disconnected before being answered.\n this.removeTaskFromCollection(task);\n }\n }\n\n /**\n * @param taskId - Unique identifier for each task\n */\n getTask = taskId => {\n return this.taskCollection[taskId];\n };\n\n /**\n * @param taskId - Unique identifier for each task\n */\n getAllTasks = () => {\n return this.taskCollection;\n };\n\n /**\n * @param contact - Routing Contact layer. Talks to AQMReq layer to convert events to promises\n * @param webCallingService - Webrtc Service Layer\n * @param webSocketManager - Websocket Manager to maintain websocket connection and keepalives\n */\n static getTaskManager = (contact, webCallingService, webSocketManager) => {\n if (!this.taskManager) {\n this.taskManager = new TaskManager(contact, webCallingService, webSocketManager);\n }\n return this.taskManager;\n };\n}\nexports[\"default\"] = TaskManager;\n//# sourceMappingURL=TaskManager.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/../../../node_modules/@webex/plugin-cc/dist/services/task/TaskManager.js?");
|
|
3956
3956
|
|
|
3957
3957
|
/***/ }),
|
|
3958
3958
|
|
|
@@ -3974,7 +3974,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));
|
|
|
3974
3974
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3975
3975
|
|
|
3976
3976
|
"use strict";
|
|
3977
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = routingContact;\nvar _types = __webpack_require__(/*! ../config/types */ \"../../../node_modules/@webex/plugin-cc/dist/services/config/types.js\");\nvar _Utils = __webpack_require__(/*! ../core/Utils */ \"../../../node_modules/@webex/plugin-cc/dist/services/core/Utils.js\");\nvar _constants = __webpack_require__(/*! ../constants */ \"../../../node_modules/@webex/plugin-cc/dist/services/constants.js\");\nvar _constants2 = __webpack_require__(/*! ../core/constants */ \"../../../node_modules/@webex/plugin-cc/dist/services/core/constants.js\");\nvar _constants3 = __webpack_require__(/*! ./constants */ \"../../../node_modules/@webex/plugin-cc/dist/services/task/constants.js\");\nvar _types2 = __webpack_require__(/*! ./types */ \"../../../node_modules/@webex/plugin-cc/dist/services/task/types.js\");\nfunction routingContact(aqm) {\n return {\n /*\n * Accept incoming task\n */\n accept: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}/accept`,\n data: {},\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONTACT_ASSIGNED,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONTACT_ASSIGN_FAILED,\n interactionId: p.interactionId\n }\n },\n errId: 'Service.aqm.task.accept'\n }\n })),\n /*\n * Hold task\n */\n hold: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.HOLD}`,\n data: p.data,\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONTACT_HELD,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONTACT_HOLD_FAILED\n }\n },\n errId: 'Service.aqm.task.hold'\n }\n })),\n /*\n * Unhold task\n */\n unHold: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.UNHOLD}`,\n data: p.data,\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONTACT_UNHELD,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONTACT_UNHOLD_FAILED\n }\n },\n errId: 'Service.aqm.task.unHold'\n }\n })),\n /*\n * Pause Recording\n */\n pauseRecording: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.PAUSE}`,\n data: {},\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.CONTACT_RECORDING_PAUSED,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.CONTACT_RECORDING_PAUSE_FAILED\n }\n },\n errId: 'Service.aqm.task.pauseRecording'\n }\n })),\n /*\n * Resume Recording\n */\n resumeRecording: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.RESUME}`,\n data: p.data,\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.CONTACT_RECORDING_RESUMED,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.CONTACT_RECORDING_RESUME_FAILED\n }\n },\n errId: 'Service.aqm.task.resumeRecording'\n }\n })),\n /*\n * Consult contact\n */\n consult: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.CONSULT}`,\n data: p.data,\n timeout: p.data && p.data.destinationType === _types2.DESTINATION_TYPE.QUEUE ? 'disabled' : _constants2.TIMEOUT_REQ,\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONSULT_CREATED,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: p.data && p.data.destinationType === _types2.DESTINATION_TYPE.QUEUE ? _types.CC_EVENTS.AGENT_CTQ_FAILED : _types.CC_EVENTS.AGENT_CONSULT_FAILED\n }\n },\n errId: 'Service.aqm.task.consult'\n },\n notifCancel: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: 'AgentCtqCancelled',\n interactionId: p.interactionId\n }\n },\n msg: {}\n }\n })),\n /*\n * Consult End\n */\n consultEnd: aqm.req(p => {\n // Setting false value for optional attribute\n const {\n isConsult,\n isSecondaryEpDnAgent = false,\n queueId\n } = p.data;\n return {\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.CONSULT_END}`,\n host: _constants.WCC_API_GATEWAY,\n data: queueId ? {\n queueId\n } : {},\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: 'RoutingMessage',\n data: {\n type: (() => {\n if (queueId) return _types.CC_EVENTS.AGENT_CTQ_CANCELLED;\n if (isSecondaryEpDnAgent) return _types.CC_EVENTS.CONTACT_ENDED;\n if (isConsult) return _types.CC_EVENTS.AGENT_CONSULT_ENDED;\n return _types.CC_EVENTS.AGENT_CONSULT_CONFERENCE_ENDED;\n })(),\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: 'RoutingMessage',\n data: {\n type: p.data.queueId ? _types.CC_EVENTS.AGENT_CTQ_CANCEL_FAILED : _types.CC_EVENTS.AGENT_CONSULT_END_FAILED\n }\n },\n errId: p.data.queueId ? 'Service.aqm.task.cancelCtq' : 'Service.aqm.task.consultEnd'\n }\n };\n }),\n /*\n * Consult Accept contact\n */\n consultAccept: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.CONSULT_ACCEPT}`,\n data: {},\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONSULTING,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONTACT_ASSIGN_FAILED\n }\n },\n errId: 'Service.aqm.task.consultAccept'\n }\n })),\n /*\n * BlindTransfer contact\n */\n blindTransfer: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.TRANSFER}`,\n data: p.data,\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_BLIND_TRANSFERRED,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_BLIND_TRANSFER_FAILED\n }\n },\n errId: 'Service.aqm.task.AgentBlindTransferFailedEvent'\n }\n })),\n /*\n * VteamTransfer contact\n */\n vteamTransfer: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.TRANSFER}`,\n data: p.data,\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_VTEAM_TRANSFERRED,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_VTEAM_TRANSFER_FAILED\n }\n },\n errId: 'Service.aqm.task.AgentVteamTransferFailed'\n }\n })),\n /*\n * Consult Transfer contact\n */\n consultTransfer: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.CONSULT_TRANSFER}`,\n data: p.data,\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: [_types.CC_EVENTS.AGENT_CONSULT_TRANSFERRED, _types.CC_EVENTS.AGENT_CONSULT_TRANSFERRING],\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONSULT_TRANSFER_FAILED\n }\n },\n errId: 'Service.aqm.task.AgentConsultTransferFailed'\n }\n })),\n /*\n * End contact\n */\n end: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.END}`,\n data: {},\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_WRAPUP,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONTACT_END_FAILED\n }\n },\n errId: 'Service.aqm.task.end'\n }\n })),\n /*\n * Wrapup contact\n */\n wrapup: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.WRAPUP}`,\n data: p.data,\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_WRAPPEDUP,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_WRAPUP_FAILED\n }\n },\n errId: 'Service.aqm.task.wrapup'\n }\n })),\n /*\n * Cancel popover\n */\n cancelTask: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.END}`,\n data: {},\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.CONTACT_ENDED,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONTACT_END_FAILED\n }\n },\n errId: 'Service.aqm.task.end'\n }\n })),\n /*\n * Cancel Ctq request\n */\n cancelCtq: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}/cancelCtq`,\n data: p.data,\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: 'AgentCtqCancelled',\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: 'AgentCtqCancelFailed'\n }\n },\n errId: 'Service.aqm.task.cancelCtq'\n }\n }))\n };\n}\n//# sourceMappingURL=contact.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/../../../node_modules/@webex/plugin-cc/dist/services/task/contact.js?");
|
|
3977
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = routingContact;\nvar _types = __webpack_require__(/*! ../config/types */ \"../../../node_modules/@webex/plugin-cc/dist/services/config/types.js\");\nvar _Utils = __webpack_require__(/*! ../core/Utils */ \"../../../node_modules/@webex/plugin-cc/dist/services/core/Utils.js\");\nvar _constants = __webpack_require__(/*! ../constants */ \"../../../node_modules/@webex/plugin-cc/dist/services/constants.js\");\nvar _constants2 = __webpack_require__(/*! ../core/constants */ \"../../../node_modules/@webex/plugin-cc/dist/services/core/constants.js\");\nvar _constants3 = __webpack_require__(/*! ./constants */ \"../../../node_modules/@webex/plugin-cc/dist/services/task/constants.js\");\nvar _types2 = __webpack_require__(/*! ./types */ \"../../../node_modules/@webex/plugin-cc/dist/services/task/types.js\");\nfunction routingContact(aqm) {\n return {\n /*\n * Accept incoming task\n */\n accept: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}/accept`,\n host: _constants.WCC_API_GATEWAY,\n data: {},\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONTACT_ASSIGNED,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONTACT_ASSIGN_FAILED,\n interactionId: p.interactionId\n }\n },\n errId: 'Service.aqm.task.accept'\n }\n })),\n /*\n * Hold task\n */\n hold: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.HOLD}`,\n data: p.data,\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONTACT_HELD,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONTACT_HOLD_FAILED\n }\n },\n errId: 'Service.aqm.task.hold'\n }\n })),\n /*\n * Unhold task\n */\n unHold: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.UNHOLD}`,\n data: p.data,\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONTACT_UNHELD,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONTACT_UNHOLD_FAILED\n }\n },\n errId: 'Service.aqm.task.unHold'\n }\n })),\n /*\n * Pause Recording\n */\n pauseRecording: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.PAUSE}`,\n data: {},\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.CONTACT_RECORDING_PAUSED,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.CONTACT_RECORDING_PAUSE_FAILED\n }\n },\n errId: 'Service.aqm.task.pauseRecording'\n }\n })),\n /*\n * Resume Recording\n */\n resumeRecording: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.RESUME}`,\n data: p.data,\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.CONTACT_RECORDING_RESUMED,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.CONTACT_RECORDING_RESUME_FAILED\n }\n },\n errId: 'Service.aqm.task.resumeRecording'\n }\n })),\n /*\n * Consult contact\n */\n consult: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.CONSULT}`,\n data: p.data,\n timeout: p.data && p.data.destinationType === _types2.DESTINATION_TYPE.QUEUE ? 'disabled' : _constants2.TIMEOUT_REQ,\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONSULT_CREATED,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: p.data && p.data.destinationType === _types2.DESTINATION_TYPE.QUEUE ? _types.CC_EVENTS.AGENT_CTQ_FAILED : _types.CC_EVENTS.AGENT_CONSULT_FAILED\n }\n },\n errId: 'Service.aqm.task.consult'\n },\n notifCancel: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: 'AgentCtqCancelled',\n interactionId: p.interactionId\n }\n },\n msg: {}\n }\n })),\n /*\n * Consult End\n */\n consultEnd: aqm.req(p => {\n // Setting false value for optional attribute\n const {\n isConsult,\n isSecondaryEpDnAgent = false,\n queueId\n } = p.data;\n return {\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.CONSULT_END}`,\n host: _constants.WCC_API_GATEWAY,\n data: queueId ? {\n queueId\n } : {},\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: 'RoutingMessage',\n data: {\n type: (() => {\n if (queueId) return _types.CC_EVENTS.AGENT_CTQ_CANCELLED;\n if (isSecondaryEpDnAgent) return _types.CC_EVENTS.CONTACT_ENDED;\n if (isConsult) return _types.CC_EVENTS.AGENT_CONSULT_ENDED;\n return _types.CC_EVENTS.AGENT_CONSULT_CONFERENCE_ENDED;\n })(),\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: 'RoutingMessage',\n data: {\n type: p.data.queueId ? _types.CC_EVENTS.AGENT_CTQ_CANCEL_FAILED : _types.CC_EVENTS.AGENT_CONSULT_END_FAILED\n }\n },\n errId: p.data.queueId ? 'Service.aqm.task.cancelCtq' : 'Service.aqm.task.consultEnd'\n }\n };\n }),\n /*\n * Consult Accept contact\n */\n consultAccept: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.CONSULT_ACCEPT}`,\n data: {},\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONSULTING,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONTACT_ASSIGN_FAILED\n }\n },\n errId: 'Service.aqm.task.consultAccept'\n }\n })),\n /*\n * BlindTransfer contact\n */\n blindTransfer: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.TRANSFER}`,\n data: p.data,\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_BLIND_TRANSFERRED,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_BLIND_TRANSFER_FAILED\n }\n },\n errId: 'Service.aqm.task.AgentBlindTransferFailedEvent'\n }\n })),\n /*\n * VteamTransfer contact\n */\n vteamTransfer: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.TRANSFER}`,\n data: p.data,\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_VTEAM_TRANSFERRED,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_VTEAM_TRANSFER_FAILED\n }\n },\n errId: 'Service.aqm.task.AgentVteamTransferFailed'\n }\n })),\n /*\n * Consult Transfer contact\n */\n consultTransfer: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.CONSULT_TRANSFER}`,\n data: p.data,\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: [_types.CC_EVENTS.AGENT_CONSULT_TRANSFERRED, _types.CC_EVENTS.AGENT_CONSULT_TRANSFERRING],\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONSULT_TRANSFER_FAILED\n }\n },\n errId: 'Service.aqm.task.AgentConsultTransferFailed'\n }\n })),\n /*\n * End contact\n */\n end: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.END}`,\n data: {},\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_WRAPUP,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONTACT_END_FAILED\n }\n },\n errId: 'Service.aqm.task.end'\n }\n })),\n /*\n * Wrapup contact\n */\n wrapup: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.WRAPUP}`,\n data: p.data,\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_WRAPPEDUP,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_WRAPUP_FAILED\n }\n },\n errId: 'Service.aqm.task.wrapup'\n }\n })),\n /*\n * Cancel popover\n */\n cancelTask: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}${_constants3.END}`,\n data: {},\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.CONTACT_ENDED,\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: _types.CC_EVENTS.AGENT_CONTACT_END_FAILED\n }\n },\n errId: 'Service.aqm.task.end'\n }\n })),\n /*\n * Cancel Ctq request\n */\n cancelCtq: aqm.req(p => ({\n url: `${_constants3.TASK_API}${p.interactionId}/cancelCtq`,\n data: p.data,\n host: _constants.WCC_API_GATEWAY,\n err: _Utils.createErrDetailsObject,\n notifSuccess: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: 'AgentCtqCancelled',\n interactionId: p.interactionId\n }\n },\n msg: {}\n },\n notifFail: {\n bind: {\n type: _constants3.TASK_MESSAGE_TYPE,\n data: {\n type: 'AgentCtqCancelFailed'\n }\n },\n errId: 'Service.aqm.task.cancelCtq'\n }\n }))\n };\n}\n//# sourceMappingURL=contact.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/../../../node_modules/@webex/plugin-cc/dist/services/task/contact.js?");
|
|
3978
3978
|
|
|
3979
3979
|
/***/ }),
|
|
3980
3980
|
|
|
@@ -3996,7 +3996,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));
|
|
|
3996
3996
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3997
3997
|
|
|
3998
3998
|
"use strict";
|
|
3999
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\nvar _events = _interopRequireDefault(__webpack_require__(/*! events */ \"../../../node_modules/events/events.js\"));\nvar _calling = __webpack_require__(/*! @webex/calling */ \"../../../node_modules/@webex/calling/dist/module/index.js\");\nvar _Utils = __webpack_require__(/*! ../core/Utils */ \"../../../node_modules/@webex/plugin-cc/dist/services/core/Utils.js\");\nvar _types = __webpack_require__(/*! ../../types */ \"../../../node_modules/@webex/plugin-cc/dist/types.js\");\nvar _constants = __webpack_require__(/*! ../../constants */ \"../../../node_modules/@webex/plugin-cc/dist/constants.js\");\nvar _types2 = __webpack_require__(/*! ./types */ \"../../../node_modules/@webex/plugin-cc/dist/services/task/types.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nclass Task extends _events.default {\n constructor(contact, webCallingService, data) {\n super();\n this.contact = contact;\n this.data = data;\n this.webCallingService = webCallingService;\n this.webCallMap = {};\n this.registerWebCallListeners();\n }\n handleRemoteMedia = track => {\n this.emit(_types2.TASK_EVENTS.TASK_MEDIA, track);\n };\n registerWebCallListeners() {\n this.webCallingService.on(_calling.CALL_EVENT_KEYS.REMOTE_MEDIA, this.handleRemoteMedia);\n }\n unregisterWebCallListeners() {\n this.webCallingService.off(_calling.CALL_EVENT_KEYS.REMOTE_MEDIA, this.handleRemoteMedia);\n }\n updateTaskData = (updatedData, shouldOverwrite = false) => {\n this.data = shouldOverwrite ? updatedData : this.reconcileData(this.data, updatedData);\n return this;\n };\n reconcileData(oldData, newData) {\n Object.keys(newData).forEach(key => {\n if (newData[key] && typeof newData[key] === 'object' && !Array.isArray(newData[key])) {\n oldData[key] = this.reconcileData({\n ...oldData[key]\n }, newData[key]);\n } else {\n oldData[key] = newData[key];\n }\n });\n return oldData;\n }\n\n /**\n * This is used for incoming task accept by agent.\n *\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * task.accept().then(()=>{}).catch(()=>{})\n * ```\n */\n async accept() {\n try {\n if (this.webCallingService.loginOption === _types.LoginOption.BROWSER) {\n const constraints = {\n audio: true\n };\n const localStream = await navigator.mediaDevices.getUserMedia(constraints);\n const audioTrack = localStream.getAudioTracks()[0];\n this.localAudioStream = new _calling.LocalMicrophoneStream(new MediaStream([audioTrack]));\n this.webCallingService.answerCall(this.localAudioStream, this.data.interactionId);\n return Promise.resolve(); // TODO: Update this with sending the task object received in AgentContactAssigned\n }\n\n // TODO: Invoke the accept API from services layer. This is going to be used in Outbound Dialer scenario\n return this.contact.accept({\n interactionId: this.data.interactionId\n });\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'accept', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /**\n * This is used for the placing the call in mute or unmute by the agent.\n *\n * @throws Error\n * @example\n * ```typescript\n * task.toggleMute().then(()=>{}).catch(()=>{})\n * ```\n */\n async toggleMute() {\n try {\n this.webCallingService.muteUnmuteCall(this.localAudioStream);\n return Promise.resolve();\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'mute', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /**\n * This is used for the incoming task decline by agent.\n *\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * task.decline().then(()=>{}).catch(()=>{})\n * ```\n */\n async decline() {\n try {\n this.webCallingService.declineCall(this.data.interactionId);\n this.unregisterWebCallListeners();\n return Promise.resolve();\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'decline', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /**\n * This is used to hold the task.\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * task.hold().then(()=>{}).catch(()=>{})\n * ```\n * */\n async hold() {\n try {\n return this.contact.hold({\n interactionId: this.data.interactionId,\n data: {\n mediaResourceId: this.data.mediaResourceId\n }\n });\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'hold', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /**\n * This is used to resume the task.\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * task.resume().then(()=>{}).catch(()=>{})\n * ```\n */\n async resume() {\n try {\n const {\n mainInteractionId\n } = this.data.interaction;\n // In case of consult call, When resume is invoked, we need to pass the mediaResourceId of the main interaction\n // It's always good to explicitly pass the main mediaResourceId to avoid any confusion\n const {\n mediaResourceId\n } = this.data.interaction.media[mainInteractionId];\n return this.contact.unHold({\n interactionId: this.data.interactionId,\n data: {\n mediaResourceId\n }\n });\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'resume', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /**\n * This is used to end the task.\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * task.end().then(()=>{}).catch(()=>{})\n * ```\n */\n async end() {\n try {\n return this.contact.end({\n interactionId: this.data.interactionId\n });\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'end', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /**\n * This is used to wrap up the task.\n * @param wrapupPayload - WrapupPayLoad\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * task.wrapup(wrapupPayload).then(()=>{}).catch(()=>{})\n * ```\n */\n async wrapup(wrapupPayload) {\n try {\n if (!this.data) {\n throw new Error('No task data available');\n }\n if (!wrapupPayload.auxCodeId || wrapupPayload.auxCodeId.length === 0) {\n throw new Error('AuxCodeId is required');\n }\n if (!wrapupPayload.wrapUpReason || wrapupPayload.wrapUpReason.length === 0) {\n throw new Error('WrapUpReason is required');\n }\n return this.contact.wrapup({\n interactionId: this.data.interactionId,\n data: wrapupPayload\n });\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'wrapup', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /**\n * This is used to pause the call recording\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * task.pauseRecording().then(()=>{}).catch(()=>{});\n * ```\n */\n async pauseRecording() {\n try {\n const result = await this.contact.pauseRecording({\n interactionId: this.data.interactionId\n });\n return result;\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'pauseRecording', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /**\n * This is used to pause the call recording\n * @param resumeRecordingPayload\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * task.resumeRecording(resumeRecordingPayload).then(()=>{}).catch(()=>{});\n * ```\n */\n async resumeRecording(resumeRecordingPayload) {\n try {\n resumeRecordingPayload ??= {\n autoResumed: false\n };\n const result = await this.contact.resumeRecording({\n interactionId: this.data.interactionId,\n data: resumeRecordingPayload\n });\n return result;\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'resumeRecording', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /**\n * This is used to consult the task\n * @param consultPayload\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * const consultPayload = {\n * destination: 'myBuddyAgentId',\n * destinationType: DESTINATION_TYPE.AGENT,\n * }\n * task.consult(consultPayload).then(()=>{}).catch(()=>{});\n * ```\n * */\n async consult(consultPayload) {\n try {\n const result = await this.contact.consult({\n interactionId: this.data.interactionId,\n data: consultPayload\n });\n return result;\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'consult', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /**\n * This is used to end the consult\n * @param consultEndPayload\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * const consultEndPayload = {\n * isConsult: true,\n * queueId: 'myQueueId',\n * }\n * task.endConsult(consultEndPayload).then(()=>{}).catch(()=>{});\n * ```\n */\n async endConsult(consultEndPayload) {\n try {\n const result = await this.contact.consultEnd({\n interactionId: this.data.interactionId,\n data: consultEndPayload\n });\n return result;\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'endConsult', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /**\n * This is used to blind transfer or vTeam transfer the task\n * @param transferPayload\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * const transferPayload = {\n * to: 'myQueueId',\n * destinationType: 'queue',\n * }\n * task.transfer(transferPayload).then(()=>{}).catch(()=>{});\n * ```\n */\n async transfer(transferPayload) {\n try {\n let result;\n if (transferPayload.destinationType === _types2.DESTINATION_TYPE.QUEUE) {\n result = await this.contact.vteamTransfer({\n interactionId: this.data.interactionId,\n data: transferPayload\n });\n } else {\n result = await this.contact.blindTransfer({\n interactionId: this.data.interactionId,\n data: transferPayload\n });\n }\n return result;\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'transfer', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /**\n * This is used to consult transfer the task\n * @param consultTransferPayload\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * const consultTransferPayload = {\n * destination: 'anotherAgentId',\n * destinationType: 'agent',\n * }\n * task.consultTransfer(consultTransferPayload).then(()=>{}).catch(()=>{});\n * ```\n * */\n async consultTransfer(consultTransferPayload) {\n try {\n // For queue destinations, use the destAgentId from task data\n if (consultTransferPayload.destinationType === _types2.CONSULT_TRANSFER_DESTINATION_TYPE.QUEUE) {\n if (!this.data.destAgentId) {\n throw new Error('No agent has accepted this queue consult yet');\n }\n\n // Override the destination with the agent who accepted the queue consult\n consultTransferPayload = {\n to: this.data.destAgentId,\n destinationType: _types2.CONSULT_TRANSFER_DESTINATION_TYPE.AGENT\n };\n }\n const result = await this.contact.consultTransfer({\n interactionId: this.data.interactionId,\n data: consultTransferPayload\n });\n return result;\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'consultTransfer', _constants.CC_FILE);\n throw detailedError;\n }\n }\n}\nexports[\"default\"] = Task;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/../../../node_modules/@webex/plugin-cc/dist/services/task/index.js?");
|
|
3999
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\nvar _events = _interopRequireDefault(__webpack_require__(/*! events */ \"../../../node_modules/events/events.js\"));\nvar _calling = __webpack_require__(/*! @webex/calling */ \"../../../node_modules/@webex/calling/dist/module/index.js\");\nvar _Utils = __webpack_require__(/*! ../core/Utils */ \"../../../node_modules/@webex/plugin-cc/dist/services/core/Utils.js\");\nvar _types = __webpack_require__(/*! ../../types */ \"../../../node_modules/@webex/plugin-cc/dist/types.js\");\nvar _constants = __webpack_require__(/*! ../../constants */ \"../../../node_modules/@webex/plugin-cc/dist/constants.js\");\nvar _types2 = __webpack_require__(/*! ./types */ \"../../../node_modules/@webex/plugin-cc/dist/services/task/types.js\");\nvar _MetricsManager = _interopRequireDefault(__webpack_require__(/*! ../../metrics/MetricsManager */ \"../../../node_modules/@webex/plugin-cc/dist/metrics/MetricsManager.js\"));\nvar _constants2 = __webpack_require__(/*! ../../metrics/constants */ \"../../../node_modules/@webex/plugin-cc/dist/metrics/constants.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nclass Task extends _events.default {\n constructor(contact, webCallingService, data) {\n super();\n this.contact = contact;\n this.data = data;\n this.webCallingService = webCallingService;\n this.webCallMap = {};\n this.metricsManager = _MetricsManager.default.getInstance();\n this.registerWebCallListeners();\n }\n handleRemoteMedia = track => {\n this.emit(_types2.TASK_EVENTS.TASK_MEDIA, track);\n };\n registerWebCallListeners() {\n this.webCallingService.on(_calling.CALL_EVENT_KEYS.REMOTE_MEDIA, this.handleRemoteMedia);\n }\n unregisterWebCallListeners() {\n this.webCallingService.off(_calling.CALL_EVENT_KEYS.REMOTE_MEDIA, this.handleRemoteMedia);\n }\n updateTaskData = (updatedData, shouldOverwrite = false) => {\n this.data = shouldOverwrite ? updatedData : this.reconcileData(this.data, updatedData);\n return this;\n };\n reconcileData(oldData, newData) {\n Object.keys(newData).forEach(key => {\n if (newData[key] && typeof newData[key] === 'object' && !Array.isArray(newData[key])) {\n oldData[key] = this.reconcileData({\n ...oldData[key]\n }, newData[key]);\n } else {\n oldData[key] = newData[key];\n }\n });\n return oldData;\n }\n\n /**\n * This is used for incoming task accept by agent.\n *\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * task.accept().then(()=>{}).catch(()=>{})\n * ```\n */\n async accept() {\n try {\n this.metricsManager.timeEvent([_constants2.METRIC_EVENT_NAMES.TASK_ACCEPT_SUCCESS, _constants2.METRIC_EVENT_NAMES.TASK_ACCEPT_FAILED]);\n if (this.data.interaction.mediaType !== _types2.MEDIA_CHANNEL.TELEPHONY) {\n return this.contact.accept({\n interactionId: this.data.interactionId\n });\n }\n if (this.webCallingService.loginOption === _types.LoginOption.BROWSER) {\n const constraints = {\n audio: true\n };\n const localStream = await navigator.mediaDevices.getUserMedia(constraints);\n const audioTrack = localStream.getAudioTracks()[0];\n this.localAudioStream = new _calling.LocalMicrophoneStream(new MediaStream([audioTrack]));\n this.webCallingService.answerCall(this.localAudioStream, this.data.interactionId);\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_ACCEPT_SUCCESS, {\n taskId: this.data.interactionId,\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(this.data)\n }, ['operational', 'behavioral', 'business']);\n return Promise.resolve(); // TODO: Update this with sending the task object received in AgentContactAssigned\n }\n\n // TODO: Invoke the accept API from services layer. This is going to be used in Outbound Dialer scenario\n const response = await this.contact.accept({\n interactionId: this.data.interactionId\n });\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_ACCEPT_SUCCESS, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(response),\n taskId: this.data.interactionId\n }, ['operational', 'behavioral', 'business']);\n return response;\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'accept', _constants.CC_FILE);\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_ACCEPT_FAILED, {\n taskId: this.data.interactionId,\n error: error.toString(),\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(error.details)\n }, ['operational', 'behavioral', 'business']);\n throw detailedError;\n }\n }\n\n /**\n * This is used for the placing the call in mute or unmute by the agent.\n *\n * @throws Error\n * @example\n * ```typescript\n * task.toggleMute().then(()=>{}).catch(()=>{})\n * ```\n */\n async toggleMute() {\n try {\n this.webCallingService.muteUnmuteCall(this.localAudioStream);\n return Promise.resolve();\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'mute', _constants.CC_FILE);\n throw detailedError;\n }\n }\n\n /**\n * This is used for the incoming task decline by agent.\n *\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * task.decline().then(()=>{}).catch(()=>{})\n * ```\n */\n async decline() {\n try {\n this.metricsManager.timeEvent([_constants2.METRIC_EVENT_NAMES.TASK_DECLINE_SUCCESS, _constants2.METRIC_EVENT_NAMES.TASK_DECLINE_FAILED]);\n this.webCallingService.declineCall(this.data.interactionId);\n this.unregisterWebCallListeners();\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_DECLINE_SUCCESS, {\n taskId: this.data.interactionId\n }, ['operational', 'behavioral']);\n return Promise.resolve();\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'decline', _constants.CC_FILE);\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_DECLINE_FAILED, {\n taskId: this.data.interactionId,\n error: error.toString(),\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(error.details || {})\n }, ['operational', 'behavioral']);\n throw detailedError;\n }\n }\n\n /**\n * This is used to hold the task.\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * task.hold().then(()=>{}).catch(()=>{})\n * ```\n * */\n async hold() {\n try {\n this.metricsManager.timeEvent([_constants2.METRIC_EVENT_NAMES.TASK_HOLD_SUCCESS, _constants2.METRIC_EVENT_NAMES.TASK_HOLD_FAILED]);\n const response = await this.contact.hold({\n interactionId: this.data.interactionId,\n data: {\n mediaResourceId: this.data.mediaResourceId\n }\n });\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_HOLD_SUCCESS, {\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(response),\n taskId: this.data.interactionId,\n mediaResourceId: this.data.mediaResourceId\n }, ['operational', 'behavioral']);\n return response;\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'hold', _constants.CC_FILE);\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_HOLD_FAILED, {\n taskId: this.data.interactionId,\n mediaResourceId: this.data.mediaResourceId,\n error: error.toString(),\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(error.details || {})\n }, ['operational', 'behavioral']);\n throw detailedError;\n }\n }\n\n /**\n * This is used to resume the task.\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * task.resume().then(()=>{}).catch(()=>{})\n * ```\n */\n async resume() {\n try {\n const {\n mainInteractionId\n } = this.data.interaction;\n const {\n mediaResourceId\n } = this.data.interaction.media[mainInteractionId];\n this.metricsManager.timeEvent([_constants2.METRIC_EVENT_NAMES.TASK_RESUME_SUCCESS, _constants2.METRIC_EVENT_NAMES.TASK_RESUME_FAILED]);\n const response = await this.contact.unHold({\n interactionId: this.data.interactionId,\n data: {\n mediaResourceId\n }\n });\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_RESUME_SUCCESS, {\n taskId: this.data.interactionId,\n mainInteractionId,\n mediaResourceId,\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(response)\n }, ['operational', 'behavioral']);\n return response;\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'resume', _constants.CC_FILE);\n const mainInteractionId = this.data?.interaction?.mainInteractionId;\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_RESUME_FAILED, {\n taskId: this.data.interactionId,\n mainInteractionId,\n mediaResourceId: mainInteractionId ? this.data.interaction.media[mainInteractionId].mediaResourceId : '',\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(error.details || {})\n }, ['operational', 'behavioral']);\n throw detailedError;\n }\n }\n\n /**\n * This is used to end the task.\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * task.end().then(()=>{}).catch(()=>{})\n * ```\n */\n async end() {\n try {\n this.metricsManager.timeEvent([_constants2.METRIC_EVENT_NAMES.TASK_END_SUCCESS, _constants2.METRIC_EVENT_NAMES.TASK_END_FAILED]);\n const response = await this.contact.end({\n interactionId: this.data.interactionId\n });\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_END_SUCCESS, {\n taskId: this.data.interactionId,\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(response)\n }, ['operational', 'behavioral', 'business']);\n return response;\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'end', _constants.CC_FILE);\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_END_FAILED, {\n taskId: this.data.interactionId,\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(error.details || {})\n }, ['operational', 'behavioral', 'business']);\n throw detailedError;\n }\n }\n\n /**\n * This is used to wrap up the task.\n * @param wrapupPayload - WrapupPayLoad\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * task.wrapup(wrapupPayload).then(()=>{}).catch(()=>{})\n * ```\n */\n async wrapup(wrapupPayload) {\n try {\n this.metricsManager.timeEvent([_constants2.METRIC_EVENT_NAMES.TASK_WRAPUP_SUCCESS, _constants2.METRIC_EVENT_NAMES.TASK_WRAPUP_FAILED]);\n if (!this.data) {\n throw new Error('No task data available');\n }\n if (!wrapupPayload.auxCodeId || wrapupPayload.auxCodeId.length === 0) {\n throw new Error('AuxCodeId is required');\n }\n if (!wrapupPayload.wrapUpReason || wrapupPayload.wrapUpReason.length === 0) {\n throw new Error('WrapUpReason is required');\n }\n const response = await this.contact.wrapup({\n interactionId: this.data.interactionId,\n data: wrapupPayload\n });\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_WRAPUP_SUCCESS, {\n taskId: this.data.interactionId,\n wrapUpCode: wrapupPayload.auxCodeId,\n wrapUpReason: wrapupPayload.wrapUpReason,\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(response)\n }, ['operational', 'behavioral', 'business']);\n return response;\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'wrapup', _constants.CC_FILE);\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_WRAPUP_FAILED, {\n taskId: this.data.interactionId,\n wrapUpCode: wrapupPayload.auxCodeId,\n wrapUpReason: wrapupPayload.wrapUpReason,\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(error.details || {})\n }, ['operational', 'behavioral', 'business']);\n throw detailedError;\n }\n }\n\n /**\n * This is used to pause the call recording\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * task.pauseRecording().then(()=>{}).catch(()=>{});\n * ```\n */\n async pauseRecording() {\n try {\n this.metricsManager.timeEvent([_constants2.METRIC_EVENT_NAMES.TASK_PAUSE_RECORDING_SUCCESS, _constants2.METRIC_EVENT_NAMES.TASK_PAUSE_RECORDING_FAILED]);\n const result = await this.contact.pauseRecording({\n interactionId: this.data.interactionId\n });\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_PAUSE_RECORDING_SUCCESS, {\n taskId: this.data.interactionId,\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(result)\n }, ['operational', 'behavioral', 'business']);\n return result;\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'pauseRecording', _constants.CC_FILE);\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_PAUSE_RECORDING_FAILED, {\n taskId: this.data.interactionId,\n error: error.toString(),\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(error.details || {})\n }, ['operational', 'behavioral', 'business']);\n throw detailedError;\n }\n }\n\n /**\n * This is used to pause the call recording\n * @param resumeRecordingPayload\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * task.resumeRecording(resumeRecordingPayload).then(()=>{}).catch(()=>{});\n * ```\n */\n async resumeRecording(resumeRecordingPayload) {\n try {\n this.metricsManager.timeEvent([_constants2.METRIC_EVENT_NAMES.TASK_RESUME_RECORDING_SUCCESS, _constants2.METRIC_EVENT_NAMES.TASK_RESUME_RECORDING_FAILED]);\n resumeRecordingPayload ??= {\n autoResumed: false\n };\n const result = await this.contact.resumeRecording({\n interactionId: this.data.interactionId,\n data: resumeRecordingPayload\n });\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_RESUME_RECORDING_SUCCESS, {\n taskId: this.data.interactionId,\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(result)\n }, ['operational', 'behavioral', 'business']);\n return result;\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'resumeRecording', _constants.CC_FILE);\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_RESUME_RECORDING_FAILED, {\n taskId: this.data.interactionId,\n error: error.toString(),\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(error.details || {})\n }, ['operational', 'behavioral', 'business']);\n throw detailedError;\n }\n }\n\n /**\n * This is used to consult the task\n * @param consultPayload\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * const consultPayload = {\n * destination: 'myBuddyAgentId',\n * destinationType: DESTINATION_TYPE.AGENT,\n * }\n * task.consult(consultPayload).then(()=>{}).catch(()=>{});\n * ```\n * */\n async consult(consultPayload) {\n try {\n this.metricsManager.timeEvent([_constants2.METRIC_EVENT_NAMES.TASK_CONSULT_START_SUCCESS, _constants2.METRIC_EVENT_NAMES.TASK_CONSULT_START_FAILED]);\n const result = await this.contact.consult({\n interactionId: this.data.interactionId,\n data: consultPayload\n });\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_CONSULT_START_SUCCESS, {\n taskId: this.data.interactionId,\n destination: consultPayload.to,\n destinationType: consultPayload.destinationType,\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(result)\n }, ['operational', 'behavioral', 'business']);\n return result;\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'consult', _constants.CC_FILE);\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_CONSULT_START_FAILED, {\n taskId: this.data.interactionId,\n destination: consultPayload.to,\n destinationType: consultPayload.destinationType,\n error: error.toString(),\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(error.details || {})\n }, ['operational', 'behavioral', 'business']);\n throw detailedError;\n }\n }\n\n /**\n * This is used to end the consult\n * @param consultEndPayload\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * const consultEndPayload = {\n * isConsult: true,\n * queueId: 'myQueueId',\n * }\n * task.endConsult(consultEndPayload).then(()=>{}).catch(()=>{});\n * ```\n */\n async endConsult(consultEndPayload) {\n try {\n this.metricsManager.timeEvent([_constants2.METRIC_EVENT_NAMES.TASK_CONSULT_END_SUCCESS, _constants2.METRIC_EVENT_NAMES.TASK_CONSULT_END_FAILED]);\n const result = await this.contact.consultEnd({\n interactionId: this.data.interactionId,\n data: consultEndPayload\n });\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_CONSULT_END_SUCCESS, {\n taskId: this.data.interactionId,\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(result)\n }, ['operational', 'behavioral', 'business']);\n return result;\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'endConsult', _constants.CC_FILE);\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_CONSULT_END_FAILED, {\n taskId: this.data.interactionId,\n error: error.toString(),\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(error.details || {})\n }, ['operational', 'behavioral', 'business']);\n throw detailedError;\n }\n }\n\n /**\n * This is used to blind transfer or vTeam transfer the task\n * @param transferPayload\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * const transferPayload = {\n * to: 'myQueueId',\n * destinationType: 'queue',\n * }\n * task.transfer(transferPayload).then(()=>{}).catch(()=>{});\n * ```\n */\n async transfer(transferPayload) {\n try {\n this.metricsManager.timeEvent([_constants2.METRIC_EVENT_NAMES.TASK_TRANSFER_SUCCESS, _constants2.METRIC_EVENT_NAMES.TASK_TRANSFER_FAILED]);\n let result;\n if (transferPayload.destinationType === _types2.DESTINATION_TYPE.QUEUE) {\n result = await this.contact.vteamTransfer({\n interactionId: this.data.interactionId,\n data: transferPayload\n });\n } else {\n result = await this.contact.blindTransfer({\n interactionId: this.data.interactionId,\n data: transferPayload\n });\n }\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_TRANSFER_SUCCESS, {\n taskId: this.data.interactionId,\n destination: transferPayload.to,\n destinationType: transferPayload.destinationType,\n isConsultTransfer: false,\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(result)\n }, ['operational', 'behavioral', 'business']);\n return result;\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'transfer', _constants.CC_FILE);\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_TRANSFER_FAILED, {\n taskId: this.data.interactionId,\n destination: transferPayload.to,\n destinationType: transferPayload.destinationType,\n isConsultTransfer: false,\n error: error.toString(),\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(error.details || {})\n }, ['operational', 'behavioral', 'business']);\n throw detailedError;\n }\n }\n\n /**\n * This is used to consult transfer the task\n * @param consultTransferPayload\n * @returns Promise<TaskResponse>\n * @throws Error\n * @example\n * ```typescript\n * const consultTransferPayload = {\n * destination: 'anotherAgentId',\n * destinationType: 'agent',\n * }\n * task.consultTransfer(consultTransferPayload).then(()=>{}).catch(()=>{});\n * ```\n * */\n async consultTransfer(consultTransferPayload) {\n try {\n this.metricsManager.timeEvent([_constants2.METRIC_EVENT_NAMES.TASK_TRANSFER_SUCCESS, _constants2.METRIC_EVENT_NAMES.TASK_TRANSFER_FAILED]);\n\n // For queue destinations, use the destAgentId from task data\n if (consultTransferPayload.destinationType === _types2.CONSULT_TRANSFER_DESTINATION_TYPE.QUEUE) {\n if (!this.data.destAgentId) {\n throw new Error('No agent has accepted this queue consult yet');\n }\n\n // Override the destination with the agent who accepted the queue consult\n consultTransferPayload = {\n to: this.data.destAgentId,\n destinationType: _types2.CONSULT_TRANSFER_DESTINATION_TYPE.AGENT\n };\n }\n const result = await this.contact.consultTransfer({\n interactionId: this.data.interactionId,\n data: consultTransferPayload\n });\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_TRANSFER_SUCCESS, {\n taskId: this.data.interactionId,\n destination: consultTransferPayload.to,\n destinationType: consultTransferPayload.destinationType,\n isConsultTransfer: true,\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponse(result)\n }, ['operational', 'behavioral', 'business']);\n return result;\n } catch (error) {\n const {\n error: detailedError\n } = (0, _Utils.getErrorDetails)(error, 'consultTransfer', _constants.CC_FILE);\n this.metricsManager.trackEvent(_constants2.METRIC_EVENT_NAMES.TASK_TRANSFER_FAILED, {\n taskId: this.data.interactionId,\n destination: consultTransferPayload.to,\n destinationType: consultTransferPayload.destinationType,\n isConsultTransfer: true,\n error: error.toString(),\n ..._MetricsManager.default.getCommonTrackingFieldForAQMResponseFailed(error.details || {})\n }, ['operational', 'behavioral', 'business']);\n throw detailedError;\n }\n }\n}\nexports[\"default\"] = Task;\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/../../../node_modules/@webex/plugin-cc/dist/services/task/index.js?");
|
|
4000
4000
|
|
|
4001
4001
|
/***/ }),
|
|
4002
4002
|
|
|
@@ -4007,7 +4007,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));
|
|
|
4007
4007
|
/***/ ((__unused_webpack_module, exports) => {
|
|
4008
4008
|
|
|
4009
4009
|
"use strict";
|
|
4010
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.TASK_EVENTS = exports.DESTINATION_TYPE = exports.CONSULT_TRANSFER_DESTINATION_TYPE = void 0;\nconst DESTINATION_TYPE = exports.DESTINATION_TYPE = {\n QUEUE: 'queue',\n DIALNUMBER: 'dialNumber',\n AGENT: 'agent',\n ENTRYPOINT: 'entryPoint' // Entrypoint is only supported for consult and not for transfer\n};\n\nconst CONSULT_TRANSFER_DESTINATION_TYPE = exports.CONSULT_TRANSFER_DESTINATION_TYPE = {\n AGENT: 'agent',\n ENTRYPOINT: 'entryPoint',\n DIALNUMBER: 'dialNumber',\n QUEUE: 'queue'\n};\nconst TASK_EVENTS = exports.TASK_EVENTS = {\n TASK_INCOMING: 'task:incoming',\n TASK_ASSIGNED: 'task:assigned',\n TASK_MEDIA: 'task:media',\n TASK_UNASSIGNED: 'task:unassigned',\n TASK_HOLD: 'task:hold',\n TASK_UNHOLD: 'task:unhold',\n TASK_CONSULT_END: 'task:consultEnd',\n TASK_CONSULT_QUEUE_CANCELLED: 'task:consultQueueCancelled',\n TASK_CONSULT_QUEUE_FAILED: 'task:consultQueueFailed',\n TASK_CONSULT_ACCEPTED: 'task:consultAccepted',\n TASK_CONSULTING: 'task:consulting',\n TASK_PAUSE: 'task:pause',\n TASK_RESUME: 'task:resume',\n TASK_END: 'task:end',\n TASK_WRAPUP: 'task:wrapup',\n TASK_REJECT: 'task:rejected',\n TASK_HYDRATE: 'task:hydrate'\n};\n\n/**\n * Task payload type\n */\n\n/**\n * Parameters to be passed for pause recording task\n */\n\n/**\n * Parameters to be passed for resume recording task\n */\n\n/**\n * Parameters to be passed for transfer task\n */\n\n/**\n * Parameters to be passed for transfer task\n */\n\n/**\n * Parameters to be passed for consult task\n */\n\n/**\n * Parameters to be passed for consult end task\n */\n\n/**\n * Parameters to be passed for transfer task\n */\n\n/**\n * Parameters to be passed for consult end task\n * This is the actual payload that is sent to the developer API\n */\n\n/**\n * Parameters to be passed for wrapup task\n */\n\n/**\n * Parameters to be passed for outbound dialer task\n */\n\n/**\n * Response type for the task public methods\n */\n\n/**\n * Represents an interface for managing task related operations.\n */\n//# sourceMappingURL=types.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/../../../node_modules/@webex/plugin-cc/dist/services/task/types.js?");
|
|
4010
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.TASK_EVENTS = exports.MEDIA_CHANNEL = exports.DESTINATION_TYPE = exports.CONSULT_TRANSFER_DESTINATION_TYPE = void 0;\nconst DESTINATION_TYPE = exports.DESTINATION_TYPE = {\n QUEUE: 'queue',\n DIALNUMBER: 'dialNumber',\n AGENT: 'agent',\n ENTRYPOINT: 'entryPoint' // Entrypoint is only supported for consult and not for transfer\n};\n\nconst CONSULT_TRANSFER_DESTINATION_TYPE = exports.CONSULT_TRANSFER_DESTINATION_TYPE = {\n AGENT: 'agent',\n ENTRYPOINT: 'entryPoint',\n DIALNUMBER: 'dialNumber',\n QUEUE: 'queue'\n};\nconst MEDIA_CHANNEL = exports.MEDIA_CHANNEL = {\n EMAIL: 'email',\n CHAT: 'chat',\n TELEPHONY: 'telephony',\n SOCIAL: 'social',\n SMS: 'sms',\n FACEBOOK: 'facebook',\n WHATSAPP: 'whatsapp'\n};\nconst TASK_EVENTS = exports.TASK_EVENTS = {\n TASK_INCOMING: 'task:incoming',\n TASK_ASSIGNED: 'task:assigned',\n TASK_MEDIA: 'task:media',\n TASK_UNASSIGNED: 'task:unassigned',\n TASK_HOLD: 'task:hold',\n TASK_UNHOLD: 'task:unhold',\n TASK_CONSULT_END: 'task:consultEnd',\n TASK_CONSULT_QUEUE_CANCELLED: 'task:consultQueueCancelled',\n TASK_CONSULT_QUEUE_FAILED: 'task:consultQueueFailed',\n TASK_CONSULT_ACCEPTED: 'task:consultAccepted',\n TASK_CONSULTING: 'task:consulting',\n TASK_PAUSE: 'task:pause',\n TASK_RESUME: 'task:resume',\n TASK_END: 'task:end',\n TASK_WRAPUP: 'task:wrapup',\n TASK_REJECT: 'task:rejected',\n TASK_HYDRATE: 'task:hydrate'\n};\n\n/**\n * Task payload type\n */\n\n/**\n * Parameters to be passed for pause recording task\n */\n\n/**\n * Parameters to be passed for resume recording task\n */\n\n/**\n * Parameters to be passed for transfer task\n */\n\n/**\n * Parameters to be passed for transfer task\n */\n\n/**\n * Parameters to be passed for consult task\n */\n\n/**\n * Parameters to be passed for consult end task\n */\n\n/**\n * Parameters to be passed for transfer task\n */\n\n/**\n * Parameters to be passed for consult end task\n * This is the actual payload that is sent to the developer API\n */\n\n/**\n * Parameters to be passed for wrapup task\n */\n\n/**\n * Parameters to be passed for outbound dialer task\n */\n\n/**\n * Response type for the task public methods\n */\n\n/**\n * Represents an interface for managing task related operations.\n */\n//# sourceMappingURL=types.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/../../../node_modules/@webex/plugin-cc/dist/services/task/types.js?");
|
|
4011
4011
|
|
|
4012
4012
|
/***/ }),
|
|
4013
4013
|
|
|
@@ -12401,7 +12401,7 @@ eval("/* provided dependency */ var process = __webpack_require__(/*! process/br
|
|
|
12401
12401
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12402
12402
|
|
|
12403
12403
|
"use strict";
|
|
12404
|
-
eval("\n\nvar _Object$defineProperty = __webpack_require__(/*! @babel/runtime-corejs2/core-js/object/define-property */ \"../../../node_modules/@babel/runtime-corejs2/core-js/object/define-property.js\");\nvar _interopRequireDefault = __webpack_require__(/*! @babel/runtime-corejs2/helpers/interopRequireDefault */ \"../../../node_modules/@babel/runtime-corejs2/helpers/interopRequireDefault.js\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nvar _merge = _interopRequireDefault(__webpack_require__(/*! lodash/merge */ \"../../../node_modules/lodash/merge.js\"));\nvar _webexCore = _interopRequireDefault(__webpack_require__(/*! @webex/webex-core */ \"../../../node_modules/@webex/webex-core/dist/index.js\"));\n__webpack_require__(/*! @webex/plugin-authorization */ \"./node_modules/@webex/plugin-authorization/dist/index.browser.js\");\n__webpack_require__(/*! @webex/plugin-cc */ \"../../../node_modules/@webex/plugin-cc/dist/index.js\");\n__webpack_require__(/*! @webex/internal-plugin-mercury */ \"../../../node_modules/@webex/internal-plugin-mercury/dist/index.js\");\n__webpack_require__(/*! @webex/plugin-logger */ \"./node_modules/@webex/plugin-logger/dist/index.js\");\n__webpack_require__(/*! @webex/internal-plugin-support */ \"./node_modules/@webex/internal-plugin-support/dist/index.js\");\nvar config = __webpack_require__(/*! ./config */ \"./node_modules/webex/dist/config.js\");\nvar Webex = _webexCore.default.extend({\n webex: true,\n version: \"3.8.0-next.
|
|
12404
|
+
eval("\n\nvar _Object$defineProperty = __webpack_require__(/*! @babel/runtime-corejs2/core-js/object/define-property */ \"../../../node_modules/@babel/runtime-corejs2/core-js/object/define-property.js\");\nvar _interopRequireDefault = __webpack_require__(/*! @babel/runtime-corejs2/helpers/interopRequireDefault */ \"../../../node_modules/@babel/runtime-corejs2/helpers/interopRequireDefault.js\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nvar _merge = _interopRequireDefault(__webpack_require__(/*! lodash/merge */ \"../../../node_modules/lodash/merge.js\"));\nvar _webexCore = _interopRequireDefault(__webpack_require__(/*! @webex/webex-core */ \"../../../node_modules/@webex/webex-core/dist/index.js\"));\n__webpack_require__(/*! @webex/plugin-authorization */ \"./node_modules/@webex/plugin-authorization/dist/index.browser.js\");\n__webpack_require__(/*! @webex/plugin-cc */ \"../../../node_modules/@webex/plugin-cc/dist/index.js\");\n__webpack_require__(/*! @webex/internal-plugin-mercury */ \"../../../node_modules/@webex/internal-plugin-mercury/dist/index.js\");\n__webpack_require__(/*! @webex/plugin-logger */ \"./node_modules/@webex/plugin-logger/dist/index.js\");\n__webpack_require__(/*! @webex/internal-plugin-support */ \"./node_modules/@webex/internal-plugin-support/dist/index.js\");\nvar config = __webpack_require__(/*! ./config */ \"./node_modules/webex/dist/config.js\");\nvar Webex = _webexCore.default.extend({\n webex: true,\n version: \"3.8.0-next.51\"\n});\nWebex.init = function init() {\n var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n attrs.config = (0, _merge.default)({}, config, attrs.config); // eslint-disable-line no-param-reassign\n\n return new Webex(attrs);\n};\nvar _default = exports[\"default\"] = Webex;\n//# sourceMappingURL=contact-center.js.map\n\n\n//# sourceURL=webpack://@webex/cc-store/./node_modules/webex/dist/contact-center.js?");
|
|
12405
12405
|
|
|
12406
12406
|
/***/ }),
|
|
12407
12407
|
|
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.
|
|
4
|
+
"version": "1.28.0-ccwidgets.49",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"publishConfig": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"mobx": "6.13.5",
|
|
25
25
|
"typescript": "5.6.3",
|
|
26
|
-
"webex": "3.8.0-next.
|
|
26
|
+
"webex": "3.8.0-next.51"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@babel/core": "7.25.2",
|