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(ts): correct type for listIndices response #1236

Merged
merged 1 commit into from
Dec 3, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions packages/client-search/src/types/Indice.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
export type Indice = {
export type Index = {
/**
* Index name.
*/
readonly name: string;

/**
* Index creation date.
* Index creation date. (ISO-8601 format)
*/
readonly createdAt: number;
readonly createdAt: string;

/**
* Date of last update.
* Date of last update. (ISO-8601 format)
*/
readonly updatedAt: number;
readonly updatedAt: string;

/**
* Number of records contained in the index
Expand All @@ -32,7 +32,7 @@ export type Indice = {
/**
* Last build time in seconds.
*/
readonly lastBuildTimes: number;
readonly lastBuildTimeS: number;

/**
* Number of pending indexing operations.
Expand All @@ -43,4 +43,21 @@ export type Indice = {
* A boolean which says whether the index has pending tasks.
*/
readonly pendingTask: boolean;

/**
* Only present if the index is a replica.
* Contains the name of the related primary index.
*/
readonly primary?: string;

/**
* Only present if the index is a primary index with replicas.
* Contains the names of all linked replicas.
*/
readonly replicas?: readonly string[];
};

/**
* @deprecated please use `Index` instead of `Indice`
*/
export type Indice = Index;
4 changes: 2 additions & 2 deletions packages/client-search/src/types/ListIndicesResponse.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Indice } from '.';
import { Index } from '.';

export type ListIndicesResponse = {
/**
Expand All @@ -9,5 +9,5 @@ export type ListIndicesResponse = {
/**
* List of index response
*/
items: Indice[];
items: Index[];
};