@webex/internal-plugin-device 3.5.0 → 3.6.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/device.js +13 -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 +222 -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,15 @@ 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 _deviceRegistrationOp = deviceRegistrationOptions.includeDetails,
|
|
375
|
+
includeDetails = _deviceRegistrationOp === void 0 ? _types.CatalogDetails.all : _deviceRegistrationOp;
|
|
372
376
|
return _this.request({
|
|
373
377
|
method: 'PUT',
|
|
374
378
|
uri: _this.url,
|
|
375
379
|
body: body,
|
|
376
380
|
headers: headers,
|
|
377
381
|
qs: {
|
|
378
|
-
includeUpstreamServices: "
|
|
382
|
+
includeUpstreamServices: "".concat(includeDetails).concat(_this.config.energyForecast && _this.energyForecastConfig ? ',energyforecast' : '')
|
|
379
383
|
}
|
|
380
384
|
}).then(function (response) {
|
|
381
385
|
return _this.processRegistrationSuccess(response);
|
|
@@ -386,7 +390,7 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
386
390
|
_this.logger.info('device: refresh failed, device is not valid');
|
|
387
391
|
_this.logger.info('device: attempting to register a new device');
|
|
388
392
|
_this.clear();
|
|
389
|
-
return _this.register();
|
|
393
|
+
return _this.register(deviceRegistrationOptions);
|
|
390
394
|
}
|
|
391
395
|
return _promise.default.reject(reason);
|
|
392
396
|
});
|
|
@@ -394,6 +398,7 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
394
398
|
},
|
|
395
399
|
register: function register() {
|
|
396
400
|
var _this2 = this;
|
|
401
|
+
var deviceRegistrationOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
397
402
|
this.logger.info('device: registering');
|
|
398
403
|
this.webex.internal.newMetrics.callDiagnosticMetrics.setDeviceInfo(this);
|
|
399
404
|
|
|
@@ -402,7 +407,7 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
402
407
|
// Validate if the device is already registered and refresh instead.
|
|
403
408
|
if (_this2.registered) {
|
|
404
409
|
_this2.logger.info('device: device already registered, refreshing');
|
|
405
|
-
return _this2.refresh();
|
|
410
|
+
return _this2.refresh(deviceRegistrationOptions);
|
|
406
411
|
}
|
|
407
412
|
|
|
408
413
|
// Merge body configurations, overriding defaults.
|
|
@@ -418,6 +423,8 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
418
423
|
_this2.webex.internal.newMetrics.submitInternalEvent({
|
|
419
424
|
name: 'internal.register.device.request'
|
|
420
425
|
});
|
|
426
|
+
var _deviceRegistrationOp2 = deviceRegistrationOptions.includeDetails,
|
|
427
|
+
includeDetails = _deviceRegistrationOp2 === void 0 ? _types.CatalogDetails.all : _deviceRegistrationOp2;
|
|
421
428
|
|
|
422
429
|
// This will be replaced by a `create()` method.
|
|
423
430
|
return _this2.request({
|
|
@@ -427,7 +434,7 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
427
434
|
body: body,
|
|
428
435
|
headers: headers,
|
|
429
436
|
qs: {
|
|
430
|
-
includeUpstreamServices: "
|
|
437
|
+
includeUpstreamServices: "".concat(includeDetails).concat(_this2.config.energyForecast && _this2.energyForecastConfig ? ',energyforecast' : '')
|
|
431
438
|
}
|
|
432
439
|
}).catch(function (error) {
|
|
433
440
|
_this2.webex.internal.newMetrics.submitInternalEvent({
|
|
@@ -758,7 +765,7 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
758
765
|
_this9.resetLogoutTimer();
|
|
759
766
|
});
|
|
760
767
|
} /* eslint-enable require-jsdoc */,
|
|
761
|
-
version: "3.
|
|
768
|
+
version: "3.6.0-next.2"
|
|
762
769
|
}, ((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
770
|
var _default = exports.default = Device;
|
|
764
771
|
//# 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.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,CAAAhL,OAAA,EAAAnB,IAAA,eA0EToM,iBAAS,EAAAxM,KAAA,OAAAyM,yBAAA,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","_deviceRegistrationOp","includeDetails","CatalogDetails","all","request","method","uri","qs","includeUpstreamServices","concat","energyForecast","response","processRegistrationSuccess","catch","reason","statusCode","clear","_promise","reject","_this2","internal","newMetrics","callDiagnosticMetrics","setDeviceInfo","submitInternalEvent","name","_deviceRegistrationOp2","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 = CatalogDetails.all} = 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-jsdo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_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,\n constants,\n CatalogDetails,\n DeviceRegistrationOptions,\n DeviceUrlInterceptor,\n FeatureCollection,\n FeatureModel,\n FeaturesModel,\n};\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;AACA,IAAAU,MAAA,GAAAV,OAAA;AAAkE,SAAAW,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,SAAAL,wBAAAK,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,SAAAK,CAAA,GAAAR,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.
|
|
196
|
+
version: "3.6.0-next.2"
|
|
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.
|
|
29
|
-
"@webex/test-helper-mocha": "3.
|
|
30
|
-
"@webex/test-helper-mock-webex": "3.
|
|
31
|
-
"@webex/test-helper-test-users": "3.
|
|
28
|
+
"@webex/test-helper-chai": "3.6.0-next.2",
|
|
29
|
+
"@webex/test-helper-mocha": "3.6.0-next.2",
|
|
30
|
+
"@webex/test-helper-mock-webex": "3.6.0-next.2",
|
|
31
|
+
"@webex/test-helper-test-users": "3.6.0-next.2",
|
|
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.
|
|
40
|
-
"@webex/common-timers": "3.
|
|
41
|
-
"@webex/http-core": "3.
|
|
42
|
-
"@webex/internal-plugin-metrics": "3.
|
|
43
|
-
"@webex/webex-core": "3.
|
|
39
|
+
"@webex/common": "3.6.0-next.2",
|
|
40
|
+
"@webex/common-timers": "3.6.0-next.2",
|
|
41
|
+
"@webex/http-core": "3.6.0-next.2",
|
|
42
|
+
"@webex/internal-plugin-metrics": "3.6.0-next.2",
|
|
43
|
+
"@webex/webex-core": "3.6.0-next.2",
|
|
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.
|
|
57
|
+
"version": "3.6.0-next.2"
|
|
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 = CatalogDetails.all} = 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,149 @@ 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 not 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();
|
|
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.all},
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
assert.notCalled(registerSpy);
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
it('calls request with the expected properties when includeDetails is specified', async () => {
|
|
242
|
+
setup();
|
|
243
|
+
|
|
244
|
+
const registerSpy = sinon.spy(device, 'register');
|
|
245
|
+
device.setEnergyForecastConfig(false);
|
|
246
|
+
device.set('registered', true);
|
|
247
|
+
|
|
248
|
+
await device.refresh({includeDetails: CatalogDetails.features});
|
|
249
|
+
|
|
250
|
+
assert.calledWith(requestSpy, {
|
|
251
|
+
method: 'PUT',
|
|
252
|
+
uri: 'https://locus-a.wbx2.com/locus/api/v1/devices/88888888-4444-4444-4444-CCCCCCCCCCCC',
|
|
253
|
+
body: sinon.match.any,
|
|
254
|
+
headers: {},
|
|
255
|
+
qs: {includeUpstreamServices: CatalogDetails.features},
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
assert.notCalled(registerSpy);
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
it('calls register with default includeDetails when not registered', async () => {
|
|
262
|
+
setup();
|
|
263
|
+
|
|
264
|
+
const registerSpy = sinon.stub(device, 'register').callsFake(() => Promise.resolve());
|
|
265
|
+
device.setEnergyForecastConfig(false);
|
|
266
|
+
device.set('registered', false);
|
|
267
|
+
|
|
268
|
+
await device.refresh();
|
|
269
|
+
|
|
270
|
+
assert.calledWith(registerSpy, {});
|
|
271
|
+
});
|
|
272
|
+
|
|
214
273
|
it('uses the energy forecast config to append upstream services to the outgoing call', async () => {
|
|
215
274
|
setup({energyForecast: true});
|
|
216
275
|
device.setEnergyForecastConfig(true);
|
|
276
|
+
device.set('registered', false);
|
|
217
277
|
|
|
218
278
|
await device.register();
|
|
219
279
|
|
|
220
|
-
assert.calledWith(
|
|
221
|
-
|
|
222
|
-
|
|
280
|
+
assert.calledWith(
|
|
281
|
+
requestSpy,
|
|
282
|
+
sinon.match({
|
|
283
|
+
qs: {includeUpstreamServices: 'all,energyforecast'},
|
|
284
|
+
})
|
|
285
|
+
);
|
|
223
286
|
});
|
|
224
287
|
|
|
225
288
|
it('uses the energy forecast config to not append upstream services to the outgoing call', async () => {
|
|
226
289
|
setup({energyForecast: true});
|
|
227
290
|
device.setEnergyForecastConfig(false);
|
|
291
|
+
device.set('registered', false);
|
|
228
292
|
|
|
229
293
|
await device.register();
|
|
230
294
|
|
|
231
|
-
assert.calledWith(
|
|
232
|
-
|
|
233
|
-
|
|
295
|
+
assert.calledWith(
|
|
296
|
+
requestSpy,
|
|
297
|
+
sinon.match({
|
|
298
|
+
qs: {includeUpstreamServices: 'all'},
|
|
299
|
+
})
|
|
300
|
+
);
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
it('calls request with the expected properties when includeDetails is specified', async () => {
|
|
304
|
+
setup();
|
|
305
|
+
|
|
306
|
+
const registerSpy = sinon.spy(device, 'register');
|
|
307
|
+
device.setEnergyForecastConfig(false);
|
|
308
|
+
device.set('registered', true);
|
|
309
|
+
|
|
310
|
+
await device.refresh({includeDetails: CatalogDetails.features});
|
|
311
|
+
|
|
312
|
+
assert.calledWith(requestSpy, {
|
|
313
|
+
method: 'PUT',
|
|
314
|
+
uri: 'https://locus-a.wbx2.com/locus/api/v1/devices/88888888-4444-4444-4444-CCCCCCCCCCCC',
|
|
315
|
+
body: sinon.match.any,
|
|
316
|
+
headers: {},
|
|
317
|
+
qs: {includeUpstreamServices: CatalogDetails.features},
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
assert.notCalled(registerSpy);
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
it('calls register with default includeDetails when not registered', async () => {
|
|
324
|
+
setup();
|
|
325
|
+
|
|
326
|
+
const registerSpy = sinon.stub(device, 'register').callsFake(() => Promise.resolve());
|
|
327
|
+
device.setEnergyForecastConfig(false);
|
|
328
|
+
device.set('registered', false);
|
|
329
|
+
|
|
330
|
+
await device.refresh();
|
|
331
|
+
|
|
332
|
+
assert.calledWith(registerSpy, {});
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
it('calls register with default includeDetails when empty options passed', async () => {
|
|
336
|
+
setup();
|
|
337
|
+
|
|
338
|
+
const registerSpy = sinon.stub(device, 'register').callsFake(() => Promise.resolve());
|
|
339
|
+
device.setEnergyForecastConfig(false);
|
|
340
|
+
device.set('registered', false);
|
|
341
|
+
|
|
342
|
+
await device.refresh({});
|
|
343
|
+
|
|
344
|
+
assert.calledWith(registerSpy, {});
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
it('calls register with specified includeDetails when not registered', async () => {
|
|
348
|
+
setup();
|
|
349
|
+
|
|
350
|
+
const registerSpy = sinon.stub(device, 'register').callsFake(() => Promise.resolve());
|
|
351
|
+
device.setEnergyForecastConfig(false);
|
|
352
|
+
device.set('registered', false);
|
|
353
|
+
|
|
354
|
+
await device.refresh({includeDetails: CatalogDetails.websocket});
|
|
355
|
+
|
|
356
|
+
assert.calledWith(registerSpy, {includeDetails: CatalogDetails.websocket});
|
|
234
357
|
});
|
|
235
358
|
});
|
|
236
359
|
|
|
237
360
|
describe('#register()', () => {
|
|
238
361
|
const setup = (config = {}) => {
|
|
239
362
|
webex.internal.metrics.submitClientMetrics = sinon.stub();
|
|
240
|
-
|
|
363
|
+
|
|
241
364
|
sinon.stub(device, 'processRegistrationSuccess').callsFake(() => {});
|
|
242
365
|
|
|
243
366
|
device.config.defaults = {};
|
|
@@ -247,6 +370,10 @@ describe('plugin-device', () => {
|
|
|
247
370
|
device.set('registered', false);
|
|
248
371
|
};
|
|
249
372
|
|
|
373
|
+
afterEach(() => {
|
|
374
|
+
sinon.restore();
|
|
375
|
+
});
|
|
376
|
+
|
|
250
377
|
it('checks that submitInternalEvent gets called with internal.register.device.request', async () => {
|
|
251
378
|
setup();
|
|
252
379
|
sinon.stub(device, 'canRegister').callsFake(() => Promise.resolve());
|
|
@@ -257,7 +384,6 @@ describe('plugin-device', () => {
|
|
|
257
384
|
assert.calledWith(webex.internal.newMetrics.submitInternalEvent, {
|
|
258
385
|
name: 'internal.register.device.request',
|
|
259
386
|
});
|
|
260
|
-
|
|
261
387
|
});
|
|
262
388
|
|
|
263
389
|
it('checks that submitInternalEvent gets called with internal.register.device.response on error', async () => {
|
|
@@ -272,16 +398,17 @@ describe('plugin-device', () => {
|
|
|
272
398
|
assert.calledWith(webex.internal.newMetrics.submitInternalEvent, {
|
|
273
399
|
name: 'internal.register.device.response',
|
|
274
400
|
});
|
|
275
|
-
|
|
276
401
|
});
|
|
277
402
|
|
|
278
403
|
it('checks that submitInternalEvent gets called with internal.register.device.response on success', async () => {
|
|
279
404
|
setup();
|
|
280
405
|
sinon.stub(device, 'canRegister').callsFake(() => Promise.resolve());
|
|
281
406
|
|
|
282
|
-
sinon.stub(device, 'request').callsFake(() =>
|
|
283
|
-
|
|
284
|
-
|
|
407
|
+
sinon.stub(device, 'request').callsFake(() =>
|
|
408
|
+
Promise.resolve({
|
|
409
|
+
exampleKey: 'example response value',
|
|
410
|
+
})
|
|
411
|
+
);
|
|
285
412
|
|
|
286
413
|
await device.register();
|
|
287
414
|
|
|
@@ -294,7 +421,7 @@ describe('plugin-device', () => {
|
|
|
294
421
|
setup();
|
|
295
422
|
sinon.stub(device, 'canRegister').rejects(new Error('some error'));
|
|
296
423
|
|
|
297
|
-
const result =
|
|
424
|
+
const result = device.register();
|
|
298
425
|
|
|
299
426
|
await assert.isRejected(result);
|
|
300
427
|
|
|
@@ -309,7 +436,6 @@ describe('plugin-device', () => {
|
|
|
309
436
|
await device.register();
|
|
310
437
|
|
|
311
438
|
assert.calledWith(webex.internal.newMetrics.callDiagnosticMetrics.setDeviceInfo, device);
|
|
312
|
-
|
|
313
439
|
});
|
|
314
440
|
|
|
315
441
|
it('uses the energy forecast config to append upstream services to the outgoing call', async () => {
|
|
@@ -326,8 +452,8 @@ describe('plugin-device', () => {
|
|
|
326
452
|
resource: 'devices',
|
|
327
453
|
body: {},
|
|
328
454
|
headers: {},
|
|
329
|
-
qs: {
|
|
330
|
-
}
|
|
455
|
+
qs: {includeUpstreamServices: 'all,energyforecast'},
|
|
456
|
+
});
|
|
331
457
|
});
|
|
332
458
|
|
|
333
459
|
it('uses the energy forecast config to not append upstream services to the outgoing call', async () => {
|
|
@@ -344,10 +470,84 @@ describe('plugin-device', () => {
|
|
|
344
470
|
resource: 'devices',
|
|
345
471
|
body: {},
|
|
346
472
|
headers: {},
|
|
347
|
-
qs: {
|
|
348
|
-
}
|
|
473
|
+
qs: {includeUpstreamServices: 'all'},
|
|
474
|
+
});
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
it('calls request with the expected properties when includeDetails is specified', async () => {
|
|
478
|
+
setup();
|
|
479
|
+
|
|
480
|
+
sinon.stub(device, 'canRegister').callsFake(() => Promise.resolve());
|
|
481
|
+
const requestSpy = sinon.spy(device, 'request');
|
|
482
|
+
const refreshSpy = sinon.spy(device, 'refresh');
|
|
483
|
+
|
|
484
|
+
device.setEnergyForecastConfig(false);
|
|
485
|
+
|
|
486
|
+
await device.register({includeDetails: CatalogDetails.features});
|
|
487
|
+
|
|
488
|
+
assert.calledWith(requestSpy, {
|
|
489
|
+
method: 'POST',
|
|
490
|
+
service: 'wdm',
|
|
491
|
+
resource: 'devices',
|
|
492
|
+
body: {},
|
|
493
|
+
headers: {},
|
|
494
|
+
qs: {includeUpstreamServices: CatalogDetails.features},
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
assert.notCalled(refreshSpy);
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
it('calls request with the expected properties when includeDetails is not specified', async () => {
|
|
501
|
+
setup();
|
|
502
|
+
|
|
503
|
+
sinon.stub(device, 'canRegister').callsFake(() => Promise.resolve());
|
|
504
|
+
const requestSpy = sinon.spy(device, 'request');
|
|
505
|
+
const refreshSpy = sinon.spy(device, 'refresh');
|
|
506
|
+
|
|
507
|
+
device.setEnergyForecastConfig(false);
|
|
508
|
+
|
|
509
|
+
await device.register();
|
|
510
|
+
|
|
511
|
+
assert.calledWith(requestSpy, {
|
|
512
|
+
method: 'POST',
|
|
513
|
+
service: 'wdm',
|
|
514
|
+
resource: 'devices',
|
|
515
|
+
body: {},
|
|
516
|
+
headers: {},
|
|
517
|
+
qs: {includeUpstreamServices: CatalogDetails.all},
|
|
518
|
+
});
|
|
519
|
+
|
|
520
|
+
assert.notCalled(refreshSpy);
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
it('calls refresh with default includeDetails when registered', async () => {
|
|
524
|
+
setup();
|
|
525
|
+
|
|
526
|
+
sinon.stub(device, 'canRegister').callsFake(() => Promise.resolve());
|
|
527
|
+
const refreshSpy = sinon.spy(device, 'refresh');
|
|
528
|
+
|
|
529
|
+
device.setEnergyForecastConfig(false);
|
|
530
|
+
device.set('registered', true);
|
|
531
|
+
|
|
532
|
+
await device.register();
|
|
533
|
+
|
|
534
|
+
assert.calledWith(refreshSpy, {});
|
|
349
535
|
});
|
|
350
536
|
|
|
537
|
+
it('calls refresh with specified includeDetails when registered', async () => {
|
|
538
|
+
setup();
|
|
539
|
+
|
|
540
|
+
sinon.stub(device, 'canRegister').callsFake(() => Promise.resolve());
|
|
541
|
+
const requestSpy = sinon.spy(device, 'request');
|
|
542
|
+
const refreshSpy = sinon.spy(device, 'refresh');
|
|
543
|
+
|
|
544
|
+
device.setEnergyForecastConfig(false);
|
|
545
|
+
device.set('registered', true);
|
|
546
|
+
|
|
547
|
+
await device.register({includeDetails: CatalogDetails.websocket});
|
|
548
|
+
|
|
549
|
+
assert.calledWith(refreshSpy, {includeDetails: CatalogDetails.websocket});
|
|
550
|
+
});
|
|
351
551
|
});
|
|
352
552
|
|
|
353
553
|
describe('#processRegistrationSuccess()', () => {
|