@webex/plugin-device-manager 2.59.2 → 2.59.3-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.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/device-manager.js +104 -104
- 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 +20 -19
- 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/.eslintrc.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const config = {
|
|
2
|
-
root: true,
|
|
3
|
-
extends: ['@webex/eslint-config-legacy'],
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
module.exports = config;
|
|
1
|
+
const config = {
|
|
2
|
+
root: true,
|
|
3
|
+
extends: ['@webex/eslint-config-legacy'],
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
module.exports = config;
|
package/README.md
CHANGED
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
# @webex/plugin-device-manager
|
|
2
|
-
|
|
3
|
-
[](https://github.com/RichardLitt/standard-readme)
|
|
4
|
-
|
|
5
|
-
> Plugin for the DeviceManager service
|
|
6
|
-
|
|
7
|
-
# WARNING: This plugin is currently under active development, is not stable, and breaking changes can and will happen!
|
|
8
|
-
|
|
9
|
-
- [Install](#install)
|
|
10
|
-
- [Usage](#usage)
|
|
11
|
-
- [Contribute](#contribute)
|
|
12
|
-
- [Maintainers](#maintainers)
|
|
13
|
-
- [License](#license)
|
|
14
|
-
|
|
15
|
-
## Install
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm install --save @webex/plugin-device-manager
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
This is a plugin for the Cisco Webex JS SDK . Please see our [developer portal](https://developer.webex.com/) and the [API docs](https://webex.github.io/webex-js-sdk/api/) for full details.
|
|
24
|
-
|
|
25
|
-
###Samples
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
yarn run samples:devicemanager
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
// initialize webex instance -> connects to mercury -> registers device ->
|
|
33
|
-
// initializes plugin-device-manager to listen for device updates
|
|
34
|
-
|
|
35
|
-
```javascript
|
|
36
|
-
import '@webex/plugin-device-manager';
|
|
37
|
-
import WebexCore from '@webex/webex-core';
|
|
38
|
-
function connect() {
|
|
39
|
-
if (!webex) {
|
|
40
|
-
webex = WebexCore.init({
|
|
41
|
-
config: {},
|
|
42
|
-
credentials: {
|
|
43
|
-
access_token: document.getElementById('access-token').value,
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
if (!webex.internal.device.registered) {
|
|
48
|
-
webex.internal.device.register().then(() => {
|
|
49
|
-
return webex.internal.mercury.connect();
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Typical flow
|
|
55
|
-
webex.devicemanager
|
|
56
|
-
.getAll() // gets a list of all devices registered to the user
|
|
57
|
-
.refresh() // refreshes and re-populates all devices registered to the user
|
|
58
|
-
.search() // search a device by name
|
|
59
|
-
.requestPin() // displays PIN Challenge on the device
|
|
60
|
-
.pair() // pairs the device and registers for subsequent fetches
|
|
61
|
-
.increaseVolume() // increases paired device's volume
|
|
62
|
-
.decreaseVolume() // decreases paired device's volume
|
|
63
|
-
.mute() // mutes the paired device
|
|
64
|
-
.unmute() // unmutes the paired device
|
|
65
|
-
.bindSpace() // binds the space to the paired device
|
|
66
|
-
.unbindSpace() // unbinds the space to the paired device
|
|
67
|
-
.unpair(); // disconnects the device paired session
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## Maintainers
|
|
71
|
-
|
|
72
|
-
This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
|
|
73
|
-
|
|
74
|
-
## Contribute
|
|
75
|
-
|
|
76
|
-
Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/webex-js-sdk/blob/master/CONTRIBUTING.md) for more details.
|
|
77
|
-
|
|
78
|
-
## License
|
|
79
|
-
|
|
80
|
-
© 2016-2020 Cisco and/or its affiliates. All Rights Reserved.
|
|
1
|
+
# @webex/plugin-device-manager
|
|
2
|
+
|
|
3
|
+
[](https://github.com/RichardLitt/standard-readme)
|
|
4
|
+
|
|
5
|
+
> Plugin for the DeviceManager service
|
|
6
|
+
|
|
7
|
+
# WARNING: This plugin is currently under active development, is not stable, and breaking changes can and will happen!
|
|
8
|
+
|
|
9
|
+
- [Install](#install)
|
|
10
|
+
- [Usage](#usage)
|
|
11
|
+
- [Contribute](#contribute)
|
|
12
|
+
- [Maintainers](#maintainers)
|
|
13
|
+
- [License](#license)
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install --save @webex/plugin-device-manager
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
This is a plugin for the Cisco Webex JS SDK . Please see our [developer portal](https://developer.webex.com/) and the [API docs](https://webex.github.io/webex-js-sdk/api/) for full details.
|
|
24
|
+
|
|
25
|
+
###Samples
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
yarn run samples:devicemanager
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
// initialize webex instance -> connects to mercury -> registers device ->
|
|
33
|
+
// initializes plugin-device-manager to listen for device updates
|
|
34
|
+
|
|
35
|
+
```javascript
|
|
36
|
+
import '@webex/plugin-device-manager';
|
|
37
|
+
import WebexCore from '@webex/webex-core';
|
|
38
|
+
function connect() {
|
|
39
|
+
if (!webex) {
|
|
40
|
+
webex = WebexCore.init({
|
|
41
|
+
config: {},
|
|
42
|
+
credentials: {
|
|
43
|
+
access_token: document.getElementById('access-token').value,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (!webex.internal.device.registered) {
|
|
48
|
+
webex.internal.device.register().then(() => {
|
|
49
|
+
return webex.internal.mercury.connect();
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Typical flow
|
|
55
|
+
webex.devicemanager
|
|
56
|
+
.getAll() // gets a list of all devices registered to the user
|
|
57
|
+
.refresh() // refreshes and re-populates all devices registered to the user
|
|
58
|
+
.search() // search a device by name
|
|
59
|
+
.requestPin() // displays PIN Challenge on the device
|
|
60
|
+
.pair() // pairs the device and registers for subsequent fetches
|
|
61
|
+
.increaseVolume() // increases paired device's volume
|
|
62
|
+
.decreaseVolume() // decreases paired device's volume
|
|
63
|
+
.mute() // mutes the paired device
|
|
64
|
+
.unmute() // unmutes the paired device
|
|
65
|
+
.bindSpace() // binds the space to the paired device
|
|
66
|
+
.unbindSpace() // unbinds the space to the paired device
|
|
67
|
+
.unpair(); // disconnects the device paired session
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Maintainers
|
|
71
|
+
|
|
72
|
+
This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
|
|
73
|
+
|
|
74
|
+
## Contribute
|
|
75
|
+
|
|
76
|
+
Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/webex-js-sdk/blob/master/CONTRIBUTING.md) for more details.
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
© 2016-2020 Cisco and/or its affiliates. All Rights Reserved.
|
package/babel.config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const babelConfigLegacy = require('@webex/babel-config-legacy');
|
|
2
|
-
|
|
3
|
-
module.exports = babelConfigLegacy;
|
|
1
|
+
const babelConfigLegacy = require('@webex/babel-config-legacy');
|
|
2
|
+
|
|
3
|
+
module.exports = babelConfigLegacy;
|
package/dist/collection.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DeviceCollection","devices","get","deviceId","set","device","id","identity","existingDevice","_merge2","default","reset","getAll","_values","_default","exports"],"sources":["collection.js"],"sourcesContent":["import {merge} from 'lodash';\n\nconst DeviceCollection = {\n devices: {},\n\n get(deviceId) {\n return this.devices[deviceId];\n },\n\n set(device) {\n const deviceId = device.id || (device.identity && device.identity.id);\n // check if the device is already existing, if so then merge else add\n const existingDevice = this.devices[deviceId];\n\n if (existingDevice) {\n // already existing, merge for any new binding information\n merge(existingDevice, device);\n } else {\n this.devices[deviceId] = device;\n }\n },\n\n reset() {\n this.devices = {};\n },\n\n getAll() {\n return Object.values(this.devices);\n },\n};\n\nexport default DeviceCollection;\n"],"mappings":";;;;;;;;;;AAEA,IAAMA,gBAAgB,GAAG;EACvBC,OAAO,EAAE,CAAC,CAAC;EAEXC,GAAG,WAAAA,IAACC,QAAQ,EAAE;IACZ,OAAO,IAAI,CAACF,OAAO,CAACE,QAAQ,CAAC;EAC/B,CAAC;EAEDC,GAAG,WAAAA,IAACC,MAAM,EAAE;IACV,IAAMF,QAAQ,GAAGE,MAAM,CAACC,EAAE,IAAKD,MAAM,CAACE,QAAQ,IAAIF,MAAM,CAACE,QAAQ,CAACD,EAAG;IACrE;IACA,IAAME,cAAc,GAAG,IAAI,CAACP,OAAO,CAACE,QAAQ,CAAC;IAE7C,IAAIK,cAAc,EAAE;MAClB;MACA,IAAAC,OAAA,CAAAC,OAAA,EAAMF,cAAc,EAAEH,MAAM,CAAC;IAC/B,CAAC,MAAM;MACL,IAAI,CAACJ,OAAO,CAACE,QAAQ,CAAC,GAAGE,MAAM;IACjC;EACF,CAAC;EAEDM,KAAK,WAAAA,MAAA,EAAG;IACN,IAAI,CAACV,OAAO,GAAG,CAAC,CAAC;EACnB,CAAC;EAEDW,MAAM,WAAAA,OAAA,EAAG;IACP,OAAO,IAAAC,OAAA,CAAAH,OAAA,EAAc,IAAI,CAACT,OAAO,CAAC;EACpC;AACF,CAAC;AAAC,IAAAa,QAAA,GAEad,gBAAgB;AAAAe,OAAA,CAAAL,OAAA,GAAAI,QAAA"}
|
|
1
|
+
{"version":3,"names":["DeviceCollection","devices","get","deviceId","set","device","id","identity","existingDevice","_merge2","default","reset","getAll","_values","_default","exports"],"sources":["collection.js"],"sourcesContent":["import {merge} from 'lodash';\r\n\r\nconst DeviceCollection = {\r\n devices: {},\r\n\r\n get(deviceId) {\r\n return this.devices[deviceId];\r\n },\r\n\r\n set(device) {\r\n const deviceId = device.id || (device.identity && device.identity.id);\r\n // check if the device is already existing, if so then merge else add\r\n const existingDevice = this.devices[deviceId];\r\n\r\n if (existingDevice) {\r\n // already existing, merge for any new binding information\r\n merge(existingDevice, device);\r\n } else {\r\n this.devices[deviceId] = device;\r\n }\r\n },\r\n\r\n reset() {\r\n this.devices = {};\r\n },\r\n\r\n getAll() {\r\n return Object.values(this.devices);\r\n },\r\n};\r\n\r\nexport default DeviceCollection;\r\n"],"mappings":";;;;;;;;;;AAEA,IAAMA,gBAAgB,GAAG;EACvBC,OAAO,EAAE,CAAC,CAAC;EAEXC,GAAG,WAAAA,IAACC,QAAQ,EAAE;IACZ,OAAO,IAAI,CAACF,OAAO,CAACE,QAAQ,CAAC;EAC/B,CAAC;EAEDC,GAAG,WAAAA,IAACC,MAAM,EAAE;IACV,IAAMF,QAAQ,GAAGE,MAAM,CAACC,EAAE,IAAKD,MAAM,CAACE,QAAQ,IAAIF,MAAM,CAACE,QAAQ,CAACD,EAAG;IACrE;IACA,IAAME,cAAc,GAAG,IAAI,CAACP,OAAO,CAACE,QAAQ,CAAC;IAE7C,IAAIK,cAAc,EAAE;MAClB;MACA,IAAAC,OAAA,CAAAC,OAAA,EAAMF,cAAc,EAAEH,MAAM,CAAC;IAC/B,CAAC,MAAM;MACL,IAAI,CAACJ,OAAO,CAACE,QAAQ,CAAC,GAAGE,MAAM;IACjC;EACF,CAAC;EAEDM,KAAK,WAAAA,MAAA,EAAG;IACN,IAAI,CAACV,OAAO,GAAG,CAAC,CAAC;EACnB,CAAC;EAEDW,MAAM,WAAAA,OAAA,EAAG;IACP,OAAO,IAAAC,OAAA,CAAAH,OAAA,EAAc,IAAI,CAACT,OAAO,CAAC;EACpC;AACF,CAAC;AAAC,IAAAa,QAAA,GAEad,gBAAgB;AAAAe,OAAA,CAAAL,OAAA,GAAAI,QAAA"}
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["exports","default","_default"],"sources":["config.js"],"sourcesContent":["export default {};\n"],"mappings":";;;;;;;eAAe,CAAC,CAAC;AAAAA,OAAA,CAAAC,OAAA,GAAAC,QAAA"}
|
|
1
|
+
{"version":3,"names":["exports","default","_default"],"sources":["config.js"],"sourcesContent":["export default {};\r\n"],"mappings":";;;;;;;eAAe,CAAC,CAAC;AAAAA,OAAA,CAAAC,OAAA,GAAAC,QAAA"}
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LYRA_SPACE","exports","UC_CLOUD","DEFAULT_PRODUCT_NAME"],"sources":["constants.js"],"sourcesContent":["export const LYRA_SPACE = 'LYRA_SPACE';\nexport const UC_CLOUD = 'uc-cloud';\nexport const DEFAULT_PRODUCT_NAME = 'default';\n"],"mappings":";;;;;;;AAAO,IAAMA,UAAU,GAAG,YAAY;AAACC,OAAA,CAAAD,UAAA,GAAAA,UAAA;AAChC,IAAME,QAAQ,GAAG,UAAU;AAACD,OAAA,CAAAC,QAAA,GAAAA,QAAA;AAC5B,IAAMC,oBAAoB,GAAG,SAAS;AAACF,OAAA,CAAAE,oBAAA,GAAAA,oBAAA"}
|
|
1
|
+
{"version":3,"names":["LYRA_SPACE","exports","UC_CLOUD","DEFAULT_PRODUCT_NAME"],"sources":["constants.js"],"sourcesContent":["export const LYRA_SPACE = 'LYRA_SPACE';\r\nexport const UC_CLOUD = 'uc-cloud';\r\nexport const DEFAULT_PRODUCT_NAME = 'default';\r\n"],"mappings":";;;;;;;AAAO,IAAMA,UAAU,GAAG,YAAY;AAACC,OAAA,CAAAD,UAAA,GAAAA,UAAA;AAChC,IAAME,QAAQ,GAAG,UAAU;AAACD,OAAA,CAAAC,QAAA,GAAAA,QAAA;AAC5B,IAAMC,oBAAoB,GAAG,SAAS;AAACF,OAAA,CAAAE,oBAAA,GAAAA,oBAAA"}
|
package/dist/device-manager.js
CHANGED
|
@@ -27,18 +27,18 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
27
27
|
_this._receiveDeviceUpdates(data);
|
|
28
28
|
});
|
|
29
29
|
},
|
|
30
|
-
/**
|
|
31
|
-
* Gets a list of all recent devices associated with the user
|
|
32
|
-
* the device list gets populated from Redis
|
|
33
|
-
* @returns {Promise<Device>}
|
|
30
|
+
/**
|
|
31
|
+
* Gets a list of all recent devices associated with the user
|
|
32
|
+
* the device list gets populated from Redis
|
|
33
|
+
* @returns {Promise<Device>}
|
|
34
34
|
*/
|
|
35
35
|
getAll: function getAll() {
|
|
36
36
|
return _collection.default.getAll();
|
|
37
37
|
},
|
|
38
|
-
/**
|
|
39
|
-
* Gets a list of all recent devices associated with the user
|
|
40
|
-
* the device list gets populated from Redis
|
|
41
|
-
* @returns {Promise<Device>}
|
|
38
|
+
/**
|
|
39
|
+
* Gets a list of all recent devices associated with the user
|
|
40
|
+
* the device list gets populated from Redis
|
|
41
|
+
* @returns {Promise<Device>}
|
|
42
42
|
*/
|
|
43
43
|
refresh: function refresh() {
|
|
44
44
|
var _this2 = this;
|
|
@@ -69,11 +69,11 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
69
69
|
_this2.logger.error('DeviceManager#refresh: failed to fetch recent devices', err);
|
|
70
70
|
});
|
|
71
71
|
},
|
|
72
|
-
/**
|
|
73
|
-
* Search for a device by name
|
|
74
|
-
* @param {Object} options
|
|
75
|
-
* @param {string} options.searchQuery
|
|
76
|
-
* @returns {Promise<Device>}
|
|
72
|
+
/**
|
|
73
|
+
* Search for a device by name
|
|
74
|
+
* @param {Object} options
|
|
75
|
+
* @param {string} options.searchQuery
|
|
76
|
+
* @returns {Promise<Device>}
|
|
77
77
|
*/
|
|
78
78
|
search: function search(options) {
|
|
79
79
|
var _this3 = this;
|
|
@@ -93,11 +93,11 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
93
93
|
throw err;
|
|
94
94
|
});
|
|
95
95
|
},
|
|
96
|
-
/**
|
|
97
|
-
* Caches the device info and also registers to Redis for subsequent fetches
|
|
98
|
-
* @param {Object} device
|
|
99
|
-
* @param {string} device.id
|
|
100
|
-
* @returns {deviceInfo}
|
|
96
|
+
/**
|
|
97
|
+
* Caches the device info and also registers to Redis for subsequent fetches
|
|
98
|
+
* @param {Object} device
|
|
99
|
+
* @param {string} device.id
|
|
100
|
+
* @returns {deviceInfo}
|
|
101
101
|
*/
|
|
102
102
|
upsert: function upsert(device) {
|
|
103
103
|
var _this4 = this;
|
|
@@ -133,10 +133,10 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
133
133
|
return _promise.default.reject(err);
|
|
134
134
|
});
|
|
135
135
|
},
|
|
136
|
-
/**
|
|
137
|
-
* Retreives device info of a particular device
|
|
138
|
-
* @param {string} token
|
|
139
|
-
* @returns {Promise<deviceInfo>}
|
|
136
|
+
/**
|
|
137
|
+
* Retreives device info of a particular device
|
|
138
|
+
* @param {string} token
|
|
139
|
+
* @returns {Promise<deviceInfo>}
|
|
140
140
|
*/
|
|
141
141
|
get: function get(token) {
|
|
142
142
|
var _this5 = this;
|
|
@@ -162,11 +162,11 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
162
162
|
return _promise.default.reject(err);
|
|
163
163
|
});
|
|
164
164
|
},
|
|
165
|
-
/**
|
|
166
|
-
* Unregisters the device from Redis, will not fetch in subsequent loads,
|
|
167
|
-
* similar to space.deleteBinding()
|
|
168
|
-
* @param {string} deviceId
|
|
169
|
-
* @returns {Promise<deviceInfo>}
|
|
165
|
+
/**
|
|
166
|
+
* Unregisters the device from Redis, will not fetch in subsequent loads,
|
|
167
|
+
* similar to space.deleteBinding()
|
|
168
|
+
* @param {string} deviceId
|
|
169
|
+
* @returns {Promise<deviceInfo>}
|
|
170
170
|
*/
|
|
171
171
|
remove: function remove(deviceId) {
|
|
172
172
|
var _this6 = this;
|
|
@@ -183,12 +183,12 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
183
183
|
return _promise.default.reject(error);
|
|
184
184
|
});
|
|
185
185
|
},
|
|
186
|
-
/**
|
|
187
|
-
* Requests to display PIN on the device
|
|
188
|
-
* @param {object} device
|
|
189
|
-
* @param {object} options
|
|
190
|
-
* @param {object} options.data
|
|
191
|
-
* @returns {Promise<deviceInfo>}
|
|
186
|
+
/**
|
|
187
|
+
* Requests to display PIN on the device
|
|
188
|
+
* @param {object} device
|
|
189
|
+
* @param {object} options
|
|
190
|
+
* @param {object} options.data
|
|
191
|
+
* @returns {Promise<deviceInfo>}
|
|
192
192
|
*/
|
|
193
193
|
requestPin: function requestPin(device) {
|
|
194
194
|
var _this7 = this;
|
|
@@ -228,13 +228,13 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
228
228
|
return _promise.default.reject(err);
|
|
229
229
|
});
|
|
230
230
|
},
|
|
231
|
-
/**
|
|
232
|
-
* pairs the device with the user (manual pairing), also adds it to
|
|
233
|
-
* user's recents list for subsequent fetches.
|
|
234
|
-
* similar to space.join()
|
|
235
|
-
* @param {object} options
|
|
236
|
-
* @param {number} options.pin
|
|
237
|
-
* @returns {Promise<deviceInfo>}
|
|
231
|
+
/**
|
|
232
|
+
* pairs the device with the user (manual pairing), also adds it to
|
|
233
|
+
* user's recents list for subsequent fetches.
|
|
234
|
+
* similar to space.join()
|
|
235
|
+
* @param {object} options
|
|
236
|
+
* @param {number} options.pin
|
|
237
|
+
* @returns {Promise<deviceInfo>}
|
|
238
238
|
*/
|
|
239
239
|
pair: function pair() {
|
|
240
240
|
var _this8 = this;
|
|
@@ -261,14 +261,14 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
261
261
|
this.logger.error('DeviceManager#pair: no device to pair');
|
|
262
262
|
return _promise.default.reject(new Error('DeviceManager#pair: no device to pair'));
|
|
263
263
|
},
|
|
264
|
-
/**
|
|
265
|
-
* unpairs the device with the user (manual/ultrasonic pairing), but still
|
|
266
|
-
* keeps in the recents list/does not remove from Redis
|
|
267
|
-
* options.removeAllDevices will remove all associated devices to user
|
|
268
|
-
* similar to space.leave()
|
|
269
|
-
* @param {object} options
|
|
270
|
-
* @param {boolean} options.removeAllDevices
|
|
271
|
-
* @returns {Promise<deviceInfo>}
|
|
264
|
+
/**
|
|
265
|
+
* unpairs the device with the user (manual/ultrasonic pairing), but still
|
|
266
|
+
* keeps in the recents list/does not remove from Redis
|
|
267
|
+
* options.removeAllDevices will remove all associated devices to user
|
|
268
|
+
* similar to space.leave()
|
|
269
|
+
* @param {object} options
|
|
270
|
+
* @param {boolean} options.removeAllDevices
|
|
271
|
+
* @returns {Promise<deviceInfo>}
|
|
272
272
|
*/
|
|
273
273
|
unpair: function unpair() {
|
|
274
274
|
var _this9 = this;
|
|
@@ -285,13 +285,13 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
285
285
|
return _promise.default.reject(err);
|
|
286
286
|
});
|
|
287
287
|
},
|
|
288
|
-
/**
|
|
289
|
-
* binds the space to the paired device (if supported)
|
|
290
|
-
* similar to space.bindConversation()
|
|
291
|
-
* @param {object} options
|
|
292
|
-
* @param {boolean} options.url, conversation url
|
|
293
|
-
* @param {boolean} options.kmsResourceObjectUrl of the convo
|
|
294
|
-
* @returns {Promise<deviceInfo>}
|
|
288
|
+
/**
|
|
289
|
+
* binds the space to the paired device (if supported)
|
|
290
|
+
* similar to space.bindConversation()
|
|
291
|
+
* @param {object} options
|
|
292
|
+
* @param {boolean} options.url, conversation url
|
|
293
|
+
* @param {boolean} options.kmsResourceObjectUrl of the convo
|
|
294
|
+
* @returns {Promise<deviceInfo>}
|
|
295
295
|
*/
|
|
296
296
|
bindSpace: function bindSpace() {
|
|
297
297
|
var _this10 = this;
|
|
@@ -321,10 +321,10 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
321
321
|
return _promise.default.reject(err);
|
|
322
322
|
});
|
|
323
323
|
},
|
|
324
|
-
/**
|
|
325
|
-
* unbinds the space to the paired device (if supported)
|
|
326
|
-
* similar to space.unbindConversation()
|
|
327
|
-
* @returns {Promise<deviceInfo>}
|
|
324
|
+
/**
|
|
325
|
+
* unbinds the space to the paired device (if supported)
|
|
326
|
+
* similar to space.unbindConversation()
|
|
327
|
+
* @returns {Promise<deviceInfo>}
|
|
328
328
|
*/
|
|
329
329
|
unbindSpace: function unbindSpace() {
|
|
330
330
|
var _this11 = this;
|
|
@@ -344,10 +344,10 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
344
344
|
return _promise.default.reject(err);
|
|
345
345
|
});
|
|
346
346
|
},
|
|
347
|
-
/**
|
|
348
|
-
* Gets the audio state of the paired device
|
|
349
|
-
* similar to device.getAudioState()
|
|
350
|
-
* @returns {Promise<audioState>}
|
|
347
|
+
/**
|
|
348
|
+
* Gets the audio state of the paired device
|
|
349
|
+
* similar to device.getAudioState()
|
|
350
|
+
* @returns {Promise<audioState>}
|
|
351
351
|
*/
|
|
352
352
|
getAudioState: function getAudioState() {
|
|
353
353
|
if (!this._pairedDevice) {
|
|
@@ -356,22 +356,22 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
356
356
|
}
|
|
357
357
|
return this.webex.internal.lyra.device.getAudioState(this._pairedDevice);
|
|
358
358
|
},
|
|
359
|
-
/**
|
|
360
|
-
* Updates audio state of the paired device, should be called every 10 minutes
|
|
361
|
-
* or when mic or volume state is changed
|
|
362
|
-
* similar to device.putAudioState()
|
|
363
|
-
* @param {object} space
|
|
364
|
-
* @param {object} audioState
|
|
365
|
-
* @returns {Promise<audioState>}
|
|
359
|
+
/**
|
|
360
|
+
* Updates audio state of the paired device, should be called every 10 minutes
|
|
361
|
+
* or when mic or volume state is changed
|
|
362
|
+
* similar to device.putAudioState()
|
|
363
|
+
* @param {object} space
|
|
364
|
+
* @param {object} audioState
|
|
365
|
+
* @returns {Promise<audioState>}
|
|
366
366
|
*/
|
|
367
367
|
putAudioState: function putAudioState(space) {
|
|
368
368
|
var audioState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
369
369
|
return this.webex.internal.lyra.device.putAudioState(space, audioState);
|
|
370
370
|
},
|
|
371
|
-
/**
|
|
372
|
-
* Mutes paired device
|
|
373
|
-
* similar to device.mute()
|
|
374
|
-
* @returns {Promise<audioState>}
|
|
371
|
+
/**
|
|
372
|
+
* Mutes paired device
|
|
373
|
+
* similar to device.mute()
|
|
374
|
+
* @returns {Promise<audioState>}
|
|
375
375
|
*/
|
|
376
376
|
mute: function mute() {
|
|
377
377
|
if (!this._pairedDevice) {
|
|
@@ -380,10 +380,10 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
380
380
|
}
|
|
381
381
|
return this.webex.internal.lyra.device.mute(this._pairedDevice);
|
|
382
382
|
},
|
|
383
|
-
/**
|
|
384
|
-
* Unmutes paired device
|
|
385
|
-
* similar to device.unmute()
|
|
386
|
-
* @returns {Promise<audioState>}
|
|
383
|
+
/**
|
|
384
|
+
* Unmutes paired device
|
|
385
|
+
* similar to device.unmute()
|
|
386
|
+
* @returns {Promise<audioState>}
|
|
387
387
|
*/
|
|
388
388
|
unmute: function unmute() {
|
|
389
389
|
if (!this._pairedDevice) {
|
|
@@ -392,10 +392,10 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
392
392
|
}
|
|
393
393
|
return this.webex.internal.lyra.device.unmute(this._pairedDevice);
|
|
394
394
|
},
|
|
395
|
-
/**
|
|
396
|
-
* Increases paired device's volume
|
|
397
|
-
* similar to device.increaseVolume()
|
|
398
|
-
* @returns {Promise<audioState>}
|
|
395
|
+
/**
|
|
396
|
+
* Increases paired device's volume
|
|
397
|
+
* similar to device.increaseVolume()
|
|
398
|
+
* @returns {Promise<audioState>}
|
|
399
399
|
*/
|
|
400
400
|
increaseVolume: function increaseVolume() {
|
|
401
401
|
if (!this._pairedDevice) {
|
|
@@ -404,10 +404,10 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
404
404
|
}
|
|
405
405
|
return this.webex.internal.lyra.device.increaseVolume(this._pairedDevice);
|
|
406
406
|
},
|
|
407
|
-
/**
|
|
408
|
-
* Decreases paired device's volume
|
|
409
|
-
* similar to device.decreaseVolume()
|
|
410
|
-
* @returns {Promise<audioState>}
|
|
407
|
+
/**
|
|
408
|
+
* Decreases paired device's volume
|
|
409
|
+
* similar to device.decreaseVolume()
|
|
410
|
+
* @returns {Promise<audioState>}
|
|
411
411
|
*/
|
|
412
412
|
decreaseVolume: function decreaseVolume() {
|
|
413
413
|
if (!this._pairedDevice) {
|
|
@@ -416,11 +416,11 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
416
416
|
}
|
|
417
417
|
return this.webex.internal.lyra.device.decreaseVolume(this._pairedDevice);
|
|
418
418
|
},
|
|
419
|
-
/**
|
|
420
|
-
* Sets paired device's volume but should use increase and decrease api instead
|
|
421
|
-
* similar to device.setVolume()
|
|
422
|
-
* @param {number} level
|
|
423
|
-
* @returns {Promise<audioState>}
|
|
419
|
+
/**
|
|
420
|
+
* Sets paired device's volume but should use increase and decrease api instead
|
|
421
|
+
* similar to device.setVolume()
|
|
422
|
+
* @param {number} level
|
|
423
|
+
* @returns {Promise<audioState>}
|
|
424
424
|
*/
|
|
425
425
|
setVolume: function setVolume() {
|
|
426
426
|
var level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
@@ -430,10 +430,10 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
430
430
|
}
|
|
431
431
|
return this.webex.internal.lyra.device.setVolume(this._pairedDevice, level);
|
|
432
432
|
},
|
|
433
|
-
/**
|
|
434
|
-
* Utility function to update decrypted device name on device object
|
|
435
|
-
* @param {Array} deviceArray
|
|
436
|
-
* @returns {device}
|
|
433
|
+
/**
|
|
434
|
+
* Utility function to update decrypted device name on device object
|
|
435
|
+
* @param {Array} deviceArray
|
|
436
|
+
* @returns {device}
|
|
437
437
|
*/
|
|
438
438
|
_updateDeviceMetadata: function _updateDeviceMetadata() {
|
|
439
439
|
var _this12 = this;
|
|
@@ -456,10 +456,10 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
456
456
|
return _promise.default.resolve(devices);
|
|
457
457
|
});
|
|
458
458
|
},
|
|
459
|
-
/**
|
|
460
|
-
* Utility function to update decrypted device name on device object
|
|
461
|
-
* @param {object} inDevice
|
|
462
|
-
* @returns {device}
|
|
459
|
+
/**
|
|
460
|
+
* Utility function to update decrypted device name on device object
|
|
461
|
+
* @param {object} inDevice
|
|
462
|
+
* @returns {device}
|
|
463
463
|
*/
|
|
464
464
|
_decryptDeviceName: function _decryptDeviceName() {
|
|
465
465
|
var _this13 = this;
|
|
@@ -479,10 +479,10 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
479
479
|
}
|
|
480
480
|
return _promise.default.resolve(device);
|
|
481
481
|
},
|
|
482
|
-
/**
|
|
483
|
-
* Utility function to update device info on mercury updates
|
|
484
|
-
* @param {object} device
|
|
485
|
-
* @returns {device}
|
|
482
|
+
/**
|
|
483
|
+
* Utility function to update device info on mercury updates
|
|
484
|
+
* @param {object} device
|
|
485
|
+
* @returns {device}
|
|
486
486
|
*/
|
|
487
487
|
_receiveDeviceUpdates: function _receiveDeviceUpdates(device) {
|
|
488
488
|
var _this14 = this;
|
|
@@ -520,7 +520,7 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
520
520
|
}
|
|
521
521
|
return _promise.default.resolve();
|
|
522
522
|
},
|
|
523
|
-
version: "2.59.
|
|
523
|
+
version: "2.59.0"
|
|
524
524
|
});
|
|
525
525
|
var _default = DeviceManager;
|
|
526
526
|
exports.default = _default;
|