@webex/internal-plugin-device 3.0.0-beta.14 → 3.0.0-beta.15
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/README.md +10 -6
- package/dist/config.js.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/device.js +2 -2
- package/dist/device.js.map +1 -1
- package/dist/features/feature-collection.js.map +1 -1
- package/dist/features/feature-model.js.map +1 -1
- package/dist/features/features-model.js.map +1 -1
- package/dist/features/index.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interceptors/device-url.js +2 -2
- package/dist/interceptors/device-url.js.map +1 -1
- package/dist/metrics.js.map +1 -1
- package/package.json +10 -10
- package/src/config.js +8 -9
- package/src/constants.js +3 -5
- package/src/device.js +140 -144
- package/src/features/feature-collection.js +1 -1
- package/src/features/feature-model.js +5 -11
- package/src/features/features-model.js +3 -9
- package/src/features/index.js +1 -5
- package/src/index.js +3 -11
- package/src/interceptors/device-url.js +5 -7
- package/src/metrics.js +1 -2
- package/test/integration/spec/device.js +210 -239
- package/test/integration/spec/webex.js +9 -9
- package/test/unit/spec/device.js +44 -53
- package/test/unit/spec/features/feature-collection.js +2 -2
- package/test/unit/spec/features/feature-model.js +23 -39
- package/test/unit/spec/features/features-model.js +4 -12
- package/test/unit/spec/interceptors/device-url.js +69 -109
- package/test/unit/spec/wdm-dto.json +5 -13
package/README.md
CHANGED
|
@@ -28,28 +28,32 @@ import WebexCore from '@webex/webex-core';
|
|
|
28
28
|
const webex = new WebexCore();
|
|
29
29
|
|
|
30
30
|
// Namespace.
|
|
31
|
-
webex.internal.device
|
|
31
|
+
webex.internal.device;
|
|
32
32
|
|
|
33
33
|
// Register the device.
|
|
34
|
-
webex.internal.device
|
|
34
|
+
webex.internal.device
|
|
35
|
+
.register()
|
|
35
36
|
.then(() => {}) // On successful registration.
|
|
36
37
|
.catch(() => {}); // On failed registration.
|
|
37
38
|
|
|
38
39
|
// Refresh the device.
|
|
39
|
-
webex.internal.device
|
|
40
|
+
webex.internal.device
|
|
41
|
+
.refresh()
|
|
40
42
|
.then(() => {}) // On successful refresh.
|
|
41
43
|
.catch(() => {}); // On failed refresh.
|
|
42
44
|
|
|
43
45
|
// Unregister the device.
|
|
44
|
-
webex.internal.device
|
|
46
|
+
webex.internal.device
|
|
47
|
+
.unregister()
|
|
45
48
|
.then(() => {}) // On successful unregistration.
|
|
46
49
|
.catch(() => {}); // On failed unregistration.
|
|
47
50
|
|
|
48
51
|
// Get the current web socket url. Accepts a boolean to enable waiting for the
|
|
49
52
|
// url to populate.
|
|
50
|
-
webex.internal.device
|
|
53
|
+
webex.internal.device
|
|
54
|
+
.getWebSocketUrl(true)
|
|
51
55
|
.then((url) => {}) // Resolves to the url when it is retrievable.
|
|
52
|
-
.catch(() => {}) // Rejects when the url is not available.
|
|
56
|
+
.catch(() => {}); // Rejects when the url is not available.
|
|
53
57
|
|
|
54
58
|
// Commonly referenced properties.
|
|
55
59
|
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["device","canRegisterWaitDuration","defaults","body","name","process","title","trim","undefined","inBrowser","deviceType","WEB","model","localizedModel","systemName","systemVersion","enableInactivityEnforcement","ephemeral","ephemeralDeviceTTL"],"sources":["config.js"],"sourcesContent":["import {inBrowser, deviceType} from '@webex/common';\n\nexport default {\n device: {\n
|
|
1
|
+
{"version":3,"names":["device","canRegisterWaitDuration","defaults","body","name","process","title","trim","undefined","inBrowser","deviceType","WEB","model","localizedModel","systemName","systemVersion","enableInactivityEnforcement","ephemeral","ephemeralDeviceTTL"],"sources":["config.js"],"sourcesContent":["import {inBrowser, deviceType} from '@webex/common';\n\nexport default {\n device: {\n /**\n * The duration to wait for the catalog to populate in seconds.\n *\n * @type {number}\n */\n canRegisterWaitDuration: 10,\n\n /**\n * The default configuration group when sending registration requests.\n *\n * @type {Object}\n */\n defaults: {\n /**\n * The default body configuration of registration requests.\n *\n * @type {Object}\n */\n body: {\n name:\n (typeof process.title === 'string' ? process.title.trim() : undefined) ||\n (inBrowser && 'browser') ||\n 'javascript',\n deviceType: deviceType.WEB,\n model: 'web-js-sdk',\n localizedModel: 'webex-js-sdk',\n systemName: 'WEBEX_JS_SDK',\n systemVersion: '1.0.0',\n },\n },\n\n /**\n * When true, the **wdm** service will enforce an inactivity duration.\n *\n * @type {boolean}\n */\n enableInactivityEnforcement: false,\n\n /**\n * When true, the device registration will include a ttl value of\n * {@link config.device.ephemeralDeviceTTL} and refresh on an interval of\n * {@link config.device.ephemeralDeviceTTL} / 2 + 60 seconds.\n *\n * @type {boolean}\n */\n ephemeral: false,\n\n /**\n * The ttl value to include in device registration if\n * {@link config.device.ephemeral} is true. Measured in seconds.\n *\n * @type {boolean}\n */\n ephemeralDeviceTTL: 30 * 60,\n },\n};\n"],"mappings":";;;;;;;;;;AAAA;;eAEe;EACbA,MAAM,EAAE;IACN;AACJ;AACA;AACA;AACA;IACIC,uBAAuB,EAAE,EANnB;;IAQN;AACJ;AACA;AACA;AACA;IACIC,QAAQ,EAAE;MACR;AACN;AACA;AACA;AACA;MACMC,IAAI,EAAE;QACJC,IAAI,EACF,CAAC,OAAOC,OAAO,CAACC,KAAf,KAAyB,QAAzB,GAAoCD,OAAO,CAACC,KAAR,CAAcC,IAAd,EAApC,GAA2DC,SAA5D,KACCC,iBAAA,IAAa,SADd,IAEA,YAJE;QAKJC,UAAU,EAAEA,kBAAA,CAAWC,GALnB;QAMJC,KAAK,EAAE,YANH;QAOJC,cAAc,EAAE,cAPZ;QAQJC,UAAU,EAAE,cARR;QASJC,aAAa,EAAE;MATX;IANE,CAbJ;;IAgCN;AACJ;AACA;AACA;AACA;IACIC,2BAA2B,EAAE,KArCvB;;IAuCN;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,SAAS,EAAE,KA9CL;;IAgDN;AACJ;AACA;AACA;AACA;AACA;IACIC,kBAAkB,EAAE,KAAK;EAtDnB;AADK,C"}
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FEATURE_COLLECTION_DEVELOPER","FEATURE_COLLECTION_ENTITLEMENT","FEATURE_COLLECTION_USER","CISCO_DEVICE_URL","FEATURE_COLLECTION_NAMES","FEATURE_TYPES","BOOLEAN","NUMBER","STRING","DEVICE_EVENT_REGISTRATION_SUCCESS","DEVICE_EVENTS"],"sources":["constants.js"],"sourcesContent":["// Feature constants.\nexport const FEATURE_COLLECTION_DEVELOPER = 'developer';\nexport const FEATURE_COLLECTION_ENTITLEMENT = 'entitlement';\nexport const FEATURE_COLLECTION_USER = 'user';\n\nexport const CISCO_DEVICE_URL = 'cisco-device-url';\n\nexport const FEATURE_COLLECTION_NAMES = [\n FEATURE_COLLECTION_DEVELOPER,\n FEATURE_COLLECTION_ENTITLEMENT,\n FEATURE_COLLECTION_USER
|
|
1
|
+
{"version":3,"names":["FEATURE_COLLECTION_DEVELOPER","FEATURE_COLLECTION_ENTITLEMENT","FEATURE_COLLECTION_USER","CISCO_DEVICE_URL","FEATURE_COLLECTION_NAMES","FEATURE_TYPES","BOOLEAN","NUMBER","STRING","DEVICE_EVENT_REGISTRATION_SUCCESS","DEVICE_EVENTS"],"sources":["constants.js"],"sourcesContent":["// Feature constants.\nexport const FEATURE_COLLECTION_DEVELOPER = 'developer';\nexport const FEATURE_COLLECTION_ENTITLEMENT = 'entitlement';\nexport const FEATURE_COLLECTION_USER = 'user';\n\nexport const CISCO_DEVICE_URL = 'cisco-device-url';\n\nexport const FEATURE_COLLECTION_NAMES = [\n FEATURE_COLLECTION_DEVELOPER,\n FEATURE_COLLECTION_ENTITLEMENT,\n FEATURE_COLLECTION_USER,\n];\n\nexport const FEATURE_TYPES = {\n BOOLEAN: 'boolean',\n NUMBER: 'number',\n STRING: 'string',\n};\n\n// Device constants.\nexport const DEVICE_EVENT_REGISTRATION_SUCCESS = 'registration:success';\n\nexport const DEVICE_EVENTS = [DEVICE_EVENT_REGISTRATION_SUCCESS];\n"],"mappings":";;;;;;;;;AAAA;AACO,IAAMA,4BAA4B,GAAG,WAArC;;AACA,IAAMC,8BAA8B,GAAG,aAAvC;;AACA,IAAMC,uBAAuB,GAAG,MAAhC;;AAEA,IAAMC,gBAAgB,GAAG,kBAAzB;;AAEA,IAAMC,wBAAwB,GAAG,CACtCJ,4BADsC,EAEtCC,8BAFsC,EAGtCC,uBAHsC,CAAjC;;AAMA,IAAMG,aAAa,GAAG;EAC3BC,OAAO,EAAE,SADkB;EAE3BC,MAAM,EAAE,QAFmB;EAG3BC,MAAM,EAAE;AAHmB,CAAtB,C,CAMP;;;AACO,IAAMC,iCAAiC,GAAG,sBAA1C;;AAEA,IAAMC,aAAa,GAAG,CAACD,iCAAD,CAAtB"}
|
package/dist/device.js
CHANGED
|
@@ -511,7 +511,7 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
511
511
|
|
|
512
512
|
return services.waitForCatalog('postauth', this.config.canRegisterWaitDuration).then(function () {
|
|
513
513
|
return (// Validate that the service exists after waiting for the catalog.
|
|
514
|
-
services.get('wdm') ? _promise.default.resolve() : _promise.default.reject(new Error(['device: cannot register,', '
|
|
514
|
+
services.get('wdm') ? _promise.default.resolve() : _promise.default.reject(new Error(['device: cannot register,', "'wdm' service is not available from the postauth catalog"].join(' ')))
|
|
515
515
|
);
|
|
516
516
|
});
|
|
517
517
|
},
|
|
@@ -792,7 +792,7 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
792
792
|
}
|
|
793
793
|
/* eslint-enable require-jsdoc */
|
|
794
794
|
,
|
|
795
|
-
version: "3.0.0-beta.
|
|
795
|
+
version: "3.0.0-beta.15"
|
|
796
796
|
}, ((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)));
|
|
797
797
|
|
|
798
798
|
var _default = Device;
|
package/dist/device.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["decider","config","ephemeral","Device","WebexPlugin","extend","waitForValue","deprecated","persist","namespace","extraProperties","idAttribute","children","features","FeaturesModel","props","clientMessagingGiphy","customerCompanyName","customerLogoUrl","deviceType","helpUrl","intranetInactivityDuration","intranetInactivityCheckUrl","inNetworkInactivityDuration","ecmEnabledForAllUsers","ecmSupportedStorageProviders","modificationTime","navigationBarColor","partnerCompanyName","partnerLogoUrl","peopleInsightsEnabled","reportingSiteDesc","reportingSiteUrl","searchEncryptionKeyUrl","showSupportText","supportProviderCompanyName","supportProviderLogoUrl","url","userId","webFileShareControl","webSocketUrl","whiteboardFileShareControl","derived","registered","deps","fn","session","logoutTimer","lastUserActivityDate","isReachabilityChecked","isInMeeting","isInNetwork","meetingStarted","webex","trigger","meetingEnded","refresh","logger","info","canRegister","then","register","body","serialize","mediaCluster","etag","ttl","ephemeralDeviceTTL","headers","defaults","request","method","uri","response","processRegistrationSuccess","catch","reason","statusCode","clear","reject","service","resource","internal","metrics","submitClientMetrics","METRICS","JS_SDK_WDM_REGISTRATION_SUCCESSFUL","error","JS_SDK_WDM_REGISTRATION_FAILED","fields","unregister","warn","resolve","services","waitForCatalog","canRegisterWaitDuration","get","Error","join","checkNetworkReachability","resetLogoutTimer","trackingid","args","prototype","getWebSocketUrl","wait","waitForRegistration","convertUrlToPriorityHostUrl","message","wsUrl","serviceHostMap","user","reset","entitlement","set","delay","refreshTimer","safeSetTimeout","DEVICE_EVENT_REGISTRATION_SUCCESS","clearTimeout","off","unset","enableInactivityEnforcement","setLogoutTimer","duration","on","logout","timeout","timeoutTimer","once","markUrlFailedAndGetNew","markFailedUrl","initialize","FEATURE_COLLECTION_NAMES","forEach","collectionName","model","value","options","listenTo","oneFlight"],"sources":["device.js"],"sourcesContent":["// Internal Dependencies\nimport {deprecated, oneFlight} from '@webex/common';\nimport {persist, waitForValue, WebexPlugin} from '@webex/webex-core';\nimport {safeSetTimeout} from '@webex/common-timers';\n\nimport METRICS from './metrics';\nimport {\n FEATURE_COLLECTION_NAMES,\n DEVICE_EVENT_REGISTRATION_SUCCESS\n} from './constants';\nimport FeaturesModel from './features/features-model';\n\n/**\n * Determine if the plugin should be initialized based on cached storage.\n *\n * @returns {boolean} - If the device is ephemeral.\n */\nfunction decider() {\n return !this.config.ephemeral;\n}\n\nconst Device = WebexPlugin.extend({\n\n // Ampersand property members.\n\n namespace: 'Device',\n\n // Allow for extra properties to prevent the plugin from failing due to\n // **WDM** service DTO changes.\n extraProperties: 'allow',\n\n idAttribute: 'url',\n\n children: {\n /**\n * The class object that contains all of the feature collections.\n *\n * @type {FeaturesModel}\n */\n features: FeaturesModel\n },\n\n /**\n * A collection of device properties mostly assigned by the retrieved DTO from\n * the **WDM** service that are mapped against the ampersand properties.\n *\n * @type {Object}\n */\n props: {\n /**\n * This property determines whether or not giphy support is enabled.\n *\n * @type {'ALLOW' | 'BLOCK'}\n */\n clientMessagingGiphy: 'string',\n\n /**\n * This property should store the company name.\n *\n * @type {string}\n */\n customerCompanyName: 'string',\n\n /**\n * This property should store the logo url.\n *\n * @type {string}\n */\n customerLogoUrl: 'string',\n\n /**\n * This property doesn't have any real values, but is sent during device\n * refresh to prevent the **wdm** service from falling back to an iOS device\n * type.\n *\n * @type {string}\n */\n deviceType: 'string',\n\n /**\n * This property should store the help url.\n *\n * @type {string}\n */\n helpUrl: 'string',\n\n /**\n * This property should store the intranet inactivity timer duration.\n *\n * @type {number}\n */\n intranetInactivityDuration: 'number',\n\n /**\n * This property stores the url required to validate if the device is able\n * to actively reach the intranet network.\n *\n * @type {string}\n */\n intranetInactivityCheckUrl: 'string',\n\n /**\n * This property stores the inactivity timer duration, and could possibly\n * deprecate the `intranetInactivityDuration` property.\n *\n * @type {number}\n */\n inNetworkInactivityDuration: 'number',\n\n /**\n * This property stores the ECM (external content management) enabled value\n * for the whole organization.\n *\n * @type {boolean}\n */\n ecmEnabledForAllUsers: ['boolean', false, false],\n\n /**\n * This property stores an array of ECM (external content management)\n * providers that are currently available.\n *\n * @returns {Array<string>}\n */\n ecmSupportedStorageProviders: ['array', false, (() => [])],\n\n /**\n * This property stores the modification time value retrieved from the\n * **WDM** endpoint formatted as ISO 8601.\n *\n * @type {string}\n */\n modificationTime: 'string',\n\n /**\n * This property stores the navigation bar color.\n *\n * @type {string}\n */\n navigationBarColor: 'string',\n\n /**\n * This property stores the partner company's name when available.\n *\n * @type {string}\n */\n partnerCompanyName: 'string',\n\n /**\n * This property stores the partner company's logo when available.\n *\n * @type {string}\n */\n partnerLogoUrl: 'string',\n\n /**\n * This property stores the availability of people data from the **WDM**\n * service.\n *\n * @type {boolean}\n */\n peopleInsightsEnabled: 'boolean',\n\n /**\n * This property stores the reporting site's description when available.\n *\n * @type {string}\n */\n reportingSiteDesc: 'string',\n\n /**\n * This property stores the reporting site's access url when available.\n *\n * @type {string}\n */\n reportingSiteUrl: 'string',\n\n /**\n * This property stores the encryption key url when available.\n *\n * @type {string}\n */\n searchEncryptionKeyUrl: 'string',\n\n /**\n * This property stores the availability of support-provided text from the\n * **WDM** service.\n *\n * @type {boolean}\n */\n showSupportText: 'boolean',\n\n /**\n * This property stores the support provider's company name when available.\n *\n * @type {string}\n */\n supportProviderCompanyName: 'string',\n\n /**\n * This property stores the support provider's logo url when available.\n *\n * @type {string}\n */\n supportProviderLogoUrl: 'string',\n\n /**\n * This property stores the device's url retrieved from a registration\n * request. This property gets set via the initial registration process by a\n * `this.set()` method.\n *\n * @type {string}\n */\n url: 'string',\n\n /**\n * This property stores the device's userId uuid value, which can also be\n * derived from the device's registerd user's userId retrieved from\n * the **Hydra** service.\n *\n * @type {string}\n */\n userId: 'string',\n\n /**\n * This property stores whether or not file sharing is enabled\n *\n * @type {'BLOCK_BOTH' | 'BLOCK_UPLOAD'}\n */\n webFileShareControl: 'string',\n\n /**\n * This property stores the current web socket url used by the registered\n * device.\n *\n * @type {string}\n */\n webSocketUrl: 'string',\n\n /**\n * This property stores the value indicating whether or not white board file\n * sharing is enabled for the current device.\n *\n * @type {'ALLOW' | 'BLOCK'}\n */\n whiteboardFileShareControl: 'string'\n },\n\n /**\n * A list of derived properties that populate based when their parent data\n * available via the device's properties.\n *\n * @type {Object}\n */\n derived: {\n /**\n * This property determines if the current device is registered.\n *\n * @type {boolean}\n */\n registered: {\n deps: ['url'],\n\n /**\n * Checks if the device is registered by validating that the url exists.\n * Amperstand does not allow this to method to be written as an arrow\n * function.\n *\n * @returns {boolean}\n */\n fn() {\n return !!(this.url);\n }\n }\n },\n\n /**\n * Stores timer data as well as other state details.\n *\n * @type {Object}\n */\n session: {\n /**\n * This property stores the logout timer object\n *\n * @type {any}\n */\n logoutTimer: 'any',\n\n /**\n * This property stores the date for the last activity the user made\n * with the current device.\n *\n * @type {number}\n */\n lastUserActivityDate: 'number',\n\n /**\n * This property stores whether or not the reachability check has been\n * performed to prevent the reachability check from performing its\n * operation more than once after a successful check.\n *\n * @returns {boolean}\n */\n isReachabilityChecked: ['boolean', false, false],\n\n /**\n * This property stores whether or not the current device is in a meeting\n * to prevent an unneeded timeout of a meeting due to inactivity.\n *\n * @type {boolean}\n */\n isInMeeting: 'boolean',\n\n /**\n * This property identifies if the device is currently in network to prevent\n * the `resetLogoutTimer()` method from being called repeatedly once its\n * known client is connected to the organization's internal network.\n *\n * @type {boolean}\n */\n isInNetwork: 'boolean'\n },\n\n // Event method members.\n\n /**\n * Trigger meeting started event for webex instance. Used by web-client team.\n *\n * @returns {void}\n */\n meetingStarted() {\n this.webex.trigger('meeting started');\n },\n\n /**\n * Trigger meeting ended event for webex instance. Used by web-client team.\n *\n * @returns {void}\n */\n meetingEnded() {\n this.webex.trigger('meeting ended');\n },\n\n // Registration method members\n\n /* eslint-disable require-jsdoc */\n /**\n * Refresh the current registered device if able.\n *\n * @returns {Promise<void, Error>}\n */\n @oneFlight\n @waitForValue('@')\n refresh() {\n this.logger.info('device: refreshing');\n\n // Validate that the device can be registered.\n return this.canRegister()\n .then(() => {\n // Validate if the device is not registered and register instead.\n if (!this.registered) {\n this.logger.info('device: device not registered, registering');\n\n return this.register();\n }\n\n // Merge body configurations, overriding defaults.\n const body = {\n ...(this.serialize()),\n ...(this.config.body ? this.config.body : {})\n };\n\n // Remove unneeded properties from the body object.\n delete body.features;\n delete body.mediaCluster;\n delete body.etag;\n\n // Append a ttl value if the device is marked as ephemeral.\n if (this.config.ephemeral) {\n body.ttl = this.config.ephemeralDeviceTTL;\n }\n\n // Merge header configurations, overriding defaults.\n const headers = {\n ...(this.config.defaults.headers ? this.config.defaults.headers : {}),\n ...(this.config.headers ? this.config.headers : {}),\n // If etag is sent, WDM will not send developer feature toggles unless they have changed\n ...(this.etag ? {'If-None-Match': this.etag} : {})\n };\n\n return this.request({\n method: 'PUT',\n uri: this.url,\n body,\n headers\n })\n .then((response) => this.processRegistrationSuccess(response))\n .catch((reason) => {\n // Handle a 404 error, which indicates that the device is no longer\n // valid and needs to be registered as a new device.\n if (reason.statusCode === 404) {\n this.logger.info('device: refresh failed, device is not valid');\n this.logger.info('device: attempting to register a new device');\n\n this.clear();\n\n return this.register();\n }\n\n return Promise.reject(reason);\n });\n });\n },\n\n /**\n * Register or refresh a device depending on the current device state. Device\n * registration utilizes the services plugin to send the request to the\n * **WDM** service.\n *\n * @returns {Promise<void, Error>}\n */\n @oneFlight\n @waitForValue('@')\n register() {\n this.logger.info('device: registering');\n\n // Validate that the device can be registered.\n return this.canRegister()\n .then(() => {\n // Validate if the device is already registered and refresh instead.\n if (this.registered) {\n this.logger.info('device: device already registered, refreshing');\n\n return this.refresh();\n }\n\n // Merge body configurations, overriding defaults.\n const body = {\n ...(this.config.defaults.body ? this.config.defaults.body : {}),\n ...(this.config.body ? this.config.body : {})\n };\n\n // Merge header configurations, overriding defaults.\n const headers = {\n ...(this.config.defaults.headers ? this.config.defaults.headers : {}),\n ...(this.config.headers ? this.config.headers : {})\n };\n\n // Append a ttl value if the device is marked as ephemeral\n if (this.config.ephemeral) {\n body.ttl = this.config.ephemeralDeviceTTL;\n }\n\n // This will be replaced by a `create()` method.\n return this.request({\n method: 'POST',\n service: 'wdm',\n resource: 'devices',\n body,\n headers\n })\n .then((response) => {\n this.webex.internal.metrics.submitClientMetrics(METRICS.JS_SDK_WDM_REGISTRATION_SUCCESSFUL);\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 })\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(\n 'postauth',\n this.config.canRegisterWaitDuration\n )\n .then(() => (\n // Validate that the service exists after waiting for the catalog.\n services.get('wdm') ?\n Promise.resolve() :\n Promise.reject(new Error([\n 'device: cannot register,',\n '\\'wdm\\' service is not available from the postauth catalog'\n ].join(' ')))\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(\n 'device: failed to get the current websocket url'\n ));\n });\n }\n\n // Validate if the device is registered.\n if (!this.registered) {\n return Promise.reject(new Error(\n '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(\n 'device: failed to get the current websocket url'\n ));\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 && 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 (!this.isInMeeting && this.config.enableInactivityEnforcement &&\n this.isReachabilityChecked) {\n if (this.isInNetwork) {\n this.setLogoutTimer(this.inNetworkInactivityDuration);\n }\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', () => { this.resetLogoutTimer(); });\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(() => reject(\n new Error('device: timeout occured while waiting for registration')\n ), timeout * 1000);\n\n this.once(DEVICE_EVENT_REGISTRATION_SUCCESS, () => {\n clearTimeout(timeoutTimer);\n resolve();\n });\n });\n },\n\n // Deprecated methods.\n\n /**\n * Mark a url as failed and get the next priority host url.\n *\n * @param {string} url - The url to mark as failed.\n * @returns {Promise<string>} - The next priority url.\n */\n @deprecated('device#markUrlFailedAndGetNew(): Use services#markFailedUrl()')\n markUrlFailedAndGetNew(url) {\n return Promise.resolve(this.webex.internal.services.markFailedUrl(url));\n },\n\n // Ampersand method members\n\n /* eslint-disable require-jsdoc */\n /**\n * Initializer method for the device plugin.\n *\n * @override\n * @param {Array<any>} args - An array of items to be mapped as properties.\n * @returns {void}\n */\n @persist('@', decider)\n initialize(...args) {\n // Prototype the extended class in order to preserve the parent member.\n Reflect.apply(WebexPlugin.prototype.initialize, this, args);\n\n // Initialize feature events and listeners.\n FEATURE_COLLECTION_NAMES.forEach((collectionName) => {\n this.features.on(`change:${collectionName}`, (model, value, options) => {\n this.trigger('change', this, options);\n this.trigger('change:features', this, this.features, options);\n });\n });\n\n // Initialize network reachability checking event for url change.\n this.on('change:intranetInactivityCheckUrl', () => {\n this.checkNetworkReachability();\n });\n\n // Initialize network reachability checking event for duration change.\n this.on('change:intranetInactivityDuration', () => {\n this.checkNetworkReachability();\n });\n\n // Initialize network reachability checking event for duration change.\n this.on('change:inNetworkInactivityDuration', () => {\n this.checkNetworkReachability();\n });\n\n // Initialize listener for activity checking.\n this.listenTo(this.webex, 'user-activity', () => {\n this.lastUserActivityDate = Date.now();\n });\n\n // Initialize listener for meeting started event.\n this.listenTo(this.webex, 'meeting started', () => {\n this.isInMeeting = true;\n this.resetLogoutTimer();\n });\n\n // Initialize listener for meeting ended event.\n this.listenTo(this.webex, 'meeting ended', () => {\n this.isInMeeting = false;\n this.resetLogoutTimer();\n });\n }\n /* eslint-enable require-jsdoc */\n});\n\nexport default Device;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAIA;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAT,GAAmB;EACjB,OAAO,CAAC,KAAKC,MAAL,CAAYC,SAApB;AACD;;AAED,IAAMC,MAAM,GAAGC,sBAAA,CAAYC,MAAZ,SA2UZ,IAAAC,uBAAA,EAAa,GAAb,CA3UY,UAiZZ,IAAAA,uBAAA,EAAa,GAAb,CAjZY,UA8cZ,IAAAA,uBAAA,EAAa,GAAb,CA9cY,UAkvBZ,IAAAC,kBAAA,EAAW,+DAAX,CAlvBY,UAiwBZ,IAAAC,kBAAA,EAAQ,GAAR,EAAaR,OAAb,CAjwBY,UAAmB;EAEhC;EAEAS,SAAS,EAAE,QAJqB;EAMhC;EACA;EACAC,eAAe,EAAE,OARe;EAUhCC,WAAW,EAAE,KAVmB;EAYhCC,QAAQ,EAAE;IAC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IC,sBAAsB,EAAE,QArInB;;IAuIL;AACJ;AACA;AACA;AACA;AACA;IACIC,eAAe,EAAE,SA7IZ;;IA+IL;AACJ;AACA;AACA;AACA;IACIC,0BAA0B,EAAE,QApJvB;;IAsJL;AACJ;AACA;AACA;AACA;IACIC,sBAAsB,EAAE,QA3JnB;;IA6JL;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,GAAG,EAAE,QApKA;;IAsKL;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,MAAM,EAAE,QA7KH;;IA+KL;AACJ;AACA;AACA;AACA;IACIC,mBAAmB,EAAE,QApLhB;;IAsLL;AACJ;AACA;AACA;AACA;AACA;IACIC,YAAY,EAAE,QA5LT;;IA8LL;AACJ;AACA;AACA;AACA;AACA;IACIC,0BAA0B,EAAE;EApMvB,CA3ByB;;EAkOhC;AACF;AACA;AACA;AACA;AACA;EACEC,OAAO,EAAE;IACP;AACJ;AACA;AACA;AACA;IACIC,UAAU,EAAE;MACVC,IAAI,EAAE,CAAC,KAAD,CADI;;MAGV;AACN;AACA;AACA;AACA;AACA;AACA;MACMC,EAVU,gBAUL;QACH,OAAO,CAAC,CAAE,KAAKR,GAAf;MACD;IAZS;EANL,CAxOuB;;EA8PhC;AACF;AACA;AACA;AACA;EACES,OAAO,EAAE;IACP;AACJ;AACA;AACA;AACA;IACIC,WAAW,EAAE,KANN;;IAQP;AACJ;AACA;AACA;AACA;AACA;IACIC,oBAAoB,EAAE,QAdf;;IAgBP;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,qBAAqB,EAAE,CAAC,SAAD,EAAY,KAAZ,EAAmB,KAAnB,CAvBhB;;IAyBP;AACJ;AACA;AACA;AACA;AACA;IACIC,WAAW,EAAE,SA/BN;;IAiCP;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,WAAW,EAAE;EAxCN,CAnQuB;EA8ShC;;EAEA;AACF;AACA;AACA;AACA;EACEC,cArTgC,4BAqTf;IACf,KAAKC,KAAL,CAAWC,OAA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AAL,GAAmB,KAAnB;;MACA,MAAI,CAACkD,gBAAL;IACD,CAHD;EAID;EACD;EA9yBgC;EAAA;AAAA,CAAnB,6DA0UZwC,iBA1UY,oIAgZZA,iBAhZY,wIA6cZA,iBA7cY,6XAAf;;eAizBezI,M"}
|
|
1
|
+
{"version":3,"names":["decider","config","ephemeral","Device","WebexPlugin","extend","waitForValue","deprecated","persist","namespace","extraProperties","idAttribute","children","features","FeaturesModel","props","clientMessagingGiphy","customerCompanyName","customerLogoUrl","deviceType","helpUrl","intranetInactivityDuration","intranetInactivityCheckUrl","inNetworkInactivityDuration","ecmEnabledForAllUsers","ecmSupportedStorageProviders","modificationTime","navigationBarColor","partnerCompanyName","partnerLogoUrl","peopleInsightsEnabled","reportingSiteDesc","reportingSiteUrl","searchEncryptionKeyUrl","showSupportText","supportProviderCompanyName","supportProviderLogoUrl","url","userId","webFileShareControl","webSocketUrl","whiteboardFileShareControl","derived","registered","deps","fn","session","logoutTimer","lastUserActivityDate","isReachabilityChecked","isInMeeting","isInNetwork","meetingStarted","webex","trigger","meetingEnded","refresh","logger","info","canRegister","then","register","body","serialize","mediaCluster","etag","ttl","ephemeralDeviceTTL","headers","defaults","request","method","uri","response","processRegistrationSuccess","catch","reason","statusCode","clear","reject","service","resource","internal","metrics","submitClientMetrics","METRICS","JS_SDK_WDM_REGISTRATION_SUCCESSFUL","error","JS_SDK_WDM_REGISTRATION_FAILED","fields","unregister","warn","resolve","services","waitForCatalog","canRegisterWaitDuration","get","Error","join","checkNetworkReachability","resetLogoutTimer","trackingid","args","prototype","getWebSocketUrl","wait","waitForRegistration","convertUrlToPriorityHostUrl","message","wsUrl","serviceHostMap","user","reset","entitlement","set","delay","refreshTimer","safeSetTimeout","DEVICE_EVENT_REGISTRATION_SUCCESS","clearTimeout","off","unset","enableInactivityEnforcement","setLogoutTimer","duration","on","logout","timeout","timeoutTimer","once","markUrlFailedAndGetNew","markFailedUrl","initialize","FEATURE_COLLECTION_NAMES","forEach","collectionName","model","value","options","listenTo","oneFlight"],"sources":["device.js"],"sourcesContent":["// Internal Dependencies\nimport {deprecated, oneFlight} from '@webex/common';\nimport {persist, waitForValue, WebexPlugin} from '@webex/webex-core';\nimport {safeSetTimeout} from '@webex/common-timers';\n\nimport METRICS from './metrics';\nimport {FEATURE_COLLECTION_NAMES, DEVICE_EVENT_REGISTRATION_SUCCESS} from './constants';\nimport FeaturesModel from './features/features-model';\n\n/**\n * Determine if the plugin should be initialized based on cached storage.\n *\n * @returns {boolean} - If the device is ephemeral.\n */\nfunction decider() {\n return !this.config.ephemeral;\n}\n\nconst Device = WebexPlugin.extend({\n // Ampersand property members.\n\n namespace: 'Device',\n\n // Allow for extra properties to prevent the plugin from failing due to\n // **WDM** service DTO changes.\n extraProperties: 'allow',\n\n idAttribute: 'url',\n\n children: {\n /**\n * The class object that contains all of the feature collections.\n *\n * @type {FeaturesModel}\n */\n features: FeaturesModel,\n },\n\n /**\n * A collection of device properties mostly assigned by the retrieved DTO from\n * the **WDM** service that are mapped against the ampersand properties.\n *\n * @type {Object}\n */\n props: {\n /**\n * This property determines whether or not giphy support is enabled.\n *\n * @type {'ALLOW' | 'BLOCK'}\n */\n clientMessagingGiphy: 'string',\n\n /**\n * This property should store the company name.\n *\n * @type {string}\n */\n customerCompanyName: 'string',\n\n /**\n * This property should store the logo url.\n *\n * @type {string}\n */\n customerLogoUrl: 'string',\n\n /**\n * This property doesn't have any real values, but is sent during device\n * refresh to prevent the **wdm** service from falling back to an iOS device\n * type.\n *\n * @type {string}\n */\n deviceType: 'string',\n\n /**\n * This property should store the help url.\n *\n * @type {string}\n */\n helpUrl: 'string',\n\n /**\n * This property should store the intranet inactivity timer duration.\n *\n * @type {number}\n */\n intranetInactivityDuration: 'number',\n\n /**\n * This property stores the url required to validate if the device is able\n * to actively reach the intranet network.\n *\n * @type {string}\n */\n intranetInactivityCheckUrl: 'string',\n\n /**\n * This property stores the inactivity timer duration, and could possibly\n * deprecate the `intranetInactivityDuration` property.\n *\n * @type {number}\n */\n inNetworkInactivityDuration: 'number',\n\n /**\n * This property stores the ECM (external content management) enabled value\n * for the whole organization.\n *\n * @type {boolean}\n */\n ecmEnabledForAllUsers: ['boolean', false, false],\n\n /**\n * This property stores an array of ECM (external content management)\n * providers that are currently available.\n *\n * @returns {Array<string>}\n */\n ecmSupportedStorageProviders: ['array', false, () => []],\n\n /**\n * This property stores the modification time value retrieved from the\n * **WDM** endpoint formatted as ISO 8601.\n *\n * @type {string}\n */\n modificationTime: 'string',\n\n /**\n * This property stores the navigation bar color.\n *\n * @type {string}\n */\n navigationBarColor: 'string',\n\n /**\n * This property stores the partner company's name when available.\n *\n * @type {string}\n */\n partnerCompanyName: 'string',\n\n /**\n * This property stores the partner company's logo when available.\n *\n * @type {string}\n */\n partnerLogoUrl: 'string',\n\n /**\n * This property stores the availability of people data from the **WDM**\n * service.\n *\n * @type {boolean}\n */\n peopleInsightsEnabled: 'boolean',\n\n /**\n * This property stores the reporting site's description when available.\n *\n * @type {string}\n */\n reportingSiteDesc: 'string',\n\n /**\n * This property stores the reporting site's access url when available.\n *\n * @type {string}\n */\n reportingSiteUrl: 'string',\n\n /**\n * This property stores the encryption key url when available.\n *\n * @type {string}\n */\n searchEncryptionKeyUrl: 'string',\n\n /**\n * This property stores the availability of support-provided text from the\n * **WDM** service.\n *\n * @type {boolean}\n */\n showSupportText: 'boolean',\n\n /**\n * This property stores the support provider's company name when available.\n *\n * @type {string}\n */\n supportProviderCompanyName: 'string',\n\n /**\n * This property stores the support provider's logo url when available.\n *\n * @type {string}\n */\n supportProviderLogoUrl: 'string',\n\n /**\n * This property stores the device's url retrieved from a registration\n * request. This property gets set via the initial registration process by a\n * `this.set()` method.\n *\n * @type {string}\n */\n url: 'string',\n\n /**\n * This property stores the device's userId uuid value, which can also be\n * derived from the device's registerd user's userId retrieved from\n * the **Hydra** service.\n *\n * @type {string}\n */\n userId: 'string',\n\n /**\n * This property stores whether or not file sharing is enabled\n *\n * @type {'BLOCK_BOTH' | 'BLOCK_UPLOAD'}\n */\n webFileShareControl: 'string',\n\n /**\n * This property stores the current web socket url used by the registered\n * device.\n *\n * @type {string}\n */\n webSocketUrl: 'string',\n\n /**\n * This property stores the value indicating whether or not white board file\n * sharing is enabled for the current device.\n *\n * @type {'ALLOW' | 'BLOCK'}\n */\n whiteboardFileShareControl: 'string',\n },\n\n /**\n * A list of derived properties that populate based when their parent data\n * available via the device's properties.\n *\n * @type {Object}\n */\n derived: {\n /**\n * This property determines if the current device is registered.\n *\n * @type {boolean}\n */\n registered: {\n deps: ['url'],\n\n /**\n * Checks if the device is registered by validating that the url exists.\n * Amperstand does not allow this to method to be written as an arrow\n * function.\n *\n * @returns {boolean}\n */\n fn() {\n return !!this.url;\n },\n },\n },\n\n /**\n * Stores timer data as well as other state details.\n *\n * @type {Object}\n */\n session: {\n /**\n * This property stores the logout timer object\n *\n * @type {any}\n */\n logoutTimer: 'any',\n\n /**\n * This property stores the date for the last activity the user made\n * with the current device.\n *\n * @type {number}\n */\n lastUserActivityDate: 'number',\n\n /**\n * This property stores whether or not the reachability check has been\n * performed to prevent the reachability check from performing its\n * operation more than once after a successful check.\n *\n * @returns {boolean}\n */\n isReachabilityChecked: ['boolean', false, false],\n\n /**\n * This property stores whether or not the current device is in a meeting\n * to prevent an unneeded timeout of a meeting due to inactivity.\n *\n * @type {boolean}\n */\n isInMeeting: 'boolean',\n\n /**\n * This property identifies if the device is currently in network to prevent\n * the `resetLogoutTimer()` method from being called repeatedly once its\n * known client is connected to the organization's internal network.\n *\n * @type {boolean}\n */\n isInNetwork: 'boolean',\n },\n\n // Event method members.\n\n /**\n * Trigger meeting started event for webex instance. Used by web-client team.\n *\n * @returns {void}\n */\n meetingStarted() {\n this.webex.trigger('meeting started');\n },\n\n /**\n * Trigger meeting ended event for webex instance. Used by web-client team.\n *\n * @returns {void}\n */\n meetingEnded() {\n this.webex.trigger('meeting ended');\n },\n\n // Registration method members\n\n /* eslint-disable require-jsdoc */\n /**\n * Refresh the current registered device if able.\n *\n * @returns {Promise<void, Error>}\n */\n @oneFlight\n @waitForValue('@')\n refresh() {\n this.logger.info('device: refreshing');\n\n // Validate that the device can be registered.\n return this.canRegister().then(() => {\n // Validate if the device is not registered and register instead.\n if (!this.registered) {\n this.logger.info('device: device not registered, registering');\n\n return this.register();\n }\n\n // Merge body configurations, overriding defaults.\n const body = {\n ...this.serialize(),\n ...(this.config.body ? this.config.body : {}),\n };\n\n // Remove unneeded properties from the body object.\n delete body.features;\n delete body.mediaCluster;\n delete body.etag;\n\n // Append a ttl value if the device is marked as ephemeral.\n if (this.config.ephemeral) {\n body.ttl = this.config.ephemeralDeviceTTL;\n }\n\n // Merge header configurations, overriding defaults.\n const headers = {\n ...(this.config.defaults.headers ? this.config.defaults.headers : {}),\n ...(this.config.headers ? this.config.headers : {}),\n // If etag is sent, WDM will not send developer feature toggles unless they have changed\n ...(this.etag ? {'If-None-Match': this.etag} : {}),\n };\n\n return this.request({\n method: 'PUT',\n uri: this.url,\n body,\n headers,\n })\n .then((response) => this.processRegistrationSuccess(response))\n .catch((reason) => {\n // Handle a 404 error, which indicates that the device is no longer\n // valid and needs to be registered as a new device.\n if (reason.statusCode === 404) {\n this.logger.info('device: refresh failed, device is not valid');\n this.logger.info('device: attempting to register a new device');\n\n this.clear();\n\n return this.register();\n }\n\n return Promise.reject(reason);\n });\n });\n },\n\n /**\n * Register or refresh a device depending on the current device state. Device\n * registration utilizes the services plugin to send the request to the\n * **WDM** service.\n *\n * @returns {Promise<void, Error>}\n */\n @oneFlight\n @waitForValue('@')\n register() {\n this.logger.info('device: registering');\n\n // Validate that the device can be registered.\n return this.canRegister().then(() => {\n // Validate if the device is already registered and refresh instead.\n if (this.registered) {\n this.logger.info('device: device already registered, refreshing');\n\n return this.refresh();\n }\n\n // Merge body configurations, overriding defaults.\n const body = {\n ...(this.config.defaults.body ? this.config.defaults.body : {}),\n ...(this.config.body ? this.config.body : {}),\n };\n\n // Merge header configurations, overriding defaults.\n const headers = {\n ...(this.config.defaults.headers ? this.config.defaults.headers : {}),\n ...(this.config.headers ? this.config.headers : {}),\n };\n\n // Append a ttl value if the device is marked as ephemeral\n if (this.config.ephemeral) {\n body.ttl = this.config.ephemeralDeviceTTL;\n }\n\n // This will be replaced by a `create()` method.\n return this.request({\n method: 'POST',\n service: 'wdm',\n resource: 'devices',\n body,\n headers,\n })\n .then((response) => {\n this.webex.internal.metrics.submitClientMetrics(\n METRICS.JS_SDK_WDM_REGISTRATION_SUCCESSFUL\n );\n\n return this.processRegistrationSuccess(response);\n })\n .catch((error) => {\n this.webex.internal.metrics.submitClientMetrics(METRICS.JS_SDK_WDM_REGISTRATION_FAILED, {\n fields: {error},\n });\n throw error;\n });\n });\n },\n\n /**\n * Unregister the current registered device if available. Unregistering a\n * device utilizes the services plugin to send the request to the **WDM**\n * service.\n *\n * @returns {Promise<void, Error>}\n */\n @oneFlight\n @waitForValue('@')\n unregister() {\n this.logger.info('device: unregistering');\n\n if (!this.registered) {\n this.logger.warn('device: not registered');\n\n return Promise.resolve();\n }\n\n return this.request({\n uri: this.url,\n method: 'DELETE',\n }).then(() => this.clear());\n },\n /* eslint-enable require-jsdoc */\n\n // Helper method members\n\n /**\n * Determine if registration methods can be performed. This method utilizes\n * the `services` plugin to confirm if the appropriate service urls are\n * available for device registration.\n *\n * @returns {Promise<void, Error>}\n */\n canRegister() {\n this.logger.info('device: validating if registration can occur');\n\n // Destructure the services plugin for ease of reference.\n const {services} = this.webex.internal;\n\n // Wait for the postauth catalog to populate.\n return services.waitForCatalog('postauth', this.config.canRegisterWaitDuration).then(() =>\n // Validate that the service exists after waiting for the catalog.\n services.get('wdm')\n ? Promise.resolve()\n : Promise.reject(\n new Error(\n [\n 'device: cannot register,',\n \"'wdm' service is not available from the postauth catalog\",\n ].join(' ')\n )\n )\n );\n },\n\n /**\n * Check if the device can currently reach the inactivity check url.\n *\n * @returns {Promise<void, Error>}\n */\n checkNetworkReachability() {\n this.logger.info('device: checking network reachability');\n\n // Validate if the device has been checked and reset the logout timer.\n if (this.isReachabilityChecked) {\n return Promise.resolve(this.resetLogoutTimer());\n }\n\n this.isReachabilityChecked = true;\n\n // Validate if the device has a intranet checking url.\n if (!this.intranetInactivityCheckUrl) {\n this.isInNetwork = false;\n\n return Promise.resolve(this.resetLogoutTimer());\n }\n\n // Clear unnecessary headers for reachability request.\n const headers = {\n 'cisco-no-http-redirect': null,\n 'spark-user-agent': null,\n trackingid: null,\n };\n\n // Send the network reachability request.\n return this.request({\n headers,\n method: 'GET',\n uri: this.intranetInactivityCheckUrl,\n })\n .then(() => {\n this.isInNetwork = true;\n\n return Promise.resolve(this.resetLogoutTimer());\n })\n .catch(() => {\n this.logger.info('device: did not reach ping endpoint');\n this.logger.info('device: triggering off-network timer');\n\n this.isInNetwork = false;\n\n return Promise.resolve(this.resetLogoutTimer());\n });\n },\n\n /**\n * Clears the registration ttl value if available.\n *\n * @param {Object} options - Values to be cleared.\n * @returns {void}\n */\n clear(...args) {\n this.logger.info('device: clearing registered device');\n\n // Prototype the extended class in order to preserve the parent member.\n Reflect.apply(WebexPlugin.prototype.clear, this, args);\n },\n\n /**\n * Get the current websocket url with the appropriate priority host.\n *\n * @param {boolean} [wait=false] - Willing to wait on a valid url.\n * @returns {Promise<string, Error>} - The priority-mapped web socket url.\n */\n getWebSocketUrl(wait = false) {\n this.logger.info('device: getting the current websocket url');\n\n // Destructure the services plugin for ease of reference.\n const {services} = this.webex.internal;\n\n // Validate if the method should wait for registration.\n if (wait) {\n return this.waitForRegistration()\n .then(() => services.convertUrlToPriorityHostUrl(this.webSocketUrl))\n .catch((error) => {\n this.logger.warn(error.message);\n\n return Promise.reject(new Error('device: failed to get the current websocket url'));\n });\n }\n\n // Validate if the device is registered.\n if (!this.registered) {\n return Promise.reject(\n new Error('device: cannot get websocket url, device is not registered')\n );\n }\n\n // Attempt to collect the priority-host-mapped web socket URL.\n const wsUrl = services.convertUrlToPriorityHostUrl(this.webSocketUrl);\n\n // Validate that the url was collected.\n if (wsUrl) {\n return Promise.resolve(wsUrl);\n }\n\n return Promise.reject(new Error('device: failed to get the current websocket url'));\n },\n\n /**\n * Process a successful device registration.\n *\n * @param {Object} response - response object from registration success.\n * @returns {void}\n */\n processRegistrationSuccess(response) {\n this.logger.info('device: received registration payload');\n\n // Clone the response body for service cleaning.\n const body = {...response.body};\n\n // Clean service data.\n delete body.services;\n delete body.serviceHostMap;\n\n const {etag} = response.headers;\n\n if (this.etag && this.etag === etag) {\n // If current etag matches the previous one and we have sent\n // If-None-Match header the developer and entitlement feature\n // toggles will not be returned\n const {features} = body;\n\n delete body.features;\n // When using the etag feature cache, user and entitlement features are still returned\n this.features.user.reset(features.user);\n this.features.entitlement.reset(features.entitlement);\n }\n\n // Assign the recieved DTO from **WDM** to this device.\n this.set(body);\n\n // Assign the new etag to this device.\n this.set({etag});\n\n // Validate if device is ephemeral and setup refresh timer.\n if (this.config.ephemeral) {\n this.logger.info('device: enqueuing device refresh');\n\n const delay = (this.config.ephemeralDeviceTTL / 2 + 60) * 1000;\n\n this.refreshTimer = safeSetTimeout(() => this.refresh(), delay);\n }\n\n // Emit the registration:success event.\n this.trigger(DEVICE_EVENT_REGISTRATION_SUCCESS, this);\n },\n\n /**\n * Reset the current local logout timer for the registered device if\n * registered.\n *\n * @returns {void}\n */\n resetLogoutTimer() {\n this.logger.info('device: resetting logout timer');\n\n // Clear current logout timer.\n clearTimeout(this.logoutTimer);\n\n // Remove last activity date event listener.\n this.off('change:lastUserActivityDate');\n\n // Remove the logout timer.\n this.unset('logoutTimer');\n\n // Validate if the device is currently in a meeting and is configured to\n // required inactivity enforcement.\n if (\n !this.isInMeeting &&\n this.config.enableInactivityEnforcement &&\n this.isReachabilityChecked\n ) {\n if (this.isInNetwork) {\n this.setLogoutTimer(this.inNetworkInactivityDuration);\n } else {\n this.setLogoutTimer(this.intranetInactivityDuration);\n }\n }\n },\n\n /**\n * Set the value of the logout timer for the current registered device.\n *\n * @param {number} duration - Value in seconds of the new logout timer.\n * @returns {void}\n */\n setLogoutTimer(duration) {\n this.logger.info('device: setting logout timer');\n\n if (!duration || duration <= 0) {\n return;\n }\n\n // Setup user activity date event listener.\n this.on('change:lastUserActivityDate', () => {\n this.resetLogoutTimer();\n });\n\n // Initialize a new timer.\n this.logoutTimer = safeSetTimeout(() => {\n this.webex.logout();\n }, duration * 1000);\n },\n\n /**\n * Wait for the device to be registered.\n *\n * @param {number} [timeout=10] - The maximum duration to wait, in seconds.\n * @returns {Promise<void, Error>}\n */\n waitForRegistration(timeout = 10) {\n this.logger.info('device: waiting for registration');\n\n return new Promise((resolve, reject) => {\n if (this.registered) {\n resolve();\n }\n\n const timeoutTimer = safeSetTimeout(\n () => reject(new Error('device: timeout occured while waiting for registration')),\n timeout * 1000\n );\n\n this.once(DEVICE_EVENT_REGISTRATION_SUCCESS, () => {\n clearTimeout(timeoutTimer);\n resolve();\n });\n });\n },\n\n // Deprecated methods.\n\n /**\n * Mark a url as failed and get the next priority host url.\n *\n * @param {string} url - The url to mark as failed.\n * @returns {Promise<string>} - The next priority url.\n */\n @deprecated('device#markUrlFailedAndGetNew(): Use services#markFailedUrl()')\n markUrlFailedAndGetNew(url) {\n return Promise.resolve(this.webex.internal.services.markFailedUrl(url));\n },\n\n // Ampersand method members\n\n /* eslint-disable require-jsdoc */\n /**\n * Initializer method for the device plugin.\n *\n * @override\n * @param {Array<any>} args - An array of items to be mapped as properties.\n * @returns {void}\n */\n @persist('@', decider)\n initialize(...args) {\n // Prototype the extended class in order to preserve the parent member.\n Reflect.apply(WebexPlugin.prototype.initialize, this, args);\n\n // Initialize feature events and listeners.\n FEATURE_COLLECTION_NAMES.forEach((collectionName) => {\n this.features.on(`change:${collectionName}`, (model, value, options) => {\n this.trigger('change', this, options);\n this.trigger('change:features', this, this.features, options);\n });\n });\n\n // Initialize network reachability checking event for url change.\n this.on('change:intranetInactivityCheckUrl', () => {\n this.checkNetworkReachability();\n });\n\n // Initialize network reachability checking event for duration change.\n this.on('change:intranetInactivityDuration', () => {\n this.checkNetworkReachability();\n });\n\n // Initialize network reachability checking event for duration change.\n this.on('change:inNetworkInactivityDuration', () => {\n this.checkNetworkReachability();\n });\n\n // Initialize listener for activity checking.\n this.listenTo(this.webex, 'user-activity', () => {\n this.lastUserActivityDate = Date.now();\n });\n\n // Initialize listener for meeting started event.\n this.listenTo(this.webex, 'meeting started', () => {\n this.isInMeeting = true;\n this.resetLogoutTimer();\n });\n\n // Initialize listener for meeting ended event.\n this.listenTo(this.webex, 'meeting ended', () => {\n this.isInMeeting = false;\n this.resetLogoutTimer();\n });\n },\n /* eslint-enable require-jsdoc */\n});\n\nexport default Device;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAT,GAAmB;EACjB,OAAO,CAAC,KAAKC,MAAL,CAAYC,SAApB;AACD;;AAED,IAAMC,MAAM,GAAGC,sBAAA,CAAYC,MAAZ,SA0UZ,IAAAC,uBAAA,EAAa,GAAb,CA1UY,UA+YZ,IAAAA,uBAAA,EAAa,GAAb,CA/YY,UA6cZ,IAAAA,uBAAA,EAAa,GAAb,CA7cY,UAivBZ,IAAAC,kBAAA,EAAW,+DAAX,CAjvBY,UAgwBZ,IAAAC,kBAAA,EAAQ,GAAR,EAAaR,OAAb,CAhwBY,UAAmB;EAChC;EAEAS,SAAS,EAAE,QAHqB;EAKhC;EACA;EACAC,eAAe,EAAE,OAPe;EAShCC,WAAW,EAAE,KATmB;EAWhCC,QAAQ,EAAE;IACR;AACJ;AACA;AACA;AACA;IACIC,QAAQ,EAAEC;EANF,CAXsB;;EAoBhC;AACF;AACA;AACA;AACA;AACA;EACEC,KAAK,EAAE;IACL;AACJ;AACA;AACA;AACA;IACIC,oBAAoB,EAAE,QANjB;;IAQL;AACJ;AACA;AACA;AACA;IACIC,mBAAmB,EAAE,QAbhB;;IAeL;AACJ;AACA;AACA;AACA;IACIC,eAAe,EA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","extend","mainIndex","model","FeatureModel"],"sources":["feature-collection.js"],"sourcesContent":["// External dependencies.\nimport AmpCollection from 'ampersand-collection';\n\n// Local Dependencies\nimport FeatureModel from './feature-model';\n\n/**\n * Feature collection model.\n *\n * @description\n * This model contains a collection of features under a specific collection\n * group.\n */\nconst FeatureCollection = AmpCollection.extend({\n /**\n * The unique identifier for the models in this collection.\n *\n * @type {string}\n */\n mainIndex: 'key',\n\n /**\n * The type of model this collection can contain.\n *\n * @type {Class}\n */\n model: FeatureModel
|
|
1
|
+
{"version":3,"names":["FeatureCollection","AmpCollection","extend","mainIndex","model","FeatureModel"],"sources":["feature-collection.js"],"sourcesContent":["// External dependencies.\nimport AmpCollection from 'ampersand-collection';\n\n// Local Dependencies\nimport FeatureModel from './feature-model';\n\n/**\n * Feature collection model.\n *\n * @description\n * This model contains a collection of features under a specific collection\n * group.\n */\nconst FeatureCollection = AmpCollection.extend({\n /**\n * The unique identifier for the models in this collection.\n *\n * @type {string}\n */\n mainIndex: 'key',\n\n /**\n * The type of model this collection can contain.\n *\n * @type {Class}\n */\n model: FeatureModel,\n});\n\nexport default FeatureCollection;\n"],"mappings":";;;;;;;;;;;;AACA;;AAGA;;AAJA;AAGA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,iBAAiB,GAAGC,4BAAA,CAAcC,MAAd,CAAqB;EAC7C;AACF;AACA;AACA;AACA;EACEC,SAAS,EAAE,KANkC;;EAQ7C;AACF;AACA;AACA;AACA;EACEC,KAAK,EAAEC;AAbsC,CAArB,CAA1B;;eAgBeL,iB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FeatureModel","AmpState","extend","idAttribute","props","key","lastModified","mutable","type","val","value","constructor","attrs","options","parse","prototype","model","parsedModel","Number","FEATURE_TYPES","NUMBER","toLowerCase","BOOLEAN","STRING","serialize","args","Date","toISOString","set","optns"],"sources":["feature-model.js"],"sourcesContent":["// External dependencies.\nimport AmpState from 'ampersand-state';\nimport {defaults, isObject} from 'lodash';\n\nimport {FEATURE_TYPES} from '../constants';\n\n/**\n * The model returned from the {@link FeatureModel#parse} method.\n *\n * @typedef {Object} ParsedFeatureModel\n * @property {boolean|number|string} ParsedFeatureModel.value - The parsed val.\n * @property {string} ParsedFeatureModel.type - The type of the parsed val.\n */\n\n/**\n * Feature model.\n *\n * @description\n * This model contains details on a single feature and is received from the\n * **WDM** service upon registration.\n */\nconst FeatureModel = AmpState.extend({\n
|
|
1
|
+
{"version":3,"names":["FeatureModel","AmpState","extend","idAttribute","props","key","lastModified","mutable","type","val","value","constructor","attrs","options","parse","prototype","model","parsedModel","Number","FEATURE_TYPES","NUMBER","toLowerCase","BOOLEAN","STRING","serialize","args","Date","toISOString","set","optns"],"sources":["feature-model.js"],"sourcesContent":["// External dependencies.\nimport AmpState from 'ampersand-state';\nimport {defaults, isObject} from 'lodash';\n\nimport {FEATURE_TYPES} from '../constants';\n\n/**\n * The model returned from the {@link FeatureModel#parse} method.\n *\n * @typedef {Object} ParsedFeatureModel\n * @property {boolean|number|string} ParsedFeatureModel.value - The parsed val.\n * @property {string} ParsedFeatureModel.type - The type of the parsed val.\n */\n\n/**\n * Feature model.\n *\n * @description\n * This model contains details on a single feature and is received from the\n * **WDM** service upon registration.\n */\nconst FeatureModel = AmpState.extend({\n idAttribute: 'key', // needed by Ampersand to determine unique item\n\n // Ampersand property members.\n\n props: {\n /**\n * Contains the unique identifier for this feature to be addressed by.\n *\n * @type {string}\n */\n key: 'string',\n\n /**\n * This property contains the date in which this feature was last modified.\n *\n * @type {date}\n */\n lastModified: 'date',\n\n /**\n * This property defines whether or not the feature is mutable.\n *\n * @type {boolean}\n */\n mutable: 'boolean',\n\n /**\n * This property contains the data type the string value should be\n * interpreted as.\n *\n * @type {FEATURE_TYPES}\n */\n type: 'string',\n\n /**\n * This property contains the string value of this feature.\n *\n * @type {string}\n */\n val: 'string',\n\n /**\n * This property contains the interpreted value of this feature.\n *\n * @type {any}\n */\n value: 'any',\n },\n\n /**\n * Class object constructor. This method safely initializes the class object\n * prior to it fully loading to allow data to be accessed and modified\n * immediately after construction instead of initialization.\n *\n * @override\n * @param {Object} attrs - An object to map against the feature's properties.\n * @param {Object} [options={}] - Ampersand options for `parse` and `parent`.\n */\n constructor(attrs, options = {}) {\n defaults(options, {parse: true});\n\n return Reflect.apply(AmpState.prototype.constructor, this, [attrs, options]);\n },\n\n // Ampsersand method members.\n\n /**\n * Parse {@link FeatureModel} properties recieved as strings from **WDM**\n * and cast them as their appropriate types.\n *\n * @private\n * @memberof FeatureModel\n * @param {Object} model - The model to parse.\n * @property {string} model.val - The value to be parsed.\n * @returns {ParsedFeatureModel} - The parsed model.\n */\n parse(model) {\n // Validate that a model was provided and that it is an object.\n if (!model || typeof model !== 'object') {\n // Return an empty object to satisfy the requirements of `Ampersand`.\n return {};\n }\n\n const parsedModel = {...model};\n const {val} = parsedModel;\n\n // Validate that the value is a number.\n if (!Number.isNaN(Number(val))) {\n parsedModel.type = FEATURE_TYPES.NUMBER;\n parsedModel.value = Number(val);\n }\n // Validate if the value should be a true boolean.\n else if (typeof val === 'string' && val.toLowerCase() === 'true') {\n parsedModel.type = FEATURE_TYPES.BOOLEAN;\n parsedModel.value = true;\n }\n // Validate if the value should be a false boolean.\n else if (typeof val === 'string' && val.toLowerCase() === 'false') {\n parsedModel.type = FEATURE_TYPES.BOOLEAN;\n parsedModel.value = false;\n }\n // In all other cases, the value is string, even if it is undefined.\n else {\n parsedModel.type = FEATURE_TYPES.STRING;\n parsedModel.value = val;\n }\n\n return parsedModel;\n },\n\n /**\n * Serialize the feature using the parent ampersand method with its date as an\n * ISO string. This converts the feature into a request-transportable object.\n *\n * @override\n * @param {Record<string,boolean>} [args] - List of properties to serialize.\n * @returns {Object} - The request-ready transport object.\n */\n serialize(...args) {\n // Call the overloaded class member.\n const attrs = Reflect.apply(AmpState.prototype.serialize, this, args);\n\n // Validate that the overloaded class member returned an object with the\n // `lastModified` key-value pair and instance it as an ISO string.\n if (attrs.lastModified) {\n attrs.lastModified = new Date(attrs.lastModified).toISOString();\n }\n\n return attrs;\n },\n\n /**\n * Set a property of this object to a specific value. This method utilizes\n * code that exists within the `ampersand-state` dependency to handle\n * scenarios in which `key = {\"key\": \"value\"}` or\n * `key = \"key\", value = \"value\"`. Since the snippet is pulled directly from\n * `ampersand-state`, there is no need to test both scenarios.\n *\n * @override\n * @param {object | string} key - The key value, or object to be set.\n * @param {any} value - The key value or object to set the keyed pair to.\n * @param {any} options - The object to set the keyed pair to.\n * @returns {any} - The changed property.\n */\n set(key, value, options) {\n // Declare formatted output variables for properly setting the targetted\n // property for this method.\n let attrs;\n let optns;\n\n // Validate if the key is an instance of any object or not.\n if (isObject(key) || key === null) {\n attrs = key;\n optns = value;\n } else {\n attrs = {};\n attrs[key] = value;\n optns = options;\n }\n\n attrs = this.parse(attrs, optns);\n\n return Reflect.apply(AmpState.prototype.set, this, [attrs, optns]);\n },\n});\n\nexport default FeatureModel;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAGA;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,YAAY,GAAGC,uBAAA,CAASC,MAAT,CAAgB;EACnCC,WAAW,EAAE,KADsB;EACf;EAEpB;EAEAC,KAAK,EAAE;IACL;AACJ;AACA;AACA;AACA;IACIC,GAAG,EAAE,QANA;;IAQL;AACJ;AACA;AACA;AACA;IACIC,YAAY,EAAE,MAbT;;IAeL;AACJ;AACA;AACA;AACA;IACIC,OAAO,EAAE,SApBJ;;IAsBL;AACJ;AACA;AACA;AACA;AACA;IACIC,IAAI,EAAE,QA5BD;;IA8BL;AACJ;AACA;AACA;AACA;IACIC,GAAG,EAAE,QAnCA;;IAqCL;AACJ;AACA;AACA;AACA;IACIC,KAAK,EAAE;EA1CF,CAL4B;;EAkDnC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,WA3DmC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AW,CAACP,KAAZ,GAAoBD,GAApB;IACD;;IAED,OAAOQ,WAAP;EACD,CA7GkC;;EA+GnC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEO,SAvHmC,uBAuHhB;IAAA,kCAANC,IAAM;MAANA,IAAM;IAAA;;IACjB;IACA,IAAMb,KAAK,GAAG,oBAAcX,uBAAA,CAASc,SAAT,CAAmBS,SAAjC,EAA4C,IAA5C,EAAkDC,IAAlD,CAAd,CAFiB,CAIjB;IACA;;IACA,IAAIb,KAAK,CAACN,YAAV,EAAwB;MACtBM,KAAK,CAACN,YAAN,GAAqB,IAAIoB,IAAJ,CAASd,KAAK,CAACN,YAAf,EAA6BqB,WAA7B,EAArB;IACD;;IAED,OAAOf,KAAP;EACD,CAlIkC;;EAoInC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEgB,GAjJmC,eAiJ/BvB,GAjJ+B,EAiJ1BK,KAjJ0B,EAiJnBG,OAjJmB,EAiJV;IACvB;IACA;IACA,IAAID,KAAJ;IACA,IAAIiB,KAAJ,CAJuB,CAMvB;;IACA,IAAI,wBAASxB,GAAT,KAAiBA,GAAG,KAAK,IAA7B,EAAmC;MACjCO,KAAK,GAAGP,GAAR;MACAwB,KAAK,GAAGnB,KAAR;IACD,CAHD,MAGO;MACLE,KAAK,GAAG,EAAR;MACAA,KAAK,CAACP,GAAD,CAAL,GAAaK,KAAb;MACAmB,KAAK,GAAGhB,OAAR;IACD;;IAEDD,KAAK,GAAG,KAAKE,KAAL,CAAWF,KAAX,EAAkBiB,KAAlB,CAAR;IAEA,OAAO,oBAAc5B,uBAAA,CAASc,SAAT,CAAmBa,GAAjC,EAAsC,IAAtC,EAA4C,CAAChB,KAAD,EAAQiB,KAAR,CAA5C,CAAP;EACD;AApKkC,CAAhB,CAArB;;eAuKe7B,Y"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FeaturesModel","AmpState","extend","collections","developer","FeatureCollection","entitlement","user","clear","options","attributes","forEach","key","unset","_children","_collections","reset","initialize","eventNames","eventName","FEATURE_COLLECTION_NAMES","collectionName","on","model","trigger"],"sources":["features-model.js"],"sourcesContent":["// External dependencies.\nimport AmpState from 'ampersand-state';\n\n// Local Dependencies\nimport {FEATURE_COLLECTION_NAMES} from '../constants';\n\nimport FeatureCollection from './feature-collection';\n\n/**\n * Feature collection parent container.\n *\n * @description\n * This class contains all of the feature collection class objects to help\n * organize the data retrieved from the **wdm** service on device registration.\n */\nconst FeaturesModel = AmpState.extend({\n
|
|
1
|
+
{"version":3,"names":["FeaturesModel","AmpState","extend","collections","developer","FeatureCollection","entitlement","user","clear","options","attributes","forEach","key","unset","_children","_collections","reset","initialize","eventNames","eventName","FEATURE_COLLECTION_NAMES","collectionName","on","model","trigger"],"sources":["features-model.js"],"sourcesContent":["// External dependencies.\nimport AmpState from 'ampersand-state';\n\n// Local Dependencies\nimport {FEATURE_COLLECTION_NAMES} from '../constants';\n\nimport FeatureCollection from './feature-collection';\n\n/**\n * Feature collection parent container.\n *\n * @description\n * This class contains all of the feature collection class objects to help\n * organize the data retrieved from the **wdm** service on device registration.\n */\nconst FeaturesModel = AmpState.extend({\n // Ampersand property members.\n\n collections: {\n /**\n * This collection contains the developer feature collection.\n *\n * @type {FeatureCollection}\n */\n developer: FeatureCollection,\n\n /**\n * This collection contains the entitlement feature collection.\n *\n * @type {FeatureCollection}\n */\n entitlement: FeatureCollection,\n\n /**\n * This collection contains the user feature collection.\n *\n * @type {FeatureCollection}\n */\n user: FeatureCollection,\n },\n\n // Helper method members.\n\n /**\n * Recursively clear attributes, children, and collections.\n *\n * @param {Object} options - Attribute options to unset.\n * @returns {this}\n */\n clear(options) {\n // Clear the ampersand attributes safely if there are any. This class should\n // never have any attributes.\n Object.keys(this.attributes).forEach((key) => {\n this.unset(key, options);\n });\n\n // Clear the ampersand children safely if there are any. This class should\n // never have any children.\n /* eslint-disable-next-line no-underscore-dangle */\n Object.keys(this._children).forEach((key) => {\n this[key].clear();\n });\n\n // Clear the ampersand collections safely.\n /* eslint-disable-next-line no-underscore-dangle */\n Object.keys(this._collections).forEach((key) => {\n this[key].reset();\n });\n\n return this;\n },\n\n // Ampersand method members.\n\n /**\n * Initializer method for FeatureModel class object.\n *\n * @override\n * @returns {void}\n */\n initialize() {\n // Declare the collection event names.\n const eventNames = ['change:value', 'add', 'remove'];\n\n // Initialize collection event listeners.\n eventNames.forEach((eventName) => {\n FEATURE_COLLECTION_NAMES.forEach((collectionName) => {\n this[collectionName].on(eventName, (model, options) => {\n this.trigger(`change:${collectionName}`, this, this[collectionName], options);\n });\n });\n });\n },\n});\n\nexport default FeaturesModel;\n"],"mappings":";;;;;;;;;;;;;;AACA;;AAGA;;AAEA;;AANA;AAGA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,aAAa,GAAGC,uBAAA,CAASC,MAAT,CAAgB;EACpC;EAEAC,WAAW,EAAE;IACX;AACJ;AACA;AACA;AACA;IACIC,SAAS,EAAEC,0BANA;;IAQX;AACJ;AACA;AACA;AACA;IACIC,WAAW,EAAED,0BAbF;;IAeX;AACJ;AACA;AACA;AACA;IACIE,IAAI,EAAEF;EApBK,CAHuB;EA0BpC;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEG,KAlCoC,iBAkC9BC,OAlC8B,EAkCrB;IAAA;;IACb;IACA;IACA,mBAAY,KAAKC,UAAjB,EAA6BC,OAA7B,CAAqC,UAACC,GAAD,EAAS;MAC5C,KAAI,CAACC,KAAL,CAAWD,GAAX,EAAgBH,OAAhB;IACD,CAFD,EAHa,CAOb;IACA;;IACA;;IACA,mBAAY,KAAKK,SAAjB,EAA4BH,OAA5B,CAAoC,UAACC,GAAD,EAAS;MAC3C,KAAI,CAACA,GAAD,CAAJ,CAAUJ,KAAV;IACD,CAFD,EAVa,CAcb;;IACA;;IACA,mBAAY,KAAKO,YAAjB,EAA+BJ,OAA/B,CAAuC,UAACC,GAAD,EAAS;MAC9C,KAAI,CAACA,GAAD,CAAJ,CAAUI,KAAV;IACD,CAFD;IAIA,OAAO,IAAP;EACD,CAvDmC;EAyDpC;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEC,UAjEoC,wBAiEvB;IAAA;;IACX;IACA,IAAMC,UAAU,GAAG,CAAC,cAAD,EAAiB,KAAjB,EAAwB,QAAxB,CAAnB,CAFW,CAIX;;IACAA,UAAU,CAACP,OAAX,CAAmB,UAACQ,SAAD,EAAe;MAChCC,mCAAA,CAAyBT,OAAzB,CAAiC,UAACU,cAAD,EAAoB;QACnD,MAAI,CAACA,cAAD,CAAJ,CAAqBC,EAArB,CAAwBH,SAAxB,EAAmC,UAACI,KAAD,EAAQd,OAAR,EAAoB;UACrD,MAAI,CAACe,OAAL,kBAAuBH,cAAvB,GAAyC,MAAzC,EAA+C,MAAI,CAACA,cAAD,CAAnD,EAAqEZ,OAArE;QACD,CAFD;MAGD,CAJD;IAKD,CAND;EAOD;AA7EmC,CAAhB,CAAtB;;eAgFeT,a"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.js"],"sourcesContent":["import FeatureCollection from './feature-collection';\nimport FeatureModel from './feature-model';\nimport FeaturesModel from './features-model';\n\nexport {
|
|
1
|
+
{"version":3,"names":[],"sources":["index.js"],"sourcesContent":["import FeatureCollection from './feature-collection';\nimport FeatureModel from './feature-model';\nimport FeaturesModel from './features-model';\n\nexport {FeatureCollection, FeatureModel, FeaturesModel};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["registerInternalPlugin","Device","config","interceptors","DeviceUrlInterceptor","create","onBeforeLogout","unregister"],"sources":["index.js"],"sourcesContent":["// Internal dependencies.\n// Need to import metrics plugin for the devices to send metrics on succes/failure registration\nimport '@webex/internal-plugin-metrics';\nimport {registerInternalPlugin} from '@webex/webex-core';\n\n// Plugin dependencies.\nimport Device from './device';\nimport {FeatureCollection, FeatureModel, FeaturesModel} from './features/index';\nimport DeviceUrlInterceptor from './interceptors/device-url';\nimport * as constants from './constants';\nimport config from './config';\n\nregisterInternalPlugin('device', Device, {\n config,\n interceptors: {\n DeviceUrlInterceptor: DeviceUrlInterceptor.create
|
|
1
|
+
{"version":3,"names":["registerInternalPlugin","Device","config","interceptors","DeviceUrlInterceptor","create","onBeforeLogout","unregister"],"sources":["index.js"],"sourcesContent":["// Internal dependencies.\n// Need to import metrics plugin for the devices to send metrics on succes/failure registration\nimport '@webex/internal-plugin-metrics';\nimport {registerInternalPlugin} from '@webex/webex-core';\n\n// Plugin dependencies.\nimport Device from './device';\nimport {FeatureCollection, FeatureModel, FeaturesModel} from './features/index';\nimport DeviceUrlInterceptor from './interceptors/device-url';\nimport * as constants from './constants';\nimport config from './config';\n\nregisterInternalPlugin('device', Device, {\n config,\n interceptors: {\n DeviceUrlInterceptor: DeviceUrlInterceptor.create,\n },\n /**\n * Unregister the device in the case that the webex instance has logged out.\n *\n * @returns {Promise<undefined>}\n */\n onBeforeLogout() {\n return this.unregister();\n },\n});\n\nexport {default} from './device';\nexport {config, constants, DeviceUrlInterceptor, FeatureCollection, FeatureModel, FeaturesModel};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;AACA;;AAGA;;AACA;;AACA;;AACA;;;;AACA;;;;;;AAVA;AACA;AAIA;AAOA,IAAAA,iCAAA,EAAuB,QAAvB,EAAiCC,eAAjC,EAAyC;EACvCC,MAAM,EAANA,eADuC;EAEvCC,YAAY,EAAE;IACZC,oBAAoB,EAAEA,kBAAA,CAAqBC;EAD/B,CAFyB;;EAKvC;AACF;AACA;AACA;AACA;EACEC,cAVuC,4BAUtB;IACf,OAAO,KAAKC,UAAL,EAAP;EACD;AAZsC,CAAzC"}
|
|
@@ -35,8 +35,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
35
35
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
* Adds 'cisco-device-url' header, as appropriate, to requests
|
|
39
|
+
*/
|
|
40
40
|
var DeviceUrlInterceptor = /*#__PURE__*/function (_Interceptor) {
|
|
41
41
|
(0, _inherits2.default)(DeviceUrlInterceptor, _Interceptor);
|
|
42
42
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DeviceUrlInterceptor","options","headers","service","uri","webex","internal","device","services","url","CISCO_DEVICE_URL","resolve","waitForService","then","getServiceFromUrl","serviceName","name","invalidServices","includes","catch","error","message","match","reject","Interceptor"],"sources":["device-url.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Interceptor} from '@webex/http-core';\nimport {set} from 'lodash';\n\nimport {CISCO_DEVICE_URL} from '../constants';\n\n/**\n
|
|
1
|
+
{"version":3,"names":["DeviceUrlInterceptor","options","headers","service","uri","webex","internal","device","services","url","CISCO_DEVICE_URL","resolve","waitForService","then","getServiceFromUrl","serviceName","name","invalidServices","includes","catch","error","message","match","reject","Interceptor"],"sources":["device-url.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Interceptor} from '@webex/http-core';\nimport {set} from 'lodash';\n\nimport {CISCO_DEVICE_URL} from '../constants';\n\n/**\n * Adds 'cisco-device-url' header, as appropriate, to requests\n */\nexport default class DeviceUrlInterceptor extends Interceptor {\n /**\n * @returns {DeviceUrlInterceptor}\n */\n static create() {\n /* eslint no-invalid-this: [0] */\n return new DeviceUrlInterceptor({webex: this});\n }\n\n /**\n * @see Interceptor#onRequest\n * @param {Object} options\n * @returns {Object}\n */\n onRequest(options) {\n const {headers, service, uri} = options;\n const {device, services} = this.webex.internal;\n\n // Check if header is already set before moving forward\n if (!device.url || (headers && CISCO_DEVICE_URL in headers && !!headers[CISCO_DEVICE_URL])) {\n return Promise.resolve(options);\n }\n\n // Wait for catalog and service to be defined.\n return services\n .waitForService({service, url: uri})\n .then((url) => {\n // Grab the service name with the url returned from waitForService\n const {name: serviceName} = services.getServiceFromUrl(url) || {};\n const invalidServices = ['idbroker', 'oauth', 'saml'];\n\n // Check if service is not one of the invalid services\n // Assign the url to the device header\n if (serviceName && !invalidServices.includes(serviceName)) {\n set(options, `headers['${CISCO_DEVICE_URL}']`, device.url);\n }\n\n return options;\n })\n .catch((error) => {\n // Validate that the error came from getServiceFromUrl\n if (error.message.match(/was not found after waiting/)) {\n return options;\n }\n\n return Promise.reject(error);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAGA;;;;;;AAEA;AACA;AACA;IACqBA,oB;;;;;;;;;;;;;IASnB;AACF;AACA;AACA;AACA;IACE,mBAAUC,OAAV,EAAmB;MACjB,IAAOC,OAAP,GAAgCD,OAAhC,CAAOC,OAAP;MAAA,IAAgBC,OAAhB,GAAgCF,OAAhC,CAAgBE,OAAhB;MAAA,IAAyBC,GAAzB,GAAgCH,OAAhC,CAAyBG,GAAzB;MACA,2BAA2B,KAAKC,KAAL,CAAWC,QAAtC;MAAA,IAAOC,MAAP,wBAAOA,MAAP;MAAA,IAAeC,QAAf,wBAAeA,QAAf,CAFiB,CAIjB;;MACA,IAAI,CAACD,MAAM,CAACE,GAAR,IAAgBP,OAAO,IAAIQ,2BAAA,IAAoBR,OAA/B,IAA0C,CAAC,CAACA,OAAO,CAACQ,2BAAD,CAAvE,EAA4F;QAC1F,OAAO,iBAAQC,OAAR,CAAgBV,OAAhB,CAAP;MACD,CAPgB,CASjB;;;MACA,OAAOO,QAAQ,CACZI,cADI,CACW;QAACT,OAAO,EAAPA,OAAD;QAAUM,GAAG,EAAEL;MAAf,CADX,EAEJS,IAFI,CAEC,UAACJ,GAAD,EAAS;QACb;QACA,WAA4BD,QAAQ,CAACM,iBAAT,CAA2BL,GAA3B,KAAmC,EAA/D;QAAA,IAAaM,WAAb,QAAOC,IAAP;;QACA,IAAMC,eAAe,GAAG,CAAC,UAAD,EAAa,OAAb,EAAsB,MAAtB,CAAxB,CAHa,CAKb;QACA;;QACA,IAAIF,WAAW,IAAI,CAACE,eAAe,CAACC,QAAhB,CAAyBH,WAAzB,CAApB,EAA2D;UACzD,mBAAId,OAAJ,qBAAyBS,2BAAzB,SAA+CH,MAAM,CAACE,GAAtD;QACD;;QAED,OAAOR,OAAP;MACD,CAdI,EAeJkB,KAfI,CAeE,UAACC,KAAD,EAAW;QAChB;QACA,IAAIA,KAAK,CAACC,OAAN,CAAcC,KAAd,CAAoB,6BAApB,CAAJ,EAAwD;UACtD,OAAOrB,OAAP;QACD;;QAED,OAAO,iBAAQsB,MAAR,CAAeH,KAAf,CAAP;MACD,CAtBI,CAAP;IAuBD;;;;IA9CD;AACF;AACA;IACE,kBAAgB;MACd;MACA,OAAO,IAAIpB,oBAAJ,CAAyB;QAACK,KAAK,EAAE;MAAR,CAAzB,CAAP;IACD;;;EAP+CmB,qB"}
|
package/dist/metrics.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["JS_SDK_WDM_REGISTRATION_SUCCESSFUL","JS_SDK_WDM_REGISTRATION_FAILED"],"sources":["metrics.js"],"sourcesContent":["// Metric to do with WDM registration\nexport default {\n JS_SDK_WDM_REGISTRATION_SUCCESSFUL: 'JS_SDK_WDM_REGISTRATION_SUCCESSFUL',\n JS_SDK_WDM_REGISTRATION_FAILED: 'JS_SDK_WDM_REGISTRATION_FAILED'
|
|
1
|
+
{"version":3,"names":["JS_SDK_WDM_REGISTRATION_SUCCESSFUL","JS_SDK_WDM_REGISTRATION_FAILED"],"sources":["metrics.js"],"sourcesContent":["// Metric to do with WDM registration\nexport default {\n JS_SDK_WDM_REGISTRATION_SUCCESSFUL: 'JS_SDK_WDM_REGISTRATION_SUCCESSFUL',\n JS_SDK_WDM_REGISTRATION_FAILED: 'JS_SDK_WDM_REGISTRATION_FAILED',\n};\n"],"mappings":";;;;;;;;;AAAA;eACe;EACbA,kCAAkC,EAAE,oCADvB;EAEbC,8BAA8B,EAAE;AAFnB,C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/internal-plugin-device",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Timothy Scheuering <timsch@cisco.com>",
|
|
@@ -21,20 +21,20 @@
|
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@webex/test-helper-chai": "3.0.0-beta.
|
|
25
|
-
"@webex/test-helper-mock-webex": "3.0.0-beta.
|
|
26
|
-
"@webex/test-helper-test-users": "3.0.0-beta.
|
|
24
|
+
"@webex/test-helper-chai": "3.0.0-beta.15",
|
|
25
|
+
"@webex/test-helper-mock-webex": "3.0.0-beta.15",
|
|
26
|
+
"@webex/test-helper-test-users": "3.0.0-beta.15",
|
|
27
27
|
"chai": "^4.3.4",
|
|
28
28
|
"chai-as-promised": "^7.1.1",
|
|
29
29
|
"sinon": "^9.2.4"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@webex/common": "3.0.0-beta.
|
|
33
|
-
"@webex/common-timers": "3.0.0-beta.
|
|
34
|
-
"@webex/http-core": "3.0.0-beta.
|
|
35
|
-
"@webex/internal-plugin-device": "3.0.0-beta.
|
|
36
|
-
"@webex/internal-plugin-metrics": "3.0.0-beta.
|
|
37
|
-
"@webex/webex-core": "3.0.0-beta.
|
|
32
|
+
"@webex/common": "3.0.0-beta.15",
|
|
33
|
+
"@webex/common-timers": "3.0.0-beta.15",
|
|
34
|
+
"@webex/http-core": "3.0.0-beta.15",
|
|
35
|
+
"@webex/internal-plugin-device": "3.0.0-beta.15",
|
|
36
|
+
"@webex/internal-plugin-metrics": "3.0.0-beta.15",
|
|
37
|
+
"@webex/webex-core": "3.0.0-beta.15",
|
|
38
38
|
"ampersand-collection": "^2.0.2",
|
|
39
39
|
"ampersand-state": "^5.0.3",
|
|
40
40
|
"lodash": "^4.17.21"
|
package/src/config.js
CHANGED
|
@@ -2,7 +2,6 @@ import {inBrowser, deviceType} from '@webex/common';
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
device: {
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* The duration to wait for the catalog to populate in seconds.
|
|
8
7
|
*
|
|
@@ -16,22 +15,22 @@ export default {
|
|
|
16
15
|
* @type {Object}
|
|
17
16
|
*/
|
|
18
17
|
defaults: {
|
|
19
|
-
|
|
20
18
|
/**
|
|
21
19
|
* The default body configuration of registration requests.
|
|
22
20
|
*
|
|
23
21
|
* @type {Object}
|
|
24
22
|
*/
|
|
25
23
|
body: {
|
|
26
|
-
name:
|
|
27
|
-
process.title.trim() : undefined) ||
|
|
28
|
-
inBrowser && 'browser' ||
|
|
24
|
+
name:
|
|
25
|
+
(typeof process.title === 'string' ? process.title.trim() : undefined) ||
|
|
26
|
+
(inBrowser && 'browser') ||
|
|
27
|
+
'javascript',
|
|
29
28
|
deviceType: deviceType.WEB,
|
|
30
29
|
model: 'web-js-sdk',
|
|
31
30
|
localizedModel: 'webex-js-sdk',
|
|
32
31
|
systemName: 'WEBEX_JS_SDK',
|
|
33
|
-
systemVersion: '1.0.0'
|
|
34
|
-
}
|
|
32
|
+
systemVersion: '1.0.0',
|
|
33
|
+
},
|
|
35
34
|
},
|
|
36
35
|
|
|
37
36
|
/**
|
|
@@ -56,6 +55,6 @@ export default {
|
|
|
56
55
|
*
|
|
57
56
|
* @type {boolean}
|
|
58
57
|
*/
|
|
59
|
-
ephemeralDeviceTTL: 30 * 60
|
|
60
|
-
}
|
|
58
|
+
ephemeralDeviceTTL: 30 * 60,
|
|
59
|
+
},
|
|
61
60
|
};
|
package/src/constants.js
CHANGED
|
@@ -8,18 +8,16 @@ export const CISCO_DEVICE_URL = 'cisco-device-url';
|
|
|
8
8
|
export const FEATURE_COLLECTION_NAMES = [
|
|
9
9
|
FEATURE_COLLECTION_DEVELOPER,
|
|
10
10
|
FEATURE_COLLECTION_ENTITLEMENT,
|
|
11
|
-
FEATURE_COLLECTION_USER
|
|
11
|
+
FEATURE_COLLECTION_USER,
|
|
12
12
|
];
|
|
13
13
|
|
|
14
14
|
export const FEATURE_TYPES = {
|
|
15
15
|
BOOLEAN: 'boolean',
|
|
16
16
|
NUMBER: 'number',
|
|
17
|
-
STRING: 'string'
|
|
17
|
+
STRING: 'string',
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
// Device constants.
|
|
21
21
|
export const DEVICE_EVENT_REGISTRATION_SUCCESS = 'registration:success';
|
|
22
22
|
|
|
23
|
-
export const DEVICE_EVENTS = [
|
|
24
|
-
DEVICE_EVENT_REGISTRATION_SUCCESS
|
|
25
|
-
];
|
|
23
|
+
export const DEVICE_EVENTS = [DEVICE_EVENT_REGISTRATION_SUCCESS];
|