node-red-contrib-redis-variable 1.0.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/LICENSE +21 -0
- package/README.md +769 -0
- package/examples/example.json +427 -0
- package/package.json +46 -0
- package/redis-variable-config.html +731 -0
- package/redis-variable-config.js +363 -0
- package/redis-variable.html +284 -0
- package/redis-variable.js +621 -0
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "universal-examples",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "Universal Payload Examples",
|
|
6
|
+
"disabled": false,
|
|
7
|
+
"info": "Examples using universal payload format with automatic JSON handling"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "get-simple",
|
|
11
|
+
"type": "inject",
|
|
12
|
+
"z": "universal-examples",
|
|
13
|
+
"name": "GET (simple)",
|
|
14
|
+
"props": [
|
|
15
|
+
{
|
|
16
|
+
"p": "payload",
|
|
17
|
+
"v": "user:123",
|
|
18
|
+
"vt": "str"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"repeat": "",
|
|
22
|
+
"crontab": "",
|
|
23
|
+
"once": false,
|
|
24
|
+
"onceDelay": 0.1,
|
|
25
|
+
"x": 120,
|
|
26
|
+
"y": 60,
|
|
27
|
+
"wires": [["get-node"]]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "get-object",
|
|
31
|
+
"type": "inject",
|
|
32
|
+
"z": "universal-examples",
|
|
33
|
+
"name": "GET (object)",
|
|
34
|
+
"props": [
|
|
35
|
+
{
|
|
36
|
+
"p": "payload",
|
|
37
|
+
"v": "{\"key\":\"user:123\"}",
|
|
38
|
+
"vt": "json"
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"repeat": "",
|
|
42
|
+
"crontab": "",
|
|
43
|
+
"once": false,
|
|
44
|
+
"onceDelay": 0.1,
|
|
45
|
+
"x": 120,
|
|
46
|
+
"y": 100,
|
|
47
|
+
"wires": [["get-node"]]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "get-node",
|
|
51
|
+
"type": "redis-variable",
|
|
52
|
+
"z": "universal-examples",
|
|
53
|
+
"name": "GET",
|
|
54
|
+
"redisConfig": "redis-config",
|
|
55
|
+
"operation": "get",
|
|
56
|
+
"x": 290,
|
|
57
|
+
"y": 80,
|
|
58
|
+
"wires": [["debug-output"]]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "set-simple",
|
|
62
|
+
"type": "inject",
|
|
63
|
+
"z": "universal-examples",
|
|
64
|
+
"name": "SET with value",
|
|
65
|
+
"props": [
|
|
66
|
+
{
|
|
67
|
+
"p": "payload",
|
|
68
|
+
"v": "{\"key\":\"user:123\",\"value\":\"John Doe\"}",
|
|
69
|
+
"vt": "json"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"repeat": "",
|
|
73
|
+
"crontab": "",
|
|
74
|
+
"once": false,
|
|
75
|
+
"onceDelay": 0.1,
|
|
76
|
+
"x": 130,
|
|
77
|
+
"y": 160,
|
|
78
|
+
"wires": [["set-node"]]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"id": "set-ttl",
|
|
82
|
+
"type": "inject",
|
|
83
|
+
"z": "universal-examples",
|
|
84
|
+
"name": "SET with TTL",
|
|
85
|
+
"props": [
|
|
86
|
+
{
|
|
87
|
+
"p": "payload",
|
|
88
|
+
"v": "{\"key\":\"session:abc123\",\"value\":{\"userId\":42,\"role\":\"admin\"},\"ttl\":3600}",
|
|
89
|
+
"vt": "json"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"repeat": "",
|
|
93
|
+
"crontab": "",
|
|
94
|
+
"once": false,
|
|
95
|
+
"onceDelay": 0.1,
|
|
96
|
+
"x": 120,
|
|
97
|
+
"y": 200,
|
|
98
|
+
"wires": [["set-node"]]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"id": "set-node",
|
|
102
|
+
"type": "redis-variable",
|
|
103
|
+
"z": "universal-examples",
|
|
104
|
+
"name": "SET",
|
|
105
|
+
"redisConfig": "redis-config",
|
|
106
|
+
"operation": "set",
|
|
107
|
+
"x": 290,
|
|
108
|
+
"y": 180,
|
|
109
|
+
"wires": [["debug-output"]]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"id": "counter-incr",
|
|
113
|
+
"type": "inject",
|
|
114
|
+
"z": "universal-examples",
|
|
115
|
+
"name": "INCR (simple)",
|
|
116
|
+
"props": [
|
|
117
|
+
{
|
|
118
|
+
"p": "payload",
|
|
119
|
+
"v": "page:views",
|
|
120
|
+
"vt": "str"
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"repeat": "",
|
|
124
|
+
"crontab": "",
|
|
125
|
+
"once": false,
|
|
126
|
+
"onceDelay": 0.1,
|
|
127
|
+
"x": 130,
|
|
128
|
+
"y": 260,
|
|
129
|
+
"wires": [["incr-node"]]
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"id": "counter-incrby",
|
|
133
|
+
"type": "inject",
|
|
134
|
+
"z": "universal-examples",
|
|
135
|
+
"name": "INCRBY amount",
|
|
136
|
+
"props": [
|
|
137
|
+
{
|
|
138
|
+
"p": "payload",
|
|
139
|
+
"v": "{\"key\":\"score:player1\",\"amount\":100}",
|
|
140
|
+
"vt": "json"
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"repeat": "",
|
|
144
|
+
"crontab": "",
|
|
145
|
+
"once": false,
|
|
146
|
+
"onceDelay": 0.1,
|
|
147
|
+
"x": 130,
|
|
148
|
+
"y": 300,
|
|
149
|
+
"wires": [["incrby-node"]]
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"id": "incr-node",
|
|
153
|
+
"type": "redis-variable",
|
|
154
|
+
"z": "universal-examples",
|
|
155
|
+
"name": "INCR",
|
|
156
|
+
"redisConfig": "redis-config",
|
|
157
|
+
"operation": "incr",
|
|
158
|
+
"x": 290,
|
|
159
|
+
"y": 260,
|
|
160
|
+
"wires": [["debug-output"]]
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"id": "incrby-node",
|
|
164
|
+
"type": "redis-variable",
|
|
165
|
+
"z": "universal-examples",
|
|
166
|
+
"name": "INCRBY",
|
|
167
|
+
"redisConfig": "redis-config",
|
|
168
|
+
"operation": "incrby",
|
|
169
|
+
"x": 290,
|
|
170
|
+
"y": 300,
|
|
171
|
+
"wires": [["debug-output"]]
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"id": "list-push",
|
|
175
|
+
"type": "inject",
|
|
176
|
+
"z": "universal-examples",
|
|
177
|
+
"name": "LPUSH task",
|
|
178
|
+
"props": [
|
|
179
|
+
{
|
|
180
|
+
"p": "payload",
|
|
181
|
+
"v": "{\"key\":\"queue:tasks\",\"value\":{\"task\":\"process_order\",\"id\":12345,\"priority\":\"high\"}}",
|
|
182
|
+
"vt": "json"
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
"repeat": "",
|
|
186
|
+
"crontab": "",
|
|
187
|
+
"once": false,
|
|
188
|
+
"onceDelay": 0.1,
|
|
189
|
+
"x": 120,
|
|
190
|
+
"y": 360,
|
|
191
|
+
"wires": [["lpush-node"]]
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"id": "list-range",
|
|
195
|
+
"type": "inject",
|
|
196
|
+
"z": "universal-examples",
|
|
197
|
+
"name": "LRANGE",
|
|
198
|
+
"props": [
|
|
199
|
+
{
|
|
200
|
+
"p": "payload",
|
|
201
|
+
"v": "{\"key\":\"queue:tasks\",\"start\":0,\"stop\":4}",
|
|
202
|
+
"vt": "json"
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
"repeat": "",
|
|
206
|
+
"crontab": "",
|
|
207
|
+
"once": false,
|
|
208
|
+
"onceDelay": 0.1,
|
|
209
|
+
"x": 110,
|
|
210
|
+
"y": 400,
|
|
211
|
+
"wires": [["lrange-node"]]
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"id": "list-pop",
|
|
215
|
+
"type": "inject",
|
|
216
|
+
"z": "universal-examples",
|
|
217
|
+
"name": "LPOP (simple)",
|
|
218
|
+
"props": [
|
|
219
|
+
{
|
|
220
|
+
"p": "payload",
|
|
221
|
+
"v": "queue:tasks",
|
|
222
|
+
"vt": "str"
|
|
223
|
+
}
|
|
224
|
+
],
|
|
225
|
+
"repeat": "",
|
|
226
|
+
"crontab": "",
|
|
227
|
+
"once": false,
|
|
228
|
+
"onceDelay": 0.1,
|
|
229
|
+
"x": 120,
|
|
230
|
+
"y": 440,
|
|
231
|
+
"wires": [["lpop-node"]]
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"id": "lpush-node",
|
|
235
|
+
"type": "redis-variable",
|
|
236
|
+
"z": "universal-examples",
|
|
237
|
+
"name": "LPUSH",
|
|
238
|
+
"redisConfig": "redis-config",
|
|
239
|
+
"operation": "lpush",
|
|
240
|
+
"x": 290,
|
|
241
|
+
"y": 360,
|
|
242
|
+
"wires": [["debug-output"]]
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"id": "lrange-node",
|
|
246
|
+
"type": "redis-variable",
|
|
247
|
+
"z": "universal-examples",
|
|
248
|
+
"name": "LRANGE",
|
|
249
|
+
"redisConfig": "redis-config",
|
|
250
|
+
"operation": "lrange",
|
|
251
|
+
"x": 290,
|
|
252
|
+
"y": 400,
|
|
253
|
+
"wires": [["debug-output"]]
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"id": "lpop-node",
|
|
257
|
+
"type": "redis-variable",
|
|
258
|
+
"z": "universal-examples",
|
|
259
|
+
"name": "LPOP",
|
|
260
|
+
"redisConfig": "redis-config",
|
|
261
|
+
"operation": "lpop",
|
|
262
|
+
"x": 290,
|
|
263
|
+
"y": 440,
|
|
264
|
+
"wires": [["debug-output"]]
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"id": "hash-set-single",
|
|
268
|
+
"type": "inject",
|
|
269
|
+
"z": "universal-examples",
|
|
270
|
+
"name": "HSET single field",
|
|
271
|
+
"props": [
|
|
272
|
+
{
|
|
273
|
+
"p": "payload",
|
|
274
|
+
"v": "{\"key\":\"user:123\",\"field\":\"email\",\"value\":\"john.doe@example.com\"}",
|
|
275
|
+
"vt": "json"
|
|
276
|
+
}
|
|
277
|
+
],
|
|
278
|
+
"repeat": "",
|
|
279
|
+
"crontab": "",
|
|
280
|
+
"once": false,
|
|
281
|
+
"onceDelay": 0.1,
|
|
282
|
+
"x": 140,
|
|
283
|
+
"y": 500,
|
|
284
|
+
"wires": [["hset-node"]]
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"id": "hash-set-multi",
|
|
288
|
+
"type": "inject",
|
|
289
|
+
"z": "universal-examples",
|
|
290
|
+
"name": "HSET multiple fields",
|
|
291
|
+
"props": [
|
|
292
|
+
{
|
|
293
|
+
"p": "payload",
|
|
294
|
+
"v": "{\"key\":\"user:123\",\"fields\":{\"name\":\"John Doe\",\"age\":30,\"city\":\"New York\",\"active\":true}}",
|
|
295
|
+
"vt": "json"
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
"repeat": "",
|
|
299
|
+
"crontab": "",
|
|
300
|
+
"once": false,
|
|
301
|
+
"onceDelay": 0.1,
|
|
302
|
+
"x": 150,
|
|
303
|
+
"y": 540,
|
|
304
|
+
"wires": [["hset-node"]]
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"id": "hash-get",
|
|
308
|
+
"type": "inject",
|
|
309
|
+
"z": "universal-examples",
|
|
310
|
+
"name": "HGET field",
|
|
311
|
+
"props": [
|
|
312
|
+
{
|
|
313
|
+
"p": "payload",
|
|
314
|
+
"v": "{\"key\":\"user:123\",\"field\":\"email\"}",
|
|
315
|
+
"vt": "json"
|
|
316
|
+
}
|
|
317
|
+
],
|
|
318
|
+
"repeat": "",
|
|
319
|
+
"crontab": "",
|
|
320
|
+
"once": false,
|
|
321
|
+
"onceDelay": 0.1,
|
|
322
|
+
"x": 120,
|
|
323
|
+
"y": 580,
|
|
324
|
+
"wires": [["hget-node"]]
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"id": "hash-getall",
|
|
328
|
+
"type": "inject",
|
|
329
|
+
"z": "universal-examples",
|
|
330
|
+
"name": "HGETALL (simple)",
|
|
331
|
+
"props": [
|
|
332
|
+
{
|
|
333
|
+
"p": "payload",
|
|
334
|
+
"v": "user:123",
|
|
335
|
+
"vt": "str"
|
|
336
|
+
}
|
|
337
|
+
],
|
|
338
|
+
"repeat": "",
|
|
339
|
+
"crontab": "",
|
|
340
|
+
"once": false,
|
|
341
|
+
"onceDelay": 0.1,
|
|
342
|
+
"x": 140,
|
|
343
|
+
"y": 620,
|
|
344
|
+
"wires": [["hgetall-node"]]
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"id": "hset-node",
|
|
348
|
+
"type": "redis-variable",
|
|
349
|
+
"z": "universal-examples",
|
|
350
|
+
"name": "HSET",
|
|
351
|
+
"redisConfig": "redis-config",
|
|
352
|
+
"operation": "hset",
|
|
353
|
+
"x": 330,
|
|
354
|
+
"y": 520,
|
|
355
|
+
"wires": [["debug-output"]]
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"id": "hget-node",
|
|
359
|
+
"type": "redis-variable",
|
|
360
|
+
"z": "universal-examples",
|
|
361
|
+
"name": "HGET",
|
|
362
|
+
"redisConfig": "redis-config",
|
|
363
|
+
"operation": "hget",
|
|
364
|
+
"x": 290,
|
|
365
|
+
"y": 580,
|
|
366
|
+
"wires": [["debug-output"]]
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"id": "hgetall-node",
|
|
370
|
+
"type": "redis-variable",
|
|
371
|
+
"z": "universal-examples",
|
|
372
|
+
"name": "HGETALL",
|
|
373
|
+
"redisConfig": "redis-config",
|
|
374
|
+
"operation": "hgetall",
|
|
375
|
+
"x": 310,
|
|
376
|
+
"y": 620,
|
|
377
|
+
"wires": [["debug-output"]]
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"id": "publish-msg",
|
|
381
|
+
"type": "inject",
|
|
382
|
+
"z": "universal-examples",
|
|
383
|
+
"name": "PUBLISH message",
|
|
384
|
+
"props": [
|
|
385
|
+
{
|
|
386
|
+
"p": "payload",
|
|
387
|
+
"v": "{\"channel\":\"notifications\",\"message\":{\"type\":\"alert\",\"text\":\"System maintenance in 5 minutes\"}}",
|
|
388
|
+
"vt": "json"
|
|
389
|
+
}
|
|
390
|
+
],
|
|
391
|
+
"repeat": "",
|
|
392
|
+
"crontab": "",
|
|
393
|
+
"once": false,
|
|
394
|
+
"onceDelay": 0.1,
|
|
395
|
+
"x": 140,
|
|
396
|
+
"y": 680,
|
|
397
|
+
"wires": [["publish-node"]]
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"id": "publish-node",
|
|
401
|
+
"type": "redis-variable",
|
|
402
|
+
"z": "universal-examples",
|
|
403
|
+
"name": "PUBLISH",
|
|
404
|
+
"redisConfig": "redis-config",
|
|
405
|
+
"operation": "publish",
|
|
406
|
+
"x": 310,
|
|
407
|
+
"y": 680,
|
|
408
|
+
"wires": [["debug-output"]]
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"id": "debug-output",
|
|
412
|
+
"type": "debug",
|
|
413
|
+
"z": "universal-examples",
|
|
414
|
+
"name": "Output",
|
|
415
|
+
"active": true,
|
|
416
|
+
"tosidebar": true,
|
|
417
|
+
"console": false,
|
|
418
|
+
"tostatus": false,
|
|
419
|
+
"complete": "payload",
|
|
420
|
+
"targetType": "msg",
|
|
421
|
+
"statusVal": "",
|
|
422
|
+
"statusType": "auto",
|
|
423
|
+
"x": 500,
|
|
424
|
+
"y": 400,
|
|
425
|
+
"wires": []
|
|
426
|
+
}
|
|
427
|
+
]
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "node-red-contrib-redis-variable",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A comprehensive Node-RED node for Redis operations with universal payload-based configuration, automatic JSON handling, and SSL/TLS support",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"node-red",
|
|
7
|
+
"redis",
|
|
8
|
+
"database",
|
|
9
|
+
"cache",
|
|
10
|
+
"variable",
|
|
11
|
+
"storage"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/lotockii/node-red-contrib-redis-variable#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/lotockii/node-red-contrib-redis-variable/issues"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/lotockii/node-red-contrib-redis-variable.git"
|
|
20
|
+
},
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"author": "Andrii Lototskyi <dn050992lan@gmail.com>",
|
|
23
|
+
"type": "commonjs",
|
|
24
|
+
"main": "redis-variable.js",
|
|
25
|
+
"directories": {
|
|
26
|
+
"example": "examples"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"ioredis": "^5.3.2",
|
|
33
|
+
"async": "^3.2.4"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=12.0.0"
|
|
38
|
+
},
|
|
39
|
+
"node-red": {
|
|
40
|
+
"version": ">=2.0.0",
|
|
41
|
+
"nodes": {
|
|
42
|
+
"redis-variable": "redis-variable.js",
|
|
43
|
+
"redis-variable-config": "redis-variable-config.js"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|