@webex/webex-core 1.144.2 → 1.146.1
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/interceptors/redirect.js +2 -0
- package/dist/interceptors/redirect.js.map +1 -1
- package/dist/lib/batcher.js +1 -1
- package/dist/lib/credentials/credentials.js +1 -1
- package/dist/lib/credentials/token.js +1 -1
- package/dist/lib/services/services.js +1 -1
- package/dist/plugins/logger.js +1 -1
- package/dist/webex-core.js +2 -2
- package/package.json +6 -6
- package/src/interceptors/redirect.js +4 -0
|
@@ -104,6 +104,7 @@ var RedirectInterceptor = /*#__PURE__*/function (_Interceptor) {
|
|
|
104
104
|
return this.webex.request(options);
|
|
105
105
|
} else if (response.headers && response.body && response.body.errorCode === LOCUS_REDIRECT_ERROR && response.body.location) {
|
|
106
106
|
options = (0, _clone2.default)(options);
|
|
107
|
+
this.webex.logger.warn('redirect: url redirects needed from', options.uri);
|
|
107
108
|
|
|
108
109
|
if (response.options && response.options.qs) {
|
|
109
110
|
// for POST requests
|
|
@@ -114,6 +115,7 @@ var RedirectInterceptor = /*#__PURE__*/function (_Interceptor) {
|
|
|
114
115
|
options.uri = response.body.location;
|
|
115
116
|
}
|
|
116
117
|
|
|
118
|
+
this.webex.logger.warn('redirect: url redirects needed to', options.uri);
|
|
117
119
|
options.$redirectCount += 1;
|
|
118
120
|
|
|
119
121
|
if (options.$redirectCount > this.webex.config.maxLocusRedirects) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["redirect.js"],"names":["requestHeaderName","responseHeaderName","LOCUS_REDIRECT_ERROR","RedirectInterceptor","options","uri","includes","webex","config","credentials","samlUrl","tokenUrl","authorizeUrl","headers","$redirectCount","response","maxAppLevelRedirects","reject","Error","request","body","errorCode","location","qs","newUrl","split","maxLocusRedirects","Interceptor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;;;;;;AAEA,IAAMA,iBAAiB,GAAG,wBA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AjB,CAAxB,EAA8D;AAC5DG,QAAAA,OAAO,GAAG,qBAAMA,OAAN,CAAV;AACAA,QAAAA,OAAO,CAACC,GAAR,GAAcU,QAAQ,CAACF,OAAT,CAAiBZ,kBAAjB,CAAd;AACAG,QAAAA,OAAO,CAACU,cAAR,IAA0B,CAA1B;;AACA,YAAIV,OAAO,CAACU,cAAR,GAAyB,KAAKP,KAAL,CAAWC,MAAX,CAAkBQ,oBAA/C,EAAqE;AACnE,iBAAO,iBAAQC,MAAR,CAAe,IAAIC,KAAJ,CAAU,4BAAV,CAAf,CAAP;AACD;;AAED,eAAO,KAAKX,KAAL,CAAWY,OAAX,CAAmBf,OAAnB,CAAP;AACD,OATD,MAUK,IAAIW,QAAQ,CAACF,OAAT,IACPE,QAAQ,CAACK,IADF,IAEPL,QAAQ,CAACK,IAAT,CAAcC,SAAd,KAA4BnB,oBAFrB,IAGPa,QAAQ,CAACK,IAAT,CAAcE,QAHX,EAGqB;AACxBlB,QAAAA,OAAO,GAAG,qBAAMA,OAAN,CAAV;;AACA,
|
|
1
|
+
{"version":3,"sources":["redirect.js"],"names":["requestHeaderName","responseHeaderName","LOCUS_REDIRECT_ERROR","RedirectInterceptor","options","uri","includes","webex","config","credentials","samlUrl","tokenUrl","authorizeUrl","headers","$redirectCount","response","maxAppLevelRedirects","reject","Error","request","body","errorCode","location","logger","warn","qs","newUrl","split","maxLocusRedirects","Interceptor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;;;;;;AAEA,IAAMA,iBAAiB,GAAG,wBAA1B;AACA,IAAMC,kBAAkB,GAAG,gBAA3B;AACA,IAAMC,oBAAoB,GAAG,OAA7B;AAEA;AACA;AACA;;IACqBC,mB;;;;;;;;;;;;;AAQnB;AACF;AACA;AACA;AACA;AACE,uBAAUC,OAAV,EAAmB;AACjB,UAAIA,OAAO,IAAIA,OAAO,CAACC,GAAnB,IAA0B,OAAOD,OAAO,CAACC,GAAf,KAAuB,QAArD,EAA+D;AAC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P;AACD;;;;AAnFD;AACF;AACA;AACE,sBAAgB;AACd,aAAO,IAAIZ,mBAAJ,CAAwB;AAACI,QAAAA,KAAK,EAAE;AAAR,OAAxB,CAAP;AACD;;;EAN8CsB,qB","sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {clone} from 'lodash';\nimport {Interceptor} from '@webex/http-core';\n\nconst requestHeaderName = 'cisco-no-http-redirect';\nconst responseHeaderName = 'cisco-location';\nconst LOCUS_REDIRECT_ERROR = 2000002;\n\n/**\n * @class\n */\nexport default class RedirectInterceptor extends Interceptor {\n /**\n * @returns {RedirectInterceptor}\n */\n static create() {\n return new RedirectInterceptor({webex: this});\n }\n\n /**\n * @see Interceptor#onRequest\n * @param {Object} options\n * @returns {Object}\n */\n onRequest(options) {\n if (options && options.uri && typeof options.uri === 'string') {\n if (options.uri.includes('https://idbroker') ||\n options.uri.includes(this.webex.config.credentials.samlUrl) ||\n options.uri.includes(this.webex.config.credentials.tokenUrl) ||\n options.uri.includes(this.webex.config.credentials.authorizeUrl)) {\n return options;\n }\n }\n\n // If cisco-no-http-redirect is already set, don't overwrite it\n if (requestHeaderName in options.headers) {\n // If cisco-no-http-redirect is set to null, false, or undefined, delete\n // it to prevent a CORS preflight.\n if (!options.headers[requestHeaderName]) {\n Reflect.deleteProperty(options.headers, requestHeaderName);\n }\n\n return options;\n }\n options.headers[requestHeaderName] = true;\n options.$redirectCount = options.$redirectCount || 0;\n\n return options;\n }\n\n /**\n * @see Interceptor#onResponse\n * @param {Object} options\n * @param {HttpResponse} response\n * @returns {Object}\n */\n onResponse(options, response) {\n /* eslint-disable no-else-return */\n if (response.headers && response.headers[responseHeaderName]) {\n options = clone(options);\n options.uri = response.headers[responseHeaderName];\n options.$redirectCount += 1;\n if (options.$redirectCount > this.webex.config.maxAppLevelRedirects) {\n return Promise.reject(new Error('Maximum redirects exceeded'));\n }\n\n return this.webex.request(options);\n }\n else if (response.headers &&\n response.body &&\n response.body.errorCode === LOCUS_REDIRECT_ERROR &&\n response.body.location) {\n options = clone(options);\n\n this.webex.logger.warn('redirect: url redirects needed from', options.uri);\n if (response.options && response.options.qs) { // for POST requests\n const newUrl = response.body.location.split('?');\n\n options.uri = newUrl[0]; // params are already present in the qs\n }\n else { // for GET requests\n options.uri = response.body.location;\n }\n\n this.webex.logger.warn('redirect: url redirects needed to', options.uri);\n options.$redirectCount += 1;\n if (options.$redirectCount > this.webex.config.maxLocusRedirects) {\n return Promise.reject(new Error('Maximum redirects exceeded'));\n }\n\n return this.webex.request(options);\n }\n /* eslint-enable no-else-return */\n\n return response;\n }\n}\n"]}
|
package/dist/lib/batcher.js
CHANGED
|
@@ -329,7 +329,7 @@ var Batcher = _webexPlugin.default.extend({
|
|
|
329
329
|
fingerprintResponse: function fingerprintResponse(item) {
|
|
330
330
|
throw new Error('fingerprintResponse() must be implemented');
|
|
331
331
|
},
|
|
332
|
-
version: "1.
|
|
332
|
+
version: "1.146.1"
|
|
333
333
|
});
|
|
334
334
|
|
|
335
335
|
var _default2 = Batcher;
|
|
@@ -590,7 +590,7 @@ var Credentials = _webexPlugin.default.extend((_dec = (0, _common.oneFlight)({
|
|
|
590
590
|
this.refresh();
|
|
591
591
|
}
|
|
592
592
|
},
|
|
593
|
-
version: "1.
|
|
593
|
+
version: "1.146.1"
|
|
594
594
|
}, ((0, _applyDecoratedDescriptor2.default)(_obj, "getUserToken", [_dec, _dec2], (0, _getOwnPropertyDescriptor.default)(_obj, "getUserToken"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "initialize", [_dec3], (0, _getOwnPropertyDescriptor.default)(_obj, "initialize"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "invalidate", [_common.oneFlight, _dec4], (0, _getOwnPropertyDescriptor.default)(_obj, "invalidate"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "refresh", [_common.oneFlight, _dec5, _dec6], (0, _getOwnPropertyDescriptor.default)(_obj, "refresh"), _obj)), _obj)));
|
|
595
595
|
|
|
596
596
|
var _default = Credentials;
|
|
@@ -605,7 +605,7 @@ var Token = _webexPlugin.default.extend((_dec = (0, _common.oneFlight)({
|
|
|
605
605
|
return res.body;
|
|
606
606
|
});
|
|
607
607
|
},
|
|
608
|
-
version: "1.
|
|
608
|
+
version: "1.146.1"
|
|
609
609
|
}, ((0, _applyDecoratedDescriptor2.default)(_obj, "downscope", [_dec], (0, _getOwnPropertyDescriptor.default)(_obj, "downscope"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "refresh", [_common.oneFlight], (0, _getOwnPropertyDescriptor.default)(_obj, "refresh"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "revoke", [_common.oneFlight], (0, _getOwnPropertyDescriptor.default)(_obj, "revoke"), _obj)), _obj)));
|
|
610
610
|
|
|
611
611
|
var _default = Token;
|
package/dist/plugins/logger.js
CHANGED
|
@@ -70,7 +70,7 @@ var Logger = _webexPlugin.default.extend({
|
|
|
70
70
|
info: wrapConsoleMethod('info'),
|
|
71
71
|
debug: wrapConsoleMethod('debug'),
|
|
72
72
|
trace: wrapConsoleMethod('trace'),
|
|
73
|
-
version: "1.
|
|
73
|
+
version: "1.146.1"
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
(0, _webexCore.registerPlugin)('logger', Logger);
|
package/dist/webex-core.js
CHANGED
|
@@ -159,7 +159,7 @@ var MAX_FILE_SIZE_IN_MB = 2048;
|
|
|
159
159
|
*/
|
|
160
160
|
|
|
161
161
|
var WebexCore = _ampersandState.default.extend((_obj = {
|
|
162
|
-
version: "1.
|
|
162
|
+
version: "1.146.1",
|
|
163
163
|
children: {
|
|
164
164
|
internal: _webexInternalCore.default
|
|
165
165
|
},
|
|
@@ -757,7 +757,7 @@ var WebexCore = _ampersandState.default.extend((_obj = {
|
|
|
757
757
|
}
|
|
758
758
|
}, ((0, _applyDecoratedDescriptor2.default)(_obj, "_uploadPhaseUpload", [_common.retry], (0, _getOwnPropertyDescriptor.default)(_obj, "_uploadPhaseUpload"), _obj)), _obj));
|
|
759
759
|
|
|
760
|
-
WebexCore.version = "1.
|
|
760
|
+
WebexCore.version = "1.146.1";
|
|
761
761
|
(0, _webexInternalCorePluginMixin.default)(_webexInternalCore.default, _config.default, interceptors);
|
|
762
762
|
(0, _webexCorePluginMixin.default)(WebexCore, _config.default, interceptors);
|
|
763
763
|
var _default = WebexCore;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/webex-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.146.1",
|
|
4
4
|
"description": "Plugin handling for Cisco Webex",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"contributors": [
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
"@babel/runtime-corejs2": "^7.14.8",
|
|
29
29
|
"lodash": "^4.17.21",
|
|
30
30
|
"ampersand-state": "^5.0.3",
|
|
31
|
-
"@webex/common": "1.
|
|
31
|
+
"@webex/common": "1.146.1",
|
|
32
32
|
"ampersand-events": "^2.0.2",
|
|
33
|
-
"@webex/http-core": "1.
|
|
33
|
+
"@webex/http-core": "1.146.1",
|
|
34
34
|
"uuid": "^3.3.2",
|
|
35
35
|
"jsonwebtoken": "^8.5.1",
|
|
36
|
-
"@webex/common-timers": "1.
|
|
36
|
+
"@webex/common-timers": "1.146.1",
|
|
37
37
|
"ampersand-collection": "^2.0.2",
|
|
38
|
-
"crypto-js": "^
|
|
39
|
-
"@webex/webex-core": "1.
|
|
38
|
+
"crypto-js": "^4.1.1",
|
|
39
|
+
"@webex/webex-core": "1.146.1",
|
|
40
40
|
"core-decorators": "^0.20.0",
|
|
41
41
|
"envify": "^4.1.0"
|
|
42
42
|
}
|
|
@@ -74,6 +74,8 @@ export default class RedirectInterceptor extends Interceptor {
|
|
|
74
74
|
response.body.errorCode === LOCUS_REDIRECT_ERROR &&
|
|
75
75
|
response.body.location) {
|
|
76
76
|
options = clone(options);
|
|
77
|
+
|
|
78
|
+
this.webex.logger.warn('redirect: url redirects needed from', options.uri);
|
|
77
79
|
if (response.options && response.options.qs) { // for POST requests
|
|
78
80
|
const newUrl = response.body.location.split('?');
|
|
79
81
|
|
|
@@ -82,6 +84,8 @@ export default class RedirectInterceptor extends Interceptor {
|
|
|
82
84
|
else { // for GET requests
|
|
83
85
|
options.uri = response.body.location;
|
|
84
86
|
}
|
|
87
|
+
|
|
88
|
+
this.webex.logger.warn('redirect: url redirects needed to', options.uri);
|
|
85
89
|
options.$redirectCount += 1;
|
|
86
90
|
if (options.$redirectCount > this.webex.config.maxLocusRedirects) {
|
|
87
91
|
return Promise.reject(new Error('Maximum redirects exceeded'));
|