@webex/cc-store 1.28.0-eft.1 → 1.28.0-eft.2
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/package.json +6 -7
- package/.babelrc.js +0 -3
- package/src/index.ts +0 -2
- package/src/sdk.ts +0 -80
- package/src/store.ts +0 -30
- package/tsconfig.json +0 -11
- package/webpack.config.js +0 -12
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/cc-store",
|
|
3
3
|
"description": "Webex Contact Center Widgets: Widgets Store",
|
|
4
|
-
"version": "1.28.0-eft.
|
|
4
|
+
"version": "1.28.0-eft.2",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/",
|
|
12
|
+
"package.json"
|
|
13
|
+
],
|
|
10
14
|
"scripts": {
|
|
11
15
|
"build": "yarn run -T tsc",
|
|
12
16
|
"build:src": "webpack && yarn run build",
|
|
@@ -14,10 +18,6 @@
|
|
|
14
18
|
"test:unit": "jest"
|
|
15
19
|
},
|
|
16
20
|
"dependencies": {
|
|
17
|
-
"@semantic-release/changelog": "^6.0.3",
|
|
18
|
-
"@semantic-release/exec": "^6.0.3",
|
|
19
|
-
"@semantic-release/git": "^10.0.1",
|
|
20
|
-
"@semantic-release/github": "^11.0.1",
|
|
21
21
|
"mobx": "6.13.5",
|
|
22
22
|
"react": "18.3.1",
|
|
23
23
|
"react-dom": "18.3.1",
|
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
"file-loader": "6.2.0",
|
|
39
39
|
"jest": "29.7.0",
|
|
40
40
|
"jest-environment-jsdom": "29.7.0",
|
|
41
|
-
"semantic-release": "^24.2.0",
|
|
42
41
|
"ts-loader": "9.5.1",
|
|
43
42
|
"webpack": "5.94.0",
|
|
44
43
|
"webpack-cli": "5.1.4",
|
|
@@ -47,5 +46,5 @@
|
|
|
47
46
|
"jest": {
|
|
48
47
|
"testEnvironment": "jsdom"
|
|
49
48
|
},
|
|
50
|
-
"stableVersion": "1.
|
|
49
|
+
"stableVersion": "1.28.0-eft.1"
|
|
51
50
|
}
|
package/.babelrc.js
DELETED
package/src/index.ts
DELETED
package/src/sdk.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
const sdk = {
|
|
2
|
-
accessToken: '',
|
|
3
|
-
callbacks: {},
|
|
4
|
-
init: async function({accessToken}) {
|
|
5
|
-
this.accessToken = accessToken;
|
|
6
|
-
},
|
|
7
|
-
logout: function() {
|
|
8
|
-
this.accessToken = '';
|
|
9
|
-
this.callControls.unmute();
|
|
10
|
-
this.presence.set('busy');
|
|
11
|
-
},
|
|
12
|
-
presence: {
|
|
13
|
-
currentState: 'busy',
|
|
14
|
-
set: function(state) {
|
|
15
|
-
this.currentState = state;
|
|
16
|
-
console.log(
|
|
17
|
-
`%cWxCCSDK\t\t\t%cpresence.set:%c Received`,
|
|
18
|
-
'background: red; color: white;',
|
|
19
|
-
'background: lightgreen; color: black;',
|
|
20
|
-
'background: transparent; color: grey;'
|
|
21
|
-
);
|
|
22
|
-
setTimeout(() => {
|
|
23
|
-
sdk.emit('presence:state', this.currentState);
|
|
24
|
-
}, 1500);
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
callControls: {
|
|
28
|
-
currentState: 'unmuted',
|
|
29
|
-
mute: function() {
|
|
30
|
-
this.currentState = 'muted';
|
|
31
|
-
console.log(
|
|
32
|
-
`%cWxCCSDK\t\t\t%ccallControls.mute:%c Received`,
|
|
33
|
-
'background: red; color: white;',
|
|
34
|
-
'background: lightgreen; color: black;',
|
|
35
|
-
'background: transparent; color: grey;'
|
|
36
|
-
);
|
|
37
|
-
setTimeout(() => {
|
|
38
|
-
sdk.emit('callControls:muteState', this.currentState);
|
|
39
|
-
}, 1500);
|
|
40
|
-
},
|
|
41
|
-
unmute: function() {
|
|
42
|
-
this.currentState = 'unmuted';
|
|
43
|
-
console.log(
|
|
44
|
-
`%cWxCCSDK\t\t\t%ccallControls.unmute:%c Received`,
|
|
45
|
-
'background: red; color: white;',
|
|
46
|
-
'background: lightgreen; color: black;',
|
|
47
|
-
'background: transparent; color: grey;'
|
|
48
|
-
);
|
|
49
|
-
setTimeout(() => {
|
|
50
|
-
sdk.emit('callControls:muteState', this.currentState);
|
|
51
|
-
}, 3000);
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
on: function(eventName, callback) {
|
|
55
|
-
if (this.callbacks[eventName] === undefined) {
|
|
56
|
-
this.callbacks[eventName] = [];
|
|
57
|
-
}
|
|
58
|
-
this.callbacks[eventName].push(callback);
|
|
59
|
-
return {
|
|
60
|
-
eventName,
|
|
61
|
-
callback,
|
|
62
|
-
};
|
|
63
|
-
},
|
|
64
|
-
off: function(eventName, callback) {
|
|
65
|
-
this.callbacks[eventName] = this.callbacks[eventName].filter((cb) => cb !== callback);
|
|
66
|
-
},
|
|
67
|
-
emit: function(eventName, payload) {
|
|
68
|
-
console.log(
|
|
69
|
-
`%cWxCCSDK\t\t\t%cEmitEvent:%c ${eventName}\t\t%cPayload:%c ${payload}`,
|
|
70
|
-
'background: red; color: white;',
|
|
71
|
-
'background: lightgreen; color: black;',
|
|
72
|
-
'background: transparent; color: grey;',
|
|
73
|
-
'background: lightgreen; color: black;',
|
|
74
|
-
'background: transparent; color: grey;'
|
|
75
|
-
);
|
|
76
|
-
this.callbacks[eventName].forEach((cb) => cb(payload));
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export default sdk;
|
package/src/store.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import {makeAutoObservable, observable} from 'mobx';
|
|
2
|
-
|
|
3
|
-
import sdk from './sdk';
|
|
4
|
-
/*
|
|
5
|
-
* Store
|
|
6
|
-
*/
|
|
7
|
-
class Store {
|
|
8
|
-
loginState = '';
|
|
9
|
-
isAvailable = false;
|
|
10
|
-
ccSdk = sdk;
|
|
11
|
-
|
|
12
|
-
constructor() {
|
|
13
|
-
makeAutoObservable(this, {ccSdk: observable.ref});
|
|
14
|
-
|
|
15
|
-
this.ccSdk.on('presence:state', (payload) => {
|
|
16
|
-
this.setIsAvailable(payload === 'available');
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
setLoginState = (state) => {
|
|
21
|
-
this.loginState = state;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
setIsAvailable = (state) => {
|
|
25
|
-
this.isAvailable = state;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const store = new Store();
|
|
30
|
-
export default store;
|
package/tsconfig.json
DELETED
package/webpack.config.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const {merge} = require('webpack-merge');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
const baseConfig = require('../../../webpack.config');
|
|
5
|
-
|
|
6
|
-
module.exports = merge(baseConfig, {
|
|
7
|
-
output: {
|
|
8
|
-
path: path.resolve(__dirname, 'dist'),
|
|
9
|
-
filename: 'index.js', // Set the output filename to index.js
|
|
10
|
-
libraryTarget: 'commonjs2',
|
|
11
|
-
},
|
|
12
|
-
});
|