vona-module-a-redis 5.0.31 → 5.0.32
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/dist/index.js +19 -19
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BeanInfo, BeanBase, cast, deepExtend, BeanSimple, combineConfigDefault, BeanScopeBase } from 'vona';
|
|
2
|
+
import { __decorate } from 'tslib';
|
|
2
3
|
import { Service, Bean, Scope } from 'vona-module-a-bean';
|
|
3
4
|
import { Redis } from 'ioredis';
|
|
4
5
|
|
|
@@ -10,10 +11,7 @@ function prepareRedisClientKeyPrefix(keyPrefix, clientName, app) {
|
|
|
10
11
|
return keyPrefix === true ? getRedisClientKeyPrefix(clientName, app) : keyPrefix;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
let ServiceRedisClient = (_dec$3 = Service(), _dec2$3 = BeanInfo({
|
|
15
|
-
module: "a-redis"
|
|
16
|
-
}), _dec$3(_class$3 = _dec2$3(_class$3 = class ServiceRedisClient extends BeanBase {
|
|
14
|
+
let ServiceRedisClient = class ServiceRedisClient extends BeanBase {
|
|
17
15
|
constructor(...args) {
|
|
18
16
|
super(...args);
|
|
19
17
|
this._redisInstance = void 0;
|
|
@@ -45,12 +43,12 @@ let ServiceRedisClient = (_dec$3 = Service(), _dec2$3 = BeanInfo({
|
|
|
45
43
|
return new Redis(configNode);
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
var _dec$2, _dec2$2, _class$2;
|
|
51
|
-
let BeanRedis = (_dec$2 = Bean(), _dec2$2 = BeanInfo({
|
|
46
|
+
};
|
|
47
|
+
ServiceRedisClient = __decorate([Service(), BeanInfo({
|
|
52
48
|
module: "a-redis"
|
|
53
|
-
}),
|
|
49
|
+
})], ServiceRedisClient);
|
|
50
|
+
|
|
51
|
+
let BeanRedis = class BeanRedis extends BeanBase {
|
|
54
52
|
getClient(clientName) {
|
|
55
53
|
return this.app.bean._getBeanSelector(ServiceRedisClient, clientName ?? 'default');
|
|
56
54
|
}
|
|
@@ -58,12 +56,12 @@ let BeanRedis = (_dec$2 = Bean(), _dec2$2 = BeanInfo({
|
|
|
58
56
|
const client = this.getClient(clientName);
|
|
59
57
|
return client.instance;
|
|
60
58
|
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
var _dec$1, _dec2$1, _class$1;
|
|
64
|
-
let ServiceRedis = (_dec$1 = Service(), _dec2$1 = BeanInfo({
|
|
59
|
+
};
|
|
60
|
+
BeanRedis = __decorate([Bean(), BeanInfo({
|
|
65
61
|
module: "a-redis"
|
|
66
|
-
}),
|
|
62
|
+
})], BeanRedis);
|
|
63
|
+
|
|
64
|
+
let ServiceRedis = class ServiceRedis extends BeanBase {
|
|
67
65
|
async clearAllData() {
|
|
68
66
|
const app = this.app;
|
|
69
67
|
// clear keys
|
|
@@ -96,7 +94,10 @@ let ServiceRedis = (_dec$1 = Service(), _dec2$1 = BeanInfo({
|
|
|
96
94
|
await redis.del(keysDel);
|
|
97
95
|
}
|
|
98
96
|
}
|
|
99
|
-
}
|
|
97
|
+
};
|
|
98
|
+
ServiceRedis = __decorate([Service(), BeanInfo({
|
|
99
|
+
module: "a-redis"
|
|
100
|
+
})], ServiceRedis);
|
|
100
101
|
|
|
101
102
|
class Main extends BeanSimple {
|
|
102
103
|
async moduleLoading() {
|
|
@@ -110,11 +111,10 @@ async function configDefault(_app) {
|
|
|
110
111
|
return {};
|
|
111
112
|
}
|
|
112
113
|
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
let ScopeModuleARedis = class ScopeModuleARedis extends BeanScopeBase {};
|
|
115
|
+
ScopeModuleARedis = __decorate([Scope(), BeanInfo({
|
|
115
116
|
module: "a-redis"
|
|
116
|
-
}),
|
|
117
|
-
|
|
117
|
+
})], ScopeModuleARedis);
|
|
118
118
|
/** scope: end */
|
|
119
119
|
|
|
120
120
|
export { BeanRedis, Main, ScopeModuleARedis, ServiceRedis, ServiceRedisClient, configDefault, getRedisClientKeyPrefix, prepareRedisClientKeyPrefix };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-redis",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.32",
|
|
5
5
|
"title": "a-redis",
|
|
6
6
|
"vonaModule": {
|
|
7
7
|
"dependencies": {},
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"ioredis": "^5.
|
|
32
|
+
"ioredis": "^5.9.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"clean-package": "^2.2.0",
|