@obisey/nest 0.1.13 → 0.1.14
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,5 +1,5 @@
|
|
|
1
1
|
import { Cache } from 'cache-manager';
|
|
2
|
-
import {
|
|
2
|
+
import { createClient } from 'redis';
|
|
3
3
|
import { Key } from './utils/keyInterface';
|
|
4
4
|
export declare const redis_on = true;
|
|
5
5
|
type Ctor = new (...a: any[]) => any;
|
|
@@ -15,7 +15,7 @@ interface Peticion {
|
|
|
15
15
|
}
|
|
16
16
|
export declare function BaseService(modelo: string): {
|
|
17
17
|
new <T extends {
|
|
18
|
-
readonly redis:
|
|
18
|
+
readonly redis: ReturnType<typeof createClient>;
|
|
19
19
|
readonly cacheManager: Cache;
|
|
20
20
|
buscarXid<Ctor>({ value: { id, cacheable }, key, Clase, repository, pagina, }: Peticion): Promise<Ctor>;
|
|
21
21
|
buscarTodos<Ctor>({ value, key, Clase, repository, pagina, cacheable, }: Peticion): Promise<Ctor[]>;
|
|
@@ -52,8 +52,8 @@ export declare function BaseService(modelo: string): {
|
|
|
52
52
|
repository: any;
|
|
53
53
|
}): Promise<Ctor>;
|
|
54
54
|
eliminarCache(items: string[], borrarSSR?: boolean): Promise<boolean[][]>;
|
|
55
|
-
}>(redis:
|
|
56
|
-
readonly redis:
|
|
55
|
+
}>(redis: ReturnType<typeof createClient>, cacheManager: Cache): {
|
|
56
|
+
readonly redis: ReturnType<typeof createClient>;
|
|
57
57
|
readonly cacheManager: Cache;
|
|
58
58
|
buscarXid<Ctor>({ value: { id, cacheable }, key, Clase, repository, pagina, }: Peticion): Promise<Ctor>;
|
|
59
59
|
buscarTodos<Ctor>({ value, key, Clase, repository, pagina, cacheable, }: Peticion): Promise<Ctor[]>;
|
|
@@ -33,8 +33,7 @@ var stringifyInclude = ({ where, as, include }) => ({
|
|
|
33
33
|
});
|
|
34
34
|
function BaseService(modelo) {
|
|
35
35
|
return class BaseService {
|
|
36
|
-
constructor(redis,
|
|
37
|
-
cacheManager) {
|
|
36
|
+
constructor(redis, cacheManager) {
|
|
38
37
|
this.redis = redis;
|
|
39
38
|
this.cacheManager = cacheManager;
|
|
40
39
|
}
|