@lowdefy/connection-redis 0.0.0-experimental-20250926130521 → 0.0.0-experimental-20251010122007
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.
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<TITLE>
|
|
2
|
+
Redis
|
|
3
|
+
</TITLE>
|
|
4
|
+
|
|
5
|
+
<DESCRIPTION>
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
- `command: string`: **Required** - Redis command to be executed, accepts all of the [out-of-the-box Redis commands](https://redis.io/commands).
|
|
10
|
+
- `parameters: array`: An array of parameters to be passed to the redis command.
|
|
11
|
+
- `modifiers: object`: The redis modififers to be passed to the redis command.
|
|
12
|
+
|
|
13
|
+
</DESCRIPTION>
|
|
14
|
+
|
|
15
|
+
<CONNECTION>
|
|
16
|
+
Redis
|
|
17
|
+
</CONNECTION>
|
|
18
|
+
|
|
19
|
+
<SCHEMA>
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
export default {
|
|
23
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
24
|
+
title: 'Lowdefy Request Schema - Redis',
|
|
25
|
+
type: 'object',
|
|
26
|
+
properties: {
|
|
27
|
+
command: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
description: 'Redis command to execute.',
|
|
30
|
+
errorMessage: {
|
|
31
|
+
type: 'Redis request property "command" should be a string.',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
parameters: {
|
|
35
|
+
type: 'array',
|
|
36
|
+
description: 'The parameters to use with the command.',
|
|
37
|
+
errorMessage: {
|
|
38
|
+
type: 'Redis request property "parameters" should be an array.',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
modifiers: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
description: 'The modifiers to use with the command.',
|
|
44
|
+
default: {},
|
|
45
|
+
errorMessage: {
|
|
46
|
+
type: 'Redis request property "modifiers" should be an object.',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
required: ['command'],
|
|
51
|
+
errorMessage: {
|
|
52
|
+
type: 'Redis request properties should be an object.',
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
</SCHEMA>
|
|
58
|
+
|
|
59
|
+
<EXAMPLES>
|
|
60
|
+
|
|
61
|
+
### Setting a key-value pair in redis
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
id: redisRequest
|
|
65
|
+
type: Redis
|
|
66
|
+
connectionId: redis
|
|
67
|
+
properties:
|
|
68
|
+
command: set
|
|
69
|
+
parameters:
|
|
70
|
+
- key
|
|
71
|
+
- value
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Getting a value from redis
|
|
75
|
+
|
|
76
|
+
```yaml
|
|
77
|
+
id: redisRequest
|
|
78
|
+
type: Redis
|
|
79
|
+
connectionId: redis
|
|
80
|
+
properties:
|
|
81
|
+
command: get
|
|
82
|
+
parameters:
|
|
83
|
+
- key
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Setting a key-value pair only if key does not exist
|
|
87
|
+
|
|
88
|
+
```yaml
|
|
89
|
+
id: redisRequest
|
|
90
|
+
type: Redis
|
|
91
|
+
connectionId: redis
|
|
92
|
+
properties:
|
|
93
|
+
command: set
|
|
94
|
+
parameters:
|
|
95
|
+
- key
|
|
96
|
+
- value
|
|
97
|
+
modififers:
|
|
98
|
+
nx: true
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
</EXAMPLES>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<TITLE>
|
|
2
|
+
Redis
|
|
3
|
+
</TITLE>
|
|
4
|
+
|
|
5
|
+
<DESCRIPTION>
|
|
6
|
+
|
|
7
|
+
[`Redis`](http://redis.io/) is an open-source, in-memory key-value data structure store. Redis offers a set of versatile in-memory data structures (strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams) that allow the creation of many custom applications. Key use cases for Redis include database, caching, session management and message broker.
|
|
8
|
+
|
|
9
|
+
Lowdefy integrates with Redis using the one of the recommended [Node.js clients (node-redis)](https://github.com/redis/node-redis).
|
|
10
|
+
|
|
11
|
+
### Properties
|
|
12
|
+
|
|
13
|
+
- `connection: object | string`: __Required__ - Connection object or string to pass to the [`redis client`](https://github.com/redis/node-redis) redis client.
|
|
14
|
+
|
|
15
|
+
The connection object accepts will be passed to the redis client verbatim, so check out the [configuration instructions](https://github.com/redis/node-redis/blob/master/docs/client-configuration.md).
|
|
16
|
+
|
|
17
|
+
</DESCRIPTION>
|
|
18
|
+
|
|
19
|
+
<REQUESTS>
|
|
20
|
+
|
|
21
|
+
- Redis
|
|
22
|
+
|
|
23
|
+
</REQUESTS>
|
|
24
|
+
|
|
25
|
+
<SCHEMA>
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
export default {
|
|
29
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
30
|
+
title: 'Lowdefy Connection Schema - Redis',
|
|
31
|
+
type: 'object',
|
|
32
|
+
properties: {
|
|
33
|
+
connection: {
|
|
34
|
+
type: ['string', 'object'],
|
|
35
|
+
description: 'Connection object or string to pass to the redis client.',
|
|
36
|
+
errorMessage: {
|
|
37
|
+
type: 'Redis connection property "connection" should be a string or object.',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
require: ['connection'],
|
|
42
|
+
errorMessage: {
|
|
43
|
+
type: 'Redis connection properties should be an object.',
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
</SCHEMA>
|
|
49
|
+
|
|
50
|
+
<EXAMPLES>
|
|
51
|
+
|
|
52
|
+
### Redis with connection object
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
connections:
|
|
56
|
+
- id: redis
|
|
57
|
+
type: Redis
|
|
58
|
+
properties:
|
|
59
|
+
connection:
|
|
60
|
+
username:
|
|
61
|
+
_secret: REDIS_USERNAME
|
|
62
|
+
password:
|
|
63
|
+
_secret: REDIS_PASSWORD
|
|
64
|
+
database:
|
|
65
|
+
_secret: REDIS_DATABASE
|
|
66
|
+
socket:
|
|
67
|
+
host:
|
|
68
|
+
_secret: REDIS_HOST
|
|
69
|
+
port:
|
|
70
|
+
_secret: REDIS_PORT
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Environment variables:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
LOWDEFY_SECRET_REDIS_USERNAME = user
|
|
77
|
+
LOWDEFY_SECRET_REDIS_PASSWORD = password
|
|
78
|
+
LOWDEFY_SECRET_REDIS_DATABASE = 4
|
|
79
|
+
LOWDEFY_SECRET_REDIS_HOST = redis.server.com
|
|
80
|
+
LOWDEFY_SECRET_REDIS_PORT = 5000
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Redis with connection string
|
|
84
|
+
|
|
85
|
+
```yaml
|
|
86
|
+
connections:
|
|
87
|
+
- id: redis
|
|
88
|
+
type: Redis
|
|
89
|
+
properties:
|
|
90
|
+
connection:
|
|
91
|
+
_secret: REDIS_CONNECTION_STRING
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Environment variables:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
LOWDEFY_SECRET_REDIS_CONNECTION_STRING = redis://user:password@redis:server.com:5000/4'
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
</EXAMPLES>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/connection-redis",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20251010122007",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"dist/*"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@lowdefy/helpers": "0.0.0-experimental-
|
|
42
|
+
"@lowdefy/helpers": "0.0.0-experimental-20251010122007",
|
|
43
43
|
"redis": "4.6.11"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@jest/globals": "28.1.3",
|
|
47
|
-
"@lowdefy/ajv": "0.0.0-experimental-
|
|
47
|
+
"@lowdefy/ajv": "0.0.0-experimental-20251010122007",
|
|
48
48
|
"@swc/cli": "0.1.63",
|
|
49
49
|
"@swc/core": "1.3.99",
|
|
50
50
|
"@swc/jest": "0.2.29",
|