@upstash/redis 1.0.0-alpha.4 → 1.0.1

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.
@@ -1,962 +0,0 @@
1
- import { C as CommandArgs, A as AppendCommand, B as BitCountCommand, a as BitPosCommand, D as DecrCommand, b as DecrByCommand, c as DelCommand, E as EchoCommand, d as ExistsCommand, e as ExpireCommand, f as ExpireAtCommand, F as FlushAllCommand, g as FlushDBCommand, G as GetCommand, h as GetBitCommand, i as GetRangeCommand, H as HDelCommand, j as HExistsCommand, k as HGetCommand, l as HGetAllCommand, m as HIncrByCommand, n as HIncrByFloatCommand, o as HKeysCommand, p as HLenCommand, q as HMGetCommand, r as HScanCommand, s as HStrLenCommand, t as HValsCommand, I as IncrCommand, u as IncrByCommand, v as IncrByFloatCommand, K as KeysCommand, L as LIndexCommand, w as LLenCommand, x as LPopCommand, N as NonEmptyArray, y as LRangeCommand, z as LTrimCommand, M as MGetCommand, P as PersistCommand, J as PExpireCommand, O as PExpireAtCommand, Q as PingCommand, R as PTtlCommand, S as RenameCommand, T as RenameNXCommand, U as RPopCommand, V as ScanCommand, W as SCardCommand, X as SDiffCommand, Y as SDiffStoreCommand, Z as SetCommandOptions, _ as SetBitCommand, $ as SetRangeCommand, a0 as SInterCommand, a1 as SInterStoreCommand, a2 as SMembersCommand, a3 as SPopCommand, a4 as SRandMemberCommand, a5 as SScanCommand, a6 as StrLenCommand, a7 as SUnionCommand, a8 as SUnionStoreCommand, a9 as TouchCommand, aa as TtlCommand, ab as TypeCommand, ac as UnlinkCommand, ad as ScoreMember, ae as ZAddCommandOptions, af as ZAddCommandOptionsWithIncr, ag as ZCardCommand, ah as ZCountCommand, ai as ZInterStoreCommand, aj as ZLexCountCommand, ak as ZPopMaxCommand, al as ZPopMinCommand, am as ZRangeCommand, an as ZRemRangeByLexCommand, ao as ZRemRangeByRankCommand, ap as ZRemRangeByScoreCommand, aq as ZScanCommand, ar as ZUnionStoreCommand, as as Type } from './zunionstore-dffa797d';
2
- import { HttpClient } from './http';
3
-
4
- /**
5
- * Upstash REST API supports command pipelining to send multiple commands in
6
- * batch, instead of sending each command one by one and waiting for a response.
7
- * When using pipelines, several commands are sent using a single HTTP request,
8
- * and a single JSON array response is returned. Each item in the response array
9
- * corresponds to the command in the same order within the pipeline.
10
- *
11
- * **NOTE:**
12
- *
13
- * Execution of the pipeline is not atomic. Even though each command in
14
- * the pipeline will be executed in order, commands sent by other clients can
15
- * interleave with the pipeline.
16
- *
17
- *
18
- * **Examples:**
19
- *
20
- * ```ts
21
- * const p = redis.pipeline()
22
- * p.set("key","value")
23
- * p.get("key")
24
- * const res = await p.exec()
25
- * ```
26
- *
27
- * You can also chain commands together
28
- * ```ts
29
- * const p = redis.pipeline()
30
- * const res = await p.set("key","value").get("key").exec()
31
- * ```
32
- *
33
- * It's not possible to infer correct types with a dynamic pipeline, so you can
34
- * override the response type manually:
35
- * ```ts
36
- * redis.pipeline()
37
- * .set("key", { greeting: "hello"})
38
- * .get("key")
39
- * .exec<["OK", { greeting: string } ]>()
40
- *
41
- * ```
42
- */
43
- declare class Pipeline {
44
- private client;
45
- private commands;
46
- constructor(client: HttpClient);
47
- /**
48
- * Send the pipeline request to upstash.
49
- *
50
- * Returns an array with the results of all pipelined commands.
51
- *
52
- * You can define a return type manually to make working in typescript easier
53
- * ```ts
54
- * redis.pipeline().get("key").exec<[{ greeting: string }]>()
55
- * ```
56
- */
57
- exec<TCommandResults extends unknown[] = unknown[]>(): Promise<TCommandResults>;
58
- /**
59
- * Pushes a command into the pipelien and returns a chainable instance of the
60
- * pipeline
61
- */
62
- private chain;
63
- /**
64
- * @see https://redis.io/commands/append
65
- */
66
- append(...args: CommandArgs<typeof AppendCommand>): this;
67
- /**
68
- * @see https://redis.io/commands/bitcount
69
- */
70
- bitcount(...args: CommandArgs<typeof BitCountCommand>): this;
71
- /**
72
- * @see https://redis.io/commands/bitop
73
- */
74
- bitop(op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): this;
75
- bitop(op: "not", destinationKey: string, sourceKey: string): this;
76
- /**
77
- * @see https://redis.io/commands/bitpos
78
- */
79
- bitpos(...args: CommandArgs<typeof BitPosCommand>): this;
80
- /**
81
- * @see https://redis.io/commands/dbsize
82
- */
83
- dbsize(): this;
84
- /**
85
- * @see https://redis.io/commands/decr
86
- */
87
- decr(...args: CommandArgs<typeof DecrCommand>): this;
88
- /**
89
- * @see https://redis.io/commands/decrby
90
- */
91
- decrby(...args: CommandArgs<typeof DecrByCommand>): this;
92
- /**
93
- * @see https://redis.io/commands/del
94
- */
95
- del(...args: CommandArgs<typeof DelCommand>): this;
96
- /**
97
- * @see https://redis.io/commands/echo
98
- */
99
- echo(...args: CommandArgs<typeof EchoCommand>): this;
100
- /**
101
- * @see https://redis.io/commands/exists
102
- */
103
- exists(...args: CommandArgs<typeof ExistsCommand>): this;
104
- /**
105
- * @see https://redis.io/commands/expire
106
- */
107
- expire(...args: CommandArgs<typeof ExpireCommand>): this;
108
- /**
109
- * @see https://redis.io/commands/expireat
110
- */
111
- expireat(...args: CommandArgs<typeof ExpireAtCommand>): this;
112
- /**
113
- * @see https://redis.io/commands/flushall
114
- */
115
- flushall(...args: CommandArgs<typeof FlushAllCommand>): this;
116
- /**
117
- * @see https://redis.io/commands/flushdb
118
- */
119
- flushdb(...args: CommandArgs<typeof FlushDBCommand>): this;
120
- /**
121
- * @see https://redis.io/commands/get
122
- */
123
- get<TData>(...args: CommandArgs<typeof GetCommand>): this;
124
- /**
125
- * @see https://redis.io/commands/getbit
126
- */
127
- getbit(...args: CommandArgs<typeof GetBitCommand>): this;
128
- /**
129
- * @see https://redis.io/commands/getrange
130
- */
131
- getrange(...args: CommandArgs<typeof GetRangeCommand>): this;
132
- /**
133
- * @see https://redis.io/commands/getset
134
- */
135
- getset<TData>(key: string, value: TData): this;
136
- /**
137
- * @see https://redis.io/commands/hdel
138
- */
139
- hdel(...args: CommandArgs<typeof HDelCommand>): this;
140
- /**
141
- * @see https://redis.io/commands/hexists
142
- */
143
- hexists(...args: CommandArgs<typeof HExistsCommand>): this;
144
- /**
145
- * @see https://redis.io/commands/hget
146
- */
147
- hget<TData>(...args: CommandArgs<typeof HGetCommand>): this;
148
- /**
149
- * @see https://redis.io/commands/hgetall
150
- */
151
- hgetall<TData extends Record<string, unknown>>(...args: CommandArgs<typeof HGetAllCommand>): this;
152
- /**
153
- * @see https://redis.io/commands/hincrby
154
- */
155
- hincrby(...args: CommandArgs<typeof HIncrByCommand>): this;
156
- /**
157
- * @see https://redis.io/commands/hincrbyfloat
158
- */
159
- hincrbyfloat(...args: CommandArgs<typeof HIncrByFloatCommand>): this;
160
- /**
161
- * @see https://redis.io/commands/hkeys
162
- */
163
- hkeys(...args: CommandArgs<typeof HKeysCommand>): this;
164
- /**
165
- * @see https://redis.io/commands/hlen
166
- */
167
- hlen(...args: CommandArgs<typeof HLenCommand>): this;
168
- /**
169
- * @see https://redis.io/commands/hmget
170
- */
171
- hmget<TData extends Record<string, unknown>>(...args: CommandArgs<typeof HMGetCommand>): this;
172
- /**
173
- * @see https://redis.io/commands/hmset
174
- */
175
- hmset<TData>(key: string, kv: {
176
- [field: string]: TData;
177
- }): this;
178
- /**
179
- * @see https://redis.io/commands/hscan
180
- */
181
- hscan(...args: CommandArgs<typeof HScanCommand>): this;
182
- /**
183
- * @see https://redis.io/commands/hset
184
- */
185
- hset<TData>(key: string, field: string, value: TData): this;
186
- /**
187
- * @see https://redis.io/commands/hsetnx
188
- */
189
- hsetnx<TData>(key: string, field: string, value: TData): this;
190
- /**
191
- * @see https://redis.io/commands/hstrlen
192
- */
193
- hstrlen(...args: CommandArgs<typeof HStrLenCommand>): this;
194
- /**
195
- * @see https://redis.io/commands/hvals
196
- */
197
- hvals(...args: CommandArgs<typeof HValsCommand>): this;
198
- /**
199
- * @see https://redis.io/commands/incr
200
- */
201
- incr(...args: CommandArgs<typeof IncrCommand>): this;
202
- /**
203
- * @see https://redis.io/commands/incrby
204
- */
205
- incrby(...args: CommandArgs<typeof IncrByCommand>): this;
206
- /**
207
- * @see https://redis.io/commands/incrbyfloat
208
- */
209
- incrbyfloat(...args: CommandArgs<typeof IncrByFloatCommand>): this;
210
- /**
211
- * @see https://redis.io/commands/keys
212
- */
213
- keys(...args: CommandArgs<typeof KeysCommand>): this;
214
- /**
215
- * @see https://redis.io/commands/lindex
216
- */
217
- lindex(...args: CommandArgs<typeof LIndexCommand>): this;
218
- /**
219
- * @see https://redis.io/commands/linsert
220
- */
221
- linsert<TData>(key: string, direction: "before" | "after", pivot: TData, value: TData): this;
222
- /**
223
- * @see https://redis.io/commands/llen
224
- */
225
- llen(...args: CommandArgs<typeof LLenCommand>): this;
226
- /**
227
- * @see https://redis.io/commands/lpop
228
- */
229
- lpop<TData>(...args: CommandArgs<typeof LPopCommand>): this;
230
- /**
231
- * @see https://redis.io/commands/lpush
232
- */
233
- lpush<TData>(key: string, ...elements: NonEmptyArray<TData>): this;
234
- /**
235
- * @see https://redis.io/commands/lpushx
236
- */
237
- lpushx<TData>(key: string, ...elements: NonEmptyArray<TData>): this;
238
- /**
239
- * @see https://redis.io/commands/lrange
240
- */
241
- lrange<TResult = string>(...args: CommandArgs<typeof LRangeCommand>): this;
242
- /**
243
- * @see https://redis.io/commands/lrem
244
- */
245
- lrem<TData>(key: string, count: number, value: TData): this;
246
- /**
247
- * @see https://redis.io/commands/lset
248
- */
249
- lset<TData>(key: string, value: TData, index: number): this;
250
- /**
251
- * @see https://redis.io/commands/ltrim
252
- */
253
- ltrim(...args: CommandArgs<typeof LTrimCommand>): this;
254
- /**
255
- * @see https://redis.io/commands/mget
256
- */
257
- mget<TData extends [unknown, ...unknown[]]>(...args: CommandArgs<typeof MGetCommand>): this;
258
- /**
259
- * @see https://redis.io/commands/mset
260
- */
261
- mset<TData>(kv: {
262
- [key: string]: TData;
263
- }): this;
264
- /**
265
- * @see https://redis.io/commands/msetnx
266
- */
267
- msetnx<TData>(kv: {
268
- [key: string]: TData;
269
- }): this;
270
- /**
271
- * @see https://redis.io/commands/persist
272
- */
273
- persist(...args: CommandArgs<typeof PersistCommand>): this;
274
- /**
275
- * @see https://redis.io/commands/pexpire
276
- */
277
- pexpire(...args: CommandArgs<typeof PExpireCommand>): this;
278
- /**
279
- * @see https://redis.io/commands/pexpireat
280
- */
281
- pexpireat(...args: CommandArgs<typeof PExpireAtCommand>): this;
282
- /**
283
- * @see https://redis.io/commands/ping
284
- */
285
- ping(...args: CommandArgs<typeof PingCommand>): this;
286
- /**
287
- * @see https://redis.io/commands/psetex
288
- */
289
- psetex<TData>(key: string, ttl: number, value: TData): this;
290
- /**
291
- * @see https://redis.io/commands/pttl
292
- */
293
- pttl(...args: CommandArgs<typeof PTtlCommand>): this;
294
- /**
295
- * @see https://redis.io/commands/randomkey
296
- */
297
- randomkey(): this;
298
- /**
299
- * @see https://redis.io/commands/rename
300
- */
301
- rename(...args: CommandArgs<typeof RenameCommand>): this;
302
- /**
303
- * @see https://redis.io/commands/renamenx
304
- */
305
- renamenx(...args: CommandArgs<typeof RenameNXCommand>): this;
306
- /**
307
- * @see https://redis.io/commands/rpop
308
- */
309
- rpop<TData = string>(...args: CommandArgs<typeof RPopCommand>): this;
310
- /**
311
- * @see https://redis.io/commands/rpush
312
- */
313
- rpush<TData>(key: string, ...elements: NonEmptyArray<TData>): this;
314
- /**
315
- * @see https://redis.io/commands/rpushx
316
- */
317
- rpushx<TData>(key: string, ...elements: NonEmptyArray<TData>): this;
318
- /**
319
- * @see https://redis.io/commands/sadd
320
- */
321
- sadd<TData>(key: string, ...members: NonEmptyArray<TData>): this;
322
- /**
323
- * @see https://redis.io/commands/scan
324
- */
325
- scan(...args: CommandArgs<typeof ScanCommand>): this;
326
- /**
327
- * @see https://redis.io/commands/scard
328
- */
329
- scard(...args: CommandArgs<typeof SCardCommand>): this;
330
- /**
331
- * @see https://redis.io/commands/sdiff
332
- */
333
- sdiff(...args: CommandArgs<typeof SDiffCommand>): this;
334
- /**
335
- * @see https://redis.io/commands/sdiffstore
336
- */
337
- sdiffstore(...args: CommandArgs<typeof SDiffStoreCommand>): this;
338
- /**
339
- * @see https://redis.io/commands/set
340
- */
341
- set<TData>(key: string, value: TData, opts?: SetCommandOptions): this;
342
- /**
343
- * @see https://redis.io/commands/setbit
344
- */
345
- setbit(...args: CommandArgs<typeof SetBitCommand>): this;
346
- /**
347
- * @see https://redis.io/commands/setex
348
- */
349
- setex<TData>(key: string, ttl: number, value: TData): this;
350
- /**
351
- * @see https://redis.io/commands/setnx
352
- */
353
- setnx<TData>(key: string, value: TData): this;
354
- /**
355
- * @see https://redis.io/commands/setrange
356
- */
357
- setrange(...args: CommandArgs<typeof SetRangeCommand>): this;
358
- /**
359
- * @see https://redis.io/commands/sinter
360
- */
361
- sinter(...args: CommandArgs<typeof SInterCommand>): this;
362
- /**
363
- * @see https://redis.io/commands/sinterstore
364
- */
365
- sinterstore(...args: CommandArgs<typeof SInterStoreCommand>): this;
366
- /**
367
- * @see https://redis.io/commands/sismember
368
- */
369
- sismember<TData>(key: string, member: TData): this;
370
- /**
371
- * @see https://redis.io/commands/smembers
372
- */
373
- smembers(...args: CommandArgs<typeof SMembersCommand>): this;
374
- /**
375
- * @see https://redis.io/commands/smove
376
- */
377
- smove<TData>(source: string, destination: string, member: TData): this;
378
- /**
379
- * @see https://redis.io/commands/spop
380
- */
381
- spop<TData>(...args: CommandArgs<typeof SPopCommand>): this;
382
- /**
383
- * @see https://redis.io/commands/srandmember
384
- */
385
- srandmember<TData>(...args: CommandArgs<typeof SRandMemberCommand>): this;
386
- /**
387
- * @see https://redis.io/commands/srem
388
- */
389
- srem<TData>(key: string, ...members: NonEmptyArray<TData>): this;
390
- /**
391
- * @see https://redis.io/commands/sscan
392
- */
393
- sscan(...args: CommandArgs<typeof SScanCommand>): this;
394
- /**
395
- * @see https://redis.io/commands/strlen
396
- */
397
- strlen(...args: CommandArgs<typeof StrLenCommand>): this;
398
- /**
399
- * @see https://redis.io/commands/sunion
400
- */
401
- sunion(...args: CommandArgs<typeof SUnionCommand>): this;
402
- /**
403
- * @see https://redis.io/commands/sunionstore
404
- */
405
- sunionstore(...args: CommandArgs<typeof SUnionStoreCommand>): this;
406
- /**
407
- * @see https://redis.io/commands/time
408
- */
409
- time(): this;
410
- /**
411
- * @see https://redis.io/commands/touch
412
- */
413
- touch(...args: CommandArgs<typeof TouchCommand>): this;
414
- /**
415
- * @see https://redis.io/commands/ttl
416
- */
417
- ttl(...args: CommandArgs<typeof TtlCommand>): this;
418
- /**
419
- * @see https://redis.io/commands/type
420
- */
421
- type(...args: CommandArgs<typeof TypeCommand>): this;
422
- /**
423
- * @see https://redis.io/commands/unlink
424
- */
425
- unlink(...args: CommandArgs<typeof UnlinkCommand>): this;
426
- /**
427
- * @see https://redis.io/commands/zadd
428
- */
429
- zadd<TData>(key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]): this;
430
- zadd<TData>(key: string, opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]): this;
431
- /**
432
- * @see https://redis.io/commands/zcard
433
- */
434
- zcard(...args: CommandArgs<typeof ZCardCommand>): this;
435
- /**
436
- * @see https://redis.io/commands/zcount
437
- */
438
- zcount(...args: CommandArgs<typeof ZCountCommand>): this;
439
- /**
440
- * @see https://redis.io/commands/zincrby
441
- */
442
- zincrby<TData>(key: string, increment: number, member: TData): this;
443
- /**
444
- * @see https://redis.io/commands/zinterstore
445
- */
446
- zinterstore(...args: CommandArgs<typeof ZInterStoreCommand>): this;
447
- /**
448
- * @see https://redis.io/commands/zlexcount
449
- */
450
- zlexcount(...args: CommandArgs<typeof ZLexCountCommand>): this;
451
- /**
452
- * @see https://redis.io/commands/zpopmax
453
- */
454
- zpopmax<TData>(...args: CommandArgs<typeof ZPopMaxCommand>): this;
455
- /**
456
- * @see https://redis.io/commands/zpopmin
457
- */
458
- zpopmin<TData>(...args: CommandArgs<typeof ZPopMinCommand>): this;
459
- /**
460
- * @see https://redis.io/commands/zrange
461
- */
462
- zrange<TData extends unknown[]>(...args: CommandArgs<typeof ZRangeCommand>): this;
463
- /**
464
- * @see https://redis.io/commands/zrank
465
- */
466
- zrank<TData>(key: string, member: TData): this;
467
- /**
468
- * @see https://redis.io/commands/zrem
469
- */
470
- zrem<TData>(key: string, ...members: NonEmptyArray<TData>): this;
471
- /**
472
- * @see https://redis.io/commands/zremrangebylex
473
- */
474
- zremrangebylex(...args: CommandArgs<typeof ZRemRangeByLexCommand>): this;
475
- /**
476
- * @see https://redis.io/commands/zremrangebyrank
477
- */
478
- zremrangebyrank(...args: CommandArgs<typeof ZRemRangeByRankCommand>): this;
479
- /**
480
- * @see https://redis.io/commands/zremrangebyscore
481
- */
482
- zremrangebyscore(...args: CommandArgs<typeof ZRemRangeByScoreCommand>): this;
483
- /**
484
- * @see https://redis.io/commands/zrevrank
485
- */
486
- zrevrank<TData>(key: string, member: TData): this;
487
- /**
488
- * @see https://redis.io/commands/zscan
489
- */
490
- zscan(...args: CommandArgs<typeof ZScanCommand>): this;
491
- /**
492
- * @see https://redis.io/commands/zscore
493
- */
494
- zscore<TData>(key: string, member: TData): this;
495
- /**
496
- * @see https://redis.io/commands/zunionstore
497
- */
498
- zunionstore(...args: CommandArgs<typeof ZUnionStoreCommand>): this;
499
- }
500
-
501
- /**
502
- * Serverless redis client for upstash.
503
- */
504
- declare class Redis {
505
- private readonly client;
506
- /**
507
- * Create a new redis client
508
- *
509
- * @example
510
- * ```typescript
511
- * const redis = new Redis({
512
- * url: "<UPSTASH_REDIS_REST_URL>",
513
- * token: "<UPSTASH_REDIS_REST_TOKEN>",
514
- * });
515
- * ```
516
- */
517
- constructor(client: HttpClient);
518
- /**
519
- * Create a new pipeline that allows you to send requests in bulk.
520
- *
521
- * @see {@link Pipeline}
522
- */
523
- pipeline(): Pipeline;
524
- /**
525
- * @see https://redis.io/commands/append
526
- */
527
- append(...args: CommandArgs<typeof AppendCommand>): Promise<number>;
528
- /**
529
- * @see https://redis.io/commands/bitcount
530
- */
531
- bitcount(...args: CommandArgs<typeof BitCountCommand>): Promise<number>;
532
- /**
533
- * @see https://redis.io/commands/bitop
534
- */
535
- bitop(op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Promise<number>;
536
- bitop(op: "not", destinationKey: string, sourceKey: string): Promise<number>;
537
- /**
538
- * @see https://redis.io/commands/bitpos
539
- */
540
- bitpos(...args: CommandArgs<typeof BitPosCommand>): Promise<number>;
541
- /**
542
- * @see https://redis.io/commands/dbsize
543
- */
544
- dbsize(): Promise<number>;
545
- /**
546
- * @see https://redis.io/commands/decr
547
- */
548
- decr(...args: CommandArgs<typeof DecrCommand>): Promise<number>;
549
- /**
550
- * @see https://redis.io/commands/decrby
551
- */
552
- decrby(...args: CommandArgs<typeof DecrByCommand>): Promise<number>;
553
- /**
554
- * @see https://redis.io/commands/del
555
- */
556
- del(...args: CommandArgs<typeof DelCommand>): Promise<number>;
557
- /**
558
- * @see https://redis.io/commands/echo
559
- */
560
- echo(...args: CommandArgs<typeof EchoCommand>): Promise<string>;
561
- /**
562
- * @see https://redis.io/commands/exists
563
- */
564
- exists(...args: CommandArgs<typeof ExistsCommand>): Promise<0 | 1>;
565
- /**
566
- * @see https://redis.io/commands/expire
567
- */
568
- expire(...args: CommandArgs<typeof ExpireCommand>): Promise<0 | 1>;
569
- /**
570
- * @see https://redis.io/commands/expireat
571
- */
572
- expireat(...args: CommandArgs<typeof ExpireAtCommand>): Promise<0 | 1>;
573
- /**
574
- * @see https://redis.io/commands/flushall
575
- */
576
- flushall(...args: CommandArgs<typeof FlushAllCommand>): Promise<"OK">;
577
- /**
578
- * @see https://redis.io/commands/flushdb
579
- */
580
- flushdb(...args: CommandArgs<typeof FlushDBCommand>): Promise<"OK">;
581
- /**
582
- * @see https://redis.io/commands/get
583
- */
584
- get<TData>(...args: CommandArgs<typeof GetCommand>): Promise<TData | null>;
585
- /**
586
- * @see https://redis.io/commands/getbit
587
- */
588
- getbit(...args: CommandArgs<typeof GetBitCommand>): Promise<0 | 1>;
589
- /**
590
- * @see https://redis.io/commands/getrange
591
- */
592
- getrange(...args: CommandArgs<typeof GetRangeCommand>): Promise<string>;
593
- /**
594
- * @see https://redis.io/commands/getset
595
- */
596
- getset<TData>(key: string, value: TData): Promise<TData | null>;
597
- /**
598
- * @see https://redis.io/commands/hdel
599
- */
600
- hdel(...args: CommandArgs<typeof HDelCommand>): Promise<0 | 1>;
601
- /**
602
- * @see https://redis.io/commands/hexists
603
- */
604
- hexists(...args: CommandArgs<typeof HExistsCommand>): Promise<number>;
605
- /**
606
- * @see https://redis.io/commands/hget
607
- */
608
- hget<TData>(...args: CommandArgs<typeof HGetCommand>): Promise<TData | null>;
609
- /**
610
- * @see https://redis.io/commands/hgetall
611
- */
612
- hgetall<TData extends Record<string, unknown>>(...args: CommandArgs<typeof HGetAllCommand>): Promise<TData | null>;
613
- /**
614
- * @see https://redis.io/commands/hincrby
615
- */
616
- hincrby(...args: CommandArgs<typeof HIncrByCommand>): Promise<number>;
617
- /**
618
- * @see https://redis.io/commands/hincrbyfloat
619
- */
620
- hincrbyfloat(...args: CommandArgs<typeof HIncrByFloatCommand>): Promise<number>;
621
- /**
622
- * @see https://redis.io/commands/hkeys
623
- */
624
- hkeys(...args: CommandArgs<typeof HKeysCommand>): Promise<string[]>;
625
- /**
626
- * @see https://redis.io/commands/hlen
627
- */
628
- hlen(...args: CommandArgs<typeof HLenCommand>): Promise<number>;
629
- /**
630
- * @see https://redis.io/commands/hmget
631
- */
632
- hmget<TData extends Record<string, unknown>>(...args: CommandArgs<typeof HMGetCommand>): Promise<TData | null>;
633
- /**
634
- * @see https://redis.io/commands/hmset
635
- */
636
- hmset<TData>(key: string, kv: {
637
- [field: string]: TData;
638
- }): Promise<number>;
639
- /**
640
- * @see https://redis.io/commands/hscan
641
- */
642
- hscan(...args: CommandArgs<typeof HScanCommand>): Promise<[number, (string | number)[]]>;
643
- /**
644
- * @see https://redis.io/commands/hset
645
- */
646
- hset<TData>(key: string, field: string, value: TData): Promise<number>;
647
- /**
648
- * @see https://redis.io/commands/hsetnx
649
- */
650
- hsetnx<TData>(key: string, field: string, value: TData): Promise<0 | 1>;
651
- /**
652
- * @see https://redis.io/commands/hstrlen
653
- */
654
- hstrlen(...args: CommandArgs<typeof HStrLenCommand>): Promise<number>;
655
- /**
656
- * @see https://redis.io/commands/hvals
657
- */
658
- hvals(...args: CommandArgs<typeof HValsCommand>): Promise<unknown[]>;
659
- /**
660
- * @see https://redis.io/commands/incr
661
- */
662
- incr(...args: CommandArgs<typeof IncrCommand>): Promise<number>;
663
- /**
664
- * @see https://redis.io/commands/incrby
665
- */
666
- incrby(...args: CommandArgs<typeof IncrByCommand>): Promise<number>;
667
- /**
668
- * @see https://redis.io/commands/incrbyfloat
669
- */
670
- incrbyfloat(...args: CommandArgs<typeof IncrByFloatCommand>): Promise<number>;
671
- /**
672
- * @see https://redis.io/commands/keys
673
- */
674
- keys(...args: CommandArgs<typeof KeysCommand>): Promise<string[]>;
675
- /**
676
- * @see https://redis.io/commands/lindex
677
- */
678
- lindex(...args: CommandArgs<typeof LIndexCommand>): Promise<string | null>;
679
- /**
680
- * @see https://redis.io/commands/linsert
681
- */
682
- linsert<TData>(key: string, direction: "before" | "after", pivot: TData, value: TData): Promise<number>;
683
- /**
684
- * @see https://redis.io/commands/llen
685
- */
686
- llen(...args: CommandArgs<typeof LLenCommand>): Promise<number>;
687
- /**
688
- * @see https://redis.io/commands/lpop
689
- */
690
- lpop<TData>(...args: CommandArgs<typeof LPopCommand>): Promise<TData | null>;
691
- /**
692
- * @see https://redis.io/commands/lpush
693
- */
694
- lpush<TData>(key: string, ...elements: NonEmptyArray<TData>): Promise<number>;
695
- /**
696
- * @see https://redis.io/commands/lpushx
697
- */
698
- lpushx<TData>(key: string, ...elements: NonEmptyArray<TData>): Promise<number>;
699
- /**
700
- * @see https://redis.io/commands/lrange
701
- */
702
- lrange<TResult = string>(...args: CommandArgs<typeof LRangeCommand>): Promise<TResult[]>;
703
- /**
704
- * @see https://redis.io/commands/lrem
705
- */
706
- lrem<TData>(key: string, count: number, value: TData): Promise<number>;
707
- /**
708
- * @see https://redis.io/commands/lset
709
- */
710
- lset<TData>(key: string, value: TData, index: number): Promise<"OK">;
711
- /**
712
- * @see https://redis.io/commands/ltrim
713
- */
714
- ltrim(...args: CommandArgs<typeof LTrimCommand>): Promise<"OK">;
715
- /**
716
- * @see https://redis.io/commands/mget
717
- */
718
- mget<TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>): Promise<TData>;
719
- /**
720
- * @see https://redis.io/commands/mset
721
- */
722
- mset<TData>(kv: {
723
- [key: string]: TData;
724
- }): Promise<"OK">;
725
- /**
726
- * @see https://redis.io/commands/msetnx
727
- */
728
- msetnx<TData>(kv: {
729
- [key: string]: TData;
730
- }): Promise<number>;
731
- /**
732
- * @see https://redis.io/commands/persist
733
- */
734
- persist(...args: CommandArgs<typeof PersistCommand>): Promise<0 | 1>;
735
- /**
736
- * @see https://redis.io/commands/pexpire
737
- */
738
- pexpire(...args: CommandArgs<typeof PExpireCommand>): Promise<0 | 1>;
739
- /**
740
- * @see https://redis.io/commands/pexpireat
741
- */
742
- pexpireat(...args: CommandArgs<typeof PExpireAtCommand>): Promise<0 | 1>;
743
- /**
744
- * @see https://redis.io/commands/ping
745
- */
746
- ping(...args: CommandArgs<typeof PingCommand>): Promise<string>;
747
- /**
748
- * @see https://redis.io/commands/psetex
749
- */
750
- psetex<TData>(key: string, ttl: number, value: TData): Promise<string>;
751
- /**
752
- * @see https://redis.io/commands/pttl
753
- */
754
- pttl(...args: CommandArgs<typeof PTtlCommand>): Promise<number>;
755
- /**
756
- * @see https://redis.io/commands/randomkey
757
- */
758
- randomkey(): Promise<string | null>;
759
- /**
760
- * @see https://redis.io/commands/rename
761
- */
762
- rename(...args: CommandArgs<typeof RenameCommand>): Promise<"OK">;
763
- /**
764
- * @see https://redis.io/commands/renamenx
765
- */
766
- renamenx(...args: CommandArgs<typeof RenameNXCommand>): Promise<0 | 1>;
767
- /**
768
- * @see https://redis.io/commands/rpop
769
- */
770
- rpop<TData = string>(...args: CommandArgs<typeof RPopCommand>): Promise<TData | null>;
771
- /**
772
- * @see https://redis.io/commands/rpush
773
- */
774
- rpush<TData>(key: string, ...elements: NonEmptyArray<TData>): Promise<number>;
775
- /**
776
- * @see https://redis.io/commands/rpushx
777
- */
778
- rpushx<TData>(key: string, ...elements: NonEmptyArray<TData>): Promise<number>;
779
- /**
780
- * @see https://redis.io/commands/sadd
781
- */
782
- sadd<TData>(key: string, ...members: NonEmptyArray<TData>): Promise<number>;
783
- /**
784
- * @see https://redis.io/commands/scan
785
- */
786
- scan(...args: CommandArgs<typeof ScanCommand>): Promise<[number, string[]]>;
787
- /**
788
- * @see https://redis.io/commands/scard
789
- */
790
- scard(...args: CommandArgs<typeof SCardCommand>): Promise<number>;
791
- /**
792
- * @see https://redis.io/commands/sdiff
793
- */
794
- sdiff(...args: CommandArgs<typeof SDiffCommand>): Promise<unknown[]>;
795
- /**
796
- * @see https://redis.io/commands/sdiffstore
797
- */
798
- sdiffstore(...args: CommandArgs<typeof SDiffStoreCommand>): Promise<number>;
799
- /**
800
- * @see https://redis.io/commands/set
801
- */
802
- set<TData>(key: string, value: TData, opts?: SetCommandOptions): Promise<TData>;
803
- /**
804
- * @see https://redis.io/commands/setbit
805
- */
806
- setbit(...args: CommandArgs<typeof SetBitCommand>): Promise<0 | 1>;
807
- /**
808
- * @see https://redis.io/commands/setex
809
- */
810
- setex<TData>(key: string, ttl: number, value: TData): Promise<"OK">;
811
- /**
812
- * @see https://redis.io/commands/setnx
813
- */
814
- setnx<TData>(key: string, value: TData): Promise<number>;
815
- /**
816
- * @see https://redis.io/commands/setrange
817
- */
818
- setrange(...args: CommandArgs<typeof SetRangeCommand>): Promise<number>;
819
- /**
820
- * @see https://redis.io/commands/sinter
821
- */
822
- sinter(...args: CommandArgs<typeof SInterCommand>): Promise<string[]>;
823
- /**
824
- * @see https://redis.io/commands/sinterstore
825
- */
826
- sinterstore(...args: CommandArgs<typeof SInterStoreCommand>): Promise<string[]>;
827
- /**
828
- * @see https://redis.io/commands/sismember
829
- */
830
- sismember<TData>(key: string, member: TData): Promise<0 | 1>;
831
- /**
832
- * @see https://redis.io/commands/smembers
833
- */
834
- smembers(...args: CommandArgs<typeof SMembersCommand>): Promise<string[]>;
835
- /**
836
- * @see https://redis.io/commands/smove
837
- */
838
- smove<TData>(source: string, destination: string, member: TData): Promise<0 | 1>;
839
- /**
840
- * @see https://redis.io/commands/spop
841
- */
842
- spop<TData>(...args: CommandArgs<typeof SPopCommand>): Promise<TData | null>;
843
- /**
844
- * @see https://redis.io/commands/srandmember
845
- */
846
- srandmember<TData>(...args: CommandArgs<typeof SRandMemberCommand>): Promise<TData | null>;
847
- /**
848
- * @see https://redis.io/commands/srem
849
- */
850
- srem<TData>(key: string, ...members: NonEmptyArray<TData>): Promise<number>;
851
- /**
852
- * @see https://redis.io/commands/sscan
853
- */
854
- sscan(...args: CommandArgs<typeof SScanCommand>): Promise<[number, (string | number)[]]>;
855
- /**
856
- * @see https://redis.io/commands/strlen
857
- */
858
- strlen(...args: CommandArgs<typeof StrLenCommand>): Promise<number>;
859
- /**
860
- * @see https://redis.io/commands/sunion
861
- */
862
- sunion(...args: CommandArgs<typeof SUnionCommand>): Promise<unknown[]>;
863
- /**
864
- * @see https://redis.io/commands/sunionstore
865
- */
866
- sunionstore(...args: CommandArgs<typeof SUnionStoreCommand>): Promise<number>;
867
- /**
868
- * @see https://redis.io/commands/time
869
- */
870
- time(): Promise<[number, number]>;
871
- /**
872
- * @see https://redis.io/commands/touch
873
- */
874
- touch(...args: CommandArgs<typeof TouchCommand>): Promise<number>;
875
- /**
876
- * @see https://redis.io/commands/ttl
877
- */
878
- ttl(...args: CommandArgs<typeof TtlCommand>): Promise<number>;
879
- /**
880
- * @see https://redis.io/commands/type
881
- */
882
- type(...args: CommandArgs<typeof TypeCommand>): Promise<Type>;
883
- /**
884
- * @see https://redis.io/commands/unlink
885
- */
886
- unlink(...args: CommandArgs<typeof UnlinkCommand>): Promise<number>;
887
- /**
888
- * @see https://redis.io/commands/zadd
889
- */
890
- zadd<TData>(key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]): Promise<number | null>;
891
- zadd<TData>(key: string, opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr, ...scoreMemberPairs: [ScoreMember<TData>, ...ScoreMember<TData>[]]): Promise<number | null>;
892
- /**
893
- * @see https://redis.io/commands/zcard
894
- */
895
- zcard(...args: CommandArgs<typeof ZCardCommand>): Promise<number>;
896
- /**
897
- * @see https://redis.io/commands/zcount
898
- */
899
- zcount(...args: CommandArgs<typeof ZCountCommand>): Promise<number>;
900
- /**
901
- * @see https://redis.io/commands/zincrby
902
- */
903
- zincrby<TData>(key: string, increment: number, member: TData): Promise<number>;
904
- /**
905
- * @see https://redis.io/commands/zinterstore
906
- */
907
- zinterstore(...args: CommandArgs<typeof ZInterStoreCommand>): Promise<number>;
908
- /**
909
- * @see https://redis.io/commands/zlexcount
910
- */
911
- zlexcount(...args: CommandArgs<typeof ZLexCountCommand>): Promise<number>;
912
- /**
913
- * @see https://redis.io/commands/zpopmax
914
- */
915
- zpopmax<TData>(...args: CommandArgs<typeof ZPopMaxCommand>): Promise<TData[]>;
916
- /**
917
- * @see https://redis.io/commands/zpopmin
918
- */
919
- zpopmin<TData>(...args: CommandArgs<typeof ZPopMinCommand>): Promise<TData[]>;
920
- /**
921
- * @see https://redis.io/commands/zrange
922
- */
923
- zrange<TData extends unknown[]>(...args: CommandArgs<typeof ZRangeCommand>): Promise<TData>;
924
- /**
925
- * @see https://redis.io/commands/zrank
926
- */
927
- zrank<TData>(key: string, member: TData): Promise<number | null>;
928
- /**
929
- * @see https://redis.io/commands/zrem
930
- */
931
- zrem<TData>(key: string, ...members: NonEmptyArray<TData>): Promise<number>;
932
- /**
933
- * @see https://redis.io/commands/zremrangebylex
934
- */
935
- zremrangebylex(...args: CommandArgs<typeof ZRemRangeByLexCommand>): Promise<number>;
936
- /**
937
- * @see https://redis.io/commands/zremrangebyrank
938
- */
939
- zremrangebyrank(...args: CommandArgs<typeof ZRemRangeByRankCommand>): Promise<number>;
940
- /**
941
- * @see https://redis.io/commands/zremrangebyscore
942
- */
943
- zremrangebyscore(...args: CommandArgs<typeof ZRemRangeByScoreCommand>): Promise<number>;
944
- /**
945
- * @see https://redis.io/commands/zrevrank
946
- */
947
- zrevrank<TData>(key: string, member: TData): Promise<number | null>;
948
- /**
949
- * @see https://redis.io/commands/zscan
950
- */
951
- zscan(...args: CommandArgs<typeof ZScanCommand>): Promise<[number, (string | number)[]]>;
952
- /**
953
- * @see https://redis.io/commands/zscore
954
- */
955
- zscore<TData>(key: string, member: TData): Promise<number | null>;
956
- /**
957
- * @see https://redis.io/commands/zunionstore
958
- */
959
- zunionstore(...args: CommandArgs<typeof ZUnionStoreCommand>): Promise<number>;
960
- }
961
-
962
- export { Redis as R };