Skip to content

Commit 71f85b9

Browse files
committed
Update APIs to 8.7.0
1 parent b34188c commit 71f85b9

File tree

12 files changed

+1347
-738
lines changed

12 files changed

+1347
-738
lines changed

docs/observability.asciidoc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,6 @@ request: {
154154

155155
The event order is described in the following graph, in some edge cases, the
156156
order is not guaranteed.
157-
You can find in
158-
https://github.com/elastic/elasticsearch-js/blob/main/test/acceptance/events-order.test.js[`test/acceptance/events-order.test.js`]
159-
how the order changes based on the situation.
160157

161158
[source]
162159
----

docs/reference.asciidoc

Lines changed: 427 additions & 389 deletions
Large diffs are not rendered by default.

src/api/api/cluster.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ export default class Cluster {
279279
async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): Promise<T.ClusterPutComponentTemplateResponse>
280280
async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): Promise<any> {
281281
const acceptedPath: string[] = ['name']
282-
const acceptedBody: string[] = ['template', 'aliases', 'mappings', 'settings', 'version', '_meta']
282+
const acceptedBody: string[] = ['template', 'version', '_meta', 'allow_auto_create']
283283
const querystring: Record<string, any> = {}
284284
// @ts-expect-error
285285
const userBody: any = params?.body

src/api/api/field_caps.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ import * as T from '../types'
3737
import * as TB from '../typesWithBodyKey'
3838
interface That { transport: Transport }
3939

40-
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FieldCapsResponse>
41-
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FieldCapsResponse, unknown>>
42-
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<T.FieldCapsResponse>
43-
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<any> {
40+
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FieldCapsResponse>
41+
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FieldCapsResponse, unknown>>
42+
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<T.FieldCapsResponse>
43+
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<any> {
4444
const acceptedPath: string[] = ['index']
45-
const acceptedBody: string[] = ['index_filter', 'runtime_mappings']
45+
const acceptedBody: string[] = ['fields', 'index_filter', 'runtime_mappings']
4646
const querystring: Record<string, any> = {}
4747
// @ts-expect-error
4848
const userBody: any = params?.body
@@ -53,6 +53,7 @@ export default async function FieldCapsApi (this: That, params: T.FieldCapsReque
5353
body = userBody != null ? { ...userBody } : undefined
5454
}
5555

56+
params = params ?? {}
5657
for (const key in params) {
5758
if (acceptedBody.includes(key)) {
5859
body = body ?? {}

src/api/api/health_report.ts

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
/* eslint-disable import/export */
21+
/* eslint-disable @typescript-eslint/no-misused-new */
22+
/* eslint-disable @typescript-eslint/no-extraneous-class */
23+
/* eslint-disable @typescript-eslint/no-unused-vars */
24+
25+
// This file was automatically generated by elastic/elastic-client-generator-js
26+
// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file,
27+
// and elastic/elastic-client-generator-js to regenerate this file again.
28+
29+
import {
30+
Transport,
31+
TransportRequestOptions,
32+
TransportRequestOptionsWithMeta,
33+
TransportRequestOptionsWithOutMeta,
34+
TransportResult
35+
} from '@elastic/transport'
36+
import * as T from '../types'
37+
import * as TB from '../typesWithBodyKey'
38+
interface That { transport: Transport }
39+
40+
export default async function HealthReportApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
41+
export default async function HealthReportApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
42+
export default async function HealthReportApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
43+
export default async function HealthReportApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
44+
const acceptedPath: string[] = ['feature']
45+
const querystring: Record<string, any> = {}
46+
const body = undefined
47+
48+
params = params ?? {}
49+
for (const key in params) {
50+
if (acceptedPath.includes(key)) {
51+
continue
52+
} else if (key !== 'body') {
53+
querystring[key] = params[key]
54+
}
55+
}
56+
57+
let method = ''
58+
let path = ''
59+
if (params.feature != null) {
60+
method = 'GET'
61+
path = `/_health_report/${encodeURIComponent(params.feature.toString())}`
62+
} else {
63+
method = 'GET'
64+
path = '/_health_report'
65+
}
66+
return await this.transport.request({ path, method, querystring, body }, options)
67+
}

src/api/api/license.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ export default class License {
135135
return await this.transport.request({ path, method, querystring, body }, options)
136136
}
137137

138-
async post (this: That, params: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LicensePostResponse>
139-
async post (this: That, params: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.LicensePostResponse, unknown>>
140-
async post (this: That, params: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptions): Promise<T.LicensePostResponse>
141-
async post (this: That, params: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptions): Promise<any> {
138+
async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LicensePostResponse>
139+
async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.LicensePostResponse, unknown>>
140+
async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptions): Promise<T.LicensePostResponse>
141+
async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptions): Promise<any> {
142142
const acceptedPath: string[] = []
143143
const acceptedBody: string[] = ['license', 'licenses']
144144
const querystring: Record<string, any> = {}
@@ -151,6 +151,7 @@ export default class License {
151151
body = userBody != null ? { ...userBody } : undefined
152152
}
153153

154+
params = params ?? {}
154155
for (const key in params) {
155156
if (acceptedBody.includes(key)) {
156157
body = body ?? {}

src/api/api/ml.ts

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@ export default class Ml {
4343
this.transport = transport
4444
}
4545

46-
async clearTrainedModelDeploymentCache (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
47-
async clearTrainedModelDeploymentCache (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
48-
async clearTrainedModelDeploymentCache (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
49-
async clearTrainedModelDeploymentCache (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
46+
async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MlClearTrainedModelDeploymentCacheResponse>
47+
async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MlClearTrainedModelDeploymentCacheResponse, unknown>>
48+
async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptions): Promise<T.MlClearTrainedModelDeploymentCacheResponse>
49+
async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptions): Promise<any> {
5050
const acceptedPath: string[] = ['model_id']
5151
const querystring: Record<string, any> = {}
5252
const body = undefined
5353

54-
params = params ?? {}
5554
for (const key in params) {
5655
if (acceptedPath.includes(key)) {
5756
continue
5857
} else if (key !== 'body') {
58+
// @ts-expect-error
5959
querystring[key] = params[key]
6060
}
6161
}
@@ -2006,7 +2006,7 @@ export default class Ml {
20062006
async updateDatafeed (this: That, params: T.MlUpdateDatafeedRequest | TB.MlUpdateDatafeedRequest, options?: TransportRequestOptions): Promise<T.MlUpdateDatafeedResponse>
20072007
async updateDatafeed (this: That, params: T.MlUpdateDatafeedRequest | TB.MlUpdateDatafeedRequest, options?: TransportRequestOptions): Promise<any> {
20082008
const acceptedPath: string[] = ['datafeed_id']
2009-
const acceptedBody: string[] = ['aggregations', 'chunking_config', 'delayed_data_check_config', 'frequency', 'indices', 'indexes', 'indices_options', 'max_empty_searches', 'query', 'query_delay', 'runtime_mappings', 'script_fields', 'scroll_size']
2009+
const acceptedBody: string[] = ['aggregations', 'chunking_config', 'delayed_data_check_config', 'frequency', 'indices', 'indexes', 'indices_options', 'job_id', 'max_empty_searches', 'query', 'query_delay', 'runtime_mappings', 'script_fields', 'scroll_size']
20102010
const querystring: Record<string, any> = {}
20112011
// @ts-expect-error
20122012
const userBody: any = params?.body
@@ -2074,7 +2074,7 @@ export default class Ml {
20742074
async updateJob (this: That, params: T.MlUpdateJobRequest | TB.MlUpdateJobRequest, options?: TransportRequestOptions): Promise<T.MlUpdateJobResponse>
20752075
async updateJob (this: That, params: T.MlUpdateJobRequest | TB.MlUpdateJobRequest, options?: TransportRequestOptions): Promise<any> {
20762076
const acceptedPath: string[] = ['job_id']
2077-
const acceptedBody: string[] = ['allow_lazy_open', 'analysis_limits', 'background_persist_interval', 'custom_settings', 'categorization_filters', 'description', 'model_plot_config', 'daily_model_snapshot_retention_after_days', 'model_snapshot_retention_days', 'renormalization_window_days', 'results_retention_days', 'groups', 'detectors', 'per_partition_categorization']
2077+
const acceptedBody: string[] = ['allow_lazy_open', 'analysis_limits', 'background_persist_interval', 'custom_settings', 'categorization_filters', 'description', 'model_plot_config', 'model_prune_window', 'daily_model_snapshot_retention_after_days', 'model_snapshot_retention_days', 'renormalization_window_days', 'results_retention_days', 'groups', 'detectors', 'per_partition_categorization']
20782078
const querystring: Record<string, any> = {}
20792079
// @ts-expect-error
20802080
const userBody: any = params?.body
@@ -2137,6 +2137,28 @@ export default class Ml {
21372137
return await this.transport.request({ path, method, querystring, body }, options)
21382138
}
21392139

2140+
async updateTrainedModelDeployment (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
2141+
async updateTrainedModelDeployment (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
2142+
async updateTrainedModelDeployment (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
2143+
async updateTrainedModelDeployment (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
2144+
const acceptedPath: string[] = ['model_id']
2145+
const querystring: Record<string, any> = {}
2146+
const body = undefined
2147+
2148+
params = params ?? {}
2149+
for (const key in params) {
2150+
if (acceptedPath.includes(key)) {
2151+
continue
2152+
} else if (key !== 'body') {
2153+
querystring[key] = params[key]
2154+
}
2155+
}
2156+
2157+
const method = 'POST'
2158+
const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/deployment/_update`
2159+
return await this.transport.request({ path, method, querystring, body }, options)
2160+
}
2161+
21402162
async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest | TB.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MlUpgradeJobSnapshotResponse>
21412163
async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest | TB.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MlUpgradeJobSnapshotResponse, unknown>>
21422164
async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest | TB.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptions): Promise<T.MlUpgradeJobSnapshotResponse>

src/api/api/search_mvt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default async function SearchMvtApi (this: That, params: T.SearchMvtReque
4242
export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptions): Promise<T.SearchMvtResponse>
4343
export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptions): Promise<any> {
4444
const acceptedPath: string[] = ['index', 'field', 'zoom', 'x', 'y']
45-
const acceptedBody: string[] = ['aggs', 'exact_bounds', 'extent', 'fields', 'grid_precision', 'grid_type', 'query', 'runtime_mappings', 'size', 'sort', 'track_total_hits']
45+
const acceptedBody: string[] = ['aggs', 'buffer', 'exact_bounds', 'extent', 'fields', 'grid_agg', 'grid_precision', 'grid_type', 'query', 'runtime_mappings', 'size', 'sort', 'track_total_hits', 'with_labels']
4646
const querystring: Record<string, any> = {}
4747
// @ts-expect-error
4848
const userBody: any = params?.body

src/api/api/transform.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,28 @@ export default class Transform {
215215
return await this.transport.request({ path, method, querystring, body }, options)
216216
}
217217

218+
async scheduleNowTransform (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
219+
async scheduleNowTransform (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
220+
async scheduleNowTransform (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
221+
async scheduleNowTransform (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
222+
const acceptedPath: string[] = ['transform_id']
223+
const querystring: Record<string, any> = {}
224+
const body = undefined
225+
226+
params = params ?? {}
227+
for (const key in params) {
228+
if (acceptedPath.includes(key)) {
229+
continue
230+
} else if (key !== 'body') {
231+
querystring[key] = params[key]
232+
}
233+
}
234+
235+
const method = 'POST'
236+
const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_schedule_now`
237+
return await this.transport.request({ path, method, querystring, body }, options)
238+
}
239+
218240
async startTransform (this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformStartTransformResponse>
219241
async startTransform (this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformStartTransformResponse, unknown>>
220242
async startTransform (this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptions): Promise<T.TransformStartTransformResponse>

src/api/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import getScriptContextApi from './api/get_script_context'
5555
import getScriptLanguagesApi from './api/get_script_languages'
5656
import getSourceApi from './api/get_source'
5757
import GraphApi from './api/graph'
58+
import healthReportApi from './api/health_report'
5859
import IlmApi from './api/ilm'
5960
import indexApi from './api/index'
6061
import IndicesApi from './api/indices'
@@ -134,6 +135,7 @@ export default interface API {
134135
getScriptLanguages: typeof getScriptLanguagesApi
135136
getSource: typeof getSourceApi
136137
graph: GraphApi
138+
healthReport: typeof healthReportApi
137139
ilm: IlmApi
138140
index: typeof indexApi
139141
indices: IndicesApi
@@ -306,6 +308,7 @@ API.prototype.getScript = getScriptApi
306308
API.prototype.getScriptContext = getScriptContextApi
307309
API.prototype.getScriptLanguages = getScriptLanguagesApi
308310
API.prototype.getSource = getSourceApi
311+
API.prototype.healthReport = healthReportApi
309312
API.prototype.index = indexApi
310313
API.prototype.info = infoApi
311314
API.prototype.knnSearch = knnSearchApi

0 commit comments

Comments
 (0)