@upstash/redis 0.0.0-ci.8895aca4ac4b6a7430f4e15b010a71fd1735c231-20240408001502 → 0.0.0-ci.893d5822fe6324e13932f920ba66e56179dfdb9f-20260130092901
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 +10 -2
- package/chunk-NQMT65VO.mjs +4838 -0
- package/cloudflare.d.mts +11 -6
- package/cloudflare.d.ts +11 -6
- package/cloudflare.js +4944 -1
- package/cloudflare.mjs +97 -1
- package/fastly.d.mts +10 -5
- package/fastly.d.ts +10 -5
- package/fastly.js +4913 -1
- package/fastly.mjs +66 -1
- package/nodejs.d.mts +19 -24
- package/nodejs.d.ts +19 -24
- package/nodejs.js +4966 -1
- package/nodejs.mjs +119 -1
- package/package.json +1 -1
- package/{zmscore-07021e27.d.ts → zmscore-BjNXmrug.d.mts} +1356 -259
- package/zmscore-BjNXmrug.d.ts +4528 -0
- package/chunk-EO6YIZRF.mjs +0 -1
- package/chunk-N4VE2BCR.js +0 -1
|
@@ -0,0 +1,4528 @@
|
|
|
1
|
+
type CommandArgs<TCommand extends new (..._args: any) => any> = ConstructorParameters<TCommand>[0];
|
|
2
|
+
type Telemetry = {
|
|
3
|
+
/**
|
|
4
|
+
* Upstash-Telemetry-Sdk
|
|
5
|
+
* @example @upstash/redis@v1.1.1
|
|
6
|
+
*/
|
|
7
|
+
sdk?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Upstash-Telemetry-Platform
|
|
10
|
+
* @example cloudflare
|
|
11
|
+
*/
|
|
12
|
+
platform?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Upstash-Telemetry-Runtime
|
|
15
|
+
* @example node@v18
|
|
16
|
+
*/
|
|
17
|
+
runtime?: string;
|
|
18
|
+
};
|
|
19
|
+
type RedisOptions = {
|
|
20
|
+
/**
|
|
21
|
+
* Automatically try to deserialize the returned data from upstash using `JSON.deserialize`
|
|
22
|
+
*
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
automaticDeserialization?: boolean;
|
|
26
|
+
latencyLogging?: boolean;
|
|
27
|
+
enableTelemetry?: boolean;
|
|
28
|
+
enableAutoPipelining?: boolean;
|
|
29
|
+
readYourWrites?: boolean;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
type CacheSetting = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
|
|
33
|
+
type UpstashRequest = {
|
|
34
|
+
path?: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Request body will be serialized to json
|
|
37
|
+
*/
|
|
38
|
+
body?: unknown;
|
|
39
|
+
/**
|
|
40
|
+
* Additional headers for the request
|
|
41
|
+
*/
|
|
42
|
+
headers?: Record<string, string>;
|
|
43
|
+
upstashSyncToken?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Callback for handling streaming messages
|
|
46
|
+
*/
|
|
47
|
+
onMessage?: (data: string) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Whether this request expects a streaming response
|
|
50
|
+
*/
|
|
51
|
+
isStreaming?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Abort signal for the request
|
|
54
|
+
*/
|
|
55
|
+
signal?: AbortSignal;
|
|
56
|
+
};
|
|
57
|
+
type UpstashResponse<TResult> = {
|
|
58
|
+
result?: TResult;
|
|
59
|
+
error?: string;
|
|
60
|
+
};
|
|
61
|
+
interface Requester {
|
|
62
|
+
/**
|
|
63
|
+
* When this flag is enabled, any subsequent commands issued by this client are guaranteed to observe the effects of all earlier writes submitted by the same client.
|
|
64
|
+
*/
|
|
65
|
+
readYourWrites?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* This token is used to ensure that the client is in sync with the server. On each request, we send this token in the header, and the server will return a new token.
|
|
68
|
+
*/
|
|
69
|
+
upstashSyncToken?: string;
|
|
70
|
+
request: <TResult = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult>>;
|
|
71
|
+
}
|
|
72
|
+
type RetryConfig = false | {
|
|
73
|
+
/**
|
|
74
|
+
* The number of retries to attempt before giving up.
|
|
75
|
+
*
|
|
76
|
+
* @default 5
|
|
77
|
+
*/
|
|
78
|
+
retries?: number;
|
|
79
|
+
/**
|
|
80
|
+
* A backoff function receives the current retry count and returns a number in milliseconds to wait before retrying.
|
|
81
|
+
*
|
|
82
|
+
* @default
|
|
83
|
+
* ```ts
|
|
84
|
+
* Math.exp(retryCount) * 50
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
backoff?: (retryCount: number) => number;
|
|
88
|
+
};
|
|
89
|
+
type Options$1 = {
|
|
90
|
+
backend?: string;
|
|
91
|
+
};
|
|
92
|
+
type RequesterConfig = {
|
|
93
|
+
/**
|
|
94
|
+
* Configure the retry behaviour in case of network errors
|
|
95
|
+
*/
|
|
96
|
+
retry?: RetryConfig;
|
|
97
|
+
/**
|
|
98
|
+
* Due to the nature of dynamic and custom data, it is possible to write data to redis that is not
|
|
99
|
+
* valid json and will therefore cause errors when deserializing. This used to happen very
|
|
100
|
+
* frequently with non-utf8 data, such as emojis.
|
|
101
|
+
*
|
|
102
|
+
* By default we will therefore encode the data as base64 on the server, before sending it to the
|
|
103
|
+
* client. The client will then decode the base64 data and parse it as utf8.
|
|
104
|
+
*
|
|
105
|
+
* For very large entries, this can add a few milliseconds, so if you are sure that your data is
|
|
106
|
+
* valid utf8, you can disable this behaviour by setting this option to false.
|
|
107
|
+
*
|
|
108
|
+
* Here's what the response body looks like:
|
|
109
|
+
*
|
|
110
|
+
* ```json
|
|
111
|
+
* {
|
|
112
|
+
* result?: "base64-encoded",
|
|
113
|
+
* error?: string
|
|
114
|
+
* }
|
|
115
|
+
* ```
|
|
116
|
+
*
|
|
117
|
+
* @default "base64"
|
|
118
|
+
*/
|
|
119
|
+
responseEncoding?: false | "base64";
|
|
120
|
+
/**
|
|
121
|
+
* Configure the cache behaviour
|
|
122
|
+
* @default "no-store"
|
|
123
|
+
*/
|
|
124
|
+
cache?: CacheSetting;
|
|
125
|
+
};
|
|
126
|
+
type HttpClientConfig = {
|
|
127
|
+
headers?: Record<string, string>;
|
|
128
|
+
baseUrl: string;
|
|
129
|
+
options?: Options$1;
|
|
130
|
+
retry?: RetryConfig;
|
|
131
|
+
agent?: any;
|
|
132
|
+
signal?: AbortSignal | (() => AbortSignal);
|
|
133
|
+
keepAlive?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* When this flag is enabled, any subsequent commands issued by this client are guaranteed to observe the effects of all earlier writes submitted by the same client.
|
|
136
|
+
*/
|
|
137
|
+
readYourWrites?: boolean;
|
|
138
|
+
} & RequesterConfig;
|
|
139
|
+
|
|
140
|
+
type Serialize = (data: unknown) => string | number | boolean;
|
|
141
|
+
type Deserialize<TResult, TData> = (result: TResult) => TData;
|
|
142
|
+
type CommandOptions<TResult, TData> = {
|
|
143
|
+
/**
|
|
144
|
+
* Custom deserializer
|
|
145
|
+
*/
|
|
146
|
+
deserialize?: (result: TResult) => TData;
|
|
147
|
+
/**
|
|
148
|
+
* Automatically try to deserialize the returned data from upstash using `JSON.deserialize`
|
|
149
|
+
*
|
|
150
|
+
* @default true
|
|
151
|
+
*/
|
|
152
|
+
automaticDeserialization?: boolean;
|
|
153
|
+
latencyLogging?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Additional headers to be sent with the request
|
|
156
|
+
*/
|
|
157
|
+
headers?: Record<string, string>;
|
|
158
|
+
/**
|
|
159
|
+
* Path to append to the URL
|
|
160
|
+
*/
|
|
161
|
+
path?: string[];
|
|
162
|
+
/**
|
|
163
|
+
* Options for streaming requests, mainly used for subscribe, monitor commands
|
|
164
|
+
**/
|
|
165
|
+
streamOptions?: {
|
|
166
|
+
/**
|
|
167
|
+
* Callback to be called when a message is received
|
|
168
|
+
*/
|
|
169
|
+
onMessage?: (data: string) => void;
|
|
170
|
+
/**
|
|
171
|
+
* Whether the request is streaming
|
|
172
|
+
*/
|
|
173
|
+
isStreaming?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Signal to abort the request
|
|
176
|
+
*/
|
|
177
|
+
signal?: AbortSignal;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Command offers default (de)serialization and the exec method to all commands.
|
|
182
|
+
*
|
|
183
|
+
* TData represents what the user will enter or receive,
|
|
184
|
+
* TResult is the raw data returned from upstash, which may need to be transformed or parsed.
|
|
185
|
+
*/
|
|
186
|
+
declare class Command<TResult, TData> {
|
|
187
|
+
readonly command: (string | number | boolean)[];
|
|
188
|
+
readonly serialize: Serialize;
|
|
189
|
+
readonly deserialize: Deserialize<TResult, TData>;
|
|
190
|
+
protected readonly headers?: Record<string, string>;
|
|
191
|
+
protected readonly path?: string[];
|
|
192
|
+
protected readonly onMessage?: (data: string) => void;
|
|
193
|
+
protected readonly isStreaming: boolean;
|
|
194
|
+
protected readonly signal?: AbortSignal;
|
|
195
|
+
/**
|
|
196
|
+
* Create a new command instance.
|
|
197
|
+
*
|
|
198
|
+
* You can define a custom `deserialize` function. By default we try to deserialize as json.
|
|
199
|
+
*/
|
|
200
|
+
constructor(command: (string | boolean | number | unknown)[], opts?: CommandOptions<TResult, TData>);
|
|
201
|
+
/**
|
|
202
|
+
* Execute the command using a client.
|
|
203
|
+
*/
|
|
204
|
+
exec(client: Requester): Promise<TData>;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
type ZUnionStoreCommandOptions = {
|
|
208
|
+
aggregate?: "sum" | "min" | "max";
|
|
209
|
+
} & ({
|
|
210
|
+
weight: number;
|
|
211
|
+
weights?: never;
|
|
212
|
+
} | {
|
|
213
|
+
weight?: never;
|
|
214
|
+
weights: number[];
|
|
215
|
+
} | {
|
|
216
|
+
weight?: never;
|
|
217
|
+
weights?: never;
|
|
218
|
+
});
|
|
219
|
+
/**
|
|
220
|
+
* @see https://redis.io/commands/zunionstore
|
|
221
|
+
*/
|
|
222
|
+
declare class ZUnionStoreCommand extends Command<number, number> {
|
|
223
|
+
constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
|
|
224
|
+
constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
type ZUnionCommandOptions = {
|
|
228
|
+
withScores?: boolean;
|
|
229
|
+
aggregate?: "sum" | "min" | "max";
|
|
230
|
+
} & ({
|
|
231
|
+
weight: number;
|
|
232
|
+
weights?: never;
|
|
233
|
+
} | {
|
|
234
|
+
weight?: never;
|
|
235
|
+
weights: number[];
|
|
236
|
+
} | {
|
|
237
|
+
weight?: never;
|
|
238
|
+
weights?: never;
|
|
239
|
+
});
|
|
240
|
+
/**
|
|
241
|
+
* @see https://redis.io/commands/zunion
|
|
242
|
+
*/
|
|
243
|
+
declare class ZUnionCommand<TData extends unknown[]> extends Command<string[], TData> {
|
|
244
|
+
constructor(cmd: [numKeys: 1, key: string, opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
|
|
245
|
+
constructor(cmd: [numKeys: number, keys: string[], opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
type ZInterStoreCommandOptions = {
|
|
249
|
+
aggregate?: "sum" | "min" | "max";
|
|
250
|
+
} & ({
|
|
251
|
+
weight: number;
|
|
252
|
+
weights?: never;
|
|
253
|
+
} | {
|
|
254
|
+
weight?: never;
|
|
255
|
+
weights: number[];
|
|
256
|
+
} | {
|
|
257
|
+
weight?: never;
|
|
258
|
+
weights?: never;
|
|
259
|
+
});
|
|
260
|
+
/**
|
|
261
|
+
* @see https://redis.io/commands/zInterstore
|
|
262
|
+
*/
|
|
263
|
+
declare class ZInterStoreCommand extends Command<number, number> {
|
|
264
|
+
constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZInterStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
|
|
265
|
+
constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
type Type = "string" | "list" | "set" | "zset" | "hash" | "none";
|
|
269
|
+
/**
|
|
270
|
+
* @see https://redis.io/commands/type
|
|
271
|
+
*/
|
|
272
|
+
declare class TypeCommand extends Command<Type, Type> {
|
|
273
|
+
constructor(cmd: [key: string], opts?: CommandOptions<Type, Type>);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
type ScriptFlushCommandOptions = {
|
|
277
|
+
sync: true;
|
|
278
|
+
async?: never;
|
|
279
|
+
} | {
|
|
280
|
+
sync?: never;
|
|
281
|
+
async: true;
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* @see https://redis.io/commands/script-flush
|
|
285
|
+
*/
|
|
286
|
+
declare class ScriptFlushCommand extends Command<"OK", "OK"> {
|
|
287
|
+
constructor([opts]: [opts?: ScriptFlushCommandOptions], cmdOpts?: CommandOptions<"OK", "OK">);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
type GeoAddCommandOptions = {
|
|
291
|
+
nx?: boolean;
|
|
292
|
+
xx?: never;
|
|
293
|
+
} | ({
|
|
294
|
+
nx?: never;
|
|
295
|
+
xx?: boolean;
|
|
296
|
+
} & {
|
|
297
|
+
ch?: boolean;
|
|
298
|
+
});
|
|
299
|
+
type GeoMember<TMemberType> = {
|
|
300
|
+
latitude: number;
|
|
301
|
+
longitude: number;
|
|
302
|
+
member: TMemberType;
|
|
303
|
+
};
|
|
304
|
+
/**
|
|
305
|
+
* @see https://redis.io/commands/geoadd
|
|
306
|
+
*/
|
|
307
|
+
declare class GeoAddCommand<TMemberType = string> extends Command<number | null, number | null> {
|
|
308
|
+
constructor([key, arg1, ...arg2]: [
|
|
309
|
+
string,
|
|
310
|
+
GeoMember<TMemberType> | GeoAddCommandOptions,
|
|
311
|
+
...GeoMember<TMemberType>[]
|
|
312
|
+
], opts?: CommandOptions<number | null, number | null>);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
type ExpireOption = "NX" | "nx" | "XX" | "xx" | "GT" | "gt" | "LT" | "lt";
|
|
316
|
+
declare class ExpireCommand extends Command<"0" | "1", 0 | 1> {
|
|
317
|
+
constructor(cmd: [key: string, seconds: number, option?: ExpireOption], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
type ClientSetInfoAttribute = "LIB-NAME" | "lib-name" | "LIB-VER" | "lib-ver";
|
|
321
|
+
/**
|
|
322
|
+
* @see https://redis.io/commands/client-setinfo
|
|
323
|
+
*/
|
|
324
|
+
declare class ClientSetInfoCommand extends Command<string, string> {
|
|
325
|
+
constructor([attribute, value]: [attribute: ClientSetInfoAttribute, value: string], opts?: CommandOptions<string, string>);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
type FunctionListArgs = {
|
|
329
|
+
/**
|
|
330
|
+
* Pattern for matching library names. Supports glob patterns.
|
|
331
|
+
*
|
|
332
|
+
* Example: "my_library_*"
|
|
333
|
+
*/
|
|
334
|
+
libraryName?: string;
|
|
335
|
+
/**
|
|
336
|
+
* Includes the library source code in the response.
|
|
337
|
+
*
|
|
338
|
+
* @default false
|
|
339
|
+
*/
|
|
340
|
+
withCode?: boolean;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
type FunctionLoadArgs = {
|
|
344
|
+
/**
|
|
345
|
+
* The Lua code to load.
|
|
346
|
+
*
|
|
347
|
+
* Example:
|
|
348
|
+
* ```lua
|
|
349
|
+
* #!lua name=mylib
|
|
350
|
+
* redis.register_function('myfunc', function() return 'ok' end)
|
|
351
|
+
* ```
|
|
352
|
+
*/
|
|
353
|
+
code: string;
|
|
354
|
+
/**
|
|
355
|
+
* If true, the library will replace the existing library with the same name.
|
|
356
|
+
*
|
|
357
|
+
* @default false
|
|
358
|
+
*/
|
|
359
|
+
replace?: boolean;
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* @see https://redis.io/commands/append
|
|
364
|
+
*/
|
|
365
|
+
declare class AppendCommand extends Command<number, number> {
|
|
366
|
+
constructor(cmd: [key: string, value: string], opts?: CommandOptions<number, number>);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* @see https://redis.io/commands/bitcount
|
|
371
|
+
*/
|
|
372
|
+
declare class BitCountCommand extends Command<number, number> {
|
|
373
|
+
constructor(cmd: [key: string, start?: never, end?: never], opts?: CommandOptions<number, number>);
|
|
374
|
+
constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<number, number>);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
type SubCommandArgs<TRest extends unknown[] = []> = [
|
|
378
|
+
encoding: string,
|
|
379
|
+
offset: number | string,
|
|
380
|
+
...rest: TRest
|
|
381
|
+
];
|
|
382
|
+
/**
|
|
383
|
+
* @see https://redis.io/commands/bitfield
|
|
384
|
+
*/
|
|
385
|
+
declare class BitFieldCommand<T = Promise<number[]>> {
|
|
386
|
+
private client;
|
|
387
|
+
private opts?;
|
|
388
|
+
private execOperation;
|
|
389
|
+
private command;
|
|
390
|
+
constructor(args: [key: string], client: Requester, opts?: CommandOptions<number[], number[]> | undefined, execOperation?: (command: Command<number[], number[]>) => T);
|
|
391
|
+
private chain;
|
|
392
|
+
get(...args: SubCommandArgs): this;
|
|
393
|
+
set(...args: SubCommandArgs<[value: number]>): this;
|
|
394
|
+
incrby(...args: SubCommandArgs<[increment: number]>): this;
|
|
395
|
+
overflow(overflow: "WRAP" | "SAT" | "FAIL"): this;
|
|
396
|
+
exec(): T;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* @see https://redis.io/commands/bitop
|
|
401
|
+
*/
|
|
402
|
+
declare class BitOpCommand extends Command<number, number> {
|
|
403
|
+
constructor(cmd: [op: "and" | "or" | "xor", destinationKey: string, ...sourceKeys: string[]], opts?: CommandOptions<number, number>);
|
|
404
|
+
constructor(cmd: [op: "not", destinationKey: string, sourceKey: string], opts?: CommandOptions<number, number>);
|
|
405
|
+
constructor(cmd: [op: "diff" | "diff1" | "andor", destinationKey: string, x: string, ...y: string[]], opts?: CommandOptions<number, number>);
|
|
406
|
+
constructor(cmd: [op: "one", destinationKey: string, ...sourceKeys: string[]], opts?: CommandOptions<number, number>);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* @see https://redis.io/commands/bitpos
|
|
411
|
+
*/
|
|
412
|
+
declare class BitPosCommand extends Command<number, number> {
|
|
413
|
+
constructor(cmd: [key: string, bit: 0 | 1, start?: number, end?: number], opts?: CommandOptions<number, number>);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* @see https://redis.io/commands/copy
|
|
418
|
+
*/
|
|
419
|
+
declare class CopyCommand extends Command<number, "COPIED" | "NOT_COPIED"> {
|
|
420
|
+
constructor([key, destinationKey, opts]: [key: string, destinationKey: string, opts?: {
|
|
421
|
+
replace: boolean;
|
|
422
|
+
}], commandOptions?: CommandOptions<number, "COPIED" | "NOT_COPIED">);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* @see https://redis.io/commands/dbsize
|
|
427
|
+
*/
|
|
428
|
+
declare class DBSizeCommand extends Command<number, number> {
|
|
429
|
+
constructor(opts?: CommandOptions<number, number>);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* @see https://redis.io/commands/decr
|
|
434
|
+
*/
|
|
435
|
+
declare class DecrCommand extends Command<number, number> {
|
|
436
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* @see https://redis.io/commands/decrby
|
|
441
|
+
*/
|
|
442
|
+
declare class DecrByCommand extends Command<number, number> {
|
|
443
|
+
constructor(cmd: [key: string, decrement: number], opts?: CommandOptions<number, number>);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* @see https://redis.io/commands/del
|
|
448
|
+
*/
|
|
449
|
+
declare class DelCommand extends Command<number, number> {
|
|
450
|
+
constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* @see https://redis.io/commands/echo
|
|
455
|
+
*/
|
|
456
|
+
declare class EchoCommand extends Command<string, string> {
|
|
457
|
+
constructor(cmd: [message: string], opts?: CommandOptions<string, string>);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* @see https://redis.io/commands/eval_ro
|
|
462
|
+
*/
|
|
463
|
+
declare class EvalROCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
|
|
464
|
+
constructor([script, keys, args]: [script: string, keys: string[], args: TArgs], opts?: CommandOptions<unknown, TData>);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* @see https://redis.io/commands/eval
|
|
469
|
+
*/
|
|
470
|
+
declare class EvalCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
|
|
471
|
+
constructor([script, keys, args]: [script: string, keys: string[], args: TArgs], opts?: CommandOptions<unknown, TData>);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* @see https://redis.io/commands/evalsha_ro
|
|
476
|
+
*/
|
|
477
|
+
declare class EvalshaROCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
|
|
478
|
+
constructor([sha, keys, args]: [sha: string, keys: string[], args?: TArgs], opts?: CommandOptions<unknown, TData>);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* @see https://redis.io/commands/evalsha
|
|
483
|
+
*/
|
|
484
|
+
declare class EvalshaCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
|
|
485
|
+
constructor([sha, keys, args]: [sha: string, keys: string[], args?: TArgs], opts?: CommandOptions<unknown, TData>);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* @see https://redis.io/commands/exists
|
|
490
|
+
*/
|
|
491
|
+
declare class ExistsCommand extends Command<number, number> {
|
|
492
|
+
constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* @see https://redis.io/commands/expireat
|
|
497
|
+
*/
|
|
498
|
+
declare class ExpireAtCommand extends Command<"0" | "1", 0 | 1> {
|
|
499
|
+
constructor(cmd: [key: string, unix: number, option?: ExpireOption], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* @see https://redis.io/commands/flushall
|
|
504
|
+
*/
|
|
505
|
+
declare class FlushAllCommand extends Command<"OK", "OK"> {
|
|
506
|
+
constructor(args?: [{
|
|
507
|
+
async?: boolean;
|
|
508
|
+
}], opts?: CommandOptions<"OK", "OK">);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* @see https://redis.io/commands/flushdb
|
|
513
|
+
*/
|
|
514
|
+
declare class FlushDBCommand extends Command<"OK", "OK"> {
|
|
515
|
+
constructor([opts]: [opts?: {
|
|
516
|
+
async?: boolean;
|
|
517
|
+
}], cmdOpts?: CommandOptions<"OK", "OK">);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* @see https://redis.io/commands/geodist
|
|
522
|
+
*/
|
|
523
|
+
declare class GeoDistCommand<TMemberType = string> extends Command<number | null, number | null> {
|
|
524
|
+
constructor([key, member1, member2, unit]: [
|
|
525
|
+
key: string,
|
|
526
|
+
member1: TMemberType,
|
|
527
|
+
member2: TMemberType,
|
|
528
|
+
unit?: "M" | "KM" | "FT" | "MI"
|
|
529
|
+
], opts?: CommandOptions<number | null, number | null>);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* @see https://redis.io/commands/geohash
|
|
534
|
+
*/
|
|
535
|
+
declare class GeoHashCommand<TMember = string> extends Command<(string | null)[], (string | null)[]> {
|
|
536
|
+
constructor(cmd: [string, ...TMember[]], opts?: CommandOptions<(string | null)[], (string | null)[]>);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
type Coordinates = {
|
|
540
|
+
lng: number;
|
|
541
|
+
lat: number;
|
|
542
|
+
};
|
|
543
|
+
/**
|
|
544
|
+
* @see https://redis.io/commands/geopos
|
|
545
|
+
*/
|
|
546
|
+
declare class GeoPosCommand<TMember = string> extends Command<(string | null)[][], Coordinates[]> {
|
|
547
|
+
constructor(cmd: [string, ...(TMember[] | TMember[])], opts?: CommandOptions<(string | null)[][], Coordinates[]>);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
type RadiusOptions$1 = "M" | "KM" | "FT" | "MI";
|
|
551
|
+
type CenterPoint$1<TMemberType> = {
|
|
552
|
+
type: "FROMMEMBER" | "frommember";
|
|
553
|
+
member: TMemberType;
|
|
554
|
+
} | {
|
|
555
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
556
|
+
coordinate: {
|
|
557
|
+
lon: number;
|
|
558
|
+
lat: number;
|
|
559
|
+
};
|
|
560
|
+
};
|
|
561
|
+
type Shape$1 = {
|
|
562
|
+
type: "BYRADIUS" | "byradius";
|
|
563
|
+
radius: number;
|
|
564
|
+
radiusType: RadiusOptions$1;
|
|
565
|
+
} | {
|
|
566
|
+
type: "BYBOX" | "bybox";
|
|
567
|
+
rect: {
|
|
568
|
+
width: number;
|
|
569
|
+
height: number;
|
|
570
|
+
};
|
|
571
|
+
rectType: RadiusOptions$1;
|
|
572
|
+
};
|
|
573
|
+
type GeoSearchCommandOptions$1 = {
|
|
574
|
+
count?: {
|
|
575
|
+
limit: number;
|
|
576
|
+
any?: boolean;
|
|
577
|
+
};
|
|
578
|
+
withCoord?: boolean;
|
|
579
|
+
withDist?: boolean;
|
|
580
|
+
withHash?: boolean;
|
|
581
|
+
};
|
|
582
|
+
type OptionMappings = {
|
|
583
|
+
withHash: "hash";
|
|
584
|
+
withCoord: "coord";
|
|
585
|
+
withDist: "dist";
|
|
586
|
+
};
|
|
587
|
+
type GeoSearchOptions<TOptions> = {
|
|
588
|
+
[K in keyof TOptions as K extends keyof OptionMappings ? OptionMappings[K] : never]: K extends "withHash" ? string : K extends "withCoord" ? {
|
|
589
|
+
long: number;
|
|
590
|
+
lat: number;
|
|
591
|
+
} : K extends "withDist" ? number : never;
|
|
592
|
+
};
|
|
593
|
+
type GeoSearchResponse<TOptions, TMemberType> = ({
|
|
594
|
+
member: TMemberType;
|
|
595
|
+
} & GeoSearchOptions<TOptions>)[];
|
|
596
|
+
/**
|
|
597
|
+
* @see https://redis.io/commands/geosearch
|
|
598
|
+
*/
|
|
599
|
+
declare class GeoSearchCommand<TMemberType = string, TOptions extends GeoSearchCommandOptions$1 = GeoSearchCommandOptions$1> extends Command<any[] | any[][], GeoSearchResponse<TOptions, TMemberType>> {
|
|
600
|
+
constructor([key, centerPoint, shape, order, opts]: [
|
|
601
|
+
key: string,
|
|
602
|
+
centerPoint: CenterPoint$1<TMemberType>,
|
|
603
|
+
shape: Shape$1,
|
|
604
|
+
order: "ASC" | "DESC" | "asc" | "desc",
|
|
605
|
+
opts?: TOptions
|
|
606
|
+
], commandOptions?: CommandOptions<any[] | any[][], GeoSearchResponse<TOptions, TMemberType>>);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
type RadiusOptions = "M" | "KM" | "FT" | "MI";
|
|
610
|
+
type CenterPoint<TMemberType> = {
|
|
611
|
+
type: "FROMMEMBER" | "frommember";
|
|
612
|
+
member: TMemberType;
|
|
613
|
+
} | {
|
|
614
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
615
|
+
coordinate: {
|
|
616
|
+
lon: number;
|
|
617
|
+
lat: number;
|
|
618
|
+
};
|
|
619
|
+
};
|
|
620
|
+
type Shape = {
|
|
621
|
+
type: "BYRADIUS" | "byradius";
|
|
622
|
+
radius: number;
|
|
623
|
+
radiusType: RadiusOptions;
|
|
624
|
+
} | {
|
|
625
|
+
type: "BYBOX" | "bybox";
|
|
626
|
+
rect: {
|
|
627
|
+
width: number;
|
|
628
|
+
height: number;
|
|
629
|
+
};
|
|
630
|
+
rectType: RadiusOptions;
|
|
631
|
+
};
|
|
632
|
+
type GeoSearchCommandOptions = {
|
|
633
|
+
count?: {
|
|
634
|
+
limit: number;
|
|
635
|
+
any?: boolean;
|
|
636
|
+
};
|
|
637
|
+
storeDist?: boolean;
|
|
638
|
+
};
|
|
639
|
+
/**
|
|
640
|
+
* @see https://redis.io/commands/geosearchstore
|
|
641
|
+
*/
|
|
642
|
+
declare class GeoSearchStoreCommand<TMemberType = string, TOptions extends GeoSearchCommandOptions = GeoSearchCommandOptions> extends Command<any[] | any[][], number> {
|
|
643
|
+
constructor([destination, key, centerPoint, shape, order, opts]: [
|
|
644
|
+
destination: string,
|
|
645
|
+
key: string,
|
|
646
|
+
centerPoint: CenterPoint<TMemberType>,
|
|
647
|
+
shape: Shape,
|
|
648
|
+
order: "ASC" | "DESC" | "asc" | "desc",
|
|
649
|
+
opts?: TOptions
|
|
650
|
+
], commandOptions?: CommandOptions<any[] | any[][], number>);
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* @see https://redis.io/commands/get
|
|
655
|
+
*/
|
|
656
|
+
declare class GetCommand<TData = string> extends Command<unknown | null, TData | null> {
|
|
657
|
+
constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* @see https://redis.io/commands/getbit
|
|
662
|
+
*/
|
|
663
|
+
declare class GetBitCommand extends Command<"0" | "1", 0 | 1> {
|
|
664
|
+
constructor(cmd: [key: string, offset: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* @see https://redis.io/commands/getdel
|
|
669
|
+
*/
|
|
670
|
+
declare class GetDelCommand<TData = string> extends Command<unknown | null, TData | null> {
|
|
671
|
+
constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
type GetExCommandOptions = {
|
|
675
|
+
ex: number;
|
|
676
|
+
px?: never;
|
|
677
|
+
exat?: never;
|
|
678
|
+
pxat?: never;
|
|
679
|
+
persist?: never;
|
|
680
|
+
} | {
|
|
681
|
+
ex?: never;
|
|
682
|
+
px: number;
|
|
683
|
+
exat?: never;
|
|
684
|
+
pxat?: never;
|
|
685
|
+
persist?: never;
|
|
686
|
+
} | {
|
|
687
|
+
ex?: never;
|
|
688
|
+
px?: never;
|
|
689
|
+
exat: number;
|
|
690
|
+
pxat?: never;
|
|
691
|
+
persist?: never;
|
|
692
|
+
} | {
|
|
693
|
+
ex?: never;
|
|
694
|
+
px?: never;
|
|
695
|
+
exat?: never;
|
|
696
|
+
pxat: number;
|
|
697
|
+
persist?: never;
|
|
698
|
+
} | {
|
|
699
|
+
ex?: never;
|
|
700
|
+
px?: never;
|
|
701
|
+
exat?: never;
|
|
702
|
+
pxat?: never;
|
|
703
|
+
persist: true;
|
|
704
|
+
} | {
|
|
705
|
+
ex?: never;
|
|
706
|
+
px?: never;
|
|
707
|
+
exat?: never;
|
|
708
|
+
pxat?: never;
|
|
709
|
+
persist?: never;
|
|
710
|
+
};
|
|
711
|
+
/**
|
|
712
|
+
* @see https://redis.io/commands/getex
|
|
713
|
+
*/
|
|
714
|
+
declare class GetExCommand<TData = string> extends Command<unknown | null, TData | null> {
|
|
715
|
+
constructor([key, opts]: [key: string, opts?: GetExCommandOptions], cmdOpts?: CommandOptions<unknown | null, TData | null>);
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* @see https://redis.io/commands/getrange
|
|
720
|
+
*/
|
|
721
|
+
declare class GetRangeCommand extends Command<string, string> {
|
|
722
|
+
constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<string, string>);
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
* @see https://redis.io/commands/getset
|
|
727
|
+
*/
|
|
728
|
+
declare class GetSetCommand<TData = string> extends Command<unknown | null, TData | null> {
|
|
729
|
+
constructor(cmd: [key: string, value: TData], opts?: CommandOptions<unknown | null, TData | null>);
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* @see https://redis.io/commands/hdel
|
|
734
|
+
*/
|
|
735
|
+
declare class HDelCommand extends Command<"0" | "1", 0 | 1> {
|
|
736
|
+
constructor(cmd: [key: string, ...fields: string[]], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* @see https://redis.io/commands/hexists
|
|
741
|
+
*/
|
|
742
|
+
declare class HExistsCommand extends Command<number, number> {
|
|
743
|
+
constructor(cmd: [key: string, field: string], opts?: CommandOptions<number, number>);
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
declare class HExpireCommand extends Command<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]> {
|
|
747
|
+
constructor(cmd: [
|
|
748
|
+
key: string,
|
|
749
|
+
fields: (string | number) | (string | number)[],
|
|
750
|
+
seconds: number,
|
|
751
|
+
option?: ExpireOption
|
|
752
|
+
], opts?: CommandOptions<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]>);
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
declare class HExpireAtCommand extends Command<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]> {
|
|
756
|
+
constructor(cmd: [
|
|
757
|
+
key: string,
|
|
758
|
+
fields: (string | number) | (string | number)[],
|
|
759
|
+
timestamp: number,
|
|
760
|
+
option?: ExpireOption
|
|
761
|
+
], opts?: CommandOptions<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]>);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
declare class HExpireTimeCommand extends Command<number[], number[]> {
|
|
765
|
+
constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<number[], number[]>);
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
declare class HPersistCommand extends Command<(-2 | -1 | 1)[], (-2 | -1 | 1)[]> {
|
|
769
|
+
constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<(-2 | -1 | 1)[], (-2 | -1 | 1)[]>);
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
declare class HPExpireCommand extends Command<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]> {
|
|
773
|
+
constructor(cmd: [
|
|
774
|
+
key: string,
|
|
775
|
+
fields: (string | number) | (string | number)[],
|
|
776
|
+
milliseconds: number,
|
|
777
|
+
option?: ExpireOption
|
|
778
|
+
], opts?: CommandOptions<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]>);
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
declare class HPExpireAtCommand extends Command<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]> {
|
|
782
|
+
constructor(cmd: [
|
|
783
|
+
key: string,
|
|
784
|
+
fields: (string | number) | (string | number)[],
|
|
785
|
+
timestamp: number,
|
|
786
|
+
option?: ExpireOption
|
|
787
|
+
], opts?: CommandOptions<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]>);
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
declare class HPExpireTimeCommand extends Command<number[], number[]> {
|
|
791
|
+
constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<number[], number[]>);
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
declare class HPTtlCommand extends Command<number[], number[]> {
|
|
795
|
+
constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<number[], number[]>);
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* @see https://redis.io/commands/hget
|
|
800
|
+
*/
|
|
801
|
+
declare class HGetCommand<TData> extends Command<unknown | null, TData | null> {
|
|
802
|
+
constructor(cmd: [key: string, field: string], opts?: CommandOptions<unknown | null, TData | null>);
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* @see https://redis.io/commands/hgetall
|
|
807
|
+
*/
|
|
808
|
+
declare class HGetAllCommand<TData extends Record<string, unknown>> extends Command<unknown | null, TData | null> {
|
|
809
|
+
constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* HGETDEL returns the values of the specified fields and then atomically deletes them from the hash
|
|
814
|
+
* The field values are returned as an object like this:
|
|
815
|
+
* ```ts
|
|
816
|
+
* {[fieldName: string]: T | null}
|
|
817
|
+
* ```
|
|
818
|
+
*
|
|
819
|
+
* In case all fields are non-existent or the hash doesn't exist, `null` is returned
|
|
820
|
+
*
|
|
821
|
+
* @see https://redis.io/commands/hgetdel
|
|
822
|
+
*/
|
|
823
|
+
declare class HGetDelCommand<TData extends Record<string, unknown>> extends Command<(string | null)[], TData | null> {
|
|
824
|
+
constructor([key, ...fields]: [key: string, ...fields: (string | number)[]], opts?: CommandOptions<(string | null)[], TData | null>);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
type HGetExCommandOptions = {
|
|
828
|
+
ex: number;
|
|
829
|
+
px?: never;
|
|
830
|
+
exat?: never;
|
|
831
|
+
pxat?: never;
|
|
832
|
+
persist?: never;
|
|
833
|
+
} | {
|
|
834
|
+
ex?: never;
|
|
835
|
+
px: number;
|
|
836
|
+
exat?: never;
|
|
837
|
+
pxat?: never;
|
|
838
|
+
persist?: never;
|
|
839
|
+
} | {
|
|
840
|
+
ex?: never;
|
|
841
|
+
px?: never;
|
|
842
|
+
exat: number;
|
|
843
|
+
pxat?: never;
|
|
844
|
+
persist?: never;
|
|
845
|
+
} | {
|
|
846
|
+
ex?: never;
|
|
847
|
+
px?: never;
|
|
848
|
+
exat?: never;
|
|
849
|
+
pxat: number;
|
|
850
|
+
persist?: never;
|
|
851
|
+
} | {
|
|
852
|
+
ex?: never;
|
|
853
|
+
px?: never;
|
|
854
|
+
exat?: never;
|
|
855
|
+
pxat?: never;
|
|
856
|
+
persist: true;
|
|
857
|
+
};
|
|
858
|
+
/**
|
|
859
|
+
* HGETEX returns the values of the specified fields and optionally sets their expiration time or TTL
|
|
860
|
+
* The field values are returned as an object like this:
|
|
861
|
+
* ```ts
|
|
862
|
+
* {[fieldName: string]: T | null}
|
|
863
|
+
* ```
|
|
864
|
+
*
|
|
865
|
+
* In case all fields are non-existent or the hash doesn't exist, `null` is returned
|
|
866
|
+
*
|
|
867
|
+
* @see https://redis.io/commands/hgetex
|
|
868
|
+
*/
|
|
869
|
+
declare class HGetExCommand<TData extends Record<string, unknown>> extends Command<(string | null)[], TData | null> {
|
|
870
|
+
constructor([key, opts, ...fields]: [
|
|
871
|
+
key: string,
|
|
872
|
+
opts: HGetExCommandOptions,
|
|
873
|
+
...fields: (string | number)[]
|
|
874
|
+
], cmdOpts?: CommandOptions<(string | null)[], TData | null>);
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* @see https://redis.io/commands/hincrby
|
|
879
|
+
*/
|
|
880
|
+
declare class HIncrByCommand extends Command<number, number> {
|
|
881
|
+
constructor(cmd: [key: string, field: string, increment: number], opts?: CommandOptions<number, number>);
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* @see https://redis.io/commands/hincrbyfloat
|
|
886
|
+
*/
|
|
887
|
+
declare class HIncrByFloatCommand extends Command<number, number> {
|
|
888
|
+
constructor(cmd: [key: string, field: string, increment: number], opts?: CommandOptions<number, number>);
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* @see https://redis.io/commands/hkeys
|
|
893
|
+
*/
|
|
894
|
+
declare class HKeysCommand extends Command<string[], string[]> {
|
|
895
|
+
constructor([key]: [key: string], opts?: CommandOptions<string[], string[]>);
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
/**
|
|
899
|
+
* @see https://redis.io/commands/hlen
|
|
900
|
+
*/
|
|
901
|
+
declare class HLenCommand extends Command<number, number> {
|
|
902
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* hmget returns an object of all requested fields from a hash
|
|
907
|
+
* The field values are returned as an object like this:
|
|
908
|
+
* ```ts
|
|
909
|
+
* {[fieldName: string]: T | null}
|
|
910
|
+
* ```
|
|
911
|
+
*
|
|
912
|
+
* In case the hash does not exist or all fields are empty `null` is returned
|
|
913
|
+
*
|
|
914
|
+
* @see https://redis.io/commands/hmget
|
|
915
|
+
*/
|
|
916
|
+
declare class HMGetCommand<TData extends Record<string, unknown>> extends Command<(string | null)[], TData | null> {
|
|
917
|
+
constructor([key, ...fields]: [key: string, ...fields: string[]], opts?: CommandOptions<(string | null)[], TData | null>);
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* @see https://redis.io/commands/hmset
|
|
922
|
+
*/
|
|
923
|
+
declare class HMSetCommand<TData> extends Command<"OK", "OK"> {
|
|
924
|
+
constructor([key, kv]: [key: string, kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">);
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* @see https://redis.io/commands/hrandfield
|
|
929
|
+
*/
|
|
930
|
+
declare class HRandFieldCommand<TData extends string | string[] | Record<string, unknown>> extends Command<string | string[], TData> {
|
|
931
|
+
constructor(cmd: [key: string], opts?: CommandOptions<string, string>);
|
|
932
|
+
constructor(cmd: [key: string, count: number], opts?: CommandOptions<string[], string[]>);
|
|
933
|
+
constructor(cmd: [key: string, count: number, withValues: boolean], opts?: CommandOptions<string[], Partial<TData>>);
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
type ScanCommandOptionsStandard = {
|
|
937
|
+
match?: string;
|
|
938
|
+
count?: number;
|
|
939
|
+
type?: string;
|
|
940
|
+
withType?: false;
|
|
941
|
+
};
|
|
942
|
+
type ScanCommandOptionsWithType = {
|
|
943
|
+
match?: string;
|
|
944
|
+
count?: number;
|
|
945
|
+
/**
|
|
946
|
+
* Includes types of each key in the result
|
|
947
|
+
*
|
|
948
|
+
* @example
|
|
949
|
+
* ```typescript
|
|
950
|
+
* await redis.scan("0", { withType: true })
|
|
951
|
+
* // ["0", [{ key: "key1", type: "string" }, { key: "key2", type: "list" }]]
|
|
952
|
+
* ```
|
|
953
|
+
*/
|
|
954
|
+
withType: true;
|
|
955
|
+
};
|
|
956
|
+
type ScanCommandOptions = ScanCommandOptionsStandard | ScanCommandOptionsWithType;
|
|
957
|
+
type ScanResultStandard = [string, string[]];
|
|
958
|
+
type ScanResultWithType = [string, {
|
|
959
|
+
key: string;
|
|
960
|
+
type: string;
|
|
961
|
+
}[]];
|
|
962
|
+
/**
|
|
963
|
+
* @see https://redis.io/commands/scan
|
|
964
|
+
*/
|
|
965
|
+
declare class ScanCommand<TData = ScanResultStandard> extends Command<[string, string[]], TData> {
|
|
966
|
+
constructor([cursor, opts]: [cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, string[]], TData>);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* @see https://redis.io/commands/hscan
|
|
971
|
+
*/
|
|
972
|
+
declare class HScanCommand extends Command<[
|
|
973
|
+
string,
|
|
974
|
+
(string | number)[]
|
|
975
|
+
], [
|
|
976
|
+
string,
|
|
977
|
+
(string | number)[]
|
|
978
|
+
]> {
|
|
979
|
+
constructor([key, cursor, cmdOpts]: [key: string, cursor: string | number, cmdOpts?: ScanCommandOptions], opts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
/**
|
|
983
|
+
* @see https://redis.io/commands/hset
|
|
984
|
+
*/
|
|
985
|
+
declare class HSetCommand<TData> extends Command<number, number> {
|
|
986
|
+
constructor([key, kv]: [key: string, kv: Record<string, TData>], opts?: CommandOptions<number, number>);
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
type HSetExConditionalOptions = "FNX" | "fnx" | "FXX" | "fxx";
|
|
990
|
+
type HSetExExpirationOptions = {
|
|
991
|
+
ex: number;
|
|
992
|
+
px?: never;
|
|
993
|
+
exat?: never;
|
|
994
|
+
pxat?: never;
|
|
995
|
+
keepttl?: never;
|
|
996
|
+
} | {
|
|
997
|
+
ex?: never;
|
|
998
|
+
px: number;
|
|
999
|
+
exat?: never;
|
|
1000
|
+
pxat?: never;
|
|
1001
|
+
keepttl?: never;
|
|
1002
|
+
} | {
|
|
1003
|
+
ex?: never;
|
|
1004
|
+
px?: never;
|
|
1005
|
+
exat: number;
|
|
1006
|
+
pxat?: never;
|
|
1007
|
+
keepttl?: never;
|
|
1008
|
+
} | {
|
|
1009
|
+
ex?: never;
|
|
1010
|
+
px?: never;
|
|
1011
|
+
exat?: never;
|
|
1012
|
+
pxat: number;
|
|
1013
|
+
keepttl?: never;
|
|
1014
|
+
} | {
|
|
1015
|
+
ex?: never;
|
|
1016
|
+
px?: never;
|
|
1017
|
+
exat?: never;
|
|
1018
|
+
pxat?: never;
|
|
1019
|
+
keepttl: true;
|
|
1020
|
+
} | {
|
|
1021
|
+
ex?: never;
|
|
1022
|
+
px?: never;
|
|
1023
|
+
exat?: never;
|
|
1024
|
+
pxat?: never;
|
|
1025
|
+
keepttl?: never;
|
|
1026
|
+
};
|
|
1027
|
+
type HSetExCommandOptions = {
|
|
1028
|
+
conditional?: HSetExConditionalOptions;
|
|
1029
|
+
expiration?: HSetExExpirationOptions;
|
|
1030
|
+
};
|
|
1031
|
+
/**
|
|
1032
|
+
* HSETEX sets the specified fields with their values and optionally sets their expiration time or TTL
|
|
1033
|
+
* Returns 1 on success and 0 otherwise.
|
|
1034
|
+
*
|
|
1035
|
+
* @see https://redis.io/commands/hsetex
|
|
1036
|
+
*/
|
|
1037
|
+
declare class HSetExCommand<TData> extends Command<number, number> {
|
|
1038
|
+
constructor([key, opts, kv]: [key: string, opts: HSetExCommandOptions, kv: Record<string, TData>], cmdOpts?: CommandOptions<number, number>);
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
/**
|
|
1042
|
+
* @see https://redis.io/commands/hsetnx
|
|
1043
|
+
*/
|
|
1044
|
+
declare class HSetNXCommand<TData> extends Command<"0" | "1", 0 | 1> {
|
|
1045
|
+
constructor(cmd: [key: string, field: string, value: TData], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
/**
|
|
1049
|
+
* @see https://redis.io/commands/hstrlen
|
|
1050
|
+
*/
|
|
1051
|
+
declare class HStrLenCommand extends Command<number, number> {
|
|
1052
|
+
constructor(cmd: [key: string, field: string], opts?: CommandOptions<number, number>);
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
declare class HTtlCommand extends Command<number[], number[]> {
|
|
1056
|
+
constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<number[], number[]>);
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* @see https://redis.io/commands/hvals
|
|
1061
|
+
*/
|
|
1062
|
+
declare class HValsCommand<TData extends unknown[]> extends Command<unknown[], TData> {
|
|
1063
|
+
constructor(cmd: [key: string], opts?: CommandOptions<unknown[], TData>);
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
/**
|
|
1067
|
+
* @see https://redis.io/commands/incr
|
|
1068
|
+
*/
|
|
1069
|
+
declare class IncrCommand extends Command<number, number> {
|
|
1070
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
/**
|
|
1074
|
+
* @see https://redis.io/commands/incrby
|
|
1075
|
+
*/
|
|
1076
|
+
declare class IncrByCommand extends Command<number, number> {
|
|
1077
|
+
constructor(cmd: [key: string, value: number], opts?: CommandOptions<number, number>);
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
/**
|
|
1081
|
+
* @see https://redis.io/commands/incrbyfloat
|
|
1082
|
+
*/
|
|
1083
|
+
declare class IncrByFloatCommand extends Command<number, number> {
|
|
1084
|
+
constructor(cmd: [key: string, value: number], opts?: CommandOptions<number, number>);
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
/**
|
|
1088
|
+
* @see https://redis.io/commands/json.arrappend
|
|
1089
|
+
*/
|
|
1090
|
+
declare class JsonArrAppendCommand<TData extends unknown[]> extends Command<(null | string)[], (null | number)[]> {
|
|
1091
|
+
constructor(cmd: [key: string, path: string, ...values: TData], opts?: CommandOptions<(null | string)[], (null | number)[]>);
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
/**
|
|
1095
|
+
* @see https://redis.io/commands/json.arrindex
|
|
1096
|
+
*/
|
|
1097
|
+
declare class JsonArrIndexCommand<TValue> extends Command<(null | string)[], (null | number)[]> {
|
|
1098
|
+
constructor(cmd: [key: string, path: string, value: TValue, start?: number, stop?: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
/**
|
|
1102
|
+
* @see https://redis.io/commands/json.arrinsert
|
|
1103
|
+
*/
|
|
1104
|
+
declare class JsonArrInsertCommand<TData extends unknown[]> extends Command<(null | string)[], (null | number)[]> {
|
|
1105
|
+
constructor(cmd: [key: string, path: string, index: number, ...values: TData], opts?: CommandOptions<(null | string)[], (null | number)[]>);
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
/**
|
|
1109
|
+
* @see https://redis.io/commands/json.arrlen
|
|
1110
|
+
*/
|
|
1111
|
+
declare class JsonArrLenCommand extends Command<(null | string)[], (null | number)[]> {
|
|
1112
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(null | string)[], (null | number)[]>);
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
/**
|
|
1116
|
+
* @see https://redis.io/commands/json.arrpop
|
|
1117
|
+
*/
|
|
1118
|
+
declare class JsonArrPopCommand<TData> extends Command<(null | string)[], (TData | null)[]> {
|
|
1119
|
+
constructor(cmd: [key: string, path?: string, index?: number], opts?: CommandOptions<(null | string)[], (TData | null)[]>);
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* @see https://redis.io/commands/json.arrtrim
|
|
1124
|
+
*/
|
|
1125
|
+
declare class JsonArrTrimCommand extends Command<(null | string)[], (null | number)[]> {
|
|
1126
|
+
constructor(cmd: [key: string, path?: string, start?: number, stop?: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* @see https://redis.io/commands/json.clear
|
|
1131
|
+
*/
|
|
1132
|
+
declare class JsonClearCommand extends Command<number, number> {
|
|
1133
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<number, number>);
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* @see https://redis.io/commands/json.del
|
|
1138
|
+
*/
|
|
1139
|
+
declare class JsonDelCommand extends Command<number, number> {
|
|
1140
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<number, number>);
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
/**
|
|
1144
|
+
* @see https://redis.io/commands/json.forget
|
|
1145
|
+
*/
|
|
1146
|
+
declare class JsonForgetCommand extends Command<number, number> {
|
|
1147
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<number, number>);
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
/**
|
|
1151
|
+
* @see https://redis.io/commands/json.get
|
|
1152
|
+
*/
|
|
1153
|
+
declare class JsonGetCommand<TData extends (unknown | Record<string, unknown>) | (unknown | Record<string, unknown>)[]> extends Command<TData | null, TData | null> {
|
|
1154
|
+
constructor(cmd: [
|
|
1155
|
+
key: string,
|
|
1156
|
+
opts?: {
|
|
1157
|
+
indent?: string;
|
|
1158
|
+
newline?: string;
|
|
1159
|
+
space?: string;
|
|
1160
|
+
},
|
|
1161
|
+
...path: string[]
|
|
1162
|
+
] | [key: string, ...path: string[]], opts?: CommandOptions<TData | null, TData | null>);
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* @see https://redis.io/commands/json.merge
|
|
1167
|
+
*/
|
|
1168
|
+
declare class JsonMergeCommand<TData extends string | number | Record<string, unknown> | Array<unknown>> extends Command<"OK" | null, "OK" | null> {
|
|
1169
|
+
constructor(cmd: [key: string, path: string, value: TData], opts?: CommandOptions<"OK" | null, "OK" | null>);
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
/**
|
|
1173
|
+
* @see https://redis.io/commands/json.mget
|
|
1174
|
+
*/
|
|
1175
|
+
declare class JsonMGetCommand<TData = unknown[]> extends Command<TData, TData> {
|
|
1176
|
+
constructor(cmd: [keys: string[], path: string], opts?: CommandOptions<TData, TData>);
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
/**
|
|
1180
|
+
* @see https://redis.io/commands/json.mset
|
|
1181
|
+
*/
|
|
1182
|
+
declare class JsonMSetCommand<TData extends number | string | boolean | Record<string, unknown> | (number | string | boolean | Record<string, unknown>)[]> extends Command<"OK" | null, "OK" | null> {
|
|
1183
|
+
constructor(cmd: {
|
|
1184
|
+
key: string;
|
|
1185
|
+
path: string;
|
|
1186
|
+
value: TData;
|
|
1187
|
+
}[], opts?: CommandOptions<"OK" | null, "OK" | null>);
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
/**
|
|
1191
|
+
* @see https://redis.io/commands/json.numincrby
|
|
1192
|
+
*/
|
|
1193
|
+
declare class JsonNumIncrByCommand extends Command<(null | string)[], (null | number)[]> {
|
|
1194
|
+
constructor(cmd: [key: string, path: string, value: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
/**
|
|
1198
|
+
* @see https://redis.io/commands/json.nummultby
|
|
1199
|
+
*/
|
|
1200
|
+
declare class JsonNumMultByCommand extends Command<(null | string)[], (null | number)[]> {
|
|
1201
|
+
constructor(cmd: [key: string, path: string, value: number], opts?: CommandOptions<(null | string)[], (null | number)[]>);
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
/**
|
|
1205
|
+
* @see https://redis.io/commands/json.objkeys
|
|
1206
|
+
*/
|
|
1207
|
+
declare class JsonObjKeysCommand extends Command<(string[] | null)[], (string[] | null)[]> {
|
|
1208
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(string[] | null)[], (string[] | null)[]>);
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
/**
|
|
1212
|
+
* @see https://redis.io/commands/json.objlen
|
|
1213
|
+
*/
|
|
1214
|
+
declare class JsonObjLenCommand extends Command<(number | null)[], (number | null)[]> {
|
|
1215
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(number | null)[], (number | null)[]>);
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* @see https://redis.io/commands/json.resp
|
|
1220
|
+
*/
|
|
1221
|
+
declare class JsonRespCommand<TData extends unknown[]> extends Command<TData, TData> {
|
|
1222
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<TData, TData>);
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
/**
|
|
1226
|
+
* @see https://redis.io/commands/json.set
|
|
1227
|
+
*/
|
|
1228
|
+
declare class JsonSetCommand<TData extends number | string | boolean | Record<string, unknown> | (number | string | boolean | Record<string, unknown>)[]> extends Command<"OK" | null, "OK" | null> {
|
|
1229
|
+
constructor(cmd: [
|
|
1230
|
+
key: string,
|
|
1231
|
+
path: string,
|
|
1232
|
+
value: TData,
|
|
1233
|
+
opts?: {
|
|
1234
|
+
nx: true;
|
|
1235
|
+
xx?: never;
|
|
1236
|
+
} | {
|
|
1237
|
+
nx?: never;
|
|
1238
|
+
xx: true;
|
|
1239
|
+
}
|
|
1240
|
+
], opts?: CommandOptions<"OK" | null, "OK" | null>);
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* @see https://redis.io/commands/json.strappend
|
|
1245
|
+
*/
|
|
1246
|
+
declare class JsonStrAppendCommand extends Command<(null | string)[], (null | number)[]> {
|
|
1247
|
+
constructor(cmd: [key: string, path: string, value: string], opts?: CommandOptions<(null | string)[], (null | number)[]>);
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* @see https://redis.io/commands/json.strlen
|
|
1252
|
+
*/
|
|
1253
|
+
declare class JsonStrLenCommand extends Command<(number | null)[], (number | null)[]> {
|
|
1254
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<(number | null)[], (number | null)[]>);
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
/**
|
|
1258
|
+
* @see https://redis.io/commands/json.toggle
|
|
1259
|
+
*/
|
|
1260
|
+
declare class JsonToggleCommand extends Command<number[], number[]> {
|
|
1261
|
+
constructor(cmd: [key: string, path: string], opts?: CommandOptions<number[], number[]>);
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
/**
|
|
1265
|
+
* @see https://redis.io/commands/json.type
|
|
1266
|
+
*/
|
|
1267
|
+
declare class JsonTypeCommand extends Command<string[], string[]> {
|
|
1268
|
+
constructor(cmd: [key: string, path?: string], opts?: CommandOptions<string[], string[]>);
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
/**
|
|
1272
|
+
* @see https://redis.io/commands/keys
|
|
1273
|
+
*/
|
|
1274
|
+
declare class KeysCommand extends Command<string[], string[]> {
|
|
1275
|
+
constructor(cmd: [pattern: string], opts?: CommandOptions<string[], string[]>);
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
declare class LIndexCommand<TData = string> extends Command<unknown | null, TData | null> {
|
|
1279
|
+
constructor(cmd: [key: string, index: number], opts?: CommandOptions<unknown | null, TData | null>);
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
declare class LInsertCommand<TData = string> extends Command<number, number> {
|
|
1283
|
+
constructor(cmd: [key: string, direction: "before" | "after", pivot: TData, value: TData], opts?: CommandOptions<number, number>);
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
/**
|
|
1287
|
+
* @see https://redis.io/commands/llen
|
|
1288
|
+
*/
|
|
1289
|
+
declare class LLenCommand extends Command<number, number> {
|
|
1290
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
/**
|
|
1294
|
+
* @see https://redis.io/commands/lmove
|
|
1295
|
+
*/
|
|
1296
|
+
declare class LMoveCommand<TData = string> extends Command<TData, TData> {
|
|
1297
|
+
constructor(cmd: [
|
|
1298
|
+
source: string,
|
|
1299
|
+
destination: string,
|
|
1300
|
+
whereFrom: "left" | "right",
|
|
1301
|
+
whereTo: "left" | "right"
|
|
1302
|
+
], opts?: CommandOptions<TData, TData>);
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
/**
|
|
1306
|
+
* @see https://redis.io/commands/lpop
|
|
1307
|
+
*/
|
|
1308
|
+
declare class LPopCommand<TData = string> extends Command<unknown | null, TData | null> {
|
|
1309
|
+
constructor(cmd: [key: string, count?: number], opts?: CommandOptions<unknown | null, TData | null>);
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
/**
|
|
1313
|
+
* @see https://redis.io/commands/lpush
|
|
1314
|
+
*/
|
|
1315
|
+
declare class LPushCommand<TData = string> extends Command<number, number> {
|
|
1316
|
+
constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
/**
|
|
1320
|
+
* @see https://redis.io/commands/lpushx
|
|
1321
|
+
*/
|
|
1322
|
+
declare class LPushXCommand<TData> extends Command<number, number> {
|
|
1323
|
+
constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
declare class LRangeCommand<TData = string> extends Command<unknown[], TData[]> {
|
|
1327
|
+
constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<unknown[], TData[]>);
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
declare class LRemCommand<TData> extends Command<number, number> {
|
|
1331
|
+
constructor(cmd: [key: string, count: number, value: TData], opts?: CommandOptions<number, number>);
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
declare class LSetCommand<TData = string> extends Command<"OK", "OK"> {
|
|
1335
|
+
constructor(cmd: [key: string, index: number, data: TData], opts?: CommandOptions<"OK", "OK">);
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
declare class LTrimCommand extends Command<"OK", "OK"> {
|
|
1339
|
+
constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<"OK", "OK">);
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
/**
|
|
1343
|
+
* @see https://redis.io/commands/mget
|
|
1344
|
+
*/
|
|
1345
|
+
declare class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
|
|
1346
|
+
constructor(cmd: [string[]] | [...string[]], opts?: CommandOptions<(string | null)[], TData>);
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
/**
|
|
1350
|
+
* @see https://redis.io/commands/mset
|
|
1351
|
+
*/
|
|
1352
|
+
declare class MSetCommand<TData> extends Command<"OK", "OK"> {
|
|
1353
|
+
constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">);
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
/**
|
|
1357
|
+
* @see https://redis.io/commands/msetnx
|
|
1358
|
+
*/
|
|
1359
|
+
declare class MSetNXCommand<TData = string> extends Command<number, number> {
|
|
1360
|
+
constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<number, number>);
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
/**
|
|
1364
|
+
* @see https://redis.io/commands/persist
|
|
1365
|
+
*/
|
|
1366
|
+
declare class PersistCommand extends Command<"0" | "1", 0 | 1> {
|
|
1367
|
+
constructor(cmd: [key: string], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
/**
|
|
1371
|
+
* @see https://redis.io/commands/pexpire
|
|
1372
|
+
*/
|
|
1373
|
+
declare class PExpireCommand extends Command<"0" | "1", 0 | 1> {
|
|
1374
|
+
constructor(cmd: [key: string, milliseconds: number, option?: ExpireOption], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
/**
|
|
1378
|
+
* @see https://redis.io/commands/pexpireat
|
|
1379
|
+
*/
|
|
1380
|
+
declare class PExpireAtCommand extends Command<"0" | "1", 0 | 1> {
|
|
1381
|
+
constructor(cmd: [key: string, unix: number, option?: ExpireOption], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
/**
|
|
1385
|
+
* @see https://redis.io/commands/ping
|
|
1386
|
+
*/
|
|
1387
|
+
declare class PingCommand extends Command<string | "PONG", string | "PONG"> {
|
|
1388
|
+
constructor(cmd?: [message?: string], opts?: CommandOptions<string | "PONG", string | "PONG">);
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
/**
|
|
1392
|
+
* @see https://redis.io/commands/psetex
|
|
1393
|
+
*/
|
|
1394
|
+
declare class PSetEXCommand<TData = string> extends Command<string, string> {
|
|
1395
|
+
constructor(cmd: [key: string, ttl: number, value: TData], opts?: CommandOptions<string, string>);
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
/**
|
|
1399
|
+
* @see https://redis.io/commands/pttl
|
|
1400
|
+
*/
|
|
1401
|
+
declare class PTtlCommand extends Command<number, number> {
|
|
1402
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
/**
|
|
1406
|
+
* @see https://redis.io/commands/publish
|
|
1407
|
+
*/
|
|
1408
|
+
declare class PublishCommand<TMessage = unknown> extends Command<number, number> {
|
|
1409
|
+
constructor(cmd: [channel: string, message: TMessage], opts?: CommandOptions<number, number>);
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
/**
|
|
1413
|
+
* @see https://redis.io/commands/randomkey
|
|
1414
|
+
*/
|
|
1415
|
+
declare class RandomKeyCommand extends Command<string | null, string | null> {
|
|
1416
|
+
constructor(opts?: CommandOptions<string | null, string | null>);
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
/**
|
|
1420
|
+
* @see https://redis.io/commands/rename
|
|
1421
|
+
*/
|
|
1422
|
+
declare class RenameCommand extends Command<"OK", "OK"> {
|
|
1423
|
+
constructor(cmd: [source: string, destination: string], opts?: CommandOptions<"OK", "OK">);
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
/**
|
|
1427
|
+
* @see https://redis.io/commands/renamenx
|
|
1428
|
+
*/
|
|
1429
|
+
declare class RenameNXCommand extends Command<"0" | "1", 0 | 1> {
|
|
1430
|
+
constructor(cmd: [source: string, destination: string], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
/**
|
|
1434
|
+
* @see https://redis.io/commands/rpop
|
|
1435
|
+
*/
|
|
1436
|
+
declare class RPopCommand<TData extends unknown | unknown[] = string> extends Command<unknown | null, TData | null> {
|
|
1437
|
+
constructor(cmd: [key: string, count?: number], opts?: CommandOptions<unknown | null, TData | null>);
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
/**
|
|
1441
|
+
* @see https://redis.io/commands/rpush
|
|
1442
|
+
*/
|
|
1443
|
+
declare class RPushCommand<TData = string> extends Command<number, number> {
|
|
1444
|
+
constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
/**
|
|
1448
|
+
* @see https://redis.io/commands/rpushx
|
|
1449
|
+
*/
|
|
1450
|
+
declare class RPushXCommand<TData = string> extends Command<number, number> {
|
|
1451
|
+
constructor(cmd: [key: string, ...elements: TData[]], opts?: CommandOptions<number, number>);
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
/**
|
|
1455
|
+
* @see https://redis.io/commands/sadd
|
|
1456
|
+
*/
|
|
1457
|
+
declare class SAddCommand<TData = string> extends Command<number, number> {
|
|
1458
|
+
constructor(cmd: [key: string, member: TData, ...members: TData[]], opts?: CommandOptions<number, number>);
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
/**
|
|
1462
|
+
* @see https://redis.io/commands/scard
|
|
1463
|
+
*/
|
|
1464
|
+
declare class SCardCommand extends Command<number, number> {
|
|
1465
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
/**
|
|
1469
|
+
* @see https://redis.io/commands/script-exists
|
|
1470
|
+
*/
|
|
1471
|
+
declare class ScriptExistsCommand<T extends string[]> extends Command<string[], number[]> {
|
|
1472
|
+
constructor(hashes: T, opts?: CommandOptions<string[], number[]>);
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
/**
|
|
1476
|
+
* @see https://redis.io/commands/script-load
|
|
1477
|
+
*/
|
|
1478
|
+
declare class ScriptLoadCommand extends Command<string, string> {
|
|
1479
|
+
constructor(args: [script: string], opts?: CommandOptions<string, string>);
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
/**
|
|
1483
|
+
* @see https://redis.io/commands/sdiff
|
|
1484
|
+
*/
|
|
1485
|
+
declare class SDiffCommand<TData> extends Command<unknown[], TData[]> {
|
|
1486
|
+
constructor(cmd: [key: string, ...keys: string[]], opts?: CommandOptions<unknown[], TData[]>);
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
/**
|
|
1490
|
+
* @see https://redis.io/commands/sdiffstore
|
|
1491
|
+
*/
|
|
1492
|
+
declare class SDiffStoreCommand extends Command<number, number> {
|
|
1493
|
+
constructor(cmd: [destination: string, ...keys: string[]], opts?: CommandOptions<number, number>);
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
type SetCommandOptions = {
|
|
1497
|
+
get?: boolean;
|
|
1498
|
+
} & ({
|
|
1499
|
+
ex: number;
|
|
1500
|
+
px?: never;
|
|
1501
|
+
exat?: never;
|
|
1502
|
+
pxat?: never;
|
|
1503
|
+
keepTtl?: never;
|
|
1504
|
+
} | {
|
|
1505
|
+
ex?: never;
|
|
1506
|
+
px: number;
|
|
1507
|
+
exat?: never;
|
|
1508
|
+
pxat?: never;
|
|
1509
|
+
keepTtl?: never;
|
|
1510
|
+
} | {
|
|
1511
|
+
ex?: never;
|
|
1512
|
+
px?: never;
|
|
1513
|
+
exat: number;
|
|
1514
|
+
pxat?: never;
|
|
1515
|
+
keepTtl?: never;
|
|
1516
|
+
} | {
|
|
1517
|
+
ex?: never;
|
|
1518
|
+
px?: never;
|
|
1519
|
+
exat?: never;
|
|
1520
|
+
pxat: number;
|
|
1521
|
+
keepTtl?: never;
|
|
1522
|
+
} | {
|
|
1523
|
+
ex?: never;
|
|
1524
|
+
px?: never;
|
|
1525
|
+
exat?: never;
|
|
1526
|
+
pxat?: never;
|
|
1527
|
+
keepTtl: true;
|
|
1528
|
+
} | {
|
|
1529
|
+
ex?: never;
|
|
1530
|
+
px?: never;
|
|
1531
|
+
exat?: never;
|
|
1532
|
+
pxat?: never;
|
|
1533
|
+
keepTtl?: never;
|
|
1534
|
+
}) & ({
|
|
1535
|
+
nx: true;
|
|
1536
|
+
xx?: never;
|
|
1537
|
+
} | {
|
|
1538
|
+
xx: true;
|
|
1539
|
+
nx?: never;
|
|
1540
|
+
} | {
|
|
1541
|
+
xx?: never;
|
|
1542
|
+
nx?: never;
|
|
1543
|
+
});
|
|
1544
|
+
/**
|
|
1545
|
+
* @see https://redis.io/commands/set
|
|
1546
|
+
*/
|
|
1547
|
+
declare class SetCommand<TData, TResult = TData | "OK" | null> extends Command<TResult, TData | "OK" | null> {
|
|
1548
|
+
constructor([key, value, opts]: [key: string, value: TData, opts?: SetCommandOptions], cmdOpts?: CommandOptions<TResult, TData>);
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
/**
|
|
1552
|
+
* @see https://redis.io/commands/setbit
|
|
1553
|
+
*/
|
|
1554
|
+
declare class SetBitCommand extends Command<"0" | "1", 0 | 1> {
|
|
1555
|
+
constructor(cmd: [key: string, offset: number, value: 0 | 1], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
/**
|
|
1559
|
+
* @see https://redis.io/commands/setex
|
|
1560
|
+
*/
|
|
1561
|
+
declare class SetExCommand<TData = string> extends Command<"OK", "OK"> {
|
|
1562
|
+
constructor(cmd: [key: string, ttl: number, value: TData], opts?: CommandOptions<"OK", "OK">);
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
/**
|
|
1566
|
+
* @see https://redis.io/commands/setnx
|
|
1567
|
+
*/
|
|
1568
|
+
declare class SetNxCommand<TData = string> extends Command<number, number> {
|
|
1569
|
+
constructor(cmd: [key: string, value: TData], opts?: CommandOptions<number, number>);
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
/**
|
|
1573
|
+
* @see https://redis.io/commands/setrange
|
|
1574
|
+
*/
|
|
1575
|
+
declare class SetRangeCommand extends Command<number, number> {
|
|
1576
|
+
constructor(cmd: [key: string, offset: number, value: string], opts?: CommandOptions<number, number>);
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
/**
|
|
1580
|
+
* @see https://redis.io/commands/sinter
|
|
1581
|
+
*/
|
|
1582
|
+
declare class SInterCommand<TData = string> extends Command<unknown[], TData[]> {
|
|
1583
|
+
constructor(cmd: [key: string, ...keys: string[]], opts?: CommandOptions<unknown[], TData[]>);
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
/**
|
|
1587
|
+
* @see https://redis.io/commands/sinterstore
|
|
1588
|
+
*/
|
|
1589
|
+
declare class SInterStoreCommand extends Command<number, number> {
|
|
1590
|
+
constructor(cmd: [destination: string, key: string, ...keys: string[]], opts?: CommandOptions<number, number>);
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
/**
|
|
1594
|
+
* @see https://redis.io/commands/sismember
|
|
1595
|
+
*/
|
|
1596
|
+
declare class SIsMemberCommand<TData = string> extends Command<"0" | "1", 0 | 1> {
|
|
1597
|
+
constructor(cmd: [key: string, member: TData], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
/**
|
|
1601
|
+
* @see https://redis.io/commands/smembers
|
|
1602
|
+
*/
|
|
1603
|
+
declare class SMembersCommand<TData extends unknown[] = string[]> extends Command<unknown[], TData> {
|
|
1604
|
+
constructor(cmd: [key: string], opts?: CommandOptions<unknown[], TData>);
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
/**
|
|
1608
|
+
* @see https://redis.io/commands/smismember
|
|
1609
|
+
*/
|
|
1610
|
+
declare class SMIsMemberCommand<TMembers extends unknown[]> extends Command<("0" | "1")[], (0 | 1)[]> {
|
|
1611
|
+
constructor(cmd: [key: string, members: TMembers], opts?: CommandOptions<("0" | "1")[], (0 | 1)[]>);
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
/**
|
|
1615
|
+
* @see https://redis.io/commands/smove
|
|
1616
|
+
*/
|
|
1617
|
+
declare class SMoveCommand<TData> extends Command<"0" | "1", 0 | 1> {
|
|
1618
|
+
constructor(cmd: [source: string, destination: string, member: TData], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
/**
|
|
1622
|
+
* @see https://redis.io/commands/spop
|
|
1623
|
+
*/
|
|
1624
|
+
declare class SPopCommand<TData> extends Command<string | string[] | null, TData | null> {
|
|
1625
|
+
constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string | string[] | null, TData | null>);
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
/**
|
|
1629
|
+
* @see https://redis.io/commands/srandmember
|
|
1630
|
+
*/
|
|
1631
|
+
declare class SRandMemberCommand<TData> extends Command<string | null, TData | null> {
|
|
1632
|
+
constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string | null, TData | null>);
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
/**
|
|
1636
|
+
* @see https://redis.io/commands/srem
|
|
1637
|
+
*/
|
|
1638
|
+
declare class SRemCommand<TData = string> extends Command<number, number> {
|
|
1639
|
+
constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
/**
|
|
1643
|
+
* @see https://redis.io/commands/sscan
|
|
1644
|
+
*/
|
|
1645
|
+
declare class SScanCommand extends Command<[
|
|
1646
|
+
string,
|
|
1647
|
+
(string | number)[]
|
|
1648
|
+
], [
|
|
1649
|
+
string,
|
|
1650
|
+
(string | number)[]
|
|
1651
|
+
]> {
|
|
1652
|
+
constructor([key, cursor, opts]: [key: string, cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
/**
|
|
1656
|
+
* @see https://redis.io/commands/strlen
|
|
1657
|
+
*/
|
|
1658
|
+
declare class StrLenCommand extends Command<number, number> {
|
|
1659
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
/**
|
|
1663
|
+
* @see https://redis.io/commands/sunion
|
|
1664
|
+
*/
|
|
1665
|
+
declare class SUnionCommand<TData> extends Command<string[], TData[]> {
|
|
1666
|
+
constructor(cmd: [key: string, ...keys: string[]], opts?: CommandOptions<string[], TData[]>);
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
/**
|
|
1670
|
+
* @see https://redis.io/commands/sunionstore
|
|
1671
|
+
*/
|
|
1672
|
+
declare class SUnionStoreCommand extends Command<number, number> {
|
|
1673
|
+
constructor(cmd: [destination: string, key: string, ...keys: string[]], opts?: CommandOptions<number, number>);
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
/**
|
|
1677
|
+
* @see https://redis.io/commands/time
|
|
1678
|
+
*/
|
|
1679
|
+
declare class TimeCommand extends Command<[number, number], [number, number]> {
|
|
1680
|
+
constructor(opts?: CommandOptions<[number, number], [number, number]>);
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
/**
|
|
1684
|
+
* @see https://redis.io/commands/touch
|
|
1685
|
+
*/
|
|
1686
|
+
declare class TouchCommand extends Command<number, number> {
|
|
1687
|
+
constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
/**
|
|
1691
|
+
* @see https://redis.io/commands/ttl
|
|
1692
|
+
*/
|
|
1693
|
+
declare class TtlCommand extends Command<number, number> {
|
|
1694
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
/**
|
|
1698
|
+
* @see https://redis.io/commands/unlink
|
|
1699
|
+
*/
|
|
1700
|
+
declare class UnlinkCommand extends Command<number, number> {
|
|
1701
|
+
constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
type XAckDelOption = "KEEPREF" | "keepref" | "DELREF" | "delref" | "ACKED" | "acked";
|
|
1705
|
+
/**
|
|
1706
|
+
* @see https://redis.io/commands/xackdel
|
|
1707
|
+
*/
|
|
1708
|
+
declare class XAckDelCommand extends Command<number[], number[]> {
|
|
1709
|
+
constructor([key, group, opts, ...ids]: [key: string, group: string, opts: XAckDelOption, ...ids: string[]], cmdOpts?: CommandOptions<number[], number[]>);
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
type XAddCommandOptions = {
|
|
1713
|
+
nomkStream?: boolean;
|
|
1714
|
+
trim?: ({
|
|
1715
|
+
type: "MAXLEN" | "maxlen";
|
|
1716
|
+
threshold: number;
|
|
1717
|
+
} | {
|
|
1718
|
+
type: "MINID" | "minid";
|
|
1719
|
+
threshold: string;
|
|
1720
|
+
}) & ({
|
|
1721
|
+
comparison: "~";
|
|
1722
|
+
limit?: number;
|
|
1723
|
+
} | {
|
|
1724
|
+
comparison: "=";
|
|
1725
|
+
limit?: never;
|
|
1726
|
+
});
|
|
1727
|
+
};
|
|
1728
|
+
/**
|
|
1729
|
+
* @see https://redis.io/commands/xadd
|
|
1730
|
+
*
|
|
1731
|
+
* Stream ID formats:
|
|
1732
|
+
* - "*" - Fully automatic ID generation
|
|
1733
|
+
* - "<ms>-<seq>" - Explicit ID (e.g., "1526919030474-55")
|
|
1734
|
+
* - "<ms>-*" - Auto-generate sequence number for the given millisecond timestamp (Redis 8+)
|
|
1735
|
+
*/
|
|
1736
|
+
declare class XAddCommand extends Command<string, string> {
|
|
1737
|
+
constructor([key, id, entries, opts]: [
|
|
1738
|
+
key: string,
|
|
1739
|
+
id: "*" | `${number}-*` | string,
|
|
1740
|
+
entries: Record<string, unknown>,
|
|
1741
|
+
opts?: XAddCommandOptions
|
|
1742
|
+
], commandOptions?: CommandOptions<string, string>);
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
type XDelExOption = "KEEPREF" | "keepref" | "DELREF" | "delref" | "ACKED" | "acked";
|
|
1746
|
+
/**
|
|
1747
|
+
* @see https://redis.io/commands/xdelex
|
|
1748
|
+
*/
|
|
1749
|
+
declare class XDelExCommand extends Command<number[], number[]> {
|
|
1750
|
+
constructor([key, opts, ...ids]: [key: string, opts?: XDelExOption, ...ids: string[]], cmdOpts?: CommandOptions<number[], number[]>);
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
declare class XRangeCommand<TData extends Record<string, Record<string, unknown>>> extends Command<string[][], TData> {
|
|
1754
|
+
constructor([key, start, end, count]: [key: string, start: string, end: string, count?: number], opts?: CommandOptions<unknown[], TData[]>);
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
type XReadCommandOptions = [
|
|
1758
|
+
key: string | string[],
|
|
1759
|
+
id: string | string[],
|
|
1760
|
+
options?: {
|
|
1761
|
+
count?: number;
|
|
1762
|
+
/**
|
|
1763
|
+
* @deprecated block is not yet supported in Upstash Redis
|
|
1764
|
+
*/
|
|
1765
|
+
blockMS?: number;
|
|
1766
|
+
}
|
|
1767
|
+
];
|
|
1768
|
+
type XReadOptions = XReadCommandOptions extends [infer K, infer I, ...any[]] ? K extends string ? I extends string ? [
|
|
1769
|
+
key: string,
|
|
1770
|
+
id: string,
|
|
1771
|
+
options?: {
|
|
1772
|
+
count?: number;
|
|
1773
|
+
/**
|
|
1774
|
+
* @deprecated block is not yet supported in Upstash Redis
|
|
1775
|
+
*/
|
|
1776
|
+
blockMS?: number;
|
|
1777
|
+
}
|
|
1778
|
+
] : never : K extends string[] ? I extends string[] ? [
|
|
1779
|
+
key: string[],
|
|
1780
|
+
id: string[],
|
|
1781
|
+
options?: {
|
|
1782
|
+
count?: number;
|
|
1783
|
+
/**
|
|
1784
|
+
* @deprecated block is not yet supported in Upstash Redis
|
|
1785
|
+
*/
|
|
1786
|
+
blockMS?: number;
|
|
1787
|
+
}
|
|
1788
|
+
] : never : never : never;
|
|
1789
|
+
/**
|
|
1790
|
+
* @see https://redis.io/commands/xread
|
|
1791
|
+
*/
|
|
1792
|
+
declare class XReadCommand extends Command<number, unknown[]> {
|
|
1793
|
+
constructor([key, id, options]: XReadOptions, opts?: CommandOptions<number, unknown[]>);
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
type Options = {
|
|
1797
|
+
count?: number;
|
|
1798
|
+
/**
|
|
1799
|
+
* @deprecated block is not yet supported in Upstash Redis
|
|
1800
|
+
*/
|
|
1801
|
+
blockMS?: number;
|
|
1802
|
+
NOACK?: boolean;
|
|
1803
|
+
};
|
|
1804
|
+
type XReadGroupCommandOptions = [
|
|
1805
|
+
group: string,
|
|
1806
|
+
consumer: string,
|
|
1807
|
+
key: string | string[],
|
|
1808
|
+
id: string | string[],
|
|
1809
|
+
options?: Options
|
|
1810
|
+
];
|
|
1811
|
+
type XReadGroupOptions = XReadGroupCommandOptions extends [
|
|
1812
|
+
string,
|
|
1813
|
+
string,
|
|
1814
|
+
infer TKey,
|
|
1815
|
+
infer TId,
|
|
1816
|
+
...any[]
|
|
1817
|
+
] ? TKey extends string ? TId extends string ? [group: string, consumer: string, key: string, id: string, options?: Options] : never : TKey extends string[] ? TId extends string[] ? [group: string, consumer: string, key: string[], id: string[], options?: Options] : never : never : never;
|
|
1818
|
+
/**
|
|
1819
|
+
* @see https://redis.io/commands/xreadgroup
|
|
1820
|
+
*/
|
|
1821
|
+
declare class XReadGroupCommand extends Command<number, unknown[]> {
|
|
1822
|
+
constructor([group, consumer, key, id, options]: XReadGroupOptions, opts?: CommandOptions<number, unknown[]>);
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
type NXAndXXOptions = {
|
|
1826
|
+
nx: true;
|
|
1827
|
+
xx?: never;
|
|
1828
|
+
} | {
|
|
1829
|
+
nx?: never;
|
|
1830
|
+
xx: true;
|
|
1831
|
+
} | {
|
|
1832
|
+
nx?: never;
|
|
1833
|
+
xx?: never;
|
|
1834
|
+
};
|
|
1835
|
+
type LTAndGTOptions = {
|
|
1836
|
+
lt: true;
|
|
1837
|
+
gt?: never;
|
|
1838
|
+
} | {
|
|
1839
|
+
lt?: never;
|
|
1840
|
+
gt: true;
|
|
1841
|
+
} | {
|
|
1842
|
+
lt?: never;
|
|
1843
|
+
gt?: never;
|
|
1844
|
+
};
|
|
1845
|
+
type ZAddCommandOptions = NXAndXXOptions & LTAndGTOptions & {
|
|
1846
|
+
ch?: true;
|
|
1847
|
+
} & {
|
|
1848
|
+
incr?: true;
|
|
1849
|
+
};
|
|
1850
|
+
type Arg2<TData> = ScoreMember<TData> | ZAddCommandOptions;
|
|
1851
|
+
type ScoreMember<TData> = {
|
|
1852
|
+
score: number;
|
|
1853
|
+
member: TData;
|
|
1854
|
+
};
|
|
1855
|
+
/**
|
|
1856
|
+
* @see https://redis.io/commands/zadd
|
|
1857
|
+
*/
|
|
1858
|
+
declare class ZAddCommand<TData = string> extends Command<number | null, number | null> {
|
|
1859
|
+
constructor([key, arg1, ...arg2]: [string, Arg2<TData>, ...ScoreMember<TData>[]], opts?: CommandOptions<number | null, number | null>);
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
/**
|
|
1863
|
+
* @see https://redis.io/commands/zcard
|
|
1864
|
+
*/
|
|
1865
|
+
declare class ZCardCommand extends Command<number, number> {
|
|
1866
|
+
constructor(cmd: [key: string], opts?: CommandOptions<number, number>);
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
/**
|
|
1870
|
+
* @see https://redis.io/commands/zcount
|
|
1871
|
+
*/
|
|
1872
|
+
declare class ZCountCommand extends Command<number, number> {
|
|
1873
|
+
constructor(cmd: [key: string, min: number | string, max: number | string], opts?: CommandOptions<number, number>);
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
/**
|
|
1877
|
+
* @see https://redis.io/commands/zincrby
|
|
1878
|
+
*/
|
|
1879
|
+
declare class ZIncrByCommand<TData> extends Command<number, number> {
|
|
1880
|
+
constructor(cmd: [key: string, increment: number, member: TData], opts?: CommandOptions<number, number>);
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
/**
|
|
1884
|
+
* @see https://redis.io/commands/zlexcount
|
|
1885
|
+
*/
|
|
1886
|
+
declare class ZLexCountCommand extends Command<number, number> {
|
|
1887
|
+
constructor(cmd: [key: string, min: string, max: string], opts?: CommandOptions<number, number>);
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
/**
|
|
1891
|
+
* @see https://redis.io/commands/zpopmax
|
|
1892
|
+
*/
|
|
1893
|
+
declare class ZPopMaxCommand<TData> extends Command<string[], TData[]> {
|
|
1894
|
+
constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string[], TData[]>);
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
/**
|
|
1898
|
+
* @see https://redis.io/commands/zpopmin
|
|
1899
|
+
*/
|
|
1900
|
+
declare class ZPopMinCommand<TData> extends Command<string[], TData[]> {
|
|
1901
|
+
constructor([key, count]: [key: string, count?: number], opts?: CommandOptions<string[], TData[]>);
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
type ZRangeCommandOptions = {
|
|
1905
|
+
withScores?: boolean;
|
|
1906
|
+
rev?: boolean;
|
|
1907
|
+
} & ({
|
|
1908
|
+
byScore: true;
|
|
1909
|
+
byLex?: never;
|
|
1910
|
+
} | {
|
|
1911
|
+
byScore?: never;
|
|
1912
|
+
byLex: true;
|
|
1913
|
+
} | {
|
|
1914
|
+
byScore?: never;
|
|
1915
|
+
byLex?: never;
|
|
1916
|
+
}) & ({
|
|
1917
|
+
offset: number;
|
|
1918
|
+
count: number;
|
|
1919
|
+
} | {
|
|
1920
|
+
offset?: never;
|
|
1921
|
+
count?: never;
|
|
1922
|
+
});
|
|
1923
|
+
/**
|
|
1924
|
+
* @see https://redis.io/commands/zrange
|
|
1925
|
+
*/
|
|
1926
|
+
declare class ZRangeCommand<TData extends unknown[]> extends Command<string[], TData> {
|
|
1927
|
+
constructor(cmd: [key: string, min: number, max: number, opts?: ZRangeCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
|
|
1928
|
+
constructor(cmd: [
|
|
1929
|
+
key: string,
|
|
1930
|
+
min: `(${string}` | `[${string}` | "-" | "+",
|
|
1931
|
+
max: `(${string}` | `[${string}` | "-" | "+",
|
|
1932
|
+
opts: {
|
|
1933
|
+
byLex: true;
|
|
1934
|
+
} & ZRangeCommandOptions
|
|
1935
|
+
], cmdOpts?: CommandOptions<string[], TData>);
|
|
1936
|
+
constructor(cmd: [
|
|
1937
|
+
key: string,
|
|
1938
|
+
min: number | `(${number}` | "-inf" | "+inf",
|
|
1939
|
+
max: number | `(${number}` | "-inf" | "+inf",
|
|
1940
|
+
opts: {
|
|
1941
|
+
byScore: true;
|
|
1942
|
+
} & ZRangeCommandOptions
|
|
1943
|
+
], cmdOpts?: CommandOptions<string[], TData>);
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
/**
|
|
1947
|
+
* @see https://redis.io/commands/zrank
|
|
1948
|
+
*/
|
|
1949
|
+
declare class ZRankCommand<TData> extends Command<number | null, number | null> {
|
|
1950
|
+
constructor(cmd: [key: string, member: TData], opts?: CommandOptions<number | null, number | null>);
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
/**
|
|
1954
|
+
* @see https://redis.io/commands/zrem
|
|
1955
|
+
*/
|
|
1956
|
+
declare class ZRemCommand<TData = string> extends Command<number, number> {
|
|
1957
|
+
constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
/**
|
|
1961
|
+
* @see https://redis.io/commands/zremrangebylex
|
|
1962
|
+
*/
|
|
1963
|
+
declare class ZRemRangeByLexCommand extends Command<number, number> {
|
|
1964
|
+
constructor(cmd: [key: string, min: string, max: string], opts?: CommandOptions<number, number>);
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
/**
|
|
1968
|
+
* @see https://redis.io/commands/zremrangebyrank
|
|
1969
|
+
*/
|
|
1970
|
+
declare class ZRemRangeByRankCommand extends Command<number, number> {
|
|
1971
|
+
constructor(cmd: [key: string, start: number, stop: number], opts?: CommandOptions<number, number>);
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
/**
|
|
1975
|
+
* @see https://redis.io/commands/zremrangebyscore
|
|
1976
|
+
*/
|
|
1977
|
+
declare class ZRemRangeByScoreCommand extends Command<number, number> {
|
|
1978
|
+
constructor(cmd: [
|
|
1979
|
+
key: string,
|
|
1980
|
+
min: number | `(${number}` | "-inf" | "+inf",
|
|
1981
|
+
max: number | `(${number}` | "-inf" | "+inf"
|
|
1982
|
+
], opts?: CommandOptions<number, number>);
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
/**
|
|
1986
|
+
* @see https://redis.io/commands/zrevrank
|
|
1987
|
+
*/
|
|
1988
|
+
declare class ZRevRankCommand<TData> extends Command<number | null, number | null> {
|
|
1989
|
+
constructor(cmd: [key: string, member: TData], opts?: CommandOptions<number | null, number | null>);
|
|
1990
|
+
}
|
|
1991
|
+
|
|
1992
|
+
/**
|
|
1993
|
+
* @see https://redis.io/commands/zscan
|
|
1994
|
+
*/
|
|
1995
|
+
declare class ZScanCommand extends Command<[
|
|
1996
|
+
string,
|
|
1997
|
+
(string | number)[]
|
|
1998
|
+
], [
|
|
1999
|
+
string,
|
|
2000
|
+
(string | number)[]
|
|
2001
|
+
]> {
|
|
2002
|
+
constructor([key, cursor, opts]: [key: string, cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
/**
|
|
2006
|
+
* @see https://redis.io/commands/zscore
|
|
2007
|
+
*/
|
|
2008
|
+
declare class ZScoreCommand<TData> extends Command<string | null, number | null> {
|
|
2009
|
+
constructor(cmd: [key: string, member: TData], opts?: CommandOptions<string | null, number | null>);
|
|
2010
|
+
}
|
|
2011
|
+
|
|
2012
|
+
type BaseMessageData<TMessage> = {
|
|
2013
|
+
channel: string;
|
|
2014
|
+
message: TMessage;
|
|
2015
|
+
};
|
|
2016
|
+
type PatternMessageData<TMessage> = BaseMessageData<TMessage> & {
|
|
2017
|
+
pattern: string;
|
|
2018
|
+
};
|
|
2019
|
+
type SubscriptionCountEvent = number;
|
|
2020
|
+
type MessageEventMap<TMessage> = {
|
|
2021
|
+
message: BaseMessageData<TMessage>;
|
|
2022
|
+
subscribe: SubscriptionCountEvent;
|
|
2023
|
+
unsubscribe: SubscriptionCountEvent;
|
|
2024
|
+
pmessage: PatternMessageData<TMessage>;
|
|
2025
|
+
psubscribe: SubscriptionCountEvent;
|
|
2026
|
+
punsubscribe: SubscriptionCountEvent;
|
|
2027
|
+
error: Error;
|
|
2028
|
+
[key: `message:${string}`]: BaseMessageData<TMessage>;
|
|
2029
|
+
[key: `pmessage:${string}`]: PatternMessageData<TMessage>;
|
|
2030
|
+
};
|
|
2031
|
+
type EventType = keyof MessageEventMap<any>;
|
|
2032
|
+
type Listener<TMessage, T extends EventType> = (event: MessageEventMap<TMessage>[T]) => void;
|
|
2033
|
+
declare class Subscriber<TMessage = any> extends EventTarget {
|
|
2034
|
+
private subscriptions;
|
|
2035
|
+
private client;
|
|
2036
|
+
private listeners;
|
|
2037
|
+
private opts?;
|
|
2038
|
+
constructor(client: Requester, channels: string[], isPattern?: boolean, opts?: Pick<RedisOptions, "automaticDeserialization">);
|
|
2039
|
+
private subscribeToChannel;
|
|
2040
|
+
private subscribeToPattern;
|
|
2041
|
+
private handleMessage;
|
|
2042
|
+
private dispatchToListeners;
|
|
2043
|
+
on<T extends keyof MessageEventMap<TMessage>>(type: T, listener: Listener<TMessage, T>): void;
|
|
2044
|
+
removeAllListeners(): void;
|
|
2045
|
+
unsubscribe(channels?: string[]): Promise<void>;
|
|
2046
|
+
getSubscribedChannels(): string[];
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
type InferResponseData<T extends unknown[]> = {
|
|
2050
|
+
[K in keyof T]: T[K] extends Command<any, infer TData> ? TData : unknown;
|
|
2051
|
+
};
|
|
2052
|
+
interface ExecMethod<TCommands extends Command<any, any>[]> {
|
|
2053
|
+
/**
|
|
2054
|
+
* Send the pipeline request to upstash.
|
|
2055
|
+
*
|
|
2056
|
+
* Returns an array with the results of all pipelined commands.
|
|
2057
|
+
*
|
|
2058
|
+
* If all commands are statically chained from start to finish, types are inferred. You can still define a return type manually if necessary though:
|
|
2059
|
+
* ```ts
|
|
2060
|
+
* const p = redis.pipeline()
|
|
2061
|
+
* p.get("key")
|
|
2062
|
+
* const result = p.exec<[{ greeting: string }]>()
|
|
2063
|
+
* ```
|
|
2064
|
+
*
|
|
2065
|
+
* If one of the commands get an error, the whole pipeline fails. Alternatively, you can set the keepErrors option to true in order to get the errors individually.
|
|
2066
|
+
*
|
|
2067
|
+
* If keepErrors is set to true, a list of objects is returned where each object corresponds to a command and is of type: `{ result: unknown, error?: string }`.
|
|
2068
|
+
*
|
|
2069
|
+
* ```ts
|
|
2070
|
+
* const p = redis.pipeline()
|
|
2071
|
+
* p.get("key")
|
|
2072
|
+
*
|
|
2073
|
+
* const result = await p.exec({ keepErrors: true });
|
|
2074
|
+
* const getResult = result[0].result
|
|
2075
|
+
* const getError = result[0].error
|
|
2076
|
+
* ```
|
|
2077
|
+
*/
|
|
2078
|
+
<TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>(): Promise<TCommandResults>;
|
|
2079
|
+
<TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>(options: {
|
|
2080
|
+
keepErrors: true;
|
|
2081
|
+
}): Promise<{
|
|
2082
|
+
[K in keyof TCommandResults]: UpstashResponse<TCommandResults[K]>;
|
|
2083
|
+
}>;
|
|
2084
|
+
}
|
|
2085
|
+
/**
|
|
2086
|
+
* Upstash REST API supports command pipelining to send multiple commands in
|
|
2087
|
+
* batch, instead of sending each command one by one and waiting for a response.
|
|
2088
|
+
* When using pipelines, several commands are sent using a single HTTP request,
|
|
2089
|
+
* and a single JSON array response is returned. Each item in the response array
|
|
2090
|
+
* corresponds to the command in the same order within the pipeline.
|
|
2091
|
+
*
|
|
2092
|
+
* **NOTE:**
|
|
2093
|
+
*
|
|
2094
|
+
* Execution of the pipeline is not atomic. Even though each command in
|
|
2095
|
+
* the pipeline will be executed in order, commands sent by other clients can
|
|
2096
|
+
* interleave with the pipeline.
|
|
2097
|
+
*
|
|
2098
|
+
* **Examples:**
|
|
2099
|
+
*
|
|
2100
|
+
* ```ts
|
|
2101
|
+
* const p = redis.pipeline() // or redis.multi()
|
|
2102
|
+
* p.set("key","value")
|
|
2103
|
+
* p.get("key")
|
|
2104
|
+
* const res = await p.exec()
|
|
2105
|
+
* ```
|
|
2106
|
+
*
|
|
2107
|
+
* You can also chain commands together
|
|
2108
|
+
* ```ts
|
|
2109
|
+
* const p = redis.pipeline()
|
|
2110
|
+
* const res = await p.set("key","value").get("key").exec()
|
|
2111
|
+
* ```
|
|
2112
|
+
*
|
|
2113
|
+
* Return types are inferred if all commands are chained, but you can still
|
|
2114
|
+
* override the response type manually:
|
|
2115
|
+
* ```ts
|
|
2116
|
+
* redis.pipeline()
|
|
2117
|
+
* .set("key", { greeting: "hello"})
|
|
2118
|
+
* .get("key")
|
|
2119
|
+
* .exec<["OK", { greeting: string } ]>()
|
|
2120
|
+
*
|
|
2121
|
+
* ```
|
|
2122
|
+
*/
|
|
2123
|
+
declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
2124
|
+
private client;
|
|
2125
|
+
private commands;
|
|
2126
|
+
private commandOptions?;
|
|
2127
|
+
private multiExec;
|
|
2128
|
+
constructor(opts: {
|
|
2129
|
+
client: Requester;
|
|
2130
|
+
commandOptions?: CommandOptions<any, any>;
|
|
2131
|
+
multiExec?: boolean;
|
|
2132
|
+
});
|
|
2133
|
+
exec: ExecMethod<TCommands>;
|
|
2134
|
+
/**
|
|
2135
|
+
* Returns the length of pipeline before the execution
|
|
2136
|
+
*/
|
|
2137
|
+
length(): number;
|
|
2138
|
+
/**
|
|
2139
|
+
* Pushes a command into the pipeline and returns a chainable instance of the
|
|
2140
|
+
* pipeline
|
|
2141
|
+
*/
|
|
2142
|
+
private chain;
|
|
2143
|
+
/**
|
|
2144
|
+
* @see https://redis.io/commands/append
|
|
2145
|
+
*/
|
|
2146
|
+
append: (key: string, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2147
|
+
/**
|
|
2148
|
+
* @see https://redis.io/commands/bitcount
|
|
2149
|
+
*/
|
|
2150
|
+
bitcount: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2151
|
+
/**
|
|
2152
|
+
* Returns an instance that can be used to execute `BITFIELD` commands on one key.
|
|
2153
|
+
*
|
|
2154
|
+
* @example
|
|
2155
|
+
* ```typescript
|
|
2156
|
+
* redis.set("mykey", 0);
|
|
2157
|
+
* const result = await redis.pipeline()
|
|
2158
|
+
* .bitfield("mykey")
|
|
2159
|
+
* .set("u4", 0, 16)
|
|
2160
|
+
* .incr("u4", "#1", 1)
|
|
2161
|
+
* .exec();
|
|
2162
|
+
* console.log(result); // [[0, 1]]
|
|
2163
|
+
* ```
|
|
2164
|
+
*
|
|
2165
|
+
* @see https://redis.io/commands/bitfield
|
|
2166
|
+
*/
|
|
2167
|
+
bitfield: (key: string) => BitFieldCommand<Pipeline<[...TCommands, Command<any, number[]>]>>;
|
|
2168
|
+
/**
|
|
2169
|
+
* @see https://redis.io/commands/bitop
|
|
2170
|
+
*/
|
|
2171
|
+
bitop: {
|
|
2172
|
+
(op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Pipeline<[...TCommands, BitOpCommand]>;
|
|
2173
|
+
(op: "not", destinationKey: string, sourceKey: string): Pipeline<[...TCommands, BitOpCommand]>;
|
|
2174
|
+
(op: "diff" | "diff1" | "andor", destinationKey: string, x: string, ...y: string[]): Pipeline<[...TCommands, BitOpCommand]>;
|
|
2175
|
+
(op: "one", destinationKey: string, ...sourceKeys: string[]): Pipeline<[...TCommands, BitOpCommand]>;
|
|
2176
|
+
};
|
|
2177
|
+
/**
|
|
2178
|
+
* @see https://redis.io/commands/bitpos
|
|
2179
|
+
*/
|
|
2180
|
+
bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2181
|
+
/**
|
|
2182
|
+
* @see https://redis.io/commands/client-setinfo
|
|
2183
|
+
*/
|
|
2184
|
+
clientSetinfo: (attribute: ClientSetInfoAttribute, value: string) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
2185
|
+
/**
|
|
2186
|
+
* @see https://redis.io/commands/copy
|
|
2187
|
+
*/
|
|
2188
|
+
copy: (key: string, destinationKey: string, opts?: {
|
|
2189
|
+
replace: boolean;
|
|
2190
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, "COPIED" | "NOT_COPIED">]>;
|
|
2191
|
+
/**
|
|
2192
|
+
* @see https://redis.io/commands/zdiffstore
|
|
2193
|
+
*/
|
|
2194
|
+
zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2195
|
+
/**
|
|
2196
|
+
* @see https://redis.io/commands/dbsize
|
|
2197
|
+
*/
|
|
2198
|
+
dbsize: () => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2199
|
+
/**
|
|
2200
|
+
* @see https://redis.io/commands/decr
|
|
2201
|
+
*/
|
|
2202
|
+
decr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2203
|
+
/**
|
|
2204
|
+
* @see https://redis.io/commands/decrby
|
|
2205
|
+
*/
|
|
2206
|
+
decrby: (key: string, decrement: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2207
|
+
/**
|
|
2208
|
+
* @see https://redis.io/commands/del
|
|
2209
|
+
*/
|
|
2210
|
+
del: (...args: CommandArgs<typeof DelCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2211
|
+
/**
|
|
2212
|
+
* @see https://redis.io/commands/echo
|
|
2213
|
+
*/
|
|
2214
|
+
echo: (message: string) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
2215
|
+
/**
|
|
2216
|
+
* @see https://redis.io/commands/eval_ro
|
|
2217
|
+
*/
|
|
2218
|
+
evalRo: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2219
|
+
/**
|
|
2220
|
+
* @see https://redis.io/commands/eval
|
|
2221
|
+
*/
|
|
2222
|
+
eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2223
|
+
/**
|
|
2224
|
+
* @see https://redis.io/commands/evalsha_ro
|
|
2225
|
+
*/
|
|
2226
|
+
evalshaRo: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2227
|
+
/**
|
|
2228
|
+
* @see https://redis.io/commands/evalsha
|
|
2229
|
+
*/
|
|
2230
|
+
evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2231
|
+
/**
|
|
2232
|
+
* @see https://redis.io/commands/exists
|
|
2233
|
+
*/
|
|
2234
|
+
exists: (...args: CommandArgs<typeof ExistsCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2235
|
+
/**
|
|
2236
|
+
* @see https://redis.io/commands/expire
|
|
2237
|
+
*/
|
|
2238
|
+
expire: (key: string, seconds: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
2239
|
+
/**
|
|
2240
|
+
* @see https://redis.io/commands/expireat
|
|
2241
|
+
*/
|
|
2242
|
+
expireat: (key: string, unix: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
2243
|
+
/**
|
|
2244
|
+
* @see https://redis.io/commands/flushall
|
|
2245
|
+
*/
|
|
2246
|
+
flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
2247
|
+
/**
|
|
2248
|
+
* @see https://redis.io/commands/flushdb
|
|
2249
|
+
*/
|
|
2250
|
+
flushdb: (opts?: {
|
|
2251
|
+
async?: boolean;
|
|
2252
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
2253
|
+
/**
|
|
2254
|
+
* @see https://redis.io/commands/geoadd
|
|
2255
|
+
*/
|
|
2256
|
+
geoadd: <TData>(args_0: string, args_1: GeoAddCommandOptions | GeoMember<TData>, ...args_2: GeoMember<TData>[]) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
2257
|
+
/**
|
|
2258
|
+
* @see https://redis.io/commands/geodist
|
|
2259
|
+
*/
|
|
2260
|
+
geodist: <TData>(key: string, member1: TData, member2: TData, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
2261
|
+
/**
|
|
2262
|
+
* @see https://redis.io/commands/geopos
|
|
2263
|
+
*/
|
|
2264
|
+
geopos: <TData>(args_0: string, ...args_1: TData[]) => Pipeline<[...TCommands, Command<any, {
|
|
2265
|
+
lng: number;
|
|
2266
|
+
lat: number;
|
|
2267
|
+
}[]>]>;
|
|
2268
|
+
/**
|
|
2269
|
+
* @see https://redis.io/commands/geohash
|
|
2270
|
+
*/
|
|
2271
|
+
geohash: <TData>(args_0: string, ...args_1: TData[]) => Pipeline<[...TCommands, Command<any, (string | null)[]>]>;
|
|
2272
|
+
/**
|
|
2273
|
+
* @see https://redis.io/commands/geosearch
|
|
2274
|
+
*/
|
|
2275
|
+
geosearch: <TData>(key: string, centerPoint: {
|
|
2276
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
2277
|
+
coordinate: {
|
|
2278
|
+
lon: number;
|
|
2279
|
+
lat: number;
|
|
2280
|
+
};
|
|
2281
|
+
} | {
|
|
2282
|
+
type: "FROMMEMBER" | "frommember";
|
|
2283
|
+
member: TData;
|
|
2284
|
+
}, shape: {
|
|
2285
|
+
type: "BYRADIUS" | "byradius";
|
|
2286
|
+
radius: number;
|
|
2287
|
+
radiusType: "M" | "KM" | "FT" | "MI";
|
|
2288
|
+
} | {
|
|
2289
|
+
type: "BYBOX" | "bybox";
|
|
2290
|
+
rect: {
|
|
2291
|
+
width: number;
|
|
2292
|
+
height: number;
|
|
2293
|
+
};
|
|
2294
|
+
rectType: "M" | "KM" | "FT" | "MI";
|
|
2295
|
+
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2296
|
+
count?: {
|
|
2297
|
+
limit: number;
|
|
2298
|
+
any?: boolean;
|
|
2299
|
+
};
|
|
2300
|
+
withCoord?: boolean;
|
|
2301
|
+
withDist?: boolean;
|
|
2302
|
+
withHash?: boolean;
|
|
2303
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, ({
|
|
2304
|
+
member: TData;
|
|
2305
|
+
} & {
|
|
2306
|
+
coord?: {
|
|
2307
|
+
long: number;
|
|
2308
|
+
lat: number;
|
|
2309
|
+
} | undefined;
|
|
2310
|
+
dist?: number | undefined;
|
|
2311
|
+
hash?: string | undefined;
|
|
2312
|
+
})[]>]>;
|
|
2313
|
+
/**
|
|
2314
|
+
* @see https://redis.io/commands/geosearchstore
|
|
2315
|
+
*/
|
|
2316
|
+
geosearchstore: <TData>(destination: string, key: string, centerPoint: {
|
|
2317
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
2318
|
+
coordinate: {
|
|
2319
|
+
lon: number;
|
|
2320
|
+
lat: number;
|
|
2321
|
+
};
|
|
2322
|
+
} | {
|
|
2323
|
+
type: "FROMMEMBER" | "frommember";
|
|
2324
|
+
member: TData;
|
|
2325
|
+
}, shape: {
|
|
2326
|
+
type: "BYRADIUS" | "byradius";
|
|
2327
|
+
radius: number;
|
|
2328
|
+
radiusType: "M" | "KM" | "FT" | "MI";
|
|
2329
|
+
} | {
|
|
2330
|
+
type: "BYBOX" | "bybox";
|
|
2331
|
+
rect: {
|
|
2332
|
+
width: number;
|
|
2333
|
+
height: number;
|
|
2334
|
+
};
|
|
2335
|
+
rectType: "M" | "KM" | "FT" | "MI";
|
|
2336
|
+
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2337
|
+
count?: {
|
|
2338
|
+
limit: number;
|
|
2339
|
+
any?: boolean;
|
|
2340
|
+
};
|
|
2341
|
+
storeDist?: boolean;
|
|
2342
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2343
|
+
/**
|
|
2344
|
+
* @see https://redis.io/commands/get
|
|
2345
|
+
*/
|
|
2346
|
+
get: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
2347
|
+
/**
|
|
2348
|
+
* @see https://redis.io/commands/getbit
|
|
2349
|
+
*/
|
|
2350
|
+
getbit: (key: string, offset: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
2351
|
+
/**
|
|
2352
|
+
* @see https://redis.io/commands/getdel
|
|
2353
|
+
*/
|
|
2354
|
+
getdel: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
2355
|
+
/**
|
|
2356
|
+
* @see https://redis.io/commands/getex
|
|
2357
|
+
*/
|
|
2358
|
+
getex: <TData>(key: string, opts?: ({
|
|
2359
|
+
ex: number;
|
|
2360
|
+
px?: never;
|
|
2361
|
+
exat?: never;
|
|
2362
|
+
pxat?: never;
|
|
2363
|
+
persist?: never;
|
|
2364
|
+
} | {
|
|
2365
|
+
ex?: never;
|
|
2366
|
+
px: number;
|
|
2367
|
+
exat?: never;
|
|
2368
|
+
pxat?: never;
|
|
2369
|
+
persist?: never;
|
|
2370
|
+
} | {
|
|
2371
|
+
ex?: never;
|
|
2372
|
+
px?: never;
|
|
2373
|
+
exat: number;
|
|
2374
|
+
pxat?: never;
|
|
2375
|
+
persist?: never;
|
|
2376
|
+
} | {
|
|
2377
|
+
ex?: never;
|
|
2378
|
+
px?: never;
|
|
2379
|
+
exat?: never;
|
|
2380
|
+
pxat: number;
|
|
2381
|
+
persist?: never;
|
|
2382
|
+
} | {
|
|
2383
|
+
ex?: never;
|
|
2384
|
+
px?: never;
|
|
2385
|
+
exat?: never;
|
|
2386
|
+
pxat?: never;
|
|
2387
|
+
persist: true;
|
|
2388
|
+
} | {
|
|
2389
|
+
ex?: never;
|
|
2390
|
+
px?: never;
|
|
2391
|
+
exat?: never;
|
|
2392
|
+
pxat?: never;
|
|
2393
|
+
persist?: never;
|
|
2394
|
+
}) | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
2395
|
+
/**
|
|
2396
|
+
* @see https://redis.io/commands/getrange
|
|
2397
|
+
*/
|
|
2398
|
+
getrange: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
2399
|
+
/**
|
|
2400
|
+
* @see https://redis.io/commands/getset
|
|
2401
|
+
*/
|
|
2402
|
+
getset: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
2403
|
+
/**
|
|
2404
|
+
* @see https://redis.io/commands/hdel
|
|
2405
|
+
*/
|
|
2406
|
+
hdel: (key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
2407
|
+
/**
|
|
2408
|
+
* @see https://redis.io/commands/hexists
|
|
2409
|
+
*/
|
|
2410
|
+
hexists: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2411
|
+
/**
|
|
2412
|
+
* @see https://redis.io/commands/hexpire
|
|
2413
|
+
*/
|
|
2414
|
+
hexpire: (key: string, fields: string | number | (string | number)[], seconds: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, (0 | 1 | 2 | -2)[]>]>;
|
|
2415
|
+
/**
|
|
2416
|
+
* @see https://redis.io/commands/hexpireat
|
|
2417
|
+
*/
|
|
2418
|
+
hexpireat: (key: string, fields: string | number | (string | number)[], timestamp: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, (0 | 1 | 2 | -2)[]>]>;
|
|
2419
|
+
/**
|
|
2420
|
+
* @see https://redis.io/commands/hexpiretime
|
|
2421
|
+
*/
|
|
2422
|
+
hexpiretime: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, number[]>]>;
|
|
2423
|
+
/**
|
|
2424
|
+
* @see https://redis.io/commands/httl
|
|
2425
|
+
*/
|
|
2426
|
+
httl: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, number[]>]>;
|
|
2427
|
+
/**
|
|
2428
|
+
* @see https://redis.io/commands/hpexpire
|
|
2429
|
+
*/
|
|
2430
|
+
hpexpire: (key: string, fields: string | number | (string | number)[], milliseconds: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, (0 | 1 | 2 | -2)[]>]>;
|
|
2431
|
+
/**
|
|
2432
|
+
* @see https://redis.io/commands/hpexpireat
|
|
2433
|
+
*/
|
|
2434
|
+
hpexpireat: (key: string, fields: string | number | (string | number)[], timestamp: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, (0 | 1 | 2 | -2)[]>]>;
|
|
2435
|
+
/**
|
|
2436
|
+
* @see https://redis.io/commands/hpexpiretime
|
|
2437
|
+
*/
|
|
2438
|
+
hpexpiretime: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, number[]>]>;
|
|
2439
|
+
/**
|
|
2440
|
+
* @see https://redis.io/commands/hpttl
|
|
2441
|
+
*/
|
|
2442
|
+
hpttl: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, number[]>]>;
|
|
2443
|
+
/**
|
|
2444
|
+
* @see https://redis.io/commands/hpersist
|
|
2445
|
+
*/
|
|
2446
|
+
hpersist: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, (1 | -2 | -1)[]>]>;
|
|
2447
|
+
/**
|
|
2448
|
+
* @see https://redis.io/commands/hget
|
|
2449
|
+
*/
|
|
2450
|
+
hget: <TData>(key: string, field: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
2451
|
+
/**
|
|
2452
|
+
* @see https://redis.io/commands/hgetall
|
|
2453
|
+
*/
|
|
2454
|
+
hgetall: <TData extends Record<string, unknown>>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
2455
|
+
/**
|
|
2456
|
+
* @see https://redis.io/commands/hgetdel
|
|
2457
|
+
*/
|
|
2458
|
+
hgetdel: <TData extends Record<string, unknown>>(key: string, ...fields: (string | number)[]) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
2459
|
+
/**
|
|
2460
|
+
* @see https://redis.io/commands/hgetex
|
|
2461
|
+
*/
|
|
2462
|
+
hgetex: <TData extends Record<string, unknown>>(key: string, opts: {
|
|
2463
|
+
ex: number;
|
|
2464
|
+
px?: never;
|
|
2465
|
+
exat?: never;
|
|
2466
|
+
pxat?: never;
|
|
2467
|
+
persist?: never;
|
|
2468
|
+
} | {
|
|
2469
|
+
ex?: never;
|
|
2470
|
+
px: number;
|
|
2471
|
+
exat?: never;
|
|
2472
|
+
pxat?: never;
|
|
2473
|
+
persist?: never;
|
|
2474
|
+
} | {
|
|
2475
|
+
ex?: never;
|
|
2476
|
+
px?: never;
|
|
2477
|
+
exat: number;
|
|
2478
|
+
pxat?: never;
|
|
2479
|
+
persist?: never;
|
|
2480
|
+
} | {
|
|
2481
|
+
ex?: never;
|
|
2482
|
+
px?: never;
|
|
2483
|
+
exat?: never;
|
|
2484
|
+
pxat: number;
|
|
2485
|
+
persist?: never;
|
|
2486
|
+
} | {
|
|
2487
|
+
ex?: never;
|
|
2488
|
+
px?: never;
|
|
2489
|
+
exat?: never;
|
|
2490
|
+
pxat?: never;
|
|
2491
|
+
persist: true;
|
|
2492
|
+
}, ...fields: (string | number)[]) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
2493
|
+
/**
|
|
2494
|
+
* @see https://redis.io/commands/hincrby
|
|
2495
|
+
*/
|
|
2496
|
+
hincrby: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2497
|
+
/**
|
|
2498
|
+
* @see https://redis.io/commands/hincrbyfloat
|
|
2499
|
+
*/
|
|
2500
|
+
hincrbyfloat: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2501
|
+
/**
|
|
2502
|
+
* @see https://redis.io/commands/hkeys
|
|
2503
|
+
*/
|
|
2504
|
+
hkeys: (key: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
|
|
2505
|
+
/**
|
|
2506
|
+
* @see https://redis.io/commands/hlen
|
|
2507
|
+
*/
|
|
2508
|
+
hlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2509
|
+
/**
|
|
2510
|
+
* @see https://redis.io/commands/hmget
|
|
2511
|
+
*/
|
|
2512
|
+
hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
2513
|
+
/**
|
|
2514
|
+
* @see https://redis.io/commands/hmset
|
|
2515
|
+
*/
|
|
2516
|
+
hmset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
2517
|
+
/**
|
|
2518
|
+
* @see https://redis.io/commands/hrandfield
|
|
2519
|
+
*/
|
|
2520
|
+
hrandfield: <TData extends string | string[] | Record<string, unknown>>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2521
|
+
/**
|
|
2522
|
+
* @see https://redis.io/commands/hscan
|
|
2523
|
+
*/
|
|
2524
|
+
hscan: (key: string, cursor: string | number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
|
|
2525
|
+
/**
|
|
2526
|
+
* @see https://redis.io/commands/hset
|
|
2527
|
+
*/
|
|
2528
|
+
hset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2529
|
+
/**
|
|
2530
|
+
* @see https://redis.io/commands/hsetex
|
|
2531
|
+
*/
|
|
2532
|
+
hsetex: <TData>(key: string, opts: {
|
|
2533
|
+
conditional?: "FNX" | "fnx" | "FXX" | "fxx";
|
|
2534
|
+
expiration?: {
|
|
2535
|
+
ex: number;
|
|
2536
|
+
px?: never;
|
|
2537
|
+
exat?: never;
|
|
2538
|
+
pxat?: never;
|
|
2539
|
+
keepttl?: never;
|
|
2540
|
+
} | {
|
|
2541
|
+
ex?: never;
|
|
2542
|
+
px: number;
|
|
2543
|
+
exat?: never;
|
|
2544
|
+
pxat?: never;
|
|
2545
|
+
keepttl?: never;
|
|
2546
|
+
} | {
|
|
2547
|
+
ex?: never;
|
|
2548
|
+
px?: never;
|
|
2549
|
+
exat: number;
|
|
2550
|
+
pxat?: never;
|
|
2551
|
+
keepttl?: never;
|
|
2552
|
+
} | {
|
|
2553
|
+
ex?: never;
|
|
2554
|
+
px?: never;
|
|
2555
|
+
exat?: never;
|
|
2556
|
+
pxat: number;
|
|
2557
|
+
keepttl?: never;
|
|
2558
|
+
} | {
|
|
2559
|
+
ex?: never;
|
|
2560
|
+
px?: never;
|
|
2561
|
+
exat?: never;
|
|
2562
|
+
pxat?: never;
|
|
2563
|
+
keepttl: true;
|
|
2564
|
+
} | {
|
|
2565
|
+
ex?: never;
|
|
2566
|
+
px?: never;
|
|
2567
|
+
exat?: never;
|
|
2568
|
+
pxat?: never;
|
|
2569
|
+
keepttl?: never;
|
|
2570
|
+
};
|
|
2571
|
+
}, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2572
|
+
/**
|
|
2573
|
+
* @see https://redis.io/commands/hsetnx
|
|
2574
|
+
*/
|
|
2575
|
+
hsetnx: <TData>(key: string, field: string, value: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
2576
|
+
/**
|
|
2577
|
+
* @see https://redis.io/commands/hstrlen
|
|
2578
|
+
*/
|
|
2579
|
+
hstrlen: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2580
|
+
/**
|
|
2581
|
+
* @see https://redis.io/commands/hvals
|
|
2582
|
+
*/
|
|
2583
|
+
hvals: (key: string) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
2584
|
+
/**
|
|
2585
|
+
* @see https://redis.io/commands/incr
|
|
2586
|
+
*/
|
|
2587
|
+
incr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2588
|
+
/**
|
|
2589
|
+
* @see https://redis.io/commands/incrby
|
|
2590
|
+
*/
|
|
2591
|
+
incrby: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2592
|
+
/**
|
|
2593
|
+
* @see https://redis.io/commands/incrbyfloat
|
|
2594
|
+
*/
|
|
2595
|
+
incrbyfloat: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2596
|
+
/**
|
|
2597
|
+
* @see https://redis.io/commands/keys
|
|
2598
|
+
*/
|
|
2599
|
+
keys: (pattern: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
|
|
2600
|
+
/**
|
|
2601
|
+
* @see https://redis.io/commands/lindex
|
|
2602
|
+
*/
|
|
2603
|
+
lindex: (key: string, index: number) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
2604
|
+
/**
|
|
2605
|
+
* @see https://redis.io/commands/linsert
|
|
2606
|
+
*/
|
|
2607
|
+
linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2608
|
+
/**
|
|
2609
|
+
* @see https://redis.io/commands/llen
|
|
2610
|
+
*/
|
|
2611
|
+
llen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2612
|
+
/**
|
|
2613
|
+
* @see https://redis.io/commands/lmove
|
|
2614
|
+
*/
|
|
2615
|
+
lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2616
|
+
/**
|
|
2617
|
+
* @see https://redis.io/commands/lpop
|
|
2618
|
+
*/
|
|
2619
|
+
lpop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
2620
|
+
/**
|
|
2621
|
+
* @see https://redis.io/commands/lmpop
|
|
2622
|
+
*/
|
|
2623
|
+
lmpop: <TData>(numkeys: number, keys: string[], args_2: "LEFT" | "RIGHT", count?: number | undefined) => Pipeline<[...TCommands, Command<any, [string, TData[]] | null>]>;
|
|
2624
|
+
/**
|
|
2625
|
+
* @see https://redis.io/commands/lpos
|
|
2626
|
+
*/
|
|
2627
|
+
lpos: <TData>(key: string, element: unknown, opts?: {
|
|
2628
|
+
rank?: number;
|
|
2629
|
+
count?: number;
|
|
2630
|
+
maxLen?: number;
|
|
2631
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2632
|
+
/**
|
|
2633
|
+
* @see https://redis.io/commands/lpush
|
|
2634
|
+
*/
|
|
2635
|
+
lpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2636
|
+
/**
|
|
2637
|
+
* @see https://redis.io/commands/lpushx
|
|
2638
|
+
*/
|
|
2639
|
+
lpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2640
|
+
/**
|
|
2641
|
+
* @see https://redis.io/commands/lrange
|
|
2642
|
+
*/
|
|
2643
|
+
lrange: <TResult = string>(key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, TResult[]>]>;
|
|
2644
|
+
/**
|
|
2645
|
+
* @see https://redis.io/commands/lrem
|
|
2646
|
+
*/
|
|
2647
|
+
lrem: <TData>(key: string, count: number, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2648
|
+
/**
|
|
2649
|
+
* @see https://redis.io/commands/lset
|
|
2650
|
+
*/
|
|
2651
|
+
lset: <TData>(key: string, index: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
2652
|
+
/**
|
|
2653
|
+
* @see https://redis.io/commands/ltrim
|
|
2654
|
+
*/
|
|
2655
|
+
ltrim: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
2656
|
+
/**
|
|
2657
|
+
* @see https://redis.io/commands/mget
|
|
2658
|
+
*/
|
|
2659
|
+
mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2660
|
+
/**
|
|
2661
|
+
* @see https://redis.io/commands/mset
|
|
2662
|
+
*/
|
|
2663
|
+
mset: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
2664
|
+
/**
|
|
2665
|
+
* @see https://redis.io/commands/msetnx
|
|
2666
|
+
*/
|
|
2667
|
+
msetnx: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2668
|
+
/**
|
|
2669
|
+
* @see https://redis.io/commands/persist
|
|
2670
|
+
*/
|
|
2671
|
+
persist: (key: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
2672
|
+
/**
|
|
2673
|
+
* @see https://redis.io/commands/pexpire
|
|
2674
|
+
*/
|
|
2675
|
+
pexpire: (key: string, milliseconds: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
2676
|
+
/**
|
|
2677
|
+
* @see https://redis.io/commands/pexpireat
|
|
2678
|
+
*/
|
|
2679
|
+
pexpireat: (key: string, unix: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
2680
|
+
/**
|
|
2681
|
+
* @see https://redis.io/commands/pfadd
|
|
2682
|
+
*/
|
|
2683
|
+
pfadd: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2684
|
+
/**
|
|
2685
|
+
* @see https://redis.io/commands/pfcount
|
|
2686
|
+
*/
|
|
2687
|
+
pfcount: (args_0: string, ...args_1: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2688
|
+
/**
|
|
2689
|
+
* @see https://redis.io/commands/pfmerge
|
|
2690
|
+
*/
|
|
2691
|
+
pfmerge: (destination_key: string, ...args_1: string[]) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
2692
|
+
/**
|
|
2693
|
+
* @see https://redis.io/commands/ping
|
|
2694
|
+
*/
|
|
2695
|
+
ping: (args?: CommandArgs<typeof PingCommand>) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
2696
|
+
/**
|
|
2697
|
+
* @see https://redis.io/commands/psetex
|
|
2698
|
+
*/
|
|
2699
|
+
psetex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
2700
|
+
/**
|
|
2701
|
+
* @see https://redis.io/commands/pttl
|
|
2702
|
+
*/
|
|
2703
|
+
pttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2704
|
+
/**
|
|
2705
|
+
* @see https://redis.io/commands/publish
|
|
2706
|
+
*/
|
|
2707
|
+
publish: (channel: string, message: unknown) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2708
|
+
/**
|
|
2709
|
+
* @see https://redis.io/commands/randomkey
|
|
2710
|
+
*/
|
|
2711
|
+
randomkey: () => Pipeline<[...TCommands, Command<any, string | null>]>;
|
|
2712
|
+
/**
|
|
2713
|
+
* @see https://redis.io/commands/rename
|
|
2714
|
+
*/
|
|
2715
|
+
rename: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
2716
|
+
/**
|
|
2717
|
+
* @see https://redis.io/commands/renamenx
|
|
2718
|
+
*/
|
|
2719
|
+
renamenx: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
2720
|
+
/**
|
|
2721
|
+
* @see https://redis.io/commands/rpop
|
|
2722
|
+
*/
|
|
2723
|
+
rpop: <TData = string>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
2724
|
+
/**
|
|
2725
|
+
* @see https://redis.io/commands/rpush
|
|
2726
|
+
*/
|
|
2727
|
+
rpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2728
|
+
/**
|
|
2729
|
+
* @see https://redis.io/commands/rpushx
|
|
2730
|
+
*/
|
|
2731
|
+
rpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2732
|
+
/**
|
|
2733
|
+
* @see https://redis.io/commands/sadd
|
|
2734
|
+
*/
|
|
2735
|
+
sadd: <TData>(key: string, member: TData, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2736
|
+
/**
|
|
2737
|
+
* @see https://redis.io/commands/scan
|
|
2738
|
+
*/
|
|
2739
|
+
scan: (cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
2740
|
+
/**
|
|
2741
|
+
* @see https://redis.io/commands/scard
|
|
2742
|
+
*/
|
|
2743
|
+
scard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2744
|
+
/**
|
|
2745
|
+
* @see https://redis.io/commands/script-exists
|
|
2746
|
+
*/
|
|
2747
|
+
scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Pipeline<[...TCommands, Command<any, number[]>]>;
|
|
2748
|
+
/**
|
|
2749
|
+
* @see https://redis.io/commands/script-flush
|
|
2750
|
+
*/
|
|
2751
|
+
scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
2752
|
+
/**
|
|
2753
|
+
* @see https://redis.io/commands/script-load
|
|
2754
|
+
*/
|
|
2755
|
+
scriptLoad: (script: string) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
2756
|
+
sdiff: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2757
|
+
/**
|
|
2758
|
+
* @see https://redis.io/commands/sdiffstore
|
|
2759
|
+
*/
|
|
2760
|
+
sdiffstore: (destination: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2761
|
+
/**
|
|
2762
|
+
* @see https://redis.io/commands/set
|
|
2763
|
+
*/
|
|
2764
|
+
set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Pipeline<[...TCommands, Command<any, "OK" | TData | null>]>;
|
|
2765
|
+
/**
|
|
2766
|
+
* @see https://redis.io/commands/setbit
|
|
2767
|
+
*/
|
|
2768
|
+
setbit: (key: string, offset: number, value: 0 | 1) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
2769
|
+
/**
|
|
2770
|
+
* @see https://redis.io/commands/setex
|
|
2771
|
+
*/
|
|
2772
|
+
setex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
2773
|
+
/**
|
|
2774
|
+
* @see https://redis.io/commands/setnx
|
|
2775
|
+
*/
|
|
2776
|
+
setnx: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2777
|
+
/**
|
|
2778
|
+
* @see https://redis.io/commands/setrange
|
|
2779
|
+
*/
|
|
2780
|
+
setrange: (key: string, offset: number, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2781
|
+
/**
|
|
2782
|
+
* @see https://redis.io/commands/sinter
|
|
2783
|
+
*/
|
|
2784
|
+
sinter: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, string[]>]>;
|
|
2785
|
+
/**
|
|
2786
|
+
* @see https://redis.io/commands/sinterstore
|
|
2787
|
+
*/
|
|
2788
|
+
sinterstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2789
|
+
/**
|
|
2790
|
+
* @see https://redis.io/commands/sismember
|
|
2791
|
+
*/
|
|
2792
|
+
sismember: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
2793
|
+
/**
|
|
2794
|
+
* @see https://redis.io/commands/smembers
|
|
2795
|
+
*/
|
|
2796
|
+
smembers: <TData extends unknown[] = string[]>(key: string) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2797
|
+
/**
|
|
2798
|
+
* @see https://redis.io/commands/smismember
|
|
2799
|
+
*/
|
|
2800
|
+
smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Pipeline<[...TCommands, Command<any, (0 | 1)[]>]>;
|
|
2801
|
+
/**
|
|
2802
|
+
* @see https://redis.io/commands/smove
|
|
2803
|
+
*/
|
|
2804
|
+
smove: <TData>(source: string, destination: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
2805
|
+
/**
|
|
2806
|
+
* @see https://redis.io/commands/spop
|
|
2807
|
+
*/
|
|
2808
|
+
spop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
2809
|
+
/**
|
|
2810
|
+
* @see https://redis.io/commands/srandmember
|
|
2811
|
+
*/
|
|
2812
|
+
srandmember: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
2813
|
+
/**
|
|
2814
|
+
* @see https://redis.io/commands/srem
|
|
2815
|
+
*/
|
|
2816
|
+
srem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2817
|
+
/**
|
|
2818
|
+
* @see https://redis.io/commands/sscan
|
|
2819
|
+
*/
|
|
2820
|
+
sscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
|
|
2821
|
+
/**
|
|
2822
|
+
* @see https://redis.io/commands/strlen
|
|
2823
|
+
*/
|
|
2824
|
+
strlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2825
|
+
/**
|
|
2826
|
+
* @see https://redis.io/commands/sunion
|
|
2827
|
+
*/
|
|
2828
|
+
sunion: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2829
|
+
/**
|
|
2830
|
+
* @see https://redis.io/commands/sunionstore
|
|
2831
|
+
*/
|
|
2832
|
+
sunionstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2833
|
+
/**
|
|
2834
|
+
* @see https://redis.io/commands/time
|
|
2835
|
+
*/
|
|
2836
|
+
time: () => Pipeline<[...TCommands, Command<any, [number, number]>]>;
|
|
2837
|
+
/**
|
|
2838
|
+
* @see https://redis.io/commands/touch
|
|
2839
|
+
*/
|
|
2840
|
+
touch: (...args: CommandArgs<typeof TouchCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2841
|
+
/**
|
|
2842
|
+
* @see https://redis.io/commands/ttl
|
|
2843
|
+
*/
|
|
2844
|
+
ttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2845
|
+
/**
|
|
2846
|
+
* @see https://redis.io/commands/type
|
|
2847
|
+
*/
|
|
2848
|
+
type: (key: string) => Pipeline<[...TCommands, Command<any, Type>]>;
|
|
2849
|
+
/**
|
|
2850
|
+
* @see https://redis.io/commands/unlink
|
|
2851
|
+
*/
|
|
2852
|
+
unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2853
|
+
/**
|
|
2854
|
+
* @see https://redis.io/commands/zadd
|
|
2855
|
+
*/
|
|
2856
|
+
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]]) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
2857
|
+
/**
|
|
2858
|
+
* @see https://redis.io/commands/xadd
|
|
2859
|
+
*/
|
|
2860
|
+
xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
|
|
2861
|
+
nomkStream?: boolean;
|
|
2862
|
+
trim?: ({
|
|
2863
|
+
type: "MAXLEN" | "maxlen";
|
|
2864
|
+
threshold: number;
|
|
2865
|
+
} | {
|
|
2866
|
+
type: "MINID" | "minid";
|
|
2867
|
+
threshold: string;
|
|
2868
|
+
}) & ({
|
|
2869
|
+
comparison: "~";
|
|
2870
|
+
limit?: number;
|
|
2871
|
+
} | {
|
|
2872
|
+
comparison: "=";
|
|
2873
|
+
limit?: never;
|
|
2874
|
+
});
|
|
2875
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
2876
|
+
/**
|
|
2877
|
+
* @see https://redis.io/commands/xack
|
|
2878
|
+
*/
|
|
2879
|
+
xack: (key: string, group: string, id: string | string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2880
|
+
/**
|
|
2881
|
+
* @see https://redis.io/commands/xackdel
|
|
2882
|
+
*/
|
|
2883
|
+
xackdel: (key: string, group: string, opts: "KEEPREF" | "keepref" | "DELREF" | "delref" | "ACKED" | "acked", ...ids: string[]) => Pipeline<[...TCommands, Command<any, number[]>]>;
|
|
2884
|
+
/**
|
|
2885
|
+
* @see https://redis.io/commands/xdel
|
|
2886
|
+
*/
|
|
2887
|
+
xdel: (key: string, ids: string | string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2888
|
+
/**
|
|
2889
|
+
* @see https://redis.io/commands/xdelex
|
|
2890
|
+
*/
|
|
2891
|
+
xdelex: (key: string, opts?: ("KEEPREF" | "keepref" | "DELREF" | "delref" | "ACKED" | "acked") | undefined, ...ids: string[]) => Pipeline<[...TCommands, Command<any, number[]>]>;
|
|
2892
|
+
/**
|
|
2893
|
+
* @see https://redis.io/commands/xgroup
|
|
2894
|
+
*/
|
|
2895
|
+
xgroup: (key: string, opts: {
|
|
2896
|
+
type: "CREATE";
|
|
2897
|
+
group: string;
|
|
2898
|
+
id: `$` | string;
|
|
2899
|
+
options?: {
|
|
2900
|
+
MKSTREAM?: boolean;
|
|
2901
|
+
ENTRIESREAD?: number;
|
|
2902
|
+
};
|
|
2903
|
+
} | {
|
|
2904
|
+
type: "CREATECONSUMER";
|
|
2905
|
+
group: string;
|
|
2906
|
+
consumer: string;
|
|
2907
|
+
} | {
|
|
2908
|
+
type: "DELCONSUMER";
|
|
2909
|
+
group: string;
|
|
2910
|
+
consumer: string;
|
|
2911
|
+
} | {
|
|
2912
|
+
type: "DESTROY";
|
|
2913
|
+
group: string;
|
|
2914
|
+
} | {
|
|
2915
|
+
type: "SETID";
|
|
2916
|
+
group: string;
|
|
2917
|
+
id: `$` | string;
|
|
2918
|
+
options?: {
|
|
2919
|
+
ENTRIESREAD?: number;
|
|
2920
|
+
};
|
|
2921
|
+
}) => Pipeline<[...TCommands, Command<any, never>]>;
|
|
2922
|
+
/**
|
|
2923
|
+
* @see https://redis.io/commands/xread
|
|
2924
|
+
*/
|
|
2925
|
+
xread: (...args: CommandArgs<typeof XReadCommand>) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2926
|
+
/**
|
|
2927
|
+
* @see https://redis.io/commands/xreadgroup
|
|
2928
|
+
*/
|
|
2929
|
+
xreadgroup: (...args: CommandArgs<typeof XReadGroupCommand>) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2930
|
+
/**
|
|
2931
|
+
* @see https://redis.io/commands/xinfo
|
|
2932
|
+
*/
|
|
2933
|
+
xinfo: (key: string, options: {
|
|
2934
|
+
type: "CONSUMERS";
|
|
2935
|
+
group: string;
|
|
2936
|
+
} | {
|
|
2937
|
+
type: "GROUPS";
|
|
2938
|
+
}) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2939
|
+
/**
|
|
2940
|
+
* @see https://redis.io/commands/xlen
|
|
2941
|
+
*/
|
|
2942
|
+
xlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2943
|
+
/**
|
|
2944
|
+
* @see https://redis.io/commands/xpending
|
|
2945
|
+
*/
|
|
2946
|
+
xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
|
|
2947
|
+
idleTime?: number;
|
|
2948
|
+
consumer?: string | string[];
|
|
2949
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2950
|
+
/**
|
|
2951
|
+
* @see https://redis.io/commands/xclaim
|
|
2952
|
+
*/
|
|
2953
|
+
xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
|
|
2954
|
+
idleMS?: number;
|
|
2955
|
+
timeMS?: number;
|
|
2956
|
+
retryCount?: number;
|
|
2957
|
+
force?: boolean;
|
|
2958
|
+
justId?: boolean;
|
|
2959
|
+
lastId?: number;
|
|
2960
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2961
|
+
/**
|
|
2962
|
+
* @see https://redis.io/commands/xautoclaim
|
|
2963
|
+
*/
|
|
2964
|
+
xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
|
|
2965
|
+
count?: number;
|
|
2966
|
+
justId?: boolean;
|
|
2967
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2968
|
+
/**
|
|
2969
|
+
* @see https://redis.io/commands/xtrim
|
|
2970
|
+
*/
|
|
2971
|
+
xtrim: (key: string, options: {
|
|
2972
|
+
strategy: "MAXLEN" | "MINID";
|
|
2973
|
+
exactness?: "~" | "=";
|
|
2974
|
+
threshold: number | string;
|
|
2975
|
+
limit?: number;
|
|
2976
|
+
}) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2977
|
+
/**
|
|
2978
|
+
* @see https://redis.io/commands/xrange
|
|
2979
|
+
*/
|
|
2980
|
+
xrange: (key: string, start: string, end: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, Record<string, Record<string, unknown>>>]>;
|
|
2981
|
+
/**
|
|
2982
|
+
* @see https://redis.io/commands/xrevrange
|
|
2983
|
+
*/
|
|
2984
|
+
xrevrange: (key: string, end: string, start: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, Record<string, Record<string, unknown>>>]>;
|
|
2985
|
+
/**
|
|
2986
|
+
* @see https://redis.io/commands/zcard
|
|
2987
|
+
*/
|
|
2988
|
+
zcard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2989
|
+
/**
|
|
2990
|
+
* @see https://redis.io/commands/zcount
|
|
2991
|
+
*/
|
|
2992
|
+
zcount: (key: string, min: string | number, max: string | number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2993
|
+
/**
|
|
2994
|
+
* @see https://redis.io/commands/zincrby
|
|
2995
|
+
*/
|
|
2996
|
+
zincrby: <TData>(key: string, increment: number, member: TData) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2997
|
+
/**
|
|
2998
|
+
* @see https://redis.io/commands/zinterstore
|
|
2999
|
+
*/
|
|
3000
|
+
zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
3001
|
+
/**
|
|
3002
|
+
* @see https://redis.io/commands/zlexcount
|
|
3003
|
+
*/
|
|
3004
|
+
zlexcount: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
3005
|
+
/**
|
|
3006
|
+
* @see https://redis.io/commands/zmscore
|
|
3007
|
+
*/
|
|
3008
|
+
zmscore: (key: string, members: unknown[]) => Pipeline<[...TCommands, Command<any, number[] | null>]>;
|
|
3009
|
+
/**
|
|
3010
|
+
* @see https://redis.io/commands/zpopmax
|
|
3011
|
+
*/
|
|
3012
|
+
zpopmax: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
|
|
3013
|
+
/**
|
|
3014
|
+
* @see https://redis.io/commands/zpopmin
|
|
3015
|
+
*/
|
|
3016
|
+
zpopmin: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
|
|
3017
|
+
/**
|
|
3018
|
+
* @see https://redis.io/commands/zrange
|
|
3019
|
+
*/
|
|
3020
|
+
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
|
|
3021
|
+
byLex: true;
|
|
3022
|
+
} & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
|
|
3023
|
+
byScore: true;
|
|
3024
|
+
} & ZRangeCommandOptions]) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
3025
|
+
/**
|
|
3026
|
+
* @see https://redis.io/commands/zrank
|
|
3027
|
+
*/
|
|
3028
|
+
zrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
3029
|
+
/**
|
|
3030
|
+
* @see https://redis.io/commands/zrem
|
|
3031
|
+
*/
|
|
3032
|
+
zrem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
3033
|
+
/**
|
|
3034
|
+
* @see https://redis.io/commands/zremrangebylex
|
|
3035
|
+
*/
|
|
3036
|
+
zremrangebylex: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
3037
|
+
/**
|
|
3038
|
+
* @see https://redis.io/commands/zremrangebyrank
|
|
3039
|
+
*/
|
|
3040
|
+
zremrangebyrank: (key: string, start: number, stop: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
3041
|
+
/**
|
|
3042
|
+
* @see https://redis.io/commands/zremrangebyscore
|
|
3043
|
+
*/
|
|
3044
|
+
zremrangebyscore: (key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf") => Pipeline<[...TCommands, Command<any, number>]>;
|
|
3045
|
+
/**
|
|
3046
|
+
* @see https://redis.io/commands/zrevrank
|
|
3047
|
+
*/
|
|
3048
|
+
zrevrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
3049
|
+
/**
|
|
3050
|
+
* @see https://redis.io/commands/zscan
|
|
3051
|
+
*/
|
|
3052
|
+
zscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
|
|
3053
|
+
/**
|
|
3054
|
+
* @see https://redis.io/commands/zscore
|
|
3055
|
+
*/
|
|
3056
|
+
zscore: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
3057
|
+
/**
|
|
3058
|
+
* @see https://redis.io/commands/zunionstore
|
|
3059
|
+
*/
|
|
3060
|
+
zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
3061
|
+
/**
|
|
3062
|
+
* @see https://redis.io/commands/zunion
|
|
3063
|
+
*/
|
|
3064
|
+
zunion: (numKeys: number, keys: string[], opts?: ZUnionCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
3065
|
+
/**
|
|
3066
|
+
* @see https://redis.io/commands/?group=json
|
|
3067
|
+
*/
|
|
3068
|
+
get json(): {
|
|
3069
|
+
/**
|
|
3070
|
+
* @see https://redis.io/commands/json.arrappend
|
|
3071
|
+
*/
|
|
3072
|
+
arrappend: (key: string, path: string, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
3073
|
+
/**
|
|
3074
|
+
* @see https://redis.io/commands/json.arrindex
|
|
3075
|
+
*/
|
|
3076
|
+
arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
3077
|
+
/**
|
|
3078
|
+
* @see https://redis.io/commands/json.arrinsert
|
|
3079
|
+
*/
|
|
3080
|
+
arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
3081
|
+
/**
|
|
3082
|
+
* @see https://redis.io/commands/json.arrlen
|
|
3083
|
+
*/
|
|
3084
|
+
arrlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
3085
|
+
/**
|
|
3086
|
+
* @see https://redis.io/commands/json.arrpop
|
|
3087
|
+
*/
|
|
3088
|
+
arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
3089
|
+
/**
|
|
3090
|
+
* @see https://redis.io/commands/json.arrtrim
|
|
3091
|
+
*/
|
|
3092
|
+
arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
3093
|
+
/**
|
|
3094
|
+
* @see https://redis.io/commands/json.clear
|
|
3095
|
+
*/
|
|
3096
|
+
clear: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
3097
|
+
/**
|
|
3098
|
+
* @see https://redis.io/commands/json.del
|
|
3099
|
+
*/
|
|
3100
|
+
del: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
3101
|
+
/**
|
|
3102
|
+
* @see https://redis.io/commands/json.forget
|
|
3103
|
+
*/
|
|
3104
|
+
forget: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
3105
|
+
/**
|
|
3106
|
+
* @see https://redis.io/commands/json.get
|
|
3107
|
+
*/
|
|
3108
|
+
get: (...args: CommandArgs<typeof JsonGetCommand>) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
3109
|
+
/**
|
|
3110
|
+
* @see https://redis.io/commands/json.merge
|
|
3111
|
+
*/
|
|
3112
|
+
merge: (key: string, path: string, value: string | number | unknown[] | Record<string, unknown>) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
|
|
3113
|
+
/**
|
|
3114
|
+
* @see https://redis.io/commands/json.mget
|
|
3115
|
+
*/
|
|
3116
|
+
mget: (keys: string[], path: string) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
3117
|
+
/**
|
|
3118
|
+
* @see https://redis.io/commands/json.mset
|
|
3119
|
+
*/
|
|
3120
|
+
mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
|
|
3121
|
+
/**
|
|
3122
|
+
* @see https://redis.io/commands/json.numincrby
|
|
3123
|
+
*/
|
|
3124
|
+
numincrby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
3125
|
+
/**
|
|
3126
|
+
* @see https://redis.io/commands/json.nummultby
|
|
3127
|
+
*/
|
|
3128
|
+
nummultby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
3129
|
+
/**
|
|
3130
|
+
* @see https://redis.io/commands/json.objkeys
|
|
3131
|
+
*/
|
|
3132
|
+
objkeys: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (string[] | null)[]>]>;
|
|
3133
|
+
/**
|
|
3134
|
+
* @see https://redis.io/commands/json.objlen
|
|
3135
|
+
*/
|
|
3136
|
+
objlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
3137
|
+
/**
|
|
3138
|
+
* @see https://redis.io/commands/json.resp
|
|
3139
|
+
*/
|
|
3140
|
+
resp: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
3141
|
+
/**
|
|
3142
|
+
* @see https://redis.io/commands/json.set
|
|
3143
|
+
*/
|
|
3144
|
+
set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
|
|
3145
|
+
nx: true;
|
|
3146
|
+
xx?: never;
|
|
3147
|
+
} | {
|
|
3148
|
+
nx?: never;
|
|
3149
|
+
xx: true;
|
|
3150
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
|
|
3151
|
+
/**
|
|
3152
|
+
* @see https://redis.io/commands/json.strappend
|
|
3153
|
+
*/
|
|
3154
|
+
strappend: (key: string, path: string, value: string) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
3155
|
+
/**
|
|
3156
|
+
* @see https://redis.io/commands/json.strlen
|
|
3157
|
+
*/
|
|
3158
|
+
strlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
3159
|
+
/**
|
|
3160
|
+
* @see https://redis.io/commands/json.toggle
|
|
3161
|
+
*/
|
|
3162
|
+
toggle: (key: string, path: string) => Pipeline<[...TCommands, Command<any, number[]>]>;
|
|
3163
|
+
/**
|
|
3164
|
+
* @see https://redis.io/commands/json.type
|
|
3165
|
+
*/
|
|
3166
|
+
type: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, string[]>]>;
|
|
3167
|
+
};
|
|
3168
|
+
get functions(): {
|
|
3169
|
+
/**
|
|
3170
|
+
* @see https://redis.io/docs/latest/commands/function-load/
|
|
3171
|
+
*/
|
|
3172
|
+
load: (args: FunctionLoadArgs) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
3173
|
+
/**
|
|
3174
|
+
* @see https://redis.io/docs/latest/commands/function-list/
|
|
3175
|
+
*/
|
|
3176
|
+
list: (args?: FunctionListArgs | undefined) => Pipeline<[...TCommands, Command<any, {
|
|
3177
|
+
libraryName: string;
|
|
3178
|
+
engine: string;
|
|
3179
|
+
functions: {
|
|
3180
|
+
name: string;
|
|
3181
|
+
description?: string;
|
|
3182
|
+
flags: string[];
|
|
3183
|
+
}[];
|
|
3184
|
+
libraryCode?: string;
|
|
3185
|
+
}[]>]>;
|
|
3186
|
+
/**
|
|
3187
|
+
* @see https://redis.io/docs/latest/commands/function-delete/
|
|
3188
|
+
*/
|
|
3189
|
+
delete: (libraryName: string) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
3190
|
+
/**
|
|
3191
|
+
* @see https://redis.io/docs/latest/commands/function-flush/
|
|
3192
|
+
*/
|
|
3193
|
+
flush: () => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
3194
|
+
/**
|
|
3195
|
+
* @see https://redis.io/docs/latest/commands/function-stats/
|
|
3196
|
+
*/
|
|
3197
|
+
stats: () => Pipeline<[...TCommands, Command<any, {
|
|
3198
|
+
engines: {
|
|
3199
|
+
[k: string]: {
|
|
3200
|
+
librariesCount: unknown;
|
|
3201
|
+
functionsCount: unknown;
|
|
3202
|
+
};
|
|
3203
|
+
};
|
|
3204
|
+
}>]>;
|
|
3205
|
+
/**
|
|
3206
|
+
* @see https://redis.io/docs/latest/commands/fcall/
|
|
3207
|
+
*/
|
|
3208
|
+
call: <TData = unknown>(functionName: string, keys?: string[] | undefined, args?: string[] | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
3209
|
+
/**
|
|
3210
|
+
* @see https://redis.io/docs/latest/commands/fcall_ro/
|
|
3211
|
+
*/
|
|
3212
|
+
callRo: <TData = unknown>(functionName: string, keys?: string[] | undefined, args?: string[] | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
3213
|
+
};
|
|
3214
|
+
}
|
|
3215
|
+
|
|
3216
|
+
/**
|
|
3217
|
+
* Creates a new script.
|
|
3218
|
+
*
|
|
3219
|
+
* Scripts offer the ability to optimistically try to execute a script without having to send the
|
|
3220
|
+
* entire script to the server. If the script is loaded on the server, it tries again by sending
|
|
3221
|
+
* the entire script. Afterwards, the script is cached on the server.
|
|
3222
|
+
*
|
|
3223
|
+
* @example
|
|
3224
|
+
* ```ts
|
|
3225
|
+
* const redis = new Redis({...})
|
|
3226
|
+
*
|
|
3227
|
+
* const script = redis.createScript<string>("return ARGV[1];")
|
|
3228
|
+
* const arg1 = await script.eval([], ["Hello World"])
|
|
3229
|
+
* expect(arg1, "Hello World")
|
|
3230
|
+
* ```
|
|
3231
|
+
*/
|
|
3232
|
+
declare class Script<TResult = unknown> {
|
|
3233
|
+
readonly script: string;
|
|
3234
|
+
/**
|
|
3235
|
+
* @deprecated This property is initialized to an empty string and will be set in the init method
|
|
3236
|
+
* asynchronously. Do not use this property immidiately after the constructor.
|
|
3237
|
+
*
|
|
3238
|
+
* This property is only exposed for backwards compatibility and will be removed in the
|
|
3239
|
+
* future major release.
|
|
3240
|
+
*/
|
|
3241
|
+
sha1: string;
|
|
3242
|
+
private readonly redis;
|
|
3243
|
+
constructor(redis: Redis, script: string);
|
|
3244
|
+
/**
|
|
3245
|
+
* Initialize the script by computing its SHA-1 hash.
|
|
3246
|
+
*/
|
|
3247
|
+
private init;
|
|
3248
|
+
/**
|
|
3249
|
+
* Send an `EVAL` command to redis.
|
|
3250
|
+
*/
|
|
3251
|
+
eval(keys: string[], args: string[]): Promise<TResult>;
|
|
3252
|
+
/**
|
|
3253
|
+
* Calculates the sha1 hash of the script and then calls `EVALSHA`.
|
|
3254
|
+
*/
|
|
3255
|
+
evalsha(keys: string[], args: string[]): Promise<TResult>;
|
|
3256
|
+
/**
|
|
3257
|
+
* Optimistically try to run `EVALSHA` first.
|
|
3258
|
+
* If the script is not loaded in redis, it will fall back and try again with `EVAL`.
|
|
3259
|
+
*
|
|
3260
|
+
* Following calls will be able to use the cached script
|
|
3261
|
+
*/
|
|
3262
|
+
exec(keys: string[], args: string[]): Promise<TResult>;
|
|
3263
|
+
/**
|
|
3264
|
+
* Compute the sha1 hash of the script and return its hex representation.
|
|
3265
|
+
*/
|
|
3266
|
+
private digest;
|
|
3267
|
+
}
|
|
3268
|
+
|
|
3269
|
+
/**
|
|
3270
|
+
* Creates a new script.
|
|
3271
|
+
*
|
|
3272
|
+
* Scripts offer the ability to optimistically try to execute a script without having to send the
|
|
3273
|
+
* entire script to the server. If the script is loaded on the server, it tries again by sending
|
|
3274
|
+
* the entire script. Afterwards, the script is cached on the server.
|
|
3275
|
+
*
|
|
3276
|
+
* @example
|
|
3277
|
+
* ```ts
|
|
3278
|
+
* const redis = new Redis({...})
|
|
3279
|
+
*
|
|
3280
|
+
* const script = redis.createScript<string>("return ARGV[1];", { readOnly: true })
|
|
3281
|
+
* const arg1 = await script.evalRo([], ["Hello World"])
|
|
3282
|
+
* expect(arg1, "Hello World")
|
|
3283
|
+
* ```
|
|
3284
|
+
*/
|
|
3285
|
+
declare class ScriptRO<TResult = unknown> {
|
|
3286
|
+
readonly script: string;
|
|
3287
|
+
/**
|
|
3288
|
+
* @deprecated This property is initialized to an empty string and will be set in the init method
|
|
3289
|
+
* asynchronously. Do not use this property immidiately after the constructor.
|
|
3290
|
+
*
|
|
3291
|
+
* This property is only exposed for backwards compatibility and will be removed in the
|
|
3292
|
+
* future major release.
|
|
3293
|
+
*/
|
|
3294
|
+
sha1: string;
|
|
3295
|
+
private readonly redis;
|
|
3296
|
+
constructor(redis: Redis, script: string);
|
|
3297
|
+
private init;
|
|
3298
|
+
/**
|
|
3299
|
+
* Send an `EVAL_RO` command to redis.
|
|
3300
|
+
*/
|
|
3301
|
+
evalRo(keys: string[], args: string[]): Promise<TResult>;
|
|
3302
|
+
/**
|
|
3303
|
+
* Calculates the sha1 hash of the script and then calls `EVALSHA_RO`.
|
|
3304
|
+
*/
|
|
3305
|
+
evalshaRo(keys: string[], args: string[]): Promise<TResult>;
|
|
3306
|
+
/**
|
|
3307
|
+
* Optimistically try to run `EVALSHA_RO` first.
|
|
3308
|
+
* If the script is not loaded in redis, it will fall back and try again with `EVAL_RO`.
|
|
3309
|
+
*
|
|
3310
|
+
* Following calls will be able to use the cached script
|
|
3311
|
+
*/
|
|
3312
|
+
exec(keys: string[], args: string[]): Promise<TResult>;
|
|
3313
|
+
/**
|
|
3314
|
+
* Compute the sha1 hash of the script and return its hex representation.
|
|
3315
|
+
*/
|
|
3316
|
+
private digest;
|
|
3317
|
+
}
|
|
3318
|
+
|
|
3319
|
+
/**
|
|
3320
|
+
* Serverless redis client for upstash.
|
|
3321
|
+
*/
|
|
3322
|
+
declare class Redis {
|
|
3323
|
+
protected client: Requester;
|
|
3324
|
+
protected opts?: CommandOptions<any, any>;
|
|
3325
|
+
protected enableTelemetry: boolean;
|
|
3326
|
+
protected enableAutoPipelining: boolean;
|
|
3327
|
+
/**
|
|
3328
|
+
* Create a new redis client
|
|
3329
|
+
*
|
|
3330
|
+
* @example
|
|
3331
|
+
* ```typescript
|
|
3332
|
+
* const redis = new Redis({
|
|
3333
|
+
* url: "<UPSTASH_REDIS_REST_URL>",
|
|
3334
|
+
* token: "<UPSTASH_REDIS_REST_TOKEN>",
|
|
3335
|
+
* });
|
|
3336
|
+
* ```
|
|
3337
|
+
*/
|
|
3338
|
+
constructor(client: Requester, opts?: RedisOptions);
|
|
3339
|
+
get readYourWritesSyncToken(): string | undefined;
|
|
3340
|
+
set readYourWritesSyncToken(session: string | undefined);
|
|
3341
|
+
get json(): {
|
|
3342
|
+
/**
|
|
3343
|
+
* @see https://redis.io/commands/json.arrappend
|
|
3344
|
+
*/
|
|
3345
|
+
arrappend: (key: string, path: string, ...values: unknown[]) => Promise<(number | null)[]>;
|
|
3346
|
+
/**
|
|
3347
|
+
* @see https://redis.io/commands/json.arrindex
|
|
3348
|
+
*/
|
|
3349
|
+
arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
|
|
3350
|
+
/**
|
|
3351
|
+
* @see https://redis.io/commands/json.arrinsert
|
|
3352
|
+
*/
|
|
3353
|
+
arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Promise<(number | null)[]>;
|
|
3354
|
+
/**
|
|
3355
|
+
* @see https://redis.io/commands/json.arrlen
|
|
3356
|
+
*/
|
|
3357
|
+
arrlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
|
|
3358
|
+
/**
|
|
3359
|
+
* @see https://redis.io/commands/json.arrpop
|
|
3360
|
+
*/
|
|
3361
|
+
arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Promise<unknown[]>;
|
|
3362
|
+
/**
|
|
3363
|
+
* @see https://redis.io/commands/json.arrtrim
|
|
3364
|
+
*/
|
|
3365
|
+
arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
|
|
3366
|
+
/**
|
|
3367
|
+
* @see https://redis.io/commands/json.clear
|
|
3368
|
+
*/
|
|
3369
|
+
clear: (key: string, path?: string | undefined) => Promise<number>;
|
|
3370
|
+
/**
|
|
3371
|
+
* @see https://redis.io/commands/json.del
|
|
3372
|
+
*/
|
|
3373
|
+
del: (key: string, path?: string | undefined) => Promise<number>;
|
|
3374
|
+
/**
|
|
3375
|
+
* @see https://redis.io/commands/json.forget
|
|
3376
|
+
*/
|
|
3377
|
+
forget: (key: string, path?: string | undefined) => Promise<number>;
|
|
3378
|
+
/**
|
|
3379
|
+
* @see https://redis.io/commands/json.get
|
|
3380
|
+
*/
|
|
3381
|
+
get: <TData>(...args: CommandArgs<typeof JsonGetCommand>) => Promise<TData | null>;
|
|
3382
|
+
/**
|
|
3383
|
+
* @see https://redis.io/commands/json.merge
|
|
3384
|
+
*/
|
|
3385
|
+
merge: (key: string, path: string, value: string | number | unknown[] | Record<string, unknown>) => Promise<"OK" | null>;
|
|
3386
|
+
/**
|
|
3387
|
+
* @see https://redis.io/commands/json.mget
|
|
3388
|
+
*/
|
|
3389
|
+
mget: <TData>(keys: string[], path: string) => Promise<TData>;
|
|
3390
|
+
/**
|
|
3391
|
+
* @see https://redis.io/commands/json.mset
|
|
3392
|
+
*/
|
|
3393
|
+
mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Promise<"OK" | null>;
|
|
3394
|
+
/**
|
|
3395
|
+
* @see https://redis.io/commands/json.numincrby
|
|
3396
|
+
*/
|
|
3397
|
+
numincrby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
|
|
3398
|
+
/**
|
|
3399
|
+
* @see https://redis.io/commands/json.nummultby
|
|
3400
|
+
*/
|
|
3401
|
+
nummultby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
|
|
3402
|
+
/**
|
|
3403
|
+
* @see https://redis.io/commands/json.objkeys
|
|
3404
|
+
*/
|
|
3405
|
+
objkeys: (key: string, path?: string | undefined) => Promise<(string[] | null)[]>;
|
|
3406
|
+
/**
|
|
3407
|
+
* @see https://redis.io/commands/json.objlen
|
|
3408
|
+
*/
|
|
3409
|
+
objlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
|
|
3410
|
+
/**
|
|
3411
|
+
* @see https://redis.io/commands/json.resp
|
|
3412
|
+
*/
|
|
3413
|
+
resp: (key: string, path?: string | undefined) => Promise<any>;
|
|
3414
|
+
/**
|
|
3415
|
+
* @see https://redis.io/commands/json.set
|
|
3416
|
+
*/
|
|
3417
|
+
set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
|
|
3418
|
+
nx: true;
|
|
3419
|
+
xx?: never;
|
|
3420
|
+
} | {
|
|
3421
|
+
nx?: never;
|
|
3422
|
+
xx: true;
|
|
3423
|
+
} | undefined) => Promise<"OK" | null>;
|
|
3424
|
+
/**
|
|
3425
|
+
* @see https://redis.io/commands/json.strappend
|
|
3426
|
+
*/
|
|
3427
|
+
strappend: (key: string, path: string, value: string) => Promise<(number | null)[]>;
|
|
3428
|
+
/**
|
|
3429
|
+
* @see https://redis.io/commands/json.strlen
|
|
3430
|
+
*/
|
|
3431
|
+
strlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
|
|
3432
|
+
/**
|
|
3433
|
+
* @see https://redis.io/commands/json.toggle
|
|
3434
|
+
*/
|
|
3435
|
+
toggle: (key: string, path: string) => Promise<number[]>;
|
|
3436
|
+
/**
|
|
3437
|
+
* @see https://redis.io/commands/json.type
|
|
3438
|
+
*/
|
|
3439
|
+
type: (key: string, path?: string | undefined) => Promise<string[]>;
|
|
3440
|
+
};
|
|
3441
|
+
get functions(): {
|
|
3442
|
+
/**
|
|
3443
|
+
* @see https://redis.io/docs/latest/commands/function-load/
|
|
3444
|
+
*/
|
|
3445
|
+
load: (args: FunctionLoadArgs) => Promise<string>;
|
|
3446
|
+
/**
|
|
3447
|
+
* @see https://redis.io/docs/latest/commands/function-list/
|
|
3448
|
+
*/
|
|
3449
|
+
list: (args?: FunctionListArgs | undefined) => Promise<{
|
|
3450
|
+
libraryName: string;
|
|
3451
|
+
engine: string;
|
|
3452
|
+
functions: {
|
|
3453
|
+
name: string;
|
|
3454
|
+
description?: string;
|
|
3455
|
+
flags: string[];
|
|
3456
|
+
}[];
|
|
3457
|
+
libraryCode?: string;
|
|
3458
|
+
}[]>;
|
|
3459
|
+
/**
|
|
3460
|
+
* @see https://redis.io/docs/latest/commands/function-delete/
|
|
3461
|
+
*/
|
|
3462
|
+
delete: (libraryName: string) => Promise<"OK">;
|
|
3463
|
+
/**
|
|
3464
|
+
* @see https://redis.io/docs/latest/commands/function-flush/
|
|
3465
|
+
*/
|
|
3466
|
+
flush: () => Promise<"OK">;
|
|
3467
|
+
/**
|
|
3468
|
+
* @see https://redis.io/docs/latest/commands/function-stats/
|
|
3469
|
+
*
|
|
3470
|
+
* Note: `running_script` field is not supported and therefore not included in the type.
|
|
3471
|
+
*/
|
|
3472
|
+
stats: () => Promise<{
|
|
3473
|
+
engines: {
|
|
3474
|
+
[k: string]: {
|
|
3475
|
+
librariesCount: unknown;
|
|
3476
|
+
functionsCount: unknown;
|
|
3477
|
+
};
|
|
3478
|
+
};
|
|
3479
|
+
}>;
|
|
3480
|
+
/**
|
|
3481
|
+
* @see https://redis.io/docs/latest/commands/fcall/
|
|
3482
|
+
*/
|
|
3483
|
+
call: <TData = unknown>(functionName: string, keys?: string[] | undefined, args?: string[] | undefined) => Promise<TData>;
|
|
3484
|
+
/**
|
|
3485
|
+
* @see https://redis.io/docs/latest/commands/fcall_ro/
|
|
3486
|
+
*/
|
|
3487
|
+
callRo: <TData = unknown>(functionName: string, keys?: string[] | undefined, args?: string[] | undefined) => Promise<TData>;
|
|
3488
|
+
};
|
|
3489
|
+
/**
|
|
3490
|
+
* Wrap a new middleware around the HTTP client.
|
|
3491
|
+
*/
|
|
3492
|
+
use: <TResult = unknown>(middleware: (r: UpstashRequest, next: <TResult_1 = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult_1>>) => Promise<UpstashResponse<TResult>>) => void;
|
|
3493
|
+
/**
|
|
3494
|
+
* Technically this is not private, we can hide it from intellisense by doing this
|
|
3495
|
+
*/
|
|
3496
|
+
protected addTelemetry: (telemetry: Telemetry) => void;
|
|
3497
|
+
/**
|
|
3498
|
+
* Creates a new script.
|
|
3499
|
+
*
|
|
3500
|
+
* Scripts offer the ability to optimistically try to execute a script without having to send the
|
|
3501
|
+
* entire script to the server. If the script is loaded on the server, it tries again by sending
|
|
3502
|
+
* the entire script. Afterwards, the script is cached on the server.
|
|
3503
|
+
*
|
|
3504
|
+
* @param script - The script to create
|
|
3505
|
+
* @param opts - Optional options to pass to the script `{ readonly?: boolean }`
|
|
3506
|
+
* @returns A new script
|
|
3507
|
+
*
|
|
3508
|
+
* @example
|
|
3509
|
+
* ```ts
|
|
3510
|
+
* const redis = new Redis({...})
|
|
3511
|
+
*
|
|
3512
|
+
* const script = redis.createScript<string>("return ARGV[1];")
|
|
3513
|
+
* const arg1 = await script.eval([], ["Hello World"])
|
|
3514
|
+
* expect(arg1, "Hello World")
|
|
3515
|
+
* ```
|
|
3516
|
+
* @example
|
|
3517
|
+
* ```ts
|
|
3518
|
+
* const redis = new Redis({...})
|
|
3519
|
+
*
|
|
3520
|
+
* const script = redis.createScript<string>("return ARGV[1];", { readonly: true })
|
|
3521
|
+
* const arg1 = await script.evalRo([], ["Hello World"])
|
|
3522
|
+
* expect(arg1, "Hello World")
|
|
3523
|
+
* ```
|
|
3524
|
+
*/
|
|
3525
|
+
createScript<TResult = unknown, TReadonly extends boolean = false>(script: string, opts?: {
|
|
3526
|
+
readonly?: TReadonly;
|
|
3527
|
+
}): TReadonly extends true ? ScriptRO<TResult> : Script<TResult>;
|
|
3528
|
+
/**
|
|
3529
|
+
* Create a new pipeline that allows you to send requests in bulk.
|
|
3530
|
+
*
|
|
3531
|
+
* @see {@link Pipeline}
|
|
3532
|
+
*/
|
|
3533
|
+
pipeline: () => Pipeline<[]>;
|
|
3534
|
+
protected autoPipeline: () => Redis;
|
|
3535
|
+
/**
|
|
3536
|
+
* Create a new transaction to allow executing multiple steps atomically.
|
|
3537
|
+
*
|
|
3538
|
+
* All the commands in a transaction are serialized and executed sequentially. A request sent by
|
|
3539
|
+
* another client will never be served in the middle of the execution of a Redis Transaction. This
|
|
3540
|
+
* guarantees that the commands are executed as a single isolated operation.
|
|
3541
|
+
*
|
|
3542
|
+
* @see {@link Pipeline}
|
|
3543
|
+
*/
|
|
3544
|
+
multi: () => Pipeline<[]>;
|
|
3545
|
+
/**
|
|
3546
|
+
* Returns an instance that can be used to execute `BITFIELD` commands on one key.
|
|
3547
|
+
*
|
|
3548
|
+
* @example
|
|
3549
|
+
* ```typescript
|
|
3550
|
+
* redis.set("mykey", 0);
|
|
3551
|
+
* const result = await redis.bitfield("mykey")
|
|
3552
|
+
* .set("u4", 0, 16)
|
|
3553
|
+
* .incr("u4", "#1", 1)
|
|
3554
|
+
* .exec();
|
|
3555
|
+
* console.log(result); // [0, 1]
|
|
3556
|
+
* ```
|
|
3557
|
+
*
|
|
3558
|
+
* @see https://redis.io/commands/bitfield
|
|
3559
|
+
*/
|
|
3560
|
+
bitfield: (key: string) => BitFieldCommand<Promise<number[]>>;
|
|
3561
|
+
/**
|
|
3562
|
+
* @see https://redis.io/commands/append
|
|
3563
|
+
*/
|
|
3564
|
+
append: (key: string, value: string) => Promise<number>;
|
|
3565
|
+
/**
|
|
3566
|
+
* @see https://redis.io/commands/bitcount
|
|
3567
|
+
*/
|
|
3568
|
+
bitcount: (key: string, start: number, end: number) => Promise<number>;
|
|
3569
|
+
/**
|
|
3570
|
+
* @see https://redis.io/commands/bitop
|
|
3571
|
+
*/
|
|
3572
|
+
bitop: {
|
|
3573
|
+
(op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Promise<number>;
|
|
3574
|
+
(op: "not", destinationKey: string, sourceKey: string): Promise<number>;
|
|
3575
|
+
(op: "diff" | "diff1" | "andor", destinationKey: string, x: string, ...y: string[]): Promise<number>;
|
|
3576
|
+
(op: "one", destinationKey: string, ...sourceKeys: string[]): Promise<number>;
|
|
3577
|
+
};
|
|
3578
|
+
/**
|
|
3579
|
+
* @see https://redis.io/commands/bitpos
|
|
3580
|
+
*/
|
|
3581
|
+
bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Promise<number>;
|
|
3582
|
+
/**
|
|
3583
|
+
* @see https://redis.io/commands/client-setinfo
|
|
3584
|
+
*/
|
|
3585
|
+
clientSetinfo: (attribute: ClientSetInfoAttribute, value: string) => Promise<string>;
|
|
3586
|
+
/**
|
|
3587
|
+
* @see https://redis.io/commands/copy
|
|
3588
|
+
*/
|
|
3589
|
+
copy: (key: string, destinationKey: string, opts?: {
|
|
3590
|
+
replace: boolean;
|
|
3591
|
+
} | undefined) => Promise<"COPIED" | "NOT_COPIED">;
|
|
3592
|
+
/**
|
|
3593
|
+
* @see https://redis.io/commands/dbsize
|
|
3594
|
+
*/
|
|
3595
|
+
dbsize: () => Promise<number>;
|
|
3596
|
+
/**
|
|
3597
|
+
* @see https://redis.io/commands/decr
|
|
3598
|
+
*/
|
|
3599
|
+
decr: (key: string) => Promise<number>;
|
|
3600
|
+
/**
|
|
3601
|
+
* @see https://redis.io/commands/decrby
|
|
3602
|
+
*/
|
|
3603
|
+
decrby: (key: string, decrement: number) => Promise<number>;
|
|
3604
|
+
/**
|
|
3605
|
+
* @see https://redis.io/commands/del
|
|
3606
|
+
*/
|
|
3607
|
+
del: (...args: CommandArgs<typeof DelCommand>) => Promise<number>;
|
|
3608
|
+
/**
|
|
3609
|
+
* @see https://redis.io/commands/echo
|
|
3610
|
+
*/
|
|
3611
|
+
echo: (message: string) => Promise<string>;
|
|
3612
|
+
/**
|
|
3613
|
+
* @see https://redis.io/commands/eval_ro
|
|
3614
|
+
*/
|
|
3615
|
+
evalRo: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Promise<TData>;
|
|
3616
|
+
/**
|
|
3617
|
+
* @see https://redis.io/commands/eval
|
|
3618
|
+
*/
|
|
3619
|
+
eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Promise<TData>;
|
|
3620
|
+
/**
|
|
3621
|
+
* @see https://redis.io/commands/evalsha_ro
|
|
3622
|
+
*/
|
|
3623
|
+
evalshaRo: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Promise<TData>;
|
|
3624
|
+
/**
|
|
3625
|
+
* @see https://redis.io/commands/evalsha
|
|
3626
|
+
*/
|
|
3627
|
+
evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Promise<TData>;
|
|
3628
|
+
/**
|
|
3629
|
+
* Generic method to execute any Redis command.
|
|
3630
|
+
*/
|
|
3631
|
+
exec: <TResult>(args: [command: string, ...args: (string | number | boolean)[]]) => Promise<TResult>;
|
|
3632
|
+
/**
|
|
3633
|
+
* @see https://redis.io/commands/exists
|
|
3634
|
+
*/
|
|
3635
|
+
exists: (...args: CommandArgs<typeof ExistsCommand>) => Promise<number>;
|
|
3636
|
+
/**
|
|
3637
|
+
* @see https://redis.io/commands/expire
|
|
3638
|
+
*/
|
|
3639
|
+
expire: (key: string, seconds: number, option?: ExpireOption | undefined) => Promise<0 | 1>;
|
|
3640
|
+
/**
|
|
3641
|
+
* @see https://redis.io/commands/expireat
|
|
3642
|
+
*/
|
|
3643
|
+
expireat: (key: string, unix: number, option?: ExpireOption | undefined) => Promise<0 | 1>;
|
|
3644
|
+
/**
|
|
3645
|
+
* @see https://redis.io/commands/flushall
|
|
3646
|
+
*/
|
|
3647
|
+
flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Promise<"OK">;
|
|
3648
|
+
/**
|
|
3649
|
+
* @see https://redis.io/commands/flushdb
|
|
3650
|
+
*/
|
|
3651
|
+
flushdb: (opts?: {
|
|
3652
|
+
async?: boolean;
|
|
3653
|
+
} | undefined) => Promise<"OK">;
|
|
3654
|
+
/**
|
|
3655
|
+
* @see https://redis.io/commands/geoadd
|
|
3656
|
+
*/
|
|
3657
|
+
geoadd: <TData>(args_0: string, args_1: GeoAddCommandOptions | GeoMember<TData>, ...args_2: GeoMember<TData>[]) => Promise<number | null>;
|
|
3658
|
+
/**
|
|
3659
|
+
* @see https://redis.io/commands/geopos
|
|
3660
|
+
*/
|
|
3661
|
+
geopos: <TData>(args_0: string, ...args_1: TData[]) => Promise<{
|
|
3662
|
+
lng: number;
|
|
3663
|
+
lat: number;
|
|
3664
|
+
}[]>;
|
|
3665
|
+
/**
|
|
3666
|
+
* @see https://redis.io/commands/geodist
|
|
3667
|
+
*/
|
|
3668
|
+
geodist: <TData>(key: string, member1: TData, member2: TData, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
|
|
3669
|
+
/**
|
|
3670
|
+
* @see https://redis.io/commands/geohash
|
|
3671
|
+
*/
|
|
3672
|
+
geohash: <TData>(args_0: string, ...args_1: TData[]) => Promise<(string | null)[]>;
|
|
3673
|
+
/**
|
|
3674
|
+
* @see https://redis.io/commands/geosearch
|
|
3675
|
+
*/
|
|
3676
|
+
geosearch: <TData>(key: string, centerPoint: {
|
|
3677
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
3678
|
+
coordinate: {
|
|
3679
|
+
lon: number;
|
|
3680
|
+
lat: number;
|
|
3681
|
+
};
|
|
3682
|
+
} | {
|
|
3683
|
+
type: "FROMMEMBER" | "frommember";
|
|
3684
|
+
member: TData;
|
|
3685
|
+
}, shape: {
|
|
3686
|
+
type: "BYRADIUS" | "byradius";
|
|
3687
|
+
radius: number;
|
|
3688
|
+
radiusType: "M" | "KM" | "FT" | "MI";
|
|
3689
|
+
} | {
|
|
3690
|
+
type: "BYBOX" | "bybox";
|
|
3691
|
+
rect: {
|
|
3692
|
+
width: number;
|
|
3693
|
+
height: number;
|
|
3694
|
+
};
|
|
3695
|
+
rectType: "M" | "KM" | "FT" | "MI";
|
|
3696
|
+
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
3697
|
+
count?: {
|
|
3698
|
+
limit: number;
|
|
3699
|
+
any?: boolean;
|
|
3700
|
+
};
|
|
3701
|
+
withCoord?: boolean;
|
|
3702
|
+
withDist?: boolean;
|
|
3703
|
+
withHash?: boolean;
|
|
3704
|
+
} | undefined) => Promise<({
|
|
3705
|
+
member: TData;
|
|
3706
|
+
} & {
|
|
3707
|
+
coord?: {
|
|
3708
|
+
long: number;
|
|
3709
|
+
lat: number;
|
|
3710
|
+
} | undefined;
|
|
3711
|
+
dist?: number | undefined;
|
|
3712
|
+
hash?: string | undefined;
|
|
3713
|
+
})[]>;
|
|
3714
|
+
/**
|
|
3715
|
+
* @see https://redis.io/commands/geosearchstore
|
|
3716
|
+
*/
|
|
3717
|
+
geosearchstore: <TData>(destination: string, key: string, centerPoint: {
|
|
3718
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
3719
|
+
coordinate: {
|
|
3720
|
+
lon: number;
|
|
3721
|
+
lat: number;
|
|
3722
|
+
};
|
|
3723
|
+
} | {
|
|
3724
|
+
type: "FROMMEMBER" | "frommember";
|
|
3725
|
+
member: TData;
|
|
3726
|
+
}, shape: {
|
|
3727
|
+
type: "BYRADIUS" | "byradius";
|
|
3728
|
+
radius: number;
|
|
3729
|
+
radiusType: "M" | "KM" | "FT" | "MI";
|
|
3730
|
+
} | {
|
|
3731
|
+
type: "BYBOX" | "bybox";
|
|
3732
|
+
rect: {
|
|
3733
|
+
width: number;
|
|
3734
|
+
height: number;
|
|
3735
|
+
};
|
|
3736
|
+
rectType: "M" | "KM" | "FT" | "MI";
|
|
3737
|
+
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
3738
|
+
count?: {
|
|
3739
|
+
limit: number;
|
|
3740
|
+
any?: boolean;
|
|
3741
|
+
};
|
|
3742
|
+
storeDist?: boolean;
|
|
3743
|
+
} | undefined) => Promise<number>;
|
|
3744
|
+
/**
|
|
3745
|
+
* @see https://redis.io/commands/get
|
|
3746
|
+
*/
|
|
3747
|
+
get: <TData>(key: string) => Promise<TData | null>;
|
|
3748
|
+
/**
|
|
3749
|
+
* @see https://redis.io/commands/getbit
|
|
3750
|
+
*/
|
|
3751
|
+
getbit: (key: string, offset: number) => Promise<0 | 1>;
|
|
3752
|
+
/**
|
|
3753
|
+
* @see https://redis.io/commands/getdel
|
|
3754
|
+
*/
|
|
3755
|
+
getdel: <TData>(key: string) => Promise<TData | null>;
|
|
3756
|
+
/**
|
|
3757
|
+
* @see https://redis.io/commands/getex
|
|
3758
|
+
*/
|
|
3759
|
+
getex: <TData>(key: string, opts?: ({
|
|
3760
|
+
ex: number;
|
|
3761
|
+
px?: never;
|
|
3762
|
+
exat?: never;
|
|
3763
|
+
pxat?: never;
|
|
3764
|
+
persist?: never;
|
|
3765
|
+
} | {
|
|
3766
|
+
ex?: never;
|
|
3767
|
+
px: number;
|
|
3768
|
+
exat?: never;
|
|
3769
|
+
pxat?: never;
|
|
3770
|
+
persist?: never;
|
|
3771
|
+
} | {
|
|
3772
|
+
ex?: never;
|
|
3773
|
+
px?: never;
|
|
3774
|
+
exat: number;
|
|
3775
|
+
pxat?: never;
|
|
3776
|
+
persist?: never;
|
|
3777
|
+
} | {
|
|
3778
|
+
ex?: never;
|
|
3779
|
+
px?: never;
|
|
3780
|
+
exat?: never;
|
|
3781
|
+
pxat: number;
|
|
3782
|
+
persist?: never;
|
|
3783
|
+
} | {
|
|
3784
|
+
ex?: never;
|
|
3785
|
+
px?: never;
|
|
3786
|
+
exat?: never;
|
|
3787
|
+
pxat?: never;
|
|
3788
|
+
persist: true;
|
|
3789
|
+
} | {
|
|
3790
|
+
ex?: never;
|
|
3791
|
+
px?: never;
|
|
3792
|
+
exat?: never;
|
|
3793
|
+
pxat?: never;
|
|
3794
|
+
persist?: never;
|
|
3795
|
+
}) | undefined) => Promise<TData | null>;
|
|
3796
|
+
/**
|
|
3797
|
+
* @see https://redis.io/commands/getrange
|
|
3798
|
+
*/
|
|
3799
|
+
getrange: (key: string, start: number, end: number) => Promise<string>;
|
|
3800
|
+
/**
|
|
3801
|
+
* @see https://redis.io/commands/getset
|
|
3802
|
+
*/
|
|
3803
|
+
getset: <TData>(key: string, value: TData) => Promise<TData | null>;
|
|
3804
|
+
/**
|
|
3805
|
+
* @see https://redis.io/commands/hdel
|
|
3806
|
+
*/
|
|
3807
|
+
hdel: (key: string, ...fields: string[]) => Promise<0 | 1>;
|
|
3808
|
+
/**
|
|
3809
|
+
* @see https://redis.io/commands/hexists
|
|
3810
|
+
*/
|
|
3811
|
+
hexists: (key: string, field: string) => Promise<number>;
|
|
3812
|
+
/**
|
|
3813
|
+
* @see https://redis.io/commands/hexpire
|
|
3814
|
+
*/
|
|
3815
|
+
hexpire: (key: string, fields: string | number | (string | number)[], seconds: number, option?: ExpireOption | undefined) => Promise<(0 | 1 | 2 | -2)[]>;
|
|
3816
|
+
/**
|
|
3817
|
+
* @see https://redis.io/commands/hexpireat
|
|
3818
|
+
*/
|
|
3819
|
+
hexpireat: (key: string, fields: string | number | (string | number)[], timestamp: number, option?: ExpireOption | undefined) => Promise<(0 | 1 | 2 | -2)[]>;
|
|
3820
|
+
/**
|
|
3821
|
+
* @see https://redis.io/commands/hexpiretime
|
|
3822
|
+
*/
|
|
3823
|
+
hexpiretime: (key: string, fields: string | number | (string | number)[]) => Promise<number[]>;
|
|
3824
|
+
/**
|
|
3825
|
+
* @see https://redis.io/commands/httl
|
|
3826
|
+
*/
|
|
3827
|
+
httl: (key: string, fields: string | number | (string | number)[]) => Promise<number[]>;
|
|
3828
|
+
/**
|
|
3829
|
+
* @see https://redis.io/commands/hpexpire
|
|
3830
|
+
*/
|
|
3831
|
+
hpexpire: (key: string, fields: string | number | (string | number)[], milliseconds: number, option?: ExpireOption | undefined) => Promise<(0 | 1 | 2 | -2)[]>;
|
|
3832
|
+
/**
|
|
3833
|
+
* @see https://redis.io/commands/hpexpireat
|
|
3834
|
+
*/
|
|
3835
|
+
hpexpireat: (key: string, fields: string | number | (string | number)[], timestamp: number, option?: ExpireOption | undefined) => Promise<(0 | 1 | 2 | -2)[]>;
|
|
3836
|
+
/**
|
|
3837
|
+
* @see https://redis.io/commands/hpexpiretime
|
|
3838
|
+
*/
|
|
3839
|
+
hpexpiretime: (key: string, fields: string | number | (string | number)[]) => Promise<number[]>;
|
|
3840
|
+
/**
|
|
3841
|
+
* @see https://redis.io/commands/hpttl
|
|
3842
|
+
*/
|
|
3843
|
+
hpttl: (key: string, fields: string | number | (string | number)[]) => Promise<number[]>;
|
|
3844
|
+
/**
|
|
3845
|
+
* @see https://redis.io/commands/hpersist
|
|
3846
|
+
*/
|
|
3847
|
+
hpersist: (key: string, fields: string | number | (string | number)[]) => Promise<(1 | -2 | -1)[]>;
|
|
3848
|
+
/**
|
|
3849
|
+
* @see https://redis.io/commands/hget
|
|
3850
|
+
*/
|
|
3851
|
+
hget: <TData>(key: string, field: string) => Promise<TData | null>;
|
|
3852
|
+
/**
|
|
3853
|
+
* @see https://redis.io/commands/hgetall
|
|
3854
|
+
*/
|
|
3855
|
+
hgetall: <TData extends Record<string, unknown>>(key: string) => Promise<TData | null>;
|
|
3856
|
+
/**
|
|
3857
|
+
* @see https://redis.io/commands/hgetdel
|
|
3858
|
+
*/
|
|
3859
|
+
hgetdel: <TData extends Record<string, unknown>>(key: string, ...fields: (string | number)[]) => Promise<TData | null>;
|
|
3860
|
+
/**
|
|
3861
|
+
* @see https://redis.io/commands/hgetex
|
|
3862
|
+
*/
|
|
3863
|
+
hgetex: <TData extends Record<string, unknown>>(key: string, opts: {
|
|
3864
|
+
ex: number;
|
|
3865
|
+
px?: never;
|
|
3866
|
+
exat?: never;
|
|
3867
|
+
pxat?: never;
|
|
3868
|
+
persist?: never;
|
|
3869
|
+
} | {
|
|
3870
|
+
ex?: never;
|
|
3871
|
+
px: number;
|
|
3872
|
+
exat?: never;
|
|
3873
|
+
pxat?: never;
|
|
3874
|
+
persist?: never;
|
|
3875
|
+
} | {
|
|
3876
|
+
ex?: never;
|
|
3877
|
+
px?: never;
|
|
3878
|
+
exat: number;
|
|
3879
|
+
pxat?: never;
|
|
3880
|
+
persist?: never;
|
|
3881
|
+
} | {
|
|
3882
|
+
ex?: never;
|
|
3883
|
+
px?: never;
|
|
3884
|
+
exat?: never;
|
|
3885
|
+
pxat: number;
|
|
3886
|
+
persist?: never;
|
|
3887
|
+
} | {
|
|
3888
|
+
ex?: never;
|
|
3889
|
+
px?: never;
|
|
3890
|
+
exat?: never;
|
|
3891
|
+
pxat?: never;
|
|
3892
|
+
persist: true;
|
|
3893
|
+
}, ...fields: (string | number)[]) => Promise<TData | null>;
|
|
3894
|
+
/**
|
|
3895
|
+
* @see https://redis.io/commands/hincrby
|
|
3896
|
+
*/
|
|
3897
|
+
hincrby: (key: string, field: string, increment: number) => Promise<number>;
|
|
3898
|
+
/**
|
|
3899
|
+
* @see https://redis.io/commands/hincrbyfloat
|
|
3900
|
+
*/
|
|
3901
|
+
hincrbyfloat: (key: string, field: string, increment: number) => Promise<number>;
|
|
3902
|
+
/**
|
|
3903
|
+
* @see https://redis.io/commands/hkeys
|
|
3904
|
+
*/
|
|
3905
|
+
hkeys: (key: string) => Promise<string[]>;
|
|
3906
|
+
/**
|
|
3907
|
+
* @see https://redis.io/commands/hlen
|
|
3908
|
+
*/
|
|
3909
|
+
hlen: (key: string) => Promise<number>;
|
|
3910
|
+
/**
|
|
3911
|
+
* @see https://redis.io/commands/hmget
|
|
3912
|
+
*/
|
|
3913
|
+
hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Promise<TData | null>;
|
|
3914
|
+
/**
|
|
3915
|
+
* @see https://redis.io/commands/hmset
|
|
3916
|
+
*/
|
|
3917
|
+
hmset: <TData>(key: string, kv: Record<string, TData>) => Promise<"OK">;
|
|
3918
|
+
/**
|
|
3919
|
+
* @see https://redis.io/commands/hrandfield
|
|
3920
|
+
*/
|
|
3921
|
+
hrandfield: {
|
|
3922
|
+
(key: string): Promise<string | null>;
|
|
3923
|
+
(key: string, count: number): Promise<string[]>;
|
|
3924
|
+
<TData extends Record<string, unknown>>(key: string, count: number, withValues: boolean): Promise<Partial<TData>>;
|
|
3925
|
+
};
|
|
3926
|
+
/**
|
|
3927
|
+
* @see https://redis.io/commands/hscan
|
|
3928
|
+
*/
|
|
3929
|
+
hscan: (key: string, cursor: string | number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
|
|
3930
|
+
/**
|
|
3931
|
+
* @see https://redis.io/commands/hset
|
|
3932
|
+
*/
|
|
3933
|
+
hset: <TData>(key: string, kv: Record<string, TData>) => Promise<number>;
|
|
3934
|
+
/**
|
|
3935
|
+
* @see https://redis.io/commands/hsetex
|
|
3936
|
+
*/
|
|
3937
|
+
hsetex: <TData>(key: string, opts: {
|
|
3938
|
+
conditional?: "FNX" | "fnx" | "FXX" | "fxx";
|
|
3939
|
+
expiration?: {
|
|
3940
|
+
ex: number;
|
|
3941
|
+
px?: never;
|
|
3942
|
+
exat?: never;
|
|
3943
|
+
pxat?: never;
|
|
3944
|
+
keepttl?: never;
|
|
3945
|
+
} | {
|
|
3946
|
+
ex?: never;
|
|
3947
|
+
px: number;
|
|
3948
|
+
exat?: never;
|
|
3949
|
+
pxat?: never;
|
|
3950
|
+
keepttl?: never;
|
|
3951
|
+
} | {
|
|
3952
|
+
ex?: never;
|
|
3953
|
+
px?: never;
|
|
3954
|
+
exat: number;
|
|
3955
|
+
pxat?: never;
|
|
3956
|
+
keepttl?: never;
|
|
3957
|
+
} | {
|
|
3958
|
+
ex?: never;
|
|
3959
|
+
px?: never;
|
|
3960
|
+
exat?: never;
|
|
3961
|
+
pxat: number;
|
|
3962
|
+
keepttl?: never;
|
|
3963
|
+
} | {
|
|
3964
|
+
ex?: never;
|
|
3965
|
+
px?: never;
|
|
3966
|
+
exat?: never;
|
|
3967
|
+
pxat?: never;
|
|
3968
|
+
keepttl: true;
|
|
3969
|
+
} | {
|
|
3970
|
+
ex?: never;
|
|
3971
|
+
px?: never;
|
|
3972
|
+
exat?: never;
|
|
3973
|
+
pxat?: never;
|
|
3974
|
+
keepttl?: never;
|
|
3975
|
+
};
|
|
3976
|
+
}, kv: Record<string, TData>) => Promise<number>;
|
|
3977
|
+
/**
|
|
3978
|
+
* @see https://redis.io/commands/hsetnx
|
|
3979
|
+
*/
|
|
3980
|
+
hsetnx: <TData>(key: string, field: string, value: TData) => Promise<0 | 1>;
|
|
3981
|
+
/**
|
|
3982
|
+
* @see https://redis.io/commands/hstrlen
|
|
3983
|
+
*/
|
|
3984
|
+
hstrlen: (key: string, field: string) => Promise<number>;
|
|
3985
|
+
/**
|
|
3986
|
+
* @see https://redis.io/commands/hvals
|
|
3987
|
+
*/
|
|
3988
|
+
hvals: (key: string) => Promise<any>;
|
|
3989
|
+
/**
|
|
3990
|
+
* @see https://redis.io/commands/incr
|
|
3991
|
+
*/
|
|
3992
|
+
incr: (key: string) => Promise<number>;
|
|
3993
|
+
/**
|
|
3994
|
+
* @see https://redis.io/commands/incrby
|
|
3995
|
+
*/
|
|
3996
|
+
incrby: (key: string, value: number) => Promise<number>;
|
|
3997
|
+
/**
|
|
3998
|
+
* @see https://redis.io/commands/incrbyfloat
|
|
3999
|
+
*/
|
|
4000
|
+
incrbyfloat: (key: string, value: number) => Promise<number>;
|
|
4001
|
+
/**
|
|
4002
|
+
* @see https://redis.io/commands/keys
|
|
4003
|
+
*/
|
|
4004
|
+
keys: (pattern: string) => Promise<string[]>;
|
|
4005
|
+
/**
|
|
4006
|
+
* @see https://redis.io/commands/lindex
|
|
4007
|
+
*/
|
|
4008
|
+
lindex: (key: string, index: number) => Promise<any>;
|
|
4009
|
+
/**
|
|
4010
|
+
* @see https://redis.io/commands/linsert
|
|
4011
|
+
*/
|
|
4012
|
+
linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Promise<number>;
|
|
4013
|
+
/**
|
|
4014
|
+
* @see https://redis.io/commands/llen
|
|
4015
|
+
*/
|
|
4016
|
+
llen: (key: string) => Promise<number>;
|
|
4017
|
+
/**
|
|
4018
|
+
* @see https://redis.io/commands/lmove
|
|
4019
|
+
*/
|
|
4020
|
+
lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Promise<TData>;
|
|
4021
|
+
/**
|
|
4022
|
+
* @see https://redis.io/commands/lpop
|
|
4023
|
+
*/
|
|
4024
|
+
lpop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
|
|
4025
|
+
/**
|
|
4026
|
+
* @see https://redis.io/commands/lmpop
|
|
4027
|
+
*/
|
|
4028
|
+
lmpop: <TData>(numkeys: number, keys: string[], args_2: "LEFT" | "RIGHT", count?: number | undefined) => Promise<[string, TData[]] | null>;
|
|
4029
|
+
/**
|
|
4030
|
+
* @see https://redis.io/commands/lpos
|
|
4031
|
+
*/
|
|
4032
|
+
lpos: <TData = number>(key: string, element: unknown, opts?: {
|
|
4033
|
+
rank?: number;
|
|
4034
|
+
count?: number;
|
|
4035
|
+
maxLen?: number;
|
|
4036
|
+
} | undefined) => Promise<TData>;
|
|
4037
|
+
/**
|
|
4038
|
+
* @see https://redis.io/commands/lpush
|
|
4039
|
+
*/
|
|
4040
|
+
lpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
|
|
4041
|
+
/**
|
|
4042
|
+
* @see https://redis.io/commands/lpushx
|
|
4043
|
+
*/
|
|
4044
|
+
lpushx: <TData>(key: string, ...elements: TData[]) => Promise<number>;
|
|
4045
|
+
/**
|
|
4046
|
+
* @see https://redis.io/commands/lrange
|
|
4047
|
+
*/
|
|
4048
|
+
lrange: <TResult = string>(key: string, start: number, end: number) => Promise<TResult[]>;
|
|
4049
|
+
/**
|
|
4050
|
+
* @see https://redis.io/commands/lrem
|
|
4051
|
+
*/
|
|
4052
|
+
lrem: <TData>(key: string, count: number, value: TData) => Promise<number>;
|
|
4053
|
+
/**
|
|
4054
|
+
* @see https://redis.io/commands/lset
|
|
4055
|
+
*/
|
|
4056
|
+
lset: <TData>(key: string, index: number, value: TData) => Promise<"OK">;
|
|
4057
|
+
/**
|
|
4058
|
+
* @see https://redis.io/commands/ltrim
|
|
4059
|
+
*/
|
|
4060
|
+
ltrim: (key: string, start: number, end: number) => Promise<"OK">;
|
|
4061
|
+
/**
|
|
4062
|
+
* @see https://redis.io/commands/mget
|
|
4063
|
+
*/
|
|
4064
|
+
mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Promise<TData>;
|
|
4065
|
+
/**
|
|
4066
|
+
* @see https://redis.io/commands/mset
|
|
4067
|
+
*/
|
|
4068
|
+
mset: <TData>(kv: Record<string, TData>) => Promise<"OK">;
|
|
4069
|
+
/**
|
|
4070
|
+
* @see https://redis.io/commands/msetnx
|
|
4071
|
+
*/
|
|
4072
|
+
msetnx: <TData>(kv: Record<string, TData>) => Promise<number>;
|
|
4073
|
+
/**
|
|
4074
|
+
* @see https://redis.io/commands/persist
|
|
4075
|
+
*/
|
|
4076
|
+
persist: (key: string) => Promise<0 | 1>;
|
|
4077
|
+
/**
|
|
4078
|
+
* @see https://redis.io/commands/pexpire
|
|
4079
|
+
*/
|
|
4080
|
+
pexpire: (key: string, milliseconds: number, option?: ExpireOption | undefined) => Promise<0 | 1>;
|
|
4081
|
+
/**
|
|
4082
|
+
* @see https://redis.io/commands/pexpireat
|
|
4083
|
+
*/
|
|
4084
|
+
pexpireat: (key: string, unix: number, option?: ExpireOption | undefined) => Promise<0 | 1>;
|
|
4085
|
+
/**
|
|
4086
|
+
* @see https://redis.io/commands/pfadd
|
|
4087
|
+
*/
|
|
4088
|
+
pfadd: (args_0: string, ...args_1: unknown[]) => Promise<number>;
|
|
4089
|
+
/**
|
|
4090
|
+
* @see https://redis.io/commands/pfcount
|
|
4091
|
+
*/
|
|
4092
|
+
pfcount: (args_0: string, ...args_1: string[]) => Promise<number>;
|
|
4093
|
+
/**
|
|
4094
|
+
* @see https://redis.io/commands/pfmerge
|
|
4095
|
+
*/
|
|
4096
|
+
pfmerge: (destination_key: string, ...args_1: string[]) => Promise<"OK">;
|
|
4097
|
+
/**
|
|
4098
|
+
* @see https://redis.io/commands/ping
|
|
4099
|
+
*/
|
|
4100
|
+
ping: (args?: CommandArgs<typeof PingCommand>) => Promise<string>;
|
|
4101
|
+
/**
|
|
4102
|
+
* @see https://redis.io/commands/psetex
|
|
4103
|
+
*/
|
|
4104
|
+
psetex: <TData>(key: string, ttl: number, value: TData) => Promise<string>;
|
|
4105
|
+
/**
|
|
4106
|
+
* @see https://redis.io/commands/psubscribe
|
|
4107
|
+
*/
|
|
4108
|
+
psubscribe: <TMessage>(patterns: string | string[]) => Subscriber<TMessage>;
|
|
4109
|
+
/**
|
|
4110
|
+
* @see https://redis.io/commands/pttl
|
|
4111
|
+
*/
|
|
4112
|
+
pttl: (key: string) => Promise<number>;
|
|
4113
|
+
/**
|
|
4114
|
+
* @see https://redis.io/commands/publish
|
|
4115
|
+
*/
|
|
4116
|
+
publish: (channel: string, message: unknown) => Promise<number>;
|
|
4117
|
+
/**
|
|
4118
|
+
* @see https://redis.io/commands/randomkey
|
|
4119
|
+
*/
|
|
4120
|
+
randomkey: () => Promise<string | null>;
|
|
4121
|
+
/**
|
|
4122
|
+
* @see https://redis.io/commands/rename
|
|
4123
|
+
*/
|
|
4124
|
+
rename: (source: string, destination: string) => Promise<"OK">;
|
|
4125
|
+
/**
|
|
4126
|
+
* @see https://redis.io/commands/renamenx
|
|
4127
|
+
*/
|
|
4128
|
+
renamenx: (source: string, destination: string) => Promise<0 | 1>;
|
|
4129
|
+
/**
|
|
4130
|
+
* @see https://redis.io/commands/rpop
|
|
4131
|
+
*/
|
|
4132
|
+
rpop: <TData = string>(key: string, count?: number | undefined) => Promise<TData | null>;
|
|
4133
|
+
/**
|
|
4134
|
+
* @see https://redis.io/commands/rpush
|
|
4135
|
+
*/
|
|
4136
|
+
rpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
|
|
4137
|
+
/**
|
|
4138
|
+
* @see https://redis.io/commands/rpushx
|
|
4139
|
+
*/
|
|
4140
|
+
rpushx: <TData>(key: string, ...elements: TData[]) => Promise<number>;
|
|
4141
|
+
/**
|
|
4142
|
+
* @see https://redis.io/commands/sadd
|
|
4143
|
+
*/
|
|
4144
|
+
sadd: <TData>(key: string, member: TData, ...members: TData[]) => Promise<number>;
|
|
4145
|
+
/**
|
|
4146
|
+
* @see https://redis.io/commands/scan
|
|
4147
|
+
*/
|
|
4148
|
+
scan(cursor: string | number): Promise<ScanResultStandard>;
|
|
4149
|
+
scan<TOptions extends ScanCommandOptions>(cursor: string | number, opts: TOptions): Promise<TOptions extends {
|
|
4150
|
+
withType: true;
|
|
4151
|
+
} ? ScanResultWithType : ScanResultStandard>;
|
|
4152
|
+
/**
|
|
4153
|
+
* @see https://redis.io/commands/scard
|
|
4154
|
+
*/
|
|
4155
|
+
scard: (key: string) => Promise<number>;
|
|
4156
|
+
/**
|
|
4157
|
+
* @see https://redis.io/commands/script-exists
|
|
4158
|
+
*/
|
|
4159
|
+
scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Promise<number[]>;
|
|
4160
|
+
/**
|
|
4161
|
+
* @see https://redis.io/commands/script-flush
|
|
4162
|
+
*/
|
|
4163
|
+
scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Promise<"OK">;
|
|
4164
|
+
/**
|
|
4165
|
+
* @see https://redis.io/commands/script-load
|
|
4166
|
+
*/
|
|
4167
|
+
scriptLoad: (script: string) => Promise<string>;
|
|
4168
|
+
/**
|
|
4169
|
+
* @see https://redis.io/commands/sdiff
|
|
4170
|
+
*/
|
|
4171
|
+
sdiff: (key: string, ...keys: string[]) => Promise<unknown[]>;
|
|
4172
|
+
/**
|
|
4173
|
+
* @see https://redis.io/commands/sdiffstore
|
|
4174
|
+
*/
|
|
4175
|
+
sdiffstore: (destination: string, ...keys: string[]) => Promise<number>;
|
|
4176
|
+
/**
|
|
4177
|
+
* @see https://redis.io/commands/set
|
|
4178
|
+
*/
|
|
4179
|
+
set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Promise<"OK" | TData | null>;
|
|
4180
|
+
/**
|
|
4181
|
+
* @see https://redis.io/commands/setbit
|
|
4182
|
+
*/
|
|
4183
|
+
setbit: (key: string, offset: number, value: 0 | 1) => Promise<0 | 1>;
|
|
4184
|
+
/**
|
|
4185
|
+
* @see https://redis.io/commands/setex
|
|
4186
|
+
*/
|
|
4187
|
+
setex: <TData>(key: string, ttl: number, value: TData) => Promise<"OK">;
|
|
4188
|
+
/**
|
|
4189
|
+
* @see https://redis.io/commands/setnx
|
|
4190
|
+
*/
|
|
4191
|
+
setnx: <TData>(key: string, value: TData) => Promise<number>;
|
|
4192
|
+
/**
|
|
4193
|
+
* @see https://redis.io/commands/setrange
|
|
4194
|
+
*/
|
|
4195
|
+
setrange: (key: string, offset: number, value: string) => Promise<number>;
|
|
4196
|
+
/**
|
|
4197
|
+
* @see https://redis.io/commands/sinter
|
|
4198
|
+
*/
|
|
4199
|
+
sinter: (key: string, ...keys: string[]) => Promise<string[]>;
|
|
4200
|
+
/**
|
|
4201
|
+
* @see https://redis.io/commands/sinterstore
|
|
4202
|
+
*/
|
|
4203
|
+
sinterstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
|
|
4204
|
+
/**
|
|
4205
|
+
* @see https://redis.io/commands/sismember
|
|
4206
|
+
*/
|
|
4207
|
+
sismember: <TData>(key: string, member: TData) => Promise<0 | 1>;
|
|
4208
|
+
/**
|
|
4209
|
+
* @see https://redis.io/commands/smismember
|
|
4210
|
+
*/
|
|
4211
|
+
smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Promise<(0 | 1)[]>;
|
|
4212
|
+
/**
|
|
4213
|
+
* @see https://redis.io/commands/smembers
|
|
4214
|
+
*/
|
|
4215
|
+
smembers: <TData extends unknown[] = string[]>(key: string) => Promise<TData>;
|
|
4216
|
+
/**
|
|
4217
|
+
* @see https://redis.io/commands/smove
|
|
4218
|
+
*/
|
|
4219
|
+
smove: <TData>(source: string, destination: string, member: TData) => Promise<0 | 1>;
|
|
4220
|
+
/**
|
|
4221
|
+
* @see https://redis.io/commands/spop
|
|
4222
|
+
*/
|
|
4223
|
+
spop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
|
|
4224
|
+
/**
|
|
4225
|
+
* @see https://redis.io/commands/srandmember
|
|
4226
|
+
*/
|
|
4227
|
+
srandmember: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
|
|
4228
|
+
/**
|
|
4229
|
+
* @see https://redis.io/commands/srem
|
|
4230
|
+
*/
|
|
4231
|
+
srem: <TData>(key: string, ...members: TData[]) => Promise<number>;
|
|
4232
|
+
/**
|
|
4233
|
+
* @see https://redis.io/commands/sscan
|
|
4234
|
+
*/
|
|
4235
|
+
sscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
|
|
4236
|
+
/**
|
|
4237
|
+
* @see https://redis.io/commands/strlen
|
|
4238
|
+
*/
|
|
4239
|
+
strlen: (key: string) => Promise<number>;
|
|
4240
|
+
/**
|
|
4241
|
+
* @see https://redis.io/commands/subscribe
|
|
4242
|
+
*/
|
|
4243
|
+
subscribe: <TMessage>(channels: string | string[]) => Subscriber<TMessage>;
|
|
4244
|
+
/**
|
|
4245
|
+
* @see https://redis.io/commands/sunion
|
|
4246
|
+
*/
|
|
4247
|
+
sunion: (key: string, ...keys: string[]) => Promise<unknown[]>;
|
|
4248
|
+
/**
|
|
4249
|
+
* @see https://redis.io/commands/sunionstore
|
|
4250
|
+
*/
|
|
4251
|
+
sunionstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
|
|
4252
|
+
/**
|
|
4253
|
+
* @see https://redis.io/commands/time
|
|
4254
|
+
*/
|
|
4255
|
+
time: () => Promise<[number, number]>;
|
|
4256
|
+
/**
|
|
4257
|
+
* @see https://redis.io/commands/touch
|
|
4258
|
+
*/
|
|
4259
|
+
touch: (...args: CommandArgs<typeof TouchCommand>) => Promise<number>;
|
|
4260
|
+
/**
|
|
4261
|
+
* @see https://redis.io/commands/ttl
|
|
4262
|
+
*/
|
|
4263
|
+
ttl: (key: string) => Promise<number>;
|
|
4264
|
+
/**
|
|
4265
|
+
* @see https://redis.io/commands/type
|
|
4266
|
+
*/
|
|
4267
|
+
type: (key: string) => Promise<Type>;
|
|
4268
|
+
/**
|
|
4269
|
+
* @see https://redis.io/commands/unlink
|
|
4270
|
+
*/
|
|
4271
|
+
unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Promise<number>;
|
|
4272
|
+
/**
|
|
4273
|
+
* @see https://redis.io/commands/xadd
|
|
4274
|
+
*/
|
|
4275
|
+
xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
|
|
4276
|
+
nomkStream?: boolean;
|
|
4277
|
+
trim?: ({
|
|
4278
|
+
type: "MAXLEN" | "maxlen";
|
|
4279
|
+
threshold: number;
|
|
4280
|
+
} | {
|
|
4281
|
+
type: "MINID" | "minid";
|
|
4282
|
+
threshold: string;
|
|
4283
|
+
}) & ({
|
|
4284
|
+
comparison: "~";
|
|
4285
|
+
limit?: number;
|
|
4286
|
+
} | {
|
|
4287
|
+
comparison: "=";
|
|
4288
|
+
limit?: never;
|
|
4289
|
+
});
|
|
4290
|
+
} | undefined) => Promise<string>;
|
|
4291
|
+
/**
|
|
4292
|
+
* @see https://redis.io/commands/xack
|
|
4293
|
+
*/
|
|
4294
|
+
xack: (key: string, group: string, id: string | string[]) => Promise<number>;
|
|
4295
|
+
/**
|
|
4296
|
+
* @see https://redis.io/commands/xackdel
|
|
4297
|
+
*/
|
|
4298
|
+
xackdel: (key: string, group: string, opts: "KEEPREF" | "keepref" | "DELREF" | "delref" | "ACKED" | "acked", ...ids: string[]) => Promise<number[]>;
|
|
4299
|
+
/**
|
|
4300
|
+
* @see https://redis.io/commands/xdel
|
|
4301
|
+
*/
|
|
4302
|
+
xdel: (key: string, ids: string | string[]) => Promise<number>;
|
|
4303
|
+
/**
|
|
4304
|
+
* @see https://redis.io/commands/xdelex
|
|
4305
|
+
*/
|
|
4306
|
+
xdelex: (key: string, opts?: ("KEEPREF" | "keepref" | "DELREF" | "delref" | "ACKED" | "acked") | undefined, ...ids: string[]) => Promise<number[]>;
|
|
4307
|
+
/**
|
|
4308
|
+
* @see https://redis.io/commands/xgroup
|
|
4309
|
+
*/
|
|
4310
|
+
xgroup: (key: string, opts: {
|
|
4311
|
+
type: "CREATE";
|
|
4312
|
+
group: string;
|
|
4313
|
+
id: `$` | string;
|
|
4314
|
+
options?: {
|
|
4315
|
+
MKSTREAM?: boolean;
|
|
4316
|
+
ENTRIESREAD?: number;
|
|
4317
|
+
};
|
|
4318
|
+
} | {
|
|
4319
|
+
type: "CREATECONSUMER";
|
|
4320
|
+
group: string;
|
|
4321
|
+
consumer: string;
|
|
4322
|
+
} | {
|
|
4323
|
+
type: "DELCONSUMER";
|
|
4324
|
+
group: string;
|
|
4325
|
+
consumer: string;
|
|
4326
|
+
} | {
|
|
4327
|
+
type: "DESTROY";
|
|
4328
|
+
group: string;
|
|
4329
|
+
} | {
|
|
4330
|
+
type: "SETID";
|
|
4331
|
+
group: string;
|
|
4332
|
+
id: `$` | string;
|
|
4333
|
+
options?: {
|
|
4334
|
+
ENTRIESREAD?: number;
|
|
4335
|
+
};
|
|
4336
|
+
}) => Promise<never>;
|
|
4337
|
+
/**
|
|
4338
|
+
* @see https://redis.io/commands/xread
|
|
4339
|
+
*/
|
|
4340
|
+
xread: (...args: CommandArgs<typeof XReadCommand>) => Promise<unknown[]>;
|
|
4341
|
+
/**
|
|
4342
|
+
* @see https://redis.io/commands/xreadgroup
|
|
4343
|
+
*/
|
|
4344
|
+
xreadgroup: (...args: CommandArgs<typeof XReadGroupCommand>) => Promise<unknown[]>;
|
|
4345
|
+
/**
|
|
4346
|
+
* @see https://redis.io/commands/xinfo
|
|
4347
|
+
*/
|
|
4348
|
+
xinfo: (key: string, options: {
|
|
4349
|
+
type: "CONSUMERS";
|
|
4350
|
+
group: string;
|
|
4351
|
+
} | {
|
|
4352
|
+
type: "GROUPS";
|
|
4353
|
+
}) => Promise<unknown[]>;
|
|
4354
|
+
/**
|
|
4355
|
+
* @see https://redis.io/commands/xlen
|
|
4356
|
+
*/
|
|
4357
|
+
xlen: (key: string) => Promise<number>;
|
|
4358
|
+
/**
|
|
4359
|
+
* @see https://redis.io/commands/xpending
|
|
4360
|
+
*/
|
|
4361
|
+
xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
|
|
4362
|
+
idleTime?: number;
|
|
4363
|
+
consumer?: string | string[];
|
|
4364
|
+
} | undefined) => Promise<unknown[]>;
|
|
4365
|
+
/**
|
|
4366
|
+
* @see https://redis.io/commands/xclaim
|
|
4367
|
+
*/
|
|
4368
|
+
xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
|
|
4369
|
+
idleMS?: number;
|
|
4370
|
+
timeMS?: number;
|
|
4371
|
+
retryCount?: number;
|
|
4372
|
+
force?: boolean;
|
|
4373
|
+
justId?: boolean;
|
|
4374
|
+
lastId?: number;
|
|
4375
|
+
} | undefined) => Promise<unknown[]>;
|
|
4376
|
+
/**
|
|
4377
|
+
* @see https://redis.io/commands/xautoclaim
|
|
4378
|
+
*/
|
|
4379
|
+
xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
|
|
4380
|
+
count?: number;
|
|
4381
|
+
justId?: boolean;
|
|
4382
|
+
} | undefined) => Promise<unknown[]>;
|
|
4383
|
+
/**
|
|
4384
|
+
* @see https://redis.io/commands/xtrim
|
|
4385
|
+
*/
|
|
4386
|
+
xtrim: (key: string, options: {
|
|
4387
|
+
strategy: "MAXLEN" | "MINID";
|
|
4388
|
+
exactness?: "~" | "=";
|
|
4389
|
+
threshold: number | string;
|
|
4390
|
+
limit?: number;
|
|
4391
|
+
}) => Promise<number>;
|
|
4392
|
+
/**
|
|
4393
|
+
* @see https://redis.io/commands/xrange
|
|
4394
|
+
*/
|
|
4395
|
+
xrange: (key: string, start: string, end: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
|
|
4396
|
+
/**
|
|
4397
|
+
* @see https://redis.io/commands/xrevrange
|
|
4398
|
+
*/
|
|
4399
|
+
xrevrange: (key: string, end: string, start: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
|
|
4400
|
+
/**
|
|
4401
|
+
* @see https://redis.io/commands/zadd
|
|
4402
|
+
*/
|
|
4403
|
+
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]]) => Promise<number | null>;
|
|
4404
|
+
/**
|
|
4405
|
+
* @see https://redis.io/commands/zcard
|
|
4406
|
+
*/
|
|
4407
|
+
zcard: (key: string) => Promise<number>;
|
|
4408
|
+
/**
|
|
4409
|
+
* @see https://redis.io/commands/zcount
|
|
4410
|
+
*/
|
|
4411
|
+
zcount: (key: string, min: string | number, max: string | number) => Promise<number>;
|
|
4412
|
+
/**
|
|
4413
|
+
* @see https://redis.io/commands/zdiffstore
|
|
4414
|
+
*/
|
|
4415
|
+
zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Promise<number>;
|
|
4416
|
+
/**
|
|
4417
|
+
* @see https://redis.io/commands/zincrby
|
|
4418
|
+
*/
|
|
4419
|
+
zincrby: <TData>(key: string, increment: number, member: TData) => Promise<number>;
|
|
4420
|
+
/**
|
|
4421
|
+
* @see https://redis.io/commands/zinterstore
|
|
4422
|
+
*/
|
|
4423
|
+
zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Promise<number>;
|
|
4424
|
+
/**
|
|
4425
|
+
* @see https://redis.io/commands/zlexcount
|
|
4426
|
+
*/
|
|
4427
|
+
zlexcount: (key: string, min: string, max: string) => Promise<number>;
|
|
4428
|
+
/**
|
|
4429
|
+
* @see https://redis.io/commands/zmscore
|
|
4430
|
+
*/
|
|
4431
|
+
zmscore: (key: string, members: unknown[]) => Promise<number[] | null>;
|
|
4432
|
+
/**
|
|
4433
|
+
* @see https://redis.io/commands/zpopmax
|
|
4434
|
+
*/
|
|
4435
|
+
zpopmax: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
|
|
4436
|
+
/**
|
|
4437
|
+
* @see https://redis.io/commands/zpopmin
|
|
4438
|
+
*/
|
|
4439
|
+
zpopmin: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
|
|
4440
|
+
/**
|
|
4441
|
+
* @see https://redis.io/commands/zrange
|
|
4442
|
+
*/
|
|
4443
|
+
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
|
|
4444
|
+
byLex: true;
|
|
4445
|
+
} & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
|
|
4446
|
+
byScore: true;
|
|
4447
|
+
} & ZRangeCommandOptions]) => Promise<TData>;
|
|
4448
|
+
/**
|
|
4449
|
+
* @see https://redis.io/commands/zrank
|
|
4450
|
+
*/
|
|
4451
|
+
zrank: <TData>(key: string, member: TData) => Promise<number | null>;
|
|
4452
|
+
/**
|
|
4453
|
+
* @see https://redis.io/commands/zrem
|
|
4454
|
+
*/
|
|
4455
|
+
zrem: <TData>(key: string, ...members: TData[]) => Promise<number>;
|
|
4456
|
+
/**
|
|
4457
|
+
* @see https://redis.io/commands/zremrangebylex
|
|
4458
|
+
*/
|
|
4459
|
+
zremrangebylex: (key: string, min: string, max: string) => Promise<number>;
|
|
4460
|
+
/**
|
|
4461
|
+
* @see https://redis.io/commands/zremrangebyrank
|
|
4462
|
+
*/
|
|
4463
|
+
zremrangebyrank: (key: string, start: number, stop: number) => Promise<number>;
|
|
4464
|
+
/**
|
|
4465
|
+
* @see https://redis.io/commands/zremrangebyscore
|
|
4466
|
+
*/
|
|
4467
|
+
zremrangebyscore: (key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf") => Promise<number>;
|
|
4468
|
+
/**
|
|
4469
|
+
* @see https://redis.io/commands/zrevrank
|
|
4470
|
+
*/
|
|
4471
|
+
zrevrank: <TData>(key: string, member: TData) => Promise<number | null>;
|
|
4472
|
+
/**
|
|
4473
|
+
* @see https://redis.io/commands/zscan
|
|
4474
|
+
*/
|
|
4475
|
+
zscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
|
|
4476
|
+
/**
|
|
4477
|
+
* @see https://redis.io/commands/zscore
|
|
4478
|
+
*/
|
|
4479
|
+
zscore: <TData>(key: string, member: TData) => Promise<number | null>;
|
|
4480
|
+
/**
|
|
4481
|
+
* @see https://redis.io/commands/zunion
|
|
4482
|
+
*/
|
|
4483
|
+
zunion: (numKeys: number, keys: string[], opts?: ZUnionCommandOptions | undefined) => Promise<any>;
|
|
4484
|
+
/**
|
|
4485
|
+
* @see https://redis.io/commands/zunionstore
|
|
4486
|
+
*/
|
|
4487
|
+
zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
|
|
4488
|
+
}
|
|
4489
|
+
|
|
4490
|
+
type UpstashErrorOptions = Pick<NonNullable<ConstructorParameters<typeof Error>[1]>, "cause">;
|
|
4491
|
+
/**
|
|
4492
|
+
* Result of a bad request to upstash
|
|
4493
|
+
*/
|
|
4494
|
+
declare class UpstashError extends Error {
|
|
4495
|
+
constructor(message: string, options?: ErrorOptions);
|
|
4496
|
+
}
|
|
4497
|
+
declare class UrlError extends Error {
|
|
4498
|
+
constructor(url: string);
|
|
4499
|
+
}
|
|
4500
|
+
declare class UpstashJSONParseError extends UpstashError {
|
|
4501
|
+
constructor(body: string, options?: UpstashErrorOptions);
|
|
4502
|
+
}
|
|
4503
|
+
|
|
4504
|
+
type error_UpstashError = UpstashError;
|
|
4505
|
+
declare const error_UpstashError: typeof UpstashError;
|
|
4506
|
+
type error_UpstashJSONParseError = UpstashJSONParseError;
|
|
4507
|
+
declare const error_UpstashJSONParseError: typeof UpstashJSONParseError;
|
|
4508
|
+
type error_UrlError = UrlError;
|
|
4509
|
+
declare const error_UrlError: typeof UrlError;
|
|
4510
|
+
declare namespace error {
|
|
4511
|
+
export { error_UpstashError as UpstashError, error_UpstashJSONParseError as UpstashJSONParseError, error_UrlError as UrlError };
|
|
4512
|
+
}
|
|
4513
|
+
|
|
4514
|
+
/**
|
|
4515
|
+
* @see https://redis.io/commands/zdiffstore
|
|
4516
|
+
*/
|
|
4517
|
+
declare class ZDiffStoreCommand extends Command<number, number> {
|
|
4518
|
+
constructor(cmd: [destination: string, numkeys: number, ...keys: string[]], opts?: CommandOptions<number, number>);
|
|
4519
|
+
}
|
|
4520
|
+
|
|
4521
|
+
/**
|
|
4522
|
+
* @see https://redis.io/commands/zmscore
|
|
4523
|
+
*/
|
|
4524
|
+
declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] | null> {
|
|
4525
|
+
constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
|
|
4526
|
+
}
|
|
4527
|
+
|
|
4528
|
+
export { HPExpireTimeCommand as $, AppendCommand as A, BitCountCommand as B, ClientSetInfoCommand as C, DBSizeCommand as D, EchoCommand as E, FlushAllCommand as F, GeoAddCommand as G, type HttpClientConfig as H, GeoSearchCommand as I, GeoSearchStoreCommand as J, GetCommand as K, GetBitCommand as L, GetDelCommand as M, GetExCommand as N, GetRangeCommand as O, Pipeline as P, GetSetCommand as Q, type RedisOptions as R, HDelCommand as S, HExistsCommand as T, type UpstashRequest as U, HExpireCommand as V, HExpireAtCommand as W, HExpireTimeCommand as X, HTtlCommand as Y, HPExpireCommand as Z, HPExpireAtCommand as _, type RequesterConfig as a, PSetEXCommand as a$, HPTtlCommand as a0, HPersistCommand as a1, HGetCommand as a2, HGetAllCommand as a3, HGetDelCommand as a4, HGetExCommand as a5, HIncrByCommand as a6, HIncrByFloatCommand as a7, HKeysCommand as a8, HLenCommand as a9, JsonObjKeysCommand as aA, JsonObjLenCommand as aB, JsonRespCommand as aC, JsonSetCommand as aD, JsonStrAppendCommand as aE, JsonStrLenCommand as aF, JsonToggleCommand as aG, JsonTypeCommand as aH, KeysCommand as aI, LIndexCommand as aJ, LInsertCommand as aK, LLenCommand as aL, LMoveCommand as aM, LPopCommand as aN, LPushCommand as aO, LPushXCommand as aP, LRangeCommand as aQ, LRemCommand as aR, LSetCommand as aS, LTrimCommand as aT, MGetCommand as aU, MSetCommand as aV, MSetNXCommand as aW, PersistCommand as aX, PExpireCommand as aY, PExpireAtCommand as aZ, PingCommand as a_, HMGetCommand as aa, HMSetCommand as ab, HRandFieldCommand as ac, HScanCommand as ad, HSetCommand as ae, HSetExCommand as af, HSetNXCommand as ag, HStrLenCommand as ah, HValsCommand as ai, IncrCommand as aj, IncrByCommand as ak, IncrByFloatCommand as al, JsonArrAppendCommand as am, JsonArrIndexCommand as an, JsonArrInsertCommand as ao, JsonArrLenCommand as ap, JsonArrPopCommand as aq, JsonArrTrimCommand as ar, JsonClearCommand as as, JsonDelCommand as at, JsonForgetCommand as au, JsonGetCommand as av, JsonMergeCommand as aw, JsonMGetCommand as ax, JsonNumIncrByCommand as ay, JsonNumMultByCommand as az, Redis as b, ZRemRangeByLexCommand as b$, PTtlCommand as b0, PublishCommand as b1, RandomKeyCommand as b2, RenameCommand as b3, RenameNXCommand as b4, RPopCommand as b5, RPushCommand as b6, RPushXCommand as b7, SAddCommand as b8, ScanCommand as b9, TimeCommand as bA, TouchCommand as bB, TtlCommand as bC, type Type as bD, TypeCommand as bE, UnlinkCommand as bF, XAddCommand as bG, XAckDelCommand as bH, XDelExCommand as bI, XRangeCommand as bJ, type ScoreMember as bK, type ZAddCommandOptions as bL, ZAddCommand as bM, ZCardCommand as bN, ZCountCommand as bO, ZDiffStoreCommand as bP, ZIncrByCommand as bQ, ZInterStoreCommand as bR, type ZInterStoreCommandOptions as bS, ZLexCountCommand as bT, ZMScoreCommand as bU, ZPopMaxCommand as bV, ZPopMinCommand as bW, ZRangeCommand as bX, type ZRangeCommandOptions as bY, ZRankCommand as bZ, ZRemCommand as b_, type ScanCommandOptions as ba, SCardCommand as bb, ScriptExistsCommand as bc, ScriptFlushCommand as bd, ScriptLoadCommand as be, SDiffCommand as bf, SDiffStoreCommand as bg, SetCommand as bh, type SetCommandOptions as bi, SetBitCommand as bj, SetExCommand as bk, SetNxCommand as bl, SetRangeCommand as bm, SInterCommand as bn, SInterStoreCommand as bo, SIsMemberCommand as bp, SMembersCommand as bq, SMIsMemberCommand as br, SMoveCommand as bs, SPopCommand as bt, SRandMemberCommand as bu, SRemCommand as bv, SScanCommand as bw, StrLenCommand as bx, SUnionCommand as by, SUnionStoreCommand as bz, type Requester as c, ZRemRangeByRankCommand as c0, ZRemRangeByScoreCommand as c1, ZRevRankCommand as c2, ZScanCommand as c3, ZScoreCommand as c4, ZUnionCommand as c5, type ZUnionCommandOptions as c6, ZUnionStoreCommand as c7, type ZUnionStoreCommandOptions as c8, type UpstashResponse as d, error as e, BitOpCommand as f, BitPosCommand as g, type ClientSetInfoAttribute as h, CopyCommand as i, DecrCommand as j, DecrByCommand as k, DelCommand as l, EvalROCommand as m, EvalCommand as n, EvalshaROCommand as o, EvalshaCommand as p, ExistsCommand as q, ExpireCommand as r, type ExpireOption as s, ExpireAtCommand as t, FlushDBCommand as u, type GeoAddCommandOptions as v, type GeoMember as w, GeoDistCommand as x, GeoHashCommand as y, GeoPosCommand as z };
|