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