ps-toolkit-ui 1.19.70 → 1.19.79
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/bundles/ps-toolkit-ui.umd.js +22 -2
- package/bundles/ps-toolkit-ui.umd.js.map +1 -1
- package/bundles/ps-toolkit-ui.umd.min.js +1 -1
- package/bundles/ps-toolkit-ui.umd.min.js.map +1 -1
- package/esm2015/lib/classes/request.class.js +9 -1
- package/esm2015/lib/services/config.service.js +12 -3
- package/fesm2015/ps-toolkit-ui.js +18 -2
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/lib/services/config.service.d.ts +6 -1
- package/package.json +1 -1
- package/ps-toolkit-ui.metadata.json +1 -1
|
@@ -31,18 +31,31 @@
|
|
|
31
31
|
var HighchartsExporting__namespace = /*#__PURE__*/_interopNamespace(HighchartsExporting);
|
|
32
32
|
var HighchartsExportData__namespace = /*#__PURE__*/_interopNamespace(HighchartsExportData);
|
|
33
33
|
|
|
34
|
+
var Config = /** @class */ (function () {
|
|
35
|
+
function Config() {
|
|
36
|
+
}
|
|
37
|
+
return Config;
|
|
38
|
+
}());
|
|
39
|
+
Config.authName = 'Authorization';
|
|
34
40
|
var PsToolkitUiConfigService = /** @class */ (function () {
|
|
35
|
-
function PsToolkitUiConfigService(environment, strings, currentLang) {
|
|
41
|
+
function PsToolkitUiConfigService(environment, strings, currentLang, authorizationName) {
|
|
42
|
+
if (authorizationName === void 0) { authorizationName = 'Authorization'; }
|
|
36
43
|
this.environment = environment;
|
|
37
44
|
this.strings = strings;
|
|
38
45
|
this.currentLang = currentLang;
|
|
46
|
+
this.authorizationName = authorizationName;
|
|
47
|
+
console.log('authorizationName', authorizationName);
|
|
48
|
+
Config.authName = authorizationName;
|
|
49
|
+
PsToolkitUiConfigService.instance = this;
|
|
39
50
|
}
|
|
40
51
|
return PsToolkitUiConfigService;
|
|
41
52
|
}());
|
|
53
|
+
PsToolkitUiConfigService.instance = null;
|
|
42
54
|
PsToolkitUiConfigService.ctorParameters = function () { return [
|
|
43
55
|
{ type: undefined, decorators: [{ type: core.Inject, args: ['environment',] }] },
|
|
44
56
|
{ type: undefined, decorators: [{ type: core.Inject, args: ['strings',] }] },
|
|
45
|
-
{ type: String, decorators: [{ type: core.Inject, args: ['currentLang',] }] }
|
|
57
|
+
{ type: String, decorators: [{ type: core.Inject, args: ['currentLang',] }] },
|
|
58
|
+
{ type: String, decorators: [{ type: core.Inject, args: ['authorizationName',] }] }
|
|
46
59
|
]; };
|
|
47
60
|
|
|
48
61
|
var AccordionComponent = /** @class */ (function () {
|
|
@@ -1969,10 +1982,17 @@
|
|
|
1969
1982
|
RequestClass.prototype.getClient = function (request, url, method, data, done, fail, timeout) {
|
|
1970
1983
|
var _this = this;
|
|
1971
1984
|
if (timeout === void 0) { timeout = null; }
|
|
1985
|
+
var _a;
|
|
1972
1986
|
var token = HelperClass.getCookie('Authorization');
|
|
1973
1987
|
if (!(data instanceof FormData)) {
|
|
1974
1988
|
data = HelperClass.jsonToFormData(data);
|
|
1975
1989
|
}
|
|
1990
|
+
var headers = {};
|
|
1991
|
+
if (token !== null) {
|
|
1992
|
+
var authName = (_a = Config.authName) !== null && _a !== void 0 ? _a : 'Authorization';
|
|
1993
|
+
console.log('Authorization name is:', Config.authName);
|
|
1994
|
+
headers[Config.authName] = token;
|
|
1995
|
+
}
|
|
1976
1996
|
var settings = {
|
|
1977
1997
|
url: (url.includes('https://') || url.includes('http://') ? '' : this.environment.apiUrl) + url,
|
|
1978
1998
|
method: exports.Method[method].toString(),
|