@obisey/nest 0.1.17 → 0.1.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obisey/nest",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "NestJS utilities and base classes by Obisey",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -1,4 +1,3 @@
1
- import { Cache } from 'cache-manager';
2
1
  import { createClient } from 'redis';
3
2
  import { Key } from './utils/keyInterface';
4
3
  export declare const redis_on = true;
@@ -51,7 +50,7 @@ export declare function BaseService(modelo: string): {
51
50
  value: any;
52
51
  repository: any;
53
52
  }): Promise<Ctor>;
54
- eliminarCache(items: string[], borrarSSR?: boolean): Promise<boolean[][]>;
53
+ eliminarCache(items: string[], borrarSSR?: boolean): Promise<number[][]>;
55
54
  }>(redis: ReturnType<typeof createClient>, cacheManager: Cache): {
56
55
  readonly redis: ReturnType<typeof createClient>;
57
56
  readonly cacheManager: Cache;
@@ -89,7 +88,7 @@ export declare function BaseService(modelo: string): {
89
88
  value: any;
90
89
  repository: any;
91
90
  }): Promise<Ctor>;
92
- eliminarCache(items: string[], borrarSSR?: boolean): Promise<boolean[][]>;
91
+ eliminarCache(items: string[], borrarSSR?: boolean): Promise<number[][]>;
93
92
  };
94
93
  };
95
94
  export {};
@@ -329,7 +329,7 @@ function BaseService(modelo) {
329
329
  let resultado = await repository.destroy(value);
330
330
  this.redis
331
331
  .keys(`*:${modelo}*`) //Obten todos los keys
332
- .then((keys) => Promise.all(keys.map((key) => this.cacheManager.del(key))));
332
+ .then((keys) => Promise.all(keys.map((key) => this.redis.del(key))));
333
333
  resolve(resultado);
334
334
  }
335
335
  catch (err) {
@@ -390,7 +390,7 @@ function BaseService(modelo) {
390
390
  // );
391
391
  return Promise.all(items.map(async (item) => this.redis
392
392
  .keys(`*${item}*`)
393
- .then((keys) => Promise.all(keys.map((key) => this.cacheManager.del(key))))));
393
+ .then((keys) => Promise.all(keys.map((key) => this.redis.del(key))))));
394
394
  }
395
395
  };
396
396
  }