From 3190b60cb5c407d698d5998f533e36e7a32980c8 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Tue, 19 Mar 2024 17:28:43 +0100 Subject: [PATCH] Auto-generated code for 8.13 (#2158) --- docs/reference.asciidoc | 25 +++++++---- src/api/api/ml.ts | 2 +- src/api/api/security.ts | 2 +- src/api/types.ts | 88 +++++++++++++++++++++++++++---------- src/api/typesWithBodyKey.ts | 88 +++++++++++++++++++++++++++---------- 5 files changed, 149 insertions(+), 56 deletions(-) diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index aab9bb7a3..c5bf3b62a 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -3377,7 +3377,7 @@ client.indices.create({ index }) * *Request (object):* ** *`index` (string)*: Name of the index you wish to create. ** *`aliases` (Optional, Record)*: Aliases for the index. -** *`mappings` (Optional, { all_field, date_detection, dynamic, dynamic_date_formats, dynamic_templates, _field_names, index_field, _meta, numeric_detection, properties, _routing, _size, _source, runtime, enabled, _data_stream_timestamp })*: Mapping for fields in the index. If specified, this mapping can include: +** *`mappings` (Optional, { all_field, date_detection, dynamic, dynamic_date_formats, dynamic_templates, _field_names, index_field, _meta, numeric_detection, properties, _routing, _size, _source, runtime, enabled, subobjects, _data_stream_timestamp })*: Mapping for fields in the index. If specified, this mapping can include: - Field names - Field data types - Mapping parameters @@ -4234,7 +4234,7 @@ a new date field is added instead of string. not used at all by Elasticsearch, but can be used to store application-specific metadata. ** *`numeric_detection` (Optional, boolean)*: Automatically map strings into numeric data types for all fields. -** *`properties` (Optional, Record)*: Mapping for a field. For new fields, this mapping can include: +** *`properties` (Optional, Record)*: Mapping for a field. For new fields, this mapping can include: - Field name - Field data type @@ -4309,7 +4309,7 @@ client.indices.putTemplate({ name }) ** *`aliases` (Optional, Record)*: Aliases for the index. ** *`index_patterns` (Optional, string | string[])*: Array of wildcard expressions used to match the names of indices during creation. -** *`mappings` (Optional, { all_field, date_detection, dynamic, dynamic_date_formats, dynamic_templates, _field_names, index_field, _meta, numeric_detection, properties, _routing, _size, _source, runtime, enabled, _data_stream_timestamp })*: Mapping for fields in the index. +** *`mappings` (Optional, { all_field, date_detection, dynamic, dynamic_date_formats, dynamic_templates, _field_names, index_field, _meta, numeric_detection, properties, _routing, _size, _source, runtime, enabled, subobjects, _data_stream_timestamp })*: Mapping for fields in the index. ** *`order` (Optional, number)*: Order in which Elasticsearch applies this template if index matches multiple templates. @@ -4462,7 +4462,7 @@ If specified, Elasticsearch only performs the rollover if the current index sati If this parameter is not specified, Elasticsearch performs the rollover unconditionally. If conditions are specified, at least one of them must be a `max_*` condition. The index will rollover if any `max_*` condition is satisfied and all `min_*` conditions are satisfied. -** *`mappings` (Optional, { all_field, date_detection, dynamic, dynamic_date_formats, dynamic_templates, _field_names, index_field, _meta, numeric_detection, properties, _routing, _size, _source, runtime, enabled, _data_stream_timestamp })*: Mapping for fields in the index. +** *`mappings` (Optional, { all_field, date_detection, dynamic, dynamic_date_formats, dynamic_templates, _field_names, index_field, _meta, numeric_detection, properties, _routing, _size, _source, runtime, enabled, subobjects, _data_stream_timestamp })*: Mapping for fields in the index. If specified, this mapping can include field names, field data types, and mapping paramaters. ** *`settings` (Optional, Record)*: Configuration options for the index. Data streams do not support this parameter. @@ -6436,6 +6436,7 @@ so one of, `linux-x86_64`, `linux-aarch64`, `darwin-x86_64`, `darwin-aarch64`, or `windows-x86_64`. For portable models (those that work independent of processor architecture or OS features), leave this field unset. ** *`tags` (Optional, string[])*: An array of tags to organize the model. +** *`prefix_strings` (Optional, { ingest, search })*: Optional prefix strings applied at inference ** *`defer_definition_decompression` (Optional, boolean)*: If set to `true` and a `compressed_definition` is provided, the request defers definition decompression and skips relevant validations. [discrete] @@ -8313,9 +8314,17 @@ client.security.queryApiKeys({ ... }) ==== Arguments * *Request (object):* -** *`query` (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 })*: A query to filter which API keys to return. -The query supports a subset of query types, including `match_all`, `bool`, `term`, `terms`, `ids`, `prefix`, `wildcard`, and `range`. -You can query all public information associated with an API key. +** *`aggregations` (Optional, Record)*: Any aggregations to run over the corpus of returned API keys. +Aggregations and queries work together. Aggregations are computed only on the API keys that match the query. +This supports only a subset of aggregation types, namely: `terms`, `range`, `date_range`, `missing`, +`cardinality`, `value_count`, `composite`, `filter`, and `filters`. +Additionally, aggregations only run over the same subset of fields that query works with. +** *`query` (Optional, { bool, exists, ids, match, match_all, prefix, range, simple_query_string, term, terms, wildcard })*: A query to filter which API keys to return. +If the query parameter is missing, it is equivalent to a `match_all` query. +The query supports a subset of query types, including `match_all`, `bool`, `term`, `terms`, `match`, +`ids`, `prefix`, `wildcard`, `exists`, `range`, and `simple_query_string`. +You can query the following public information associated with an API key: `id`, `type`, `name`, +`creation`, `expiration`, `invalidated`, `invalidation`, `username`, `realm`, and `metadata`. ** *`from` (Optional, number)*: Starting document offset. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the `search_after` parameter. @@ -8325,7 +8334,7 @@ In addition, sort can also be applied to the `_doc` field to sort by index order By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters. To page through more hits, use the `search_after` parameter. ** *`search_after` (Optional, number | number | string | boolean | null | User-defined value[])*: Search after definition -** *`with_limited_by` (Optional, boolean)*: Return the snapshot of the owner user's role descriptors associated with the API key. +** *`with_limited_by` (Optional, boolean)*: Return the snapshot of the owner user's role descriptors associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors. [discrete] diff --git a/src/api/api/ml.ts b/src/api/api/ml.ts index 75fbc818f..c100e7315 100644 --- a/src/api/api/ml.ts +++ b/src/api/api/ml.ts @@ -1821,7 +1821,7 @@ export default class Ml { async putTrainedModel (this: That, params: T.MlPutTrainedModelRequest | TB.MlPutTrainedModelRequest, options?: TransportRequestOptions): Promise async putTrainedModel (this: That, params: T.MlPutTrainedModelRequest | TB.MlPutTrainedModelRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_id'] - const acceptedBody: string[] = ['compressed_definition', 'definition', 'description', 'inference_config', 'input', 'metadata', 'model_type', 'model_size_bytes', 'platform_architecture', 'tags'] + const acceptedBody: string[] = ['compressed_definition', 'definition', 'description', 'inference_config', 'input', 'metadata', 'model_type', 'model_size_bytes', 'platform_architecture', 'tags', 'prefix_strings'] const querystring: Record = {} // @ts-expect-error const userBody: any = params?.body diff --git a/src/api/api/security.ts b/src/api/api/security.ts index 51a0dee80..6ce0ffd42 100644 --- a/src/api/api/security.ts +++ b/src/api/api/security.ts @@ -1502,7 +1502,7 @@ export default class Security { async queryApiKeys (this: That, params?: T.SecurityQueryApiKeysRequest | TB.SecurityQueryApiKeysRequest, options?: TransportRequestOptions): Promise async queryApiKeys (this: That, params?: T.SecurityQueryApiKeysRequest | TB.SecurityQueryApiKeysRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] - const acceptedBody: string[] = ['query', 'from', 'sort', 'size', 'search_after'] + const acceptedBody: string[] = ['aggregations', 'aggs', 'query', 'from', 'sort', 'size', 'search_after'] const querystring: Record = {} // @ts-expect-error const userBody: any = params?.body diff --git a/src/api/types.ts b/src/api/types.ts index f2f82414d..600a6336d 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -5095,6 +5095,7 @@ export interface MappingNumberPropertyBase extends MappingDocValuesPropertyBase export interface MappingObjectProperty extends MappingCorePropertyBase { enabled?: boolean + subobjects?: boolean type?: 'object' } @@ -5269,6 +5270,7 @@ export interface MappingTypeMapping { _source?: MappingSourceField runtime?: Record enabled?: boolean + subobjects?: boolean _data_stream_timestamp?: MappingDataStreamTimestamp } @@ -9747,7 +9749,7 @@ export interface IndicesIndexSettingsKeys { settings?: IndicesIndexSettings time_series?: IndicesIndexSettingsTimeSeries queries?: IndicesQueries - similarity?: IndicesSettingsSimilarity + similarity?: Record mapping?: IndicesMappingLimitSettings 'indexing.slowlog'?: IndicesIndexingSlowlogSettings indexing_pressure?: IndicesIndexingPressure @@ -9925,55 +9927,52 @@ export interface IndicesSettingsSearch { slowlog?: IndicesSlowlogSettings } -export interface IndicesSettingsSimilarity { - bm25?: IndicesSettingsSimilarityBm25 - dfi?: IndicesSettingsSimilarityDfi - dfr?: IndicesSettingsSimilarityDfr - ib?: IndicesSettingsSimilarityIb - lmd?: IndicesSettingsSimilarityLmd - lmj?: IndicesSettingsSimilarityLmj - scripted_tfidf?: IndicesSettingsSimilarityScriptedTfidf -} +export type IndicesSettingsSimilarity = IndicesSettingsSimilarityBm25 | IndicesSettingsSimilarityBoolean | IndicesSettingsSimilarityDfi | IndicesSettingsSimilarityDfr | IndicesSettingsSimilarityIb | IndicesSettingsSimilarityLmd | IndicesSettingsSimilarityLmj | IndicesSettingsSimilarityScripted export interface IndicesSettingsSimilarityBm25 { - b: double - discount_overlaps: boolean - k1: double type: 'BM25' + b?: double + discount_overlaps?: boolean + k1?: double +} + +export interface IndicesSettingsSimilarityBoolean { + type: 'boolean' } export interface IndicesSettingsSimilarityDfi { - independence_measure: DFIIndependenceMeasure type: 'DFI' + independence_measure: DFIIndependenceMeasure } export interface IndicesSettingsSimilarityDfr { + type: 'DFR' after_effect: DFRAfterEffect basic_model: DFRBasicModel normalization: Normalization - type: 'DFR' } export interface IndicesSettingsSimilarityIb { + type: 'IB' distribution: IBDistribution lambda: IBLambda normalization: Normalization - type: 'IB' } export interface IndicesSettingsSimilarityLmd { - mu: integer type: 'LMDirichlet' + mu?: double } export interface IndicesSettingsSimilarityLmj { - lambda: double type: 'LMJelinekMercer' + lambda?: double } -export interface IndicesSettingsSimilarityScriptedTfidf { - script: Script +export interface IndicesSettingsSimilarityScripted { type: 'scripted' + script: Script + weight_script?: Script } export interface IndicesSlowlogSettings { @@ -13216,8 +13215,8 @@ export interface MlTrainedModelLocationIndex { } export interface MlTrainedModelPrefixStrings { - ingest: string - search: string + ingest?: string + search?: string } export interface MlTrainedModelSizeStats { @@ -14154,6 +14153,7 @@ export interface MlPutTrainedModelRequest extends RequestBase { model_size_bytes?: long platform_architecture?: string tags?: string[] + prefix_strings?: MlTrainedModelPrefixStrings } export type MlPutTrainedModelResponse = MlTrainedModelConfig @@ -16554,9 +16554,50 @@ export interface SecurityPutUserResponse { created: boolean } +export type SecurityQueryApiKeysAPIKeyAggregate = AggregationsCardinalityAggregate | AggregationsValueCountAggregate | AggregationsStringTermsAggregate | AggregationsLongTermsAggregate | AggregationsDoubleTermsAggregate | AggregationsUnmappedTermsAggregate | AggregationsMultiTermsAggregate | AggregationsMissingAggregate | AggregationsFilterAggregate | AggregationsFiltersAggregate | AggregationsRangeAggregate | AggregationsDateRangeAggregate | AggregationsCompositeAggregate + +export interface SecurityQueryApiKeysAPIKeyAggregationContainer { + aggregations?: Record + aggs?: Record + meta?: Metadata + cardinality?: AggregationsCardinalityAggregation + composite?: AggregationsCompositeAggregation + date_range?: AggregationsDateRangeAggregation + filter?: SecurityQueryApiKeysAPIKeyQueryContainer + filters?: SecurityQueryApiKeysAPIKeyFiltersAggregation + missing?: AggregationsMissingAggregation + range?: AggregationsRangeAggregation + terms?: AggregationsTermsAggregation + value_count?: AggregationsValueCountAggregation +} + +export interface SecurityQueryApiKeysAPIKeyFiltersAggregation extends AggregationsBucketAggregationBase { + filters?: AggregationsBuckets + other_bucket?: boolean + other_bucket_key?: string + keyed?: boolean +} + +export interface SecurityQueryApiKeysAPIKeyQueryContainer { + bool?: QueryDslBoolQuery + exists?: QueryDslExistsQuery + ids?: QueryDslIdsQuery + match?: Partial> + match_all?: QueryDslMatchAllQuery + prefix?: Partial> + range?: Partial> + simple_query_string?: QueryDslSimpleQueryStringQuery + term?: Partial> + terms?: QueryDslTermsQuery + wildcard?: Partial> +} + export interface SecurityQueryApiKeysRequest extends RequestBase { with_limited_by?: boolean - query?: QueryDslQueryContainer + aggregations?: Record + /** @alias aggregations */ + aggs?: Record + query?: SecurityQueryApiKeysAPIKeyQueryContainer from?: integer sort?: Sort size?: integer @@ -16567,6 +16608,7 @@ export interface SecurityQueryApiKeysResponse { total: integer count: integer api_keys: SecurityApiKey[] + aggregations?: Record } export interface SecuritySamlAuthenticateRequest extends RequestBase { diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index bb58742f4..dd55e3e19 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -5168,6 +5168,7 @@ export interface MappingNumberPropertyBase extends MappingDocValuesPropertyBase export interface MappingObjectProperty extends MappingCorePropertyBase { enabled?: boolean + subobjects?: boolean type?: 'object' } @@ -5342,6 +5343,7 @@ export interface MappingTypeMapping { _source?: MappingSourceField runtime?: Record enabled?: boolean + subobjects?: boolean _data_stream_timestamp?: MappingDataStreamTimestamp } @@ -9873,7 +9875,7 @@ export interface IndicesIndexSettingsKeys { settings?: IndicesIndexSettings time_series?: IndicesIndexSettingsTimeSeries queries?: IndicesQueries - similarity?: IndicesSettingsSimilarity + similarity?: Record mapping?: IndicesMappingLimitSettings 'indexing.slowlog'?: IndicesIndexingSlowlogSettings indexing_pressure?: IndicesIndexingPressure @@ -10051,55 +10053,52 @@ export interface IndicesSettingsSearch { slowlog?: IndicesSlowlogSettings } -export interface IndicesSettingsSimilarity { - bm25?: IndicesSettingsSimilarityBm25 - dfi?: IndicesSettingsSimilarityDfi - dfr?: IndicesSettingsSimilarityDfr - ib?: IndicesSettingsSimilarityIb - lmd?: IndicesSettingsSimilarityLmd - lmj?: IndicesSettingsSimilarityLmj - scripted_tfidf?: IndicesSettingsSimilarityScriptedTfidf -} +export type IndicesSettingsSimilarity = IndicesSettingsSimilarityBm25 | IndicesSettingsSimilarityBoolean | IndicesSettingsSimilarityDfi | IndicesSettingsSimilarityDfr | IndicesSettingsSimilarityIb | IndicesSettingsSimilarityLmd | IndicesSettingsSimilarityLmj | IndicesSettingsSimilarityScripted export interface IndicesSettingsSimilarityBm25 { - b: double - discount_overlaps: boolean - k1: double type: 'BM25' + b?: double + discount_overlaps?: boolean + k1?: double +} + +export interface IndicesSettingsSimilarityBoolean { + type: 'boolean' } export interface IndicesSettingsSimilarityDfi { - independence_measure: DFIIndependenceMeasure type: 'DFI' + independence_measure: DFIIndependenceMeasure } export interface IndicesSettingsSimilarityDfr { + type: 'DFR' after_effect: DFRAfterEffect basic_model: DFRBasicModel normalization: Normalization - type: 'DFR' } export interface IndicesSettingsSimilarityIb { + type: 'IB' distribution: IBDistribution lambda: IBLambda normalization: Normalization - type: 'IB' } export interface IndicesSettingsSimilarityLmd { - mu: integer type: 'LMDirichlet' + mu?: double } export interface IndicesSettingsSimilarityLmj { - lambda: double type: 'LMJelinekMercer' + lambda?: double } -export interface IndicesSettingsSimilarityScriptedTfidf { - script: Script +export interface IndicesSettingsSimilarityScripted { type: 'scripted' + script: Script + weight_script?: Script } export interface IndicesSlowlogSettings { @@ -13404,8 +13403,8 @@ export interface MlTrainedModelLocationIndex { } export interface MlTrainedModelPrefixStrings { - ingest: string - search: string + ingest?: string + search?: string } export interface MlTrainedModelSizeStats { @@ -14417,6 +14416,7 @@ export interface MlPutTrainedModelRequest extends RequestBase { model_size_bytes?: long platform_architecture?: string tags?: string[] + prefix_strings?: MlTrainedModelPrefixStrings } } @@ -16910,11 +16910,52 @@ export interface SecurityPutUserResponse { created: boolean } +export type SecurityQueryApiKeysAPIKeyAggregate = AggregationsCardinalityAggregate | AggregationsValueCountAggregate | AggregationsStringTermsAggregate | AggregationsLongTermsAggregate | AggregationsDoubleTermsAggregate | AggregationsUnmappedTermsAggregate | AggregationsMultiTermsAggregate | AggregationsMissingAggregate | AggregationsFilterAggregate | AggregationsFiltersAggregate | AggregationsRangeAggregate | AggregationsDateRangeAggregate | AggregationsCompositeAggregate + +export interface SecurityQueryApiKeysAPIKeyAggregationContainer { + aggregations?: Record + aggs?: Record + meta?: Metadata + cardinality?: AggregationsCardinalityAggregation + composite?: AggregationsCompositeAggregation + date_range?: AggregationsDateRangeAggregation + filter?: SecurityQueryApiKeysAPIKeyQueryContainer + filters?: SecurityQueryApiKeysAPIKeyFiltersAggregation + missing?: AggregationsMissingAggregation + range?: AggregationsRangeAggregation + terms?: AggregationsTermsAggregation + value_count?: AggregationsValueCountAggregation +} + +export interface SecurityQueryApiKeysAPIKeyFiltersAggregation extends AggregationsBucketAggregationBase { + filters?: AggregationsBuckets + other_bucket?: boolean + other_bucket_key?: string + keyed?: boolean +} + +export interface SecurityQueryApiKeysAPIKeyQueryContainer { + bool?: QueryDslBoolQuery + exists?: QueryDslExistsQuery + ids?: QueryDslIdsQuery + match?: Partial> + match_all?: QueryDslMatchAllQuery + prefix?: Partial> + range?: Partial> + simple_query_string?: QueryDslSimpleQueryStringQuery + term?: Partial> + terms?: QueryDslTermsQuery + wildcard?: Partial> +} + export interface SecurityQueryApiKeysRequest extends RequestBase { with_limited_by?: boolean /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ body?: { - query?: QueryDslQueryContainer + aggregations?: Record + /** @alias aggregations */ + aggs?: Record + query?: SecurityQueryApiKeysAPIKeyQueryContainer from?: integer sort?: Sort size?: integer @@ -16926,6 +16967,7 @@ export interface SecurityQueryApiKeysResponse { total: integer count: integer api_keys: SecurityApiKey[] + aggregations?: Record } export interface SecuritySamlAuthenticateRequest extends RequestBase {