Navigation Menu

Skip to content

Commit

Permalink
Fix for the redirect object in SearchResponse (#1443)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfaiqh committed Mar 21, 2023
1 parent db3b266 commit 6b0685c
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
31 changes: 31 additions & 0 deletions packages/client-search/src/types/RedirectRuleIndexMetadata.ts
@@ -0,0 +1,31 @@
export type RedirectRuleIndexMetadata = {
/**
* Source index for the redirect rule
*/
readonly source: string;

/**
* Destination index for the redirect rule
*/
readonly dest: string;

/**
* Reason for the redirect rule
*/
readonly reason: string;

/**
* Status for the redirect rule
*/
readonly succeed: boolean;

/**
* Data for the redirect rule
*/
readonly data: {
/**
* Rule objectId
*/
readonly ruleObjectID: string;
};
};
8 changes: 8 additions & 0 deletions packages/client-search/src/types/SearchResponse.ts
@@ -1,4 +1,5 @@
import { Hit, Settings } from '.';
import { RedirectRuleIndexMetadata } from './RedirectRuleIndexMetadata';

export type SearchResponse<TObject = {}> = {
/**
Expand Down Expand Up @@ -224,6 +225,13 @@ export type SearchResponse<TObject = {}> = {
* as a JSON object with one field per parameter.
*/
params?: Record<string, any>;

/**
* This parameter is for internal use only.
*/
redirect?: {
index?: RedirectRuleIndexMetadata[];
};
};

/**
Expand Down
1 change: 1 addition & 0 deletions packages/client-search/src/types/index.ts
Expand Up @@ -63,6 +63,7 @@ export * from './MultipleQueriesResponse';
export * from './ObjectWithObjectID';
export * from './PartialUpdateObjectResponse';
export * from './PartialUpdateObjectsOptions';
export * from './RedirectRuleIndexMetadata';
export * from './RemoveUserIDResponse';
export * from './ReplaceAllObjectsOptions';
export * from './RequireAtLeastOne';
Expand Down

0 comments on commit 6b0685c

Please sign in to comment.