@upstash/redis 0.0.0-ci.8122a6a6-20221030 → 0.0.0-ci.8132df91-20231017
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 +20 -18
- package/esm/pkg/commands/command.js +12 -3
- package/esm/pkg/commands/geo_add.js +27 -0
- package/esm/pkg/commands/getdel.js +9 -0
- package/esm/pkg/commands/hgetall.js +0 -4
- package/esm/pkg/commands/hrandfield.js +39 -0
- package/esm/pkg/commands/json_arrappend.js +9 -0
- package/esm/pkg/commands/json_arrindex.js +9 -0
- package/esm/pkg/commands/json_arrinsert.js +9 -0
- package/esm/pkg/commands/json_arrlen.js +9 -0
- package/esm/pkg/commands/json_arrpop.js +9 -0
- package/esm/pkg/commands/json_arrtrim.js +12 -0
- package/esm/pkg/commands/json_clear.js +9 -0
- package/esm/pkg/commands/json_del.js +9 -0
- package/esm/pkg/commands/json_forget.js +9 -0
- package/esm/pkg/commands/json_get.js +30 -0
- package/esm/pkg/commands/json_mget.js +9 -0
- package/esm/pkg/commands/json_numincrby.js +9 -0
- package/esm/pkg/commands/json_nummultby.js +9 -0
- package/esm/pkg/commands/json_objkeys.js +9 -0
- package/esm/pkg/commands/json_objlen.js +9 -0
- package/esm/pkg/commands/json_resp.js +9 -0
- package/esm/pkg/commands/json_set.js +18 -0
- package/esm/pkg/commands/json_strappend.js +9 -0
- package/esm/pkg/commands/json_strlen.js +9 -0
- package/esm/pkg/commands/json_toggle.js +9 -0
- package/esm/pkg/commands/json_type.js +9 -0
- package/esm/pkg/commands/lmove.js +9 -0
- package/esm/pkg/commands/mod.js +29 -0
- package/esm/pkg/commands/set.js +1 -1
- package/esm/pkg/commands/smismember.js +9 -0
- package/esm/pkg/commands/xadd.js +26 -0
- package/esm/pkg/commands/xrange.js +36 -0
- package/esm/pkg/commands/zdiffstore.js +9 -0
- package/esm/pkg/commands/zunion.js +30 -0
- package/esm/pkg/http.js +70 -25
- package/esm/pkg/pipeline.js +162 -7
- package/esm/pkg/redis.js +201 -2
- package/esm/platforms/cloudflare.js +10 -2
- package/esm/platforms/fastly.js +6 -0
- package/esm/platforms/node_with_fetch.js +26 -1
- package/esm/platforms/nodejs.js +23 -0
- package/esm/version.js +1 -0
- package/package.json +53 -20
- package/script/pkg/commands/command.js +12 -3
- package/script/pkg/commands/geo_add.js +31 -0
- package/script/pkg/commands/getdel.js +13 -0
- package/script/pkg/commands/hgetall.js +0 -4
- package/script/pkg/commands/hrandfield.js +43 -0
- package/script/pkg/commands/json_arrappend.js +13 -0
- package/script/pkg/commands/json_arrindex.js +13 -0
- package/script/pkg/commands/json_arrinsert.js +13 -0
- package/script/pkg/commands/json_arrlen.js +13 -0
- package/script/pkg/commands/json_arrpop.js +13 -0
- package/script/pkg/commands/json_arrtrim.js +16 -0
- package/script/pkg/commands/json_clear.js +13 -0
- package/script/pkg/commands/json_del.js +13 -0
- package/script/pkg/commands/json_forget.js +13 -0
- package/script/pkg/commands/json_get.js +34 -0
- package/script/pkg/commands/json_mget.js +13 -0
- package/script/pkg/commands/json_numincrby.js +13 -0
- package/script/pkg/commands/json_nummultby.js +13 -0
- package/script/pkg/commands/json_objkeys.js +13 -0
- package/script/pkg/commands/json_objlen.js +13 -0
- package/script/pkg/commands/json_resp.js +13 -0
- package/script/pkg/commands/json_set.js +22 -0
- package/script/pkg/commands/json_strappend.js +13 -0
- package/script/pkg/commands/json_strlen.js +13 -0
- package/script/pkg/commands/json_toggle.js +13 -0
- package/script/pkg/commands/json_type.js +13 -0
- package/script/pkg/commands/lmove.js +13 -0
- package/script/pkg/commands/mod.js +29 -0
- package/script/pkg/commands/set.js +1 -1
- package/script/pkg/commands/smismember.js +13 -0
- package/script/pkg/commands/xadd.js +30 -0
- package/script/pkg/commands/xrange.js +40 -0
- package/script/pkg/commands/zdiffstore.js +13 -0
- package/script/pkg/commands/zunion.js +34 -0
- package/script/pkg/http.js +70 -25
- package/script/pkg/pipeline.js +161 -6
- package/script/pkg/redis.js +200 -1
- package/script/platforms/cloudflare.js +10 -2
- package/script/platforms/fastly.js +6 -0
- package/script/platforms/node_with_fetch.js +26 -1
- package/script/platforms/nodejs.js +23 -0
- package/script/version.js +4 -0
- package/types/pkg/commands/command.d.ts +5 -5
- package/types/pkg/commands/geo_add.d.ts +25 -0
- package/types/pkg/commands/getdel.d.ts +7 -0
- package/types/pkg/commands/hdel.d.ts +1 -1
- package/types/pkg/commands/hrandfield.d.ts +9 -0
- package/types/pkg/commands/json_arrappend.d.ts +7 -0
- package/types/pkg/commands/json_arrindex.d.ts +13 -0
- package/types/pkg/commands/json_arrinsert.d.ts +7 -0
- package/types/pkg/commands/json_arrlen.d.ts +7 -0
- package/types/pkg/commands/json_arrpop.d.ts +7 -0
- package/types/pkg/commands/json_arrtrim.d.ts +7 -0
- package/types/pkg/commands/json_clear.d.ts +7 -0
- package/types/pkg/commands/json_del.d.ts +7 -0
- package/types/pkg/commands/json_forget.d.ts +7 -0
- package/types/pkg/commands/json_get.d.ts +15 -0
- package/types/pkg/commands/json_mget.d.ts +7 -0
- package/types/pkg/commands/json_numincrby.d.ts +7 -0
- package/types/pkg/commands/json_nummultby.d.ts +7 -0
- package/types/pkg/commands/json_objkeys.d.ts +7 -0
- package/types/pkg/commands/json_objlen.d.ts +7 -0
- package/types/pkg/commands/json_resp.d.ts +7 -0
- package/types/pkg/commands/json_set.d.ts +18 -0
- package/types/pkg/commands/json_strappend.d.ts +7 -0
- package/types/pkg/commands/json_strlen.d.ts +7 -0
- package/types/pkg/commands/json_toggle.d.ts +7 -0
- package/types/pkg/commands/json_type.d.ts +7 -0
- package/types/pkg/commands/lmove.d.ts +12 -0
- package/types/pkg/commands/mod.d.ts +29 -0
- package/types/pkg/commands/scan.d.ts +1 -1
- package/types/pkg/commands/script_flush.d.ts +1 -1
- package/types/pkg/commands/set.d.ts +3 -3
- package/types/pkg/commands/smembers.d.ts +2 -2
- package/types/pkg/commands/smismember.d.ts +7 -0
- package/types/pkg/commands/type.d.ts +1 -1
- package/types/pkg/commands/xadd.d.ts +31 -0
- package/types/pkg/commands/xrange.d.ts +9 -0
- package/types/pkg/commands/zadd.d.ts +3 -3
- package/types/pkg/commands/zdiffstore.d.ts +7 -0
- package/types/pkg/commands/zinterstore.d.ts +1 -1
- package/types/pkg/commands/zrange.d.ts +1 -1
- package/types/pkg/commands/zunion.d.ts +29 -0
- package/types/pkg/commands/zunionstore.d.ts +1 -1
- package/types/pkg/http.d.ts +46 -7
- package/types/pkg/pipeline.d.ts +253 -124
- package/types/pkg/redis.d.ts +162 -14
- package/types/pkg/types.d.ts +27 -1
- package/types/platforms/cloudflare.d.ts +9 -8
- package/types/platforms/fastly.d.ts +3 -7
- package/types/platforms/node_with_fetch.d.ts +3 -22
- package/types/platforms/nodejs.d.ts +3 -7
- package/types/version.d.ts +1 -0
package/types/pkg/pipeline.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { DelCommand, ExistsCommand, FlushAllCommand, MGetCommand, PingCommand, ScoreMember, ScriptExistsCommand, SetCommandOptions, TouchCommand, UnlinkCommand, ZAddCommandOptions, ZAddCommandOptionsWithIncr, ZRangeCommandOptions } from "./commands/mod.js";
|
|
2
|
-
import { CommandOptions } from "./commands/command.js";
|
|
1
|
+
import { BitOpCommand, DelCommand, ExistsCommand, FlushAllCommand, JsonGetCommand, MGetCommand, PingCommand, ScoreMember, ScriptExistsCommand, SetCommandOptions, TouchCommand, UnlinkCommand, ZAddCommandOptions, ZAddCommandOptionsWithIncr, ZRangeCommandOptions } from "./commands/mod.js";
|
|
2
|
+
import { Command, CommandOptions } from "./commands/command.js";
|
|
3
3
|
import { Requester } from "./http.js";
|
|
4
4
|
import { CommandArgs } from "./types.js";
|
|
5
|
+
type InferResponseData<T extends unknown[]> = {
|
|
6
|
+
[K in keyof T]: T[K] extends Command<any, infer TData> ? TData : unknown;
|
|
7
|
+
};
|
|
5
8
|
/**
|
|
6
9
|
* Upstash REST API supports command pipelining to send multiple commands in
|
|
7
10
|
* batch, instead of sending each command one by one and waiting for a response.
|
|
@@ -30,7 +33,7 @@ import { CommandArgs } from "./types.js";
|
|
|
30
33
|
* const res = await p.set("key","value").get("key").exec()
|
|
31
34
|
* ```
|
|
32
35
|
*
|
|
33
|
-
*
|
|
36
|
+
* Return types are inferred if all commands are chained, but you can still
|
|
34
37
|
* override the response type manually:
|
|
35
38
|
* ```ts
|
|
36
39
|
* redis.pipeline()
|
|
@@ -40,7 +43,7 @@ import { CommandArgs } from "./types.js";
|
|
|
40
43
|
*
|
|
41
44
|
* ```
|
|
42
45
|
*/
|
|
43
|
-
export declare class Pipeline {
|
|
46
|
+
export declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
44
47
|
private client;
|
|
45
48
|
private commands;
|
|
46
49
|
private commandOptions?;
|
|
@@ -55,198 +58,220 @@ export declare class Pipeline {
|
|
|
55
58
|
*
|
|
56
59
|
* Returns an array with the results of all pipelined commands.
|
|
57
60
|
*
|
|
58
|
-
* You can define a return type manually
|
|
61
|
+
* If all commands are statically chained from start to finish, types are inferred. You can still define a return type manually if necessary though:
|
|
59
62
|
* ```ts
|
|
60
|
-
* redis.pipeline()
|
|
63
|
+
* const p = redis.pipeline()
|
|
64
|
+
* p.get("key")
|
|
65
|
+
* const result = p.exec<[{ greeting: string }]>()
|
|
61
66
|
* ```
|
|
62
67
|
*/
|
|
63
|
-
exec: <TCommandResults extends unknown[] = unknown[]
|
|
68
|
+
exec: <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>() => Promise<TCommandResults>;
|
|
64
69
|
/**
|
|
65
|
-
*
|
|
70
|
+
* Returns the length of pipeline before the execution
|
|
71
|
+
*/
|
|
72
|
+
length(): number;
|
|
73
|
+
/**
|
|
74
|
+
* Pushes a command into the pipeline and returns a chainable instance of the
|
|
66
75
|
* pipeline
|
|
67
76
|
*/
|
|
68
77
|
private chain;
|
|
69
78
|
/**
|
|
70
79
|
* @see https://redis.io/commands/append
|
|
71
80
|
*/
|
|
72
|
-
append: (key: string, value: string) =>
|
|
81
|
+
append: (key: string, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
73
82
|
/**
|
|
74
83
|
* @see https://redis.io/commands/bitcount
|
|
75
84
|
*/
|
|
76
|
-
bitcount: (key: string, start: number, end: number) =>
|
|
85
|
+
bitcount: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
77
86
|
/**
|
|
78
87
|
* @see https://redis.io/commands/bitop
|
|
79
88
|
*/
|
|
80
89
|
bitop: {
|
|
81
|
-
(op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Pipeline
|
|
82
|
-
(op: "not", destinationKey: string, sourceKey: string): Pipeline
|
|
90
|
+
(op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Pipeline<[...TCommands, BitOpCommand]>;
|
|
91
|
+
(op: "not", destinationKey: string, sourceKey: string): Pipeline<[...TCommands, BitOpCommand]>;
|
|
83
92
|
};
|
|
84
93
|
/**
|
|
85
94
|
* @see https://redis.io/commands/bitpos
|
|
86
95
|
*/
|
|
87
|
-
bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) =>
|
|
96
|
+
bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
97
|
+
/**
|
|
98
|
+
* @see https://redis.io/commands/zdiffstore
|
|
99
|
+
*/
|
|
100
|
+
zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
88
101
|
/**
|
|
89
102
|
* @see https://redis.io/commands/dbsize
|
|
90
103
|
*/
|
|
91
|
-
dbsize: () =>
|
|
104
|
+
dbsize: () => Pipeline<[...TCommands, Command<any, number>]>;
|
|
92
105
|
/**
|
|
93
106
|
* @see https://redis.io/commands/decr
|
|
94
107
|
*/
|
|
95
|
-
decr: (key: string) =>
|
|
108
|
+
decr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
96
109
|
/**
|
|
97
110
|
* @see https://redis.io/commands/decrby
|
|
98
111
|
*/
|
|
99
|
-
decrby: (key: string, decrement: number) =>
|
|
112
|
+
decrby: (key: string, decrement: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
100
113
|
/**
|
|
101
114
|
* @see https://redis.io/commands/del
|
|
102
115
|
*/
|
|
103
|
-
del: (...args: CommandArgs<typeof DelCommand>) =>
|
|
116
|
+
del: (...args: CommandArgs<typeof DelCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
104
117
|
/**
|
|
105
118
|
* @see https://redis.io/commands/echo
|
|
106
119
|
*/
|
|
107
|
-
echo: (message: string) =>
|
|
120
|
+
echo: (message: string) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
108
121
|
/**
|
|
109
122
|
* @see https://redis.io/commands/eval
|
|
110
123
|
*/
|
|
111
|
-
eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) =>
|
|
124
|
+
eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
112
125
|
/**
|
|
113
126
|
* @see https://redis.io/commands/evalsha
|
|
114
127
|
*/
|
|
115
|
-
evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) =>
|
|
128
|
+
evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
116
129
|
/**
|
|
117
130
|
* @see https://redis.io/commands/exists
|
|
118
131
|
*/
|
|
119
|
-
exists: (...args: CommandArgs<typeof ExistsCommand>) =>
|
|
132
|
+
exists: (...args: CommandArgs<typeof ExistsCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
120
133
|
/**
|
|
121
134
|
* @see https://redis.io/commands/expire
|
|
122
135
|
*/
|
|
123
|
-
expire: (key: string, seconds: number) =>
|
|
136
|
+
expire: (key: string, seconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
124
137
|
/**
|
|
125
138
|
* @see https://redis.io/commands/expireat
|
|
126
139
|
*/
|
|
127
|
-
expireat: (key: string, unix: number) =>
|
|
140
|
+
expireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
128
141
|
/**
|
|
129
142
|
* @see https://redis.io/commands/flushall
|
|
130
143
|
*/
|
|
131
|
-
flushall: (args?: CommandArgs<typeof FlushAllCommand>) =>
|
|
144
|
+
flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
132
145
|
/**
|
|
133
146
|
* @see https://redis.io/commands/flushdb
|
|
134
147
|
*/
|
|
135
148
|
flushdb: (opts?: {
|
|
136
149
|
async?: boolean | undefined;
|
|
137
|
-
} | undefined) =>
|
|
150
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
138
151
|
/**
|
|
139
152
|
* @see https://redis.io/commands/get
|
|
140
153
|
*/
|
|
141
|
-
get: <TData>(key: string) =>
|
|
154
|
+
get: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
142
155
|
/**
|
|
143
156
|
* @see https://redis.io/commands/getbit
|
|
144
157
|
*/
|
|
145
|
-
getbit: (key: string, offset: number) =>
|
|
158
|
+
getbit: (key: string, offset: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
159
|
+
/**
|
|
160
|
+
* @see https://redis.io/commands/getdel
|
|
161
|
+
*/
|
|
162
|
+
getdel: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
146
163
|
/**
|
|
147
164
|
* @see https://redis.io/commands/getrange
|
|
148
165
|
*/
|
|
149
|
-
getrange: (key: string, start: number, end: number) =>
|
|
166
|
+
getrange: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
150
167
|
/**
|
|
151
168
|
* @see https://redis.io/commands/getset
|
|
152
169
|
*/
|
|
153
|
-
getset: <TData>(key: string, value: TData) =>
|
|
170
|
+
getset: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
154
171
|
/**
|
|
155
172
|
* @see https://redis.io/commands/hdel
|
|
156
173
|
*/
|
|
157
|
-
hdel: (key: string,
|
|
174
|
+
hdel: (key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
158
175
|
/**
|
|
159
176
|
* @see https://redis.io/commands/hexists
|
|
160
177
|
*/
|
|
161
|
-
hexists: (key: string, field: string) =>
|
|
178
|
+
hexists: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
162
179
|
/**
|
|
163
180
|
* @see https://redis.io/commands/hget
|
|
164
181
|
*/
|
|
165
|
-
hget: <TData>(key: string, field: string) =>
|
|
182
|
+
hget: <TData>(key: string, field: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
166
183
|
/**
|
|
167
184
|
* @see https://redis.io/commands/hgetall
|
|
168
185
|
*/
|
|
169
|
-
hgetall: <TData extends Record<string, unknown>>(key: string) =>
|
|
186
|
+
hgetall: <TData extends Record<string, unknown>>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
170
187
|
/**
|
|
171
188
|
* @see https://redis.io/commands/hincrby
|
|
172
189
|
*/
|
|
173
|
-
hincrby: (key: string, field: string, increment: number) =>
|
|
190
|
+
hincrby: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
174
191
|
/**
|
|
175
192
|
* @see https://redis.io/commands/hincrbyfloat
|
|
176
193
|
*/
|
|
177
|
-
hincrbyfloat: (key: string, field: string, increment: number) =>
|
|
194
|
+
hincrbyfloat: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
178
195
|
/**
|
|
179
196
|
* @see https://redis.io/commands/hkeys
|
|
180
197
|
*/
|
|
181
|
-
hkeys: (key: string) =>
|
|
198
|
+
hkeys: (key: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
|
|
182
199
|
/**
|
|
183
200
|
* @see https://redis.io/commands/hlen
|
|
184
201
|
*/
|
|
185
|
-
hlen: (key: string) =>
|
|
202
|
+
hlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
186
203
|
/**
|
|
187
204
|
* @see https://redis.io/commands/hmget
|
|
188
205
|
*/
|
|
189
|
-
hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) =>
|
|
206
|
+
hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
190
207
|
/**
|
|
191
208
|
* @see https://redis.io/commands/hmset
|
|
192
209
|
*/
|
|
193
210
|
hmset: <TData>(key: string, kv: {
|
|
194
211
|
[field: string]: TData;
|
|
195
|
-
}) =>
|
|
212
|
+
}) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
213
|
+
/**
|
|
214
|
+
* @see https://redis.io/commands/hrandfield
|
|
215
|
+
*/
|
|
216
|
+
hrandfield: <TData extends string | string[] | Record<string, unknown>>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
196
217
|
/**
|
|
197
218
|
* @see https://redis.io/commands/hscan
|
|
198
219
|
*/
|
|
199
|
-
hscan: (key: string, cursor: number, cmdOpts?: import("./commands/scan.js").ScanCommandOptions | undefined) =>
|
|
220
|
+
hscan: (key: string, cursor: number, cmdOpts?: import("./commands/scan.js").ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
|
|
200
221
|
/**
|
|
201
222
|
* @see https://redis.io/commands/hset
|
|
202
223
|
*/
|
|
203
224
|
hset: <TData>(key: string, kv: {
|
|
204
225
|
[field: string]: TData;
|
|
205
|
-
}) =>
|
|
226
|
+
}) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
206
227
|
/**
|
|
207
228
|
* @see https://redis.io/commands/hsetnx
|
|
208
229
|
*/
|
|
209
|
-
hsetnx: <TData>(key: string, field: string, value: TData) =>
|
|
230
|
+
hsetnx: <TData>(key: string, field: string, value: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
210
231
|
/**
|
|
211
232
|
* @see https://redis.io/commands/hstrlen
|
|
212
233
|
*/
|
|
213
|
-
hstrlen: (key: string, field: string) =>
|
|
234
|
+
hstrlen: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
214
235
|
/**
|
|
215
236
|
* @see https://redis.io/commands/hvals
|
|
216
237
|
*/
|
|
217
|
-
hvals: (key: string) =>
|
|
238
|
+
hvals: (key: string) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
218
239
|
/**
|
|
219
240
|
* @see https://redis.io/commands/incr
|
|
220
241
|
*/
|
|
221
|
-
incr: (key: string) =>
|
|
242
|
+
incr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
222
243
|
/**
|
|
223
244
|
* @see https://redis.io/commands/incrby
|
|
224
245
|
*/
|
|
225
|
-
incrby: (key: string, value: number) =>
|
|
246
|
+
incrby: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
226
247
|
/**
|
|
227
248
|
* @see https://redis.io/commands/incrbyfloat
|
|
228
249
|
*/
|
|
229
|
-
incrbyfloat: (key: string, value: number) =>
|
|
250
|
+
incrbyfloat: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
230
251
|
/**
|
|
231
252
|
* @see https://redis.io/commands/keys
|
|
232
253
|
*/
|
|
233
|
-
keys: (pattern: string) =>
|
|
254
|
+
keys: (pattern: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
|
|
234
255
|
/**
|
|
235
256
|
* @see https://redis.io/commands/lindex
|
|
236
257
|
*/
|
|
237
|
-
lindex: (key: string, index: number) =>
|
|
258
|
+
lindex: (key: string, index: number) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
238
259
|
/**
|
|
239
260
|
* @see https://redis.io/commands/linsert
|
|
240
261
|
*/
|
|
241
|
-
linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Pipeline
|
|
262
|
+
linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
242
263
|
/**
|
|
243
264
|
* @see https://redis.io/commands/llen
|
|
244
265
|
*/
|
|
245
|
-
llen: (key: string) =>
|
|
266
|
+
llen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
267
|
+
/**
|
|
268
|
+
* @see https://redis.io/commands/lmove
|
|
269
|
+
*/
|
|
270
|
+
lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
246
271
|
/**
|
|
247
272
|
* @see https://redis.io/commands/lpop
|
|
248
273
|
*/
|
|
249
|
-
lpop: <TData>(key: string, count?: number | undefined) =>
|
|
274
|
+
lpop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
250
275
|
/**
|
|
251
276
|
* @see https://redis.io/commands/lpos
|
|
252
277
|
*/
|
|
@@ -254,252 +279,256 @@ export declare class Pipeline {
|
|
|
254
279
|
rank?: number | undefined;
|
|
255
280
|
count?: number | undefined;
|
|
256
281
|
maxLen?: number | undefined;
|
|
257
|
-
} | undefined) =>
|
|
282
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
258
283
|
/**
|
|
259
284
|
* @see https://redis.io/commands/lpush
|
|
260
285
|
*/
|
|
261
|
-
lpush: <TData>(key: string, ...elements: TData[]) =>
|
|
286
|
+
lpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
262
287
|
/**
|
|
263
288
|
* @see https://redis.io/commands/lpushx
|
|
264
289
|
*/
|
|
265
|
-
lpushx: <TData>(key: string, ...elements: TData[]) =>
|
|
290
|
+
lpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
266
291
|
/**
|
|
267
292
|
* @see https://redis.io/commands/lrange
|
|
268
293
|
*/
|
|
269
|
-
lrange: <TResult = string>(key: string, start: number, end: number) =>
|
|
294
|
+
lrange: <TResult = string>(key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, TResult[]>]>;
|
|
270
295
|
/**
|
|
271
296
|
* @see https://redis.io/commands/lrem
|
|
272
297
|
*/
|
|
273
|
-
lrem: <TData>(key: string, count: number, value: TData) =>
|
|
298
|
+
lrem: <TData>(key: string, count: number, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
274
299
|
/**
|
|
275
300
|
* @see https://redis.io/commands/lset
|
|
276
301
|
*/
|
|
277
|
-
lset: <TData>(key: string, index: number, value: TData) =>
|
|
302
|
+
lset: <TData>(key: string, index: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
278
303
|
/**
|
|
279
304
|
* @see https://redis.io/commands/ltrim
|
|
280
305
|
*/
|
|
281
|
-
ltrim: (key: string, start: number, end: number) =>
|
|
306
|
+
ltrim: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
282
307
|
/**
|
|
283
308
|
* @see https://redis.io/commands/mget
|
|
284
309
|
*/
|
|
285
|
-
mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) =>
|
|
310
|
+
mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
286
311
|
/**
|
|
287
312
|
* @see https://redis.io/commands/mset
|
|
288
313
|
*/
|
|
289
314
|
mset: <TData>(kv: {
|
|
290
315
|
[key: string]: TData;
|
|
291
|
-
}) =>
|
|
316
|
+
}) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
292
317
|
/**
|
|
293
318
|
* @see https://redis.io/commands/msetnx
|
|
294
319
|
*/
|
|
295
320
|
msetnx: <TData>(kv: {
|
|
296
321
|
[key: string]: TData;
|
|
297
|
-
}) =>
|
|
322
|
+
}) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
298
323
|
/**
|
|
299
324
|
* @see https://redis.io/commands/persist
|
|
300
325
|
*/
|
|
301
|
-
persist: (key: string) =>
|
|
326
|
+
persist: (key: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
302
327
|
/**
|
|
303
328
|
* @see https://redis.io/commands/pexpire
|
|
304
329
|
*/
|
|
305
|
-
pexpire: (key: string, milliseconds: number) =>
|
|
330
|
+
pexpire: (key: string, milliseconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
306
331
|
/**
|
|
307
332
|
* @see https://redis.io/commands/pexpireat
|
|
308
333
|
*/
|
|
309
|
-
pexpireat: (key: string, unix: number) =>
|
|
334
|
+
pexpireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
310
335
|
/**
|
|
311
336
|
* @see https://redis.io/commands/ping
|
|
312
337
|
*/
|
|
313
|
-
ping: (args?: CommandArgs<typeof PingCommand>) =>
|
|
338
|
+
ping: (args?: CommandArgs<typeof PingCommand>) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
314
339
|
/**
|
|
315
340
|
* @see https://redis.io/commands/psetex
|
|
316
341
|
*/
|
|
317
|
-
psetex: <TData>(key: string, ttl: number, value: TData) =>
|
|
342
|
+
psetex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
318
343
|
/**
|
|
319
344
|
* @see https://redis.io/commands/pttl
|
|
320
345
|
*/
|
|
321
|
-
pttl: (key: string) =>
|
|
346
|
+
pttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
322
347
|
/**
|
|
323
348
|
* @see https://redis.io/commands/publish
|
|
324
349
|
*/
|
|
325
|
-
publish: (channel: string, message: unknown) =>
|
|
350
|
+
publish: (channel: string, message: unknown) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
326
351
|
/**
|
|
327
352
|
* @see https://redis.io/commands/randomkey
|
|
328
353
|
*/
|
|
329
|
-
randomkey: () =>
|
|
354
|
+
randomkey: () => Pipeline<[...TCommands, Command<any, string | null>]>;
|
|
330
355
|
/**
|
|
331
356
|
* @see https://redis.io/commands/rename
|
|
332
357
|
*/
|
|
333
|
-
rename: (source: string, destination: string) =>
|
|
358
|
+
rename: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
334
359
|
/**
|
|
335
360
|
* @see https://redis.io/commands/renamenx
|
|
336
361
|
*/
|
|
337
|
-
renamenx: (source: string, destination: string) =>
|
|
362
|
+
renamenx: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
338
363
|
/**
|
|
339
364
|
* @see https://redis.io/commands/rpop
|
|
340
365
|
*/
|
|
341
|
-
rpop: <TData = string>(key: string, count?: number | undefined) =>
|
|
366
|
+
rpop: <TData = string>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
342
367
|
/**
|
|
343
368
|
* @see https://redis.io/commands/rpush
|
|
344
369
|
*/
|
|
345
|
-
rpush: <TData>(key: string, ...elements: TData[]) =>
|
|
370
|
+
rpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
346
371
|
/**
|
|
347
372
|
* @see https://redis.io/commands/rpushx
|
|
348
373
|
*/
|
|
349
|
-
rpushx: <TData>(key: string, ...elements: TData[]) =>
|
|
374
|
+
rpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
350
375
|
/**
|
|
351
376
|
* @see https://redis.io/commands/sadd
|
|
352
377
|
*/
|
|
353
|
-
sadd: <TData>(key: string, ...members: TData[]) =>
|
|
378
|
+
sadd: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
354
379
|
/**
|
|
355
380
|
* @see https://redis.io/commands/scan
|
|
356
381
|
*/
|
|
357
|
-
scan: (cursor: number, opts?: import("./commands/scan.js").ScanCommandOptions | undefined) =>
|
|
382
|
+
scan: (cursor: number, opts?: import("./commands/scan.js").ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, string[]]>]>;
|
|
358
383
|
/**
|
|
359
384
|
* @see https://redis.io/commands/scard
|
|
360
385
|
*/
|
|
361
|
-
scard: (key: string) =>
|
|
386
|
+
scard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
362
387
|
/**
|
|
363
388
|
* @see https://redis.io/commands/script-exists
|
|
364
389
|
*/
|
|
365
|
-
scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) =>
|
|
390
|
+
scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Pipeline<[...TCommands, Command<any, number[]>]>;
|
|
366
391
|
/**
|
|
367
392
|
* @see https://redis.io/commands/script-flush
|
|
368
393
|
*/
|
|
369
|
-
scriptFlush: (opts?: import("./commands/script_flush.js").ScriptFlushCommandOptions | undefined) =>
|
|
394
|
+
scriptFlush: (opts?: import("./commands/script_flush.js").ScriptFlushCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
370
395
|
/**
|
|
371
396
|
* @see https://redis.io/commands/script-load
|
|
372
397
|
*/
|
|
373
|
-
scriptLoad: (script: string) =>
|
|
374
|
-
sdiff: (key: string, ...keys: string[]) =>
|
|
398
|
+
scriptLoad: (script: string) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
399
|
+
sdiff: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
375
400
|
/**
|
|
376
401
|
* @see https://redis.io/commands/sdiffstore
|
|
377
402
|
*/
|
|
378
|
-
sdiffstore: (destination: string, ...keys: string[]) =>
|
|
403
|
+
sdiffstore: (destination: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
379
404
|
/**
|
|
380
405
|
* @see https://redis.io/commands/set
|
|
381
406
|
*/
|
|
382
|
-
set: <TData>(key: string, value: TData, opts?: SetCommandOptions) =>
|
|
407
|
+
set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Pipeline<[...TCommands, Command<any, "OK" | TData | null>]>;
|
|
383
408
|
/**
|
|
384
409
|
* @see https://redis.io/commands/setbit
|
|
385
410
|
*/
|
|
386
|
-
setbit: (key: string, offset: number, value: 0 | 1) =>
|
|
411
|
+
setbit: (key: string, offset: number, value: 0 | 1) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
387
412
|
/**
|
|
388
413
|
* @see https://redis.io/commands/setex
|
|
389
414
|
*/
|
|
390
|
-
setex: <TData>(key: string, ttl: number, value: TData) =>
|
|
415
|
+
setex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
391
416
|
/**
|
|
392
417
|
* @see https://redis.io/commands/setnx
|
|
393
418
|
*/
|
|
394
|
-
setnx: <TData>(key: string, value: TData) =>
|
|
419
|
+
setnx: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
395
420
|
/**
|
|
396
421
|
* @see https://redis.io/commands/setrange
|
|
397
422
|
*/
|
|
398
|
-
setrange: (key: string, offset: number, value: string) =>
|
|
423
|
+
setrange: (key: string, offset: number, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
399
424
|
/**
|
|
400
425
|
* @see https://redis.io/commands/sinter
|
|
401
426
|
*/
|
|
402
|
-
sinter: (key: string, ...keys: string[]) =>
|
|
427
|
+
sinter: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, string[]>]>;
|
|
403
428
|
/**
|
|
404
429
|
* @see https://redis.io/commands/sinterstore
|
|
405
430
|
*/
|
|
406
|
-
sinterstore: (destination: string, key: string, ...keys: string[]) =>
|
|
431
|
+
sinterstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
407
432
|
/**
|
|
408
433
|
* @see https://redis.io/commands/sismember
|
|
409
434
|
*/
|
|
410
|
-
sismember: <TData>(key: string, member: TData) =>
|
|
435
|
+
sismember: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
411
436
|
/**
|
|
412
437
|
* @see https://redis.io/commands/smembers
|
|
413
438
|
*/
|
|
414
|
-
smembers: (key: string) =>
|
|
439
|
+
smembers: <TData extends unknown[] = string[]>(key: string) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
440
|
+
/**
|
|
441
|
+
* @see https://redis.io/commands/smismember
|
|
442
|
+
*/
|
|
443
|
+
smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Pipeline<[...TCommands, Command<any, (0 | 1)[]>]>;
|
|
415
444
|
/**
|
|
416
445
|
* @see https://redis.io/commands/smove
|
|
417
446
|
*/
|
|
418
|
-
smove: <TData>(source: string, destination: string, member: TData) =>
|
|
447
|
+
smove: <TData>(source: string, destination: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
419
448
|
/**
|
|
420
449
|
* @see https://redis.io/commands/spop
|
|
421
450
|
*/
|
|
422
|
-
spop: <TData>(key: string, count?: number | undefined) =>
|
|
451
|
+
spop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
423
452
|
/**
|
|
424
453
|
* @see https://redis.io/commands/srandmember
|
|
425
454
|
*/
|
|
426
|
-
srandmember: <TData>(key: string, count?: number | undefined) =>
|
|
455
|
+
srandmember: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
427
456
|
/**
|
|
428
457
|
* @see https://redis.io/commands/srem
|
|
429
458
|
*/
|
|
430
|
-
srem: <TData>(key: string, ...members: TData[]) =>
|
|
459
|
+
srem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
431
460
|
/**
|
|
432
461
|
* @see https://redis.io/commands/sscan
|
|
433
462
|
*/
|
|
434
|
-
sscan: (key: string, cursor: number, opts?: import("./commands/scan.js").ScanCommandOptions | undefined) =>
|
|
463
|
+
sscan: (key: string, cursor: number, opts?: import("./commands/scan.js").ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
|
|
435
464
|
/**
|
|
436
465
|
* @see https://redis.io/commands/strlen
|
|
437
466
|
*/
|
|
438
|
-
strlen: (key: string) =>
|
|
467
|
+
strlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
439
468
|
/**
|
|
440
469
|
* @see https://redis.io/commands/sunion
|
|
441
470
|
*/
|
|
442
|
-
sunion: (key: string, ...keys: string[]) =>
|
|
471
|
+
sunion: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
443
472
|
/**
|
|
444
473
|
* @see https://redis.io/commands/sunionstore
|
|
445
474
|
*/
|
|
446
|
-
sunionstore: (destination: string, key: string, ...keys: string[]) =>
|
|
475
|
+
sunionstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
447
476
|
/**
|
|
448
477
|
* @see https://redis.io/commands/time
|
|
449
478
|
*/
|
|
450
|
-
time: () =>
|
|
479
|
+
time: () => Pipeline<[...TCommands, Command<any, [number, number]>]>;
|
|
451
480
|
/**
|
|
452
481
|
* @see https://redis.io/commands/touch
|
|
453
482
|
*/
|
|
454
|
-
touch: (...args: CommandArgs<typeof TouchCommand>) =>
|
|
483
|
+
touch: (...args: CommandArgs<typeof TouchCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
455
484
|
/**
|
|
456
485
|
* @see https://redis.io/commands/ttl
|
|
457
486
|
*/
|
|
458
|
-
ttl: (key: string) =>
|
|
487
|
+
ttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
459
488
|
/**
|
|
460
489
|
* @see https://redis.io/commands/type
|
|
461
490
|
*/
|
|
462
|
-
type: (key: string) =>
|
|
491
|
+
type: (key: string) => Pipeline<[...TCommands, Command<any, import("./commands/type.js").Type>]>;
|
|
463
492
|
/**
|
|
464
493
|
* @see https://redis.io/commands/unlink
|
|
465
494
|
*/
|
|
466
|
-
unlink: (...args: CommandArgs<typeof UnlinkCommand>) =>
|
|
495
|
+
unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
467
496
|
/**
|
|
468
497
|
* @see https://redis.io/commands/zadd
|
|
469
498
|
*/
|
|
470
|
-
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [string, ZAddCommandOptions | ZAddCommandOptionsWithIncr, ScoreMember<TData>, ...ScoreMember<TData>[]]) =>
|
|
499
|
+
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [string, ZAddCommandOptions | ZAddCommandOptionsWithIncr, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
471
500
|
/**
|
|
472
501
|
* @see https://redis.io/commands/zcard
|
|
473
502
|
*/
|
|
474
|
-
zcard: (key: string) =>
|
|
503
|
+
zcard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
475
504
|
/**
|
|
476
505
|
* @see https://redis.io/commands/zcount
|
|
477
506
|
*/
|
|
478
|
-
zcount: (key: string, min: string | number, max: string | number) =>
|
|
507
|
+
zcount: (key: string, min: string | number, max: string | number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
479
508
|
/**
|
|
480
509
|
* @see https://redis.io/commands/zincrby
|
|
481
510
|
*/
|
|
482
|
-
zincrby: <TData>(key: string, increment: number, member: TData) =>
|
|
511
|
+
zincrby: <TData>(key: string, increment: number, member: TData) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
483
512
|
/**
|
|
484
513
|
* @see https://redis.io/commands/zinterstore
|
|
485
514
|
*/
|
|
486
|
-
zinterstore: (destination: string, numKeys: number, keys: string[], opts?: import("./commands/zinterstore.js").ZInterStoreCommandOptions | undefined) =>
|
|
515
|
+
zinterstore: (destination: string, numKeys: number, keys: string[], opts?: import("./commands/zinterstore.js").ZInterStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
487
516
|
/**
|
|
488
517
|
* @see https://redis.io/commands/zlexcount
|
|
489
518
|
*/
|
|
490
|
-
zlexcount: (key: string, min: string, max: string) =>
|
|
519
|
+
zlexcount: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
491
520
|
/**
|
|
492
521
|
* @see https://redis.io/commands/zmscore
|
|
493
522
|
*/
|
|
494
|
-
zmscore: (key: string, members: unknown[]) =>
|
|
523
|
+
zmscore: (key: string, members: unknown[]) => Pipeline<[...TCommands, Command<any, number[] | null>]>;
|
|
495
524
|
/**
|
|
496
525
|
* @see https://redis.io/commands/zpopmax
|
|
497
526
|
*/
|
|
498
|
-
zpopmax: <TData>(key: string, count?: number | undefined) =>
|
|
527
|
+
zpopmax: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
|
|
499
528
|
/**
|
|
500
529
|
* @see https://redis.io/commands/zpopmin
|
|
501
530
|
*/
|
|
502
|
-
zpopmin: <TData>(key: string, count?: number | undefined) =>
|
|
531
|
+
zpopmin: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
|
|
503
532
|
/**
|
|
504
533
|
* @see https://redis.io/commands/zrange
|
|
505
534
|
*/
|
|
@@ -517,41 +546,141 @@ export declare class Pipeline {
|
|
|
517
546
|
opts: {
|
|
518
547
|
byScore: true;
|
|
519
548
|
} & ZRangeCommandOptions
|
|
520
|
-
]) =>
|
|
549
|
+
]) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
521
550
|
/**
|
|
522
551
|
* @see https://redis.io/commands/zrank
|
|
523
552
|
*/
|
|
524
|
-
zrank: <TData>(key: string, member: TData) =>
|
|
553
|
+
zrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
525
554
|
/**
|
|
526
555
|
* @see https://redis.io/commands/zrem
|
|
527
556
|
*/
|
|
528
|
-
zrem: <TData>(key: string, ...members: TData[]) =>
|
|
557
|
+
zrem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
529
558
|
/**
|
|
530
559
|
* @see https://redis.io/commands/zremrangebylex
|
|
531
560
|
*/
|
|
532
|
-
zremrangebylex: (key: string, min: string, max: string) =>
|
|
561
|
+
zremrangebylex: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
533
562
|
/**
|
|
534
563
|
* @see https://redis.io/commands/zremrangebyrank
|
|
535
564
|
*/
|
|
536
|
-
zremrangebyrank: (key: string, start: number, stop: number) =>
|
|
565
|
+
zremrangebyrank: (key: string, start: number, stop: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
537
566
|
/**
|
|
538
567
|
* @see https://redis.io/commands/zremrangebyscore
|
|
539
568
|
*/
|
|
540
|
-
zremrangebyscore: (key: string, min: number, max: number) =>
|
|
569
|
+
zremrangebyscore: (key: string, min: number, max: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
541
570
|
/**
|
|
542
571
|
* @see https://redis.io/commands/zrevrank
|
|
543
572
|
*/
|
|
544
|
-
zrevrank: <TData>(key: string, member: TData) =>
|
|
573
|
+
zrevrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
545
574
|
/**
|
|
546
575
|
* @see https://redis.io/commands/zscan
|
|
547
576
|
*/
|
|
548
|
-
zscan: (key: string, cursor: number, opts?: import("./commands/scan.js").ScanCommandOptions | undefined) =>
|
|
577
|
+
zscan: (key: string, cursor: number, opts?: import("./commands/scan.js").ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
|
|
549
578
|
/**
|
|
550
579
|
* @see https://redis.io/commands/zscore
|
|
551
580
|
*/
|
|
552
|
-
zscore: <TData>(key: string, member: TData) =>
|
|
581
|
+
zscore: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
553
582
|
/**
|
|
554
583
|
* @see https://redis.io/commands/zunionstore
|
|
555
584
|
*/
|
|
556
|
-
zunionstore: (destination: string, numKeys: number, keys: string[], opts?: import("./commands/zunionstore.js").ZUnionStoreCommandOptions | undefined) =>
|
|
585
|
+
zunionstore: (destination: string, numKeys: number, keys: string[], opts?: import("./commands/zunionstore.js").ZUnionStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
586
|
+
/**
|
|
587
|
+
* @see https://redis.io/commands/zunion
|
|
588
|
+
*/
|
|
589
|
+
zunion: (numKeys: number, keys: string[], opts?: import("./commands/zunion.js").ZUnionCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
590
|
+
/**
|
|
591
|
+
* @see https://redis.io/commands/?group=json
|
|
592
|
+
*/
|
|
593
|
+
get json(): {
|
|
594
|
+
/**
|
|
595
|
+
* @see https://redis.io/commands/json.arrappend
|
|
596
|
+
*/
|
|
597
|
+
arrappend: (key: string, path: string, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
598
|
+
/**
|
|
599
|
+
* @see https://redis.io/commands/json.arrindex
|
|
600
|
+
*/
|
|
601
|
+
arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
602
|
+
/**
|
|
603
|
+
* @see https://redis.io/commands/json.arrinsert
|
|
604
|
+
*/
|
|
605
|
+
arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
606
|
+
/**
|
|
607
|
+
* @see https://redis.io/commands/json.arrlen
|
|
608
|
+
*/
|
|
609
|
+
arrlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
610
|
+
/**
|
|
611
|
+
* @see https://redis.io/commands/json.arrpop
|
|
612
|
+
*/
|
|
613
|
+
arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
614
|
+
/**
|
|
615
|
+
* @see https://redis.io/commands/json.arrtrim
|
|
616
|
+
*/
|
|
617
|
+
arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
618
|
+
/**
|
|
619
|
+
* @see https://redis.io/commands/json.clear
|
|
620
|
+
*/
|
|
621
|
+
clear: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
622
|
+
/**
|
|
623
|
+
* @see https://redis.io/commands/json.del
|
|
624
|
+
*/
|
|
625
|
+
del: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
626
|
+
/**
|
|
627
|
+
* @see https://redis.io/commands/json.forget
|
|
628
|
+
*/
|
|
629
|
+
forget: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
630
|
+
/**
|
|
631
|
+
* @see https://redis.io/commands/json.get
|
|
632
|
+
*/
|
|
633
|
+
get: (...args: CommandArgs<typeof JsonGetCommand>) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
634
|
+
/**
|
|
635
|
+
* @see https://redis.io/commands/json.mget
|
|
636
|
+
*/
|
|
637
|
+
mget: (keys: string[], path: string) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
638
|
+
/**
|
|
639
|
+
* @see https://redis.io/commands/json.numincrby
|
|
640
|
+
*/
|
|
641
|
+
numincrby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
642
|
+
/**
|
|
643
|
+
* @see https://redis.io/commands/json.nummultby
|
|
644
|
+
*/
|
|
645
|
+
nummultby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
646
|
+
/**
|
|
647
|
+
* @see https://redis.io/commands/json.objkeys
|
|
648
|
+
*/
|
|
649
|
+
objkeys: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (string[] | null)[]>]>;
|
|
650
|
+
/**
|
|
651
|
+
* @see https://redis.io/commands/json.objlen
|
|
652
|
+
*/
|
|
653
|
+
objlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
654
|
+
/**
|
|
655
|
+
* @see https://redis.io/commands/json.resp
|
|
656
|
+
*/
|
|
657
|
+
resp: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
658
|
+
/**
|
|
659
|
+
* @see https://redis.io/commands/json.set
|
|
660
|
+
*/
|
|
661
|
+
set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
|
|
662
|
+
nx: true;
|
|
663
|
+
xx?: undefined;
|
|
664
|
+
} | {
|
|
665
|
+
nx?: undefined;
|
|
666
|
+
xx: true;
|
|
667
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
|
|
668
|
+
/**
|
|
669
|
+
* @see https://redis.io/commands/json.strappend
|
|
670
|
+
*/
|
|
671
|
+
strappend: (key: string, path: string, value: string) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
672
|
+
/**
|
|
673
|
+
* @see https://redis.io/commands/json.strlen
|
|
674
|
+
*/
|
|
675
|
+
strlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
676
|
+
/**
|
|
677
|
+
* @see https://redis.io/commands/json.toggle
|
|
678
|
+
*/
|
|
679
|
+
toggle: (key: string, path: string) => Pipeline<[...TCommands, Command<any, number[]>]>;
|
|
680
|
+
/**
|
|
681
|
+
* @see https://redis.io/commands/json.type
|
|
682
|
+
*/
|
|
683
|
+
type: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, string[]>]>;
|
|
684
|
+
};
|
|
557
685
|
}
|
|
686
|
+
export {};
|