@esfaenza/httpservice 11.2.39 → 11.2.42

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common/http'), require('@angular/core'), require('@esfaenza/preferences'), require('rxjs/operators'), require('rxjs')) :
3
- typeof define === 'function' && define.amd ? define('@esfaenza/httpservice', ['exports', '@angular/common/http', '@angular/core', '@esfaenza/preferences', 'rxjs/operators', 'rxjs'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.esfaenza = global.esfaenza || {}, global.esfaenza.httpservice = {}), global.ng.common.http, global.ng.core, global.preferences, global.rxjs.operators, global.rxjs));
5
- })(this, (function (exports, http, core, preferences, operators, rxjs) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common/http'), require('@angular/core'), require('@esfaenza/preferences'), require('@esfaenza/extensions'), require('rxjs/operators'), require('rxjs')) :
3
+ typeof define === 'function' && define.amd ? define('@esfaenza/httpservice', ['exports', '@angular/common/http', '@angular/core', '@esfaenza/preferences', '@esfaenza/extensions', 'rxjs/operators', 'rxjs'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.esfaenza = global.esfaenza || {}, global.esfaenza.httpservice = {}), global.ng.common.http, global.ng.core, global.preferences, global.extensions, global.rxjs.operators, global.rxjs));
5
+ })(this, (function (exports, http, core, preferences, extensions, operators, rxjs) { 'use strict';
6
6
 
7
7
  /*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
@@ -471,7 +471,7 @@
471
471
  /**
472
472
  * @ignore
473
473
  */
474
- function HTTPService(BACKEND_URL, EXTENSION_CLASS, HTTP_INVALIDATION, LOCALE, APP_NAME, CLIENT_CACHE_DURATION_S, CACHE_BY_USER, DEBUG_MODE, http, localStorage) {
474
+ function HTTPService(BACKEND_URL, EXTENSION_CLASS, HTTP_INVALIDATION, LOCALE, APP_NAME, CLIENT_CACHE_DURATION_S, CACHE_BY_USER, DEBUG_MODE, http, localStorage, utisExts) {
475
475
  var _a, _b;
476
476
  this.BACKEND_URL = BACKEND_URL;
477
477
  this.EXTENSION_CLASS = EXTENSION_CLASS;
@@ -483,6 +483,7 @@
483
483
  this.DEBUG_MODE = DEBUG_MODE;
484
484
  this.http = http;
485
485
  this.localStorage = localStorage;
486
+ this.utisExts = utisExts;
486
487
  /** Cache dello stato delle chiamate HTTP attualmente effettuate. Ogni chiamata è rappresentata da un GUID e lo status assume valore **false** solo sugli errori */
487
488
  this.callStatus = {};
488
489
  /** Nome della cache in cui vengono storicizzate le informazioni sulle risposte delle chiamate sotto forma di dictionary */
@@ -1140,7 +1141,7 @@
1140
1141
  * @returns {CacheInfos} Oggetto contenente le informazioni sulla cache per l'oggetto specificato
1141
1142
  */
1142
1143
  HTTPService.prototype.tryGetCacheInformations = function (url, params) {
1143
- var cachingKey = null, cacheTime = null, cache = null, item = null;
1144
+ var cachingKey = null, cacheTime = null, item = null;
1144
1145
  var useCaching = !!(/#cache/gi.exec(url));
1145
1146
  if (useCaching) {
1146
1147
  var tmp = /#cache(:?-(\d+))/gi.exec(url);
@@ -1151,16 +1152,17 @@
1151
1152
  cachingKey = this.makeCacheKey(url, params);
1152
1153
  var cacheKey = cacheTime ? this.localStorageHttpTimedCacheKey : this.localStorageHttpCacheKey;
1153
1154
  var cacheLs = this.localStorage.getLocalItem(cacheKey);
1154
- var cache_1 = cacheLs ? cacheLs : {};
1155
- if (cache_1 && cache_1[cachingKey] && !this.timedCacheItemExpired(cache_1[cachingKey])) {
1155
+ var cache = cacheLs ? cacheLs : {};
1156
+ if (cache && cache[cachingKey] && !this.timedCacheItemExpired(cache[cachingKey])) {
1156
1157
  // Se gestisco il tempo esatto della cache prima di restituire l'oggetto cachato lo ripulisco
1157
1158
  // dalle proprietà interne che gli ho aggiunto per controllarne la scadenza
1158
1159
  if (cacheTime)
1159
- delete cache_1[cachingKey].__expire;
1160
- item = cache_1[cachingKey];
1160
+ delete cache[cachingKey].__expire;
1161
+ item = cache[cachingKey];
1161
1162
  }
1162
1163
  }
1163
- return new CacheInfos(url, useCaching, cachingKey, cacheTime, item);
1164
+ // Per assicurarmi che il rifeirmento degli oggetti sia diverso utilizzo il deepClone
1165
+ return new CacheInfos(url, useCaching, cachingKey, cacheTime, this.utisExts.deepClone(item));
1164
1166
  };
1165
1167
  /**
1166
1168
  * Inserisce un oggetto nella cache appropriata in base alle informazioni contenute nel parametro **cacheInfos**
@@ -1290,7 +1292,8 @@
1290
1292
  { type: Boolean, decorators: [{ type: core.Optional }, { type: core.Inject, args: [CACHE_BY_USER,] }] },
1291
1293
  { type: Boolean, decorators: [{ type: core.Optional }, { type: core.Inject, args: [DEBUG_MODE,] }] },
1292
1294
  { type: http.HttpClient },
1293
- { type: preferences.PreferencesService }
1295
+ { type: preferences.PreferencesService },
1296
+ { type: extensions.UtilityService }
1294
1297
  ]; };
1295
1298
 
1296
1299
  var HttpserviceModule = /** @class */ (function () {