@webex/internal-plugin-device 2.4.1 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/device.js
CHANGED
|
@@ -772,7 +772,7 @@ var Device = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)(
|
|
|
772
772
|
}
|
|
773
773
|
/* eslint-enable require-jsdoc */
|
|
774
774
|
,
|
|
775
|
-
version: "2.4.
|
|
775
|
+
version: "2.4.2"
|
|
776
776
|
}, ((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)));
|
|
777
777
|
|
|
778
778
|
var _default = Device;
|
|
@@ -63,7 +63,7 @@ var DeviceUrlInterceptor = /*#__PURE__*/function (_Interceptor) {
|
|
|
63
63
|
device = _this$webex$internal.device,
|
|
64
64
|
services = _this$webex$internal.services; // Check if header is already set before moving forward
|
|
65
65
|
|
|
66
|
-
if (!device.url || headers && _constants.CISCO_DEVICE_URL in headers &&
|
|
66
|
+
if (!device.url || headers && _constants.CISCO_DEVICE_URL in headers && !!headers[_constants.CISCO_DEVICE_URL]) {
|
|
67
67
|
return _promise.default.resolve(options);
|
|
68
68
|
} // Wait for catalog and service to be defined.
|
|
69
69
|
|
|
@@ -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 * 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 (\n !device.url ||\n (headers && CISCO_DEVICE_URL in headers &&
|
|
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 (\n !device.url ||\n (headers && CISCO_DEVICE_URL in headers && !!headers[CISCO_DEVICE_URL])\n ) {\n return Promise.resolve(options);\n }\n\n // Wait for catalog and service to be defined.\n return services.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,IACE,CAACD,MAAM,CAACE,GAAR,IACCP,OAAO,IAAIQ,+BAAoBR,OAA/B,IAA0C,CAAC,CAACA,OAAO,CAACQ,2BAAD,CAFtD,EAGE;QACA,OAAO,iBAAQC,OAAR,CAAgBV,OAAhB,CAAP;MACD,CAVgB,CAYjB;;;MACA,OAAOO,QAAQ,CAACI,cAAT,CAAwB;QAACT,OAAO,EAAPA,OAAD;QAAUM,GAAG,EAAEL;MAAf,CAAxB,EACJS,IADI,CACC,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,CAbI,EAcJkB,KAdI,CAcE,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,CArBI,CAAP;IAsBD;;;;IAhDD;AACF;AACA;IACE,kBAAgB;MACd;MACA,OAAO,IAAIpB,oBAAJ,CAAyB;QAACK,KAAK,EAAE;MAAR,CAAzB,CAAP;IACD;;;EAP+CmB,qB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/internal-plugin-device",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Timothy Scheuering <timsch@cisco.com>",
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@babel/runtime-corejs2": "^7.14.8",
|
|
20
|
-
"@webex/internal-plugin-metrics": "2.4.
|
|
21
|
-
"@webex/webex-core": "2.4.
|
|
22
|
-
"@webex/common": "2.4.
|
|
23
|
-
"@webex/common-timers": "2.4.
|
|
20
|
+
"@webex/internal-plugin-metrics": "2.4.2",
|
|
21
|
+
"@webex/webex-core": "2.4.2",
|
|
22
|
+
"@webex/common": "2.4.2",
|
|
23
|
+
"@webex/common-timers": "2.4.2",
|
|
24
24
|
"ampersand-state": "^5.0.3",
|
|
25
25
|
"ampersand-collection": "^2.0.2",
|
|
26
26
|
"lodash": "^4.17.21",
|
|
27
|
-
"@webex/http-core": "2.4.
|
|
27
|
+
"@webex/http-core": "2.4.2",
|
|
28
28
|
"envify": "^4.1.0"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -31,7 +31,7 @@ export default class DeviceUrlInterceptor extends Interceptor {
|
|
|
31
31
|
// Check if header is already set before moving forward
|
|
32
32
|
if (
|
|
33
33
|
!device.url ||
|
|
34
|
-
(headers && CISCO_DEVICE_URL in headers &&
|
|
34
|
+
(headers && CISCO_DEVICE_URL in headers && !!headers[CISCO_DEVICE_URL])
|
|
35
35
|
) {
|
|
36
36
|
return Promise.resolve(options);
|
|
37
37
|
}
|