@webex/internal-plugin-device 2.59.3-next.1 → 2.59.4
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/.eslintrc.js +6 -6
- package/README.md +80 -80
- package/babel.config.js +3 -3
- package/dist/config.js +27 -27
- package/dist/config.js.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/device.js +226 -226
- package/dist/device.js.map +1 -1
- package/dist/features/feature-collection.js +14 -14
- package/dist/features/feature-collection.js.map +1 -1
- package/dist/features/feature-model.js +73 -73
- package/dist/features/feature-model.js.map +1 -1
- package/dist/features/features-model.js +28 -28
- package/dist/features/features-model.js.map +1 -1
- package/dist/features/index.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/interceptors/device-url.js +8 -8
- package/dist/interceptors/device-url.js.map +1 -1
- package/dist/metrics.js.map +1 -1
- package/jest.config.js +3 -3
- package/package.json +16 -17
- package/process +1 -1
- package/src/config.js +60 -60
- package/src/constants.js +23 -23
- package/src/device.js +835 -835
- package/src/features/feature-collection.js +30 -30
- package/src/features/feature-model.js +189 -189
- package/src/features/features-model.js +96 -96
- package/src/features/index.js +5 -5
- package/src/index.js +29 -29
- package/src/interceptors/device-url.js +61 -61
- package/src/metrics.js +5 -5
- package/test/integration/spec/device.js +904 -904
- package/test/integration/spec/webex.js +42 -42
- package/test/unit/spec/device.js +409 -409
- package/test/unit/spec/features/feature-collection.js +24 -24
- package/test/unit/spec/features/feature-model.js +255 -255
- package/test/unit/spec/features/features-model.js +97 -97
- package/test/unit/spec/interceptors/device-url.js +215 -215
- package/test/unit/spec/wdm-dto.json +104 -104
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_ampersandState","_interopRequireDefault","require","_constants","_featureCollection","FeaturesModel","AmpState","extend","collections","developer","FeatureCollection","entitlement","user","clear","options","_this","_keys","default","attributes","forEach","key","unset","_children","_collections","reset","initialize","_this2","eventNames","eventName","FEATURE_COLLECTION_NAMES","collectionName","on","model","trigger","concat","_default","exports"],"sources":["features-model.js"],"sourcesContent":["// External dependencies.\
|
|
1
|
+
{"version":3,"names":["_ampersandState","_interopRequireDefault","require","_constants","_featureCollection","FeaturesModel","AmpState","extend","collections","developer","FeatureCollection","entitlement","user","clear","options","_this","_keys","default","attributes","forEach","key","unset","_children","_collections","reset","initialize","_this2","eventNames","eventName","FEATURE_COLLECTION_NAMES","collectionName","on","model","trigger","concat","_default","exports"],"sources":["features-model.js"],"sourcesContent":["// External dependencies.\nimport AmpState from 'ampersand-state';\n\n// Local Dependencies\nimport {FEATURE_COLLECTION_NAMES} from '../constants';\n\nimport FeatureCollection from './feature-collection';\n\n/**\n * Feature collection parent container.\n *\n * @description\n * This class contains all of the feature collection class objects to help\n * organize the data retrieved from the **wdm** service on device registration.\n */\nconst FeaturesModel = AmpState.extend({\n // Ampersand property members.\n\n collections: {\n /**\n * This collection contains the developer feature collection.\n *\n * @type {FeatureCollection}\n */\n developer: FeatureCollection,\n\n /**\n * This collection contains the entitlement feature collection.\n *\n * @type {FeatureCollection}\n */\n entitlement: FeatureCollection,\n\n /**\n * This collection contains the user feature collection.\n *\n * @type {FeatureCollection}\n */\n user: FeatureCollection,\n },\n\n // Helper method members.\n\n /**\n * Recursively clear attributes, children, and collections.\n *\n * @param {Object} options - Attribute options to unset.\n * @returns {this}\n */\n clear(options) {\n // Clear the ampersand attributes safely if there are any. This class should\n // never have any attributes.\n Object.keys(this.attributes).forEach((key) => {\n this.unset(key, options);\n });\n\n // Clear the ampersand children safely if there are any. This class should\n // never have any children.\n /* eslint-disable-next-line no-underscore-dangle */\n Object.keys(this._children).forEach((key) => {\n this[key].clear();\n });\n\n // Clear the ampersand collections safely.\n /* eslint-disable-next-line no-underscore-dangle */\n Object.keys(this._collections).forEach((key) => {\n this[key].reset();\n });\n\n return this;\n },\n\n // Ampersand method members.\n\n /**\n * Initializer method for FeatureModel class object.\n *\n * @override\n * @returns {void}\n */\n initialize() {\n // Declare the collection event names.\n const eventNames = ['change:value', 'add', 'remove'];\n\n // Initialize collection event listeners.\n eventNames.forEach((eventName) => {\n FEATURE_COLLECTION_NAMES.forEach((collectionName) => {\n this[collectionName].on(eventName, (model, options) => {\n this.trigger(`change:${collectionName}`, this, this[collectionName], options);\n });\n });\n });\n },\n});\n\nexport default FeaturesModel;\n"],"mappings":";;;;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AANA;;AAGA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMG,aAAa,GAAGC,uBAAQ,CAACC,MAAM,CAAC;EACpC;;EAEAC,WAAW,EAAE;IACX;AACJ;AACA;AACA;AACA;IACIC,SAAS,EAAEC,0BAAiB;IAE5B;AACJ;AACA;AACA;AACA;IACIC,WAAW,EAAED,0BAAiB;IAE9B;AACJ;AACA;AACA;AACA;IACIE,IAAI,EAAEF;EACR,CAAC;EAED;EAEA;AACF;AACA;AACA;AACA;AACA;EACEG,KAAK,WAAAA,MAACC,OAAO,EAAE;IAAA,IAAAC,KAAA;IACb;IACA;IACA,IAAAC,KAAA,CAAAC,OAAA,EAAY,IAAI,CAACC,UAAU,CAAC,CAACC,OAAO,CAAC,UAACC,GAAG,EAAK;MAC5CL,KAAI,CAACM,KAAK,CAACD,GAAG,EAAEN,OAAO,CAAC;IAC1B,CAAC,CAAC;;IAEF;IACA;IACA;IACA,IAAAE,KAAA,CAAAC,OAAA,EAAY,IAAI,CAACK,SAAS,CAAC,CAACH,OAAO,CAAC,UAACC,GAAG,EAAK;MAC3CL,KAAI,CAACK,GAAG,CAAC,CAACP,KAAK,EAAE;IACnB,CAAC,CAAC;;IAEF;IACA;IACA,IAAAG,KAAA,CAAAC,OAAA,EAAY,IAAI,CAACM,YAAY,CAAC,CAACJ,OAAO,CAAC,UAACC,GAAG,EAAK;MAC9CL,KAAI,CAACK,GAAG,CAAC,CAACI,KAAK,EAAE;IACnB,CAAC,CAAC;IAEF,OAAO,IAAI;EACb,CAAC;EAED;EAEA;AACF;AACA;AACA;AACA;AACA;EACEC,UAAU,WAAAA,WAAA,EAAG;IAAA,IAAAC,MAAA;IACX;IACA,IAAMC,UAAU,GAAG,CAAC,cAAc,EAAE,KAAK,EAAE,QAAQ,CAAC;;IAEpD;IACAA,UAAU,CAACR,OAAO,CAAC,UAACS,SAAS,EAAK;MAChCC,mCAAwB,CAACV,OAAO,CAAC,UAACW,cAAc,EAAK;QACnDJ,MAAI,CAACI,cAAc,CAAC,CAACC,EAAE,CAACH,SAAS,EAAE,UAACI,KAAK,EAAElB,OAAO,EAAK;UACrDY,MAAI,CAACO,OAAO,WAAAC,MAAA,CAAWJ,cAAc,GAAIJ,MAAI,EAAEA,MAAI,CAACI,cAAc,CAAC,EAAEhB,OAAO,CAAC;QAC/E,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;AACF,CAAC,CAAC;AAAC,IAAAqB,QAAA,GAEY9B,aAAa;AAAA+B,OAAA,CAAAnB,OAAA,GAAAkB,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_featureCollection","_interopRequireDefault","require","_featureModel","_featuresModel"],"sources":["index.js"],"sourcesContent":["import FeatureCollection from './feature-collection';\
|
|
1
|
+
{"version":3,"names":["_featureCollection","_interopRequireDefault","require","_featureModel","_featuresModel"],"sources":["index.js"],"sourcesContent":["import FeatureCollection from './feature-collection';\nimport FeatureModel from './feature-model';\nimport FeaturesModel from './features-model';\n\nexport {FeatureCollection, FeatureModel, FeaturesModel};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GAAAH,sBAAA,CAAAC,OAAA"}
|
package/dist/index.js
CHANGED
|
@@ -65,10 +65,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
65
65
|
interceptors: {
|
|
66
66
|
DeviceUrlInterceptor: _deviceUrl.default.create
|
|
67
67
|
},
|
|
68
|
-
/**
|
|
69
|
-
* Unregister the device in the case that the webex instance has logged out.
|
|
70
|
-
*
|
|
71
|
-
* @returns {Promise<undefined>}
|
|
68
|
+
/**
|
|
69
|
+
* Unregister the device in the case that the webex instance has logged out.
|
|
70
|
+
*
|
|
71
|
+
* @returns {Promise<undefined>}
|
|
72
72
|
*/
|
|
73
73
|
onBeforeLogout: function onBeforeLogout() {
|
|
74
74
|
return this.unregister();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["require","_webexCore","_device","_interopRequireDefault","_index","_deviceUrl","constants","_interopRequireWildcard","exports","_config","_getRequireWildcardCache","nodeInterop","_WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","default","cache","has","get","newObj","hasPropertyDescriptor","_Object$defineProperty","_Object$getOwnPropertyDescriptor","key","Object","prototype","hasOwnProperty","call","desc","set","registerInternalPlugin","Device","config","interceptors","DeviceUrlInterceptor","create","onBeforeLogout","unregister"],"sources":["index.js"],"sourcesContent":["// Internal dependencies.\
|
|
1
|
+
{"version":3,"names":["require","_webexCore","_device","_interopRequireDefault","_index","_deviceUrl","constants","_interopRequireWildcard","exports","_config","_getRequireWildcardCache","nodeInterop","_WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","default","cache","has","get","newObj","hasPropertyDescriptor","_Object$defineProperty","_Object$getOwnPropertyDescriptor","key","Object","prototype","hasOwnProperty","call","desc","set","registerInternalPlugin","Device","config","interceptors","DeviceUrlInterceptor","create","onBeforeLogout","unregister"],"sources":["index.js"],"sourcesContent":["// Internal dependencies.\n// Need to import metrics plugin for the devices to send metrics on succes/failure registration\nimport '@webex/internal-plugin-metrics';\nimport {registerInternalPlugin} from '@webex/webex-core';\n\n// Plugin dependencies.\nimport Device from './device';\nimport {FeatureCollection, FeatureModel, FeaturesModel} from './features/index';\nimport DeviceUrlInterceptor from './interceptors/device-url';\nimport * as constants from './constants';\nimport config from './config';\n\nregisterInternalPlugin('device', Device, {\n config,\n interceptors: {\n DeviceUrlInterceptor: DeviceUrlInterceptor.create,\n },\n /**\n * Unregister the device in the case that the webex instance has logged out.\n *\n * @returns {Promise<undefined>}\n */\n onBeforeLogout() {\n return this.unregister();\n },\n});\n\nexport {default} from './device';\nexport {config, constants, DeviceUrlInterceptor, FeatureCollection, FeatureModel, FeaturesModel};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEAA,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAGA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,SAAA,GAAAC,uBAAA,CAAAP,OAAA;AAAyCQ,OAAA,CAAAF,SAAA,GAAAA,SAAA;AACzC,IAAAG,OAAA,GAAAN,sBAAA,CAAAH,OAAA;AAA8B,SAAAU,yBAAAC,WAAA,eAAAC,QAAA,kCAAAC,iBAAA,OAAAD,QAAA,QAAAE,gBAAA,OAAAF,QAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,4BAAAG,OAAA,EAAAH,GAAA,UAAAI,KAAA,GAAAT,wBAAA,CAAAC,WAAA,OAAAQ,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAL,GAAA,YAAAI,KAAA,CAAAE,GAAA,CAAAN,GAAA,SAAAO,MAAA,WAAAC,qBAAA,GAAAC,sBAAA,IAAAC,gCAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAC,MAAA,CAAAC,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAf,GAAA,EAAAW,GAAA,SAAAK,IAAA,GAAAR,qBAAA,GAAAE,gCAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAK,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,sBAAA,CAAAF,MAAA,EAAAI,GAAA,EAAAK,IAAA,YAAAT,MAAA,CAAAI,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAJ,MAAA,CAAAJ,OAAA,GAAAH,GAAA,MAAAI,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAjB,GAAA,EAAAO,MAAA,YAAAA,MAAA;AAV9B;AACA;;AAIA;;AAOA,IAAAW,iCAAsB,EAAC,QAAQ,EAAEC,eAAM,EAAE;EACvCC,MAAM,EAANA,eAAM;EACNC,YAAY,EAAE;IACZC,oBAAoB,EAAEA,kBAAoB,CAACC;EAC7C,CAAC;EACD;AACF;AACA;AACA;AACA;EACEC,cAAc,WAAAA,eAAA,EAAG;IACf,OAAO,IAAI,CAACC,UAAU,EAAE;EAC1B;AACF,CAAC,CAAC"}
|
|
@@ -18,8 +18,8 @@ var _httpCore = require("@webex/http-core");
|
|
|
18
18
|
var _constants = require("../constants");
|
|
19
19
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
20
20
|
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; } }
|
|
21
|
-
/**
|
|
22
|
-
* Adds 'cisco-device-url' header, as appropriate, to requests
|
|
21
|
+
/**
|
|
22
|
+
* Adds 'cisco-device-url' header, as appropriate, to requests
|
|
23
23
|
*/
|
|
24
24
|
var DeviceUrlInterceptor = /*#__PURE__*/function (_Interceptor) {
|
|
25
25
|
(0, _inherits2.default)(DeviceUrlInterceptor, _Interceptor);
|
|
@@ -31,10 +31,10 @@ var DeviceUrlInterceptor = /*#__PURE__*/function (_Interceptor) {
|
|
|
31
31
|
(0, _createClass2.default)(DeviceUrlInterceptor, [{
|
|
32
32
|
key: "onRequest",
|
|
33
33
|
value:
|
|
34
|
-
/**
|
|
35
|
-
* @see Interceptor#onRequest
|
|
36
|
-
* @param {Object} options
|
|
37
|
-
* @returns {Object}
|
|
34
|
+
/**
|
|
35
|
+
* @see Interceptor#onRequest
|
|
36
|
+
* @param {Object} options
|
|
37
|
+
* @returns {Object}
|
|
38
38
|
*/
|
|
39
39
|
function onRequest(options) {
|
|
40
40
|
var headers = options.headers,
|
|
@@ -76,8 +76,8 @@ var DeviceUrlInterceptor = /*#__PURE__*/function (_Interceptor) {
|
|
|
76
76
|
}], [{
|
|
77
77
|
key: "create",
|
|
78
78
|
value:
|
|
79
|
-
/**
|
|
80
|
-
* @returns {DeviceUrlInterceptor}
|
|
79
|
+
/**
|
|
80
|
+
* @returns {DeviceUrlInterceptor}
|
|
81
81
|
*/
|
|
82
82
|
function create() {
|
|
83
83
|
/* eslint no-invalid-this: [0] */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_httpCore","require","_constants","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","DeviceUrlInterceptor","_Interceptor","_inherits2","_super","_classCallCheck2","_createClass2","key","value","onRequest","options","headers","service","uri","_this$webex$internal","webex","internal","device","services","url","CISCO_DEVICE_URL","_promise","resolve","waitForService","then","_ref","getServiceFromUrl","serviceName","name","invalidServices","includes","_set2","concat","catch","error","message","match","reject","create","Interceptor","exports"],"sources":["device-url.js"],"sourcesContent":["/*!\
|
|
1
|
+
{"version":3,"names":["_httpCore","require","_constants","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","DeviceUrlInterceptor","_Interceptor","_inherits2","_super","_classCallCheck2","_createClass2","key","value","onRequest","options","headers","service","uri","_this$webex$internal","webex","internal","device","services","url","CISCO_DEVICE_URL","_promise","resolve","waitForService","then","_ref","getServiceFromUrl","serviceName","name","invalidServices","includes","_set2","concat","catch","error","message","match","reject","create","Interceptor","exports"],"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":"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"}
|
package/dist/metrics.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_default","JS_SDK_WDM_REGISTRATION_SUCCESSFUL","JS_SDK_WDM_REGISTRATION_FAILED","exports","default"],"sources":["metrics.js"],"sourcesContent":["// Metric to do with WDM registration\
|
|
1
|
+
{"version":3,"names":["_default","JS_SDK_WDM_REGISTRATION_SUCCESSFUL","JS_SDK_WDM_REGISTRATION_FAILED","exports","default"],"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;AAAA,IAAAA,QAAA,GACe;EACbC,kCAAkC,EAAE,oCAAoC;EACxEC,8BAA8B,EAAE;AAClC,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAJ,QAAA"}
|
package/jest.config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const config = require('@webex/jest-config-legacy');
|
|
2
|
-
|
|
3
|
-
module.exports = config;
|
|
1
|
+
const config = require('@webex/jest-config-legacy');
|
|
2
|
+
|
|
3
|
+
module.exports = config;
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/internal-plugin-device",
|
|
3
|
+
"version": "2.59.4",
|
|
3
4
|
"description": "",
|
|
4
5
|
"license": "MIT",
|
|
5
6
|
"author": "Timothy Scheuering <timsch@cisco.com>",
|
|
@@ -21,14 +22,14 @@
|
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
24
|
"@babel/core": "^7.17.10",
|
|
24
|
-
"@webex/babel-config-legacy": "
|
|
25
|
-
"@webex/eslint-config-legacy": "
|
|
26
|
-
"@webex/jest-config-legacy": "
|
|
27
|
-
"@webex/legacy-tools": "
|
|
28
|
-
"@webex/test-helper-chai": "
|
|
29
|
-
"@webex/test-helper-mocha": "
|
|
30
|
-
"@webex/test-helper-mock-webex": "
|
|
31
|
-
"@webex/test-helper-test-users": "
|
|
25
|
+
"@webex/babel-config-legacy": "2.59.4",
|
|
26
|
+
"@webex/eslint-config-legacy": "2.59.4",
|
|
27
|
+
"@webex/jest-config-legacy": "2.59.4",
|
|
28
|
+
"@webex/legacy-tools": "2.59.4",
|
|
29
|
+
"@webex/test-helper-chai": "2.59.4",
|
|
30
|
+
"@webex/test-helper-mocha": "2.59.4",
|
|
31
|
+
"@webex/test-helper-mock-webex": "2.59.4",
|
|
32
|
+
"@webex/test-helper-test-users": "2.59.4",
|
|
32
33
|
"chai": "^4.3.4",
|
|
33
34
|
"chai-as-promised": "^7.1.1",
|
|
34
35
|
"eslint": "^8.24.0",
|
|
@@ -36,11 +37,11 @@
|
|
|
36
37
|
"sinon": "^9.2.4"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@webex/common": "
|
|
40
|
-
"@webex/common-timers": "
|
|
41
|
-
"@webex/http-core": "
|
|
42
|
-
"@webex/internal-plugin-metrics": "
|
|
43
|
-
"@webex/webex-core": "
|
|
40
|
+
"@webex/common": "2.59.4",
|
|
41
|
+
"@webex/common-timers": "2.59.4",
|
|
42
|
+
"@webex/http-core": "2.59.4",
|
|
43
|
+
"@webex/internal-plugin-metrics": "2.59.4",
|
|
44
|
+
"@webex/webex-core": "2.59.4",
|
|
44
45
|
"ampersand-collection": "^2.0.2",
|
|
45
46
|
"ampersand-state": "^5.0.3",
|
|
46
47
|
"lodash": "^4.17.21"
|
|
@@ -48,12 +49,10 @@
|
|
|
48
49
|
"scripts": {
|
|
49
50
|
"build": "yarn build:src",
|
|
50
51
|
"build:src": "webex-legacy-tools build -dest \"./dist\" -src \"./src\" -js -ts -maps",
|
|
51
|
-
"deploy:npm": "yarn npm publish",
|
|
52
52
|
"test": "yarn test:style && yarn test:unit && yarn test:integration && yarn test:browser",
|
|
53
53
|
"test:browser": "webex-legacy-tools test --integration --unit --runner karma",
|
|
54
54
|
"test:integration": "webex-legacy-tools test --integration --runner mocha",
|
|
55
55
|
"test:style": "eslint ./src/**/*.*",
|
|
56
56
|
"test:unit": "webex-legacy-tools test --unit --runner jest"
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
}
|
|
57
|
+
}
|
|
58
|
+
}
|
package/process
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports = {browser: true};
|
|
1
|
+
module.exports = {browser: true};
|
package/src/config.js
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import {inBrowser, deviceType} from '@webex/common';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
device: {
|
|
5
|
-
/**
|
|
6
|
-
* The duration to wait for the catalog to populate in seconds.
|
|
7
|
-
*
|
|
8
|
-
* @type {number}
|
|
9
|
-
*/
|
|
10
|
-
canRegisterWaitDuration: 10,
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* The default configuration group when sending registration requests.
|
|
14
|
-
*
|
|
15
|
-
* @type {Object}
|
|
16
|
-
*/
|
|
17
|
-
defaults: {
|
|
18
|
-
/**
|
|
19
|
-
* The default body configuration of registration requests.
|
|
20
|
-
*
|
|
21
|
-
* @type {Object}
|
|
22
|
-
*/
|
|
23
|
-
body: {
|
|
24
|
-
name:
|
|
25
|
-
(typeof process.title === 'string' ? process.title.trim() : undefined) ||
|
|
26
|
-
(inBrowser && 'browser') ||
|
|
27
|
-
'javascript',
|
|
28
|
-
deviceType: deviceType.WEB,
|
|
29
|
-
model: 'web-js-sdk',
|
|
30
|
-
localizedModel: 'webex-js-sdk',
|
|
31
|
-
systemName: 'WEBEX_JS_SDK',
|
|
32
|
-
systemVersion: '1.0.0',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* When true, the **wdm** service will enforce an inactivity duration.
|
|
38
|
-
*
|
|
39
|
-
* @type {boolean}
|
|
40
|
-
*/
|
|
41
|
-
enableInactivityEnforcement: false,
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* When true, the device registration will include a ttl value of
|
|
45
|
-
* {@link config.device.ephemeralDeviceTTL} and refresh on an interval of
|
|
46
|
-
* {@link config.device.ephemeralDeviceTTL} / 2 + 60 seconds.
|
|
47
|
-
*
|
|
48
|
-
* @type {boolean}
|
|
49
|
-
*/
|
|
50
|
-
ephemeral: false,
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* The ttl value to include in device registration if
|
|
54
|
-
* {@link config.device.ephemeral} is true. Measured in seconds.
|
|
55
|
-
*
|
|
56
|
-
* @type {boolean}
|
|
57
|
-
*/
|
|
58
|
-
ephemeralDeviceTTL: 30 * 60,
|
|
59
|
-
},
|
|
60
|
-
};
|
|
1
|
+
import {inBrowser, deviceType} from '@webex/common';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
device: {
|
|
5
|
+
/**
|
|
6
|
+
* The duration to wait for the catalog to populate in seconds.
|
|
7
|
+
*
|
|
8
|
+
* @type {number}
|
|
9
|
+
*/
|
|
10
|
+
canRegisterWaitDuration: 10,
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The default configuration group when sending registration requests.
|
|
14
|
+
*
|
|
15
|
+
* @type {Object}
|
|
16
|
+
*/
|
|
17
|
+
defaults: {
|
|
18
|
+
/**
|
|
19
|
+
* The default body configuration of registration requests.
|
|
20
|
+
*
|
|
21
|
+
* @type {Object}
|
|
22
|
+
*/
|
|
23
|
+
body: {
|
|
24
|
+
name:
|
|
25
|
+
(typeof process.title === 'string' ? process.title.trim() : undefined) ||
|
|
26
|
+
(inBrowser && 'browser') ||
|
|
27
|
+
'javascript',
|
|
28
|
+
deviceType: deviceType.WEB,
|
|
29
|
+
model: 'web-js-sdk',
|
|
30
|
+
localizedModel: 'webex-js-sdk',
|
|
31
|
+
systemName: 'WEBEX_JS_SDK',
|
|
32
|
+
systemVersion: '1.0.0',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* When true, the **wdm** service will enforce an inactivity duration.
|
|
38
|
+
*
|
|
39
|
+
* @type {boolean}
|
|
40
|
+
*/
|
|
41
|
+
enableInactivityEnforcement: false,
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* When true, the device registration will include a ttl value of
|
|
45
|
+
* {@link config.device.ephemeralDeviceTTL} and refresh on an interval of
|
|
46
|
+
* {@link config.device.ephemeralDeviceTTL} / 2 + 60 seconds.
|
|
47
|
+
*
|
|
48
|
+
* @type {boolean}
|
|
49
|
+
*/
|
|
50
|
+
ephemeral: false,
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The ttl value to include in device registration if
|
|
54
|
+
* {@link config.device.ephemeral} is true. Measured in seconds.
|
|
55
|
+
*
|
|
56
|
+
* @type {boolean}
|
|
57
|
+
*/
|
|
58
|
+
ephemeralDeviceTTL: 30 * 60,
|
|
59
|
+
},
|
|
60
|
+
};
|
package/src/constants.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
// Feature constants.
|
|
2
|
-
export const FEATURE_COLLECTION_DEVELOPER = 'developer';
|
|
3
|
-
export const FEATURE_COLLECTION_ENTITLEMENT = 'entitlement';
|
|
4
|
-
export const FEATURE_COLLECTION_USER = 'user';
|
|
5
|
-
|
|
6
|
-
export const CISCO_DEVICE_URL = 'cisco-device-url';
|
|
7
|
-
|
|
8
|
-
export const FEATURE_COLLECTION_NAMES = [
|
|
9
|
-
FEATURE_COLLECTION_DEVELOPER,
|
|
10
|
-
FEATURE_COLLECTION_ENTITLEMENT,
|
|
11
|
-
FEATURE_COLLECTION_USER,
|
|
12
|
-
];
|
|
13
|
-
|
|
14
|
-
export const FEATURE_TYPES = {
|
|
15
|
-
BOOLEAN: 'boolean',
|
|
16
|
-
NUMBER: 'number',
|
|
17
|
-
STRING: 'string',
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
// Device constants.
|
|
21
|
-
export const DEVICE_EVENT_REGISTRATION_SUCCESS = 'registration:success';
|
|
22
|
-
|
|
23
|
-
export const DEVICE_EVENTS = [DEVICE_EVENT_REGISTRATION_SUCCESS];
|
|
1
|
+
// Feature constants.
|
|
2
|
+
export const FEATURE_COLLECTION_DEVELOPER = 'developer';
|
|
3
|
+
export const FEATURE_COLLECTION_ENTITLEMENT = 'entitlement';
|
|
4
|
+
export const FEATURE_COLLECTION_USER = 'user';
|
|
5
|
+
|
|
6
|
+
export const CISCO_DEVICE_URL = 'cisco-device-url';
|
|
7
|
+
|
|
8
|
+
export const FEATURE_COLLECTION_NAMES = [
|
|
9
|
+
FEATURE_COLLECTION_DEVELOPER,
|
|
10
|
+
FEATURE_COLLECTION_ENTITLEMENT,
|
|
11
|
+
FEATURE_COLLECTION_USER,
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
export const FEATURE_TYPES = {
|
|
15
|
+
BOOLEAN: 'boolean',
|
|
16
|
+
NUMBER: 'number',
|
|
17
|
+
STRING: 'string',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Device constants.
|
|
21
|
+
export const DEVICE_EVENT_REGISTRATION_SUCCESS = 'registration:success';
|
|
22
|
+
|
|
23
|
+
export const DEVICE_EVENTS = [DEVICE_EVENT_REGISTRATION_SUCCESS];
|