@webex/cc-store 1.28.0-ccwidgets.12 → 1.28.0-ccwidgets.14

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
@@ -23803,7 +23803,7 @@ eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ?
23803
23803
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
23804
23804
 
23805
23805
  "use strict";
23806
- eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst mobx_1 = __webpack_require__(/*! mobx */ \"../../../node_modules/mobx/dist/mobx.esm.js\");\nconst webex_1 = __importDefault(__webpack_require__(/*! webex */ \"./node_modules/webex/dist/index.js\"));\nclass Store {\n constructor() {\n this.teams = [];\n this.loginOptions = [];\n this.idleCodes = [];\n this.agentId = '';\n this.selectedLoginOption = '';\n this.wrapupCodes = [];\n this.currentTask = null;\n this.isAgentLoggedIn = false;\n this.deviceType = '';\n (0, mobx_1.makeAutoObservable)(this, {\n cc: mobx_1.observable.ref,\n currentTask: mobx_1.observable, // Make currentTask observable\n });\n }\n setCurrentTask(task) {\n this.currentTask = task;\n }\n static getInstance() {\n if (!Store.instance) {\n console.log('Creating new store instance');\n Store.instance = new Store();\n }\n console.log('Returning store instance');\n return Store.instance;\n }\n setSelectedLoginOption(option) {\n this.selectedLoginOption = option;\n }\n registerCC(webex) {\n this.cc = webex.cc;\n this.logger = this.cc.LoggerProxy;\n return this.cc\n .register()\n .then((response) => {\n this.teams = response.teams;\n this.loginOptions = response.loginVoiceOptions;\n this.idleCodes = response.idleCodes;\n this.agentId = response.agentId;\n this.wrapupCodes = response.wrapupCodes;\n this.isAgentLoggedIn = response.isAgentLoggedIn;\n this.deviceType = response.deviceType;\n })\n .catch((error) => {\n this.logger.error(`Error registering contact center: ${error}`, {\n module: 'cc-store#store.ts',\n method: 'registerCC',\n });\n return Promise.reject(error);\n });\n }\n init(options) {\n if ('webex' in options) {\n // If devs decide to go with webex, they will have to listen to the ready event before calling init\n // This has to be documented\n return this.registerCC(options.webex);\n }\n return new Promise((resolve, reject) => {\n const timer = setTimeout(() => {\n reject(new Error('Webex SDK failed to initialize'));\n }, 6000);\n const webex = webex_1.default.init({\n config: options.webexConfig,\n credentials: {\n access_token: options.access_token,\n },\n });\n webex.once('ready', () => {\n clearTimeout(timer);\n this.registerCC(webex)\n .then(() => {\n resolve();\n })\n .catch((error) => {\n reject(error);\n });\n });\n });\n }\n}\nconst store = Store.getInstance();\nexports[\"default\"] = store;\n\n\n//# sourceURL=webpack://@webex/cc-store/./src/store.ts?");
23806
+ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst mobx_1 = __webpack_require__(/*! mobx */ \"../../../node_modules/mobx/dist/mobx.esm.js\");\nconst webex_1 = __importDefault(__webpack_require__(/*! webex */ \"./node_modules/webex/dist/index.js\"));\nclass Store {\n constructor() {\n this.teams = [];\n this.loginOptions = [];\n this.idleCodes = [];\n this.agentId = '';\n this.selectedLoginOption = '';\n this.currentTheme = 'LIGHT';\n this.wrapupCodes = [];\n this.currentTask = null;\n this.isAgentLoggedIn = false;\n this.deviceType = '';\n (0, mobx_1.makeAutoObservable)(this, {\n cc: mobx_1.observable.ref,\n currentTask: mobx_1.observable, // Make currentTask observable\n });\n }\n setCurrentTask(task) {\n this.currentTask = task;\n }\n static getInstance() {\n if (!Store.instance) {\n console.log('Creating new store instance');\n Store.instance = new Store();\n }\n console.log('Returning store instance');\n return Store.instance;\n }\n setSelectedLoginOption(option) {\n this.selectedLoginOption = option;\n }\n setCurrentTheme(theme) {\n this.currentTheme = theme;\n }\n registerCC(webex) {\n this.cc = webex.cc;\n this.logger = this.cc.LoggerProxy;\n return this.cc\n .register()\n .then((response) => {\n this.teams = response.teams;\n this.loginOptions = response.loginVoiceOptions;\n this.idleCodes = response.idleCodes;\n this.agentId = response.agentId;\n this.wrapupCodes = response.wrapupCodes;\n this.isAgentLoggedIn = response.isAgentLoggedIn;\n this.deviceType = response.deviceType;\n })\n .catch((error) => {\n this.logger.error(`Error registering contact center: ${error}`, {\n module: 'cc-store#store.ts',\n method: 'registerCC',\n });\n return Promise.reject(error);\n });\n }\n init(options) {\n if ('webex' in options) {\n // If devs decide to go with webex, they will have to listen to the ready event before calling init\n // This has to be documented\n return this.registerCC(options.webex);\n }\n return new Promise((resolve, reject) => {\n const timer = setTimeout(() => {\n reject(new Error('Webex SDK failed to initialize'));\n }, 6000);\n const webex = webex_1.default.init({\n config: options.webexConfig,\n credentials: {\n access_token: options.access_token,\n },\n });\n webex.once('ready', () => {\n clearTimeout(timer);\n this.registerCC(webex)\n .then(() => {\n resolve();\n })\n .catch((error) => {\n reject(error);\n });\n });\n });\n }\n}\nconst store = Store.getInstance();\nexports[\"default\"] = store;\n\n\n//# sourceURL=webpack://@webex/cc-store/./src/store.ts?");
23807
23807
 
23808
23808
  /***/ }),
23809
23809
 
@@ -9,6 +9,7 @@ declare class Store implements IStore {
9
9
  idleCodes: IdleCode[];
10
10
  agentId: string;
11
11
  selectedLoginOption: string;
12
+ currentTheme: string;
12
13
  wrapupCodes: IWrapupCode[];
13
14
  currentTask: ITask;
14
15
  isAgentLoggedIn: boolean;
@@ -17,6 +18,7 @@ declare class Store implements IStore {
17
18
  setCurrentTask(task: ITask): void;
18
19
  static getInstance(): Store;
19
20
  setSelectedLoginOption(option: string): void;
21
+ setCurrentTheme(theme: string): void;
20
22
  registerCC(webex: WithWebex['webex']): Promise<void>;
21
23
  init(options: InitParams): Promise<void>;
22
24
  }
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.12",
4
+ "version": "1.28.0-ccwidgets.14",
5
5
  "main": "dist/index.js",
6
6
  "license": "MIT",
7
7
  "publishConfig": {
@@ -51,5 +51,5 @@
51
51
  "**/tests/**/*.tsx"
52
52
  ]
53
53
  },
54
- "stableVersion": "1.28.0-ccwidgets.11"
54
+ "stableVersion": "1.28.0-ccwidgets.13"
55
55
  }