@webex/plugin-device-manager 2.59.3-next.1 → 2.59.4-next.1
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/.eslintrc.js +6 -6
- package/README.md +80 -80
- package/babel.config.js +3 -3
- package/dist/collection.js +2 -2
- package/dist/collection.js.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/device-manager.js +111 -107
- package/dist/device-manager.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/jest.config.js +3 -3
- package/package.json +13 -13
- package/process +1 -1
- package/sample/app.js +453 -453
- package/sample/index.html +121 -121
- package/src/collection.js +32 -32
- package/src/config.js +1 -1
- package/src/constants.js +3 -3
- package/src/device-manager.js +643 -643
- package/src/index.js +18 -18
- package/test/unit/spec/index.js +11 -11
- package/webex.js +42 -42
package/sample/index.html
CHANGED
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>Sample: Device Manager</title>
|
|
5
|
-
</head>
|
|
6
|
-
|
|
7
|
-
<body>
|
|
8
|
-
<div style="width:100%;">
|
|
9
|
-
<div id='notifications' style="float:right; text-align: right; font-size: 20px;">
|
|
10
|
-
</div>
|
|
11
|
-
<div style="float:inherit;">
|
|
12
|
-
<h1>Device Manager</h1>
|
|
13
|
-
<p>This is the start of the "kitchen sink" demo app for plugin-device-manager.</p>
|
|
14
|
-
|
|
15
|
-
<h2>Connect first:</h2>
|
|
16
|
-
|
|
17
|
-
<form id="credentials">
|
|
18
|
-
<fieldset>
|
|
19
|
-
<legend>Credentials</legend>
|
|
20
|
-
<input id="access-token" name="accessToken" placeholder="Your access token" value="" type="text" />
|
|
21
|
-
<input id="connect" title="connect" type="submit" value="connect" />
|
|
22
|
-
<p id="connection-status">disconnected</p>
|
|
23
|
-
</fieldset>
|
|
24
|
-
</form>
|
|
25
|
-
|
|
26
|
-
<form id="deviceControls" name="deviceControls">
|
|
27
|
-
<fieldset>
|
|
28
|
-
<legend>Device Controls</legend>
|
|
29
|
-
<div>
|
|
30
|
-
<div id='refreshDiv' style="display:block; float:left">
|
|
31
|
-
<button id="refresh" name="refresh" title="Refresh device list" type="button">refresh</button>
|
|
32
|
-
</div>
|
|
33
|
-
<div id='removeBtnDiv' style="display:none; float:left">
|
|
34
|
-
<button id="remove" title="Remove" type="button">Remove</button>
|
|
35
|
-
</div>
|
|
36
|
-
<div id='requestPinDiv' style="display:none; float:left">
|
|
37
|
-
<button id="requestPin" title="Request a PIN" type="button">Request PIN</button>
|
|
38
|
-
</div>
|
|
39
|
-
<div id='enterPinDiv' style="display:none; float:left">
|
|
40
|
-
<input maxlength="4" id="pin" name="pin" placeholder="PIN" value="" type="text" />
|
|
41
|
-
</div>
|
|
42
|
-
<div id='requestPairingBtnDiv' style="display:none; float:left">
|
|
43
|
-
<button id="requestPairing" title="Pair" type="button">Pair</button>
|
|
44
|
-
</div>
|
|
45
|
-
<div id='requestUnPairingBtnDiv' style="display:none; float:left">
|
|
46
|
-
<button id="requestUnPairing" title="UnPair" type="button">UnPair</button>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
<div id='getAudioStateBtnDiv' style="display:none; float:left">
|
|
50
|
-
<button id="getAudioState" title="getAudioState" type="button">getAudioState</button>
|
|
51
|
-
</div>
|
|
52
|
-
<div id='volumeUpBtnDiv' style="display:none; float:left">
|
|
53
|
-
<button id="volumeUp" title="Volume Up" type="button">Up</button>
|
|
54
|
-
</div>
|
|
55
|
-
<div id='volumeDownBtnDiv' style="display:none; float:left">
|
|
56
|
-
<button id="volumeDown" title="Volume Down" type="button">Down</button>
|
|
57
|
-
</div>
|
|
58
|
-
<div id='muteBtnDiv' style="display:none; float:left">
|
|
59
|
-
<button id="mute" title="Mute" type="button">Mute</button>
|
|
60
|
-
</div>
|
|
61
|
-
<div id='unmuteBtnDiv' style="display:none; float:left">
|
|
62
|
-
<button id="unmute" title="Unmute" type="button">UnMute</button>
|
|
63
|
-
</div>
|
|
64
|
-
|
|
65
|
-
<div id='enterConvoIdDiv' style="display:none; float:left">
|
|
66
|
-
<input id="convoId" name="convoId" placeholder="convo Id" value="" type="text" />
|
|
67
|
-
</div>
|
|
68
|
-
<div id='bindSpaceBtnDiv' style="display:none; float:left">
|
|
69
|
-
<button id="bindSpace" title="Bind" type="button">Bind</button>
|
|
70
|
-
</div>
|
|
71
|
-
<div id='unbindSpaceBtnDiv' style="display:none; float:left">
|
|
72
|
-
<button id="unbindSpace" title="Unbind" type="button">Unbind</button>
|
|
73
|
-
</div>
|
|
74
|
-
|
|
75
|
-
<div id='getAudioStateContentsDiv' style="display:none; float:right">
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
</fieldset>
|
|
79
|
-
</form>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<div style="width:100%">
|
|
84
|
-
<div style="float:inherit;">
|
|
85
|
-
<form id="deviceListing" name="deviceListing">
|
|
86
|
-
<fieldset>
|
|
87
|
-
<legend>Device Listing</legend>
|
|
88
|
-
<div style="display:block; float:left">
|
|
89
|
-
<form id="device-list">
|
|
90
|
-
<select id="device-list-dropdown">
|
|
91
|
-
</select>
|
|
92
|
-
</form>
|
|
93
|
-
</div>
|
|
94
|
-
</fieldset>
|
|
95
|
-
</form>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
|
|
99
|
-
<div style="width:100%">
|
|
100
|
-
<div style="float:inherit;">
|
|
101
|
-
<form id="deviceSearch" name="deviceSearch">
|
|
102
|
-
<fieldset>
|
|
103
|
-
<legend>Device Search</legend>
|
|
104
|
-
<div style="display:block; float:left">
|
|
105
|
-
<input id="searchQuery" name="searchQuery" placeholder="search query" value="" type="text" />
|
|
106
|
-
</div>
|
|
107
|
-
<div id='searchBtnDiv' style="display:block; float:left">
|
|
108
|
-
<button id="search" title="Search" type="button">Search</button>
|
|
109
|
-
</div>
|
|
110
|
-
<div id='getDeviceSearchResultsDiv' style="display:none; float:right">
|
|
111
|
-
</div>
|
|
112
|
-
</fieldset>
|
|
113
|
-
</form>
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
116
|
-
|
|
117
|
-
<script src="../webex.min.js"></script>
|
|
118
|
-
<!-- app.js is your application code -->
|
|
119
|
-
<script src="app.js"></script>
|
|
120
|
-
</body>
|
|
121
|
-
</html>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Sample: Device Manager</title>
|
|
5
|
+
</head>
|
|
6
|
+
|
|
7
|
+
<body>
|
|
8
|
+
<div style="width:100%;">
|
|
9
|
+
<div id='notifications' style="float:right; text-align: right; font-size: 20px;">
|
|
10
|
+
</div>
|
|
11
|
+
<div style="float:inherit;">
|
|
12
|
+
<h1>Device Manager</h1>
|
|
13
|
+
<p>This is the start of the "kitchen sink" demo app for plugin-device-manager.</p>
|
|
14
|
+
|
|
15
|
+
<h2>Connect first:</h2>
|
|
16
|
+
|
|
17
|
+
<form id="credentials">
|
|
18
|
+
<fieldset>
|
|
19
|
+
<legend>Credentials</legend>
|
|
20
|
+
<input id="access-token" name="accessToken" placeholder="Your access token" value="" type="text" />
|
|
21
|
+
<input id="connect" title="connect" type="submit" value="connect" />
|
|
22
|
+
<p id="connection-status">disconnected</p>
|
|
23
|
+
</fieldset>
|
|
24
|
+
</form>
|
|
25
|
+
|
|
26
|
+
<form id="deviceControls" name="deviceControls">
|
|
27
|
+
<fieldset>
|
|
28
|
+
<legend>Device Controls</legend>
|
|
29
|
+
<div>
|
|
30
|
+
<div id='refreshDiv' style="display:block; float:left">
|
|
31
|
+
<button id="refresh" name="refresh" title="Refresh device list" type="button">refresh</button>
|
|
32
|
+
</div>
|
|
33
|
+
<div id='removeBtnDiv' style="display:none; float:left">
|
|
34
|
+
<button id="remove" title="Remove" type="button">Remove</button>
|
|
35
|
+
</div>
|
|
36
|
+
<div id='requestPinDiv' style="display:none; float:left">
|
|
37
|
+
<button id="requestPin" title="Request a PIN" type="button">Request PIN</button>
|
|
38
|
+
</div>
|
|
39
|
+
<div id='enterPinDiv' style="display:none; float:left">
|
|
40
|
+
<input maxlength="4" id="pin" name="pin" placeholder="PIN" value="" type="text" />
|
|
41
|
+
</div>
|
|
42
|
+
<div id='requestPairingBtnDiv' style="display:none; float:left">
|
|
43
|
+
<button id="requestPairing" title="Pair" type="button">Pair</button>
|
|
44
|
+
</div>
|
|
45
|
+
<div id='requestUnPairingBtnDiv' style="display:none; float:left">
|
|
46
|
+
<button id="requestUnPairing" title="UnPair" type="button">UnPair</button>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<div id='getAudioStateBtnDiv' style="display:none; float:left">
|
|
50
|
+
<button id="getAudioState" title="getAudioState" type="button">getAudioState</button>
|
|
51
|
+
</div>
|
|
52
|
+
<div id='volumeUpBtnDiv' style="display:none; float:left">
|
|
53
|
+
<button id="volumeUp" title="Volume Up" type="button">Up</button>
|
|
54
|
+
</div>
|
|
55
|
+
<div id='volumeDownBtnDiv' style="display:none; float:left">
|
|
56
|
+
<button id="volumeDown" title="Volume Down" type="button">Down</button>
|
|
57
|
+
</div>
|
|
58
|
+
<div id='muteBtnDiv' style="display:none; float:left">
|
|
59
|
+
<button id="mute" title="Mute" type="button">Mute</button>
|
|
60
|
+
</div>
|
|
61
|
+
<div id='unmuteBtnDiv' style="display:none; float:left">
|
|
62
|
+
<button id="unmute" title="Unmute" type="button">UnMute</button>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div id='enterConvoIdDiv' style="display:none; float:left">
|
|
66
|
+
<input id="convoId" name="convoId" placeholder="convo Id" value="" type="text" />
|
|
67
|
+
</div>
|
|
68
|
+
<div id='bindSpaceBtnDiv' style="display:none; float:left">
|
|
69
|
+
<button id="bindSpace" title="Bind" type="button">Bind</button>
|
|
70
|
+
</div>
|
|
71
|
+
<div id='unbindSpaceBtnDiv' style="display:none; float:left">
|
|
72
|
+
<button id="unbindSpace" title="Unbind" type="button">Unbind</button>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<div id='getAudioStateContentsDiv' style="display:none; float:right">
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</fieldset>
|
|
79
|
+
</form>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<div style="width:100%">
|
|
84
|
+
<div style="float:inherit;">
|
|
85
|
+
<form id="deviceListing" name="deviceListing">
|
|
86
|
+
<fieldset>
|
|
87
|
+
<legend>Device Listing</legend>
|
|
88
|
+
<div style="display:block; float:left">
|
|
89
|
+
<form id="device-list">
|
|
90
|
+
<select id="device-list-dropdown">
|
|
91
|
+
</select>
|
|
92
|
+
</form>
|
|
93
|
+
</div>
|
|
94
|
+
</fieldset>
|
|
95
|
+
</form>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div style="width:100%">
|
|
100
|
+
<div style="float:inherit;">
|
|
101
|
+
<form id="deviceSearch" name="deviceSearch">
|
|
102
|
+
<fieldset>
|
|
103
|
+
<legend>Device Search</legend>
|
|
104
|
+
<div style="display:block; float:left">
|
|
105
|
+
<input id="searchQuery" name="searchQuery" placeholder="search query" value="" type="text" />
|
|
106
|
+
</div>
|
|
107
|
+
<div id='searchBtnDiv' style="display:block; float:left">
|
|
108
|
+
<button id="search" title="Search" type="button">Search</button>
|
|
109
|
+
</div>
|
|
110
|
+
<div id='getDeviceSearchResultsDiv' style="display:none; float:right">
|
|
111
|
+
</div>
|
|
112
|
+
</fieldset>
|
|
113
|
+
</form>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<script src="../webex.min.js"></script>
|
|
118
|
+
<!-- app.js is your application code -->
|
|
119
|
+
<script src="app.js"></script>
|
|
120
|
+
</body>
|
|
121
|
+
</html>
|
package/src/collection.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import {merge} from 'lodash';
|
|
2
|
-
|
|
3
|
-
const DeviceCollection = {
|
|
4
|
-
devices: {},
|
|
5
|
-
|
|
6
|
-
get(deviceId) {
|
|
7
|
-
return this.devices[deviceId];
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
set(device) {
|
|
11
|
-
const deviceId = device.id || (device.identity && device.identity.id);
|
|
12
|
-
// check if the device is already existing, if so then merge else add
|
|
13
|
-
const existingDevice = this.devices[deviceId];
|
|
14
|
-
|
|
15
|
-
if (existingDevice) {
|
|
16
|
-
// already existing, merge for any new binding information
|
|
17
|
-
merge(existingDevice, device);
|
|
18
|
-
} else {
|
|
19
|
-
this.devices[deviceId] = device;
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
reset() {
|
|
24
|
-
this.devices = {};
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
getAll() {
|
|
28
|
-
return Object.values(this.devices);
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export default DeviceCollection;
|
|
1
|
+
import {merge} from 'lodash';
|
|
2
|
+
|
|
3
|
+
const DeviceCollection = {
|
|
4
|
+
devices: {},
|
|
5
|
+
|
|
6
|
+
get(deviceId) {
|
|
7
|
+
return this.devices[deviceId];
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
set(device) {
|
|
11
|
+
const deviceId = device.id || (device.identity && device.identity.id);
|
|
12
|
+
// check if the device is already existing, if so then merge else add
|
|
13
|
+
const existingDevice = this.devices[deviceId];
|
|
14
|
+
|
|
15
|
+
if (existingDevice) {
|
|
16
|
+
// already existing, merge for any new binding information
|
|
17
|
+
merge(existingDevice, device);
|
|
18
|
+
} else {
|
|
19
|
+
this.devices[deviceId] = device;
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
reset() {
|
|
24
|
+
this.devices = {};
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
getAll() {
|
|
28
|
+
return Object.values(this.devices);
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default DeviceCollection;
|
package/src/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default {};
|
|
1
|
+
export default {};
|
package/src/constants.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const LYRA_SPACE = 'LYRA_SPACE';
|
|
2
|
-
export const UC_CLOUD = 'uc-cloud';
|
|
3
|
-
export const DEFAULT_PRODUCT_NAME = 'default';
|
|
1
|
+
export const LYRA_SPACE = 'LYRA_SPACE';
|
|
2
|
+
export const UC_CLOUD = 'uc-cloud';
|
|
3
|
+
export const DEFAULT_PRODUCT_NAME = 'default';
|