effect-redis 0.0.10 → 0.0.11
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 +9 -9
- package/dist/redis.d.ts +14 -7
- package/package.json +35 -31
package/dist/redis.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ interface RedisConnectionOptionsShape {
|
|
|
14
14
|
declare const RedisConnectionOptions_base: Context.TagClass<RedisConnectionOptions, "RedisConnectionOptions", RedisConnectionOptionsShape>;
|
|
15
15
|
declare class RedisConnectionOptions extends RedisConnectionOptions_base {
|
|
16
16
|
}
|
|
17
|
-
declare const RedisConnectionOptionsLive: (options?: Parameters<typeof createClient>[0]) => Layer.Layer<RedisConnectionOptions, never, never>;
|
|
18
17
|
interface RedisShape {
|
|
19
18
|
use: <T>(fn: (client: ReturnType<typeof createClient>) => T) => Effect.Effect<Awaited<T>, RedisError, never>;
|
|
20
19
|
}
|
|
@@ -30,6 +29,9 @@ declare class RedisPubSub extends RedisPubSub_base {
|
|
|
30
29
|
}
|
|
31
30
|
interface RedisPersistenceShape {
|
|
32
31
|
setValue: (key: string, value: string) => Effect.Effect<void, RedisError, never>;
|
|
32
|
+
getValue: (key: string) => Effect.Effect<string | null, RedisError, never>;
|
|
33
|
+
del: (key: string) => Effect.Effect<number, RedisError, never>;
|
|
34
|
+
exists: (key: string) => Effect.Effect<boolean, RedisError, never>;
|
|
33
35
|
sAdd: (key: string, members: string[]) => Effect.Effect<void, RedisError, never>;
|
|
34
36
|
}
|
|
35
37
|
declare const RedisPersistence_base: Context.TagClass<RedisPersistence, "RedisPersistence", RedisPersistenceShape>;
|
|
@@ -40,19 +42,24 @@ export interface StreamEntry {
|
|
|
40
42
|
message: Record<string, string>;
|
|
41
43
|
}
|
|
42
44
|
interface RedisStreamShape {
|
|
43
|
-
xadd: (key: RedisArgument,
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
xadd: (key: RedisArgument, // Stream key name
|
|
46
|
+
id: RedisArgument | '*', // Entry ID or '*' for auto-generation
|
|
47
|
+
message: Record<string, RedisArgument>) => Effect.Effect<string, RedisError, never>;
|
|
48
|
+
xread: (key: RedisArgument, // Stream key to read from
|
|
49
|
+
id: RedisArgument, // Start reading from this ID ('$' for new entries only)
|
|
50
|
+
block?: number, // Block in milliseconds (0 for indefinite wait)
|
|
46
51
|
count?: number) => Effect.Effect<StreamEntry[], RedisError, never>;
|
|
47
|
-
xrange: (key: RedisArgument,
|
|
48
|
-
|
|
52
|
+
xrange: (key: RedisArgument, // Stream key name
|
|
53
|
+
start: RedisArgument, // Start ID ('-' for earliest available)
|
|
54
|
+
end: RedisArgument, // End ID ('+' for latest available)
|
|
49
55
|
count?: number) => Effect.Effect<StreamEntry[], RedisError, never>;
|
|
50
56
|
}
|
|
51
57
|
declare const RedisStream_base: Context.TagClass<RedisStream, "RedisStream", RedisStreamShape>;
|
|
52
58
|
declare class RedisStream extends RedisStream_base {
|
|
53
59
|
}
|
|
60
|
+
declare const RedisConnectionOptionsLive: (options?: Parameters<typeof createClient>[0]) => Layer.Layer<RedisConnectionOptions, never, never>;
|
|
54
61
|
declare const RedisLive: Layer.Layer<Redis, RedisError, RedisConnectionOptions>;
|
|
55
|
-
declare const RedisPersistenceLive: Layer.Layer<RedisPersistence, RedisError, RedisConnectionOptions>;
|
|
56
62
|
declare const RedisPubSubLive: Layer.Layer<RedisPubSub, RedisError, RedisConnectionOptions>;
|
|
63
|
+
declare const RedisPersistenceLive: Layer.Layer<RedisPersistence, RedisError, RedisConnectionOptions>;
|
|
57
64
|
declare const RedisStreamLive: Layer.Layer<RedisStream, RedisError, RedisConnectionOptions>;
|
|
58
65
|
export { RedisPersistence, RedisPubSub, RedisConnectionOptions, Redis, RedisStream, RedisPersistenceLive, RedisPubSubLive, RedisConnectionOptionsLive, RedisLive, RedisStreamLive, };
|
package/package.json
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "effect-redis",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Simple Effect wrapper for Redis.",
|
|
5
|
-
"module": "dist/index.js",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"type": "module",
|
|
9
|
-
"files": [
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "effect-redis",
|
|
3
|
+
"version": "0.0.11",
|
|
4
|
+
"description": "Simple Effect wrapper for Redis.",
|
|
5
|
+
"module": "dist/index.js",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build:main": "bun build --minify-syntax --minify-whitespace ./src/index.ts --outdir ./dist --target node --format esm",
|
|
15
|
+
"build:types": "bun tsc --emitDeclarationOnly --outDir dist",
|
|
16
|
+
"build": "bun run build:main && bun run build:types",
|
|
17
|
+
"prepublishOnly": "bun run build",
|
|
18
|
+
"test": "vitest run --passWithNoTests",
|
|
19
|
+
"format": "biome format --write ./src",
|
|
20
|
+
"lint": "biome lint ."
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@biomejs/biome": "^2.1.2",
|
|
24
|
+
"@types/bun": "latest",
|
|
25
|
+
"vitest": "^3.2.4"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"effect": "^3.17.1",
|
|
29
|
+
"redis": "^5.1.0",
|
|
30
|
+
"typescript": "^5"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@effect/platform-bun": "^0.77.0"
|
|
34
|
+
}
|
|
35
|
+
}
|