@upstash/redis 0.0.0-ci.f79c0d6d7212dfe450359da7ed92d84d639af819-20231031072701 → 0.0.0-ci.fa1d496e56b9c6b274a4edb64a8fbcbcb5d5080b-20251205201758
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 +16 -3
- package/chunk-WTYE7OV3.mjs +4520 -0
- package/cloudflare.d.mts +15 -5
- package/cloudflare.d.ts +15 -5
- package/cloudflare.js +4622 -1
- package/cloudflare.mjs +93 -1
- package/fastly.d.mts +10 -5
- package/fastly.d.ts +10 -5
- package/fastly.js +4595 -1
- package/fastly.mjs +66 -1
- package/nodejs.d.mts +24 -23
- package/nodejs.d.ts +24 -23
- package/nodejs.js +4646 -1
- package/nodejs.mjs +117 -1
- package/package.json +1 -54
- package/{zmscore-10fd3773.d.ts → zmscore-DhpQcqpW.d.mts} +1312 -376
- package/zmscore-DhpQcqpW.d.ts +4062 -0
|
@@ -23,7 +23,10 @@ type RedisOptions = {
|
|
|
23
23
|
* @default true
|
|
24
24
|
*/
|
|
25
25
|
automaticDeserialization?: boolean;
|
|
26
|
+
latencyLogging?: boolean;
|
|
26
27
|
enableTelemetry?: boolean;
|
|
28
|
+
enableAutoPipelining?: boolean;
|
|
29
|
+
readYourWrites?: boolean;
|
|
27
30
|
};
|
|
28
31
|
|
|
29
32
|
type CacheSetting = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
|
|
@@ -33,12 +36,37 @@ type UpstashRequest = {
|
|
|
33
36
|
* Request body will be serialized to json
|
|
34
37
|
*/
|
|
35
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;
|
|
36
56
|
};
|
|
37
57
|
type UpstashResponse<TResult> = {
|
|
38
58
|
result?: TResult;
|
|
39
59
|
error?: string;
|
|
40
60
|
};
|
|
41
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;
|
|
42
70
|
request: <TResult = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult>>;
|
|
43
71
|
}
|
|
44
72
|
type RetryConfig = false | {
|
|
@@ -49,7 +77,7 @@ type RetryConfig = false | {
|
|
|
49
77
|
*/
|
|
50
78
|
retries?: number;
|
|
51
79
|
/**
|
|
52
|
-
* A backoff function receives the current retry
|
|
80
|
+
* A backoff function receives the current retry count and returns a number in milliseconds to wait before retrying.
|
|
53
81
|
*
|
|
54
82
|
* @default
|
|
55
83
|
* ```ts
|
|
@@ -58,6 +86,9 @@ type RetryConfig = false | {
|
|
|
58
86
|
*/
|
|
59
87
|
backoff?: (retryCount: number) => number;
|
|
60
88
|
};
|
|
89
|
+
type Options$1 = {
|
|
90
|
+
backend?: string;
|
|
91
|
+
};
|
|
61
92
|
type RequesterConfig = {
|
|
62
93
|
/**
|
|
63
94
|
* Configure the retry behaviour in case of network errors
|
|
@@ -92,6 +123,19 @@ type RequesterConfig = {
|
|
|
92
123
|
*/
|
|
93
124
|
cache?: CacheSetting;
|
|
94
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;
|
|
95
139
|
|
|
96
140
|
type Serialize = (data: unknown) => string | number | boolean;
|
|
97
141
|
type Deserialize<TResult, TData> = (result: TResult) => TData;
|
|
@@ -106,6 +150,32 @@ type CommandOptions<TResult, TData> = {
|
|
|
106
150
|
* @default true
|
|
107
151
|
*/
|
|
108
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
|
+
};
|
|
109
179
|
};
|
|
110
180
|
/**
|
|
111
181
|
* Command offers default (de)serialization and the exec method to all commands.
|
|
@@ -117,6 +187,11 @@ declare class Command<TResult, TData> {
|
|
|
117
187
|
readonly command: (string | number | boolean)[];
|
|
118
188
|
readonly serialize: Serialize;
|
|
119
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;
|
|
120
195
|
/**
|
|
121
196
|
* Create a new command instance.
|
|
122
197
|
*
|
|
@@ -212,18 +287,6 @@ declare class ScriptFlushCommand extends Command<"OK", "OK"> {
|
|
|
212
287
|
constructor([opts]: [opts?: ScriptFlushCommandOptions], cmdOpts?: CommandOptions<"OK", "OK">);
|
|
213
288
|
}
|
|
214
289
|
|
|
215
|
-
type ScanCommandOptions = {
|
|
216
|
-
match?: string;
|
|
217
|
-
count?: number;
|
|
218
|
-
type?: string;
|
|
219
|
-
};
|
|
220
|
-
/**
|
|
221
|
-
* @see https://redis.io/commands/scan
|
|
222
|
-
*/
|
|
223
|
-
declare class ScanCommand extends Command<[number, string[]], [number, string[]]> {
|
|
224
|
-
constructor([cursor, opts]: [cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[number, string[]], [number, string[]]>);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
290
|
type GeoAddCommandOptions = {
|
|
228
291
|
nx?: boolean;
|
|
229
292
|
xx?: never;
|
|
@@ -233,11 +296,11 @@ type GeoAddCommandOptions = {
|
|
|
233
296
|
} & {
|
|
234
297
|
ch?: boolean;
|
|
235
298
|
});
|
|
236
|
-
|
|
299
|
+
type GeoMember<TMemberType> = {
|
|
237
300
|
latitude: number;
|
|
238
301
|
longitude: number;
|
|
239
302
|
member: TMemberType;
|
|
240
|
-
}
|
|
303
|
+
};
|
|
241
304
|
/**
|
|
242
305
|
* @see https://redis.io/commands/geoadd
|
|
243
306
|
*/
|
|
@@ -249,6 +312,11 @@ declare class GeoAddCommand<TMemberType = string> extends Command<number | null,
|
|
|
249
312
|
], opts?: CommandOptions<number | null, number | null>);
|
|
250
313
|
}
|
|
251
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
|
+
|
|
252
320
|
/**
|
|
253
321
|
* @see https://redis.io/commands/append
|
|
254
322
|
*/
|
|
@@ -264,6 +332,28 @@ declare class BitCountCommand extends Command<number, number> {
|
|
|
264
332
|
constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<number, number>);
|
|
265
333
|
}
|
|
266
334
|
|
|
335
|
+
type SubCommandArgs<TRest extends unknown[] = []> = [
|
|
336
|
+
encoding: string,
|
|
337
|
+
offset: number | string,
|
|
338
|
+
...rest: TRest
|
|
339
|
+
];
|
|
340
|
+
/**
|
|
341
|
+
* @see https://redis.io/commands/bitfield
|
|
342
|
+
*/
|
|
343
|
+
declare class BitFieldCommand<T = Promise<number[]>> {
|
|
344
|
+
private client;
|
|
345
|
+
private opts?;
|
|
346
|
+
private execOperation;
|
|
347
|
+
private command;
|
|
348
|
+
constructor(args: [key: string], client: Requester, opts?: CommandOptions<number[], number[]> | undefined, execOperation?: (command: Command<number[], number[]>) => T);
|
|
349
|
+
private chain;
|
|
350
|
+
get(...args: SubCommandArgs): this;
|
|
351
|
+
set(...args: SubCommandArgs<[value: number]>): this;
|
|
352
|
+
incrby(...args: SubCommandArgs<[increment: number]>): this;
|
|
353
|
+
overflow(overflow: "WRAP" | "SAT" | "FAIL"): this;
|
|
354
|
+
exec(): T;
|
|
355
|
+
}
|
|
356
|
+
|
|
267
357
|
/**
|
|
268
358
|
* @see https://redis.io/commands/bitop
|
|
269
359
|
*/
|
|
@@ -323,6 +413,13 @@ declare class EchoCommand extends Command<string, string> {
|
|
|
323
413
|
constructor(cmd: [message: string], opts?: CommandOptions<string, string>);
|
|
324
414
|
}
|
|
325
415
|
|
|
416
|
+
/**
|
|
417
|
+
* @see https://redis.io/commands/eval_ro
|
|
418
|
+
*/
|
|
419
|
+
declare class EvalROCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
|
|
420
|
+
constructor([script, keys, args]: [script: string, keys: string[], args: TArgs], opts?: CommandOptions<unknown, TData>);
|
|
421
|
+
}
|
|
422
|
+
|
|
326
423
|
/**
|
|
327
424
|
* @see https://redis.io/commands/eval
|
|
328
425
|
*/
|
|
@@ -330,6 +427,13 @@ declare class EvalCommand<TArgs extends unknown[], TData> extends Command<unknow
|
|
|
330
427
|
constructor([script, keys, args]: [script: string, keys: string[], args: TArgs], opts?: CommandOptions<unknown, TData>);
|
|
331
428
|
}
|
|
332
429
|
|
|
430
|
+
/**
|
|
431
|
+
* @see https://redis.io/commands/evalsha_ro
|
|
432
|
+
*/
|
|
433
|
+
declare class EvalshaROCommand<TArgs extends unknown[], TData> extends Command<unknown, TData> {
|
|
434
|
+
constructor([sha, keys, args]: [sha: string, keys: string[], args?: TArgs], opts?: CommandOptions<unknown, TData>);
|
|
435
|
+
}
|
|
436
|
+
|
|
333
437
|
/**
|
|
334
438
|
* @see https://redis.io/commands/evalsha
|
|
335
439
|
*/
|
|
@@ -344,18 +448,11 @@ declare class ExistsCommand extends Command<number, number> {
|
|
|
344
448
|
constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
|
|
345
449
|
}
|
|
346
450
|
|
|
347
|
-
/**
|
|
348
|
-
* @see https://redis.io/commands/expire
|
|
349
|
-
*/
|
|
350
|
-
declare class ExpireCommand extends Command<"0" | "1", 0 | 1> {
|
|
351
|
-
constructor(cmd: [key: string, seconds: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
451
|
/**
|
|
355
452
|
* @see https://redis.io/commands/expireat
|
|
356
453
|
*/
|
|
357
454
|
declare class ExpireAtCommand extends Command<"0" | "1", 0 | 1> {
|
|
358
|
-
constructor(cmd: [key: string, unix: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
455
|
+
constructor(cmd: [key: string, unix: number, option?: ExpireOption], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
359
456
|
}
|
|
360
457
|
|
|
361
458
|
/**
|
|
@@ -388,6 +485,13 @@ declare class GeoDistCommand<TMemberType = string> extends Command<number | null
|
|
|
388
485
|
], opts?: CommandOptions<number | null, number | null>);
|
|
389
486
|
}
|
|
390
487
|
|
|
488
|
+
/**
|
|
489
|
+
* @see https://redis.io/commands/geohash
|
|
490
|
+
*/
|
|
491
|
+
declare class GeoHashCommand<TMember = string> extends Command<(string | null)[], (string | null)[]> {
|
|
492
|
+
constructor(cmd: [string, ...TMember[]], opts?: CommandOptions<(string | null)[], (string | null)[]>);
|
|
493
|
+
}
|
|
494
|
+
|
|
391
495
|
type Coordinates = {
|
|
392
496
|
lng: number;
|
|
393
497
|
lat: number;
|
|
@@ -399,13 +503,6 @@ declare class GeoPosCommand<TMember = string> extends Command<(string | null)[][
|
|
|
399
503
|
constructor(cmd: [string, ...(TMember[] | TMember[])], opts?: CommandOptions<(string | null)[][], Coordinates[]>);
|
|
400
504
|
}
|
|
401
505
|
|
|
402
|
-
/**
|
|
403
|
-
* @see https://redis.io/commands/geohash
|
|
404
|
-
*/
|
|
405
|
-
declare class GeoHashCommand<TMember = string> extends Command<(string | null)[], (string | null)[]> {
|
|
406
|
-
constructor(cmd: [string, ...(TMember[] | TMember[])], opts?: CommandOptions<(string | null)[], (string | null)[]>);
|
|
407
|
-
}
|
|
408
|
-
|
|
409
506
|
type RadiusOptions$1 = "M" | "KM" | "FT" | "MI";
|
|
410
507
|
type CenterPoint$1<TMemberType> = {
|
|
411
508
|
type: "FROMMEMBER" | "frommember";
|
|
@@ -530,6 +627,50 @@ declare class GetDelCommand<TData = string> extends Command<unknown | null, TDat
|
|
|
530
627
|
constructor(cmd: [key: string], opts?: CommandOptions<unknown | null, TData | null>);
|
|
531
628
|
}
|
|
532
629
|
|
|
630
|
+
type GetExCommandOptions = {
|
|
631
|
+
ex: number;
|
|
632
|
+
px?: never;
|
|
633
|
+
exat?: never;
|
|
634
|
+
pxat?: never;
|
|
635
|
+
persist?: never;
|
|
636
|
+
} | {
|
|
637
|
+
ex?: never;
|
|
638
|
+
px: number;
|
|
639
|
+
exat?: never;
|
|
640
|
+
pxat?: never;
|
|
641
|
+
persist?: never;
|
|
642
|
+
} | {
|
|
643
|
+
ex?: never;
|
|
644
|
+
px?: never;
|
|
645
|
+
exat: number;
|
|
646
|
+
pxat?: never;
|
|
647
|
+
persist?: never;
|
|
648
|
+
} | {
|
|
649
|
+
ex?: never;
|
|
650
|
+
px?: never;
|
|
651
|
+
exat?: never;
|
|
652
|
+
pxat: number;
|
|
653
|
+
persist?: never;
|
|
654
|
+
} | {
|
|
655
|
+
ex?: never;
|
|
656
|
+
px?: never;
|
|
657
|
+
exat?: never;
|
|
658
|
+
pxat?: never;
|
|
659
|
+
persist: true;
|
|
660
|
+
} | {
|
|
661
|
+
ex?: never;
|
|
662
|
+
px?: never;
|
|
663
|
+
exat?: never;
|
|
664
|
+
pxat?: never;
|
|
665
|
+
persist?: never;
|
|
666
|
+
};
|
|
667
|
+
/**
|
|
668
|
+
* @see https://redis.io/commands/getex
|
|
669
|
+
*/
|
|
670
|
+
declare class GetExCommand<TData = string> extends Command<unknown | null, TData | null> {
|
|
671
|
+
constructor([key, opts]: [key: string, opts?: GetExCommandOptions], cmdOpts?: CommandOptions<unknown | null, TData | null>);
|
|
672
|
+
}
|
|
673
|
+
|
|
533
674
|
/**
|
|
534
675
|
* @see https://redis.io/commands/getrange
|
|
535
676
|
*/
|
|
@@ -558,6 +699,58 @@ declare class HExistsCommand extends Command<number, number> {
|
|
|
558
699
|
constructor(cmd: [key: string, field: string], opts?: CommandOptions<number, number>);
|
|
559
700
|
}
|
|
560
701
|
|
|
702
|
+
declare class HExpireCommand extends Command<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]> {
|
|
703
|
+
constructor(cmd: [
|
|
704
|
+
key: string,
|
|
705
|
+
fields: (string | number) | (string | number)[],
|
|
706
|
+
seconds: number,
|
|
707
|
+
option?: ExpireOption
|
|
708
|
+
], opts?: CommandOptions<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]>);
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
declare class HExpireAtCommand extends Command<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]> {
|
|
712
|
+
constructor(cmd: [
|
|
713
|
+
key: string,
|
|
714
|
+
fields: (string | number) | (string | number)[],
|
|
715
|
+
timestamp: number,
|
|
716
|
+
option?: ExpireOption
|
|
717
|
+
], opts?: CommandOptions<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]>);
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
declare class HExpireTimeCommand extends Command<number[], number[]> {
|
|
721
|
+
constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<number[], number[]>);
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
declare class HPersistCommand extends Command<(-2 | -1 | 1)[], (-2 | -1 | 1)[]> {
|
|
725
|
+
constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<(-2 | -1 | 1)[], (-2 | -1 | 1)[]>);
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
declare class HPExpireCommand extends Command<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]> {
|
|
729
|
+
constructor(cmd: [
|
|
730
|
+
key: string,
|
|
731
|
+
fields: (string | number) | (string | number)[],
|
|
732
|
+
milliseconds: number,
|
|
733
|
+
option?: ExpireOption
|
|
734
|
+
], opts?: CommandOptions<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]>);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
declare class HPExpireAtCommand extends Command<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]> {
|
|
738
|
+
constructor(cmd: [
|
|
739
|
+
key: string,
|
|
740
|
+
fields: (string | number) | (string | number)[],
|
|
741
|
+
timestamp: number,
|
|
742
|
+
option?: ExpireOption
|
|
743
|
+
], opts?: CommandOptions<(-2 | 0 | 1 | 2)[], (-2 | 0 | 1 | 2)[]>);
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
declare class HPExpireTimeCommand extends Command<number[], number[]> {
|
|
747
|
+
constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<number[], number[]>);
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
declare class HPTtlCommand extends Command<number[], number[]> {
|
|
751
|
+
constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<number[], number[]>);
|
|
752
|
+
}
|
|
753
|
+
|
|
561
754
|
/**
|
|
562
755
|
* @see https://redis.io/commands/hget
|
|
563
756
|
*/
|
|
@@ -619,9 +812,7 @@ declare class HMGetCommand<TData extends Record<string, unknown>> extends Comman
|
|
|
619
812
|
* @see https://redis.io/commands/hmset
|
|
620
813
|
*/
|
|
621
814
|
declare class HMSetCommand<TData> extends Command<"OK", "OK"> {
|
|
622
|
-
constructor([key, kv]: [key: string, kv:
|
|
623
|
-
[field: string]: TData;
|
|
624
|
-
}], opts?: CommandOptions<"OK", "OK">);
|
|
815
|
+
constructor([key, kv]: [key: string, kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">);
|
|
625
816
|
}
|
|
626
817
|
|
|
627
818
|
/**
|
|
@@ -633,26 +824,57 @@ declare class HRandFieldCommand<TData extends string | string[] | Record<string,
|
|
|
633
824
|
constructor(cmd: [key: string, count: number, withValues: boolean], opts?: CommandOptions<string[], Partial<TData>>);
|
|
634
825
|
}
|
|
635
826
|
|
|
827
|
+
type ScanCommandOptionsStandard = {
|
|
828
|
+
match?: string;
|
|
829
|
+
count?: number;
|
|
830
|
+
type?: string;
|
|
831
|
+
withType?: false;
|
|
832
|
+
};
|
|
833
|
+
type ScanCommandOptionsWithType = {
|
|
834
|
+
match?: string;
|
|
835
|
+
count?: number;
|
|
836
|
+
/**
|
|
837
|
+
* Includes types of each key in the result
|
|
838
|
+
*
|
|
839
|
+
* @example
|
|
840
|
+
* ```typescript
|
|
841
|
+
* await redis.scan("0", { withType: true })
|
|
842
|
+
* // ["0", [{ key: "key1", type: "string" }, { key: "key2", type: "list" }]]
|
|
843
|
+
* ```
|
|
844
|
+
*/
|
|
845
|
+
withType: true;
|
|
846
|
+
};
|
|
847
|
+
type ScanCommandOptions = ScanCommandOptionsStandard | ScanCommandOptionsWithType;
|
|
848
|
+
type ScanResultStandard = [string, string[]];
|
|
849
|
+
type ScanResultWithType = [string, {
|
|
850
|
+
key: string;
|
|
851
|
+
type: string;
|
|
852
|
+
}[]];
|
|
853
|
+
/**
|
|
854
|
+
* @see https://redis.io/commands/scan
|
|
855
|
+
*/
|
|
856
|
+
declare class ScanCommand<TData = ScanResultStandard> extends Command<[string, string[]], TData> {
|
|
857
|
+
constructor([cursor, opts]: [cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, string[]], TData>);
|
|
858
|
+
}
|
|
859
|
+
|
|
636
860
|
/**
|
|
637
861
|
* @see https://redis.io/commands/hscan
|
|
638
862
|
*/
|
|
639
863
|
declare class HScanCommand extends Command<[
|
|
640
|
-
|
|
864
|
+
string,
|
|
641
865
|
(string | number)[]
|
|
642
866
|
], [
|
|
643
|
-
|
|
867
|
+
string,
|
|
644
868
|
(string | number)[]
|
|
645
869
|
]> {
|
|
646
|
-
constructor([key, cursor, cmdOpts]: [key: string, cursor: number, cmdOpts?: ScanCommandOptions], opts?: CommandOptions<[
|
|
870
|
+
constructor([key, cursor, cmdOpts]: [key: string, cursor: string | number, cmdOpts?: ScanCommandOptions], opts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
|
|
647
871
|
}
|
|
648
872
|
|
|
649
873
|
/**
|
|
650
874
|
* @see https://redis.io/commands/hset
|
|
651
875
|
*/
|
|
652
876
|
declare class HSetCommand<TData> extends Command<number, number> {
|
|
653
|
-
constructor([key, kv]: [key: string, kv:
|
|
654
|
-
[field: string]: TData;
|
|
655
|
-
}], opts?: CommandOptions<number, number>);
|
|
877
|
+
constructor([key, kv]: [key: string, kv: Record<string, TData>], opts?: CommandOptions<number, number>);
|
|
656
878
|
}
|
|
657
879
|
|
|
658
880
|
/**
|
|
@@ -669,6 +891,10 @@ declare class HStrLenCommand extends Command<number, number> {
|
|
|
669
891
|
constructor(cmd: [key: string, field: string], opts?: CommandOptions<number, number>);
|
|
670
892
|
}
|
|
671
893
|
|
|
894
|
+
declare class HTtlCommand extends Command<number[], number[]> {
|
|
895
|
+
constructor(cmd: [key: string, fields: (string | number) | (string | number)[]], opts?: CommandOptions<number[], number[]>);
|
|
896
|
+
}
|
|
897
|
+
|
|
672
898
|
/**
|
|
673
899
|
* @see https://redis.io/commands/hvals
|
|
674
900
|
*/
|
|
@@ -775,13 +1001,31 @@ declare class JsonGetCommand<TData extends (unknown | Record<string, unknown>) |
|
|
|
775
1001
|
] | [key: string, ...path: string[]], opts?: CommandOptions<TData | null, TData | null>);
|
|
776
1002
|
}
|
|
777
1003
|
|
|
1004
|
+
/**
|
|
1005
|
+
* @see https://redis.io/commands/json.merge
|
|
1006
|
+
*/
|
|
1007
|
+
declare class JsonMergeCommand<TData extends string | number | Record<string, unknown> | Array<unknown>> extends Command<"OK" | null, "OK" | null> {
|
|
1008
|
+
constructor(cmd: [key: string, path: string, value: TData], opts?: CommandOptions<"OK" | null, "OK" | null>);
|
|
1009
|
+
}
|
|
1010
|
+
|
|
778
1011
|
/**
|
|
779
1012
|
* @see https://redis.io/commands/json.mget
|
|
780
1013
|
*/
|
|
781
|
-
declare class JsonMGetCommand<TData
|
|
1014
|
+
declare class JsonMGetCommand<TData = unknown[]> extends Command<TData, TData> {
|
|
782
1015
|
constructor(cmd: [keys: string[], path: string], opts?: CommandOptions<TData, TData>);
|
|
783
1016
|
}
|
|
784
1017
|
|
|
1018
|
+
/**
|
|
1019
|
+
* @see https://redis.io/commands/json.mset
|
|
1020
|
+
*/
|
|
1021
|
+
declare class JsonMSetCommand<TData extends number | string | boolean | Record<string, unknown> | (number | string | boolean | Record<string, unknown>)[]> extends Command<"OK" | null, "OK" | null> {
|
|
1022
|
+
constructor(cmd: {
|
|
1023
|
+
key: string;
|
|
1024
|
+
path: string;
|
|
1025
|
+
value: TData;
|
|
1026
|
+
}[], opts?: CommandOptions<"OK" | null, "OK" | null>);
|
|
1027
|
+
}
|
|
1028
|
+
|
|
785
1029
|
/**
|
|
786
1030
|
* @see https://redis.io/commands/json.numincrby
|
|
787
1031
|
*/
|
|
@@ -938,25 +1182,21 @@ declare class LTrimCommand extends Command<"OK", "OK"> {
|
|
|
938
1182
|
* @see https://redis.io/commands/mget
|
|
939
1183
|
*/
|
|
940
1184
|
declare class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
|
|
941
|
-
constructor(cmd: [string[]] | [...
|
|
1185
|
+
constructor(cmd: [string[]] | [...string[]], opts?: CommandOptions<(string | null)[], TData>);
|
|
942
1186
|
}
|
|
943
1187
|
|
|
944
1188
|
/**
|
|
945
1189
|
* @see https://redis.io/commands/mset
|
|
946
1190
|
*/
|
|
947
1191
|
declare class MSetCommand<TData> extends Command<"OK", "OK"> {
|
|
948
|
-
constructor([kv]: [kv:
|
|
949
|
-
[key: string]: TData;
|
|
950
|
-
}], opts?: CommandOptions<"OK", "OK">);
|
|
1192
|
+
constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">);
|
|
951
1193
|
}
|
|
952
1194
|
|
|
953
1195
|
/**
|
|
954
1196
|
* @see https://redis.io/commands/msetnx
|
|
955
1197
|
*/
|
|
956
1198
|
declare class MSetNXCommand<TData = string> extends Command<number, number> {
|
|
957
|
-
constructor([kv]: [kv:
|
|
958
|
-
[key: string]: TData;
|
|
959
|
-
}], opts?: CommandOptions<number, number>);
|
|
1199
|
+
constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<number, number>);
|
|
960
1200
|
}
|
|
961
1201
|
|
|
962
1202
|
/**
|
|
@@ -970,14 +1210,14 @@ declare class PersistCommand extends Command<"0" | "1", 0 | 1> {
|
|
|
970
1210
|
* @see https://redis.io/commands/pexpire
|
|
971
1211
|
*/
|
|
972
1212
|
declare class PExpireCommand extends Command<"0" | "1", 0 | 1> {
|
|
973
|
-
constructor(cmd: [key: string, milliseconds: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
1213
|
+
constructor(cmd: [key: string, milliseconds: number, option?: ExpireOption], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
974
1214
|
}
|
|
975
1215
|
|
|
976
1216
|
/**
|
|
977
1217
|
* @see https://redis.io/commands/pexpireat
|
|
978
1218
|
*/
|
|
979
1219
|
declare class PExpireAtCommand extends Command<"0" | "1", 0 | 1> {
|
|
980
|
-
constructor(cmd: [key: string, unix: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
1220
|
+
constructor(cmd: [key: string, unix: number, option?: ExpireOption], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
981
1221
|
}
|
|
982
1222
|
|
|
983
1223
|
/**
|
|
@@ -1054,7 +1294,7 @@ declare class RPushXCommand<TData = string> extends Command<number, number> {
|
|
|
1054
1294
|
* @see https://redis.io/commands/sadd
|
|
1055
1295
|
*/
|
|
1056
1296
|
declare class SAddCommand<TData = string> extends Command<number, number> {
|
|
1057
|
-
constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
|
|
1297
|
+
constructor(cmd: [key: string, member: TData, ...members: TData[]], opts?: CommandOptions<number, number>);
|
|
1058
1298
|
}
|
|
1059
1299
|
|
|
1060
1300
|
/**
|
|
@@ -1242,13 +1482,13 @@ declare class SRemCommand<TData = string> extends Command<number, number> {
|
|
|
1242
1482
|
* @see https://redis.io/commands/sscan
|
|
1243
1483
|
*/
|
|
1244
1484
|
declare class SScanCommand extends Command<[
|
|
1245
|
-
|
|
1485
|
+
string,
|
|
1246
1486
|
(string | number)[]
|
|
1247
1487
|
], [
|
|
1248
|
-
|
|
1488
|
+
string,
|
|
1249
1489
|
(string | number)[]
|
|
1250
1490
|
]> {
|
|
1251
|
-
constructor([key, cursor, opts]: [key: string, cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[
|
|
1491
|
+
constructor([key, cursor, opts]: [key: string, cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
|
|
1252
1492
|
}
|
|
1253
1493
|
|
|
1254
1494
|
/**
|
|
@@ -1323,9 +1563,7 @@ declare class XAddCommand extends Command<string, string> {
|
|
|
1323
1563
|
constructor([key, id, entries, opts]: [
|
|
1324
1564
|
key: string,
|
|
1325
1565
|
id: "*" | string,
|
|
1326
|
-
entries:
|
|
1327
|
-
[field: string]: unknown;
|
|
1328
|
-
},
|
|
1566
|
+
entries: Record<string, unknown>,
|
|
1329
1567
|
opts?: XAddCommandOptions
|
|
1330
1568
|
], commandOptions?: CommandOptions<string, string>);
|
|
1331
1569
|
}
|
|
@@ -1334,7 +1572,75 @@ declare class XRangeCommand<TData extends Record<string, Record<string, unknown>
|
|
|
1334
1572
|
constructor([key, start, end, count]: [key: string, start: string, end: string, count?: number], opts?: CommandOptions<unknown[], TData[]>);
|
|
1335
1573
|
}
|
|
1336
1574
|
|
|
1337
|
-
type
|
|
1575
|
+
type XReadCommandOptions = [
|
|
1576
|
+
key: string | string[],
|
|
1577
|
+
id: string | string[],
|
|
1578
|
+
options?: {
|
|
1579
|
+
count?: number;
|
|
1580
|
+
/**
|
|
1581
|
+
* @deprecated block is not yet supported in Upstash Redis
|
|
1582
|
+
*/
|
|
1583
|
+
blockMS?: number;
|
|
1584
|
+
}
|
|
1585
|
+
];
|
|
1586
|
+
type XReadOptions = XReadCommandOptions extends [infer K, infer I, ...any[]] ? K extends string ? I extends string ? [
|
|
1587
|
+
key: string,
|
|
1588
|
+
id: string,
|
|
1589
|
+
options?: {
|
|
1590
|
+
count?: number;
|
|
1591
|
+
/**
|
|
1592
|
+
* @deprecated block is not yet supported in Upstash Redis
|
|
1593
|
+
*/
|
|
1594
|
+
blockMS?: number;
|
|
1595
|
+
}
|
|
1596
|
+
] : never : K extends string[] ? I extends string[] ? [
|
|
1597
|
+
key: string[],
|
|
1598
|
+
id: string[],
|
|
1599
|
+
options?: {
|
|
1600
|
+
count?: number;
|
|
1601
|
+
/**
|
|
1602
|
+
* @deprecated block is not yet supported in Upstash Redis
|
|
1603
|
+
*/
|
|
1604
|
+
blockMS?: number;
|
|
1605
|
+
}
|
|
1606
|
+
] : never : never : never;
|
|
1607
|
+
/**
|
|
1608
|
+
* @see https://redis.io/commands/xread
|
|
1609
|
+
*/
|
|
1610
|
+
declare class XReadCommand extends Command<number, unknown[]> {
|
|
1611
|
+
constructor([key, id, options]: XReadOptions, opts?: CommandOptions<number, unknown[]>);
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
type Options = {
|
|
1615
|
+
count?: number;
|
|
1616
|
+
/**
|
|
1617
|
+
* @deprecated block is not yet supported in Upstash Redis
|
|
1618
|
+
*/
|
|
1619
|
+
blockMS?: number;
|
|
1620
|
+
NOACK?: boolean;
|
|
1621
|
+
};
|
|
1622
|
+
type XReadGroupCommandOptions = [
|
|
1623
|
+
group: string,
|
|
1624
|
+
consumer: string,
|
|
1625
|
+
key: string | string[],
|
|
1626
|
+
id: string | string[],
|
|
1627
|
+
options?: Options
|
|
1628
|
+
];
|
|
1629
|
+
type XReadGroupOptions = XReadGroupCommandOptions extends [
|
|
1630
|
+
string,
|
|
1631
|
+
string,
|
|
1632
|
+
infer TKey,
|
|
1633
|
+
infer TId,
|
|
1634
|
+
...any[]
|
|
1635
|
+
] ? 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;
|
|
1636
|
+
/**
|
|
1637
|
+
* @see https://redis.io/commands/xreadgroup
|
|
1638
|
+
*/
|
|
1639
|
+
declare class XReadGroupCommand extends Command<number, unknown[]> {
|
|
1640
|
+
constructor([group, consumer, key, id, options]: XReadGroupOptions, opts?: CommandOptions<number, unknown[]>);
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
type NXAndXXOptions = {
|
|
1338
1644
|
nx: true;
|
|
1339
1645
|
xx?: never;
|
|
1340
1646
|
} | {
|
|
@@ -1343,12 +1649,23 @@ type ZAddCommandOptions = ({
|
|
|
1343
1649
|
} | {
|
|
1344
1650
|
nx?: never;
|
|
1345
1651
|
xx?: never;
|
|
1346
|
-
}) & {
|
|
1347
|
-
ch?: true;
|
|
1348
1652
|
};
|
|
1349
|
-
type
|
|
1350
|
-
|
|
1653
|
+
type LTAndGTOptions = {
|
|
1654
|
+
lt: true;
|
|
1655
|
+
gt?: never;
|
|
1656
|
+
} | {
|
|
1657
|
+
lt?: never;
|
|
1658
|
+
gt: true;
|
|
1659
|
+
} | {
|
|
1660
|
+
lt?: never;
|
|
1661
|
+
gt?: never;
|
|
1662
|
+
};
|
|
1663
|
+
type ZAddCommandOptions = NXAndXXOptions & LTAndGTOptions & {
|
|
1664
|
+
ch?: true;
|
|
1665
|
+
} & {
|
|
1666
|
+
incr?: true;
|
|
1351
1667
|
};
|
|
1668
|
+
type Arg2<TData> = ScoreMember<TData> | ZAddCommandOptions;
|
|
1352
1669
|
type ScoreMember<TData> = {
|
|
1353
1670
|
score: number;
|
|
1354
1671
|
member: TData;
|
|
@@ -1357,12 +1674,7 @@ type ScoreMember<TData> = {
|
|
|
1357
1674
|
* @see https://redis.io/commands/zadd
|
|
1358
1675
|
*/
|
|
1359
1676
|
declare class ZAddCommand<TData = string> extends Command<number | null, number | null> {
|
|
1360
|
-
constructor(
|
|
1361
|
-
constructor(cmd: [
|
|
1362
|
-
key: string,
|
|
1363
|
-
opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr,
|
|
1364
|
-
...scoreMemberPairs: ScoreMember<TData>[]
|
|
1365
|
-
], opts?: CommandOptions<number | null, number | null>);
|
|
1677
|
+
constructor([key, arg1, ...arg2]: [string, Arg2<TData>, ...ScoreMember<TData>[]], opts?: CommandOptions<number | null, number | null>);
|
|
1366
1678
|
}
|
|
1367
1679
|
|
|
1368
1680
|
/**
|
|
@@ -1481,7 +1793,11 @@ declare class ZRemRangeByRankCommand extends Command<number, number> {
|
|
|
1481
1793
|
* @see https://redis.io/commands/zremrangebyscore
|
|
1482
1794
|
*/
|
|
1483
1795
|
declare class ZRemRangeByScoreCommand extends Command<number, number> {
|
|
1484
|
-
constructor(cmd: [
|
|
1796
|
+
constructor(cmd: [
|
|
1797
|
+
key: string,
|
|
1798
|
+
min: number | `(${number}` | "-inf" | "+inf",
|
|
1799
|
+
max: number | `(${number}` | "-inf" | "+inf"
|
|
1800
|
+
], opts?: CommandOptions<number, number>);
|
|
1485
1801
|
}
|
|
1486
1802
|
|
|
1487
1803
|
/**
|
|
@@ -1495,13 +1811,13 @@ declare class ZRevRankCommand<TData> extends Command<number | null, number | nul
|
|
|
1495
1811
|
* @see https://redis.io/commands/zscan
|
|
1496
1812
|
*/
|
|
1497
1813
|
declare class ZScanCommand extends Command<[
|
|
1498
|
-
|
|
1814
|
+
string,
|
|
1499
1815
|
(string | number)[]
|
|
1500
1816
|
], [
|
|
1501
|
-
|
|
1817
|
+
string,
|
|
1502
1818
|
(string | number)[]
|
|
1503
1819
|
]> {
|
|
1504
|
-
constructor([key, cursor, opts]: [key: string, cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[
|
|
1820
|
+
constructor([key, cursor, opts]: [key: string, cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
|
|
1505
1821
|
}
|
|
1506
1822
|
|
|
1507
1823
|
/**
|
|
@@ -1511,9 +1827,79 @@ declare class ZScoreCommand<TData> extends Command<string | null, number | null>
|
|
|
1511
1827
|
constructor(cmd: [key: string, member: TData], opts?: CommandOptions<string | null, number | null>);
|
|
1512
1828
|
}
|
|
1513
1829
|
|
|
1830
|
+
type BaseMessageData<TMessage> = {
|
|
1831
|
+
channel: string;
|
|
1832
|
+
message: TMessage;
|
|
1833
|
+
};
|
|
1834
|
+
type PatternMessageData<TMessage> = BaseMessageData<TMessage> & {
|
|
1835
|
+
pattern: string;
|
|
1836
|
+
};
|
|
1837
|
+
type SubscriptionCountEvent = number;
|
|
1838
|
+
type MessageEventMap<TMessage> = {
|
|
1839
|
+
message: BaseMessageData<TMessage>;
|
|
1840
|
+
subscribe: SubscriptionCountEvent;
|
|
1841
|
+
unsubscribe: SubscriptionCountEvent;
|
|
1842
|
+
pmessage: PatternMessageData<TMessage>;
|
|
1843
|
+
psubscribe: SubscriptionCountEvent;
|
|
1844
|
+
punsubscribe: SubscriptionCountEvent;
|
|
1845
|
+
error: Error;
|
|
1846
|
+
[key: `message:${string}`]: BaseMessageData<TMessage>;
|
|
1847
|
+
[key: `pmessage:${string}`]: PatternMessageData<TMessage>;
|
|
1848
|
+
};
|
|
1849
|
+
type EventType = keyof MessageEventMap<any>;
|
|
1850
|
+
type Listener<TMessage, T extends EventType> = (event: MessageEventMap<TMessage>[T]) => void;
|
|
1851
|
+
declare class Subscriber<TMessage = any> extends EventTarget {
|
|
1852
|
+
private subscriptions;
|
|
1853
|
+
private client;
|
|
1854
|
+
private listeners;
|
|
1855
|
+
private opts?;
|
|
1856
|
+
constructor(client: Requester, channels: string[], isPattern?: boolean, opts?: Pick<RedisOptions, "automaticDeserialization">);
|
|
1857
|
+
private subscribeToChannel;
|
|
1858
|
+
private subscribeToPattern;
|
|
1859
|
+
private handleMessage;
|
|
1860
|
+
private dispatchToListeners;
|
|
1861
|
+
on<T extends keyof MessageEventMap<TMessage>>(type: T, listener: Listener<TMessage, T>): void;
|
|
1862
|
+
removeAllListeners(): void;
|
|
1863
|
+
unsubscribe(channels?: string[]): Promise<void>;
|
|
1864
|
+
getSubscribedChannels(): string[];
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1514
1867
|
type InferResponseData<T extends unknown[]> = {
|
|
1515
1868
|
[K in keyof T]: T[K] extends Command<any, infer TData> ? TData : unknown;
|
|
1516
1869
|
};
|
|
1870
|
+
interface ExecMethod<TCommands extends Command<any, any>[]> {
|
|
1871
|
+
/**
|
|
1872
|
+
* Send the pipeline request to upstash.
|
|
1873
|
+
*
|
|
1874
|
+
* Returns an array with the results of all pipelined commands.
|
|
1875
|
+
*
|
|
1876
|
+
* If all commands are statically chained from start to finish, types are inferred. You can still define a return type manually if necessary though:
|
|
1877
|
+
* ```ts
|
|
1878
|
+
* const p = redis.pipeline()
|
|
1879
|
+
* p.get("key")
|
|
1880
|
+
* const result = p.exec<[{ greeting: string }]>()
|
|
1881
|
+
* ```
|
|
1882
|
+
*
|
|
1883
|
+
* 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.
|
|
1884
|
+
*
|
|
1885
|
+
* 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 }`.
|
|
1886
|
+
*
|
|
1887
|
+
* ```ts
|
|
1888
|
+
* const p = redis.pipeline()
|
|
1889
|
+
* p.get("key")
|
|
1890
|
+
*
|
|
1891
|
+
* const result = await p.exec({ keepErrors: true });
|
|
1892
|
+
* const getResult = result[0].result
|
|
1893
|
+
* const getError = result[0].error
|
|
1894
|
+
* ```
|
|
1895
|
+
*/
|
|
1896
|
+
<TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>(): Promise<TCommandResults>;
|
|
1897
|
+
<TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>(options: {
|
|
1898
|
+
keepErrors: true;
|
|
1899
|
+
}): Promise<{
|
|
1900
|
+
[K in keyof TCommandResults]: UpstashResponse<TCommandResults[K]>;
|
|
1901
|
+
}>;
|
|
1902
|
+
}
|
|
1517
1903
|
/**
|
|
1518
1904
|
* Upstash REST API supports command pipelining to send multiple commands in
|
|
1519
1905
|
* batch, instead of sending each command one by one and waiting for a response.
|
|
@@ -1562,19 +1948,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1562
1948
|
commandOptions?: CommandOptions<any, any>;
|
|
1563
1949
|
multiExec?: boolean;
|
|
1564
1950
|
});
|
|
1565
|
-
|
|
1566
|
-
* Send the pipeline request to upstash.
|
|
1567
|
-
*
|
|
1568
|
-
* Returns an array with the results of all pipelined commands.
|
|
1569
|
-
*
|
|
1570
|
-
* If all commands are statically chained from start to finish, types are inferred. You can still define a return type manually if necessary though:
|
|
1571
|
-
* ```ts
|
|
1572
|
-
* const p = redis.pipeline()
|
|
1573
|
-
* p.get("key")
|
|
1574
|
-
* const result = p.exec<[{ greeting: string }]>()
|
|
1575
|
-
* ```
|
|
1576
|
-
*/
|
|
1577
|
-
exec: <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>() => Promise<TCommandResults>;
|
|
1951
|
+
exec: ExecMethod<TCommands>;
|
|
1578
1952
|
/**
|
|
1579
1953
|
* Returns the length of pipeline before the execution
|
|
1580
1954
|
*/
|
|
@@ -1592,6 +1966,23 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1592
1966
|
* @see https://redis.io/commands/bitcount
|
|
1593
1967
|
*/
|
|
1594
1968
|
bitcount: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1969
|
+
/**
|
|
1970
|
+
* Returns an instance that can be used to execute `BITFIELD` commands on one key.
|
|
1971
|
+
*
|
|
1972
|
+
* @example
|
|
1973
|
+
* ```typescript
|
|
1974
|
+
* redis.set("mykey", 0);
|
|
1975
|
+
* const result = await redis.pipeline()
|
|
1976
|
+
* .bitfield("mykey")
|
|
1977
|
+
* .set("u4", 0, 16)
|
|
1978
|
+
* .incr("u4", "#1", 1)
|
|
1979
|
+
* .exec();
|
|
1980
|
+
* console.log(result); // [[0, 1]]
|
|
1981
|
+
* ```
|
|
1982
|
+
*
|
|
1983
|
+
* @see https://redis.io/commands/bitfield
|
|
1984
|
+
*/
|
|
1985
|
+
bitfield: (key: string) => BitFieldCommand<Pipeline<[...TCommands, Command<any, number[]>]>>;
|
|
1595
1986
|
/**
|
|
1596
1987
|
* @see https://redis.io/commands/bitop
|
|
1597
1988
|
*/
|
|
@@ -1633,10 +2024,18 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1633
2024
|
* @see https://redis.io/commands/echo
|
|
1634
2025
|
*/
|
|
1635
2026
|
echo: (message: string) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
2027
|
+
/**
|
|
2028
|
+
* @see https://redis.io/commands/eval_ro
|
|
2029
|
+
*/
|
|
2030
|
+
evalRo: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
1636
2031
|
/**
|
|
1637
2032
|
* @see https://redis.io/commands/eval
|
|
1638
2033
|
*/
|
|
1639
2034
|
eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2035
|
+
/**
|
|
2036
|
+
* @see https://redis.io/commands/evalsha_ro
|
|
2037
|
+
*/
|
|
2038
|
+
evalshaRo: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
1640
2039
|
/**
|
|
1641
2040
|
* @see https://redis.io/commands/evalsha
|
|
1642
2041
|
*/
|
|
@@ -1648,11 +2047,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1648
2047
|
/**
|
|
1649
2048
|
* @see https://redis.io/commands/expire
|
|
1650
2049
|
*/
|
|
1651
|
-
expire: (key: string, seconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
2050
|
+
expire: (key: string, seconds: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
1652
2051
|
/**
|
|
1653
2052
|
* @see https://redis.io/commands/expireat
|
|
1654
2053
|
*/
|
|
1655
|
-
expireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
2054
|
+
expireat: (key: string, unix: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
1656
2055
|
/**
|
|
1657
2056
|
* @see https://redis.io/commands/flushall
|
|
1658
2057
|
*/
|
|
@@ -1661,36 +2060,202 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1661
2060
|
* @see https://redis.io/commands/flushdb
|
|
1662
2061
|
*/
|
|
1663
2062
|
flushdb: (opts?: {
|
|
1664
|
-
async?: boolean
|
|
2063
|
+
async?: boolean;
|
|
1665
2064
|
} | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1666
2065
|
/**
|
|
1667
|
-
* @see https://redis.io/commands/
|
|
2066
|
+
* @see https://redis.io/commands/geoadd
|
|
1668
2067
|
*/
|
|
1669
|
-
|
|
2068
|
+
geoadd: <TData>(args_0: string, args_1: GeoAddCommandOptions | GeoMember<TData>, ...args_2: GeoMember<TData>[]) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
1670
2069
|
/**
|
|
1671
|
-
* @see https://redis.io/commands/
|
|
2070
|
+
* @see https://redis.io/commands/geodist
|
|
1672
2071
|
*/
|
|
1673
|
-
|
|
2072
|
+
geodist: <TData>(key: string, member1: TData, member2: TData, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
1674
2073
|
/**
|
|
1675
|
-
* @see https://redis.io/commands/
|
|
2074
|
+
* @see https://redis.io/commands/geopos
|
|
1676
2075
|
*/
|
|
1677
|
-
|
|
2076
|
+
geopos: <TData>(args_0: string, ...args_1: TData[]) => Pipeline<[...TCommands, Command<any, {
|
|
2077
|
+
lng: number;
|
|
2078
|
+
lat: number;
|
|
2079
|
+
}[]>]>;
|
|
1678
2080
|
/**
|
|
1679
|
-
* @see https://redis.io/commands/
|
|
2081
|
+
* @see https://redis.io/commands/geohash
|
|
1680
2082
|
*/
|
|
1681
|
-
|
|
2083
|
+
geohash: <TData>(args_0: string, ...args_1: TData[]) => Pipeline<[...TCommands, Command<any, (string | null)[]>]>;
|
|
1682
2084
|
/**
|
|
1683
|
-
* @see https://redis.io/commands/
|
|
2085
|
+
* @see https://redis.io/commands/geosearch
|
|
1684
2086
|
*/
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
2087
|
+
geosearch: <TData>(key: string, centerPoint: {
|
|
2088
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
2089
|
+
coordinate: {
|
|
2090
|
+
lon: number;
|
|
2091
|
+
lat: number;
|
|
2092
|
+
};
|
|
2093
|
+
} | {
|
|
2094
|
+
type: "FROMMEMBER" | "frommember";
|
|
2095
|
+
member: TData;
|
|
2096
|
+
}, shape: {
|
|
2097
|
+
type: "BYRADIUS" | "byradius";
|
|
2098
|
+
radius: number;
|
|
2099
|
+
radiusType: "M" | "KM" | "FT" | "MI";
|
|
2100
|
+
} | {
|
|
2101
|
+
type: "BYBOX" | "bybox";
|
|
2102
|
+
rect: {
|
|
2103
|
+
width: number;
|
|
2104
|
+
height: number;
|
|
2105
|
+
};
|
|
2106
|
+
rectType: "M" | "KM" | "FT" | "MI";
|
|
2107
|
+
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2108
|
+
count?: {
|
|
2109
|
+
limit: number;
|
|
2110
|
+
any?: boolean;
|
|
2111
|
+
};
|
|
2112
|
+
withCoord?: boolean;
|
|
2113
|
+
withDist?: boolean;
|
|
2114
|
+
withHash?: boolean;
|
|
2115
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, ({
|
|
2116
|
+
member: TData;
|
|
2117
|
+
} & {
|
|
2118
|
+
coord?: {
|
|
2119
|
+
long: number;
|
|
2120
|
+
lat: number;
|
|
2121
|
+
} | undefined;
|
|
2122
|
+
dist?: number | undefined;
|
|
2123
|
+
hash?: string | undefined;
|
|
2124
|
+
})[]>]>;
|
|
2125
|
+
/**
|
|
2126
|
+
* @see https://redis.io/commands/geosearchstore
|
|
2127
|
+
*/
|
|
2128
|
+
geosearchstore: <TData>(destination: string, key: string, centerPoint: {
|
|
2129
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
2130
|
+
coordinate: {
|
|
2131
|
+
lon: number;
|
|
2132
|
+
lat: number;
|
|
2133
|
+
};
|
|
2134
|
+
} | {
|
|
2135
|
+
type: "FROMMEMBER" | "frommember";
|
|
2136
|
+
member: TData;
|
|
2137
|
+
}, shape: {
|
|
2138
|
+
type: "BYRADIUS" | "byradius";
|
|
2139
|
+
radius: number;
|
|
2140
|
+
radiusType: "M" | "KM" | "FT" | "MI";
|
|
2141
|
+
} | {
|
|
2142
|
+
type: "BYBOX" | "bybox";
|
|
2143
|
+
rect: {
|
|
2144
|
+
width: number;
|
|
2145
|
+
height: number;
|
|
2146
|
+
};
|
|
2147
|
+
rectType: "M" | "KM" | "FT" | "MI";
|
|
2148
|
+
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2149
|
+
count?: {
|
|
2150
|
+
limit: number;
|
|
2151
|
+
any?: boolean;
|
|
2152
|
+
};
|
|
2153
|
+
storeDist?: boolean;
|
|
2154
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2155
|
+
/**
|
|
2156
|
+
* @see https://redis.io/commands/get
|
|
2157
|
+
*/
|
|
2158
|
+
get: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
2159
|
+
/**
|
|
2160
|
+
* @see https://redis.io/commands/getbit
|
|
2161
|
+
*/
|
|
2162
|
+
getbit: (key: string, offset: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
2163
|
+
/**
|
|
2164
|
+
* @see https://redis.io/commands/getdel
|
|
2165
|
+
*/
|
|
2166
|
+
getdel: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
2167
|
+
/**
|
|
2168
|
+
* @see https://redis.io/commands/getex
|
|
2169
|
+
*/
|
|
2170
|
+
getex: <TData>(key: string, opts?: ({
|
|
2171
|
+
ex: number;
|
|
2172
|
+
px?: never;
|
|
2173
|
+
exat?: never;
|
|
2174
|
+
pxat?: never;
|
|
2175
|
+
persist?: never;
|
|
2176
|
+
} | {
|
|
2177
|
+
ex?: never;
|
|
2178
|
+
px: number;
|
|
2179
|
+
exat?: never;
|
|
2180
|
+
pxat?: never;
|
|
2181
|
+
persist?: never;
|
|
2182
|
+
} | {
|
|
2183
|
+
ex?: never;
|
|
2184
|
+
px?: never;
|
|
2185
|
+
exat: number;
|
|
2186
|
+
pxat?: never;
|
|
2187
|
+
persist?: never;
|
|
2188
|
+
} | {
|
|
2189
|
+
ex?: never;
|
|
2190
|
+
px?: never;
|
|
2191
|
+
exat?: never;
|
|
2192
|
+
pxat: number;
|
|
2193
|
+
persist?: never;
|
|
2194
|
+
} | {
|
|
2195
|
+
ex?: never;
|
|
2196
|
+
px?: never;
|
|
2197
|
+
exat?: never;
|
|
2198
|
+
pxat?: never;
|
|
2199
|
+
persist: true;
|
|
2200
|
+
} | {
|
|
2201
|
+
ex?: never;
|
|
2202
|
+
px?: never;
|
|
2203
|
+
exat?: never;
|
|
2204
|
+
pxat?: never;
|
|
2205
|
+
persist?: never;
|
|
2206
|
+
}) | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
2207
|
+
/**
|
|
2208
|
+
* @see https://redis.io/commands/getrange
|
|
2209
|
+
*/
|
|
2210
|
+
getrange: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
2211
|
+
/**
|
|
2212
|
+
* @see https://redis.io/commands/getset
|
|
2213
|
+
*/
|
|
2214
|
+
getset: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
2215
|
+
/**
|
|
2216
|
+
* @see https://redis.io/commands/hdel
|
|
1688
2217
|
*/
|
|
1689
2218
|
hdel: (key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
1690
2219
|
/**
|
|
1691
2220
|
* @see https://redis.io/commands/hexists
|
|
1692
2221
|
*/
|
|
1693
2222
|
hexists: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2223
|
+
/**
|
|
2224
|
+
* @see https://redis.io/commands/hexpire
|
|
2225
|
+
*/
|
|
2226
|
+
hexpire: (key: string, fields: string | number | (string | number)[], seconds: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, (0 | 1 | 2 | -2)[]>]>;
|
|
2227
|
+
/**
|
|
2228
|
+
* @see https://redis.io/commands/hexpireat
|
|
2229
|
+
*/
|
|
2230
|
+
hexpireat: (key: string, fields: string | number | (string | number)[], timestamp: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, (0 | 1 | 2 | -2)[]>]>;
|
|
2231
|
+
/**
|
|
2232
|
+
* @see https://redis.io/commands/hexpiretime
|
|
2233
|
+
*/
|
|
2234
|
+
hexpiretime: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, number[]>]>;
|
|
2235
|
+
/**
|
|
2236
|
+
* @see https://redis.io/commands/httl
|
|
2237
|
+
*/
|
|
2238
|
+
httl: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, number[]>]>;
|
|
2239
|
+
/**
|
|
2240
|
+
* @see https://redis.io/commands/hpexpire
|
|
2241
|
+
*/
|
|
2242
|
+
hpexpire: (key: string, fields: string | number | (string | number)[], milliseconds: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, (0 | 1 | 2 | -2)[]>]>;
|
|
2243
|
+
/**
|
|
2244
|
+
* @see https://redis.io/commands/hpexpireat
|
|
2245
|
+
*/
|
|
2246
|
+
hpexpireat: (key: string, fields: string | number | (string | number)[], timestamp: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, (0 | 1 | 2 | -2)[]>]>;
|
|
2247
|
+
/**
|
|
2248
|
+
* @see https://redis.io/commands/hpexpiretime
|
|
2249
|
+
*/
|
|
2250
|
+
hpexpiretime: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, number[]>]>;
|
|
2251
|
+
/**
|
|
2252
|
+
* @see https://redis.io/commands/hpttl
|
|
2253
|
+
*/
|
|
2254
|
+
hpttl: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, number[]>]>;
|
|
2255
|
+
/**
|
|
2256
|
+
* @see https://redis.io/commands/hpersist
|
|
2257
|
+
*/
|
|
2258
|
+
hpersist: (key: string, fields: string | number | (string | number)[]) => Pipeline<[...TCommands, Command<any, (1 | -2 | -1)[]>]>;
|
|
1694
2259
|
/**
|
|
1695
2260
|
* @see https://redis.io/commands/hget
|
|
1696
2261
|
*/
|
|
@@ -1722,9 +2287,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1722
2287
|
/**
|
|
1723
2288
|
* @see https://redis.io/commands/hmset
|
|
1724
2289
|
*/
|
|
1725
|
-
hmset: <TData>(key: string, kv:
|
|
1726
|
-
[field: string]: TData;
|
|
1727
|
-
}) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
2290
|
+
hmset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1728
2291
|
/**
|
|
1729
2292
|
* @see https://redis.io/commands/hrandfield
|
|
1730
2293
|
*/
|
|
@@ -1732,13 +2295,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1732
2295
|
/**
|
|
1733
2296
|
* @see https://redis.io/commands/hscan
|
|
1734
2297
|
*/
|
|
1735
|
-
hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [
|
|
2298
|
+
hscan: (key: string, cursor: string | number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
|
|
1736
2299
|
/**
|
|
1737
2300
|
* @see https://redis.io/commands/hset
|
|
1738
2301
|
*/
|
|
1739
|
-
hset: <TData>(key: string, kv:
|
|
1740
|
-
[field: string]: TData;
|
|
1741
|
-
}) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2302
|
+
hset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1742
2303
|
/**
|
|
1743
2304
|
* @see https://redis.io/commands/hsetnx
|
|
1744
2305
|
*/
|
|
@@ -1787,13 +2348,17 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1787
2348
|
* @see https://redis.io/commands/lpop
|
|
1788
2349
|
*/
|
|
1789
2350
|
lpop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
2351
|
+
/**
|
|
2352
|
+
* @see https://redis.io/commands/lmpop
|
|
2353
|
+
*/
|
|
2354
|
+
lmpop: <TData>(numkeys: number, keys: string[], args_2: "LEFT" | "RIGHT", count?: number | undefined) => Pipeline<[...TCommands, Command<any, [string, TData[]] | null>]>;
|
|
1790
2355
|
/**
|
|
1791
2356
|
* @see https://redis.io/commands/lpos
|
|
1792
2357
|
*/
|
|
1793
2358
|
lpos: <TData>(key: string, element: unknown, opts?: {
|
|
1794
|
-
rank?: number
|
|
1795
|
-
count?: number
|
|
1796
|
-
maxLen?: number
|
|
2359
|
+
rank?: number;
|
|
2360
|
+
count?: number;
|
|
2361
|
+
maxLen?: number;
|
|
1797
2362
|
} | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
1798
2363
|
/**
|
|
1799
2364
|
* @see https://redis.io/commands/lpush
|
|
@@ -1826,15 +2391,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1826
2391
|
/**
|
|
1827
2392
|
* @see https://redis.io/commands/mset
|
|
1828
2393
|
*/
|
|
1829
|
-
mset: <TData>(kv:
|
|
1830
|
-
[key: string]: TData;
|
|
1831
|
-
}) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
2394
|
+
mset: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1832
2395
|
/**
|
|
1833
2396
|
* @see https://redis.io/commands/msetnx
|
|
1834
2397
|
*/
|
|
1835
|
-
msetnx: <TData>(kv:
|
|
1836
|
-
[key: string]: TData;
|
|
1837
|
-
}) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2398
|
+
msetnx: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1838
2399
|
/**
|
|
1839
2400
|
* @see https://redis.io/commands/persist
|
|
1840
2401
|
*/
|
|
@@ -1842,11 +2403,23 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1842
2403
|
/**
|
|
1843
2404
|
* @see https://redis.io/commands/pexpire
|
|
1844
2405
|
*/
|
|
1845
|
-
pexpire: (key: string, milliseconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
2406
|
+
pexpire: (key: string, milliseconds: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
1846
2407
|
/**
|
|
1847
2408
|
* @see https://redis.io/commands/pexpireat
|
|
1848
2409
|
*/
|
|
1849
|
-
pexpireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
2410
|
+
pexpireat: (key: string, unix: number, option?: ExpireOption | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
2411
|
+
/**
|
|
2412
|
+
* @see https://redis.io/commands/pfadd
|
|
2413
|
+
*/
|
|
2414
|
+
pfadd: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2415
|
+
/**
|
|
2416
|
+
* @see https://redis.io/commands/pfcount
|
|
2417
|
+
*/
|
|
2418
|
+
pfcount: (args_0: string, ...args_1: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2419
|
+
/**
|
|
2420
|
+
* @see https://redis.io/commands/pfmerge
|
|
2421
|
+
*/
|
|
2422
|
+
pfmerge: (destination_key: string, ...args_1: string[]) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1850
2423
|
/**
|
|
1851
2424
|
* @see https://redis.io/commands/ping
|
|
1852
2425
|
*/
|
|
@@ -1890,11 +2463,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1890
2463
|
/**
|
|
1891
2464
|
* @see https://redis.io/commands/sadd
|
|
1892
2465
|
*/
|
|
1893
|
-
sadd: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2466
|
+
sadd: <TData>(key: string, member: TData, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1894
2467
|
/**
|
|
1895
2468
|
* @see https://redis.io/commands/scan
|
|
1896
2469
|
*/
|
|
1897
|
-
scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any,
|
|
2470
|
+
scan: (cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
1898
2471
|
/**
|
|
1899
2472
|
* @see https://redis.io/commands/scard
|
|
1900
2473
|
*/
|
|
@@ -1975,7 +2548,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1975
2548
|
/**
|
|
1976
2549
|
* @see https://redis.io/commands/sscan
|
|
1977
2550
|
*/
|
|
1978
|
-
sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [
|
|
2551
|
+
sscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
|
|
1979
2552
|
/**
|
|
1980
2553
|
* @see https://redis.io/commands/strlen
|
|
1981
2554
|
*/
|
|
@@ -2011,7 +2584,127 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2011
2584
|
/**
|
|
2012
2585
|
* @see https://redis.io/commands/zadd
|
|
2013
2586
|
*/
|
|
2014
|
-
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions
|
|
2587
|
+
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>]>;
|
|
2588
|
+
/**
|
|
2589
|
+
* @see https://redis.io/commands/xadd
|
|
2590
|
+
*/
|
|
2591
|
+
xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
|
|
2592
|
+
nomkStream?: boolean;
|
|
2593
|
+
trim?: ({
|
|
2594
|
+
type: "MAXLEN" | "maxlen";
|
|
2595
|
+
threshold: number;
|
|
2596
|
+
} | {
|
|
2597
|
+
type: "MINID" | "minid";
|
|
2598
|
+
threshold: string;
|
|
2599
|
+
}) & ({
|
|
2600
|
+
comparison: "~";
|
|
2601
|
+
limit?: number;
|
|
2602
|
+
} | {
|
|
2603
|
+
comparison: "=";
|
|
2604
|
+
limit?: never;
|
|
2605
|
+
});
|
|
2606
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
2607
|
+
/**
|
|
2608
|
+
* @see https://redis.io/commands/xack
|
|
2609
|
+
*/
|
|
2610
|
+
xack: (key: string, group: string, id: string | string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2611
|
+
/**
|
|
2612
|
+
* @see https://redis.io/commands/xdel
|
|
2613
|
+
*/
|
|
2614
|
+
xdel: (key: string, ids: string | string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2615
|
+
/**
|
|
2616
|
+
* @see https://redis.io/commands/xgroup
|
|
2617
|
+
*/
|
|
2618
|
+
xgroup: (key: string, opts: {
|
|
2619
|
+
type: "CREATE";
|
|
2620
|
+
group: string;
|
|
2621
|
+
id: `$` | string;
|
|
2622
|
+
options?: {
|
|
2623
|
+
MKSTREAM?: boolean;
|
|
2624
|
+
ENTRIESREAD?: number;
|
|
2625
|
+
};
|
|
2626
|
+
} | {
|
|
2627
|
+
type: "CREATECONSUMER";
|
|
2628
|
+
group: string;
|
|
2629
|
+
consumer: string;
|
|
2630
|
+
} | {
|
|
2631
|
+
type: "DELCONSUMER";
|
|
2632
|
+
group: string;
|
|
2633
|
+
consumer: string;
|
|
2634
|
+
} | {
|
|
2635
|
+
type: "DESTROY";
|
|
2636
|
+
group: string;
|
|
2637
|
+
} | {
|
|
2638
|
+
type: "SETID";
|
|
2639
|
+
group: string;
|
|
2640
|
+
id: `$` | string;
|
|
2641
|
+
options?: {
|
|
2642
|
+
ENTRIESREAD?: number;
|
|
2643
|
+
};
|
|
2644
|
+
}) => Pipeline<[...TCommands, Command<any, never>]>;
|
|
2645
|
+
/**
|
|
2646
|
+
* @see https://redis.io/commands/xread
|
|
2647
|
+
*/
|
|
2648
|
+
xread: (...args: CommandArgs<typeof XReadCommand>) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2649
|
+
/**
|
|
2650
|
+
* @see https://redis.io/commands/xreadgroup
|
|
2651
|
+
*/
|
|
2652
|
+
xreadgroup: (...args: CommandArgs<typeof XReadGroupCommand>) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2653
|
+
/**
|
|
2654
|
+
* @see https://redis.io/commands/xinfo
|
|
2655
|
+
*/
|
|
2656
|
+
xinfo: (key: string, options: {
|
|
2657
|
+
type: "CONSUMERS";
|
|
2658
|
+
group: string;
|
|
2659
|
+
} | {
|
|
2660
|
+
type: "GROUPS";
|
|
2661
|
+
}) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2662
|
+
/**
|
|
2663
|
+
* @see https://redis.io/commands/xlen
|
|
2664
|
+
*/
|
|
2665
|
+
xlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2666
|
+
/**
|
|
2667
|
+
* @see https://redis.io/commands/xpending
|
|
2668
|
+
*/
|
|
2669
|
+
xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
|
|
2670
|
+
idleTime?: number;
|
|
2671
|
+
consumer?: string | string[];
|
|
2672
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2673
|
+
/**
|
|
2674
|
+
* @see https://redis.io/commands/xclaim
|
|
2675
|
+
*/
|
|
2676
|
+
xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
|
|
2677
|
+
idleMS?: number;
|
|
2678
|
+
timeMS?: number;
|
|
2679
|
+
retryCount?: number;
|
|
2680
|
+
force?: boolean;
|
|
2681
|
+
justId?: boolean;
|
|
2682
|
+
lastId?: number;
|
|
2683
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2684
|
+
/**
|
|
2685
|
+
* @see https://redis.io/commands/xautoclaim
|
|
2686
|
+
*/
|
|
2687
|
+
xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
|
|
2688
|
+
count?: number;
|
|
2689
|
+
justId?: boolean;
|
|
2690
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2691
|
+
/**
|
|
2692
|
+
* @see https://redis.io/commands/xtrim
|
|
2693
|
+
*/
|
|
2694
|
+
xtrim: (key: string, options: {
|
|
2695
|
+
strategy: "MAXLEN" | "MINID";
|
|
2696
|
+
exactness?: "~" | "=";
|
|
2697
|
+
threshold: number | string;
|
|
2698
|
+
limit?: number;
|
|
2699
|
+
}) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2700
|
+
/**
|
|
2701
|
+
* @see https://redis.io/commands/xrange
|
|
2702
|
+
*/
|
|
2703
|
+
xrange: (key: string, start: string, end: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, Record<string, Record<string, unknown>>>]>;
|
|
2704
|
+
/**
|
|
2705
|
+
* @see https://redis.io/commands/xrevrange
|
|
2706
|
+
*/
|
|
2707
|
+
xrevrange: (key: string, end: string, start: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, Record<string, Record<string, unknown>>>]>;
|
|
2015
2708
|
/**
|
|
2016
2709
|
* @see https://redis.io/commands/zcard
|
|
2017
2710
|
*/
|
|
@@ -2047,21 +2740,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2047
2740
|
/**
|
|
2048
2741
|
* @see https://redis.io/commands/zrange
|
|
2049
2742
|
*/
|
|
2050
|
-
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
byLex: true;
|
|
2056
|
-
} & ZRangeCommandOptions
|
|
2057
|
-
] | [
|
|
2058
|
-
key: string,
|
|
2059
|
-
min: number | `(${number}` | "-inf" | "+inf",
|
|
2060
|
-
max: number | `(${number}` | "-inf" | "+inf",
|
|
2061
|
-
opts: {
|
|
2062
|
-
byScore: true;
|
|
2063
|
-
} & ZRangeCommandOptions
|
|
2064
|
-
]) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2743
|
+
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
|
|
2744
|
+
byLex: true;
|
|
2745
|
+
} & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
|
|
2746
|
+
byScore: true;
|
|
2747
|
+
} & ZRangeCommandOptions]) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2065
2748
|
/**
|
|
2066
2749
|
* @see https://redis.io/commands/zrank
|
|
2067
2750
|
*/
|
|
@@ -2081,7 +2764,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2081
2764
|
/**
|
|
2082
2765
|
* @see https://redis.io/commands/zremrangebyscore
|
|
2083
2766
|
*/
|
|
2084
|
-
zremrangebyscore: (key: string, min: number, max: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2767
|
+
zremrangebyscore: (key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf") => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2085
2768
|
/**
|
|
2086
2769
|
* @see https://redis.io/commands/zrevrank
|
|
2087
2770
|
*/
|
|
@@ -2089,7 +2772,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2089
2772
|
/**
|
|
2090
2773
|
* @see https://redis.io/commands/zscan
|
|
2091
2774
|
*/
|
|
2092
|
-
zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [
|
|
2775
|
+
zscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
|
|
2093
2776
|
/**
|
|
2094
2777
|
* @see https://redis.io/commands/zscore
|
|
2095
2778
|
*/
|
|
@@ -2142,104 +2825,22 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2142
2825
|
* @see https://redis.io/commands/json.forget
|
|
2143
2826
|
*/
|
|
2144
2827
|
forget: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2145
|
-
/**
|
|
2146
|
-
* @see https://redis.io/commands/geoadd
|
|
2147
|
-
*/
|
|
2148
|
-
geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<unknown>, ...args_2: GeoMember<unknown>[]) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
2149
|
-
/**
|
|
2150
|
-
* @see https://redis.io/commands/geodist
|
|
2151
|
-
*/
|
|
2152
|
-
geodist: (key: string, member1: unknown, member2: unknown, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
2153
|
-
/**
|
|
2154
|
-
* @see https://redis.io/commands/geopos
|
|
2155
|
-
*/
|
|
2156
|
-
geopos: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, {
|
|
2157
|
-
lng: number;
|
|
2158
|
-
lat: number;
|
|
2159
|
-
}[]>]>;
|
|
2160
|
-
/**
|
|
2161
|
-
* @see https://redis.io/commands/geohash
|
|
2162
|
-
*/
|
|
2163
|
-
geohash: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, (string | null)[]>]>;
|
|
2164
|
-
/**
|
|
2165
|
-
* @see https://redis.io/commands/geosearch
|
|
2166
|
-
*/
|
|
2167
|
-
geosearch: (key: string, centerPoint: {
|
|
2168
|
-
type: "FROMLONLAT" | "fromlonlat";
|
|
2169
|
-
coordinate: {
|
|
2170
|
-
lon: number;
|
|
2171
|
-
lat: number;
|
|
2172
|
-
};
|
|
2173
|
-
} | {
|
|
2174
|
-
type: "FROMMEMBER" | "frommember";
|
|
2175
|
-
member: unknown;
|
|
2176
|
-
}, shape: {
|
|
2177
|
-
type: "BYRADIUS" | "byradius";
|
|
2178
|
-
radius: number;
|
|
2179
|
-
radiusType: "M" | "KM" | "FT" | "MI";
|
|
2180
|
-
} | {
|
|
2181
|
-
type: "BYBOX" | "bybox";
|
|
2182
|
-
rect: {
|
|
2183
|
-
width: number;
|
|
2184
|
-
height: number;
|
|
2185
|
-
};
|
|
2186
|
-
rectType: "M" | "KM" | "FT" | "MI";
|
|
2187
|
-
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2188
|
-
count?: {
|
|
2189
|
-
limit: number;
|
|
2190
|
-
any?: boolean | undefined;
|
|
2191
|
-
} | undefined;
|
|
2192
|
-
withCoord?: boolean | undefined;
|
|
2193
|
-
withDist?: boolean | undefined;
|
|
2194
|
-
withHash?: boolean | undefined;
|
|
2195
|
-
} | undefined) => Pipeline<[...TCommands, Command<any, ({
|
|
2196
|
-
member: unknown;
|
|
2197
|
-
} & {
|
|
2198
|
-
coord?: {
|
|
2199
|
-
long: number;
|
|
2200
|
-
lat: number;
|
|
2201
|
-
} | undefined;
|
|
2202
|
-
dist?: number | undefined;
|
|
2203
|
-
hash?: string | undefined;
|
|
2204
|
-
})[]>]>;
|
|
2205
|
-
/**
|
|
2206
|
-
* @see https://redis.io/commands/geosearchstore
|
|
2207
|
-
*/
|
|
2208
|
-
geosearchstore: (destination: string, key: string, centerPoint: {
|
|
2209
|
-
type: "FROMLONLAT" | "fromlonlat";
|
|
2210
|
-
coordinate: {
|
|
2211
|
-
lon: number;
|
|
2212
|
-
lat: number;
|
|
2213
|
-
};
|
|
2214
|
-
} | {
|
|
2215
|
-
type: "FROMMEMBER" | "frommember";
|
|
2216
|
-
member: unknown;
|
|
2217
|
-
}, shape: {
|
|
2218
|
-
type: "BYRADIUS" | "byradius";
|
|
2219
|
-
radius: number;
|
|
2220
|
-
radiusType: "M" | "KM" | "FT" | "MI";
|
|
2221
|
-
} | {
|
|
2222
|
-
type: "BYBOX" | "bybox";
|
|
2223
|
-
rect: {
|
|
2224
|
-
width: number;
|
|
2225
|
-
height: number;
|
|
2226
|
-
};
|
|
2227
|
-
rectType: "M" | "KM" | "FT" | "MI";
|
|
2228
|
-
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2229
|
-
count?: {
|
|
2230
|
-
limit: number;
|
|
2231
|
-
any?: boolean | undefined;
|
|
2232
|
-
} | undefined;
|
|
2233
|
-
storeDist?: boolean | undefined;
|
|
2234
|
-
} | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2235
2828
|
/**
|
|
2236
2829
|
* @see https://redis.io/commands/json.get
|
|
2237
2830
|
*/
|
|
2238
2831
|
get: (...args: CommandArgs<typeof JsonGetCommand>) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
2832
|
+
/**
|
|
2833
|
+
* @see https://redis.io/commands/json.merge
|
|
2834
|
+
*/
|
|
2835
|
+
merge: (key: string, path: string, value: string | number | unknown[] | Record<string, unknown>) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
|
|
2239
2836
|
/**
|
|
2240
2837
|
* @see https://redis.io/commands/json.mget
|
|
2241
2838
|
*/
|
|
2242
2839
|
mget: (keys: string[], path: string) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
2840
|
+
/**
|
|
2841
|
+
* @see https://redis.io/commands/json.mset
|
|
2842
|
+
*/
|
|
2843
|
+
mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
|
|
2243
2844
|
/**
|
|
2244
2845
|
* @see https://redis.io/commands/json.numincrby
|
|
2245
2846
|
*/
|
|
@@ -2265,9 +2866,9 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2265
2866
|
*/
|
|
2266
2867
|
set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
|
|
2267
2868
|
nx: true;
|
|
2268
|
-
xx?:
|
|
2869
|
+
xx?: never;
|
|
2269
2870
|
} | {
|
|
2270
|
-
nx?:
|
|
2871
|
+
nx?: never;
|
|
2271
2872
|
xx: true;
|
|
2272
2873
|
} | undefined) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
|
|
2273
2874
|
/**
|
|
@@ -2307,9 +2908,20 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2307
2908
|
*/
|
|
2308
2909
|
declare class Script<TResult = unknown> {
|
|
2309
2910
|
readonly script: string;
|
|
2310
|
-
|
|
2911
|
+
/**
|
|
2912
|
+
* @deprecated This property is initialized to an empty string and will be set in the init method
|
|
2913
|
+
* asynchronously. Do not use this property immidiately after the constructor.
|
|
2914
|
+
*
|
|
2915
|
+
* This property is only exposed for backwards compatibility and will be removed in the
|
|
2916
|
+
* future major release.
|
|
2917
|
+
*/
|
|
2918
|
+
sha1: string;
|
|
2311
2919
|
private readonly redis;
|
|
2312
2920
|
constructor(redis: Redis, script: string);
|
|
2921
|
+
/**
|
|
2922
|
+
* Initialize the script by computing its SHA-1 hash.
|
|
2923
|
+
*/
|
|
2924
|
+
private init;
|
|
2313
2925
|
/**
|
|
2314
2926
|
* Send an `EVAL` command to redis.
|
|
2315
2927
|
*/
|
|
@@ -2331,6 +2943,56 @@ declare class Script<TResult = unknown> {
|
|
|
2331
2943
|
private digest;
|
|
2332
2944
|
}
|
|
2333
2945
|
|
|
2946
|
+
/**
|
|
2947
|
+
* Creates a new script.
|
|
2948
|
+
*
|
|
2949
|
+
* Scripts offer the ability to optimistically try to execute a script without having to send the
|
|
2950
|
+
* entire script to the server. If the script is loaded on the server, it tries again by sending
|
|
2951
|
+
* the entire script. Afterwards, the script is cached on the server.
|
|
2952
|
+
*
|
|
2953
|
+
* @example
|
|
2954
|
+
* ```ts
|
|
2955
|
+
* const redis = new Redis({...})
|
|
2956
|
+
*
|
|
2957
|
+
* const script = redis.createScript<string>("return ARGV[1];", { readOnly: true })
|
|
2958
|
+
* const arg1 = await script.evalRo([], ["Hello World"])
|
|
2959
|
+
* expect(arg1, "Hello World")
|
|
2960
|
+
* ```
|
|
2961
|
+
*/
|
|
2962
|
+
declare class ScriptRO<TResult = unknown> {
|
|
2963
|
+
readonly script: string;
|
|
2964
|
+
/**
|
|
2965
|
+
* @deprecated This property is initialized to an empty string and will be set in the init method
|
|
2966
|
+
* asynchronously. Do not use this property immidiately after the constructor.
|
|
2967
|
+
*
|
|
2968
|
+
* This property is only exposed for backwards compatibility and will be removed in the
|
|
2969
|
+
* future major release.
|
|
2970
|
+
*/
|
|
2971
|
+
sha1: string;
|
|
2972
|
+
private readonly redis;
|
|
2973
|
+
constructor(redis: Redis, script: string);
|
|
2974
|
+
private init;
|
|
2975
|
+
/**
|
|
2976
|
+
* Send an `EVAL_RO` command to redis.
|
|
2977
|
+
*/
|
|
2978
|
+
evalRo(keys: string[], args: string[]): Promise<TResult>;
|
|
2979
|
+
/**
|
|
2980
|
+
* Calculates the sha1 hash of the script and then calls `EVALSHA_RO`.
|
|
2981
|
+
*/
|
|
2982
|
+
evalshaRo(keys: string[], args: string[]): Promise<TResult>;
|
|
2983
|
+
/**
|
|
2984
|
+
* Optimistically try to run `EVALSHA_RO` first.
|
|
2985
|
+
* If the script is not loaded in redis, it will fall back and try again with `EVAL_RO`.
|
|
2986
|
+
*
|
|
2987
|
+
* Following calls will be able to use the cached script
|
|
2988
|
+
*/
|
|
2989
|
+
exec(keys: string[], args: string[]): Promise<TResult>;
|
|
2990
|
+
/**
|
|
2991
|
+
* Compute the sha1 hash of the script and return its hex representation.
|
|
2992
|
+
*/
|
|
2993
|
+
private digest;
|
|
2994
|
+
}
|
|
2995
|
+
|
|
2334
2996
|
/**
|
|
2335
2997
|
* Serverless redis client for upstash.
|
|
2336
2998
|
*/
|
|
@@ -2338,6 +3000,7 @@ declare class Redis {
|
|
|
2338
3000
|
protected client: Requester;
|
|
2339
3001
|
protected opts?: CommandOptions<any, any>;
|
|
2340
3002
|
protected enableTelemetry: boolean;
|
|
3003
|
+
protected enableAutoPipelining: boolean;
|
|
2341
3004
|
/**
|
|
2342
3005
|
* Create a new redis client
|
|
2343
3006
|
*
|
|
@@ -2350,6 +3013,8 @@ declare class Redis {
|
|
|
2350
3013
|
* ```
|
|
2351
3014
|
*/
|
|
2352
3015
|
constructor(client: Requester, opts?: RedisOptions);
|
|
3016
|
+
get readYourWritesSyncToken(): string | undefined;
|
|
3017
|
+
set readYourWritesSyncToken(session: string | undefined);
|
|
2353
3018
|
get json(): {
|
|
2354
3019
|
/**
|
|
2355
3020
|
* @see https://redis.io/commands/json.arrappend
|
|
@@ -2388,103 +3053,21 @@ declare class Redis {
|
|
|
2388
3053
|
*/
|
|
2389
3054
|
forget: (key: string, path?: string | undefined) => Promise<number>;
|
|
2390
3055
|
/**
|
|
2391
|
-
* @see https://redis.io/commands/
|
|
2392
|
-
*/
|
|
2393
|
-
geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<unknown>, ...args_2: GeoMember<unknown>[]) => Promise<number | null>;
|
|
2394
|
-
/**
|
|
2395
|
-
* @see https://redis.io/commands/geopos
|
|
2396
|
-
*/
|
|
2397
|
-
geopos: (args_0: string, ...args_1: unknown[]) => Promise<{
|
|
2398
|
-
lng: number;
|
|
2399
|
-
lat: number;
|
|
2400
|
-
}[]>;
|
|
2401
|
-
/**
|
|
2402
|
-
* @see https://redis.io/commands/geodist
|
|
2403
|
-
*/
|
|
2404
|
-
geodist: (key: string, member1: unknown, member2: unknown, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
|
|
2405
|
-
/**
|
|
2406
|
-
* @see https://redis.io/commands/geohash
|
|
3056
|
+
* @see https://redis.io/commands/json.get
|
|
2407
3057
|
*/
|
|
2408
|
-
|
|
3058
|
+
get: <TData>(...args: CommandArgs<typeof JsonGetCommand>) => Promise<TData | null>;
|
|
2409
3059
|
/**
|
|
2410
|
-
* @see https://redis.io/commands/
|
|
3060
|
+
* @see https://redis.io/commands/json.merge
|
|
2411
3061
|
*/
|
|
2412
|
-
|
|
2413
|
-
type: "FROMLONLAT" | "fromlonlat";
|
|
2414
|
-
coordinate: {
|
|
2415
|
-
lon: number;
|
|
2416
|
-
lat: number;
|
|
2417
|
-
};
|
|
2418
|
-
} | {
|
|
2419
|
-
type: "FROMMEMBER" | "frommember";
|
|
2420
|
-
member: unknown;
|
|
2421
|
-
}, shape: {
|
|
2422
|
-
type: "BYRADIUS" | "byradius";
|
|
2423
|
-
radius: number;
|
|
2424
|
-
radiusType: "M" | "KM" | "FT" | "MI";
|
|
2425
|
-
} | {
|
|
2426
|
-
type: "BYBOX" | "bybox";
|
|
2427
|
-
rect: {
|
|
2428
|
-
width: number;
|
|
2429
|
-
height: number;
|
|
2430
|
-
};
|
|
2431
|
-
rectType: "M" | "KM" | "FT" | "MI";
|
|
2432
|
-
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2433
|
-
count?: {
|
|
2434
|
-
limit: number;
|
|
2435
|
-
any?: boolean | undefined;
|
|
2436
|
-
} | undefined;
|
|
2437
|
-
withCoord?: boolean | undefined;
|
|
2438
|
-
withDist?: boolean | undefined;
|
|
2439
|
-
withHash?: boolean | undefined;
|
|
2440
|
-
} | undefined) => Promise<({
|
|
2441
|
-
member: unknown;
|
|
2442
|
-
} & {
|
|
2443
|
-
coord?: {
|
|
2444
|
-
long: number;
|
|
2445
|
-
lat: number;
|
|
2446
|
-
} | undefined;
|
|
2447
|
-
dist?: number | undefined;
|
|
2448
|
-
hash?: string | undefined;
|
|
2449
|
-
})[]>;
|
|
3062
|
+
merge: (key: string, path: string, value: string | number | unknown[] | Record<string, unknown>) => Promise<"OK" | null>;
|
|
2450
3063
|
/**
|
|
2451
|
-
* @see https://redis.io/commands/
|
|
2452
|
-
*/
|
|
2453
|
-
geosearchstore: (destination: string, key: string, centerPoint: {
|
|
2454
|
-
type: "FROMLONLAT" | "fromlonlat";
|
|
2455
|
-
coordinate: {
|
|
2456
|
-
lon: number;
|
|
2457
|
-
lat: number;
|
|
2458
|
-
};
|
|
2459
|
-
} | {
|
|
2460
|
-
type: "FROMMEMBER" | "frommember";
|
|
2461
|
-
member: unknown;
|
|
2462
|
-
}, shape: {
|
|
2463
|
-
type: "BYRADIUS" | "byradius";
|
|
2464
|
-
radius: number;
|
|
2465
|
-
radiusType: "M" | "KM" | "FT" | "MI";
|
|
2466
|
-
} | {
|
|
2467
|
-
type: "BYBOX" | "bybox";
|
|
2468
|
-
rect: {
|
|
2469
|
-
width: number;
|
|
2470
|
-
height: number;
|
|
2471
|
-
};
|
|
2472
|
-
rectType: "M" | "KM" | "FT" | "MI";
|
|
2473
|
-
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2474
|
-
count?: {
|
|
2475
|
-
limit: number;
|
|
2476
|
-
any?: boolean | undefined;
|
|
2477
|
-
} | undefined;
|
|
2478
|
-
storeDist?: boolean | undefined;
|
|
2479
|
-
} | undefined) => Promise<number>;
|
|
2480
|
-
/**
|
|
2481
|
-
* @see https://redis.io/commands/json.get
|
|
3064
|
+
* @see https://redis.io/commands/json.mget
|
|
2482
3065
|
*/
|
|
2483
|
-
|
|
3066
|
+
mget: <TData>(keys: string[], path: string) => Promise<TData>;
|
|
2484
3067
|
/**
|
|
2485
|
-
* @see https://redis.io/commands/json.
|
|
3068
|
+
* @see https://redis.io/commands/json.mset
|
|
2486
3069
|
*/
|
|
2487
|
-
|
|
3070
|
+
mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Promise<"OK" | null>;
|
|
2488
3071
|
/**
|
|
2489
3072
|
* @see https://redis.io/commands/json.numincrby
|
|
2490
3073
|
*/
|
|
@@ -2510,9 +3093,9 @@ declare class Redis {
|
|
|
2510
3093
|
*/
|
|
2511
3094
|
set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
|
|
2512
3095
|
nx: true;
|
|
2513
|
-
xx?:
|
|
3096
|
+
xx?: never;
|
|
2514
3097
|
} | {
|
|
2515
|
-
nx?:
|
|
3098
|
+
nx?: never;
|
|
2516
3099
|
xx: true;
|
|
2517
3100
|
} | undefined) => Promise<"OK" | null>;
|
|
2518
3101
|
/**
|
|
@@ -2540,13 +3123,44 @@ declare class Redis {
|
|
|
2540
3123
|
* Technically this is not private, we can hide it from intellisense by doing this
|
|
2541
3124
|
*/
|
|
2542
3125
|
protected addTelemetry: (telemetry: Telemetry) => void;
|
|
2543
|
-
|
|
3126
|
+
/**
|
|
3127
|
+
* Creates a new script.
|
|
3128
|
+
*
|
|
3129
|
+
* Scripts offer the ability to optimistically try to execute a script without having to send the
|
|
3130
|
+
* entire script to the server. If the script is loaded on the server, it tries again by sending
|
|
3131
|
+
* the entire script. Afterwards, the script is cached on the server.
|
|
3132
|
+
*
|
|
3133
|
+
* @param script - The script to create
|
|
3134
|
+
* @param opts - Optional options to pass to the script `{ readonly?: boolean }`
|
|
3135
|
+
* @returns A new script
|
|
3136
|
+
*
|
|
3137
|
+
* @example
|
|
3138
|
+
* ```ts
|
|
3139
|
+
* const redis = new Redis({...})
|
|
3140
|
+
*
|
|
3141
|
+
* const script = redis.createScript<string>("return ARGV[1];")
|
|
3142
|
+
* const arg1 = await script.eval([], ["Hello World"])
|
|
3143
|
+
* expect(arg1, "Hello World")
|
|
3144
|
+
* ```
|
|
3145
|
+
* @example
|
|
3146
|
+
* ```ts
|
|
3147
|
+
* const redis = new Redis({...})
|
|
3148
|
+
*
|
|
3149
|
+
* const script = redis.createScript<string>("return ARGV[1];", { readonly: true })
|
|
3150
|
+
* const arg1 = await script.evalRo([], ["Hello World"])
|
|
3151
|
+
* expect(arg1, "Hello World")
|
|
3152
|
+
* ```
|
|
3153
|
+
*/
|
|
3154
|
+
createScript<TResult = unknown, TReadonly extends boolean = false>(script: string, opts?: {
|
|
3155
|
+
readonly?: TReadonly;
|
|
3156
|
+
}): TReadonly extends true ? ScriptRO<TResult> : Script<TResult>;
|
|
2544
3157
|
/**
|
|
2545
3158
|
* Create a new pipeline that allows you to send requests in bulk.
|
|
2546
3159
|
*
|
|
2547
3160
|
* @see {@link Pipeline}
|
|
2548
3161
|
*/
|
|
2549
3162
|
pipeline: () => Pipeline<[]>;
|
|
3163
|
+
protected autoPipeline: () => Redis;
|
|
2550
3164
|
/**
|
|
2551
3165
|
* Create a new transaction to allow executing multiple steps atomically.
|
|
2552
3166
|
*
|
|
@@ -2557,6 +3171,22 @@ declare class Redis {
|
|
|
2557
3171
|
* @see {@link Pipeline}
|
|
2558
3172
|
*/
|
|
2559
3173
|
multi: () => Pipeline<[]>;
|
|
3174
|
+
/**
|
|
3175
|
+
* Returns an instance that can be used to execute `BITFIELD` commands on one key.
|
|
3176
|
+
*
|
|
3177
|
+
* @example
|
|
3178
|
+
* ```typescript
|
|
3179
|
+
* redis.set("mykey", 0);
|
|
3180
|
+
* const result = await redis.bitfield("mykey")
|
|
3181
|
+
* .set("u4", 0, 16)
|
|
3182
|
+
* .incr("u4", "#1", 1)
|
|
3183
|
+
* .exec();
|
|
3184
|
+
* console.log(result); // [0, 1]
|
|
3185
|
+
* ```
|
|
3186
|
+
*
|
|
3187
|
+
* @see https://redis.io/commands/bitfield
|
|
3188
|
+
*/
|
|
3189
|
+
bitfield: (key: string) => BitFieldCommand<Promise<number[]>>;
|
|
2560
3190
|
/**
|
|
2561
3191
|
* @see https://redis.io/commands/append
|
|
2562
3192
|
*/
|
|
@@ -2602,14 +3232,26 @@ declare class Redis {
|
|
|
2602
3232
|
* @see https://redis.io/commands/echo
|
|
2603
3233
|
*/
|
|
2604
3234
|
echo: (message: string) => Promise<string>;
|
|
3235
|
+
/**
|
|
3236
|
+
* @see https://redis.io/commands/eval_ro
|
|
3237
|
+
*/
|
|
3238
|
+
evalRo: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Promise<TData>;
|
|
2605
3239
|
/**
|
|
2606
3240
|
* @see https://redis.io/commands/eval
|
|
2607
3241
|
*/
|
|
2608
3242
|
eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Promise<TData>;
|
|
3243
|
+
/**
|
|
3244
|
+
* @see https://redis.io/commands/evalsha_ro
|
|
3245
|
+
*/
|
|
3246
|
+
evalshaRo: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Promise<TData>;
|
|
2609
3247
|
/**
|
|
2610
3248
|
* @see https://redis.io/commands/evalsha
|
|
2611
3249
|
*/
|
|
2612
3250
|
evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Promise<TData>;
|
|
3251
|
+
/**
|
|
3252
|
+
* Generic method to execute any Redis command.
|
|
3253
|
+
*/
|
|
3254
|
+
exec: <TResult>(args: [command: string, ...args: (string | number | boolean)[]]) => Promise<TResult>;
|
|
2613
3255
|
/**
|
|
2614
3256
|
* @see https://redis.io/commands/exists
|
|
2615
3257
|
*/
|
|
@@ -2617,11 +3259,11 @@ declare class Redis {
|
|
|
2617
3259
|
/**
|
|
2618
3260
|
* @see https://redis.io/commands/expire
|
|
2619
3261
|
*/
|
|
2620
|
-
expire: (key: string, seconds: number) => Promise<0 | 1>;
|
|
3262
|
+
expire: (key: string, seconds: number, option?: ExpireOption | undefined) => Promise<0 | 1>;
|
|
2621
3263
|
/**
|
|
2622
3264
|
* @see https://redis.io/commands/expireat
|
|
2623
3265
|
*/
|
|
2624
|
-
expireat: (key: string, unix: number) => Promise<0 | 1>;
|
|
3266
|
+
expireat: (key: string, unix: number, option?: ExpireOption | undefined) => Promise<0 | 1>;
|
|
2625
3267
|
/**
|
|
2626
3268
|
* @see https://redis.io/commands/flushall
|
|
2627
3269
|
*/
|
|
@@ -2630,8 +3272,98 @@ declare class Redis {
|
|
|
2630
3272
|
* @see https://redis.io/commands/flushdb
|
|
2631
3273
|
*/
|
|
2632
3274
|
flushdb: (opts?: {
|
|
2633
|
-
async?: boolean
|
|
3275
|
+
async?: boolean;
|
|
2634
3276
|
} | undefined) => Promise<"OK">;
|
|
3277
|
+
/**
|
|
3278
|
+
* @see https://redis.io/commands/geoadd
|
|
3279
|
+
*/
|
|
3280
|
+
geoadd: <TData>(args_0: string, args_1: GeoAddCommandOptions | GeoMember<TData>, ...args_2: GeoMember<TData>[]) => Promise<number | null>;
|
|
3281
|
+
/**
|
|
3282
|
+
* @see https://redis.io/commands/geopos
|
|
3283
|
+
*/
|
|
3284
|
+
geopos: <TData>(args_0: string, ...args_1: TData[]) => Promise<{
|
|
3285
|
+
lng: number;
|
|
3286
|
+
lat: number;
|
|
3287
|
+
}[]>;
|
|
3288
|
+
/**
|
|
3289
|
+
* @see https://redis.io/commands/geodist
|
|
3290
|
+
*/
|
|
3291
|
+
geodist: <TData>(key: string, member1: TData, member2: TData, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
|
|
3292
|
+
/**
|
|
3293
|
+
* @see https://redis.io/commands/geohash
|
|
3294
|
+
*/
|
|
3295
|
+
geohash: <TData>(args_0: string, ...args_1: TData[]) => Promise<(string | null)[]>;
|
|
3296
|
+
/**
|
|
3297
|
+
* @see https://redis.io/commands/geosearch
|
|
3298
|
+
*/
|
|
3299
|
+
geosearch: <TData>(key: string, centerPoint: {
|
|
3300
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
3301
|
+
coordinate: {
|
|
3302
|
+
lon: number;
|
|
3303
|
+
lat: number;
|
|
3304
|
+
};
|
|
3305
|
+
} | {
|
|
3306
|
+
type: "FROMMEMBER" | "frommember";
|
|
3307
|
+
member: TData;
|
|
3308
|
+
}, shape: {
|
|
3309
|
+
type: "BYRADIUS" | "byradius";
|
|
3310
|
+
radius: number;
|
|
3311
|
+
radiusType: "M" | "KM" | "FT" | "MI";
|
|
3312
|
+
} | {
|
|
3313
|
+
type: "BYBOX" | "bybox";
|
|
3314
|
+
rect: {
|
|
3315
|
+
width: number;
|
|
3316
|
+
height: number;
|
|
3317
|
+
};
|
|
3318
|
+
rectType: "M" | "KM" | "FT" | "MI";
|
|
3319
|
+
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
3320
|
+
count?: {
|
|
3321
|
+
limit: number;
|
|
3322
|
+
any?: boolean;
|
|
3323
|
+
};
|
|
3324
|
+
withCoord?: boolean;
|
|
3325
|
+
withDist?: boolean;
|
|
3326
|
+
withHash?: boolean;
|
|
3327
|
+
} | undefined) => Promise<({
|
|
3328
|
+
member: TData;
|
|
3329
|
+
} & {
|
|
3330
|
+
coord?: {
|
|
3331
|
+
long: number;
|
|
3332
|
+
lat: number;
|
|
3333
|
+
} | undefined;
|
|
3334
|
+
dist?: number | undefined;
|
|
3335
|
+
hash?: string | undefined;
|
|
3336
|
+
})[]>;
|
|
3337
|
+
/**
|
|
3338
|
+
* @see https://redis.io/commands/geosearchstore
|
|
3339
|
+
*/
|
|
3340
|
+
geosearchstore: <TData>(destination: string, key: string, centerPoint: {
|
|
3341
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
3342
|
+
coordinate: {
|
|
3343
|
+
lon: number;
|
|
3344
|
+
lat: number;
|
|
3345
|
+
};
|
|
3346
|
+
} | {
|
|
3347
|
+
type: "FROMMEMBER" | "frommember";
|
|
3348
|
+
member: TData;
|
|
3349
|
+
}, shape: {
|
|
3350
|
+
type: "BYRADIUS" | "byradius";
|
|
3351
|
+
radius: number;
|
|
3352
|
+
radiusType: "M" | "KM" | "FT" | "MI";
|
|
3353
|
+
} | {
|
|
3354
|
+
type: "BYBOX" | "bybox";
|
|
3355
|
+
rect: {
|
|
3356
|
+
width: number;
|
|
3357
|
+
height: number;
|
|
3358
|
+
};
|
|
3359
|
+
rectType: "M" | "KM" | "FT" | "MI";
|
|
3360
|
+
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
3361
|
+
count?: {
|
|
3362
|
+
limit: number;
|
|
3363
|
+
any?: boolean;
|
|
3364
|
+
};
|
|
3365
|
+
storeDist?: boolean;
|
|
3366
|
+
} | undefined) => Promise<number>;
|
|
2635
3367
|
/**
|
|
2636
3368
|
* @see https://redis.io/commands/get
|
|
2637
3369
|
*/
|
|
@@ -2644,6 +3376,46 @@ declare class Redis {
|
|
|
2644
3376
|
* @see https://redis.io/commands/getdel
|
|
2645
3377
|
*/
|
|
2646
3378
|
getdel: <TData>(key: string) => Promise<TData | null>;
|
|
3379
|
+
/**
|
|
3380
|
+
* @see https://redis.io/commands/getex
|
|
3381
|
+
*/
|
|
3382
|
+
getex: <TData>(key: string, opts?: ({
|
|
3383
|
+
ex: number;
|
|
3384
|
+
px?: never;
|
|
3385
|
+
exat?: never;
|
|
3386
|
+
pxat?: never;
|
|
3387
|
+
persist?: never;
|
|
3388
|
+
} | {
|
|
3389
|
+
ex?: never;
|
|
3390
|
+
px: number;
|
|
3391
|
+
exat?: never;
|
|
3392
|
+
pxat?: never;
|
|
3393
|
+
persist?: never;
|
|
3394
|
+
} | {
|
|
3395
|
+
ex?: never;
|
|
3396
|
+
px?: never;
|
|
3397
|
+
exat: number;
|
|
3398
|
+
pxat?: never;
|
|
3399
|
+
persist?: never;
|
|
3400
|
+
} | {
|
|
3401
|
+
ex?: never;
|
|
3402
|
+
px?: never;
|
|
3403
|
+
exat?: never;
|
|
3404
|
+
pxat: number;
|
|
3405
|
+
persist?: never;
|
|
3406
|
+
} | {
|
|
3407
|
+
ex?: never;
|
|
3408
|
+
px?: never;
|
|
3409
|
+
exat?: never;
|
|
3410
|
+
pxat?: never;
|
|
3411
|
+
persist: true;
|
|
3412
|
+
} | {
|
|
3413
|
+
ex?: never;
|
|
3414
|
+
px?: never;
|
|
3415
|
+
exat?: never;
|
|
3416
|
+
pxat?: never;
|
|
3417
|
+
persist?: never;
|
|
3418
|
+
}) | undefined) => Promise<TData | null>;
|
|
2647
3419
|
/**
|
|
2648
3420
|
* @see https://redis.io/commands/getrange
|
|
2649
3421
|
*/
|
|
@@ -2660,6 +3432,42 @@ declare class Redis {
|
|
|
2660
3432
|
* @see https://redis.io/commands/hexists
|
|
2661
3433
|
*/
|
|
2662
3434
|
hexists: (key: string, field: string) => Promise<number>;
|
|
3435
|
+
/**
|
|
3436
|
+
* @see https://redis.io/commands/hexpire
|
|
3437
|
+
*/
|
|
3438
|
+
hexpire: (key: string, fields: string | number | (string | number)[], seconds: number, option?: ExpireOption | undefined) => Promise<(0 | 1 | 2 | -2)[]>;
|
|
3439
|
+
/**
|
|
3440
|
+
* @see https://redis.io/commands/hexpireat
|
|
3441
|
+
*/
|
|
3442
|
+
hexpireat: (key: string, fields: string | number | (string | number)[], timestamp: number, option?: ExpireOption | undefined) => Promise<(0 | 1 | 2 | -2)[]>;
|
|
3443
|
+
/**
|
|
3444
|
+
* @see https://redis.io/commands/hexpiretime
|
|
3445
|
+
*/
|
|
3446
|
+
hexpiretime: (key: string, fields: string | number | (string | number)[]) => Promise<number[]>;
|
|
3447
|
+
/**
|
|
3448
|
+
* @see https://redis.io/commands/httl
|
|
3449
|
+
*/
|
|
3450
|
+
httl: (key: string, fields: string | number | (string | number)[]) => Promise<number[]>;
|
|
3451
|
+
/**
|
|
3452
|
+
* @see https://redis.io/commands/hpexpire
|
|
3453
|
+
*/
|
|
3454
|
+
hpexpire: (key: string, fields: string | number | (string | number)[], milliseconds: number, option?: ExpireOption | undefined) => Promise<(0 | 1 | 2 | -2)[]>;
|
|
3455
|
+
/**
|
|
3456
|
+
* @see https://redis.io/commands/hpexpireat
|
|
3457
|
+
*/
|
|
3458
|
+
hpexpireat: (key: string, fields: string | number | (string | number)[], timestamp: number, option?: ExpireOption | undefined) => Promise<(0 | 1 | 2 | -2)[]>;
|
|
3459
|
+
/**
|
|
3460
|
+
* @see https://redis.io/commands/hpexpiretime
|
|
3461
|
+
*/
|
|
3462
|
+
hpexpiretime: (key: string, fields: string | number | (string | number)[]) => Promise<number[]>;
|
|
3463
|
+
/**
|
|
3464
|
+
* @see https://redis.io/commands/hpttl
|
|
3465
|
+
*/
|
|
3466
|
+
hpttl: (key: string, fields: string | number | (string | number)[]) => Promise<number[]>;
|
|
3467
|
+
/**
|
|
3468
|
+
* @see https://redis.io/commands/hpersist
|
|
3469
|
+
*/
|
|
3470
|
+
hpersist: (key: string, fields: string | number | (string | number)[]) => Promise<(1 | -2 | -1)[]>;
|
|
2663
3471
|
/**
|
|
2664
3472
|
* @see https://redis.io/commands/hget
|
|
2665
3473
|
*/
|
|
@@ -2691,27 +3499,23 @@ declare class Redis {
|
|
|
2691
3499
|
/**
|
|
2692
3500
|
* @see https://redis.io/commands/hmset
|
|
2693
3501
|
*/
|
|
2694
|
-
hmset: <TData>(key: string, kv:
|
|
2695
|
-
[field: string]: TData;
|
|
2696
|
-
}) => Promise<"OK">;
|
|
3502
|
+
hmset: <TData>(key: string, kv: Record<string, TData>) => Promise<"OK">;
|
|
2697
3503
|
/**
|
|
2698
3504
|
* @see https://redis.io/commands/hrandfield
|
|
2699
3505
|
*/
|
|
2700
3506
|
hrandfield: {
|
|
2701
|
-
(key: string): Promise<string>;
|
|
3507
|
+
(key: string): Promise<string | null>;
|
|
2702
3508
|
(key: string, count: number): Promise<string[]>;
|
|
2703
3509
|
<TData extends Record<string, unknown>>(key: string, count: number, withValues: boolean): Promise<Partial<TData>>;
|
|
2704
3510
|
};
|
|
2705
3511
|
/**
|
|
2706
3512
|
* @see https://redis.io/commands/hscan
|
|
2707
3513
|
*/
|
|
2708
|
-
hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[
|
|
3514
|
+
hscan: (key: string, cursor: string | number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
|
|
2709
3515
|
/**
|
|
2710
3516
|
* @see https://redis.io/commands/hset
|
|
2711
3517
|
*/
|
|
2712
|
-
hset: <TData>(key: string, kv:
|
|
2713
|
-
[field: string]: TData;
|
|
2714
|
-
}) => Promise<number>;
|
|
3518
|
+
hset: <TData>(key: string, kv: Record<string, TData>) => Promise<number>;
|
|
2715
3519
|
/**
|
|
2716
3520
|
* @see https://redis.io/commands/hsetnx
|
|
2717
3521
|
*/
|
|
@@ -2760,13 +3564,17 @@ declare class Redis {
|
|
|
2760
3564
|
* @see https://redis.io/commands/lpop
|
|
2761
3565
|
*/
|
|
2762
3566
|
lpop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
|
|
3567
|
+
/**
|
|
3568
|
+
* @see https://redis.io/commands/lmpop
|
|
3569
|
+
*/
|
|
3570
|
+
lmpop: <TData>(numkeys: number, keys: string[], args_2: "LEFT" | "RIGHT", count?: number | undefined) => Promise<[string, TData[]] | null>;
|
|
2763
3571
|
/**
|
|
2764
3572
|
* @see https://redis.io/commands/lpos
|
|
2765
3573
|
*/
|
|
2766
3574
|
lpos: <TData = number>(key: string, element: unknown, opts?: {
|
|
2767
|
-
rank?: number
|
|
2768
|
-
count?: number
|
|
2769
|
-
maxLen?: number
|
|
3575
|
+
rank?: number;
|
|
3576
|
+
count?: number;
|
|
3577
|
+
maxLen?: number;
|
|
2770
3578
|
} | undefined) => Promise<TData>;
|
|
2771
3579
|
/**
|
|
2772
3580
|
* @see https://redis.io/commands/lpush
|
|
@@ -2799,15 +3607,11 @@ declare class Redis {
|
|
|
2799
3607
|
/**
|
|
2800
3608
|
* @see https://redis.io/commands/mset
|
|
2801
3609
|
*/
|
|
2802
|
-
mset: <TData>(kv:
|
|
2803
|
-
[key: string]: TData;
|
|
2804
|
-
}) => Promise<"OK">;
|
|
3610
|
+
mset: <TData>(kv: Record<string, TData>) => Promise<"OK">;
|
|
2805
3611
|
/**
|
|
2806
3612
|
* @see https://redis.io/commands/msetnx
|
|
2807
3613
|
*/
|
|
2808
|
-
msetnx: <TData>(kv:
|
|
2809
|
-
[key: string]: TData;
|
|
2810
|
-
}) => Promise<number>;
|
|
3614
|
+
msetnx: <TData>(kv: Record<string, TData>) => Promise<number>;
|
|
2811
3615
|
/**
|
|
2812
3616
|
* @see https://redis.io/commands/persist
|
|
2813
3617
|
*/
|
|
@@ -2815,11 +3619,23 @@ declare class Redis {
|
|
|
2815
3619
|
/**
|
|
2816
3620
|
* @see https://redis.io/commands/pexpire
|
|
2817
3621
|
*/
|
|
2818
|
-
pexpire: (key: string, milliseconds: number) => Promise<0 | 1>;
|
|
3622
|
+
pexpire: (key: string, milliseconds: number, option?: ExpireOption | undefined) => Promise<0 | 1>;
|
|
2819
3623
|
/**
|
|
2820
3624
|
* @see https://redis.io/commands/pexpireat
|
|
2821
3625
|
*/
|
|
2822
|
-
pexpireat: (key: string, unix: number) => Promise<0 | 1>;
|
|
3626
|
+
pexpireat: (key: string, unix: number, option?: ExpireOption | undefined) => Promise<0 | 1>;
|
|
3627
|
+
/**
|
|
3628
|
+
* @see https://redis.io/commands/pfadd
|
|
3629
|
+
*/
|
|
3630
|
+
pfadd: (args_0: string, ...args_1: unknown[]) => Promise<number>;
|
|
3631
|
+
/**
|
|
3632
|
+
* @see https://redis.io/commands/pfcount
|
|
3633
|
+
*/
|
|
3634
|
+
pfcount: (args_0: string, ...args_1: string[]) => Promise<number>;
|
|
3635
|
+
/**
|
|
3636
|
+
* @see https://redis.io/commands/pfmerge
|
|
3637
|
+
*/
|
|
3638
|
+
pfmerge: (destination_key: string, ...args_1: string[]) => Promise<"OK">;
|
|
2823
3639
|
/**
|
|
2824
3640
|
* @see https://redis.io/commands/ping
|
|
2825
3641
|
*/
|
|
@@ -2828,6 +3644,10 @@ declare class Redis {
|
|
|
2828
3644
|
* @see https://redis.io/commands/psetex
|
|
2829
3645
|
*/
|
|
2830
3646
|
psetex: <TData>(key: string, ttl: number, value: TData) => Promise<string>;
|
|
3647
|
+
/**
|
|
3648
|
+
* @see https://redis.io/commands/psubscribe
|
|
3649
|
+
*/
|
|
3650
|
+
psubscribe: <TMessage>(patterns: string | string[]) => Subscriber<TMessage>;
|
|
2831
3651
|
/**
|
|
2832
3652
|
* @see https://redis.io/commands/pttl
|
|
2833
3653
|
*/
|
|
@@ -2863,11 +3683,14 @@ declare class Redis {
|
|
|
2863
3683
|
/**
|
|
2864
3684
|
* @see https://redis.io/commands/sadd
|
|
2865
3685
|
*/
|
|
2866
|
-
sadd: <TData>(key: string, ...members: TData[]) => Promise<number>;
|
|
3686
|
+
sadd: <TData>(key: string, member: TData, ...members: TData[]) => Promise<number>;
|
|
2867
3687
|
/**
|
|
2868
3688
|
* @see https://redis.io/commands/scan
|
|
2869
3689
|
*/
|
|
2870
|
-
scan
|
|
3690
|
+
scan(cursor: string | number): Promise<ScanResultStandard>;
|
|
3691
|
+
scan<TOptions extends ScanCommandOptions>(cursor: string | number, opts: TOptions): Promise<TOptions extends {
|
|
3692
|
+
withType: true;
|
|
3693
|
+
} ? ScanResultWithType : ScanResultStandard>;
|
|
2871
3694
|
/**
|
|
2872
3695
|
* @see https://redis.io/commands/scard
|
|
2873
3696
|
*/
|
|
@@ -2951,11 +3774,15 @@ declare class Redis {
|
|
|
2951
3774
|
/**
|
|
2952
3775
|
* @see https://redis.io/commands/sscan
|
|
2953
3776
|
*/
|
|
2954
|
-
sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[
|
|
3777
|
+
sscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
|
|
2955
3778
|
/**
|
|
2956
3779
|
* @see https://redis.io/commands/strlen
|
|
2957
3780
|
*/
|
|
2958
3781
|
strlen: (key: string) => Promise<number>;
|
|
3782
|
+
/**
|
|
3783
|
+
* @see https://redis.io/commands/subscribe
|
|
3784
|
+
*/
|
|
3785
|
+
subscribe: <TMessage>(channels: string | string[]) => Subscriber<TMessage>;
|
|
2959
3786
|
/**
|
|
2960
3787
|
* @see https://redis.io/commands/sunion
|
|
2961
3788
|
*/
|
|
@@ -2987,11 +3814,9 @@ declare class Redis {
|
|
|
2987
3814
|
/**
|
|
2988
3815
|
* @see https://redis.io/commands/xadd
|
|
2989
3816
|
*/
|
|
2990
|
-
xadd: (key: string, id: string, entries: {
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
nomkStream?: boolean | undefined;
|
|
2994
|
-
trim?: (({
|
|
3817
|
+
xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
|
|
3818
|
+
nomkStream?: boolean;
|
|
3819
|
+
trim?: ({
|
|
2995
3820
|
type: "MAXLEN" | "maxlen";
|
|
2996
3821
|
threshold: number;
|
|
2997
3822
|
} | {
|
|
@@ -2999,20 +3824,117 @@ declare class Redis {
|
|
|
2999
3824
|
threshold: string;
|
|
3000
3825
|
}) & ({
|
|
3001
3826
|
comparison: "~";
|
|
3002
|
-
limit?: number
|
|
3827
|
+
limit?: number;
|
|
3003
3828
|
} | {
|
|
3004
3829
|
comparison: "=";
|
|
3005
|
-
limit?:
|
|
3006
|
-
})
|
|
3830
|
+
limit?: never;
|
|
3831
|
+
});
|
|
3007
3832
|
} | undefined) => Promise<string>;
|
|
3833
|
+
/**
|
|
3834
|
+
* @see https://redis.io/commands/xack
|
|
3835
|
+
*/
|
|
3836
|
+
xack: (key: string, group: string, id: string | string[]) => Promise<number>;
|
|
3837
|
+
/**
|
|
3838
|
+
* @see https://redis.io/commands/xdel
|
|
3839
|
+
*/
|
|
3840
|
+
xdel: (key: string, ids: string | string[]) => Promise<number>;
|
|
3841
|
+
/**
|
|
3842
|
+
* @see https://redis.io/commands/xgroup
|
|
3843
|
+
*/
|
|
3844
|
+
xgroup: (key: string, opts: {
|
|
3845
|
+
type: "CREATE";
|
|
3846
|
+
group: string;
|
|
3847
|
+
id: `$` | string;
|
|
3848
|
+
options?: {
|
|
3849
|
+
MKSTREAM?: boolean;
|
|
3850
|
+
ENTRIESREAD?: number;
|
|
3851
|
+
};
|
|
3852
|
+
} | {
|
|
3853
|
+
type: "CREATECONSUMER";
|
|
3854
|
+
group: string;
|
|
3855
|
+
consumer: string;
|
|
3856
|
+
} | {
|
|
3857
|
+
type: "DELCONSUMER";
|
|
3858
|
+
group: string;
|
|
3859
|
+
consumer: string;
|
|
3860
|
+
} | {
|
|
3861
|
+
type: "DESTROY";
|
|
3862
|
+
group: string;
|
|
3863
|
+
} | {
|
|
3864
|
+
type: "SETID";
|
|
3865
|
+
group: string;
|
|
3866
|
+
id: `$` | string;
|
|
3867
|
+
options?: {
|
|
3868
|
+
ENTRIESREAD?: number;
|
|
3869
|
+
};
|
|
3870
|
+
}) => Promise<never>;
|
|
3871
|
+
/**
|
|
3872
|
+
* @see https://redis.io/commands/xread
|
|
3873
|
+
*/
|
|
3874
|
+
xread: (...args: CommandArgs<typeof XReadCommand>) => Promise<unknown[]>;
|
|
3875
|
+
/**
|
|
3876
|
+
* @see https://redis.io/commands/xreadgroup
|
|
3877
|
+
*/
|
|
3878
|
+
xreadgroup: (...args: CommandArgs<typeof XReadGroupCommand>) => Promise<unknown[]>;
|
|
3879
|
+
/**
|
|
3880
|
+
* @see https://redis.io/commands/xinfo
|
|
3881
|
+
*/
|
|
3882
|
+
xinfo: (key: string, options: {
|
|
3883
|
+
type: "CONSUMERS";
|
|
3884
|
+
group: string;
|
|
3885
|
+
} | {
|
|
3886
|
+
type: "GROUPS";
|
|
3887
|
+
}) => Promise<unknown[]>;
|
|
3888
|
+
/**
|
|
3889
|
+
* @see https://redis.io/commands/xlen
|
|
3890
|
+
*/
|
|
3891
|
+
xlen: (key: string) => Promise<number>;
|
|
3892
|
+
/**
|
|
3893
|
+
* @see https://redis.io/commands/xpending
|
|
3894
|
+
*/
|
|
3895
|
+
xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
|
|
3896
|
+
idleTime?: number;
|
|
3897
|
+
consumer?: string | string[];
|
|
3898
|
+
} | undefined) => Promise<unknown[]>;
|
|
3899
|
+
/**
|
|
3900
|
+
* @see https://redis.io/commands/xclaim
|
|
3901
|
+
*/
|
|
3902
|
+
xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
|
|
3903
|
+
idleMS?: number;
|
|
3904
|
+
timeMS?: number;
|
|
3905
|
+
retryCount?: number;
|
|
3906
|
+
force?: boolean;
|
|
3907
|
+
justId?: boolean;
|
|
3908
|
+
lastId?: number;
|
|
3909
|
+
} | undefined) => Promise<unknown[]>;
|
|
3910
|
+
/**
|
|
3911
|
+
* @see https://redis.io/commands/xautoclaim
|
|
3912
|
+
*/
|
|
3913
|
+
xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
|
|
3914
|
+
count?: number;
|
|
3915
|
+
justId?: boolean;
|
|
3916
|
+
} | undefined) => Promise<unknown[]>;
|
|
3917
|
+
/**
|
|
3918
|
+
* @see https://redis.io/commands/xtrim
|
|
3919
|
+
*/
|
|
3920
|
+
xtrim: (key: string, options: {
|
|
3921
|
+
strategy: "MAXLEN" | "MINID";
|
|
3922
|
+
exactness?: "~" | "=";
|
|
3923
|
+
threshold: number | string;
|
|
3924
|
+
limit?: number;
|
|
3925
|
+
}) => Promise<number>;
|
|
3008
3926
|
/**
|
|
3009
3927
|
* @see https://redis.io/commands/xrange
|
|
3010
3928
|
*/
|
|
3011
3929
|
xrange: (key: string, start: string, end: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
|
|
3930
|
+
/**
|
|
3931
|
+
* @see https://redis.io/commands/xrevrange
|
|
3932
|
+
*/
|
|
3933
|
+
xrevrange: (key: string, end: string, start: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
|
|
3012
3934
|
/**
|
|
3013
3935
|
* @see https://redis.io/commands/zadd
|
|
3014
3936
|
*/
|
|
3015
|
-
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions
|
|
3937
|
+
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]]) => Promise<number | null>;
|
|
3016
3938
|
/**
|
|
3017
3939
|
* @see https://redis.io/commands/zcard
|
|
3018
3940
|
*/
|
|
@@ -3052,21 +3974,11 @@ declare class Redis {
|
|
|
3052
3974
|
/**
|
|
3053
3975
|
* @see https://redis.io/commands/zrange
|
|
3054
3976
|
*/
|
|
3055
|
-
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
byLex: true;
|
|
3061
|
-
} & ZRangeCommandOptions
|
|
3062
|
-
] | [
|
|
3063
|
-
key: string,
|
|
3064
|
-
min: number | `(${number}` | "-inf" | "+inf",
|
|
3065
|
-
max: number | `(${number}` | "-inf" | "+inf",
|
|
3066
|
-
opts: {
|
|
3067
|
-
byScore: true;
|
|
3068
|
-
} & ZRangeCommandOptions
|
|
3069
|
-
]) => Promise<TData>;
|
|
3977
|
+
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
|
|
3978
|
+
byLex: true;
|
|
3979
|
+
} & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
|
|
3980
|
+
byScore: true;
|
|
3981
|
+
} & ZRangeCommandOptions]) => Promise<TData>;
|
|
3070
3982
|
/**
|
|
3071
3983
|
* @see https://redis.io/commands/zrank
|
|
3072
3984
|
*/
|
|
@@ -3086,7 +3998,7 @@ declare class Redis {
|
|
|
3086
3998
|
/**
|
|
3087
3999
|
* @see https://redis.io/commands/zremrangebyscore
|
|
3088
4000
|
*/
|
|
3089
|
-
zremrangebyscore: (key: string, min: number, max: number) => Promise<number>;
|
|
4001
|
+
zremrangebyscore: (key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf") => Promise<number>;
|
|
3090
4002
|
/**
|
|
3091
4003
|
* @see https://redis.io/commands/zrevrank
|
|
3092
4004
|
*/
|
|
@@ -3094,7 +4006,7 @@ declare class Redis {
|
|
|
3094
4006
|
/**
|
|
3095
4007
|
* @see https://redis.io/commands/zscan
|
|
3096
4008
|
*/
|
|
3097
|
-
zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[
|
|
4009
|
+
zscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
|
|
3098
4010
|
/**
|
|
3099
4011
|
* @see https://redis.io/commands/zscore
|
|
3100
4012
|
*/
|
|
@@ -3109,6 +4021,30 @@ declare class Redis {
|
|
|
3109
4021
|
zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
|
|
3110
4022
|
}
|
|
3111
4023
|
|
|
4024
|
+
type UpstashErrorOptions = Pick<NonNullable<ConstructorParameters<typeof Error>[1]>, "cause">;
|
|
4025
|
+
/**
|
|
4026
|
+
* Result of a bad request to upstash
|
|
4027
|
+
*/
|
|
4028
|
+
declare class UpstashError extends Error {
|
|
4029
|
+
constructor(message: string, options?: ErrorOptions);
|
|
4030
|
+
}
|
|
4031
|
+
declare class UrlError extends Error {
|
|
4032
|
+
constructor(url: string);
|
|
4033
|
+
}
|
|
4034
|
+
declare class UpstashJSONParseError extends UpstashError {
|
|
4035
|
+
constructor(body: string, options?: UpstashErrorOptions);
|
|
4036
|
+
}
|
|
4037
|
+
|
|
4038
|
+
type error_UpstashError = UpstashError;
|
|
4039
|
+
declare const error_UpstashError: typeof UpstashError;
|
|
4040
|
+
type error_UpstashJSONParseError = UpstashJSONParseError;
|
|
4041
|
+
declare const error_UpstashJSONParseError: typeof UpstashJSONParseError;
|
|
4042
|
+
type error_UrlError = UrlError;
|
|
4043
|
+
declare const error_UrlError: typeof UrlError;
|
|
4044
|
+
declare namespace error {
|
|
4045
|
+
export { error_UpstashError as UpstashError, error_UpstashJSONParseError as UpstashJSONParseError, error_UrlError as UrlError };
|
|
4046
|
+
}
|
|
4047
|
+
|
|
3112
4048
|
/**
|
|
3113
4049
|
* @see https://redis.io/commands/zdiffstore
|
|
3114
4050
|
*/
|
|
@@ -3123,4 +4059,4 @@ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] |
|
|
|
3123
4059
|
constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
|
|
3124
4060
|
}
|
|
3125
4061
|
|
|
3126
|
-
export {
|
|
4062
|
+
export { HPersistCommand as $, AppendCommand as A, BitCountCommand as B, CopyCommand as C, DBSizeCommand as D, EchoCommand as E, FlushAllCommand as F, GeoAddCommand as G, type HttpClientConfig as H, GetCommand as I, GetBitCommand as J, GetDelCommand as K, GetExCommand as L, GetRangeCommand as M, GetSetCommand as N, HDelCommand as O, Pipeline as P, HExistsCommand as Q, type RedisOptions as R, HExpireCommand as S, HExpireAtCommand as T, type UpstashRequest as U, HExpireTimeCommand as V, HTtlCommand as W, HPExpireCommand as X, HPExpireAtCommand as Y, HPExpireTimeCommand as Z, HPTtlCommand as _, type RequesterConfig as a, RenameNXCommand as a$, HGetCommand as a0, HGetAllCommand as a1, HIncrByCommand as a2, HIncrByFloatCommand as a3, HKeysCommand as a4, HLenCommand as a5, HMGetCommand as a6, HMSetCommand as a7, HRandFieldCommand as a8, HScanCommand as a9, JsonStrLenCommand as aA, JsonToggleCommand as aB, JsonTypeCommand as aC, KeysCommand as aD, LIndexCommand as aE, LInsertCommand as aF, LLenCommand as aG, LMoveCommand as aH, LPopCommand as aI, LPushCommand as aJ, LPushXCommand as aK, LRangeCommand as aL, LRemCommand as aM, LSetCommand as aN, LTrimCommand as aO, MGetCommand as aP, MSetCommand as aQ, MSetNXCommand as aR, PersistCommand as aS, PExpireCommand as aT, PExpireAtCommand as aU, PingCommand as aV, PSetEXCommand as aW, PTtlCommand as aX, PublishCommand as aY, RandomKeyCommand as aZ, RenameCommand as a_, HSetCommand as aa, HSetNXCommand as ab, HStrLenCommand as ac, HValsCommand as ad, IncrCommand as ae, IncrByCommand as af, IncrByFloatCommand as ag, JsonArrAppendCommand as ah, JsonArrIndexCommand as ai, JsonArrInsertCommand as aj, JsonArrLenCommand as ak, JsonArrPopCommand as al, JsonArrTrimCommand as am, JsonClearCommand as an, JsonDelCommand as ao, JsonForgetCommand as ap, JsonGetCommand as aq, JsonMergeCommand as ar, JsonMGetCommand as as, JsonNumIncrByCommand as at, JsonNumMultByCommand as au, JsonObjKeysCommand as av, JsonObjLenCommand as aw, JsonRespCommand as ax, JsonSetCommand as ay, JsonStrAppendCommand as az, Redis as b, type ZUnionCommandOptions as b$, RPopCommand as b0, RPushCommand as b1, RPushXCommand as b2, SAddCommand as b3, ScanCommand as b4, type ScanCommandOptions as b5, SCardCommand as b6, ScriptExistsCommand as b7, ScriptFlushCommand as b8, ScriptLoadCommand as b9, UnlinkCommand as bA, XAddCommand as bB, XRangeCommand as bC, type ScoreMember as bD, type ZAddCommandOptions as bE, ZAddCommand as bF, ZCardCommand as bG, ZCountCommand as bH, ZDiffStoreCommand as bI, ZIncrByCommand as bJ, ZInterStoreCommand as bK, type ZInterStoreCommandOptions as bL, ZLexCountCommand as bM, ZMScoreCommand as bN, ZPopMaxCommand as bO, ZPopMinCommand as bP, ZRangeCommand as bQ, type ZRangeCommandOptions as bR, ZRankCommand as bS, ZRemCommand as bT, ZRemRangeByLexCommand as bU, ZRemRangeByRankCommand as bV, ZRemRangeByScoreCommand as bW, ZRevRankCommand as bX, ZScanCommand as bY, ZScoreCommand as bZ, ZUnionCommand as b_, SDiffCommand as ba, SDiffStoreCommand as bb, SetCommand as bc, type SetCommandOptions as bd, SetBitCommand as be, SetExCommand as bf, SetNxCommand as bg, SetRangeCommand as bh, SInterCommand as bi, SInterStoreCommand as bj, SIsMemberCommand as bk, SMembersCommand as bl, SMIsMemberCommand as bm, SMoveCommand as bn, SPopCommand as bo, SRandMemberCommand as bp, SRemCommand as bq, SScanCommand as br, StrLenCommand as bs, SUnionCommand as bt, SUnionStoreCommand as bu, TimeCommand as bv, TouchCommand as bw, TtlCommand as bx, type Type as by, TypeCommand as bz, type Requester as c, ZUnionStoreCommand as c0, type ZUnionStoreCommandOptions as c1, type UpstashResponse as d, error as e, BitOpCommand as f, BitPosCommand as g, DecrCommand as h, DecrByCommand as i, DelCommand as j, EvalROCommand as k, EvalCommand as l, EvalshaROCommand as m, EvalshaCommand as n, ExistsCommand as o, ExpireCommand as p, type ExpireOption as q, ExpireAtCommand as r, FlushDBCommand as s, type GeoAddCommandOptions as t, type GeoMember as u, GeoDistCommand as v, GeoHashCommand as w, GeoPosCommand as x, GeoSearchCommand as y, GeoSearchStoreCommand as z };
|