Skip to content

Commit e265c52

Browse files
authored
export RediSearchSchema type (#1825)
* export RediSearchSchema type * export SearchOptions and SearchReply
1 parent 10da371 commit e265c52

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Diff for: packages/search/lib/commands/ALTER.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { CreateSchema, pushSchema } from '.';
1+
import { RediSearchSchema, pushSchema } from '.';
22

3-
export function transformArguments(index: string, schema: CreateSchema): Array<string> {
3+
export function transformArguments(index: string, schema: RediSearchSchema): Array<string> {
44
const args = ['FT.ALTER', index, 'SCHEMA', 'ADD'];
55
pushSchema(args, schema);
66

Diff for: packages/search/lib/commands/CREATE.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { pushOptionalVerdictArgument } from '@node-redis/client/dist/lib/commands/generic-transformers';
2-
import { RedisSearchLanguages, PropertyName, CreateSchema, pushSchema } from '.';
2+
import { RedisSearchLanguages, PropertyName, RediSearchSchema, pushSchema } from '.';
33

44
interface CreateOptions {
55
ON?: 'HASH' | 'JSON';
@@ -20,7 +20,7 @@ interface CreateOptions {
2020
STOPWORDS?: string | Array<string>;
2121
}
2222

23-
export function transformArguments(index: string, schema: CreateSchema, options?: CreateOptions): Array<string> {
23+
export function transformArguments(index: string, schema: RediSearchSchema, options?: CreateOptions): Array<string> {
2424
const args = ['FT.CREATE', index];
2525

2626
if (options?.ON) {

Diff for: packages/search/lib/commands/index.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,15 @@ type CreateSchemaTagField = CreateSchemaField<SchemaFieldTypes.TAG, {
204204
CASESENSITIVE?: true;
205205
}>;
206206

207-
export interface CreateSchema {
207+
export interface RediSearchSchema {
208208
[field: string]:
209209
CreateSchemaTextField |
210210
CreateSchemaNumericField |
211211
CreateSchemaGeoField |
212212
CreateSchemaTagField
213213
}
214214

215-
export function pushSchema(args: RedisCommandArguments, schema: CreateSchema) {
215+
export function pushSchema(args: RedisCommandArguments, schema: RediSearchSchema) {
216216
for (const [field, fieldOptions] of Object.entries(schema)) {
217217
args.push(field);
218218

@@ -396,7 +396,6 @@ export interface SearchReply {
396396
}>;
397397
}
398398

399-
400399
export interface ProfileOptions {
401400
LIMITED?: true;
402401
}

Diff for: packages/search/lib/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export { default } from './commands';
22

3-
export { SchemaFieldTypes, SchemaTextFieldPhonetics } from './commands';
3+
export { RediSearchSchema, SchemaFieldTypes, SchemaTextFieldPhonetics, SearchReply } from './commands';
44
export { AggregateSteps, AggregateGroupByReducers } from './commands/AGGREGATE';
5+
export { SearchOptions } from './commands/SEARCH';

0 commit comments

Comments
 (0)