From 0bb6bbadbd284e4f74241fe3f4c2ffe28c7724ec Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Thu, 3 Dec 2020 10:45:51 +0100 Subject: [PATCH] fix(ts): correct type for listIndices response (#1236) --- packages/client-search/src/types/Indice.ts | 29 +++++++++++++++---- .../src/types/ListIndicesResponse.ts | 4 +-- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/packages/client-search/src/types/Indice.ts b/packages/client-search/src/types/Indice.ts index c2eb1e619..203e7cc37 100644 --- a/packages/client-search/src/types/Indice.ts +++ b/packages/client-search/src/types/Indice.ts @@ -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 @@ -32,7 +32,7 @@ export type Indice = { /** * Last build time in seconds. */ - readonly lastBuildTimes: number; + readonly lastBuildTimeS: number; /** * Number of pending indexing operations. @@ -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; diff --git a/packages/client-search/src/types/ListIndicesResponse.ts b/packages/client-search/src/types/ListIndicesResponse.ts index 0a4653a4d..951a3c9f8 100644 --- a/packages/client-search/src/types/ListIndicesResponse.ts +++ b/packages/client-search/src/types/ListIndicesResponse.ts @@ -1,4 +1,4 @@ -import { Indice } from '.'; +import { Index } from '.'; export type ListIndicesResponse = { /** @@ -9,5 +9,5 @@ export type ListIndicesResponse = { /** * List of index response */ - items: Indice[]; + items: Index[]; };