Skip to content

Commit d4b02b0

Browse files
committed
Fix for the redirect object in SearchResponse
1 parent db3b266 commit d4b02b0

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
export type RedirectRuleIndexMetadata = {
2+
/**
3+
* Source index for the redirect rule
4+
*/
5+
readonly source: string;
6+
7+
/**
8+
* Destination index for the redirect rule
9+
*/
10+
readonly dest: string;
11+
12+
/**
13+
* Reason for the redirect rule
14+
*/
15+
readonly reason: string;
16+
17+
/**
18+
* Status for the redirect rule
19+
*/
20+
readonly succeed: boolean;
21+
22+
/**
23+
* Data for the redirect rule
24+
*/
25+
readonly data: {
26+
/**
27+
* Rule objectId
28+
*/
29+
readonly ruleObjectID: string;
30+
};
31+
};

packages/client-search/src/types/SearchResponse.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Hit, Settings } from '.';
2+
import { RedirectRuleIndexMetadata } from './RedirectRuleIndexMetadata';
23

34
export type SearchResponse<TObject = {}> = {
45
/**
@@ -224,6 +225,10 @@ export type SearchResponse<TObject = {}> = {
224225
* as a JSON object with one field per parameter.
225226
*/
226227
params?: Record<string, any>;
228+
229+
redirect?: {
230+
index?: RedirectRuleIndexMetadata[];
231+
};
227232
};
228233

229234
/**

packages/client-search/src/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export * from './MultipleQueriesResponse';
6363
export * from './ObjectWithObjectID';
6464
export * from './PartialUpdateObjectResponse';
6565
export * from './PartialUpdateObjectsOptions';
66+
export * from './RedirectRuleIndexMetadata';
6667
export * from './RemoveUserIDResponse';
6768
export * from './ReplaceAllObjectsOptions';
6869
export * from './RequireAtLeastOne';

0 commit comments

Comments
 (0)