@webex/internal-plugin-device 3.0.0-beta.9 → 3.0.0-bnr.2
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 +10 -6
- package/dist/config.js +0 -8
- package/dist/config.js.map +1 -1
- package/dist/constants.js +2 -3
- package/dist/constants.js.map +1 -1
- package/dist/device.js +94 -171
- package/dist/device.js.map +1 -1
- package/dist/features/feature-collection.js +1 -8
- package/dist/features/feature-collection.js.map +1 -1
- package/dist/features/feature-model.js +15 -42
- package/dist/features/feature-model.js.map +1 -1
- package/dist/features/features-model.js +9 -21
- package/dist/features/features-model.js.map +1 -1
- package/dist/features/index.js +0 -8
- package/dist/features/index.js.map +1 -1
- package/dist/index.js +2 -24
- package/dist/index.js.map +1 -1
- package/dist/interceptors/device-url.js +12 -33
- package/dist/interceptors/device-url.js.map +1 -1
- package/dist/internal-plugin-device.d.ts +91 -0
- package/dist/metrics.js +0 -2
- package/dist/metrics.js.map +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/dist/types/config.d.ts +10 -0
- package/dist/types/constants.d.ts +12 -0
- package/dist/types/device.d.ts +2 -0
- package/dist/types/features/feature-collection.d.ts +9 -0
- package/dist/types/features/feature-model.d.ts +29 -0
- package/dist/types/features/features-model.d.ts +9 -0
- package/dist/types/features/index.d.ts +4 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/interceptors/device-url.d.ts +15 -0
- package/dist/types/metrics.d.ts +5 -0
- package/package.json +10 -10
- package/src/config.js +8 -9
- package/src/constants.js +3 -5
- package/src/device.js +142 -146
- package/src/features/feature-collection.js +1 -1
- package/src/features/feature-model.js +5 -11
- package/src/features/features-model.js +3 -9
- package/src/features/index.js +1 -5
- package/src/index.js +3 -11
- package/src/interceptors/device-url.js +5 -7
- package/src/metrics.js +1 -2
- package/test/integration/spec/device.js +210 -239
- package/test/integration/spec/webex.js +9 -9
- package/test/unit/spec/device.js +44 -53
- package/test/unit/spec/features/feature-collection.js +2 -2
- package/test/unit/spec/features/feature-model.js +23 -39
- package/test/unit/spec/features/features-model.js +4 -12
- package/test/unit/spec/interceptors/device-url.js +69 -109
- package/test/unit/spec/wdm-dto.json +5 -13
package/README.md
CHANGED
|
@@ -28,28 +28,32 @@ import WebexCore from '@webex/webex-core';
|
|
|
28
28
|
const webex = new WebexCore();
|
|
29
29
|
|
|
30
30
|
// Namespace.
|
|
31
|
-
webex.internal.device
|
|
31
|
+
webex.internal.device;
|
|
32
32
|
|
|
33
33
|
// Register the device.
|
|
34
|
-
webex.internal.device
|
|
34
|
+
webex.internal.device
|
|
35
|
+
.register()
|
|
35
36
|
.then(() => {}) // On successful registration.
|
|
36
37
|
.catch(() => {}); // On failed registration.
|
|
37
38
|
|
|
38
39
|
// Refresh the device.
|
|
39
|
-
webex.internal.device
|
|
40
|
+
webex.internal.device
|
|
41
|
+
.refresh()
|
|
40
42
|
.then(() => {}) // On successful refresh.
|
|
41
43
|
.catch(() => {}); // On failed refresh.
|
|
42
44
|
|
|
43
45
|
// Unregister the device.
|
|
44
|
-
webex.internal.device
|
|
46
|
+
webex.internal.device
|
|
47
|
+
.unregister()
|
|
45
48
|
.then(() => {}) // On successful unregistration.
|
|
46
49
|
.catch(() => {}); // On failed unregistration.
|
|
47
50
|
|
|
48
51
|
// Get the current web socket url. Accepts a boolean to enable waiting for the
|
|
49
52
|
// url to populate.
|
|
50
|
-
webex.internal.device
|
|
53
|
+
webex.internal.device
|
|
54
|
+
.getWebSocketUrl(true)
|
|
51
55
|
.then((url) => {}) // Resolves to the url when it is retrievable.
|
|
52
|
-
.catch(() => {}) // Rejects when the url is not available.
|
|
56
|
+
.catch(() => {}); // Rejects when the url is not available.
|
|
53
57
|
|
|
54
58
|
// Commonly referenced properties.
|
|
55
59
|
|
package/dist/config.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
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
|
var _common = require("@webex/common");
|
|
12
|
-
|
|
13
9
|
var _default = {
|
|
14
10
|
device: {
|
|
15
11
|
/**
|
|
@@ -18,7 +14,6 @@ var _default = {
|
|
|
18
14
|
* @type {number}
|
|
19
15
|
*/
|
|
20
16
|
canRegisterWaitDuration: 10,
|
|
21
|
-
|
|
22
17
|
/**
|
|
23
18
|
* The default configuration group when sending registration requests.
|
|
24
19
|
*
|
|
@@ -39,14 +34,12 @@ var _default = {
|
|
|
39
34
|
systemVersion: '1.0.0'
|
|
40
35
|
}
|
|
41
36
|
},
|
|
42
|
-
|
|
43
37
|
/**
|
|
44
38
|
* When true, the **wdm** service will enforce an inactivity duration.
|
|
45
39
|
*
|
|
46
40
|
* @type {boolean}
|
|
47
41
|
*/
|
|
48
42
|
enableInactivityEnforcement: false,
|
|
49
|
-
|
|
50
43
|
/**
|
|
51
44
|
* When true, the device registration will include a ttl value of
|
|
52
45
|
* {@link config.device.ephemeralDeviceTTL} and refresh on an interval of
|
|
@@ -55,7 +48,6 @@ var _default = {
|
|
|
55
48
|
* @type {boolean}
|
|
56
49
|
*/
|
|
57
50
|
ephemeral: false,
|
|
58
|
-
|
|
59
51
|
/**
|
|
60
52
|
* The ttl value to include in device registration if
|
|
61
53
|
* {@link config.device.ephemeral} is true. Measured in seconds.
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["device","canRegisterWaitDuration","defaults","body","name","process","title","trim","undefined","inBrowser","deviceType","WEB","model","localizedModel","systemName","systemVersion","enableInactivityEnforcement","ephemeral","ephemeralDeviceTTL"],"sources":["config.js"],"sourcesContent":["import {inBrowser, deviceType} from '@webex/common';\n\nexport default {\n device: {\n
|
|
1
|
+
{"version":3,"names":["device","canRegisterWaitDuration","defaults","body","name","process","title","trim","undefined","inBrowser","deviceType","WEB","model","localizedModel","systemName","systemVersion","enableInactivityEnforcement","ephemeral","ephemeralDeviceTTL"],"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;AAAoD,eAErC;EACbA,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;AAAA"}
|
package/dist/constants.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
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.FEATURE_TYPES = exports.FEATURE_COLLECTION_USER = exports.FEATURE_COLLECTION_NAMES = exports.FEATURE_COLLECTION_ENTITLEMENT = exports.FEATURE_COLLECTION_DEVELOPER = exports.DEVICE_EVENT_REGISTRATION_SUCCESS = exports.DEVICE_EVENTS = exports.CISCO_DEVICE_URL = void 0;
|
|
10
8
|
// Feature constants.
|
|
11
9
|
var FEATURE_COLLECTION_DEVELOPER = 'developer';
|
|
@@ -22,8 +20,9 @@ var FEATURE_TYPES = {
|
|
|
22
20
|
BOOLEAN: 'boolean',
|
|
23
21
|
NUMBER: 'number',
|
|
24
22
|
STRING: 'string'
|
|
25
|
-
};
|
|
23
|
+
};
|
|
26
24
|
|
|
25
|
+
// Device constants.
|
|
27
26
|
exports.FEATURE_TYPES = FEATURE_TYPES;
|
|
28
27
|
var DEVICE_EVENT_REGISTRATION_SUCCESS = 'registration:success';
|
|
29
28
|
exports.DEVICE_EVENT_REGISTRATION_SUCCESS = DEVICE_EVENT_REGISTRATION_SUCCESS;
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FEATURE_COLLECTION_DEVELOPER","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
|
|
1
|
+
{"version":3,"names":["FEATURE_COLLECTION_DEVELOPER","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;AAAC;AACjD,IAAMC,8BAA8B,GAAG,aAAa;AAAC;AACrD,IAAMC,uBAAuB,GAAG,MAAM;AAAC;AAEvC,IAAMC,gBAAgB,GAAG,kBAAkB;AAAC;AAE5C,IAAMC,wBAAwB,GAAG,CACtCJ,4BAA4B,EAC5BC,8BAA8B,EAC9BC,uBAAuB,CACxB;AAAC;AAEK,IAAMG,aAAa,GAAG;EAC3BC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE;AACV,CAAC;;AAED;AAAA;AACO,IAAMC,iCAAiC,GAAG,sBAAsB;AAAC;AAEjE,IAAMC,aAAa,GAAG,CAACD,iCAAiC,CAAC;AAAC"}
|