@bejibun/redis 0.1.12 → 0.1.13
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.
|
@@ -3,6 +3,7 @@ import { defineValue, isEmpty, isNotEmpty } from "@bejibun/core";
|
|
|
3
3
|
import { RedisClient } from "bun";
|
|
4
4
|
import { EventEmitter } from "events";
|
|
5
5
|
import config from "../config/redis";
|
|
6
|
+
import RedisException from "../exceptions/RedisException";
|
|
6
7
|
class RedisBuilder {
|
|
7
8
|
static connection(name) {
|
|
8
9
|
return {
|
package/dist/config/redis.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const config = {
|
|
2
|
-
default:
|
|
2
|
+
default: "local",
|
|
3
3
|
connections: {
|
|
4
4
|
local: {
|
|
5
|
-
host:
|
|
6
|
-
port:
|
|
7
|
-
password:
|
|
8
|
-
database:
|
|
9
|
-
maxRetries:
|
|
5
|
+
host: "127.0.0.1",
|
|
6
|
+
port: 6379,
|
|
7
|
+
password: "",
|
|
8
|
+
database: 0,
|
|
9
|
+
maxRetries: 10
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
};
|
package/dist/facades/Redis.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@/types/redis";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type RedisConfig = {
|
|
2
|
+
host: string;
|
|
3
|
+
port: number;
|
|
4
|
+
password?: string | null;
|
|
5
|
+
database?: number;
|
|
6
|
+
maxRetries?: number;
|
|
7
|
+
};
|
|
8
|
+
export type RedisPipeline = {
|
|
9
|
+
del: (key: string) => void;
|
|
10
|
+
get: (key: string) => void;
|
|
11
|
+
set: (key: string, value: any, ttl?: number) => void;
|
|
12
|
+
};
|
|
13
|
+
export type RedisSubscribe = {
|
|
14
|
+
client: RedisClient;
|
|
15
|
+
unsubscribe: () => Promise<boolean>;
|
|
16
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bejibun/redis",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Redis for Bejibun Framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bun",
|
|
@@ -27,6 +27,18 @@
|
|
|
27
27
|
".": {
|
|
28
28
|
"import": "./dist/index.js",
|
|
29
29
|
"types": "./dist/index.d.ts"
|
|
30
|
+
},
|
|
31
|
+
"./exceptions/*": {
|
|
32
|
+
"import": "./dist/exceptions/*.js",
|
|
33
|
+
"types": "./dist/exceptions/*.d.ts"
|
|
34
|
+
},
|
|
35
|
+
"./facades/*": {
|
|
36
|
+
"import": "./dist/facades/*.js",
|
|
37
|
+
"types": "./dist/facades/*.d.ts"
|
|
38
|
+
},
|
|
39
|
+
"./types/*": {
|
|
40
|
+
"import": "./dist/types/*.js",
|
|
41
|
+
"types": "./dist/types/*.d.ts"
|
|
30
42
|
}
|
|
31
43
|
},
|
|
32
44
|
"files": [
|
|
@@ -34,10 +46,11 @@
|
|
|
34
46
|
],
|
|
35
47
|
"scripts": {
|
|
36
48
|
"clean": "rm -rf dist",
|
|
37
|
-
"build": "bun run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json"
|
|
49
|
+
"build": "bun run clean && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && cp -rf src/types dist/types",
|
|
50
|
+
"deploy": "bun run build && npm publish --access public"
|
|
38
51
|
},
|
|
39
52
|
"dependencies": {
|
|
40
|
-
"@bejibun/core": "^0.1.
|
|
53
|
+
"@bejibun/core": "^0.1.23"
|
|
41
54
|
},
|
|
42
55
|
"devDependencies": {
|
|
43
56
|
"@types/bun": "latest",
|