@upstash/redis 0.0.0-ci.e475de1f85007c6e91b7c723aae0092693599d18-20231218001438 → 0.0.0-ci.e4eab2833c7196d06833dccf8f132ddbc18c2cfa-20241008071408
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 +6 -2
- package/chunk-6OUEAHUL.mjs +3829 -0
- package/cloudflare.d.mts +10 -5
- package/cloudflare.d.ts +10 -5
- package/cloudflare.js +3939 -1
- package/cloudflare.mjs +91 -1
- package/fastly.d.mts +10 -5
- package/fastly.d.ts +10 -5
- package/fastly.js +3912 -1
- package/fastly.mjs +64 -1
- package/nodejs.d.mts +12 -24
- package/nodejs.d.ts +12 -24
- package/nodejs.js +3958 -1
- package/nodejs.mjs +110 -1
- package/package.json +1 -1
- package/{zmscore-0d2a25ed.d.ts → zmscore-CiyMzgdc.d.mts} +604 -327
- package/zmscore-CiyMzgdc.d.ts +3503 -0
- package/chunk-3KV34DA6.mjs +0 -1
- package/chunk-DRRUVDJQ.js +0 -1
|
@@ -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,21 @@ type UpstashRequest = {
|
|
|
33
36
|
* Request body will be serialized to json
|
|
34
37
|
*/
|
|
35
38
|
body?: unknown;
|
|
39
|
+
upstashSyncToken?: string;
|
|
36
40
|
};
|
|
37
41
|
type UpstashResponse<TResult> = {
|
|
38
42
|
result?: TResult;
|
|
39
43
|
error?: string;
|
|
40
44
|
};
|
|
41
45
|
interface Requester {
|
|
46
|
+
/**
|
|
47
|
+
* 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.
|
|
48
|
+
*/
|
|
49
|
+
readYourWrites?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* 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.
|
|
52
|
+
*/
|
|
53
|
+
upstashSyncToken?: string;
|
|
42
54
|
request: <TResult = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult>>;
|
|
43
55
|
}
|
|
44
56
|
type RetryConfig = false | {
|
|
@@ -106,6 +118,7 @@ type CommandOptions<TResult, TData> = {
|
|
|
106
118
|
* @default true
|
|
107
119
|
*/
|
|
108
120
|
automaticDeserialization?: boolean;
|
|
121
|
+
latencyLogging?: boolean;
|
|
109
122
|
};
|
|
110
123
|
/**
|
|
111
124
|
* Command offers default (de)serialization and the exec method to all commands.
|
|
@@ -220,8 +233,8 @@ type ScanCommandOptions = {
|
|
|
220
233
|
/**
|
|
221
234
|
* @see https://redis.io/commands/scan
|
|
222
235
|
*/
|
|
223
|
-
declare class ScanCommand extends Command<[
|
|
224
|
-
constructor([cursor, opts]: [cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[
|
|
236
|
+
declare class ScanCommand extends Command<[string, string[]], [string, string[]]> {
|
|
237
|
+
constructor([cursor, opts]: [cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, string[]], [string, string[]]>);
|
|
225
238
|
}
|
|
226
239
|
|
|
227
240
|
type GeoAddCommandOptions = {
|
|
@@ -233,11 +246,11 @@ type GeoAddCommandOptions = {
|
|
|
233
246
|
} & {
|
|
234
247
|
ch?: boolean;
|
|
235
248
|
});
|
|
236
|
-
|
|
249
|
+
type GeoMember<TMemberType> = {
|
|
237
250
|
latitude: number;
|
|
238
251
|
longitude: number;
|
|
239
252
|
member: TMemberType;
|
|
240
|
-
}
|
|
253
|
+
};
|
|
241
254
|
/**
|
|
242
255
|
* @see https://redis.io/commands/geoadd
|
|
243
256
|
*/
|
|
@@ -264,6 +277,28 @@ declare class BitCountCommand extends Command<number, number> {
|
|
|
264
277
|
constructor(cmd: [key: string, start: number, end: number], opts?: CommandOptions<number, number>);
|
|
265
278
|
}
|
|
266
279
|
|
|
280
|
+
type SubCommandArgs<TRest extends unknown[] = []> = [
|
|
281
|
+
encoding: string,
|
|
282
|
+
offset: number | string,
|
|
283
|
+
...rest: TRest
|
|
284
|
+
];
|
|
285
|
+
/**
|
|
286
|
+
* @see https://redis.io/commands/bitfield
|
|
287
|
+
*/
|
|
288
|
+
declare class BitFieldCommand<T = Promise<number[]>> {
|
|
289
|
+
private client;
|
|
290
|
+
private opts?;
|
|
291
|
+
private execOperation;
|
|
292
|
+
private command;
|
|
293
|
+
constructor(args: [key: string], client: Requester, opts?: CommandOptions<number[], number[]> | undefined, execOperation?: (command: Command<number[], number[]>) => T);
|
|
294
|
+
private chain;
|
|
295
|
+
get(...args: SubCommandArgs): this;
|
|
296
|
+
set(...args: SubCommandArgs<[value: number]>): this;
|
|
297
|
+
incrby(...args: SubCommandArgs<[increment: number]>): this;
|
|
298
|
+
overflow(overflow: "WRAP" | "SAT" | "FAIL"): this;
|
|
299
|
+
exec(): T;
|
|
300
|
+
}
|
|
301
|
+
|
|
267
302
|
/**
|
|
268
303
|
* @see https://redis.io/commands/bitop
|
|
269
304
|
*/
|
|
@@ -344,11 +379,9 @@ declare class ExistsCommand extends Command<number, number> {
|
|
|
344
379
|
constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
|
|
345
380
|
}
|
|
346
381
|
|
|
347
|
-
|
|
348
|
-
* @see https://redis.io/commands/expire
|
|
349
|
-
*/
|
|
382
|
+
type ExpireOptions = "NX" | "nx" | "XX" | "xx" | "GT" | "gt" | "LT" | "lt";
|
|
350
383
|
declare class ExpireCommand extends Command<"0" | "1", 0 | 1> {
|
|
351
|
-
constructor(cmd: [key: string, seconds: number], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
384
|
+
constructor(cmd: [key: string, seconds: number, option?: ExpireOptions], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
352
385
|
}
|
|
353
386
|
|
|
354
387
|
/**
|
|
@@ -392,7 +425,7 @@ declare class GeoDistCommand<TMemberType = string> extends Command<number | null
|
|
|
392
425
|
* @see https://redis.io/commands/geohash
|
|
393
426
|
*/
|
|
394
427
|
declare class GeoHashCommand<TMember = string> extends Command<(string | null)[], (string | null)[]> {
|
|
395
|
-
constructor(cmd: [string, ...
|
|
428
|
+
constructor(cmd: [string, ...TMember[]], opts?: CommandOptions<(string | null)[], (string | null)[]>);
|
|
396
429
|
}
|
|
397
430
|
|
|
398
431
|
type Coordinates = {
|
|
@@ -619,9 +652,7 @@ declare class HMGetCommand<TData extends Record<string, unknown>> extends Comman
|
|
|
619
652
|
* @see https://redis.io/commands/hmset
|
|
620
653
|
*/
|
|
621
654
|
declare class HMSetCommand<TData> extends Command<"OK", "OK"> {
|
|
622
|
-
constructor([key, kv]: [key: string, kv:
|
|
623
|
-
[field: string]: TData;
|
|
624
|
-
}], opts?: CommandOptions<"OK", "OK">);
|
|
655
|
+
constructor([key, kv]: [key: string, kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">);
|
|
625
656
|
}
|
|
626
657
|
|
|
627
658
|
/**
|
|
@@ -637,22 +668,20 @@ declare class HRandFieldCommand<TData extends string | string[] | Record<string,
|
|
|
637
668
|
* @see https://redis.io/commands/hscan
|
|
638
669
|
*/
|
|
639
670
|
declare class HScanCommand extends Command<[
|
|
640
|
-
|
|
671
|
+
string,
|
|
641
672
|
(string | number)[]
|
|
642
673
|
], [
|
|
643
|
-
|
|
674
|
+
string,
|
|
644
675
|
(string | number)[]
|
|
645
676
|
]> {
|
|
646
|
-
constructor([key, cursor, cmdOpts]: [key: string, cursor: number, cmdOpts?: ScanCommandOptions], opts?: CommandOptions<[
|
|
677
|
+
constructor([key, cursor, cmdOpts]: [key: string, cursor: string | number, cmdOpts?: ScanCommandOptions], opts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
|
|
647
678
|
}
|
|
648
679
|
|
|
649
680
|
/**
|
|
650
681
|
* @see https://redis.io/commands/hset
|
|
651
682
|
*/
|
|
652
683
|
declare class HSetCommand<TData> extends Command<number, number> {
|
|
653
|
-
constructor([key, kv]: [key: string, kv:
|
|
654
|
-
[field: string]: TData;
|
|
655
|
-
}], opts?: CommandOptions<number, number>);
|
|
684
|
+
constructor([key, kv]: [key: string, kv: Record<string, TData>], opts?: CommandOptions<number, number>);
|
|
656
685
|
}
|
|
657
686
|
|
|
658
687
|
/**
|
|
@@ -778,10 +807,21 @@ declare class JsonGetCommand<TData extends (unknown | Record<string, unknown>) |
|
|
|
778
807
|
/**
|
|
779
808
|
* @see https://redis.io/commands/json.mget
|
|
780
809
|
*/
|
|
781
|
-
declare class JsonMGetCommand<TData
|
|
810
|
+
declare class JsonMGetCommand<TData = unknown[]> extends Command<TData, TData> {
|
|
782
811
|
constructor(cmd: [keys: string[], path: string], opts?: CommandOptions<TData, TData>);
|
|
783
812
|
}
|
|
784
813
|
|
|
814
|
+
/**
|
|
815
|
+
* @see https://redis.io/commands/json.mset
|
|
816
|
+
*/
|
|
817
|
+
declare class JsonMSetCommand<TData extends number | string | boolean | Record<string, unknown> | (number | string | boolean | Record<string, unknown>)[]> extends Command<"OK" | null, "OK" | null> {
|
|
818
|
+
constructor(cmd: {
|
|
819
|
+
key: string;
|
|
820
|
+
path: string;
|
|
821
|
+
value: TData;
|
|
822
|
+
}[], opts?: CommandOptions<"OK" | null, "OK" | null>);
|
|
823
|
+
}
|
|
824
|
+
|
|
785
825
|
/**
|
|
786
826
|
* @see https://redis.io/commands/json.numincrby
|
|
787
827
|
*/
|
|
@@ -938,25 +978,21 @@ declare class LTrimCommand extends Command<"OK", "OK"> {
|
|
|
938
978
|
* @see https://redis.io/commands/mget
|
|
939
979
|
*/
|
|
940
980
|
declare class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
|
|
941
|
-
constructor(cmd: [string[]] | [...
|
|
981
|
+
constructor(cmd: [string[]] | [...string[]], opts?: CommandOptions<(string | null)[], TData>);
|
|
942
982
|
}
|
|
943
983
|
|
|
944
984
|
/**
|
|
945
985
|
* @see https://redis.io/commands/mset
|
|
946
986
|
*/
|
|
947
987
|
declare class MSetCommand<TData> extends Command<"OK", "OK"> {
|
|
948
|
-
constructor([kv]: [kv:
|
|
949
|
-
[key: string]: TData;
|
|
950
|
-
}], opts?: CommandOptions<"OK", "OK">);
|
|
988
|
+
constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">);
|
|
951
989
|
}
|
|
952
990
|
|
|
953
991
|
/**
|
|
954
992
|
* @see https://redis.io/commands/msetnx
|
|
955
993
|
*/
|
|
956
994
|
declare class MSetNXCommand<TData = string> extends Command<number, number> {
|
|
957
|
-
constructor([kv]: [kv:
|
|
958
|
-
[key: string]: TData;
|
|
959
|
-
}], opts?: CommandOptions<number, number>);
|
|
995
|
+
constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<number, number>);
|
|
960
996
|
}
|
|
961
997
|
|
|
962
998
|
/**
|
|
@@ -1054,7 +1090,7 @@ declare class RPushXCommand<TData = string> extends Command<number, number> {
|
|
|
1054
1090
|
* @see https://redis.io/commands/sadd
|
|
1055
1091
|
*/
|
|
1056
1092
|
declare class SAddCommand<TData = string> extends Command<number, number> {
|
|
1057
|
-
constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
|
|
1093
|
+
constructor(cmd: [key: string, member: TData, ...members: TData[]], opts?: CommandOptions<number, number>);
|
|
1058
1094
|
}
|
|
1059
1095
|
|
|
1060
1096
|
/**
|
|
@@ -1242,13 +1278,13 @@ declare class SRemCommand<TData = string> extends Command<number, number> {
|
|
|
1242
1278
|
* @see https://redis.io/commands/sscan
|
|
1243
1279
|
*/
|
|
1244
1280
|
declare class SScanCommand extends Command<[
|
|
1245
|
-
|
|
1281
|
+
string,
|
|
1246
1282
|
(string | number)[]
|
|
1247
1283
|
], [
|
|
1248
|
-
|
|
1284
|
+
string,
|
|
1249
1285
|
(string | number)[]
|
|
1250
1286
|
]> {
|
|
1251
|
-
constructor([key, cursor, opts]: [key: string, cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[
|
|
1287
|
+
constructor([key, cursor, opts]: [key: string, cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
|
|
1252
1288
|
}
|
|
1253
1289
|
|
|
1254
1290
|
/**
|
|
@@ -1323,9 +1359,7 @@ declare class XAddCommand extends Command<string, string> {
|
|
|
1323
1359
|
constructor([key, id, entries, opts]: [
|
|
1324
1360
|
key: string,
|
|
1325
1361
|
id: "*" | string,
|
|
1326
|
-
entries:
|
|
1327
|
-
[field: string]: unknown;
|
|
1328
|
-
},
|
|
1362
|
+
entries: Record<string, unknown>,
|
|
1329
1363
|
opts?: XAddCommandOptions
|
|
1330
1364
|
], commandOptions?: CommandOptions<string, string>);
|
|
1331
1365
|
}
|
|
@@ -1334,6 +1368,54 @@ declare class XRangeCommand<TData extends Record<string, Record<string, unknown>
|
|
|
1334
1368
|
constructor([key, start, end, count]: [key: string, start: string, end: string, count?: number], opts?: CommandOptions<unknown[], TData[]>);
|
|
1335
1369
|
}
|
|
1336
1370
|
|
|
1371
|
+
type XReadCommandOptions = [
|
|
1372
|
+
key: string | string[],
|
|
1373
|
+
id: string | string[],
|
|
1374
|
+
options?: {
|
|
1375
|
+
count?: number;
|
|
1376
|
+
blockMS?: number;
|
|
1377
|
+
}
|
|
1378
|
+
];
|
|
1379
|
+
type XReadOptions = XReadCommandOptions extends [infer K, infer I, ...any[]] ? K extends string ? I extends string ? [key: string, id: string, options?: {
|
|
1380
|
+
count?: number;
|
|
1381
|
+
blockMS?: number;
|
|
1382
|
+
}] : never : K extends string[] ? I extends string[] ? [key: string[], id: string[], options?: {
|
|
1383
|
+
count?: number;
|
|
1384
|
+
blockMS?: number;
|
|
1385
|
+
}] : never : never : never;
|
|
1386
|
+
/**
|
|
1387
|
+
* @see https://redis.io/commands/xread
|
|
1388
|
+
*/
|
|
1389
|
+
declare class XReadCommand extends Command<number, unknown[]> {
|
|
1390
|
+
constructor([key, id, options]: XReadOptions, opts?: CommandOptions<number, unknown[]>);
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
type Options = {
|
|
1394
|
+
count?: number;
|
|
1395
|
+
blockMS?: number;
|
|
1396
|
+
NOACK?: boolean;
|
|
1397
|
+
};
|
|
1398
|
+
type XReadGroupCommandOptions = [
|
|
1399
|
+
group: string,
|
|
1400
|
+
consumer: string,
|
|
1401
|
+
key: string | string[],
|
|
1402
|
+
id: string | string[],
|
|
1403
|
+
options?: Options
|
|
1404
|
+
];
|
|
1405
|
+
type XReadGroupOptions = XReadGroupCommandOptions extends [
|
|
1406
|
+
string,
|
|
1407
|
+
string,
|
|
1408
|
+
infer TKey,
|
|
1409
|
+
infer TId,
|
|
1410
|
+
...any[]
|
|
1411
|
+
] ? 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;
|
|
1412
|
+
/**
|
|
1413
|
+
* @see https://redis.io/commands/xreadgroup
|
|
1414
|
+
*/
|
|
1415
|
+
declare class XReadGroupCommand extends Command<number, unknown[]> {
|
|
1416
|
+
constructor([group, consumer, key, id, options]: XReadGroupOptions, opts?: CommandOptions<number, unknown[]>);
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1337
1419
|
type NXAndXXOptions = {
|
|
1338
1420
|
nx: true;
|
|
1339
1421
|
xx?: never;
|
|
@@ -1501,13 +1583,13 @@ declare class ZRevRankCommand<TData> extends Command<number | null, number | nul
|
|
|
1501
1583
|
* @see https://redis.io/commands/zscan
|
|
1502
1584
|
*/
|
|
1503
1585
|
declare class ZScanCommand extends Command<[
|
|
1504
|
-
|
|
1586
|
+
string,
|
|
1505
1587
|
(string | number)[]
|
|
1506
1588
|
], [
|
|
1507
|
-
|
|
1589
|
+
string,
|
|
1508
1590
|
(string | number)[]
|
|
1509
1591
|
]> {
|
|
1510
|
-
constructor([key, cursor, opts]: [key: string, cursor: number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[
|
|
1592
|
+
constructor([key, cursor, opts]: [key: string, cursor: string | number, opts?: ScanCommandOptions], cmdOpts?: CommandOptions<[string, (string | number)[]], [string, (string | number)[]]>);
|
|
1511
1593
|
}
|
|
1512
1594
|
|
|
1513
1595
|
/**
|
|
@@ -1579,8 +1661,23 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1579
1661
|
* p.get("key")
|
|
1580
1662
|
* const result = p.exec<[{ greeting: string }]>()
|
|
1581
1663
|
* ```
|
|
1664
|
+
*
|
|
1665
|
+
* 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.
|
|
1666
|
+
*
|
|
1667
|
+
* 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 }`.
|
|
1668
|
+
*
|
|
1669
|
+
* ```ts
|
|
1670
|
+
* const p = redis.pipeline()
|
|
1671
|
+
* p.get("key")
|
|
1672
|
+
*
|
|
1673
|
+
* const result = await p.exec({ keepErrors: true });
|
|
1674
|
+
* const getResult = result[0].result
|
|
1675
|
+
* const getError = result[0].error
|
|
1676
|
+
* ```
|
|
1582
1677
|
*/
|
|
1583
|
-
exec: <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands
|
|
1678
|
+
exec: <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>, TKeepErrors extends true | undefined = undefined>(options?: {
|
|
1679
|
+
keepErrors: TKeepErrors;
|
|
1680
|
+
}) => Promise<TKeepErrors extends true ? UpstashResponse<any>[] : TCommandResults>;
|
|
1584
1681
|
/**
|
|
1585
1682
|
* Returns the length of pipeline before the execution
|
|
1586
1683
|
*/
|
|
@@ -1598,15 +1695,29 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1598
1695
|
* @see https://redis.io/commands/bitcount
|
|
1599
1696
|
*/
|
|
1600
1697
|
bitcount: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1698
|
+
/**
|
|
1699
|
+
* Returns an instance that can be used to execute `BITFIELD` commands on one key.
|
|
1700
|
+
*
|
|
1701
|
+
* @example
|
|
1702
|
+
* ```typescript
|
|
1703
|
+
* redis.set("mykey", 0);
|
|
1704
|
+
* const result = await redis.pipeline()
|
|
1705
|
+
* .bitfield("mykey")
|
|
1706
|
+
* .set("u4", 0, 16)
|
|
1707
|
+
* .incr("u4", "#1", 1)
|
|
1708
|
+
* .exec();
|
|
1709
|
+
* console.log(result); // [[0, 1]]
|
|
1710
|
+
* ```
|
|
1711
|
+
*
|
|
1712
|
+
* @see https://redis.io/commands/bitfield
|
|
1713
|
+
*/
|
|
1714
|
+
bitfield: (key: string) => BitFieldCommand<Pipeline<[...TCommands, Command<any, number[]>]>>;
|
|
1601
1715
|
/**
|
|
1602
1716
|
* @see https://redis.io/commands/bitop
|
|
1603
1717
|
*/
|
|
1604
1718
|
bitop: {
|
|
1605
1719
|
(op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Pipeline<[...TCommands, BitOpCommand]>;
|
|
1606
|
-
(op: "not", destinationKey: string, sourceKey: string): Pipeline<[
|
|
1607
|
-
...TCommands,
|
|
1608
|
-
BitOpCommand
|
|
1609
|
-
]>;
|
|
1720
|
+
(op: "not", destinationKey: string, sourceKey: string): Pipeline<[...TCommands, BitOpCommand]>;
|
|
1610
1721
|
};
|
|
1611
1722
|
/**
|
|
1612
1723
|
* @see https://redis.io/commands/bitpos
|
|
@@ -1657,7 +1768,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1657
1768
|
/**
|
|
1658
1769
|
* @see https://redis.io/commands/expire
|
|
1659
1770
|
*/
|
|
1660
|
-
expire: (key: string, seconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
1771
|
+
expire: (key: string, seconds: number, option?: ("NX" | "nx" | "XX" | "xx" | "GT" | "gt" | "LT" | "lt") | undefined) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
1661
1772
|
/**
|
|
1662
1773
|
* @see https://redis.io/commands/expireat
|
|
1663
1774
|
*/
|
|
@@ -1670,8 +1781,98 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1670
1781
|
* @see https://redis.io/commands/flushdb
|
|
1671
1782
|
*/
|
|
1672
1783
|
flushdb: (opts?: {
|
|
1673
|
-
async?: boolean
|
|
1784
|
+
async?: boolean;
|
|
1674
1785
|
} | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1786
|
+
/**
|
|
1787
|
+
* @see https://redis.io/commands/geoadd
|
|
1788
|
+
*/
|
|
1789
|
+
geoadd: <TData>(args_0: string, args_1: GeoAddCommandOptions | GeoMember<TData>, ...args_2: GeoMember<TData>[]) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
1790
|
+
/**
|
|
1791
|
+
* @see https://redis.io/commands/geodist
|
|
1792
|
+
*/
|
|
1793
|
+
geodist: <TData>(key: string, member1: TData, member2: TData, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
1794
|
+
/**
|
|
1795
|
+
* @see https://redis.io/commands/geopos
|
|
1796
|
+
*/
|
|
1797
|
+
geopos: <TData>(args_0: string, ...args_1: TData[]) => Pipeline<[...TCommands, Command<any, {
|
|
1798
|
+
lng: number;
|
|
1799
|
+
lat: number;
|
|
1800
|
+
}[]>]>;
|
|
1801
|
+
/**
|
|
1802
|
+
* @see https://redis.io/commands/geohash
|
|
1803
|
+
*/
|
|
1804
|
+
geohash: <TData>(args_0: string, ...args_1: TData[]) => Pipeline<[...TCommands, Command<any, (string | null)[]>]>;
|
|
1805
|
+
/**
|
|
1806
|
+
* @see https://redis.io/commands/geosearch
|
|
1807
|
+
*/
|
|
1808
|
+
geosearch: <TData>(key: string, centerPoint: {
|
|
1809
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
1810
|
+
coordinate: {
|
|
1811
|
+
lon: number;
|
|
1812
|
+
lat: number;
|
|
1813
|
+
};
|
|
1814
|
+
} | {
|
|
1815
|
+
type: "FROMMEMBER" | "frommember";
|
|
1816
|
+
member: TData;
|
|
1817
|
+
}, shape: {
|
|
1818
|
+
type: "BYRADIUS" | "byradius";
|
|
1819
|
+
radius: number;
|
|
1820
|
+
radiusType: "M" | "KM" | "FT" | "MI";
|
|
1821
|
+
} | {
|
|
1822
|
+
type: "BYBOX" | "bybox";
|
|
1823
|
+
rect: {
|
|
1824
|
+
width: number;
|
|
1825
|
+
height: number;
|
|
1826
|
+
};
|
|
1827
|
+
rectType: "M" | "KM" | "FT" | "MI";
|
|
1828
|
+
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
1829
|
+
count?: {
|
|
1830
|
+
limit: number;
|
|
1831
|
+
any?: boolean;
|
|
1832
|
+
};
|
|
1833
|
+
withCoord?: boolean;
|
|
1834
|
+
withDist?: boolean;
|
|
1835
|
+
withHash?: boolean;
|
|
1836
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, ({
|
|
1837
|
+
member: TData;
|
|
1838
|
+
} & {
|
|
1839
|
+
coord?: {
|
|
1840
|
+
long: number;
|
|
1841
|
+
lat: number;
|
|
1842
|
+
} | undefined;
|
|
1843
|
+
dist?: number | undefined;
|
|
1844
|
+
hash?: string | undefined;
|
|
1845
|
+
})[]>]>;
|
|
1846
|
+
/**
|
|
1847
|
+
* @see https://redis.io/commands/geosearchstore
|
|
1848
|
+
*/
|
|
1849
|
+
geosearchstore: <TData>(destination: string, key: string, centerPoint: {
|
|
1850
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
1851
|
+
coordinate: {
|
|
1852
|
+
lon: number;
|
|
1853
|
+
lat: number;
|
|
1854
|
+
};
|
|
1855
|
+
} | {
|
|
1856
|
+
type: "FROMMEMBER" | "frommember";
|
|
1857
|
+
member: TData;
|
|
1858
|
+
}, shape: {
|
|
1859
|
+
type: "BYRADIUS" | "byradius";
|
|
1860
|
+
radius: number;
|
|
1861
|
+
radiusType: "M" | "KM" | "FT" | "MI";
|
|
1862
|
+
} | {
|
|
1863
|
+
type: "BYBOX" | "bybox";
|
|
1864
|
+
rect: {
|
|
1865
|
+
width: number;
|
|
1866
|
+
height: number;
|
|
1867
|
+
};
|
|
1868
|
+
rectType: "M" | "KM" | "FT" | "MI";
|
|
1869
|
+
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
1870
|
+
count?: {
|
|
1871
|
+
limit: number;
|
|
1872
|
+
any?: boolean;
|
|
1873
|
+
};
|
|
1874
|
+
storeDist?: boolean;
|
|
1875
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1675
1876
|
/**
|
|
1676
1877
|
* @see https://redis.io/commands/get
|
|
1677
1878
|
*/
|
|
@@ -1731,9 +1932,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1731
1932
|
/**
|
|
1732
1933
|
* @see https://redis.io/commands/hmset
|
|
1733
1934
|
*/
|
|
1734
|
-
hmset: <TData>(key: string, kv:
|
|
1735
|
-
[field: string]: TData;
|
|
1736
|
-
}) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1935
|
+
hmset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1737
1936
|
/**
|
|
1738
1937
|
* @see https://redis.io/commands/hrandfield
|
|
1739
1938
|
*/
|
|
@@ -1741,13 +1940,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1741
1940
|
/**
|
|
1742
1941
|
* @see https://redis.io/commands/hscan
|
|
1743
1942
|
*/
|
|
1744
|
-
hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [
|
|
1943
|
+
hscan: (key: string, cursor: string | number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
|
|
1745
1944
|
/**
|
|
1746
1945
|
* @see https://redis.io/commands/hset
|
|
1747
1946
|
*/
|
|
1748
|
-
hset: <TData>(key: string, kv:
|
|
1749
|
-
[field: string]: TData;
|
|
1750
|
-
}) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1947
|
+
hset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1751
1948
|
/**
|
|
1752
1949
|
* @see https://redis.io/commands/hsetnx
|
|
1753
1950
|
*/
|
|
@@ -1796,13 +1993,17 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1796
1993
|
* @see https://redis.io/commands/lpop
|
|
1797
1994
|
*/
|
|
1798
1995
|
lpop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
1996
|
+
/**
|
|
1997
|
+
* @see https://redis.io/commands/lmpop
|
|
1998
|
+
*/
|
|
1999
|
+
lmpop: <TData>(numkeys: number, keys: string[], args_2: "LEFT" | "RIGHT", count?: number | undefined) => Pipeline<[...TCommands, Command<any, [string, TData[]] | null>]>;
|
|
1799
2000
|
/**
|
|
1800
2001
|
* @see https://redis.io/commands/lpos
|
|
1801
2002
|
*/
|
|
1802
2003
|
lpos: <TData>(key: string, element: unknown, opts?: {
|
|
1803
|
-
rank?: number
|
|
1804
|
-
count?: number
|
|
1805
|
-
maxLen?: number
|
|
2004
|
+
rank?: number;
|
|
2005
|
+
count?: number;
|
|
2006
|
+
maxLen?: number;
|
|
1806
2007
|
} | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
1807
2008
|
/**
|
|
1808
2009
|
* @see https://redis.io/commands/lpush
|
|
@@ -1835,15 +2036,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1835
2036
|
/**
|
|
1836
2037
|
* @see https://redis.io/commands/mset
|
|
1837
2038
|
*/
|
|
1838
|
-
mset: <TData>(kv:
|
|
1839
|
-
[key: string]: TData;
|
|
1840
|
-
}) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
2039
|
+
mset: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
1841
2040
|
/**
|
|
1842
2041
|
* @see https://redis.io/commands/msetnx
|
|
1843
2042
|
*/
|
|
1844
|
-
msetnx: <TData>(kv:
|
|
1845
|
-
[key: string]: TData;
|
|
1846
|
-
}) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2043
|
+
msetnx: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1847
2044
|
/**
|
|
1848
2045
|
* @see https://redis.io/commands/persist
|
|
1849
2046
|
*/
|
|
@@ -1911,11 +2108,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1911
2108
|
/**
|
|
1912
2109
|
* @see https://redis.io/commands/sadd
|
|
1913
2110
|
*/
|
|
1914
|
-
sadd: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2111
|
+
sadd: <TData>(key: string, member: TData, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
1915
2112
|
/**
|
|
1916
2113
|
* @see https://redis.io/commands/scan
|
|
1917
2114
|
*/
|
|
1918
|
-
scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [
|
|
2115
|
+
scan: (cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, string[]]>]>;
|
|
1919
2116
|
/**
|
|
1920
2117
|
* @see https://redis.io/commands/scard
|
|
1921
2118
|
*/
|
|
@@ -1996,7 +2193,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
1996
2193
|
/**
|
|
1997
2194
|
* @see https://redis.io/commands/sscan
|
|
1998
2195
|
*/
|
|
1999
|
-
sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [
|
|
2196
|
+
sscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
|
|
2000
2197
|
/**
|
|
2001
2198
|
* @see https://redis.io/commands/strlen
|
|
2002
2199
|
*/
|
|
@@ -2032,15 +2229,13 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2032
2229
|
/**
|
|
2033
2230
|
* @see https://redis.io/commands/zadd
|
|
2034
2231
|
*/
|
|
2035
|
-
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
2232
|
+
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>]>;
|
|
2036
2233
|
/**
|
|
2037
2234
|
* @see https://redis.io/commands/xadd
|
|
2038
2235
|
*/
|
|
2039
|
-
xadd: (key: string, id: string, entries: {
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
nomkStream?: boolean | undefined;
|
|
2043
|
-
trim?: (({
|
|
2236
|
+
xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
|
|
2237
|
+
nomkStream?: boolean;
|
|
2238
|
+
trim?: ({
|
|
2044
2239
|
type: "MAXLEN" | "maxlen";
|
|
2045
2240
|
threshold: number;
|
|
2046
2241
|
} | {
|
|
@@ -2048,28 +2243,104 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2048
2243
|
threshold: string;
|
|
2049
2244
|
}) & ({
|
|
2050
2245
|
comparison: "~";
|
|
2051
|
-
limit?: number
|
|
2246
|
+
limit?: number;
|
|
2052
2247
|
} | {
|
|
2053
2248
|
comparison: "=";
|
|
2054
|
-
limit?:
|
|
2055
|
-
})
|
|
2249
|
+
limit?: never;
|
|
2250
|
+
});
|
|
2056
2251
|
} | undefined) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
2252
|
+
/**
|
|
2253
|
+
* @see https://redis.io/commands/xack
|
|
2254
|
+
*/
|
|
2255
|
+
xack: (key: string, group: string, id: string | string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2057
2256
|
/**
|
|
2058
2257
|
* @see https://redis.io/commands/xdel
|
|
2059
2258
|
*/
|
|
2060
2259
|
xdel: (key: string, ids: string | string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2260
|
+
/**
|
|
2261
|
+
* @see https://redis.io/commands/xgroup
|
|
2262
|
+
*/
|
|
2263
|
+
xgroup: (key: string, opts: {
|
|
2264
|
+
type: "CREATE";
|
|
2265
|
+
group: string;
|
|
2266
|
+
id: `$` | string;
|
|
2267
|
+
options?: {
|
|
2268
|
+
MKSTREAM?: boolean;
|
|
2269
|
+
ENTRIESREAD?: number;
|
|
2270
|
+
};
|
|
2271
|
+
} | {
|
|
2272
|
+
type: "CREATECONSUMER";
|
|
2273
|
+
group: string;
|
|
2274
|
+
consumer: string;
|
|
2275
|
+
} | {
|
|
2276
|
+
type: "DELCONSUMER";
|
|
2277
|
+
group: string;
|
|
2278
|
+
consumer: string;
|
|
2279
|
+
} | {
|
|
2280
|
+
type: "DESTROY";
|
|
2281
|
+
group: string;
|
|
2282
|
+
} | {
|
|
2283
|
+
type: "SETID";
|
|
2284
|
+
group: string;
|
|
2285
|
+
id: `$` | string;
|
|
2286
|
+
options?: {
|
|
2287
|
+
ENTRIESREAD?: number;
|
|
2288
|
+
};
|
|
2289
|
+
}) => Pipeline<[...TCommands, Command<any, never>]>;
|
|
2290
|
+
/**
|
|
2291
|
+
* @see https://redis.io/commands/xread
|
|
2292
|
+
*/
|
|
2293
|
+
xread: (...args: CommandArgs<typeof XReadCommand>) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2294
|
+
/**
|
|
2295
|
+
* @see https://redis.io/commands/xreadgroup
|
|
2296
|
+
*/
|
|
2297
|
+
xreadgroup: (...args: CommandArgs<typeof XReadGroupCommand>) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2298
|
+
/**
|
|
2299
|
+
* @see https://redis.io/commands/xinfo
|
|
2300
|
+
*/
|
|
2301
|
+
xinfo: (key: string, options: {
|
|
2302
|
+
type: "CONSUMERS";
|
|
2303
|
+
group: string;
|
|
2304
|
+
} | {
|
|
2305
|
+
type: "GROUPS";
|
|
2306
|
+
}) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2061
2307
|
/**
|
|
2062
2308
|
* @see https://redis.io/commands/xlen
|
|
2063
2309
|
*/
|
|
2064
2310
|
xlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2311
|
+
/**
|
|
2312
|
+
* @see https://redis.io/commands/xpending
|
|
2313
|
+
*/
|
|
2314
|
+
xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
|
|
2315
|
+
idleTime?: number;
|
|
2316
|
+
consumer?: string | string[];
|
|
2317
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2318
|
+
/**
|
|
2319
|
+
* @see https://redis.io/commands/xclaim
|
|
2320
|
+
*/
|
|
2321
|
+
xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
|
|
2322
|
+
idleMS?: number;
|
|
2323
|
+
timeMS?: number;
|
|
2324
|
+
retryCount?: number;
|
|
2325
|
+
force?: boolean;
|
|
2326
|
+
justId?: boolean;
|
|
2327
|
+
lastId?: number;
|
|
2328
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2329
|
+
/**
|
|
2330
|
+
* @see https://redis.io/commands/xautoclaim
|
|
2331
|
+
*/
|
|
2332
|
+
xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
|
|
2333
|
+
count?: number;
|
|
2334
|
+
justId?: boolean;
|
|
2335
|
+
} | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
2065
2336
|
/**
|
|
2066
2337
|
* @see https://redis.io/commands/xtrim
|
|
2067
2338
|
*/
|
|
2068
2339
|
xtrim: (key: string, options: {
|
|
2069
2340
|
strategy: "MAXLEN" | "MINID";
|
|
2070
|
-
exactness?: "~" | "="
|
|
2071
|
-
threshold:
|
|
2072
|
-
limit?: number
|
|
2341
|
+
exactness?: "~" | "=";
|
|
2342
|
+
threshold: number | string;
|
|
2343
|
+
limit?: number;
|
|
2073
2344
|
}) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2074
2345
|
/**
|
|
2075
2346
|
* @see https://redis.io/commands/xrange
|
|
@@ -2114,21 +2385,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2114
2385
|
/**
|
|
2115
2386
|
* @see https://redis.io/commands/zrange
|
|
2116
2387
|
*/
|
|
2117
|
-
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
byLex: true;
|
|
2123
|
-
} & ZRangeCommandOptions
|
|
2124
|
-
] | [
|
|
2125
|
-
key: string,
|
|
2126
|
-
min: number | `(${number}` | "-inf" | "+inf",
|
|
2127
|
-
max: number | `(${number}` | "-inf" | "+inf",
|
|
2128
|
-
opts: {
|
|
2129
|
-
byScore: true;
|
|
2130
|
-
} & ZRangeCommandOptions
|
|
2131
|
-
]) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2388
|
+
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
|
|
2389
|
+
byLex: true;
|
|
2390
|
+
} & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
|
|
2391
|
+
byScore: true;
|
|
2392
|
+
} & ZRangeCommandOptions]) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2132
2393
|
/**
|
|
2133
2394
|
* @see https://redis.io/commands/zrank
|
|
2134
2395
|
*/
|
|
@@ -2156,7 +2417,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2156
2417
|
/**
|
|
2157
2418
|
* @see https://redis.io/commands/zscan
|
|
2158
2419
|
*/
|
|
2159
|
-
zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [
|
|
2420
|
+
zscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [string, (string | number)[]]>]>;
|
|
2160
2421
|
/**
|
|
2161
2422
|
* @see https://redis.io/commands/zscore
|
|
2162
2423
|
*/
|
|
@@ -2209,96 +2470,6 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2209
2470
|
* @see https://redis.io/commands/json.forget
|
|
2210
2471
|
*/
|
|
2211
2472
|
forget: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2212
|
-
/**
|
|
2213
|
-
* @see https://redis.io/commands/geoadd
|
|
2214
|
-
*/
|
|
2215
|
-
geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<unknown>, ...args_2: GeoMember<unknown>[]) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
2216
|
-
/**
|
|
2217
|
-
* @see https://redis.io/commands/geodist
|
|
2218
|
-
*/
|
|
2219
|
-
geodist: (key: string, member1: unknown, member2: unknown, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
2220
|
-
/**
|
|
2221
|
-
* @see https://redis.io/commands/geopos
|
|
2222
|
-
*/
|
|
2223
|
-
geopos: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, {
|
|
2224
|
-
lng: number;
|
|
2225
|
-
lat: number;
|
|
2226
|
-
}[]>]>;
|
|
2227
|
-
/**
|
|
2228
|
-
* @see https://redis.io/commands/geohash
|
|
2229
|
-
*/
|
|
2230
|
-
geohash: (args_0: string, ...args_1: unknown[]) => Pipeline<[...TCommands, Command<any, (string | null)[]>]>;
|
|
2231
|
-
/**
|
|
2232
|
-
* @see https://redis.io/commands/geosearch
|
|
2233
|
-
*/
|
|
2234
|
-
geosearch: (key: string, centerPoint: {
|
|
2235
|
-
type: "FROMLONLAT" | "fromlonlat";
|
|
2236
|
-
coordinate: {
|
|
2237
|
-
lon: number;
|
|
2238
|
-
lat: number;
|
|
2239
|
-
};
|
|
2240
|
-
} | {
|
|
2241
|
-
type: "FROMMEMBER" | "frommember";
|
|
2242
|
-
member: unknown;
|
|
2243
|
-
}, shape: {
|
|
2244
|
-
type: "BYRADIUS" | "byradius";
|
|
2245
|
-
radius: number;
|
|
2246
|
-
radiusType: "M" | "KM" | "FT" | "MI";
|
|
2247
|
-
} | {
|
|
2248
|
-
type: "BYBOX" | "bybox";
|
|
2249
|
-
rect: {
|
|
2250
|
-
width: number;
|
|
2251
|
-
height: number;
|
|
2252
|
-
};
|
|
2253
|
-
rectType: "M" | "KM" | "FT" | "MI";
|
|
2254
|
-
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2255
|
-
count?: {
|
|
2256
|
-
limit: number;
|
|
2257
|
-
any?: boolean | undefined;
|
|
2258
|
-
} | undefined;
|
|
2259
|
-
withCoord?: boolean | undefined;
|
|
2260
|
-
withDist?: boolean | undefined;
|
|
2261
|
-
withHash?: boolean | undefined;
|
|
2262
|
-
} | undefined) => Pipeline<[...TCommands, Command<any, ({
|
|
2263
|
-
member: unknown;
|
|
2264
|
-
} & {
|
|
2265
|
-
coord?: {
|
|
2266
|
-
long: number;
|
|
2267
|
-
lat: number;
|
|
2268
|
-
} | undefined;
|
|
2269
|
-
dist?: number | undefined;
|
|
2270
|
-
hash?: string | undefined;
|
|
2271
|
-
})[]>]>;
|
|
2272
|
-
/**
|
|
2273
|
-
* @see https://redis.io/commands/geosearchstore
|
|
2274
|
-
*/
|
|
2275
|
-
geosearchstore: (destination: string, key: string, centerPoint: {
|
|
2276
|
-
type: "FROMLONLAT" | "fromlonlat";
|
|
2277
|
-
coordinate: {
|
|
2278
|
-
lon: number;
|
|
2279
|
-
lat: number;
|
|
2280
|
-
};
|
|
2281
|
-
} | {
|
|
2282
|
-
type: "FROMMEMBER" | "frommember";
|
|
2283
|
-
member: unknown;
|
|
2284
|
-
}, shape: {
|
|
2285
|
-
type: "BYRADIUS" | "byradius";
|
|
2286
|
-
radius: number;
|
|
2287
|
-
radiusType: "M" | "KM" | "FT" | "MI";
|
|
2288
|
-
} | {
|
|
2289
|
-
type: "BYBOX" | "bybox";
|
|
2290
|
-
rect: {
|
|
2291
|
-
width: number;
|
|
2292
|
-
height: number;
|
|
2293
|
-
};
|
|
2294
|
-
rectType: "M" | "KM" | "FT" | "MI";
|
|
2295
|
-
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2296
|
-
count?: {
|
|
2297
|
-
limit: number;
|
|
2298
|
-
any?: boolean | undefined;
|
|
2299
|
-
} | undefined;
|
|
2300
|
-
storeDist?: boolean | undefined;
|
|
2301
|
-
} | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
2302
2473
|
/**
|
|
2303
2474
|
* @see https://redis.io/commands/json.get
|
|
2304
2475
|
*/
|
|
@@ -2307,6 +2478,10 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2307
2478
|
* @see https://redis.io/commands/json.mget
|
|
2308
2479
|
*/
|
|
2309
2480
|
mget: (keys: string[], path: string) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
2481
|
+
/**
|
|
2482
|
+
* @see https://redis.io/commands/json.mset
|
|
2483
|
+
*/
|
|
2484
|
+
mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
|
|
2310
2485
|
/**
|
|
2311
2486
|
* @see https://redis.io/commands/json.numincrby
|
|
2312
2487
|
*/
|
|
@@ -2332,9 +2507,9 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
2332
2507
|
*/
|
|
2333
2508
|
set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
|
|
2334
2509
|
nx: true;
|
|
2335
|
-
xx?:
|
|
2510
|
+
xx?: never;
|
|
2336
2511
|
} | {
|
|
2337
|
-
nx?:
|
|
2512
|
+
nx?: never;
|
|
2338
2513
|
xx: true;
|
|
2339
2514
|
} | undefined) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
|
|
2340
2515
|
/**
|
|
@@ -2405,6 +2580,7 @@ declare class Redis {
|
|
|
2405
2580
|
protected client: Requester;
|
|
2406
2581
|
protected opts?: CommandOptions<any, any>;
|
|
2407
2582
|
protected enableTelemetry: boolean;
|
|
2583
|
+
protected enableAutoPipelining: boolean;
|
|
2408
2584
|
/**
|
|
2409
2585
|
* Create a new redis client
|
|
2410
2586
|
*
|
|
@@ -2417,6 +2593,8 @@ declare class Redis {
|
|
|
2417
2593
|
* ```
|
|
2418
2594
|
*/
|
|
2419
2595
|
constructor(client: Requester, opts?: RedisOptions);
|
|
2596
|
+
get readYourWritesSyncToken(): string | undefined;
|
|
2597
|
+
set readYourWritesSyncToken(session: string | undefined);
|
|
2420
2598
|
get json(): {
|
|
2421
2599
|
/**
|
|
2422
2600
|
* @see https://redis.io/commands/json.arrappend
|
|
@@ -2454,104 +2632,18 @@ declare class Redis {
|
|
|
2454
2632
|
* @see https://redis.io/commands/json.forget
|
|
2455
2633
|
*/
|
|
2456
2634
|
forget: (key: string, path?: string | undefined) => Promise<number>;
|
|
2457
|
-
/**
|
|
2458
|
-
* @see https://redis.io/commands/geoadd
|
|
2459
|
-
*/
|
|
2460
|
-
geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<unknown>, ...args_2: GeoMember<unknown>[]) => Promise<number | null>;
|
|
2461
|
-
/**
|
|
2462
|
-
* @see https://redis.io/commands/geopos
|
|
2463
|
-
*/
|
|
2464
|
-
geopos: (args_0: string, ...args_1: unknown[]) => Promise<{
|
|
2465
|
-
lng: number;
|
|
2466
|
-
lat: number;
|
|
2467
|
-
}[]>;
|
|
2468
|
-
/**
|
|
2469
|
-
* @see https://redis.io/commands/geodist
|
|
2470
|
-
*/
|
|
2471
|
-
geodist: (key: string, member1: unknown, member2: unknown, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
|
|
2472
|
-
/**
|
|
2473
|
-
* @see https://redis.io/commands/geohash
|
|
2474
|
-
*/
|
|
2475
|
-
geohash: (args_0: string, ...args_1: unknown[]) => Promise<(string | null)[]>;
|
|
2476
|
-
/**
|
|
2477
|
-
* @see https://redis.io/commands/geosearch
|
|
2478
|
-
*/
|
|
2479
|
-
geosearch: (key: string, centerPoint: {
|
|
2480
|
-
type: "FROMLONLAT" | "fromlonlat";
|
|
2481
|
-
coordinate: {
|
|
2482
|
-
lon: number;
|
|
2483
|
-
lat: number;
|
|
2484
|
-
};
|
|
2485
|
-
} | {
|
|
2486
|
-
type: "FROMMEMBER" | "frommember";
|
|
2487
|
-
member: unknown;
|
|
2488
|
-
}, shape: {
|
|
2489
|
-
type: "BYRADIUS" | "byradius";
|
|
2490
|
-
radius: number;
|
|
2491
|
-
radiusType: "M" | "KM" | "FT" | "MI";
|
|
2492
|
-
} | {
|
|
2493
|
-
type: "BYBOX" | "bybox";
|
|
2494
|
-
rect: {
|
|
2495
|
-
width: number;
|
|
2496
|
-
height: number;
|
|
2497
|
-
};
|
|
2498
|
-
rectType: "M" | "KM" | "FT" | "MI";
|
|
2499
|
-
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2500
|
-
count?: {
|
|
2501
|
-
limit: number;
|
|
2502
|
-
any?: boolean | undefined;
|
|
2503
|
-
} | undefined;
|
|
2504
|
-
withCoord?: boolean | undefined;
|
|
2505
|
-
withDist?: boolean | undefined;
|
|
2506
|
-
withHash?: boolean | undefined;
|
|
2507
|
-
} | undefined) => Promise<({
|
|
2508
|
-
member: unknown;
|
|
2509
|
-
} & {
|
|
2510
|
-
coord?: {
|
|
2511
|
-
long: number;
|
|
2512
|
-
lat: number;
|
|
2513
|
-
} | undefined;
|
|
2514
|
-
dist?: number | undefined;
|
|
2515
|
-
hash?: string | undefined;
|
|
2516
|
-
})[]>;
|
|
2517
|
-
/**
|
|
2518
|
-
* @see https://redis.io/commands/geosearchstore
|
|
2519
|
-
*/
|
|
2520
|
-
geosearchstore: (destination: string, key: string, centerPoint: {
|
|
2521
|
-
type: "FROMLONLAT" | "fromlonlat";
|
|
2522
|
-
coordinate: {
|
|
2523
|
-
lon: number;
|
|
2524
|
-
lat: number;
|
|
2525
|
-
};
|
|
2526
|
-
} | {
|
|
2527
|
-
type: "FROMMEMBER" | "frommember";
|
|
2528
|
-
member: unknown;
|
|
2529
|
-
}, shape: {
|
|
2530
|
-
type: "BYRADIUS" | "byradius";
|
|
2531
|
-
radius: number;
|
|
2532
|
-
radiusType: "M" | "KM" | "FT" | "MI";
|
|
2533
|
-
} | {
|
|
2534
|
-
type: "BYBOX" | "bybox";
|
|
2535
|
-
rect: {
|
|
2536
|
-
width: number;
|
|
2537
|
-
height: number;
|
|
2538
|
-
};
|
|
2539
|
-
rectType: "M" | "KM" | "FT" | "MI";
|
|
2540
|
-
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2541
|
-
count?: {
|
|
2542
|
-
limit: number;
|
|
2543
|
-
any?: boolean | undefined;
|
|
2544
|
-
} | undefined;
|
|
2545
|
-
storeDist?: boolean | undefined;
|
|
2546
|
-
} | undefined) => Promise<number>;
|
|
2547
2635
|
/**
|
|
2548
2636
|
* @see https://redis.io/commands/json.get
|
|
2549
2637
|
*/
|
|
2550
|
-
get: (...args: CommandArgs<typeof JsonGetCommand>) => Promise<
|
|
2638
|
+
get: <TData>(...args: CommandArgs<typeof JsonGetCommand>) => Promise<TData | null>;
|
|
2551
2639
|
/**
|
|
2552
2640
|
* @see https://redis.io/commands/json.mget
|
|
2553
2641
|
*/
|
|
2554
|
-
mget: (keys: string[], path: string) => Promise<
|
|
2642
|
+
mget: <TData>(keys: string[], path: string) => Promise<TData>;
|
|
2643
|
+
/**
|
|
2644
|
+
* @see https://redis.io/commands/json.mset
|
|
2645
|
+
*/
|
|
2646
|
+
mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Promise<"OK" | null>;
|
|
2555
2647
|
/**
|
|
2556
2648
|
* @see https://redis.io/commands/json.numincrby
|
|
2557
2649
|
*/
|
|
@@ -2577,9 +2669,9 @@ declare class Redis {
|
|
|
2577
2669
|
*/
|
|
2578
2670
|
set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
|
|
2579
2671
|
nx: true;
|
|
2580
|
-
xx?:
|
|
2672
|
+
xx?: never;
|
|
2581
2673
|
} | {
|
|
2582
|
-
nx?:
|
|
2674
|
+
nx?: never;
|
|
2583
2675
|
xx: true;
|
|
2584
2676
|
} | undefined) => Promise<"OK" | null>;
|
|
2585
2677
|
/**
|
|
@@ -2614,6 +2706,7 @@ declare class Redis {
|
|
|
2614
2706
|
* @see {@link Pipeline}
|
|
2615
2707
|
*/
|
|
2616
2708
|
pipeline: () => Pipeline<[]>;
|
|
2709
|
+
protected autoPipeline: () => Redis;
|
|
2617
2710
|
/**
|
|
2618
2711
|
* Create a new transaction to allow executing multiple steps atomically.
|
|
2619
2712
|
*
|
|
@@ -2624,6 +2717,22 @@ declare class Redis {
|
|
|
2624
2717
|
* @see {@link Pipeline}
|
|
2625
2718
|
*/
|
|
2626
2719
|
multi: () => Pipeline<[]>;
|
|
2720
|
+
/**
|
|
2721
|
+
* Returns an instance that can be used to execute `BITFIELD` commands on one key.
|
|
2722
|
+
*
|
|
2723
|
+
* @example
|
|
2724
|
+
* ```typescript
|
|
2725
|
+
* redis.set("mykey", 0);
|
|
2726
|
+
* const result = await redis.bitfield("mykey")
|
|
2727
|
+
* .set("u4", 0, 16)
|
|
2728
|
+
* .incr("u4", "#1", 1)
|
|
2729
|
+
* .exec();
|
|
2730
|
+
* console.log(result); // [0, 1]
|
|
2731
|
+
* ```
|
|
2732
|
+
*
|
|
2733
|
+
* @see https://redis.io/commands/bitfield
|
|
2734
|
+
*/
|
|
2735
|
+
bitfield: (key: string) => BitFieldCommand<Promise<number[]>>;
|
|
2627
2736
|
/**
|
|
2628
2737
|
* @see https://redis.io/commands/append
|
|
2629
2738
|
*/
|
|
@@ -2684,7 +2793,7 @@ declare class Redis {
|
|
|
2684
2793
|
/**
|
|
2685
2794
|
* @see https://redis.io/commands/expire
|
|
2686
2795
|
*/
|
|
2687
|
-
expire: (key: string, seconds: number) => Promise<0 | 1>;
|
|
2796
|
+
expire: (key: string, seconds: number, option?: ("NX" | "nx" | "XX" | "xx" | "GT" | "gt" | "LT" | "lt") | undefined) => Promise<0 | 1>;
|
|
2688
2797
|
/**
|
|
2689
2798
|
* @see https://redis.io/commands/expireat
|
|
2690
2799
|
*/
|
|
@@ -2697,8 +2806,98 @@ declare class Redis {
|
|
|
2697
2806
|
* @see https://redis.io/commands/flushdb
|
|
2698
2807
|
*/
|
|
2699
2808
|
flushdb: (opts?: {
|
|
2700
|
-
async?: boolean
|
|
2809
|
+
async?: boolean;
|
|
2701
2810
|
} | undefined) => Promise<"OK">;
|
|
2811
|
+
/**
|
|
2812
|
+
* @see https://redis.io/commands/geoadd
|
|
2813
|
+
*/
|
|
2814
|
+
geoadd: <TData>(args_0: string, args_1: GeoAddCommandOptions | GeoMember<TData>, ...args_2: GeoMember<TData>[]) => Promise<number | null>;
|
|
2815
|
+
/**
|
|
2816
|
+
* @see https://redis.io/commands/geopos
|
|
2817
|
+
*/
|
|
2818
|
+
geopos: <TData>(args_0: string, ...args_1: TData[]) => Promise<{
|
|
2819
|
+
lng: number;
|
|
2820
|
+
lat: number;
|
|
2821
|
+
}[]>;
|
|
2822
|
+
/**
|
|
2823
|
+
* @see https://redis.io/commands/geodist
|
|
2824
|
+
*/
|
|
2825
|
+
geodist: <TData>(key: string, member1: TData, member2: TData, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
|
|
2826
|
+
/**
|
|
2827
|
+
* @see https://redis.io/commands/geohash
|
|
2828
|
+
*/
|
|
2829
|
+
geohash: <TData>(args_0: string, ...args_1: TData[]) => Promise<(string | null)[]>;
|
|
2830
|
+
/**
|
|
2831
|
+
* @see https://redis.io/commands/geosearch
|
|
2832
|
+
*/
|
|
2833
|
+
geosearch: <TData>(key: string, centerPoint: {
|
|
2834
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
2835
|
+
coordinate: {
|
|
2836
|
+
lon: number;
|
|
2837
|
+
lat: number;
|
|
2838
|
+
};
|
|
2839
|
+
} | {
|
|
2840
|
+
type: "FROMMEMBER" | "frommember";
|
|
2841
|
+
member: TData;
|
|
2842
|
+
}, shape: {
|
|
2843
|
+
type: "BYRADIUS" | "byradius";
|
|
2844
|
+
radius: number;
|
|
2845
|
+
radiusType: "M" | "KM" | "FT" | "MI";
|
|
2846
|
+
} | {
|
|
2847
|
+
type: "BYBOX" | "bybox";
|
|
2848
|
+
rect: {
|
|
2849
|
+
width: number;
|
|
2850
|
+
height: number;
|
|
2851
|
+
};
|
|
2852
|
+
rectType: "M" | "KM" | "FT" | "MI";
|
|
2853
|
+
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2854
|
+
count?: {
|
|
2855
|
+
limit: number;
|
|
2856
|
+
any?: boolean;
|
|
2857
|
+
};
|
|
2858
|
+
withCoord?: boolean;
|
|
2859
|
+
withDist?: boolean;
|
|
2860
|
+
withHash?: boolean;
|
|
2861
|
+
} | undefined) => Promise<({
|
|
2862
|
+
member: TData;
|
|
2863
|
+
} & {
|
|
2864
|
+
coord?: {
|
|
2865
|
+
long: number;
|
|
2866
|
+
lat: number;
|
|
2867
|
+
} | undefined;
|
|
2868
|
+
dist?: number | undefined;
|
|
2869
|
+
hash?: string | undefined;
|
|
2870
|
+
})[]>;
|
|
2871
|
+
/**
|
|
2872
|
+
* @see https://redis.io/commands/geosearchstore
|
|
2873
|
+
*/
|
|
2874
|
+
geosearchstore: <TData>(destination: string, key: string, centerPoint: {
|
|
2875
|
+
type: "FROMLONLAT" | "fromlonlat";
|
|
2876
|
+
coordinate: {
|
|
2877
|
+
lon: number;
|
|
2878
|
+
lat: number;
|
|
2879
|
+
};
|
|
2880
|
+
} | {
|
|
2881
|
+
type: "FROMMEMBER" | "frommember";
|
|
2882
|
+
member: TData;
|
|
2883
|
+
}, shape: {
|
|
2884
|
+
type: "BYRADIUS" | "byradius";
|
|
2885
|
+
radius: number;
|
|
2886
|
+
radiusType: "M" | "KM" | "FT" | "MI";
|
|
2887
|
+
} | {
|
|
2888
|
+
type: "BYBOX" | "bybox";
|
|
2889
|
+
rect: {
|
|
2890
|
+
width: number;
|
|
2891
|
+
height: number;
|
|
2892
|
+
};
|
|
2893
|
+
rectType: "M" | "KM" | "FT" | "MI";
|
|
2894
|
+
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
2895
|
+
count?: {
|
|
2896
|
+
limit: number;
|
|
2897
|
+
any?: boolean;
|
|
2898
|
+
};
|
|
2899
|
+
storeDist?: boolean;
|
|
2900
|
+
} | undefined) => Promise<number>;
|
|
2702
2901
|
/**
|
|
2703
2902
|
* @see https://redis.io/commands/get
|
|
2704
2903
|
*/
|
|
@@ -2758,27 +2957,23 @@ declare class Redis {
|
|
|
2758
2957
|
/**
|
|
2759
2958
|
* @see https://redis.io/commands/hmset
|
|
2760
2959
|
*/
|
|
2761
|
-
hmset: <TData>(key: string, kv:
|
|
2762
|
-
[field: string]: TData;
|
|
2763
|
-
}) => Promise<"OK">;
|
|
2960
|
+
hmset: <TData>(key: string, kv: Record<string, TData>) => Promise<"OK">;
|
|
2764
2961
|
/**
|
|
2765
2962
|
* @see https://redis.io/commands/hrandfield
|
|
2766
2963
|
*/
|
|
2767
2964
|
hrandfield: {
|
|
2768
|
-
(key: string): Promise<string>;
|
|
2965
|
+
(key: string): Promise<string | null>;
|
|
2769
2966
|
(key: string, count: number): Promise<string[]>;
|
|
2770
2967
|
<TData extends Record<string, unknown>>(key: string, count: number, withValues: boolean): Promise<Partial<TData>>;
|
|
2771
2968
|
};
|
|
2772
2969
|
/**
|
|
2773
2970
|
* @see https://redis.io/commands/hscan
|
|
2774
2971
|
*/
|
|
2775
|
-
hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[
|
|
2972
|
+
hscan: (key: string, cursor: string | number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
|
|
2776
2973
|
/**
|
|
2777
2974
|
* @see https://redis.io/commands/hset
|
|
2778
2975
|
*/
|
|
2779
|
-
hset: <TData>(key: string, kv:
|
|
2780
|
-
[field: string]: TData;
|
|
2781
|
-
}) => Promise<number>;
|
|
2976
|
+
hset: <TData>(key: string, kv: Record<string, TData>) => Promise<number>;
|
|
2782
2977
|
/**
|
|
2783
2978
|
* @see https://redis.io/commands/hsetnx
|
|
2784
2979
|
*/
|
|
@@ -2827,13 +3022,17 @@ declare class Redis {
|
|
|
2827
3022
|
* @see https://redis.io/commands/lpop
|
|
2828
3023
|
*/
|
|
2829
3024
|
lpop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
|
|
3025
|
+
/**
|
|
3026
|
+
* @see https://redis.io/commands/lmpop
|
|
3027
|
+
*/
|
|
3028
|
+
lmpop: <TData>(numkeys: number, keys: string[], args_2: "LEFT" | "RIGHT", count?: number | undefined) => Promise<[string, TData[]] | null>;
|
|
2830
3029
|
/**
|
|
2831
3030
|
* @see https://redis.io/commands/lpos
|
|
2832
3031
|
*/
|
|
2833
3032
|
lpos: <TData = number>(key: string, element: unknown, opts?: {
|
|
2834
|
-
rank?: number
|
|
2835
|
-
count?: number
|
|
2836
|
-
maxLen?: number
|
|
3033
|
+
rank?: number;
|
|
3034
|
+
count?: number;
|
|
3035
|
+
maxLen?: number;
|
|
2837
3036
|
} | undefined) => Promise<TData>;
|
|
2838
3037
|
/**
|
|
2839
3038
|
* @see https://redis.io/commands/lpush
|
|
@@ -2866,15 +3065,11 @@ declare class Redis {
|
|
|
2866
3065
|
/**
|
|
2867
3066
|
* @see https://redis.io/commands/mset
|
|
2868
3067
|
*/
|
|
2869
|
-
mset: <TData>(kv:
|
|
2870
|
-
[key: string]: TData;
|
|
2871
|
-
}) => Promise<"OK">;
|
|
3068
|
+
mset: <TData>(kv: Record<string, TData>) => Promise<"OK">;
|
|
2872
3069
|
/**
|
|
2873
3070
|
* @see https://redis.io/commands/msetnx
|
|
2874
3071
|
*/
|
|
2875
|
-
msetnx: <TData>(kv:
|
|
2876
|
-
[key: string]: TData;
|
|
2877
|
-
}) => Promise<number>;
|
|
3072
|
+
msetnx: <TData>(kv: Record<string, TData>) => Promise<number>;
|
|
2878
3073
|
/**
|
|
2879
3074
|
* @see https://redis.io/commands/persist
|
|
2880
3075
|
*/
|
|
@@ -2942,11 +3137,11 @@ declare class Redis {
|
|
|
2942
3137
|
/**
|
|
2943
3138
|
* @see https://redis.io/commands/sadd
|
|
2944
3139
|
*/
|
|
2945
|
-
sadd: <TData>(key: string, ...members: TData[]) => Promise<number>;
|
|
3140
|
+
sadd: <TData>(key: string, member: TData, ...members: TData[]) => Promise<number>;
|
|
2946
3141
|
/**
|
|
2947
3142
|
* @see https://redis.io/commands/scan
|
|
2948
3143
|
*/
|
|
2949
|
-
scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[
|
|
3144
|
+
scan: (cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, string[]]>;
|
|
2950
3145
|
/**
|
|
2951
3146
|
* @see https://redis.io/commands/scard
|
|
2952
3147
|
*/
|
|
@@ -3030,7 +3225,7 @@ declare class Redis {
|
|
|
3030
3225
|
/**
|
|
3031
3226
|
* @see https://redis.io/commands/sscan
|
|
3032
3227
|
*/
|
|
3033
|
-
sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[
|
|
3228
|
+
sscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
|
|
3034
3229
|
/**
|
|
3035
3230
|
* @see https://redis.io/commands/strlen
|
|
3036
3231
|
*/
|
|
@@ -3066,11 +3261,9 @@ declare class Redis {
|
|
|
3066
3261
|
/**
|
|
3067
3262
|
* @see https://redis.io/commands/xadd
|
|
3068
3263
|
*/
|
|
3069
|
-
xadd: (key: string, id: string, entries: {
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
nomkStream?: boolean | undefined;
|
|
3073
|
-
trim?: (({
|
|
3264
|
+
xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
|
|
3265
|
+
nomkStream?: boolean;
|
|
3266
|
+
trim?: ({
|
|
3074
3267
|
type: "MAXLEN" | "maxlen";
|
|
3075
3268
|
threshold: number;
|
|
3076
3269
|
} | {
|
|
@@ -3078,28 +3271,104 @@ declare class Redis {
|
|
|
3078
3271
|
threshold: string;
|
|
3079
3272
|
}) & ({
|
|
3080
3273
|
comparison: "~";
|
|
3081
|
-
limit?: number
|
|
3274
|
+
limit?: number;
|
|
3082
3275
|
} | {
|
|
3083
3276
|
comparison: "=";
|
|
3084
|
-
limit?:
|
|
3085
|
-
})
|
|
3277
|
+
limit?: never;
|
|
3278
|
+
});
|
|
3086
3279
|
} | undefined) => Promise<string>;
|
|
3280
|
+
/**
|
|
3281
|
+
* @see https://redis.io/commands/xack
|
|
3282
|
+
*/
|
|
3283
|
+
xack: (key: string, group: string, id: string | string[]) => Promise<number>;
|
|
3087
3284
|
/**
|
|
3088
3285
|
* @see https://redis.io/commands/xdel
|
|
3089
3286
|
*/
|
|
3090
3287
|
xdel: (key: string, ids: string | string[]) => Promise<number>;
|
|
3288
|
+
/**
|
|
3289
|
+
* @see https://redis.io/commands/xgroup
|
|
3290
|
+
*/
|
|
3291
|
+
xgroup: (key: string, opts: {
|
|
3292
|
+
type: "CREATE";
|
|
3293
|
+
group: string;
|
|
3294
|
+
id: `$` | string;
|
|
3295
|
+
options?: {
|
|
3296
|
+
MKSTREAM?: boolean;
|
|
3297
|
+
ENTRIESREAD?: number;
|
|
3298
|
+
};
|
|
3299
|
+
} | {
|
|
3300
|
+
type: "CREATECONSUMER";
|
|
3301
|
+
group: string;
|
|
3302
|
+
consumer: string;
|
|
3303
|
+
} | {
|
|
3304
|
+
type: "DELCONSUMER";
|
|
3305
|
+
group: string;
|
|
3306
|
+
consumer: string;
|
|
3307
|
+
} | {
|
|
3308
|
+
type: "DESTROY";
|
|
3309
|
+
group: string;
|
|
3310
|
+
} | {
|
|
3311
|
+
type: "SETID";
|
|
3312
|
+
group: string;
|
|
3313
|
+
id: `$` | string;
|
|
3314
|
+
options?: {
|
|
3315
|
+
ENTRIESREAD?: number;
|
|
3316
|
+
};
|
|
3317
|
+
}) => Promise<never>;
|
|
3318
|
+
/**
|
|
3319
|
+
* @see https://redis.io/commands/xread
|
|
3320
|
+
*/
|
|
3321
|
+
xread: (...args: CommandArgs<typeof XReadCommand>) => Promise<unknown[]>;
|
|
3322
|
+
/**
|
|
3323
|
+
* @see https://redis.io/commands/xreadgroup
|
|
3324
|
+
*/
|
|
3325
|
+
xreadgroup: (...args: CommandArgs<typeof XReadGroupCommand>) => Promise<unknown[]>;
|
|
3326
|
+
/**
|
|
3327
|
+
* @see https://redis.io/commands/xinfo
|
|
3328
|
+
*/
|
|
3329
|
+
xinfo: (key: string, options: {
|
|
3330
|
+
type: "CONSUMERS";
|
|
3331
|
+
group: string;
|
|
3332
|
+
} | {
|
|
3333
|
+
type: "GROUPS";
|
|
3334
|
+
}) => Promise<unknown[]>;
|
|
3091
3335
|
/**
|
|
3092
3336
|
* @see https://redis.io/commands/xlen
|
|
3093
3337
|
*/
|
|
3094
3338
|
xlen: (key: string) => Promise<number>;
|
|
3339
|
+
/**
|
|
3340
|
+
* @see https://redis.io/commands/xpending
|
|
3341
|
+
*/
|
|
3342
|
+
xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
|
|
3343
|
+
idleTime?: number;
|
|
3344
|
+
consumer?: string | string[];
|
|
3345
|
+
} | undefined) => Promise<unknown[]>;
|
|
3346
|
+
/**
|
|
3347
|
+
* @see https://redis.io/commands/xclaim
|
|
3348
|
+
*/
|
|
3349
|
+
xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
|
|
3350
|
+
idleMS?: number;
|
|
3351
|
+
timeMS?: number;
|
|
3352
|
+
retryCount?: number;
|
|
3353
|
+
force?: boolean;
|
|
3354
|
+
justId?: boolean;
|
|
3355
|
+
lastId?: number;
|
|
3356
|
+
} | undefined) => Promise<unknown[]>;
|
|
3357
|
+
/**
|
|
3358
|
+
* @see https://redis.io/commands/xautoclaim
|
|
3359
|
+
*/
|
|
3360
|
+
xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
|
|
3361
|
+
count?: number;
|
|
3362
|
+
justId?: boolean;
|
|
3363
|
+
} | undefined) => Promise<unknown[]>;
|
|
3095
3364
|
/**
|
|
3096
3365
|
* @see https://redis.io/commands/xtrim
|
|
3097
3366
|
*/
|
|
3098
3367
|
xtrim: (key: string, options: {
|
|
3099
3368
|
strategy: "MAXLEN" | "MINID";
|
|
3100
|
-
exactness?: "~" | "="
|
|
3101
|
-
threshold:
|
|
3102
|
-
limit?: number
|
|
3369
|
+
exactness?: "~" | "=";
|
|
3370
|
+
threshold: number | string;
|
|
3371
|
+
limit?: number;
|
|
3103
3372
|
}) => Promise<number>;
|
|
3104
3373
|
/**
|
|
3105
3374
|
* @see https://redis.io/commands/xrange
|
|
@@ -3112,7 +3381,7 @@ declare class Redis {
|
|
|
3112
3381
|
/**
|
|
3113
3382
|
* @see https://redis.io/commands/zadd
|
|
3114
3383
|
*/
|
|
3115
|
-
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Promise<number | null>;
|
|
3384
|
+
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]]) => Promise<number | null>;
|
|
3116
3385
|
/**
|
|
3117
3386
|
* @see https://redis.io/commands/zcard
|
|
3118
3387
|
*/
|
|
@@ -3152,21 +3421,11 @@ declare class Redis {
|
|
|
3152
3421
|
/**
|
|
3153
3422
|
* @see https://redis.io/commands/zrange
|
|
3154
3423
|
*/
|
|
3155
|
-
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
byLex: true;
|
|
3161
|
-
} & ZRangeCommandOptions
|
|
3162
|
-
] | [
|
|
3163
|
-
key: string,
|
|
3164
|
-
min: number | `(${number}` | "-inf" | "+inf",
|
|
3165
|
-
max: number | `(${number}` | "-inf" | "+inf",
|
|
3166
|
-
opts: {
|
|
3167
|
-
byScore: true;
|
|
3168
|
-
} & ZRangeCommandOptions
|
|
3169
|
-
]) => Promise<TData>;
|
|
3424
|
+
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
|
|
3425
|
+
byLex: true;
|
|
3426
|
+
} & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
|
|
3427
|
+
byScore: true;
|
|
3428
|
+
} & ZRangeCommandOptions]) => Promise<TData>;
|
|
3170
3429
|
/**
|
|
3171
3430
|
* @see https://redis.io/commands/zrank
|
|
3172
3431
|
*/
|
|
@@ -3194,7 +3453,7 @@ declare class Redis {
|
|
|
3194
3453
|
/**
|
|
3195
3454
|
* @see https://redis.io/commands/zscan
|
|
3196
3455
|
*/
|
|
3197
|
-
zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[
|
|
3456
|
+
zscan: (key: string, cursor: string | number, opts?: ScanCommandOptions | undefined) => Promise<[string, (string | number)[]]>;
|
|
3198
3457
|
/**
|
|
3199
3458
|
* @see https://redis.io/commands/zscore
|
|
3200
3459
|
*/
|
|
@@ -3209,6 +3468,24 @@ declare class Redis {
|
|
|
3209
3468
|
zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
|
|
3210
3469
|
}
|
|
3211
3470
|
|
|
3471
|
+
/**
|
|
3472
|
+
* Result of a bad request to upstash
|
|
3473
|
+
*/
|
|
3474
|
+
declare class UpstashError extends Error {
|
|
3475
|
+
constructor(message: string);
|
|
3476
|
+
}
|
|
3477
|
+
declare class UrlError extends Error {
|
|
3478
|
+
constructor(url: string);
|
|
3479
|
+
}
|
|
3480
|
+
|
|
3481
|
+
type error_UpstashError = UpstashError;
|
|
3482
|
+
declare const error_UpstashError: typeof UpstashError;
|
|
3483
|
+
type error_UrlError = UrlError;
|
|
3484
|
+
declare const error_UrlError: typeof UrlError;
|
|
3485
|
+
declare namespace error {
|
|
3486
|
+
export { error_UpstashError as UpstashError, error_UrlError as UrlError };
|
|
3487
|
+
}
|
|
3488
|
+
|
|
3212
3489
|
/**
|
|
3213
3490
|
* @see https://redis.io/commands/zdiffstore
|
|
3214
3491
|
*/
|
|
@@ -3223,4 +3500,4 @@ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] |
|
|
|
3223
3500
|
constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
|
|
3224
3501
|
}
|
|
3225
3502
|
|
|
3226
|
-
export {
|
|
3503
|
+
export { HValsCommand as $, AppendCommand as A, BitCountCommand as B, CopyCommand as C, DBSizeCommand as D, EchoCommand as E, FlushAllCommand as F, GeoAddCommand as G, GetRangeCommand as H, GetSetCommand as I, HDelCommand as J, HExistsCommand as K, HGetCommand as L, HGetAllCommand as M, HIncrByCommand as N, HIncrByFloatCommand as O, Pipeline as P, HKeysCommand as Q, type RedisOptions as R, HLenCommand as S, HMGetCommand as T, type UpstashRequest as U, HMSetCommand as V, HRandFieldCommand as W, HScanCommand as X, HSetCommand as Y, HSetNXCommand as Z, HStrLenCommand as _, type RequesterConfig as a, SetBitCommand as a$, IncrCommand as a0, IncrByCommand as a1, IncrByFloatCommand as a2, JsonArrAppendCommand as a3, JsonArrIndexCommand as a4, JsonArrInsertCommand as a5, JsonArrLenCommand as a6, JsonArrPopCommand as a7, JsonArrTrimCommand as a8, JsonClearCommand as a9, MGetCommand as aA, MSetCommand as aB, MSetNXCommand as aC, PersistCommand as aD, PExpireCommand as aE, PExpireAtCommand as aF, PingCommand as aG, PSetEXCommand as aH, PTtlCommand as aI, PublishCommand as aJ, RandomKeyCommand as aK, RenameCommand as aL, RenameNXCommand as aM, RPopCommand as aN, RPushCommand as aO, RPushXCommand as aP, SAddCommand as aQ, ScanCommand as aR, type ScanCommandOptions as aS, SCardCommand as aT, ScriptExistsCommand as aU, ScriptFlushCommand as aV, ScriptLoadCommand as aW, SDiffCommand as aX, SDiffStoreCommand as aY, SetCommand as aZ, type SetCommandOptions as a_, JsonDelCommand as aa, JsonForgetCommand as ab, JsonGetCommand as ac, JsonMGetCommand as ad, JsonNumIncrByCommand as ae, JsonNumMultByCommand as af, JsonObjKeysCommand as ag, JsonObjLenCommand as ah, JsonRespCommand as ai, JsonSetCommand as aj, JsonStrAppendCommand as ak, JsonStrLenCommand as al, JsonToggleCommand as am, JsonTypeCommand as an, KeysCommand as ao, LIndexCommand as ap, LInsertCommand as aq, LLenCommand as ar, LMoveCommand as as, LPopCommand as at, LPushCommand as au, LPushXCommand as av, LRangeCommand as aw, LRemCommand as ax, LSetCommand as ay, LTrimCommand as az, Redis as b, SetExCommand as b0, SetNxCommand as b1, SetRangeCommand as b2, SInterCommand as b3, SInterStoreCommand as b4, SIsMemberCommand as b5, SMembersCommand as b6, SMIsMemberCommand as b7, SMoveCommand as b8, SPopCommand as b9, ZPopMinCommand as bA, ZRangeCommand as bB, type ZRangeCommandOptions as bC, ZRankCommand as bD, ZRemCommand as bE, ZRemRangeByLexCommand as bF, ZRemRangeByRankCommand as bG, ZRemRangeByScoreCommand as bH, ZRevRankCommand as bI, ZScanCommand as bJ, ZScoreCommand as bK, ZUnionCommand as bL, type ZUnionCommandOptions as bM, ZUnionStoreCommand as bN, type ZUnionStoreCommandOptions as bO, SRandMemberCommand as ba, SRemCommand as bb, SScanCommand as bc, StrLenCommand as bd, SUnionCommand as be, SUnionStoreCommand as bf, TimeCommand as bg, TouchCommand as bh, TtlCommand as bi, type Type as bj, TypeCommand as bk, UnlinkCommand as bl, XAddCommand as bm, XRangeCommand as bn, type ScoreMember as bo, type ZAddCommandOptions as bp, ZAddCommand as bq, ZCardCommand as br, ZCountCommand as bs, ZDiffStoreCommand as bt, ZIncrByCommand as bu, ZInterStoreCommand as bv, type ZInterStoreCommandOptions as bw, ZLexCountCommand as bx, ZMScoreCommand as by, ZPopMaxCommand as bz, type UpstashResponse as c, type Requester as d, error as e, BitOpCommand as f, BitPosCommand as g, DecrCommand as h, DecrByCommand as i, DelCommand as j, EvalCommand as k, EvalshaCommand as l, ExistsCommand as m, ExpireCommand as n, ExpireAtCommand as o, FlushDBCommand as p, type GeoAddCommandOptions as q, type GeoMember as r, GeoDistCommand as s, GeoHashCommand as t, GeoPosCommand as u, GeoSearchCommand as v, GeoSearchStoreCommand as w, GetCommand as x, GetBitCommand as y, GetDelCommand as z };
|