@webex/internal-plugin-device 3.4.0 → 3.5.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/config.js +6 -1
- package/dist/config.js.map +1 -1
- package/dist/device.js +25 -3
- package/dist/device.js.map +1 -1
- package/dist/ipNetworkDetector.js +1 -1
- package/package.json +10 -10
- package/src/config.js +6 -0
- package/src/device.js +27 -0
- package/test/unit/spec/device.js +66 -2
package/dist/config.js
CHANGED
|
@@ -54,7 +54,12 @@ var _default = exports.default = {
|
|
|
54
54
|
*
|
|
55
55
|
* @type {boolean}
|
|
56
56
|
*/
|
|
57
|
-
ephemeralDeviceTTL: 30 * 60
|
|
57
|
+
ephemeralDeviceTTL: 30 * 60,
|
|
58
|
+
/**
|
|
59
|
+
* energyForcast
|
|
60
|
+
* @type {boolean}
|
|
61
|
+
*/
|
|
62
|
+
energyForecast: false
|
|
58
63
|
},
|
|
59
64
|
/**
|
|
60
65
|
* installationId is used exclusively as web client for fraud prevention,
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_common","require","_default","exports","default","device","canRegisterWaitDuration","defaults","body","name","process","title","trim","undefined","inBrowser","deviceType","WEB","model","localizedModel","systemName","systemVersion","enableInactivityEnforcement","ephemeral","ephemeralDeviceTTL","installationId"],"sources":["config.js"],"sourcesContent":["import {inBrowser, deviceType} from '@webex/common';\n\nexport default {\n device: {\n /**\n * The duration to wait for the catalog to populate in seconds.\n *\n * @type {number}\n */\n canRegisterWaitDuration: 10,\n\n /**\n * The default configuration group when sending registration requests.\n *\n * @type {Object}\n */\n defaults: {\n /**\n * The default body configuration of registration requests.\n *\n * @type {Object}\n */\n body: {\n name:\n (typeof process.title === 'string' ? process.title.trim() : undefined) ||\n (inBrowser && 'browser') ||\n 'javascript',\n deviceType: deviceType.WEB,\n model: 'web-js-sdk',\n localizedModel: 'webex-js-sdk',\n systemName: 'WEBEX_JS_SDK',\n systemVersion: '1.0.0',\n },\n },\n\n /**\n * When true, the **wdm** service will enforce an inactivity duration.\n *\n * @type {boolean}\n */\n enableInactivityEnforcement: false,\n\n /**\n * When true, the device registration will include a ttl value of\n * {@link config.device.ephemeralDeviceTTL} and refresh on an interval of\n * {@link config.device.ephemeralDeviceTTL} / 2 + 60 seconds.\n *\n * @type {boolean}\n */\n ephemeral: false,\n\n /**\n * The ttl value to include in device registration if\n * {@link config.device.ephemeral} is true. Measured in seconds.\n *\n * @type {boolean}\n */\n ephemeralDeviceTTL: 30 * 60,\n },\n\n /**\n * installationId is used exclusively as web client for fraud prevention,\n * and is aliased to as machineId by CA.\n *\n * @alias device.machineId\n * @type {string}\n */\n installationId: undefined,\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAoD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAErC;EACbC,MAAM,EAAE;IACN;AACJ;AACA;AACA;AACA;IACIC,uBAAuB,EAAE,EAAE;IAE3B;AACJ;AACA;AACA;AACA;IACIC,QAAQ,EAAE;MACR;AACN;AACA;AACA;AACA;MACMC,IAAI,EAAE;QACJC,IAAI,EACF,CAAC,OAAOC,OAAO,CAACC,KAAK,KAAK,QAAQ,GAAGD,OAAO,CAACC,KAAK,CAACC,IAAI,CAAC,CAAC,GAAGC,SAAS,KACpEC,iBAAS,IAAI,SAAU,IACxB,YAAY;QACdC,UAAU,EAAEA,kBAAU,CAACC,GAAG;QAC1BC,KAAK,EAAE,YAAY;QACnBC,cAAc,EAAE,cAAc;QAC9BC,UAAU,EAAE,cAAc;QAC1BC,aAAa,EAAE;MACjB;IACF,CAAC;IAED;AACJ;AACA;AACA;AACA;IACIC,2BAA2B,EAAE,KAAK;IAElC;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,SAAS,EAAE,KAAK;IAEhB;AACJ;AACA;AACA;AACA;AACA;IACIC,kBAAkB,EAAE,EAAE,GAAG;
|
|
1
|
+
{"version":3,"names":["_common","require","_default","exports","default","device","canRegisterWaitDuration","defaults","body","name","process","title","trim","undefined","inBrowser","deviceType","WEB","model","localizedModel","systemName","systemVersion","enableInactivityEnforcement","ephemeral","ephemeralDeviceTTL","energyForecast","installationId"],"sources":["config.js"],"sourcesContent":["import {inBrowser, deviceType} from '@webex/common';\n\nexport default {\n device: {\n /**\n * The duration to wait for the catalog to populate in seconds.\n *\n * @type {number}\n */\n canRegisterWaitDuration: 10,\n\n /**\n * The default configuration group when sending registration requests.\n *\n * @type {Object}\n */\n defaults: {\n /**\n * The default body configuration of registration requests.\n *\n * @type {Object}\n */\n body: {\n name:\n (typeof process.title === 'string' ? process.title.trim() : undefined) ||\n (inBrowser && 'browser') ||\n 'javascript',\n deviceType: deviceType.WEB,\n model: 'web-js-sdk',\n localizedModel: 'webex-js-sdk',\n systemName: 'WEBEX_JS_SDK',\n systemVersion: '1.0.0',\n },\n },\n\n /**\n * When true, the **wdm** service will enforce an inactivity duration.\n *\n * @type {boolean}\n */\n enableInactivityEnforcement: false,\n\n /**\n * When true, the device registration will include a ttl value of\n * {@link config.device.ephemeralDeviceTTL} and refresh on an interval of\n * {@link config.device.ephemeralDeviceTTL} / 2 + 60 seconds.\n *\n * @type {boolean}\n */\n ephemeral: false,\n\n /**\n * The ttl value to include in device registration if\n * {@link config.device.ephemeral} is true. Measured in seconds.\n *\n * @type {boolean}\n */\n ephemeralDeviceTTL: 30 * 60,\n\n /**\n * energyForcast\n * @type {boolean}\n */\n energyForecast: false,\n },\n\n /**\n * installationId is used exclusively as web client for fraud prevention,\n * and is aliased to as machineId by CA.\n *\n * @alias device.machineId\n * @type {string}\n */\n installationId: undefined,\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAoD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAErC;EACbC,MAAM,EAAE;IACN;AACJ;AACA;AACA;AACA;IACIC,uBAAuB,EAAE,EAAE;IAE3B;AACJ;AACA;AACA;AACA;IACIC,QAAQ,EAAE;MACR;AACN;AACA;AACA;AACA;MACMC,IAAI,EAAE;QACJC,IAAI,EACF,CAAC,OAAOC,OAAO,CAACC,KAAK,KAAK,QAAQ,GAAGD,OAAO,CAACC,KAAK,CAACC,IAAI,CAAC,CAAC,GAAGC,SAAS,KACpEC,iBAAS,IAAI,SAAU,IACxB,YAAY;QACdC,UAAU,EAAEA,kBAAU,CAACC,GAAG;QAC1BC,KAAK,EAAE,YAAY;QACnBC,cAAc,EAAE,cAAc;QAC9BC,UAAU,EAAE,cAAc;QAC1BC,aAAa,EAAE;MACjB;IACF,CAAC;IAED;AACJ;AACA;AACA;AACA;IACIC,2BAA2B,EAAE,KAAK;IAElC;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,SAAS,EAAE,KAAK;IAEhB;AACJ;AACA;AACA;AACA;AACA;IACIC,kBAAkB,EAAE,EAAE,GAAG,EAAE;IAE3B;AACJ;AACA;AACA;IACIC,cAAc,EAAE;EAClB,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,cAAc,EAAEZ;AAClB,CAAC"}
|
package/dist/device.js
CHANGED
|
@@ -291,6 +291,13 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
291
291
|
* @returns {boolean}
|
|
292
292
|
*/
|
|
293
293
|
isReachabilityChecked: ['boolean', false, false],
|
|
294
|
+
/**
|
|
295
|
+
* This property stores whether or not the next refresh or register request should request energy forecast data
|
|
296
|
+
* in order to prevent over fetching energy forecasts
|
|
297
|
+
*
|
|
298
|
+
* @type {boolean}
|
|
299
|
+
*/
|
|
300
|
+
energyForecastConfig: 'boolean',
|
|
294
301
|
/**
|
|
295
302
|
* This property stores whether or not the current device is in a meeting
|
|
296
303
|
* to prevent an unneeded timeout of a meeting due to inactivity.
|
|
@@ -324,6 +331,15 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
324
331
|
meetingEnded: function meetingEnded() {
|
|
325
332
|
this.webex.trigger('meeting ended');
|
|
326
333
|
},
|
|
334
|
+
/**
|
|
335
|
+
* Set the value of energy forecast config for the current registered device.
|
|
336
|
+
* @param {boolean} [energyForecastConfig=false] - fetch an energy forecast on the next refresh/register
|
|
337
|
+
* @returns {void}
|
|
338
|
+
*/
|
|
339
|
+
setEnergyForecastConfig: function setEnergyForecastConfig() {
|
|
340
|
+
var energyForecastConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
341
|
+
this.energyForecastConfig = energyForecastConfig;
|
|
342
|
+
},
|
|
327
343
|
refresh: function refresh() {
|
|
328
344
|
var _this = this;
|
|
329
345
|
this.logger.info('device: refreshing');
|
|
@@ -357,7 +373,10 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
357
373
|
method: 'PUT',
|
|
358
374
|
uri: _this.url,
|
|
359
375
|
body: body,
|
|
360
|
-
headers: headers
|
|
376
|
+
headers: headers,
|
|
377
|
+
qs: {
|
|
378
|
+
includeUpstreamServices: "all".concat(_this.config.energyForecast && _this.energyForecastConfig ? ',energyforecast' : '')
|
|
379
|
+
}
|
|
361
380
|
}).then(function (response) {
|
|
362
381
|
return _this.processRegistrationSuccess(response);
|
|
363
382
|
}).catch(function (reason) {
|
|
@@ -406,7 +425,10 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
406
425
|
service: 'wdm',
|
|
407
426
|
resource: 'devices',
|
|
408
427
|
body: body,
|
|
409
|
-
headers: headers
|
|
428
|
+
headers: headers,
|
|
429
|
+
qs: {
|
|
430
|
+
includeUpstreamServices: "all".concat(_this2.config.energyForecast && _this2.energyForecastConfig ? ',energyforecast' : '')
|
|
431
|
+
}
|
|
410
432
|
}).catch(function (error) {
|
|
411
433
|
_this2.webex.internal.newMetrics.submitInternalEvent({
|
|
412
434
|
name: 'internal.register.device.response'
|
|
@@ -736,7 +758,7 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
736
758
|
_this9.resetLogoutTimer();
|
|
737
759
|
});
|
|
738
760
|
} /* eslint-enable require-jsdoc */,
|
|
739
|
-
version: "3.
|
|
761
|
+
version: "3.5.0-next.2"
|
|
740
762
|
}, ((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)));
|
|
741
763
|
var _default = exports.default = Device;
|
|
742
764
|
//# 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","isInMeeting","isInNetwork","meetingStarted","webex","trigger","meetingEnded","refresh","_this","logger","info","canRegister","then","register","body","serialize","mediaCluster","etag","ttl","ephemeralDeviceTTL","headers","defaults","request","method","uri","response","processRegistrationSuccess","catch","reason","statusCode","clear","_promise","reject","_this2","internal","newMetrics","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","undefined","waitForRegistration","convertUrlToPriorityHostUrl","message","wsUrl","_this6","serviceHostMap","_ref","user","reset","entitlement","set","delay","refreshTimer","safeSetTimeout","DEVICE_EVENT_REGISTRATION_SUCCESS","clearTimeout","off","unset","enableInactivityEnforcement","setLogoutTimer","duration","_this7","on","logout","_this8","timeout","timeoutTimer","once","markUrlFailedAndGetNew","markFailedUrl","initialize","_this9","_len2","_key2","FEATURE_COLLECTION_NAMES","collectionName","concat","model","value","options","listenTo","_now","version","_applyDecoratedDescriptor2","oneFlight","_getOwnPropertyDescriptor","_default","exports"],"sources":["device.js"],"sourcesContent":["// Internal Dependencies\nimport {deprecated, oneFlight} from '@webex/common';\nimport {persist, waitForValue, WebexPlugin} from '@webex/webex-core';\nimport {safeSetTimeout} from '@webex/common-timers';\n\nimport METRICS from './metrics';\nimport {FEATURE_COLLECTION_NAMES, DEVICE_EVENT_REGISTRATION_SUCCESS} from './constants';\nimport FeaturesModel from './features/features-model';\nimport IpNetworkDetector from './ipNetworkDetector';\n\n/**\n * Determine if the plugin should be initialized based on cached storage.\n *\n * @returns {boolean} - If the device is ephemeral.\n */\nfunction decider() {\n return !this.config.ephemeral;\n}\n\nconst Device = WebexPlugin.extend({\n // Ampersand property members.\n\n namespace: 'Device',\n\n // Allow for extra properties to prevent the plugin from failing due to\n // **WDM** service DTO changes.\n extraProperties: 'allow',\n\n idAttribute: 'url',\n\n children: {\n /**\n * The class object that contains all of the feature collections.\n *\n * @type {FeaturesModel}\n */\n features: FeaturesModel,\n /**\n * Helper class for detecting what IP network version (ipv4, ipv6) we're on.\n *\n * @type {IpNetworkDetector}\n */\n ipNetworkDetector: IpNetworkDetector,\n },\n\n /**\n * A collection of device properties mostly assigned by the retrieved DTO from\n * the **WDM** service that are mapped against the ampersand properties.\n *\n * @type {Object}\n */\n props: {\n /**\n * This property determines whether or not giphy support is enabled.\n *\n * @type {'ALLOW' | 'BLOCK'}\n */\n clientMessagingGiphy: 'string',\n\n /**\n * This property should store the company name.\n *\n * @type {string}\n */\n customerCompanyName: 'string',\n\n /**\n * This property should store the logo url.\n *\n * @type {string}\n */\n customerLogoUrl: 'string',\n\n /**\n * This property doesn't have any real values, but is sent during device\n * refresh to prevent the **wdm** service from falling back to an iOS device\n * type.\n *\n * @type {string}\n */\n deviceType: 'string',\n\n /**\n * This property should store the help url.\n *\n * @type {string}\n */\n helpUrl: 'string',\n\n /**\n * This property should store the intranet inactivity timer duration.\n *\n * @type {number}\n */\n intranetInactivityDuration: 'number',\n\n /**\n * This property stores the url required to validate if the device is able\n * to actively reach the intranet network.\n *\n * @type {string}\n */\n intranetInactivityCheckUrl: 'string',\n\n /**\n * This property stores the inactivity timer duration, and could possibly\n * deprecate the `intranetInactivityDuration` property.\n *\n * @type {number}\n */\n inNetworkInactivityDuration: 'number',\n\n /**\n * This property stores the ECM (external content management) enabled value\n * for the whole organization.\n *\n * @type {boolean}\n */\n ecmEnabledForAllUsers: ['boolean', false, false],\n\n /**\n * This property stores an array of ECM (external content management)\n * providers that are currently available.\n *\n * @returns {Array<string>}\n */\n ecmSupportedStorageProviders: ['array', false, () => []],\n\n /**\n * This property stores the modification time value retrieved from the\n * **WDM** endpoint formatted as ISO 8601.\n *\n * @type {string}\n */\n modificationTime: 'string',\n\n /**\n * This property stores the navigation bar color.\n *\n * @type {string}\n */\n navigationBarColor: 'string',\n\n /**\n * This property stores the partner company's name when available.\n *\n * @type {string}\n */\n partnerCompanyName: 'string',\n\n /**\n * This property stores the partner company's logo when available.\n *\n * @type {string}\n */\n partnerLogoUrl: 'string',\n\n /**\n * This property stores the availability of people data from the **WDM**\n * service.\n *\n * @type {boolean}\n */\n peopleInsightsEnabled: 'boolean',\n\n /**\n * This property stores the reporting site's description when available.\n *\n * @type {string}\n */\n reportingSiteDesc: 'string',\n\n /**\n * This property stores the reporting site's access url when available.\n *\n * @type {string}\n */\n reportingSiteUrl: 'string',\n\n /**\n * This property stores the encryption key url when available.\n *\n * @type {string}\n */\n searchEncryptionKeyUrl: 'string',\n\n /**\n * This property stores the availability of support-provided text from the\n * **WDM** service.\n *\n * @type {boolean}\n */\n showSupportText: 'boolean',\n\n /**\n * This property stores the support provider's company name when available.\n *\n * @type {string}\n */\n supportProviderCompanyName: 'string',\n\n /**\n * This property stores the support provider's logo url when available.\n *\n * @type {string}\n */\n supportProviderLogoUrl: 'string',\n\n /**\n * This property stores the device's url retrieved from a registration\n * request. This property gets set via the initial registration process by a\n * `this.set()` method.\n *\n * @type {string}\n */\n url: 'string',\n\n /**\n * This property stores the device's userId uuid value, which can also be\n * derived from the device's registerd user's userId retrieved from\n * the **Hydra** service.\n *\n * @type {string}\n */\n userId: 'string',\n\n /**\n * This property stores whether or not file sharing is enabled\n *\n * @type {'BLOCK_BOTH' | 'BLOCK_UPLOAD'}\n */\n webFileShareControl: 'string',\n\n /**\n * This property stores the current web socket url used by the registered\n * device.\n *\n * @type {string}\n */\n webSocketUrl: 'string',\n\n /**\n * This property stores the value indicating whether or not white board file\n * sharing is enabled for the current device.\n *\n * @type {'ALLOW' | 'BLOCK'}\n */\n whiteboardFileShareControl: 'string',\n },\n\n /**\n * A list of derived properties that populate based when their parent data\n * available via the device's properties.\n *\n * @type {Object}\n */\n derived: {\n /**\n * This property determines if the current device is registered.\n *\n * @type {boolean}\n */\n registered: {\n deps: ['url'],\n\n /**\n * Checks if the device is registered by validating that the url exists.\n * Amperstand does not allow this to method to be written as an arrow\n * function.\n *\n * @returns {boolean}\n */\n fn() {\n return !!this.url;\n },\n },\n },\n\n /**\n * Stores timer data as well as other state details.\n *\n * @type {Object}\n */\n session: {\n /**\n * This property stores the logout timer object\n *\n * @type {any}\n */\n logoutTimer: 'any',\n\n /**\n * This property stores the date for the last activity the user made\n * with the current device.\n *\n * @type {number}\n */\n lastUserActivityDate: 'number',\n\n /**\n * This property stores whether or not the reachability check has been\n * performed to prevent the reachability check from performing its\n * operation more than once after a successful check.\n *\n * @returns {boolean}\n */\n isReachabilityChecked: ['boolean', false, false],\n\n /**\n * This property stores whether or not the current device is in a meeting\n * to prevent an unneeded timeout of a meeting due to inactivity.\n *\n * @type {boolean}\n */\n isInMeeting: 'boolean',\n\n /**\n * This property identifies if the device is currently in network to prevent\n * the `resetLogoutTimer()` method from being called repeatedly once its\n * known client is connected to the organization's internal network.\n *\n * @type {boolean}\n */\n isInNetwork: 'boolean',\n },\n\n // Event method members.\n\n /**\n * Trigger meeting started event for webex instance. Used by web-client team.\n *\n * @returns {void}\n */\n meetingStarted() {\n this.webex.trigger('meeting started');\n },\n\n /**\n * Trigger meeting ended event for webex instance. Used by web-client team.\n *\n * @returns {void}\n */\n meetingEnded() {\n this.webex.trigger('meeting ended');\n },\n\n // Registration method members\n\n /* eslint-disable require-jsdoc */\n /**\n * Refresh the current registered device if able.\n *\n * @returns {Promise<void, Error>}\n */\n @oneFlight\n @waitForValue('@')\n refresh() {\n this.logger.info('device: refreshing');\n\n // Validate that the device can be registered.\n return this.canRegister().then(() => {\n // Validate if the device is not registered and register instead.\n if (!this.registered) {\n this.logger.info('device: device not registered, registering');\n\n return this.register();\n }\n\n // Merge body configurations, overriding defaults.\n const body = {\n ...this.serialize(),\n ...(this.config.body ? this.config.body : {}),\n };\n\n // Remove unneeded properties from the body object.\n delete body.features;\n delete body.mediaCluster;\n delete body.etag;\n\n // Append a ttl value if the device is marked as ephemeral.\n if (this.config.ephemeral) {\n body.ttl = this.config.ephemeralDeviceTTL;\n }\n\n // Merge header configurations, overriding defaults.\n const headers = {\n ...(this.config.defaults.headers ? this.config.defaults.headers : {}),\n ...(this.config.headers ? this.config.headers : {}),\n // If etag is sent, WDM will not send developer feature toggles unless they have changed\n ...(this.etag ? {'If-None-Match': this.etag} : {}),\n };\n\n return this.request({\n method: 'PUT',\n uri: this.url,\n body,\n headers,\n })\n .then((response) => this.processRegistrationSuccess(response))\n .catch((reason) => {\n // Handle a 404 error, which indicates that the device is no longer\n // valid and needs to be registered as a new device.\n if (reason.statusCode === 404) {\n this.logger.info('device: refresh failed, device is not valid');\n this.logger.info('device: attempting to register a new device');\n\n this.clear();\n\n return this.register();\n }\n\n return Promise.reject(reason);\n });\n });\n },\n\n /**\n * Register or refresh a device depending on the current device state. Device\n * registration utilizes the services plugin to send the request to the\n * **WDM** service.\n *\n * @returns {Promise<void, Error>}\n */\n @oneFlight\n @waitForValue('@')\n register() {\n this.logger.info('device: registering');\n\n 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 })\n .catch((error) => {\n this.webex.internal.newMetrics.submitInternalEvent({\n name: 'internal.register.device.response',\n });\n\n throw error;\n })\n .then((response) => {\n // Do not add any processing of response above this as that will affect timestamp\n this.webex.internal.newMetrics.submitInternalEvent({\n name: 'internal.register.device.response',\n });\n\n this.webex.internal.metrics.submitClientMetrics(\n METRICS.JS_SDK_WDM_REGISTRATION_SUCCESSFUL\n );\n\n return this.processRegistrationSuccess(response);\n })\n .catch((error) => {\n this.webex.internal.metrics.submitClientMetrics(METRICS.JS_SDK_WDM_REGISTRATION_FAILED, {\n fields: {error},\n });\n throw error;\n });\n });\n },\n\n /**\n * Unregister the current registered device if available. Unregistering a\n * device utilizes the services plugin to send the request to the **WDM**\n * service.\n *\n * @returns {Promise<void, Error>}\n */\n @oneFlight\n @waitForValue('@')\n unregister() {\n this.logger.info('device: unregistering');\n\n if (!this.registered) {\n this.logger.warn('device: not registered');\n\n return Promise.resolve();\n }\n\n return this.request({\n uri: this.url,\n method: 'DELETE',\n }).then(() => this.clear());\n },\n /* eslint-enable require-jsdoc */\n\n // Helper method members\n\n /**\n * Determine if registration methods can be performed. This method utilizes\n * the `services` plugin to confirm if the appropriate service urls are\n * available for device registration.\n *\n * @returns {Promise<void, Error>}\n */\n canRegister() {\n this.logger.info('device: validating if registration can occur');\n\n // Destructure the services plugin for ease of reference.\n const {services} = this.webex.internal;\n\n // Wait for the postauth catalog to populate.\n return services.waitForCatalog('postauth', this.config.canRegisterWaitDuration).then(() =>\n // Validate that the service exists after waiting for the catalog.\n services.get('wdm')\n ? Promise.resolve()\n : Promise.reject(\n new Error(\n [\n 'device: cannot register,',\n \"'wdm' service is not available from the postauth catalog\",\n ].join(' ')\n )\n )\n );\n },\n\n /**\n * Check if the device can currently reach the inactivity check url.\n *\n * @returns {Promise<void, Error>}\n */\n checkNetworkReachability() {\n this.logger.info('device: checking network reachability');\n\n // Validate if the device has been checked and reset the logout timer.\n if (this.isReachabilityChecked) {\n return Promise.resolve(this.resetLogoutTimer());\n }\n\n this.isReachabilityChecked = true;\n\n // Validate if the device has a intranet checking url.\n if (!this.intranetInactivityCheckUrl) {\n this.isInNetwork = false;\n\n return Promise.resolve(this.resetLogoutTimer());\n }\n\n // Clear unnecessary headers for reachability request.\n const headers = {\n 'cisco-no-http-redirect': null,\n 'spark-user-agent': null,\n trackingid: null,\n };\n\n // Send the network reachability request.\n return this.request({\n headers,\n method: 'GET',\n uri: this.intranetInactivityCheckUrl,\n })\n .then(() => {\n this.isInNetwork = true;\n\n return Promise.resolve(this.resetLogoutTimer());\n })\n .catch(() => {\n this.logger.info('device: did not reach ping endpoint');\n this.logger.info('device: triggering off-network timer');\n\n this.isInNetwork = false;\n\n return Promise.resolve(this.resetLogoutTimer());\n });\n },\n\n /**\n * Clears the registration ttl value if available.\n *\n * @param {Object} options - Values to be cleared.\n * @returns {void}\n */\n clear(...args) {\n this.logger.info('device: clearing registered device');\n\n // Prototype the extended class in order to preserve the parent member.\n Reflect.apply(WebexPlugin.prototype.clear, this, args);\n },\n\n /**\n * Get the current websocket url with the appropriate priority host.\n *\n * @param {boolean} [wait=false] - Willing to wait on a valid url.\n * @returns {Promise<string, Error>} - The priority-mapped web socket url.\n */\n getWebSocketUrl(wait = false) {\n this.logger.info('device: getting the current websocket url');\n\n // Destructure the services plugin for ease of reference.\n const {services} = this.webex.internal;\n\n // Validate if the method should wait for registration.\n if (wait) {\n return this.waitForRegistration()\n .then(() => services.convertUrlToPriorityHostUrl(this.webSocketUrl))\n .catch((error) => {\n this.logger.warn(error.message);\n\n return Promise.reject(new Error('device: failed to get the current websocket url'));\n });\n }\n\n // Validate if the device is registered.\n if (!this.registered) {\n return Promise.reject(\n new Error('device: cannot get websocket url, device is not registered')\n );\n }\n\n // Attempt to collect the priority-host-mapped web socket URL.\n const wsUrl = services.convertUrlToPriorityHostUrl(this.webSocketUrl);\n\n // Validate that the url was collected.\n if (wsUrl) {\n return Promise.resolve(wsUrl);\n }\n\n return Promise.reject(new Error('device: failed to get the current websocket url'));\n },\n\n /**\n * Process a successful device registration.\n *\n * @param {Object} response - response object from registration success.\n * @returns {void}\n */\n processRegistrationSuccess(response) {\n this.logger.info('device: received registration payload');\n\n // Clone the response body for service cleaning.\n const body = {...response.body};\n\n // Clean service data.\n delete body.services;\n delete body.serviceHostMap;\n\n const {etag} = response.headers || {};\n\n if (this.etag && etag && this.etag === etag) {\n // If current etag matches the previous one and we have sent\n // If-None-Match header the developer and entitlement feature\n // toggles will not be returned\n const {features} = body;\n\n delete body.features;\n // When using the etag feature cache, user and entitlement features are still returned\n this.features.user.reset(features.user);\n this.features.entitlement.reset(features.entitlement);\n }\n\n // Assign the recieved DTO from **WDM** to this device.\n this.set(body);\n\n // Assign the new etag to this device.\n this.set({etag});\n\n // Validate if device is ephemeral and setup refresh timer.\n if (this.config.ephemeral) {\n this.logger.info('device: enqueuing device refresh');\n\n const delay = (this.config.ephemeralDeviceTTL / 2 + 60) * 1000;\n\n this.refreshTimer = safeSetTimeout(() => this.refresh(), delay);\n }\n\n // Emit the registration:success event.\n this.trigger(DEVICE_EVENT_REGISTRATION_SUCCESS, this);\n },\n\n /**\n * Reset the current local logout timer for the registered device if\n * registered.\n *\n * @returns {void}\n */\n resetLogoutTimer() {\n this.logger.info('device: resetting logout timer');\n\n // Clear current logout timer.\n clearTimeout(this.logoutTimer);\n\n // Remove last activity date event listener.\n this.off('change:lastUserActivityDate');\n\n // Remove the logout timer.\n this.unset('logoutTimer');\n\n // Validate if the device is currently in a meeting and is configured to\n // required inactivity enforcement.\n if (\n !this.isInMeeting &&\n this.config.enableInactivityEnforcement &&\n this.isReachabilityChecked\n ) {\n if (this.isInNetwork) {\n this.setLogoutTimer(this.inNetworkInactivityDuration);\n } else {\n this.setLogoutTimer(this.intranetInactivityDuration);\n }\n }\n },\n\n /**\n * Set the value of the logout timer for the current registered device.\n *\n * @param {number} duration - Value in seconds of the new logout timer.\n * @returns {void}\n */\n setLogoutTimer(duration) {\n this.logger.info('device: setting logout timer');\n\n if (!duration || duration <= 0) {\n return;\n }\n\n // Setup user activity date event listener.\n this.on('change:lastUserActivityDate', () => {\n this.resetLogoutTimer();\n });\n\n // Initialize a new timer.\n this.logoutTimer = safeSetTimeout(() => {\n this.webex.logout();\n }, duration * 1000);\n },\n\n /**\n * Wait for the device to be registered.\n *\n * @param {number} [timeout=10] - The maximum duration to wait, in seconds.\n * @returns {Promise<void, Error>}\n */\n waitForRegistration(timeout = 10) {\n this.logger.info('device: waiting for registration');\n\n return new Promise((resolve, reject) => {\n if (this.registered) {\n resolve();\n }\n\n const timeoutTimer = safeSetTimeout(\n () => reject(new Error('device: timeout occured while waiting for registration')),\n timeout * 1000\n );\n\n this.once(DEVICE_EVENT_REGISTRATION_SUCCESS, () => {\n clearTimeout(timeoutTimer);\n resolve();\n });\n });\n },\n\n // Deprecated methods.\n\n /**\n * Mark a url as failed and get the next priority host url.\n *\n * @param {string} url - The url to mark as failed.\n * @returns {Promise<string>} - The next priority url.\n */\n @deprecated('device#markUrlFailedAndGetNew(): Use services#markFailedUrl()')\n markUrlFailedAndGetNew(url) {\n return Promise.resolve(this.webex.internal.services.markFailedUrl(url));\n },\n\n // Ampersand method members\n\n /* eslint-disable require-jsdoc */\n /**\n * Initializer method for the device plugin.\n *\n * @override\n * @param {Array<any>} args - An array of items to be mapped as properties.\n * @returns {void}\n */\n @persist('@', decider)\n initialize(...args) {\n // Prototype the extended class in order to preserve the parent member.\n Reflect.apply(WebexPlugin.prototype.initialize, this, args);\n\n // Initialize feature events and listeners.\n FEATURE_COLLECTION_NAMES.forEach((collectionName) => {\n this.features.on(`change:${collectionName}`, (model, value, options) => {\n this.trigger('change', this, options);\n this.trigger('change:features', this, this.features, options);\n });\n });\n\n // Initialize network reachability checking event for url change.\n this.on('change:intranetInactivityCheckUrl', () => {\n this.checkNetworkReachability();\n });\n\n // Initialize network reachability checking event for duration change.\n this.on('change:intranetInactivityDuration', () => {\n this.checkNetworkReachability();\n });\n\n // Initialize network reachability checking event for duration change.\n this.on('change:inNetworkInactivityDuration', () => {\n this.checkNetworkReachability();\n });\n\n // Initialize listener for activity checking.\n this.listenTo(this.webex, 'user-activity', () => {\n this.lastUserActivityDate = Date.now();\n });\n\n // Initialize listener for meeting started event.\n this.listenTo(this.webex, 'meeting started', () => {\n this.isInMeeting = true;\n this.resetLogoutTimer();\n });\n\n // Initialize listener for meeting ended event.\n this.listenTo(this.webex, 'meeting ended', () => {\n this.isInMeeting = false;\n this.resetLogoutTimer();\n });\n },\n /* eslint-enable require-jsdoc */\n});\n\nexport default Device;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,kBAAA,GAAAH,sBAAA,CAAAJ,OAAA;AAAoD,IAAAQ,IAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,IAAA,EARpD;AAAA,SAAAC,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAH,CAAA,OAAAI,6BAAA,QAAAC,CAAA,GAAAD,6BAAA,CAAAJ,CAAA,GAAAC,CAAA,KAAAI,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAL,CAAA,WAAAM,iCAAA,CAAAP,CAAA,EAAAC,C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AE1B;AACJ;AACA;AACA;AACA;IACIC,sBAAsB,EAAE,QAAQ;IAEhC;AACJ;AACA;AACA;AACA;AACA;IACIC,eAAe,EAAE,SAAS;IAE1B;AACJ;AACA;AACA;AACA;IACIC,0BAA0B,EAAE,QAAQ;IAEpC;AACJ;AACA;AACA;AACA;IACIC,sBAAsB,EAAE,QAAQ;IAEhC;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,GAAG,EAAE,QAAQ;IAEb;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,MAAM,EAAE,QAAQ;IAEhB;AACJ;AACA;AACA;AACA;IACIC,mBAAmB,EAAE,QAAQ;IAE7B;AACJ;AACA;AACA;AACA;AACA;IACIC,YAAY,EAAE,QAAQ;IAEtB;AACJ;AACA;AACA;AACA;AACA;IACIC,0BAA0B,EAAE;EAC9B,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEC,OAAO,EAAE;IACP;AACJ;AACA;AACA;AACA;IACIC,UAAU,EAAE;MACVC,IAAI,EAAE,CAAC,KAAK,CAAC;MAEb;AACN;AACA;AACA;AACA;AACA;AACA;MACMC,EAAE,WAAAA,GAAA,EAAG;QACH,OAAO,CAAC,CAAC,IAAI,CAACR,GAAG;MACnB;IACF;EACF,CAAC;EAED;AACF;AACA;AACA;AACA;EACES,OAAO,EAAE;IACP;AACJ;AACA;AACA;AACA;IACIC,WAAW,EAAE,KAAK;IAElB;AACJ;AACA;AACA;AACA;AACA;IACIC,oBAAoB,EAAE,QAAQ;IAE9B;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,qBAAqB,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC;IAEhD;AACJ;AACA;AACA;AACA;AACA;IACIC,WAAW,EAAE,SAAS;IAEtB;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,WAAW,EAAE;EACf,CAAC;EAED;EAEA;AACF;AACA;AACA;AACA;EACEC,cAAc,WAAAA,eAAA,EAAG;IACf,IAAI,CAACC,KA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A,CAAA7K,OAAA,EAAAnB,IAAA,eAAAA,IAAA,OAAA8L,0BAAA,CAAA3K,OAAA,EAAAnB,IAAA,iBA+ET+L,iBAAS,EAAAlM,KAAA,OAAAmM,yBAAA,CAAA7K,OAAA,EAAAnB,IAAA,iBAAAA,IAAA,OAAA8L,0BAAA,CAAA3K,OAAA,EAAAnB,IAAA,6BAAAF,KAAA,OAAAkM,yBAAA,CAAA7K,OAAA,EAAAnB,IAAA,6BAAAA,IAAA,OAAA8L,0BAAA,CAAA3K,OAAA,EAAAnB,IAAA,iBAAAD,KAAA,OAAAiM,yBAAA,CAAA7K,OAAA,EAAAnB,IAAA,iBAAAA,IAAA,IAAAA,IAAA,EAkWX,CAAC;AAAC,IAAAiM,QAAA,GAAAC,OAAA,CAAA/K,OAAA,GAEYO,MAAM"}
|
|
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":";;;;;;;;;;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,kBAAA,GAAAH,sBAAA,CAAAJ,OAAA;AAAoD,IAAAQ,IAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,IAAA,EARpD;AAAA,SAAAC,QAAAC,CAAA,EAAAC,CAAA,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AA,IAAA,EAkWX,CAAC;AAAC,IAAAsM,QAAA,GAAAC,OAAA,CAAApL,OAAA,GAEYO,MAAM"}
|
|
@@ -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.5.0-next.2"
|
|
197
197
|
});
|
|
198
198
|
var _default = exports.default = IpNetworkDetector;
|
|
199
199
|
//# sourceMappingURL=ipNetworkDetector.js.map
|
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.5.0-next.2",
|
|
29
|
+
"@webex/test-helper-mocha": "3.5.0-next.2",
|
|
30
|
+
"@webex/test-helper-mock-webex": "3.5.0-next.2",
|
|
31
|
+
"@webex/test-helper-test-users": "3.5.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.5.0-next.2",
|
|
40
|
+
"@webex/common-timers": "3.5.0-next.2",
|
|
41
|
+
"@webex/http-core": "3.5.0-next.2",
|
|
42
|
+
"@webex/internal-plugin-metrics": "3.5.0-next.2",
|
|
43
|
+
"@webex/webex-core": "3.5.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.5.0-next.2"
|
|
58
58
|
}
|
package/src/config.js
CHANGED
package/src/device.js
CHANGED
|
@@ -306,6 +306,14 @@ const Device = WebexPlugin.extend({
|
|
|
306
306
|
*/
|
|
307
307
|
isReachabilityChecked: ['boolean', false, false],
|
|
308
308
|
|
|
309
|
+
/**
|
|
310
|
+
* This property stores whether or not the next refresh or register request should request energy forecast data
|
|
311
|
+
* in order to prevent over fetching energy forecasts
|
|
312
|
+
*
|
|
313
|
+
* @type {boolean}
|
|
314
|
+
*/
|
|
315
|
+
energyForecastConfig: 'boolean',
|
|
316
|
+
|
|
309
317
|
/**
|
|
310
318
|
* This property stores whether or not the current device is in a meeting
|
|
311
319
|
* to prevent an unneeded timeout of a meeting due to inactivity.
|
|
@@ -344,6 +352,15 @@ const Device = WebexPlugin.extend({
|
|
|
344
352
|
this.webex.trigger('meeting ended');
|
|
345
353
|
},
|
|
346
354
|
|
|
355
|
+
/**
|
|
356
|
+
* Set the value of energy forecast config for the current registered device.
|
|
357
|
+
* @param {boolean} [energyForecastConfig=false] - fetch an energy forecast on the next refresh/register
|
|
358
|
+
* @returns {void}
|
|
359
|
+
*/
|
|
360
|
+
setEnergyForecastConfig(energyForecastConfig = false) {
|
|
361
|
+
this.energyForecastConfig = energyForecastConfig;
|
|
362
|
+
},
|
|
363
|
+
|
|
347
364
|
// Registration method members
|
|
348
365
|
|
|
349
366
|
/* eslint-disable require-jsdoc */
|
|
@@ -395,6 +412,11 @@ const Device = WebexPlugin.extend({
|
|
|
395
412
|
uri: this.url,
|
|
396
413
|
body,
|
|
397
414
|
headers,
|
|
415
|
+
qs: {
|
|
416
|
+
includeUpstreamServices: `all${
|
|
417
|
+
this.config.energyForecast && this.energyForecastConfig ? ',energyforecast' : ''
|
|
418
|
+
}`,
|
|
419
|
+
},
|
|
398
420
|
})
|
|
399
421
|
.then((response) => this.processRegistrationSuccess(response))
|
|
400
422
|
.catch((reason) => {
|
|
@@ -464,6 +486,11 @@ const Device = WebexPlugin.extend({
|
|
|
464
486
|
resource: 'devices',
|
|
465
487
|
body,
|
|
466
488
|
headers,
|
|
489
|
+
qs: {
|
|
490
|
+
includeUpstreamServices: `all${
|
|
491
|
+
this.config.energyForecast && this.energyForecastConfig ? ',energyforecast' : ''
|
|
492
|
+
}`,
|
|
493
|
+
},
|
|
467
494
|
})
|
|
468
495
|
.catch((error) => {
|
|
469
496
|
this.webex.internal.newMetrics.submitInternalEvent({
|
package/test/unit/spec/device.js
CHANGED
|
@@ -176,11 +176,14 @@ describe('plugin-device', () => {
|
|
|
176
176
|
describe('#refresh()', () => {
|
|
177
177
|
let requestSpy;
|
|
178
178
|
|
|
179
|
-
const setup = () => {
|
|
179
|
+
const setup = (config = {}) => {
|
|
180
180
|
sinon.stub(device, 'canRegister').callsFake(() => Promise.resolve());
|
|
181
181
|
sinon.stub(device, 'processRegistrationSuccess').callsFake(() => {});
|
|
182
182
|
requestSpy = sinon.spy(device, 'request');
|
|
183
183
|
device.config.defaults = {};
|
|
184
|
+
Object.keys((config)).forEach((key) => {
|
|
185
|
+
device.config[key] = config[key];
|
|
186
|
+
});
|
|
184
187
|
device.set('registered', true);
|
|
185
188
|
};
|
|
186
189
|
|
|
@@ -207,15 +210,40 @@ describe('plugin-device', () => {
|
|
|
207
210
|
|
|
208
211
|
assert.deepEqual(requestSpy.args[0][0].headers, {});
|
|
209
212
|
});
|
|
213
|
+
|
|
214
|
+
it('uses the energy forecast config to append upstream services to the outgoing call', async () => {
|
|
215
|
+
setup({energyForecast: true});
|
|
216
|
+
device.setEnergyForecastConfig(true);
|
|
217
|
+
|
|
218
|
+
await device.register();
|
|
219
|
+
|
|
220
|
+
assert.calledWith(requestSpy, sinon.match({
|
|
221
|
+
qs: { includeUpstreamServices: 'all,energyforecast' }
|
|
222
|
+
}))
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
it('uses the energy forecast config to not append upstream services to the outgoing call', async () => {
|
|
226
|
+
setup({energyForecast: true});
|
|
227
|
+
device.setEnergyForecastConfig(false);
|
|
228
|
+
|
|
229
|
+
await device.register();
|
|
230
|
+
|
|
231
|
+
assert.calledWith(requestSpy, sinon.match({
|
|
232
|
+
qs: { includeUpstreamServices: 'all' }
|
|
233
|
+
}))
|
|
234
|
+
});
|
|
210
235
|
});
|
|
211
236
|
|
|
212
237
|
describe('#register()', () => {
|
|
213
|
-
const setup = () => {
|
|
238
|
+
const setup = (config = {}) => {
|
|
214
239
|
webex.internal.metrics.submitClientMetrics = sinon.stub();
|
|
215
240
|
|
|
216
241
|
sinon.stub(device, 'processRegistrationSuccess').callsFake(() => {});
|
|
217
242
|
|
|
218
243
|
device.config.defaults = {};
|
|
244
|
+
Object.keys(config).forEach((key) => {
|
|
245
|
+
device.config[key] = config[key];
|
|
246
|
+
});
|
|
219
247
|
device.set('registered', false);
|
|
220
248
|
};
|
|
221
249
|
|
|
@@ -284,6 +312,42 @@ describe('plugin-device', () => {
|
|
|
284
312
|
|
|
285
313
|
});
|
|
286
314
|
|
|
315
|
+
it('uses the energy forecast config to append upstream services to the outgoing call', async () => {
|
|
316
|
+
setup({energyForecast: true});
|
|
317
|
+
sinon.stub(device, 'canRegister').callsFake(() => Promise.resolve());
|
|
318
|
+
const spy = sinon.spy(device, 'request');
|
|
319
|
+
device.setEnergyForecastConfig(true);
|
|
320
|
+
|
|
321
|
+
await device.register();
|
|
322
|
+
|
|
323
|
+
assert.calledWith(spy, {
|
|
324
|
+
method: 'POST',
|
|
325
|
+
service: 'wdm',
|
|
326
|
+
resource: 'devices',
|
|
327
|
+
body: {},
|
|
328
|
+
headers: {},
|
|
329
|
+
qs: { includeUpstreamServices: 'all,energyforecast' }
|
|
330
|
+
} )
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
it('uses the energy forecast config to not append upstream services to the outgoing call', async () => {
|
|
334
|
+
setup({energyForecast: true});
|
|
335
|
+
sinon.stub(device, 'canRegister').callsFake(() => Promise.resolve());
|
|
336
|
+
const spy = sinon.spy(device, 'request');
|
|
337
|
+
device.setEnergyForecastConfig(false);
|
|
338
|
+
|
|
339
|
+
await device.register();
|
|
340
|
+
|
|
341
|
+
assert.calledWith(spy, {
|
|
342
|
+
method: 'POST',
|
|
343
|
+
service: 'wdm',
|
|
344
|
+
resource: 'devices',
|
|
345
|
+
body: {},
|
|
346
|
+
headers: {},
|
|
347
|
+
qs: { includeUpstreamServices: 'all' }
|
|
348
|
+
} )
|
|
349
|
+
});
|
|
350
|
+
|
|
287
351
|
});
|
|
288
352
|
|
|
289
353
|
describe('#processRegistrationSuccess()', () => {
|