@webex/cc-station-login 1.28.0-ccwidgets.8 → 1.28.0-ccwidgets.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -296,7 +296,7 @@ eval("\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ../cj
296
296
  \***********************/
297
297
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
298
298
 
299
- eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.useStationLogin = void 0;\nconst react_1 = __webpack_require__(/*! react */ \"react\");\nconst cc_store_1 = __importDefault(__webpack_require__(/*! @webex/cc-store */ \"@webex/cc-store\")); // we need to import as we are losing the context of this in store\nconst useStationLogin = (props) => {\n const cc = props.cc;\n const loginCb = props.onLogin;\n const logoutCb = props.onLogout;\n const [dialNumber, setDialNumber] = (0, react_1.useState)('');\n const [deviceType, setDeviceType] = (0, react_1.useState)('');\n const [team, setTeam] = (0, react_1.useState)('');\n const [loginSuccess, setLoginSuccess] = (0, react_1.useState)();\n const [loginFailure, setLoginFailure] = (0, react_1.useState)();\n const [logoutSuccess, setLogoutSuccess] = (0, react_1.useState)();\n const login = () => {\n cc.stationLogin({ teamId: team, loginOption: deviceType, dialNumber: dialNumber })\n .then((res) => {\n setLoginSuccess(res);\n cc_store_1.default.setSelectedLoginOption(deviceType);\n if (loginCb) {\n loginCb();\n }\n })\n .catch((error) => {\n console.error(error);\n setLoginFailure(error);\n });\n };\n const logout = () => {\n cc.stationLogout({ logoutReason: 'User requested logout' })\n .then((res) => {\n setLogoutSuccess(res);\n if (logoutCb) {\n logoutCb();\n }\n })\n .catch((error) => {\n console.error(error);\n });\n };\n return {\n name: 'StationLogin',\n setDeviceType,\n setDialNumber,\n setTeam,\n login,\n logout,\n loginSuccess,\n loginFailure,\n logoutSuccess,\n };\n};\nexports.useStationLogin = useStationLogin;\n\n\n//# sourceURL=webpack://@webex/cc-station-login/./src/helper.ts?");
299
+ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.useStationLogin = void 0;\nconst react_1 = __webpack_require__(/*! react */ \"react\");\nconst cc_store_1 = __importDefault(__webpack_require__(/*! @webex/cc-store */ \"@webex/cc-store\")); // we need to import as we are losing the context of this in store\nconst useStationLogin = (props) => {\n const cc = props.cc;\n const loginCb = props.onLogin;\n const logoutCb = props.onLogout;\n const logger = props.logger;\n const [dialNumber, setDialNumber] = (0, react_1.useState)('');\n const [deviceType, setDeviceType] = (0, react_1.useState)('');\n const [team, setTeam] = (0, react_1.useState)('');\n const [loginSuccess, setLoginSuccess] = (0, react_1.useState)();\n const [loginFailure, setLoginFailure] = (0, react_1.useState)();\n const [logoutSuccess, setLogoutSuccess] = (0, react_1.useState)();\n const login = () => {\n cc.stationLogin({ teamId: team, loginOption: deviceType, dialNumber: dialNumber })\n .then((res) => {\n setLoginSuccess(res);\n cc_store_1.default.setSelectedLoginOption(deviceType);\n if (loginCb) {\n loginCb();\n }\n }).catch((error) => {\n logger.error(`Error logging in: ${error}`, {\n module: 'widget-station-login#helper.ts',\n method: 'login',\n });\n setLoginFailure(error);\n });\n };\n const logout = () => {\n cc.stationLogout({ logoutReason: 'User requested logout' })\n .then((res) => {\n setLogoutSuccess(res);\n if (logoutCb) {\n logoutCb();\n }\n }).catch((error) => {\n logger.error(`Error logging out: ${error}`, {\n module: 'widget-station-login#helper.ts',\n method: 'logout',\n });\n });\n };\n return {\n name: 'StationLogin',\n setDeviceType,\n setDialNumber,\n setTeam,\n login,\n logout,\n loginSuccess,\n loginFailure,\n logoutSuccess,\n };\n};\nexports.useStationLogin = useStationLogin;\n\n\n//# sourceURL=webpack://@webex/cc-station-login/./src/helper.ts?");
300
300
 
301
301
  /***/ }),
302
302
 
@@ -316,7 +316,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
316
316
  \*************************************/
317
317
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
318
318
 
319
- eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.StationLogin = void 0;\nconst react_1 = __importDefault(__webpack_require__(/*! react */ \"react\"));\nconst cc_store_1 = __importDefault(__webpack_require__(/*! @webex/cc-store */ \"@webex/cc-store\"));\nconst mobx_react_lite_1 = __webpack_require__(/*! mobx-react-lite */ \"../../../node_modules/mobx-react-lite/es/index.js\");\nconst station_login_presentational_1 = __importDefault(__webpack_require__(/*! ./station-login.presentational */ \"./src/station-login/station-login.presentational.tsx\"));\nconst helper_1 = __webpack_require__(/*! ../helper */ \"./src/helper.ts\");\nconst StationLogin = (0, mobx_react_lite_1.observer)(({ onLogin, onLogout }) => {\n const { cc, teams, loginOptions } = cc_store_1.default;\n const result = (0, helper_1.useStationLogin)({ cc, onLogin, onLogout });\n const props = Object.assign(Object.assign({}, result), { teams,\n loginOptions });\n return react_1.default.createElement(station_login_presentational_1.default, Object.assign({}, props));\n});\nexports.StationLogin = StationLogin;\n\n\n//# sourceURL=webpack://@webex/cc-station-login/./src/station-login/index.tsx?");
319
+ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.StationLogin = void 0;\nconst react_1 = __importDefault(__webpack_require__(/*! react */ \"react\"));\nconst cc_store_1 = __importDefault(__webpack_require__(/*! @webex/cc-store */ \"@webex/cc-store\"));\nconst mobx_react_lite_1 = __webpack_require__(/*! mobx-react-lite */ \"../../../node_modules/mobx-react-lite/es/index.js\");\nconst station_login_presentational_1 = __importDefault(__webpack_require__(/*! ./station-login.presentational */ \"./src/station-login/station-login.presentational.tsx\"));\nconst helper_1 = __webpack_require__(/*! ../helper */ \"./src/helper.ts\");\nconst StationLogin = (0, mobx_react_lite_1.observer)(({ onLogin, onLogout }) => {\n const { cc, teams, loginOptions, logger } = cc_store_1.default;\n const result = (0, helper_1.useStationLogin)({ cc, onLogin, onLogout, logger });\n const props = Object.assign(Object.assign({}, result), { teams,\n loginOptions });\n return react_1.default.createElement(station_login_presentational_1.default, Object.assign({}, props));\n});\nexports.StationLogin = StationLogin;\n\n\n//# sourceURL=webpack://@webex/cc-station-login/./src/station-login/index.tsx?");
320
320
 
321
321
  /***/ }),
322
322
 
@@ -1,4 +1,5 @@
1
1
  import { IContactCenter, StationLoginSuccess, StationLogoutSuccess, Team } from '@webex/plugin-cc';
2
+ import { ILogger } from '@webex/cc-store';
2
3
  /**
3
4
  * Interface representing the properties for the Station Login component.
4
5
  */
@@ -59,7 +60,11 @@ export interface IStationLoginProps {
59
60
  * Handler to set the selected agent team
60
61
  */
61
62
  setTeam: (team: string) => void;
63
+ /**
64
+ * The logger instance from SDK
65
+ */
66
+ logger: ILogger;
62
67
  }
63
68
  export type StationLoginPresentationalProps = Pick<IStationLoginProps, 'name' | 'teams' | 'loginOptions' | 'login' | 'logout' | 'loginSuccess' | 'loginFailure' | 'logoutSuccess' | 'setDeviceType' | 'setDialNumber' | 'setTeam'>;
64
- export type UseStationLoginProps = Pick<IStationLoginProps, 'cc' | 'onLogin' | 'onLogout'>;
69
+ export type UseStationLoginProps = Pick<IStationLoginProps, 'cc' | 'onLogin' | 'onLogout' | 'logger'>;
65
70
  export type StationLoginProps = Pick<IStationLoginProps, 'onLogin' | 'onLogout'>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@webex/cc-station-login",
3
3
  "description": "Webex Contact Center Widgets: Station Login",
4
- "version": "1.28.0-ccwidgets.8",
4
+ "version": "1.28.0-ccwidgets.9",
5
5
  "main": "dist/index.js",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -19,7 +19,7 @@
19
19
  "test:unit": "jest"
20
20
  },
21
21
  "dependencies": {
22
- "@webex/cc-store": "1.28.0-ccwidgets.8",
22
+ "@webex/cc-store": "1.28.0-ccwidgets.9",
23
23
  "mobx-react-lite": "^4.1.0"
24
24
  },
25
25
  "devDependencies": {
@@ -58,5 +58,5 @@
58
58
  "^.+\\.(css|less|scss)$": "babel-jest"
59
59
  }
60
60
  },
61
- "stableVersion": "1.28.0-ccwidgets.7"
61
+ "stableVersion": "1.28.0-ccwidgets.8"
62
62
  }