Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for the redirect object in SearchResponse #1443

Merged
merged 1 commit into from Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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?: {
shortcuts marked this conversation as resolved.
Show resolved Hide resolved
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