@webex/cc-store 1.28.0-ccwidgets.6 → 1.28.0-ccwidgets.8

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.
@@ -1,5 +1,6 @@
1
1
  import { IContactCenter, Team, WithWebex, IdleCode, InitParams, IStore } from './store.types';
2
2
  declare class Store implements IStore {
3
+ private static instance;
3
4
  teams: Team[];
4
5
  loginOptions: string[];
5
6
  cc: IContactCenter;
@@ -7,6 +8,7 @@ declare class Store implements IStore {
7
8
  agentId: string;
8
9
  selectedLoginOption: string;
9
10
  constructor();
11
+ static getInstance(): Store;
10
12
  setSelectedLoginOption(option: string): void;
11
13
  registerCC(webex: WithWebex['webex']): Promise<void>;
12
14
  init(options: InitParams): Promise<void>;
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.6",
4
+ "version": "1.28.0-ccwidgets.8",
5
5
  "main": "dist/index.js",
6
6
  "license": "MIT",
7
7
  "publishConfig": {
@@ -12,17 +12,17 @@
12
12
  "package.json"
13
13
  ],
14
14
  "scripts": {
15
+ "clean": "rm -rf dist && rm -rf node_modules",
16
+ "clean:dist": "rm -rf dist",
15
17
  "build": "yarn run -T tsc",
16
- "build:src": "webpack && yarn run build",
18
+ "build:src": "yarn run clean:dist && webpack",
17
19
  "build:watch": "webpack --watch",
18
20
  "test:unit": "jest"
19
21
  },
20
22
  "dependencies": {
21
23
  "mobx": "6.13.5",
22
- "react": "18.3.1",
23
- "react-dom": "18.3.1",
24
24
  "typescript": "5.6.3",
25
- "webex": "3.7.0-wxcc.4"
25
+ "webex": "3.7.0-wxcc.5"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@babel/core": "7.25.2",
@@ -51,5 +51,5 @@
51
51
  "**/tests/**/*.tsx"
52
52
  ]
53
53
  },
54
- "stableVersion": "1.28.0-ccwidgets.5"
54
+ "stableVersion": "1.28.0-ccwidgets.7"
55
55
  }
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,oDAA4B;AAC5B,gDAA8B;AAC9B,kBAAe,eAAK,CAAC"}
package/dist/store.js DELETED
@@ -1,66 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const mobx_1 = require("mobx");
7
- const webex_1 = __importDefault(require("webex"));
8
- class Store {
9
- constructor() {
10
- this.teams = [];
11
- this.loginOptions = [];
12
- this.idleCodes = [];
13
- this.agentId = '';
14
- this.selectedLoginOption = '';
15
- (0, mobx_1.makeAutoObservable)(this, { cc: mobx_1.observable.ref });
16
- }
17
- setSelectedLoginOption(option) {
18
- this.selectedLoginOption = option;
19
- }
20
- registerCC(webex) {
21
- this.cc = webex.cc;
22
- return this.cc
23
- .register()
24
- .then((response) => {
25
- this.teams = response.teams;
26
- this.loginOptions = response.loginVoiceOptions;
27
- this.idleCodes = response.idleCodes;
28
- this.agentId = response.agentId;
29
- })
30
- .catch((error) => {
31
- console.error('Error registering contact center', error);
32
- return Promise.reject(error);
33
- });
34
- }
35
- init(options) {
36
- if ('webex' in options) {
37
- // If devs decide to go with webex, they will have to listen to the ready event before calling init
38
- // This has to be documented
39
- return this.registerCC(options.webex);
40
- }
41
- return new Promise((resolve, reject) => {
42
- const timer = setTimeout(() => {
43
- reject(new Error('Webex SDK failed to initialize'));
44
- }, 6000);
45
- const webex = webex_1.default.init({
46
- config: options.webexConfig,
47
- credentials: {
48
- access_token: options.access_token,
49
- },
50
- });
51
- webex.once('ready', () => {
52
- clearTimeout(timer);
53
- this.registerCC(webex)
54
- .then(() => {
55
- resolve();
56
- })
57
- .catch((error) => {
58
- reject(error);
59
- });
60
- });
61
- });
62
- }
63
- }
64
- const store = new Store();
65
- exports.default = store;
66
- //# sourceMappingURL=store.js.map
package/dist/store.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":";;;;;AAAA,+BAAoD;AACpD,kDAA0B;AAG1B,MAAM,KAAK;IAQT;QAPA,UAAK,GAAW,EAAE,CAAC;QACnB,iBAAY,GAAa,EAAE,CAAC;QAE5B,cAAS,GAAe,EAAE,CAAC;QAC3B,YAAO,GAAW,EAAE,CAAC;QACrB,wBAAmB,GAAW,EAAE,CAAC;QAG/B,IAAA,yBAAkB,EAAC,IAAI,EAAE,EAAC,EAAE,EAAE,iBAAU,CAAC,GAAG,EAAC,CAAC,CAAC;IACjD,CAAC;IAED,sBAAsB,CAAC,MAAc;QACnC,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC;IACpC,CAAC;IAED,UAAU,CAAC,KAAyB;QAClC,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC,EAAE;aACX,QAAQ,EAAE;aACV,IAAI,CAAC,CAAC,QAAiB,EAAE,EAAE;YAC1B,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;YAC5B,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC,iBAAiB,CAAC;YAC/C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;YACpC,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;QAClC,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;YACzD,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACP,CAAC;IAED,IAAI,CAAC,OAAmB;QACtB,IAAI,OAAO,IAAI,OAAO,EAAE,CAAC;YACvB,mGAAmG;YACnG,4BAA4B;YAC5B,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACxC,CAAC;QACD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC5B,MAAM,CAAC,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC,CAAC;YACtD,CAAC,EAAE,IAAI,CAAC,CAAC;YAET,MAAM,KAAK,GAAG,eAAK,CAAC,IAAI,CAAC;gBACvB,MAAM,EAAE,OAAO,CAAC,WAAW;gBAC3B,WAAW,EAAE;oBACX,YAAY,EAAE,OAAO,CAAC,YAAY;iBACnC;aACF,CAAC,CAAC;YAEH,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE;gBACvB,YAAY,CAAC,KAAK,CAAC,CAAC;gBACpB,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;qBACnB,IAAI,CAAC,GAAG,EAAE;oBACT,OAAO,EAAE,CAAC;gBACZ,CAAC,CAAC;qBACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;oBACf,MAAM,CAAC,KAAK,CAAC,CAAC;gBAChB,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;AAC1B,kBAAe,KAAK,CAAC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=store.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.types.js","sourceRoot":"","sources":["../src/store.types.ts"],"names":[],"mappings":""}