@upstash/redis 1.36.0-rc.1 → 1.36.0-rc.3
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-U5HO3NMB.mjs → chunk-2HN5OIX5.mjs} +150 -149
- package/cloudflare.d.mts +2 -2
- package/cloudflare.d.ts +2 -2
- package/cloudflare.js +144 -87
- package/cloudflare.mjs +1 -1
- package/fastly.d.mts +2 -2
- package/fastly.d.ts +2 -2
- package/fastly.js +144 -87
- package/fastly.mjs +1 -1
- package/nodejs.d.mts +10 -72
- package/nodejs.d.ts +10 -72
- package/nodejs.js +152 -151
- package/nodejs.mjs +5 -5
- package/package.json +1 -1
- package/{zmscore-BVyzI3wx.d.mts → zmscore-DQw_6S0p.d.mts} +73 -53
- package/{zmscore-BVyzI3wx.d.ts → zmscore-DQw_6S0p.d.ts} +73 -53
|
@@ -326,7 +326,7 @@ type TextField = {
|
|
|
326
326
|
};
|
|
327
327
|
type NumericField = {
|
|
328
328
|
type: "U64" | "I64" | "F64";
|
|
329
|
-
fast
|
|
329
|
+
fast: true;
|
|
330
330
|
};
|
|
331
331
|
type BoolField = {
|
|
332
332
|
type: "BOOL";
|
|
@@ -356,47 +356,61 @@ type InferSchemaData<TSchema> = {
|
|
|
356
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
357
|
};
|
|
358
358
|
type QueryOptions<TSchema extends NestedIndexSchema | FlatIndexSchema> = {
|
|
359
|
+
filter: QueryFilter<TSchema>;
|
|
359
360
|
/** Maximum number of results to return */
|
|
360
361
|
limit?: number;
|
|
361
362
|
/** Number of results to skip */
|
|
362
363
|
offset?: number;
|
|
363
364
|
/** Sort by field (requires FAST option on field) */
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
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
|
+
}>;
|
|
372
373
|
highlight?: {
|
|
373
374
|
fields: SchemaPaths<TSchema>[];
|
|
374
375
|
preTag?: string;
|
|
375
376
|
postTag?: string;
|
|
376
377
|
};
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
[K in
|
|
384
|
-
} :
|
|
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;
|
|
385
401
|
type QueryResult<TSchema extends NestedIndexSchema | FlatIndexSchema, TOptions extends QueryOptions<TSchema> | undefined = undefined> = TOptions extends {
|
|
386
|
-
|
|
387
|
-
} ? {
|
|
402
|
+
select: infer TFields;
|
|
403
|
+
} ? {} extends TFields ? {
|
|
388
404
|
key: string;
|
|
389
405
|
score: string;
|
|
390
|
-
} :
|
|
391
|
-
returnFields: infer TFields extends readonly string[];
|
|
392
|
-
} ? {
|
|
406
|
+
} : {
|
|
393
407
|
key: string;
|
|
394
408
|
score: string;
|
|
395
|
-
|
|
409
|
+
data: BuildNestedResult<TSchema, TFields>;
|
|
396
410
|
} : {
|
|
397
411
|
key: string;
|
|
398
412
|
score: string;
|
|
399
|
-
|
|
413
|
+
data: InferSchemaData<TSchema>;
|
|
400
414
|
};
|
|
401
415
|
type StringOperationMap<T extends string> = {
|
|
402
416
|
$eq: T;
|
|
@@ -472,25 +486,25 @@ type QueryFilter<TSchema extends NestedIndexSchema | FlatIndexSchema> = QueryLea
|
|
|
472
486
|
value: number;
|
|
473
487
|
};
|
|
474
488
|
};
|
|
475
|
-
type
|
|
476
|
-
type
|
|
477
|
-
|
|
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;
|
|
478
497
|
dataType: "hash" | "string";
|
|
479
498
|
prefixes: string[];
|
|
480
|
-
language?:
|
|
481
|
-
|
|
482
|
-
name: string;
|
|
483
|
-
type: FieldType;
|
|
484
|
-
noTokenize?: boolean;
|
|
485
|
-
noStem?: boolean;
|
|
486
|
-
fast?: boolean;
|
|
487
|
-
}>;
|
|
499
|
+
language?: Language;
|
|
500
|
+
schema: Record<SchemaPaths<TSchema>, DescribeFieldInfo>;
|
|
488
501
|
};
|
|
502
|
+
type Language = "english" | "arabic" | "danish" | "dutch" | "finnish" | "french" | "german" | "greek" | "hungarian" | "italian" | "norwegian" | "portuguese" | "romanian" | "russian" | "spanish" | "swedish" | "tamil" | "turkish";
|
|
489
503
|
|
|
490
|
-
type
|
|
491
|
-
|
|
504
|
+
type createIndexProps<TSchema extends NestedIndexSchema | FlatIndexSchema> = {
|
|
505
|
+
name: string;
|
|
492
506
|
prefix: string | string[];
|
|
493
|
-
language?:
|
|
507
|
+
language?: Language;
|
|
494
508
|
client: Requester;
|
|
495
509
|
} & ({
|
|
496
510
|
dataType: "string";
|
|
@@ -499,22 +513,26 @@ type CreateSearchIndexProps<TSchema extends NestedIndexSchema | FlatIndexSchema>
|
|
|
499
513
|
dataType: "hash";
|
|
500
514
|
schema: TSchema extends FlatIndexSchema ? TSchema : never;
|
|
501
515
|
});
|
|
502
|
-
type SearchIndexProps<TSchema extends NestedIndexSchema | FlatIndexSchema> = Pick<
|
|
503
|
-
schema?:
|
|
516
|
+
type SearchIndexProps<TSchema extends NestedIndexSchema | FlatIndexSchema> = Pick<createIndexProps<TSchema>, "name" | "client"> & {
|
|
517
|
+
schema?: createIndexProps<TSchema>["schema"];
|
|
504
518
|
};
|
|
505
|
-
declare class SearchIndex<TSchema extends NestedIndexSchema | FlatIndexSchema
|
|
506
|
-
|
|
507
|
-
schema?: TSchema;
|
|
508
|
-
client
|
|
509
|
-
constructor({
|
|
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>);
|
|
510
524
|
waitIndexing(): Promise<string>;
|
|
511
|
-
describe(): Promise<IndexDescription
|
|
512
|
-
query<TOptions extends QueryOptions<TSchema>>(
|
|
513
|
-
count(filter
|
|
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
|
+
}>;
|
|
514
532
|
drop(): Promise<string>;
|
|
515
533
|
}
|
|
516
|
-
declare function
|
|
517
|
-
declare function
|
|
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>;
|
|
518
536
|
|
|
519
537
|
/**
|
|
520
538
|
* @see https://redis.io/commands/append
|
|
@@ -3353,8 +3371,10 @@ declare class Redis {
|
|
|
3353
3371
|
createScript<TResult = unknown, TReadonly extends boolean = false>(script: string, opts?: {
|
|
3354
3372
|
readonly?: TReadonly;
|
|
3355
3373
|
}): TReadonly extends true ? ScriptRO<TResult> : Script<TResult>;
|
|
3356
|
-
|
|
3357
|
-
|
|
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
|
+
};
|
|
3358
3378
|
/**
|
|
3359
3379
|
* Create a new pipeline that allows you to send requests in bulk.
|
|
3360
3380
|
*
|
|
@@ -4260,4 +4280,4 @@ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] |
|
|
|
4260
4280
|
constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
|
|
4261
4281
|
}
|
|
4262
4282
|
|
|
4263
|
-
export {
|
|
4283
|
+
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 };
|
|
@@ -326,7 +326,7 @@ type TextField = {
|
|
|
326
326
|
};
|
|
327
327
|
type NumericField = {
|
|
328
328
|
type: "U64" | "I64" | "F64";
|
|
329
|
-
fast
|
|
329
|
+
fast: true;
|
|
330
330
|
};
|
|
331
331
|
type BoolField = {
|
|
332
332
|
type: "BOOL";
|
|
@@ -356,47 +356,61 @@ type InferSchemaData<TSchema> = {
|
|
|
356
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
357
|
};
|
|
358
358
|
type QueryOptions<TSchema extends NestedIndexSchema | FlatIndexSchema> = {
|
|
359
|
+
filter: QueryFilter<TSchema>;
|
|
359
360
|
/** Maximum number of results to return */
|
|
360
361
|
limit?: number;
|
|
361
362
|
/** Number of results to skip */
|
|
362
363
|
offset?: number;
|
|
363
364
|
/** Sort by field (requires FAST option on field) */
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
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
|
+
}>;
|
|
372
373
|
highlight?: {
|
|
373
374
|
fields: SchemaPaths<TSchema>[];
|
|
374
375
|
preTag?: string;
|
|
375
376
|
postTag?: string;
|
|
376
377
|
};
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
[K in
|
|
384
|
-
} :
|
|
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;
|
|
385
401
|
type QueryResult<TSchema extends NestedIndexSchema | FlatIndexSchema, TOptions extends QueryOptions<TSchema> | undefined = undefined> = TOptions extends {
|
|
386
|
-
|
|
387
|
-
} ? {
|
|
402
|
+
select: infer TFields;
|
|
403
|
+
} ? {} extends TFields ? {
|
|
388
404
|
key: string;
|
|
389
405
|
score: string;
|
|
390
|
-
} :
|
|
391
|
-
returnFields: infer TFields extends readonly string[];
|
|
392
|
-
} ? {
|
|
406
|
+
} : {
|
|
393
407
|
key: string;
|
|
394
408
|
score: string;
|
|
395
|
-
|
|
409
|
+
data: BuildNestedResult<TSchema, TFields>;
|
|
396
410
|
} : {
|
|
397
411
|
key: string;
|
|
398
412
|
score: string;
|
|
399
|
-
|
|
413
|
+
data: InferSchemaData<TSchema>;
|
|
400
414
|
};
|
|
401
415
|
type StringOperationMap<T extends string> = {
|
|
402
416
|
$eq: T;
|
|
@@ -472,25 +486,25 @@ type QueryFilter<TSchema extends NestedIndexSchema | FlatIndexSchema> = QueryLea
|
|
|
472
486
|
value: number;
|
|
473
487
|
};
|
|
474
488
|
};
|
|
475
|
-
type
|
|
476
|
-
type
|
|
477
|
-
|
|
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;
|
|
478
497
|
dataType: "hash" | "string";
|
|
479
498
|
prefixes: string[];
|
|
480
|
-
language?:
|
|
481
|
-
|
|
482
|
-
name: string;
|
|
483
|
-
type: FieldType;
|
|
484
|
-
noTokenize?: boolean;
|
|
485
|
-
noStem?: boolean;
|
|
486
|
-
fast?: boolean;
|
|
487
|
-
}>;
|
|
499
|
+
language?: Language;
|
|
500
|
+
schema: Record<SchemaPaths<TSchema>, DescribeFieldInfo>;
|
|
488
501
|
};
|
|
502
|
+
type Language = "english" | "arabic" | "danish" | "dutch" | "finnish" | "french" | "german" | "greek" | "hungarian" | "italian" | "norwegian" | "portuguese" | "romanian" | "russian" | "spanish" | "swedish" | "tamil" | "turkish";
|
|
489
503
|
|
|
490
|
-
type
|
|
491
|
-
|
|
504
|
+
type createIndexProps<TSchema extends NestedIndexSchema | FlatIndexSchema> = {
|
|
505
|
+
name: string;
|
|
492
506
|
prefix: string | string[];
|
|
493
|
-
language?:
|
|
507
|
+
language?: Language;
|
|
494
508
|
client: Requester;
|
|
495
509
|
} & ({
|
|
496
510
|
dataType: "string";
|
|
@@ -499,22 +513,26 @@ type CreateSearchIndexProps<TSchema extends NestedIndexSchema | FlatIndexSchema>
|
|
|
499
513
|
dataType: "hash";
|
|
500
514
|
schema: TSchema extends FlatIndexSchema ? TSchema : never;
|
|
501
515
|
});
|
|
502
|
-
type SearchIndexProps<TSchema extends NestedIndexSchema | FlatIndexSchema> = Pick<
|
|
503
|
-
schema?:
|
|
516
|
+
type SearchIndexProps<TSchema extends NestedIndexSchema | FlatIndexSchema> = Pick<createIndexProps<TSchema>, "name" | "client"> & {
|
|
517
|
+
schema?: createIndexProps<TSchema>["schema"];
|
|
504
518
|
};
|
|
505
|
-
declare class SearchIndex<TSchema extends NestedIndexSchema | FlatIndexSchema
|
|
506
|
-
|
|
507
|
-
schema?: TSchema;
|
|
508
|
-
client
|
|
509
|
-
constructor({
|
|
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>);
|
|
510
524
|
waitIndexing(): Promise<string>;
|
|
511
|
-
describe(): Promise<IndexDescription
|
|
512
|
-
query<TOptions extends QueryOptions<TSchema>>(
|
|
513
|
-
count(filter
|
|
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
|
+
}>;
|
|
514
532
|
drop(): Promise<string>;
|
|
515
533
|
}
|
|
516
|
-
declare function
|
|
517
|
-
declare function
|
|
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>;
|
|
518
536
|
|
|
519
537
|
/**
|
|
520
538
|
* @see https://redis.io/commands/append
|
|
@@ -3353,8 +3371,10 @@ declare class Redis {
|
|
|
3353
3371
|
createScript<TResult = unknown, TReadonly extends boolean = false>(script: string, opts?: {
|
|
3354
3372
|
readonly?: TReadonly;
|
|
3355
3373
|
}): TReadonly extends true ? ScriptRO<TResult> : Script<TResult>;
|
|
3356
|
-
|
|
3357
|
-
|
|
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
|
+
};
|
|
3358
3378
|
/**
|
|
3359
3379
|
* Create a new pipeline that allows you to send requests in bulk.
|
|
3360
3380
|
*
|
|
@@ -4260,4 +4280,4 @@ declare class ZMScoreCommand<TData> extends Command<string[] | null, number[] |
|
|
|
4260
4280
|
constructor(cmd: [key: string, members: TData[]], opts?: CommandOptions<string[] | null, number[] | null>);
|
|
4261
4281
|
}
|
|
4262
4282
|
|
|
4263
|
-
export {
|
|
4283
|
+
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 };
|