@webex/cc-store 1.28.0-ccwidgets.1 → 1.28.0-ccwidgets.3
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 +15 -0
- package/dist/index.js.map +1 -1
- package/dist/store.js +27 -7
- package/dist/store.js.map +1 -1
- package/dist/store.types.js +3 -0
- package/dist/store.types.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/store.d.ts +6 -3
- package/dist/types/store.types.d.ts +27 -0
- package/package.json +7 -6
package/dist/index.js
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
18
|
};
|
|
5
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
20
|
const store_1 = __importDefault(require("./store"));
|
|
21
|
+
__exportStar(require("./store.types"), exports);
|
|
7
22
|
exports.default = store_1.default;
|
|
8
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
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
CHANGED
|
@@ -9,21 +9,41 @@ class Store {
|
|
|
9
9
|
constructor() {
|
|
10
10
|
this.teams = [];
|
|
11
11
|
this.loginOptions = [];
|
|
12
|
+
this.idleCodes = [];
|
|
13
|
+
this.agentId = '';
|
|
12
14
|
(0, mobx_1.makeAutoObservable)(this, { cc: mobx_1.observable.ref });
|
|
13
15
|
}
|
|
14
|
-
|
|
16
|
+
registerCC(webex) {
|
|
17
|
+
this.cc = webex.cc;
|
|
18
|
+
return this.cc.register().then((response) => {
|
|
19
|
+
this.teams = response.teams;
|
|
20
|
+
this.loginOptions = response.loginVoiceOptions;
|
|
21
|
+
this.idleCodes = response.idleCodes;
|
|
22
|
+
this.agentId = response.agentId;
|
|
23
|
+
}).catch((error) => {
|
|
24
|
+
console.error('Error registering contact center', error);
|
|
25
|
+
return Promise.reject(error);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
init(options) {
|
|
29
|
+
if ('webex' in options) {
|
|
30
|
+
// If devs decide to go with webex, they will have to listen to the ready event before calling init
|
|
31
|
+
// This has to be documented
|
|
32
|
+
return this.registerCC(options.webex);
|
|
33
|
+
}
|
|
15
34
|
return new Promise((resolve, reject) => {
|
|
35
|
+
const timer = setTimeout(() => {
|
|
36
|
+
reject(new Error('Webex SDK failed to initialize'));
|
|
37
|
+
}, 6000);
|
|
16
38
|
const webex = webex_1.default.init({
|
|
17
|
-
config: webexConfig,
|
|
39
|
+
config: options.webexConfig,
|
|
18
40
|
credentials: {
|
|
19
|
-
access_token: access_token
|
|
41
|
+
access_token: options.access_token
|
|
20
42
|
}
|
|
21
43
|
});
|
|
22
44
|
webex.once('ready', () => {
|
|
23
|
-
|
|
24
|
-
this.
|
|
25
|
-
this.teams = response.teams;
|
|
26
|
-
this.loginOptions = response.loginVoiceOptions;
|
|
45
|
+
clearTimeout(timer);
|
|
46
|
+
this.registerCC(webex).then(() => {
|
|
27
47
|
resolve();
|
|
28
48
|
})
|
|
29
49
|
.catch((error) => {
|
package/dist/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":";;;;;AAAA,+BAAoD;AACpD,kDAA0B;
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":";;;;;AAAA,+BAAoD;AACpD,kDAA0B;AAW1B,MAAM,KAAK;IAOT;QANA,UAAK,GAAW,EAAE,CAAC;QACnB,iBAAY,GAAa,EAAE,CAAC;QAE5B,cAAS,GAAe,EAAE,CAAC;QAC3B,YAAO,GAAW,EAAE,CAAC;QAGnB,IAAA,yBAAkB,EAAC,IAAI,EAAE,EAAC,EAAE,EAAE,iBAAU,CAAC,GAAG,EAAC,CAAC,CAAC;IACjD,CAAC;IAED,UAAU,CAAC,KAAyB;QAClC,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,QAAiB,EAAE,EAAE;YACnD,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,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACjB,OAAO,CAAC,KAAK,CAAC,kCAAkC,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index.d.ts
CHANGED
package/dist/types/store.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { IContactCenter, Team } from '
|
|
2
|
-
declare class Store {
|
|
1
|
+
import { IContactCenter, Team, WithWebex, IdleCode, InitParams, IStore } from './store.types';
|
|
2
|
+
declare class Store implements IStore {
|
|
3
3
|
teams: Team[];
|
|
4
4
|
loginOptions: string[];
|
|
5
5
|
cc: IContactCenter;
|
|
6
|
+
idleCodes: IdleCode[];
|
|
7
|
+
agentId: string;
|
|
6
8
|
constructor();
|
|
7
|
-
|
|
9
|
+
registerCC(webex: WithWebex['webex']): Promise<void>;
|
|
10
|
+
init(options: InitParams): Promise<void>;
|
|
8
11
|
}
|
|
9
12
|
declare const store: Store;
|
|
10
13
|
export default store;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AgentLogin, IContactCenter, Profile, Team } from '@webex/plugin-cc';
|
|
2
|
+
interface WithWebex {
|
|
3
|
+
webex: {
|
|
4
|
+
cc: IContactCenter;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
interface WithWebexConfig {
|
|
8
|
+
webexConfig: any;
|
|
9
|
+
access_token: string;
|
|
10
|
+
}
|
|
11
|
+
type InitParams = WithWebex | WithWebexConfig;
|
|
12
|
+
type IdleCode = {
|
|
13
|
+
name: string;
|
|
14
|
+
id: string;
|
|
15
|
+
isSystem: boolean;
|
|
16
|
+
isDefault: boolean;
|
|
17
|
+
};
|
|
18
|
+
interface IStore {
|
|
19
|
+
teams: Team[];
|
|
20
|
+
loginOptions: string[];
|
|
21
|
+
cc: IContactCenter;
|
|
22
|
+
idleCodes: IdleCode[];
|
|
23
|
+
agentId: string;
|
|
24
|
+
registerCC(webex: WithWebex['webex']): Promise<Profile>;
|
|
25
|
+
init(params: InitParams): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
export type { IContactCenter, Profile, Team, AgentLogin, WithWebex, IdleCode, InitParams, IStore };
|
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.3",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"publishConfig": {
|
|
@@ -18,12 +18,11 @@
|
|
|
18
18
|
"test:unit": "jest"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@webex/plugin-cc": "3.5.0-wxcc.2",
|
|
22
21
|
"mobx": "6.13.5",
|
|
23
22
|
"react": "18.3.1",
|
|
24
23
|
"react-dom": "18.3.1",
|
|
25
24
|
"typescript": "5.6.3",
|
|
26
|
-
"webex": "3.6.0-wxcc.
|
|
25
|
+
"webex": "3.6.0-wxcc.5"
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|
|
29
28
|
"@babel/core": "7.25.2",
|
|
@@ -47,8 +46,10 @@
|
|
|
47
46
|
},
|
|
48
47
|
"jest": {
|
|
49
48
|
"testEnvironment": "jsdom",
|
|
50
|
-
"
|
|
51
|
-
|
|
49
|
+
"testMatch": [
|
|
50
|
+
"**/tests/**/*.ts",
|
|
51
|
+
"**/tests/**/*.tsx"
|
|
52
|
+
]
|
|
52
53
|
},
|
|
53
|
-
"stableVersion": "1.0.
|
|
54
|
+
"stableVersion": "1.28.0-ccwidgets.2"
|
|
54
55
|
}
|