@upstash/redis 1.36.0-rc.3 → 1.36.0
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/{chunk-2HN5OIX5.mjs → chunk-4AG3JMXU.mjs} +215 -404
- package/cloudflare.d.mts +2 -2
- package/cloudflare.d.ts +2 -2
- package/cloudflare.js +222 -379
- package/cloudflare.mjs +14 -10
- package/fastly.d.mts +2 -2
- package/fastly.d.ts +2 -2
- package/fastly.js +209 -370
- package/fastly.mjs +1 -1
- package/nodejs.d.mts +3 -94
- package/nodejs.d.ts +3 -94
- package/nodejs.js +217 -407
- package/nodejs.mjs +9 -13
- package/package.json +1 -1
- package/{zmscore-DQw_6S0p.d.mts → zmscore-0SAuWM0q.d.mts} +125 -218
- package/{zmscore-DQw_6S0p.d.ts → zmscore-0SAuWM0q.d.ts} +125 -218
package/nodejs.mjs
CHANGED
|
@@ -2,11 +2,8 @@ import {
|
|
|
2
2
|
HttpClient,
|
|
3
3
|
Redis,
|
|
4
4
|
VERSION,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
index,
|
|
8
|
-
s
|
|
9
|
-
} from "./chunk-2HN5OIX5.mjs";
|
|
5
|
+
error_exports
|
|
6
|
+
} from "./chunk-4AG3JMXU.mjs";
|
|
10
7
|
|
|
11
8
|
// platforms/nodejs.ts
|
|
12
9
|
if (typeof atob === "undefined") {
|
|
@@ -64,18 +61,20 @@ var Redis2 = class _Redis extends Redis {
|
|
|
64
61
|
keepAlive: configOrRequester.keepAlive,
|
|
65
62
|
readYourWrites: configOrRequester.readYourWrites
|
|
66
63
|
});
|
|
64
|
+
const safeEnv = typeof process === "object" && process && typeof process.env === "object" && process.env ? process.env : {};
|
|
67
65
|
super(client, {
|
|
68
66
|
automaticDeserialization: configOrRequester.automaticDeserialization,
|
|
69
|
-
enableTelemetry: configOrRequester.enableTelemetry ?? !
|
|
67
|
+
enableTelemetry: configOrRequester.enableTelemetry ?? !safeEnv.UPSTASH_DISABLE_TELEMETRY,
|
|
70
68
|
latencyLogging: configOrRequester.latencyLogging,
|
|
71
69
|
enableAutoPipelining: configOrRequester.enableAutoPipelining
|
|
72
70
|
});
|
|
71
|
+
const nodeVersion = typeof process === "object" && process ? process.version : void 0;
|
|
73
72
|
this.addTelemetry({
|
|
74
73
|
runtime: (
|
|
75
74
|
// @ts-expect-error to silence compiler
|
|
76
|
-
typeof EdgeRuntime === "string" ? "edge-light" : `node@${
|
|
75
|
+
typeof EdgeRuntime === "string" ? "edge-light" : nodeVersion ? `node@${nodeVersion}` : "unknown"
|
|
77
76
|
),
|
|
78
|
-
platform:
|
|
77
|
+
platform: safeEnv.UPSTASH_CONSOLE ? "console" : safeEnv.VERCEL ? "vercel" : safeEnv.AWS_REGION ? "aws" : "unknown",
|
|
79
78
|
sdk: `@upstash/redis@${VERSION}`
|
|
80
79
|
});
|
|
81
80
|
if (this.enableAutoPipelining) {
|
|
@@ -96,7 +95,7 @@ var Redis2 = class _Redis extends Redis {
|
|
|
96
95
|
* that may use different naming conventions.
|
|
97
96
|
*/
|
|
98
97
|
static fromEnv(config) {
|
|
99
|
-
if (process.env
|
|
98
|
+
if (typeof process !== "object" || !process || typeof process.env !== "object" || !process.env) {
|
|
100
99
|
throw new TypeError(
|
|
101
100
|
'[Upstash Redis] Unable to get environment variables, `process.env` is undefined. If you are deploying to cloudflare, please import from "@upstash/redis/cloudflare" instead'
|
|
102
101
|
);
|
|
@@ -116,8 +115,5 @@ var Redis2 = class _Redis extends Redis {
|
|
|
116
115
|
};
|
|
117
116
|
export {
|
|
118
117
|
Redis2 as Redis,
|
|
119
|
-
|
|
120
|
-
error_exports as errors,
|
|
121
|
-
index,
|
|
122
|
-
s
|
|
118
|
+
error_exports as errors
|
|
123
119
|
};
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@upstash/redis","version":"v1.36.0
|
|
1
|
+
{"name":"@upstash/redis","version":"v1.36.0","main":"./nodejs.js","module":"./nodejs.mjs","types":"./nodejs.d.ts","exports":{".":{"import":"./nodejs.mjs","require":"./nodejs.js"},"./node":{"import":"./nodejs.mjs","require":"./nodejs.js"},"./cloudflare":{"import":"./cloudflare.mjs","require":"./cloudflare.js"},"./cloudflare.js":{"import":"./cloudflare.mjs","require":"./cloudflare.js"},"./cloudflare.mjs":{"import":"./cloudflare.mjs","require":"./cloudflare.js"},"./fastly":{"import":"./fastly.mjs","require":"./fastly.js"},"./fastly.js":{"import":"./fastly.mjs","require":"./fastly.js"},"./fastly.mjs":{"import":"./fastly.mjs","require":"./fastly.js"}},"description":"An HTTP/REST based Redis client built on top of Upstash REST API.","repository":{"type":"git","url":"git+https://github.com/upstash/upstash-redis.git"},"keywords":["redis","database","serverless","edge","upstash"],"files":["./*"],"scripts":{"build":"tsup && cp package.json README.md LICENSE dist/","test":"bun test pkg","fmt":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","lint":"eslint \"**/*.{js,ts,tsx}\" --quiet --fix","format":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","format:check":"prettier --check \"**/*.{ts,tsx,js,jsx,json,md}\"","lint:fix":"eslint . -c .ts,.tsx,.js,.jsx --fix","commit":"cz","lint:format":"bun run lint:fix && bun run format","check-exports":"bun run build && cd dist && attw -P"},"author":"Andreas Thomas <dev@chronark.com>","license":"MIT","bugs":{"url":"https://github.com/upstash/upstash-redis/issues"},"homepage":"https://github.com/upstash/upstash-redis#readme","devDependencies":{"@biomejs/biome":"latest","@commitlint/cli":"^19.3.0","@commitlint/config-conventional":"^19.2.2","@typescript-eslint/eslint-plugin":"8.4.0","@typescript-eslint/parser":"8.4.0","bun-types":"1.0.33","eslint":"9.10.0","eslint-plugin-unicorn":"55.0.0","husky":"^9.1.1","prettier":"^3.3.3","tsup":"^8.2.3","typescript":"latest"},"dependencies":{"uncrypto":"^0.1.3"}}
|
|
@@ -317,222 +317,39 @@ declare class ExpireCommand extends Command<"0" | "1", 0 | 1> {
|
|
|
317
317
|
constructor(cmd: [key: string, seconds: number, option?: ExpireOption], opts?: CommandOptions<"0" | "1", 0 | 1>);
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
fast?: boolean;
|
|
334
|
-
};
|
|
335
|
-
type DateField = {
|
|
336
|
-
type: "DATE";
|
|
337
|
-
fast?: boolean;
|
|
338
|
-
};
|
|
339
|
-
type DetailedField = TextField | NumericField | BoolField | DateField;
|
|
340
|
-
type NestedIndexSchema = {
|
|
341
|
-
[key: string]: FieldType | DetailedField | NestedIndexSchema;
|
|
342
|
-
};
|
|
343
|
-
type FlatIndexSchema = {
|
|
344
|
-
[key: string]: FieldType | DetailedField;
|
|
345
|
-
};
|
|
346
|
-
type SchemaPaths<T, Prefix extends string = ""> = {
|
|
347
|
-
[K in keyof T]: K extends string ? T[K] extends FieldType | DetailedField ? Prefix extends "" ? K : `${Prefix}${K}` : T[K] extends object ? SchemaPaths<T[K], `${Prefix}${K}.`> : never : never;
|
|
348
|
-
}[keyof T];
|
|
349
|
-
type ExtractFieldType<T> = T extends FieldType ? T : T extends {
|
|
350
|
-
type: infer U;
|
|
351
|
-
} ? U extends FieldType ? U : never : never;
|
|
352
|
-
type GetFieldAtPath<TSchema, Path extends string> = Path extends `${infer First}.${infer Rest}` ? First extends keyof TSchema ? GetFieldAtPath<TSchema[First], Rest> : never : Path extends keyof TSchema ? TSchema[Path] : never;
|
|
353
|
-
type FieldValueType<T extends FieldType> = T extends "TEXT" ? string : T extends "U64" | "I64" | "F64" ? number : T extends "BOOL" ? boolean : T extends "DATE" ? string : never;
|
|
354
|
-
type GetFieldValueType<TSchema, Path extends string> = GetFieldAtPath<TSchema, Path> extends infer Field ? Field extends FieldType | DetailedField ? FieldValueType<ExtractFieldType<Field>> : never : never;
|
|
355
|
-
type InferSchemaData<TSchema> = {
|
|
356
|
-
[K in keyof TSchema]: TSchema[K] extends FieldType ? FieldValueType<TSchema[K]> : TSchema[K] extends DetailedField ? FieldValueType<ExtractFieldType<TSchema[K]>> : TSchema[K] extends NestedIndexSchema ? InferSchemaData<TSchema[K]> : never;
|
|
357
|
-
};
|
|
358
|
-
type QueryOptions<TSchema extends NestedIndexSchema | FlatIndexSchema> = {
|
|
359
|
-
filter: QueryFilter<TSchema>;
|
|
360
|
-
/** Maximum number of results to return */
|
|
361
|
-
limit?: number;
|
|
362
|
-
/** Number of results to skip */
|
|
363
|
-
offset?: number;
|
|
364
|
-
/** Sort by field (requires FAST option on field) */
|
|
365
|
-
orderBy?: {
|
|
366
|
-
[K in SchemaPaths<TSchema>]: {
|
|
367
|
-
[P in K]: "ASC" | "DESC";
|
|
368
|
-
};
|
|
369
|
-
}[SchemaPaths<TSchema>];
|
|
370
|
-
select?: Partial<{
|
|
371
|
-
[K in SchemaPaths<TSchema>]: true;
|
|
372
|
-
}>;
|
|
373
|
-
highlight?: {
|
|
374
|
-
fields: SchemaPaths<TSchema>[];
|
|
375
|
-
preTag?: string;
|
|
376
|
-
postTag?: string;
|
|
377
|
-
};
|
|
378
|
-
};
|
|
379
|
-
/**
|
|
380
|
-
* Converts dot notation paths to nested object structure type
|
|
381
|
-
* e.g. "content.title" | "content.author" becomes { content: { title: ..., author: ... } }
|
|
382
|
-
*/
|
|
383
|
-
type PathToNestedObject<TSchema, Path extends string, Value> = Path extends `${infer First}.${infer Rest}` ? {
|
|
384
|
-
[K in First]: PathToNestedObject<TSchema, Rest, Value>;
|
|
385
|
-
} : {
|
|
386
|
-
[K in Path]: Value;
|
|
387
|
-
};
|
|
388
|
-
/**
|
|
389
|
-
* Merges intersection of objects into a single object type with proper nesting
|
|
390
|
-
*/
|
|
391
|
-
type DeepMerge<T> = T extends object ? {
|
|
392
|
-
[K in keyof T]: T[K] extends object ? DeepMerge<T[K]> : T[K];
|
|
393
|
-
} : T;
|
|
394
|
-
/**
|
|
395
|
-
* Build nested result type from selected paths
|
|
396
|
-
*/
|
|
397
|
-
type BuildNestedResult<TSchema, TFields> = DeepMerge<UnionToIntersection<{
|
|
398
|
-
[Path in keyof TFields & SchemaPaths<TSchema>]: PathToNestedObject<TSchema, Path & string, GetFieldValueType<TSchema, Path & string>>;
|
|
399
|
-
}[keyof TFields & SchemaPaths<TSchema>]>>;
|
|
400
|
-
type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
401
|
-
type QueryResult<TSchema extends NestedIndexSchema | FlatIndexSchema, TOptions extends QueryOptions<TSchema> | undefined = undefined> = TOptions extends {
|
|
402
|
-
select: infer TFields;
|
|
403
|
-
} ? {} extends TFields ? {
|
|
404
|
-
key: string;
|
|
405
|
-
score: string;
|
|
406
|
-
} : {
|
|
407
|
-
key: string;
|
|
408
|
-
score: string;
|
|
409
|
-
data: BuildNestedResult<TSchema, TFields>;
|
|
410
|
-
} : {
|
|
411
|
-
key: string;
|
|
412
|
-
score: string;
|
|
413
|
-
data: InferSchemaData<TSchema>;
|
|
414
|
-
};
|
|
415
|
-
type StringOperationMap<T extends string> = {
|
|
416
|
-
$eq: T;
|
|
417
|
-
$ne: T;
|
|
418
|
-
$in: T[];
|
|
419
|
-
$fuzzy: T | {
|
|
420
|
-
value: T;
|
|
421
|
-
distance?: number;
|
|
422
|
-
transpositionCostOne?: boolean;
|
|
423
|
-
};
|
|
424
|
-
$phrase: T;
|
|
425
|
-
$regex: T;
|
|
426
|
-
};
|
|
427
|
-
type NumberOperationMap<T extends number> = {
|
|
428
|
-
$eq: T;
|
|
429
|
-
$ne: T;
|
|
430
|
-
$in: T[];
|
|
431
|
-
$gt: T;
|
|
432
|
-
$gte: T;
|
|
433
|
-
$lt: T;
|
|
434
|
-
$lte: T;
|
|
435
|
-
};
|
|
436
|
-
type BooleanOperationMap<T extends boolean> = {
|
|
437
|
-
$eq: T;
|
|
438
|
-
$ne: T;
|
|
439
|
-
$in: T[];
|
|
440
|
-
};
|
|
441
|
-
type DateOperationMap<T extends string | Date> = {
|
|
442
|
-
$eq: T;
|
|
443
|
-
$ne: T;
|
|
444
|
-
$in: T[];
|
|
445
|
-
};
|
|
446
|
-
type StringOperations = {
|
|
447
|
-
[K in keyof StringOperationMap<string>]: {
|
|
448
|
-
[P in K]: StringOperationMap<string>[K];
|
|
449
|
-
};
|
|
450
|
-
}[keyof StringOperationMap<string>];
|
|
451
|
-
type NumberOperations = {
|
|
452
|
-
[K in keyof NumberOperationMap<number>]: {
|
|
453
|
-
[P in K]: NumberOperationMap<number>[K];
|
|
454
|
-
};
|
|
455
|
-
}[keyof NumberOperationMap<number>];
|
|
456
|
-
type BooleanOperations = {
|
|
457
|
-
[K in keyof BooleanOperationMap<boolean>]: {
|
|
458
|
-
[P in K]: BooleanOperationMap<boolean>[K];
|
|
459
|
-
};
|
|
460
|
-
}[keyof BooleanOperationMap<boolean>];
|
|
461
|
-
type DateOperations = {
|
|
462
|
-
[K in keyof DateOperationMap<string | Date>]: {
|
|
463
|
-
[P in K]: DateOperationMap<string | Date>[K];
|
|
464
|
-
};
|
|
465
|
-
}[keyof DateOperationMap<string | Date>];
|
|
466
|
-
type OperationsForFieldType<T extends FieldType> = T extends "TEXT" ? StringOperations : T extends "U64" | "I64" | "F64" ? NumberOperations : T extends "BOOL" ? BooleanOperations : T extends "DATE" ? DateOperations : never;
|
|
467
|
-
type PathOperations<TSchema, TPath extends string> = GetFieldAtPath<TSchema, TPath> extends infer Field ? Field extends FieldType | DetailedField ? OperationsForFieldType<ExtractFieldType<Field>> : never : never;
|
|
468
|
-
type QueryLeaf<TSchema> = {
|
|
469
|
-
[Path in SchemaPaths<TSchema>]: {
|
|
470
|
-
[K in Path]: PathOperations<TSchema, Path>;
|
|
471
|
-
};
|
|
472
|
-
}[SchemaPaths<TSchema>];
|
|
473
|
-
type QueryFilter<TSchema extends NestedIndexSchema | FlatIndexSchema> = QueryLeaf<TSchema> | {
|
|
474
|
-
$must: QueryFilter<TSchema>;
|
|
475
|
-
} | {
|
|
476
|
-
$should: QueryFilter<TSchema>;
|
|
477
|
-
} | {
|
|
478
|
-
$not: QueryFilter<TSchema>;
|
|
479
|
-
} | {
|
|
480
|
-
$and: QueryFilter<TSchema>;
|
|
481
|
-
} | {
|
|
482
|
-
$or: QueryFilter<TSchema>;
|
|
483
|
-
} | {
|
|
484
|
-
$boost: {
|
|
485
|
-
query: QueryFilter<TSchema>;
|
|
486
|
-
value: number;
|
|
487
|
-
};
|
|
488
|
-
};
|
|
489
|
-
type DescribeFieldInfo = {
|
|
490
|
-
type: FieldType;
|
|
491
|
-
noTokenize?: boolean;
|
|
492
|
-
noStem?: boolean;
|
|
493
|
-
fast?: boolean;
|
|
494
|
-
};
|
|
495
|
-
type IndexDescription<TSchema extends NestedIndexSchema | FlatIndexSchema> = {
|
|
496
|
-
name: string;
|
|
497
|
-
dataType: "hash" | "string";
|
|
498
|
-
prefixes: string[];
|
|
499
|
-
language?: Language;
|
|
500
|
-
schema: Record<SchemaPaths<TSchema>, DescribeFieldInfo>;
|
|
320
|
+
type FunctionListArgs = {
|
|
321
|
+
/**
|
|
322
|
+
* Pattern for matching library names. Supports glob patterns.
|
|
323
|
+
*
|
|
324
|
+
* Example: "my_library_*"
|
|
325
|
+
*/
|
|
326
|
+
libraryName?: string;
|
|
327
|
+
/**
|
|
328
|
+
* Includes the library source code in the response.
|
|
329
|
+
*
|
|
330
|
+
* @default false
|
|
331
|
+
*/
|
|
332
|
+
withCode?: boolean;
|
|
501
333
|
};
|
|
502
|
-
type Language = "english" | "arabic" | "danish" | "dutch" | "finnish" | "french" | "german" | "greek" | "hungarian" | "italian" | "norwegian" | "portuguese" | "romanian" | "russian" | "spanish" | "swedish" | "tamil" | "turkish";
|
|
503
334
|
|
|
504
|
-
type
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
335
|
+
type FunctionLoadArgs = {
|
|
336
|
+
/**
|
|
337
|
+
* The Lua code to load.
|
|
338
|
+
*
|
|
339
|
+
* Example:
|
|
340
|
+
* ```lua
|
|
341
|
+
* #!lua name=mylib
|
|
342
|
+
* redis.register_function('myfunc', function() return 'ok' end)
|
|
343
|
+
* ```
|
|
344
|
+
*/
|
|
345
|
+
code: string;
|
|
346
|
+
/**
|
|
347
|
+
* If true, the library will replace the existing library with the same name.
|
|
348
|
+
*
|
|
349
|
+
* @default false
|
|
350
|
+
*/
|
|
351
|
+
replace?: boolean;
|
|
518
352
|
};
|
|
519
|
-
declare class SearchIndex<TSchema extends NestedIndexSchema | FlatIndexSchema> {
|
|
520
|
-
readonly name: SearchIndexProps<TSchema>["name"];
|
|
521
|
-
readonly schema?: TSchema;
|
|
522
|
-
private client;
|
|
523
|
-
constructor({ name, schema, client }: SearchIndexProps<TSchema>);
|
|
524
|
-
waitIndexing(): Promise<string>;
|
|
525
|
-
describe(): Promise<IndexDescription<TSchema>>;
|
|
526
|
-
query<TOptions extends QueryOptions<TSchema>>(options: TOptions): Promise<QueryResult<TSchema, TOptions>[]>;
|
|
527
|
-
count({ filter }: {
|
|
528
|
-
filter: QueryFilter<TSchema>;
|
|
529
|
-
}): Promise<{
|
|
530
|
-
count: number;
|
|
531
|
-
}>;
|
|
532
|
-
drop(): Promise<string>;
|
|
533
|
-
}
|
|
534
|
-
declare function createIndex<TSchema extends NestedIndexSchema | FlatIndexSchema>(props: createIndexProps<TSchema>): Promise<SearchIndex<TSchema>>;
|
|
535
|
-
declare function index<TSchema extends NestedIndexSchema | FlatIndexSchema>(client: Requester, name: SearchIndexProps<TSchema>["name"], schema?: SearchIndexProps<TSchema>["schema"]): SearchIndex<TSchema>;
|
|
536
353
|
|
|
537
354
|
/**
|
|
538
355
|
* @see https://redis.io/commands/append
|
|
@@ -3105,6 +2922,52 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
|
|
|
3105
2922
|
*/
|
|
3106
2923
|
type: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, string[]>]>;
|
|
3107
2924
|
};
|
|
2925
|
+
get functions(): {
|
|
2926
|
+
/**
|
|
2927
|
+
* @see https://redis.io/docs/latest/commands/function-load/
|
|
2928
|
+
*/
|
|
2929
|
+
load: (args: FunctionLoadArgs) => Pipeline<[...TCommands, Command<any, string>]>;
|
|
2930
|
+
/**
|
|
2931
|
+
* @see https://redis.io/docs/latest/commands/function-list/
|
|
2932
|
+
*/
|
|
2933
|
+
list: (args?: FunctionListArgs | undefined) => Pipeline<[...TCommands, Command<any, {
|
|
2934
|
+
libraryName: string;
|
|
2935
|
+
engine: string;
|
|
2936
|
+
functions: {
|
|
2937
|
+
name: string;
|
|
2938
|
+
description?: string;
|
|
2939
|
+
flags: string[];
|
|
2940
|
+
}[];
|
|
2941
|
+
libraryCode?: string;
|
|
2942
|
+
}[]>]>;
|
|
2943
|
+
/**
|
|
2944
|
+
* @see https://redis.io/docs/latest/commands/function-delete/
|
|
2945
|
+
*/
|
|
2946
|
+
delete: (libraryName: string) => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
2947
|
+
/**
|
|
2948
|
+
* @see https://redis.io/docs/latest/commands/function-flush/
|
|
2949
|
+
*/
|
|
2950
|
+
flush: () => Pipeline<[...TCommands, Command<any, "OK">]>;
|
|
2951
|
+
/**
|
|
2952
|
+
* @see https://redis.io/docs/latest/commands/function-stats/
|
|
2953
|
+
*/
|
|
2954
|
+
stats: () => Pipeline<[...TCommands, Command<any, {
|
|
2955
|
+
engines: {
|
|
2956
|
+
[k: string]: {
|
|
2957
|
+
librariesCount: unknown;
|
|
2958
|
+
functionsCount: unknown;
|
|
2959
|
+
};
|
|
2960
|
+
};
|
|
2961
|
+
}>]>;
|
|
2962
|
+
/**
|
|
2963
|
+
* @see https://redis.io/docs/latest/commands/fcall/
|
|
2964
|
+
*/
|
|
2965
|
+
call: <TData = unknown>(functionName: string, keys?: string[] | undefined, args?: string[] | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2966
|
+
/**
|
|
2967
|
+
* @see https://redis.io/docs/latest/commands/fcall_ro/
|
|
2968
|
+
*/
|
|
2969
|
+
callRo: <TData = unknown>(functionName: string, keys?: string[] | undefined, args?: string[] | undefined) => Pipeline<[...TCommands, Command<any, TData>]>;
|
|
2970
|
+
};
|
|
3108
2971
|
}
|
|
3109
2972
|
|
|
3110
2973
|
/**
|
|
@@ -3332,6 +3195,54 @@ declare class Redis {
|
|
|
3332
3195
|
*/
|
|
3333
3196
|
type: (key: string, path?: string | undefined) => Promise<string[]>;
|
|
3334
3197
|
};
|
|
3198
|
+
get functions(): {
|
|
3199
|
+
/**
|
|
3200
|
+
* @see https://redis.io/docs/latest/commands/function-load/
|
|
3201
|
+
*/
|
|
3202
|
+
load: (args: FunctionLoadArgs) => Promise<string>;
|
|
3203
|
+
/**
|
|
3204
|
+
* @see https://redis.io/docs/latest/commands/function-list/
|
|
3205
|
+
*/
|
|
3206
|
+
list: (args?: FunctionListArgs | undefined) => Promise<{
|
|
3207
|
+
libraryName: string;
|
|
3208
|
+
engine: string;
|
|
3209
|
+
functions: {
|
|
3210
|
+
name: string;
|
|
3211
|
+
description?: string;
|
|
3212
|
+
flags: string[];
|
|
3213
|
+
}[];
|
|
3214
|
+
libraryCode?: string;
|
|
3215
|
+
}[]>;
|
|
3216
|
+
/**
|
|
3217
|
+
* @see https://redis.io/docs/latest/commands/function-delete/
|
|
3218
|
+
*/
|
|
3219
|
+
delete: (libraryName: string) => Promise<"OK">;
|
|
3220
|
+
/**
|
|
3221
|
+
* @see https://redis.io/docs/latest/commands/function-flush/
|
|
3222
|
+
*/
|
|
3223
|
+
flush: () => Promise<"OK">;
|
|
3224
|
+
/**
|
|
3225
|
+
* @see https://redis.io/docs/latest/commands/function-stats/
|
|
3226
|
+
*
|
|
3227
|
+
* Note: `running_script` field is not supported and therefore not included in the type.
|
|
3228
|
+
*/
|
|
3229
|
+
stats: () => Promise<{
|
|
3230
|
+
engines: {
|
|
3231
|
+
[k: string]: {
|
|
3232
|
+
librariesCount: unknown;
|
|
3233
|
+
functionsCount: unknown;
|
|
3234
|
+
};
|
|
3235
|
+
};
|
|
3236
|
+
}>;
|
|
3237
|
+
/**
|
|
3238
|
+
* @see https://redis.io/docs/latest/commands/fcall/
|
|
3239
|
+
*/
|
|
3240
|
+
call: <TData = unknown>(functionName: string, keys?: string[] | undefined, args?: string[] | undefined) => Promise<TData>;
|
|
3241
|
+
/**
|
|
3242
|
+
* @see https://redis.io/docs/latest/commands/fcall_ro/
|
|
3243
|
+
*/
|
|
3244
|
+
callRo: <TData = unknown>(functionName: string, keys?: string[] | undefined, args?: string[] | undefined) => Promise<TData>;
|
|
3245
|
+
};
|
|
3335
3246
|
/**
|
|
3336
3247
|
* Wrap a new middleware around the HTTP client.
|
|
3337
3248
|
*/
|
|
@@ -3371,10 +3282,6 @@ declare class Redis {
|
|
|
3371
3282
|
createScript<TResult = unknown, TReadonly extends boolean = false>(script: string, opts?: {
|
|
3372
3283
|
readonly?: TReadonly;
|
|
3373
3284
|
}): TReadonly extends true ? ScriptRO<TResult> : Script<TResult>;
|
|
3374
|
-
get search(): {
|
|
3375
|
-
createIndex: <TSchema extends NestedIndexSchema | FlatIndexSchema>(props: Omit<createIndexProps<TSchema>, "client">) => Promise<SearchIndex<TSchema>>;
|
|
3376
|
-
index: <TSchema extends NestedIndexSchema | FlatIndexSchema>(name: string, schema?: TSchema extends NestedIndexSchema ? TSchema : never) => SearchIndex<TSchema>;
|
|
3377
|
-
};
|
|
3378
3285
|
/**
|
|
3379
3286
|
* Create a new pipeline that allows you to send requests in bulk.
|
|
3380
3287
|
*
|
|
@@ -4280,4 +4187,4 @@ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] |
|
|
|
4280
4187
|
constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
|
|
4281
4188
|
}
|
|
4282
4189
|
|
|
4283
|
-
export {
|
|
4190
|
+
export { HPersistCommand as $, AppendCommand as A, BitCountCommand as B, CopyCommand as C, DBSizeCommand as D, EchoCommand as E, FlushAllCommand as F, GeoAddCommand as G, type HttpClientConfig as H, GetCommand as I, GetBitCommand as J, GetDelCommand as K, GetExCommand as L, GetRangeCommand as M, GetSetCommand as N, HDelCommand as O, Pipeline as P, HExistsCommand as Q, type RedisOptions as R, HExpireCommand as S, HExpireAtCommand as T, type UpstashRequest as U, HExpireTimeCommand as V, HTtlCommand as W, HPExpireCommand as X, HPExpireAtCommand as Y, HPExpireTimeCommand as Z, HPTtlCommand as _, type RequesterConfig as a, RenameNXCommand as a$, HGetCommand as a0, HGetAllCommand as a1, HIncrByCommand as a2, HIncrByFloatCommand as a3, HKeysCommand as a4, HLenCommand as a5, HMGetCommand as a6, HMSetCommand as a7, HRandFieldCommand as a8, HScanCommand as a9, JsonStrLenCommand as aA, JsonToggleCommand as aB, JsonTypeCommand as aC, KeysCommand as aD, LIndexCommand as aE, LInsertCommand as aF, LLenCommand as aG, LMoveCommand as aH, LPopCommand as aI, LPushCommand as aJ, LPushXCommand as aK, LRangeCommand as aL, LRemCommand as aM, LSetCommand as aN, LTrimCommand as aO, MGetCommand as aP, MSetCommand as aQ, MSetNXCommand as aR, PersistCommand as aS, PExpireCommand as aT, PExpireAtCommand as aU, PingCommand as aV, PSetEXCommand as aW, PTtlCommand as aX, PublishCommand as aY, RandomKeyCommand as aZ, RenameCommand as a_, HSetCommand as aa, HSetNXCommand as ab, HStrLenCommand as ac, HValsCommand as ad, IncrCommand as ae, IncrByCommand as af, IncrByFloatCommand as ag, JsonArrAppendCommand as ah, JsonArrIndexCommand as ai, JsonArrInsertCommand as aj, JsonArrLenCommand as ak, JsonArrPopCommand as al, JsonArrTrimCommand as am, JsonClearCommand as an, JsonDelCommand as ao, JsonForgetCommand as ap, JsonGetCommand as aq, JsonMergeCommand as ar, JsonMGetCommand as as, JsonNumIncrByCommand as at, JsonNumMultByCommand as au, JsonObjKeysCommand as av, JsonObjLenCommand as aw, JsonRespCommand as ax, JsonSetCommand as ay, JsonStrAppendCommand as az, Redis as b, type ZUnionCommandOptions as b$, RPopCommand as b0, RPushCommand as b1, RPushXCommand as b2, SAddCommand as b3, ScanCommand as b4, type ScanCommandOptions as b5, SCardCommand as b6, ScriptExistsCommand as b7, ScriptFlushCommand as b8, ScriptLoadCommand as b9, UnlinkCommand as bA, XAddCommand as bB, XRangeCommand as bC, type ScoreMember as bD, type ZAddCommandOptions as bE, ZAddCommand as bF, ZCardCommand as bG, ZCountCommand as bH, ZDiffStoreCommand as bI, ZIncrByCommand as bJ, ZInterStoreCommand as bK, type ZInterStoreCommandOptions as bL, ZLexCountCommand as bM, ZMScoreCommand as bN, ZPopMaxCommand as bO, ZPopMinCommand as bP, ZRangeCommand as bQ, type ZRangeCommandOptions as bR, ZRankCommand as bS, ZRemCommand as bT, ZRemRangeByLexCommand as bU, ZRemRangeByRankCommand as bV, ZRemRangeByScoreCommand as bW, ZRevRankCommand as bX, ZScanCommand as bY, ZScoreCommand as bZ, ZUnionCommand as b_, SDiffCommand as ba, SDiffStoreCommand as bb, SetCommand as bc, type SetCommandOptions as bd, SetBitCommand as be, SetExCommand as bf, SetNxCommand as bg, SetRangeCommand as bh, SInterCommand as bi, SInterStoreCommand as bj, SIsMemberCommand as bk, SMembersCommand as bl, SMIsMemberCommand as bm, SMoveCommand as bn, SPopCommand as bo, SRandMemberCommand as bp, SRemCommand as bq, SScanCommand as br, StrLenCommand as bs, SUnionCommand as bt, SUnionStoreCommand as bu, TimeCommand as bv, TouchCommand as bw, TtlCommand as bx, type Type as by, TypeCommand as bz, type Requester as c, ZUnionStoreCommand as c0, type ZUnionStoreCommandOptions as c1, type UpstashResponse as d, error as e, BitOpCommand as f, BitPosCommand as g, DecrCommand as h, DecrByCommand as i, DelCommand as j, EvalROCommand as k, EvalCommand as l, EvalshaROCommand as m, EvalshaCommand as n, ExistsCommand as o, ExpireCommand as p, type ExpireOption as q, ExpireAtCommand as r, FlushDBCommand as s, type GeoAddCommandOptions as t, type GeoMember as u, GeoDistCommand as v, GeoHashCommand as w, GeoPosCommand as x, GeoSearchCommand as y, GeoSearchStoreCommand as z };
|