@upstash/redis 0.0.0-ci.ec86feafac6d95eed4e9c9d8a5ff13b74ed84a74-20240709145745 → 0.0.0-ci.ed4e6de160b6a8d6f2caedfb5836805e0ffd2cdd-20241008135327

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.
@@ -43,7 +43,14 @@ type UpstashResponse<TResult> = {
43
43
  error?: string;
44
44
  };
45
45
  interface Requester {
46
- upstashSyncToken: string;
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;
47
54
  request: <TResult = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult>>;
48
55
  }
49
56
  type RetryConfig = false | {
@@ -135,8 +142,7 @@ declare class Command<TResult, TData> {
135
142
  exec(client: Requester): Promise<TData>;
136
143
  }
137
144
 
138
- type ZUnionCommandOptions = {
139
- withScores?: boolean;
145
+ type ZUnionStoreCommandOptions = {
140
146
  aggregate?: "sum" | "min" | "max";
141
147
  } & ({
142
148
  weight: number;
@@ -149,14 +155,15 @@ type ZUnionCommandOptions = {
149
155
  weights?: never;
150
156
  });
151
157
  /**
152
- * @see https://redis.io/commands/zunion
158
+ * @see https://redis.io/commands/zunionstore
153
159
  */
154
- declare class ZUnionCommand<TData extends unknown[]> extends Command<string[], TData> {
155
- constructor(cmd: [numKeys: 1, key: string, opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
156
- constructor(cmd: [numKeys: number, keys: string[], opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
160
+ declare class ZUnionStoreCommand extends Command<number, number> {
161
+ constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
162
+ constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
157
163
  }
158
164
 
159
- type ZUnionStoreCommandOptions = {
165
+ type ZUnionCommandOptions = {
166
+ withScores?: boolean;
160
167
  aggregate?: "sum" | "min" | "max";
161
168
  } & ({
162
169
  weight: number;
@@ -169,11 +176,11 @@ type ZUnionStoreCommandOptions = {
169
176
  weights?: never;
170
177
  });
171
178
  /**
172
- * @see https://redis.io/commands/zunionstore
179
+ * @see https://redis.io/commands/zunion
173
180
  */
174
- declare class ZUnionStoreCommand extends Command<number, number> {
175
- constructor(cmd: [destination: string, numKeys: 1, key: string, opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
176
- constructor(cmd: [destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions], cmdOpts?: CommandOptions<number, number>);
181
+ declare class ZUnionCommand<TData extends unknown[]> extends Command<string[], TData> {
182
+ constructor(cmd: [numKeys: 1, key: string, opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
183
+ constructor(cmd: [numKeys: number, keys: string[], opts?: ZUnionCommandOptions], cmdOpts?: CommandOptions<string[], TData>);
177
184
  }
178
185
 
179
186
  type ZInterStoreCommandOptions = {
@@ -239,11 +246,11 @@ type GeoAddCommandOptions = {
239
246
  } & {
240
247
  ch?: boolean;
241
248
  });
242
- interface GeoMember<TMemberType> {
249
+ type GeoMember<TMemberType> = {
243
250
  latitude: number;
244
251
  longitude: number;
245
252
  member: TMemberType;
246
- }
253
+ };
247
254
  /**
248
255
  * @see https://redis.io/commands/geoadd
249
256
  */
@@ -273,7 +280,7 @@ declare class BitCountCommand extends Command<number, number> {
273
280
  type SubCommandArgs<TRest extends unknown[] = []> = [
274
281
  encoding: string,
275
282
  offset: number | string,
276
- ...TRest
283
+ ...rest: TRest
277
284
  ];
278
285
  /**
279
286
  * @see https://redis.io/commands/bitfield
@@ -418,7 +425,7 @@ declare class GeoDistCommand<TMemberType = string> extends Command<number | null
418
425
  * @see https://redis.io/commands/geohash
419
426
  */
420
427
  declare class GeoHashCommand<TMember = string> extends Command<(string | null)[], (string | null)[]> {
421
- constructor(cmd: [string, ...(TMember[] | TMember[])], opts?: CommandOptions<(string | null)[], (string | null)[]>);
428
+ constructor(cmd: [string, ...TMember[]], opts?: CommandOptions<(string | null)[], (string | null)[]>);
422
429
  }
423
430
 
424
431
  type Coordinates = {
@@ -645,9 +652,7 @@ declare class HMGetCommand<TData extends Record<string, unknown>> extends Comman
645
652
  * @see https://redis.io/commands/hmset
646
653
  */
647
654
  declare class HMSetCommand<TData> extends Command<"OK", "OK"> {
648
- constructor([key, kv]: [key: string, kv: {
649
- [field: string]: TData;
650
- }], opts?: CommandOptions<"OK", "OK">);
655
+ constructor([key, kv]: [key: string, kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">);
651
656
  }
652
657
 
653
658
  /**
@@ -676,9 +681,7 @@ declare class HScanCommand extends Command<[
676
681
  * @see https://redis.io/commands/hset
677
682
  */
678
683
  declare class HSetCommand<TData> extends Command<number, number> {
679
- constructor([key, kv]: [key: string, kv: {
680
- [field: string]: TData;
681
- }], opts?: CommandOptions<number, number>);
684
+ constructor([key, kv]: [key: string, kv: Record<string, TData>], opts?: CommandOptions<number, number>);
682
685
  }
683
686
 
684
687
  /**
@@ -808,6 +811,17 @@ declare class JsonMGetCommand<TData = unknown[]> extends Command<TData, TData> {
808
811
  constructor(cmd: [keys: string[], path: string], opts?: CommandOptions<TData, TData>);
809
812
  }
810
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
+
811
825
  /**
812
826
  * @see https://redis.io/commands/json.numincrby
813
827
  */
@@ -964,25 +978,21 @@ declare class LTrimCommand extends Command<"OK", "OK"> {
964
978
  * @see https://redis.io/commands/mget
965
979
  */
966
980
  declare class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
967
- constructor(cmd: [string[]] | [...(string[] | string[])], opts?: CommandOptions<(string | null)[], TData>);
981
+ constructor(cmd: [string[]] | [...string[]], opts?: CommandOptions<(string | null)[], TData>);
968
982
  }
969
983
 
970
984
  /**
971
985
  * @see https://redis.io/commands/mset
972
986
  */
973
987
  declare class MSetCommand<TData> extends Command<"OK", "OK"> {
974
- constructor([kv]: [kv: {
975
- [key: string]: TData;
976
- }], opts?: CommandOptions<"OK", "OK">);
988
+ constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<"OK", "OK">);
977
989
  }
978
990
 
979
991
  /**
980
992
  * @see https://redis.io/commands/msetnx
981
993
  */
982
994
  declare class MSetNXCommand<TData = string> extends Command<number, number> {
983
- constructor([kv]: [kv: {
984
- [key: string]: TData;
985
- }], opts?: CommandOptions<number, number>);
995
+ constructor([kv]: [kv: Record<string, TData>], opts?: CommandOptions<number, number>);
986
996
  }
987
997
 
988
998
  /**
@@ -1080,7 +1090,7 @@ declare class RPushXCommand<TData = string> extends Command<number, number> {
1080
1090
  * @see https://redis.io/commands/sadd
1081
1091
  */
1082
1092
  declare class SAddCommand<TData = string> extends Command<number, number> {
1083
- constructor(cmd: [key: string, ...members: TData[]], opts?: CommandOptions<number, number>);
1093
+ constructor(cmd: [key: string, member: TData, ...members: TData[]], opts?: CommandOptions<number, number>);
1084
1094
  }
1085
1095
 
1086
1096
  /**
@@ -1349,9 +1359,7 @@ declare class XAddCommand extends Command<string, string> {
1349
1359
  constructor([key, id, entries, opts]: [
1350
1360
  key: string,
1351
1361
  id: "*" | string,
1352
- entries: {
1353
- [field: string]: unknown;
1354
- },
1362
+ entries: Record<string, unknown>,
1355
1363
  opts?: XAddCommandOptions
1356
1364
  ], commandOptions?: CommandOptions<string, string>);
1357
1365
  }
@@ -1758,7 +1766,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1758
1766
  * @see https://redis.io/commands/flushdb
1759
1767
  */
1760
1768
  flushdb: (opts?: {
1761
- async?: boolean | undefined;
1769
+ async?: boolean;
1762
1770
  } | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
1763
1771
  /**
1764
1772
  * @see https://redis.io/commands/geoadd
@@ -1805,11 +1813,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1805
1813
  }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
1806
1814
  count?: {
1807
1815
  limit: number;
1808
- any?: boolean | undefined;
1809
- } | undefined;
1810
- withCoord?: boolean | undefined;
1811
- withDist?: boolean | undefined;
1812
- withHash?: boolean | undefined;
1816
+ any?: boolean;
1817
+ };
1818
+ withCoord?: boolean;
1819
+ withDist?: boolean;
1820
+ withHash?: boolean;
1813
1821
  } | undefined) => Pipeline<[...TCommands, Command<any, ({
1814
1822
  member: TData;
1815
1823
  } & {
@@ -1846,9 +1854,9 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1846
1854
  }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
1847
1855
  count?: {
1848
1856
  limit: number;
1849
- any?: boolean | undefined;
1850
- } | undefined;
1851
- storeDist?: boolean | undefined;
1857
+ any?: boolean;
1858
+ };
1859
+ storeDist?: boolean;
1852
1860
  } | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
1853
1861
  /**
1854
1862
  * @see https://redis.io/commands/get
@@ -1909,13 +1917,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1909
1917
  /**
1910
1918
  * @see https://redis.io/commands/hmset
1911
1919
  */
1912
- hmset: <TData>(key: string, kv: {
1913
- [field: string]: TData;
1914
- }) => Pipeline<[...TCommands, Command<any, "OK">]>;
1920
+ hmset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
1915
1921
  /**
1916
1922
  * @see https://redis.io/commands/hrandfield
1917
1923
  */
1918
- hrandfield: <TData extends string | Record<string, unknown> | string[]>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
1924
+ hrandfield: <TData extends string | string[] | Record<string, unknown>>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
1919
1925
  /**
1920
1926
  * @see https://redis.io/commands/hscan
1921
1927
  */
@@ -1923,9 +1929,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1923
1929
  /**
1924
1930
  * @see https://redis.io/commands/hset
1925
1931
  */
1926
- hset: <TData>(key: string, kv: {
1927
- [field: string]: TData;
1928
- }) => Pipeline<[...TCommands, Command<any, number>]>;
1932
+ hset: <TData>(key: string, kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
1929
1933
  /**
1930
1934
  * @see https://redis.io/commands/hsetnx
1931
1935
  */
@@ -1982,9 +1986,9 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
1982
1986
  * @see https://redis.io/commands/lpos
1983
1987
  */
1984
1988
  lpos: <TData>(key: string, element: unknown, opts?: {
1985
- rank?: number | undefined;
1986
- count?: number | undefined;
1987
- maxLen?: number | undefined;
1989
+ rank?: number;
1990
+ count?: number;
1991
+ maxLen?: number;
1988
1992
  } | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
1989
1993
  /**
1990
1994
  * @see https://redis.io/commands/lpush
@@ -2017,15 +2021,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2017
2021
  /**
2018
2022
  * @see https://redis.io/commands/mset
2019
2023
  */
2020
- mset: <TData>(kv: {
2021
- [key: string]: TData;
2022
- }) => Pipeline<[...TCommands, Command<any, "OK">]>;
2024
+ mset: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, "OK">]>;
2023
2025
  /**
2024
2026
  * @see https://redis.io/commands/msetnx
2025
2027
  */
2026
- msetnx: <TData>(kv: {
2027
- [key: string]: TData;
2028
- }) => Pipeline<[...TCommands, Command<any, number>]>;
2028
+ msetnx: <TData>(kv: Record<string, TData>) => Pipeline<[...TCommands, Command<any, number>]>;
2029
2029
  /**
2030
2030
  * @see https://redis.io/commands/persist
2031
2031
  */
@@ -2093,7 +2093,7 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2093
2093
  /**
2094
2094
  * @see https://redis.io/commands/sadd
2095
2095
  */
2096
- sadd: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2096
+ sadd: <TData>(key: string, member: TData, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
2097
2097
  /**
2098
2098
  * @see https://redis.io/commands/scan
2099
2099
  */
@@ -2214,19 +2214,13 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2214
2214
  /**
2215
2215
  * @see https://redis.io/commands/zadd
2216
2216
  */
2217
- zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [
2218
- key: string,
2219
- opts: ZAddCommandOptions,
2220
- ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]
2221
- ]) => Pipeline<[...TCommands, Command<any, number | null>]>;
2217
+ 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>]>;
2222
2218
  /**
2223
2219
  * @see https://redis.io/commands/xadd
2224
2220
  */
2225
- xadd: (key: string, id: string, entries: {
2226
- [field: string]: unknown;
2227
- }, opts?: {
2228
- nomkStream?: boolean | undefined;
2229
- trim?: (({
2221
+ xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
2222
+ nomkStream?: boolean;
2223
+ trim?: ({
2230
2224
  type: "MAXLEN" | "maxlen";
2231
2225
  threshold: number;
2232
2226
  } | {
@@ -2234,11 +2228,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2234
2228
  threshold: string;
2235
2229
  }) & ({
2236
2230
  comparison: "~";
2237
- limit?: number | undefined;
2231
+ limit?: number;
2238
2232
  } | {
2239
2233
  comparison: "=";
2240
- limit?: undefined;
2241
- })) | undefined;
2234
+ limit?: never;
2235
+ });
2242
2236
  } | undefined) => Pipeline<[...TCommands, Command<any, string>]>;
2243
2237
  /**
2244
2238
  * @see https://redis.io/commands/xack
@@ -2254,11 +2248,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2254
2248
  xgroup: (key: string, opts: {
2255
2249
  type: "CREATE";
2256
2250
  group: string;
2257
- id: string;
2251
+ id: `$` | string;
2258
2252
  options?: {
2259
- MKSTREAM?: boolean | undefined;
2260
- ENTRIESREAD?: number | undefined;
2261
- } | undefined;
2253
+ MKSTREAM?: boolean;
2254
+ ENTRIESREAD?: number;
2255
+ };
2262
2256
  } | {
2263
2257
  type: "CREATECONSUMER";
2264
2258
  group: string;
@@ -2273,10 +2267,10 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2273
2267
  } | {
2274
2268
  type: "SETID";
2275
2269
  group: string;
2276
- id: string;
2270
+ id: `$` | string;
2277
2271
  options?: {
2278
- ENTRIESREAD?: number | undefined;
2279
- } | undefined;
2272
+ ENTRIESREAD?: number;
2273
+ };
2280
2274
  }) => Pipeline<[...TCommands, Command<any, never>]>;
2281
2275
  /**
2282
2276
  * @see https://redis.io/commands/xread
@@ -2303,35 +2297,35 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2303
2297
  * @see https://redis.io/commands/xpending
2304
2298
  */
2305
2299
  xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
2306
- idleTime?: number | undefined;
2307
- consumer?: string | string[] | undefined;
2300
+ idleTime?: number;
2301
+ consumer?: string | string[];
2308
2302
  } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2309
2303
  /**
2310
2304
  * @see https://redis.io/commands/xclaim
2311
2305
  */
2312
2306
  xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
2313
- idleMS?: number | undefined;
2314
- timeMS?: number | undefined;
2315
- retryCount?: number | undefined;
2316
- force?: boolean | undefined;
2317
- justId?: boolean | undefined;
2318
- lastId?: number | undefined;
2307
+ idleMS?: number;
2308
+ timeMS?: number;
2309
+ retryCount?: number;
2310
+ force?: boolean;
2311
+ justId?: boolean;
2312
+ lastId?: number;
2319
2313
  } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2320
2314
  /**
2321
2315
  * @see https://redis.io/commands/xautoclaim
2322
2316
  */
2323
2317
  xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
2324
- count?: number | undefined;
2325
- justId?: boolean | undefined;
2318
+ count?: number;
2319
+ justId?: boolean;
2326
2320
  } | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
2327
2321
  /**
2328
2322
  * @see https://redis.io/commands/xtrim
2329
2323
  */
2330
2324
  xtrim: (key: string, options: {
2331
2325
  strategy: "MAXLEN" | "MINID";
2332
- exactness?: "~" | "=" | undefined;
2333
- threshold: string | number;
2334
- limit?: number | undefined;
2326
+ exactness?: "~" | "=";
2327
+ threshold: number | string;
2328
+ limit?: number;
2335
2329
  }) => Pipeline<[...TCommands, Command<any, number>]>;
2336
2330
  /**
2337
2331
  * @see https://redis.io/commands/xrange
@@ -2376,21 +2370,11 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2376
2370
  /**
2377
2371
  * @see https://redis.io/commands/zrange
2378
2372
  */
2379
- zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
2380
- key: string,
2381
- min: `(${string}` | `[${string}` | "-" | "+",
2382
- max: `(${string}` | `[${string}` | "-" | "+",
2383
- opts: {
2384
- byLex: true;
2385
- } & ZRangeCommandOptions
2386
- ] | [
2387
- key: string,
2388
- min: number | `(${number}` | "-inf" | "+inf",
2389
- max: number | `(${number}` | "-inf" | "+inf",
2390
- opts: {
2391
- byScore: true;
2392
- } & ZRangeCommandOptions
2393
- ]) => Pipeline<[...TCommands, Command<any, TData>]>;
2373
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
2374
+ byLex: true;
2375
+ } & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
2376
+ byScore: true;
2377
+ } & ZRangeCommandOptions]) => Pipeline<[...TCommands, Command<any, TData>]>;
2394
2378
  /**
2395
2379
  * @see https://redis.io/commands/zrank
2396
2380
  */
@@ -2479,6 +2463,10 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2479
2463
  * @see https://redis.io/commands/json.mget
2480
2464
  */
2481
2465
  mget: (keys: string[], path: string) => Pipeline<[...TCommands, Command<any, any>]>;
2466
+ /**
2467
+ * @see https://redis.io/commands/json.mset
2468
+ */
2469
+ mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
2482
2470
  /**
2483
2471
  * @see https://redis.io/commands/json.numincrby
2484
2472
  */
@@ -2504,9 +2492,9 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
2504
2492
  */
2505
2493
  set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
2506
2494
  nx: true;
2507
- xx?: undefined;
2495
+ xx?: never;
2508
2496
  } | {
2509
- nx?: undefined;
2497
+ nx?: never;
2510
2498
  xx: true;
2511
2499
  } | undefined) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
2512
2500
  /**
@@ -2578,7 +2566,6 @@ declare class Redis {
2578
2566
  protected opts?: CommandOptions<any, any>;
2579
2567
  protected enableTelemetry: boolean;
2580
2568
  protected enableAutoPipelining: boolean;
2581
- protected readYourWrites: boolean;
2582
2569
  /**
2583
2570
  * Create a new redis client
2584
2571
  *
@@ -2591,6 +2578,8 @@ declare class Redis {
2591
2578
  * ```
2592
2579
  */
2593
2580
  constructor(client: Requester, opts?: RedisOptions);
2581
+ get readYourWritesSyncToken(): string | undefined;
2582
+ set readYourWritesSyncToken(session: string | undefined);
2594
2583
  get json(): {
2595
2584
  /**
2596
2585
  * @see https://redis.io/commands/json.arrappend
@@ -2635,7 +2624,11 @@ declare class Redis {
2635
2624
  /**
2636
2625
  * @see https://redis.io/commands/json.mget
2637
2626
  */
2638
- mget: <TData_1>(keys: string[], path: string) => Promise<TData_1>;
2627
+ mget: <TData>(keys: string[], path: string) => Promise<TData>;
2628
+ /**
2629
+ * @see https://redis.io/commands/json.mset
2630
+ */
2631
+ mset: (...args: CommandArgs<typeof JsonMSetCommand>) => Promise<"OK" | null>;
2639
2632
  /**
2640
2633
  * @see https://redis.io/commands/json.numincrby
2641
2634
  */
@@ -2661,9 +2654,9 @@ declare class Redis {
2661
2654
  */
2662
2655
  set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
2663
2656
  nx: true;
2664
- xx?: undefined;
2657
+ xx?: never;
2665
2658
  } | {
2666
- nx?: undefined;
2659
+ nx?: never;
2667
2660
  xx: true;
2668
2661
  } | undefined) => Promise<"OK" | null>;
2669
2662
  /**
@@ -2798,7 +2791,7 @@ declare class Redis {
2798
2791
  * @see https://redis.io/commands/flushdb
2799
2792
  */
2800
2793
  flushdb: (opts?: {
2801
- async?: boolean | undefined;
2794
+ async?: boolean;
2802
2795
  } | undefined) => Promise<"OK">;
2803
2796
  /**
2804
2797
  * @see https://redis.io/commands/geoadd
@@ -2845,11 +2838,11 @@ declare class Redis {
2845
2838
  }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2846
2839
  count?: {
2847
2840
  limit: number;
2848
- any?: boolean | undefined;
2849
- } | undefined;
2850
- withCoord?: boolean | undefined;
2851
- withDist?: boolean | undefined;
2852
- withHash?: boolean | undefined;
2841
+ any?: boolean;
2842
+ };
2843
+ withCoord?: boolean;
2844
+ withDist?: boolean;
2845
+ withHash?: boolean;
2853
2846
  } | undefined) => Promise<({
2854
2847
  member: TData;
2855
2848
  } & {
@@ -2886,9 +2879,9 @@ declare class Redis {
2886
2879
  }, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
2887
2880
  count?: {
2888
2881
  limit: number;
2889
- any?: boolean | undefined;
2890
- } | undefined;
2891
- storeDist?: boolean | undefined;
2882
+ any?: boolean;
2883
+ };
2884
+ storeDist?: boolean;
2892
2885
  } | undefined) => Promise<number>;
2893
2886
  /**
2894
2887
  * @see https://redis.io/commands/get
@@ -2949,9 +2942,7 @@ declare class Redis {
2949
2942
  /**
2950
2943
  * @see https://redis.io/commands/hmset
2951
2944
  */
2952
- hmset: <TData>(key: string, kv: {
2953
- [field: string]: TData;
2954
- }) => Promise<"OK">;
2945
+ hmset: <TData>(key: string, kv: Record<string, TData>) => Promise<"OK">;
2955
2946
  /**
2956
2947
  * @see https://redis.io/commands/hrandfield
2957
2948
  */
@@ -2967,9 +2958,7 @@ declare class Redis {
2967
2958
  /**
2968
2959
  * @see https://redis.io/commands/hset
2969
2960
  */
2970
- hset: <TData>(key: string, kv: {
2971
- [field: string]: TData;
2972
- }) => Promise<number>;
2961
+ hset: <TData>(key: string, kv: Record<string, TData>) => Promise<number>;
2973
2962
  /**
2974
2963
  * @see https://redis.io/commands/hsetnx
2975
2964
  */
@@ -3026,9 +3015,9 @@ declare class Redis {
3026
3015
  * @see https://redis.io/commands/lpos
3027
3016
  */
3028
3017
  lpos: <TData = number>(key: string, element: unknown, opts?: {
3029
- rank?: number | undefined;
3030
- count?: number | undefined;
3031
- maxLen?: number | undefined;
3018
+ rank?: number;
3019
+ count?: number;
3020
+ maxLen?: number;
3032
3021
  } | undefined) => Promise<TData>;
3033
3022
  /**
3034
3023
  * @see https://redis.io/commands/lpush
@@ -3061,15 +3050,11 @@ declare class Redis {
3061
3050
  /**
3062
3051
  * @see https://redis.io/commands/mset
3063
3052
  */
3064
- mset: <TData>(kv: {
3065
- [key: string]: TData;
3066
- }) => Promise<"OK">;
3053
+ mset: <TData>(kv: Record<string, TData>) => Promise<"OK">;
3067
3054
  /**
3068
3055
  * @see https://redis.io/commands/msetnx
3069
3056
  */
3070
- msetnx: <TData>(kv: {
3071
- [key: string]: TData;
3072
- }) => Promise<number>;
3057
+ msetnx: <TData>(kv: Record<string, TData>) => Promise<number>;
3073
3058
  /**
3074
3059
  * @see https://redis.io/commands/persist
3075
3060
  */
@@ -3137,7 +3122,7 @@ declare class Redis {
3137
3122
  /**
3138
3123
  * @see https://redis.io/commands/sadd
3139
3124
  */
3140
- sadd: <TData>(key: string, ...members: TData[]) => Promise<number>;
3125
+ sadd: <TData>(key: string, member: TData, ...members: TData[]) => Promise<number>;
3141
3126
  /**
3142
3127
  * @see https://redis.io/commands/scan
3143
3128
  */
@@ -3261,11 +3246,9 @@ declare class Redis {
3261
3246
  /**
3262
3247
  * @see https://redis.io/commands/xadd
3263
3248
  */
3264
- xadd: (key: string, id: string, entries: {
3265
- [field: string]: unknown;
3266
- }, opts?: {
3267
- nomkStream?: boolean | undefined;
3268
- trim?: (({
3249
+ xadd: (key: string, id: string, entries: Record<string, unknown>, opts?: {
3250
+ nomkStream?: boolean;
3251
+ trim?: ({
3269
3252
  type: "MAXLEN" | "maxlen";
3270
3253
  threshold: number;
3271
3254
  } | {
@@ -3273,11 +3256,11 @@ declare class Redis {
3273
3256
  threshold: string;
3274
3257
  }) & ({
3275
3258
  comparison: "~";
3276
- limit?: number | undefined;
3259
+ limit?: number;
3277
3260
  } | {
3278
3261
  comparison: "=";
3279
- limit?: undefined;
3280
- })) | undefined;
3262
+ limit?: never;
3263
+ });
3281
3264
  } | undefined) => Promise<string>;
3282
3265
  /**
3283
3266
  * @see https://redis.io/commands/xack
@@ -3293,11 +3276,11 @@ declare class Redis {
3293
3276
  xgroup: (key: string, opts: {
3294
3277
  type: "CREATE";
3295
3278
  group: string;
3296
- id: string;
3279
+ id: `$` | string;
3297
3280
  options?: {
3298
- MKSTREAM?: boolean | undefined;
3299
- ENTRIESREAD?: number | undefined;
3300
- } | undefined;
3281
+ MKSTREAM?: boolean;
3282
+ ENTRIESREAD?: number;
3283
+ };
3301
3284
  } | {
3302
3285
  type: "CREATECONSUMER";
3303
3286
  group: string;
@@ -3312,10 +3295,10 @@ declare class Redis {
3312
3295
  } | {
3313
3296
  type: "SETID";
3314
3297
  group: string;
3315
- id: string;
3298
+ id: `$` | string;
3316
3299
  options?: {
3317
- ENTRIESREAD?: number | undefined;
3318
- } | undefined;
3300
+ ENTRIESREAD?: number;
3301
+ };
3319
3302
  }) => Promise<never>;
3320
3303
  /**
3321
3304
  * @see https://redis.io/commands/xread
@@ -3342,35 +3325,35 @@ declare class Redis {
3342
3325
  * @see https://redis.io/commands/xpending
3343
3326
  */
3344
3327
  xpending: (key: string, group: string, start: string, end: string, count: number, options?: {
3345
- idleTime?: number | undefined;
3346
- consumer?: string | string[] | undefined;
3328
+ idleTime?: number;
3329
+ consumer?: string | string[];
3347
3330
  } | undefined) => Promise<unknown[]>;
3348
3331
  /**
3349
3332
  * @see https://redis.io/commands/xclaim
3350
3333
  */
3351
3334
  xclaim: (key: string, group: string, consumer: string, minIdleTime: number, id: string | string[], options?: {
3352
- idleMS?: number | undefined;
3353
- timeMS?: number | undefined;
3354
- retryCount?: number | undefined;
3355
- force?: boolean | undefined;
3356
- justId?: boolean | undefined;
3357
- lastId?: number | undefined;
3335
+ idleMS?: number;
3336
+ timeMS?: number;
3337
+ retryCount?: number;
3338
+ force?: boolean;
3339
+ justId?: boolean;
3340
+ lastId?: number;
3358
3341
  } | undefined) => Promise<unknown[]>;
3359
3342
  /**
3360
3343
  * @see https://redis.io/commands/xautoclaim
3361
3344
  */
3362
3345
  xautoclaim: (key: string, group: string, consumer: string, minIdleTime: number, start: string, options?: {
3363
- count?: number | undefined;
3364
- justId?: boolean | undefined;
3346
+ count?: number;
3347
+ justId?: boolean;
3365
3348
  } | undefined) => Promise<unknown[]>;
3366
3349
  /**
3367
3350
  * @see https://redis.io/commands/xtrim
3368
3351
  */
3369
3352
  xtrim: (key: string, options: {
3370
3353
  strategy: "MAXLEN" | "MINID";
3371
- exactness?: "~" | "=" | undefined;
3372
- threshold: string | number;
3373
- limit?: number | undefined;
3354
+ exactness?: "~" | "=";
3355
+ threshold: number | string;
3356
+ limit?: number;
3374
3357
  }) => Promise<number>;
3375
3358
  /**
3376
3359
  * @see https://redis.io/commands/xrange
@@ -3383,11 +3366,7 @@ declare class Redis {
3383
3366
  /**
3384
3367
  * @see https://redis.io/commands/zadd
3385
3368
  */
3386
- zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [
3387
- key: string,
3388
- opts: ZAddCommandOptions,
3389
- ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]
3390
- ]) => Promise<number | null>;
3369
+ zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]]) => Promise<number | null>;
3391
3370
  /**
3392
3371
  * @see https://redis.io/commands/zcard
3393
3372
  */
@@ -3427,21 +3406,11 @@ declare class Redis {
3427
3406
  /**
3428
3407
  * @see https://redis.io/commands/zrange
3429
3408
  */
3430
- zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
3431
- key: string,
3432
- min: `(${string}` | `[${string}` | "-" | "+",
3433
- max: `(${string}` | `[${string}` | "-" | "+",
3434
- opts: {
3435
- byLex: true;
3436
- } & ZRangeCommandOptions
3437
- ] | [
3438
- key: string,
3439
- min: number | `(${number}` | "-inf" | "+inf",
3440
- max: number | `(${number}` | "-inf" | "+inf",
3441
- opts: {
3442
- byScore: true;
3443
- } & ZRangeCommandOptions
3444
- ]) => Promise<TData>;
3409
+ zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [key: string, min: `(${string}` | `[${string}` | "-" | "+", max: `(${string}` | `[${string}` | "-" | "+", opts: {
3410
+ byLex: true;
3411
+ } & ZRangeCommandOptions] | [key: string, min: number | `(${number}` | "-inf" | "+inf", max: number | `(${number}` | "-inf" | "+inf", opts: {
3412
+ byScore: true;
3413
+ } & ZRangeCommandOptions]) => Promise<TData>;
3445
3414
  /**
3446
3415
  * @see https://redis.io/commands/zrank
3447
3416
  */
@@ -3499,10 +3468,7 @@ declare const error_UpstashError: typeof UpstashError;
3499
3468
  type error_UrlError = UrlError;
3500
3469
  declare const error_UrlError: typeof UrlError;
3501
3470
  declare namespace error {
3502
- export {
3503
- error_UpstashError as UpstashError,
3504
- error_UrlError as UrlError,
3505
- };
3471
+ export { error_UpstashError as UpstashError, error_UrlError as UrlError };
3506
3472
  }
3507
3473
 
3508
3474
  /**
@@ -3519,4 +3485,4 @@ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] |
3519
3485
  constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
3520
3486
  }
3521
3487
 
3522
- 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 };
3488
+ 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 };