Auto-generated code for 8.14 (#2253)

This commit is contained in:
Elastic Machine
2024-05-09 20:43:41 +01:00
committed by GitHub
parent aeda5cc9c7
commit 24a471cf7a
4 changed files with 19 additions and 10 deletions

View File

@ -2483,7 +2483,6 @@ that uses deprecated components, Elasticsearch will emit a deprecation warning.
** *`create` (Optional, boolean)*: If `true`, this request cannot replace or update existing component templates. ** *`create` (Optional, boolean)*: If `true`, this request cannot replace or update existing component templates.
** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node. ** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node.
If no response is received before the timeout expires, the request fails and returns an error. If no response is received before the timeout expires, the request fails and returns an error.
** *`cause` (Optional, string)*
[discrete] [discrete]
==== put_settings ==== put_settings
@ -2814,7 +2813,7 @@ Executes an ESQL request
{ref}/esql-rest.html[Endpoint documentation] {ref}/esql-rest.html[Endpoint documentation]
[source,ts] [source,ts]
---- ----
client.esql.query({ query, version }) client.esql.query({ query })
---- ----
[discrete] [discrete]
@ -2822,11 +2821,11 @@ client.esql.query({ query, version })
* *Request (object):* * *Request (object):*
** *`query` (string)*: The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results. ** *`query` (string)*: The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results.
** *`version` (Enum("2024.04.01"))*: The version of the ES|QL language in which the "query" field was written.
** *`columnar` (Optional, boolean)*: By default, ES|QL returns results as rows. For example, FROM returns each individual document as one row. For the JSON, YAML, CBOR and smile formats, ES|QL can return the results in a columnar fashion where one row represents all the values of a certain column in the results. ** *`columnar` (Optional, boolean)*: By default, ES|QL returns results as rows. For example, FROM returns each individual document as one row. For the JSON, YAML, CBOR and smile formats, ES|QL can return the results in a columnar fashion where one row represents all the values of a certain column in the results.
** *`filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Specify a Query DSL query in the filter parameter to filter the set of documents that an ES|QL query runs on. ** *`filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Specify a Query DSL query in the filter parameter to filter the set of documents that an ES|QL query runs on.
** *`locale` (Optional, string)* ** *`locale` (Optional, string)*
** *`params` (Optional, number | number | string | boolean | null[])*: To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters. ** *`params` (Optional, number | number | string | boolean | null[])*: To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters.
** *`version` (Optional, Enum("2024.04.01"))*: The version of the ES|QL language in which the "query" field was written.
** *`format` (Optional, string)*: A short version of the Accept header, e.g. json, yaml. ** *`format` (Optional, string)*: A short version of the Accept header, e.g. json, yaml.
** *`delimiter` (Optional, string)*: The character to use between values within a CSV row. Only valid for the CSV format. ** *`delimiter` (Optional, string)*: The character to use between values within a CSV row. Only valid for the CSV format.
@ -4253,7 +4252,7 @@ a new date field is added instead of string.
not used at all by Elasticsearch, but can be used to store not used at all by Elasticsearch, but can be used to store
application-specific metadata. application-specific metadata.
** *`numeric_detection` (Optional, boolean)*: Automatically map strings into numeric data types for all fields. ** *`numeric_detection` (Optional, boolean)*: Automatically map strings into numeric data types for all fields.
** *`properties` (Optional, Record<string, { type } | { boost, fielddata, index, null_value, type } | { type, enabled, null_value, boost, coerce, script, on_script_error, ignore_malformed, time_series_metric, analyzer, eager_global_ordinals, index, index_options, index_phrases, index_prefixes, norms, position_increment_gap, search_analyzer, search_quote_analyzer, term_vector, format, precision_step, locale } | { relations, eager_global_ordinals, type } | { boost, eager_global_ordinals, index, index_options, normalizer, norms, null_value, split_queries_on_whitespace, time_series_dimension, type } | { type, fields, meta, copy_to } | { type } | { positive_score_impact, type } | { positive_score_impact, type } | { analyzer, index, index_options, max_shingle_size, norms, search_analyzer, search_quote_analyzer, term_vector, type } | { analyzer, boost, eager_global_ordinals, fielddata, fielddata_frequency_filter, index, index_options, index_phrases, index_prefixes, norms, position_increment_gap, search_analyzer, search_quote_analyzer, term_vector, type } | { type } | { type, null_value } | { boost, format, ignore_malformed, index, null_value, precision_step, type } | { boost, fielddata, format, ignore_malformed, index, null_value, precision_step, locale, type } | { type, default_metric, metrics, time_series_metric } | { type, dims, similarity, index, index_options } | { type } | { boost, depth_limit, doc_values, eager_global_ordinals, index, index_options, null_value, similarity, split_queries_on_whitespace, type } | { enabled, include_in_parent, include_in_root, type } | { enabled, subobjects, type } | { analyzer, contexts, max_input_length, preserve_position_increments, preserve_separators, search_analyzer, type } | { value, type } | { path, type } | { ignore_malformed, type } | { boost, index, ignore_malformed, null_value, on_script_error, script, time_series_dimension, type } | { type } | { analyzer, boost, index, null_value, enable_position_increments, type } | { ignore_malformed, ignore_z_value, null_value, index, on_script_error, script, type } | { coerce, ignore_malformed, ignore_z_value, orientation, strategy, type } | { ignore_malformed, ignore_z_value, null_value, type } | { coerce, ignore_malformed, ignore_z_value, orientation, type } | { type, null_value } | { type, null_value } | { type, null_value } | { type, null_value } | { type, null_value } | { type, null_value } | { type, null_value, scaling_factor } | { type, null_value } | { type, null_value } | { format, type } | { type } | { type } | { type } | { type } | { type }>)*: Mapping for a field. For new fields, this mapping can include: ** *`properties` (Optional, Record<string, { type } | { boost, fielddata, index, null_value, type } | { type, enabled, null_value, boost, coerce, script, on_script_error, ignore_malformed, time_series_metric, analyzer, eager_global_ordinals, index, index_options, index_phrases, index_prefixes, norms, position_increment_gap, search_analyzer, search_quote_analyzer, term_vector, format, precision_step, locale } | { relations, eager_global_ordinals, type } | { boost, eager_global_ordinals, index, index_options, normalizer, norms, null_value, split_queries_on_whitespace, time_series_dimension, type } | { type, fields, meta, copy_to } | { type } | { positive_score_impact, type } | { positive_score_impact, type } | { analyzer, index, index_options, max_shingle_size, norms, search_analyzer, search_quote_analyzer, term_vector, type } | { analyzer, boost, eager_global_ordinals, fielddata, fielddata_frequency_filter, index, index_options, index_phrases, index_prefixes, norms, position_increment_gap, search_analyzer, search_quote_analyzer, term_vector, type } | { type } | { type, null_value } | { boost, format, ignore_malformed, index, null_value, precision_step, type } | { boost, fielddata, format, ignore_malformed, index, null_value, precision_step, locale, type } | { type, default_metric, metrics, time_series_metric } | { type, element_type, dims, similarity, index, index_options } | { type } | { boost, depth_limit, doc_values, eager_global_ordinals, index, index_options, null_value, similarity, split_queries_on_whitespace, type } | { enabled, include_in_parent, include_in_root, type } | { enabled, subobjects, type } | { analyzer, contexts, max_input_length, preserve_position_increments, preserve_separators, search_analyzer, type } | { value, type } | { path, type } | { ignore_malformed, type } | { boost, index, ignore_malformed, null_value, on_script_error, script, time_series_dimension, type } | { type } | { analyzer, boost, index, null_value, enable_position_increments, type } | { ignore_malformed, ignore_z_value, null_value, index, on_script_error, script, type } | { coerce, ignore_malformed, ignore_z_value, orientation, strategy, type } | { ignore_malformed, ignore_z_value, null_value, type } | { coerce, ignore_malformed, ignore_z_value, orientation, type } | { type, null_value } | { type, null_value } | { type, null_value } | { type, null_value } | { type, null_value } | { type, null_value } | { type, null_value, scaling_factor } | { type, null_value } | { type, null_value } | { format, type } | { type } | { type } | { type } | { type } | { type }>)*: Mapping for a field. For new fields, this mapping can include:
- Field name - Field name
- Field data type - Field data type

View File

@ -63,6 +63,12 @@ export default class Esql {
body = userBody != null ? { ...userBody } : undefined body = userBody != null ? { ...userBody } : undefined
} }
// a version number is required for all ES|QL queries.
// inject a default value if none is provided.
if (typeof body === 'object' && body.version == null) {
body.version = '2024.04.01'
}
for (const key in params) { for (const key in params) {
if (acceptedBody.includes(key)) { if (acceptedBody.includes(key)) {
body = body ?? {} body = body ?? {}

View File

@ -2760,7 +2760,7 @@ export interface WriteResponseBase {
_index: IndexName _index: IndexName
_primary_term?: long _primary_term?: long
result: Result result: Result
_seq_no: SequenceNumber _seq_no?: SequenceNumber
_shards: ShardStatistics _shards: ShardStatistics
_version: VersionNumber _version: VersionNumber
forced_refresh?: boolean forced_refresh?: boolean
@ -2787,6 +2787,7 @@ export interface AggregationsAdjacencyMatrixAggregate extends AggregationsMultiB
export interface AggregationsAdjacencyMatrixAggregation extends AggregationsBucketAggregationBase { export interface AggregationsAdjacencyMatrixAggregation extends AggregationsBucketAggregationBase {
filters?: Record<string, QueryDslQueryContainer> filters?: Record<string, QueryDslQueryContainer>
separator?: string
} }
export interface AggregationsAdjacencyMatrixBucketKeys extends AggregationsMultiBucketBase { export interface AggregationsAdjacencyMatrixBucketKeys extends AggregationsMultiBucketBase {
@ -4901,6 +4902,7 @@ export interface MappingDenseVectorIndexOptions {
export interface MappingDenseVectorProperty extends MappingPropertyBase { export interface MappingDenseVectorProperty extends MappingPropertyBase {
type: 'dense_vector' type: 'dense_vector'
element_type?: string
dims?: integer dims?: integer
similarity?: string similarity?: string
index?: boolean index?: boolean
@ -8584,7 +8586,6 @@ export interface ClusterPutComponentTemplateRequest extends RequestBase {
name: Name name: Name
create?: boolean create?: boolean
master_timeout?: Duration master_timeout?: Duration
cause?: string
template: IndicesIndexState template: IndicesIndexState
version?: VersionNumber version?: VersionNumber
_meta?: Metadata _meta?: Metadata
@ -9662,7 +9663,7 @@ export interface EsqlQueryRequest extends RequestBase {
locale?: string locale?: string
params?: ScalarValue[] params?: ScalarValue[]
query: string query: string
version: EsqlEsqlVersion version?: EsqlEsqlVersion
} }
export type EsqlQueryResponse = EsqlColumns export type EsqlQueryResponse = EsqlColumns
@ -12186,6 +12187,7 @@ export interface IngestProcessorContainer {
export interface IngestRemoveProcessor extends IngestProcessorBase { export interface IngestRemoveProcessor extends IngestProcessorBase {
field: Fields field: Fields
keep?: Fields
ignore_missing?: boolean ignore_missing?: boolean
} }

View File

@ -2833,7 +2833,7 @@ export interface WriteResponseBase {
_index: IndexName _index: IndexName
_primary_term?: long _primary_term?: long
result: Result result: Result
_seq_no: SequenceNumber _seq_no?: SequenceNumber
_shards: ShardStatistics _shards: ShardStatistics
_version: VersionNumber _version: VersionNumber
forced_refresh?: boolean forced_refresh?: boolean
@ -2860,6 +2860,7 @@ export interface AggregationsAdjacencyMatrixAggregate extends AggregationsMultiB
export interface AggregationsAdjacencyMatrixAggregation extends AggregationsBucketAggregationBase { export interface AggregationsAdjacencyMatrixAggregation extends AggregationsBucketAggregationBase {
filters?: Record<string, QueryDslQueryContainer> filters?: Record<string, QueryDslQueryContainer>
separator?: string
} }
export interface AggregationsAdjacencyMatrixBucketKeys extends AggregationsMultiBucketBase { export interface AggregationsAdjacencyMatrixBucketKeys extends AggregationsMultiBucketBase {
@ -4974,6 +4975,7 @@ export interface MappingDenseVectorIndexOptions {
export interface MappingDenseVectorProperty extends MappingPropertyBase { export interface MappingDenseVectorProperty extends MappingPropertyBase {
type: 'dense_vector' type: 'dense_vector'
element_type?: string
dims?: integer dims?: integer
similarity?: string similarity?: string
index?: boolean index?: boolean
@ -8676,7 +8678,6 @@ export interface ClusterPutComponentTemplateRequest extends RequestBase {
name: Name name: Name
create?: boolean create?: boolean
master_timeout?: Duration master_timeout?: Duration
cause?: string
/** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */
body?: { body?: {
template: IndicesIndexState template: IndicesIndexState
@ -9819,7 +9820,7 @@ export interface EsqlQueryRequest extends RequestBase {
locale?: string locale?: string
params?: ScalarValue[] params?: ScalarValue[]
query: string query: string
version: EsqlEsqlVersion version?: EsqlEsqlVersion
} }
} }
@ -12411,6 +12412,7 @@ export interface IngestProcessorContainer {
export interface IngestRemoveProcessor extends IngestProcessorBase { export interface IngestRemoveProcessor extends IngestProcessorBase {
field: Fields field: Fields
keep?: Fields
ignore_missing?: boolean ignore_missing?: boolean
} }