Skip to content

Commit

Permalink
fix(ts): correct type for listIndices response (#1236)
Browse files Browse the repository at this point in the history
  • Loading branch information
Haroenv committed Dec 3, 2020
1 parent cd9c879 commit 0bb6bba
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
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[];
};

0 comments on commit 0bb6bba

Please sign in to comment.