@webex/internal-plugin-lyra 3.0.0-beta.3 → 3.0.0-beta.30
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/README.md +1 -3
- package/dist/config.js +0 -3
- package/dist/config.js.map +1 -1
- package/dist/device.js +1 -17
- package/dist/device.js.map +1 -1
- package/dist/index.js +1 -12
- package/dist/index.js.map +1 -1
- package/dist/lyra.js +2 -10
- package/dist/lyra.js.map +1 -1
- package/dist/space.js +20 -64
- package/dist/space.js.map +1 -1
- package/package.json +13 -13
- package/src/config.js +1 -2
- package/src/device.js +18 -17
- package/src/index.js +1 -1
- package/src/lyra.js +11 -11
- package/src/space.js +68 -64
- package/test/integration/spec/device.js +69 -48
- package/test/integration/spec/space.js +127 -82
- package/test/unit/spec/device.js +22 -15
- package/test/unit/spec/lyra.js +16 -11
- package/test/unit/spec/space.js +132 -71
package/README.md
CHANGED
|
@@ -21,14 +21,12 @@ npm install --save @webex/internal-plugin-lyra
|
|
|
21
21
|
## Usage
|
|
22
22
|
|
|
23
23
|
```js
|
|
24
|
-
|
|
25
24
|
import '@webex/internal-plugin-lyra';
|
|
26
25
|
|
|
27
26
|
import WebexCore from '@webex/webex-core';
|
|
28
27
|
|
|
29
28
|
const webex = new WebexCore();
|
|
30
|
-
webex.internal.lyra.WHATEVER
|
|
31
|
-
|
|
29
|
+
webex.internal.lyra.WHATEVER;
|
|
32
30
|
```
|
|
33
31
|
|
|
34
32
|
## Maintainers
|
package/dist/config.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
-
|
|
5
4
|
_Object$defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
|
|
9
7
|
exports.default = void 0;
|
|
10
|
-
|
|
11
8
|
/*!
|
|
12
9
|
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
13
10
|
*/
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["lyra"],"sources":["config.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nexport default {\n lyra: {
|
|
1
|
+
{"version":3,"names":["lyra"],"sources":["config.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nexport default {\n lyra: {},\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAFA,eAIe;EACbA,IAAI,EAAE,CAAC;AACT,CAAC;AAAA"}
|
package/dist/device.js
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
5
|
_Object$defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
|
|
11
8
|
exports.default = void 0;
|
|
12
|
-
|
|
13
9
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
14
|
-
|
|
15
10
|
var _webexCore = require("@webex/webex-core");
|
|
16
|
-
|
|
17
11
|
/*!
|
|
18
12
|
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
19
13
|
*/
|
|
@@ -25,7 +19,6 @@ var _webexCore = require("@webex/webex-core");
|
|
|
25
19
|
*/
|
|
26
20
|
var Device = _webexCore.WebexPlugin.extend({
|
|
27
21
|
namespace: 'Lyra',
|
|
28
|
-
|
|
29
22
|
/**
|
|
30
23
|
* Gets the audio state of the device
|
|
31
24
|
* @param {Types~LyraSpace} space
|
|
@@ -40,7 +33,6 @@ var Device = _webexCore.WebexPlugin.extend({
|
|
|
40
33
|
return res.body;
|
|
41
34
|
});
|
|
42
35
|
},
|
|
43
|
-
|
|
44
36
|
/**
|
|
45
37
|
* Updates audio state for lyra device, should be called every 10 minutes or
|
|
46
38
|
* when mic or volume state is changed
|
|
@@ -56,11 +48,9 @@ var Device = _webexCore.WebexPlugin.extend({
|
|
|
56
48
|
*/
|
|
57
49
|
putAudioState: function putAudioState(space) {
|
|
58
50
|
var audioState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
59
|
-
|
|
60
51
|
if (!audioState.deviceUrl) {
|
|
61
52
|
return _promise.default.reject(new Error('audioState.deviceUrl is required'));
|
|
62
53
|
}
|
|
63
|
-
|
|
64
54
|
return this.webex.request({
|
|
65
55
|
method: 'PUT',
|
|
66
56
|
uri: "".concat(space.url, "/audio"),
|
|
@@ -69,7 +59,6 @@ var Device = _webexCore.WebexPlugin.extend({
|
|
|
69
59
|
return res.body;
|
|
70
60
|
});
|
|
71
61
|
},
|
|
72
|
-
|
|
73
62
|
/**
|
|
74
63
|
* Mutes lyra device
|
|
75
64
|
* @param {Types~LyraSpace} space
|
|
@@ -82,7 +71,6 @@ var Device = _webexCore.WebexPlugin.extend({
|
|
|
82
71
|
uri: "".concat(space.url, "/audio/microphones/actions/mute/invoke")
|
|
83
72
|
});
|
|
84
73
|
},
|
|
85
|
-
|
|
86
74
|
/**
|
|
87
75
|
* Unmutes lyra device
|
|
88
76
|
* @param {Types~LyraSpace} space
|
|
@@ -95,7 +83,6 @@ var Device = _webexCore.WebexPlugin.extend({
|
|
|
95
83
|
uri: "".concat(space.url, "/audio/microphones/actions/un-mute/invoke")
|
|
96
84
|
});
|
|
97
85
|
},
|
|
98
|
-
|
|
99
86
|
/**
|
|
100
87
|
* Increases lyra device's volume
|
|
101
88
|
* @param {Types~LyraSpace} space
|
|
@@ -108,7 +95,6 @@ var Device = _webexCore.WebexPlugin.extend({
|
|
|
108
95
|
uri: "".concat(space.url, "/audio/volume/actions/increase/invoke")
|
|
109
96
|
});
|
|
110
97
|
},
|
|
111
|
-
|
|
112
98
|
/**
|
|
113
99
|
* Decreases lyra device's volume
|
|
114
100
|
* @param {Types~LyraSpace} space
|
|
@@ -121,7 +107,6 @@ var Device = _webexCore.WebexPlugin.extend({
|
|
|
121
107
|
uri: "".concat(space.url, "/audio/volume/actions/decrease/invoke")
|
|
122
108
|
});
|
|
123
109
|
},
|
|
124
|
-
|
|
125
110
|
/**
|
|
126
111
|
* Sets lyra device's volume but should use increase and decrease api instead
|
|
127
112
|
* @param {Types~LyraSpace} space
|
|
@@ -139,9 +124,8 @@ var Device = _webexCore.WebexPlugin.extend({
|
|
|
139
124
|
}
|
|
140
125
|
});
|
|
141
126
|
},
|
|
142
|
-
version: "3.0.0-beta.
|
|
127
|
+
version: "3.0.0-beta.30"
|
|
143
128
|
});
|
|
144
|
-
|
|
145
129
|
var _default = Device;
|
|
146
130
|
exports.default = _default;
|
|
147
131
|
//# sourceMappingURL=device.js.map
|
package/dist/device.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Device","WebexPlugin","extend","namespace","getAudioState","space","webex","request","method","uri","url","then","res","body","putAudioState","audioState","deviceUrl","reject","Error","mute","unmute","increaseVolume","decreaseVolume","setVolume","level"],"sources":["device.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {WebexPlugin} from '@webex/webex-core';\n\n/**\n * @class\n * @extends {Lyra}\n * @memberof Lyra\n */\nconst Device = WebexPlugin.extend({\n namespace: 'Lyra',\n\n /**\n * Gets the audio state of the device\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @returns {Promise<LyraAudioState>} {volume, microphones, url}\n */\n getAudioState(space) {\n return this.webex.request({\n
|
|
1
|
+
{"version":3,"names":["Device","WebexPlugin","extend","namespace","getAudioState","space","webex","request","method","uri","url","then","res","body","putAudioState","audioState","deviceUrl","reject","Error","mute","unmute","increaseVolume","decreaseVolume","setVolume","level"],"sources":["device.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {WebexPlugin} from '@webex/webex-core';\n\n/**\n * @class\n * @extends {Lyra}\n * @memberof Lyra\n */\nconst Device = WebexPlugin.extend({\n namespace: 'Lyra',\n\n /**\n * Gets the audio state of the device\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @returns {Promise<LyraAudioState>} {volume, microphones, url}\n */\n getAudioState(space) {\n return this.webex\n .request({\n method: 'GET',\n uri: `${space.url}/audio`,\n })\n .then((res) => res.body);\n },\n\n /**\n * Updates audio state for lyra device, should be called every 10 minutes or\n * when mic or volume state is changed\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @param {Types~LyraAudioState} audioState\n * @param {object} audioState.volume optional\n * @param {boolean} audioState.volume.level\n * @param {object} audioState.microphones optional\n * @param {boolean} audioState.microphones.muted\n * @param {string} audioState.deviceUrl\n * @returns {Promise}\n */\n putAudioState(space, audioState = {}) {\n if (!audioState.deviceUrl) {\n return Promise.reject(new Error('audioState.deviceUrl is required'));\n }\n\n return this.webex\n .request({\n method: 'PUT',\n uri: `${space.url}/audio`,\n body: audioState,\n })\n .then((res) => res.body);\n },\n\n /**\n * Mutes lyra device\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @returns {Promise}\n */\n mute(space) {\n return this.webex.request({\n method: 'POST',\n uri: `${space.url}/audio/microphones/actions/mute/invoke`,\n });\n },\n\n /**\n * Unmutes lyra device\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @returns {Promise}\n */\n unmute(space) {\n return this.webex.request({\n method: 'POST',\n uri: `${space.url}/audio/microphones/actions/un-mute/invoke`,\n });\n },\n\n /**\n * Increases lyra device's volume\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @returns {Promise}\n */\n increaseVolume(space) {\n return this.webex.request({\n method: 'POST',\n uri: `${space.url}/audio/volume/actions/increase/invoke`,\n });\n },\n\n /**\n * Decreases lyra device's volume\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @returns {Promise}\n */\n decreaseVolume(space) {\n return this.webex.request({\n method: 'POST',\n uri: `${space.url}/audio/volume/actions/decrease/invoke`,\n });\n },\n\n /**\n * Sets lyra device's volume but should use increase and decrease api instead\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @param {integer} level to be set\n * @returns {Promise}\n */\n setVolume(space, level = 0) {\n return this.webex.request({\n method: 'POST',\n uri: `${space.url}/audio/volume/actions/set/invoke`,\n body: {\n level,\n },\n });\n },\n});\n\nexport default Device;\n"],"mappings":";;;;;;;;;AAIA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA,IAAMA,MAAM,GAAGC,sBAAW,CAACC,MAAM,CAAC;EAChCC,SAAS,EAAE,MAAM;EAEjB;AACF;AACA;AACA;AACA;AACA;EACEC,aAAa,yBAACC,KAAK,EAAE;IACnB,OAAO,IAAI,CAACC,KAAK,CACdC,OAAO,CAAC;MACPC,MAAM,EAAE,KAAK;MACbC,GAAG,YAAKJ,KAAK,CAACK,GAAG;IACnB,CAAC,CAAC,CACDC,IAAI,CAAC,UAACC,GAAG;MAAA,OAAKA,GAAG,CAACC,IAAI;IAAA,EAAC;EAC5B,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,aAAa,yBAACT,KAAK,EAAmB;IAAA,IAAjBU,UAAU,uEAAG,CAAC,CAAC;IAClC,IAAI,CAACA,UAAU,CAACC,SAAS,EAAE;MACzB,OAAO,iBAAQC,MAAM,CAAC,IAAIC,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtE;IAEA,OAAO,IAAI,CAACZ,KAAK,CACdC,OAAO,CAAC;MACPC,MAAM,EAAE,KAAK;MACbC,GAAG,YAAKJ,KAAK,CAACK,GAAG,WAAQ;MACzBG,IAAI,EAAEE;IACR,CAAC,CAAC,CACDJ,IAAI,CAAC,UAACC,GAAG;MAAA,OAAKA,GAAG,CAACC,IAAI;IAAA,EAAC;EAC5B,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEM,IAAI,gBAACd,KAAK,EAAE;IACV,OAAO,IAAI,CAACC,KAAK,CAACC,OAAO,CAAC;MACxBC,MAAM,EAAE,MAAM;MACdC,GAAG,YAAKJ,KAAK,CAACK,GAAG;IACnB,CAAC,CAAC;EACJ,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEU,MAAM,kBAACf,KAAK,EAAE;IACZ,OAAO,IAAI,CAACC,KAAK,CAACC,OAAO,CAAC;MACxBC,MAAM,EAAE,MAAM;MACdC,GAAG,YAAKJ,KAAK,CAACK,GAAG;IACnB,CAAC,CAAC;EACJ,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEW,cAAc,0BAAChB,KAAK,EAAE;IACpB,OAAO,IAAI,CAACC,KAAK,CAACC,OAAO,CAAC;MACxBC,MAAM,EAAE,MAAM;MACdC,GAAG,YAAKJ,KAAK,CAACK,GAAG;IACnB,CAAC,CAAC;EACJ,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEY,cAAc,0BAACjB,KAAK,EAAE;IACpB,OAAO,IAAI,CAACC,KAAK,CAACC,OAAO,CAAC;MACxBC,MAAM,EAAE,MAAM;MACdC,GAAG,YAAKJ,KAAK,CAACK,GAAG;IACnB,CAAC,CAAC;EACJ,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;EACEa,SAAS,qBAAClB,KAAK,EAAa;IAAA,IAAXmB,KAAK,uEAAG,CAAC;IACxB,OAAO,IAAI,CAAClB,KAAK,CAACC,OAAO,CAAC;MACxBC,MAAM,EAAE,MAAM;MACdC,GAAG,YAAKJ,KAAK,CAACK,GAAG,qCAAkC;MACnDG,IAAI,EAAE;QACJW,KAAK,EAALA;MACF;IACF,CAAC,CAAC;EACJ,CAAC;EAAA;AACH,CAAC,CAAC;AAAC,eAEYxB,MAAM;AAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,44 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
5
|
_Object$defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
|
|
11
8
|
_Object$defineProperty(exports, "config", {
|
|
12
9
|
enumerable: true,
|
|
13
10
|
get: function get() {
|
|
14
11
|
return _config.default;
|
|
15
12
|
}
|
|
16
13
|
});
|
|
17
|
-
|
|
18
14
|
_Object$defineProperty(exports, "default", {
|
|
19
15
|
enumerable: true,
|
|
20
16
|
get: function get() {
|
|
21
17
|
return _lyra.default;
|
|
22
18
|
}
|
|
23
19
|
});
|
|
24
|
-
|
|
25
20
|
require("@webex/internal-plugin-mercury");
|
|
26
|
-
|
|
27
21
|
require("@webex/internal-plugin-encryption");
|
|
28
|
-
|
|
29
22
|
require("@webex/internal-plugin-conversation");
|
|
30
|
-
|
|
31
23
|
require("@webex/internal-plugin-feature");
|
|
32
|
-
|
|
33
24
|
var _webexCore = require("@webex/webex-core");
|
|
34
|
-
|
|
35
25
|
var _lyra = _interopRequireDefault(require("./lyra"));
|
|
36
|
-
|
|
37
26
|
var _config = _interopRequireDefault(require("./config"));
|
|
38
|
-
|
|
39
27
|
/*!
|
|
40
28
|
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
41
29
|
*/
|
|
30
|
+
|
|
42
31
|
(0, _webexCore.registerInternalPlugin)('lyra', _lyra.default, {
|
|
43
32
|
config: _config.default
|
|
44
33
|
});
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["registerInternalPlugin","Lyra","config"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport '@webex/internal-plugin-mercury';\nimport '@webex/internal-plugin-encryption';\nimport '@webex/internal-plugin-conversation';\nimport '@webex/internal-plugin-feature';\n\nimport {registerInternalPlugin} from '@webex/webex-core';\n\nimport Lyra from './lyra';\nimport config from './config';\n\nregisterInternalPlugin('lyra', Lyra, {\n config
|
|
1
|
+
{"version":3,"names":["registerInternalPlugin","Lyra","config"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport '@webex/internal-plugin-mercury';\nimport '@webex/internal-plugin-encryption';\nimport '@webex/internal-plugin-conversation';\nimport '@webex/internal-plugin-feature';\n\nimport {registerInternalPlugin} from '@webex/webex-core';\n\nimport Lyra from './lyra';\nimport config from './config';\n\nregisterInternalPlugin('lyra', Lyra, {\n config,\n});\n\nexport {default} from './lyra';\nexport {config};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAIA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAZA;AACA;AACA;;AAYA,IAAAA,iCAAsB,EAAC,MAAM,EAAEC,aAAI,EAAE;EACnCC,MAAM,EAANA;AACF,CAAC,CAAC"}
|
package/dist/lyra.js
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
5
|
_Object$defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
|
|
11
8
|
exports.default = void 0;
|
|
12
|
-
|
|
13
9
|
var _webexCore = require("@webex/webex-core");
|
|
14
|
-
|
|
15
10
|
var _space = _interopRequireDefault(require("./space"));
|
|
16
|
-
|
|
17
11
|
var _device = _interopRequireDefault(require("./device"));
|
|
18
|
-
|
|
19
12
|
/*!
|
|
20
13
|
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
21
14
|
*/
|
|
15
|
+
|
|
22
16
|
var Lyra = _webexCore.WebexPlugin.extend({
|
|
23
17
|
/**
|
|
24
18
|
* @typedef {Object} Endpoint
|
|
@@ -42,7 +36,6 @@ var Lyra = _webexCore.WebexPlugin.extend({
|
|
|
42
36
|
space: _space.default,
|
|
43
37
|
device: _device.default
|
|
44
38
|
},
|
|
45
|
-
|
|
46
39
|
/**
|
|
47
40
|
* Get the endpoint information
|
|
48
41
|
* @param {string} token - ultrasound token decoded
|
|
@@ -60,9 +53,8 @@ var Lyra = _webexCore.WebexPlugin.extend({
|
|
|
60
53
|
return res.body;
|
|
61
54
|
});
|
|
62
55
|
},
|
|
63
|
-
version: "3.0.0-beta.
|
|
56
|
+
version: "3.0.0-beta.30"
|
|
64
57
|
});
|
|
65
|
-
|
|
66
58
|
var _default = Lyra;
|
|
67
59
|
exports.default = _default;
|
|
68
60
|
//# sourceMappingURL=lyra.js.map
|
package/dist/lyra.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Lyra","WebexPlugin","extend","namespace","children","space","Space","device","Device","getAdvertisedEndpoint","token","webex","request","method","api","resource","qs","then","res","body"],"sources":["lyra.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {WebexPlugin} from '@webex/webex-core';\n\nimport Space from './space';\nimport Device from './device';\n\nconst Lyra = WebexPlugin.extend({\n /**\n * @typedef {Object} Endpoint\n * @property {Object} advertiser\n * @property {string} advertiser.id\n * @property {string} advertiser.displayName\n * @property {string} advertiser.orgId\n * @property {Object} links\n * @property {Object} links.addMeToSpace\n * @property {string} links.addMeToSpace.href\n * @property {string} links.addMeToSpace.method\n * @property {Object} links.lyra_space\n * @property {string} links.lyra_space.href\n * @property {string} links.lyra_space.method\n * @property {string} proof\n * @property {Object} token\n * @property {string} token.value\n */\n namespace: 'Lyra',\n children: {\n space: Space,\n device: Device
|
|
1
|
+
{"version":3,"names":["Lyra","WebexPlugin","extend","namespace","children","space","Space","device","Device","getAdvertisedEndpoint","token","webex","request","method","api","resource","qs","then","res","body"],"sources":["lyra.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {WebexPlugin} from '@webex/webex-core';\n\nimport Space from './space';\nimport Device from './device';\n\nconst Lyra = WebexPlugin.extend({\n /**\n * @typedef {Object} Endpoint\n * @property {Object} advertiser\n * @property {string} advertiser.id\n * @property {string} advertiser.displayName\n * @property {string} advertiser.orgId\n * @property {Object} links\n * @property {Object} links.addMeToSpace\n * @property {string} links.addMeToSpace.href\n * @property {string} links.addMeToSpace.method\n * @property {Object} links.lyra_space\n * @property {string} links.lyra_space.href\n * @property {string} links.lyra_space.method\n * @property {string} proof\n * @property {Object} token\n * @property {string} token.value\n */\n namespace: 'Lyra',\n children: {\n space: Space,\n device: Device,\n },\n\n /**\n * Get the endpoint information\n * @param {string} token - ultrasound token decoded\n * @returns {Promise<Endpoint>}\n */\n getAdvertisedEndpoint(token) {\n return this.webex\n .request({\n method: 'GET',\n api: 'proximity',\n resource: '/ultrasound/advertisements',\n qs: {\n token,\n },\n })\n .then((res) => res.body);\n },\n});\n\nexport default Lyra;\n"],"mappings":";;;;;;;;AAIA;AAEA;AACA;AAPA;AACA;AACA;;AAOA,IAAMA,IAAI,GAAGC,sBAAW,CAACC,MAAM,CAAC;EAC9B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,SAAS,EAAE,MAAM;EACjBC,QAAQ,EAAE;IACRC,KAAK,EAAEC,cAAK;IACZC,MAAM,EAAEC;EACV,CAAC;EAED;AACF;AACA;AACA;AACA;EACEC,qBAAqB,iCAACC,KAAK,EAAE;IAC3B,OAAO,IAAI,CAACC,KAAK,CACdC,OAAO,CAAC;MACPC,MAAM,EAAE,KAAK;MACbC,GAAG,EAAE,WAAW;MAChBC,QAAQ,EAAE,4BAA4B;MACtCC,EAAE,EAAE;QACFN,KAAK,EAALA;MACF;IACF,CAAC,CAAC,CACDO,IAAI,CAAC,UAACC,GAAG;MAAA,OAAKA,GAAG,CAACC,IAAI;IAAA,EAAC;EAC5B,CAAC;EAAA;AACH,CAAC,CAAC;AAAC,eAEYnB,IAAI;AAAA"}
|
package/dist/space.js
CHANGED
|
@@ -1,29 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _Object$keys = require("@babel/runtime-corejs2/core-js/object/keys");
|
|
4
|
+
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
|
|
5
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
|
|
6
|
+
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
|
|
7
|
+
var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
|
|
3
8
|
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
-
|
|
5
9
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
10
|
_Object$defineProperty(exports, "__esModule", {
|
|
8
11
|
value: true
|
|
9
12
|
});
|
|
10
|
-
|
|
11
13
|
exports.default = void 0;
|
|
12
|
-
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
13
15
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
14
|
-
|
|
15
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/assign"));
|
|
16
|
-
|
|
17
16
|
var _querystring = _interopRequireDefault(require("querystring"));
|
|
18
|
-
|
|
19
17
|
var _webexCore = require("@webex/webex-core");
|
|
20
|
-
|
|
21
18
|
var _common = require("@webex/common");
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
25
|
-
*/
|
|
26
|
-
|
|
19
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
21
|
/**
|
|
28
22
|
* @class
|
|
29
23
|
* @extends {Lyra}
|
|
@@ -31,7 +25,6 @@ var _common = require("@webex/common");
|
|
|
31
25
|
*/
|
|
32
26
|
var Space = _webexCore.WebexPlugin.extend({
|
|
33
27
|
namespace: 'Lyra',
|
|
34
|
-
|
|
35
28
|
/**
|
|
36
29
|
* Lists lyra spaces associated with user
|
|
37
30
|
*
|
|
@@ -46,7 +39,6 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
46
39
|
return res.body.items;
|
|
47
40
|
});
|
|
48
41
|
},
|
|
49
|
-
|
|
50
42
|
/**
|
|
51
43
|
* Retrieves a lyra space info
|
|
52
44
|
* @param {Types~LyraSpace} space
|
|
@@ -57,11 +49,9 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
57
49
|
get: function get() {
|
|
58
50
|
var space = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
59
51
|
var spaceId = space.id || space.identity && space.identity.id;
|
|
60
|
-
|
|
61
52
|
if (!spaceId) {
|
|
62
53
|
return _promise.default.reject(new Error('space.id is required'));
|
|
63
54
|
}
|
|
64
|
-
|
|
65
55
|
return this.webex.request({
|
|
66
56
|
method: 'GET',
|
|
67
57
|
api: 'lyra',
|
|
@@ -70,7 +60,6 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
70
60
|
return res.body;
|
|
71
61
|
});
|
|
72
62
|
},
|
|
73
|
-
|
|
74
63
|
/**
|
|
75
64
|
* Joins a lyra space, update every 10 minutes to keep alive for MANUAL
|
|
76
65
|
* @param {Types~LyraSpace} space
|
|
@@ -82,7 +71,7 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
82
71
|
* @returns {Promise}
|
|
83
72
|
*/
|
|
84
73
|
join: function join(space, options) {
|
|
85
|
-
options = (
|
|
74
|
+
options = _objectSpread({
|
|
86
75
|
passType: 'MANUAL'
|
|
87
76
|
}, options);
|
|
88
77
|
var body = {
|
|
@@ -91,17 +80,15 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
91
80
|
},
|
|
92
81
|
deviceUrl: this.webex.internal.device.url
|
|
93
82
|
};
|
|
94
|
-
|
|
95
83
|
if (options.data) {
|
|
96
84
|
body.pass.data = options.data;
|
|
97
85
|
}
|
|
98
|
-
|
|
99
86
|
if (options.verificationInitiation) {
|
|
100
87
|
body.verificationInitiation = options.verificationInitiation;
|
|
101
|
-
}
|
|
102
|
-
// complete lyra service URL
|
|
103
|
-
|
|
88
|
+
}
|
|
104
89
|
|
|
90
|
+
// if options.uri is available use it, since that would have the
|
|
91
|
+
// complete lyra service URL
|
|
105
92
|
if (options.uri) {
|
|
106
93
|
return this.webex.request({
|
|
107
94
|
method: 'PUT',
|
|
@@ -109,7 +96,6 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
109
96
|
body: body
|
|
110
97
|
});
|
|
111
98
|
}
|
|
112
|
-
|
|
113
99
|
return this.webex.request({
|
|
114
100
|
method: 'PUT',
|
|
115
101
|
api: 'lyra',
|
|
@@ -117,7 +103,6 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
117
103
|
body: body
|
|
118
104
|
});
|
|
119
105
|
},
|
|
120
|
-
|
|
121
106
|
/**
|
|
122
107
|
* Leaves a lyra space
|
|
123
108
|
* @param {Types~LyraSpace} space
|
|
@@ -130,21 +115,18 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
130
115
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
131
116
|
// all devices are removed by default (when deviceUrl is not supplied)
|
|
132
117
|
var uri = "".concat(space.url, "/occupants/@me");
|
|
133
|
-
|
|
134
118
|
if (!options.removeAllDevices) {
|
|
135
119
|
var params = {
|
|
136
120
|
deviceUrl: _common.base64.toBase64Url(this.webex.internal.device.url)
|
|
137
121
|
};
|
|
138
122
|
uri += "?".concat(_querystring.default.stringify(params));
|
|
139
123
|
}
|
|
140
|
-
|
|
141
124
|
return this.webex.request({
|
|
142
125
|
method: 'DELETE',
|
|
143
126
|
api: 'lyra',
|
|
144
127
|
resource: uri
|
|
145
128
|
});
|
|
146
129
|
},
|
|
147
|
-
|
|
148
130
|
/**
|
|
149
131
|
* Verifies a space occupant (to be used by the lyra device)
|
|
150
132
|
* @param {Types~LyraSpace} space
|
|
@@ -164,7 +146,6 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
164
146
|
body: body
|
|
165
147
|
});
|
|
166
148
|
},
|
|
167
|
-
|
|
168
149
|
/**
|
|
169
150
|
* Gets the state of bindings in this Lyra space
|
|
170
151
|
* @param {Types~LyraSpace} space
|
|
@@ -179,7 +160,6 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
179
160
|
return res.body;
|
|
180
161
|
});
|
|
181
162
|
},
|
|
182
|
-
|
|
183
163
|
/**
|
|
184
164
|
* Binds a conversation to lyra space
|
|
185
165
|
* @param {Types~LyraSpace} space
|
|
@@ -195,28 +175,22 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
195
175
|
*/
|
|
196
176
|
bindConversation: function bindConversation() {
|
|
197
177
|
var _this = this;
|
|
198
|
-
|
|
199
178
|
var space = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
200
179
|
var conversation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
201
180
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
202
181
|
var spaceId = space.id || space.identity && space.identity.id;
|
|
203
|
-
|
|
204
182
|
if (!space.url) {
|
|
205
183
|
return _promise.default.reject(new Error('space.url is required'));
|
|
206
184
|
}
|
|
207
|
-
|
|
208
185
|
if (!spaceId) {
|
|
209
186
|
return _promise.default.reject(new Error('space.id is required'));
|
|
210
187
|
}
|
|
211
|
-
|
|
212
188
|
if (!conversation.kmsResourceObjectUrl) {
|
|
213
189
|
return _promise.default.reject(new Error('conversation.kmsResourceObjectUrl is required'));
|
|
214
190
|
}
|
|
215
|
-
|
|
216
191
|
if (!conversation.url) {
|
|
217
192
|
return _promise.default.reject(new Error('conversation.url is required'));
|
|
218
193
|
}
|
|
219
|
-
|
|
220
194
|
var body = {
|
|
221
195
|
kmsMessage: {
|
|
222
196
|
method: 'create',
|
|
@@ -229,23 +203,22 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
229
203
|
var request = {
|
|
230
204
|
method: 'POST',
|
|
231
205
|
body: body
|
|
232
|
-
};
|
|
233
|
-
// complete lyra service URL
|
|
206
|
+
};
|
|
234
207
|
|
|
208
|
+
// if options.uri is available use it, since that would have the
|
|
209
|
+
// complete lyra service URL
|
|
235
210
|
if (options.uri) {
|
|
236
211
|
request.uri = options.uri;
|
|
237
212
|
} else {
|
|
238
213
|
request.api = 'lyra';
|
|
239
214
|
request.resource = "".concat(space.url, "/bindings");
|
|
240
215
|
}
|
|
241
|
-
|
|
242
216
|
return this._bindConversation(spaceId).then(function () {
|
|
243
217
|
return _this.webex.request(request);
|
|
244
218
|
}).then(function (res) {
|
|
245
219
|
return res.body;
|
|
246
220
|
});
|
|
247
221
|
},
|
|
248
|
-
|
|
249
222
|
/**
|
|
250
223
|
* Binds a conversation to lyra space by posting capabilities to Lyra.
|
|
251
224
|
*
|
|
@@ -256,12 +229,11 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
256
229
|
*/
|
|
257
230
|
_bindConversation: function _bindConversation(spaceId) {
|
|
258
231
|
// Skip until we can bind a conversation to lyra space by posting capabilities to Lyra.
|
|
259
|
-
|
|
260
232
|
/* eslint no-unreachable: 1 */
|
|
261
|
-
return _promise.default.resolve();
|
|
233
|
+
return _promise.default.resolve();
|
|
262
234
|
|
|
235
|
+
// PUT /lyra/api/v1/spaces/{spaceId}/devices/{encodedDeviceUrl}/capabilities
|
|
263
236
|
var encodedDeviceUrl = _common.base64.encode(this.webex.internal.device.url);
|
|
264
|
-
|
|
265
237
|
var resource = "spaces/".concat(spaceId, "/devices/").concat(encodedDeviceUrl, "/capabilities");
|
|
266
238
|
return this.webex.request({
|
|
267
239
|
method: 'PUT',
|
|
@@ -272,7 +244,6 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
272
244
|
}
|
|
273
245
|
});
|
|
274
246
|
},
|
|
275
|
-
|
|
276
247
|
/**
|
|
277
248
|
* Removes binding between a conversation and a lyra space using conversation
|
|
278
249
|
* url
|
|
@@ -289,28 +260,22 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
289
260
|
*/
|
|
290
261
|
unbindConversation: function unbindConversation() {
|
|
291
262
|
var _this2 = this;
|
|
292
|
-
|
|
293
263
|
var space = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
294
264
|
var conversation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
295
265
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
296
266
|
var spaceId = space.id || space.identity && space.identity.id;
|
|
297
|
-
|
|
298
267
|
if (!space.url) {
|
|
299
268
|
return _promise.default.reject(new Error('space.url is required'));
|
|
300
269
|
}
|
|
301
|
-
|
|
302
270
|
if (!spaceId) {
|
|
303
271
|
return _promise.default.reject(new Error('space.id is required'));
|
|
304
272
|
}
|
|
305
|
-
|
|
306
273
|
if (!conversation.url) {
|
|
307
274
|
return _promise.default.reject(new Error('conversation.url is required'));
|
|
308
275
|
}
|
|
309
|
-
|
|
310
276
|
if (!conversation.kmsResourceObjectUrl) {
|
|
311
277
|
return _promise.default.reject(new Error('conversation.kmsResourceObjectUrl is required'));
|
|
312
278
|
}
|
|
313
|
-
|
|
314
279
|
var parameters = {
|
|
315
280
|
kmsMessage: {
|
|
316
281
|
method: 'delete',
|
|
@@ -321,16 +286,15 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
321
286
|
conversationUrl: _common.base64.toBase64Url(conversation.url)
|
|
322
287
|
};
|
|
323
288
|
return this.webex.internal.encryption.kms.prepareRequest(parameters.kmsMessage).then(function (req) {
|
|
324
|
-
parameters.kmsMessage = req.wrapped;
|
|
289
|
+
parameters.kmsMessage = req.wrapped;
|
|
290
|
+
// if options.uri is available use it, since that would have the
|
|
325
291
|
// complete lyra service URL
|
|
326
|
-
|
|
327
292
|
if (options.uri) {
|
|
328
293
|
return _this2.webex.request({
|
|
329
294
|
method: 'DELETE',
|
|
330
295
|
uri: "".concat(options.uri, "?").concat(_querystring.default.stringify(parameters))
|
|
331
296
|
});
|
|
332
297
|
}
|
|
333
|
-
|
|
334
298
|
return _this2.webex.request({
|
|
335
299
|
method: 'DELETE',
|
|
336
300
|
api: 'lyra',
|
|
@@ -338,7 +302,6 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
338
302
|
});
|
|
339
303
|
});
|
|
340
304
|
},
|
|
341
|
-
|
|
342
305
|
/**
|
|
343
306
|
* Delete a binding using binding id
|
|
344
307
|
* @param {Types~LyraSpace} space
|
|
@@ -351,27 +314,21 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
351
314
|
*/
|
|
352
315
|
deleteBinding: function deleteBinding() {
|
|
353
316
|
var _this3 = this;
|
|
354
|
-
|
|
355
317
|
var space = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
356
318
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
357
319
|
var spaceId = space.id || space.identity && space.identity.id;
|
|
358
|
-
|
|
359
320
|
if (!space.url) {
|
|
360
321
|
return _promise.default.reject(new Error('space.url is required'));
|
|
361
322
|
}
|
|
362
|
-
|
|
363
323
|
if (!spaceId) {
|
|
364
324
|
return _promise.default.reject(new Error('space.id is required'));
|
|
365
325
|
}
|
|
366
|
-
|
|
367
326
|
if (!options.kmsResourceObjectUrl) {
|
|
368
327
|
return _promise.default.reject(new Error('options.kmsResourceObjectUrl is required'));
|
|
369
328
|
}
|
|
370
|
-
|
|
371
329
|
if (!options.bindingId) {
|
|
372
330
|
return _promise.default.reject(new Error('options.bindingId is required'));
|
|
373
331
|
}
|
|
374
|
-
|
|
375
332
|
var parameters = {
|
|
376
333
|
kmsMessage: {
|
|
377
334
|
method: 'delete',
|
|
@@ -388,9 +345,8 @@ var Space = _webexCore.WebexPlugin.extend({
|
|
|
388
345
|
});
|
|
389
346
|
});
|
|
390
347
|
},
|
|
391
|
-
version: "3.0.0-beta.
|
|
348
|
+
version: "3.0.0-beta.30"
|
|
392
349
|
});
|
|
393
|
-
|
|
394
350
|
var _default = Space;
|
|
395
351
|
exports.default = _default;
|
|
396
352
|
//# sourceMappingURL=space.js.map
|