@@ -43,17 +43,29 @@ import { TaskClient } from './task'
4343class Index < T = Record < string , any > > {
4444 uid : string
4545 primaryKey : string | undefined
46+ updatedAt : Date | undefined
47+ createdAt : Date | undefined
4648 httpRequest : HttpRequests
4749 tasks : TaskClient
4850
4951 /**
5052 * @param {Config } config Request configuration options
5153 * @param {string } uid UID of the index
52- * @param {string } primaryKey? Primary Key of the index
54+ * @param {string } [primaryKey] Primary Key of the index
55+ * @param {Date } [createdAt] Creation date of the index
56+ * @param {Date } [updatedAt] Last update date of the index
5357 */
54- constructor ( config : Config , uid : string , primaryKey ?: string ) {
58+ constructor (
59+ config : Config ,
60+ uid : string ,
61+ primaryKey ?: string ,
62+ updatedAt ?: Date ,
63+ createdAt ?: Date
64+ ) {
5565 this . uid = uid
5666 this . primaryKey = primaryKey
67+ this . updatedAt = updatedAt
68+ this . createdAt = createdAt
5769 this . httpRequest = new HttpRequests ( config )
5870 this . tasks = new TaskClient ( config )
5971 }
@@ -145,6 +157,8 @@ class Index<T = Record<string, any>> {
145157 const url = `indexes/${ this . uid } `
146158 const res = await this . httpRequest . get < IndexResponse > ( url )
147159 this . primaryKey = res . primaryKey
160+ this . updatedAt = res . updatedAt
161+ this . createdAt = res . createdAt
148162 return res
149163 }
150164
0 commit comments