@bejibun/redis 0.1.36 → 0.1.38
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 +39 -25
- package/LICENSE +1 -1
- package/README.md +10 -7
- package/builders/RedisBuilder.d.ts +1 -0
- package/builders/RedisBuilder.js +14 -0
- package/facades/Redis.d.ts +1 -0
- package/facades/Redis.js +3 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,23 +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.38](https://github.com/Bejibun-Framework/bejibun-redis/compare/v0.1.36...v0.1.38) - 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
|
|
7
21
|
|
|
8
22
|
### 🩹 Fixes
|
|
9
23
|
|
|
10
24
|
### 📖 Changes
|
|
11
25
|
- Set random connection name for `.setClient()` and disconnect after used then clear the connection lists.
|
|
12
26
|
|
|
13
|
-
#### Upgrade [@bejibun/utils](https://github.com/
|
|
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)
|
|
14
28
|
|
|
15
29
|
### ❤️Contributors
|
|
16
30
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
17
31
|
|
|
18
|
-
**Full Changelog**: https://github.com/
|
|
32
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
19
33
|
|
|
20
34
|
---
|
|
21
35
|
|
|
22
|
-
## [v0.1.35](https://github.com/
|
|
36
|
+
## [v0.1.35](https://github.com/Bejibun-Framework/bejibun-redis/compare/v0.1.34...v0.1.35) - 2025-12-07
|
|
23
37
|
|
|
24
38
|
### 🩹 Fixes
|
|
25
39
|
|
|
@@ -27,21 +41,21 @@ All notable changes to this project will be documented in this file.
|
|
|
27
41
|
What's New :
|
|
28
42
|
- Adding `.setClient(cfg: RedisConfig)` to override connection.
|
|
29
43
|
|
|
30
|
-
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`.
|
|
31
45
|
|
|
32
46
|
Now, you can override it by using `setClient()`.
|
|
33
47
|
|
|
34
|
-
#### 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)
|
|
35
49
|
- Fix empty validation for class
|
|
36
50
|
|
|
37
51
|
### ❤️Contributors
|
|
38
52
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
39
53
|
|
|
40
|
-
**Full Changelog**: https://github.com/
|
|
54
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
41
55
|
|
|
42
56
|
---
|
|
43
57
|
|
|
44
|
-
## [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
|
|
45
59
|
|
|
46
60
|
### 🩹 Fixes
|
|
47
61
|
- Fix redis ttl
|
|
@@ -51,11 +65,11 @@ Now, you can override it by using `setClient()`.
|
|
|
51
65
|
### ❤️Contributors
|
|
52
66
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
53
67
|
|
|
54
|
-
**Full Changelog**: https://github.com/
|
|
68
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
55
69
|
|
|
56
70
|
---
|
|
57
71
|
|
|
58
|
-
## [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
|
|
59
73
|
|
|
60
74
|
### 🩹 Fixes
|
|
61
75
|
- Fix redis configuration
|
|
@@ -65,11 +79,11 @@ Now, you can override it by using `setClient()`.
|
|
|
65
79
|
### ❤️Contributors
|
|
66
80
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
67
81
|
|
|
68
|
-
**Full Changelog**: https://github.com/
|
|
82
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
69
83
|
|
|
70
84
|
---
|
|
71
85
|
|
|
72
|
-
## [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
|
|
73
87
|
|
|
74
88
|
### 🩹 Fixes
|
|
75
89
|
- Fix `configure.ts` configuration file
|
|
@@ -80,11 +94,11 @@ Now, you can override it by using `setClient()`.
|
|
|
80
94
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
81
95
|
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
82
96
|
|
|
83
|
-
**Full Changelog**: https://github.com/
|
|
97
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
84
98
|
|
|
85
99
|
---
|
|
86
100
|
|
|
87
|
-
## [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
|
|
88
102
|
|
|
89
103
|
### 🩹 Fixes
|
|
90
104
|
|
|
@@ -96,11 +110,11 @@ What's New :
|
|
|
96
110
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
97
111
|
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
98
112
|
|
|
99
|
-
**Full Changelog**: https://github.com/
|
|
113
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
100
114
|
|
|
101
115
|
---
|
|
102
116
|
|
|
103
|
-
## [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
|
|
104
118
|
|
|
105
119
|
### 🩹 Fixes
|
|
106
120
|
|
|
@@ -113,11 +127,11 @@ Chore :
|
|
|
113
127
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
114
128
|
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
115
129
|
|
|
116
|
-
**Full Changelog**: https://github.com/
|
|
130
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
117
131
|
|
|
118
132
|
---
|
|
119
133
|
|
|
120
|
-
## [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
|
|
121
135
|
|
|
122
136
|
### 🩹 Fixes
|
|
123
137
|
|
|
@@ -129,11 +143,11 @@ What's New :
|
|
|
129
143
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
130
144
|
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
131
145
|
|
|
132
|
-
**Full Changelog**: https://github.com/
|
|
146
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
133
147
|
|
|
134
148
|
---
|
|
135
149
|
|
|
136
|
-
## [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
|
|
137
151
|
|
|
138
152
|
### 🩹 Fixes
|
|
139
153
|
|
|
@@ -145,11 +159,11 @@ What's New :
|
|
|
145
159
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
146
160
|
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
147
161
|
|
|
148
|
-
**Full Changelog**: https://github.com/
|
|
162
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
149
163
|
|
|
150
164
|
---
|
|
151
165
|
|
|
152
|
-
## [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
|
|
153
167
|
|
|
154
168
|
### 🩹 Fixes
|
|
155
169
|
|
|
@@ -160,11 +174,11 @@ Update build indexing
|
|
|
160
174
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
161
175
|
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
162
176
|
|
|
163
|
-
**Full Changelog**: https://github.com/
|
|
177
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-redis/blob/master/CHANGELOG.md
|
|
164
178
|
|
|
165
179
|
---
|
|
166
180
|
|
|
167
|
-
## [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
|
|
168
182
|
|
|
169
183
|
### 🩹 Fixes
|
|
170
184
|
|
|
@@ -190,4 +204,4 @@ Available Redis :
|
|
|
190
204
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
191
205
|
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
192
206
|
|
|
193
|
-
**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,6 +69,9 @@ 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.");
|
|
@@ -114,7 +117,7 @@ If you find this project helpful and want to support it, you can donate via cryp
|
|
|
114
117
|
|
|
115
118
|
| EVM | Solana |
|
|
116
119
|
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
|
117
|
-
| <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" /> |
|
|
118
121
|
| 0xdABe8750061410D35cE52EB2a418c8cB004788B3 | GAnoyvy9p3QFyxikWDh9hA3fmSk2uiPLNWyQ579cckMn |
|
|
119
122
|
|
|
120
123
|
Or you can buy this `$BJBN (Bejibun)` tokens [here](https://pump.fun/coin/CQhbNnCGKfDaKXt8uE61i5DrBYJV7NPsCDD9vQgypump), beware of bots.
|
|
@@ -6,6 +6,7 @@ export default class RedisBuilder {
|
|
|
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 keys(pattern: string, connection?: string, disconnectAfter?: boolean): Promise<Array<string>>;
|
|
9
10
|
static get(key: Bun.RedisClient.KeyLike, connection?: string, disconnectAfter?: boolean): Promise<any>;
|
|
10
11
|
static set(key: Bun.RedisClient.KeyLike, value: any, ttl?: number, connection?: string, disconnectAfter?: boolean): Promise<number | "OK">;
|
|
11
12
|
static del(key: Bun.RedisClient.KeyLike, connection?: string, disconnectAfter?: boolean): Promise<number>;
|
package/builders/RedisBuilder.js
CHANGED
|
@@ -15,6 +15,7 @@ export default class RedisBuilder {
|
|
|
15
15
|
return {
|
|
16
16
|
del: (key) => this.del(key, connectionName, isNotEmpty(name)),
|
|
17
17
|
get: (key) => this.get(key, connectionName, isNotEmpty(name)),
|
|
18
|
+
keys: (pattern) => this.keys(pattern, connectionName, isNotEmpty(name)),
|
|
18
19
|
pipeline: (fn) => this.pipeline(fn, connectionName, isNotEmpty(name)),
|
|
19
20
|
publish: (channel, message) => this.publish(channel, message, connectionName),
|
|
20
21
|
set: (key, value, ttl) => this.set(key, value, ttl, connectionName, isNotEmpty(name)),
|
|
@@ -25,6 +26,7 @@ export default class RedisBuilder {
|
|
|
25
26
|
return {
|
|
26
27
|
del: (key) => this.del(key, name),
|
|
27
28
|
get: (key) => this.get(key, name),
|
|
29
|
+
keys: (pattern) => this.keys(pattern, name),
|
|
28
30
|
pipeline: (fn) => this.pipeline(fn, name),
|
|
29
31
|
publish: (channel, message) => this.publish(channel, message, name),
|
|
30
32
|
set: (key, value, ttl) => this.set(key, value, ttl, name),
|
|
@@ -55,6 +57,18 @@ export default class RedisBuilder {
|
|
|
55
57
|
this.clients = {};
|
|
56
58
|
}
|
|
57
59
|
}
|
|
60
|
+
static async keys(pattern, connection, disconnectAfter) {
|
|
61
|
+
try {
|
|
62
|
+
const response = await this.getClient(connection).keys(pattern);
|
|
63
|
+
if (disconnectAfter)
|
|
64
|
+
await this.disconnect(connection);
|
|
65
|
+
return response;
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
Logger.setContext("Redis").error("Failed to get value.").trace(error);
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
58
72
|
static async get(key, connection, disconnectAfter) {
|
|
59
73
|
try {
|
|
60
74
|
const response = await this.getClient(connection).get(key);
|
package/facades/Redis.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export default class Redis {
|
|
|
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
|
@@ -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.38",
|
|
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
|
}
|