@bejibun/redis 0.1.35 → 0.1.37
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/CHANGELOG.md +52 -22
- package/LICENSE +1 -1
- package/README.md +19 -7
- package/builders/RedisBuilder.d.ts +6 -5
- package/builders/RedisBuilder.js +34 -15
- package/facades/Redis.d.ts +2 -1
- package/facades/Redis.js +5 -2
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,37 @@ All notable changes to this project will be documented in this file.
|
|
|
3
3
|
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
## [v0.1.
|
|
6
|
+
## [v0.1.37](https://github.com/Bejibun-Framework/bejibun-redis/compare/v0.1.36...v0.1.37) - 2026-02-14
|
|
7
|
+
|
|
8
|
+
### 🩹 Fixes
|
|
9
|
+
|
|
10
|
+
### 📖 Changes
|
|
11
|
+
- Added `.keys(pattern: string)` to get list of key.
|
|
12
|
+
|
|
13
|
+
### ❤️Contributors
|
|
14
|
+
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
15
|
+
|
|
16
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## [v0.1.36](https://github.com/Bejibun-Framework/bejibun-redis/compare/v0.1.35...v0.1.36) - 2025-12-11
|
|
21
|
+
|
|
22
|
+
### 🩹 Fixes
|
|
23
|
+
|
|
24
|
+
### 📖 Changes
|
|
25
|
+
- Set random connection name for `.setClient()` and disconnect after used then clear the connection lists.
|
|
26
|
+
|
|
27
|
+
#### Upgrade [@bejibun/utils](https://github.com/Bejibun-Framework/bejibun-utils) to [v0.1.27](https://github.com/Bejibun-Framework/bejibun-utils/releases/tag/v0.1.24)
|
|
28
|
+
|
|
29
|
+
### ❤️Contributors
|
|
30
|
+
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
31
|
+
|
|
32
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## [v0.1.35](https://github.com/Bejibun-Framework/bejibun-redis/compare/v0.1.34...v0.1.35) - 2025-12-07
|
|
7
37
|
|
|
8
38
|
### 🩹 Fixes
|
|
9
39
|
|
|
@@ -11,21 +41,21 @@ All notable changes to this project will be documented in this file.
|
|
|
11
41
|
What's New :
|
|
12
42
|
- Adding `.setClient(cfg: RedisConfig)` to override connection.
|
|
13
43
|
|
|
14
|
-
By default, [@bejibun/redis](https://github.com/
|
|
44
|
+
By default, [@bejibun/redis](https://github.com/Bejibun-Framework/bejibun-redis) use connection from `config/redis.ts`.
|
|
15
45
|
|
|
16
46
|
Now, you can override it by using `setClient()`.
|
|
17
47
|
|
|
18
|
-
#### Upgrade [@bejibun/utils](https://github.com/
|
|
48
|
+
#### Upgrade [@bejibun/utils](https://github.com/Bejibun-Framework/bejibun-utils) to [v0.1.24](https://github.com/Bejibun-Framework/bejibun-utils/releases/tag/v0.1.24)
|
|
19
49
|
- Fix empty validation for class
|
|
20
50
|
|
|
21
51
|
### ❤️Contributors
|
|
22
52
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
23
53
|
|
|
24
|
-
**Full Changelog**: https://github.com/
|
|
54
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
25
55
|
|
|
26
56
|
---
|
|
27
57
|
|
|
28
|
-
## [v0.1.34](https://github.com/
|
|
58
|
+
## [v0.1.34](https://github.com/Bejibun-Framework/bejibun-redis/compare/v0.1.33...v0.1.34) - 2025-11-23
|
|
29
59
|
|
|
30
60
|
### 🩹 Fixes
|
|
31
61
|
- Fix redis ttl
|
|
@@ -35,11 +65,11 @@ Now, you can override it by using `setClient()`.
|
|
|
35
65
|
### ❤️Contributors
|
|
36
66
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
37
67
|
|
|
38
|
-
**Full Changelog**: https://github.com/
|
|
68
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
39
69
|
|
|
40
70
|
---
|
|
41
71
|
|
|
42
|
-
## [v0.1.33](https://github.com/
|
|
72
|
+
## [v0.1.33](https://github.com/Bejibun-Framework/bejibun-redis/compare/v0.1.30...v0.1.33) - 2025-11-09
|
|
43
73
|
|
|
44
74
|
### 🩹 Fixes
|
|
45
75
|
- Fix redis configuration
|
|
@@ -49,11 +79,11 @@ Now, you can override it by using `setClient()`.
|
|
|
49
79
|
### ❤️Contributors
|
|
50
80
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
51
81
|
|
|
52
|
-
**Full Changelog**: https://github.com/
|
|
82
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
53
83
|
|
|
54
84
|
---
|
|
55
85
|
|
|
56
|
-
## [v0.1.30](https://github.com/
|
|
86
|
+
## [v0.1.30](https://github.com/Bejibun-Framework/bejibun-redis/compare/v0.1.29...v0.1.30) - 2025-10-22
|
|
57
87
|
|
|
58
88
|
### 🩹 Fixes
|
|
59
89
|
- Fix `configure.ts` configuration file
|
|
@@ -64,11 +94,11 @@ Now, you can override it by using `setClient()`.
|
|
|
64
94
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
65
95
|
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
66
96
|
|
|
67
|
-
**Full Changelog**: https://github.com/
|
|
97
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
68
98
|
|
|
69
99
|
---
|
|
70
100
|
|
|
71
|
-
## [v0.1.29](https://github.com/
|
|
101
|
+
## [v0.1.29](https://github.com/Bejibun-Framework/bejibun-redis/compare/v0.1.27...v0.1.29) - 2025-10-22
|
|
72
102
|
|
|
73
103
|
### 🩹 Fixes
|
|
74
104
|
|
|
@@ -80,11 +110,11 @@ What's New :
|
|
|
80
110
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
81
111
|
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
82
112
|
|
|
83
|
-
**Full Changelog**: https://github.com/
|
|
113
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
84
114
|
|
|
85
115
|
---
|
|
86
116
|
|
|
87
|
-
## [v0.1.27](https://github.com/
|
|
117
|
+
## [v0.1.27](https://github.com/Bejibun-Framework/bejibun-redis/compare/v0.1.26...v0.1.27) - 2025-10-20
|
|
88
118
|
|
|
89
119
|
### 🩹 Fixes
|
|
90
120
|
|
|
@@ -97,11 +127,11 @@ Chore :
|
|
|
97
127
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
98
128
|
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
99
129
|
|
|
100
|
-
**Full Changelog**: https://github.com/
|
|
130
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
101
131
|
|
|
102
132
|
---
|
|
103
133
|
|
|
104
|
-
## [v0.1.26](https://github.com/
|
|
134
|
+
## [v0.1.26](https://github.com/Bejibun-Framework/bejibun-redis/compare/v0.1.24...v0.1.26) - 2025-10-18
|
|
105
135
|
|
|
106
136
|
### 🩹 Fixes
|
|
107
137
|
|
|
@@ -113,11 +143,11 @@ What's New :
|
|
|
113
143
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
114
144
|
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
115
145
|
|
|
116
|
-
**Full Changelog**: https://github.com/
|
|
146
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
117
147
|
|
|
118
148
|
---
|
|
119
149
|
|
|
120
|
-
## [v0.1.24](https://github.com/
|
|
150
|
+
## [v0.1.24](https://github.com/Bejibun-Framework/bejibun-redis/compare/v0.1.23...v0.1.24) - 2025-10-16
|
|
121
151
|
|
|
122
152
|
### 🩹 Fixes
|
|
123
153
|
|
|
@@ -129,11 +159,11 @@ What's New :
|
|
|
129
159
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
130
160
|
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
131
161
|
|
|
132
|
-
**Full Changelog**: https://github.com/
|
|
162
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
133
163
|
|
|
134
164
|
---
|
|
135
165
|
|
|
136
|
-
## [v0.1.23](https://github.com/
|
|
166
|
+
## [v0.1.23](https://github.com/Bejibun-Framework/bejibun-redis/compare/v0.1.0...v0.1.23) - 2025-10-15
|
|
137
167
|
|
|
138
168
|
### 🩹 Fixes
|
|
139
169
|
|
|
@@ -144,11 +174,11 @@ Update build indexing
|
|
|
144
174
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
145
175
|
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
146
176
|
|
|
147
|
-
**Full Changelog**: https://github.com/
|
|
177
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
148
178
|
|
|
149
179
|
---
|
|
150
180
|
|
|
151
|
-
## [v0.1.0](https://github.com/
|
|
181
|
+
## [v0.1.0](https://github.com/Bejibun-Framework/bejibun-redis/compare/v0.1.0...v0.1.0) - 2025-10-12
|
|
152
182
|
|
|
153
183
|
### 🩹 Fixes
|
|
154
184
|
|
|
@@ -174,4 +204,4 @@ Available Redis :
|
|
|
174
204
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
175
205
|
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
176
206
|
|
|
177
|
-
**Full Changelog**: https://github.com/
|
|
207
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
<img src="https://github.com/
|
|
3
|
+
<img src="https://github.com/Bejibun-Framework/bejibun/blob/master/public/images/bejibun.png?raw=true" width="150" alt="Bejibun" />
|
|
4
4
|
|
|
5
|
-
](https://img.shields.io/github/v/release/
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
10
10
|
|
|
11
11
|
</div>
|
|
12
12
|
|
|
@@ -69,11 +69,23 @@ import Redis from "@bejibun/redis";
|
|
|
69
69
|
export default class TestController extends BaseController {
|
|
70
70
|
public async redis(request: Bun.BunRequest): Promise<Response> {
|
|
71
71
|
await Redis.set("redis", {hello: "world"});
|
|
72
|
+
|
|
73
|
+
const keys = await Redis.keys("pattern");
|
|
74
|
+
|
|
72
75
|
const redis = await Redis.get("redis");
|
|
73
76
|
|
|
74
77
|
await Redis.connection("local").set("connection", "This is using custom connection.");
|
|
75
78
|
const connection = await Redis.connection("local").get("connection");
|
|
76
79
|
|
|
80
|
+
await Redis.setClient({
|
|
81
|
+
host: "127.0.0.1",
|
|
82
|
+
port: 6379,
|
|
83
|
+
password: "",
|
|
84
|
+
database: 0,
|
|
85
|
+
maxRetries: 10
|
|
86
|
+
}, "optional-connection-name").set("redis", {hello: "world"});
|
|
87
|
+
// for publish and subscibe recommended using custom connection name to make sure connection matched
|
|
88
|
+
|
|
77
89
|
const pipeline = await Redis.pipeline((pipe: RedisPipeline) => {
|
|
78
90
|
pipe.set("redis-pipeline-1", "This is redis pipeline 1");
|
|
79
91
|
pipe.set("redis-pipeline-2", "This is redis pipeline 2");
|
|
@@ -105,7 +117,7 @@ If you find this project helpful and want to support it, you can donate via cryp
|
|
|
105
117
|
|
|
106
118
|
| EVM | Solana |
|
|
107
119
|
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
|
108
|
-
| <img src="https://github.com/
|
|
120
|
+
| <img src="https://github.com/Bejibun-Framework/bejibun/blob/master/public/images/EVM.png?raw=true" width="150" /> | <img src="https://github.com/Bejibun-Framework/bejibun/blob/master/public/images/SOL.png?raw=true" width="150" /> |
|
|
109
121
|
| 0xdABe8750061410D35cE52EB2a418c8cB004788B3 | GAnoyvy9p3QFyxikWDh9hA3fmSk2uiPLNWyQ579cckMn |
|
|
110
122
|
|
|
111
123
|
Or you can buy this `$BJBN (Bejibun)` tokens [here](https://pump.fun/coin/CQhbNnCGKfDaKXt8uE61i5DrBYJV7NPsCDD9vQgypump), beware of bots.
|
|
@@ -2,16 +2,17 @@ import type { RedisConfig, RedisPipeline, RedisSubscribe } from "../types/redis"
|
|
|
2
2
|
export default class RedisBuilder {
|
|
3
3
|
private static clients;
|
|
4
4
|
private static emitter;
|
|
5
|
-
static setClient(cfg: RedisConfig): Record<string, Function>;
|
|
5
|
+
static setClient(cfg: RedisConfig, name?: string): Record<string, Function>;
|
|
6
6
|
static connection(name: string): Record<string, Function>;
|
|
7
7
|
static connect(name?: string): Promise<Bun.RedisClient>;
|
|
8
8
|
static disconnect(name?: string): Promise<void>;
|
|
9
|
-
static
|
|
10
|
-
static
|
|
11
|
-
static
|
|
9
|
+
static keys(pattern: string, connection?: string, disconnectAfter?: boolean): Promise<Array<string>>;
|
|
10
|
+
static get(key: Bun.RedisClient.KeyLike, connection?: string, disconnectAfter?: boolean): Promise<any>;
|
|
11
|
+
static set(key: Bun.RedisClient.KeyLike, value: any, ttl?: number, connection?: string, disconnectAfter?: boolean): Promise<number | "OK">;
|
|
12
|
+
static del(key: Bun.RedisClient.KeyLike, connection?: string, disconnectAfter?: boolean): Promise<number>;
|
|
12
13
|
static publish(channel: string, message: any, connection?: string): Promise<number>;
|
|
13
14
|
static subscribe(channel: string, listener: Bun.RedisClient.StringPubSubListener, connection?: string): Promise<RedisSubscribe>;
|
|
14
|
-
static pipeline(fn: (pipe: RedisPipeline) => void, connection?: string): Promise<any[]>;
|
|
15
|
+
static pipeline(fn: (pipe: RedisPipeline) => void, connection?: string, disconnectAfter?: boolean): Promise<any[]>;
|
|
15
16
|
static on(event: "connect" | "disconnect" | "error", listener: (...args: Array<any>) => void): void;
|
|
16
17
|
static off(event: "connect" | "disconnect" | "error", listener: (...args: Array<any>) => void): void;
|
|
17
18
|
private static get config();
|
package/builders/RedisBuilder.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import App from "@bejibun/app";
|
|
2
2
|
import Logger from "@bejibun/logger";
|
|
3
3
|
import { defineValue, isEmpty, isNotEmpty } from "@bejibun/utils";
|
|
4
|
+
import Str from "@bejibun/utils/facades/Str";
|
|
4
5
|
import { EventEmitter } from "events";
|
|
5
6
|
import fs from "fs";
|
|
6
7
|
import RedisConf from "../config/redis";
|
|
@@ -8,18 +9,15 @@ import RedisException from "../exceptions/RedisException";
|
|
|
8
9
|
export default class RedisBuilder {
|
|
9
10
|
static clients = {};
|
|
10
11
|
static emitter = new EventEmitter();
|
|
11
|
-
static setClient(cfg) {
|
|
12
|
-
const connectionName =
|
|
13
|
-
this.
|
|
14
|
-
if (isEmpty(this.clients[connectionName])) {
|
|
15
|
-
this.clients[connectionName] = this.createClient(connectionName, cfg);
|
|
16
|
-
}
|
|
12
|
+
static setClient(cfg, name) {
|
|
13
|
+
const connectionName = defineValue(name, Str.random());
|
|
14
|
+
this.clients[connectionName] = this.createClient(connectionName, cfg);
|
|
17
15
|
return {
|
|
18
|
-
del: (key) => this.del(key, connectionName),
|
|
19
|
-
get: (key) => this.get(key, connectionName),
|
|
20
|
-
pipeline: (fn) => this.pipeline(fn, connectionName),
|
|
16
|
+
del: (key) => this.del(key, connectionName, isNotEmpty(name)),
|
|
17
|
+
get: (key) => this.get(key, connectionName, isNotEmpty(name)),
|
|
18
|
+
pipeline: (fn) => this.pipeline(fn, connectionName, isNotEmpty(name)),
|
|
21
19
|
publish: (channel, message) => this.publish(channel, message, connectionName),
|
|
22
|
-
set: (key, value, ttl) => this.set(key, value, ttl, connectionName),
|
|
20
|
+
set: (key, value, ttl) => this.set(key, value, ttl, connectionName, isNotEmpty(name)),
|
|
23
21
|
subscribe: (channel, listener) => this.subscribe(channel, listener, connectionName),
|
|
24
22
|
};
|
|
25
23
|
}
|
|
@@ -57,9 +55,23 @@ export default class RedisBuilder {
|
|
|
57
55
|
this.clients = {};
|
|
58
56
|
}
|
|
59
57
|
}
|
|
60
|
-
static async
|
|
58
|
+
static async keys(pattern, connection, disconnectAfter) {
|
|
59
|
+
try {
|
|
60
|
+
const response = await this.getClient(connection).keys(pattern);
|
|
61
|
+
if (disconnectAfter)
|
|
62
|
+
await this.disconnect(connection);
|
|
63
|
+
return response;
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
Logger.setContext("Redis").error("Failed to get value.").trace(error);
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
static async get(key, connection, disconnectAfter) {
|
|
61
71
|
try {
|
|
62
72
|
const response = await this.getClient(connection).get(key);
|
|
73
|
+
if (disconnectAfter)
|
|
74
|
+
await this.disconnect(connection);
|
|
63
75
|
return this.deserialize(response);
|
|
64
76
|
}
|
|
65
77
|
catch (error) {
|
|
@@ -67,13 +79,15 @@ export default class RedisBuilder {
|
|
|
67
79
|
return null;
|
|
68
80
|
}
|
|
69
81
|
}
|
|
70
|
-
static async set(key, value, ttl, connection) {
|
|
82
|
+
static async set(key, value, ttl, connection, disconnectAfter) {
|
|
71
83
|
try {
|
|
72
84
|
const client = this.getClient(connection);
|
|
73
85
|
const serialized = this.serialize(value);
|
|
74
86
|
const data = await client.set(key, serialized);
|
|
75
87
|
if (isNotEmpty(ttl))
|
|
76
88
|
return await client.expire(key, ttl);
|
|
89
|
+
if (disconnectAfter)
|
|
90
|
+
await this.disconnect(connection);
|
|
77
91
|
return data;
|
|
78
92
|
}
|
|
79
93
|
catch (error) {
|
|
@@ -81,9 +95,12 @@ export default class RedisBuilder {
|
|
|
81
95
|
return 0;
|
|
82
96
|
}
|
|
83
97
|
}
|
|
84
|
-
static async del(key, connection) {
|
|
98
|
+
static async del(key, connection, disconnectAfter) {
|
|
85
99
|
try {
|
|
86
|
-
|
|
100
|
+
const data = await this.getClient(connection).del(key);
|
|
101
|
+
if (disconnectAfter)
|
|
102
|
+
await this.disconnect(connection);
|
|
103
|
+
return data;
|
|
87
104
|
}
|
|
88
105
|
catch (error) {
|
|
89
106
|
Logger.setContext("Redis").error("Failed to delete key.").trace(error);
|
|
@@ -127,7 +144,7 @@ export default class RedisBuilder {
|
|
|
127
144
|
unsubscribe: unsubscribe
|
|
128
145
|
};
|
|
129
146
|
}
|
|
130
|
-
static async pipeline(fn, connection) {
|
|
147
|
+
static async pipeline(fn, connection, disconnectAfter) {
|
|
131
148
|
const client = this.getClient(connection);
|
|
132
149
|
const ops = [];
|
|
133
150
|
const pipe = {
|
|
@@ -147,6 +164,8 @@ export default class RedisBuilder {
|
|
|
147
164
|
};
|
|
148
165
|
fn(pipe);
|
|
149
166
|
const results = await Promise.all(ops);
|
|
167
|
+
if (disconnectAfter)
|
|
168
|
+
await this.disconnect(connection);
|
|
150
169
|
return results.map((result) => this.deserialize(result));
|
|
151
170
|
}
|
|
152
171
|
static on(event, listener) {
|
package/facades/Redis.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { RedisConfig, RedisPipeline, RedisSubscribe } from "../types/redis";
|
|
2
2
|
export default class Redis {
|
|
3
|
-
static setClient(cfg: RedisConfig): Record<string, Function>;
|
|
3
|
+
static setClient(cfg: RedisConfig, name?: string): Record<string, Function>;
|
|
4
4
|
static connection(name: string): Record<string, Function>;
|
|
5
5
|
static connect(name?: string): Promise<Bun.RedisClient>;
|
|
6
6
|
static disconnect(name?: string): Promise<void>;
|
|
7
|
+
static keys(pattern: string, connection?: string): Promise<Array<string>>;
|
|
7
8
|
static get(key: Bun.RedisClient.KeyLike, connection?: string): Promise<any>;
|
|
8
9
|
static set(key: Bun.RedisClient.KeyLike, value: any, ttl?: number, connection?: string): Promise<number | "OK">;
|
|
9
10
|
static del(key: Bun.RedisClient.KeyLike, connection?: string): Promise<number>;
|
package/facades/Redis.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import RedisBuilder from "../builders/RedisBuilder";
|
|
2
2
|
export default class Redis {
|
|
3
|
-
static setClient(cfg) {
|
|
4
|
-
return RedisBuilder.setClient(cfg);
|
|
3
|
+
static setClient(cfg, name) {
|
|
4
|
+
return RedisBuilder.setClient(cfg, name);
|
|
5
5
|
}
|
|
6
6
|
static connection(name) {
|
|
7
7
|
return RedisBuilder.connection(name);
|
|
@@ -12,6 +12,9 @@ export default class Redis {
|
|
|
12
12
|
static async disconnect(name) {
|
|
13
13
|
return RedisBuilder.disconnect(name);
|
|
14
14
|
}
|
|
15
|
+
static async keys(pattern, connection) {
|
|
16
|
+
return RedisBuilder.keys(pattern, connection);
|
|
17
|
+
}
|
|
15
18
|
static async get(key, connection) {
|
|
16
19
|
return RedisBuilder.get(key, connection);
|
|
17
20
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bejibun/redis",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.37",
|
|
4
4
|
"author": "Havea Crenata <havea.crenata@gmail.com>",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/
|
|
7
|
+
"url": "git+https://github.com/Bejibun-Framework/bejibun-redis.git"
|
|
8
8
|
},
|
|
9
9
|
"main": "index.js",
|
|
10
10
|
"module": "index.js",
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"tsc-alias": "^1.8.16"
|
|
14
14
|
},
|
|
15
15
|
"bugs": {
|
|
16
|
-
"url": "https://github.com/
|
|
16
|
+
"url": "https://github.com/Bejibun-Framework/bejibun-redis/issues"
|
|
17
17
|
},
|
|
18
18
|
"description": "Redis for Bejibun Framework",
|
|
19
|
-
"homepage": "https://github.com/
|
|
19
|
+
"homepage": "https://github.com/Bejibun-Framework/bejibun-redis#readme",
|
|
20
20
|
"keywords": [
|
|
21
21
|
"bun",
|
|
22
22
|
"bun framework",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"type": "module",
|
|
37
37
|
"types": "index.d.ts",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@bejibun/app": "^0.1.
|
|
39
|
+
"@bejibun/app": "^0.1.23",
|
|
40
40
|
"@bejibun/logger": "^0.1.22",
|
|
41
|
-
"@bejibun/utils": "^0.1.
|
|
41
|
+
"@bejibun/utils": "^0.1.28"
|
|
42
42
|
}
|
|
43
43
|
}
|