@midwayjs/cache-manager 3.0.0
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 +12 -0
- package/dist/configuration.d.ts +9 -0
- package/dist/configuration.js +67 -0
- package/dist/decorator/cacheKey.d.ts +9 -0
- package/dist/decorator/cacheKey.js +18 -0
- package/dist/factory.d.ts +15 -0
- package/dist/factory.js +155 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +25 -0
- package/dist/interface.d.ts +21 -0
- package/dist/interface.js +3 -0
- package/index.d.ts +9 -0
- package/package.json +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# midway cache manager
|
|
2
|
+
|
|
3
|
+
[](http://packagequality.com/#?package=midway-core)
|
|
4
|
+
[](https://github.com/midwayjs/midway/pulls)
|
|
5
|
+
|
|
6
|
+
this is a sub package for midway.
|
|
7
|
+
|
|
8
|
+
Document: [https://midwayjs.org](https://midwayjs.org)
|
|
9
|
+
|
|
10
|
+
## License
|
|
11
|
+
|
|
12
|
+
[MIT]((http://github.com/midwayjs/midway/blob/master/LICENSE))
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ILifeCycle, IMidwayContainer, MidwayDecoratorService } from '@midwayjs/core';
|
|
2
|
+
import { CachingFactory } from './factory';
|
|
3
|
+
export declare function getClassMethodDefaultCacheKey(target: any, methodName: string): string;
|
|
4
|
+
export declare class CacheConfiguration implements ILifeCycle {
|
|
5
|
+
decoratorService: MidwayDecoratorService;
|
|
6
|
+
cacheService: CachingFactory;
|
|
7
|
+
onReady(container: IMidwayContainer): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=configuration.d.ts.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CacheConfiguration = exports.getClassMethodDefaultCacheKey = void 0;
|
|
13
|
+
const core_1 = require("@midwayjs/core");
|
|
14
|
+
const cacheKey_1 = require("./decorator/cacheKey");
|
|
15
|
+
const factory_1 = require("./factory");
|
|
16
|
+
function getClassMethodDefaultCacheKey(target, methodName) {
|
|
17
|
+
return target.name + '-' + (0, core_1.getProviderUUId)(target) + '-' + methodName;
|
|
18
|
+
}
|
|
19
|
+
exports.getClassMethodDefaultCacheKey = getClassMethodDefaultCacheKey;
|
|
20
|
+
let CacheConfiguration = class CacheConfiguration {
|
|
21
|
+
async onReady(container) {
|
|
22
|
+
// init factory and caching instance
|
|
23
|
+
this.cacheService = await container.getAsync(factory_1.CachingFactory);
|
|
24
|
+
// register @Caching decorator implementation
|
|
25
|
+
this.decoratorService.registerMethodHandler(cacheKey_1.CACHE_DECORATOR_KEY, ({ target, propertyName, metadata }) => {
|
|
26
|
+
if (!metadata.cacheKey) {
|
|
27
|
+
metadata.cacheKey = getClassMethodDefaultCacheKey(target, propertyName);
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
around: async (joinPoint) => {
|
|
31
|
+
const cachingInstance = this.cacheService.get(metadata.cacheInstanceName);
|
|
32
|
+
if (typeof metadata.cacheKey === 'function') {
|
|
33
|
+
metadata.cacheKey = await metadata.cacheKey({
|
|
34
|
+
methodArgs: joinPoint.args,
|
|
35
|
+
ctx: joinPoint.target[core_1.REQUEST_OBJ_CTX_KEY],
|
|
36
|
+
target: joinPoint.target,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (typeof metadata.cacheKey === 'string') {
|
|
40
|
+
return cachingInstance.methodWrap(metadata.cacheKey, joinPoint.proceed, joinPoint.args, metadata.ttl);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return joinPoint.proceed(...joinPoint.args);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, core_1.Inject)(),
|
|
52
|
+
__metadata("design:type", core_1.MidwayDecoratorService)
|
|
53
|
+
], CacheConfiguration.prototype, "decoratorService", void 0);
|
|
54
|
+
CacheConfiguration = __decorate([
|
|
55
|
+
(0, core_1.Configuration)({
|
|
56
|
+
namespace: 'cacheManager',
|
|
57
|
+
importConfigs: [
|
|
58
|
+
{
|
|
59
|
+
default: {
|
|
60
|
+
cacheManager: {},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
})
|
|
65
|
+
], CacheConfiguration);
|
|
66
|
+
exports.CacheConfiguration = CacheConfiguration;
|
|
67
|
+
//# sourceMappingURL=configuration.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IMidwayContext } from '@midwayjs/core';
|
|
2
|
+
export declare const CACHE_DECORATOR_KEY = "cache-manager:caching";
|
|
3
|
+
export type CachingDecoratorKeyOptions = string | ((options: {
|
|
4
|
+
methodArgs: any[];
|
|
5
|
+
ctx?: IMidwayContext;
|
|
6
|
+
target: any;
|
|
7
|
+
}) => string);
|
|
8
|
+
export declare function Caching(cacheInstanceName: string, cacheKeyOrTTL?: CachingDecoratorKeyOptions | number, ttl?: number): MethodDecorator;
|
|
9
|
+
//# sourceMappingURL=cacheKey.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Caching = exports.CACHE_DECORATOR_KEY = void 0;
|
|
4
|
+
const core_1 = require("@midwayjs/core");
|
|
5
|
+
exports.CACHE_DECORATOR_KEY = 'cache-manager:caching';
|
|
6
|
+
function Caching(cacheInstanceName, cacheKeyOrTTL, ttl) {
|
|
7
|
+
if (typeof cacheKeyOrTTL === 'number') {
|
|
8
|
+
ttl = cacheKeyOrTTL;
|
|
9
|
+
cacheKeyOrTTL = undefined;
|
|
10
|
+
}
|
|
11
|
+
return (0, core_1.createCustomMethodDecorator)(exports.CACHE_DECORATOR_KEY, {
|
|
12
|
+
cacheInstanceName,
|
|
13
|
+
cacheKey: cacheKeyOrTTL,
|
|
14
|
+
ttl,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
exports.Caching = Caching;
|
|
18
|
+
//# sourceMappingURL=cacheKey.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IMidwayContainer, ServiceFactory, ServiceFactoryConfigOption } from '@midwayjs/core';
|
|
2
|
+
import { CachingConfig } from 'cache-manager';
|
|
3
|
+
import { CacheManagerOptions, MidwayCache, MidwayMultiCache, MidwayUnionCache } from './interface';
|
|
4
|
+
export declare class CachingFactory extends ServiceFactory<MidwayUnionCache> {
|
|
5
|
+
protected cacheManagerConfig: ServiceFactoryConfigOption<CacheManagerOptions>;
|
|
6
|
+
protected applicationContext: IMidwayContainer;
|
|
7
|
+
protected init(): Promise<void>;
|
|
8
|
+
protected createClient(config: CacheManagerOptions<any>, clientName: string): Promise<void | MidwayUnionCache>;
|
|
9
|
+
wrapCaching(cacheInstance: MidwayCache, cachingArgs?: CachingConfig<any>): MidwayCache;
|
|
10
|
+
wrapMultiCaching(cacheInstance: MidwayMultiCache, caches: MidwayCache[]): MidwayMultiCache;
|
|
11
|
+
getName(): string;
|
|
12
|
+
getCaching(cacheKey: string): MidwayCache;
|
|
13
|
+
getMultiCaching(cacheKey: string): MidwayMultiCache;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=factory.d.ts.map
|
package/dist/factory.js
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CachingFactory = void 0;
|
|
13
|
+
const core_1 = require("@midwayjs/core");
|
|
14
|
+
const cache_manager_1 = require("cache-manager");
|
|
15
|
+
const promise_coalesce_1 = require("promise-coalesce");
|
|
16
|
+
let CachingFactory = class CachingFactory extends core_1.ServiceFactory {
|
|
17
|
+
async init() {
|
|
18
|
+
await this.initClients(this.cacheManagerConfig);
|
|
19
|
+
}
|
|
20
|
+
async createClient(config, clientName) {
|
|
21
|
+
// multi cache
|
|
22
|
+
if (Array.isArray(config.store)) {
|
|
23
|
+
const newFactory = [];
|
|
24
|
+
for (const storeConfig of config.store) {
|
|
25
|
+
if (typeof storeConfig === 'string') {
|
|
26
|
+
if (!this.has(storeConfig)) {
|
|
27
|
+
throw new core_1.MidwayCommonError(`cache instance "${storeConfig}" not found in "${clientName}", please check your configuration.`);
|
|
28
|
+
}
|
|
29
|
+
newFactory.push(this.get(storeConfig));
|
|
30
|
+
}
|
|
31
|
+
else if (typeof storeConfig === 'function') {
|
|
32
|
+
newFactory.push(await storeConfig());
|
|
33
|
+
}
|
|
34
|
+
else if (storeConfig['wrap']) {
|
|
35
|
+
// wrap is a caching object method
|
|
36
|
+
newFactory.push(storeConfig['wrap']);
|
|
37
|
+
}
|
|
38
|
+
else if (typeof storeConfig === 'object') {
|
|
39
|
+
if (typeof storeConfig.store === 'function') {
|
|
40
|
+
storeConfig.store = await storeConfig.store(storeConfig['options'] || {}, this.applicationContext);
|
|
41
|
+
}
|
|
42
|
+
if (!storeConfig.store) {
|
|
43
|
+
throw new core_1.MidwayCommonError(`cache instance "${clientName}" store is undefined, please check your configuration.`);
|
|
44
|
+
}
|
|
45
|
+
newFactory.push(await (0, cache_manager_1.caching)(storeConfig.store, storeConfig['options']));
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
throw new core_1.MidwayCommonError('invalid cache config');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const cacheInstance = await (0, cache_manager_1.multiCaching)(newFactory);
|
|
52
|
+
return this.wrapMultiCaching(cacheInstance, newFactory);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
// single cache
|
|
56
|
+
if (typeof config.store === 'function') {
|
|
57
|
+
config.store = await config.store(config['options'] || {}, this.applicationContext);
|
|
58
|
+
}
|
|
59
|
+
if (!config.store) {
|
|
60
|
+
throw new core_1.MidwayCommonError(`cache instance "${clientName}" store is undefined, please check your configuration.`);
|
|
61
|
+
}
|
|
62
|
+
const cacheInstance = await (0, cache_manager_1.caching)(config.store, config['options']);
|
|
63
|
+
return this.wrapCaching(cacheInstance, config['options']);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
wrapCaching(cacheInstance, cachingArgs) {
|
|
67
|
+
if (cacheInstance.methodWrap) {
|
|
68
|
+
return cacheInstance;
|
|
69
|
+
}
|
|
70
|
+
cacheInstance.methodWrap = async (key, fn, fnArgs, ttl) => {
|
|
71
|
+
const store = cacheInstance.store;
|
|
72
|
+
return (0, promise_coalesce_1.coalesceAsync)(key, async () => {
|
|
73
|
+
const value = await store.get(key);
|
|
74
|
+
if (value === undefined) {
|
|
75
|
+
const result = await fn(...fnArgs);
|
|
76
|
+
const cacheTTL = typeof ttl === 'function' ? ttl(result) : ttl;
|
|
77
|
+
await store.set(key, result, cacheTTL);
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
else if (cachingArgs === null || cachingArgs === void 0 ? void 0 : cachingArgs.refreshThreshold) {
|
|
81
|
+
const cacheTTL = typeof ttl === 'function' ? ttl(value) : ttl;
|
|
82
|
+
const remainingTtl = await store.ttl(key);
|
|
83
|
+
if (remainingTtl !== -1 &&
|
|
84
|
+
remainingTtl < cachingArgs.refreshThreshold) {
|
|
85
|
+
// fn(...fnArgs).then(result => store.set(key, result, cacheTTL));
|
|
86
|
+
(0, promise_coalesce_1.coalesceAsync)(`+++${key}`, () => fn(...fnArgs)).then(result => store.set(key, result, cacheTTL));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return value;
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
return cacheInstance;
|
|
93
|
+
}
|
|
94
|
+
wrapMultiCaching(cacheInstance, caches) {
|
|
95
|
+
if (cacheInstance.methodWrap) {
|
|
96
|
+
return cacheInstance;
|
|
97
|
+
}
|
|
98
|
+
cacheInstance.methodWrap = async (key, fn, fnArgs, ttl) => {
|
|
99
|
+
let value;
|
|
100
|
+
let i = 0;
|
|
101
|
+
for (; i < caches.length; i++) {
|
|
102
|
+
try {
|
|
103
|
+
value = await caches[i].get(key);
|
|
104
|
+
if (value !== undefined)
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
catch (e) {
|
|
108
|
+
// ignore
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (value === undefined) {
|
|
112
|
+
const result = await fn(...fnArgs);
|
|
113
|
+
const cacheTTL = typeof ttl === 'function' ? ttl(result) : ttl;
|
|
114
|
+
await cacheInstance.set(key, result, cacheTTL);
|
|
115
|
+
return result;
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
const cacheTTL = typeof ttl === 'function' ? ttl(value) : ttl;
|
|
119
|
+
Promise.all(caches.slice(0, i).map(cache => cache.set(key, value, cacheTTL))).then();
|
|
120
|
+
caches[i].methodWrap(key, fn, fnArgs, ttl).then(); // call wrap for store for internal refreshThreshold logic, see: src/caching.ts caching.wrap
|
|
121
|
+
}
|
|
122
|
+
return value;
|
|
123
|
+
};
|
|
124
|
+
return cacheInstance;
|
|
125
|
+
}
|
|
126
|
+
getName() {
|
|
127
|
+
return 'cache-manager';
|
|
128
|
+
}
|
|
129
|
+
getCaching(cacheKey) {
|
|
130
|
+
return this.get(cacheKey);
|
|
131
|
+
}
|
|
132
|
+
getMultiCaching(cacheKey) {
|
|
133
|
+
return this.get(cacheKey);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
__decorate([
|
|
137
|
+
(0, core_1.Config)('cacheManager'),
|
|
138
|
+
__metadata("design:type", Object)
|
|
139
|
+
], CachingFactory.prototype, "cacheManagerConfig", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
(0, core_1.ApplicationContext)(),
|
|
142
|
+
__metadata("design:type", Object)
|
|
143
|
+
], CachingFactory.prototype, "applicationContext", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, core_1.Init)(),
|
|
146
|
+
__metadata("design:type", Function),
|
|
147
|
+
__metadata("design:paramtypes", []),
|
|
148
|
+
__metadata("design:returntype", Promise)
|
|
149
|
+
], CachingFactory.prototype, "init", null);
|
|
150
|
+
CachingFactory = __decorate([
|
|
151
|
+
(0, core_1.Provide)(),
|
|
152
|
+
(0, core_1.Scope)(core_1.ScopeEnum.Singleton)
|
|
153
|
+
], CachingFactory);
|
|
154
|
+
exports.CachingFactory = CachingFactory;
|
|
155
|
+
//# sourceMappingURL=factory.js.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { CacheConfiguration as Configuration, getClassMethodDefaultCacheKey, } from './configuration';
|
|
2
|
+
export * from './interface';
|
|
3
|
+
export * from './factory';
|
|
4
|
+
export * from './decorator/cacheKey';
|
|
5
|
+
export * as CacheManager from 'cache-manager';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.CacheManager = exports.getClassMethodDefaultCacheKey = exports.Configuration = void 0;
|
|
18
|
+
var configuration_1 = require("./configuration");
|
|
19
|
+
Object.defineProperty(exports, "Configuration", { enumerable: true, get: function () { return configuration_1.CacheConfiguration; } });
|
|
20
|
+
Object.defineProperty(exports, "getClassMethodDefaultCacheKey", { enumerable: true, get: function () { return configuration_1.getClassMethodDefaultCacheKey; } });
|
|
21
|
+
__exportStar(require("./interface"), exports);
|
|
22
|
+
__exportStar(require("./factory"), exports);
|
|
23
|
+
__exportStar(require("./decorator/cacheKey"), exports);
|
|
24
|
+
exports.CacheManager = require("cache-manager");
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Cache, Store, MemoryConfig, FactoryStore, FactoryConfig, MultiCache, WrapTTL } from 'cache-manager';
|
|
2
|
+
export type SingleCacheOptions<S extends Store = any, T extends object = any> = {
|
|
3
|
+
store: 'memory';
|
|
4
|
+
options?: MemoryConfig;
|
|
5
|
+
} | {
|
|
6
|
+
store: S | (() => S | Promise<S>);
|
|
7
|
+
} | {
|
|
8
|
+
store: FactoryStore<S, T>;
|
|
9
|
+
options?: FactoryConfig<Parameters<FactoryStore<S, T>>[0]>;
|
|
10
|
+
};
|
|
11
|
+
export type CacheManagerOptions<S extends Store = any, T extends object = any> = SingleCacheOptions<S> | {
|
|
12
|
+
store: Array<string | Cache | SingleCacheOptions<S, T> | (() => Cache | Promise<Cache>)>;
|
|
13
|
+
};
|
|
14
|
+
export type MidwayCache = Cache & {
|
|
15
|
+
methodWrap?: <T>(key: string, fn: (...args: any[]) => Promise<T>, fnArgs: any[], ttl?: WrapTTL<T>) => Promise<T>;
|
|
16
|
+
};
|
|
17
|
+
export type MidwayMultiCache = MultiCache & {
|
|
18
|
+
methodWrap?: <T>(key: string, fn: (...args: any[]) => Promise<T>, fnArgs: any[], ttl?: WrapTTL<T>) => Promise<T>;
|
|
19
|
+
};
|
|
20
|
+
export type MidwayUnionCache = MidwayCache | MidwayMultiCache;
|
|
21
|
+
//# sourceMappingURL=interface.d.ts.map
|
package/index.d.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@midwayjs/cache-manager",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "midway cache manager",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"typings": "index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"test": "node --require=ts-node/register ../../node_modules/.bin/jest --runInBand",
|
|
10
|
+
"cov": "node --require=ts-node/register ../../node_modules/.bin/jest --runInBand --coverage --forceExit"
|
|
11
|
+
},
|
|
12
|
+
"author": "",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist/**/*.js",
|
|
15
|
+
"dist/**/*.d.ts",
|
|
16
|
+
"index.d.ts"
|
|
17
|
+
],
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git@github.com:midwayjs/midway.git"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"midway",
|
|
25
|
+
"cache"
|
|
26
|
+
],
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=12"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@midwayjs/core": "^3.13.5",
|
|
32
|
+
"@midwayjs/mock": "^3.13.5",
|
|
33
|
+
"@midwayjs/redis": "^3.13.5",
|
|
34
|
+
"cache-manager-ioredis-yet": "1.2.2"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"cache-manager": "5.3.2",
|
|
38
|
+
"promise-coalesce": "1.1.1"
|
|
39
|
+
}
|
|
40
|
+
}
|