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