@rcrsr/rill-ext-kv-redis 0.8.5 → 0.9.0
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/README.md +24 -8
- package/dist/index.d.ts +2 -1
- package/dist/index.js +9 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -1,31 +1,47 @@
|
|
|
1
1
|
# @rcrsr/rill-ext-kv-redis
|
|
2
2
|
|
|
3
|
-
Redis
|
|
3
|
+
[rill](https://rill.run) extension for Redis key-value storage. Provides persistent key-value operations with TTL support, SCAN-based key listing, and TLS connectivity.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> **Experimental.** Breaking changes will occur before stabilization.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
10
|
npm install @rcrsr/rill-ext-kv-redis
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
**Peer dependencies:** `@rcrsr/rill`
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
12
16
|
|
|
13
17
|
```typescript
|
|
18
|
+
import { createRuntimeContext, prefixFunctions } from '@rcrsr/rill';
|
|
14
19
|
import { createRedisKvExtension } from '@rcrsr/rill-ext-kv-redis';
|
|
15
20
|
|
|
16
|
-
const
|
|
21
|
+
const ext = createRedisKvExtension({
|
|
17
22
|
url: 'redis://localhost:6379',
|
|
18
23
|
mounts: {
|
|
19
|
-
|
|
24
|
+
user: {
|
|
25
|
+
mode: 'read-write',
|
|
26
|
+
prefix: 'app:user:',
|
|
27
|
+
},
|
|
20
28
|
},
|
|
21
|
-
maxStoreSize: 1000000,
|
|
22
|
-
writePolicy: 'dispose',
|
|
23
29
|
});
|
|
30
|
+
const functions = prefixFunctions('kv', ext);
|
|
31
|
+
const ctx = createRuntimeContext({ functions });
|
|
32
|
+
|
|
33
|
+
// Script: kv::set("user", "name", "Alice")
|
|
24
34
|
```
|
|
25
35
|
|
|
26
36
|
## Documentation
|
|
27
37
|
|
|
28
|
-
|
|
38
|
+
See [full documentation](docs/extension-kv-redis.md) for configuration, functions, mount options, and error handling.
|
|
39
|
+
|
|
40
|
+
## Related
|
|
41
|
+
|
|
42
|
+
- [rill](https://github.com/rcrsr/rill) — Core language runtime
|
|
43
|
+
- [Extensions Guide](https://github.com/rcrsr/rill/blob/main/docs/integration-extensions.md) — Extension contract and patterns
|
|
44
|
+
- [Host API Reference](https://github.com/rcrsr/rill/blob/main/docs/ref-host-api.md) — Runtime context and host functions
|
|
29
45
|
|
|
30
46
|
## License
|
|
31
47
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
-
import { ExtensionResult, SchemaEntry } from '@rcrsr/rill';
|
|
3
|
+
import { ExtensionConfigSchema, ExtensionResult, SchemaEntry } from '@rcrsr/rill';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Configuration for a single Redis kv mount.
|
|
@@ -187,6 +187,7 @@ export interface RedisKvExtensionConfig {
|
|
|
187
187
|
* ```
|
|
188
188
|
*/
|
|
189
189
|
export declare function createRedisKvExtension(config: RedisKvExtensionConfig): ExtensionResult;
|
|
190
|
+
export declare const configSchema: ExtensionConfigSchema;
|
|
190
191
|
|
|
191
192
|
export {
|
|
192
193
|
SchemaEntry,
|
package/dist/index.js
CHANGED
|
@@ -34,7 +34,8 @@ function createRedisKvExtension(config) {
|
|
|
34
34
|
client = new Redis(config.url);
|
|
35
35
|
} catch (error) {
|
|
36
36
|
throw new Error(
|
|
37
|
-
`Failed to create Redis client: ${error instanceof Error ? error.message : String(error)}
|
|
37
|
+
`Failed to create Redis client: ${error instanceof Error ? error.message : String(error)}`,
|
|
38
|
+
{ cause: error }
|
|
38
39
|
);
|
|
39
40
|
}
|
|
40
41
|
client.on("error", (err) => {
|
|
@@ -420,6 +421,13 @@ function createRedisKvExtension(config) {
|
|
|
420
421
|
};
|
|
421
422
|
return result;
|
|
422
423
|
}
|
|
424
|
+
|
|
425
|
+
// src/index.ts
|
|
426
|
+
var configSchema = {
|
|
427
|
+
url: { type: "string", required: true, secret: true },
|
|
428
|
+
mounts: { type: "string" }
|
|
429
|
+
};
|
|
423
430
|
export {
|
|
431
|
+
configSchema,
|
|
424
432
|
createRedisKvExtension
|
|
425
433
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rcrsr/rill-ext-kv-redis",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "rill extension for Redis kv backend implementation",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Andre Bremer",
|
|
@@ -17,32 +17,32 @@
|
|
|
17
17
|
"scripting"
|
|
18
18
|
],
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@rcrsr/rill": "^0.
|
|
20
|
+
"@rcrsr/rill": "^0.9.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@
|
|
23
|
+
"@rcrsr/rill": "^0.9.0",
|
|
24
|
+
"@types/node": "^25.3.0",
|
|
24
25
|
"dts-bundle-generator": "^9.5.1",
|
|
25
|
-
"tsup": "^8.5.
|
|
26
|
-
"undici-types": "^7.
|
|
27
|
-
"@rcrsr/rill": "^0.8.5"
|
|
26
|
+
"tsup": "^8.5.1",
|
|
27
|
+
"undici-types": "^7.22.0"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"dist"
|
|
31
31
|
],
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
34
|
-
"url": "git+https://github.com/rcrsr/rill.git",
|
|
34
|
+
"url": "git+https://github.com/rcrsr/rill-ext.git",
|
|
35
35
|
"directory": "packages/ext/kv-redis"
|
|
36
36
|
},
|
|
37
|
-
"homepage": "https://
|
|
37
|
+
"homepage": "https://github.com/rcrsr/rill-ext/tree/main/packages/ext/kv-redis#readme",
|
|
38
38
|
"bugs": {
|
|
39
|
-
"url": "https://github.com/rcrsr/rill/issues"
|
|
39
|
+
"url": "https://github.com/rcrsr/rill-ext/issues"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"ioredis": "^5.
|
|
45
|
+
"ioredis": "^5.9.3"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "tsup && dts-bundle-generator --config dts-bundle-generator.config.cjs",
|