@upstash/redis 1.36.0-rc.7 → 1.36.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/nodejs.mjs CHANGED
@@ -2,11 +2,8 @@ import {
2
2
  HttpClient,
3
3
  Redis,
4
4
  VERSION,
5
- createIndex,
6
- error_exports,
7
- index,
8
- s
9
- } from "./chunk-YYS6F6RP.mjs";
5
+ error_exports
6
+ } from "./chunk-LLI2WIYN.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 ?? !process.env.UPSTASH_DISABLE_TELEMETRY,
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@${process.version}`
75
+ typeof EdgeRuntime === "string" ? "edge-light" : nodeVersion ? `node@${nodeVersion}` : "unknown"
77
76
  ),
78
- platform: process.env.UPSTASH_CONSOLE ? "console" : process.env.VERCEL ? "vercel" : process.env.AWS_REGION ? "aws" : "unknown",
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 === void 0) {
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
- createIndex,
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-rc.7","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"}}
1
+ {"name":"@upstash/redis","version":"v1.36.1","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,340 +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
- declare const FIELD_TYPES: readonly ["TEXT", "U64", "I64", "F64", "BOOL", "DATE"];
321
- type FieldType = (typeof FIELD_TYPES)[number];
322
- type TextField = {
323
- type: "TEXT";
324
- noTokenize?: boolean;
325
- noStem?: boolean;
326
- };
327
- type NumericField = {
328
- type: "U64" | "I64" | "F64";
329
- fast: true;
330
- };
331
- type BoolField = {
332
- type: "BOOL";
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?: RootQueryFilter<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
- value: T;
426
- } | {
427
- value: T;
428
- slop: number;
429
- prefix?: never;
430
- } | {
431
- value: T;
432
- prefix: boolean;
433
- slop?: never;
434
- };
435
- $regex: T;
436
- };
437
- type NumberOperationMap<T extends number> = {
438
- $eq: T;
439
- $ne: T;
440
- $in: T[];
441
- $gt: T;
442
- $gte: T;
443
- $lt: T;
444
- $lte: T;
445
- };
446
- type BooleanOperationMap<T extends boolean> = {
447
- $eq: T;
448
- $ne: T;
449
- $in: T[];
450
- };
451
- type DateOperationMap<T extends string | Date> = {
452
- $eq: T;
453
- $ne: T;
454
- $in: T[];
455
- $gt: T;
456
- $gte: T;
457
- $lte: T;
458
- $lt: T;
459
- };
460
- type StringOperations = {
461
- [K in keyof StringOperationMap<string>]: {
462
- [P in K]: StringOperationMap<string>[K];
463
- } & {
464
- $boost?: number;
465
- };
466
- }[keyof StringOperationMap<string>];
467
- type NumberOperations = {
468
- [K in keyof NumberOperationMap<number>]: {
469
- [P in K]: NumberOperationMap<number>[K];
470
- } & {
471
- $boost?: number;
472
- };
473
- }[keyof NumberOperationMap<number>];
474
- type BooleanOperations = {
475
- [K in keyof BooleanOperationMap<boolean>]: {
476
- [P in K]: BooleanOperationMap<boolean>[K];
477
- } & {
478
- $boost?: number;
479
- };
480
- }[keyof BooleanOperationMap<boolean>];
481
- type DateOperations = {
482
- [K in keyof DateOperationMap<string | Date>]: {
483
- [P in K]: DateOperationMap<string | Date>[K];
484
- } & {
485
- $boost?: number;
486
- };
487
- }[keyof DateOperationMap<string | Date>];
488
- type OperationsForFieldType<T extends FieldType> = T extends "TEXT" ? StringOperations : T extends "U64" | "I64" | "F64" ? NumberOperations : T extends "BOOL" ? BooleanOperations : T extends "DATE" ? DateOperations : never;
489
- type PathOperations<TSchema, TPath extends string> = GetFieldAtPath<TSchema, TPath> extends infer Field ? Field extends FieldType | DetailedField ? OperationsForFieldType<ExtractFieldType<Field>> | FieldValueType<ExtractFieldType<Field>> : never : never;
490
- type QueryLeaf<TSchema> = {
491
- [K in SchemaPaths<TSchema>]?: PathOperations<TSchema, K>;
492
- } & {
493
- $and?: never;
494
- $or?: never;
495
- $must?: never;
496
- $should?: never;
497
- $mustNot?: never;
498
- $boost?: never;
499
- };
500
- type BoolBase<TSchema extends NestedIndexSchema | FlatIndexSchema> = {
501
- [P in SchemaPaths<TSchema>]?: PathOperations<TSchema, P>;
502
- };
503
- type AndNode<TSchema extends NestedIndexSchema | FlatIndexSchema> = BoolBase<TSchema> & {
504
- $and: QueryFilter<TSchema> | QueryFilter<TSchema>[];
505
- $boost?: number;
506
- $or?: never;
507
- $must?: never;
508
- $should?: never;
509
- $mustNot?: never;
510
- };
511
- type OrNode<TSchema extends NestedIndexSchema | FlatIndexSchema> = BoolBase<TSchema> & {
512
- $or: QueryFilter<TSchema> | QueryFilter<TSchema>[];
513
- $boost?: number;
514
- $and?: never;
515
- $must?: never;
516
- $should?: never;
517
- $mustNot?: never;
518
- };
519
- type MustNode<TSchema extends NestedIndexSchema | FlatIndexSchema> = BoolBase<TSchema> & {
520
- $must: QueryFilter<TSchema> | QueryFilter<TSchema>[];
521
- $boost?: number;
522
- $and?: never;
523
- $or?: never;
524
- $should?: never;
525
- $mustNot?: never;
526
- };
527
- type ShouldNode<TSchema extends NestedIndexSchema | FlatIndexSchema> = BoolBase<TSchema> & {
528
- $should: QueryFilter<TSchema> | QueryFilter<TSchema>[];
529
- $boost?: number;
530
- $and?: never;
531
- $or?: never;
532
- $must?: never;
533
- $mustNot?: never;
534
- };
535
- type MustShouldNode<TSchema extends NestedIndexSchema | FlatIndexSchema> = BoolBase<TSchema> & {
536
- $must: QueryFilter<TSchema> | QueryFilter<TSchema>[];
537
- $should: QueryFilter<TSchema> | QueryFilter<TSchema>[];
538
- $and?: never;
539
- $or?: never;
540
- };
541
- type NotNode<TSchema extends NestedIndexSchema | FlatIndexSchema> = BoolBase<TSchema> & {
542
- $mustNot: QueryFilter<TSchema> | QueryFilter<TSchema>[];
543
- $boost?: number;
544
- $and?: never;
545
- $or?: never;
546
- $must?: never;
547
- $should?: never;
548
- };
549
- type AndNotNode<TSchema extends NestedIndexSchema | FlatIndexSchema> = BoolBase<TSchema> & {
550
- $and: QueryFilter<TSchema> | QueryFilter<TSchema>[];
551
- $mustNot: QueryFilter<TSchema> | QueryFilter<TSchema>[];
552
- $boost?: number;
553
- $or?: never;
554
- $must?: never;
555
- $should?: never;
556
- };
557
- type OrNotNode<TSchema extends NestedIndexSchema | FlatIndexSchema> = BoolBase<TSchema> & {
558
- $or: QueryFilter<TSchema> | QueryFilter<TSchema>[];
559
- $mustNot: QueryFilter<TSchema> | QueryFilter<TSchema>[];
560
- $boost?: number;
561
- $and?: never;
562
- $must?: never;
563
- $should?: never;
564
- };
565
- type ShouldNotNode<TSchema extends NestedIndexSchema | FlatIndexSchema> = BoolBase<TSchema> & {
566
- $should: QueryFilter<TSchema> | QueryFilter<TSchema>[];
567
- $mustNot: QueryFilter<TSchema> | QueryFilter<TSchema>[];
568
- $boost?: number;
569
- $and?: never;
570
- $or?: never;
571
- $must?: never;
572
- };
573
- type MustNotNode<TSchema extends NestedIndexSchema | FlatIndexSchema> = BoolBase<TSchema> & {
574
- $must: QueryFilter<TSchema> | QueryFilter<TSchema>[];
575
- $mustNot: QueryFilter<TSchema> | QueryFilter<TSchema>[];
576
- $boost?: number;
577
- $and?: never;
578
- $or?: never;
579
- $should?: never;
580
- };
581
- type BoolNode<TSchema extends NestedIndexSchema | FlatIndexSchema> = BoolBase<TSchema> & {
582
- $must: QueryFilter<TSchema> | QueryFilter<TSchema>[];
583
- $should: QueryFilter<TSchema> | QueryFilter<TSchema>[];
584
- $mustNot: QueryFilter<TSchema> | QueryFilter<TSchema>[];
585
- $boost?: number;
586
- $and?: never;
587
- $or?: never;
588
- };
589
- type QueryFilter<TSchema extends NestedIndexSchema | FlatIndexSchema> = QueryLeaf<TSchema> | AndNode<TSchema> | OrNode<TSchema> | MustNode<TSchema> | ShouldNode<TSchema> | MustShouldNode<TSchema> | NotNode<TSchema> | AndNotNode<TSchema> | OrNotNode<TSchema> | ShouldNotNode<TSchema> | MustNotNode<TSchema> | BoolNode<TSchema>;
590
- type RootQueryFilter<TSchema extends NestedIndexSchema | FlatIndexSchema> = QueryLeaf<TSchema> | AndNode<TSchema> | RootOrNode<TSchema> | MustNode<TSchema> | ShouldNode<TSchema> | MustShouldNode<TSchema> | AndNotNode<TSchema> | ShouldNotNode<TSchema> | MustNotNode<TSchema> | BoolNode<TSchema>;
591
- type RootOrNode<TSchema extends NestedIndexSchema | FlatIndexSchema> = {
592
- [P in SchemaPaths<TSchema>]?: never;
593
- } & {
594
- $or: QueryFilter<TSchema> | QueryFilter<TSchema>[];
595
- $boost?: number;
596
- $and?: never;
597
- $must?: never;
598
- $should?: never;
599
- $mustNot?: never;
600
- };
601
- type DescribeFieldInfo = {
602
- type: FieldType;
603
- noTokenize?: boolean;
604
- noStem?: boolean;
605
- fast?: boolean;
606
- };
607
- type IndexDescription<TSchema extends NestedIndexSchema | FlatIndexSchema> = {
608
- name: string;
609
- dataType: "hash" | "string" | "json";
610
- prefixes: string[];
611
- language?: Language;
612
- 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;
613
333
  };
614
- type Language = "english" | "arabic" | "danish" | "dutch" | "finnish" | "french" | "german" | "greek" | "hungarian" | "italian" | "norwegian" | "portuguese" | "romanian" | "russian" | "spanish" | "swedish" | "tamil" | "turkish";
615
334
 
616
- type createIndexProps<TSchema extends NestedIndexSchema | FlatIndexSchema> = {
617
- name: string;
618
- prefix: string | string[];
619
- language?: Language;
620
- client: Requester;
621
- } & ({
622
- dataType: "string";
623
- schema: TSchema extends NestedIndexSchema ? TSchema : never;
624
- } | {
625
- dataType: "json";
626
- schema: TSchema extends NestedIndexSchema ? TSchema : never;
627
- } | {
628
- dataType: "hash";
629
- schema: TSchema extends FlatIndexSchema ? TSchema : never;
630
- });
631
- type SearchIndexProps<TSchema extends NestedIndexSchema | FlatIndexSchema> = {
632
- name: string;
633
- client: Requester;
634
- schema?: TSchema;
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;
635
352
  };
636
- declare class SearchIndex<TSchema extends NestedIndexSchema | FlatIndexSchema> {
637
- readonly name: SearchIndexProps<TSchema>["name"];
638
- readonly schema?: TSchema;
639
- private client;
640
- constructor({ name, schema, client }: SearchIndexProps<TSchema>);
641
- waitIndexing(): Promise<string>;
642
- describe(): Promise<IndexDescription<TSchema>>;
643
- query(options?: QueryOptions<TSchema>): Promise<QueryResult<TSchema, QueryOptions<TSchema>>[]>;
644
- count({ filter }: {
645
- filter: RootQueryFilter<TSchema>;
646
- }): Promise<{
647
- count: number;
648
- }>;
649
- drop(): Promise<string>;
650
- }
651
- declare function createIndex<TSchema extends NestedIndexSchema | FlatIndexSchema>(props: createIndexProps<TSchema>): Promise<SearchIndex<(TSchema extends NestedIndexSchema ? TSchema : never) | (TSchema extends NestedIndexSchema ? TSchema : never) | (TSchema extends FlatIndexSchema ? TSchema : never)>>;
652
- declare function index<TSchema extends NestedIndexSchema | FlatIndexSchema>(client: Requester, name: string, schema: TSchema): SearchIndex<TSchema>;
653
- declare function index(client: Requester, name: string): SearchIndex<any>;
654
353
 
655
354
  /**
656
355
  * @see https://redis.io/commands/append
@@ -3223,6 +2922,52 @@ declare class Pipeline<TCommands extends Command<any, any>[] = []> {
3223
2922
  */
3224
2923
  type: (key: string, path?: string | undefined) => Pipeline<[...TCommands, Command<any, string[]>]>;
3225
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
+ };
3226
2971
  }
3227
2972
 
3228
2973
  /**
@@ -3450,6 +3195,54 @@ declare class Redis {
3450
3195
  */
3451
3196
  type: (key: string, path?: string | undefined) => Promise<string[]>;
3452
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
+ };
3453
3246
  /**
3454
3247
  * Wrap a new middleware around the HTTP client.
3455
3248
  */
@@ -3489,10 +3282,6 @@ declare class Redis {
3489
3282
  createScript<TResult = unknown, TReadonly extends boolean = false>(script: string, opts?: {
3490
3283
  readonly?: TReadonly;
3491
3284
  }): TReadonly extends true ? ScriptRO<TResult> : Script<TResult>;
3492
- get search(): {
3493
- createIndex: <TSchema extends NestedIndexSchema | FlatIndexSchema>(props: Omit<createIndexProps<TSchema>, "client">) => Promise<SearchIndex<(TSchema extends NestedIndexSchema ? TSchema : never) | (TSchema extends NestedIndexSchema ? TSchema : never) | (TSchema extends FlatIndexSchema ? TSchema : never)>>;
3494
- index: <TSchema extends NestedIndexSchema | FlatIndexSchema>(name: string, schema?: TSchema extends NestedIndexSchema ? TSchema : never) => SearchIndex<TSchema>;
3495
- };
3496
3285
  /**
3497
3286
  * Create a new pipeline that allows you to send requests in bulk.
3498
3287
  *
@@ -4398,4 +4187,4 @@ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] |
4398
4187
  constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
4399
4188
  }
4400
4189
 
4401
- export { HPExpireTimeCommand 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, GeoSearchStoreCommand as I, GetCommand as J, GetBitCommand as K, GetDelCommand as L, GetExCommand as M, type NumericField as N, GetRangeCommand as O, Pipeline as P, GetSetCommand as Q, type RedisOptions as R, HDelCommand as S, HExistsCommand as T, type UpstashRequest as U, HExpireCommand as V, HExpireAtCommand as W, HExpireTimeCommand as X, HTtlCommand as Y, HPExpireCommand as Z, HPExpireAtCommand as _, type NestedIndexSchema as a, RandomKeyCommand as a$, HPTtlCommand as a0, HPersistCommand as a1, HGetCommand as a2, HGetAllCommand as a3, HIncrByCommand as a4, HIncrByFloatCommand as a5, HKeysCommand as a6, HLenCommand as a7, HMGetCommand as a8, HMSetCommand as a9, JsonSetCommand as aA, JsonStrAppendCommand as aB, JsonStrLenCommand as aC, JsonToggleCommand as aD, JsonTypeCommand as aE, KeysCommand as aF, LIndexCommand as aG, LInsertCommand as aH, LLenCommand as aI, LMoveCommand as aJ, LPopCommand as aK, LPushCommand as aL, LPushXCommand as aM, LRangeCommand as aN, LRemCommand as aO, LSetCommand as aP, LTrimCommand as aQ, MGetCommand as aR, MSetCommand as aS, MSetNXCommand as aT, PersistCommand as aU, PExpireCommand as aV, PExpireAtCommand as aW, PingCommand as aX, PSetEXCommand as aY, PTtlCommand as aZ, PublishCommand as a_, HRandFieldCommand as aa, HScanCommand as ab, HSetCommand as ac, HSetNXCommand as ad, HStrLenCommand as ae, HValsCommand as af, IncrCommand as ag, IncrByCommand as ah, IncrByFloatCommand as ai, JsonArrAppendCommand as aj, JsonArrIndexCommand as ak, JsonArrInsertCommand as al, JsonArrLenCommand as am, JsonArrPopCommand as an, JsonArrTrimCommand as ao, JsonClearCommand as ap, JsonDelCommand as aq, JsonForgetCommand as ar, JsonGetCommand as as, JsonMergeCommand as at, JsonMGetCommand as au, JsonNumIncrByCommand as av, JsonNumMultByCommand as aw, JsonObjKeysCommand as ax, JsonObjLenCommand as ay, JsonRespCommand as az, type RequesterConfig as b, ZScoreCommand as b$, RenameCommand as b0, RenameNXCommand as b1, RPopCommand as b2, RPushCommand as b3, RPushXCommand as b4, SAddCommand as b5, ScanCommand as b6, type ScanCommandOptions as b7, SCardCommand as b8, ScriptExistsCommand as b9, type Type as bA, TypeCommand as bB, UnlinkCommand as bC, XAddCommand as bD, XRangeCommand as bE, type ScoreMember as bF, type ZAddCommandOptions as bG, ZAddCommand as bH, ZCardCommand as bI, ZCountCommand as bJ, ZDiffStoreCommand as bK, ZIncrByCommand as bL, ZInterStoreCommand as bM, type ZInterStoreCommandOptions as bN, ZLexCountCommand as bO, ZMScoreCommand as bP, ZPopMaxCommand as bQ, ZPopMinCommand as bR, ZRangeCommand as bS, type ZRangeCommandOptions as bT, ZRankCommand as bU, ZRemCommand as bV, ZRemRangeByLexCommand as bW, ZRemRangeByRankCommand as bX, ZRemRangeByScoreCommand as bY, ZRevRankCommand as bZ, ZScanCommand as b_, ScriptFlushCommand as ba, ScriptLoadCommand as bb, SDiffCommand as bc, SDiffStoreCommand as bd, SetCommand as be, type SetCommandOptions as bf, SetBitCommand as bg, SetExCommand as bh, SetNxCommand as bi, SetRangeCommand as bj, SInterCommand as bk, SInterStoreCommand as bl, SIsMemberCommand as bm, SMembersCommand as bn, SMIsMemberCommand as bo, SMoveCommand as bp, SPopCommand as bq, SRandMemberCommand as br, SRemCommand as bs, SScanCommand as bt, StrLenCommand as bu, SUnionCommand as bv, SUnionStoreCommand as bw, TimeCommand as bx, TouchCommand as by, TtlCommand as bz, Redis as c, ZUnionCommand as c0, type ZUnionCommandOptions as c1, ZUnionStoreCommand as c2, type ZUnionStoreCommandOptions as c3, createIndex as c4, index as c5, type SearchIndexProps as c6, type createIndexProps as c7, type FlatIndexSchema as c8, type Requester as d, error as e, type UpstashResponse as f, BitOpCommand as g, BitPosCommand as h, DecrCommand as i, DecrByCommand as j, DelCommand as k, EvalROCommand as l, EvalCommand as m, EvalshaROCommand as n, EvalshaCommand as o, ExistsCommand as p, ExpireCommand as q, type ExpireOption as r, ExpireAtCommand as s, FlushDBCommand as t, type GeoAddCommandOptions as u, type GeoMember as v, GeoDistCommand as w, GeoHashCommand as x, GeoPosCommand as y, GeoSearchCommand as z };
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 };