ps-toolkit-ui 1.19.70 → 1.19.77

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.
@@ -32,17 +32,23 @@
32
32
  var HighchartsExportData__namespace = /*#__PURE__*/_interopNamespace(HighchartsExportData);
33
33
 
34
34
  var PsToolkitUiConfigService = /** @class */ (function () {
35
- function PsToolkitUiConfigService(environment, strings, currentLang) {
35
+ function PsToolkitUiConfigService(environment, strings, currentLang, authorizationName) {
36
+ if (authorizationName === void 0) { authorizationName = 'Authorization'; }
36
37
  this.environment = environment;
37
38
  this.strings = strings;
38
39
  this.currentLang = currentLang;
40
+ this.authorizationName = authorizationName;
41
+ this.authName = authorizationName;
42
+ PsToolkitUiConfigService.instance = this;
39
43
  }
40
44
  return PsToolkitUiConfigService;
41
45
  }());
46
+ PsToolkitUiConfigService.instance = null;
42
47
  PsToolkitUiConfigService.ctorParameters = function () { return [
43
48
  { type: undefined, decorators: [{ type: core.Inject, args: ['environment',] }] },
44
49
  { type: undefined, decorators: [{ type: core.Inject, args: ['strings',] }] },
45
- { type: String, decorators: [{ type: core.Inject, args: ['currentLang',] }] }
50
+ { type: String, decorators: [{ type: core.Inject, args: ['currentLang',] }] },
51
+ { type: String, decorators: [{ type: core.Inject, args: ['authorizationName',] }] }
46
52
  ]; };
47
53
 
48
54
  var AccordionComponent = /** @class */ (function () {
@@ -1969,10 +1975,18 @@
1969
1975
  RequestClass.prototype.getClient = function (request, url, method, data, done, fail, timeout) {
1970
1976
  var _this = this;
1971
1977
  if (timeout === void 0) { timeout = null; }
1978
+ var _a, _b, _c, _d, _e;
1972
1979
  var token = HelperClass.getCookie('Authorization');
1973
1980
  if (!(data instanceof FormData)) {
1974
1981
  data = HelperClass.jsonToFormData(data);
1975
1982
  }
1983
+ var headers = {};
1984
+ if (token !== null) {
1985
+ var authName = (_b = (_a = PsToolkitUiConfigService.instance) === null || _a === void 0 ? void 0 : _a.authName) !== null && _b !== void 0 ? _b : 'Authorization';
1986
+ console.log('Authorization name is:', (_c = PsToolkitUiConfigService.instance) === null || _c === void 0 ? void 0 : _c.authName);
1987
+ console.log('Authorization name is:', (_d = PsToolkitUiConfigService.instance) === null || _d === void 0 ? void 0 : _d.authorizationName);
1988
+ headers[(_e = PsToolkitUiConfigService.instance) === null || _e === void 0 ? void 0 : _e.authName] = token;
1989
+ }
1976
1990
  var settings = {
1977
1991
  url: (url.includes('https://') || url.includes('http://') ? '' : this.environment.apiUrl) + url,
1978
1992
  method: exports.Method[method].toString(),