@esfaenza/extensions 11.2.16 → 11.2.17

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.
@@ -1790,8 +1790,20 @@
1790
1790
  * che generi una chiave univoca di sessione su cui tutte le operazioni di questa classe saranno eseguite
1791
1791
  */
1792
1792
  var BaseStorageProvider = /** @class */ (function () {
1793
- function BaseStorageProvider() {
1793
+ /** @ignore Costruttore */
1794
+ function BaseStorageProvider(session) {
1795
+ this.session = session;
1794
1796
  }
1797
+ /**
1798
+ * Ottiene la chiave "Reale" da utilizzare per la persistenza di una chiave generica
1799
+ *
1800
+ * @param {string} key Chiave da storicizzare
1801
+ *
1802
+ * @returns {string} Unione fra l'identificativo della sessione e la chiave specificata
1803
+ */
1804
+ BaseStorageProvider.prototype.getKey = function (key) {
1805
+ return this.session.getSessionKey() + "§" + key + "§";
1806
+ };
1795
1807
  return BaseStorageProvider;
1796
1808
  }());
1797
1809
 
@@ -1837,7 +1849,7 @@
1837
1849
  }
1838
1850
  else
1839
1851
  finalItem = item;
1840
- return this._storage.setItem(this._session.getSessionKey(), storeName, finalItem).pipe(operators.tap(function (res) {
1852
+ return this._storage.setItem(storeName, finalItem).pipe(operators.tap(function (res) {
1841
1853
  if (res == false) {
1842
1854
  console.error("Impossibile effettuare il salvataggio dell'oggetto all'interno dello Storage Locale per la chiave " + storeName);
1843
1855
  }
@@ -1851,7 +1863,7 @@
1851
1863
  * @returns {any} Oggetto recuperato e deserializzato
1852
1864
  */
1853
1865
  StorageService.prototype.getItem = function (storeName) {
1854
- return this._storage.getItem(this._session.getSessionKey(), storeName).pipe(operators.tap(function (res) {
1866
+ return this._storage.getItem(storeName).pipe(operators.tap(function (res) {
1855
1867
  if (res == null)
1856
1868
  console.warn("Impossibile ottenere l'oggetto salvato con chiave " + storeName);
1857
1869
  }));
@@ -1862,7 +1874,7 @@
1862
1874
  * @param {string} storeName Chiave del localStorage da ripulire
1863
1875
  */
1864
1876
  StorageService.prototype.removeItem = function (storeName) {
1865
- return this._storage.removeItem(this._session.getSessionKey(), storeName).pipe(operators.tap(function (res) {
1877
+ return this._storage.removeItem(storeName).pipe(operators.tap(function (res) {
1866
1878
  if (res == false)
1867
1879
  console.warn("Impossibile rimuovere l'oggetto salvato con chiave " + storeName);
1868
1880
  }));
@@ -1873,7 +1885,7 @@
1873
1885
  * @param {string} storeName Chiave del localStorage da ripulire
1874
1886
  */
1875
1887
  StorageService.prototype.clear = function () {
1876
- return this._storage.clear(this._session.getSessionKey()).pipe(operators.tap(function (res) {
1888
+ return this._storage.clear().pipe(operators.tap(function (res) {
1877
1889
  if (res == false)
1878
1890
  console.warn("Impossibile ripulire lo Storage Locale");
1879
1891
  }));
@@ -1884,7 +1896,7 @@
1884
1896
  * @returns {Observable<{ [index: string]: string; }>} Risultato della query
1885
1897
  */
1886
1898
  StorageService.prototype.getAll = function () {
1887
- return this._storage.getAll(this._session.getSessionKey());
1899
+ return this._storage.getAll();
1888
1900
  };
1889
1901
  return StorageService;
1890
1902
  }());
@@ -2237,12 +2249,12 @@
2237
2249
  /** Implementazione di default per la classe **BaseStorageProvider** */
2238
2250
  var DefaultStorageProvider = /** @class */ (function (_super) {
2239
2251
  __extends(DefaultStorageProvider, _super);
2240
- /** @ignore Costruttore */
2241
- function DefaultStorageProvider() {
2242
- return _super.call(this) || this;
2252
+ /** @ignore Costruttore */
2253
+ function DefaultStorageProvider(session) {
2254
+ return _super.call(this, session) || this;
2243
2255
  }
2244
2256
  /** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
2245
- DefaultStorageProvider.prototype.setItem = function (identity, key, value) {
2257
+ DefaultStorageProvider.prototype.setItem = function (key, value) {
2246
2258
  try {
2247
2259
  localStorage.setItem(key, JSON.stringify(value));
2248
2260
  return rxjs.of(true);
@@ -2267,7 +2279,7 @@
2267
2279
  }
2268
2280
  };
2269
2281
  /** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
2270
- DefaultStorageProvider.prototype.getItem = function (identity, key) {
2282
+ DefaultStorageProvider.prototype.getItem = function (key) {
2271
2283
  try {
2272
2284
  var ret = JSON.parse(localStorage.getItem(key));
2273
2285
  return rxjs.of(ret);
@@ -2277,7 +2289,7 @@
2277
2289
  }
2278
2290
  };
2279
2291
  /** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
2280
- DefaultStorageProvider.prototype.removeItem = function (identity, key) {
2292
+ DefaultStorageProvider.prototype.removeItem = function (key) {
2281
2293
  try {
2282
2294
  localStorage.removeItem(key);
2283
2295
  return rxjs.of(true);
@@ -2287,7 +2299,7 @@
2287
2299
  }
2288
2300
  };
2289
2301
  /** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
2290
- DefaultStorageProvider.prototype.clear = function (identity) {
2302
+ DefaultStorageProvider.prototype.clear = function () {
2291
2303
  try {
2292
2304
  localStorage.clear();
2293
2305
  return rxjs.of(true);
@@ -2297,7 +2309,7 @@
2297
2309
  }
2298
2310
  };
2299
2311
  /** @ignore Implementazione di Default con localStorage. Identity viene ignorata perché essendo già nel localStorage è già per sito */
2300
- DefaultStorageProvider.prototype.getAll = function (identity) {
2312
+ DefaultStorageProvider.prototype.getAll = function () {
2301
2313
  var ret = {};
2302
2314
  for (var key in localStorage) {
2303
2315
  ret[key] = localStorage[key];
@@ -2309,7 +2321,9 @@
2309
2321
  DefaultStorageProvider.decorators = [
2310
2322
  { type: core.Injectable }
2311
2323
  ];
2312
- DefaultStorageProvider.ctorParameters = function () { return []; };
2324
+ DefaultStorageProvider.ctorParameters = function () { return [
2325
+ { type: BaseSessionRetriever }
2326
+ ]; };
2313
2327
 
2314
2328
  // Angular
2315
2329
  /**