@webex/internal-plugin-device 2.59.3-next.1 → 2.59.4-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +6 -6
- package/README.md +80 -80
- package/babel.config.js +3 -3
- package/dist/config.js +27 -27
- package/dist/config.js.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/device.js +226 -226
- package/dist/device.js.map +1 -1
- package/dist/features/feature-collection.js +14 -14
- package/dist/features/feature-collection.js.map +1 -1
- package/dist/features/feature-model.js +78 -79
- package/dist/features/feature-model.js.map +1 -1
- package/dist/features/features-model.js +28 -28
- package/dist/features/features-model.js.map +1 -1
- package/dist/features/index.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/interceptors/device-url.js +10 -10
- package/dist/interceptors/device-url.js.map +1 -1
- package/dist/metrics.js.map +1 -1
- package/jest.config.js +3 -3
- package/package.json +10 -10
- package/process +1 -1
- package/src/config.js +60 -60
- package/src/constants.js +23 -23
- package/src/device.js +835 -835
- package/src/features/feature-collection.js +30 -30
- package/src/features/feature-model.js +189 -189
- package/src/features/features-model.js +96 -96
- package/src/features/index.js +5 -5
- package/src/index.js +29 -29
- package/src/interceptors/device-url.js +61 -61
- package/src/metrics.js +5 -5
- package/test/integration/spec/device.js +904 -904
- package/test/integration/spec/webex.js +42 -42
- package/test/unit/spec/device.js +409 -409
- package/test/unit/spec/features/feature-collection.js +24 -24
- package/test/unit/spec/features/feature-model.js +255 -255
- package/test/unit/spec/features/features-model.js +97 -97
- package/test/unit/spec/interceptors/device-url.js +215 -215
- package/test/unit/spec/wdm-dto.json +104 -104
package/.eslintrc.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const config = {
|
|
2
|
-
root: true,
|
|
3
|
-
extends: ['@webex/eslint-config-legacy'],
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
module.exports = config;
|
|
1
|
+
const config = {
|
|
2
|
+
root: true,
|
|
3
|
+
extends: ['@webex/eslint-config-legacy'],
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
module.exports = config;
|
package/README.md
CHANGED
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
# @webex/internal-plugin-device
|
|
2
|
-
|
|
3
|
-
[](https://github.com/RichardLitt/standard-readme)
|
|
4
|
-
|
|
5
|
-
> Plugin for device management
|
|
6
|
-
|
|
7
|
-
This is an internal Cisco Webex plugin. As such, it does not strictly adhere to semantic versioning. Use at your own risk. If you're not working on one of our first party clients, please look at our [developer api](https://developer.webex.com/) and stick to our public plugins.
|
|
8
|
-
|
|
9
|
-
- [Install](#install)
|
|
10
|
-
- [Usage](#usage)
|
|
11
|
-
- [Maintainers](#maintainers)
|
|
12
|
-
- [Contribute](#contribute)
|
|
13
|
-
- [License](#license)
|
|
14
|
-
|
|
15
|
-
## Install
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm install --save @webex/internal-plugin-device
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
```js
|
|
24
|
-
import '@webex/internal-plugin-device';
|
|
25
|
-
|
|
26
|
-
import WebexCore from '@webex/webex-core';
|
|
27
|
-
|
|
28
|
-
const webex = new WebexCore();
|
|
29
|
-
|
|
30
|
-
// Namespace.
|
|
31
|
-
webex.internal.device;
|
|
32
|
-
|
|
33
|
-
// Register the device.
|
|
34
|
-
webex.internal.device
|
|
35
|
-
.register()
|
|
36
|
-
.then(() => {}) // On successful registration.
|
|
37
|
-
.catch(() => {}); // On failed registration.
|
|
38
|
-
|
|
39
|
-
// Refresh the device.
|
|
40
|
-
webex.internal.device
|
|
41
|
-
.refresh()
|
|
42
|
-
.then(() => {}) // On successful refresh.
|
|
43
|
-
.catch(() => {}); // On failed refresh.
|
|
44
|
-
|
|
45
|
-
// Unregister the device.
|
|
46
|
-
webex.internal.device
|
|
47
|
-
.unregister()
|
|
48
|
-
.then(() => {}) // On successful unregistration.
|
|
49
|
-
.catch(() => {}); // On failed unregistration.
|
|
50
|
-
|
|
51
|
-
// Get the current web socket url. Accepts a boolean to enable waiting for the
|
|
52
|
-
// url to populate.
|
|
53
|
-
webex.internal.device
|
|
54
|
-
.getWebSocketUrl(true)
|
|
55
|
-
.then((url) => {}) // Resolves to the url when it is retrievable.
|
|
56
|
-
.catch(() => {}); // Rejects when the url is not available.
|
|
57
|
-
|
|
58
|
-
// Commonly referenced properties.
|
|
59
|
-
|
|
60
|
-
// The device's url once registered.
|
|
61
|
-
webex.internal.device.url;
|
|
62
|
-
|
|
63
|
-
// The registered device's user uuid.
|
|
64
|
-
webex.internal.device.userId;
|
|
65
|
-
|
|
66
|
-
// Determines if the device is registered.
|
|
67
|
-
webex.internal.device.registered;
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## Maintainers
|
|
71
|
-
|
|
72
|
-
This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
|
|
73
|
-
|
|
74
|
-
## Contribute
|
|
75
|
-
|
|
76
|
-
Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/webex-js-sdk/blob/master/CONTRIBUTING.md) for more details.
|
|
77
|
-
|
|
78
|
-
## License
|
|
79
|
-
|
|
80
|
-
© 2016-2020 Cisco and/or its affiliates. All Rights Reserved.
|
|
1
|
+
# @webex/internal-plugin-device
|
|
2
|
+
|
|
3
|
+
[](https://github.com/RichardLitt/standard-readme)
|
|
4
|
+
|
|
5
|
+
> Plugin for device management
|
|
6
|
+
|
|
7
|
+
This is an internal Cisco Webex plugin. As such, it does not strictly adhere to semantic versioning. Use at your own risk. If you're not working on one of our first party clients, please look at our [developer api](https://developer.webex.com/) and stick to our public plugins.
|
|
8
|
+
|
|
9
|
+
- [Install](#install)
|
|
10
|
+
- [Usage](#usage)
|
|
11
|
+
- [Maintainers](#maintainers)
|
|
12
|
+
- [Contribute](#contribute)
|
|
13
|
+
- [License](#license)
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install --save @webex/internal-plugin-device
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import '@webex/internal-plugin-device';
|
|
25
|
+
|
|
26
|
+
import WebexCore from '@webex/webex-core';
|
|
27
|
+
|
|
28
|
+
const webex = new WebexCore();
|
|
29
|
+
|
|
30
|
+
// Namespace.
|
|
31
|
+
webex.internal.device;
|
|
32
|
+
|
|
33
|
+
// Register the device.
|
|
34
|
+
webex.internal.device
|
|
35
|
+
.register()
|
|
36
|
+
.then(() => {}) // On successful registration.
|
|
37
|
+
.catch(() => {}); // On failed registration.
|
|
38
|
+
|
|
39
|
+
// Refresh the device.
|
|
40
|
+
webex.internal.device
|
|
41
|
+
.refresh()
|
|
42
|
+
.then(() => {}) // On successful refresh.
|
|
43
|
+
.catch(() => {}); // On failed refresh.
|
|
44
|
+
|
|
45
|
+
// Unregister the device.
|
|
46
|
+
webex.internal.device
|
|
47
|
+
.unregister()
|
|
48
|
+
.then(() => {}) // On successful unregistration.
|
|
49
|
+
.catch(() => {}); // On failed unregistration.
|
|
50
|
+
|
|
51
|
+
// Get the current web socket url. Accepts a boolean to enable waiting for the
|
|
52
|
+
// url to populate.
|
|
53
|
+
webex.internal.device
|
|
54
|
+
.getWebSocketUrl(true)
|
|
55
|
+
.then((url) => {}) // Resolves to the url when it is retrievable.
|
|
56
|
+
.catch(() => {}); // Rejects when the url is not available.
|
|
57
|
+
|
|
58
|
+
// Commonly referenced properties.
|
|
59
|
+
|
|
60
|
+
// The device's url once registered.
|
|
61
|
+
webex.internal.device.url;
|
|
62
|
+
|
|
63
|
+
// The registered device's user uuid.
|
|
64
|
+
webex.internal.device.userId;
|
|
65
|
+
|
|
66
|
+
// Determines if the device is registered.
|
|
67
|
+
webex.internal.device.registered;
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Maintainers
|
|
71
|
+
|
|
72
|
+
This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
|
|
73
|
+
|
|
74
|
+
## Contribute
|
|
75
|
+
|
|
76
|
+
Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/webex-js-sdk/blob/master/CONTRIBUTING.md) for more details.
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
© 2016-2020 Cisco and/or its affiliates. All Rights Reserved.
|
package/babel.config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const babelConfigLegacy = require('@webex/babel-config-legacy');
|
|
2
|
-
|
|
3
|
-
module.exports = babelConfigLegacy;
|
|
1
|
+
const babelConfigLegacy = require('@webex/babel-config-legacy');
|
|
2
|
+
|
|
3
|
+
module.exports = babelConfigLegacy;
|
package/dist/config.js
CHANGED
|
@@ -8,22 +8,22 @@ exports.default = void 0;
|
|
|
8
8
|
var _common = require("@webex/common");
|
|
9
9
|
var _default = {
|
|
10
10
|
device: {
|
|
11
|
-
/**
|
|
12
|
-
* The duration to wait for the catalog to populate in seconds.
|
|
13
|
-
*
|
|
14
|
-
* @type {number}
|
|
11
|
+
/**
|
|
12
|
+
* The duration to wait for the catalog to populate in seconds.
|
|
13
|
+
*
|
|
14
|
+
* @type {number}
|
|
15
15
|
*/
|
|
16
16
|
canRegisterWaitDuration: 10,
|
|
17
|
-
/**
|
|
18
|
-
* The default configuration group when sending registration requests.
|
|
19
|
-
*
|
|
20
|
-
* @type {Object}
|
|
17
|
+
/**
|
|
18
|
+
* The default configuration group when sending registration requests.
|
|
19
|
+
*
|
|
20
|
+
* @type {Object}
|
|
21
21
|
*/
|
|
22
22
|
defaults: {
|
|
23
|
-
/**
|
|
24
|
-
* The default body configuration of registration requests.
|
|
25
|
-
*
|
|
26
|
-
* @type {Object}
|
|
23
|
+
/**
|
|
24
|
+
* The default body configuration of registration requests.
|
|
25
|
+
*
|
|
26
|
+
* @type {Object}
|
|
27
27
|
*/
|
|
28
28
|
body: {
|
|
29
29
|
name: (typeof process.title === 'string' ? process.title.trim() : undefined) || _common.inBrowser && 'browser' || 'javascript',
|
|
@@ -34,25 +34,25 @@ var _default = {
|
|
|
34
34
|
systemVersion: '1.0.0'
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
|
-
/**
|
|
38
|
-
* When true, the **wdm** service will enforce an inactivity duration.
|
|
39
|
-
*
|
|
40
|
-
* @type {boolean}
|
|
37
|
+
/**
|
|
38
|
+
* When true, the **wdm** service will enforce an inactivity duration.
|
|
39
|
+
*
|
|
40
|
+
* @type {boolean}
|
|
41
41
|
*/
|
|
42
42
|
enableInactivityEnforcement: false,
|
|
43
|
-
/**
|
|
44
|
-
* When true, the device registration will include a ttl value of
|
|
45
|
-
* {@link config.device.ephemeralDeviceTTL} and refresh on an interval of
|
|
46
|
-
* {@link config.device.ephemeralDeviceTTL} / 2 + 60 seconds.
|
|
47
|
-
*
|
|
48
|
-
* @type {boolean}
|
|
43
|
+
/**
|
|
44
|
+
* When true, the device registration will include a ttl value of
|
|
45
|
+
* {@link config.device.ephemeralDeviceTTL} and refresh on an interval of
|
|
46
|
+
* {@link config.device.ephemeralDeviceTTL} / 2 + 60 seconds.
|
|
47
|
+
*
|
|
48
|
+
* @type {boolean}
|
|
49
49
|
*/
|
|
50
50
|
ephemeral: false,
|
|
51
|
-
/**
|
|
52
|
-
* The ttl value to include in device registration if
|
|
53
|
-
* {@link config.device.ephemeral} is true. Measured in seconds.
|
|
54
|
-
*
|
|
55
|
-
* @type {boolean}
|
|
51
|
+
/**
|
|
52
|
+
* The ttl value to include in device registration if
|
|
53
|
+
* {@link config.device.ephemeral} is true. Measured in seconds.
|
|
54
|
+
*
|
|
55
|
+
* @type {boolean}
|
|
56
56
|
*/
|
|
57
57
|
ephemeralDeviceTTL: 30 * 60
|
|
58
58
|
}
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_common","require","_default","device","canRegisterWaitDuration","defaults","body","name","process","title","trim","undefined","inBrowser","deviceType","WEB","model","localizedModel","systemName","systemVersion","enableInactivityEnforcement","ephemeral","ephemeralDeviceTTL","exports","default"],"sources":["config.js"],"sourcesContent":["import {inBrowser, deviceType} from '@webex/common';\
|
|
1
|
+
{"version":3,"names":["_common","require","_default","device","canRegisterWaitDuration","defaults","body","name","process","title","trim","undefined","inBrowser","deviceType","WEB","model","localizedModel","systemName","systemVersion","enableInactivityEnforcement","ephemeral","ephemeralDeviceTTL","exports","default"],"sources":["config.js"],"sourcesContent":["import {inBrowser, deviceType} from '@webex/common';\n\nexport default {\n device: {\n /**\n * The duration to wait for the catalog to populate in seconds.\n *\n * @type {number}\n */\n canRegisterWaitDuration: 10,\n\n /**\n * The default configuration group when sending registration requests.\n *\n * @type {Object}\n */\n defaults: {\n /**\n * The default body configuration of registration requests.\n *\n * @type {Object}\n */\n body: {\n name:\n (typeof process.title === 'string' ? process.title.trim() : undefined) ||\n (inBrowser && 'browser') ||\n 'javascript',\n deviceType: deviceType.WEB,\n model: 'web-js-sdk',\n localizedModel: 'webex-js-sdk',\n systemName: 'WEBEX_JS_SDK',\n systemVersion: '1.0.0',\n },\n },\n\n /**\n * When true, the **wdm** service will enforce an inactivity duration.\n *\n * @type {boolean}\n */\n enableInactivityEnforcement: false,\n\n /**\n * When true, the device registration will include a ttl value of\n * {@link config.device.ephemeralDeviceTTL} and refresh on an interval of\n * {@link config.device.ephemeralDeviceTTL} / 2 + 60 seconds.\n *\n * @type {boolean}\n */\n ephemeral: false,\n\n /**\n * The ttl value to include in device registration if\n * {@link config.device.ephemeral} is true. Measured in seconds.\n *\n * @type {boolean}\n */\n ephemeralDeviceTTL: 30 * 60,\n },\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAoD,IAAAC,QAAA,GAErC;EACbC,MAAM,EAAE;IACN;AACJ;AACA;AACA;AACA;IACIC,uBAAuB,EAAE,EAAE;IAE3B;AACJ;AACA;AACA;AACA;IACIC,QAAQ,EAAE;MACR;AACN;AACA;AACA;AACA;MACMC,IAAI,EAAE;QACJC,IAAI,EACF,CAAC,OAAOC,OAAO,CAACC,KAAK,KAAK,QAAQ,GAAGD,OAAO,CAACC,KAAK,CAACC,IAAI,EAAE,GAAGC,SAAS,KACpEC,iBAAS,IAAI,SAAU,IACxB,YAAY;QACdC,UAAU,EAAEA,kBAAU,CAACC,GAAG;QAC1BC,KAAK,EAAE,YAAY;QACnBC,cAAc,EAAE,cAAc;QAC9BC,UAAU,EAAE,cAAc;QAC1BC,aAAa,EAAE;MACjB;IACF,CAAC;IAED;AACJ;AACA;AACA;AACA;IACIC,2BAA2B,EAAE,KAAK;IAElC;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,SAAS,EAAE,KAAK;IAEhB;AACJ;AACA;AACA;AACA;AACA;IACIC,kBAAkB,EAAE,EAAE,GAAG;EAC3B;AACF,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAArB,QAAA"}
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FEATURE_COLLECTION_DEVELOPER","exports","FEATURE_COLLECTION_ENTITLEMENT","FEATURE_COLLECTION_USER","CISCO_DEVICE_URL","FEATURE_COLLECTION_NAMES","FEATURE_TYPES","BOOLEAN","NUMBER","STRING","DEVICE_EVENT_REGISTRATION_SUCCESS","DEVICE_EVENTS"],"sources":["constants.js"],"sourcesContent":["// Feature constants.\
|
|
1
|
+
{"version":3,"names":["FEATURE_COLLECTION_DEVELOPER","exports","FEATURE_COLLECTION_ENTITLEMENT","FEATURE_COLLECTION_USER","CISCO_DEVICE_URL","FEATURE_COLLECTION_NAMES","FEATURE_TYPES","BOOLEAN","NUMBER","STRING","DEVICE_EVENT_REGISTRATION_SUCCESS","DEVICE_EVENTS"],"sources":["constants.js"],"sourcesContent":["// Feature constants.\nexport const FEATURE_COLLECTION_DEVELOPER = 'developer';\nexport const FEATURE_COLLECTION_ENTITLEMENT = 'entitlement';\nexport const FEATURE_COLLECTION_USER = 'user';\n\nexport const CISCO_DEVICE_URL = 'cisco-device-url';\n\nexport const FEATURE_COLLECTION_NAMES = [\n FEATURE_COLLECTION_DEVELOPER,\n FEATURE_COLLECTION_ENTITLEMENT,\n FEATURE_COLLECTION_USER,\n];\n\nexport const FEATURE_TYPES = {\n BOOLEAN: 'boolean',\n NUMBER: 'number',\n STRING: 'string',\n};\n\n// Device constants.\nexport const DEVICE_EVENT_REGISTRATION_SUCCESS = 'registration:success';\n\nexport const DEVICE_EVENTS = [DEVICE_EVENT_REGISTRATION_SUCCESS];\n"],"mappings":";;;;;;;AAAA;AACO,IAAMA,4BAA4B,GAAG,WAAW;AAACC,OAAA,CAAAD,4BAAA,GAAAA,4BAAA;AACjD,IAAME,8BAA8B,GAAG,aAAa;AAACD,OAAA,CAAAC,8BAAA,GAAAA,8BAAA;AACrD,IAAMC,uBAAuB,GAAG,MAAM;AAACF,OAAA,CAAAE,uBAAA,GAAAA,uBAAA;AAEvC,IAAMC,gBAAgB,GAAG,kBAAkB;AAACH,OAAA,CAAAG,gBAAA,GAAAA,gBAAA;AAE5C,IAAMC,wBAAwB,GAAG,CACtCL,4BAA4B,EAC5BE,8BAA8B,EAC9BC,uBAAuB,CACxB;AAACF,OAAA,CAAAI,wBAAA,GAAAA,wBAAA;AAEK,IAAMC,aAAa,GAAG;EAC3BC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE;AACV,CAAC;;AAED;AAAAR,OAAA,CAAAK,aAAA,GAAAA,aAAA;AACO,IAAMI,iCAAiC,GAAG,sBAAsB;AAACT,OAAA,CAAAS,iCAAA,GAAAA,iCAAA;AAEjE,IAAMC,aAAa,GAAG,CAACD,iCAAiC,CAAC;AAACT,OAAA,CAAAU,aAAA,GAAAA,aAAA"}
|