@upstash/redis 1.32.0 → 1.33.1-canary

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.
@@ -40,9 +40,9 @@ type UpstashResponse<TResult> = {
40
40
  result?: TResult;
41
41
  error?: string;
42
42
  };
43
- interface Requester {
43
+ type Requester = {
44
44
  request: <TResult = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult>>;
45
- }
45
+ };
46
46
  type RetryConfig = false | {
47
47
  /**
48
48
  * The number of retries to attempt before giving up.
@@ -132,8 +132,7 @@ declare class Command<TResult, TData> {
132
132
  exec(client: Requester): Promise<TData>;
133
133
  }
134
134
 
135
- type ZUnionCommandOptions = {
136
- withScores?: boolean;
135
+ type ZUnionStoreCommandOptions = {
137
136
  aggregate?: "sum" | "min" | "max";
138
137
  } & ({
139
138
  weight: number;
@@ -146,14 +145,15 @@ type ZUnionCommandOptions = {
146
145
  weights?: never;
147
146
  });
148
147
  /**
149
- * @see https://redis.io/commands/zunion
148
+ * @see https://redis.io/commands/zunionstore
150
149
  */
151
- declare class ZUnionCommand<TData extends unknown[]> extends Command<string[], TData> {
152
- constructor(cmd: [numKeys: 1, key: string, opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
153
- constructor(cmd: [numKeys: number, keys: string[], opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
150
+ declare class ZUnionStoreCommand extends Command<number, number> {
151
+ constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
152
+ constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
154
153
  }
155
154
 
156
- type ZUnionStoreCommandOptions = {
155
+ type ZUnionCommandOptions = {
156
+ withScores?: boolean;
157
157
  aggregate?: "sum" | "min" | "max";
158
158
  } & ({
159
159
  weight: number;
@@ -166,11 +166,11 @@ type ZUnionStoreCommandOptions = {
166
166
  weights?: never;
167
167
  });
168
168
  /**
169
- * @see https://redis.io/commands/zunionstore
169
+ * @see https://redis.io/commands/zunion
170
170
  */
171
- declare class ZUnionStoreCommand extends Command<number, number> {
172
- constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
173
- constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
171
+ declare class ZUnionCommand<TData extends unknown[]> extends Command<string[], TData> {
172
+ constructor(cmd: [numKeys: 1, key: string, opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
173
+ constructor(cmd: [numKeys: number, keys: string[], opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
174
174
  }
175
175
 
176
176
  type ZInterStoreCommandOptions = {
@@ -236,11 +236,11 @@ type GeoAddCommandOptions = {
236
236
  } & {
237
237
  ch?: boolean;
238
238
  });
239
- interface GeoMember<TMemberType> {
239
+ type GeoMember<TMemberType> = {
240
240
  latitude: number;
241
241
  longitude: number;
242
242
  member: TMemberType;
243
- }
243
+ };
244
244
  /**
245
245
  * @see https://redis.io/commands/geoadd
246
246
  */
@@ -415,7 +415,7 @@ declare class GeoDistCommand<TMemberType = string> extends Command<number | null
415
415
  * @see https://redis.io/commands/geohash
416
416
  */
417
417
  declare class GeoHashCommand<TMember = string> extends Command<(string | null)[], (string | null)[]> {
418
- constructor(cmd: [string, ...(TMember[] | TMember[])], opts?: CommandOptions<(string | null)[], (string | null)[]>);
418
+ constructor(cmd: [string, ...TMember[]], opts?: CommandOptions<(string | null)[], (string | null)[]>);
419
419
  }
420
420
 
421
421
  type Coordinates = {
@@ -642,9 +642,7 @@ declare class HMGetCommand<TData extends Record<string, unknown>> extends Comman
642
642
  * @see https://redis.io/commands/hmset
643
643
  */
644
644
  declare class HMSetCommand<TData> extends Command<"OK", "OK"> {
645
- constructor([key, kv]: [key: string, kv: {
646
- [field: string]: TData;
647
- }], opts?: CommandOptions<"OK", "OK">);
645
+ constructor([key, kv]: [key: string, kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">);
648
646
  }
649
647
 
650
648
  /**
@@ -673,9 +671,7 @@ declare class HScanCommand extends Command<[
673
671
  * @see https://redis.io/commands/hset
674
672
  */
675
673
  declare class HSetCommand<TData> extends Command<number, number> {
676
- constructor([key, kv]: [key: string, kv: {
677
- [field: string]: TData;
678
- }], opts?: CommandOptions<number, number>);
674
+ constructor([key, kv]: [key: string, kv: Record<string, TData>], opts?: CommandOptions<number, number>);
679
675
  }
680
676
 
681
677
  /**
@@ -805,6 +801,17 @@ declare class JsonMGetCommand<TData = unknown[]> extends Command<TData, TData> {
805
801
  constructor(cmd: [keys: string[], path: string], opts?: CommandOptions<TData, TData>);
806
802
  }
807
803
 
804
+ /**
805
+ * @see https://redis.io/commands/json.mset
806
+ */
807
+ declare class JsonMSetCommand<TData extends number | string | boolean | Record<string, unknown> | (number | string | boolean | Record<string, unknown>)[]> extends Command<"OK" | null, "OK" | null> {
808
+ constructor(cmd: {
809
+ key: string;
810
+ path: string;
811
+ value: TData;
812
+ }[], opts?: CommandOptions<"OK" | null, "OK" | null>);
813
+ }
814
+
808
815
  /**
809
816
  * @see https://redis.io/commands/json.numincrby
810
817
  */
@@ -961,25 +968,21 @@ declare class LTrimCommand extends Command<"OK", "OK"> {
961
968
  * @see https://redis.io/commands/mget
962
969
  */
963
970
  declare class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
964
- constructor(cmd: [string[]] | [...(string[] | string[])], opts?: CommandOptions<(string | null)[], TData>);
971
+ constructor(cmd: [string[]] | [...string[]], opts?: CommandOptions<(string | null)[], TData>);
965
972
  }
966
973
 
967
974
  /**
968
975
  * @see https://redis.io/commands/mset
969
976
  */
970
977
  declare class MSetCommand<TData> extends Command<"OK", "OK"> {
971
- constructor([kv]: [kv: {
972
- [key: string]: TData;
973
- }], opts?: CommandOptions<"OK", "OK">);
978
+ constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">);
974
979
  }
975
980
 
976
981
  /**
977
982
  * @see https://redis.io/commands/msetnx
978
983
  */
979
984
  declare class MSetNXCommand<TData = string> extends Command<number, number> {
980
- constructor([kv]: [kv: {
981
- [key: string]: TData;
982
- }], opts?: CommandOptions<number, number>);
985
+ constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<number, number>);
983
986
  }
984
987
 
985
988
  /**
@@ -1346,9 +1349,7 @@ declare class XAddCommand extends Command<string, string> {
1346
1349
  constructor([key, id, entries, opts]: [
1347
1350
  key: string,
1348
1351
  id: "*" | string,
1349
- entries: {
1350
- [field: string]: unknown;
1351
- },
1352
+ entries: Record<string, unknown>,
1352
1353
  opts?: XAddCommandOptions
1353
1354
  ], commandOptions?: CommandOptions<string, string>);
1354
1355
  }
@@ -1755,7 +1756,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1755
1756
  * @see https://redis.io/commands/flushdb
1756
1757
  */
1757
1758
  flushdb: (opts?: {
1758
- async?: boolean | undefined;
1759
+ async?: boolean;
1759
1760
  } | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
1760
1761
  /**
1761
1762
  * @see https://redis.io/commands/geoadd
@@ -1802,11 +1803,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1802
1803
  }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
1803
1804
  count?: {
1804
1805
  limit: number;
1805
- any?: boolean | undefined;
1806
- } | undefined;
1807
- withCoord?: boolean | undefined;
1808
- withDist?: boolean | undefined;
1809
- withHash?: boolean | undefined;
1806
+ any?: boolean;
1807
+ };
1808
+ withCoord?: boolean;
1809
+ withDist?: boolean;
1810
+ withHash?: boolean;
1810
1811
  } | undefined) => Pipeline<[...TCommands, Command<any, ({
1811
1812
  member: TData;
1812
1813
  } & {
@@ -1843,9 +1844,9 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1843
1844
  }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
1844
1845
  count?: {
1845
1846
  limit: number;
1846
- any?: boolean | undefined;
1847
- } | undefined;
1848
- storeDist?: boolean | undefined;
1847
+ any?: boolean;
1848
+ };
1849
+ storeDist?: boolean;
1849
1850
  } | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
1850
1851
  /**
1851
1852
  * @see https://redis.io/commands/get
@@ -1906,13 +1907,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1906
1907
  /**
1907
1908
  * @see https://redis.io/commands/hmset
1908
1909
  */
1909
- hmset: <TData>(key: string, kv: {
1910
- [field: string]: TData;
1911
- }) => Pipeline<[...TCommands, Command<any, "OK">]>;
1910
+ hmset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
1912
1911
  /**
1913
1912
  * @see https://redis.io/commands/hrandfield
1914
1913
  */
1915
- hrandfield: <TData extends string | Record<string, unknown> | string[]>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
1914
+ hrandfield: <TData extends string | string[] | Record<string, unknown>>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
1916
1915
  /**
1917
1916
  * @see https://redis.io/commands/hscan
1918
1917
  */
@@ -1920,9 +1919,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1920
1919
  /**
1921
1920
  * @see https://redis.io/commands/hset
1922
1921
  */
1923
- hset: <TData>(key: string, kv: {
1924
- [field: string]: TData;
1925
- }) => Pipeline<[...TCommands, Command<any, number>]>;
1922
+ hset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
1926
1923
  /**
1927
1924
  * @see https://redis.io/commands/hsetnx
1928
1925
  */
@@ -1979,9 +1976,9 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1979
1976
  * @see https://redis.io/commands/lpos
1980
1977
  */
1981
1978
  lpos: <TData>(key: string, element: unknown, opts?: {
1982
- rank?: number | undefined;
1983
- count?: number | undefined;
1984
- maxLen?: number | undefined;
1979
+ rank?: number;
1980
+ count?: number;
1981
+ maxLen?: number;
1985
1982
  } | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
1986
1983
  /**
1987
1984
  * @see https://redis.io/commands/lpush
@@ -2014,15 +2011,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2014
2011
  /**
2015
2012
  * @see https://redis.io/commands/mset
2016
2013
  */
2017
- mset: <TData>(kv: {
2018
- [key: string]: TData;
2019
- }) => Pipeline<[...TCommands, Command<any, "OK">]>;
2014
+ mset: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
2020
2015
  /**
2021
2016
  * @see https://redis.io/commands/msetnx
2022
2017
  */
2023
- msetnx: <TData>(kv: {
2024
- [key: string]: TData;
2025
- }) => Pipeline<[...TCommands, Command<any, number>]>;
2018
+ msetnx: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
2026
2019
  /**
2027
2020
  * @see https://redis.io/commands/persist
2028
2021
  */
@@ -2211,19 +2204,13 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2211
2204
  /**
2212
2205
  * @see https://redis.io/commands/zadd
2213
2206
  */
2214
- zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [
2215
- key: string,
2216
- opts: ZAddCommandOptions,
2217
- ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]
2218
- ]) => Pipeline<[...TCommands, Command<any, number | null>]>;
2207
+ 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>]>;
2219
2208
  /**
2220
2209
  * @see https://redis.io/commands/xadd
2221
2210
  */
2222
- xadd: (key: string, id: string, entries: {
2223
- [field: string]: unknown;
2224
- }, opts?: {
2225
- nomkStream?: boolean | undefined;
2226
- trim?: (({
2211
+ xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
2212
+ nomkStream?: boolean;
2213
+ trim?: ({
2227
2214
  type: "MAXLEN" | "maxlen";
2228
2215
  threshold: number;
2229
2216
  } | {
@@ -2231,11 +2218,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2231
2218
  threshold: string;
2232
2219
  }) & ({
2233
2220
  comparison: "~";
2234
- limit?: number | undefined;
2221
+ limit?: number;
2235
2222
  } | {
2236
2223
  comparison: "=";
2237
- limit?: undefined;
2238
- })) | undefined;
2224
+ limit?: never;
2225
+ });
2239
2226
  } | undefined) => Pipeline<[...TCommands, Command<any, string>]>;
2240
2227
  /**
2241
2228
  * @see https://redis.io/commands/xack
@@ -2251,11 +2238,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2251
2238
  xgroup: (key: string, opts: {
2252
2239
  type: "CREATE";
2253
2240
  group: string;
2254
- id: string;
2241
+ id: `$` | string;
2255
2242
  options?: {
2256
- MKSTREAM?: boolean | undefined;
2257
- ENTRIESREAD?: number | undefined;
2258
- } | undefined;
2243
+ MKSTREAM?: boolean;
2244
+ ENTRIESREAD?: number;
2245
+ };
2259
2246
  } | {
2260
2247
  type: "CREATECONSUMER";
2261
2248
  group: string;
@@ -2270,10 +2257,10 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2270
2257
  } | {
2271
2258
  type: "SETID";
2272
2259
  group: string;
2273
- id: string;
2260
+ id: `$` | string;
2274
2261
  options?: {
2275
- ENTRIESREAD?: number | undefined;
2276
- } | undefined;
2262
+ ENTRIESREAD?: number;
2263
+ };
2277
2264
  }) => Pipeline<[...TCommands, Command<any, never>]>;
2278
2265
  /**
2279
2266
  * @see https://redis.io/commands/xread
@@ -2300,35 +2287,35 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2300
2287
  * @see https://redis.io/commands/xpending
2301
2288
  */
2302
2289
  xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
2303
- idleTime?: number | undefined;
2304
- consumer?: string | string[] | undefined;
2290
+ idleTime?: number;
2291
+ consumer?: string | string[];
2305
2292
  } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2306
2293
  /**
2307
2294
  * @see https://redis.io/commands/xclaim
2308
2295
  */
2309
2296
  xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
2310
- idleMS?: number | undefined;
2311
- timeMS?: number | undefined;
2312
- retryCount?: number | undefined;
2313
- force?: boolean | undefined;
2314
- justId?: boolean | undefined;
2315
- lastId?: number | undefined;
2297
+ idleMS?: number;
2298
+ timeMS?: number;
2299
+ retryCount?: number;
2300
+ force?: boolean;
2301
+ justId?: boolean;
2302
+ lastId?: number;
2316
2303
  } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2317
2304
  /**
2318
2305
  * @see https://redis.io/commands/xautoclaim
2319
2306
  */
2320
2307
  xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
2321
- count?: number | undefined;
2322
- justId?: boolean | undefined;
2308
+ count?: number;
2309
+ justId?: boolean;
2323
2310
  } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2324
2311
  /**
2325
2312
  * @see https://redis.io/commands/xtrim
2326
2313
  */
2327
2314
  xtrim: (key: string, options: {
2328
2315
  strategy: "MAXLEN" | "MINID";
2329
- exactness?: "~" | "=" | undefined;
2330
- threshold: string | number;
2331
- limit?: number | undefined;
2316
+ exactness?: "~" | "=";
2317
+ threshold: number | string;
2318
+ limit?: number;
2332
2319
  }) => Pipeline<[...TCommands, Command<any, number>]>;
2333
2320
  /**
2334
2321
  * @see https://redis.io/commands/xrange
@@ -2373,21 +2360,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2373
2360
  /**
2374
2361
  * @see https://redis.io/commands/zrange
2375
2362
  */
2376
- zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
2377
- key: string,
2378
- min: `(${string}` | `[${string}` | "-" | "+",
2379
- max: `(${string}` | `[${string}` | "-" | "+",
2380
- opts: {
2381
- byLex: true;
2382
- } & ZRangeCommandOptions
2383
- ] | [
2384
- key: string,
2385
- min: number | `(${number}` | "-inf" | "+inf",
2386
- max: number | `(${number}` | "-inf" | "+inf",
2387
- opts: {
2388
- byScore: true;
2389
- } & ZRangeCommandOptions
2390
- ]) => Pipeline<[...TCommands, Command<any, TData>]>;
2363
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
2364
+ byLex: true;
2365
+ } & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
2366
+ byScore: true;
2367
+ } & ZRangeCommandOptions]) => Pipeline<[...TCommands, Command<any, TData>]>;
2391
2368
  /**
2392
2369
  * @see https://redis.io/commands/zrank
2393
2370
  */
@@ -2476,6 +2453,10 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2476
2453
  * @see https://redis.io/commands/json.mget
2477
2454
  */
2478
2455
  mget: (keys: string[], path: string) => Pipeline<[...TCommands, Command<any, any>]>;
2456
+ /**
2457
+ * @see https://redis.io/commands/json.mset
2458
+ */
2459
+ mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
2479
2460
  /**
2480
2461
  * @see https://redis.io/commands/json.numincrby
2481
2462
  */
@@ -2501,9 +2482,9 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2501
2482
  */
2502
2483
  set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
2503
2484
  nx: true;
2504
- xx?: undefined;
2485
+ xx?: never;
2505
2486
  } | {
2506
- nx?: undefined;
2487
+ nx?: never;
2507
2488
  xx: true;
2508
2489
  } | undefined) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
2509
2490
  /**
@@ -2631,7 +2612,11 @@ declare class Redis {
2631
2612
  /**
2632
2613
  * @see https://redis.io/commands/json.mget
2633
2614
  */
2634
- mget: <TData_1>(keys: string[], path: string) => Promise<TData_1>;
2615
+ mget: <TData>(keys: string[], path: string) => Promise<TData>;
2616
+ /**
2617
+ * @see https://redis.io/commands/json.mset
2618
+ */
2619
+ mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Promise<"OK" | null>;
2635
2620
  /**
2636
2621
  * @see https://redis.io/commands/json.numincrby
2637
2622
  */
@@ -2657,9 +2642,9 @@ declare class Redis {
2657
2642
  */
2658
2643
  set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
2659
2644
  nx: true;
2660
- xx?: undefined;
2645
+ xx?: never;
2661
2646
  } | {
2662
- nx?: undefined;
2647
+ nx?: never;
2663
2648
  xx: true;
2664
2649
  } | undefined) => Promise<"OK" | null>;
2665
2650
  /**
@@ -2794,7 +2779,7 @@ declare class Redis {
2794
2779
  * @see https://redis.io/commands/flushdb
2795
2780
  */
2796
2781
  flushdb: (opts?: {
2797
- async?: boolean | undefined;
2782
+ async?: boolean;
2798
2783
  } | undefined) => Promise<"OK">;
2799
2784
  /**
2800
2785
  * @see https://redis.io/commands/geoadd
@@ -2841,11 +2826,11 @@ declare class Redis {
2841
2826
  }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2842
2827
  count?: {
2843
2828
  limit: number;
2844
- any?: boolean | undefined;
2845
- } | undefined;
2846
- withCoord?: boolean | undefined;
2847
- withDist?: boolean | undefined;
2848
- withHash?: boolean | undefined;
2829
+ any?: boolean;
2830
+ };
2831
+ withCoord?: boolean;
2832
+ withDist?: boolean;
2833
+ withHash?: boolean;
2849
2834
  } | undefined) => Promise<({
2850
2835
  member: TData;
2851
2836
  } & {
@@ -2882,9 +2867,9 @@ declare class Redis {
2882
2867
  }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2883
2868
  count?: {
2884
2869
  limit: number;
2885
- any?: boolean | undefined;
2886
- } | undefined;
2887
- storeDist?: boolean | undefined;
2870
+ any?: boolean;
2871
+ };
2872
+ storeDist?: boolean;
2888
2873
  } | undefined) => Promise<number>;
2889
2874
  /**
2890
2875
  * @see https://redis.io/commands/get
@@ -2945,9 +2930,7 @@ declare class Redis {
2945
2930
  /**
2946
2931
  * @see https://redis.io/commands/hmset
2947
2932
  */
2948
- hmset: <TData>(key: string, kv: {
2949
- [field: string]: TData;
2950
- }) => Promise<"OK">;
2933
+ hmset: <TData>(key: string, kv: Record<string, TData>) => Promise<"OK">;
2951
2934
  /**
2952
2935
  * @see https://redis.io/commands/hrandfield
2953
2936
  */
@@ -2963,9 +2946,7 @@ declare class Redis {
2963
2946
  /**
2964
2947
  * @see https://redis.io/commands/hset
2965
2948
  */
2966
- hset: <TData>(key: string, kv: {
2967
- [field: string]: TData;
2968
- }) => Promise<number>;
2949
+ hset: <TData>(key: string, kv: Record<string, TData>) => Promise<number>;
2969
2950
  /**
2970
2951
  * @see https://redis.io/commands/hsetnx
2971
2952
  */
@@ -3022,9 +3003,9 @@ declare class Redis {
3022
3003
  * @see https://redis.io/commands/lpos
3023
3004
  */
3024
3005
  lpos: <TData = number>(key: string, element: unknown, opts?: {
3025
- rank?: number | undefined;
3026
- count?: number | undefined;
3027
- maxLen?: number | undefined;
3006
+ rank?: number;
3007
+ count?: number;
3008
+ maxLen?: number;
3028
3009
  } | undefined) => Promise<TData>;
3029
3010
  /**
3030
3011
  * @see https://redis.io/commands/lpush
@@ -3057,15 +3038,11 @@ declare class Redis {
3057
3038
  /**
3058
3039
  * @see https://redis.io/commands/mset
3059
3040
  */
3060
- mset: <TData>(kv: {
3061
- [key: string]: TData;
3062
- }) => Promise<"OK">;
3041
+ mset: <TData>(kv: Record<string, TData>) => Promise<"OK">;
3063
3042
  /**
3064
3043
  * @see https://redis.io/commands/msetnx
3065
3044
  */
3066
- msetnx: <TData>(kv: {
3067
- [key: string]: TData;
3068
- }) => Promise<number>;
3045
+ msetnx: <TData>(kv: Record<string, TData>) => Promise<number>;
3069
3046
  /**
3070
3047
  * @see https://redis.io/commands/persist
3071
3048
  */
@@ -3257,11 +3234,9 @@ declare class Redis {
3257
3234
  /**
3258
3235
  * @see https://redis.io/commands/xadd
3259
3236
  */
3260
- xadd: (key: string, id: string, entries: {
3261
- [field: string]: unknown;
3262
- }, opts?: {
3263
- nomkStream?: boolean | undefined;
3264
- trim?: (({
3237
+ xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
3238
+ nomkStream?: boolean;
3239
+ trim?: ({
3265
3240
  type: "MAXLEN" | "maxlen";
3266
3241
  threshold: number;
3267
3242
  } | {
@@ -3269,11 +3244,11 @@ declare class Redis {
3269
3244
  threshold: string;
3270
3245
  }) & ({
3271
3246
  comparison: "~";
3272
- limit?: number | undefined;
3247
+ limit?: number;
3273
3248
  } | {
3274
3249
  comparison: "=";
3275
- limit?: undefined;
3276
- })) | undefined;
3250
+ limit?: never;
3251
+ });
3277
3252
  } | undefined) => Promise<string>;
3278
3253
  /**
3279
3254
  * @see https://redis.io/commands/xack
@@ -3289,11 +3264,11 @@ declare class Redis {
3289
3264
  xgroup: (key: string, opts: {
3290
3265
  type: "CREATE";
3291
3266
  group: string;
3292
- id: string;
3267
+ id: `$` | string;
3293
3268
  options?: {
3294
- MKSTREAM?: boolean | undefined;
3295
- ENTRIESREAD?: number | undefined;
3296
- } | undefined;
3269
+ MKSTREAM?: boolean;
3270
+ ENTRIESREAD?: number;
3271
+ };
3297
3272
  } | {
3298
3273
  type: "CREATECONSUMER";
3299
3274
  group: string;
@@ -3308,10 +3283,10 @@ declare class Redis {
3308
3283
  } | {
3309
3284
  type: "SETID";
3310
3285
  group: string;
3311
- id: string;
3286
+ id: `$` | string;
3312
3287
  options?: {
3313
- ENTRIESREAD?: number | undefined;
3314
- } | undefined;
3288
+ ENTRIESREAD?: number;
3289
+ };
3315
3290
  }) => Promise<never>;
3316
3291
  /**
3317
3292
  * @see https://redis.io/commands/xread
@@ -3338,35 +3313,35 @@ declare class Redis {
3338
3313
  * @see https://redis.io/commands/xpending
3339
3314
  */
3340
3315
  xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
3341
- idleTime?: number | undefined;
3342
- consumer?: string | string[] | undefined;
3316
+ idleTime?: number;
3317
+ consumer?: string | string[];
3343
3318
  } | undefined) => Promise<unknown[]>;
3344
3319
  /**
3345
3320
  * @see https://redis.io/commands/xclaim
3346
3321
  */
3347
3322
  xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
3348
- idleMS?: number | undefined;
3349
- timeMS?: number | undefined;
3350
- retryCount?: number | undefined;
3351
- force?: boolean | undefined;
3352
- justId?: boolean | undefined;
3353
- lastId?: number | undefined;
3323
+ idleMS?: number;
3324
+ timeMS?: number;
3325
+ retryCount?: number;
3326
+ force?: boolean;
3327
+ justId?: boolean;
3328
+ lastId?: number;
3354
3329
  } | undefined) => Promise<unknown[]>;
3355
3330
  /**
3356
3331
  * @see https://redis.io/commands/xautoclaim
3357
3332
  */
3358
3333
  xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
3359
- count?: number | undefined;
3360
- justId?: boolean | undefined;
3334
+ count?: number;
3335
+ justId?: boolean;
3361
3336
  } | undefined) => Promise<unknown[]>;
3362
3337
  /**
3363
3338
  * @see https://redis.io/commands/xtrim
3364
3339
  */
3365
3340
  xtrim: (key: string, options: {
3366
3341
  strategy: "MAXLEN" | "MINID";
3367
- exactness?: "~" | "=" | undefined;
3368
- threshold: string | number;
3369
- limit?: number | undefined;
3342
+ exactness?: "~" | "=";
3343
+ threshold: number | string;
3344
+ limit?: number;
3370
3345
  }) => Promise<number>;
3371
3346
  /**
3372
3347
  * @see https://redis.io/commands/xrange
@@ -3379,11 +3354,7 @@ declare class Redis {
3379
3354
  /**
3380
3355
  * @see https://redis.io/commands/zadd
3381
3356
  */
3382
- zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [
3383
- key: string,
3384
- opts: ZAddCommandOptions,
3385
- ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]
3386
- ]) => Promise<number | null>;
3357
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]]) => Promise<number | null>;
3387
3358
  /**
3388
3359
  * @see https://redis.io/commands/zcard
3389
3360
  */
@@ -3423,21 +3394,11 @@ declare class Redis {
3423
3394
  /**
3424
3395
  * @see https://redis.io/commands/zrange
3425
3396
  */
3426
- zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
3427
- key: string,
3428
- min: `(${string}` | `[${string}` | "-" | "+",
3429
- max: `(${string}` | `[${string}` | "-" | "+",
3430
- opts: {
3431
- byLex: true;
3432
- } & ZRangeCommandOptions
3433
- ] | [
3434
- key: string,
3435
- min: number | `(${number}` | "-inf" | "+inf",
3436
- max: number | `(${number}` | "-inf" | "+inf",
3437
- opts: {
3438
- byScore: true;
3439
- } & ZRangeCommandOptions
3440
- ]) => Promise<TData>;
3397
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
3398
+ byLex: true;
3399
+ } & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
3400
+ byScore: true;
3401
+ } & ZRangeCommandOptions]) => Promise<TData>;
3441
3402
  /**
3442
3403
  * @see https://redis.io/commands/zrank
3443
3404
  */
@@ -3495,10 +3456,7 @@ declare const error_UpstashError: typeof UpstashError;
3495
3456
  type error_UrlError = UrlError;
3496
3457
  declare const error_UrlError: typeof UrlError;
3497
3458
  declare namespace error {
3498
- export {
3499
- error_UpstashError as UpstashError,
3500
- error_UrlError as UrlError,
3501
- };
3459
+ export { error_UpstashError as UpstashError, error_UrlError as UrlError };
3502
3460
  }
3503
3461
 
3504
3462
  /**
@@ -3515,4 +3473,4 @@ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] |
3515
3473
  constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
3516
3474
  }
3517
3475
 
3518
- 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, RedisOptions as R, HLenCommand as S, HMGetCommand as T, UpstashRequest as U, HMSetCommand as V, HRandFieldCommand as W, HScanCommand as X, HSetCommand as Y, HSetNXCommand as Z, HStrLenCommand as _, 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, ScanCommandOptions as aS, SCardCommand as aT, ScriptExistsCommand as aU, ScriptFlushCommand as aV, ScriptLoadCommand as aW, SDiffCommand as aX, SDiffStoreCommand as aY, SetCommand as aZ, 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, 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, ZUnionCommandOptions as bM, ZUnionStoreCommand as bN, 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 as bj, TypeCommand as bk, UnlinkCommand as bl, XAddCommand as bm, XRangeCommand as bn, ScoreMember as bo, ZAddCommandOptions as bp, ZAddCommand as bq, ZCardCommand as br, ZCountCommand as bs, ZDiffStoreCommand as bt, ZIncrByCommand as bu, ZInterStoreCommand as bv, ZInterStoreCommandOptions as bw, ZLexCountCommand as bx, ZMScoreCommand as by, ZPopMaxCommand as bz, Requester as c, UpstashResponse 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, GeoAddCommandOptions as q, 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 };
3476
+ 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 };