@webex/internal-plugin-device 3.0.0-bnr.4 → 3.0.0

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 (45) hide show
  1. package/.eslintrc.js +6 -0
  2. package/babel.config.js +3 -0
  3. package/dist/config.js +1 -2
  4. package/dist/config.js.map +1 -1
  5. package/dist/constants.js +8 -16
  6. package/dist/constants.js.map +1 -1
  7. package/dist/device.js +25 -7
  8. package/dist/device.js.map +1 -1
  9. package/dist/features/feature-collection.js +1 -2
  10. package/dist/features/feature-collection.js.map +1 -1
  11. package/dist/features/feature-model.js +8 -11
  12. package/dist/features/feature-model.js.map +1 -1
  13. package/dist/features/features-model.js +1 -2
  14. package/dist/features/features-model.js.map +1 -1
  15. package/dist/features/index.js.map +1 -1
  16. package/dist/index.js +2 -2
  17. package/dist/index.js.map +1 -1
  18. package/dist/interceptors/device-url.js +6 -5
  19. package/dist/interceptors/device-url.js.map +1 -1
  20. package/dist/ipNetworkDetector.js +199 -0
  21. package/dist/ipNetworkDetector.js.map +1 -0
  22. package/dist/metrics.js +1 -2
  23. package/dist/metrics.js.map +1 -1
  24. package/jest.config.js +3 -0
  25. package/package.json +28 -12
  26. package/process +1 -0
  27. package/src/device.js +22 -0
  28. package/src/ipNetworkDetector.ts +176 -0
  29. package/test/unit/spec/device.js +77 -12
  30. package/test/unit/spec/features/feature-collection.js +1 -1
  31. package/test/unit/spec/features/feature-model.js +20 -20
  32. package/test/unit/spec/features/features-model.js +4 -4
  33. package/test/unit/spec/ipNetworkDetector.js +410 -0
  34. package/dist/internal-plugin-device.d.ts +0 -91
  35. package/dist/tsdoc-metadata.json +0 -11
  36. package/dist/types/config.d.ts +0 -10
  37. package/dist/types/constants.d.ts +0 -12
  38. package/dist/types/device.d.ts +0 -2
  39. package/dist/types/features/feature-collection.d.ts +0 -9
  40. package/dist/types/features/feature-model.d.ts +0 -29
  41. package/dist/types/features/features-model.d.ts +0 -9
  42. package/dist/types/features/index.d.ts +0 -4
  43. package/dist/types/index.d.ts +0 -8
  44. package/dist/types/interceptors/device-url.d.ts +0 -15
  45. package/dist/types/metrics.d.ts +0 -5
package/.eslintrc.js ADDED
@@ -0,0 +1,6 @@
1
+ const config = {
2
+ root: true,
3
+ extends: ['@webex/eslint-config-legacy'],
4
+ };
5
+
6
+ module.exports = config;
@@ -0,0 +1,3 @@
1
+ const babelConfigLegacy = require('@webex/babel-config-legacy');
2
+
3
+ module.exports = babelConfigLegacy;
package/dist/config.js CHANGED
@@ -6,7 +6,7 @@ _Object$defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _common = require("@webex/common");
9
- var _default = {
9
+ var _default = exports.default = {
10
10
  device: {
11
11
  /**
12
12
  * The duration to wait for the catalog to populate in seconds.
@@ -57,5 +57,4 @@ var _default = {
57
57
  ephemeralDeviceTTL: 30 * 60
58
58
  }
59
59
  };
60
- exports.default = _default;
61
60
  //# sourceMappingURL=config.js.map
@@ -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 * 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"}
1
+ {"version":3,"names":["_common","require","_default","exports","default","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,IAAAA,OAAA,GAAAC,OAAA;AAAoD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,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,CAAC,CAAC,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"}
package/dist/constants.js CHANGED
@@ -6,26 +6,18 @@ _Object$defineProperty(exports, "__esModule", {
6
6
  });
7
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;
8
8
  // Feature constants.
9
- var FEATURE_COLLECTION_DEVELOPER = 'developer';
10
- exports.FEATURE_COLLECTION_DEVELOPER = FEATURE_COLLECTION_DEVELOPER;
11
- var FEATURE_COLLECTION_ENTITLEMENT = 'entitlement';
12
- exports.FEATURE_COLLECTION_ENTITLEMENT = FEATURE_COLLECTION_ENTITLEMENT;
13
- var FEATURE_COLLECTION_USER = 'user';
14
- exports.FEATURE_COLLECTION_USER = FEATURE_COLLECTION_USER;
15
- var CISCO_DEVICE_URL = 'cisco-device-url';
16
- exports.CISCO_DEVICE_URL = CISCO_DEVICE_URL;
17
- var FEATURE_COLLECTION_NAMES = [FEATURE_COLLECTION_DEVELOPER, FEATURE_COLLECTION_ENTITLEMENT, FEATURE_COLLECTION_USER];
18
- exports.FEATURE_COLLECTION_NAMES = FEATURE_COLLECTION_NAMES;
19
- var FEATURE_TYPES = {
9
+ var FEATURE_COLLECTION_DEVELOPER = exports.FEATURE_COLLECTION_DEVELOPER = 'developer';
10
+ var FEATURE_COLLECTION_ENTITLEMENT = exports.FEATURE_COLLECTION_ENTITLEMENT = 'entitlement';
11
+ var FEATURE_COLLECTION_USER = exports.FEATURE_COLLECTION_USER = 'user';
12
+ var CISCO_DEVICE_URL = exports.CISCO_DEVICE_URL = 'cisco-device-url';
13
+ var FEATURE_COLLECTION_NAMES = exports.FEATURE_COLLECTION_NAMES = [FEATURE_COLLECTION_DEVELOPER, FEATURE_COLLECTION_ENTITLEMENT, FEATURE_COLLECTION_USER];
14
+ var FEATURE_TYPES = exports.FEATURE_TYPES = {
20
15
  BOOLEAN: 'boolean',
21
16
  NUMBER: 'number',
22
17
  STRING: 'string'
23
18
  };
24
19
 
25
20
  // Device constants.
26
- exports.FEATURE_TYPES = FEATURE_TYPES;
27
- var DEVICE_EVENT_REGISTRATION_SUCCESS = 'registration:success';
28
- exports.DEVICE_EVENT_REGISTRATION_SUCCESS = DEVICE_EVENT_REGISTRATION_SUCCESS;
29
- var DEVICE_EVENTS = [DEVICE_EVENT_REGISTRATION_SUCCESS];
30
- exports.DEVICE_EVENTS = DEVICE_EVENTS;
21
+ var DEVICE_EVENT_REGISTRATION_SUCCESS = exports.DEVICE_EVENT_REGISTRATION_SUCCESS = 'registration:success';
22
+ var DEVICE_EVENTS = exports.DEVICE_EVENTS = [DEVICE_EVENT_REGISTRATION_SUCCESS];
31
23
  //# sourceMappingURL=constants.js.map
@@ -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 = [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"}
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,GAAAC,OAAA,CAAAD,4BAAA,GAAG,WAAW;AAChD,IAAME,8BAA8B,GAAAD,OAAA,CAAAC,8BAAA,GAAG,aAAa;AACpD,IAAMC,uBAAuB,GAAAF,OAAA,CAAAE,uBAAA,GAAG,MAAM;AAEtC,IAAMC,gBAAgB,GAAAH,OAAA,CAAAG,gBAAA,GAAG,kBAAkB;AAE3C,IAAMC,wBAAwB,GAAAJ,OAAA,CAAAI,wBAAA,GAAG,CACtCL,4BAA4B,EAC5BE,8BAA8B,EAC9BC,uBAAuB,CACxB;AAEM,IAAMG,aAAa,GAAAL,OAAA,CAAAK,aAAA,GAAG;EAC3BC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE;AACV,CAAC;;AAED;AACO,IAAMC,iCAAiC,GAAAT,OAAA,CAAAS,iCAAA,GAAG,sBAAsB;AAEhE,IAAMC,aAAa,GAAAV,OAAA,CAAAU,aAAA,GAAG,CAACD,iCAAiC,CAAC"}
package/dist/device.js CHANGED
@@ -23,9 +23,10 @@ var _commonTimers = require("@webex/common-timers");
23
23
  var _metrics = _interopRequireDefault(require("./metrics"));
24
24
  var _constants = require("./constants");
25
25
  var _featuresModel = _interopRequireDefault(require("./features/features-model"));
26
- var _dec, _dec2, _dec3, _dec4, _dec5, _obj;
27
- 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$getOwnPropertyDescriptor2(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
28
- 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$getOwnPropertyDescriptor2(source, key)); }); } return target; }
26
+ var _ipNetworkDetector = _interopRequireDefault(require("./ipNetworkDetector"));
27
+ var _dec, _dec2, _dec3, _dec4, _dec5, _obj; // Internal Dependencies
28
+ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor2(e, r).enumerable; })), t.push.apply(t, o); } return t; }
29
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor2(t, r)); }); } return e; }
29
30
  /**
30
31
  * Determine if the plugin should be initialized based on cached storage.
31
32
  *
@@ -48,7 +49,13 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
48
49
  *
49
50
  * @type {FeaturesModel}
50
51
  */
51
- features: _featuresModel.default
52
+ features: _featuresModel.default,
53
+ /**
54
+ * Helper class for detecting what IP network version (ipv4, ipv6) we're on.
55
+ *
56
+ * @type {IpNetworkDetector}
57
+ */
58
+ ipNetworkDetector: _ipNetworkDetector.default
52
59
  },
53
60
  /**
54
61
  * A collection of device properties mostly assigned by the retrieved DTO from
@@ -388,6 +395,9 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
388
395
  if (_this2.config.ephemeral) {
389
396
  body.ttl = _this2.config.ephemeralDeviceTTL;
390
397
  }
398
+ _this2.webex.internal.newMetrics.submitInternalEvent({
399
+ name: 'internal.register.device.request'
400
+ });
391
401
 
392
402
  // This will be replaced by a `create()` method.
393
403
  return _this2.request({
@@ -396,7 +406,16 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
396
406
  resource: 'devices',
397
407
  body: body,
398
408
  headers: headers
409
+ }).catch(function (error) {
410
+ _this2.webex.internal.newMetrics.submitInternalEvent({
411
+ name: 'internal.register.device.response'
412
+ });
413
+ throw error;
399
414
  }).then(function (response) {
415
+ // Do not add any processing of response above this as that will affect timestamp
416
+ _this2.webex.internal.newMetrics.submitInternalEvent({
417
+ name: 'internal.register.device.response'
418
+ });
400
419
  _this2.webex.internal.metrics.submitClientMetrics(_metrics.default.JS_SDK_WDM_REGISTRATION_SUCCESSFUL);
401
420
  return _this2.processRegistrationSuccess(response);
402
421
  }).catch(function (error) {
@@ -716,8 +735,7 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
716
735
  _this9.resetLogoutTimer();
717
736
  });
718
737
  } /* eslint-enable require-jsdoc */,
719
- version: "3.0.0-bnr.4"
738
+ version: "3.0.0"
720
739
  }, ((0, _applyDecoratedDescriptor2.default)(_obj, "refresh", [_common.oneFlight, _dec], (0, _getOwnPropertyDescriptor.default)(_obj, "refresh"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "register", [_common.oneFlight, _dec2], (0, _getOwnPropertyDescriptor.default)(_obj, "register"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "unregister", [_common.oneFlight, _dec3], (0, _getOwnPropertyDescriptor.default)(_obj, "unregister"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "markUrlFailedAndGetNew", [_dec4], (0, _getOwnPropertyDescriptor.default)(_obj, "markUrlFailedAndGetNew"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "initialize", [_dec5], (0, _getOwnPropertyDescriptor.default)(_obj, "initialize"), _obj)), _obj)));
721
- var _default = Device;
722
- exports.default = _default;
740
+ var _default = exports.default = Device;
723
741
  //# sourceMappingURL=device.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["decider","config","ephemeral","Device","WebexPlugin","extend","waitForValue","deprecated","persist","namespace","extraProperties","idAttribute","children","features","FeaturesModel","props","clientMessagingGiphy","customerCompanyName","customerLogoUrl","deviceType","helpUrl","intranetInactivityDuration","intranetInactivityCheckUrl","inNetworkInactivityDuration","ecmEnabledForAllUsers","ecmSupportedStorageProviders","modificationTime","navigationBarColor","partnerCompanyName","partnerLogoUrl","peopleInsightsEnabled","reportingSiteDesc","reportingSiteUrl","searchEncryptionKeyUrl","showSupportText","supportProviderCompanyName","supportProviderLogoUrl","url","userId","webFileShareControl","webSocketUrl","whiteboardFileShareControl","derived","registered","deps","fn","session","logoutTimer","lastUserActivityDate","isReachabilityChecked","isInMeeting","isInNetwork","meetingStarted","webex","trigger","meetingEnded","refresh","logger","info","canRegister","then","register","body","serialize","mediaCluster","etag","ttl","ephemeralDeviceTTL","headers","defaults","request","method","uri","response","processRegistrationSuccess","catch","reason","statusCode","clear","reject","service","resource","internal","metrics","submitClientMetrics","METRICS","JS_SDK_WDM_REGISTRATION_SUCCESSFUL","error","JS_SDK_WDM_REGISTRATION_FAILED","fields","unregister","warn","resolve","services","waitForCatalog","canRegisterWaitDuration","get","Error","join","checkNetworkReachability","resetLogoutTimer","trackingid","args","prototype","getWebSocketUrl","wait","waitForRegistration","convertUrlToPriorityHostUrl","message","wsUrl","serviceHostMap","user","reset","entitlement","set","delay","refreshTimer","safeSetTimeout","DEVICE_EVENT_REGISTRATION_SUCCESS","clearTimeout","off","unset","enableInactivityEnforcement","setLogoutTimer","duration","on","logout","timeout","timeoutTimer","once","markUrlFailedAndGetNew","markFailedUrl","initialize","FEATURE_COLLECTION_NAMES","forEach","collectionName","model","value","options","listenTo","oneFlight"],"sources":["device.js"],"sourcesContent":["// Internal Dependencies\nimport {deprecated, oneFlight} from '@webex/common';\nimport {persist, waitForValue, WebexPlugin} from '@webex/webex-core';\nimport {safeSetTimeout} from '@webex/common-timers';\n\nimport METRICS from './metrics';\nimport {FEATURE_COLLECTION_NAMES, DEVICE_EVENT_REGISTRATION_SUCCESS} from './constants';\nimport FeaturesModel from './features/features-model';\n\n/**\n * Determine if the plugin should be initialized based on cached storage.\n *\n * @returns {boolean} - If the device is ephemeral.\n */\nfunction decider() {\n return !this.config.ephemeral;\n}\n\nconst Device = WebexPlugin.extend({\n // Ampersand property members.\n\n namespace: 'Device',\n\n // Allow for extra properties to prevent the plugin from failing due to\n // **WDM** service DTO changes.\n extraProperties: 'allow',\n\n idAttribute: 'url',\n\n children: {\n /**\n * The class object that contains all of the feature collections.\n *\n * @type {FeaturesModel}\n */\n features: FeaturesModel,\n },\n\n /**\n * A collection of device properties mostly assigned by the retrieved DTO from\n * the **WDM** service that are mapped against the ampersand properties.\n *\n * @type {Object}\n */\n props: {\n /**\n * This property determines whether or not giphy support is enabled.\n *\n * @type {'ALLOW' | 'BLOCK'}\n */\n clientMessagingGiphy: 'string',\n\n /**\n * This property should store the company name.\n *\n * @type {string}\n */\n customerCompanyName: 'string',\n\n /**\n * This property should store the logo url.\n *\n * @type {string}\n */\n customerLogoUrl: 'string',\n\n /**\n * This property doesn't have any real values, but is sent during device\n * refresh to prevent the **wdm** service from falling back to an iOS device\n * type.\n *\n * @type {string}\n */\n deviceType: 'string',\n\n /**\n * This property should store the help url.\n *\n * @type {string}\n */\n helpUrl: 'string',\n\n /**\n * This property should store the intranet inactivity timer duration.\n *\n * @type {number}\n */\n intranetInactivityDuration: 'number',\n\n /**\n * This property stores the url required to validate if the device is able\n * to actively reach the intranet network.\n *\n * @type {string}\n */\n intranetInactivityCheckUrl: 'string',\n\n /**\n * This property stores the inactivity timer duration, and could possibly\n * deprecate the `intranetInactivityDuration` property.\n *\n * @type {number}\n */\n inNetworkInactivityDuration: 'number',\n\n /**\n * This property stores the ECM (external content management) enabled value\n * for the whole organization.\n *\n * @type {boolean}\n */\n ecmEnabledForAllUsers: ['boolean', false, false],\n\n /**\n * This property stores an array of ECM (external content management)\n * providers that are currently available.\n *\n * @returns {Array<string>}\n */\n ecmSupportedStorageProviders: ['array', false, () => []],\n\n /**\n * This property stores the modification time value retrieved from the\n * **WDM** endpoint formatted as ISO 8601.\n *\n * @type {string}\n */\n modificationTime: 'string',\n\n /**\n * This property stores the navigation bar color.\n *\n * @type {string}\n */\n navigationBarColor: 'string',\n\n /**\n * This property stores the partner company's name when available.\n *\n * @type {string}\n */\n partnerCompanyName: 'string',\n\n /**\n * This property stores the partner company's logo when available.\n *\n * @type {string}\n */\n partnerLogoUrl: 'string',\n\n /**\n * This property stores the availability of people data from the **WDM**\n * service.\n *\n * @type {boolean}\n */\n peopleInsightsEnabled: 'boolean',\n\n /**\n * This property stores the reporting site's description when available.\n *\n * @type {string}\n */\n reportingSiteDesc: 'string',\n\n /**\n * This property stores the reporting site's access url when available.\n *\n * @type {string}\n */\n reportingSiteUrl: 'string',\n\n /**\n * This property stores the encryption key url when available.\n *\n * @type {string}\n */\n searchEncryptionKeyUrl: 'string',\n\n /**\n * This property stores the availability of support-provided text from the\n * **WDM** service.\n *\n * @type {boolean}\n */\n showSupportText: 'boolean',\n\n /**\n * This property stores the support provider's company name when available.\n *\n * @type {string}\n */\n supportProviderCompanyName: 'string',\n\n /**\n * This property stores the support provider's logo url when available.\n *\n * @type {string}\n */\n supportProviderLogoUrl: 'string',\n\n /**\n * This property stores the device's url retrieved from a registration\n * request. This property gets set via the initial registration process by a\n * `this.set()` method.\n *\n * @type {string}\n */\n url: 'string',\n\n /**\n * This property stores the device's userId uuid value, which can also be\n * derived from the device's registerd user's userId retrieved from\n * the **Hydra** service.\n *\n * @type {string}\n */\n userId: 'string',\n\n /**\n * This property stores whether or not file sharing is enabled\n *\n * @type {'BLOCK_BOTH' | 'BLOCK_UPLOAD'}\n */\n webFileShareControl: 'string',\n\n /**\n * This property stores the current web socket url used by the registered\n * device.\n *\n * @type {string}\n */\n webSocketUrl: 'string',\n\n /**\n * This property stores the value indicating whether or not white board file\n * sharing is enabled for the current device.\n *\n * @type {'ALLOW' | 'BLOCK'}\n */\n whiteboardFileShareControl: 'string',\n },\n\n /**\n * A list of derived properties that populate based when their parent data\n * available via the device's properties.\n *\n * @type {Object}\n */\n derived: {\n /**\n * This property determines if the current device is registered.\n *\n * @type {boolean}\n */\n registered: {\n deps: ['url'],\n\n /**\n * Checks if the device is registered by validating that the url exists.\n * Amperstand does not allow this to method to be written as an arrow\n * function.\n *\n * @returns {boolean}\n */\n fn() {\n return !!this.url;\n },\n },\n },\n\n /**\n * Stores timer data as well as other state details.\n *\n * @type {Object}\n */\n session: {\n /**\n * This property stores the logout timer object\n *\n * @type {any}\n */\n logoutTimer: 'any',\n\n /**\n * This property stores the date for the last activity the user made\n * with the current device.\n *\n * @type {number}\n */\n lastUserActivityDate: 'number',\n\n /**\n * This property stores whether or not the reachability check has been\n * performed to prevent the reachability check from performing its\n * operation more than once after a successful check.\n *\n * @returns {boolean}\n */\n isReachabilityChecked: ['boolean', false, false],\n\n /**\n * This property stores whether or not the current device is in a meeting\n * to prevent an unneeded timeout of a meeting due to inactivity.\n *\n * @type {boolean}\n */\n isInMeeting: 'boolean',\n\n /**\n * This property identifies if the device is currently in network to prevent\n * the `resetLogoutTimer()` method from being called repeatedly once its\n * known client is connected to the organization's internal network.\n *\n * @type {boolean}\n */\n isInNetwork: 'boolean',\n },\n\n // Event method members.\n\n /**\n * Trigger meeting started event for webex instance. Used by web-client team.\n *\n * @returns {void}\n */\n meetingStarted() {\n this.webex.trigger('meeting started');\n },\n\n /**\n * Trigger meeting ended event for webex instance. Used by web-client team.\n *\n * @returns {void}\n */\n meetingEnded() {\n this.webex.trigger('meeting ended');\n },\n\n // Registration method members\n\n /* eslint-disable require-jsdoc */\n /**\n * Refresh the current registered device if able.\n *\n * @returns {Promise<void, Error>}\n */\n @oneFlight\n @waitForValue('@')\n refresh() {\n this.logger.info('device: refreshing');\n\n // Validate that the device can be registered.\n return this.canRegister().then(() => {\n // Validate if the device is not registered and register instead.\n if (!this.registered) {\n this.logger.info('device: device not registered, registering');\n\n return this.register();\n }\n\n // Merge body configurations, overriding defaults.\n const body = {\n ...this.serialize(),\n ...(this.config.body ? this.config.body : {}),\n };\n\n // Remove unneeded properties from the body object.\n delete body.features;\n delete body.mediaCluster;\n delete body.etag;\n\n // Append a ttl value if the device is marked as ephemeral.\n if (this.config.ephemeral) {\n body.ttl = this.config.ephemeralDeviceTTL;\n }\n\n // Merge header configurations, overriding defaults.\n const headers = {\n ...(this.config.defaults.headers ? this.config.defaults.headers : {}),\n ...(this.config.headers ? this.config.headers : {}),\n // If etag is sent, WDM will not send developer feature toggles unless they have changed\n ...(this.etag ? {'If-None-Match': this.etag} : {}),\n };\n\n return this.request({\n method: 'PUT',\n uri: this.url,\n body,\n headers,\n })\n .then((response) => this.processRegistrationSuccess(response))\n .catch((reason) => {\n // Handle a 404 error, which indicates that the device is no longer\n // valid and needs to be registered as a new device.\n if (reason.statusCode === 404) {\n this.logger.info('device: refresh failed, device is not valid');\n this.logger.info('device: attempting to register a new device');\n\n this.clear();\n\n return this.register();\n }\n\n return Promise.reject(reason);\n });\n });\n },\n\n /**\n * Register or refresh a device depending on the current device state. Device\n * registration utilizes the services plugin to send the request to the\n * **WDM** service.\n *\n * @returns {Promise<void, Error>}\n */\n @oneFlight\n @waitForValue('@')\n register() {\n this.logger.info('device: registering');\n\n // Validate that the device can be registered.\n return this.canRegister().then(() => {\n // Validate if the device is already registered and refresh instead.\n if (this.registered) {\n this.logger.info('device: device already registered, refreshing');\n\n return this.refresh();\n }\n\n // Merge body configurations, overriding defaults.\n const body = {\n ...(this.config.defaults.body ? this.config.defaults.body : {}),\n ...(this.config.body ? this.config.body : {}),\n };\n\n // Merge header configurations, overriding defaults.\n const headers = {\n ...(this.config.defaults.headers ? this.config.defaults.headers : {}),\n ...(this.config.headers ? this.config.headers : {}),\n };\n\n // Append a ttl value if the device is marked as ephemeral\n if (this.config.ephemeral) {\n body.ttl = this.config.ephemeralDeviceTTL;\n }\n\n // This will be replaced by a `create()` method.\n return this.request({\n method: 'POST',\n service: 'wdm',\n resource: 'devices',\n body,\n headers,\n })\n .then((response) => {\n this.webex.internal.metrics.submitClientMetrics(\n METRICS.JS_SDK_WDM_REGISTRATION_SUCCESSFUL\n );\n\n return this.processRegistrationSuccess(response);\n })\n .catch((error) => {\n this.webex.internal.metrics.submitClientMetrics(METRICS.JS_SDK_WDM_REGISTRATION_FAILED, {\n fields: {error},\n });\n throw error;\n });\n });\n },\n\n /**\n * Unregister the current registered device if available. Unregistering a\n * device utilizes the services plugin to send the request to the **WDM**\n * service.\n *\n * @returns {Promise<void, Error>}\n */\n @oneFlight\n @waitForValue('@')\n unregister() {\n this.logger.info('device: unregistering');\n\n if (!this.registered) {\n this.logger.warn('device: not registered');\n\n return Promise.resolve();\n }\n\n return this.request({\n uri: this.url,\n method: 'DELETE',\n }).then(() => this.clear());\n },\n /* eslint-enable require-jsdoc */\n\n // Helper method members\n\n /**\n * Determine if registration methods can be performed. This method utilizes\n * the `services` plugin to confirm if the appropriate service urls are\n * available for device registration.\n *\n * @returns {Promise<void, Error>}\n */\n canRegister() {\n this.logger.info('device: validating if registration can occur');\n\n // Destructure the services plugin for ease of reference.\n const {services} = this.webex.internal;\n\n // Wait for the postauth catalog to populate.\n return services.waitForCatalog('postauth', this.config.canRegisterWaitDuration).then(() =>\n // Validate that the service exists after waiting for the catalog.\n services.get('wdm')\n ? Promise.resolve()\n : Promise.reject(\n new Error(\n [\n 'device: cannot register,',\n \"'wdm' service is not available from the postauth catalog\",\n ].join(' ')\n )\n )\n );\n },\n\n /**\n * Check if the device can currently reach the inactivity check url.\n *\n * @returns {Promise<void, Error>}\n */\n checkNetworkReachability() {\n this.logger.info('device: checking network reachability');\n\n // Validate if the device has been checked and reset the logout timer.\n if (this.isReachabilityChecked) {\n return Promise.resolve(this.resetLogoutTimer());\n }\n\n this.isReachabilityChecked = true;\n\n // Validate if the device has a intranet checking url.\n if (!this.intranetInactivityCheckUrl) {\n this.isInNetwork = false;\n\n return Promise.resolve(this.resetLogoutTimer());\n }\n\n // Clear unnecessary headers for reachability request.\n const headers = {\n 'cisco-no-http-redirect': null,\n 'spark-user-agent': null,\n trackingid: null,\n };\n\n // Send the network reachability request.\n return this.request({\n headers,\n method: 'GET',\n uri: this.intranetInactivityCheckUrl,\n })\n .then(() => {\n this.isInNetwork = true;\n\n return Promise.resolve(this.resetLogoutTimer());\n })\n .catch(() => {\n this.logger.info('device: did not reach ping endpoint');\n this.logger.info('device: triggering off-network timer');\n\n this.isInNetwork = false;\n\n return Promise.resolve(this.resetLogoutTimer());\n });\n },\n\n /**\n * Clears the registration ttl value if available.\n *\n * @param {Object} options - Values to be cleared.\n * @returns {void}\n */\n clear(...args) {\n this.logger.info('device: clearing registered device');\n\n // Prototype the extended class in order to preserve the parent member.\n Reflect.apply(WebexPlugin.prototype.clear, this, args);\n },\n\n /**\n * Get the current websocket url with the appropriate priority host.\n *\n * @param {boolean} [wait=false] - Willing to wait on a valid url.\n * @returns {Promise<string, Error>} - The priority-mapped web socket url.\n */\n getWebSocketUrl(wait = false) {\n this.logger.info('device: getting the current websocket url');\n\n // Destructure the services plugin for ease of reference.\n const {services} = this.webex.internal;\n\n // Validate if the method should wait for registration.\n if (wait) {\n return this.waitForRegistration()\n .then(() => services.convertUrlToPriorityHostUrl(this.webSocketUrl))\n .catch((error) => {\n this.logger.warn(error.message);\n\n return Promise.reject(new Error('device: failed to get the current websocket url'));\n });\n }\n\n // Validate if the device is registered.\n if (!this.registered) {\n return Promise.reject(\n new Error('device: cannot get websocket url, device is not registered')\n );\n }\n\n // Attempt to collect the priority-host-mapped web socket URL.\n const wsUrl = services.convertUrlToPriorityHostUrl(this.webSocketUrl);\n\n // Validate that the url was collected.\n if (wsUrl) {\n return Promise.resolve(wsUrl);\n }\n\n return Promise.reject(new Error('device: failed to get the current websocket url'));\n },\n\n /**\n * Process a successful device registration.\n *\n * @param {Object} response - response object from registration success.\n * @returns {void}\n */\n processRegistrationSuccess(response) {\n this.logger.info('device: received registration payload');\n\n // Clone the response body for service cleaning.\n const body = {...response.body};\n\n // Clean service data.\n delete body.services;\n delete body.serviceHostMap;\n\n const {etag} = response.headers || {};\n\n if (this.etag && etag && this.etag === etag) {\n // If current etag matches the previous one and we have sent\n // If-None-Match header the developer and entitlement feature\n // toggles will not be returned\n const {features} = body;\n\n delete body.features;\n // When using the etag feature cache, user and entitlement features are still returned\n this.features.user.reset(features.user);\n this.features.entitlement.reset(features.entitlement);\n }\n\n // Assign the recieved DTO from **WDM** to this device.\n this.set(body);\n\n // Assign the new etag to this device.\n this.set({etag});\n\n // Validate if device is ephemeral and setup refresh timer.\n if (this.config.ephemeral) {\n this.logger.info('device: enqueuing device refresh');\n\n const delay = (this.config.ephemeralDeviceTTL / 2 + 60) * 1000;\n\n this.refreshTimer = safeSetTimeout(() => this.refresh(), delay);\n }\n\n // Emit the registration:success event.\n this.trigger(DEVICE_EVENT_REGISTRATION_SUCCESS, this);\n },\n\n /**\n * Reset the current local logout timer for the registered device if\n * registered.\n *\n * @returns {void}\n */\n resetLogoutTimer() {\n this.logger.info('device: resetting logout timer');\n\n // Clear current logout timer.\n clearTimeout(this.logoutTimer);\n\n // Remove last activity date event listener.\n this.off('change:lastUserActivityDate');\n\n // Remove the logout timer.\n this.unset('logoutTimer');\n\n // Validate if the device is currently in a meeting and is configured to\n // required inactivity enforcement.\n if (\n !this.isInMeeting &&\n this.config.enableInactivityEnforcement &&\n this.isReachabilityChecked\n ) {\n if (this.isInNetwork) {\n this.setLogoutTimer(this.inNetworkInactivityDuration);\n } else {\n this.setLogoutTimer(this.intranetInactivityDuration);\n }\n }\n },\n\n /**\n * Set the value of the logout timer for the current registered device.\n *\n * @param {number} duration - Value in seconds of the new logout timer.\n * @returns {void}\n */\n setLogoutTimer(duration) {\n this.logger.info('device: setting logout timer');\n\n if (!duration || duration <= 0) {\n return;\n }\n\n // Setup user activity date event listener.\n this.on('change:lastUserActivityDate', () => {\n this.resetLogoutTimer();\n });\n\n // Initialize a new timer.\n this.logoutTimer = safeSetTimeout(() => {\n this.webex.logout();\n }, duration * 1000);\n },\n\n /**\n * Wait for the device to be registered.\n *\n * @param {number} [timeout=10] - The maximum duration to wait, in seconds.\n * @returns {Promise<void, Error>}\n */\n waitForRegistration(timeout = 10) {\n this.logger.info('device: waiting for registration');\n\n return new Promise((resolve, reject) => {\n if (this.registered) {\n resolve();\n }\n\n const timeoutTimer = safeSetTimeout(\n () => reject(new Error('device: timeout occured while waiting for registration')),\n timeout * 1000\n );\n\n this.once(DEVICE_EVENT_REGISTRATION_SUCCESS, () => {\n clearTimeout(timeoutTimer);\n resolve();\n });\n });\n },\n\n // Deprecated methods.\n\n /**\n * Mark a url as failed and get the next priority host url.\n *\n * @param {string} url - The url to mark as failed.\n * @returns {Promise<string>} - The next priority url.\n */\n @deprecated('device#markUrlFailedAndGetNew(): Use services#markFailedUrl()')\n markUrlFailedAndGetNew(url) {\n return Promise.resolve(this.webex.internal.services.markFailedUrl(url));\n },\n\n // Ampersand method members\n\n /* eslint-disable require-jsdoc */\n /**\n * Initializer method for the device plugin.\n *\n * @override\n * @param {Array<any>} args - An array of items to be mapped as properties.\n * @returns {void}\n */\n @persist('@', decider)\n initialize(...args) {\n // Prototype the extended class in order to preserve the parent member.\n Reflect.apply(WebexPlugin.prototype.initialize, this, args);\n\n // Initialize feature events and listeners.\n FEATURE_COLLECTION_NAMES.forEach((collectionName) => {\n this.features.on(`change:${collectionName}`, (model, value, options) => {\n this.trigger('change', this, options);\n this.trigger('change:features', this, this.features, options);\n });\n });\n\n // Initialize network reachability checking event for url change.\n this.on('change:intranetInactivityCheckUrl', () => {\n this.checkNetworkReachability();\n });\n\n // Initialize network reachability checking event for duration change.\n this.on('change:intranetInactivityDuration', () => {\n this.checkNetworkReachability();\n });\n\n // Initialize network reachability checking event for duration change.\n this.on('change:inNetworkInactivityDuration', () => {\n this.checkNetworkReachability();\n });\n\n // Initialize listener for activity checking.\n this.listenTo(this.webex, 'user-activity', () => {\n this.lastUserActivityDate = Date.now();\n });\n\n // Initialize listener for meeting started event.\n this.listenTo(this.webex, 'meeting started', () => {\n this.isInMeeting = true;\n this.resetLogoutTimer();\n });\n\n // Initialize listener for meeting ended event.\n this.listenTo(this.webex, 'meeting ended', () => {\n this.isInMeeting = false;\n this.resetLogoutTimer();\n });\n },\n /* eslint-enable require-jsdoc */\n});\n\nexport default Device;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA;AACA;AACA;AAEA;AACA;AACA;AAAsD;AAAA;AAAA;AAEtD;AACA;AACA;AACA;AACA;AACA,SAASA,OAAO,GAAG;EACjB,OAAO,CAAC,IAAI,CAACC,MAAM,CAACC,SAAS;AAC/B;AAEA,IAAMC,MAAM,GAAGC,sBAAW,CAACC,MAAM,SA0U9B,IAAAC,uBAAY,EAAC,GAAG,CAAC,UAqEjB,IAAAA,uBAAY,EAAC,GAAG,CAAC,UA8DjB,IAAAA,uBAAY,EAAC,GAAG,CAAC,UAoSjB,IAAAC,kBAAU,EAAC,+DAA+D,CAAC,UAe3E,IAAAC,kBAAO,EAAC,GAAG,EAAER,OAAO,CAAC,UAhwBU;EAChC;;EAEAS,SAAS,EAAE,QAAQ;EAEnB;EACA;EACAC,eAAe,EAAE,OAAO;EAExBC,WAAW,EAAE,KAAK;EAElBC,QAAQ,EAAE;IACR;AACJ;AACA;AACA;AACA;IACIC,QAAQ,EAAEC;EACZ,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEC,KAAK,EAAE;IACL;AACJ;AACA;AACA;AACA;IACIC,oBAAoB,EAAE,QAAQ;IAE9B;AACJ;AACA;AACA;AACA;IACIC,mBAAmB,EAAE,QAAQ;IAE7B;AACJ;AACA;AACA;AACA;IACIC,eAAe,EAAE,QAAQ;IAEzB;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,UAAU,EAAE,QA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AAO,CAAC;MAC/D,CAAC,CAAC;IACJ,CAAC,CAAC;;IAEF;IACA,IAAI,CAACb,EAAE,CAAC,mCAAmC,EAAE,YAAM;MACjD,MAAI,CAAC1B,wBAAwB,EAAE;IACjC,CAAC,CAAC;;IAEF;IACA,IAAI,CAAC0B,EAAE,CAAC,mCAAmC,EAAE,YAAM;MACjD,MAAI,CAAC1B,wBAAwB,EAAE;IACjC,CAAC,CAAC;;IAEF;IACA,IAAI,CAAC0B,EAAE,CAAC,oCAAoC,EAAE,YAAM;MAClD,MAAI,CAAC1B,wBAAwB,EAAE;IACjC,CAAC,CAAC;;IAEF;IACA,IAAI,CAACwC,QAAQ,CAAC,IAAI,CAACtF,KAAK,EAAE,eAAe,EAAE,YAAM;MAC/C,MAAI,CAACL,oBAAoB,GAAG,mBAAU;IACxC,CAAC,CAAC;;IAEF;IACA,IAAI,CAAC2F,QAAQ,CAAC,IAAI,CAACtF,KAAK,EAAE,iBAAiB,EAAE,YAAM;MACjD,MAAI,CAACH,WAAW,GAAG,IAAI;MACvB,MAAI,CAACkD,gBAAgB,EAAE;IACzB,CAAC,CAAC;;IAEF;IACA,IAAI,CAACuC,QAAQ,CAAC,IAAI,CAACtF,KAAK,EAAE,eAAe,EAAE,YAAM;MAC/C,MAAI,CAACH,WAAW,GAAG,KAAK;MACxB,MAAI,CAACkD,gBAAgB,EAAE;IACzB,CAAC,CAAC;EACJ,CAAC,CACD;EAAA;AACF,CAAC,6DAreEwC,iBAAS,oIAqETA,iBAAS,wIA8DTA,iBAAS,6XAkWV;AAAC,eAEYzI,MAAM;AAAA"}
1
+ {"version":3,"names":["_common","require","_webexCore","_commonTimers","_metrics","_interopRequireDefault","_constants","_featuresModel","_ipNetworkDetector","_dec","_dec2","_dec3","_dec4","_dec5","_obj","ownKeys","e","r","t","_Object$keys","_Object$getOwnPropertySymbols","o","filter","_Object$getOwnPropertyDescriptor2","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","decider","config","ephemeral","Device","WebexPlugin","extend","waitForValue","deprecated","persist","namespace","extraProperties","idAttribute","children","features","FeaturesModel","ipNetworkDetector","IpNetworkDetector","props","clientMessagingGiphy","customerCompanyName","customerLogoUrl","deviceType","helpUrl","intranetInactivityDuration","intranetInactivityCheckUrl","inNetworkInactivityDuration","ecmEnabledForAllUsers","ecmSupportedStorageProviders","modificationTime","navigationBarColor","partnerCompanyName","partnerLogoUrl","peopleInsightsEnabled","reportingSiteDesc","reportingSiteUrl","searchEncryptionKeyUrl","showSupportText","supportProviderCompanyName","supportProviderLogoUrl","url","userId","webFileShareControl","webSocketUrl","whiteboardFileShareControl","derived","registered","deps","fn","session","logoutTimer","lastUserActivityDate","isReachabilityChecked","isInMeeting","isInNetwork","meetingStarted","webex","trigger","meetingEnded","refresh","_this","logger","info","canRegister","then","register","body","serialize","mediaCluster","etag","ttl","ephemeralDeviceTTL","headers","defaults","request","method","uri","response","processRegistrationSuccess","catch","reason","statusCode","clear","_promise","reject","_this2","internal","newMetrics","submitInternalEvent","name","service","resource","error","metrics","submitClientMetrics","METRICS","JS_SDK_WDM_REGISTRATION_SUCCESSFUL","JS_SDK_WDM_REGISTRATION_FAILED","fields","unregister","_this3","warn","resolve","services","waitForCatalog","canRegisterWaitDuration","get","Error","join","checkNetworkReachability","_this4","resetLogoutTimer","trackingid","_len","args","Array","_key","_apply","prototype","getWebSocketUrl","_this5","wait","undefined","waitForRegistration","convertUrlToPriorityHostUrl","message","wsUrl","_this6","serviceHostMap","_ref","user","reset","entitlement","set","delay","refreshTimer","safeSetTimeout","DEVICE_EVENT_REGISTRATION_SUCCESS","clearTimeout","off","unset","enableInactivityEnforcement","setLogoutTimer","duration","_this7","on","logout","_this8","timeout","timeoutTimer","once","markUrlFailedAndGetNew","markFailedUrl","initialize","_this9","_len2","_key2","FEATURE_COLLECTION_NAMES","collectionName","concat","model","value","options","listenTo","_now","version","_applyDecoratedDescriptor2","oneFlight","_getOwnPropertyDescriptor","_default","exports"],"sources":["device.js"],"sourcesContent":["// Internal Dependencies\nimport {deprecated, oneFlight} from '@webex/common';\nimport {persist, waitForValue, WebexPlugin} from '@webex/webex-core';\nimport {safeSetTimeout} from '@webex/common-timers';\n\nimport METRICS from './metrics';\nimport {FEATURE_COLLECTION_NAMES, DEVICE_EVENT_REGISTRATION_SUCCESS} from './constants';\nimport FeaturesModel from './features/features-model';\nimport IpNetworkDetector from './ipNetworkDetector';\n\n/**\n * Determine if the plugin should be initialized based on cached storage.\n *\n * @returns {boolean} - If the device is ephemeral.\n */\nfunction decider() {\n return !this.config.ephemeral;\n}\n\nconst Device = WebexPlugin.extend({\n // Ampersand property members.\n\n namespace: 'Device',\n\n // Allow for extra properties to prevent the plugin from failing due to\n // **WDM** service DTO changes.\n extraProperties: 'allow',\n\n idAttribute: 'url',\n\n children: {\n /**\n * The class object that contains all of the feature collections.\n *\n * @type {FeaturesModel}\n */\n features: FeaturesModel,\n /**\n * Helper class for detecting what IP network version (ipv4, ipv6) we're on.\n *\n * @type {IpNetworkDetector}\n */\n ipNetworkDetector: IpNetworkDetector,\n },\n\n /**\n * A collection of device properties mostly assigned by the retrieved DTO from\n * the **WDM** service that are mapped against the ampersand properties.\n *\n * @type {Object}\n */\n props: {\n /**\n * This property determines whether or not giphy support is enabled.\n *\n * @type {'ALLOW' | 'BLOCK'}\n */\n clientMessagingGiphy: 'string',\n\n /**\n * This property should store the company name.\n *\n * @type {string}\n */\n customerCompanyName: 'string',\n\n /**\n * This property should store the logo url.\n *\n * @type {string}\n */\n customerLogoUrl: 'string',\n\n /**\n * This property doesn't have any real values, but is sent during device\n * refresh to prevent the **wdm** service from falling back to an iOS device\n * type.\n *\n * @type {string}\n */\n deviceType: 'string',\n\n /**\n * This property should store the help url.\n *\n * @type {string}\n */\n helpUrl: 'string',\n\n /**\n * This property should store the intranet inactivity timer duration.\n *\n * @type {number}\n */\n intranetInactivityDuration: 'number',\n\n /**\n * This property stores the url required to validate if the device is able\n * to actively reach the intranet network.\n *\n * @type {string}\n */\n intranetInactivityCheckUrl: 'string',\n\n /**\n * This property stores the inactivity timer duration, and could possibly\n * deprecate the `intranetInactivityDuration` property.\n *\n * @type {number}\n */\n inNetworkInactivityDuration: 'number',\n\n /**\n * This property stores the ECM (external content management) enabled value\n * for the whole organization.\n *\n * @type {boolean}\n */\n ecmEnabledForAllUsers: ['boolean', false, false],\n\n /**\n * This property stores an array of ECM (external content management)\n * providers that are currently available.\n *\n * @returns {Array<string>}\n */\n ecmSupportedStorageProviders: ['array', false, () => []],\n\n /**\n * This property stores the modification time value retrieved from the\n * **WDM** endpoint formatted as ISO 8601.\n *\n * @type {string}\n */\n modificationTime: 'string',\n\n /**\n * This property stores the navigation bar color.\n *\n * @type {string}\n */\n navigationBarColor: 'string',\n\n /**\n * This property stores the partner company's name when available.\n *\n * @type {string}\n */\n partnerCompanyName: 'string',\n\n /**\n * This property stores the partner company's logo when available.\n *\n * @type {string}\n */\n partnerLogoUrl: 'string',\n\n /**\n * This property stores the availability of people data from the **WDM**\n * service.\n *\n * @type {boolean}\n */\n peopleInsightsEnabled: 'boolean',\n\n /**\n * This property stores the reporting site's description when available.\n *\n * @type {string}\n */\n reportingSiteDesc: 'string',\n\n /**\n * This property stores the reporting site's access url when available.\n *\n * @type {string}\n */\n reportingSiteUrl: 'string',\n\n /**\n * This property stores the encryption key url when available.\n *\n * @type {string}\n */\n searchEncryptionKeyUrl: 'string',\n\n /**\n * This property stores the availability of support-provided text from the\n * **WDM** service.\n *\n * @type {boolean}\n */\n showSupportText: 'boolean',\n\n /**\n * This property stores the support provider's company name when available.\n *\n * @type {string}\n */\n supportProviderCompanyName: 'string',\n\n /**\n * This property stores the support provider's logo url when available.\n *\n * @type {string}\n */\n supportProviderLogoUrl: 'string',\n\n /**\n * This property stores the device's url retrieved from a registration\n * request. This property gets set via the initial registration process by a\n * `this.set()` method.\n *\n * @type {string}\n */\n url: 'string',\n\n /**\n * This property stores the device's userId uuid value, which can also be\n * derived from the device's registerd user's userId retrieved from\n * the **Hydra** service.\n *\n * @type {string}\n */\n userId: 'string',\n\n /**\n * This property stores whether or not file sharing is enabled\n *\n * @type {'BLOCK_BOTH' | 'BLOCK_UPLOAD'}\n */\n webFileShareControl: 'string',\n\n /**\n * This property stores the current web socket url used by the registered\n * device.\n *\n * @type {string}\n */\n webSocketUrl: 'string',\n\n /**\n * This property stores the value indicating whether or not white board file\n * sharing is enabled for the current device.\n *\n * @type {'ALLOW' | 'BLOCK'}\n */\n whiteboardFileShareControl: 'string',\n },\n\n /**\n * A list of derived properties that populate based when their parent data\n * available via the device's properties.\n *\n * @type {Object}\n */\n derived: {\n /**\n * This property determines if the current device is registered.\n *\n * @type {boolean}\n */\n registered: {\n deps: ['url'],\n\n /**\n * Checks if the device is registered by validating that the url exists.\n * Amperstand does not allow this to method to be written as an arrow\n * function.\n *\n * @returns {boolean}\n */\n fn() {\n return !!this.url;\n },\n },\n },\n\n /**\n * Stores timer data as well as other state details.\n *\n * @type {Object}\n */\n session: {\n /**\n * This property stores the logout timer object\n *\n * @type {any}\n */\n logoutTimer: 'any',\n\n /**\n * This property stores the date for the last activity the user made\n * with the current device.\n *\n * @type {number}\n */\n lastUserActivityDate: 'number',\n\n /**\n * This property stores whether or not the reachability check has been\n * performed to prevent the reachability check from performing its\n * operation more than once after a successful check.\n *\n * @returns {boolean}\n */\n isReachabilityChecked: ['boolean', false, false],\n\n /**\n * This property stores whether or not the current device is in a meeting\n * to prevent an unneeded timeout of a meeting due to inactivity.\n *\n * @type {boolean}\n */\n isInMeeting: 'boolean',\n\n /**\n * This property identifies if the device is currently in network to prevent\n * the `resetLogoutTimer()` method from being called repeatedly once its\n * known client is connected to the organization's internal network.\n *\n * @type {boolean}\n */\n isInNetwork: 'boolean',\n },\n\n // Event method members.\n\n /**\n * Trigger meeting started event for webex instance. Used by web-client team.\n *\n * @returns {void}\n */\n meetingStarted() {\n this.webex.trigger('meeting started');\n },\n\n /**\n * Trigger meeting ended event for webex instance. Used by web-client team.\n *\n * @returns {void}\n */\n meetingEnded() {\n this.webex.trigger('meeting ended');\n },\n\n // Registration method members\n\n /* eslint-disable require-jsdoc */\n /**\n * Refresh the current registered device if able.\n *\n * @returns {Promise<void, Error>}\n */\n @oneFlight\n @waitForValue('@')\n refresh() {\n this.logger.info('device: refreshing');\n\n // Validate that the device can be registered.\n return this.canRegister().then(() => {\n // Validate if the device is not registered and register instead.\n if (!this.registered) {\n this.logger.info('device: device not registered, registering');\n\n return this.register();\n }\n\n // Merge body configurations, overriding defaults.\n const body = {\n ...this.serialize(),\n ...(this.config.body ? this.config.body : {}),\n };\n\n // Remove unneeded properties from the body object.\n delete body.features;\n delete body.mediaCluster;\n delete body.etag;\n\n // Append a ttl value if the device is marked as ephemeral.\n if (this.config.ephemeral) {\n body.ttl = this.config.ephemeralDeviceTTL;\n }\n\n // Merge header configurations, overriding defaults.\n const headers = {\n ...(this.config.defaults.headers ? this.config.defaults.headers : {}),\n ...(this.config.headers ? this.config.headers : {}),\n // If etag is sent, WDM will not send developer feature toggles unless they have changed\n ...(this.etag ? {'If-None-Match': this.etag} : {}),\n };\n\n return this.request({\n method: 'PUT',\n uri: this.url,\n body,\n headers,\n })\n .then((response) => this.processRegistrationSuccess(response))\n .catch((reason) => {\n // Handle a 404 error, which indicates that the device is no longer\n // valid and needs to be registered as a new device.\n if (reason.statusCode === 404) {\n this.logger.info('device: refresh failed, device is not valid');\n this.logger.info('device: attempting to register a new device');\n\n this.clear();\n\n return this.register();\n }\n\n return Promise.reject(reason);\n });\n });\n },\n\n /**\n * Register or refresh a device depending on the current device state. Device\n * registration utilizes the services plugin to send the request to the\n * **WDM** service.\n *\n * @returns {Promise<void, Error>}\n */\n @oneFlight\n @waitForValue('@')\n register() {\n this.logger.info('device: registering');\n\n // Validate that the device can be registered.\n return this.canRegister().then(() => {\n // Validate if the device is already registered and refresh instead.\n if (this.registered) {\n this.logger.info('device: device already registered, refreshing');\n\n return this.refresh();\n }\n\n // Merge body configurations, overriding defaults.\n const body = {\n ...(this.config.defaults.body ? this.config.defaults.body : {}),\n ...(this.config.body ? this.config.body : {}),\n };\n\n // Merge header configurations, overriding defaults.\n const headers = {\n ...(this.config.defaults.headers ? this.config.defaults.headers : {}),\n ...(this.config.headers ? this.config.headers : {}),\n };\n\n // Append a ttl value if the device is marked as ephemeral\n if (this.config.ephemeral) {\n body.ttl = this.config.ephemeralDeviceTTL;\n }\n this.webex.internal.newMetrics.submitInternalEvent({\n name: 'internal.register.device.request',\n });\n\n // This will be replaced by a `create()` method.\n return this.request({\n method: 'POST',\n service: 'wdm',\n resource: 'devices',\n body,\n headers,\n })\n .catch((error) => {\n this.webex.internal.newMetrics.submitInternalEvent({\n name: 'internal.register.device.response',\n });\n\n throw error;\n })\n .then((response) => {\n // Do not add any processing of response above this as that will affect timestamp\n this.webex.internal.newMetrics.submitInternalEvent({\n name: 'internal.register.device.response',\n });\n\n this.webex.internal.metrics.submitClientMetrics(\n METRICS.JS_SDK_WDM_REGISTRATION_SUCCESSFUL\n );\n\n return this.processRegistrationSuccess(response);\n })\n .catch((error) => {\n this.webex.internal.metrics.submitClientMetrics(METRICS.JS_SDK_WDM_REGISTRATION_FAILED, {\n fields: {error},\n });\n throw error;\n });\n });\n },\n\n /**\n * Unregister the current registered device if available. Unregistering a\n * device utilizes the services plugin to send the request to the **WDM**\n * service.\n *\n * @returns {Promise<void, Error>}\n */\n @oneFlight\n @waitForValue('@')\n unregister() {\n this.logger.info('device: unregistering');\n\n if (!this.registered) {\n this.logger.warn('device: not registered');\n\n return Promise.resolve();\n }\n\n return this.request({\n uri: this.url,\n method: 'DELETE',\n }).then(() => this.clear());\n },\n /* eslint-enable require-jsdoc */\n\n // Helper method members\n\n /**\n * Determine if registration methods can be performed. This method utilizes\n * the `services` plugin to confirm if the appropriate service urls are\n * available for device registration.\n *\n * @returns {Promise<void, Error>}\n */\n canRegister() {\n this.logger.info('device: validating if registration can occur');\n\n // Destructure the services plugin for ease of reference.\n const {services} = this.webex.internal;\n\n // Wait for the postauth catalog to populate.\n return services.waitForCatalog('postauth', this.config.canRegisterWaitDuration).then(() =>\n // Validate that the service exists after waiting for the catalog.\n services.get('wdm')\n ? Promise.resolve()\n : Promise.reject(\n new Error(\n [\n 'device: cannot register,',\n \"'wdm' service is not available from the postauth catalog\",\n ].join(' ')\n )\n )\n );\n },\n\n /**\n * Check if the device can currently reach the inactivity check url.\n *\n * @returns {Promise<void, Error>}\n */\n checkNetworkReachability() {\n this.logger.info('device: checking network reachability');\n\n // Validate if the device has been checked and reset the logout timer.\n if (this.isReachabilityChecked) {\n return Promise.resolve(this.resetLogoutTimer());\n }\n\n this.isReachabilityChecked = true;\n\n // Validate if the device has a intranet checking url.\n if (!this.intranetInactivityCheckUrl) {\n this.isInNetwork = false;\n\n return Promise.resolve(this.resetLogoutTimer());\n }\n\n // Clear unnecessary headers for reachability request.\n const headers = {\n 'cisco-no-http-redirect': null,\n 'spark-user-agent': null,\n trackingid: null,\n };\n\n // Send the network reachability request.\n return this.request({\n headers,\n method: 'GET',\n uri: this.intranetInactivityCheckUrl,\n })\n .then(() => {\n this.isInNetwork = true;\n\n return Promise.resolve(this.resetLogoutTimer());\n })\n .catch(() => {\n this.logger.info('device: did not reach ping endpoint');\n this.logger.info('device: triggering off-network timer');\n\n this.isInNetwork = false;\n\n return Promise.resolve(this.resetLogoutTimer());\n });\n },\n\n /**\n * Clears the registration ttl value if available.\n *\n * @param {Object} options - Values to be cleared.\n * @returns {void}\n */\n clear(...args) {\n this.logger.info('device: clearing registered device');\n\n // Prototype the extended class in order to preserve the parent member.\n Reflect.apply(WebexPlugin.prototype.clear, this, args);\n },\n\n /**\n * Get the current websocket url with the appropriate priority host.\n *\n * @param {boolean} [wait=false] - Willing to wait on a valid url.\n * @returns {Promise<string, Error>} - The priority-mapped web socket url.\n */\n getWebSocketUrl(wait = false) {\n this.logger.info('device: getting the current websocket url');\n\n // Destructure the services plugin for ease of reference.\n const {services} = this.webex.internal;\n\n // Validate if the method should wait for registration.\n if (wait) {\n return this.waitForRegistration()\n .then(() => services.convertUrlToPriorityHostUrl(this.webSocketUrl))\n .catch((error) => {\n this.logger.warn(error.message);\n\n return Promise.reject(new Error('device: failed to get the current websocket url'));\n });\n }\n\n // Validate if the device is registered.\n if (!this.registered) {\n return Promise.reject(\n new Error('device: cannot get websocket url, device is not registered')\n );\n }\n\n // Attempt to collect the priority-host-mapped web socket URL.\n const wsUrl = services.convertUrlToPriorityHostUrl(this.webSocketUrl);\n\n // Validate that the url was collected.\n if (wsUrl) {\n return Promise.resolve(wsUrl);\n }\n\n return Promise.reject(new Error('device: failed to get the current websocket url'));\n },\n\n /**\n * Process a successful device registration.\n *\n * @param {Object} response - response object from registration success.\n * @returns {void}\n */\n processRegistrationSuccess(response) {\n this.logger.info('device: received registration payload');\n\n // Clone the response body for service cleaning.\n const body = {...response.body};\n\n // Clean service data.\n delete body.services;\n delete body.serviceHostMap;\n\n const {etag} = response.headers || {};\n\n if (this.etag && etag && this.etag === etag) {\n // If current etag matches the previous one and we have sent\n // If-None-Match header the developer and entitlement feature\n // toggles will not be returned\n const {features} = body;\n\n delete body.features;\n // When using the etag feature cache, user and entitlement features are still returned\n this.features.user.reset(features.user);\n this.features.entitlement.reset(features.entitlement);\n }\n\n // Assign the recieved DTO from **WDM** to this device.\n this.set(body);\n\n // Assign the new etag to this device.\n this.set({etag});\n\n // Validate if device is ephemeral and setup refresh timer.\n if (this.config.ephemeral) {\n this.logger.info('device: enqueuing device refresh');\n\n const delay = (this.config.ephemeralDeviceTTL / 2 + 60) * 1000;\n\n this.refreshTimer = safeSetTimeout(() => this.refresh(), delay);\n }\n\n // Emit the registration:success event.\n this.trigger(DEVICE_EVENT_REGISTRATION_SUCCESS, this);\n },\n\n /**\n * Reset the current local logout timer for the registered device if\n * registered.\n *\n * @returns {void}\n */\n resetLogoutTimer() {\n this.logger.info('device: resetting logout timer');\n\n // Clear current logout timer.\n clearTimeout(this.logoutTimer);\n\n // Remove last activity date event listener.\n this.off('change:lastUserActivityDate');\n\n // Remove the logout timer.\n this.unset('logoutTimer');\n\n // Validate if the device is currently in a meeting and is configured to\n // required inactivity enforcement.\n if (\n !this.isInMeeting &&\n this.config.enableInactivityEnforcement &&\n this.isReachabilityChecked\n ) {\n if (this.isInNetwork) {\n this.setLogoutTimer(this.inNetworkInactivityDuration);\n } else {\n this.setLogoutTimer(this.intranetInactivityDuration);\n }\n }\n },\n\n /**\n * Set the value of the logout timer for the current registered device.\n *\n * @param {number} duration - Value in seconds of the new logout timer.\n * @returns {void}\n */\n setLogoutTimer(duration) {\n this.logger.info('device: setting logout timer');\n\n if (!duration || duration <= 0) {\n return;\n }\n\n // Setup user activity date event listener.\n this.on('change:lastUserActivityDate', () => {\n this.resetLogoutTimer();\n });\n\n // Initialize a new timer.\n this.logoutTimer = safeSetTimeout(() => {\n this.webex.logout();\n }, duration * 1000);\n },\n\n /**\n * Wait for the device to be registered.\n *\n * @param {number} [timeout=10] - The maximum duration to wait, in seconds.\n * @returns {Promise<void, Error>}\n */\n waitForRegistration(timeout = 10) {\n this.logger.info('device: waiting for registration');\n\n return new Promise((resolve, reject) => {\n if (this.registered) {\n resolve();\n }\n\n const timeoutTimer = safeSetTimeout(\n () => reject(new Error('device: timeout occured while waiting for registration')),\n timeout * 1000\n );\n\n this.once(DEVICE_EVENT_REGISTRATION_SUCCESS, () => {\n clearTimeout(timeoutTimer);\n resolve();\n });\n });\n },\n\n // Deprecated methods.\n\n /**\n * Mark a url as failed and get the next priority host url.\n *\n * @param {string} url - The url to mark as failed.\n * @returns {Promise<string>} - The next priority url.\n */\n @deprecated('device#markUrlFailedAndGetNew(): Use services#markFailedUrl()')\n markUrlFailedAndGetNew(url) {\n return Promise.resolve(this.webex.internal.services.markFailedUrl(url));\n },\n\n // Ampersand method members\n\n /* eslint-disable require-jsdoc */\n /**\n * Initializer method for the device plugin.\n *\n * @override\n * @param {Array<any>} args - An array of items to be mapped as properties.\n * @returns {void}\n */\n @persist('@', decider)\n initialize(...args) {\n // Prototype the extended class in order to preserve the parent member.\n Reflect.apply(WebexPlugin.prototype.initialize, this, args);\n\n // Initialize feature events and listeners.\n FEATURE_COLLECTION_NAMES.forEach((collectionName) => {\n this.features.on(`change:${collectionName}`, (model, value, options) => {\n this.trigger('change', this, options);\n this.trigger('change:features', this, this.features, options);\n });\n });\n\n // Initialize network reachability checking event for url change.\n this.on('change:intranetInactivityCheckUrl', () => {\n this.checkNetworkReachability();\n });\n\n // Initialize network reachability checking event for duration change.\n this.on('change:intranetInactivityDuration', () => {\n this.checkNetworkReachability();\n });\n\n // Initialize network reachability checking event for duration change.\n this.on('change:inNetworkInactivityDuration', () => {\n this.checkNetworkReachability();\n });\n\n // Initialize listener for activity checking.\n this.listenTo(this.webex, 'user-activity', () => {\n this.lastUserActivityDate = Date.now();\n });\n\n // Initialize listener for meeting started event.\n this.listenTo(this.webex, 'meeting started', () => {\n this.isInMeeting = true;\n this.resetLogoutTimer();\n });\n\n // Initialize listener for meeting ended event.\n this.listenTo(this.webex, 'meeting ended', () => {\n this.isInMeeting = false;\n this.resetLogoutTimer();\n });\n },\n /* eslint-enable require-jsdoc */\n});\n\nexport default Device;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,kBAAA,GAAAH,sBAAA,CAAAJ,OAAA;AAAoD,IAAAQ,IAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,IAAA,EARpD;AAAA,SAAAC,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAH,CAAA,OAAAI,6BAAA,QAAAC,C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KAAA,OAAAkM,yBAAA,CAAA3K,OAAA,EAAAnB,IAAA,eAAAA,IAAA,OAAA4L,0BAAA,CAAAzK,OAAA,EAAAnB,IAAA,iBA6ET6L,iBAAS,EAAAhM,KAAA,OAAAiM,yBAAA,CAAA3K,OAAA,EAAAnB,IAAA,iBAAAA,IAAA,OAAA4L,0BAAA,CAAAzK,OAAA,EAAAnB,IAAA,6BAAAF,KAAA,OAAAgM,yBAAA,CAAA3K,OAAA,EAAAnB,IAAA,6BAAAA,IAAA,OAAA4L,0BAAA,CAAAzK,OAAA,EAAAnB,IAAA,iBAAAD,KAAA,OAAA+L,yBAAA,CAAA3K,OAAA,EAAAnB,IAAA,iBAAAA,IAAA,IAAAA,IAAA,EAkWX,CAAC;AAAC,IAAA+L,QAAA,GAAAC,OAAA,CAAA7K,OAAA,GAEYO,MAAM"}
@@ -33,6 +33,5 @@ var FeatureCollection = _ampersandCollection.default.extend({
33
33
  */
34
34
  model: _featureModel.default
35
35
  });
36
- var _default = FeatureCollection;
37
- exports.default = _default;
36
+ var _default = exports.default = FeatureCollection;
38
37
  //# sourceMappingURL=feature-collection.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["FeatureCollection","AmpCollection","extend","mainIndex","model","FeatureModel"],"sources":["feature-collection.js"],"sourcesContent":["// External dependencies.\nimport AmpCollection from 'ampersand-collection';\n\n// Local Dependencies\nimport FeatureModel from './feature-model';\n\n/**\n * Feature collection model.\n *\n * @description\n * This model contains a collection of features under a specific collection\n * group.\n */\nconst FeatureCollection = AmpCollection.extend({\n /**\n * The unique identifier for the models in this collection.\n *\n * @type {string}\n */\n mainIndex: 'key',\n\n /**\n * The type of model this collection can contain.\n *\n * @type {Class}\n */\n model: FeatureModel,\n});\n\nexport default FeatureCollection;\n"],"mappings":";;;;;;;;AACA;AAGA;AAJA;;AAGA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,iBAAiB,GAAGC,4BAAa,CAACC,MAAM,CAAC;EAC7C;AACF;AACA;AACA;AACA;EACEC,SAAS,EAAE,KAAK;EAEhB;AACF;AACA;AACA;AACA;EACEC,KAAK,EAAEC;AACT,CAAC,CAAC;AAAC,eAEYL,iBAAiB;AAAA"}
1
+ {"version":3,"names":["_ampersandCollection","_interopRequireDefault","require","_featureModel","FeatureCollection","AmpCollection","extend","mainIndex","model","FeatureModel","_default","exports","default"],"sources":["feature-collection.js"],"sourcesContent":["// External dependencies.\nimport AmpCollection from 'ampersand-collection';\n\n// Local Dependencies\nimport FeatureModel from './feature-model';\n\n/**\n * Feature collection model.\n *\n * @description\n * This model contains a collection of features under a specific collection\n * group.\n */\nconst FeatureCollection = AmpCollection.extend({\n /**\n * The unique identifier for the models in this collection.\n *\n * @type {string}\n */\n mainIndex: 'key',\n\n /**\n * The type of model this collection can contain.\n *\n * @type {Class}\n */\n model: FeatureModel,\n});\n\nexport default FeatureCollection;\n"],"mappings":";;;;;;;;AACA,IAAAA,oBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AAJA;;AAGA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAME,iBAAiB,GAAGC,4BAAa,CAACC,MAAM,CAAC;EAC7C;AACF;AACA;AACA;AACA;EACEC,SAAS,EAAE,KAAK;EAEhB;AACF;AACA;AACA;AACA;EACEC,KAAK,EAAEC;AACT,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEYR,iBAAiB"}
@@ -11,16 +11,15 @@ _Object$defineProperty(exports, "__esModule", {
11
11
  value: true
12
12
  });
13
13
  exports.default = void 0;
14
- var _apply = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/reflect/apply"));
15
- var _isNan = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/number/is-nan"));
16
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
17
15
  var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/typeof"));
18
- var _isObject2 = _interopRequireDefault(require("lodash/isObject"));
19
- var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
16
+ var _apply = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/reflect/apply"));
17
+ var _isNan = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/number/is-nan"));
20
18
  var _ampersandState = _interopRequireDefault(require("ampersand-state"));
19
+ var _lodash = require("lodash");
21
20
  var _constants = require("../constants");
22
- 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; }
23
- 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; }
21
+ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
22
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; } // External dependencies.
24
23
  /**
25
24
  * The model returned from the {@link FeatureModel#parse} method.
26
25
  *
@@ -28,7 +27,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
28
27
  * @property {boolean|number|string} ParsedFeatureModel.value - The parsed val.
29
28
  * @property {string} ParsedFeatureModel.type - The type of the parsed val.
30
29
  */
31
-
32
30
  /**
33
31
  * Feature model.
34
32
  *
@@ -92,7 +90,7 @@ var FeatureModel = _ampersandState.default.extend({
92
90
  */
93
91
  constructor: function constructor(attrs) {
94
92
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
95
- (0, _defaults2.default)(options, {
93
+ (0, _lodash.defaults)(options, {
96
94
  parse: true
97
95
  });
98
96
  return (0, _apply.default)(_ampersandState.default.prototype.constructor, this, [attrs, options]);
@@ -181,7 +179,7 @@ var FeatureModel = _ampersandState.default.extend({
181
179
  var optns;
182
180
 
183
181
  // Validate if the key is an instance of any object or not.
184
- if ((0, _isObject2.default)(key) || key === null) {
182
+ if ((0, _lodash.isObject)(key) || key === null) {
185
183
  attrs = key;
186
184
  optns = value;
187
185
  } else {
@@ -193,6 +191,5 @@ var FeatureModel = _ampersandState.default.extend({
193
191
  return (0, _apply.default)(_ampersandState.default.prototype.set, this, [attrs, optns]);
194
192
  }
195
193
  });
196
- var _default = FeatureModel;
197
- exports.default = _default;
194
+ var _default = exports.default = FeatureModel;
198
195
  //# sourceMappingURL=feature-model.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["FeatureModel","AmpState","extend","idAttribute","props","key","lastModified","mutable","type","val","value","constructor","attrs","options","parse","prototype","model","parsedModel","Number","FEATURE_TYPES","NUMBER","toLowerCase","BOOLEAN","STRING","serialize","args","Date","toISOString","set","optns"],"sources":["feature-model.js"],"sourcesContent":["// External dependencies.\nimport AmpState from 'ampersand-state';\nimport {defaults, isObject} from 'lodash';\n\nimport {FEATURE_TYPES} from '../constants';\n\n/**\n * The model returned from the {@link FeatureModel#parse} method.\n *\n * @typedef {Object} ParsedFeatureModel\n * @property {boolean|number|string} ParsedFeatureModel.value - The parsed val.\n * @property {string} ParsedFeatureModel.type - The type of the parsed val.\n */\n\n/**\n * Feature model.\n *\n * @description\n * This model contains details on a single feature and is received from the\n * **WDM** service upon registration.\n */\nconst FeatureModel = AmpState.extend({\n idAttribute: 'key', // needed by Ampersand to determine unique item\n\n // Ampersand property members.\n\n props: {\n /**\n * Contains the unique identifier for this feature to be addressed by.\n *\n * @type {string}\n */\n key: 'string',\n\n /**\n * This property contains the date in which this feature was last modified.\n *\n * @type {date}\n */\n lastModified: 'date',\n\n /**\n * This property defines whether or not the feature is mutable.\n *\n * @type {boolean}\n */\n mutable: 'boolean',\n\n /**\n * This property contains the data type the string value should be\n * interpreted as.\n *\n * @type {FEATURE_TYPES}\n */\n type: 'string',\n\n /**\n * This property contains the string value of this feature.\n *\n * @type {string}\n */\n val: 'string',\n\n /**\n * This property contains the interpreted value of this feature.\n *\n * @type {any}\n */\n value: 'any',\n },\n\n /**\n * Class object constructor. This method safely initializes the class object\n * prior to it fully loading to allow data to be accessed and modified\n * immediately after construction instead of initialization.\n *\n * @override\n * @param {Object} attrs - An object to map against the feature's properties.\n * @param {Object} [options={}] - Ampersand options for `parse` and `parent`.\n */\n constructor(attrs, options = {}) {\n defaults(options, {parse: true});\n\n return Reflect.apply(AmpState.prototype.constructor, this, [attrs, options]);\n },\n\n // Ampsersand method members.\n\n /**\n * Parse {@link FeatureModel} properties recieved as strings from **WDM**\n * and cast them as their appropriate types.\n *\n * @private\n * @memberof FeatureModel\n * @param {Object} model - The model to parse.\n * @property {string} model.val - The value to be parsed.\n * @returns {ParsedFeatureModel} - The parsed model.\n */\n parse(model) {\n // Validate that a model was provided and that it is an object.\n if (!model || typeof model !== 'object') {\n // Return an empty object to satisfy the requirements of `Ampersand`.\n return {};\n }\n\n const parsedModel = {...model};\n const {val} = parsedModel;\n\n // Validate that the value is a number.\n if (!Number.isNaN(Number(val))) {\n parsedModel.type = FEATURE_TYPES.NUMBER;\n parsedModel.value = Number(val);\n }\n // Validate if the value should be a true boolean.\n else if (typeof val === 'string' && val.toLowerCase() === 'true') {\n parsedModel.type = FEATURE_TYPES.BOOLEAN;\n parsedModel.value = true;\n }\n // Validate if the value should be a false boolean.\n else if (typeof val === 'string' && val.toLowerCase() === 'false') {\n parsedModel.type = FEATURE_TYPES.BOOLEAN;\n parsedModel.value = false;\n }\n // In all other cases, the value is string, even if it is undefined.\n else {\n parsedModel.type = FEATURE_TYPES.STRING;\n parsedModel.value = val;\n }\n\n return parsedModel;\n },\n\n /**\n * Serialize the feature using the parent ampersand method with its date as an\n * ISO string. This converts the feature into a request-transportable object.\n *\n * @override\n * @param {Record<string,boolean>} [args] - List of properties to serialize.\n * @returns {Object} - The request-ready transport object.\n */\n serialize(...args) {\n // Call the overloaded class member.\n const attrs = Reflect.apply(AmpState.prototype.serialize, this, args);\n\n // Validate that the overloaded class member returned an object with the\n // `lastModified` key-value pair and instance it as an ISO string.\n if (attrs.lastModified) {\n attrs.lastModified = new Date(attrs.lastModified).toISOString();\n }\n\n return attrs;\n },\n\n /**\n * Set a property of this object to a specific value. This method utilizes\n * code that exists within the `ampersand-state` dependency to handle\n * scenarios in which `key = {\"key\": \"value\"}` or\n * `key = \"key\", value = \"value\"`. Since the snippet is pulled directly from\n * `ampersand-state`, there is no need to test both scenarios.\n *\n * @override\n * @param {object | string} key - The key value, or object to be set.\n * @param {any} value - The key value or object to set the keyed pair to.\n * @param {any} options - The object to set the keyed pair to.\n * @returns {any} - The changed property.\n */\n set(key, value, options) {\n // Declare formatted output variables for properly setting the targetted\n // property for this method.\n let attrs;\n let optns;\n\n // Validate if the key is an instance of any object or not.\n if (isObject(key) || key === null) {\n attrs = key;\n optns = value;\n } else {\n attrs = {};\n attrs[key] = value;\n optns = options;\n }\n\n attrs = this.parse(attrs, optns);\n\n return Reflect.apply(AmpState.prototype.set, this, [attrs, optns]);\n },\n});\n\nexport default FeatureModel;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA;AAGA;AAA2C;AAAA;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IACf,CAAC,MAAM;MACLE,KAAK,GAAG,CAAC,CAAC;MACVA,KAAK,CAACP,GAAG,CAAC,GAAGK,KAAK;MAClBmB,KAAK,GAAGhB,OAAO;IACjB;IAEAD,KAAK,GAAG,IAAI,CAACE,KAAK,CAACF,KAAK,EAAEiB,KAAK,CAAC;IAEhC,OAAO,oBAAc5B,uBAAQ,CAACc,SAAS,CAACa,GAAG,EAAE,IAAI,EAAE,CAAChB,KAAK,EAAEiB,KAAK,CAAC,CAAC;EACpE;AACF,CAAC,CAAC;AAAC,eAEY7B,YAAY;AAAA"}
1
+ {"version":3,"names":["_ampersandState","_interopRequireDefault","require","_lodash","_constants","ownKeys","e","r","t","_Object$keys","_Object$getOwnPropertySymbols","o","filter","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","FeatureModel","AmpState","extend","idAttribute","props","key","lastModified","mutable","type","val","value","constructor","attrs","options","undefined","defaults","parse","_apply","prototype","model","_typeof2","parsedModel","_isNan","Number","FEATURE_TYPES","NUMBER","toLowerCase","BOOLEAN","STRING","serialize","_len","args","Array","_key","Date","toISOString","set","optns","isObject","_default","exports"],"sources":["feature-model.js"],"sourcesContent":["// External dependencies.\nimport AmpState from 'ampersand-state';\nimport {defaults, isObject} from 'lodash';\n\nimport {FEATURE_TYPES} from '../constants';\n\n/**\n * The model returned from the {@link FeatureModel#parse} method.\n *\n * @typedef {Object} ParsedFeatureModel\n * @property {boolean|number|string} ParsedFeatureModel.value - The parsed val.\n * @property {string} ParsedFeatureModel.type - The type of the parsed val.\n */\n\n/**\n * Feature model.\n *\n * @description\n * This model contains details on a single feature and is received from the\n * **WDM** service upon registration.\n */\nconst FeatureModel = AmpState.extend({\n idAttribute: 'key', // needed by Ampersand to determine unique item\n\n // Ampersand property members.\n\n props: {\n /**\n * Contains the unique identifier for this feature to be addressed by.\n *\n * @type {string}\n */\n key: 'string',\n\n /**\n * This property contains the date in which this feature was last modified.\n *\n * @type {date}\n */\n lastModified: 'date',\n\n /**\n * This property defines whether or not the feature is mutable.\n *\n * @type {boolean}\n */\n mutable: 'boolean',\n\n /**\n * This property contains the data type the string value should be\n * interpreted as.\n *\n * @type {FEATURE_TYPES}\n */\n type: 'string',\n\n /**\n * This property contains the string value of this feature.\n *\n * @type {string}\n */\n val: 'string',\n\n /**\n * This property contains the interpreted value of this feature.\n *\n * @type {any}\n */\n value: 'any',\n },\n\n /**\n * Class object constructor. This method safely initializes the class object\n * prior to it fully loading to allow data to be accessed and modified\n * immediately after construction instead of initialization.\n *\n * @override\n * @param {Object} attrs - An object to map against the feature's properties.\n * @param {Object} [options={}] - Ampersand options for `parse` and `parent`.\n */\n constructor(attrs, options = {}) {\n defaults(options, {parse: true});\n\n return Reflect.apply(AmpState.prototype.constructor, this, [attrs, options]);\n },\n\n // Ampsersand method members.\n\n /**\n * Parse {@link FeatureModel} properties recieved as strings from **WDM**\n * and cast them as their appropriate types.\n *\n * @private\n * @memberof FeatureModel\n * @param {Object} model - The model to parse.\n * @property {string} model.val - The value to be parsed.\n * @returns {ParsedFeatureModel} - The parsed model.\n */\n parse(model) {\n // Validate that a model was provided and that it is an object.\n if (!model || typeof model !== 'object') {\n // Return an empty object to satisfy the requirements of `Ampersand`.\n return {};\n }\n\n const parsedModel = {...model};\n const {val} = parsedModel;\n\n // Validate that the value is a number.\n if (!Number.isNaN(Number(val))) {\n parsedModel.type = FEATURE_TYPES.NUMBER;\n parsedModel.value = Number(val);\n }\n // Validate if the value should be a true boolean.\n else if (typeof val === 'string' && val.toLowerCase() === 'true') {\n parsedModel.type = FEATURE_TYPES.BOOLEAN;\n parsedModel.value = true;\n }\n // Validate if the value should be a false boolean.\n else if (typeof val === 'string' && val.toLowerCase() === 'false') {\n parsedModel.type = FEATURE_TYPES.BOOLEAN;\n parsedModel.value = false;\n }\n // In all other cases, the value is string, even if it is undefined.\n else {\n parsedModel.type = FEATURE_TYPES.STRING;\n parsedModel.value = val;\n }\n\n return parsedModel;\n },\n\n /**\n * Serialize the feature using the parent ampersand method with its date as an\n * ISO string. This converts the feature into a request-transportable object.\n *\n * @override\n * @param {Record<string,boolean>} [args] - List of properties to serialize.\n * @returns {Object} - The request-ready transport object.\n */\n serialize(...args) {\n // Call the overloaded class member.\n const attrs = Reflect.apply(AmpState.prototype.serialize, this, args);\n\n // Validate that the overloaded class member returned an object with the\n // `lastModified` key-value pair and instance it as an ISO string.\n if (attrs.lastModified) {\n attrs.lastModified = new Date(attrs.lastModified).toISOString();\n }\n\n return attrs;\n },\n\n /**\n * Set a property of this object to a specific value. This method utilizes\n * code that exists within the `ampersand-state` dependency to handle\n * scenarios in which `key = {\"key\": \"value\"}` or\n * `key = \"key\", value = \"value\"`. Since the snippet is pulled directly from\n * `ampersand-state`, there is no need to test both scenarios.\n *\n * @override\n * @param {object | string} key - The key value, or object to be set.\n * @param {any} value - The key value or object to set the keyed pair to.\n * @param {any} options - The object to set the keyed pair to.\n * @returns {any} - The changed property.\n */\n set(key, value, options) {\n // Declare formatted output variables for properly setting the targetted\n // property for this method.\n let attrs;\n let optns;\n\n // Validate if the key is an instance of any object or not.\n if (isObject(key) || key === null) {\n attrs = key;\n optns = value;\n } else {\n attrs = {};\n attrs[key] = value;\n optns = options;\n }\n\n attrs = this.parse(attrs, optns);\n\n return Reflect.apply(AmpState.prototype.set, this, [attrs, optns]);\n },\n});\n\nexport default FeatureModel;\n"],"mappings":";;;;;;;;;;;;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AAA2C,SAAAG,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAH,CAAA,OAAAI,6BAAA,QAAAC,CAAA,GAAAD,6BAAA,CAAAJ,CAAA,GAAAC,CAAA,KAAAI,CAAA,GAAAA,CAAA,CAAAC,M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CAAC,GAAGK,KAAK;MAClB2B,KAAK,GAAGxB,OAAO;IACjB;IAEAD,KAAK,GAAG,IAAI,CAACI,KAAK,CAACJ,KAAK,EAAEyB,KAAK,CAAC;IAEhC,OAAO,IAAApB,MAAA,CAAArB,OAAA,EAAcK,uBAAQ,CAACiB,SAAS,CAACkB,GAAG,EAAE,IAAI,EAAE,CAACxB,KAAK,EAAEyB,KAAK,CAAC,CAAC;EACpE;AACF,CAAC,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAA5C,OAAA,GAEYI,YAAY"}
@@ -95,6 +95,5 @@ var FeaturesModel = _ampersandState.default.extend({
95
95
  });
96
96
  }
97
97
  });
98
- var _default = FeaturesModel;
99
- exports.default = _default;
98
+ var _default = exports.default = FeaturesModel;
100
99
  //# sourceMappingURL=features-model.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["FeaturesModel","AmpState","extend","collections","developer","FeatureCollection","entitlement","user","clear","options","attributes","forEach","key","unset","_children","_collections","reset","initialize","eventNames","eventName","FEATURE_COLLECTION_NAMES","collectionName","on","model","trigger"],"sources":["features-model.js"],"sourcesContent":["// External dependencies.\nimport AmpState from 'ampersand-state';\n\n// Local Dependencies\nimport {FEATURE_COLLECTION_NAMES} from '../constants';\n\nimport FeatureCollection from './feature-collection';\n\n/**\n * Feature collection parent container.\n *\n * @description\n * This class contains all of the feature collection class objects to help\n * organize the data retrieved from the **wdm** service on device registration.\n */\nconst FeaturesModel = AmpState.extend({\n // Ampersand property members.\n\n collections: {\n /**\n * This collection contains the developer feature collection.\n *\n * @type {FeatureCollection}\n */\n developer: FeatureCollection,\n\n /**\n * This collection contains the entitlement feature collection.\n *\n * @type {FeatureCollection}\n */\n entitlement: FeatureCollection,\n\n /**\n * This collection contains the user feature collection.\n *\n * @type {FeatureCollection}\n */\n user: FeatureCollection,\n },\n\n // Helper method members.\n\n /**\n * Recursively clear attributes, children, and collections.\n *\n * @param {Object} options - Attribute options to unset.\n * @returns {this}\n */\n clear(options) {\n // Clear the ampersand attributes safely if there are any. This class should\n // never have any attributes.\n Object.keys(this.attributes).forEach((key) => {\n this.unset(key, options);\n });\n\n // Clear the ampersand children safely if there are any. This class should\n // never have any children.\n /* eslint-disable-next-line no-underscore-dangle */\n Object.keys(this._children).forEach((key) => {\n this[key].clear();\n });\n\n // Clear the ampersand collections safely.\n /* eslint-disable-next-line no-underscore-dangle */\n Object.keys(this._collections).forEach((key) => {\n this[key].reset();\n });\n\n return this;\n },\n\n // Ampersand method members.\n\n /**\n * Initializer method for FeatureModel class object.\n *\n * @override\n * @returns {void}\n */\n initialize() {\n // Declare the collection event names.\n const eventNames = ['change:value', 'add', 'remove'];\n\n // Initialize collection event listeners.\n eventNames.forEach((eventName) => {\n FEATURE_COLLECTION_NAMES.forEach((collectionName) => {\n this[collectionName].on(eventName, (model, options) => {\n this.trigger(`change:${collectionName}`, this, this[collectionName], options);\n });\n });\n });\n },\n});\n\nexport default FeaturesModel;\n"],"mappings":";;;;;;;;;AACA;AAGA;AAEA;AANA;;AAGA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,aAAa,GAAGC,uBAAQ,CAACC,MAAM,CAAC;EACpC;;EAEAC,WAAW,EAAE;IACX;AACJ;AACA;AACA;AACA;IACIC,SAAS,EAAEC,0BAAiB;IAE5B;AACJ;AACA;AACA;AACA;IACIC,WAAW,EAAED,0BAAiB;IAE9B;AACJ;AACA;AACA;AACA;IACIE,IAAI,EAAEF;EACR,CAAC;EAED;EAEA;AACF;AACA;AACA;AACA;AACA;EACEG,KAAK,iBAACC,OAAO,EAAE;IAAA;IACb;IACA;IACA,mBAAY,IAAI,CAACC,UAAU,CAAC,CAACC,OAAO,CAAC,UAACC,GAAG,EAAK;MAC5C,KAAI,CAACC,KAAK,CAACD,GAAG,EAAEH,OAAO,CAAC;IAC1B,CAAC,CAAC;;IAEF;IACA;IACA;IACA,mBAAY,IAAI,CAACK,SAAS,CAAC,CAACH,OAAO,CAAC,UAACC,GAAG,EAAK;MAC3C,KAAI,CAACA,GAAG,CAAC,CAACJ,KAAK,EAAE;IACnB,CAAC,CAAC;;IAEF;IACA;IACA,mBAAY,IAAI,CAACO,YAAY,CAAC,CAACJ,OAAO,CAAC,UAACC,GAAG,EAAK;MAC9C,KAAI,CAACA,GAAG,CAAC,CAACI,KAAK,EAAE;IACnB,CAAC,CAAC;IAEF,OAAO,IAAI;EACb,CAAC;EAED;EAEA;AACF;AACA;AACA;AACA;AACA;EACEC,UAAU,wBAAG;IAAA;IACX;IACA,IAAMC,UAAU,GAAG,CAAC,cAAc,EAAE,KAAK,EAAE,QAAQ,CAAC;;IAEpD;IACAA,UAAU,CAACP,OAAO,CAAC,UAACQ,SAAS,EAAK;MAChCC,mCAAwB,CAACT,OAAO,CAAC,UAACU,cAAc,EAAK;QACnD,MAAI,CAACA,cAAc,CAAC,CAACC,EAAE,CAACH,SAAS,EAAE,UAACI,KAAK,EAAEd,OAAO,EAAK;UACrD,MAAI,CAACe,OAAO,kBAAWH,cAAc,GAAI,MAAI,EAAE,MAAI,CAACA,cAAc,CAAC,EAAEZ,OAAO,CAAC;QAC/E,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;AACF,CAAC,CAAC;AAAC,eAEYT,aAAa;AAAA"}
1
+ {"version":3,"names":["_ampersandState","_interopRequireDefault","require","_constants","_featureCollection","FeaturesModel","AmpState","extend","collections","developer","FeatureCollection","entitlement","user","clear","options","_this","_keys","default","attributes","forEach","key","unset","_children","_collections","reset","initialize","_this2","eventNames","eventName","FEATURE_COLLECTION_NAMES","collectionName","on","model","trigger","concat","_default","exports"],"sources":["features-model.js"],"sourcesContent":["// External dependencies.\nimport AmpState from 'ampersand-state';\n\n// Local Dependencies\nimport {FEATURE_COLLECTION_NAMES} from '../constants';\n\nimport FeatureCollection from './feature-collection';\n\n/**\n * Feature collection parent container.\n *\n * @description\n * This class contains all of the feature collection class objects to help\n * organize the data retrieved from the **wdm** service on device registration.\n */\nconst FeaturesModel = AmpState.extend({\n // Ampersand property members.\n\n collections: {\n /**\n * This collection contains the developer feature collection.\n *\n * @type {FeatureCollection}\n */\n developer: FeatureCollection,\n\n /**\n * This collection contains the entitlement feature collection.\n *\n * @type {FeatureCollection}\n */\n entitlement: FeatureCollection,\n\n /**\n * This collection contains the user feature collection.\n *\n * @type {FeatureCollection}\n */\n user: FeatureCollection,\n },\n\n // Helper method members.\n\n /**\n * Recursively clear attributes, children, and collections.\n *\n * @param {Object} options - Attribute options to unset.\n * @returns {this}\n */\n clear(options) {\n // Clear the ampersand attributes safely if there are any. This class should\n // never have any attributes.\n Object.keys(this.attributes).forEach((key) => {\n this.unset(key, options);\n });\n\n // Clear the ampersand children safely if there are any. This class should\n // never have any children.\n /* eslint-disable-next-line no-underscore-dangle */\n Object.keys(this._children).forEach((key) => {\n this[key].clear();\n });\n\n // Clear the ampersand collections safely.\n /* eslint-disable-next-line no-underscore-dangle */\n Object.keys(this._collections).forEach((key) => {\n this[key].reset();\n });\n\n return this;\n },\n\n // Ampersand method members.\n\n /**\n * Initializer method for FeatureModel class object.\n *\n * @override\n * @returns {void}\n */\n initialize() {\n // Declare the collection event names.\n const eventNames = ['change:value', 'add', 'remove'];\n\n // Initialize collection event listeners.\n eventNames.forEach((eventName) => {\n FEATURE_COLLECTION_NAMES.forEach((collectionName) => {\n this[collectionName].on(eventName, (model, options) => {\n this.trigger(`change:${collectionName}`, this, this[collectionName], options);\n });\n });\n });\n },\n});\n\nexport default FeaturesModel;\n"],"mappings":";;;;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AANA;;AAGA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMG,aAAa,GAAGC,uBAAQ,CAACC,MAAM,CAAC;EACpC;;EAEAC,WAAW,EAAE;IACX;AACJ;AACA;AACA;AACA;IACIC,S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MAAI,EAAEA,MAAI,CAACI,cAAc,CAAC,EAAEhB,OAAO,CAAC;QAC/E,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;AACF,CAAC,CAAC;AAAC,IAAAqB,QAAA,GAAAC,OAAA,CAAAnB,OAAA,GAEYZ,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.js"],"sourcesContent":["import FeatureCollection from './feature-collection';\nimport FeatureModel from './feature-model';\nimport FeaturesModel from './features-model';\n\nexport {FeatureCollection, FeatureModel, FeaturesModel};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA"}
1
+ {"version":3,"names":["_featureCollection","_interopRequireDefault","require","_featureModel","_featuresModel"],"sources":["index.js"],"sourcesContent":["import FeatureCollection from './feature-collection';\nimport FeatureModel from './feature-model';\nimport FeaturesModel from './features-model';\n\nexport {FeatureCollection, FeatureModel, FeaturesModel};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GAAAH,sBAAA,CAAAC,OAAA"}
package/dist/index.js CHANGED
@@ -53,8 +53,8 @@ var _deviceUrl = _interopRequireDefault(require("./interceptors/device-url"));
53
53
  var constants = _interopRequireWildcard(require("./constants"));
54
54
  exports.constants = constants;
55
55
  var _config = _interopRequireDefault(require("./config"));
56
- function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
57
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
56
+ function _getRequireWildcardCache(e) { if ("function" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
57
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
58
58
  // Internal dependencies.
59
59
  // Need to import metrics plugin for the devices to send metrics on succes/failure registration
60
60
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["registerInternalPlugin","Device","config","interceptors","DeviceUrlInterceptor","create","onBeforeLogout","unregister"],"sources":["index.js"],"sourcesContent":["// Internal dependencies.\n// Need to import metrics plugin for the devices to send metrics on succes/failure registration\nimport '@webex/internal-plugin-metrics';\nimport {registerInternalPlugin} from '@webex/webex-core';\n\n// Plugin dependencies.\nimport Device from './device';\nimport {FeatureCollection, FeatureModel, FeaturesModel} from './features/index';\nimport DeviceUrlInterceptor from './interceptors/device-url';\nimport * as constants from './constants';\nimport config from './config';\n\nregisterInternalPlugin('device', Device, {\n config,\n interceptors: {\n DeviceUrlInterceptor: DeviceUrlInterceptor.create,\n },\n /**\n * Unregister the device in the case that the webex instance has logged out.\n *\n * @returns {Promise<undefined>}\n */\n onBeforeLogout() {\n return this.unregister();\n },\n});\n\nexport {default} from './device';\nexport {config, constants, DeviceUrlInterceptor, FeatureCollection, FeatureModel, FeaturesModel};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AAGA;AACA;AACA;AACA;AAAyC;AACzC;AAA8B;AAAA;AAV9B;AACA;;AAIA;;AAOA,IAAAA,iCAAsB,EAAC,QAAQ,EAAEC,eAAM,EAAE;EACvCC,MAAM,EAANA,eAAM;EACNC,YAAY,EAAE;IACZC,oBAAoB,EAAEA,kBAAoB,CAACC;EAC7C,CAAC;EACD;AACF;AACA;AACA;AACA;EACEC,cAAc,4BAAG;IACf,OAAO,IAAI,CAACC,UAAU,EAAE;EAC1B;AACF,CAAC,CAAC"}
1
+ {"version":3,"names":["require","_webexCore","_device","_interopRequireDefault","_index","_deviceUrl","constants","_interopRequireWildcard","exports","_config","_getRequireWildcardCache","e","_WeakMap","r","t","__esModule","_typeof","default","has","get","n","__proto__","a","_Object$defineProperty","_Object$getOwnPropertyDescriptor","u","Object","prototype","hasOwnProperty","call","i","set","registerInternalPlugin","Device","config","interceptors","DeviceUrlInterceptor","create","onBeforeLogout","unregister"],"sources":["index.js"],"sourcesContent":["// Internal dependencies.\n// Need to import metrics plugin for the devices to send metrics on succes/failure registration\nimport '@webex/internal-plugin-metrics';\nimport {registerInternalPlugin} from '@webex/webex-core';\n\n// Plugin dependencies.\nimport Device from './device';\nimport {FeatureCollection, FeatureModel, FeaturesModel} from './features/index';\nimport DeviceUrlInterceptor from './interceptors/device-url';\nimport * as constants from './constants';\nimport config from './config';\n\nregisterInternalPlugin('device', Device, {\n config,\n interceptors: {\n DeviceUrlInterceptor: DeviceUrlInterceptor.create,\n },\n /**\n * Unregister the device in the case that the webex instance has logged out.\n *\n * @returns {Promise<undefined>}\n */\n onBeforeLogout() {\n return this.unregister();\n },\n});\n\nexport {default} from './device';\nexport {config, constants, DeviceUrlInterceptor, FeatureCollection, FeatureModel, FeaturesModel};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEAA,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAGA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,SAAA,GAAAC,uBAAA,CAAAP,OAAA;AAAyCQ,OAAA,CAAAF,SAAA,GAAAA,SAAA;AACzC,IAAAG,OAAA,GAAAN,sBAAA,CAAAH,OAAA;AAA8B,SAAAU,yBAAAC,CAAA,6BAAAC,QAAA,mBAAAC,CAAA,OAAAD,QAAA,IAAAE,CAAA,OAAAF,QAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,WAAAM,OAAA,EAAAN,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAI,GAAA,CAAAP,CAAA,UAAAG,CAAA,CAAAK,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,sBAAA,IAAAC,gCAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAC,MAAA,CAAAC,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAlB,CAAA,EAAAc,CAAA,SA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