Skip to content

Commit 0bb6bba

Browse files
authored
fix(ts): correct type for listIndices response (#1236)
1 parent cd9c879 commit 0bb6bba

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

packages/client-search/src/types/Indice.ts

+23-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
export type Indice = {
1+
export type Index = {
22
/**
33
* Index name.
44
*/
55
readonly name: string;
66

77
/**
8-
* Index creation date.
8+
* Index creation date. (ISO-8601 format)
99
*/
10-
readonly createdAt: number;
10+
readonly createdAt: string;
1111

1212
/**
13-
* Date of last update.
13+
* Date of last update. (ISO-8601 format)
1414
*/
15-
readonly updatedAt: number;
15+
readonly updatedAt: string;
1616

1717
/**
1818
* Number of records contained in the index
@@ -32,7 +32,7 @@ export type Indice = {
3232
/**
3333
* Last build time in seconds.
3434
*/
35-
readonly lastBuildTimes: number;
35+
readonly lastBuildTimeS: number;
3636

3737
/**
3838
* Number of pending indexing operations.
@@ -43,4 +43,21 @@ export type Indice = {
4343
* A boolean which says whether the index has pending tasks.
4444
*/
4545
readonly pendingTask: boolean;
46+
47+
/**
48+
* Only present if the index is a replica.
49+
* Contains the name of the related primary index.
50+
*/
51+
readonly primary?: string;
52+
53+
/**
54+
* Only present if the index is a primary index with replicas.
55+
* Contains the names of all linked replicas.
56+
*/
57+
readonly replicas?: readonly string[];
4658
};
59+
60+
/**
61+
* @deprecated please use `Index` instead of `Indice`
62+
*/
63+
export type Indice = Index;

packages/client-search/src/types/ListIndicesResponse.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Indice } from '.';
1+
import { Index } from '.';
22

33
export type ListIndicesResponse = {
44
/**
@@ -9,5 +9,5 @@ export type ListIndicesResponse = {
99
/**
1010
* List of index response
1111
*/
12-
items: Indice[];
12+
items: Index[];
1313
};

0 commit comments

Comments
 (0)