ts-cache-mongoose 0.0.1 → 0.0.3
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/README.md +59 -3
- package/dist/cjs/cache/Cache.js +17 -12
- package/dist/cjs/cache/Cache.js.map +1 -1
- package/dist/cjs/cache/engine/MemoryCacheEngine.js +3 -0
- package/dist/cjs/cache/engine/MemoryCacheEngine.js.map +1 -1
- package/dist/cjs/cache/engine/RedisCacheEngine.js +8 -2
- package/dist/cjs/cache/engine/RedisCacheEngine.js.map +1 -1
- package/dist/cjs/interfaces/{ICacheMongooseOptions.js → ICacheOptions.js} +1 -1
- package/dist/cjs/interfaces/ICacheOptions.js.map +1 -0
- package/dist/cjs/plugin.js +13 -9
- package/dist/cjs/plugin.js.map +1 -1
- package/dist/cjs/types/cache/Cache.d.ts +7 -5
- package/dist/cjs/types/cache/Cache.d.ts.map +1 -1
- package/dist/cjs/types/cache/engine/MemoryCacheEngine.d.ts +1 -0
- package/dist/cjs/types/cache/engine/MemoryCacheEngine.d.ts.map +1 -1
- package/dist/cjs/types/cache/engine/RedisCacheEngine.d.ts +3 -1
- package/dist/cjs/types/cache/engine/RedisCacheEngine.d.ts.map +1 -1
- package/dist/cjs/types/interfaces/ICacheEngine.d.ts +1 -0
- package/dist/cjs/types/interfaces/ICacheEngine.d.ts.map +1 -1
- package/dist/cjs/types/interfaces/ICacheOptions.d.ts +8 -0
- package/dist/cjs/types/interfaces/ICacheOptions.d.ts.map +1 -0
- package/dist/cjs/types/plugin.d.ts +8 -6
- package/dist/cjs/types/plugin.d.ts.map +1 -1
- package/dist/esm/cache/Cache.js +17 -11
- package/dist/esm/cache/Cache.js.map +1 -1
- package/dist/esm/cache/engine/MemoryCacheEngine.js +3 -0
- package/dist/esm/cache/engine/MemoryCacheEngine.js.map +1 -1
- package/dist/esm/cache/engine/RedisCacheEngine.js +8 -2
- package/dist/esm/cache/engine/RedisCacheEngine.js.map +1 -1
- package/dist/esm/interfaces/ICacheOptions.js +2 -0
- package/dist/esm/interfaces/ICacheOptions.js.map +1 -0
- package/dist/esm/plugin.js.map +1 -1
- package/dist/esm/plugin.mjs +13 -9
- package/dist/esm/types/cache/Cache.d.ts +7 -5
- package/dist/esm/types/cache/Cache.d.ts.map +1 -1
- package/dist/esm/types/cache/engine/MemoryCacheEngine.d.ts +1 -0
- package/dist/esm/types/cache/engine/MemoryCacheEngine.d.ts.map +1 -1
- package/dist/esm/types/cache/engine/RedisCacheEngine.d.ts +3 -1
- package/dist/esm/types/cache/engine/RedisCacheEngine.d.ts.map +1 -1
- package/dist/esm/types/interfaces/ICacheEngine.d.ts +1 -0
- package/dist/esm/types/interfaces/ICacheEngine.d.ts.map +1 -1
- package/dist/esm/types/interfaces/ICacheOptions.d.ts +8 -0
- package/dist/esm/types/interfaces/ICacheOptions.d.ts.map +1 -0
- package/dist/esm/types/plugin.d.ts +8 -6
- package/dist/esm/types/plugin.d.ts.map +1 -1
- package/package.json +6 -7
- package/src/cache/Cache.ts +24 -14
- package/src/cache/engine/MemoryCacheEngine.ts +5 -0
- package/src/cache/engine/RedisCacheEngine.ts +10 -4
- package/src/interfaces/ICacheEngine.ts +1 -0
- package/src/interfaces/ICacheOptions.ts +9 -0
- package/src/plugin.ts +19 -13
- package/tests/cache-options.test.ts +80 -0
- package/tests/cache.test.ts +112 -15
- package/dist/cjs/interfaces/ICacheMongooseOptions.js.map +0 -1
- package/dist/cjs/types/interfaces/ICacheMongooseOptions.d.ts +0 -10
- package/dist/cjs/types/interfaces/ICacheMongooseOptions.d.ts.map +0 -1
- package/dist/esm/interfaces/ICacheMongooseOptions.js +0 -2
- package/dist/esm/interfaces/ICacheMongooseOptions.js.map +0 -1
- package/dist/esm/types/interfaces/ICacheMongooseOptions.d.ts +0 -10
- package/dist/esm/types/interfaces/ICacheMongooseOptions.d.ts.map +0 -1
- package/src/interfaces/ICacheMongooseOptions.ts +0 -10
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
declare class
|
|
1
|
+
import type ICacheOptions from '../interfaces/ICacheOptions';
|
|
2
|
+
declare class CacheEngine {
|
|
3
3
|
private engine;
|
|
4
4
|
private defaultTTL;
|
|
5
|
-
|
|
5
|
+
private readonly engines;
|
|
6
|
+
constructor(cacheOptions: ICacheOptions);
|
|
6
7
|
get(key: string): Promise<Record<string, unknown> | Record<string, unknown>[] | undefined>;
|
|
7
|
-
set(key: string, value: Record<string, unknown> | Record<string, unknown>[], ttl?:
|
|
8
|
+
set(key: string, value: Record<string, unknown> | Record<string, unknown>[], ttl?: string): Promise<void>;
|
|
8
9
|
del(key: string): Promise<void>;
|
|
9
10
|
clear(): Promise<void>;
|
|
11
|
+
close(): Promise<void>;
|
|
10
12
|
}
|
|
11
|
-
export default
|
|
13
|
+
export default CacheEngine;
|
|
12
14
|
//# sourceMappingURL=Cache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cache.d.ts","sourceRoot":"","sources":["../../../../src/cache/Cache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Cache.d.ts","sourceRoot":"","sources":["../../../../src/cache/Cache.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,aAAa,MAAM,6BAA6B,CAAA;AAK5D,cAAM,WAAW;IACf,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,UAAU,CAAQ;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;gBAE1C,YAAY,EAAE,aAAa;IAoBlC,GAAG,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC;IAI3F,GAAG,CAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK1G,GAAG,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhC,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;IAIvB,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;CAG9B;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -6,6 +6,7 @@ declare class MemoryCacheEngine implements ICacheEngine {
|
|
|
6
6
|
set(key: string, value: Record<string, unknown> | Record<string, unknown>[], ttl?: number): void;
|
|
7
7
|
del(key: string): void;
|
|
8
8
|
clear(): void;
|
|
9
|
+
close(): void;
|
|
9
10
|
}
|
|
10
11
|
export default MemoryCacheEngine;
|
|
11
12
|
//# sourceMappingURL=MemoryCacheEngine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemoryCacheEngine.d.ts","sourceRoot":"","sources":["../../../../../src/cache/engine/MemoryCacheEngine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAA;AAE7D,cAAM,iBAAkB,YAAW,YAAY;IAC7C,OAAO,CAAC,KAAK,CAA+G;;IAM5H,GAAG,CAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,SAAS;
|
|
1
|
+
{"version":3,"file":"MemoryCacheEngine.d.ts","sourceRoot":"","sources":["../../../../../src/cache/engine/MemoryCacheEngine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAA;AAE7D,cAAM,iBAAkB,YAAW,YAAY;IAC7C,OAAO,CAAC,KAAK,CAA+G;;IAM5H,GAAG,CAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,SAAS;IASlF,GAAG,CAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,SAAW,GAAG,IAAI;IAInG,GAAG,CAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAKvB,KAAK,IAAK,IAAI;IAId,KAAK,IAAK,IAAI;CAGf;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import type { RedisOptions } from 'ioredis';
|
|
1
2
|
import type ICacheEngine from '../../interfaces/ICacheEngine';
|
|
2
3
|
declare class RedisCacheEngine implements ICacheEngine {
|
|
3
4
|
private client;
|
|
4
|
-
constructor();
|
|
5
|
+
constructor(options: RedisOptions);
|
|
5
6
|
get(key: string): Promise<Record<string, unknown> | Record<string, unknown>[] | undefined>;
|
|
6
7
|
set(key: string, value: unknown, ttl?: number): Promise<void>;
|
|
7
8
|
del(key: string): Promise<void>;
|
|
8
9
|
clear(): Promise<void>;
|
|
10
|
+
close(): Promise<void>;
|
|
9
11
|
}
|
|
10
12
|
export default RedisCacheEngine;
|
|
11
13
|
//# sourceMappingURL=RedisCacheEngine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedisCacheEngine.d.ts","sourceRoot":"","sources":["../../../../../src/cache/engine/RedisCacheEngine.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RedisCacheEngine.d.ts","sourceRoot":"","sources":["../../../../../src/cache/engine/RedisCacheEngine.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAS,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAA;AAE7D,cAAM,gBAAiB,YAAW,YAAY;IAC5C,OAAO,CAAC,MAAM,CAAO;gBAER,OAAO,EAAE,YAAY;IAO5B,GAAG,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC;IAQ3F,GAAG,CAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,SAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAKhE,GAAG,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhC,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;IAIvB,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;CAG9B;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -3,6 +3,7 @@ interface ICacheEngine {
|
|
|
3
3
|
set: (key: string, value: Record<string, unknown> | Record<string, unknown>[], ttl?: number) => Promise<void> | void;
|
|
4
4
|
del: (key: string) => Promise<void> | void;
|
|
5
5
|
clear: () => Promise<void> | void;
|
|
6
|
+
close: () => Promise<void> | void;
|
|
6
7
|
}
|
|
7
8
|
export default ICacheEngine;
|
|
8
9
|
//# sourceMappingURL=ICacheEngine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ICacheEngine.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/ICacheEngine.ts"],"names":[],"mappings":"AAAA,UAAU,YAAY;IACpB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,SAAS,CAAA;IAChK,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IACpH,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAC1C,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;CAClC;AAED,eAAe,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"ICacheEngine.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/ICacheEngine.ts"],"names":[],"mappings":"AAAA,UAAU,YAAY;IACpB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,SAAS,CAAA;IAChK,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IACpH,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAC1C,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IACjC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;CAClC;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ICacheOptions.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/ICacheOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C,UAAU,aAAa;IACrB,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Mongoose } from 'mongoose';
|
|
2
|
-
import type
|
|
2
|
+
import type ICacheOptions from './interfaces/ICacheOptions';
|
|
3
3
|
declare module 'mongoose' {
|
|
4
4
|
interface Query<ResultType, DocType, THelpers, RawDocType> {
|
|
5
|
-
cache: (this: Query<ResultType, DocType, THelpers, RawDocType>, ttl?: string) => this;
|
|
5
|
+
cache: (this: Query<ResultType, DocType, THelpers, RawDocType>, ttl?: string, customKey?: string) => this;
|
|
6
6
|
_key?: string;
|
|
7
7
|
getCacheKey: (this: Query<ResultType, DocType, THelpers, RawDocType>) => string;
|
|
8
|
-
_ttl
|
|
9
|
-
getCacheTTL: (this: Query<ResultType, DocType, THelpers, RawDocType>) =>
|
|
8
|
+
_ttl?: string;
|
|
9
|
+
getCacheTTL: (this: Query<ResultType, DocType, THelpers, RawDocType>) => string | undefined;
|
|
10
10
|
op?: string;
|
|
11
11
|
_fields?: unknown;
|
|
12
12
|
_path?: unknown;
|
|
@@ -16,9 +16,11 @@ declare module 'mongoose' {
|
|
|
16
16
|
declare class CacheMongoose {
|
|
17
17
|
private static instance;
|
|
18
18
|
private cache;
|
|
19
|
+
private cacheOptions;
|
|
19
20
|
private constructor();
|
|
20
|
-
static init(mongoose: Mongoose,
|
|
21
|
-
|
|
21
|
+
static init(mongoose: Mongoose, cacheOptions: ICacheOptions): CacheMongoose;
|
|
22
|
+
clear(customKey?: string): Promise<void>;
|
|
23
|
+
close(): Promise<void>;
|
|
22
24
|
}
|
|
23
25
|
export default CacheMongoose;
|
|
24
26
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,KAAK,aAAa,MAAM,4BAA4B,CAAA;AAG3D,OAAO,QAAQ,UAAU,CAAC;IACxB,UAAU,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU;QACvD,KAAK,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;QACzG,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,WAAW,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,KAAK,MAAM,CAAA;QAC/E,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,WAAW,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,KAAK,MAAM,GAAG,SAAS,CAAA;QAC3F,EAAE,CAAC,EAAE,MAAM,CAAA;QACX,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,KAAK,CAAC,EAAE,OAAO,CAAA;QACf,SAAS,CAAC,EAAE,OAAO,CAAA;KACpB;CACF;AAED,cAAM,aAAa;IAEjB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA2B;IAClD,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,YAAY,CAAgB;IAEpC,OAAO;WAKO,IAAI,CAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,GAAG,aAAa;IAiFtE,KAAK,CAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOzC,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;CAKrC;AAED,eAAe,aAAa,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-cache-mongoose",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Cache plugin for mongoose",
|
|
5
5
|
"author": "Alex Eagle",
|
|
6
6
|
"license": "MIT",
|
|
@@ -80,16 +80,16 @@
|
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@shelf/jest-mongodb": "4.1.7",
|
|
82
82
|
"@swc/cli": "0.1.62",
|
|
83
|
-
"@swc/core": "1.3.
|
|
84
|
-
"@swc/helpers": "0.5.
|
|
83
|
+
"@swc/core": "1.3.55",
|
|
84
|
+
"@swc/helpers": "0.5.1",
|
|
85
85
|
"@swc/jest": "0.2.26",
|
|
86
86
|
"@swc/register": "0.1.10",
|
|
87
87
|
"@types/jest": "29.5.1",
|
|
88
88
|
"@types/lodash": "4.14.194",
|
|
89
89
|
"@types/ms": "^0.7.31",
|
|
90
|
-
"@types/node": "18.16.
|
|
91
|
-
"@typescript-eslint/eslint-plugin": "5.59.
|
|
92
|
-
"@typescript-eslint/parser": "5.59.
|
|
90
|
+
"@types/node": "18.16.1",
|
|
91
|
+
"@typescript-eslint/eslint-plugin": "5.59.1",
|
|
92
|
+
"@typescript-eslint/parser": "5.59.1",
|
|
93
93
|
"eslint": "8.39.0",
|
|
94
94
|
"eslint-config-standard": "17.0.0",
|
|
95
95
|
"eslint-plugin-import": "2.27.5",
|
|
@@ -103,7 +103,6 @@
|
|
|
103
103
|
"merge": "2.1.1",
|
|
104
104
|
"mongoose": "6.10.5",
|
|
105
105
|
"open-cli": "7.2.0",
|
|
106
|
-
"ts-node": "10.9.1",
|
|
107
106
|
"typescript": "5.0.4"
|
|
108
107
|
},
|
|
109
108
|
"peerDependencies": {
|
package/src/cache/Cache.ts
CHANGED
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
import ms from 'ms'
|
|
2
2
|
|
|
3
3
|
import type ICacheEngine from '../interfaces/ICacheEngine'
|
|
4
|
+
import type ICacheOptions from '../interfaces/ICacheOptions'
|
|
4
5
|
|
|
5
6
|
import MemoryCacheEngine from './engine/MemoryCacheEngine'
|
|
6
7
|
import RedisCacheEngine from './engine/RedisCacheEngine'
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class Cache {
|
|
11
|
-
private engine: ICacheEngine
|
|
9
|
+
class CacheEngine {
|
|
10
|
+
private engine!: ICacheEngine
|
|
12
11
|
private defaultTTL: number
|
|
12
|
+
private readonly engines = ['memory', 'redis'] as const
|
|
13
|
+
|
|
14
|
+
constructor (cacheOptions: ICacheOptions) {
|
|
15
|
+
if (!this.engines.includes(cacheOptions.engine)) {
|
|
16
|
+
throw new Error(`Invalid engine name: ${cacheOptions.engine}`)
|
|
17
|
+
}
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
throw new Error(`Invalid engine name: ${engineName}`)
|
|
19
|
+
if (cacheOptions.engine === 'redis' && !cacheOptions.engineOptions) {
|
|
20
|
+
throw new Error(`Engine options are required for ${cacheOptions.engine} engine`)
|
|
17
21
|
}
|
|
18
22
|
|
|
19
|
-
this.defaultTTL = ms(defaultTTL)
|
|
23
|
+
this.defaultTTL = ms(cacheOptions.defaultTTL ?? '1 minute')
|
|
20
24
|
|
|
21
|
-
if (
|
|
22
|
-
this.engine = new RedisCacheEngine()
|
|
23
|
-
}
|
|
25
|
+
if (cacheOptions.engine === 'redis' && cacheOptions.engineOptions) {
|
|
26
|
+
this.engine = new RedisCacheEngine(cacheOptions.engineOptions)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (cacheOptions.engine === 'memory') {
|
|
24
30
|
this.engine = new MemoryCacheEngine()
|
|
25
31
|
}
|
|
26
32
|
}
|
|
@@ -29,8 +35,8 @@ class Cache {
|
|
|
29
35
|
return await this.engine.get(key)
|
|
30
36
|
}
|
|
31
37
|
|
|
32
|
-
async set (key: string, value: Record<string, unknown> | Record<string, unknown>[], ttl?:
|
|
33
|
-
const actualTTL = ttl
|
|
38
|
+
async set (key: string, value: Record<string, unknown> | Record<string, unknown>[], ttl?: string): Promise<void> {
|
|
39
|
+
const actualTTL = ttl ? ms(ttl) : this.defaultTTL
|
|
34
40
|
return await this.engine.set(key, value, actualTTL)
|
|
35
41
|
}
|
|
36
42
|
|
|
@@ -41,6 +47,10 @@ class Cache {
|
|
|
41
47
|
async clear (): Promise<void> {
|
|
42
48
|
return await this.engine.clear()
|
|
43
49
|
}
|
|
50
|
+
|
|
51
|
+
async close (): Promise<void> {
|
|
52
|
+
return await this.engine.close()
|
|
53
|
+
}
|
|
44
54
|
}
|
|
45
55
|
|
|
46
|
-
export default
|
|
56
|
+
export default CacheEngine
|
|
@@ -10,6 +10,7 @@ class MemoryCacheEngine implements ICacheEngine {
|
|
|
10
10
|
get (key: string): Record<string, unknown> | Record<string, unknown>[] | undefined {
|
|
11
11
|
const item = this.cache[key]
|
|
12
12
|
if (!item || item.expiresAt < Date.now()) {
|
|
13
|
+
this.del(key)
|
|
13
14
|
return undefined
|
|
14
15
|
}
|
|
15
16
|
return item.value
|
|
@@ -27,6 +28,10 @@ class MemoryCacheEngine implements ICacheEngine {
|
|
|
27
28
|
clear (): void {
|
|
28
29
|
this.cache = {}
|
|
29
30
|
}
|
|
31
|
+
|
|
32
|
+
close (): void {
|
|
33
|
+
// do nothing
|
|
34
|
+
}
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
export default MemoryCacheEngine
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import IORedis from 'ioredis'
|
|
2
2
|
|
|
3
|
-
import type { Redis } from 'ioredis'
|
|
4
|
-
|
|
3
|
+
import type { Redis, RedisOptions } from 'ioredis'
|
|
5
4
|
import type ICacheEngine from '../../interfaces/ICacheEngine'
|
|
6
5
|
|
|
7
6
|
class RedisCacheEngine implements ICacheEngine {
|
|
8
7
|
private client: Redis
|
|
9
8
|
|
|
10
|
-
constructor () {
|
|
11
|
-
|
|
9
|
+
constructor (options: RedisOptions) {
|
|
10
|
+
if (!options.keyPrefix) {
|
|
11
|
+
options.keyPrefix = 'cache-mongoose:'
|
|
12
|
+
}
|
|
13
|
+
this.client = new IORedis(options)
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
async get (key: string): Promise<Record<string, unknown> | Record<string, unknown>[] | undefined> {
|
|
@@ -31,6 +33,10 @@ class RedisCacheEngine implements ICacheEngine {
|
|
|
31
33
|
async clear (): Promise<void> {
|
|
32
34
|
await this.client.flushdb()
|
|
33
35
|
}
|
|
36
|
+
|
|
37
|
+
async close (): Promise<void> {
|
|
38
|
+
await this.client.quit()
|
|
39
|
+
}
|
|
34
40
|
}
|
|
35
41
|
|
|
36
42
|
export default RedisCacheEngine
|
|
@@ -3,6 +3,7 @@ interface ICacheEngine {
|
|
|
3
3
|
set: (key: string, value: Record<string, unknown> | Record<string, unknown>[], ttl?: number) => Promise<void> | void
|
|
4
4
|
del: (key: string) => Promise<void> | void
|
|
5
5
|
clear: () => Promise<void> | void
|
|
6
|
+
close: () => Promise<void> | void
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
export default ICacheEngine
|
package/src/plugin.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import _ from 'lodash'
|
|
2
|
-
import ms from 'ms'
|
|
3
2
|
import Cache from './cache/Cache'
|
|
4
3
|
|
|
5
4
|
import type { Mongoose } from 'mongoose'
|
|
6
|
-
import type
|
|
5
|
+
import type ICacheOptions from './interfaces/ICacheOptions'
|
|
7
6
|
import { getKey } from './crypto'
|
|
8
7
|
|
|
9
8
|
declare module 'mongoose' {
|
|
10
9
|
interface Query<ResultType, DocType, THelpers, RawDocType> {
|
|
11
|
-
cache: (this: Query<ResultType, DocType, THelpers, RawDocType>, ttl?: string) => this
|
|
10
|
+
cache: (this: Query<ResultType, DocType, THelpers, RawDocType>, ttl?: string, customKey?: string) => this
|
|
12
11
|
_key?: string
|
|
13
12
|
getCacheKey: (this: Query<ResultType, DocType, THelpers, RawDocType>) => string
|
|
14
|
-
_ttl
|
|
15
|
-
getCacheTTL: (this: Query<ResultType, DocType, THelpers, RawDocType>) =>
|
|
13
|
+
_ttl?: string
|
|
14
|
+
getCacheTTL: (this: Query<ResultType, DocType, THelpers, RawDocType>) => string | undefined
|
|
16
15
|
op?: string
|
|
17
16
|
_fields?: unknown
|
|
18
17
|
_path?: unknown
|
|
@@ -24,17 +23,19 @@ class CacheMongoose {
|
|
|
24
23
|
// eslint-disable-next-line no-use-before-define
|
|
25
24
|
private static instance: CacheMongoose | undefined
|
|
26
25
|
private cache!: Cache
|
|
26
|
+
private cacheOptions!: ICacheOptions
|
|
27
27
|
|
|
28
28
|
private constructor () {
|
|
29
29
|
// Private constructor to prevent external instantiation
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
33
|
-
public static init (mongoose: Mongoose,
|
|
33
|
+
public static init (mongoose: Mongoose, cacheOptions: ICacheOptions): CacheMongoose {
|
|
34
34
|
if (typeof mongoose.Model.hydrate !== 'function') throw new Error('Cache is only compatible with versions of mongoose that implement the `model.hydrate` method')
|
|
35
35
|
if (!this.instance) {
|
|
36
36
|
this.instance = new CacheMongoose()
|
|
37
|
-
this.instance.cache = new Cache(
|
|
37
|
+
this.instance.cache = new Cache(cacheOptions)
|
|
38
|
+
this.instance.cacheOptions = cacheOptions
|
|
38
39
|
|
|
39
40
|
const cache = this.instance.cache
|
|
40
41
|
|
|
@@ -72,14 +73,14 @@ class CacheMongoose {
|
|
|
72
73
|
|
|
73
74
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
74
75
|
mongoose.Query.prototype.cache = function (ttl?: string, customKey?: string) {
|
|
75
|
-
this._ttl =
|
|
76
|
+
this._ttl = ttl
|
|
76
77
|
this._key = customKey
|
|
77
78
|
return this
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
81
82
|
mongoose.Query.prototype.exec = async function () {
|
|
82
|
-
if (!
|
|
83
|
+
if (!this._ttl) {
|
|
83
84
|
return mongooseExec.apply(this)
|
|
84
85
|
}
|
|
85
86
|
|
|
@@ -110,12 +111,17 @@ class CacheMongoose {
|
|
|
110
111
|
return this.instance
|
|
111
112
|
}
|
|
112
113
|
|
|
113
|
-
public async
|
|
114
|
+
public async clear (customKey?: string): Promise<void> {
|
|
114
115
|
if (!customKey) {
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
return this.cache.clear()
|
|
117
|
+
}
|
|
118
|
+
return this.cache.del(customKey)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
public async close (): Promise<void> {
|
|
122
|
+
if (this.cacheOptions.engine === 'redis') {
|
|
123
|
+
await this.cache.close()
|
|
117
124
|
}
|
|
118
|
-
await this.cache.del(customKey)
|
|
119
125
|
}
|
|
120
126
|
}
|
|
121
127
|
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import Cache from '../src/cache/Cache'
|
|
2
|
+
|
|
3
|
+
import type ICacheOptions from '../src/interfaces/ICacheOptions'
|
|
4
|
+
|
|
5
|
+
describe('Cache class tests', () => {
|
|
6
|
+
it('should create a new instance of Cache', () => {
|
|
7
|
+
const cacheOptions: ICacheOptions = {
|
|
8
|
+
engine: 'memory'
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const cache = new Cache(cacheOptions)
|
|
12
|
+
expect(cache).toBeInstanceOf(Cache)
|
|
13
|
+
expect(cache).toHaveProperty('get')
|
|
14
|
+
expect(cache).toHaveProperty('set')
|
|
15
|
+
expect(cache).toHaveProperty('del')
|
|
16
|
+
expect(cache).toHaveProperty('clear')
|
|
17
|
+
expect(cache).toHaveProperty('close')
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
it('should throw an error if the cache engine is not supported', () => {
|
|
21
|
+
const cacheOptions: ICacheOptions = {
|
|
22
|
+
engine: 'not-supported'
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
expect(() => new Cache(cacheOptions)).toThrow(`Invalid engine name: ${cacheOptions.engine}`)
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it('should throw an error if the cache engine is redis and no engine options are provided', () => {
|
|
29
|
+
const cacheOptions: ICacheOptions = {
|
|
30
|
+
engine: 'redis'
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
expect(() => new Cache(cacheOptions)).toThrow(`Engine options are required for ${cacheOptions.engine} engine`)
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it('should create a new instance of Cache with redis engine', async () => {
|
|
37
|
+
const cacheOptions: ICacheOptions = {
|
|
38
|
+
engine: 'redis',
|
|
39
|
+
engineOptions: {
|
|
40
|
+
host: 'localhost',
|
|
41
|
+
port: 6379
|
|
42
|
+
},
|
|
43
|
+
defaultTTL: '10 minutes'
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const cache = new Cache(cacheOptions)
|
|
47
|
+
expect(cache).toBeInstanceOf(Cache)
|
|
48
|
+
expect(cache).toHaveProperty('get')
|
|
49
|
+
expect(cache).toHaveProperty('set')
|
|
50
|
+
expect(cache).toHaveProperty('del')
|
|
51
|
+
expect(cache).toHaveProperty('clear')
|
|
52
|
+
expect(cache).toHaveProperty('close')
|
|
53
|
+
|
|
54
|
+
await cache.set('bob', { test: 'bob' })
|
|
55
|
+
await cache.set('john', { test: 'john' }, '1 minute')
|
|
56
|
+
|
|
57
|
+
const value = await cache.get('bob')
|
|
58
|
+
expect(value).toEqual({ test: 'bob' })
|
|
59
|
+
|
|
60
|
+
await cache.del('bob')
|
|
61
|
+
const clearBob = await cache.get('bob')
|
|
62
|
+
expect(clearBob).toBeUndefined()
|
|
63
|
+
|
|
64
|
+
const john = await cache.get('john')
|
|
65
|
+
expect(john).toEqual({ test: 'john' })
|
|
66
|
+
|
|
67
|
+
await cache.clear()
|
|
68
|
+
const clearJohn = await cache.get('john')
|
|
69
|
+
expect(clearJohn).toBeUndefined()
|
|
70
|
+
|
|
71
|
+
const mockSet = jest.fn()
|
|
72
|
+
cache.set = mockSet
|
|
73
|
+
|
|
74
|
+
await cache.set('bob', { test: 'bob' })
|
|
75
|
+
expect(mockSet).toHaveBeenCalled()
|
|
76
|
+
expect(mockSet).toHaveBeenCalledWith('bob', { test: 'bob' })
|
|
77
|
+
|
|
78
|
+
await cache.close()
|
|
79
|
+
})
|
|
80
|
+
})
|
package/tests/cache.test.ts
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import mongoose, { model } from 'mongoose'
|
|
2
2
|
import CacheMongoose from '../src/plugin'
|
|
3
3
|
|
|
4
|
-
import type ICacheOptions from '../src/interfaces/
|
|
4
|
+
import type ICacheOptions from '../src/interfaces/ICacheOptions'
|
|
5
5
|
|
|
6
6
|
import UserSchema from './schemas/UserSchema'
|
|
7
7
|
|
|
8
|
-
const cacheOptions: ICacheOptions = {
|
|
9
|
-
engine: 'memory'
|
|
10
|
-
}
|
|
11
|
-
|
|
12
8
|
describe('CacheMongoose', () => {
|
|
13
9
|
const uri = `${globalThis.__MONGO_URI__}${globalThis.__MONGO_DB_NAME__}`
|
|
14
10
|
|
|
@@ -26,7 +22,90 @@ describe('CacheMongoose', () => {
|
|
|
26
22
|
await mongoose.connection.collection('users').deleteMany({})
|
|
27
23
|
})
|
|
28
24
|
|
|
29
|
-
|
|
25
|
+
describe('memory scenarios', () => {
|
|
26
|
+
const cacheOptions: ICacheOptions = {
|
|
27
|
+
engine: 'memory'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const cache = CacheMongoose.init(mongoose, cacheOptions)
|
|
31
|
+
|
|
32
|
+
it('should use memory cache', async () => {
|
|
33
|
+
const user = await User.create({
|
|
34
|
+
name: 'John Doe',
|
|
35
|
+
role: 'admin'
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const user1 = await User.findById(user._id).cache()
|
|
39
|
+
await User.updateOne({ _id: user._id }, { name: 'John Doe 2' })
|
|
40
|
+
const user2 = await User.findById(user._id).cache()
|
|
41
|
+
|
|
42
|
+
expect(user1).not.toBeNull()
|
|
43
|
+
expect(user2).not.toBeNull()
|
|
44
|
+
expect(user1?._id).toEqual(user2?._id)
|
|
45
|
+
expect(user1?.name).not.toEqual(user2?.name)
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it('should not use memory cache', async () => {
|
|
49
|
+
const user = await User.create({
|
|
50
|
+
name: 'John Doe',
|
|
51
|
+
role: 'admin'
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
const cache1 = await User.findById(user._id).cache().exec()
|
|
55
|
+
await User.updateOne({ _id: user._id }, { name: 'John Doe 2' })
|
|
56
|
+
await cache.clear()
|
|
57
|
+
const cache2 = await User.findById(user._id).cache().exec()
|
|
58
|
+
|
|
59
|
+
expect(cache1).not.toBeNull()
|
|
60
|
+
expect(cache2).not.toBeNull()
|
|
61
|
+
expect(cache1?._id).toEqual(cache2?._id)
|
|
62
|
+
expect(cache1?.name).not.toEqual(cache2?.name)
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
it('should use memory cache with custom key', async () => {
|
|
66
|
+
const user = await User.create({
|
|
67
|
+
name: 'John Doe',
|
|
68
|
+
role: 'admin'
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
const cache1 = await User.findById(user._id).cache('1 minute', 'test-custom-key').exec()
|
|
72
|
+
await User.updateOne({ _id: user._id }, { name: 'John Doe 2' })
|
|
73
|
+
const cache2 = await User.findById(user._id).cache('1 minute', 'test-custom-key').exec()
|
|
74
|
+
|
|
75
|
+
expect(cache1).not.toBeNull()
|
|
76
|
+
expect(cache2).not.toBeNull()
|
|
77
|
+
expect(cache1?._id).toEqual(cache2?._id)
|
|
78
|
+
expect(cache1?.name).toEqual(cache2?.name)
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
it('should use memory cache and clear custom key', async () => {
|
|
82
|
+
const user = await User.create({
|
|
83
|
+
name: 'John Doe',
|
|
84
|
+
role: 'admin'
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
const cache1 = await User.findById(user._id).cache('1 minute', 'test-custom-key-second').exec()
|
|
88
|
+
await User.updateOne({ _id: user._id }, { name: 'John Doe 2' })
|
|
89
|
+
await cache.clear('test-custom-key-second')
|
|
90
|
+
const cache2 = await User.findById(user._id).cache('1 minute', 'test-custom-key-second').exec()
|
|
91
|
+
|
|
92
|
+
expect(cache1).not.toBeNull()
|
|
93
|
+
expect(cache2).not.toBeNull()
|
|
94
|
+
expect(cache1?._id).toEqual(cache2?._id)
|
|
95
|
+
expect(cache1?.name).not.toEqual(cache2?.name)
|
|
96
|
+
})
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
it('should use redis cache', async () => {
|
|
100
|
+
const cacheOptions: ICacheOptions = {
|
|
101
|
+
engine: 'redis',
|
|
102
|
+
engineOptions: {
|
|
103
|
+
host: 'localhost',
|
|
104
|
+
port: 6379
|
|
105
|
+
},
|
|
106
|
+
defaultTTL: '6 minutes'
|
|
107
|
+
}
|
|
108
|
+
|
|
30
109
|
const cache = CacheMongoose.init(mongoose, cacheOptions)
|
|
31
110
|
expect(cache).toBeDefined()
|
|
32
111
|
|
|
@@ -35,17 +114,35 @@ describe('CacheMongoose', () => {
|
|
|
35
114
|
role: 'admin'
|
|
36
115
|
})
|
|
37
116
|
|
|
38
|
-
const
|
|
39
|
-
console.log(cachedUser1)
|
|
40
|
-
|
|
117
|
+
const cache1 = await User.findById(user._id).cache()
|
|
41
118
|
await User.updateOne({ _id: user._id }, { name: 'John Doe 2' })
|
|
119
|
+
const cache2 = await User.findById(user._id).cache()
|
|
120
|
+
|
|
121
|
+
expect(cache1).not.toBeNull()
|
|
122
|
+
expect(cache2).not.toBeNull()
|
|
123
|
+
expect(cache1?._id).toEqual(cache2?._id)
|
|
124
|
+
expect(cache1?.name).not.toEqual(cache2?.name)
|
|
125
|
+
|
|
126
|
+
await User.create([
|
|
127
|
+
{
|
|
128
|
+
name: 'John Doe 3',
|
|
129
|
+
role: 'admin'
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'John Doe 4',
|
|
133
|
+
role: 'admin'
|
|
134
|
+
}
|
|
135
|
+
])
|
|
136
|
+
|
|
137
|
+
const cache3 = await User.find({ role: 'admin' }).cache()
|
|
138
|
+
await User.updateMany({ role: 'admin' }, { name: 'John Doe 5' })
|
|
139
|
+
const cache4 = await User.find({ role: 'admin' }).cache()
|
|
42
140
|
|
|
43
|
-
|
|
44
|
-
|
|
141
|
+
expect(cache3).not.toBeNull()
|
|
142
|
+
expect(cache4).not.toBeNull()
|
|
143
|
+
expect(cache3?.length).toEqual(cache4?.length)
|
|
144
|
+
expect(cache3?.[0].name).not.toEqual(cache4?.[0].name)
|
|
45
145
|
|
|
46
|
-
|
|
47
|
-
expect(cachedUser2).not.toBeNull()
|
|
48
|
-
expect(cachedUser1?._id).toEqual(cachedUser2?._id)
|
|
49
|
-
expect(cachedUser1?.name).toEqual(cachedUser2?.name)
|
|
146
|
+
cache.close()
|
|
50
147
|
})
|
|
51
148
|
})
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ICacheMongooseOptions.js","sourceRoot":"","sources":["../../../src/interfaces/ICacheMongooseOptions.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ICacheMongooseOptions.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/ICacheMongooseOptions.ts"],"names":[],"mappings":"AAAA,UAAU,qBAAqB;IAC7B,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAA;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,eAAe,qBAAqB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ICacheMongooseOptions.js","sourceRoot":"","sources":["../../../src/interfaces/ICacheMongooseOptions.ts"],"names":[],"mappings":""}
|