@webex/plugin-device-manager 3.0.0-beta.14 → 3.0.0-beta.15
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/collection.js.map +1 -1
- package/dist/device-manager.js +107 -105
- package/dist/device-manager.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/sample/app.js +159 -150
- package/src/collection.js +3 -5
- package/src/device-manager.js +267 -224
- package/src/index.js +1 -1
- package/webex.js +5 -5
package/dist/collection.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DeviceCollection","devices","get","deviceId","set","device","id","identity","existingDevice","reset","getAll"],"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 }
|
|
1
|
+
{"version":3,"names":["DeviceCollection","devices","get","deviceId","set","device","id","identity","existingDevice","reset","getAll"],"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,EADc;EAGvBC,GAHuB,eAGnBC,QAHmB,EAGT;IACZ,OAAO,KAAKF,OAAL,CAAaE,QAAb,CAAP;EACD,CALsB;EAOvBC,GAPuB,eAOnBC,MAPmB,EAOX;IACV,IAAMF,QAAQ,GAAGE,MAAM,CAACC,EAAP,IAAcD,MAAM,CAACE,QAAP,IAAmBF,MAAM,CAACE,QAAP,CAAgBD,EAAlE,CADU,CAEV;;IACA,IAAME,cAAc,GAAG,KAAKP,OAAL,CAAaE,QAAb,CAAvB;;IAEA,IAAIK,cAAJ,EAAoB;MAClB;MACA,qBAAMA,cAAN,EAAsBH,MAAtB;IACD,CAHD,MAGO;MACL,KAAKJ,OAAL,CAAaE,QAAb,IAAyBE,MAAzB;IACD;EACF,CAlBsB;EAoBvBI,KApBuB,mBAoBf;IACN,KAAKR,OAAL,GAAe,EAAf;EACD,CAtBsB;EAwBvBS,MAxBuB,oBAwBd;IACP,OAAO,qBAAc,KAAKT,OAAnB,CAAP;EACD;AA1BsB,CAAzB;eA6BeD,gB"}
|
package/dist/device-manager.js
CHANGED
|
@@ -43,19 +43,19 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
43
43
|
},
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
* Gets a list of all recent devices associated with the user
|
|
47
|
+
* the device list gets populated from Redis
|
|
48
|
+
* @returns {Promise<Device>}
|
|
49
|
+
*/
|
|
50
50
|
getAll: function getAll() {
|
|
51
51
|
return _collection.default.getAll();
|
|
52
52
|
},
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
* Gets a list of all recent devices associated with the user
|
|
56
|
+
* the device list gets populated from Redis
|
|
57
|
+
* @returns {Promise<Device>}
|
|
58
|
+
*/
|
|
59
59
|
refresh: function refresh() {
|
|
60
60
|
var _this2 = this;
|
|
61
61
|
|
|
@@ -91,11 +91,11 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
91
91
|
},
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
* Search for a device by name
|
|
95
|
+
* @param {Object} options
|
|
96
|
+
* @param {string} options.searchQuery
|
|
97
|
+
* @returns {Promise<Device>}
|
|
98
|
+
*/
|
|
99
99
|
search: function search(options) {
|
|
100
100
|
var _this3 = this;
|
|
101
101
|
|
|
@@ -119,11 +119,11 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
119
119
|
},
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
* Caches the device info and also registers to Redis for subsequent fetches
|
|
123
|
+
* @param {Object} device
|
|
124
|
+
* @param {string} device.id
|
|
125
|
+
* @returns {deviceInfo}
|
|
126
|
+
*/
|
|
127
127
|
upsert: function upsert(device) {
|
|
128
128
|
var _this4 = this;
|
|
129
129
|
|
|
@@ -153,7 +153,8 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
153
153
|
}).then(function (res) {
|
|
154
154
|
var auxDevice = res.body;
|
|
155
155
|
return _this4._decryptDeviceName(auxDevice);
|
|
156
|
-
})
|
|
156
|
+
}) // eslint-disable-next-line no-shadow
|
|
157
|
+
.then(function (device) {
|
|
157
158
|
_collection.default.set(device);
|
|
158
159
|
|
|
159
160
|
return _promise.default.resolve(_collection.default.get(deviceId));
|
|
@@ -165,10 +166,10 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
165
166
|
},
|
|
166
167
|
|
|
167
168
|
/**
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
* Retreives device info of a particular device
|
|
170
|
+
* @param {string} token
|
|
171
|
+
* @returns {Promise<deviceInfo>}
|
|
172
|
+
*/
|
|
172
173
|
get: function get(token) {
|
|
173
174
|
var _this5 = this;
|
|
174
175
|
|
|
@@ -199,11 +200,11 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
199
200
|
},
|
|
200
201
|
|
|
201
202
|
/**
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
203
|
+
* Unregisters the device from Redis, will not fetch in subsequent loads,
|
|
204
|
+
* similar to space.deleteBinding()
|
|
205
|
+
* @param {string} deviceId
|
|
206
|
+
* @returns {Promise<deviceInfo>}
|
|
207
|
+
*/
|
|
207
208
|
remove: function remove(deviceId) {
|
|
208
209
|
var _this6 = this;
|
|
209
210
|
|
|
@@ -224,12 +225,12 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
224
225
|
},
|
|
225
226
|
|
|
226
227
|
/**
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
228
|
+
* Requests to display PIN on the device
|
|
229
|
+
* @param {object} device
|
|
230
|
+
* @param {object} options
|
|
231
|
+
* @param {object} options.data
|
|
232
|
+
* @returns {Promise<deviceInfo>}
|
|
233
|
+
*/
|
|
233
234
|
requestPin: function requestPin(device) {
|
|
234
235
|
var _this7 = this;
|
|
235
236
|
|
|
@@ -276,13 +277,13 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
276
277
|
},
|
|
277
278
|
|
|
278
279
|
/**
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
280
|
+
* pairs the device with the user (manual pairing), also adds it to
|
|
281
|
+
* user's recents list for subsequent fetches.
|
|
282
|
+
* similar to space.join()
|
|
283
|
+
* @param {object} options
|
|
284
|
+
* @param {number} options.pin
|
|
285
|
+
* @returns {Promise<deviceInfo>}
|
|
286
|
+
*/
|
|
286
287
|
pair: function pair() {
|
|
287
288
|
var _this8 = this;
|
|
288
289
|
|
|
@@ -315,14 +316,14 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
315
316
|
},
|
|
316
317
|
|
|
317
318
|
/**
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
319
|
+
* unpairs the device with the user (manual/ultrasonic pairing), but still
|
|
320
|
+
* keeps in the recents list/does not remove from Redis
|
|
321
|
+
* options.removeAllDevices will remove all associated devices to user
|
|
322
|
+
* similar to space.leave()
|
|
323
|
+
* @param {object} options
|
|
324
|
+
* @param {boolean} options.removeAllDevices
|
|
325
|
+
* @returns {Promise<deviceInfo>}
|
|
326
|
+
*/
|
|
326
327
|
unpair: function unpair() {
|
|
327
328
|
var _this9 = this;
|
|
328
329
|
|
|
@@ -344,13 +345,13 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
344
345
|
},
|
|
345
346
|
|
|
346
347
|
/**
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
348
|
+
* binds the space to the paired device (if supported)
|
|
349
|
+
* similar to space.bindConversation()
|
|
350
|
+
* @param {object} options
|
|
351
|
+
* @param {boolean} options.url, conversation url
|
|
352
|
+
* @param {boolean} options.kmsResourceObjectUrl of the convo
|
|
353
|
+
* @returns {Promise<deviceInfo>}
|
|
354
|
+
*/
|
|
354
355
|
bindSpace: function bindSpace() {
|
|
355
356
|
var _this10 = this;
|
|
356
357
|
|
|
@@ -387,10 +388,10 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
387
388
|
},
|
|
388
389
|
|
|
389
390
|
/**
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
391
|
+
* unbinds the space to the paired device (if supported)
|
|
392
|
+
* similar to space.unbindConversation()
|
|
393
|
+
* @returns {Promise<deviceInfo>}
|
|
394
|
+
*/
|
|
394
395
|
unbindSpace: function unbindSpace() {
|
|
395
396
|
var _this11 = this;
|
|
396
397
|
|
|
@@ -414,10 +415,10 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
414
415
|
},
|
|
415
416
|
|
|
416
417
|
/**
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
418
|
+
* Gets the audio state of the paired device
|
|
419
|
+
* similar to device.getAudioState()
|
|
420
|
+
* @returns {Promise<audioState>}
|
|
421
|
+
*/
|
|
421
422
|
getAudioState: function getAudioState() {
|
|
422
423
|
if (!this._pairedDevice) {
|
|
423
424
|
this.logger.error('DeviceManager#getAudioState: Currently no device is paired');
|
|
@@ -428,23 +429,23 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
428
429
|
},
|
|
429
430
|
|
|
430
431
|
/**
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
432
|
+
* Updates audio state of the paired device, should be called every 10 minutes
|
|
433
|
+
* or when mic or volume state is changed
|
|
434
|
+
* similar to device.putAudioState()
|
|
435
|
+
* @param {object} space
|
|
436
|
+
* @param {object} audioState
|
|
437
|
+
* @returns {Promise<audioState>}
|
|
438
|
+
*/
|
|
438
439
|
putAudioState: function putAudioState(space) {
|
|
439
440
|
var audioState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
440
441
|
return this.webex.internal.lyra.device.putAudioState(space, audioState);
|
|
441
442
|
},
|
|
442
443
|
|
|
443
444
|
/**
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
445
|
+
* Mutes paired device
|
|
446
|
+
* similar to device.mute()
|
|
447
|
+
* @returns {Promise<audioState>}
|
|
448
|
+
*/
|
|
448
449
|
mute: function mute() {
|
|
449
450
|
if (!this._pairedDevice) {
|
|
450
451
|
this.logger.error('DeviceManager#mute: Currently no device is paired');
|
|
@@ -455,10 +456,10 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
455
456
|
},
|
|
456
457
|
|
|
457
458
|
/**
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
459
|
+
* Unmutes paired device
|
|
460
|
+
* similar to device.unmute()
|
|
461
|
+
* @returns {Promise<audioState>}
|
|
462
|
+
*/
|
|
462
463
|
unmute: function unmute() {
|
|
463
464
|
if (!this._pairedDevice) {
|
|
464
465
|
this.logger.error('DeviceManager#unmute: Currently no device is paired');
|
|
@@ -469,10 +470,10 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
469
470
|
},
|
|
470
471
|
|
|
471
472
|
/**
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
473
|
+
* Increases paired device's volume
|
|
474
|
+
* similar to device.increaseVolume()
|
|
475
|
+
* @returns {Promise<audioState>}
|
|
476
|
+
*/
|
|
476
477
|
increaseVolume: function increaseVolume() {
|
|
477
478
|
if (!this._pairedDevice) {
|
|
478
479
|
this.logger.error('DeviceManager#increaseVolume: Currently no device is paired');
|
|
@@ -483,10 +484,10 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
483
484
|
},
|
|
484
485
|
|
|
485
486
|
/**
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
487
|
+
* Decreases paired device's volume
|
|
488
|
+
* similar to device.decreaseVolume()
|
|
489
|
+
* @returns {Promise<audioState>}
|
|
490
|
+
*/
|
|
490
491
|
decreaseVolume: function decreaseVolume() {
|
|
491
492
|
if (!this._pairedDevice) {
|
|
492
493
|
this.logger.error('DeviceManager#decreaseVolume: Currently no device is paired');
|
|
@@ -497,11 +498,11 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
497
498
|
},
|
|
498
499
|
|
|
499
500
|
/**
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
501
|
+
* Sets paired device's volume but should use increase and decrease api instead
|
|
502
|
+
* similar to device.setVolume()
|
|
503
|
+
* @param {number} level
|
|
504
|
+
* @returns {Promise<audioState>}
|
|
505
|
+
*/
|
|
505
506
|
setVolume: function setVolume() {
|
|
506
507
|
var level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
507
508
|
|
|
@@ -514,10 +515,10 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
514
515
|
},
|
|
515
516
|
|
|
516
517
|
/**
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
518
|
+
* Utility function to update decrypted device name on device object
|
|
519
|
+
* @param {Array} deviceArray
|
|
520
|
+
* @returns {device}
|
|
521
|
+
*/
|
|
521
522
|
_updateDeviceMetadata: function _updateDeviceMetadata() {
|
|
522
523
|
var _this12 = this;
|
|
523
524
|
|
|
@@ -545,10 +546,10 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
545
546
|
},
|
|
546
547
|
|
|
547
548
|
/**
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
549
|
+
* Utility function to update decrypted device name on device object
|
|
550
|
+
* @param {object} inDevice
|
|
551
|
+
* @returns {device}
|
|
552
|
+
*/
|
|
552
553
|
_decryptDeviceName: function _decryptDeviceName() {
|
|
553
554
|
var _this13 = this;
|
|
554
555
|
|
|
@@ -573,10 +574,10 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
573
574
|
},
|
|
574
575
|
|
|
575
576
|
/**
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
577
|
+
* Utility function to update device info on mercury updates
|
|
578
|
+
* @param {object} device
|
|
579
|
+
* @returns {device}
|
|
580
|
+
*/
|
|
580
581
|
_receiveDeviceUpdates: function _receiveDeviceUpdates(device) {
|
|
581
582
|
var _this14 = this;
|
|
582
583
|
|
|
@@ -590,6 +591,7 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
590
591
|
return this.webex.internal.lyra.space.get({
|
|
591
592
|
id: deviceId
|
|
592
593
|
}).then(function (space) {
|
|
594
|
+
// eslint-disable-next-line no-shadow
|
|
593
595
|
var device = _collection.default.get(deviceId);
|
|
594
596
|
|
|
595
597
|
if (device && space.occupants && (!space.occupants.self || !space.occupants.self.verified)) {
|
|
@@ -623,7 +625,7 @@ var DeviceManager = _webexCore.WebexPlugin.extend({
|
|
|
623
625
|
|
|
624
626
|
return _promise.default.resolve();
|
|
625
627
|
},
|
|
626
|
-
version: "3.0.0-beta.
|
|
628
|
+
version: "3.0.0-beta.15"
|
|
627
629
|
});
|
|
628
630
|
|
|
629
631
|
var _default = DeviceManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DeviceManager","WebexPlugin","extend","namespace","_devicePendingPinChallenge","_pairedDevice","_boundSpace","initialize","webex","internal","mercury","on","data","_receiveDeviceUpdates","getAll","DeviceCollection","refresh","reset","request","api","resource","then","res","body","reject","_updateDeviceMetadata","items","devices","forEach","device","deviceInfo","machineType","LYRA_SPACE","lyra","space","get","catch","err","logger","error","set","search","options","searchQuery","Error","people","searchId","uuid","v4","searchType","searchEntity","includePeople","includeRooms","queryString","upsert","deviceId","id","identity","existingDevice","resolve","method","auxDevice","_decryptDeviceName","token","getAdvertisedEndpoint","advertiser","result","displayName","remove","requestPin","url","dev","occupants","pinChallenge","info","join","passType","verificationInitiation","pair","pin","unpair","leave","bindSpace","kmsResourceObjectUrl","bindConversation","unbindSpace","unbindConversation","getAudioState","putAudioState","audioState","mute","unmute","increaseVolume","decreaseVolume","setVolume","level","deviceArray","length","all","map","index","services","waitForCatalog","deviceClass","UC_CLOUD","updatedDevice","inDevice","metadata","encryptedUserAssignedName","encryptionKeyUrl","encryption","decryptText","decryptedDeviceName","undefined","userAssignedName","spaceUrl","substring","lastIndexOf","self","verified","productName","DEFAULT_PRODUCT_NAME","pairedDeviceId"],"sources":["device-manager.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nimport {cloneDeep} from 'lodash';\nimport '@webex/internal-plugin-lyra';\nimport '@webex/internal-plugin-search';\nimport {WebexPlugin} from '@webex/webex-core';\nimport uuid from 'uuid';\n\nimport {LYRA_SPACE, UC_CLOUD, DEFAULT_PRODUCT_NAME} from './constants';\nimport DeviceCollection from './collection';\n\nconst DeviceManager = WebexPlugin.extend({\n namespace: 'DeviceManager',\n _devicePendingPinChallenge: null,\n _pairedDevice: null,\n _boundSpace: null,\n\n initialize() {\n // Lyra mercury events listener\n this.webex.internal.mercury.on('event:lyra.space_updated', ({data}) => {\n this._receiveDeviceUpdates(data);\n });\n },\n\n /**\n * Gets a list of all recent devices associated with the user\n * the device list gets populated from Redis\n * @returns {Promise<Device>}\n */\n getAll() {\n return DeviceCollection.getAll();\n },\n\n /**\n * Gets a list of all recent devices associated with the user\n * the device list gets populated from Redis\n * @returns {Promise<Device>}\n */\n refresh() {\n DeviceCollection.reset();\n\n return this.webex.request({\n api: 'wdm',\n resource: 'devices/auxiliary'\n })\n .then((res) => {\n if (!res.body) {\n return Promise.reject();\n }\n\n return this._updateDeviceMetadata(res.body.items)\n .then((devices) => {\n /* eslint-disable consistent-return */\n devices.forEach((device) => {\n if (device.deviceInfo &&\n device.deviceInfo.machineType === LYRA_SPACE) {\n return this.webex.internal.lyra.space.get(device.deviceInfo)\n .catch((err) => {\n this.logger.error('DeviceManager#refresh: failed to receive device info', err);\n });\n }\n });\n /* eslint-enable consistent-return */\n res.body.items.forEach((device) => {\n DeviceCollection.set(device);\n });\n\n return this.getAll();\n });\n })\n .catch((err) => {\n this.logger.error('DeviceManager#refresh: failed to fetch recent devices', err);\n });\n },\n\n /**\n * Search for a device by name\n * @param {Object} options\n * @param {string} options.searchQuery\n * @returns {Promise<Device>}\n */\n search(options) {\n if (!options || !options.searchQuery) {\n this.logger.error('DeviceManager#search: options.searchQuery is required');\n\n return Promise.reject(new Error('DeviceManager#search: options.searchQuery is required'));\n }\n\n return this.webex.internal.search.people({\n searchId: uuid.v4(),\n searchType: 'DEVICE_SEARCH',\n searchEntity: 'device',\n includePeople: false,\n includeRooms: true,\n queryString: options.searchQuery\n })\n .catch((err) => {\n this.logger.error('DeviceManager#search: failed to search a device', err);\n\n throw err;\n });\n },\n\n /**\n * Caches the device info and also registers to Redis for subsequent fetches\n * @param {Object} device\n * @param {string} device.id\n * @returns {deviceInfo}\n */\n upsert(device) {\n const deviceId = device.id || device.identity && device.identity.id;\n\n if (!deviceId) {\n this.logger.error('DeviceManager#upsert: device.id is required');\n\n return Promise.reject(new Error('DeviceManager#upsert: device.id is required'));\n }\n this._pairedDevice = this._devicePendingPinChallenge;\n this._devicePendingPinChallenge = null;\n // check if the device is already existing, if so then merge else add\n const existingDevice = DeviceCollection.get(deviceId);\n\n if (existingDevice) {\n DeviceCollection.set(device);\n\n return Promise.resolve(DeviceCollection.get(deviceId));\n }\n\n // new device requested, add to wdm for subsequent retreivals\n return this.webex.request({\n api: 'wdm',\n method: 'PUT',\n resource: `devices/auxiliary/Room/${deviceId}`\n })\n .then((res) => {\n const auxDevice = res.body;\n\n return this._decryptDeviceName(auxDevice);\n })\n .then((device) => {\n DeviceCollection.set(device);\n\n return Promise.resolve(DeviceCollection.get(deviceId));\n })\n .catch((err) => {\n this.logger.error('DeviceManager#upsert: failed to add/update a device', err);\n\n return Promise.reject(err);\n });\n },\n\n /**\n * Retreives device info of a particular device\n * @param {string} token\n * @returns {Promise<deviceInfo>}\n */\n get(token) {\n if (!token) {\n this.logger.error('DeviceManager#get: token is required');\n\n return Promise.reject(new Error('DeviceManager#get: token is required'));\n }\n let deviceInfo;\n\n return this.webex.internal.lyra.getAdvertisedEndpoint(token)\n .then((res) => {\n deviceInfo = res;\n\n return this.webex.internal.lyra.space.get({id: res.advertiser.id});\n })\n .then((result) => {\n // the deviceInfo doesn't have proper displayName, hence update\n // displayName on deviceInfo for search to work\n if (result && result.identity && result.identity.displayName) {\n deviceInfo.advertiser.displayName = result.identity.displayName;\n }\n\n return deviceInfo;\n })\n .catch((err) => {\n this.logger.error('DeviceManager#get: failed to get device info', err);\n\n return Promise.reject(err);\n });\n },\n\n /**\n * Unregisters the device from Redis, will not fetch in subsequent loads,\n * similar to space.deleteBinding()\n * @param {string} deviceId\n * @returns {Promise<deviceInfo>}\n */\n remove(deviceId) {\n if (!deviceId) {\n this.logger.error('DeviceManager#remove: deviceId is required');\n\n return Promise.reject(new Error('DeviceManager#remove: deviceId is required'));\n }\n\n return this.webex.request({\n method: 'delete',\n api: 'wdm',\n resource: `devices/auxiliary/${deviceId}`\n })\n .catch((error) => {\n this.logger.error('DeviceManager#remove: failed to remove the device', error);\n\n return Promise.reject(error);\n });\n },\n\n /**\n * Requests to display PIN on the device\n * @param {object} device\n * @param {object} options\n * @param {object} options.data\n * @returns {Promise<deviceInfo>}\n */\n requestPin(device, options = {}) {\n const deviceId = device.id || device.identity && device.identity.id;\n\n if (!deviceId) {\n this.logger.error('DeviceManager#requestPin: device.id is required');\n\n return Promise.reject(new Error('DeviceManager#requestPin: device.id is required'));\n }\n const space = {id: deviceId, url: `/spaces/${deviceId}`};\n\n return this.webex.internal.lyra.space.get(space)\n .then((dev) => { // check if the space is pinChallenge capable\n if (dev && dev.occupants && dev.occupants.pinChallenge) {\n this.logger.info('DeviceManager#requestPin: space is PIN challenge capable');\n\n return this.webex.internal.lyra.space.join(space, {\n passType: 'MANUAL',\n verificationInitiation: 'PIN',\n data: options.data\n })\n .then(() => {\n this._devicePendingPinChallenge = dev;\n\n // return the actual device so that it can be upserted on successful\n // PIN exchange\n return dev;\n });\n }\n // pairs with the space if it's not PIN challenge capable\n this.logger.info('DeviceManager#requestPin: space is not PIN challenge capable, probably already occupied, will still return device info');\n\n return this.webex.internal.lyra.space.get(space)\n .then(() => Promise.resolve(dev));\n })\n .catch((err) => {\n this.logger.error('DeviceManager#requestPin: device failed PIN challenge request', err);\n\n return Promise.reject(err);\n });\n },\n\n /**\n * pairs the device with the user (manual pairing), also adds it to\n * user's recents list for subsequent fetches.\n * similar to space.join()\n * @param {object} options\n * @param {number} options.pin\n * @returns {Promise<deviceInfo>}\n */\n pair(options = {}) {\n if (!options.pin) {\n this.logger.error('DeviceManager#pair: options.pin is required');\n\n return Promise.reject(new Error('DeviceManager#pair: options.pin is required'));\n }\n if (this._devicePendingPinChallenge) {\n const space = {id: this._devicePendingPinChallenge.identity.id, url: `/spaces/${this._devicePendingPinChallenge.identity.id}`};\n\n return this.webex.internal.lyra.space.join(space, {\n passType: 'PIN_ANSWER',\n data: options.pin\n })\n .catch((err) => {\n this.logger.error('DeviceManager#pair: incorrect PIN, unable to pair ', err);\n\n return Promise.reject(err);\n })\n .then(() => this.upsert(this._devicePendingPinChallenge));\n }\n this.logger.error('DeviceManager#pair: no device to pair');\n\n return Promise.reject(new Error('DeviceManager#pair: no device to pair'));\n },\n\n /**\n * unpairs the device with the user (manual/ultrasonic pairing), but still\n * keeps in the recents list/does not remove from Redis\n * options.removeAllDevices will remove all associated devices to user\n * similar to space.leave()\n * @param {object} options\n * @param {boolean} options.removeAllDevices\n * @returns {Promise<deviceInfo>}\n */\n unpair(options = {}) {\n if (!this._pairedDevice) {\n this.logger.error('DeviceManager#unpair: no device to unpair');\n\n return Promise.reject(new Error('DeviceManager#unpair: no device to unpair'));\n }\n const space = {url: `/spaces/${this._pairedDevice.identity.id}`};\n\n return this.webex.internal.lyra.space.leave(space, options)\n .catch((err) => {\n this.logger.error('DeviceManager#unpair: failed to remove device from Lyra', err);\n\n return Promise.reject(err);\n });\n },\n\n /**\n * binds the space to the paired device (if supported)\n * similar to space.bindConversation()\n * @param {object} options\n * @param {boolean} options.url, conversation url\n * @param {boolean} options.kmsResourceObjectUrl of the convo\n * @returns {Promise<deviceInfo>}\n */\n bindSpace(options = {}) {\n if (!options.url) {\n this.logger.error('DeviceManager#pair: options.url is required');\n\n return Promise.reject(new Error('DeviceManager#bindSpace: options.url is required'));\n }\n if (!options.kmsResourceObjectUrl) {\n this.logger.error('DeviceManager#bindSpace: options.kmsResourceObjectUrl is required');\n\n return Promise.reject(new Error('DeviceManager#bindSpace: options.kmsResourceObjectUrl is required'));\n }\n if (!this._pairedDevice) {\n this.logger.error('DeviceManager#bindSpace: No device paired currently');\n\n return Promise.reject(new Error('DeviceManager#bindSpace: No device paired currently'));\n }\n const space = {url: `/spaces/${this._pairedDevice.identity.id}`, id: this._pairedDevice.identity.id};\n\n this._boundSpace = {\n kmsResourceObjectUrl: options.kmsResourceObjectUrl,\n url: options.url\n };\n\n return this.webex.internal.lyra.space.bindConversation(space, this._boundSpace)\n .catch((err) => {\n this.logger.error('DeviceManager#bindSpace: failed to bind device to Space');\n\n return Promise.reject(err);\n });\n },\n\n /**\n * unbinds the space to the paired device (if supported)\n * similar to space.unbindConversation()\n * @returns {Promise<deviceInfo>}\n */\n unbindSpace() {\n if (!this._pairedDevice || !this._boundSpace) {\n this.logger.error('DeviceManager#unbindSpace: No space currently bound to the device');\n\n return Promise.reject(new Error('DeviceManager#unbindSpace: No space currently bound to the device'));\n }\n const space = {url: `/spaces/${this._pairedDevice.identity.id}`, id: this._pairedDevice.identity.id};\n\n return this.webex.internal.lyra.space.unbindConversation(space, this._boundSpace)\n .then((res) => {\n this._boundSpace = null;\n\n return Promise.resolve(res);\n })\n .catch((err) => {\n this.logger.error('DeviceManager#unbindSpace: failed to unbind Space to device');\n\n return Promise.reject(err);\n });\n },\n\n /**\n * Gets the audio state of the paired device\n * similar to device.getAudioState()\n * @returns {Promise<audioState>}\n */\n getAudioState() {\n if (!this._pairedDevice) {\n this.logger.error('DeviceManager#getAudioState: Currently no device is paired');\n\n return Promise.reject(new Error('DeviceManager#getAudioState: Currently no device is paired'));\n }\n\n return this.webex.internal.lyra.device.getAudioState(this._pairedDevice);\n },\n\n /**\n * Updates audio state of the paired device, should be called every 10 minutes\n * or when mic or volume state is changed\n * similar to device.putAudioState()\n * @param {object} space\n * @param {object} audioState\n * @returns {Promise<audioState>}\n */\n putAudioState(space, audioState = {}) {\n return this.webex.internal.lyra.device.putAudioState(space, audioState);\n },\n\n /**\n * Mutes paired device\n * similar to device.mute()\n * @returns {Promise<audioState>}\n */\n mute() {\n if (!this._pairedDevice) {\n this.logger.error('DeviceManager#mute: Currently no device is paired');\n\n return Promise.reject(new Error('DeviceManager#mute: Currently no device is paired'));\n }\n\n return this.webex.internal.lyra.device.mute(this._pairedDevice);\n },\n\n /**\n * Unmutes paired device\n * similar to device.unmute()\n * @returns {Promise<audioState>}\n */\n unmute() {\n if (!this._pairedDevice) {\n this.logger.error('DeviceManager#unmute: Currently no device is paired');\n\n return Promise.reject(new Error('DeviceManager#unmute: Currently no device is paired'));\n }\n\n return this.webex.internal.lyra.device.unmute(this._pairedDevice);\n },\n\n /**\n * Increases paired device's volume\n * similar to device.increaseVolume()\n * @returns {Promise<audioState>}\n */\n increaseVolume() {\n if (!this._pairedDevice) {\n this.logger.error('DeviceManager#increaseVolume: Currently no device is paired');\n\n return Promise.reject(new Error('DeviceManager#increaseVolume: Currently no device is paired'));\n }\n\n return this.webex.internal.lyra.device.increaseVolume(this._pairedDevice);\n },\n\n /**\n * Decreases paired device's volume\n * similar to device.decreaseVolume()\n * @returns {Promise<audioState>}\n */\n decreaseVolume() {\n if (!this._pairedDevice) {\n this.logger.error('DeviceManager#decreaseVolume: Currently no device is paired');\n\n return Promise.reject(new Error('DeviceManager#decreaseVolume: Currently no device is paired'));\n }\n\n return this.webex.internal.lyra.device.decreaseVolume(this._pairedDevice);\n },\n\n /**\n * Sets paired device's volume but should use increase and decrease api instead\n * similar to device.setVolume()\n * @param {number} level\n * @returns {Promise<audioState>}\n */\n setVolume(level = 0) {\n if (!this._pairedDevice) {\n this.logger.error('DeviceManager#setVolume: Currently no device is paired');\n\n return Promise.reject(new Error('DeviceManager#setVolume: Currently no device is paired'));\n }\n\n return this.webex.internal.lyra.device.setVolume(this._pairedDevice, level);\n },\n\n /**\n * Utility function to update decrypted device name on device object\n * @param {Array} deviceArray\n * @returns {device}\n */\n _updateDeviceMetadata(deviceArray = []) {\n if (!deviceArray.length) {\n return Promise.resolve(deviceArray);\n }\n const devices = cloneDeep(deviceArray);\n\n return Promise.all(devices.map(\n (device, index) => this.webex.internal.services.waitForCatalog('postauth')\n .then(() => {\n if (device.deviceClass === UC_CLOUD) {\n device.id = `${this.webex.internal.services.get('wdm')}/${device.id}`;\n }\n\n return this._decryptDeviceName(device);\n })\n .then((updatedDevice) => {\n devices[index] = updatedDevice;\n\n return Promise.resolve();\n })\n ))\n .then(() => Promise.resolve(devices));\n },\n\n /**\n * Utility function to update decrypted device name on device object\n * @param {object} inDevice\n * @returns {device}\n */\n _decryptDeviceName(inDevice = {}) {\n const device = cloneDeep(inDevice);\n\n if (device.metadata &&\n device.metadata.encryptedUserAssignedName &&\n device.metadata.encryptionKeyUrl) {\n return this.webex.internal.encryption.decryptText(\n device.metadata.encryptionKeyUrl, device.metadata.encryptedUserAssignedName\n )\n .then((decryptedDeviceName) => {\n // set userAssignedName as the decypted value, unset encryptedUserAssignedName since it's not needed\n device.metadata.encryptedUserAssignedName = undefined;\n device.metadata.userAssignedName = decryptedDeviceName;\n\n return Promise.resolve(device);\n })\n .catch((err) => {\n // unset encryptedUserAssignedName if failed to decrypt\n device.metadata.encryptedUserAssignedName = undefined;\n this.logger.error('DeviceCollection#_decryptDeviceName: failed to decrypt device name', err);\n });\n }\n\n return Promise.resolve(device);\n },\n\n /**\n * Utility function to update device info on mercury updates\n * @param {object} device\n * @returns {device}\n */\n _receiveDeviceUpdates(device) {\n // we care only the updates are for the registered devices\n if (device && device.spaceUrl) {\n const deviceId = device.spaceUrl.substring(device.spaceUrl.lastIndexOf('/') + 1);\n const existingDevice = DeviceCollection.get(deviceId);\n\n if (existingDevice) {\n return this.webex.internal.lyra.space.get({id: deviceId})\n .then((space) => {\n const device = DeviceCollection.get(deviceId);\n\n if (device &&\n space.occupants &&\n (!space.occupants.self || !space.occupants.self.verified)) {\n device.productName = space.devices && space.devices[0] && space.devices[0].productName ||\n DEFAULT_PRODUCT_NAME;\n // pin challenge is not verified reset _pairedDevice if ids\n // match\n const pairedDeviceId = this._pairedDevice && (this._pairedDevice.id || this._pairedDevice.identity.id);\n\n if (pairedDeviceId === deviceId) {\n this._pairedDevice = null;\n this.logger.info(`DeviceManager#_receiveDeviceUpdates: device ${deviceId} lost pairing`);\n\n return Promise.resolve();\n }\n // we do not want to reset the device pending PIN challenge\n if (this._devicePendingPinChallenge.identity.id !== deviceId) {\n return this.upsert(device);\n }\n\n return Promise.resolve();\n }\n\n return Promise.resolve();\n })\n .catch((err) => {\n this.logger.error('DeviceManager#_receiveDeviceUpdates: failed to receive updates for Lyra space', err);\n });\n }\n }\n\n return Promise.resolve();\n }\n\n\n});\n\nexport default DeviceManager;\n"],"mappings":";;;;;;;;;;;;;;;;AAIA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA,IAAMA,aAAa,GAAGC,sBAAA,CAAYC,MAAZ,CAAmB;EACvCC,SAAS,EAAE,eAD4B;EAEvCC,0BAA0B,EAAE,IAFW;EAGvCC,aAAa,EAAE,IAHwB;EAIvCC,WAAW,EAAE,IAJ0B;EAMvCC,UANuC,wBAM1B;IAAA;;IACX;IACA,KAAKC,KAAL,CAAWC,QAAX,CAAoBC,OAApB,CAA4BC,EAA5B,CAA+B,0BAA/B,EAA2D,gBAAY;MAAA,IAAVC,IAAU,QAAVA,IAAU;;MACrE,KAAI,CAACC,qBAAL,CAA2BD,IAA3B;IACD,CAFD;EAGD,CAXsC;;EAavC;AACF;AACA;AACA;AACA;EACEE,MAlBuC,oBAkB9B;IACP,OAAOC,mBAAA,CAAiBD,MAAjB,EAAP;EACD,CApBsC;;EAsBvC;AACF;AACA;AACA;AACA;EACEE,OA3BuC,qBA2B7B;IAAA;;IACRD,mBAAA,CAAiBE,KAAjB;;IAEA,OAAO,KAAKT,KAAL,CAAWU,OAAX,CAAmB;MACxBC,GAAG,EAAE,KADmB;MAExBC,QAAQ,EAAE;IAFc,CAAnB,EAIJC,IAJI,CAIC,UAACC,GAAD,EAAS;MACb,IAAI,CAACA,GAAG,CAACC,IAAT,EAAe;QACb,OAAO,iBAAQC,MAA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C,MAAL,CAAYC,KAAZ,CAAkB,+EAAlB,EAAmGF,GAAnG;QACD,CA/BI,CAAP;MAgCD;IACF;;IAED,OAAO,iBAAQsB,OAAR,EAAP;EACD,CAtkBsC;EAAA;AAAA,CAAnB,CAAtB;;eA2kBe3D,a"}
|
|
1
|
+
{"version":3,"names":["DeviceManager","WebexPlugin","extend","namespace","_devicePendingPinChallenge","_pairedDevice","_boundSpace","initialize","webex","internal","mercury","on","data","_receiveDeviceUpdates","getAll","DeviceCollection","refresh","reset","request","api","resource","then","res","body","reject","_updateDeviceMetadata","items","devices","forEach","device","deviceInfo","machineType","LYRA_SPACE","lyra","space","get","catch","err","logger","error","set","search","options","searchQuery","Error","people","searchId","uuid","v4","searchType","searchEntity","includePeople","includeRooms","queryString","upsert","deviceId","id","identity","existingDevice","resolve","method","auxDevice","_decryptDeviceName","token","getAdvertisedEndpoint","advertiser","result","displayName","remove","requestPin","url","dev","occupants","pinChallenge","info","join","passType","verificationInitiation","pair","pin","unpair","leave","bindSpace","kmsResourceObjectUrl","bindConversation","unbindSpace","unbindConversation","getAudioState","putAudioState","audioState","mute","unmute","increaseVolume","decreaseVolume","setVolume","level","deviceArray","length","all","map","index","services","waitForCatalog","deviceClass","UC_CLOUD","updatedDevice","inDevice","metadata","encryptedUserAssignedName","encryptionKeyUrl","encryption","decryptText","decryptedDeviceName","undefined","userAssignedName","spaceUrl","substring","lastIndexOf","self","verified","productName","DEFAULT_PRODUCT_NAME","pairedDeviceId"],"sources":["device-manager.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nimport {cloneDeep} from 'lodash';\nimport '@webex/internal-plugin-lyra';\nimport '@webex/internal-plugin-search';\nimport {WebexPlugin} from '@webex/webex-core';\nimport uuid from 'uuid';\n\nimport {LYRA_SPACE, UC_CLOUD, DEFAULT_PRODUCT_NAME} from './constants';\nimport DeviceCollection from './collection';\n\nconst DeviceManager = WebexPlugin.extend({\n namespace: 'DeviceManager',\n _devicePendingPinChallenge: null,\n _pairedDevice: null,\n _boundSpace: null,\n\n initialize() {\n // Lyra mercury events listener\n this.webex.internal.mercury.on('event:lyra.space_updated', ({data}) => {\n this._receiveDeviceUpdates(data);\n });\n },\n\n /**\n * Gets a list of all recent devices associated with the user\n * the device list gets populated from Redis\n * @returns {Promise<Device>}\n */\n getAll() {\n return DeviceCollection.getAll();\n },\n\n /**\n * Gets a list of all recent devices associated with the user\n * the device list gets populated from Redis\n * @returns {Promise<Device>}\n */\n refresh() {\n DeviceCollection.reset();\n\n return this.webex\n .request({\n api: 'wdm',\n resource: 'devices/auxiliary',\n })\n .then((res) => {\n if (!res.body) {\n return Promise.reject();\n }\n\n return this._updateDeviceMetadata(res.body.items).then((devices) => {\n /* eslint-disable consistent-return */\n devices.forEach((device) => {\n if (device.deviceInfo && device.deviceInfo.machineType === LYRA_SPACE) {\n return this.webex.internal.lyra.space.get(device.deviceInfo).catch((err) => {\n this.logger.error('DeviceManager#refresh: failed to receive device info', err);\n });\n }\n });\n /* eslint-enable consistent-return */\n res.body.items.forEach((device) => {\n DeviceCollection.set(device);\n });\n\n return this.getAll();\n });\n })\n .catch((err) => {\n this.logger.error('DeviceManager#refresh: failed to fetch recent devices', err);\n });\n },\n\n /**\n * Search for a device by name\n * @param {Object} options\n * @param {string} options.searchQuery\n * @returns {Promise<Device>}\n */\n search(options) {\n if (!options || !options.searchQuery) {\n this.logger.error('DeviceManager#search: options.searchQuery is required');\n\n return Promise.reject(new Error('DeviceManager#search: options.searchQuery is required'));\n }\n\n return this.webex.internal.search\n .people({\n searchId: uuid.v4(),\n searchType: 'DEVICE_SEARCH',\n searchEntity: 'device',\n includePeople: false,\n includeRooms: true,\n queryString: options.searchQuery,\n })\n .catch((err) => {\n this.logger.error('DeviceManager#search: failed to search a device', err);\n\n throw err;\n });\n },\n\n /**\n * Caches the device info and also registers to Redis for subsequent fetches\n * @param {Object} device\n * @param {string} device.id\n * @returns {deviceInfo}\n */\n upsert(device) {\n const deviceId = device.id || (device.identity && device.identity.id);\n\n if (!deviceId) {\n this.logger.error('DeviceManager#upsert: device.id is required');\n\n return Promise.reject(new Error('DeviceManager#upsert: device.id is required'));\n }\n this._pairedDevice = this._devicePendingPinChallenge;\n this._devicePendingPinChallenge = null;\n // check if the device is already existing, if so then merge else add\n const existingDevice = DeviceCollection.get(deviceId);\n\n if (existingDevice) {\n DeviceCollection.set(device);\n\n return Promise.resolve(DeviceCollection.get(deviceId));\n }\n\n // new device requested, add to wdm for subsequent retreivals\n return (\n this.webex\n .request({\n api: 'wdm',\n method: 'PUT',\n resource: `devices/auxiliary/Room/${deviceId}`,\n })\n .then((res) => {\n const auxDevice = res.body;\n\n return this._decryptDeviceName(auxDevice);\n })\n // eslint-disable-next-line no-shadow\n .then((device) => {\n DeviceCollection.set(device);\n\n return Promise.resolve(DeviceCollection.get(deviceId));\n })\n .catch((err) => {\n this.logger.error('DeviceManager#upsert: failed to add/update a device', err);\n\n return Promise.reject(err);\n })\n );\n },\n\n /**\n * Retreives device info of a particular device\n * @param {string} token\n * @returns {Promise<deviceInfo>}\n */\n get(token) {\n if (!token) {\n this.logger.error('DeviceManager#get: token is required');\n\n return Promise.reject(new Error('DeviceManager#get: token is required'));\n }\n let deviceInfo;\n\n return this.webex.internal.lyra\n .getAdvertisedEndpoint(token)\n .then((res) => {\n deviceInfo = res;\n\n return this.webex.internal.lyra.space.get({id: res.advertiser.id});\n })\n .then((result) => {\n // the deviceInfo doesn't have proper displayName, hence update\n // displayName on deviceInfo for search to work\n if (result && result.identity && result.identity.displayName) {\n deviceInfo.advertiser.displayName = result.identity.displayName;\n }\n\n return deviceInfo;\n })\n .catch((err) => {\n this.logger.error('DeviceManager#get: failed to get device info', err);\n\n return Promise.reject(err);\n });\n },\n\n /**\n * Unregisters the device from Redis, will not fetch in subsequent loads,\n * similar to space.deleteBinding()\n * @param {string} deviceId\n * @returns {Promise<deviceInfo>}\n */\n remove(deviceId) {\n if (!deviceId) {\n this.logger.error('DeviceManager#remove: deviceId is required');\n\n return Promise.reject(new Error('DeviceManager#remove: deviceId is required'));\n }\n\n return this.webex\n .request({\n method: 'delete',\n api: 'wdm',\n resource: `devices/auxiliary/${deviceId}`,\n })\n .catch((error) => {\n this.logger.error('DeviceManager#remove: failed to remove the device', error);\n\n return Promise.reject(error);\n });\n },\n\n /**\n * Requests to display PIN on the device\n * @param {object} device\n * @param {object} options\n * @param {object} options.data\n * @returns {Promise<deviceInfo>}\n */\n requestPin(device, options = {}) {\n const deviceId = device.id || (device.identity && device.identity.id);\n\n if (!deviceId) {\n this.logger.error('DeviceManager#requestPin: device.id is required');\n\n return Promise.reject(new Error('DeviceManager#requestPin: device.id is required'));\n }\n const space = {id: deviceId, url: `/spaces/${deviceId}`};\n\n return this.webex.internal.lyra.space\n .get(space)\n .then((dev) => {\n // check if the space is pinChallenge capable\n if (dev && dev.occupants && dev.occupants.pinChallenge) {\n this.logger.info('DeviceManager#requestPin: space is PIN challenge capable');\n\n return this.webex.internal.lyra.space\n .join(space, {\n passType: 'MANUAL',\n verificationInitiation: 'PIN',\n data: options.data,\n })\n .then(() => {\n this._devicePendingPinChallenge = dev;\n\n // return the actual device so that it can be upserted on successful\n // PIN exchange\n return dev;\n });\n }\n // pairs with the space if it's not PIN challenge capable\n this.logger.info(\n 'DeviceManager#requestPin: space is not PIN challenge capable, probably already occupied, will still return device info'\n );\n\n return this.webex.internal.lyra.space.get(space).then(() => Promise.resolve(dev));\n })\n .catch((err) => {\n this.logger.error('DeviceManager#requestPin: device failed PIN challenge request', err);\n\n return Promise.reject(err);\n });\n },\n\n /**\n * pairs the device with the user (manual pairing), also adds it to\n * user's recents list for subsequent fetches.\n * similar to space.join()\n * @param {object} options\n * @param {number} options.pin\n * @returns {Promise<deviceInfo>}\n */\n pair(options = {}) {\n if (!options.pin) {\n this.logger.error('DeviceManager#pair: options.pin is required');\n\n return Promise.reject(new Error('DeviceManager#pair: options.pin is required'));\n }\n if (this._devicePendingPinChallenge) {\n const space = {\n id: this._devicePendingPinChallenge.identity.id,\n url: `/spaces/${this._devicePendingPinChallenge.identity.id}`,\n };\n\n return this.webex.internal.lyra.space\n .join(space, {\n passType: 'PIN_ANSWER',\n data: options.pin,\n })\n .catch((err) => {\n this.logger.error('DeviceManager#pair: incorrect PIN, unable to pair ', err);\n\n return Promise.reject(err);\n })\n .then(() => this.upsert(this._devicePendingPinChallenge));\n }\n this.logger.error('DeviceManager#pair: no device to pair');\n\n return Promise.reject(new Error('DeviceManager#pair: no device to pair'));\n },\n\n /**\n * unpairs the device with the user (manual/ultrasonic pairing), but still\n * keeps in the recents list/does not remove from Redis\n * options.removeAllDevices will remove all associated devices to user\n * similar to space.leave()\n * @param {object} options\n * @param {boolean} options.removeAllDevices\n * @returns {Promise<deviceInfo>}\n */\n unpair(options = {}) {\n if (!this._pairedDevice) {\n this.logger.error('DeviceManager#unpair: no device to unpair');\n\n return Promise.reject(new Error('DeviceManager#unpair: no device to unpair'));\n }\n const space = {url: `/spaces/${this._pairedDevice.identity.id}`};\n\n return this.webex.internal.lyra.space.leave(space, options).catch((err) => {\n this.logger.error('DeviceManager#unpair: failed to remove device from Lyra', err);\n\n return Promise.reject(err);\n });\n },\n\n /**\n * binds the space to the paired device (if supported)\n * similar to space.bindConversation()\n * @param {object} options\n * @param {boolean} options.url, conversation url\n * @param {boolean} options.kmsResourceObjectUrl of the convo\n * @returns {Promise<deviceInfo>}\n */\n bindSpace(options = {}) {\n if (!options.url) {\n this.logger.error('DeviceManager#pair: options.url is required');\n\n return Promise.reject(new Error('DeviceManager#bindSpace: options.url is required'));\n }\n if (!options.kmsResourceObjectUrl) {\n this.logger.error('DeviceManager#bindSpace: options.kmsResourceObjectUrl is required');\n\n return Promise.reject(\n new Error('DeviceManager#bindSpace: options.kmsResourceObjectUrl is required')\n );\n }\n if (!this._pairedDevice) {\n this.logger.error('DeviceManager#bindSpace: No device paired currently');\n\n return Promise.reject(new Error('DeviceManager#bindSpace: No device paired currently'));\n }\n const space = {\n url: `/spaces/${this._pairedDevice.identity.id}`,\n id: this._pairedDevice.identity.id,\n };\n\n this._boundSpace = {\n kmsResourceObjectUrl: options.kmsResourceObjectUrl,\n url: options.url,\n };\n\n return this.webex.internal.lyra.space.bindConversation(space, this._boundSpace).catch((err) => {\n this.logger.error('DeviceManager#bindSpace: failed to bind device to Space');\n\n return Promise.reject(err);\n });\n },\n\n /**\n * unbinds the space to the paired device (if supported)\n * similar to space.unbindConversation()\n * @returns {Promise<deviceInfo>}\n */\n unbindSpace() {\n if (!this._pairedDevice || !this._boundSpace) {\n this.logger.error('DeviceManager#unbindSpace: No space currently bound to the device');\n\n return Promise.reject(\n new Error('DeviceManager#unbindSpace: No space currently bound to the device')\n );\n }\n const space = {\n url: `/spaces/${this._pairedDevice.identity.id}`,\n id: this._pairedDevice.identity.id,\n };\n\n return this.webex.internal.lyra.space\n .unbindConversation(space, this._boundSpace)\n .then((res) => {\n this._boundSpace = null;\n\n return Promise.resolve(res);\n })\n .catch((err) => {\n this.logger.error('DeviceManager#unbindSpace: failed to unbind Space to device');\n\n return Promise.reject(err);\n });\n },\n\n /**\n * Gets the audio state of the paired device\n * similar to device.getAudioState()\n * @returns {Promise<audioState>}\n */\n getAudioState() {\n if (!this._pairedDevice) {\n this.logger.error('DeviceManager#getAudioState: Currently no device is paired');\n\n return Promise.reject(\n new Error('DeviceManager#getAudioState: Currently no device is paired')\n );\n }\n\n return this.webex.internal.lyra.device.getAudioState(this._pairedDevice);\n },\n\n /**\n * Updates audio state of the paired device, should be called every 10 minutes\n * or when mic or volume state is changed\n * similar to device.putAudioState()\n * @param {object} space\n * @param {object} audioState\n * @returns {Promise<audioState>}\n */\n putAudioState(space, audioState = {}) {\n return this.webex.internal.lyra.device.putAudioState(space, audioState);\n },\n\n /**\n * Mutes paired device\n * similar to device.mute()\n * @returns {Promise<audioState>}\n */\n mute() {\n if (!this._pairedDevice) {\n this.logger.error('DeviceManager#mute: Currently no device is paired');\n\n return Promise.reject(new Error('DeviceManager#mute: Currently no device is paired'));\n }\n\n return this.webex.internal.lyra.device.mute(this._pairedDevice);\n },\n\n /**\n * Unmutes paired device\n * similar to device.unmute()\n * @returns {Promise<audioState>}\n */\n unmute() {\n if (!this._pairedDevice) {\n this.logger.error('DeviceManager#unmute: Currently no device is paired');\n\n return Promise.reject(new Error('DeviceManager#unmute: Currently no device is paired'));\n }\n\n return this.webex.internal.lyra.device.unmute(this._pairedDevice);\n },\n\n /**\n * Increases paired device's volume\n * similar to device.increaseVolume()\n * @returns {Promise<audioState>}\n */\n increaseVolume() {\n if (!this._pairedDevice) {\n this.logger.error('DeviceManager#increaseVolume: Currently no device is paired');\n\n return Promise.reject(\n new Error('DeviceManager#increaseVolume: Currently no device is paired')\n );\n }\n\n return this.webex.internal.lyra.device.increaseVolume(this._pairedDevice);\n },\n\n /**\n * Decreases paired device's volume\n * similar to device.decreaseVolume()\n * @returns {Promise<audioState>}\n */\n decreaseVolume() {\n if (!this._pairedDevice) {\n this.logger.error('DeviceManager#decreaseVolume: Currently no device is paired');\n\n return Promise.reject(\n new Error('DeviceManager#decreaseVolume: Currently no device is paired')\n );\n }\n\n return this.webex.internal.lyra.device.decreaseVolume(this._pairedDevice);\n },\n\n /**\n * Sets paired device's volume but should use increase and decrease api instead\n * similar to device.setVolume()\n * @param {number} level\n * @returns {Promise<audioState>}\n */\n setVolume(level = 0) {\n if (!this._pairedDevice) {\n this.logger.error('DeviceManager#setVolume: Currently no device is paired');\n\n return Promise.reject(new Error('DeviceManager#setVolume: Currently no device is paired'));\n }\n\n return this.webex.internal.lyra.device.setVolume(this._pairedDevice, level);\n },\n\n /**\n * Utility function to update decrypted device name on device object\n * @param {Array} deviceArray\n * @returns {device}\n */\n _updateDeviceMetadata(deviceArray = []) {\n if (!deviceArray.length) {\n return Promise.resolve(deviceArray);\n }\n const devices = cloneDeep(deviceArray);\n\n return Promise.all(\n devices.map((device, index) =>\n this.webex.internal.services\n .waitForCatalog('postauth')\n .then(() => {\n if (device.deviceClass === UC_CLOUD) {\n device.id = `${this.webex.internal.services.get('wdm')}/${device.id}`;\n }\n\n return this._decryptDeviceName(device);\n })\n .then((updatedDevice) => {\n devices[index] = updatedDevice;\n\n return Promise.resolve();\n })\n )\n ).then(() => Promise.resolve(devices));\n },\n\n /**\n * Utility function to update decrypted device name on device object\n * @param {object} inDevice\n * @returns {device}\n */\n _decryptDeviceName(inDevice = {}) {\n const device = cloneDeep(inDevice);\n\n if (\n device.metadata &&\n device.metadata.encryptedUserAssignedName &&\n device.metadata.encryptionKeyUrl\n ) {\n return this.webex.internal.encryption\n .decryptText(device.metadata.encryptionKeyUrl, device.metadata.encryptedUserAssignedName)\n .then((decryptedDeviceName) => {\n // set userAssignedName as the decypted value, unset encryptedUserAssignedName since it's not needed\n device.metadata.encryptedUserAssignedName = undefined;\n device.metadata.userAssignedName = decryptedDeviceName;\n\n return Promise.resolve(device);\n })\n .catch((err) => {\n // unset encryptedUserAssignedName if failed to decrypt\n device.metadata.encryptedUserAssignedName = undefined;\n this.logger.error(\n 'DeviceCollection#_decryptDeviceName: failed to decrypt device name',\n err\n );\n });\n }\n\n return Promise.resolve(device);\n },\n\n /**\n * Utility function to update device info on mercury updates\n * @param {object} device\n * @returns {device}\n */\n _receiveDeviceUpdates(device) {\n // we care only the updates are for the registered devices\n if (device && device.spaceUrl) {\n const deviceId = device.spaceUrl.substring(device.spaceUrl.lastIndexOf('/') + 1);\n const existingDevice = DeviceCollection.get(deviceId);\n\n if (existingDevice) {\n return this.webex.internal.lyra.space\n .get({id: deviceId})\n .then((space) => {\n // eslint-disable-next-line no-shadow\n const device = DeviceCollection.get(deviceId);\n\n if (\n device &&\n space.occupants &&\n (!space.occupants.self || !space.occupants.self.verified)\n ) {\n device.productName =\n (space.devices && space.devices[0] && space.devices[0].productName) ||\n DEFAULT_PRODUCT_NAME;\n // pin challenge is not verified reset _pairedDevice if ids\n // match\n const pairedDeviceId =\n this._pairedDevice && (this._pairedDevice.id || this._pairedDevice.identity.id);\n\n if (pairedDeviceId === deviceId) {\n this._pairedDevice = null;\n this.logger.info(\n `DeviceManager#_receiveDeviceUpdates: device ${deviceId} lost pairing`\n );\n\n return Promise.resolve();\n }\n // we do not want to reset the device pending PIN challenge\n if (this._devicePendingPinChallenge.identity.id !== deviceId) {\n return this.upsert(device);\n }\n\n return Promise.resolve();\n }\n\n return Promise.resolve();\n })\n .catch((err) => {\n this.logger.error(\n 'DeviceManager#_receiveDeviceUpdates: failed to receive updates for Lyra space',\n err\n );\n });\n }\n }\n\n return Promise.resolve();\n },\n});\n\nexport default DeviceManager;\n"],"mappings":";;;;;;;;;;;;;;;;AAIA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA,IAAMA,aAAa,GAAGC,sBAAA,CAAYC,MAAZ,CAAmB;EACvCC,SAAS,EAAE,eAD4B;EAEvCC,0BAA0B,EAAE,IAFW;EAGvCC,aAAa,EAAE,IAHwB;EAIvCC,WAAW,EAAE,IAJ0B;EAMvCC,UANuC,wBAM1B;IAAA;;IACX;IACA,KAAKC,KAAL,CAAWC,QAAX,CAAoBC,OAApB,CAA4BC,EAA5B,CAA+B,0BAA/B,EAA2D,gBAAY;MAAA,IAAVC,IAAU,QAAVA,IAAU;;MACrE,KAAI,CAACC,qBAAL,CAA2BD,IAA3B;IACD,CAFD;EAGD,CAXsC;;EAavC;AACF;AACA;AACA;AACA;EACEE,MAlBuC,oBAkB9B;IACP,OAAOC,mBAAA,CAAiBD,MAAjB,EAAP;EACD,CApBsC;;EAsBvC;AACF;AACA;AACA;AACA;EACEE,OA3BuC,qBA2B7B;IAAA;;IACRD,mBAAA,CAAiBE,KAAjB;;IAEA,OAAO,KAAKT,KAAL,CACJU,OADI,CACI;MACPC,GAAG,EAAE,KADE;MAEPC,QAAQ,EAAE;IAFH,CADJ,EAKJC,IALI,CAKC,UAACC,GAAD,EAAS;MACb,IAAI,CAACA,GAAG,CAACC,IAAT,EAAe;QACb,OAAO,iBAAQC,MAAR,EAAP;MACD;;MAED,OAAO,MAAI,CA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AtB;;eAsnBe3D,a"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["registerPlugin","DeviceManager","config"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* globals */\n\nimport '@webex/internal-plugin-device';\nimport {registerPlugin} from '@webex/webex-core';\n\nimport DeviceManager from './device-manager';\nimport config from './config';\n\nregisterPlugin('devicemanager', DeviceManager, {\n config
|
|
1
|
+
{"version":3,"names":["registerPlugin","DeviceManager","config"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* globals */\n\nimport '@webex/internal-plugin-device';\nimport {registerPlugin} from '@webex/webex-core';\n\nimport DeviceManager from './device-manager';\nimport config from './config';\n\nregisterPlugin('devicemanager', DeviceManager, {\n config,\n});\n\nexport {default} from './device-manager';\nexport {default as config} from './config';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAMA;;AACA;;AAEA;;AACA;;AAVA;AACA;AACA;;AAEA;AAQA,IAAAA,yBAAA,EAAe,eAAf,EAAgCC,sBAAhC,EAA+C;EAC7CC,MAAM,EAANA;AAD6C,CAA/C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/plugin-device-manager",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"contributors": [
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
]
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@webex/internal-plugin-calendar": "3.0.0-beta.
|
|
27
|
-
"@webex/internal-plugin-device": "3.0.0-beta.
|
|
28
|
-
"@webex/internal-plugin-lyra": "3.0.0-beta.
|
|
29
|
-
"@webex/internal-plugin-search": "3.0.0-beta.
|
|
30
|
-
"@webex/plugin-authorization": "3.0.0-beta.
|
|
31
|
-
"@webex/plugin-device-manager": "3.0.0-beta.
|
|
32
|
-
"@webex/plugin-logger": "3.0.0-beta.
|
|
33
|
-
"@webex/test-helper-chai": "3.0.0-beta.
|
|
34
|
-
"@webex/webex-core": "3.0.0-beta.
|
|
26
|
+
"@webex/internal-plugin-calendar": "3.0.0-beta.15",
|
|
27
|
+
"@webex/internal-plugin-device": "3.0.0-beta.15",
|
|
28
|
+
"@webex/internal-plugin-lyra": "3.0.0-beta.15",
|
|
29
|
+
"@webex/internal-plugin-search": "3.0.0-beta.15",
|
|
30
|
+
"@webex/plugin-authorization": "3.0.0-beta.15",
|
|
31
|
+
"@webex/plugin-device-manager": "3.0.0-beta.15",
|
|
32
|
+
"@webex/plugin-logger": "3.0.0-beta.15",
|
|
33
|
+
"@webex/test-helper-chai": "3.0.0-beta.15",
|
|
34
|
+
"@webex/webex-core": "3.0.0-beta.15",
|
|
35
35
|
"lodash": "^4.17.21",
|
|
36
36
|
"uuid": "^3.3.2"
|
|
37
37
|
}
|