@upstash/redis 0.0.0-ci.f5cad9e7bda3d77569d9df207b4e1565f75d6154 → 0.0.0-ci.f6da5d747c9564bc95fccdbfe16a9aa10cd30367-20251125191507
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -3
- package/chunk-WTYE7OV3.mjs +4520 -0
- package/cloudflare.d.mts +15 -5
- package/cloudflare.d.ts +15 -5
- package/cloudflare.js +4622 -1
- package/cloudflare.mjs +93 -1
- package/fastly.d.mts +10 -5
- package/fastly.d.ts +10 -5
- package/fastly.js +4595 -1
- package/fastly.mjs +66 -1
- package/nodejs.d.mts +24 -23
- package/nodejs.d.ts +24 -23
- package/nodejs.js +4646 -1
- package/nodejs.mjs +117 -1
- package/package.json +1 -54
- package/zmscore-xbfRql7X.d.mts +4058 -0
- package/zmscore-xbfRql7X.d.ts +4058 -0
- package/redis-b1b1b1df.d.ts +0 -1959
package/redis-b1b1b1df.d.ts
DELETED
|
@@ -1,1959 +0,0 @@
|
|
|
1
|
-
type CommandArgs<TCommand extends new (..._args: any) => any> = ConstructorParameters<TCommand>[0];
|
|
2
|
-
type Telemetry = {
|
|
3
|
-
/**
|
|
4
|
-
* Upstash-Telemetry-Sdk
|
|
5
|
-
* @example @upstash/redis@v1.1.1
|
|
6
|
-
*/
|
|
7
|
-
sdk?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Upstash-Telemetry-Platform
|
|
10
|
-
* @example cloudflare
|
|
11
|
-
*/
|
|
12
|
-
platform?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Upstash-Telemetry-Runtime
|
|
15
|
-
* @example node@v18
|
|
16
|
-
*/
|
|
17
|
-
runtime?: string;
|
|
18
|
-
};
|
|
19
|
-
type RedisOptions = {
|
|
20
|
-
/**
|
|
21
|
-
* Automatically try to deserialize the returned data from upstash using `JSON.deserialize`
|
|
22
|
-
*
|
|
23
|
-
* @default true
|
|
24
|
-
*/
|
|
25
|
-
automaticDeserialization?: boolean;
|
|
26
|
-
enableTelemetry?: boolean;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
type CacheSetting = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
|
|
30
|
-
type UpstashRequest = {
|
|
31
|
-
path?: string[];
|
|
32
|
-
/**
|
|
33
|
-
* Request body will be serialized to json
|
|
34
|
-
*/
|
|
35
|
-
body?: unknown;
|
|
36
|
-
};
|
|
37
|
-
type UpstashResponse<TResult> = {
|
|
38
|
-
result?: TResult;
|
|
39
|
-
error?: string;
|
|
40
|
-
};
|
|
41
|
-
interface Requester {
|
|
42
|
-
request: <TResult = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult>>;
|
|
43
|
-
}
|
|
44
|
-
type RetryConfig = false | {
|
|
45
|
-
/**
|
|
46
|
-
* The number of retries to attempt before giving up.
|
|
47
|
-
*
|
|
48
|
-
* @default 5
|
|
49
|
-
*/
|
|
50
|
-
retries?: number;
|
|
51
|
-
/**
|
|
52
|
-
* A backoff function receives the current retry cound and returns a number in milliseconds to wait before retrying.
|
|
53
|
-
*
|
|
54
|
-
* @default
|
|
55
|
-
* ```ts
|
|
56
|
-
* Math.exp(retryCount) * 50
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
backoff?: (retryCount: number) => number;
|
|
60
|
-
};
|
|
61
|
-
type RequesterConfig = {
|
|
62
|
-
/**
|
|
63
|
-
* Configure the retry behaviour in case of network errors
|
|
64
|
-
*/
|
|
65
|
-
retry?: RetryConfig;
|
|
66
|
-
/**
|
|
67
|
-
* Due to the nature of dynamic and custom data, it is possible to write data to redis that is not
|
|
68
|
-
* valid json and will therefore cause errors when deserializing. This used to happen very
|
|
69
|
-
* frequently with non-utf8 data, such as emojis.
|
|
70
|
-
*
|
|
71
|
-
* By default we will therefore encode the data as base64 on the server, before sending it to the
|
|
72
|
-
* client. The client will then decode the base64 data and parse it as utf8.
|
|
73
|
-
*
|
|
74
|
-
* For very large entries, this can add a few milliseconds, so if you are sure that your data is
|
|
75
|
-
* valid utf8, you can disable this behaviour by setting this option to false.
|
|
76
|
-
*
|
|
77
|
-
* Here's what the response body looks like:
|
|
78
|
-
*
|
|
79
|
-
* ```json
|
|
80
|
-
* {
|
|
81
|
-
* result?: "base64-encoded",
|
|
82
|
-
* error?: string
|
|
83
|
-
* }
|
|
84
|
-
* ```
|
|
85
|
-
*
|
|
86
|
-
* @default "base64"
|
|
87
|
-
*/
|
|
88
|
-
responseEncoding?: false | "base64";
|
|
89
|
-
/**
|
|
90
|
-
* Configure the cache behaviour
|
|
91
|
-
* @default "no-store"
|
|
92
|
-
*/
|
|
93
|
-
cache?: CacheSetting;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
type Serialize = (data: unknown) => string | number | boolean;
|
|
97
|
-
type Deserialize<TResult, TData> = (result: TResult) => TData;
|
|
98
|
-
type CommandOptions<TResult, TData> = {
|
|
99
|
-
/**
|
|
100
|
-
* Custom deserializer
|
|
101
|
-
*/
|
|
102
|
-
deserialize?: (result: TResult) => TData;
|
|
103
|
-
/**
|
|
104
|
-
* Automatically try to deserialize the returned data from upstash using `JSON.deserialize`
|
|
105
|
-
*
|
|
106
|
-
* @default true
|
|
107
|
-
*/
|
|
108
|
-
automaticDeserialization?: boolean;
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* Command offers default (de)serialization and the exec method to all commands.
|
|
112
|
-
*
|
|
113
|
-
* TData represents what the user will enter or receive,
|
|
114
|
-
* TResult is the raw data returned from upstash, which may need to be transformed or parsed.
|
|
115
|
-
*/
|
|
116
|
-
declare class Command<TResult, TData> {
|
|
117
|
-
readonly command: (string | number | boolean)[];
|
|
118
|
-
readonly serialize: Serialize;
|
|
119
|
-
readonly deserialize: Deserialize<TResult, TData>;
|
|
120
|
-
/**
|
|
121
|
-
* Create a new command instance.
|
|
122
|
-
*
|
|
123
|
-
* You can define a custom `deserialize` function. By default we try to deserialize as json.
|
|
124
|
-
*/
|
|
125
|
-
constructor(command: (string | boolean | number | unknown)[], opts?: CommandOptions<TResult, TData>);
|
|
126
|
-
/**
|
|
127
|
-
* Execute the command using a client.
|
|
128
|
-
*/
|
|
129
|
-
exec(client: Requester): Promise<TData>;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
type ZUnionStoreCommandOptions = {
|
|
133
|
-
aggregate?: "sum" | "min" | "max";
|
|
134
|
-
} & ({
|
|
135
|
-
weight: number;
|
|
136
|
-
weights?: never;
|
|
137
|
-
} | {
|
|
138
|
-
weight?: never;
|
|
139
|
-
weights: number[];
|
|
140
|
-
} | {
|
|
141
|
-
weight?: never;
|
|
142
|
-
weights?: never;
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
type ZUnionCommandOptions = {
|
|
146
|
-
withScores?: boolean;
|
|
147
|
-
aggregate?: "sum" | "min" | "max";
|
|
148
|
-
} & ({
|
|
149
|
-
weight: number;
|
|
150
|
-
weights?: never;
|
|
151
|
-
} | {
|
|
152
|
-
weight?: never;
|
|
153
|
-
weights: number[];
|
|
154
|
-
} | {
|
|
155
|
-
weight?: never;
|
|
156
|
-
weights?: never;
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
type ZInterStoreCommandOptions = {
|
|
160
|
-
aggregate?: "sum" | "min" | "max";
|
|
161
|
-
} & ({
|
|
162
|
-
weight: number;
|
|
163
|
-
weights?: never;
|
|
164
|
-
} | {
|
|
165
|
-
weight?: never;
|
|
166
|
-
weights: number[];
|
|
167
|
-
} | {
|
|
168
|
-
weight?: never;
|
|
169
|
-
weights?: never;
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
type Type = "string" | "list" | "set" | "zset" | "hash" | "none";
|
|
173
|
-
|
|
174
|
-
type ScriptFlushCommandOptions = {
|
|
175
|
-
sync: true;
|
|
176
|
-
async?: never;
|
|
177
|
-
} | {
|
|
178
|
-
sync?: never;
|
|
179
|
-
async: true;
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
type ScanCommandOptions = {
|
|
183
|
-
match?: string;
|
|
184
|
-
count?: number;
|
|
185
|
-
type?: string;
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
type GeoAddCommandOptions = {
|
|
189
|
-
nx?: boolean;
|
|
190
|
-
xx?: never;
|
|
191
|
-
} | ({
|
|
192
|
-
nx?: never;
|
|
193
|
-
xx?: boolean;
|
|
194
|
-
} & {
|
|
195
|
-
ch?: boolean;
|
|
196
|
-
});
|
|
197
|
-
interface GeoMember<TMemberType> {
|
|
198
|
-
latitude: number;
|
|
199
|
-
longitude: number;
|
|
200
|
-
member: TMemberType;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* @see https://redis.io/commands/bitop
|
|
205
|
-
*/
|
|
206
|
-
declare class BitOpCommand extends Command<number, number> {
|
|
207
|
-
constructor(cmd: [op: "and" | "or" | "xor", destinationKey: string, ...sourceKeys: string[]], opts?: CommandOptions<number, number>);
|
|
208
|
-
constructor(cmd: [op: "not", destinationKey: string, sourceKey: string], opts?: CommandOptions<number, number>);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* @see https://redis.io/commands/del
|
|
213
|
-
*/
|
|
214
|
-
declare class DelCommand extends Command<number, number> {
|
|
215
|
-
constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* @see https://redis.io/commands/exists
|
|
220
|
-
*/
|
|
221
|
-
declare class ExistsCommand extends Command<number, number> {
|
|
222
|
-
constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* @see https://redis.io/commands/flushall
|
|
227
|
-
*/
|
|
228
|
-
declare class FlushAllCommand extends Command<"OK", "OK"> {
|
|
229
|
-
constructor(args?: [{
|
|
230
|
-
async?: boolean;
|
|
231
|
-
}], opts?: CommandOptions<"OK", "OK">);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* @see https://redis.io/commands/json.get
|
|
236
|
-
*/
|
|
237
|
-
declare class JsonGetCommand<TData extends (unknown | Record<string, unknown>) | (unknown | Record<string, unknown>)[]> extends Command<TData | null, TData | null> {
|
|
238
|
-
constructor(cmd: [
|
|
239
|
-
key: string,
|
|
240
|
-
opts?: {
|
|
241
|
-
indent?: string;
|
|
242
|
-
newline?: string;
|
|
243
|
-
space?: string;
|
|
244
|
-
},
|
|
245
|
-
...path: string[]
|
|
246
|
-
] | [key: string, ...path: string[]], opts?: CommandOptions<TData | null, TData | null>);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* @see https://redis.io/commands/mget
|
|
251
|
-
*/
|
|
252
|
-
declare class MGetCommand<TData extends unknown[]> extends Command<(string | null)[], TData> {
|
|
253
|
-
constructor(cmd: [string[]] | [...(string[] | string[])], opts?: CommandOptions<(string | null)[], TData>);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* @see https://redis.io/commands/ping
|
|
258
|
-
*/
|
|
259
|
-
declare class PingCommand extends Command<string | "PONG", string | "PONG"> {
|
|
260
|
-
constructor(cmd?: [message?: string], opts?: CommandOptions<string | "PONG", string | "PONG">);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* @see https://redis.io/commands/script-exists
|
|
265
|
-
*/
|
|
266
|
-
declare class ScriptExistsCommand<T extends string[]> extends Command<string[], number[]> {
|
|
267
|
-
constructor(hashes: T, opts?: CommandOptions<string[], number[]>);
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
type SetCommandOptions = {
|
|
271
|
-
get?: boolean;
|
|
272
|
-
} & ({
|
|
273
|
-
ex: number;
|
|
274
|
-
px?: never;
|
|
275
|
-
exat?: never;
|
|
276
|
-
pxat?: never;
|
|
277
|
-
keepTtl?: never;
|
|
278
|
-
} | {
|
|
279
|
-
ex?: never;
|
|
280
|
-
px: number;
|
|
281
|
-
exat?: never;
|
|
282
|
-
pxat?: never;
|
|
283
|
-
keepTtl?: never;
|
|
284
|
-
} | {
|
|
285
|
-
ex?: never;
|
|
286
|
-
px?: never;
|
|
287
|
-
exat: number;
|
|
288
|
-
pxat?: never;
|
|
289
|
-
keepTtl?: never;
|
|
290
|
-
} | {
|
|
291
|
-
ex?: never;
|
|
292
|
-
px?: never;
|
|
293
|
-
exat?: never;
|
|
294
|
-
pxat: number;
|
|
295
|
-
keepTtl?: never;
|
|
296
|
-
} | {
|
|
297
|
-
ex?: never;
|
|
298
|
-
px?: never;
|
|
299
|
-
exat?: never;
|
|
300
|
-
pxat?: never;
|
|
301
|
-
keepTtl: true;
|
|
302
|
-
} | {
|
|
303
|
-
ex?: never;
|
|
304
|
-
px?: never;
|
|
305
|
-
exat?: never;
|
|
306
|
-
pxat?: never;
|
|
307
|
-
keepTtl?: never;
|
|
308
|
-
}) & ({
|
|
309
|
-
nx: true;
|
|
310
|
-
xx?: never;
|
|
311
|
-
} | {
|
|
312
|
-
xx: true;
|
|
313
|
-
nx?: never;
|
|
314
|
-
} | {
|
|
315
|
-
xx?: never;
|
|
316
|
-
nx?: never;
|
|
317
|
-
});
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* @see https://redis.io/commands/touch
|
|
321
|
-
*/
|
|
322
|
-
declare class TouchCommand extends Command<number, number> {
|
|
323
|
-
constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* @see https://redis.io/commands/unlink
|
|
328
|
-
*/
|
|
329
|
-
declare class UnlinkCommand extends Command<number, number> {
|
|
330
|
-
constructor(cmd: [...keys: string[]], opts?: CommandOptions<number, number>);
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
type ZAddCommandOptions = ({
|
|
334
|
-
nx: true;
|
|
335
|
-
xx?: never;
|
|
336
|
-
} | {
|
|
337
|
-
nx?: never;
|
|
338
|
-
xx: true;
|
|
339
|
-
} | {
|
|
340
|
-
nx?: never;
|
|
341
|
-
xx?: never;
|
|
342
|
-
}) & {
|
|
343
|
-
ch?: true;
|
|
344
|
-
};
|
|
345
|
-
type ZAddCommandOptionsWithIncr = ZAddCommandOptions & {
|
|
346
|
-
incr: true;
|
|
347
|
-
};
|
|
348
|
-
type ScoreMember<TData> = {
|
|
349
|
-
score: number;
|
|
350
|
-
member: TData;
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
type ZRangeCommandOptions = {
|
|
354
|
-
withScores?: boolean;
|
|
355
|
-
rev?: boolean;
|
|
356
|
-
} & ({
|
|
357
|
-
byScore: true;
|
|
358
|
-
byLex?: never;
|
|
359
|
-
} | {
|
|
360
|
-
byScore?: never;
|
|
361
|
-
byLex: true;
|
|
362
|
-
} | {
|
|
363
|
-
byScore?: never;
|
|
364
|
-
byLex?: never;
|
|
365
|
-
}) & ({
|
|
366
|
-
offset: number;
|
|
367
|
-
count: number;
|
|
368
|
-
} | {
|
|
369
|
-
offset?: never;
|
|
370
|
-
count?: never;
|
|
371
|
-
});
|
|
372
|
-
|
|
373
|
-
type InferResponseData<T extends unknown[]> = {
|
|
374
|
-
[K in keyof T]: T[K] extends Command<any, infer TData> ? TData : unknown;
|
|
375
|
-
};
|
|
376
|
-
/**
|
|
377
|
-
* Upstash REST API supports command pipelining to send multiple commands in
|
|
378
|
-
* batch, instead of sending each command one by one and waiting for a response.
|
|
379
|
-
* When using pipelines, several commands are sent using a single HTTP request,
|
|
380
|
-
* and a single JSON array response is returned. Each item in the response array
|
|
381
|
-
* corresponds to the command in the same order within the pipeline.
|
|
382
|
-
*
|
|
383
|
-
* **NOTE:**
|
|
384
|
-
*
|
|
385
|
-
* Execution of the pipeline is not atomic. Even though each command in
|
|
386
|
-
* the pipeline will be executed in order, commands sent by other clients can
|
|
387
|
-
* interleave with the pipeline.
|
|
388
|
-
*
|
|
389
|
-
* **Examples:**
|
|
390
|
-
*
|
|
391
|
-
* ```ts
|
|
392
|
-
* const p = redis.pipeline() // or redis.multi()
|
|
393
|
-
* p.set("key","value")
|
|
394
|
-
* p.get("key")
|
|
395
|
-
* const res = await p.exec()
|
|
396
|
-
* ```
|
|
397
|
-
*
|
|
398
|
-
* You can also chain commands together
|
|
399
|
-
* ```ts
|
|
400
|
-
* const p = redis.pipeline()
|
|
401
|
-
* const res = await p.set("key","value").get("key").exec()
|
|
402
|
-
* ```
|
|
403
|
-
*
|
|
404
|
-
* Return types are inferred if all commands are chained, but you can still
|
|
405
|
-
* override the response type manually:
|
|
406
|
-
* ```ts
|
|
407
|
-
* redis.pipeline()
|
|
408
|
-
* .set("key", { greeting: "hello"})
|
|
409
|
-
* .get("key")
|
|
410
|
-
* .exec<["OK", { greeting: string } ]>()
|
|
411
|
-
*
|
|
412
|
-
* ```
|
|
413
|
-
*/
|
|
414
|
-
declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
415
|
-
private client;
|
|
416
|
-
private commands;
|
|
417
|
-
private commandOptions?;
|
|
418
|
-
private multiExec;
|
|
419
|
-
constructor(opts: {
|
|
420
|
-
client: Requester;
|
|
421
|
-
commandOptions?: CommandOptions<any, any>;
|
|
422
|
-
multiExec?: boolean;
|
|
423
|
-
});
|
|
424
|
-
/**
|
|
425
|
-
* Send the pipeline request to upstash.
|
|
426
|
-
*
|
|
427
|
-
* Returns an array with the results of all pipelined commands.
|
|
428
|
-
*
|
|
429
|
-
* If all commands are statically chained from start to finish, types are inferred. You can still define a return type manually if necessary though:
|
|
430
|
-
* ```ts
|
|
431
|
-
* const p = redis.pipeline()
|
|
432
|
-
* p.get("key")
|
|
433
|
-
* const result = p.exec<[{ greeting: string }]>()
|
|
434
|
-
* ```
|
|
435
|
-
*/
|
|
436
|
-
exec: <TCommandResults extends unknown[] = [] extends TCommands ? unknown[] : InferResponseData<TCommands>>() => Promise<TCommandResults>;
|
|
437
|
-
/**
|
|
438
|
-
* Returns the length of pipeline before the execution
|
|
439
|
-
*/
|
|
440
|
-
length(): number;
|
|
441
|
-
/**
|
|
442
|
-
* Pushes a command into the pipeline and returns a chainable instance of the
|
|
443
|
-
* pipeline
|
|
444
|
-
*/
|
|
445
|
-
private chain;
|
|
446
|
-
/**
|
|
447
|
-
* @see https://redis.io/commands/append
|
|
448
|
-
*/
|
|
449
|
-
append: (key: string, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
450
|
-
/**
|
|
451
|
-
* @see https://redis.io/commands/bitcount
|
|
452
|
-
*/
|
|
453
|
-
bitcount: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
454
|
-
/**
|
|
455
|
-
* @see https://redis.io/commands/bitop
|
|
456
|
-
*/
|
|
457
|
-
bitop: {
|
|
458
|
-
(op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Pipeline<[...TCommands, BitOpCommand]>;
|
|
459
|
-
(op: "not", destinationKey: string, sourceKey: string): Pipeline<[...TCommands, BitOpCommand]>;
|
|
460
|
-
};
|
|
461
|
-
/**
|
|
462
|
-
* @see https://redis.io/commands/bitpos
|
|
463
|
-
*/
|
|
464
|
-
bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
465
|
-
/**
|
|
466
|
-
* @see https://redis.io/commands/zdiffstore
|
|
467
|
-
*/
|
|
468
|
-
zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
469
|
-
/**
|
|
470
|
-
* @see https://redis.io/commands/dbsize
|
|
471
|
-
*/
|
|
472
|
-
dbsize: () => Pipeline<[...TCommands, Command<any, number>]>;
|
|
473
|
-
/**
|
|
474
|
-
* @see https://redis.io/commands/decr
|
|
475
|
-
*/
|
|
476
|
-
decr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
477
|
-
/**
|
|
478
|
-
* @see https://redis.io/commands/decrby
|
|
479
|
-
*/
|
|
480
|
-
decrby: (key: string, decrement: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
481
|
-
/**
|
|
482
|
-
* @see https://redis.io/commands/del
|
|
483
|
-
*/
|
|
484
|
-
del: (...args: CommandArgs<typeof DelCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
485
|
-
/**
|
|
486
|
-
* @see https://redis.io/commands/echo
|
|
487
|
-
*/
|
|
488
|
-
echo: (message: string) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
489
|
-
/**
|
|
490
|
-
* @see https://redis.io/commands/eval
|
|
491
|
-
*/
|
|
492
|
-
eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
493
|
-
/**
|
|
494
|
-
* @see https://redis.io/commands/evalsha
|
|
495
|
-
*/
|
|
496
|
-
evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
497
|
-
/**
|
|
498
|
-
* @see https://redis.io/commands/exists
|
|
499
|
-
*/
|
|
500
|
-
exists: (...args: CommandArgs<typeof ExistsCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
501
|
-
/**
|
|
502
|
-
* @see https://redis.io/commands/expire
|
|
503
|
-
*/
|
|
504
|
-
expire: (key: string, seconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
505
|
-
/**
|
|
506
|
-
* @see https://redis.io/commands/expireat
|
|
507
|
-
*/
|
|
508
|
-
expireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
509
|
-
/**
|
|
510
|
-
* @see https://redis.io/commands/flushall
|
|
511
|
-
*/
|
|
512
|
-
flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
513
|
-
/**
|
|
514
|
-
* @see https://redis.io/commands/flushdb
|
|
515
|
-
*/
|
|
516
|
-
flushdb: (opts?: {
|
|
517
|
-
async?: boolean | undefined;
|
|
518
|
-
} | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
519
|
-
/**
|
|
520
|
-
* @see https://redis.io/commands/get
|
|
521
|
-
*/
|
|
522
|
-
get: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
523
|
-
/**
|
|
524
|
-
* @see https://redis.io/commands/getbit
|
|
525
|
-
*/
|
|
526
|
-
getbit: (key: string, offset: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
527
|
-
/**
|
|
528
|
-
* @see https://redis.io/commands/getdel
|
|
529
|
-
*/
|
|
530
|
-
getdel: <TData>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
531
|
-
/**
|
|
532
|
-
* @see https://redis.io/commands/getrange
|
|
533
|
-
*/
|
|
534
|
-
getrange: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
535
|
-
/**
|
|
536
|
-
* @see https://redis.io/commands/getset
|
|
537
|
-
*/
|
|
538
|
-
getset: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
539
|
-
/**
|
|
540
|
-
* @see https://redis.io/commands/hdel
|
|
541
|
-
*/
|
|
542
|
-
hdel: (key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
543
|
-
/**
|
|
544
|
-
* @see https://redis.io/commands/hexists
|
|
545
|
-
*/
|
|
546
|
-
hexists: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
547
|
-
/**
|
|
548
|
-
* @see https://redis.io/commands/hget
|
|
549
|
-
*/
|
|
550
|
-
hget: <TData>(key: string, field: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
551
|
-
/**
|
|
552
|
-
* @see https://redis.io/commands/hgetall
|
|
553
|
-
*/
|
|
554
|
-
hgetall: <TData extends Record<string, unknown>>(key: string) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
555
|
-
/**
|
|
556
|
-
* @see https://redis.io/commands/hincrby
|
|
557
|
-
*/
|
|
558
|
-
hincrby: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
559
|
-
/**
|
|
560
|
-
* @see https://redis.io/commands/hincrbyfloat
|
|
561
|
-
*/
|
|
562
|
-
hincrbyfloat: (key: string, field: string, increment: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
563
|
-
/**
|
|
564
|
-
* @see https://redis.io/commands/hkeys
|
|
565
|
-
*/
|
|
566
|
-
hkeys: (key: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
|
|
567
|
-
/**
|
|
568
|
-
* @see https://redis.io/commands/hlen
|
|
569
|
-
*/
|
|
570
|
-
hlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
571
|
-
/**
|
|
572
|
-
* @see https://redis.io/commands/hmget
|
|
573
|
-
*/
|
|
574
|
-
hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
575
|
-
/**
|
|
576
|
-
* @see https://redis.io/commands/hmset
|
|
577
|
-
*/
|
|
578
|
-
hmset: <TData>(key: string, kv: {
|
|
579
|
-
[field: string]: TData;
|
|
580
|
-
}) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
581
|
-
/**
|
|
582
|
-
* @see https://redis.io/commands/hrandfield
|
|
583
|
-
*/
|
|
584
|
-
hrandfield: <TData extends string | string[] | Record<string, unknown>>(key: string, count?: number, withValues?: boolean) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
585
|
-
/**
|
|
586
|
-
* @see https://redis.io/commands/hscan
|
|
587
|
-
*/
|
|
588
|
-
hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
|
|
589
|
-
/**
|
|
590
|
-
* @see https://redis.io/commands/hset
|
|
591
|
-
*/
|
|
592
|
-
hset: <TData>(key: string, kv: {
|
|
593
|
-
[field: string]: TData;
|
|
594
|
-
}) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
595
|
-
/**
|
|
596
|
-
* @see https://redis.io/commands/hsetnx
|
|
597
|
-
*/
|
|
598
|
-
hsetnx: <TData>(key: string, field: string, value: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
599
|
-
/**
|
|
600
|
-
* @see https://redis.io/commands/hstrlen
|
|
601
|
-
*/
|
|
602
|
-
hstrlen: (key: string, field: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
603
|
-
/**
|
|
604
|
-
* @see https://redis.io/commands/hvals
|
|
605
|
-
*/
|
|
606
|
-
hvals: (key: string) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
607
|
-
/**
|
|
608
|
-
* @see https://redis.io/commands/incr
|
|
609
|
-
*/
|
|
610
|
-
incr: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
611
|
-
/**
|
|
612
|
-
* @see https://redis.io/commands/incrby
|
|
613
|
-
*/
|
|
614
|
-
incrby: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
615
|
-
/**
|
|
616
|
-
* @see https://redis.io/commands/incrbyfloat
|
|
617
|
-
*/
|
|
618
|
-
incrbyfloat: (key: string, value: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
619
|
-
/**
|
|
620
|
-
* @see https://redis.io/commands/keys
|
|
621
|
-
*/
|
|
622
|
-
keys: (pattern: string) => Pipeline<[...TCommands, Command<any, string[]>]>;
|
|
623
|
-
/**
|
|
624
|
-
* @see https://redis.io/commands/lindex
|
|
625
|
-
*/
|
|
626
|
-
lindex: (key: string, index: number) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
627
|
-
/**
|
|
628
|
-
* @see https://redis.io/commands/linsert
|
|
629
|
-
*/
|
|
630
|
-
linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
631
|
-
/**
|
|
632
|
-
* @see https://redis.io/commands/llen
|
|
633
|
-
*/
|
|
634
|
-
llen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
635
|
-
/**
|
|
636
|
-
* @see https://redis.io/commands/lmove
|
|
637
|
-
*/
|
|
638
|
-
lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
639
|
-
/**
|
|
640
|
-
* @see https://redis.io/commands/lpop
|
|
641
|
-
*/
|
|
642
|
-
lpop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
643
|
-
/**
|
|
644
|
-
* @see https://redis.io/commands/lpos
|
|
645
|
-
*/
|
|
646
|
-
lpos: <TData>(key: string, element: unknown, opts?: {
|
|
647
|
-
rank?: number | undefined;
|
|
648
|
-
count?: number | undefined;
|
|
649
|
-
maxLen?: number | undefined;
|
|
650
|
-
} | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
651
|
-
/**
|
|
652
|
-
* @see https://redis.io/commands/lpush
|
|
653
|
-
*/
|
|
654
|
-
lpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
655
|
-
/**
|
|
656
|
-
* @see https://redis.io/commands/lpushx
|
|
657
|
-
*/
|
|
658
|
-
lpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
659
|
-
/**
|
|
660
|
-
* @see https://redis.io/commands/lrange
|
|
661
|
-
*/
|
|
662
|
-
lrange: <TResult = string>(key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, TResult[]>]>;
|
|
663
|
-
/**
|
|
664
|
-
* @see https://redis.io/commands/lrem
|
|
665
|
-
*/
|
|
666
|
-
lrem: <TData>(key: string, count: number, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
667
|
-
/**
|
|
668
|
-
* @see https://redis.io/commands/lset
|
|
669
|
-
*/
|
|
670
|
-
lset: <TData>(key: string, index: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
671
|
-
/**
|
|
672
|
-
* @see https://redis.io/commands/ltrim
|
|
673
|
-
*/
|
|
674
|
-
ltrim: (key: string, start: number, end: number) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
675
|
-
/**
|
|
676
|
-
* @see https://redis.io/commands/mget
|
|
677
|
-
*/
|
|
678
|
-
mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
679
|
-
/**
|
|
680
|
-
* @see https://redis.io/commands/mset
|
|
681
|
-
*/
|
|
682
|
-
mset: <TData>(kv: {
|
|
683
|
-
[key: string]: TData;
|
|
684
|
-
}) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
685
|
-
/**
|
|
686
|
-
* @see https://redis.io/commands/msetnx
|
|
687
|
-
*/
|
|
688
|
-
msetnx: <TData>(kv: {
|
|
689
|
-
[key: string]: TData;
|
|
690
|
-
}) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
691
|
-
/**
|
|
692
|
-
* @see https://redis.io/commands/persist
|
|
693
|
-
*/
|
|
694
|
-
persist: (key: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
695
|
-
/**
|
|
696
|
-
* @see https://redis.io/commands/pexpire
|
|
697
|
-
*/
|
|
698
|
-
pexpire: (key: string, milliseconds: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
699
|
-
/**
|
|
700
|
-
* @see https://redis.io/commands/pexpireat
|
|
701
|
-
*/
|
|
702
|
-
pexpireat: (key: string, unix: number) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
703
|
-
/**
|
|
704
|
-
* @see https://redis.io/commands/ping
|
|
705
|
-
*/
|
|
706
|
-
ping: (args?: CommandArgs<typeof PingCommand>) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
707
|
-
/**
|
|
708
|
-
* @see https://redis.io/commands/psetex
|
|
709
|
-
*/
|
|
710
|
-
psetex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
711
|
-
/**
|
|
712
|
-
* @see https://redis.io/commands/pttl
|
|
713
|
-
*/
|
|
714
|
-
pttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
715
|
-
/**
|
|
716
|
-
* @see https://redis.io/commands/publish
|
|
717
|
-
*/
|
|
718
|
-
publish: (channel: string, message: unknown) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
719
|
-
/**
|
|
720
|
-
* @see https://redis.io/commands/randomkey
|
|
721
|
-
*/
|
|
722
|
-
randomkey: () => Pipeline<[...TCommands, Command<any, string | null>]>;
|
|
723
|
-
/**
|
|
724
|
-
* @see https://redis.io/commands/rename
|
|
725
|
-
*/
|
|
726
|
-
rename: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
727
|
-
/**
|
|
728
|
-
* @see https://redis.io/commands/renamenx
|
|
729
|
-
*/
|
|
730
|
-
renamenx: (source: string, destination: string) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
731
|
-
/**
|
|
732
|
-
* @see https://redis.io/commands/rpop
|
|
733
|
-
*/
|
|
734
|
-
rpop: <TData = string>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
735
|
-
/**
|
|
736
|
-
* @see https://redis.io/commands/rpush
|
|
737
|
-
*/
|
|
738
|
-
rpush: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
739
|
-
/**
|
|
740
|
-
* @see https://redis.io/commands/rpushx
|
|
741
|
-
*/
|
|
742
|
-
rpushx: <TData>(key: string, ...elements: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
743
|
-
/**
|
|
744
|
-
* @see https://redis.io/commands/sadd
|
|
745
|
-
*/
|
|
746
|
-
sadd: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
747
|
-
/**
|
|
748
|
-
* @see https://redis.io/commands/scan
|
|
749
|
-
*/
|
|
750
|
-
scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, string[]]>]>;
|
|
751
|
-
/**
|
|
752
|
-
* @see https://redis.io/commands/scard
|
|
753
|
-
*/
|
|
754
|
-
scard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
755
|
-
/**
|
|
756
|
-
* @see https://redis.io/commands/script-exists
|
|
757
|
-
*/
|
|
758
|
-
scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Pipeline<[...TCommands, Command<any, number[]>]>;
|
|
759
|
-
/**
|
|
760
|
-
* @see https://redis.io/commands/script-flush
|
|
761
|
-
*/
|
|
762
|
-
scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
763
|
-
/**
|
|
764
|
-
* @see https://redis.io/commands/script-load
|
|
765
|
-
*/
|
|
766
|
-
scriptLoad: (script: string) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
767
|
-
sdiff: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
768
|
-
/**
|
|
769
|
-
* @see https://redis.io/commands/sdiffstore
|
|
770
|
-
*/
|
|
771
|
-
sdiffstore: (destination: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
772
|
-
/**
|
|
773
|
-
* @see https://redis.io/commands/set
|
|
774
|
-
*/
|
|
775
|
-
set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Pipeline<[...TCommands, Command<any, "OK" | TData | null>]>;
|
|
776
|
-
/**
|
|
777
|
-
* @see https://redis.io/commands/setbit
|
|
778
|
-
*/
|
|
779
|
-
setbit: (key: string, offset: number, value: 0 | 1) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
780
|
-
/**
|
|
781
|
-
* @see https://redis.io/commands/setex
|
|
782
|
-
*/
|
|
783
|
-
setex: <TData>(key: string, ttl: number, value: TData) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
784
|
-
/**
|
|
785
|
-
* @see https://redis.io/commands/setnx
|
|
786
|
-
*/
|
|
787
|
-
setnx: <TData>(key: string, value: TData) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
788
|
-
/**
|
|
789
|
-
* @see https://redis.io/commands/setrange
|
|
790
|
-
*/
|
|
791
|
-
setrange: (key: string, offset: number, value: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
792
|
-
/**
|
|
793
|
-
* @see https://redis.io/commands/sinter
|
|
794
|
-
*/
|
|
795
|
-
sinter: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, string[]>]>;
|
|
796
|
-
/**
|
|
797
|
-
* @see https://redis.io/commands/sinterstore
|
|
798
|
-
*/
|
|
799
|
-
sinterstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
800
|
-
/**
|
|
801
|
-
* @see https://redis.io/commands/sismember
|
|
802
|
-
*/
|
|
803
|
-
sismember: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
804
|
-
/**
|
|
805
|
-
* @see https://redis.io/commands/smembers
|
|
806
|
-
*/
|
|
807
|
-
smembers: <TData extends unknown[] = string[]>(key: string) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
808
|
-
/**
|
|
809
|
-
* @see https://redis.io/commands/smismember
|
|
810
|
-
*/
|
|
811
|
-
smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Pipeline<[...TCommands, Command<any, (0 | 1)[]>]>;
|
|
812
|
-
/**
|
|
813
|
-
* @see https://redis.io/commands/smove
|
|
814
|
-
*/
|
|
815
|
-
smove: <TData>(source: string, destination: string, member: TData) => Pipeline<[...TCommands, Command<any, 0 | 1>]>;
|
|
816
|
-
/**
|
|
817
|
-
* @see https://redis.io/commands/spop
|
|
818
|
-
*/
|
|
819
|
-
spop: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
820
|
-
/**
|
|
821
|
-
* @see https://redis.io/commands/srandmember
|
|
822
|
-
*/
|
|
823
|
-
srandmember: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData | null>]>;
|
|
824
|
-
/**
|
|
825
|
-
* @see https://redis.io/commands/srem
|
|
826
|
-
*/
|
|
827
|
-
srem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
828
|
-
/**
|
|
829
|
-
* @see https://redis.io/commands/sscan
|
|
830
|
-
*/
|
|
831
|
-
sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
|
|
832
|
-
/**
|
|
833
|
-
* @see https://redis.io/commands/strlen
|
|
834
|
-
*/
|
|
835
|
-
strlen: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
836
|
-
/**
|
|
837
|
-
* @see https://redis.io/commands/sunion
|
|
838
|
-
*/
|
|
839
|
-
sunion: (key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
840
|
-
/**
|
|
841
|
-
* @see https://redis.io/commands/sunionstore
|
|
842
|
-
*/
|
|
843
|
-
sunionstore: (destination: string, key: string, ...keys: string[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
844
|
-
/**
|
|
845
|
-
* @see https://redis.io/commands/time
|
|
846
|
-
*/
|
|
847
|
-
time: () => Pipeline<[...TCommands, Command<any, [number, number]>]>;
|
|
848
|
-
/**
|
|
849
|
-
* @see https://redis.io/commands/touch
|
|
850
|
-
*/
|
|
851
|
-
touch: (...args: CommandArgs<typeof TouchCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
852
|
-
/**
|
|
853
|
-
* @see https://redis.io/commands/ttl
|
|
854
|
-
*/
|
|
855
|
-
ttl: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
856
|
-
/**
|
|
857
|
-
* @see https://redis.io/commands/type
|
|
858
|
-
*/
|
|
859
|
-
type: (key: string) => Pipeline<[...TCommands, Command<any, Type>]>;
|
|
860
|
-
/**
|
|
861
|
-
* @see https://redis.io/commands/unlink
|
|
862
|
-
*/
|
|
863
|
-
unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
864
|
-
/**
|
|
865
|
-
* @see https://redis.io/commands/zadd
|
|
866
|
-
*/
|
|
867
|
-
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
868
|
-
/**
|
|
869
|
-
* @see https://redis.io/commands/zcard
|
|
870
|
-
*/
|
|
871
|
-
zcard: (key: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
872
|
-
/**
|
|
873
|
-
* @see https://redis.io/commands/zcount
|
|
874
|
-
*/
|
|
875
|
-
zcount: (key: string, min: string | number, max: string | number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
876
|
-
/**
|
|
877
|
-
* @see https://redis.io/commands/zincrby
|
|
878
|
-
*/
|
|
879
|
-
zincrby: <TData>(key: string, increment: number, member: TData) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
880
|
-
/**
|
|
881
|
-
* @see https://redis.io/commands/zinterstore
|
|
882
|
-
*/
|
|
883
|
-
zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
884
|
-
/**
|
|
885
|
-
* @see https://redis.io/commands/zlexcount
|
|
886
|
-
*/
|
|
887
|
-
zlexcount: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
888
|
-
/**
|
|
889
|
-
* @see https://redis.io/commands/zmscore
|
|
890
|
-
*/
|
|
891
|
-
zmscore: (key: string, members: unknown[]) => Pipeline<[...TCommands, Command<any, number[] | null>]>;
|
|
892
|
-
/**
|
|
893
|
-
* @see https://redis.io/commands/zpopmax
|
|
894
|
-
*/
|
|
895
|
-
zpopmax: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
|
|
896
|
-
/**
|
|
897
|
-
* @see https://redis.io/commands/zpopmin
|
|
898
|
-
*/
|
|
899
|
-
zpopmin: <TData>(key: string, count?: number | undefined) => Pipeline<[...TCommands, Command<any, TData[]>]>;
|
|
900
|
-
/**
|
|
901
|
-
* @see https://redis.io/commands/zrange
|
|
902
|
-
*/
|
|
903
|
-
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
|
|
904
|
-
key: string,
|
|
905
|
-
min: `(${string}` | `[${string}` | "-" | "+",
|
|
906
|
-
max: `(${string}` | `[${string}` | "-" | "+",
|
|
907
|
-
opts: {
|
|
908
|
-
byLex: true;
|
|
909
|
-
} & ZRangeCommandOptions
|
|
910
|
-
] | [
|
|
911
|
-
key: string,
|
|
912
|
-
min: number | `(${number}` | "-inf" | "+inf",
|
|
913
|
-
max: number | `(${number}` | "-inf" | "+inf",
|
|
914
|
-
opts: {
|
|
915
|
-
byScore: true;
|
|
916
|
-
} & ZRangeCommandOptions
|
|
917
|
-
]) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
918
|
-
/**
|
|
919
|
-
* @see https://redis.io/commands/zrank
|
|
920
|
-
*/
|
|
921
|
-
zrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
922
|
-
/**
|
|
923
|
-
* @see https://redis.io/commands/zrem
|
|
924
|
-
*/
|
|
925
|
-
zrem: <TData>(key: string, ...members: TData[]) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
926
|
-
/**
|
|
927
|
-
* @see https://redis.io/commands/zremrangebylex
|
|
928
|
-
*/
|
|
929
|
-
zremrangebylex: (key: string, min: string, max: string) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
930
|
-
/**
|
|
931
|
-
* @see https://redis.io/commands/zremrangebyrank
|
|
932
|
-
*/
|
|
933
|
-
zremrangebyrank: (key: string, start: number, stop: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
934
|
-
/**
|
|
935
|
-
* @see https://redis.io/commands/zremrangebyscore
|
|
936
|
-
*/
|
|
937
|
-
zremrangebyscore: (key: string, min: number, max: number) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
938
|
-
/**
|
|
939
|
-
* @see https://redis.io/commands/zrevrank
|
|
940
|
-
*/
|
|
941
|
-
zrevrank: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
942
|
-
/**
|
|
943
|
-
* @see https://redis.io/commands/zscan
|
|
944
|
-
*/
|
|
945
|
-
zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, [number, (string | number)[]]>]>;
|
|
946
|
-
/**
|
|
947
|
-
* @see https://redis.io/commands/zscore
|
|
948
|
-
*/
|
|
949
|
-
zscore: <TData>(key: string, member: TData) => Pipeline<[...TCommands, Command<any, number | null>]>;
|
|
950
|
-
/**
|
|
951
|
-
* @see https://redis.io/commands/zunionstore
|
|
952
|
-
*/
|
|
953
|
-
zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
954
|
-
/**
|
|
955
|
-
* @see https://redis.io/commands/zunion
|
|
956
|
-
*/
|
|
957
|
-
zunion: (numKeys: number, keys: string[], opts?: ZUnionCommandOptions | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
958
|
-
/**
|
|
959
|
-
* @see https://redis.io/commands/?group=json
|
|
960
|
-
*/
|
|
961
|
-
get json(): {
|
|
962
|
-
/**
|
|
963
|
-
* @see https://redis.io/commands/json.arrappend
|
|
964
|
-
*/
|
|
965
|
-
arrappend: (key: string, path: string, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
966
|
-
/**
|
|
967
|
-
* @see https://redis.io/commands/json.arrindex
|
|
968
|
-
*/
|
|
969
|
-
arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
970
|
-
/**
|
|
971
|
-
* @see https://redis.io/commands/json.arrinsert
|
|
972
|
-
*/
|
|
973
|
-
arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
974
|
-
/**
|
|
975
|
-
* @see https://redis.io/commands/json.arrlen
|
|
976
|
-
*/
|
|
977
|
-
arrlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
978
|
-
/**
|
|
979
|
-
* @see https://redis.io/commands/json.arrpop
|
|
980
|
-
*/
|
|
981
|
-
arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Pipeline<[...TCommands, Command<any, unknown[]>]>;
|
|
982
|
-
/**
|
|
983
|
-
* @see https://redis.io/commands/json.arrtrim
|
|
984
|
-
*/
|
|
985
|
-
arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
986
|
-
/**
|
|
987
|
-
* @see https://redis.io/commands/json.clear
|
|
988
|
-
*/
|
|
989
|
-
clear: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
990
|
-
/**
|
|
991
|
-
* @see https://redis.io/commands/json.del
|
|
992
|
-
*/
|
|
993
|
-
del: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
994
|
-
/**
|
|
995
|
-
* @see https://redis.io/commands/json.forget
|
|
996
|
-
*/
|
|
997
|
-
forget: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, number>]>;
|
|
998
|
-
/**
|
|
999
|
-
* @see https://redis.io/commands/geoadd
|
|
1000
|
-
*/
|
|
1001
|
-
geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<unknown>, ...args_2: GeoMember<unknown>[]) => Promise<number | null>;
|
|
1002
|
-
/**
|
|
1003
|
-
* @see https://redis.io/commands/geodist
|
|
1004
|
-
*/
|
|
1005
|
-
geodist: (key: string, member1: unknown, member2: unknown, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
|
|
1006
|
-
/**
|
|
1007
|
-
* @see https://redis.io/commands/geopos
|
|
1008
|
-
*/
|
|
1009
|
-
geopos: (args_0: string, ...args_1: unknown[]) => Promise<{
|
|
1010
|
-
lng: number;
|
|
1011
|
-
lat: number;
|
|
1012
|
-
}[]>;
|
|
1013
|
-
/**
|
|
1014
|
-
* @see https://redis.io/commands/geohash
|
|
1015
|
-
*/
|
|
1016
|
-
geohash: (args_0: string, ...args_1: unknown[]) => Promise<(string | null)[]>;
|
|
1017
|
-
/**
|
|
1018
|
-
* @see https://redis.io/commands/geosearch
|
|
1019
|
-
*/
|
|
1020
|
-
geosearch: (key: string, centerPoint: {
|
|
1021
|
-
type: "FROMLONLAT" | "fromlonlat";
|
|
1022
|
-
coordinate: {
|
|
1023
|
-
lon: number;
|
|
1024
|
-
lat: number;
|
|
1025
|
-
};
|
|
1026
|
-
} | {
|
|
1027
|
-
type: "FROMMEMBER" | "frommember";
|
|
1028
|
-
member: unknown;
|
|
1029
|
-
}, shape: {
|
|
1030
|
-
type: "BYRADIUS" | "byradius";
|
|
1031
|
-
radius: number;
|
|
1032
|
-
radiusType: "M" | "KM" | "FT" | "MI";
|
|
1033
|
-
} | {
|
|
1034
|
-
type: "BYBOX" | "bybox";
|
|
1035
|
-
rect: {
|
|
1036
|
-
width: number;
|
|
1037
|
-
height: number;
|
|
1038
|
-
};
|
|
1039
|
-
rectType: "M" | "KM" | "FT" | "MI";
|
|
1040
|
-
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
1041
|
-
count?: {
|
|
1042
|
-
limit: number;
|
|
1043
|
-
any?: boolean | undefined;
|
|
1044
|
-
} | undefined;
|
|
1045
|
-
withCoord?: boolean | undefined;
|
|
1046
|
-
withDist?: boolean | undefined;
|
|
1047
|
-
withHash?: boolean | undefined;
|
|
1048
|
-
} | undefined) => Promise<({
|
|
1049
|
-
member: unknown;
|
|
1050
|
-
} & {
|
|
1051
|
-
coord?: {
|
|
1052
|
-
long: number;
|
|
1053
|
-
lat: number;
|
|
1054
|
-
} | undefined;
|
|
1055
|
-
dist?: number | undefined;
|
|
1056
|
-
hash?: string | undefined;
|
|
1057
|
-
})[]>;
|
|
1058
|
-
/**
|
|
1059
|
-
* @see https://redis.io/commands/geosearchstore
|
|
1060
|
-
*/
|
|
1061
|
-
geosearchstore: (destination: string, key: string, centerPoint: {
|
|
1062
|
-
type: "FROMLONLAT" | "fromlonlat";
|
|
1063
|
-
coordinate: {
|
|
1064
|
-
lon: number;
|
|
1065
|
-
lat: number;
|
|
1066
|
-
};
|
|
1067
|
-
} | {
|
|
1068
|
-
type: "FROMMEMBER" | "frommember";
|
|
1069
|
-
member: unknown;
|
|
1070
|
-
}, shape: {
|
|
1071
|
-
type: "BYRADIUS" | "byradius";
|
|
1072
|
-
radius: number;
|
|
1073
|
-
radiusType: "M" | "KM" | "FT" | "MI";
|
|
1074
|
-
} | {
|
|
1075
|
-
type: "BYBOX" | "bybox";
|
|
1076
|
-
rect: {
|
|
1077
|
-
width: number;
|
|
1078
|
-
height: number;
|
|
1079
|
-
};
|
|
1080
|
-
rectType: "M" | "KM" | "FT" | "MI";
|
|
1081
|
-
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
1082
|
-
count?: {
|
|
1083
|
-
limit: number;
|
|
1084
|
-
any?: boolean | undefined;
|
|
1085
|
-
} | undefined;
|
|
1086
|
-
storeDist?: boolean | undefined;
|
|
1087
|
-
} | undefined) => Promise<number>;
|
|
1088
|
-
/**
|
|
1089
|
-
* @see https://redis.io/commands/json.get
|
|
1090
|
-
*/
|
|
1091
|
-
get: (...args: CommandArgs<typeof JsonGetCommand>) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
1092
|
-
/**
|
|
1093
|
-
* @see https://redis.io/commands/json.mget
|
|
1094
|
-
*/
|
|
1095
|
-
mget: (keys: string[], path: string) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
1096
|
-
/**
|
|
1097
|
-
* @see https://redis.io/commands/json.numincrby
|
|
1098
|
-
*/
|
|
1099
|
-
numincrby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
1100
|
-
/**
|
|
1101
|
-
* @see https://redis.io/commands/json.nummultby
|
|
1102
|
-
*/
|
|
1103
|
-
nummultby: (key: string, path: string, value: number) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
1104
|
-
/**
|
|
1105
|
-
* @see https://redis.io/commands/json.objkeys
|
|
1106
|
-
*/
|
|
1107
|
-
objkeys: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (string[] | null)[]>]>;
|
|
1108
|
-
/**
|
|
1109
|
-
* @see https://redis.io/commands/json.objlen
|
|
1110
|
-
*/
|
|
1111
|
-
objlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
1112
|
-
/**
|
|
1113
|
-
* @see https://redis.io/commands/json.resp
|
|
1114
|
-
*/
|
|
1115
|
-
resp: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, any>]>;
|
|
1116
|
-
/**
|
|
1117
|
-
* @see https://redis.io/commands/json.set
|
|
1118
|
-
*/
|
|
1119
|
-
set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
|
|
1120
|
-
nx: true;
|
|
1121
|
-
xx?: undefined;
|
|
1122
|
-
} | {
|
|
1123
|
-
nx?: undefined;
|
|
1124
|
-
xx: true;
|
|
1125
|
-
} | undefined) => Pipeline<[...TCommands, Command<any, "OK" | null>]>;
|
|
1126
|
-
/**
|
|
1127
|
-
* @see https://redis.io/commands/json.strappend
|
|
1128
|
-
*/
|
|
1129
|
-
strappend: (key: string, path: string, value: string) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
1130
|
-
/**
|
|
1131
|
-
* @see https://redis.io/commands/json.strlen
|
|
1132
|
-
*/
|
|
1133
|
-
strlen: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, (number | null)[]>]>;
|
|
1134
|
-
/**
|
|
1135
|
-
* @see https://redis.io/commands/json.toggle
|
|
1136
|
-
*/
|
|
1137
|
-
toggle: (key: string, path: string) => Pipeline<[...TCommands, Command<any, number[]>]>;
|
|
1138
|
-
/**
|
|
1139
|
-
* @see https://redis.io/commands/json.type
|
|
1140
|
-
*/
|
|
1141
|
-
type: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, string[]>]>;
|
|
1142
|
-
};
|
|
1143
|
-
}
|
|
1144
|
-
|
|
1145
|
-
/**
|
|
1146
|
-
* Creates a new script.
|
|
1147
|
-
*
|
|
1148
|
-
* Scripts offer the ability to optimistically try to execute a script without having to send the
|
|
1149
|
-
* entire script to the server. If the script is loaded on the server, it tries again by sending
|
|
1150
|
-
* the entire script. Afterwards, the script is cached on the server.
|
|
1151
|
-
*
|
|
1152
|
-
* @example
|
|
1153
|
-
* ```ts
|
|
1154
|
-
* const redis = new Redis({...})
|
|
1155
|
-
*
|
|
1156
|
-
* const script = redis.createScript<string>("return ARGV[1];")
|
|
1157
|
-
* const arg1 = await script.eval([], ["Hello World"])
|
|
1158
|
-
* expect(arg1, "Hello World")
|
|
1159
|
-
* ```
|
|
1160
|
-
*/
|
|
1161
|
-
declare class Script<TResult = unknown> {
|
|
1162
|
-
readonly script: string;
|
|
1163
|
-
readonly sha1: string;
|
|
1164
|
-
private readonly redis;
|
|
1165
|
-
constructor(redis: Redis, script: string);
|
|
1166
|
-
/**
|
|
1167
|
-
* Send an `EVAL` command to redis.
|
|
1168
|
-
*/
|
|
1169
|
-
eval(keys: string[], args: string[]): Promise<TResult>;
|
|
1170
|
-
/**
|
|
1171
|
-
* Calculates the sha1 hash of the script and then calls `EVALSHA`.
|
|
1172
|
-
*/
|
|
1173
|
-
evalsha(keys: string[], args: string[]): Promise<TResult>;
|
|
1174
|
-
/**
|
|
1175
|
-
* Optimistically try to run `EVALSHA` first.
|
|
1176
|
-
* If the script is not loaded in redis, it will fall back and try again with `EVAL`.
|
|
1177
|
-
*
|
|
1178
|
-
* Following calls will be able to use the cached script
|
|
1179
|
-
*/
|
|
1180
|
-
exec(keys: string[], args: string[]): Promise<TResult>;
|
|
1181
|
-
/**
|
|
1182
|
-
* Compute the sha1 hash of the script and return its hex representation.
|
|
1183
|
-
*/
|
|
1184
|
-
private digest;
|
|
1185
|
-
}
|
|
1186
|
-
|
|
1187
|
-
/**
|
|
1188
|
-
* Serverless redis client for upstash.
|
|
1189
|
-
*/
|
|
1190
|
-
declare class Redis {
|
|
1191
|
-
protected client: Requester;
|
|
1192
|
-
protected opts?: CommandOptions<any, any>;
|
|
1193
|
-
protected enableTelemetry: boolean;
|
|
1194
|
-
/**
|
|
1195
|
-
* Create a new redis client
|
|
1196
|
-
*
|
|
1197
|
-
* @example
|
|
1198
|
-
* ```typescript
|
|
1199
|
-
* const redis = new Redis({
|
|
1200
|
-
* url: "<UPSTASH_REDIS_REST_URL>",
|
|
1201
|
-
* token: "<UPSTASH_REDIS_REST_TOKEN>",
|
|
1202
|
-
* });
|
|
1203
|
-
* ```
|
|
1204
|
-
*/
|
|
1205
|
-
constructor(client: Requester, opts?: RedisOptions);
|
|
1206
|
-
get json(): {
|
|
1207
|
-
/**
|
|
1208
|
-
* @see https://redis.io/commands/json.arrappend
|
|
1209
|
-
*/
|
|
1210
|
-
arrappend: (key: string, path: string, ...values: unknown[]) => Promise<(number | null)[]>;
|
|
1211
|
-
/**
|
|
1212
|
-
* @see https://redis.io/commands/json.arrindex
|
|
1213
|
-
*/
|
|
1214
|
-
arrindex: (key: string, path: string, value: unknown, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
|
|
1215
|
-
/**
|
|
1216
|
-
* @see https://redis.io/commands/json.arrinsert
|
|
1217
|
-
*/
|
|
1218
|
-
arrinsert: (key: string, path: string, index: number, ...values: unknown[]) => Promise<(number | null)[]>;
|
|
1219
|
-
/**
|
|
1220
|
-
* @see https://redis.io/commands/json.arrlen
|
|
1221
|
-
*/
|
|
1222
|
-
arrlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
|
|
1223
|
-
/**
|
|
1224
|
-
* @see https://redis.io/commands/json.arrpop
|
|
1225
|
-
*/
|
|
1226
|
-
arrpop: (key: string, path?: string | undefined, index?: number | undefined) => Promise<unknown[]>;
|
|
1227
|
-
/**
|
|
1228
|
-
* @see https://redis.io/commands/json.arrtrim
|
|
1229
|
-
*/
|
|
1230
|
-
arrtrim: (key: string, path?: string | undefined, start?: number | undefined, stop?: number | undefined) => Promise<(number | null)[]>;
|
|
1231
|
-
/**
|
|
1232
|
-
* @see https://redis.io/commands/json.clear
|
|
1233
|
-
*/
|
|
1234
|
-
clear: (key: string, path?: string | undefined) => Promise<number>;
|
|
1235
|
-
/**
|
|
1236
|
-
* @see https://redis.io/commands/json.del
|
|
1237
|
-
*/
|
|
1238
|
-
del: (key: string, path?: string | undefined) => Promise<number>;
|
|
1239
|
-
/**
|
|
1240
|
-
* @see https://redis.io/commands/json.forget
|
|
1241
|
-
*/
|
|
1242
|
-
forget: (key: string, path?: string | undefined) => Promise<number>;
|
|
1243
|
-
/**
|
|
1244
|
-
* @see https://redis.io/commands/geoadd
|
|
1245
|
-
*/
|
|
1246
|
-
geoadd: (args_0: string, args_1: GeoAddCommandOptions | GeoMember<unknown>, ...args_2: GeoMember<unknown>[]) => Promise<number | null>;
|
|
1247
|
-
/**
|
|
1248
|
-
* @see https://redis.io/commands/geopos
|
|
1249
|
-
*/
|
|
1250
|
-
geopos: (args_0: string, ...args_1: unknown[]) => Promise<{
|
|
1251
|
-
lng: number;
|
|
1252
|
-
lat: number;
|
|
1253
|
-
}[]>;
|
|
1254
|
-
/**
|
|
1255
|
-
* @see https://redis.io/commands/geodist
|
|
1256
|
-
*/
|
|
1257
|
-
geodist: (key: string, member1: unknown, member2: unknown, unit?: "M" | "KM" | "FT" | "MI" | undefined) => Promise<number | null>;
|
|
1258
|
-
/**
|
|
1259
|
-
* @see https://redis.io/commands/geohash
|
|
1260
|
-
*/
|
|
1261
|
-
geohash: (args_0: string, ...args_1: unknown[]) => Promise<(string | null)[]>;
|
|
1262
|
-
/**
|
|
1263
|
-
* @see https://redis.io/commands/geosearch
|
|
1264
|
-
*/
|
|
1265
|
-
geosearch: (key: string, centerPoint: {
|
|
1266
|
-
type: "FROMLONLAT" | "fromlonlat";
|
|
1267
|
-
coordinate: {
|
|
1268
|
-
lon: number;
|
|
1269
|
-
lat: number;
|
|
1270
|
-
};
|
|
1271
|
-
} | {
|
|
1272
|
-
type: "FROMMEMBER" | "frommember";
|
|
1273
|
-
member: unknown;
|
|
1274
|
-
}, shape: {
|
|
1275
|
-
type: "BYRADIUS" | "byradius";
|
|
1276
|
-
radius: number;
|
|
1277
|
-
radiusType: "M" | "KM" | "FT" | "MI";
|
|
1278
|
-
} | {
|
|
1279
|
-
type: "BYBOX" | "bybox";
|
|
1280
|
-
rect: {
|
|
1281
|
-
width: number;
|
|
1282
|
-
height: number;
|
|
1283
|
-
};
|
|
1284
|
-
rectType: "M" | "KM" | "FT" | "MI";
|
|
1285
|
-
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
1286
|
-
count?: {
|
|
1287
|
-
limit: number;
|
|
1288
|
-
any?: boolean | undefined;
|
|
1289
|
-
} | undefined;
|
|
1290
|
-
withCoord?: boolean | undefined;
|
|
1291
|
-
withDist?: boolean | undefined;
|
|
1292
|
-
withHash?: boolean | undefined;
|
|
1293
|
-
} | undefined) => Promise<({
|
|
1294
|
-
member: unknown;
|
|
1295
|
-
} & {
|
|
1296
|
-
coord?: {
|
|
1297
|
-
long: number;
|
|
1298
|
-
lat: number;
|
|
1299
|
-
} | undefined;
|
|
1300
|
-
dist?: number | undefined;
|
|
1301
|
-
hash?: string | undefined;
|
|
1302
|
-
})[]>;
|
|
1303
|
-
/**
|
|
1304
|
-
* @see https://redis.io/commands/geosearchstore
|
|
1305
|
-
*/
|
|
1306
|
-
geosearchstore: (destination: string, key: string, centerPoint: {
|
|
1307
|
-
type: "FROMLONLAT" | "fromlonlat";
|
|
1308
|
-
coordinate: {
|
|
1309
|
-
lon: number;
|
|
1310
|
-
lat: number;
|
|
1311
|
-
};
|
|
1312
|
-
} | {
|
|
1313
|
-
type: "FROMMEMBER" | "frommember";
|
|
1314
|
-
member: unknown;
|
|
1315
|
-
}, shape: {
|
|
1316
|
-
type: "BYRADIUS" | "byradius";
|
|
1317
|
-
radius: number;
|
|
1318
|
-
radiusType: "M" | "KM" | "FT" | "MI";
|
|
1319
|
-
} | {
|
|
1320
|
-
type: "BYBOX" | "bybox";
|
|
1321
|
-
rect: {
|
|
1322
|
-
width: number;
|
|
1323
|
-
height: number;
|
|
1324
|
-
};
|
|
1325
|
-
rectType: "M" | "KM" | "FT" | "MI";
|
|
1326
|
-
}, order: "ASC" | "DESC" | "asc" | "desc", opts?: {
|
|
1327
|
-
count?: {
|
|
1328
|
-
limit: number;
|
|
1329
|
-
any?: boolean | undefined;
|
|
1330
|
-
} | undefined;
|
|
1331
|
-
storeDist?: boolean | undefined;
|
|
1332
|
-
} | undefined) => Promise<number>;
|
|
1333
|
-
/**
|
|
1334
|
-
* @see https://redis.io/commands/json.get
|
|
1335
|
-
*/
|
|
1336
|
-
get: (...args: CommandArgs<typeof JsonGetCommand>) => Promise<any>;
|
|
1337
|
-
/**
|
|
1338
|
-
* @see https://redis.io/commands/json.mget
|
|
1339
|
-
*/
|
|
1340
|
-
mget: (keys: string[], path: string) => Promise<any>;
|
|
1341
|
-
/**
|
|
1342
|
-
* @see https://redis.io/commands/json.numincrby
|
|
1343
|
-
*/
|
|
1344
|
-
numincrby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
|
|
1345
|
-
/**
|
|
1346
|
-
* @see https://redis.io/commands/json.nummultby
|
|
1347
|
-
*/
|
|
1348
|
-
nummultby: (key: string, path: string, value: number) => Promise<(number | null)[]>;
|
|
1349
|
-
/**
|
|
1350
|
-
* @see https://redis.io/commands/json.objkeys
|
|
1351
|
-
*/
|
|
1352
|
-
objkeys: (key: string, path?: string | undefined) => Promise<(string[] | null)[]>;
|
|
1353
|
-
/**
|
|
1354
|
-
* @see https://redis.io/commands/json.objlen
|
|
1355
|
-
*/
|
|
1356
|
-
objlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
|
|
1357
|
-
/**
|
|
1358
|
-
* @see https://redis.io/commands/json.resp
|
|
1359
|
-
*/
|
|
1360
|
-
resp: (key: string, path?: string | undefined) => Promise<any>;
|
|
1361
|
-
/**
|
|
1362
|
-
* @see https://redis.io/commands/json.set
|
|
1363
|
-
*/
|
|
1364
|
-
set: (key: string, path: string, value: string | number | boolean | Record<string, unknown> | (string | number | boolean | Record<string, unknown>)[], opts?: {
|
|
1365
|
-
nx: true;
|
|
1366
|
-
xx?: undefined;
|
|
1367
|
-
} | {
|
|
1368
|
-
nx?: undefined;
|
|
1369
|
-
xx: true;
|
|
1370
|
-
} | undefined) => Promise<"OK" | null>;
|
|
1371
|
-
/**
|
|
1372
|
-
* @see https://redis.io/commands/json.strappend
|
|
1373
|
-
*/
|
|
1374
|
-
strappend: (key: string, path: string, value: string) => Promise<(number | null)[]>;
|
|
1375
|
-
/**
|
|
1376
|
-
* @see https://redis.io/commands/json.strlen
|
|
1377
|
-
*/
|
|
1378
|
-
strlen: (key: string, path?: string | undefined) => Promise<(number | null)[]>;
|
|
1379
|
-
/**
|
|
1380
|
-
* @see https://redis.io/commands/json.toggle
|
|
1381
|
-
*/
|
|
1382
|
-
toggle: (key: string, path: string) => Promise<number[]>;
|
|
1383
|
-
/**
|
|
1384
|
-
* @see https://redis.io/commands/json.type
|
|
1385
|
-
*/
|
|
1386
|
-
type: (key: string, path?: string | undefined) => Promise<string[]>;
|
|
1387
|
-
};
|
|
1388
|
-
/**
|
|
1389
|
-
* Wrap a new middleware around the HTTP client.
|
|
1390
|
-
*/
|
|
1391
|
-
use: <TResult = unknown>(middleware: (r: UpstashRequest, next: <TResult_1 = unknown>(req: UpstashRequest) => Promise<UpstashResponse<TResult_1>>) => Promise<UpstashResponse<TResult>>) => void;
|
|
1392
|
-
/**
|
|
1393
|
-
* Technically this is not private, we can hide it from intellisense by doing this
|
|
1394
|
-
*/
|
|
1395
|
-
protected addTelemetry: (telemetry: Telemetry) => void;
|
|
1396
|
-
createScript(script: string): Script;
|
|
1397
|
-
/**
|
|
1398
|
-
* Create a new pipeline that allows you to send requests in bulk.
|
|
1399
|
-
*
|
|
1400
|
-
* @see {@link Pipeline}
|
|
1401
|
-
*/
|
|
1402
|
-
pipeline: () => Pipeline<[]>;
|
|
1403
|
-
/**
|
|
1404
|
-
* Create a new transaction to allow executing multiple steps atomically.
|
|
1405
|
-
*
|
|
1406
|
-
* All the commands in a transaction are serialized and executed sequentially. A request sent by
|
|
1407
|
-
* another client will never be served in the middle of the execution of a Redis Transaction. This
|
|
1408
|
-
* guarantees that the commands are executed as a single isolated operation.
|
|
1409
|
-
*
|
|
1410
|
-
* @see {@link Pipeline}
|
|
1411
|
-
*/
|
|
1412
|
-
multi: () => Pipeline<[]>;
|
|
1413
|
-
/**
|
|
1414
|
-
* @see https://redis.io/commands/append
|
|
1415
|
-
*/
|
|
1416
|
-
append: (key: string, value: string) => Promise<number>;
|
|
1417
|
-
/**
|
|
1418
|
-
* @see https://redis.io/commands/bitcount
|
|
1419
|
-
*/
|
|
1420
|
-
bitcount: (key: string, start: number, end: number) => Promise<number>;
|
|
1421
|
-
/**
|
|
1422
|
-
* @see https://redis.io/commands/bitop
|
|
1423
|
-
*/
|
|
1424
|
-
bitop: {
|
|
1425
|
-
(op: "and" | "or" | "xor", destinationKey: string, sourceKey: string, ...sourceKeys: string[]): Promise<number>;
|
|
1426
|
-
(op: "not", destinationKey: string, sourceKey: string): Promise<number>;
|
|
1427
|
-
};
|
|
1428
|
-
/**
|
|
1429
|
-
* @see https://redis.io/commands/bitpos
|
|
1430
|
-
*/
|
|
1431
|
-
bitpos: (key: string, bit: 0 | 1, start?: number | undefined, end?: number | undefined) => Promise<number>;
|
|
1432
|
-
/**
|
|
1433
|
-
* @see https://redis.io/commands/dbsize
|
|
1434
|
-
*/
|
|
1435
|
-
dbsize: () => Promise<number>;
|
|
1436
|
-
/**
|
|
1437
|
-
* @see https://redis.io/commands/decr
|
|
1438
|
-
*/
|
|
1439
|
-
decr: (key: string) => Promise<number>;
|
|
1440
|
-
/**
|
|
1441
|
-
* @see https://redis.io/commands/decrby
|
|
1442
|
-
*/
|
|
1443
|
-
decrby: (key: string, decrement: number) => Promise<number>;
|
|
1444
|
-
/**
|
|
1445
|
-
* @see https://redis.io/commands/del
|
|
1446
|
-
*/
|
|
1447
|
-
del: (...args: CommandArgs<typeof DelCommand>) => Promise<number>;
|
|
1448
|
-
/**
|
|
1449
|
-
* @see https://redis.io/commands/echo
|
|
1450
|
-
*/
|
|
1451
|
-
echo: (message: string) => Promise<string>;
|
|
1452
|
-
/**
|
|
1453
|
-
* @see https://redis.io/commands/eval
|
|
1454
|
-
*/
|
|
1455
|
-
eval: <TArgs extends unknown[], TData = unknown>(script: string, keys: string[], args: TArgs) => Promise<TData>;
|
|
1456
|
-
/**
|
|
1457
|
-
* @see https://redis.io/commands/evalsha
|
|
1458
|
-
*/
|
|
1459
|
-
evalsha: <TArgs extends unknown[], TData = unknown>(sha1: string, keys: string[], args: TArgs) => Promise<TData>;
|
|
1460
|
-
/**
|
|
1461
|
-
* @see https://redis.io/commands/exists
|
|
1462
|
-
*/
|
|
1463
|
-
exists: (...args: CommandArgs<typeof ExistsCommand>) => Promise<number>;
|
|
1464
|
-
/**
|
|
1465
|
-
* @see https://redis.io/commands/expire
|
|
1466
|
-
*/
|
|
1467
|
-
expire: (key: string, seconds: number) => Promise<0 | 1>;
|
|
1468
|
-
/**
|
|
1469
|
-
* @see https://redis.io/commands/expireat
|
|
1470
|
-
*/
|
|
1471
|
-
expireat: (key: string, unix: number) => Promise<0 | 1>;
|
|
1472
|
-
/**
|
|
1473
|
-
* @see https://redis.io/commands/flushall
|
|
1474
|
-
*/
|
|
1475
|
-
flushall: (args?: CommandArgs<typeof FlushAllCommand>) => Promise<"OK">;
|
|
1476
|
-
/**
|
|
1477
|
-
* @see https://redis.io/commands/flushdb
|
|
1478
|
-
*/
|
|
1479
|
-
flushdb: (opts?: {
|
|
1480
|
-
async?: boolean | undefined;
|
|
1481
|
-
} | undefined) => Promise<"OK">;
|
|
1482
|
-
/**
|
|
1483
|
-
* @see https://redis.io/commands/get
|
|
1484
|
-
*/
|
|
1485
|
-
get: <TData>(key: string) => Promise<TData | null>;
|
|
1486
|
-
/**
|
|
1487
|
-
* @see https://redis.io/commands/getbit
|
|
1488
|
-
*/
|
|
1489
|
-
getbit: (key: string, offset: number) => Promise<0 | 1>;
|
|
1490
|
-
/**
|
|
1491
|
-
* @see https://redis.io/commands/getdel
|
|
1492
|
-
*/
|
|
1493
|
-
getdel: <TData>(key: string) => Promise<TData | null>;
|
|
1494
|
-
/**
|
|
1495
|
-
* @see https://redis.io/commands/getrange
|
|
1496
|
-
*/
|
|
1497
|
-
getrange: (key: string, start: number, end: number) => Promise<string>;
|
|
1498
|
-
/**
|
|
1499
|
-
* @see https://redis.io/commands/getset
|
|
1500
|
-
*/
|
|
1501
|
-
getset: <TData>(key: string, value: TData) => Promise<TData | null>;
|
|
1502
|
-
/**
|
|
1503
|
-
* @see https://redis.io/commands/hdel
|
|
1504
|
-
*/
|
|
1505
|
-
hdel: (key: string, ...fields: string[]) => Promise<0 | 1>;
|
|
1506
|
-
/**
|
|
1507
|
-
* @see https://redis.io/commands/hexists
|
|
1508
|
-
*/
|
|
1509
|
-
hexists: (key: string, field: string) => Promise<number>;
|
|
1510
|
-
/**
|
|
1511
|
-
* @see https://redis.io/commands/hget
|
|
1512
|
-
*/
|
|
1513
|
-
hget: <TData>(key: string, field: string) => Promise<TData | null>;
|
|
1514
|
-
/**
|
|
1515
|
-
* @see https://redis.io/commands/hgetall
|
|
1516
|
-
*/
|
|
1517
|
-
hgetall: <TData extends Record<string, unknown>>(key: string) => Promise<TData | null>;
|
|
1518
|
-
/**
|
|
1519
|
-
* @see https://redis.io/commands/hincrby
|
|
1520
|
-
*/
|
|
1521
|
-
hincrby: (key: string, field: string, increment: number) => Promise<number>;
|
|
1522
|
-
/**
|
|
1523
|
-
* @see https://redis.io/commands/hincrbyfloat
|
|
1524
|
-
*/
|
|
1525
|
-
hincrbyfloat: (key: string, field: string, increment: number) => Promise<number>;
|
|
1526
|
-
/**
|
|
1527
|
-
* @see https://redis.io/commands/hkeys
|
|
1528
|
-
*/
|
|
1529
|
-
hkeys: (key: string) => Promise<string[]>;
|
|
1530
|
-
/**
|
|
1531
|
-
* @see https://redis.io/commands/hlen
|
|
1532
|
-
*/
|
|
1533
|
-
hlen: (key: string) => Promise<number>;
|
|
1534
|
-
/**
|
|
1535
|
-
* @see https://redis.io/commands/hmget
|
|
1536
|
-
*/
|
|
1537
|
-
hmget: <TData extends Record<string, unknown>>(key: string, ...fields: string[]) => Promise<TData | null>;
|
|
1538
|
-
/**
|
|
1539
|
-
* @see https://redis.io/commands/hmset
|
|
1540
|
-
*/
|
|
1541
|
-
hmset: <TData>(key: string, kv: {
|
|
1542
|
-
[field: string]: TData;
|
|
1543
|
-
}) => Promise<"OK">;
|
|
1544
|
-
/**
|
|
1545
|
-
* @see https://redis.io/commands/hrandfield
|
|
1546
|
-
*/
|
|
1547
|
-
hrandfield: {
|
|
1548
|
-
(key: string): Promise<string>;
|
|
1549
|
-
(key: string, count: number): Promise<string[]>;
|
|
1550
|
-
<TData extends Record<string, unknown>>(key: string, count: number, withValues: boolean): Promise<Partial<TData>>;
|
|
1551
|
-
};
|
|
1552
|
-
/**
|
|
1553
|
-
* @see https://redis.io/commands/hscan
|
|
1554
|
-
*/
|
|
1555
|
-
hscan: (key: string, cursor: number, cmdOpts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
|
|
1556
|
-
/**
|
|
1557
|
-
* @see https://redis.io/commands/hset
|
|
1558
|
-
*/
|
|
1559
|
-
hset: <TData>(key: string, kv: {
|
|
1560
|
-
[field: string]: TData;
|
|
1561
|
-
}) => Promise<number>;
|
|
1562
|
-
/**
|
|
1563
|
-
* @see https://redis.io/commands/hsetnx
|
|
1564
|
-
*/
|
|
1565
|
-
hsetnx: <TData>(key: string, field: string, value: TData) => Promise<0 | 1>;
|
|
1566
|
-
/**
|
|
1567
|
-
* @see https://redis.io/commands/hstrlen
|
|
1568
|
-
*/
|
|
1569
|
-
hstrlen: (key: string, field: string) => Promise<number>;
|
|
1570
|
-
/**
|
|
1571
|
-
* @see https://redis.io/commands/hvals
|
|
1572
|
-
*/
|
|
1573
|
-
hvals: (key: string) => Promise<any>;
|
|
1574
|
-
/**
|
|
1575
|
-
* @see https://redis.io/commands/incr
|
|
1576
|
-
*/
|
|
1577
|
-
incr: (key: string) => Promise<number>;
|
|
1578
|
-
/**
|
|
1579
|
-
* @see https://redis.io/commands/incrby
|
|
1580
|
-
*/
|
|
1581
|
-
incrby: (key: string, value: number) => Promise<number>;
|
|
1582
|
-
/**
|
|
1583
|
-
* @see https://redis.io/commands/incrbyfloat
|
|
1584
|
-
*/
|
|
1585
|
-
incrbyfloat: (key: string, value: number) => Promise<number>;
|
|
1586
|
-
/**
|
|
1587
|
-
* @see https://redis.io/commands/keys
|
|
1588
|
-
*/
|
|
1589
|
-
keys: (pattern: string) => Promise<string[]>;
|
|
1590
|
-
/**
|
|
1591
|
-
* @see https://redis.io/commands/lindex
|
|
1592
|
-
*/
|
|
1593
|
-
lindex: (key: string, index: number) => Promise<any>;
|
|
1594
|
-
/**
|
|
1595
|
-
* @see https://redis.io/commands/linsert
|
|
1596
|
-
*/
|
|
1597
|
-
linsert: <TData>(key: string, direction: "before" | "after", pivot: TData, value: TData) => Promise<number>;
|
|
1598
|
-
/**
|
|
1599
|
-
* @see https://redis.io/commands/llen
|
|
1600
|
-
*/
|
|
1601
|
-
llen: (key: string) => Promise<number>;
|
|
1602
|
-
/**
|
|
1603
|
-
* @see https://redis.io/commands/lmove
|
|
1604
|
-
*/
|
|
1605
|
-
lmove: <TData = string>(source: string, destination: string, whereFrom: "left" | "right", whereTo: "left" | "right") => Promise<TData>;
|
|
1606
|
-
/**
|
|
1607
|
-
* @see https://redis.io/commands/lpop
|
|
1608
|
-
*/
|
|
1609
|
-
lpop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
|
|
1610
|
-
/**
|
|
1611
|
-
* @see https://redis.io/commands/lpos
|
|
1612
|
-
*/
|
|
1613
|
-
lpos: <TData = number>(key: string, element: unknown, opts?: {
|
|
1614
|
-
rank?: number | undefined;
|
|
1615
|
-
count?: number | undefined;
|
|
1616
|
-
maxLen?: number | undefined;
|
|
1617
|
-
} | undefined) => Promise<TData>;
|
|
1618
|
-
/**
|
|
1619
|
-
* @see https://redis.io/commands/lpush
|
|
1620
|
-
*/
|
|
1621
|
-
lpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
|
|
1622
|
-
/**
|
|
1623
|
-
* @see https://redis.io/commands/lpushx
|
|
1624
|
-
*/
|
|
1625
|
-
lpushx: <TData>(key: string, ...elements: TData[]) => Promise<number>;
|
|
1626
|
-
/**
|
|
1627
|
-
* @see https://redis.io/commands/lrange
|
|
1628
|
-
*/
|
|
1629
|
-
lrange: <TResult = string>(key: string, start: number, end: number) => Promise<TResult[]>;
|
|
1630
|
-
/**
|
|
1631
|
-
* @see https://redis.io/commands/lrem
|
|
1632
|
-
*/
|
|
1633
|
-
lrem: <TData>(key: string, count: number, value: TData) => Promise<number>;
|
|
1634
|
-
/**
|
|
1635
|
-
* @see https://redis.io/commands/lset
|
|
1636
|
-
*/
|
|
1637
|
-
lset: <TData>(key: string, index: number, value: TData) => Promise<"OK">;
|
|
1638
|
-
/**
|
|
1639
|
-
* @see https://redis.io/commands/ltrim
|
|
1640
|
-
*/
|
|
1641
|
-
ltrim: (key: string, start: number, end: number) => Promise<"OK">;
|
|
1642
|
-
/**
|
|
1643
|
-
* @see https://redis.io/commands/mget
|
|
1644
|
-
*/
|
|
1645
|
-
mget: <TData extends unknown[]>(...args: CommandArgs<typeof MGetCommand>) => Promise<TData>;
|
|
1646
|
-
/**
|
|
1647
|
-
* @see https://redis.io/commands/mset
|
|
1648
|
-
*/
|
|
1649
|
-
mset: <TData>(kv: {
|
|
1650
|
-
[key: string]: TData;
|
|
1651
|
-
}) => Promise<"OK">;
|
|
1652
|
-
/**
|
|
1653
|
-
* @see https://redis.io/commands/msetnx
|
|
1654
|
-
*/
|
|
1655
|
-
msetnx: <TData>(kv: {
|
|
1656
|
-
[key: string]: TData;
|
|
1657
|
-
}) => Promise<number>;
|
|
1658
|
-
/**
|
|
1659
|
-
* @see https://redis.io/commands/persist
|
|
1660
|
-
*/
|
|
1661
|
-
persist: (key: string) => Promise<0 | 1>;
|
|
1662
|
-
/**
|
|
1663
|
-
* @see https://redis.io/commands/pexpire
|
|
1664
|
-
*/
|
|
1665
|
-
pexpire: (key: string, milliseconds: number) => Promise<0 | 1>;
|
|
1666
|
-
/**
|
|
1667
|
-
* @see https://redis.io/commands/pexpireat
|
|
1668
|
-
*/
|
|
1669
|
-
pexpireat: (key: string, unix: number) => Promise<0 | 1>;
|
|
1670
|
-
/**
|
|
1671
|
-
* @see https://redis.io/commands/ping
|
|
1672
|
-
*/
|
|
1673
|
-
ping: (args?: CommandArgs<typeof PingCommand>) => Promise<string>;
|
|
1674
|
-
/**
|
|
1675
|
-
* @see https://redis.io/commands/psetex
|
|
1676
|
-
*/
|
|
1677
|
-
psetex: <TData>(key: string, ttl: number, value: TData) => Promise<string>;
|
|
1678
|
-
/**
|
|
1679
|
-
* @see https://redis.io/commands/pttl
|
|
1680
|
-
*/
|
|
1681
|
-
pttl: (key: string) => Promise<number>;
|
|
1682
|
-
/**
|
|
1683
|
-
* @see https://redis.io/commands/publish
|
|
1684
|
-
*/
|
|
1685
|
-
publish: (channel: string, message: unknown) => Promise<number>;
|
|
1686
|
-
/**
|
|
1687
|
-
* @see https://redis.io/commands/randomkey
|
|
1688
|
-
*/
|
|
1689
|
-
randomkey: () => Promise<string | null>;
|
|
1690
|
-
/**
|
|
1691
|
-
* @see https://redis.io/commands/rename
|
|
1692
|
-
*/
|
|
1693
|
-
rename: (source: string, destination: string) => Promise<"OK">;
|
|
1694
|
-
/**
|
|
1695
|
-
* @see https://redis.io/commands/renamenx
|
|
1696
|
-
*/
|
|
1697
|
-
renamenx: (source: string, destination: string) => Promise<0 | 1>;
|
|
1698
|
-
/**
|
|
1699
|
-
* @see https://redis.io/commands/rpop
|
|
1700
|
-
*/
|
|
1701
|
-
rpop: <TData = string>(key: string, count?: number | undefined) => Promise<TData | null>;
|
|
1702
|
-
/**
|
|
1703
|
-
* @see https://redis.io/commands/rpush
|
|
1704
|
-
*/
|
|
1705
|
-
rpush: <TData>(key: string, ...elements: TData[]) => Promise<number>;
|
|
1706
|
-
/**
|
|
1707
|
-
* @see https://redis.io/commands/rpushx
|
|
1708
|
-
*/
|
|
1709
|
-
rpushx: <TData>(key: string, ...elements: TData[]) => Promise<number>;
|
|
1710
|
-
/**
|
|
1711
|
-
* @see https://redis.io/commands/sadd
|
|
1712
|
-
*/
|
|
1713
|
-
sadd: <TData>(key: string, ...members: TData[]) => Promise<number>;
|
|
1714
|
-
/**
|
|
1715
|
-
* @see https://redis.io/commands/scan
|
|
1716
|
-
*/
|
|
1717
|
-
scan: (cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, string[]]>;
|
|
1718
|
-
/**
|
|
1719
|
-
* @see https://redis.io/commands/scard
|
|
1720
|
-
*/
|
|
1721
|
-
scard: (key: string) => Promise<number>;
|
|
1722
|
-
/**
|
|
1723
|
-
* @see https://redis.io/commands/script-exists
|
|
1724
|
-
*/
|
|
1725
|
-
scriptExists: (...args: CommandArgs<typeof ScriptExistsCommand>) => Promise<number[]>;
|
|
1726
|
-
/**
|
|
1727
|
-
* @see https://redis.io/commands/script-flush
|
|
1728
|
-
*/
|
|
1729
|
-
scriptFlush: (opts?: ScriptFlushCommandOptions | undefined) => Promise<"OK">;
|
|
1730
|
-
/**
|
|
1731
|
-
* @see https://redis.io/commands/script-load
|
|
1732
|
-
*/
|
|
1733
|
-
scriptLoad: (script: string) => Promise<string>;
|
|
1734
|
-
/**
|
|
1735
|
-
* @see https://redis.io/commands/sdiff
|
|
1736
|
-
*/
|
|
1737
|
-
sdiff: (key: string, ...keys: string[]) => Promise<unknown[]>;
|
|
1738
|
-
/**
|
|
1739
|
-
* @see https://redis.io/commands/sdiffstore
|
|
1740
|
-
*/
|
|
1741
|
-
sdiffstore: (destination: string, ...keys: string[]) => Promise<number>;
|
|
1742
|
-
/**
|
|
1743
|
-
* @see https://redis.io/commands/set
|
|
1744
|
-
*/
|
|
1745
|
-
set: <TData>(key: string, value: TData, opts?: SetCommandOptions) => Promise<"OK" | TData | null>;
|
|
1746
|
-
/**
|
|
1747
|
-
* @see https://redis.io/commands/setbit
|
|
1748
|
-
*/
|
|
1749
|
-
setbit: (key: string, offset: number, value: 0 | 1) => Promise<0 | 1>;
|
|
1750
|
-
/**
|
|
1751
|
-
* @see https://redis.io/commands/setex
|
|
1752
|
-
*/
|
|
1753
|
-
setex: <TData>(key: string, ttl: number, value: TData) => Promise<"OK">;
|
|
1754
|
-
/**
|
|
1755
|
-
* @see https://redis.io/commands/setnx
|
|
1756
|
-
*/
|
|
1757
|
-
setnx: <TData>(key: string, value: TData) => Promise<number>;
|
|
1758
|
-
/**
|
|
1759
|
-
* @see https://redis.io/commands/setrange
|
|
1760
|
-
*/
|
|
1761
|
-
setrange: (key: string, offset: number, value: string) => Promise<number>;
|
|
1762
|
-
/**
|
|
1763
|
-
* @see https://redis.io/commands/sinter
|
|
1764
|
-
*/
|
|
1765
|
-
sinter: (key: string, ...keys: string[]) => Promise<string[]>;
|
|
1766
|
-
/**
|
|
1767
|
-
* @see https://redis.io/commands/sinterstore
|
|
1768
|
-
*/
|
|
1769
|
-
sinterstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
|
|
1770
|
-
/**
|
|
1771
|
-
* @see https://redis.io/commands/sismember
|
|
1772
|
-
*/
|
|
1773
|
-
sismember: <TData>(key: string, member: TData) => Promise<0 | 1>;
|
|
1774
|
-
/**
|
|
1775
|
-
* @see https://redis.io/commands/smismember
|
|
1776
|
-
*/
|
|
1777
|
-
smismember: <TMembers extends unknown[]>(key: string, members: TMembers) => Promise<(0 | 1)[]>;
|
|
1778
|
-
/**
|
|
1779
|
-
* @see https://redis.io/commands/smembers
|
|
1780
|
-
*/
|
|
1781
|
-
smembers: <TData extends unknown[] = string[]>(key: string) => Promise<TData>;
|
|
1782
|
-
/**
|
|
1783
|
-
* @see https://redis.io/commands/smove
|
|
1784
|
-
*/
|
|
1785
|
-
smove: <TData>(source: string, destination: string, member: TData) => Promise<0 | 1>;
|
|
1786
|
-
/**
|
|
1787
|
-
* @see https://redis.io/commands/spop
|
|
1788
|
-
*/
|
|
1789
|
-
spop: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
|
|
1790
|
-
/**
|
|
1791
|
-
* @see https://redis.io/commands/srandmember
|
|
1792
|
-
*/
|
|
1793
|
-
srandmember: <TData>(key: string, count?: number | undefined) => Promise<TData | null>;
|
|
1794
|
-
/**
|
|
1795
|
-
* @see https://redis.io/commands/srem
|
|
1796
|
-
*/
|
|
1797
|
-
srem: <TData>(key: string, ...members: TData[]) => Promise<number>;
|
|
1798
|
-
/**
|
|
1799
|
-
* @see https://redis.io/commands/sscan
|
|
1800
|
-
*/
|
|
1801
|
-
sscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
|
|
1802
|
-
/**
|
|
1803
|
-
* @see https://redis.io/commands/strlen
|
|
1804
|
-
*/
|
|
1805
|
-
strlen: (key: string) => Promise<number>;
|
|
1806
|
-
/**
|
|
1807
|
-
* @see https://redis.io/commands/sunion
|
|
1808
|
-
*/
|
|
1809
|
-
sunion: (key: string, ...keys: string[]) => Promise<unknown[]>;
|
|
1810
|
-
/**
|
|
1811
|
-
* @see https://redis.io/commands/sunionstore
|
|
1812
|
-
*/
|
|
1813
|
-
sunionstore: (destination: string, key: string, ...keys: string[]) => Promise<number>;
|
|
1814
|
-
/**
|
|
1815
|
-
* @see https://redis.io/commands/time
|
|
1816
|
-
*/
|
|
1817
|
-
time: () => Promise<[number, number]>;
|
|
1818
|
-
/**
|
|
1819
|
-
* @see https://redis.io/commands/touch
|
|
1820
|
-
*/
|
|
1821
|
-
touch: (...args: CommandArgs<typeof TouchCommand>) => Promise<number>;
|
|
1822
|
-
/**
|
|
1823
|
-
* @see https://redis.io/commands/ttl
|
|
1824
|
-
*/
|
|
1825
|
-
ttl: (key: string) => Promise<number>;
|
|
1826
|
-
/**
|
|
1827
|
-
* @see https://redis.io/commands/type
|
|
1828
|
-
*/
|
|
1829
|
-
type: (key: string) => Promise<Type>;
|
|
1830
|
-
/**
|
|
1831
|
-
* @see https://redis.io/commands/unlink
|
|
1832
|
-
*/
|
|
1833
|
-
unlink: (...args: CommandArgs<typeof UnlinkCommand>) => Promise<number>;
|
|
1834
|
-
/**
|
|
1835
|
-
* @see https://redis.io/commands/xadd
|
|
1836
|
-
*/
|
|
1837
|
-
xadd: (key: string, id: string, entries: {
|
|
1838
|
-
[field: string]: unknown;
|
|
1839
|
-
}, opts?: {
|
|
1840
|
-
nomkStream?: boolean | undefined;
|
|
1841
|
-
trim?: (({
|
|
1842
|
-
type: "MAXLEN" | "maxlen";
|
|
1843
|
-
threshold: number;
|
|
1844
|
-
} | {
|
|
1845
|
-
type: "MINID" | "minid";
|
|
1846
|
-
threshold: string;
|
|
1847
|
-
}) & ({
|
|
1848
|
-
comparison: "~";
|
|
1849
|
-
limit?: number | undefined;
|
|
1850
|
-
} | {
|
|
1851
|
-
comparison: "=";
|
|
1852
|
-
limit?: undefined;
|
|
1853
|
-
})) | undefined;
|
|
1854
|
-
} | undefined) => Promise<string>;
|
|
1855
|
-
/**
|
|
1856
|
-
* @see https://redis.io/commands/xrange
|
|
1857
|
-
*/
|
|
1858
|
-
xrange: (key: string, start: string, end: string, count?: number | undefined) => Promise<Record<string, Record<string, unknown>>>;
|
|
1859
|
-
/**
|
|
1860
|
-
* @see https://redis.io/commands/zadd
|
|
1861
|
-
*/
|
|
1862
|
-
zadd: <TData>(...args: [key: string, scoreMember: ScoreMember<TData>, ...scoreMemberPairs: ScoreMember<TData>[]] | [key: string, opts: ZAddCommandOptions | ZAddCommandOptionsWithIncr, ScoreMember<TData>, ...ScoreMember<TData>[]]) => Promise<number | null>;
|
|
1863
|
-
/**
|
|
1864
|
-
* @see https://redis.io/commands/zcard
|
|
1865
|
-
*/
|
|
1866
|
-
zcard: (key: string) => Promise<number>;
|
|
1867
|
-
/**
|
|
1868
|
-
* @see https://redis.io/commands/zcount
|
|
1869
|
-
*/
|
|
1870
|
-
zcount: (key: string, min: string | number, max: string | number) => Promise<number>;
|
|
1871
|
-
/**
|
|
1872
|
-
* @see https://redis.io/commands/zdiffstore
|
|
1873
|
-
*/
|
|
1874
|
-
zdiffstore: (destination: string, numkeys: number, ...keys: string[]) => Promise<number>;
|
|
1875
|
-
/**
|
|
1876
|
-
* @see https://redis.io/commands/zincrby
|
|
1877
|
-
*/
|
|
1878
|
-
zincrby: <TData>(key: string, increment: number, member: TData) => Promise<number>;
|
|
1879
|
-
/**
|
|
1880
|
-
* @see https://redis.io/commands/zinterstore
|
|
1881
|
-
*/
|
|
1882
|
-
zinterstore: (destination: string, numKeys: number, keys: string[], opts?: ZInterStoreCommandOptions | undefined) => Promise<number>;
|
|
1883
|
-
/**
|
|
1884
|
-
* @see https://redis.io/commands/zlexcount
|
|
1885
|
-
*/
|
|
1886
|
-
zlexcount: (key: string, min: string, max: string) => Promise<number>;
|
|
1887
|
-
/**
|
|
1888
|
-
* @see https://redis.io/commands/zmscore
|
|
1889
|
-
*/
|
|
1890
|
-
zmscore: (key: string, members: unknown[]) => Promise<number[] | null>;
|
|
1891
|
-
/**
|
|
1892
|
-
* @see https://redis.io/commands/zpopmax
|
|
1893
|
-
*/
|
|
1894
|
-
zpopmax: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
|
|
1895
|
-
/**
|
|
1896
|
-
* @see https://redis.io/commands/zpopmin
|
|
1897
|
-
*/
|
|
1898
|
-
zpopmin: <TData>(key: string, count?: number | undefined) => Promise<TData[]>;
|
|
1899
|
-
/**
|
|
1900
|
-
* @see https://redis.io/commands/zrange
|
|
1901
|
-
*/
|
|
1902
|
-
zrange: <TData extends unknown[]>(...args: [key: string, min: number, max: number, opts?: ZRangeCommandOptions] | [
|
|
1903
|
-
key: string,
|
|
1904
|
-
min: `(${string}` | `[${string}` | "-" | "+",
|
|
1905
|
-
max: `(${string}` | `[${string}` | "-" | "+",
|
|
1906
|
-
opts: {
|
|
1907
|
-
byLex: true;
|
|
1908
|
-
} & ZRangeCommandOptions
|
|
1909
|
-
] | [
|
|
1910
|
-
key: string,
|
|
1911
|
-
min: number | `(${number}` | "-inf" | "+inf",
|
|
1912
|
-
max: number | `(${number}` | "-inf" | "+inf",
|
|
1913
|
-
opts: {
|
|
1914
|
-
byScore: true;
|
|
1915
|
-
} & ZRangeCommandOptions
|
|
1916
|
-
]) => Promise<TData>;
|
|
1917
|
-
/**
|
|
1918
|
-
* @see https://redis.io/commands/zrank
|
|
1919
|
-
*/
|
|
1920
|
-
zrank: <TData>(key: string, member: TData) => Promise<number | null>;
|
|
1921
|
-
/**
|
|
1922
|
-
* @see https://redis.io/commands/zrem
|
|
1923
|
-
*/
|
|
1924
|
-
zrem: <TData>(key: string, ...members: TData[]) => Promise<number>;
|
|
1925
|
-
/**
|
|
1926
|
-
* @see https://redis.io/commands/zremrangebylex
|
|
1927
|
-
*/
|
|
1928
|
-
zremrangebylex: (key: string, min: string, max: string) => Promise<number>;
|
|
1929
|
-
/**
|
|
1930
|
-
* @see https://redis.io/commands/zremrangebyrank
|
|
1931
|
-
*/
|
|
1932
|
-
zremrangebyrank: (key: string, start: number, stop: number) => Promise<number>;
|
|
1933
|
-
/**
|
|
1934
|
-
* @see https://redis.io/commands/zremrangebyscore
|
|
1935
|
-
*/
|
|
1936
|
-
zremrangebyscore: (key: string, min: number, max: number) => Promise<number>;
|
|
1937
|
-
/**
|
|
1938
|
-
* @see https://redis.io/commands/zrevrank
|
|
1939
|
-
*/
|
|
1940
|
-
zrevrank: <TData>(key: string, member: TData) => Promise<number | null>;
|
|
1941
|
-
/**
|
|
1942
|
-
* @see https://redis.io/commands/zscan
|
|
1943
|
-
*/
|
|
1944
|
-
zscan: (key: string, cursor: number, opts?: ScanCommandOptions | undefined) => Promise<[number, (string | number)[]]>;
|
|
1945
|
-
/**
|
|
1946
|
-
* @see https://redis.io/commands/zscore
|
|
1947
|
-
*/
|
|
1948
|
-
zscore: <TData>(key: string, member: TData) => Promise<number | null>;
|
|
1949
|
-
/**
|
|
1950
|
-
* @see https://redis.io/commands/zunion
|
|
1951
|
-
*/
|
|
1952
|
-
zunion: (numKeys: number, keys: string[], opts?: ZUnionCommandOptions | undefined) => Promise<any>;
|
|
1953
|
-
/**
|
|
1954
|
-
* @see https://redis.io/commands/zunionstore
|
|
1955
|
-
*/
|
|
1956
|
-
zunionstore: (destination: string, numKeys: number, keys: string[], opts?: ZUnionStoreCommandOptions | undefined) => Promise<number>;
|
|
1957
|
-
}
|
|
1958
|
-
|
|
1959
|
-
export { RedisOptions as R, UpstashRequest as U, RequesterConfig as a, Redis as b, Requester as c, UpstashResponse as d };
|