@webex/internal-plugin-device 3.5.0-next.11 → 3.5.0-next.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/device.js +12 -6
- package/dist/device.js.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/ipNetworkDetector.js +1 -1
- package/dist/types.js +15 -0
- package/dist/types.js.map +1 -0
- package/package.json +10 -10
- package/src/device.js +16 -8
- package/src/index.js +12 -1
- package/src/types.ts +10 -0
- package/test/unit/spec/device.js +179 -22
package/dist/device.js
CHANGED
|
@@ -24,6 +24,7 @@ var _metrics = _interopRequireDefault(require("./metrics"));
|
|
|
24
24
|
var _constants = require("./constants");
|
|
25
25
|
var _featuresModel = _interopRequireDefault(require("./features/features-model"));
|
|
26
26
|
var _ipNetworkDetector = _interopRequireDefault(require("./ipNetworkDetector"));
|
|
27
|
+
var _types = require("./types");
|
|
27
28
|
var _dec, _dec2, _dec3, _dec4, _dec5, _obj; // Internal Dependencies
|
|
28
29
|
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
30
|
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; }
|
|
@@ -342,6 +343,7 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
342
343
|
},
|
|
343
344
|
refresh: function refresh() {
|
|
344
345
|
var _this = this;
|
|
346
|
+
var deviceRegistrationOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
345
347
|
this.logger.info('device: refreshing');
|
|
346
348
|
|
|
347
349
|
// Validate that the device can be registered.
|
|
@@ -349,7 +351,7 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
349
351
|
// Validate if the device is not registered and register instead.
|
|
350
352
|
if (!_this.registered) {
|
|
351
353
|
_this.logger.info('device: device not registered, registering');
|
|
352
|
-
return _this.register();
|
|
354
|
+
return _this.register(deviceRegistrationOptions);
|
|
353
355
|
}
|
|
354
356
|
|
|
355
357
|
// Merge body configurations, overriding defaults.
|
|
@@ -369,13 +371,14 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
369
371
|
var headers = _objectSpread(_objectSpread(_objectSpread({}, _this.config.defaults.headers ? _this.config.defaults.headers : {}), _this.config.headers ? _this.config.headers : {}), _this.etag ? {
|
|
370
372
|
'If-None-Match': _this.etag
|
|
371
373
|
} : {});
|
|
374
|
+
var includeDetails = deviceRegistrationOptions.includeDetails;
|
|
372
375
|
return _this.request({
|
|
373
376
|
method: 'PUT',
|
|
374
377
|
uri: _this.url,
|
|
375
378
|
body: body,
|
|
376
379
|
headers: headers,
|
|
377
380
|
qs: {
|
|
378
|
-
includeUpstreamServices: "
|
|
381
|
+
includeUpstreamServices: "".concat(includeDetails).concat(_this.config.energyForecast && _this.energyForecastConfig ? ',energyforecast' : '')
|
|
379
382
|
}
|
|
380
383
|
}).then(function (response) {
|
|
381
384
|
return _this.processRegistrationSuccess(response);
|
|
@@ -386,7 +389,7 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
386
389
|
_this.logger.info('device: refresh failed, device is not valid');
|
|
387
390
|
_this.logger.info('device: attempting to register a new device');
|
|
388
391
|
_this.clear();
|
|
389
|
-
return _this.register();
|
|
392
|
+
return _this.register(deviceRegistrationOptions);
|
|
390
393
|
}
|
|
391
394
|
return _promise.default.reject(reason);
|
|
392
395
|
});
|
|
@@ -394,6 +397,7 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
394
397
|
},
|
|
395
398
|
register: function register() {
|
|
396
399
|
var _this2 = this;
|
|
400
|
+
var deviceRegistrationOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
397
401
|
this.logger.info('device: registering');
|
|
398
402
|
this.webex.internal.newMetrics.callDiagnosticMetrics.setDeviceInfo(this);
|
|
399
403
|
|
|
@@ -402,7 +406,7 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
402
406
|
// Validate if the device is already registered and refresh instead.
|
|
403
407
|
if (_this2.registered) {
|
|
404
408
|
_this2.logger.info('device: device already registered, refreshing');
|
|
405
|
-
return _this2.refresh();
|
|
409
|
+
return _this2.refresh(deviceRegistrationOptions);
|
|
406
410
|
}
|
|
407
411
|
|
|
408
412
|
// Merge body configurations, overriding defaults.
|
|
@@ -418,6 +422,8 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
418
422
|
_this2.webex.internal.newMetrics.submitInternalEvent({
|
|
419
423
|
name: 'internal.register.device.request'
|
|
420
424
|
});
|
|
425
|
+
var _deviceRegistrationOp = deviceRegistrationOptions.includeDetails,
|
|
426
|
+
includeDetails = _deviceRegistrationOp === void 0 ? _types.CatalogDetails.all : _deviceRegistrationOp;
|
|
421
427
|
|
|
422
428
|
// This will be replaced by a `create()` method.
|
|
423
429
|
return _this2.request({
|
|
@@ -427,7 +433,7 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
427
433
|
body: body,
|
|
428
434
|
headers: headers,
|
|
429
435
|
qs: {
|
|
430
|
-
includeUpstreamServices: "
|
|
436
|
+
includeUpstreamServices: "".concat(includeDetails).concat(_this2.config.energyForecast && _this2.energyForecastConfig ? ',energyforecast' : '')
|
|
431
437
|
}
|
|
432
438
|
}).catch(function (error) {
|
|
433
439
|
_this2.webex.internal.newMetrics.submitInternalEvent({
|
|
@@ -758,7 +764,7 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
758
764
|
_this9.resetLogoutTimer();
|
|
759
765
|
});
|
|
760
766
|
} /* eslint-enable require-jsdoc */,
|
|
761
|
-
version: "3.5.0-next.
|
|
767
|
+
version: "3.5.0-next.13"
|
|
762
768
|
}, ((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)));
|
|
763
769
|
var _default = exports.default = Device;
|
|
764
770
|
//# sourceMappingURL=device.js.map
|
package/dist/device.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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","energyForecastConfig","isInMeeting","isInNetwork","meetingStarted","webex","trigger","meetingEnded","setEnergyForecastConfig","undefined","refresh","_this","logger","info","canRegister","then","register","body","serialize","mediaCluster","etag","ttl","ephemeralDeviceTTL","headers","defaults","request","method","uri","qs","includeUpstreamServices","concat","energyForecast","response","processRegistrationSuccess","catch","reason","statusCode","clear","_promise","reject","_this2","internal","newMetrics","callDiagnosticMetrics","setDeviceInfo","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","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","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 next refresh or register request should request energy forecast data\n * in order to prevent over fetching energy forecasts\n *\n * @type {boolean}\n */\n energyForecastConfig: 'boolean',\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 /**\n * Set the value of energy forecast config for the current registered device.\n * @param {boolean} [energyForecastConfig=false] - fetch an energy forecast on the next refresh/register\n * @returns {void}\n */\n setEnergyForecastConfig(energyForecastConfig = false) {\n this.energyForecastConfig = energyForecastConfig;\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 qs: {\n includeUpstreamServices: `all${\n this.config.energyForecast && this.energyForecastConfig ? ',energyforecast' : ''\n }`,\n },\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 this.webex.internal.newMetrics.callDiagnosticMetrics.setDeviceInfo(this);\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 qs: {\n includeUpstreamServices: `all${\n this.config.energyForecast && this.energyForecastConfig ? ',energyforecast' : ''\n }`,\n },\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":";;;;;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A,CAAAlL,OAAA,EAAAnB,IAAA,eAAAA,IAAA,OAAAmM,0BAAA,CAAAhL,OAAA,EAAAnB,IAAA,iBAoFToM,iBAAS,EAAAvM,KAAA,OAAAwM,yBAAA,CAAAlL,OAAA,EAAAnB,IAAA,iBAAAA,IAAA,OAAAmM,0BAAA,CAAAhL,OAAA,EAAAnB,IAAA,6BAAAF,KAAA,OAAAuM,yBAAA,CAAAlL,OAAA,EAAAnB,IAAA,6BAAAA,IAAA,OAAAmM,0BAAA,CAAAhL,OAAA,EAAAnB,IAAA,iBAAAD,KAAA,OAAAsM,yBAAA,CAAAlL,OAAA,EAAAnB,IAAA,iBAAAA,IAAA,IAAAA,IAAA,EAkWX,CAAC;AAAC,IAAAsM,QAAA,GAAAC,OAAA,CAAApL,OAAA,GAEYO,MAAM"}
|
|
1
|
+
{"version":3,"names":["_common","require","_webexCore","_commonTimers","_metrics","_interopRequireDefault","_constants","_featuresModel","_ipNetworkDetector","_types","_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","energyForecastConfig","isInMeeting","isInNetwork","meetingStarted","webex","trigger","meetingEnded","setEnergyForecastConfig","undefined","refresh","_this","deviceRegistrationOptions","logger","info","canRegister","then","register","body","serialize","mediaCluster","etag","ttl","ephemeralDeviceTTL","headers","defaults","includeDetails","request","method","uri","qs","includeUpstreamServices","concat","energyForecast","response","processRegistrationSuccess","catch","reason","statusCode","clear","_promise","reject","_this2","internal","newMetrics","callDiagnosticMetrics","setDeviceInfo","submitInternalEvent","name","_deviceRegistrationOp","CatalogDetails","all","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","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","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';\nimport {CatalogDetails} from './types';\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 next refresh or register request should request energy forecast data\n * in order to prevent over fetching energy forecasts\n *\n * @type {boolean}\n */\n energyForecastConfig: 'boolean',\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 /**\n * Set the value of energy forecast config for the current registered device.\n * @param {boolean} [energyForecastConfig=false] - fetch an energy forecast on the next refresh/register\n * @returns {void}\n */\n setEnergyForecastConfig(energyForecastConfig = false) {\n this.energyForecastConfig = energyForecastConfig;\n },\n\n // Registration method members\n\n /**\n * Refresh the current registered device if able.\n *\n * @param {DeviceRegistrationOptions} options - The options for refresh.\n * @param {CatalogDetails} options.includeDetails - The details to include in the refresh/register request.\n * @returns {Promise<void, Error>}\n */\n @oneFlight\n @waitForValue('@')\n refresh(deviceRegistrationOptions = {}) {\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(deviceRegistrationOptions);\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 const {includeDetails} = deviceRegistrationOptions;\n\n return this.request({\n method: 'PUT',\n uri: this.url,\n body,\n headers,\n qs: {\n includeUpstreamServices: `${includeDetails}${\n this.config.energyForecast && this.energyForecastConfig ? ',energyforecast' : ''\n }`,\n },\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(deviceRegistrationOptions);\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 * @param {Object} options - The options for registration.\n * @param {CatalogDetails} options.includeDetails - The details to include in the refresh/register request.\n * @returns {Promise<void, Error>}\n */\n @oneFlight\n @waitForValue('@')\n register(deviceRegistrationOptions = {}) {\n this.logger.info('device: registering');\n\n this.webex.internal.newMetrics.callDiagnosticMetrics.setDeviceInfo(this);\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(deviceRegistrationOptions);\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 const {includeDetails = CatalogDetails.all} = deviceRegistrationOptions;\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 qs: {\n includeUpstreamServices: `${includeDetails}${\n this.config.energyForecast && this.energyForecastConfig ? ',energyforecast' : ''\n }`,\n },\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,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;IACA,IAAI,CAACkD,QAAQ,CAAC,IAAI,CAACtH,KAAK,EAAE,eAAe,EAAE,YAAM;MAC/C8G,MAAI,CAACjH,WAAW,GAAG,KAAK;MACxBiH,MAAI,CAAC1C,gBAAgB,CAAC,CAAC;IACzB,CAAC,CAAC;EACJ,CAAC,CACD;EAAAoD,OAAA;AACF,CAAC,OAAAC,0BAAA,CAAArL,OAAA,EAAAnB,IAAA,cAtgBEyM,iBAAS,EAAA9M,IAAA,OAAA+M,yBAAA,CAAAvL,OAAA,EAAAnB,IAAA,cAAAA,IAAA,OAAAwM,0BAAA,CAAArL,OAAA,EAAAnB,IAAA,eA8ETyM,iBAAS,EAAA7M,KAAA,OAAA8M,yBAAA,CAAAvL,OAAA,EAAAnB,IAAA,eAAAA,IAAA,OAAAwM,0BAAA,CAAArL,OAAA,EAAAnB,IAAA,iBAsFTyM,iBAAS,EAAA5M,KAAA,OAAA6M,yBAAA,CAAAvL,OAAA,EAAAnB,IAAA,iBAAAA,IAAA,OAAAwM,0BAAA,CAAArL,OAAA,EAAAnB,IAAA,6BAAAF,KAAA,OAAA4M,yBAAA,CAAAvL,OAAA,EAAAnB,IAAA,6BAAAA,IAAA,OAAAwM,0BAAA,CAAArL,OAAA,EAAAnB,IAAA,iBAAAD,KAAA,OAAA2M,yBAAA,CAAAvL,OAAA,EAAAnB,IAAA,iBAAAA,IAAA,IAAAA,IAAA,EAkWX,CAAC;AAAC,IAAA2M,QAAA,GAAAC,OAAA,CAAAzL,OAAA,GAEYO,MAAM"}
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,18 @@ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequ
|
|
|
8
8
|
_Object$defineProperty(exports, "__esModule", {
|
|
9
9
|
value: true
|
|
10
10
|
});
|
|
11
|
+
_Object$defineProperty(exports, "CatalogDetails", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function get() {
|
|
14
|
+
return _types.CatalogDetails;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
_Object$defineProperty(exports, "DeviceRegistrationOptions", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function get() {
|
|
20
|
+
return _types.DeviceRegistrationOptions;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
11
23
|
_Object$defineProperty(exports, "DeviceUrlInterceptor", {
|
|
12
24
|
enumerable: true,
|
|
13
25
|
get: function get() {
|
|
@@ -53,6 +65,7 @@ var _deviceUrl = _interopRequireDefault(require("./interceptors/device-url"));
|
|
|
53
65
|
var constants = _interopRequireWildcard(require("./constants"));
|
|
54
66
|
exports.constants = constants;
|
|
55
67
|
var _config = _interopRequireDefault(require("./config"));
|
|
68
|
+
var _types = require("./types");
|
|
56
69
|
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
70
|
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
71
|
// Internal dependencies.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
1
|
+
{"version":3,"names":["require","_webexCore","_device","_interopRequireDefault","_index","_deviceUrl","constants","_interopRequireWildcard","exports","_config","_types","_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';\nimport {CatalogDetails, DeviceRegistrationOptions} from './types';\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';\n\nexport {\n config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,CAAA,GAAAE,gCAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAK,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,sBAAA,CAAAH,CAAA,EAAAK,CAAA,EAAAK,CAAA,IAAAV,CAAA,CAAAK,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAL,CAAA,CAAAH,OAAA,GAAAN,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAiB,GAAA,CAAApB,CAAA,EAAAS,CAAA,GAAAA,CAAA;AAXlE;AACA;;AAIA;;AAQA,IAAAY,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,WAAAA,eAAA,EAAG;IACf,OAAO,IAAI,CAACC,UAAU,CAAC,CAAC;EAC1B;AACF,CAAC,CAAC"}
|
|
@@ -193,7 +193,7 @@ var IpNetworkDetector = _webexCore.WebexPlugin.extend({
|
|
|
193
193
|
}, _callee2, null, [[0,, 5, 8]]);
|
|
194
194
|
}))();
|
|
195
195
|
},
|
|
196
|
-
version: "3.5.0-next.
|
|
196
|
+
version: "3.5.0-next.13"
|
|
197
197
|
});
|
|
198
198
|
var _default = exports.default = IpNetworkDetector;
|
|
199
199
|
//# sourceMappingURL=ipNetworkDetector.js.map
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.CatalogDetails = void 0;
|
|
8
|
+
var CatalogDetails = exports.CatalogDetails = /*#__PURE__*/function (CatalogDetails) {
|
|
9
|
+
CatalogDetails["all"] = "all";
|
|
10
|
+
CatalogDetails["features"] = "features";
|
|
11
|
+
CatalogDetails["websocket"] = "websocket";
|
|
12
|
+
CatalogDetails["none"] = "none";
|
|
13
|
+
return CatalogDetails;
|
|
14
|
+
}({});
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CatalogDetails","exports"],"sources":["types.ts"],"sourcesContent":["export enum CatalogDetails {\n all = 'all',\n features = 'features',\n websocket = 'websocket',\n none = 'none',\n}\n\nexport type DeviceRegistrationOptions = {\n includeDetails?: CatalogDetails;\n};\n"],"mappings":";;;;;;;IAAYA,cAAc,GAAAC,OAAA,CAAAD,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA"}
|
package/package.json
CHANGED
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"@webex/eslint-config-legacy": "0.0.0",
|
|
26
26
|
"@webex/jest-config-legacy": "0.0.0",
|
|
27
27
|
"@webex/legacy-tools": "0.0.0",
|
|
28
|
-
"@webex/test-helper-chai": "3.5.0-next.
|
|
29
|
-
"@webex/test-helper-mocha": "3.5.0-next.
|
|
30
|
-
"@webex/test-helper-mock-webex": "3.5.0-next.
|
|
31
|
-
"@webex/test-helper-test-users": "3.5.0-next.
|
|
28
|
+
"@webex/test-helper-chai": "3.5.0-next.13",
|
|
29
|
+
"@webex/test-helper-mocha": "3.5.0-next.13",
|
|
30
|
+
"@webex/test-helper-mock-webex": "3.5.0-next.13",
|
|
31
|
+
"@webex/test-helper-test-users": "3.5.0-next.13",
|
|
32
32
|
"chai": "^4.3.4",
|
|
33
33
|
"chai-as-promised": "^7.1.1",
|
|
34
34
|
"eslint": "^8.24.0",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"sinon": "^9.2.4"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@webex/common": "3.5.0-next.
|
|
40
|
-
"@webex/common-timers": "3.5.0-next.
|
|
41
|
-
"@webex/http-core": "3.5.0-next.
|
|
42
|
-
"@webex/internal-plugin-metrics": "3.5.0-next.
|
|
43
|
-
"@webex/webex-core": "3.5.0-next.
|
|
39
|
+
"@webex/common": "3.5.0-next.13",
|
|
40
|
+
"@webex/common-timers": "3.5.0-next.13",
|
|
41
|
+
"@webex/http-core": "3.5.0-next.13",
|
|
42
|
+
"@webex/internal-plugin-metrics": "3.5.0-next.13",
|
|
43
|
+
"@webex/webex-core": "3.5.0-next.13",
|
|
44
44
|
"ampersand-collection": "^2.0.2",
|
|
45
45
|
"ampersand-state": "^5.0.3",
|
|
46
46
|
"lodash": "^4.17.21"
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"test:style": "eslint ./src/**/*.*",
|
|
55
55
|
"test:unit": "webex-legacy-tools test --unit --runner jest"
|
|
56
56
|
},
|
|
57
|
-
"version": "3.5.0-next.
|
|
57
|
+
"version": "3.5.0-next.13"
|
|
58
58
|
}
|
package/src/device.js
CHANGED
|
@@ -7,6 +7,7 @@ import METRICS from './metrics';
|
|
|
7
7
|
import {FEATURE_COLLECTION_NAMES, DEVICE_EVENT_REGISTRATION_SUCCESS} from './constants';
|
|
8
8
|
import FeaturesModel from './features/features-model';
|
|
9
9
|
import IpNetworkDetector from './ipNetworkDetector';
|
|
10
|
+
import {CatalogDetails} from './types';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Determine if the plugin should be initialized based on cached storage.
|
|
@@ -363,15 +364,16 @@ const Device = WebexPlugin.extend({
|
|
|
363
364
|
|
|
364
365
|
// Registration method members
|
|
365
366
|
|
|
366
|
-
/* eslint-disable require-jsdoc */
|
|
367
367
|
/**
|
|
368
368
|
* Refresh the current registered device if able.
|
|
369
369
|
*
|
|
370
|
+
* @param {DeviceRegistrationOptions} options - The options for refresh.
|
|
371
|
+
* @param {CatalogDetails} options.includeDetails - The details to include in the refresh/register request.
|
|
370
372
|
* @returns {Promise<void, Error>}
|
|
371
373
|
*/
|
|
372
374
|
@oneFlight
|
|
373
375
|
@waitForValue('@')
|
|
374
|
-
refresh() {
|
|
376
|
+
refresh(deviceRegistrationOptions = {}) {
|
|
375
377
|
this.logger.info('device: refreshing');
|
|
376
378
|
|
|
377
379
|
// Validate that the device can be registered.
|
|
@@ -380,7 +382,7 @@ const Device = WebexPlugin.extend({
|
|
|
380
382
|
if (!this.registered) {
|
|
381
383
|
this.logger.info('device: device not registered, registering');
|
|
382
384
|
|
|
383
|
-
return this.register();
|
|
385
|
+
return this.register(deviceRegistrationOptions);
|
|
384
386
|
}
|
|
385
387
|
|
|
386
388
|
// Merge body configurations, overriding defaults.
|
|
@@ -407,13 +409,15 @@ const Device = WebexPlugin.extend({
|
|
|
407
409
|
...(this.etag ? {'If-None-Match': this.etag} : {}),
|
|
408
410
|
};
|
|
409
411
|
|
|
412
|
+
const {includeDetails} = deviceRegistrationOptions;
|
|
413
|
+
|
|
410
414
|
return this.request({
|
|
411
415
|
method: 'PUT',
|
|
412
416
|
uri: this.url,
|
|
413
417
|
body,
|
|
414
418
|
headers,
|
|
415
419
|
qs: {
|
|
416
|
-
includeUpstreamServices:
|
|
420
|
+
includeUpstreamServices: `${includeDetails}${
|
|
417
421
|
this.config.energyForecast && this.energyForecastConfig ? ',energyforecast' : ''
|
|
418
422
|
}`,
|
|
419
423
|
},
|
|
@@ -428,7 +432,7 @@ const Device = WebexPlugin.extend({
|
|
|
428
432
|
|
|
429
433
|
this.clear();
|
|
430
434
|
|
|
431
|
-
return this.register();
|
|
435
|
+
return this.register(deviceRegistrationOptions);
|
|
432
436
|
}
|
|
433
437
|
|
|
434
438
|
return Promise.reject(reason);
|
|
@@ -441,11 +445,13 @@ const Device = WebexPlugin.extend({
|
|
|
441
445
|
* registration utilizes the services plugin to send the request to the
|
|
442
446
|
* **WDM** service.
|
|
443
447
|
*
|
|
448
|
+
* @param {Object} options - The options for registration.
|
|
449
|
+
* @param {CatalogDetails} options.includeDetails - The details to include in the refresh/register request.
|
|
444
450
|
* @returns {Promise<void, Error>}
|
|
445
451
|
*/
|
|
446
452
|
@oneFlight
|
|
447
453
|
@waitForValue('@')
|
|
448
|
-
register() {
|
|
454
|
+
register(deviceRegistrationOptions = {}) {
|
|
449
455
|
this.logger.info('device: registering');
|
|
450
456
|
|
|
451
457
|
this.webex.internal.newMetrics.callDiagnosticMetrics.setDeviceInfo(this);
|
|
@@ -456,7 +462,7 @@ const Device = WebexPlugin.extend({
|
|
|
456
462
|
if (this.registered) {
|
|
457
463
|
this.logger.info('device: device already registered, refreshing');
|
|
458
464
|
|
|
459
|
-
return this.refresh();
|
|
465
|
+
return this.refresh(deviceRegistrationOptions);
|
|
460
466
|
}
|
|
461
467
|
|
|
462
468
|
// Merge body configurations, overriding defaults.
|
|
@@ -479,6 +485,8 @@ const Device = WebexPlugin.extend({
|
|
|
479
485
|
name: 'internal.register.device.request',
|
|
480
486
|
});
|
|
481
487
|
|
|
488
|
+
const {includeDetails = CatalogDetails.all} = deviceRegistrationOptions;
|
|
489
|
+
|
|
482
490
|
// This will be replaced by a `create()` method.
|
|
483
491
|
return this.request({
|
|
484
492
|
method: 'POST',
|
|
@@ -487,7 +495,7 @@ const Device = WebexPlugin.extend({
|
|
|
487
495
|
body,
|
|
488
496
|
headers,
|
|
489
497
|
qs: {
|
|
490
|
-
includeUpstreamServices:
|
|
498
|
+
includeUpstreamServices: `${includeDetails}${
|
|
491
499
|
this.config.energyForecast && this.energyForecastConfig ? ',energyforecast' : ''
|
|
492
500
|
}`,
|
|
493
501
|
},
|
package/src/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import {FeatureCollection, FeatureModel, FeaturesModel} from './features/index';
|
|
|
9
9
|
import DeviceUrlInterceptor from './interceptors/device-url';
|
|
10
10
|
import * as constants from './constants';
|
|
11
11
|
import config from './config';
|
|
12
|
+
import {CatalogDetails, DeviceRegistrationOptions} from './types';
|
|
12
13
|
|
|
13
14
|
registerInternalPlugin('device', Device, {
|
|
14
15
|
config,
|
|
@@ -26,4 +27,14 @@ registerInternalPlugin('device', Device, {
|
|
|
26
27
|
});
|
|
27
28
|
|
|
28
29
|
export {default} from './device';
|
|
29
|
-
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
config,
|
|
33
|
+
constants,
|
|
34
|
+
CatalogDetails,
|
|
35
|
+
DeviceRegistrationOptions,
|
|
36
|
+
DeviceUrlInterceptor,
|
|
37
|
+
FeatureCollection,
|
|
38
|
+
FeatureModel,
|
|
39
|
+
FeaturesModel,
|
|
40
|
+
};
|
package/src/types.ts
ADDED
package/test/unit/spec/device.js
CHANGED
|
@@ -3,6 +3,7 @@ import {cloneDeep} from 'lodash';
|
|
|
3
3
|
import MockWebex from '@webex/test-helper-mock-webex';
|
|
4
4
|
import sinon from 'sinon';
|
|
5
5
|
import Device from '@webex/internal-plugin-device';
|
|
6
|
+
import {CatalogDetails} from '@webex/internal-plugin-device';
|
|
6
7
|
|
|
7
8
|
import dto from './wdm-dto';
|
|
8
9
|
|
|
@@ -56,7 +57,7 @@ describe('plugin-device', () => {
|
|
|
56
57
|
device.checkNetworkReachability = sinon.spy();
|
|
57
58
|
});
|
|
58
59
|
|
|
59
|
-
describe(
|
|
60
|
+
describe("when the 'intranetInactivityCheckUrl' changes", () => {
|
|
60
61
|
beforeEach(() => {
|
|
61
62
|
device.intranetInactivityCheckUrl = 'https://not-a-url.com';
|
|
62
63
|
});
|
|
@@ -70,7 +71,7 @@ describe('plugin-device', () => {
|
|
|
70
71
|
});
|
|
71
72
|
});
|
|
72
73
|
|
|
73
|
-
describe(
|
|
74
|
+
describe("when the 'intranetInactivityDuration' changes", () => {
|
|
74
75
|
beforeEach(() => {
|
|
75
76
|
device.intranetInactivityDuration = 1234;
|
|
76
77
|
});
|
|
@@ -84,7 +85,7 @@ describe('plugin-device', () => {
|
|
|
84
85
|
});
|
|
85
86
|
});
|
|
86
87
|
|
|
87
|
-
describe(
|
|
88
|
+
describe("when the 'inNetworkInactivityDuration' changes", () => {
|
|
88
89
|
beforeEach(() => {
|
|
89
90
|
device.inNetworkInactivityDuration = 1234;
|
|
90
91
|
});
|
|
@@ -177,16 +178,22 @@ describe('plugin-device', () => {
|
|
|
177
178
|
let requestSpy;
|
|
178
179
|
|
|
179
180
|
const setup = (config = {}) => {
|
|
181
|
+
webex.internal.metrics.submitClientMetrics = sinon.stub();
|
|
182
|
+
|
|
180
183
|
sinon.stub(device, 'canRegister').callsFake(() => Promise.resolve());
|
|
181
184
|
sinon.stub(device, 'processRegistrationSuccess').callsFake(() => {});
|
|
182
185
|
requestSpy = sinon.spy(device, 'request');
|
|
183
186
|
device.config.defaults = {};
|
|
184
|
-
Object.keys(
|
|
187
|
+
Object.keys(config).forEach((key) => {
|
|
185
188
|
device.config[key] = config[key];
|
|
186
189
|
});
|
|
187
190
|
device.set('registered', true);
|
|
188
191
|
};
|
|
189
192
|
|
|
193
|
+
afterEach(() => {
|
|
194
|
+
sinon.restore();
|
|
195
|
+
});
|
|
196
|
+
|
|
190
197
|
it('If-None-Match header is added if etag is set', async () => {
|
|
191
198
|
setup();
|
|
192
199
|
|
|
@@ -211,33 +218,129 @@ describe('plugin-device', () => {
|
|
|
211
218
|
assert.deepEqual(requestSpy.args[0][0].headers, {});
|
|
212
219
|
});
|
|
213
220
|
|
|
221
|
+
it('calls request with the expected properties when includeDetails is specified', async () => {
|
|
222
|
+
setup();
|
|
223
|
+
|
|
224
|
+
const registerSpy = sinon.spy(device, 'register');
|
|
225
|
+
device.setEnergyForecastConfig(false);
|
|
226
|
+
device.set('registered', true);
|
|
227
|
+
|
|
228
|
+
await device.refresh({includeDetails: CatalogDetails.features});
|
|
229
|
+
|
|
230
|
+
assert.calledWith(requestSpy, {
|
|
231
|
+
method: 'PUT',
|
|
232
|
+
uri: 'https://locus-a.wbx2.com/locus/api/v1/devices/88888888-4444-4444-4444-CCCCCCCCCCCC',
|
|
233
|
+
body: sinon.match.any,
|
|
234
|
+
headers: {},
|
|
235
|
+
qs: {includeUpstreamServices: CatalogDetails.features},
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
assert.notCalled(registerSpy);
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
it('calls register with default includeDetails when not registered', async () => {
|
|
242
|
+
setup();
|
|
243
|
+
|
|
244
|
+
const registerSpy = sinon.stub(device, 'register').callsFake(() => Promise.resolve());
|
|
245
|
+
device.setEnergyForecastConfig(false);
|
|
246
|
+
device.set('registered', false);
|
|
247
|
+
|
|
248
|
+
await device.refresh();
|
|
249
|
+
|
|
250
|
+
assert.calledWith(registerSpy, {});
|
|
251
|
+
});
|
|
252
|
+
|
|
214
253
|
it('uses the energy forecast config to append upstream services to the outgoing call', async () => {
|
|
215
254
|
setup({energyForecast: true});
|
|
216
255
|
device.setEnergyForecastConfig(true);
|
|
256
|
+
device.set('registered', false);
|
|
217
257
|
|
|
218
258
|
await device.register();
|
|
219
259
|
|
|
220
|
-
assert.calledWith(
|
|
221
|
-
|
|
222
|
-
|
|
260
|
+
assert.calledWith(
|
|
261
|
+
requestSpy,
|
|
262
|
+
sinon.match({
|
|
263
|
+
qs: {includeUpstreamServices: 'all,energyforecast'},
|
|
264
|
+
})
|
|
265
|
+
);
|
|
223
266
|
});
|
|
224
267
|
|
|
225
268
|
it('uses the energy forecast config to not append upstream services to the outgoing call', async () => {
|
|
226
269
|
setup({energyForecast: true});
|
|
227
270
|
device.setEnergyForecastConfig(false);
|
|
271
|
+
device.set('registered', false);
|
|
228
272
|
|
|
229
273
|
await device.register();
|
|
230
274
|
|
|
231
|
-
assert.calledWith(
|
|
232
|
-
|
|
233
|
-
|
|
275
|
+
assert.calledWith(
|
|
276
|
+
requestSpy,
|
|
277
|
+
sinon.match({
|
|
278
|
+
qs: {includeUpstreamServices: 'all'},
|
|
279
|
+
})
|
|
280
|
+
);
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
it('calls request with the expected properties when includeDetails is specified', async () => {
|
|
284
|
+
setup();
|
|
285
|
+
|
|
286
|
+
const registerSpy = sinon.spy(device, 'register');
|
|
287
|
+
device.setEnergyForecastConfig(false);
|
|
288
|
+
device.set('registered', true);
|
|
289
|
+
|
|
290
|
+
await device.refresh({includeDetails: CatalogDetails.features});
|
|
291
|
+
|
|
292
|
+
assert.calledWith(requestSpy, {
|
|
293
|
+
method: 'PUT',
|
|
294
|
+
uri: 'https://locus-a.wbx2.com/locus/api/v1/devices/88888888-4444-4444-4444-CCCCCCCCCCCC',
|
|
295
|
+
body: sinon.match.any,
|
|
296
|
+
headers: {},
|
|
297
|
+
qs: {includeUpstreamServices: CatalogDetails.features},
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
assert.notCalled(registerSpy);
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
it('calls register with default includeDetails when not registered', async () => {
|
|
304
|
+
setup();
|
|
305
|
+
|
|
306
|
+
const registerSpy = sinon.stub(device, 'register').callsFake(() => Promise.resolve());
|
|
307
|
+
device.setEnergyForecastConfig(false);
|
|
308
|
+
device.set('registered', false);
|
|
309
|
+
|
|
310
|
+
await device.refresh();
|
|
311
|
+
|
|
312
|
+
assert.calledWith(registerSpy, {});
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
it('calls register with default includeDetails when empty options passed', async () => {
|
|
316
|
+
setup();
|
|
317
|
+
|
|
318
|
+
const registerSpy = sinon.stub(device, 'register').callsFake(() => Promise.resolve());
|
|
319
|
+
device.setEnergyForecastConfig(false);
|
|
320
|
+
device.set('registered', false);
|
|
321
|
+
|
|
322
|
+
await device.refresh({});
|
|
323
|
+
|
|
324
|
+
assert.calledWith(registerSpy, {});
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
it('calls register with specified includeDetails when not registered', async () => {
|
|
328
|
+
setup();
|
|
329
|
+
|
|
330
|
+
const registerSpy = sinon.stub(device, 'register').callsFake(() => Promise.resolve());
|
|
331
|
+
device.setEnergyForecastConfig(false);
|
|
332
|
+
device.set('registered', false);
|
|
333
|
+
|
|
334
|
+
await device.refresh({includeDetails: CatalogDetails.websocket});
|
|
335
|
+
|
|
336
|
+
assert.calledWith(registerSpy, {includeDetails: CatalogDetails.websocket});
|
|
234
337
|
});
|
|
235
338
|
});
|
|
236
339
|
|
|
237
340
|
describe('#register()', () => {
|
|
238
341
|
const setup = (config = {}) => {
|
|
239
342
|
webex.internal.metrics.submitClientMetrics = sinon.stub();
|
|
240
|
-
|
|
343
|
+
|
|
241
344
|
sinon.stub(device, 'processRegistrationSuccess').callsFake(() => {});
|
|
242
345
|
|
|
243
346
|
device.config.defaults = {};
|
|
@@ -247,6 +350,10 @@ describe('plugin-device', () => {
|
|
|
247
350
|
device.set('registered', false);
|
|
248
351
|
};
|
|
249
352
|
|
|
353
|
+
afterEach(() => {
|
|
354
|
+
sinon.restore();
|
|
355
|
+
});
|
|
356
|
+
|
|
250
357
|
it('checks that submitInternalEvent gets called with internal.register.device.request', async () => {
|
|
251
358
|
setup();
|
|
252
359
|
sinon.stub(device, 'canRegister').callsFake(() => Promise.resolve());
|
|
@@ -257,7 +364,6 @@ describe('plugin-device', () => {
|
|
|
257
364
|
assert.calledWith(webex.internal.newMetrics.submitInternalEvent, {
|
|
258
365
|
name: 'internal.register.device.request',
|
|
259
366
|
});
|
|
260
|
-
|
|
261
367
|
});
|
|
262
368
|
|
|
263
369
|
it('checks that submitInternalEvent gets called with internal.register.device.response on error', async () => {
|
|
@@ -272,16 +378,17 @@ describe('plugin-device', () => {
|
|
|
272
378
|
assert.calledWith(webex.internal.newMetrics.submitInternalEvent, {
|
|
273
379
|
name: 'internal.register.device.response',
|
|
274
380
|
});
|
|
275
|
-
|
|
276
381
|
});
|
|
277
382
|
|
|
278
383
|
it('checks that submitInternalEvent gets called with internal.register.device.response on success', async () => {
|
|
279
384
|
setup();
|
|
280
385
|
sinon.stub(device, 'canRegister').callsFake(() => Promise.resolve());
|
|
281
386
|
|
|
282
|
-
sinon.stub(device, 'request').callsFake(() =>
|
|
283
|
-
|
|
284
|
-
|
|
387
|
+
sinon.stub(device, 'request').callsFake(() =>
|
|
388
|
+
Promise.resolve({
|
|
389
|
+
exampleKey: 'example response value',
|
|
390
|
+
})
|
|
391
|
+
);
|
|
285
392
|
|
|
286
393
|
await device.register();
|
|
287
394
|
|
|
@@ -294,7 +401,7 @@ describe('plugin-device', () => {
|
|
|
294
401
|
setup();
|
|
295
402
|
sinon.stub(device, 'canRegister').rejects(new Error('some error'));
|
|
296
403
|
|
|
297
|
-
const result =
|
|
404
|
+
const result = device.register();
|
|
298
405
|
|
|
299
406
|
await assert.isRejected(result);
|
|
300
407
|
|
|
@@ -309,7 +416,6 @@ describe('plugin-device', () => {
|
|
|
309
416
|
await device.register();
|
|
310
417
|
|
|
311
418
|
assert.calledWith(webex.internal.newMetrics.callDiagnosticMetrics.setDeviceInfo, device);
|
|
312
|
-
|
|
313
419
|
});
|
|
314
420
|
|
|
315
421
|
it('uses the energy forecast config to append upstream services to the outgoing call', async () => {
|
|
@@ -326,8 +432,8 @@ describe('plugin-device', () => {
|
|
|
326
432
|
resource: 'devices',
|
|
327
433
|
body: {},
|
|
328
434
|
headers: {},
|
|
329
|
-
qs: {
|
|
330
|
-
}
|
|
435
|
+
qs: {includeUpstreamServices: 'all,energyforecast'},
|
|
436
|
+
});
|
|
331
437
|
});
|
|
332
438
|
|
|
333
439
|
it('uses the energy forecast config to not append upstream services to the outgoing call', async () => {
|
|
@@ -344,10 +450,61 @@ describe('plugin-device', () => {
|
|
|
344
450
|
resource: 'devices',
|
|
345
451
|
body: {},
|
|
346
452
|
headers: {},
|
|
347
|
-
qs: {
|
|
348
|
-
}
|
|
453
|
+
qs: {includeUpstreamServices: 'all'},
|
|
454
|
+
});
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
it('calls request with the expected properties when includeDetails is specified', async () => {
|
|
458
|
+
setup();
|
|
459
|
+
|
|
460
|
+
sinon.stub(device, 'canRegister').callsFake(() => Promise.resolve());
|
|
461
|
+
const requestSpy = sinon.spy(device, 'request');
|
|
462
|
+
const refreshSpy = sinon.spy(device, 'refresh');
|
|
463
|
+
|
|
464
|
+
device.setEnergyForecastConfig(false);
|
|
465
|
+
|
|
466
|
+
await device.register({includeDetails: CatalogDetails.features});
|
|
467
|
+
|
|
468
|
+
assert.calledWith(requestSpy, {
|
|
469
|
+
method: 'POST',
|
|
470
|
+
service: 'wdm',
|
|
471
|
+
resource: 'devices',
|
|
472
|
+
body: {},
|
|
473
|
+
headers: {},
|
|
474
|
+
qs: {includeUpstreamServices: CatalogDetails.features},
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
assert.notCalled(refreshSpy);
|
|
349
478
|
});
|
|
350
479
|
|
|
480
|
+
it('calls refresh with default includeDetails when registered', async () => {
|
|
481
|
+
setup();
|
|
482
|
+
|
|
483
|
+
sinon.stub(device, 'canRegister').callsFake(() => Promise.resolve());
|
|
484
|
+
const refreshSpy = sinon.spy(device, 'refresh');
|
|
485
|
+
|
|
486
|
+
device.setEnergyForecastConfig(false);
|
|
487
|
+
device.set('registered', true);
|
|
488
|
+
|
|
489
|
+
await device.register();
|
|
490
|
+
|
|
491
|
+
assert.calledWith(refreshSpy, {});
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
it('calls refresh with specified includeDetails when registered', async () => {
|
|
495
|
+
setup();
|
|
496
|
+
|
|
497
|
+
sinon.stub(device, 'canRegister').callsFake(() => Promise.resolve());
|
|
498
|
+
const requestSpy = sinon.spy(device, 'request');
|
|
499
|
+
const refreshSpy = sinon.spy(device, 'refresh');
|
|
500
|
+
|
|
501
|
+
device.setEnergyForecastConfig(false);
|
|
502
|
+
device.set('registered', true);
|
|
503
|
+
|
|
504
|
+
await device.register({includeDetails: CatalogDetails.websocket});
|
|
505
|
+
|
|
506
|
+
assert.calledWith(refreshSpy, {includeDetails: CatalogDetails.websocket});
|
|
507
|
+
});
|
|
351
508
|
});
|
|
352
509
|
|
|
353
510
|
describe('#processRegistrationSuccess()', () => {
|