From 33e0873ecf44878acc8842ca8a94c953d2a63f79 Mon Sep 17 00:00:00 2001 From: delvedor Date: Mon, 23 May 2022 16:33:56 +0200 Subject: [PATCH] API generation --- docs/reference.asciidoc | 22 +- src/api/api/_internal.ts | 14 +- src/api/api/async_search.ts | 16 +- src/api/api/cat.ts | 9 +- src/api/api/enrich.ts | 2 +- src/api/api/indices.ts | 26 +- src/api/api/ml.ts | 12 +- src/api/api/security.ts | 109 +++++--- src/api/api/shutdown.ts | 16 +- src/api/types.ts | 504 +++++++++++++++++++++++++++------- src/api/typesWithBodyKey.ts | 519 +++++++++++++++++++++++++++++------- 11 files changed, 970 insertions(+), 279 deletions(-) diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index bef00bbe8..2fd0eda62 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -2384,6 +2384,8 @@ client.ml.getJobs(...) [discrete] ==== get_memory_stats Returns information on how ML is using memory. + +https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-memory.html[Endpoint documentation] [source,ts] ---- client.ml.getMemoryStats(...) @@ -2450,13 +2452,13 @@ client.ml.getTrainedModelsStats(...) ---- [discrete] -==== infer_trained_model_deployment +==== infer_trained_model Evaluate a trained model. -https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-trained-model-deployment.html[Endpoint documentation] +https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-trained-model.html[Endpoint documentation] [source,ts] ---- -client.ml.inferTrainedModelDeployment(...) +client.ml.inferTrainedModel(...) ---- [discrete] @@ -2980,6 +2982,8 @@ client.searchableSnapshots.stats(...) [discrete] ==== activate_user_profile Creates or updates the user profile on behalf of another user. + +https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-activate-user-profile.html[Endpoint documentation] [source,ts] ---- client.security.activateUserProfile(...) @@ -3288,6 +3292,8 @@ client.security.getUserPrivileges(...) [discrete] ==== get_user_profile Retrieves user profile for the given unique ID. + +https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-profile.html[Endpoint documentation] [source,ts] ---- client.security.getUserProfile(...) @@ -3474,18 +3480,20 @@ client.security.samlServiceProviderMetadata(...) ---- [discrete] -==== search_user_profiles -Searches for user profiles that match specified criteria. +==== suggest_user_profiles +Get suggestions for user profiles that match specified search criteria. -https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-search-user-profile.html[Endpoint documentation] +https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-suggest-user-profile.html[Endpoint documentation] [source,ts] ---- -client.security.searchUserProfiles(...) +client.security.suggestUserProfiles(...) ---- [discrete] ==== update_user_profile_data Update application specific data for the user profile of the given unique ID. + +https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html[Endpoint documentation] [source,ts] ---- client.security.updateUserProfileData(...) diff --git a/src/api/api/_internal.ts b/src/api/api/_internal.ts index cea5da529..581cde7af 100644 --- a/src/api/api/_internal.ts +++ b/src/api/api/_internal.ts @@ -104,8 +104,18 @@ export default class Internal { } } - const method = 'GET' - const path = '/_internal/_health' + let method = '' + let path = '' + if (params.component != null && params.feature != null) { + method = 'GET' + path = `/_internal/_health/${encodeURIComponent(params.component.toString())}/${encodeURIComponent(params.feature.toString())}` + } else if (params.component != null) { + method = 'GET' + path = `/_internal/_health/${encodeURIComponent(params.component.toString())}` + } else { + method = 'GET' + path = '/_internal/_health' + } return await this.transport.request({ path, method, querystring, body }, options) } diff --git a/src/api/api/async_search.ts b/src/api/api/async_search.ts index 3560f488d..57bbcfa42 100644 --- a/src/api/api/async_search.ts +++ b/src/api/api/async_search.ts @@ -65,10 +65,10 @@ export default class AsyncSearch { return await this.transport.request({ path, method, querystring, body }, options) } - async get (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise> - async get (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> - async get (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise> - async get (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise { + async get> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise> + async get> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> + async get> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise> + async get> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -109,10 +109,10 @@ export default class AsyncSearch { return await this.transport.request({ path, method, querystring, body }, options) } - async submit (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithOutMeta): Promise> - async submit (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> - async submit (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise> - async submit (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise { + async submit> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithOutMeta): Promise> + async submit> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> + async submit> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise> + async submit> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats'] const querystring: Record = {} diff --git a/src/api/api/cat.ts b/src/api/api/cat.ts index a4dea6a34..74e383095 100644 --- a/src/api/api/cat.ts +++ b/src/api/api/cat.ts @@ -103,10 +103,10 @@ export default class Cat { return await this.transport.request({ path, method, querystring, body }, options) } - async componentTemplates (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async componentTemplates (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async componentTemplates (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async componentTemplates (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptions): Promise + async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -116,6 +116,7 @@ export default class Cat { if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { + // @ts-expect-error querystring[key] = params[key] } } diff --git a/src/api/api/enrich.ts b/src/api/api/enrich.ts index 74909ed40..2ebc67be0 100644 --- a/src/api/api/enrich.ts +++ b/src/api/api/enrich.ts @@ -122,7 +122,7 @@ export default class Enrich { async putPolicy (this: That, params: T.EnrichPutPolicyRequest | TB.EnrichPutPolicyRequest, options?: TransportRequestOptions): Promise async putPolicy (this: That, params: T.EnrichPutPolicyRequest | TB.EnrichPutPolicyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] - const acceptedBody: string[] = ['geo_match', 'match'] + const acceptedBody: string[] = ['geo_match', 'match', 'range'] const querystring: Record = {} // @ts-expect-error const userBody: any = params?.body diff --git a/src/api/api/indices.ts b/src/api/api/indices.ts index 1fd863f40..cc8abbfa3 100644 --- a/src/api/api/indices.ts +++ b/src/api/api/indices.ts @@ -860,19 +860,31 @@ export default class Indices { return await this.transport.request({ path, method, querystring, body }, options) } - async modifyDataStream (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async modifyDataStream (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async modifyDataStream (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async modifyDataStream (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async modifyDataStream (this: That, params: T.IndicesModifyDataStreamRequest | TB.IndicesModifyDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async modifyDataStream (this: That, params: T.IndicesModifyDataStreamRequest | TB.IndicesModifyDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise> + async modifyDataStream (this: That, params: T.IndicesModifyDataStreamRequest | TB.IndicesModifyDataStreamRequest, options?: TransportRequestOptions): Promise + async modifyDataStream (this: That, params: T.IndicesModifyDataStreamRequest | TB.IndicesModifyDataStreamRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] + const acceptedBody: string[] = ['actions'] const querystring: Record = {} - const body = undefined + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } - params = params ?? {} for (const key in params) { - if (acceptedPath.includes(key)) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { + // @ts-expect-error querystring[key] = params[key] } } diff --git a/src/api/api/ml.ts b/src/api/api/ml.ts index 83e6932c8..b293853a7 100644 --- a/src/api/api/ml.ts +++ b/src/api/api/ml.ts @@ -1158,12 +1158,12 @@ export default class Ml { return await this.transport.request({ path, method, querystring, body }, options) } - async inferTrainedModelDeployment (this: That, params: T.MlInferTrainedModelDeploymentRequest | TB.MlInferTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async inferTrainedModelDeployment (this: That, params: T.MlInferTrainedModelDeploymentRequest | TB.MlInferTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithMeta): Promise> - async inferTrainedModelDeployment (this: That, params: T.MlInferTrainedModelDeploymentRequest | TB.MlInferTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise - async inferTrainedModelDeployment (this: That, params: T.MlInferTrainedModelDeploymentRequest | TB.MlInferTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise { + async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest | TB.MlInferTrainedModelRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest | TB.MlInferTrainedModelRequest, options?: TransportRequestOptionsWithMeta): Promise> + async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest | TB.MlInferTrainedModelRequest, options?: TransportRequestOptions): Promise + async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest | TB.MlInferTrainedModelRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_id'] - const acceptedBody: string[] = ['docs'] + const acceptedBody: string[] = ['docs', 'inference_config'] const querystring: Record = {} // @ts-expect-error const userBody: any = params?.body @@ -1188,7 +1188,7 @@ export default class Ml { } const method = 'POST' - const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/deployment/_infer` + const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/_infer` return await this.transport.request({ path, method, querystring, body }, options) } diff --git a/src/api/api/security.ts b/src/api/api/security.ts index d480295e3..fcde13c7a 100644 --- a/src/api/api/security.ts +++ b/src/api/api/security.ts @@ -43,19 +43,31 @@ export default class Security { this.transport = transport } - async activateUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async activateUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async activateUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async activateUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async activateUserProfile (this: That, params: T.SecurityActivateUserProfileRequest | TB.SecurityActivateUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async activateUserProfile (this: That, params: T.SecurityActivateUserProfileRequest | TB.SecurityActivateUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise> + async activateUserProfile (this: That, params: T.SecurityActivateUserProfileRequest | TB.SecurityActivateUserProfileRequest, options?: TransportRequestOptions): Promise + async activateUserProfile (this: That, params: T.SecurityActivateUserProfileRequest | TB.SecurityActivateUserProfileRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] + const acceptedBody: string[] = ['access_token', 'grant_type', 'password', 'username'] const querystring: Record = {} - const body = undefined + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } - params = params ?? {} for (const key in params) { - if (acceptedPath.includes(key)) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { + // @ts-expect-error querystring[key] = params[key] } } @@ -436,19 +448,19 @@ export default class Security { return await this.transport.request({ path, method, querystring, body }, options) } - async disableUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async disableUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async disableUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async disableUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async disableUserProfile (this: That, params: T.SecurityDisableUserProfileRequest | TB.SecurityDisableUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async disableUserProfile (this: That, params: T.SecurityDisableUserProfileRequest | TB.SecurityDisableUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise> + async disableUserProfile (this: That, params: T.SecurityDisableUserProfileRequest | TB.SecurityDisableUserProfileRequest, options?: TransportRequestOptions): Promise + async disableUserProfile (this: That, params: T.SecurityDisableUserProfileRequest | TB.SecurityDisableUserProfileRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['uid'] const querystring: Record = {} const body = undefined - params = params ?? {} for (const key in params) { if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { + // @ts-expect-error querystring[key] = params[key] } } @@ -480,19 +492,19 @@ export default class Security { return await this.transport.request({ path, method, querystring, body }, options) } - async enableUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async enableUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async enableUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async enableUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async enableUserProfile (this: That, params: T.SecurityEnableUserProfileRequest | TB.SecurityEnableUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async enableUserProfile (this: That, params: T.SecurityEnableUserProfileRequest | TB.SecurityEnableUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise> + async enableUserProfile (this: That, params: T.SecurityEnableUserProfileRequest | TB.SecurityEnableUserProfileRequest, options?: TransportRequestOptions): Promise + async enableUserProfile (this: That, params: T.SecurityEnableUserProfileRequest | TB.SecurityEnableUserProfileRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['uid'] const querystring: Record = {} const body = undefined - params = params ?? {} for (const key in params) { if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { + // @ts-expect-error querystring[key] = params[key] } } @@ -830,19 +842,19 @@ export default class Security { return await this.transport.request({ path, method, querystring, body }, options) } - async getUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async getUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async getUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async getUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest | TB.SecurityGetUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest | TB.SecurityGetUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest | TB.SecurityGetUserProfileRequest, options?: TransportRequestOptions): Promise + async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest | TB.SecurityGetUserProfileRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['uid'] const querystring: Record = {} const body = undefined - params = params ?? {} for (const key in params) { if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { + // @ts-expect-error querystring[key] = params[key] } } @@ -1421,41 +1433,66 @@ export default class Security { return await this.transport.request({ path, method, querystring, body }, options) } - async searchUserProfiles (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async searchUserProfiles (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async searchUserProfiles (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async searchUserProfiles (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async suggestUserProfiles (this: That, params?: T.SecuritySuggestUserProfilesRequest | TB.SecuritySuggestUserProfilesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async suggestUserProfiles (this: That, params?: T.SecuritySuggestUserProfilesRequest | TB.SecuritySuggestUserProfilesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async suggestUserProfiles (this: That, params?: T.SecuritySuggestUserProfilesRequest | TB.SecuritySuggestUserProfilesRequest, options?: TransportRequestOptions): Promise + async suggestUserProfiles (this: That, params?: T.SecuritySuggestUserProfilesRequest | TB.SecuritySuggestUserProfilesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] + const acceptedBody: string[] = ['name', 'size'] const querystring: Record = {} - const body = undefined + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } params = params ?? {} for (const key in params) { - if (acceptedPath.includes(key)) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { + // @ts-expect-error querystring[key] = params[key] } } const method = body != null ? 'POST' : 'GET' - const path = '/_security/profile/_search' + const path = '/_security/profile/_suggest' return await this.transport.request({ path, method, querystring, body }, options) } - async updateUserProfileData (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async updateUserProfileData (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async updateUserProfileData (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async updateUserProfileData (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async updateUserProfileData (this: That, params: T.SecurityUpdateUserProfileDataRequest | TB.SecurityUpdateUserProfileDataRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateUserProfileData (this: That, params: T.SecurityUpdateUserProfileDataRequest | TB.SecurityUpdateUserProfileDataRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateUserProfileData (this: That, params: T.SecurityUpdateUserProfileDataRequest | TB.SecurityUpdateUserProfileDataRequest, options?: TransportRequestOptions): Promise + async updateUserProfileData (this: That, params: T.SecurityUpdateUserProfileDataRequest | TB.SecurityUpdateUserProfileDataRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['uid'] + const acceptedBody: string[] = ['access', 'data'] const querystring: Record = {} - const body = undefined + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } - params = params ?? {} for (const key in params) { - if (acceptedPath.includes(key)) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { + // @ts-expect-error querystring[key] = params[key] } } diff --git a/src/api/api/shutdown.ts b/src/api/api/shutdown.ts index 9ee79c1d1..c995623c7 100644 --- a/src/api/api/shutdown.ts +++ b/src/api/api/shutdown.ts @@ -100,11 +100,23 @@ export default class Shutdown { async putNode (this: That, params: T.ShutdownPutNodeRequest | TB.ShutdownPutNodeRequest, options?: TransportRequestOptions): Promise async putNode (this: That, params: T.ShutdownPutNodeRequest | TB.ShutdownPutNodeRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['node_id'] + const acceptedBody: string[] = ['type', 'reason', 'allocation_delay', 'target_node_name'] const querystring: Record = {} - const body = undefined + // @ts-expect-error + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } for (const key in params) { - if (acceptedPath.includes(key)) { + if (acceptedBody.includes(key)) { + body = body ?? {} + // @ts-expect-error + body[key] = params[key] + } else if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { // @ts-expect-error diff --git a/src/api/types.ts b/src/api/types.ts index dcbfe4a37..b4cbb39a7 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -241,7 +241,7 @@ export interface DeleteByQueryRethrottleRequest extends RequestBase { requests_per_second?: long } -export type DeleteByQueryRethrottleResponse = TasksListResponse +export type DeleteByQueryRethrottleResponse = TasksTaskListResponseBase export interface DeleteScriptRequest extends RequestBase { id: Id @@ -556,10 +556,21 @@ export interface MsearchMultisearchBody { aggregations?: Record aggs?: Record query?: QueryDslQueryContainer + explain?: boolean + stored_fields?: Fields + docvalue_fields?: (QueryDslFieldAndFormat | Field)[] from?: integer size?: integer - pit?: SearchPointInTimeReference + sort?: Sort + _source?: SearchSourceConfig + terminate_after?: long + stats?: string[] + timeout?: string + track_scores?: boolean track_total_hits?: SearchTrackHits + version?: boolean + seq_no_primary_term?: boolean + pit?: SearchPointInTimeReference suggest?: SearchSuggester } @@ -572,6 +583,9 @@ export interface MsearchMultisearchHeader { request_cache?: boolean routing?: string search_type?: SearchType + ccs_minimize_roundtrips?: boolean + allow_partial_search_results?: boolean + ignore_throttled?: boolean } export interface MsearchRequest extends RequestBase { @@ -1088,12 +1102,13 @@ export interface SearchCompletionSuggestOption { collate_match?: boolean contexts?: Record fields?: Record - _id: string - _index: IndexName + _id?: string + _index?: IndexName _routing?: Routing _score?: double _source?: TDocument text: string + score?: double } export interface SearchCompletionSuggester extends SearchSuggesterBase { @@ -1153,9 +1168,9 @@ export interface SearchFieldCollapse { export interface SearchFieldSuggester { completion?: SearchCompletionSuggester phrase?: SearchPhraseSuggester + term?: SearchTermSuggester prefix?: string regex?: string - term?: SearchTermSuggester text?: string } @@ -2516,6 +2531,7 @@ export interface AggregationsAggregationContainer { geohash_grid?: AggregationsGeoHashGridAggregation geo_line?: AggregationsGeoLineAggregation geotile_grid?: AggregationsGeoTileGridAggregation + geohex_grid?: AggregationsGeohexGridAggregation global?: AggregationsGlobalAggregation histogram?: AggregationsHistogramAggregation ip_range?: AggregationsIpRangeAggregation @@ -2713,14 +2729,6 @@ export interface AggregationsChildrenAggregation extends AggregationsBucketAggre type?: RelationName } -export interface AggregationsClassificationInferenceOptions { - num_top_classes?: integer - num_top_feature_importance_values?: integer - prediction_field_type?: string - results_field?: string - top_classes_results_field?: string -} - export interface AggregationsCompositeAggregate extends AggregationsMultiBucketAggregateBase { after_key?: Record } @@ -2989,6 +2997,14 @@ export interface AggregationsGeoTileGridBucketKeys extends AggregationsMultiBuck export type AggregationsGeoTileGridBucket = AggregationsGeoTileGridBucketKeys & { [property: string]: AggregationsAggregate | GeoTile | long } +export interface AggregationsGeohexGridAggregation extends AggregationsBucketAggregationBase { + field: Field + precision?: integer + bounds?: GeoBounds + size?: integer + shard_size?: integer +} + export interface AggregationsGlobalAggregateKeys extends AggregationsSingleBucketAggregateBase { } export type AggregationsGlobalAggregate = AggregationsGlobalAggregateKeys @@ -3086,8 +3102,8 @@ export interface AggregationsInferenceClassImportance { } export interface AggregationsInferenceConfigContainer { - regression?: AggregationsRegressionInferenceOptions - classification?: AggregationsClassificationInferenceOptions + regression?: MlRegressionInferenceOptions + classification?: MlClassificationInferenceOptions } export interface AggregationsInferenceFeatureImportance { @@ -3377,11 +3393,6 @@ export interface AggregationsRateAggregation extends AggregationsFormatMetricAgg export type AggregationsRateMode = 'sum' | 'value_count' -export interface AggregationsRegressionInferenceOptions { - results_field?: Field - num_top_feature_importance_values?: integer -} - export interface AggregationsReverseNestedAggregateKeys extends AggregationsSingleBucketAggregateBase { } export type AggregationsReverseNestedAggregate = AggregationsReverseNestedAggregateKeys @@ -3448,7 +3459,8 @@ export interface AggregationsSignificantTermsAggregation extends AggregationsBuc execution_hint?: AggregationsTermsAggregationExecutionHint field?: Field gnd?: AggregationsGoogleNormalizedDistanceHeuristic - include?: string | string[] + include?: AggregationsTermsInclude + jlh?: EmptyObject min_doc_count?: long mutual_information?: AggregationsMutualInformationHeuristic percentage?: AggregationsPercentageScoreHeuristic @@ -3472,6 +3484,7 @@ export interface AggregationsSignificantTextAggregation extends AggregationsBuck filter_duplicate_text?: boolean gnd?: AggregationsGoogleNormalizedDistanceHeuristic include?: string | string[] + jlh?: EmptyObject min_doc_count?: long mutual_information?: AggregationsMutualInformationHeuristic percentage?: AggregationsPercentageScoreHeuristic @@ -4477,7 +4490,7 @@ export interface MappingDenseVectorProperty extends MappingPropertyBase { index_options?: MappingDenseVectorIndexOptions } -export type MappingDocValuesProperty = MappingBinaryProperty | MappingBooleanProperty | MappingDateProperty | MappingDateNanosProperty | MappingKeywordProperty | MappingNumberProperty | MappingRangeProperty | MappingGeoPointProperty | MappingGeoShapeProperty | MappingCompletionProperty | MappingGenericProperty | MappingIpProperty | MappingMurmur3HashProperty | MappingShapeProperty | MappingTokenCountProperty | MappingVersionProperty | MappingWildcardProperty | MappingPointProperty +export type MappingDocValuesProperty = MappingBinaryProperty | MappingBooleanProperty | MappingDateProperty | MappingDateNanosProperty | MappingKeywordProperty | MappingNumberProperty | MappingRangeProperty | MappingGeoPointProperty | MappingGeoShapeProperty | MappingCompletionProperty | MappingIpProperty | MappingMurmur3HashProperty | MappingShapeProperty | MappingTokenCountProperty | MappingVersionProperty | MappingWildcardProperty | MappingPointProperty export interface MappingDocValuesPropertyBase extends MappingCorePropertyBase { doc_values?: boolean @@ -4542,21 +4555,6 @@ export interface MappingFloatRangeProperty extends MappingRangePropertyBase { type: 'float_range' } -export interface MappingGenericProperty extends MappingDocValuesPropertyBase { - analyzer: string - boost: double - fielddata: IndicesStringFielddata - ignore_malformed: boolean - index: boolean - index_options: MappingIndexOptions - norms: boolean - null_value: string - position_increment_gap: integer - search_analyzer: string - term_vector: MappingTermVectorOption - type: string -} - export type MappingGeoOrientation = 'right' | 'RIGHT' | 'counterclockwise' | 'ccw' | 'left' | 'LEFT' | 'clockwise' | 'cw' export interface MappingGeoPointProperty extends MappingDocValuesPropertyBase { @@ -4692,7 +4690,6 @@ export type MappingProperty = MappingFlattenedProperty | MappingJoinProperty | M export interface MappingPropertyBase { local_metadata?: Metadata meta?: Record - name?: PropertyName properties?: Record ignore_above?: integer dynamic?: MappingDynamicMapping @@ -4901,7 +4898,7 @@ export interface QueryDslConstantScoreQuery extends QueryDslQueryBase { export interface QueryDslDateDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslDateDecayFunction = QueryDslDateDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode | QueryDslQueryContainer | double } +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export interface QueryDslDateDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } @@ -4919,7 +4916,7 @@ export interface QueryDslDateRangeQuery extends QueryDslRangeQueryBase { export type QueryDslDecayFunction = QueryDslDateDecayFunction | QueryDslNumericDecayFunction | QueryDslGeoDecayFunction -export interface QueryDslDecayFunctionBase extends QueryDslScoreFunctionBase { +export interface QueryDslDecayFunctionBase { multi_value_mode?: QueryDslMultiValueMode } @@ -4962,7 +4959,7 @@ export interface QueryDslFieldLookup { export type QueryDslFieldValueFactorModifier = 'none' | 'log' | 'log1p' | 'log2p' | 'ln' | 'ln1p' | 'ln2p' | 'square' | 'sqrt' | 'reciprocal' -export interface QueryDslFieldValueFactorScoreFunction extends QueryDslScoreFunctionBase { +export interface QueryDslFieldValueFactorScoreFunction { field: Field factor?: double missing?: double @@ -5013,7 +5010,7 @@ export type QueryDslGeoBoundingBoxQuery = QueryDslGeoBoundingBoxQueryKeys export interface QueryDslGeoDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslGeoDecayFunction = QueryDslGeoDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode | QueryDslQueryContainer | double } +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export interface QueryDslGeoDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } @@ -5279,7 +5276,7 @@ export interface QueryDslNumberRangeQuery extends QueryDslRangeQueryBase { export interface QueryDslNumericDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslNumericDecayFunction = QueryDslNumericDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode | QueryDslQueryContainer | double } +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export type QueryDslOperator = 'and' | 'AND' | 'or' | 'OR' @@ -5409,7 +5406,7 @@ export interface QueryDslQueryStringQuery extends QueryDslQueryBase { type?: QueryDslTextQueryType } -export interface QueryDslRandomScoreFunction extends QueryDslScoreFunctionBase { +export interface QueryDslRandomScoreFunction { field?: Field seed?: long | string } @@ -5457,16 +5454,11 @@ export interface QueryDslRegexpQuery extends QueryDslQueryBase { value: string } -export interface QueryDslScoreFunctionBase { - filter?: QueryDslQueryContainer - weight?: double -} - export interface QueryDslScriptQuery extends QueryDslQueryBase { script: Script } -export interface QueryDslScriptScoreFunction extends QueryDslScoreFunctionBase { +export interface QueryDslScriptScoreFunction { script: Script } @@ -5655,8 +5647,7 @@ export interface AsyncSearchGetRequest extends RequestBase { wait_for_completion_timeout?: Time } -export interface AsyncSearchGetResponse extends AsyncSearchAsyncSearchDocumentResponseBase { -} +export type AsyncSearchGetResponse> = AsyncSearchAsyncSearchDocumentResponseBase export interface AsyncSearchStatusRequest extends RequestBase { id: Id @@ -5736,8 +5727,7 @@ export interface AsyncSearchSubmitRequest extends RequestBase { runtime_mappings?: MappingRuntimeFields } -export interface AsyncSearchSubmitResponse extends AsyncSearchAsyncSearchDocumentResponseBase { -} +export type AsyncSearchSubmitResponse> = AsyncSearchAsyncSearchDocumentResponseBase export interface AutoscalingAutoscalingPolicy { roles: string[] @@ -5879,6 +5869,22 @@ export interface CatAllocationRequest extends CatCatRequestBase { export type CatAllocationResponse = CatAllocationAllocationRecord[] +export interface CatComponentTemplatesComponentTemplate { + name: string + version: string + alias_count: string + mapping_count: string + settings_count: string + metadata_count: string + included_in: string +} + +export interface CatComponentTemplatesRequest extends CatCatRequestBase { + name?: string +} + +export type CatComponentTemplatesResponse = CatComponentTemplatesComponentTemplate[] + export interface CatCountCountRecord { epoch?: EpochMillis t?: EpochMillis @@ -8489,6 +8495,7 @@ export interface DanglingIndicesListDanglingIndicesResponse { export interface EnrichConfiguration { geo_match?: EnrichPolicy match: EnrichPolicy + range: EnrichPolicy } export interface EnrichPolicy { @@ -8537,6 +8544,7 @@ export interface EnrichPutPolicyRequest extends RequestBase { name: Name geo_match?: EnrichPolicy match?: EnrichPolicy + range?: EnrichPolicy } export type EnrichPutPolicyResponse = AcknowledgedResponseBase @@ -8610,8 +8618,7 @@ export interface EqlGetRequest extends RequestBase { wait_for_completion_timeout?: Time } -export interface EqlGetResponse extends EqlEqlSearchResponseBase { -} +export type EqlGetResponse = EqlEqlSearchResponseBase export interface EqlGetStatusRequest extends RequestBase { id: Id @@ -8647,8 +8654,7 @@ export interface EqlSearchRequest extends RequestBase { runtime_mappings?: MappingRuntimeFields } -export interface EqlSearchResponse extends EqlEqlSearchResponseBase { -} +export type EqlSearchResponse = EqlEqlSearchResponseBase export type EqlSearchResultPosition = 'tail' | 'head' @@ -9087,7 +9093,7 @@ export interface IndicesFielddataFrequencyFilter { min_segment_size: integer } -export type IndicesIndexCheckOnStartup = boolean | 'false' | 'checksum' | 'true' +export type IndicesIndexCheckOnStartup = boolean | 'true' | 'false' | 'checksum' export interface IndicesIndexRouting { allocation?: IndicesIndexRoutingAllocation @@ -9273,6 +9279,7 @@ export interface IndicesMappingLimitSettings { nested_objects?: IndicesMappingLimitSettingsNestedObjects field_name_length?: IndicesMappingLimitSettingsFieldNameLength dimension_fields?: IndicesMappingLimitSettingsDimensionFields + ignore_malformed?: boolean } export interface IndicesMappingLimitSettingsDepth { @@ -9430,13 +9437,7 @@ export interface IndicesStorage { allow_mmap?: boolean } -export type IndicesStorageType = 'fs' | 'niofs' | 'mmapfs' | 'hybridfs' - -export interface IndicesStringFielddata { - format: IndicesStringFielddataFormat -} - -export type IndicesStringFielddataFormat = 'paged_bytes' | 'disabled' +export type IndicesStorageType = 'fs' | '' | 'niofs' | 'mmapfs' | 'hybridfs' export interface IndicesTemplateMapping { aliases: Record @@ -9454,7 +9455,7 @@ export interface IndicesTranslog { retention?: IndicesTranslogRetention } -export type IndicesTranslogDurability = 'request' | 'async' +export type IndicesTranslogDurability = 'request' | 'REQUEST' | 'async' | 'ASYNC' export interface IndicesTranslogRetention { size?: ByteSize @@ -9615,7 +9616,7 @@ export interface IndicesCreateRequest extends RequestBase { export interface IndicesCreateResponse { index: IndexName shards_acknowledged: boolean - acknowledged?: boolean + acknowledged: boolean } export interface IndicesCreateDataStreamRequest extends RequestBase { @@ -9941,6 +9942,22 @@ export interface IndicesMigrateToDataStreamRequest extends RequestBase { export type IndicesMigrateToDataStreamResponse = AcknowledgedResponseBase +export interface IndicesModifyDataStreamAction { + add_backing_index?: IndicesModifyDataStreamIndexAndDataStreamAction + remove_backing_index?: IndicesModifyDataStreamIndexAndDataStreamAction +} + +export interface IndicesModifyDataStreamIndexAndDataStreamAction { + index: IndexName + data_stream: DataStreamName +} + +export interface IndicesModifyDataStreamRequest extends RequestBase { + actions: IndicesModifyDataStreamAction[] +} + +export type IndicesModifyDataStreamResponse = AcknowledgedResponseBase + export interface IndicesOpenRequest extends RequestBase { index: Indices allow_no_indices?: boolean @@ -10761,10 +10778,20 @@ export interface IngestGsubProcessor extends IngestProcessorBase { export interface IngestInferenceConfig { regression?: IngestInferenceConfigRegression + classification?: IngestInferenceConfigClassification +} + +export interface IngestInferenceConfigClassification { + num_top_classes?: integer + num_top_feature_importance_values?: integer + results_field?: Field + top_classes_results_field?: Field + prediction_field_type?: string } export interface IngestInferenceConfigRegression { - results_field: string + results_field?: Field + num_top_feature_importance_values?: integer } export interface IngestInferenceProcessor extends IngestProcessorBase { @@ -11381,6 +11408,14 @@ export interface MlChunkingConfig { export type MlChunkingMode = 'auto' | 'manual' | 'off' +export interface MlClassificationInferenceOptions { + num_top_classes?: integer + num_top_feature_importance_values?: integer + prediction_field_type?: string + results_field?: string + top_classes_results_field?: string +} + export type MlConditionOperator = 'gt' | 'gte' | 'lt' | 'lte' export type MlCustomSettings = any @@ -11771,6 +11806,18 @@ export interface MlDiscoveryNode { export type MlExcludeFrequent = 'all' | 'none' | 'by' | 'over' +export interface MlFillMaskInferenceOptions { + num_top_classes?: integer + tokenization?: MlTokenizationConfigContainer + results_field?: string +} + +export interface MlFillMaskInferenceUpdateOptions { + num_top_classes?: integer + tokenization?: MlNlpTokenizationUpdateOptions + results_field?: string +} + export interface MlFilter { description?: string filter_id: Id @@ -11811,6 +11858,42 @@ export interface MlHyperparameters { export type MlInclude = 'definition' | 'feature_importance_baseline' | 'hyperparameters' | 'total_feature_importance' +export interface MlInferenceConfigCreateContainer { + regression?: MlRegressionInferenceOptions + classification?: MlClassificationInferenceOptions + text_classification?: MlTextClassificationInferenceOptions + zero_shot_classification?: MlZeroShotClassificationInferenceOptions + fill_mask?: MlFillMaskInferenceOptions + ner?: MlNerInferenceOptions + pass_through?: MlPassThroughInferenceOptions + text_embedding?: MlTextEmbeddingInferenceOptions + question_answering?: MlQuestionAnsweringInferenceOptions +} + +export interface MlInferenceConfigUpdateContainer { + regression?: MlRegressionInferenceOptions + classification?: MlClassificationInferenceOptions + text_classification?: MlTextClassificationInferenceUpdateOptions + zero_shot_classification?: MlZeroShotClassificationInferenceUpdateOptions + fill_mask?: MlFillMaskInferenceUpdateOptions + ner?: MlNerInferenceUpdateOptions + pass_through?: MlPassThroughInferenceUpdateOptions + text_embedding?: MlTextEmbeddingInferenceUpdateOptions + question_answering?: MlQuestionAnsweringInferenceUpdateOptions +} + +export interface MlInferenceResponseResult { + entities?: MlTrainedModelEntities[] + is_truncated?: boolean + predicted_value?: MlPredictedValue[] + predicted_value_sequence?: string + prediction_probability?: double + prediction_score?: double + top_classes?: MlTopClassEntry[] + warning?: string + feature_importance?: MlTrainedModelInferenceFeatureImportance[] +} + export interface MlInfluence { influencer_field_name: string influencer_field_values: string[] @@ -11970,6 +12053,38 @@ export interface MlModelSnapshot { timestamp: long } +export interface MlNerInferenceOptions { + tokenization?: MlTokenizationConfigContainer + results_field?: string + classification_labels?: string[] +} + +export interface MlNerInferenceUpdateOptions { + tokenization?: MlNlpTokenizationUpdateOptions + results_field?: string +} + +export interface MlNlpBertTokenizationConfig { + do_lower_case?: boolean + with_special_tokens?: boolean + max_sequence_length?: integer + truncate?: MlTokenizationTruncate + span?: integer +} + +export interface MlNlpRobertaTokenizationConfig { + add_prefix_space?: boolean + with_special_tokens?: boolean + max_sequence_length?: integer + truncate?: MlTokenizationTruncate + span?: integer +} + +export interface MlNlpTokenizationUpdateOptions { + truncate?: MlTokenizationTruncate + span?: integer +} + export interface MlOutlierDetectionParameters { compute_feature_influence?: boolean feature_influence_threshold?: double @@ -11998,12 +12113,42 @@ export interface MlPage { size?: integer } +export interface MlPassThroughInferenceOptions { + tokenization?: MlTokenizationConfigContainer + results_field?: string +} + +export interface MlPassThroughInferenceUpdateOptions { + tokenization?: MlNlpTokenizationUpdateOptions + results_field?: string +} + export interface MlPerPartitionCategorization { enabled?: boolean stop_on_warn?: boolean } -export type MlPredictedValue = string | double +export type MlPredictedValue = string | double | boolean | integer + +export interface MlQuestionAnsweringInferenceOptions { + num_top_classes?: integer + tokenization?: MlTokenizationConfigContainer + results_field?: string + max_answer_length?: integer +} + +export interface MlQuestionAnsweringInferenceUpdateOptions { + question: string + num_top_classes?: integer + tokenization?: MlNlpTokenizationUpdateOptions + results_field?: string + max_answer_length?: integer +} + +export interface MlRegressionInferenceOptions { + results_field?: Field + num_top_feature_importance_values?: integer +} export type MlRoutingState = 'failed' | 'started' | 'starting' | 'stopped' | 'stopping' @@ -12020,11 +12165,43 @@ export interface MlRunningStateSearchInterval { start_ms: long } +export interface MlTextClassificationInferenceOptions { + num_top_classes?: integer + tokenization?: MlTokenizationConfigContainer + results_field?: string + classification_labels?: string[] +} + +export interface MlTextClassificationInferenceUpdateOptions { + num_top_classes?: integer + tokenization?: MlNlpTokenizationUpdateOptions + results_field?: string + classification_labels?: string[] +} + +export interface MlTextEmbeddingInferenceOptions { + tokenization?: MlTokenizationConfigContainer + results_field?: string +} + +export interface MlTextEmbeddingInferenceUpdateOptions { + tokenization?: MlNlpTokenizationUpdateOptions + results_field?: string +} + export interface MlTimingStats { elapsed_time: integer iteration_time?: integer } +export interface MlTokenizationConfigContainer { + bert?: MlNlpBertTokenizationConfig + mpnet?: MlNlpBertTokenizationConfig + roberta?: MlNlpRobertaTokenizationConfig +} + +export type MlTokenizationTruncate = 'first' | 'second' | 'none' + export interface MlTopClassEntry { class_name: string class_probability: double @@ -12077,7 +12254,7 @@ export interface MlTrainedModelConfig { description?: string estimated_heap_memory_usage_bytes?: integer estimated_operations?: integer - inference_config: AggregationsInferenceConfigContainer + inference_config: MlInferenceConfigCreateContainer input: MlTrainedModelConfigInput license_level?: string metadata?: MlTrainedModelConfigMetadata @@ -12106,14 +12283,14 @@ export interface MlTrainedModelDeploymentNodesStats { average_inference_time_ms: double error_count: integer inference_count: integer - inference_threads: integer last_access: long - model_threads: integer node: MlDiscoveryNode + number_of_allocations: integer number_of_pending_requests: integer rejection_execution_count: integer routing_state: MlTrainedModelAllocationRoutingTable start_time: long + threads_per_allocation: integer timeout_count: integer } @@ -12121,15 +12298,15 @@ export interface MlTrainedModelDeploymentStats { allocation_status: MlTrainedModelDeploymentAllocationStatus error_count: integer inference_count: integer - inference_threads: integer model_id: Id - model_threads: integer nodes: MlTrainedModelDeploymentNodesStats + number_of_allocations: integer queue_capacity: integer rejected_execution_count: integer reason: string start_time: long state: MlDeploymentState + threads_per_allocation: integer timeout_count: integer } @@ -12141,6 +12318,17 @@ export interface MlTrainedModelEntities { end_pos: integer } +export interface MlTrainedModelInferenceClassImportance { + class_name: string + importance: double +} + +export interface MlTrainedModelInferenceFeatureImportance { + feature_name: string + importance?: double + classes?: MlTrainedModelInferenceClassImportance[] +} + export interface MlTrainedModelInferenceStats { cache_miss_count: integer failure_count: integer @@ -12178,6 +12366,22 @@ export interface MlValidationLoss { loss_type: string } +export interface MlZeroShotClassificationInferenceOptions { + tokenization?: MlTokenizationConfigContainer + hypothesis_template?: string + classification_labels: string[] + results_field?: string + multi_label?: boolean + labels?: string[] +} + +export interface MlZeroShotClassificationInferenceUpdateOptions { + tokenization?: MlNlpTokenizationUpdateOptions + results_field?: string + multi_label?: boolean + labels: string[] +} + export interface MlCloseJobRequest extends RequestBase { job_id: Id allow_no_match?: boolean @@ -12590,42 +12794,43 @@ export interface MlGetJobsResponse { } export interface MlGetMemoryStatsJvmStats { - heap_max: ByteSize + heap_max?: ByteSize heap_max_in_bytes: integer - java_inference: ByteSize + java_inference?: ByteSize java_inference_in_bytes: integer - java_inference_max: ByteSize + java_inference_max?: ByteSize java_inference_max_in_bytes: integer } export interface MlGetMemoryStatsMemMlStats { - anomaly_detectors: ByteSize + anomaly_detectors?: ByteSize anomaly_detectors_in_bytes: integer - data_frame_analytics: ByteSize + data_frame_analytics?: ByteSize data_frame_analytics_in_bytes: integer - max: ByteSize + max?: ByteSize max_in_bytes: integer - native_code_overhead: ByteSize + native_code_overhead?: ByteSize native_code_overhead_in_bytes: integer - native_inference: ByteSize + native_inference?: ByteSize native_inference_in_bytes: integer } export interface MlGetMemoryStatsMemStats { - adjusted_total: ByteSize + adjusted_total?: ByteSize adjusted_total_in_bytes: integer - total: ByteSize + total?: ByteSize total_in_bytes: integer ml: MlGetMemoryStatsMemMlStats } export interface MlGetMemoryStatsMemory { - attributes: string[] + attributes: Record jvm: MlGetMemoryStatsJvmStats mem: MlGetMemoryStatsMemStats name: Name roles: string[] transport_address: TransportAddress + ephemeral_id: Id } export interface MlGetMemoryStatsRequest extends RequestBase { @@ -12637,7 +12842,7 @@ export interface MlGetMemoryStatsRequest extends RequestBase { export interface MlGetMemoryStatsResponse { _nodes: NodeStatistics - cluser_name: Name + cluster_name: Name nodes: Record } @@ -12720,20 +12925,15 @@ export interface MlGetTrainedModelsStatsResponse { trained_model_stats: MlTrainedModelStats[] } -export interface MlInferTrainedModelDeploymentRequest extends RequestBase { +export interface MlInferTrainedModelRequest extends RequestBase { model_id: Id timeout?: Time - docs: Record[] + docs: Record[] + inference_config?: MlInferenceConfigUpdateContainer } -export interface MlInferTrainedModelDeploymentResponse { - entities?: MlTrainedModelEntities[] - is_truncated?: boolean - predicted_value?: MlPredictedValue[] - predicted_value_sequence?: string - prediction_probability?: double - top_classes: MlTopClassEntry[] - warning?: string +export interface MlInferTrainedModelResponse { + inference_results: MlInferenceResponseResult[] } export interface MlInfoAnomalyDetectors { @@ -13036,7 +13236,7 @@ export interface MlPutTrainedModelRequest extends RequestBase { compressed_definition?: string definition?: MlPutTrainedModelDefinition description?: string - inference_config: AggregationsInferenceConfigContainer + inference_config: MlInferenceConfigCreateContainer input: MlPutTrainedModelInput metadata?: any model_type?: MlTrainedModelType @@ -13156,9 +13356,9 @@ export interface MlStartDatafeedResponse { export interface MlStartTrainedModelDeploymentRequest extends RequestBase { model_id: Id - inference_threads?: integer - model_threads?: integer + number_of_allocations?: integer queue_capacity?: integer + threads_per_allocation?: integer timeout?: Time wait_for?: MlDeploymentAllocationState } @@ -14579,6 +14779,8 @@ export interface SecurityGlobalPrivilege { application: SecurityApplicationGlobalUserPrivileges } +export type SecurityGrantType = 'password' | 'access_token' + export type SecurityIndexPrivilege = 'none' | 'all' | 'auto_configure' | 'create' | 'create_doc' | 'create_index' | 'delete' | 'delete_index' | 'index' | 'maintenance' | 'manage' | 'manage_follow_index' | 'manage_ilm' | 'manage_leader_index' | 'monitor' | 'read' | 'read_cross_cluster' | 'view_index_metadata' | 'write' export interface SecurityIndicesPrivileges { @@ -14642,6 +14844,41 @@ export interface SecurityUser { enabled: boolean } +export interface SecurityUserProfile { + uid: string + user: SecurityUserProfileUser + data?: Record + labels?: Record + enabled?: boolean +} + +export interface SecurityUserProfileHitMetadata { + _primary_term: long + _seq_no: SequenceNumber +} + +export interface SecurityUserProfileUser { + email?: string | null + full_name?: Name | null + metadata: Metadata + roles: string[] + username: Username +} + +export interface SecurityUserProfileWithMetadata extends SecurityUserProfile { + last_synchronized: long + _doc?: SecurityUserProfileHitMetadata +} + +export interface SecurityActivateUserProfileRequest extends RequestBase { + access_token?: string + grant_type: SecurityGrantType + password?: string + username?: string +} + +export type SecurityActivateUserProfileResponse = SecurityUserProfileWithMetadata + export interface SecurityAuthenticateRequest extends RequestBase { } @@ -14828,6 +15065,13 @@ export interface SecurityDisableUserRequest extends RequestBase { export interface SecurityDisableUserResponse { } +export interface SecurityDisableUserProfileRequest extends RequestBase { + uid: string + refresh?: Refresh +} + +export type SecurityDisableUserProfileResponse = AcknowledgedResponseBase + export interface SecurityEnableUserRequest extends RequestBase { username: Username refresh?: Refresh @@ -14836,6 +15080,13 @@ export interface SecurityEnableUserRequest extends RequestBase { export interface SecurityEnableUserResponse { } +export interface SecurityEnableUserProfileRequest extends RequestBase { + uid: string + refresh?: Refresh +} + +export type SecurityEnableUserProfileResponse = AcknowledgedResponseBase + export interface SecurityEnrollKibanaRequest extends RequestBase { } @@ -15018,6 +15269,13 @@ export interface SecurityGetUserPrivilegesResponse { run_as: string[] } +export interface SecurityGetUserProfileRequest extends RequestBase { + uid: string + data?: string | string[] +} + +export type SecurityGetUserProfileResponse = Record + export type SecurityGrantApiKeyApiKeyGrantType = 'access_token' | 'password' export interface SecurityGrantApiKeyGrantApiKey { @@ -15058,7 +15316,7 @@ export interface SecurityHasPrivilegesIndexPrivilegesCheck { export type SecurityHasPrivilegesPrivileges = Record export interface SecurityHasPrivilegesRequest extends RequestBase { - user?: Name | null + user?: Name application?: SecurityHasPrivilegesApplicationPrivilegesCheck[] cluster?: SecurityClusterPrivilege[] index?: SecurityHasPrivilegesIndexPrivilegesCheck[] @@ -15243,8 +15501,40 @@ export interface SecuritySamlServiceProviderMetadataResponse { metadata: string } +export interface SecuritySuggestUserProfilesRequest extends RequestBase { + data?: string | string[] + name?: string + size?: long +} + +export interface SecuritySuggestUserProfilesResponse { + total: SecuritySuggestUserProfilesTotalUserProfiles + took: long + profiles: SecurityUserProfile[] +} + +export interface SecuritySuggestUserProfilesTotalUserProfiles { + value: long + relation: RelationName +} + +export interface SecurityUpdateUserProfileDataRequest extends RequestBase { + uid: string + if_seq_no?: SequenceNumber + if_primary_term?: long + refresh?: Refresh + access?: Record + data?: Record +} + +export type SecurityUpdateUserProfileDataResponse = AcknowledgedResponseBase + +export type ShutdownType = 'restart' | 'remove' | 'replace' + export interface ShutdownDeleteNodeRequest extends RequestBase { node_id: NodeId + master_timeout?: TimeUnit + timeout?: TimeUnit } export type ShutdownDeleteNodeResponse = AcknowledgedResponseBase @@ -15270,6 +15560,8 @@ export interface ShutdownGetNodePluginsStatus { export interface ShutdownGetNodeRequest extends RequestBase { node_id?: NodeIds + master_timeout?: TimeUnit + timeout?: TimeUnit } export interface ShutdownGetNodeResponse { @@ -15286,6 +15578,12 @@ export type ShutdownGetNodeShutdownType = 'remove' | 'restart' export interface ShutdownPutNodeRequest extends RequestBase { node_id: NodeId + master_timeout?: TimeUnit + timeout?: TimeUnit + type: ShutdownType + reason: string + allocation_delay?: string + target_node_name?: string } export type ShutdownPutNodeResponse = AcknowledgedResponseBase @@ -15664,7 +15962,7 @@ export interface SnapshotRestoreRequest extends RequestBase { ignore_unavailable?: boolean include_aliases?: boolean include_global_state?: boolean - index_settings?: IndicesPutSettingsRequest + index_settings?: IndicesIndexSettings indices?: Indices partial?: boolean rename_pattern?: string @@ -16202,7 +16500,7 @@ export interface TransformUpdateTransformRequest extends RequestBase { source?: TransformSource settings?: TransformSettings sync?: TransformSyncContainer - retention_policy?: TransformRetentionPolicyContainer + retention_policy?: TransformRetentionPolicyContainer | null } export interface TransformUpdateTransformResponse { diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index a9c2646a8..20ba75e68 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -257,7 +257,7 @@ export interface DeleteByQueryRethrottleRequest extends RequestBase { requests_per_second?: long } -export type DeleteByQueryRethrottleResponse = TasksListResponse +export type DeleteByQueryRethrottleResponse = TasksTaskListResponseBase export interface DeleteScriptRequest extends RequestBase { id: Id @@ -585,10 +585,21 @@ export interface MsearchMultisearchBody { aggregations?: Record aggs?: Record query?: QueryDslQueryContainer + explain?: boolean + stored_fields?: Fields + docvalue_fields?: (QueryDslFieldAndFormat | Field)[] from?: integer size?: integer - pit?: SearchPointInTimeReference + sort?: Sort + _source?: SearchSourceConfig + terminate_after?: long + stats?: string[] + timeout?: string + track_scores?: boolean track_total_hits?: SearchTrackHits + version?: boolean + seq_no_primary_term?: boolean + pit?: SearchPointInTimeReference suggest?: SearchSuggester } @@ -601,6 +612,9 @@ export interface MsearchMultisearchHeader { request_cache?: boolean routing?: string search_type?: SearchType + ccs_minimize_roundtrips?: boolean + allow_partial_search_results?: boolean + ignore_throttled?: boolean } export interface MsearchRequest extends RequestBase { @@ -1160,12 +1174,13 @@ export interface SearchCompletionSuggestOption { collate_match?: boolean contexts?: Record fields?: Record - _id: string - _index: IndexName + _id?: string + _index?: IndexName _routing?: Routing _score?: double _source?: TDocument text: string + score?: double } export interface SearchCompletionSuggester extends SearchSuggesterBase { @@ -1225,9 +1240,9 @@ export interface SearchFieldCollapse { export interface SearchFieldSuggester { completion?: SearchCompletionSuggester phrase?: SearchPhraseSuggester + term?: SearchTermSuggester prefix?: string regex?: string - term?: SearchTermSuggester text?: string } @@ -2616,6 +2631,7 @@ export interface AggregationsAggregationContainer { geohash_grid?: AggregationsGeoHashGridAggregation geo_line?: AggregationsGeoLineAggregation geotile_grid?: AggregationsGeoTileGridAggregation + geohex_grid?: AggregationsGeohexGridAggregation global?: AggregationsGlobalAggregation histogram?: AggregationsHistogramAggregation ip_range?: AggregationsIpRangeAggregation @@ -2813,14 +2829,6 @@ export interface AggregationsChildrenAggregation extends AggregationsBucketAggre type?: RelationName } -export interface AggregationsClassificationInferenceOptions { - num_top_classes?: integer - num_top_feature_importance_values?: integer - prediction_field_type?: string - results_field?: string - top_classes_results_field?: string -} - export interface AggregationsCompositeAggregate extends AggregationsMultiBucketAggregateBase { after_key?: Record } @@ -3089,6 +3097,14 @@ export interface AggregationsGeoTileGridBucketKeys extends AggregationsMultiBuck export type AggregationsGeoTileGridBucket = AggregationsGeoTileGridBucketKeys & { [property: string]: AggregationsAggregate | GeoTile | long } +export interface AggregationsGeohexGridAggregation extends AggregationsBucketAggregationBase { + field: Field + precision?: integer + bounds?: GeoBounds + size?: integer + shard_size?: integer +} + export interface AggregationsGlobalAggregateKeys extends AggregationsSingleBucketAggregateBase { } export type AggregationsGlobalAggregate = AggregationsGlobalAggregateKeys @@ -3186,8 +3202,8 @@ export interface AggregationsInferenceClassImportance { } export interface AggregationsInferenceConfigContainer { - regression?: AggregationsRegressionInferenceOptions - classification?: AggregationsClassificationInferenceOptions + regression?: MlRegressionInferenceOptions + classification?: MlClassificationInferenceOptions } export interface AggregationsInferenceFeatureImportance { @@ -3477,11 +3493,6 @@ export interface AggregationsRateAggregation extends AggregationsFormatMetricAgg export type AggregationsRateMode = 'sum' | 'value_count' -export interface AggregationsRegressionInferenceOptions { - results_field?: Field - num_top_feature_importance_values?: integer -} - export interface AggregationsReverseNestedAggregateKeys extends AggregationsSingleBucketAggregateBase { } export type AggregationsReverseNestedAggregate = AggregationsReverseNestedAggregateKeys @@ -3548,7 +3559,8 @@ export interface AggregationsSignificantTermsAggregation extends AggregationsBuc execution_hint?: AggregationsTermsAggregationExecutionHint field?: Field gnd?: AggregationsGoogleNormalizedDistanceHeuristic - include?: string | string[] + include?: AggregationsTermsInclude + jlh?: EmptyObject min_doc_count?: long mutual_information?: AggregationsMutualInformationHeuristic percentage?: AggregationsPercentageScoreHeuristic @@ -3572,6 +3584,7 @@ export interface AggregationsSignificantTextAggregation extends AggregationsBuck filter_duplicate_text?: boolean gnd?: AggregationsGoogleNormalizedDistanceHeuristic include?: string | string[] + jlh?: EmptyObject min_doc_count?: long mutual_information?: AggregationsMutualInformationHeuristic percentage?: AggregationsPercentageScoreHeuristic @@ -4577,7 +4590,7 @@ export interface MappingDenseVectorProperty extends MappingPropertyBase { index_options?: MappingDenseVectorIndexOptions } -export type MappingDocValuesProperty = MappingBinaryProperty | MappingBooleanProperty | MappingDateProperty | MappingDateNanosProperty | MappingKeywordProperty | MappingNumberProperty | MappingRangeProperty | MappingGeoPointProperty | MappingGeoShapeProperty | MappingCompletionProperty | MappingGenericProperty | MappingIpProperty | MappingMurmur3HashProperty | MappingShapeProperty | MappingTokenCountProperty | MappingVersionProperty | MappingWildcardProperty | MappingPointProperty +export type MappingDocValuesProperty = MappingBinaryProperty | MappingBooleanProperty | MappingDateProperty | MappingDateNanosProperty | MappingKeywordProperty | MappingNumberProperty | MappingRangeProperty | MappingGeoPointProperty | MappingGeoShapeProperty | MappingCompletionProperty | MappingIpProperty | MappingMurmur3HashProperty | MappingShapeProperty | MappingTokenCountProperty | MappingVersionProperty | MappingWildcardProperty | MappingPointProperty export interface MappingDocValuesPropertyBase extends MappingCorePropertyBase { doc_values?: boolean @@ -4642,21 +4655,6 @@ export interface MappingFloatRangeProperty extends MappingRangePropertyBase { type: 'float_range' } -export interface MappingGenericProperty extends MappingDocValuesPropertyBase { - analyzer: string - boost: double - fielddata: IndicesStringFielddata - ignore_malformed: boolean - index: boolean - index_options: MappingIndexOptions - norms: boolean - null_value: string - position_increment_gap: integer - search_analyzer: string - term_vector: MappingTermVectorOption - type: string -} - export type MappingGeoOrientation = 'right' | 'RIGHT' | 'counterclockwise' | 'ccw' | 'left' | 'LEFT' | 'clockwise' | 'cw' export interface MappingGeoPointProperty extends MappingDocValuesPropertyBase { @@ -4792,7 +4790,6 @@ export type MappingProperty = MappingFlattenedProperty | MappingJoinProperty | M export interface MappingPropertyBase { local_metadata?: Metadata meta?: Record - name?: PropertyName properties?: Record ignore_above?: integer dynamic?: MappingDynamicMapping @@ -5001,7 +4998,7 @@ export interface QueryDslConstantScoreQuery extends QueryDslQueryBase { export interface QueryDslDateDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslDateDecayFunction = QueryDslDateDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode | QueryDslQueryContainer | double } +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export interface QueryDslDateDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } @@ -5019,7 +5016,7 @@ export interface QueryDslDateRangeQuery extends QueryDslRangeQueryBase { export type QueryDslDecayFunction = QueryDslDateDecayFunction | QueryDslNumericDecayFunction | QueryDslGeoDecayFunction -export interface QueryDslDecayFunctionBase extends QueryDslScoreFunctionBase { +export interface QueryDslDecayFunctionBase { multi_value_mode?: QueryDslMultiValueMode } @@ -5062,7 +5059,7 @@ export interface QueryDslFieldLookup { export type QueryDslFieldValueFactorModifier = 'none' | 'log' | 'log1p' | 'log2p' | 'ln' | 'ln1p' | 'ln2p' | 'square' | 'sqrt' | 'reciprocal' -export interface QueryDslFieldValueFactorScoreFunction extends QueryDslScoreFunctionBase { +export interface QueryDslFieldValueFactorScoreFunction { field: Field factor?: double missing?: double @@ -5113,7 +5110,7 @@ export type QueryDslGeoBoundingBoxQuery = QueryDslGeoBoundingBoxQueryKeys export interface QueryDslGeoDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslGeoDecayFunction = QueryDslGeoDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode | QueryDslQueryContainer | double } +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export interface QueryDslGeoDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } @@ -5379,7 +5376,7 @@ export interface QueryDslNumberRangeQuery extends QueryDslRangeQueryBase { export interface QueryDslNumericDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslNumericDecayFunction = QueryDslNumericDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode | QueryDslQueryContainer | double } +& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export type QueryDslOperator = 'and' | 'AND' | 'or' | 'OR' @@ -5509,7 +5506,7 @@ export interface QueryDslQueryStringQuery extends QueryDslQueryBase { type?: QueryDslTextQueryType } -export interface QueryDslRandomScoreFunction extends QueryDslScoreFunctionBase { +export interface QueryDslRandomScoreFunction { field?: Field seed?: long | string } @@ -5557,16 +5554,11 @@ export interface QueryDslRegexpQuery extends QueryDslQueryBase { value: string } -export interface QueryDslScoreFunctionBase { - filter?: QueryDslQueryContainer - weight?: double -} - export interface QueryDslScriptQuery extends QueryDslQueryBase { script: Script } -export interface QueryDslScriptScoreFunction extends QueryDslScoreFunctionBase { +export interface QueryDslScriptScoreFunction { script: Script } @@ -5755,8 +5747,7 @@ export interface AsyncSearchGetRequest extends RequestBase { wait_for_completion_timeout?: Time } -export interface AsyncSearchGetResponse extends AsyncSearchAsyncSearchDocumentResponseBase { -} +export type AsyncSearchGetResponse> = AsyncSearchAsyncSearchDocumentResponseBase export interface AsyncSearchStatusRequest extends RequestBase { id: Id @@ -5853,8 +5844,7 @@ export interface AsyncSearchSubmitRequest extends RequestBase { } } -export interface AsyncSearchSubmitResponse extends AsyncSearchAsyncSearchDocumentResponseBase { -} +export type AsyncSearchSubmitResponse> = AsyncSearchAsyncSearchDocumentResponseBase export interface AutoscalingAutoscalingPolicy { roles: string[] @@ -5997,6 +5987,22 @@ export interface CatAllocationRequest extends CatCatRequestBase { export type CatAllocationResponse = CatAllocationAllocationRecord[] +export interface CatComponentTemplatesComponentTemplate { + name: string + version: string + alias_count: string + mapping_count: string + settings_count: string + metadata_count: string + included_in: string +} + +export interface CatComponentTemplatesRequest extends CatCatRequestBase { + name?: string +} + +export type CatComponentTemplatesResponse = CatComponentTemplatesComponentTemplate[] + export interface CatCountCountRecord { epoch?: EpochMillis t?: EpochMillis @@ -8631,6 +8637,7 @@ export interface DanglingIndicesListDanglingIndicesResponse { export interface EnrichConfiguration { geo_match?: EnrichPolicy match: EnrichPolicy + range: EnrichPolicy } export interface EnrichPolicy { @@ -8681,6 +8688,7 @@ export interface EnrichPutPolicyRequest extends RequestBase { body?: { geo_match?: EnrichPolicy match?: EnrichPolicy + range?: EnrichPolicy } } @@ -8755,8 +8763,7 @@ export interface EqlGetRequest extends RequestBase { wait_for_completion_timeout?: Time } -export interface EqlGetResponse extends EqlEqlSearchResponseBase { -} +export type EqlGetResponse = EqlEqlSearchResponseBase export interface EqlGetStatusRequest extends RequestBase { id: Id @@ -8798,8 +8805,7 @@ export interface EqlSearchRequest extends RequestBase { } } -export interface EqlSearchResponse extends EqlEqlSearchResponseBase { -} +export type EqlSearchResponse = EqlEqlSearchResponseBase export type EqlSearchResultPosition = 'tail' | 'head' @@ -9268,7 +9274,7 @@ export interface IndicesFielddataFrequencyFilter { min_segment_size: integer } -export type IndicesIndexCheckOnStartup = boolean | 'false' | 'checksum' | 'true' +export type IndicesIndexCheckOnStartup = boolean | 'true' | 'false' | 'checksum' export interface IndicesIndexRouting { allocation?: IndicesIndexRoutingAllocation @@ -9454,6 +9460,7 @@ export interface IndicesMappingLimitSettings { nested_objects?: IndicesMappingLimitSettingsNestedObjects field_name_length?: IndicesMappingLimitSettingsFieldNameLength dimension_fields?: IndicesMappingLimitSettingsDimensionFields + ignore_malformed?: boolean } export interface IndicesMappingLimitSettingsDepth { @@ -9611,13 +9618,7 @@ export interface IndicesStorage { allow_mmap?: boolean } -export type IndicesStorageType = 'fs' | 'niofs' | 'mmapfs' | 'hybridfs' - -export interface IndicesStringFielddata { - format: IndicesStringFielddataFormat -} - -export type IndicesStringFielddataFormat = 'paged_bytes' | 'disabled' +export type IndicesStorageType = 'fs' | '' | 'niofs' | 'mmapfs' | 'hybridfs' export interface IndicesTemplateMapping { aliases: Record @@ -9635,7 +9636,7 @@ export interface IndicesTranslog { retention?: IndicesTranslogRetention } -export type IndicesTranslogDurability = 'request' | 'async' +export type IndicesTranslogDurability = 'request' | 'REQUEST' | 'async' | 'ASYNC' export interface IndicesTranslogRetention { size?: ByteSize @@ -9805,7 +9806,7 @@ export interface IndicesCreateRequest extends RequestBase { export interface IndicesCreateResponse { index: IndexName shards_acknowledged: boolean - acknowledged?: boolean + acknowledged: boolean } export interface IndicesCreateDataStreamRequest extends RequestBase { @@ -10131,6 +10132,25 @@ export interface IndicesMigrateToDataStreamRequest extends RequestBase { export type IndicesMigrateToDataStreamResponse = AcknowledgedResponseBase +export interface IndicesModifyDataStreamAction { + add_backing_index?: IndicesModifyDataStreamIndexAndDataStreamAction + remove_backing_index?: IndicesModifyDataStreamIndexAndDataStreamAction +} + +export interface IndicesModifyDataStreamIndexAndDataStreamAction { + index: IndexName + data_stream: DataStreamName +} + +export interface IndicesModifyDataStreamRequest extends RequestBase { + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + actions: IndicesModifyDataStreamAction[] + } +} + +export type IndicesModifyDataStreamResponse = AcknowledgedResponseBase + export interface IndicesOpenRequest extends RequestBase { index: Indices allow_no_indices?: boolean @@ -10984,10 +11004,20 @@ export interface IngestGsubProcessor extends IngestProcessorBase { export interface IngestInferenceConfig { regression?: IngestInferenceConfigRegression + classification?: IngestInferenceConfigClassification +} + +export interface IngestInferenceConfigClassification { + num_top_classes?: integer + num_top_feature_importance_values?: integer + results_field?: Field + top_classes_results_field?: Field + prediction_field_type?: string } export interface IngestInferenceConfigRegression { - results_field: string + results_field?: Field + num_top_feature_importance_values?: integer } export interface IngestInferenceProcessor extends IngestProcessorBase { @@ -11614,6 +11644,14 @@ export interface MlChunkingConfig { export type MlChunkingMode = 'auto' | 'manual' | 'off' +export interface MlClassificationInferenceOptions { + num_top_classes?: integer + num_top_feature_importance_values?: integer + prediction_field_type?: string + results_field?: string + top_classes_results_field?: string +} + export type MlConditionOperator = 'gt' | 'gte' | 'lt' | 'lte' export type MlCustomSettings = any @@ -12004,6 +12042,18 @@ export interface MlDiscoveryNode { export type MlExcludeFrequent = 'all' | 'none' | 'by' | 'over' +export interface MlFillMaskInferenceOptions { + num_top_classes?: integer + tokenization?: MlTokenizationConfigContainer + results_field?: string +} + +export interface MlFillMaskInferenceUpdateOptions { + num_top_classes?: integer + tokenization?: MlNlpTokenizationUpdateOptions + results_field?: string +} + export interface MlFilter { description?: string filter_id: Id @@ -12044,6 +12094,42 @@ export interface MlHyperparameters { export type MlInclude = 'definition' | 'feature_importance_baseline' | 'hyperparameters' | 'total_feature_importance' +export interface MlInferenceConfigCreateContainer { + regression?: MlRegressionInferenceOptions + classification?: MlClassificationInferenceOptions + text_classification?: MlTextClassificationInferenceOptions + zero_shot_classification?: MlZeroShotClassificationInferenceOptions + fill_mask?: MlFillMaskInferenceOptions + ner?: MlNerInferenceOptions + pass_through?: MlPassThroughInferenceOptions + text_embedding?: MlTextEmbeddingInferenceOptions + question_answering?: MlQuestionAnsweringInferenceOptions +} + +export interface MlInferenceConfigUpdateContainer { + regression?: MlRegressionInferenceOptions + classification?: MlClassificationInferenceOptions + text_classification?: MlTextClassificationInferenceUpdateOptions + zero_shot_classification?: MlZeroShotClassificationInferenceUpdateOptions + fill_mask?: MlFillMaskInferenceUpdateOptions + ner?: MlNerInferenceUpdateOptions + pass_through?: MlPassThroughInferenceUpdateOptions + text_embedding?: MlTextEmbeddingInferenceUpdateOptions + question_answering?: MlQuestionAnsweringInferenceUpdateOptions +} + +export interface MlInferenceResponseResult { + entities?: MlTrainedModelEntities[] + is_truncated?: boolean + predicted_value?: MlPredictedValue[] + predicted_value_sequence?: string + prediction_probability?: double + prediction_score?: double + top_classes?: MlTopClassEntry[] + warning?: string + feature_importance?: MlTrainedModelInferenceFeatureImportance[] +} + export interface MlInfluence { influencer_field_name: string influencer_field_values: string[] @@ -12203,6 +12289,38 @@ export interface MlModelSnapshot { timestamp: long } +export interface MlNerInferenceOptions { + tokenization?: MlTokenizationConfigContainer + results_field?: string + classification_labels?: string[] +} + +export interface MlNerInferenceUpdateOptions { + tokenization?: MlNlpTokenizationUpdateOptions + results_field?: string +} + +export interface MlNlpBertTokenizationConfig { + do_lower_case?: boolean + with_special_tokens?: boolean + max_sequence_length?: integer + truncate?: MlTokenizationTruncate + span?: integer +} + +export interface MlNlpRobertaTokenizationConfig { + add_prefix_space?: boolean + with_special_tokens?: boolean + max_sequence_length?: integer + truncate?: MlTokenizationTruncate + span?: integer +} + +export interface MlNlpTokenizationUpdateOptions { + truncate?: MlTokenizationTruncate + span?: integer +} + export interface MlOutlierDetectionParameters { compute_feature_influence?: boolean feature_influence_threshold?: double @@ -12231,12 +12349,42 @@ export interface MlPage { size?: integer } +export interface MlPassThroughInferenceOptions { + tokenization?: MlTokenizationConfigContainer + results_field?: string +} + +export interface MlPassThroughInferenceUpdateOptions { + tokenization?: MlNlpTokenizationUpdateOptions + results_field?: string +} + export interface MlPerPartitionCategorization { enabled?: boolean stop_on_warn?: boolean } -export type MlPredictedValue = string | double +export type MlPredictedValue = string | double | boolean | integer + +export interface MlQuestionAnsweringInferenceOptions { + num_top_classes?: integer + tokenization?: MlTokenizationConfigContainer + results_field?: string + max_answer_length?: integer +} + +export interface MlQuestionAnsweringInferenceUpdateOptions { + question: string + num_top_classes?: integer + tokenization?: MlNlpTokenizationUpdateOptions + results_field?: string + max_answer_length?: integer +} + +export interface MlRegressionInferenceOptions { + results_field?: Field + num_top_feature_importance_values?: integer +} export type MlRoutingState = 'failed' | 'started' | 'starting' | 'stopped' | 'stopping' @@ -12253,11 +12401,43 @@ export interface MlRunningStateSearchInterval { start_ms: long } +export interface MlTextClassificationInferenceOptions { + num_top_classes?: integer + tokenization?: MlTokenizationConfigContainer + results_field?: string + classification_labels?: string[] +} + +export interface MlTextClassificationInferenceUpdateOptions { + num_top_classes?: integer + tokenization?: MlNlpTokenizationUpdateOptions + results_field?: string + classification_labels?: string[] +} + +export interface MlTextEmbeddingInferenceOptions { + tokenization?: MlTokenizationConfigContainer + results_field?: string +} + +export interface MlTextEmbeddingInferenceUpdateOptions { + tokenization?: MlNlpTokenizationUpdateOptions + results_field?: string +} + export interface MlTimingStats { elapsed_time: integer iteration_time?: integer } +export interface MlTokenizationConfigContainer { + bert?: MlNlpBertTokenizationConfig + mpnet?: MlNlpBertTokenizationConfig + roberta?: MlNlpRobertaTokenizationConfig +} + +export type MlTokenizationTruncate = 'first' | 'second' | 'none' + export interface MlTopClassEntry { class_name: string class_probability: double @@ -12310,7 +12490,7 @@ export interface MlTrainedModelConfig { description?: string estimated_heap_memory_usage_bytes?: integer estimated_operations?: integer - inference_config: AggregationsInferenceConfigContainer + inference_config: MlInferenceConfigCreateContainer input: MlTrainedModelConfigInput license_level?: string metadata?: MlTrainedModelConfigMetadata @@ -12339,14 +12519,14 @@ export interface MlTrainedModelDeploymentNodesStats { average_inference_time_ms: double error_count: integer inference_count: integer - inference_threads: integer last_access: long - model_threads: integer node: MlDiscoveryNode + number_of_allocations: integer number_of_pending_requests: integer rejection_execution_count: integer routing_state: MlTrainedModelAllocationRoutingTable start_time: long + threads_per_allocation: integer timeout_count: integer } @@ -12354,15 +12534,15 @@ export interface MlTrainedModelDeploymentStats { allocation_status: MlTrainedModelDeploymentAllocationStatus error_count: integer inference_count: integer - inference_threads: integer model_id: Id - model_threads: integer nodes: MlTrainedModelDeploymentNodesStats + number_of_allocations: integer queue_capacity: integer rejected_execution_count: integer reason: string start_time: long state: MlDeploymentState + threads_per_allocation: integer timeout_count: integer } @@ -12374,6 +12554,17 @@ export interface MlTrainedModelEntities { end_pos: integer } +export interface MlTrainedModelInferenceClassImportance { + class_name: string + importance: double +} + +export interface MlTrainedModelInferenceFeatureImportance { + feature_name: string + importance?: double + classes?: MlTrainedModelInferenceClassImportance[] +} + export interface MlTrainedModelInferenceStats { cache_miss_count: integer failure_count: integer @@ -12411,6 +12602,22 @@ export interface MlValidationLoss { loss_type: string } +export interface MlZeroShotClassificationInferenceOptions { + tokenization?: MlTokenizationConfigContainer + hypothesis_template?: string + classification_labels: string[] + results_field?: string + multi_label?: boolean + labels?: string[] +} + +export interface MlZeroShotClassificationInferenceUpdateOptions { + tokenization?: MlNlpTokenizationUpdateOptions + results_field?: string + multi_label?: boolean + labels: string[] +} + export interface MlCloseJobRequest extends RequestBase { job_id: Id allow_no_match?: boolean @@ -12876,42 +13083,43 @@ export interface MlGetJobsResponse { } export interface MlGetMemoryStatsJvmStats { - heap_max: ByteSize + heap_max?: ByteSize heap_max_in_bytes: integer - java_inference: ByteSize + java_inference?: ByteSize java_inference_in_bytes: integer - java_inference_max: ByteSize + java_inference_max?: ByteSize java_inference_max_in_bytes: integer } export interface MlGetMemoryStatsMemMlStats { - anomaly_detectors: ByteSize + anomaly_detectors?: ByteSize anomaly_detectors_in_bytes: integer - data_frame_analytics: ByteSize + data_frame_analytics?: ByteSize data_frame_analytics_in_bytes: integer - max: ByteSize + max?: ByteSize max_in_bytes: integer - native_code_overhead: ByteSize + native_code_overhead?: ByteSize native_code_overhead_in_bytes: integer - native_inference: ByteSize + native_inference?: ByteSize native_inference_in_bytes: integer } export interface MlGetMemoryStatsMemStats { - adjusted_total: ByteSize + adjusted_total?: ByteSize adjusted_total_in_bytes: integer - total: ByteSize + total?: ByteSize total_in_bytes: integer ml: MlGetMemoryStatsMemMlStats } export interface MlGetMemoryStatsMemory { - attributes: string[] + attributes: Record jvm: MlGetMemoryStatsJvmStats mem: MlGetMemoryStatsMemStats name: Name roles: string[] transport_address: TransportAddress + ephemeral_id: Id } export interface MlGetMemoryStatsRequest extends RequestBase { @@ -12923,7 +13131,7 @@ export interface MlGetMemoryStatsRequest extends RequestBase { export interface MlGetMemoryStatsResponse { _nodes: NodeStatistics - cluser_name: Name + cluster_name: Name nodes: Record } @@ -13032,23 +13240,18 @@ export interface MlGetTrainedModelsStatsResponse { trained_model_stats: MlTrainedModelStats[] } -export interface MlInferTrainedModelDeploymentRequest extends RequestBase { +export interface MlInferTrainedModelRequest extends RequestBase { model_id: Id timeout?: Time /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ body?: { - docs: Record[] + docs: Record[] + inference_config?: MlInferenceConfigUpdateContainer } } -export interface MlInferTrainedModelDeploymentResponse { - entities?: MlTrainedModelEntities[] - is_truncated?: boolean - predicted_value?: MlPredictedValue[] - predicted_value_sequence?: string - prediction_probability?: double - top_classes: MlTopClassEntry[] - warning?: string +export interface MlInferTrainedModelResponse { + inference_results: MlInferenceResponseResult[] } export interface MlInfoAnomalyDetectors { @@ -13382,7 +13585,7 @@ export interface MlPutTrainedModelRequest extends RequestBase { compressed_definition?: string definition?: MlPutTrainedModelDefinition description?: string - inference_config: AggregationsInferenceConfigContainer + inference_config: MlInferenceConfigCreateContainer input: MlPutTrainedModelInput metadata?: any model_type?: MlTrainedModelType @@ -13519,9 +13722,9 @@ export interface MlStartDatafeedResponse { export interface MlStartTrainedModelDeploymentRequest extends RequestBase { model_id: Id - inference_threads?: integer - model_threads?: integer + number_of_allocations?: integer queue_capacity?: integer + threads_per_allocation?: integer timeout?: Time wait_for?: MlDeploymentAllocationState } @@ -14981,6 +15184,8 @@ export interface SecurityGlobalPrivilege { application: SecurityApplicationGlobalUserPrivileges } +export type SecurityGrantType = 'password' | 'access_token' + export type SecurityIndexPrivilege = 'none' | 'all' | 'auto_configure' | 'create' | 'create_doc' | 'create_index' | 'delete' | 'delete_index' | 'index' | 'maintenance' | 'manage' | 'manage_follow_index' | 'manage_ilm' | 'manage_leader_index' | 'monitor' | 'read' | 'read_cross_cluster' | 'view_index_metadata' | 'write' export interface SecurityIndicesPrivileges { @@ -15044,6 +15249,44 @@ export interface SecurityUser { enabled: boolean } +export interface SecurityUserProfile { + uid: string + user: SecurityUserProfileUser + data?: Record + labels?: Record + enabled?: boolean +} + +export interface SecurityUserProfileHitMetadata { + _primary_term: long + _seq_no: SequenceNumber +} + +export interface SecurityUserProfileUser { + email?: string | null + full_name?: Name | null + metadata: Metadata + roles: string[] + username: Username +} + +export interface SecurityUserProfileWithMetadata extends SecurityUserProfile { + last_synchronized: long + _doc?: SecurityUserProfileHitMetadata +} + +export interface SecurityActivateUserProfileRequest extends RequestBase { + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + access_token?: string + grant_type: SecurityGrantType + password?: string + username?: string + } +} + +export type SecurityActivateUserProfileResponse = SecurityUserProfileWithMetadata + export interface SecurityAuthenticateRequest extends RequestBase { } @@ -15236,6 +15479,13 @@ export interface SecurityDisableUserRequest extends RequestBase { export interface SecurityDisableUserResponse { } +export interface SecurityDisableUserProfileRequest extends RequestBase { + uid: string + refresh?: Refresh +} + +export type SecurityDisableUserProfileResponse = AcknowledgedResponseBase + export interface SecurityEnableUserRequest extends RequestBase { username: Username refresh?: Refresh @@ -15244,6 +15494,13 @@ export interface SecurityEnableUserRequest extends RequestBase { export interface SecurityEnableUserResponse { } +export interface SecurityEnableUserProfileRequest extends RequestBase { + uid: string + refresh?: Refresh +} + +export type SecurityEnableUserProfileResponse = AcknowledgedResponseBase + export interface SecurityEnrollKibanaRequest extends RequestBase { } @@ -15429,6 +15686,13 @@ export interface SecurityGetUserPrivilegesResponse { run_as: string[] } +export interface SecurityGetUserProfileRequest extends RequestBase { + uid: string + data?: string | string[] +} + +export type SecurityGetUserProfileResponse = Record + export type SecurityGrantApiKeyApiKeyGrantType = 'access_token' | 'password' export interface SecurityGrantApiKeyGrantApiKey { @@ -15472,7 +15736,7 @@ export interface SecurityHasPrivilegesIndexPrivilegesCheck { export type SecurityHasPrivilegesPrivileges = Record export interface SecurityHasPrivilegesRequest extends RequestBase { - user?: Name | null + user?: Name /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ body?: { application?: SecurityHasPrivilegesApplicationPrivilegesCheck[] @@ -15695,8 +15959,46 @@ export interface SecuritySamlServiceProviderMetadataResponse { metadata: string } +export interface SecuritySuggestUserProfilesRequest extends RequestBase { + data?: string | string[] + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + name?: string + size?: long + } +} + +export interface SecuritySuggestUserProfilesResponse { + total: SecuritySuggestUserProfilesTotalUserProfiles + took: long + profiles: SecurityUserProfile[] +} + +export interface SecuritySuggestUserProfilesTotalUserProfiles { + value: long + relation: RelationName +} + +export interface SecurityUpdateUserProfileDataRequest extends RequestBase { + uid: string + if_seq_no?: SequenceNumber + if_primary_term?: long + refresh?: Refresh + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + access?: Record + data?: Record + } +} + +export type SecurityUpdateUserProfileDataResponse = AcknowledgedResponseBase + +export type ShutdownType = 'restart' | 'remove' | 'replace' + export interface ShutdownDeleteNodeRequest extends RequestBase { node_id: NodeId + master_timeout?: TimeUnit + timeout?: TimeUnit } export type ShutdownDeleteNodeResponse = AcknowledgedResponseBase @@ -15722,6 +16024,8 @@ export interface ShutdownGetNodePluginsStatus { export interface ShutdownGetNodeRequest extends RequestBase { node_id?: NodeIds + master_timeout?: TimeUnit + timeout?: TimeUnit } export interface ShutdownGetNodeResponse { @@ -15738,6 +16042,15 @@ export type ShutdownGetNodeShutdownType = 'remove' | 'restart' export interface ShutdownPutNodeRequest extends RequestBase { node_id: NodeId + master_timeout?: TimeUnit + timeout?: TimeUnit + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + type: ShutdownType + reason: string + allocation_delay?: string + target_node_name?: string + } } export type ShutdownPutNodeResponse = AcknowledgedResponseBase @@ -16130,7 +16443,7 @@ export interface SnapshotRestoreRequest extends RequestBase { ignore_unavailable?: boolean include_aliases?: boolean include_global_state?: boolean - index_settings?: IndicesPutSettingsRequest + index_settings?: IndicesIndexSettings indices?: Indices partial?: boolean rename_pattern?: string @@ -16687,7 +17000,7 @@ export interface TransformUpdateTransformRequest extends RequestBase { source?: TransformSource settings?: TransformSettings sync?: TransformSyncContainer - retention_policy?: TransformRetentionPolicyContainer + retention_policy?: TransformRetentionPolicyContainer | null } }