@webex/internal-plugin-device 3.0.0-beta.8 → 3.0.0-beta.81

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.
Files changed (40) hide show
  1. package/README.md +10 -6
  2. package/dist/config.js +0 -8
  3. package/dist/config.js.map +1 -1
  4. package/dist/constants.js +2 -3
  5. package/dist/constants.js.map +1 -1
  6. package/dist/device.js +94 -171
  7. package/dist/device.js.map +1 -1
  8. package/dist/features/feature-collection.js +1 -8
  9. package/dist/features/feature-collection.js.map +1 -1
  10. package/dist/features/feature-model.js +15 -42
  11. package/dist/features/feature-model.js.map +1 -1
  12. package/dist/features/features-model.js +9 -21
  13. package/dist/features/features-model.js.map +1 -1
  14. package/dist/features/index.js +0 -8
  15. package/dist/features/index.js.map +1 -1
  16. package/dist/index.js +2 -24
  17. package/dist/index.js.map +1 -1
  18. package/dist/interceptors/device-url.js +12 -33
  19. package/dist/interceptors/device-url.js.map +1 -1
  20. package/dist/metrics.js +0 -2
  21. package/dist/metrics.js.map +1 -1
  22. package/package.json +10 -10
  23. package/src/config.js +8 -9
  24. package/src/constants.js +3 -5
  25. package/src/device.js +142 -146
  26. package/src/features/feature-collection.js +1 -1
  27. package/src/features/feature-model.js +5 -11
  28. package/src/features/features-model.js +3 -9
  29. package/src/features/index.js +1 -5
  30. package/src/index.js +3 -11
  31. package/src/interceptors/device-url.js +5 -7
  32. package/src/metrics.js +1 -2
  33. package/test/integration/spec/device.js +210 -239
  34. package/test/integration/spec/webex.js +9 -9
  35. package/test/unit/spec/device.js +44 -53
  36. package/test/unit/spec/features/feature-collection.js +2 -2
  37. package/test/unit/spec/features/feature-model.js +23 -39
  38. package/test/unit/spec/features/features-model.js +4 -12
  39. package/test/unit/spec/interceptors/device-url.js +69 -109
  40. 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.register()
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.refresh()
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.unregister()
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.getWebSocketUrl(true)
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.
@@ -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\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 /**\n * The default body configuration of registration requests.\n *\n * @type {Object}\n */\n body: {\n name: (typeof process.title === 'string' ?\n process.title.trim() : undefined) ||\n inBrowser && 'browser' || '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;;eAEe;EACbA,MAAM,EAAE;IAEN;AACJ;AACA;AACA;AACA;IACIC,uBAAuB,EAAE,EAPnB;;IASN;AACJ;AACA;AACA;AACA;IACIC,QAAQ,EAAE;MAER;AACN;AACA;AACA;AACA;MACMC,IAAI,EAAE;QACJC,IAAI,EAAE,CAAC,OAAOC,OAAO,CAACC,KAAf,KAAyB,QAAzB,GACLD,OAAO,CAACC,KAAR,CAAcC,IAAd,EADK,GACkBC,SADnB,KAEJC,iBAAA,IAAa,SAFT,IAEsB,YAHxB;QAIJC,UAAU,EAAEA,kBAAA,CAAWC,GAJnB;QAKJC,KAAK,EAAE,YALH;QAMJC,cAAc,EAAE,cANZ;QAOJC,UAAU,EAAE,cAPR;QAQJC,aAAa,EAAE;MARX;IAPE,CAdJ;;IAiCN;AACJ;AACA;AACA;AACA;IACIC,2BAA2B,EAAE,KAtCvB;;IAwCN;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,SAAS,EAAE,KA/CL;;IAiDN;AACJ;AACA;AACA;AACA;AACA;IACIC,kBAAkB,EAAE,KAAK;EAvDnB;AADK,C"}
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
- }; // Device constants.
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;
@@ -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\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 = [\n DEVICE_EVENT_REGISTRATION_SUCCESS\n];\n"],"mappings":";;;;;;;;;AAAA;AACO,IAAMA,4BAA4B,GAAG,WAArC;;AACA,IAAMC,8BAA8B,GAAG,aAAvC;;AACA,IAAMC,uBAAuB,GAAG,MAAhC;;AAEA,IAAMC,gBAAgB,GAAG,kBAAzB;;AAEA,IAAMC,wBAAwB,GAAG,CACtCJ,4BADsC,EAEtCC,8BAFsC,EAGtCC,uBAHsC,CAAjC;;AAMA,IAAMG,aAAa,GAAG;EAC3BC,OAAO,EAAE,SADkB;EAE3BC,MAAM,EAAE,QAFmB;EAG3BC,MAAM,EAAE;AAHmB,CAAtB,C,CAMP;;;AACO,IAAMC,iCAAiC,GAAG,sBAA1C;;AAEA,IAAMC,aAAa,GAAG,CAC3BD,iCAD2B,CAAtB"}
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"}