@webex/internal-plugin-device 3.0.0-beta.3 → 3.0.0-beta.30
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 +0 -8
- package/dist/config.js.map +1 -1
- package/dist/constants.js +2 -3
- package/dist/constants.js.map +1 -1
- package/dist/device.js +91 -169
- package/dist/device.js.map +1 -1
- package/dist/features/feature-collection.js +1 -8
- package/dist/features/feature-collection.js.map +1 -1
- package/dist/features/feature-model.js +15 -42
- package/dist/features/feature-model.js.map +1 -1
- package/dist/features/features-model.js +9 -21
- package/dist/features/features-model.js.map +1 -1
- package/dist/features/index.js +0 -8
- package/dist/features/index.js.map +1 -1
- package/dist/index.js +2 -24
- package/dist/index.js.map +1 -1
- package/dist/interceptors/device-url.js +12 -33
- package/dist/interceptors/device-url.js.map +1 -1
- package/dist/metrics.js +0 -2
- 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/dist/features/index.js
CHANGED
|
@@ -1,37 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
5
|
_Object$defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
|
|
11
8
|
_Object$defineProperty(exports, "FeatureCollection", {
|
|
12
9
|
enumerable: true,
|
|
13
10
|
get: function get() {
|
|
14
11
|
return _featureCollection.default;
|
|
15
12
|
}
|
|
16
13
|
});
|
|
17
|
-
|
|
18
14
|
_Object$defineProperty(exports, "FeatureModel", {
|
|
19
15
|
enumerable: true,
|
|
20
16
|
get: function get() {
|
|
21
17
|
return _featureModel.default;
|
|
22
18
|
}
|
|
23
19
|
});
|
|
24
|
-
|
|
25
20
|
_Object$defineProperty(exports, "FeaturesModel", {
|
|
26
21
|
enumerable: true,
|
|
27
22
|
get: function get() {
|
|
28
23
|
return _featuresModel.default;
|
|
29
24
|
}
|
|
30
25
|
});
|
|
31
|
-
|
|
32
26
|
var _featureCollection = _interopRequireDefault(require("./feature-collection"));
|
|
33
|
-
|
|
34
27
|
var _featureModel = _interopRequireDefault(require("./feature-model"));
|
|
35
|
-
|
|
36
28
|
var _featuresModel = _interopRequireDefault(require("./features-model"));
|
|
37
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -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
CHANGED
|
@@ -1,92 +1,70 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _typeof = require("@babel/runtime-corejs2/helpers/typeof");
|
|
4
|
-
|
|
5
4
|
var _WeakMap = require("@babel/runtime-corejs2/core-js/weak-map");
|
|
6
|
-
|
|
7
5
|
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
8
|
-
|
|
9
6
|
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
|
|
10
|
-
|
|
11
7
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
12
|
-
|
|
13
8
|
_Object$defineProperty(exports, "__esModule", {
|
|
14
9
|
value: true
|
|
15
10
|
});
|
|
16
|
-
|
|
17
11
|
_Object$defineProperty(exports, "DeviceUrlInterceptor", {
|
|
18
12
|
enumerable: true,
|
|
19
13
|
get: function get() {
|
|
20
14
|
return _deviceUrl.default;
|
|
21
15
|
}
|
|
22
16
|
});
|
|
23
|
-
|
|
24
17
|
_Object$defineProperty(exports, "FeatureCollection", {
|
|
25
18
|
enumerable: true,
|
|
26
19
|
get: function get() {
|
|
27
20
|
return _index.FeatureCollection;
|
|
28
21
|
}
|
|
29
22
|
});
|
|
30
|
-
|
|
31
23
|
_Object$defineProperty(exports, "FeatureModel", {
|
|
32
24
|
enumerable: true,
|
|
33
25
|
get: function get() {
|
|
34
26
|
return _index.FeatureModel;
|
|
35
27
|
}
|
|
36
28
|
});
|
|
37
|
-
|
|
38
29
|
_Object$defineProperty(exports, "FeaturesModel", {
|
|
39
30
|
enumerable: true,
|
|
40
31
|
get: function get() {
|
|
41
32
|
return _index.FeaturesModel;
|
|
42
33
|
}
|
|
43
34
|
});
|
|
44
|
-
|
|
45
35
|
_Object$defineProperty(exports, "config", {
|
|
46
36
|
enumerable: true,
|
|
47
37
|
get: function get() {
|
|
48
38
|
return _config.default;
|
|
49
39
|
}
|
|
50
40
|
});
|
|
51
|
-
|
|
52
41
|
exports.constants = void 0;
|
|
53
|
-
|
|
54
42
|
_Object$defineProperty(exports, "default", {
|
|
55
43
|
enumerable: true,
|
|
56
44
|
get: function get() {
|
|
57
45
|
return _device.default;
|
|
58
46
|
}
|
|
59
47
|
});
|
|
60
|
-
|
|
61
48
|
require("@webex/internal-plugin-metrics");
|
|
62
|
-
|
|
63
49
|
var _webexCore = require("@webex/webex-core");
|
|
64
|
-
|
|
65
50
|
var _device = _interopRequireDefault(require("./device"));
|
|
66
|
-
|
|
67
51
|
var _index = require("./features/index");
|
|
68
|
-
|
|
69
52
|
var _deviceUrl = _interopRequireDefault(require("./interceptors/device-url"));
|
|
70
|
-
|
|
71
53
|
var constants = _interopRequireWildcard(require("./constants"));
|
|
72
|
-
|
|
73
54
|
exports.constants = constants;
|
|
74
|
-
|
|
75
55
|
var _config = _interopRequireDefault(require("./config"));
|
|
76
|
-
|
|
77
56
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
78
|
-
|
|
79
57
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
80
|
-
|
|
81
58
|
// Internal dependencies.
|
|
82
59
|
// Need to import metrics plugin for the devices to send metrics on succes/failure registration
|
|
60
|
+
|
|
83
61
|
// Plugin dependencies.
|
|
62
|
+
|
|
84
63
|
(0, _webexCore.registerInternalPlugin)('device', _device.default, {
|
|
85
64
|
config: _config.default,
|
|
86
65
|
interceptors: {
|
|
87
66
|
DeviceUrlInterceptor: _deviceUrl.default.create
|
|
88
67
|
},
|
|
89
|
-
|
|
90
68
|
/**
|
|
91
69
|
* Unregister the device in the case that the webex instance has logged out.
|
|
92
70
|
*
|
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;AAAyC;AACzC;AAA8B;AAAA;AAV9B;AACA;;AAIA;;AAOA,IAAAA,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,4BAAG;IACf,OAAO,IAAI,CAACC,UAAU,EAAE;EAC1B;AACF,CAAC,CAAC"}
|
|
@@ -1,52 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
|
|
4
|
-
|
|
5
4
|
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
6
|
-
|
|
7
5
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
8
|
-
|
|
9
6
|
_Object$defineProperty(exports, "__esModule", {
|
|
10
7
|
value: true
|
|
11
8
|
});
|
|
12
|
-
|
|
13
9
|
exports.default = void 0;
|
|
14
|
-
|
|
15
10
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
16
|
-
|
|
17
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
18
|
-
|
|
19
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
20
|
-
|
|
21
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
|
|
22
|
-
|
|
23
14
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
|
|
24
|
-
|
|
25
15
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
|
|
26
|
-
|
|
27
16
|
var _set2 = _interopRequireDefault(require("lodash/set"));
|
|
28
|
-
|
|
29
17
|
var _httpCore = require("@webex/http-core");
|
|
30
|
-
|
|
31
18
|
var _constants = require("../constants");
|
|
32
|
-
|
|
33
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); }; }
|
|
34
|
-
|
|
35
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; } }
|
|
36
|
-
|
|
37
21
|
/**
|
|
38
|
-
|
|
39
|
-
|
|
22
|
+
* Adds 'cisco-device-url' header, as appropriate, to requests
|
|
23
|
+
*/
|
|
40
24
|
var DeviceUrlInterceptor = /*#__PURE__*/function (_Interceptor) {
|
|
41
25
|
(0, _inherits2.default)(DeviceUrlInterceptor, _Interceptor);
|
|
42
|
-
|
|
43
26
|
var _super = _createSuper(DeviceUrlInterceptor);
|
|
44
|
-
|
|
45
27
|
function DeviceUrlInterceptor() {
|
|
46
28
|
(0, _classCallCheck2.default)(this, DeviceUrlInterceptor);
|
|
47
29
|
return _super.apply(this, arguments);
|
|
48
30
|
}
|
|
49
|
-
|
|
50
31
|
(0, _createClass2.default)(DeviceUrlInterceptor, [{
|
|
51
32
|
key: "onRequest",
|
|
52
33
|
value:
|
|
@@ -57,39 +38,38 @@ var DeviceUrlInterceptor = /*#__PURE__*/function (_Interceptor) {
|
|
|
57
38
|
*/
|
|
58
39
|
function onRequest(options) {
|
|
59
40
|
var headers = options.headers,
|
|
60
|
-
|
|
61
|
-
|
|
41
|
+
service = options.service,
|
|
42
|
+
uri = options.uri;
|
|
62
43
|
var _this$webex$internal = this.webex.internal,
|
|
63
|
-
|
|
64
|
-
|
|
44
|
+
device = _this$webex$internal.device,
|
|
45
|
+
services = _this$webex$internal.services;
|
|
65
46
|
|
|
47
|
+
// Check if header is already set before moving forward
|
|
66
48
|
if (!device.url || headers && _constants.CISCO_DEVICE_URL in headers && !!headers[_constants.CISCO_DEVICE_URL]) {
|
|
67
49
|
return _promise.default.resolve(options);
|
|
68
|
-
}
|
|
69
|
-
|
|
50
|
+
}
|
|
70
51
|
|
|
52
|
+
// Wait for catalog and service to be defined.
|
|
71
53
|
return services.waitForService({
|
|
72
54
|
service: service,
|
|
73
55
|
url: uri
|
|
74
56
|
}).then(function (url) {
|
|
75
57
|
// Grab the service name with the url returned from waitForService
|
|
76
58
|
var _ref = services.getServiceFromUrl(url) || {},
|
|
77
|
-
|
|
59
|
+
serviceName = _ref.name;
|
|
60
|
+
var invalidServices = ['idbroker', 'oauth', 'saml'];
|
|
78
61
|
|
|
79
|
-
|
|
62
|
+
// Check if service is not one of the invalid services
|
|
80
63
|
// Assign the url to the device header
|
|
81
|
-
|
|
82
64
|
if (serviceName && !invalidServices.includes(serviceName)) {
|
|
83
65
|
(0, _set2.default)(options, "headers['".concat(_constants.CISCO_DEVICE_URL, "']"), device.url);
|
|
84
66
|
}
|
|
85
|
-
|
|
86
67
|
return options;
|
|
87
68
|
}).catch(function (error) {
|
|
88
69
|
// Validate that the error came from getServiceFromUrl
|
|
89
70
|
if (error.message.match(/was not found after waiting/)) {
|
|
90
71
|
return options;
|
|
91
72
|
}
|
|
92
|
-
|
|
93
73
|
return _promise.default.reject(error);
|
|
94
74
|
});
|
|
95
75
|
}
|
|
@@ -108,6 +88,5 @@ var DeviceUrlInterceptor = /*#__PURE__*/function (_Interceptor) {
|
|
|
108
88
|
}]);
|
|
109
89
|
return DeviceUrlInterceptor;
|
|
110
90
|
}(_httpCore.Interceptor);
|
|
111
|
-
|
|
112
91
|
exports.default = DeviceUrlInterceptor;
|
|
113
92
|
//# sourceMappingURL=device-url.js.map
|
|
@@ -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;AAA8C;AAAA;AAE9C;AACA;AACA;AAFA,IAGqBA,oBAAoB;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IASvC;AACF;AACA;AACA;AACA;IACE,mBAAUC,OAAO,EAAE;MACjB,IAAOC,OAAO,GAAkBD,OAAO,CAAhCC,OAAO;QAAEC,OAAO,GAASF,OAAO,CAAvBE,OAAO;QAAEC,GAAG,GAAIH,OAAO,CAAdG,GAAG;MAC5B,2BAA2B,IAAI,CAACC,KAAK,CAACC,QAAQ;QAAvCC,MAAM,wBAANA,MAAM;QAAEC,QAAQ,wBAARA,QAAQ;;MAEvB;MACA,IAAI,CAACD,MAAM,CAACE,GAAG,IAAKP,OAAO,IAAIQ,2BAAgB,IAAIR,OAAO,IAAI,CAAC,CAACA,OAAO,CAACQ,2BAAgB,CAAE,EAAE;QAC1F,OAAO,iBAAQC,OAAO,CAACV,OAAO,CAAC;MACjC;;MAEA;MACA,OAAOO,QAAQ,CACZI,cAAc,CAAC;QAACT,OAAO,EAAPA,OAAO;QAAEM,GAAG,EAAEL;MAAG,CAAC,CAAC,CACnCS,IAAI,CAAC,UAACJ,GAAG,EAAK;QACb;QACA,WAA4BD,QAAQ,CAACM,iBAAiB,CAACL,GAAG,CAAC,IAAI,CAAC,CAAC;UAApDM,WAAW,QAAjBC,IAAI;QACX,IAAMC,eAAe,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC;;QAErD;QACA;QACA,IAAIF,WAAW,IAAI,CAACE,eAAe,CAACC,QAAQ,CAACH,WAAW,CAAC,EAAE;UACzD,mBAAId,OAAO,qBAAcS,2BAAgB,SAAMH,MAAM,CAACE,GAAG,CAAC;QAC5D;QAEA,OAAOR,OAAO;MAChB,CAAC,CAAC,CACDkB,KAAK,CAAC,UAACC,KAAK,EAAK;QAChB;QACA,IAAIA,KAAK,CAACC,OAAO,CAACC,KAAK,CAAC,6BAA6B,CAAC,EAAE;UACtD,OAAOrB,OAAO;QAChB;QAEA,OAAO,iBAAQsB,MAAM,CAACH,KAAK,CAAC;MAC9B,CAAC,CAAC;IACN;EAAC;IAAA;IAAA;IA9CD;AACF;AACA;IACE,kBAAgB;MACd;MACA,OAAO,IAAIpB,oBAAoB,CAAC;QAACK,KAAK,EAAE;MAAI,CAAC,CAAC;IAChD;EAAC;EAAA;AAAA,EAP+CmB,qBAAW;AAAA"}
|
package/dist/metrics.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
-
|
|
5
4
|
_Object$defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
|
|
9
7
|
exports.default = void 0;
|
|
10
8
|
// Metric to do with WDM registration
|
|
11
9
|
var _default = {
|
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;AAAA,eACe;EACbA,kCAAkC,EAAE,oCAAoC;EACxEC,8BAA8B,EAAE;AAClC,CAAC;AAAA"}
|
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.30",
|
|
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.30",
|
|
25
|
+
"@webex/test-helper-mock-webex": "3.0.0-beta.30",
|
|
26
|
+
"@webex/test-helper-test-users": "3.0.0-beta.30",
|
|
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.30",
|
|
33
|
+
"@webex/common-timers": "3.0.0-beta.30",
|
|
34
|
+
"@webex/http-core": "3.0.0-beta.30",
|
|
35
|
+
"@webex/internal-plugin-device": "3.0.0-beta.30",
|
|
36
|
+
"@webex/internal-plugin-metrics": "3.0.0-beta.30",
|
|
37
|
+
"@webex/webex-core": "3.0.0-beta.30",
|
|
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];
|