From c150efbd21065f22ac535b63aac19c57ae38739b Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Mon, 11 Nov 2024 18:04:42 +0100 Subject: [PATCH] Auto-generated code for 8.16 (#2442) --- .../15f769bbd7b5fddeb3353ae726b71b14.asciidoc | 28 +++ .../2e7844477b41fcfa9efefee4ec0e7101.asciidoc | 43 +++++ .../339c4e5af9f9069ad9912aa574488b59.asciidoc | 52 ++++++ .../44198781d164a15be633d4469485a544.asciidoc | 23 +++ .../828f0045747fde4888a947bb99e190e3.asciidoc | 27 +++ .../853fc710cea79fb4e1a85fb6d149f9c5.asciidoc | 42 +++++ ...acc44366a9908684b2c8c2b119a4fb2b.asciidoc} | 12 +- docs/reference.asciidoc | 170 ++++++++++++++---- src/api/api/async_search.ts | 2 +- src/api/api/autoscaling.ts | 8 +- src/api/api/clear_scroll.ts | 2 +- src/api/api/close_point_in_time.ts | 2 +- src/api/api/field_caps.ts | 2 +- src/api/api/knn_search.ts | 2 +- src/api/api/msearch_template.ts | 2 +- src/api/api/open_point_in_time.ts | 2 +- src/api/api/rank_eval.ts | 2 +- src/api/api/render_search_template.ts | 2 +- src/api/api/search.ts | 2 +- src/api/api/search_mvt.ts | 2 +- src/api/api/search_shards.ts | 2 +- src/api/api/search_template.ts | 2 +- src/api/api/security.ts | 56 ++++-- src/api/api/termvectors.ts | 2 +- src/api/types.ts | 65 ++++++- src/api/typesWithBodyKey.ts | 71 +++++++- 26 files changed, 555 insertions(+), 70 deletions(-) create mode 100644 docs/doc_examples/15f769bbd7b5fddeb3353ae726b71b14.asciidoc create mode 100644 docs/doc_examples/2e7844477b41fcfa9efefee4ec0e7101.asciidoc create mode 100644 docs/doc_examples/339c4e5af9f9069ad9912aa574488b59.asciidoc create mode 100644 docs/doc_examples/44198781d164a15be633d4469485a544.asciidoc create mode 100644 docs/doc_examples/828f0045747fde4888a947bb99e190e3.asciidoc create mode 100644 docs/doc_examples/853fc710cea79fb4e1a85fb6d149f9c5.asciidoc rename docs/doc_examples/{8f0a3d7b5fbdf5351750a23c493cc078.asciidoc => acc44366a9908684b2c8c2b119a4fb2b.asciidoc} (71%) diff --git a/docs/doc_examples/15f769bbd7b5fddeb3353ae726b71b14.asciidoc b/docs/doc_examples/15f769bbd7b5fddeb3353ae726b71b14.asciidoc new file mode 100644 index 000000000..0db865fe6 --- /dev/null +++ b/docs/doc_examples/15f769bbd7b5fddeb3353ae726b71b14.asciidoc @@ -0,0 +1,28 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: "my-index-bit-vectors", + query: { + script_score: { + query: { + match_all: {}, + }, + script: { + source: "dotProduct(params.query_vector, 'my_dense_vector')", + params: { + query_vector: [ + 0.23, 1.45, 3.67, 4.89, -0.56, 2.34, 3.21, 1.78, -2.45, 0.98, -0.12, + 3.45, 4.56, 2.78, 1.23, 0.67, 3.89, 4.12, -2.34, 1.56, 0.78, 3.21, + 4.12, 2.45, -1.67, 0.34, -3.45, 4.56, -2.78, 1.23, -0.67, 3.89, + -4.34, 2.12, -1.56, 0.78, -3.21, 4.45, 2.12, 1.67, + ], + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/2e7844477b41fcfa9efefee4ec0e7101.asciidoc b/docs/doc_examples/2e7844477b41fcfa9efefee4ec0e7101.asciidoc new file mode 100644 index 000000000..e19fb83da --- /dev/null +++ b/docs/doc_examples/2e7844477b41fcfa9efefee4ec0e7101.asciidoc @@ -0,0 +1,43 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: "my-index-000001", + retriever: { + rule: { + match_criteria: { + query_string: "puggles", + user_country: "us", + }, + ruleset_ids: ["my-ruleset"], + retriever: { + rrf: { + retrievers: [ + { + standard: { + query: { + query_string: { + query: "pugs", + }, + }, + }, + }, + { + standard: { + query: { + query_string: { + query: "puggles", + }, + }, + }, + }, + ], + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/339c4e5af9f9069ad9912aa574488b59.asciidoc b/docs/doc_examples/339c4e5af9f9069ad9912aa574488b59.asciidoc new file mode 100644 index 000000000..905e21821 --- /dev/null +++ b/docs/doc_examples/339c4e5af9f9069ad9912aa574488b59.asciidoc @@ -0,0 +1,52 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.create({ + index: "my-index-bit-vectors", + mappings: { + properties: { + my_dense_vector: { + type: "dense_vector", + index: false, + element_type: "bit", + dims: 40, + }, + }, + }, +}); +console.log(response); + +const response1 = await client.index({ + index: "my-index-bit-vectors", + id: 1, + document: { + my_dense_vector: [8, 5, -15, 1, -7], + }, +}); +console.log(response1); + +const response2 = await client.index({ + index: "my-index-bit-vectors", + id: 2, + document: { + my_dense_vector: [-1, 115, -3, 4, -128], + }, +}); +console.log(response2); + +const response3 = await client.index({ + index: "my-index-bit-vectors", + id: 3, + document: { + my_dense_vector: [2, 18, -5, 0, -124], + }, +}); +console.log(response3); + +const response4 = await client.indices.refresh({ + index: "my-index-bit-vectors", +}); +console.log(response4); +---- diff --git a/docs/doc_examples/44198781d164a15be633d4469485a544.asciidoc b/docs/doc_examples/44198781d164a15be633d4469485a544.asciidoc new file mode 100644 index 000000000..f3125224a --- /dev/null +++ b/docs/doc_examples/44198781d164a15be633d4469485a544.asciidoc @@ -0,0 +1,23 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: "my-index-bit-vectors", + query: { + script_score: { + query: { + match_all: {}, + }, + script: { + source: "dotProduct(params.query_vector, 'my_dense_vector')", + params: { + query_vector: [8, 5, -15, 1, -7], + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/828f0045747fde4888a947bb99e190e3.asciidoc b/docs/doc_examples/828f0045747fde4888a947bb99e190e3.asciidoc new file mode 100644 index 000000000..a4e4969f9 --- /dev/null +++ b/docs/doc_examples/828f0045747fde4888a947bb99e190e3.asciidoc @@ -0,0 +1,27 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: "movies", + retriever: { + rule: { + match_criteria: { + query_string: "harry potter", + }, + ruleset_ids: ["my-ruleset"], + retriever: { + standard: { + query: { + query_string: { + query: "harry potter", + }, + }, + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/853fc710cea79fb4e1a85fb6d149f9c5.asciidoc b/docs/doc_examples/853fc710cea79fb4e1a85fb6d149f9c5.asciidoc new file mode 100644 index 000000000..0ca3674f6 --- /dev/null +++ b/docs/doc_examples/853fc710cea79fb4e1a85fb6d149f9c5.asciidoc @@ -0,0 +1,42 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: "movies", + retriever: { + rule: { + match_criteria: { + query_string: "harry potter", + }, + ruleset_ids: ["my-ruleset"], + retriever: { + rrf: { + retrievers: [ + { + standard: { + query: { + query_string: { + query: "sorcerer's stone", + }, + }, + }, + }, + { + standard: { + query: { + query_string: { + query: "chamber of secrets", + }, + }, + }, + }, + ], + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/8f0a3d7b5fbdf5351750a23c493cc078.asciidoc b/docs/doc_examples/acc44366a9908684b2c8c2b119a4fb2b.asciidoc similarity index 71% rename from docs/doc_examples/8f0a3d7b5fbdf5351750a23c493cc078.asciidoc rename to docs/doc_examples/acc44366a9908684b2c8c2b119a4fb2b.asciidoc index 8f14d2f77..2dcd961c6 100644 --- a/docs/doc_examples/8f0a3d7b5fbdf5351750a23c493cc078.asciidoc +++ b/docs/doc_examples/acc44366a9908684b2c8c2b119a4fb2b.asciidoc @@ -5,11 +5,15 @@ ---- const response = await client.search({ index: "my-index-000001", - query: { + retriever: { rule: { - organic: { - query_string: { - query: "puggles", + retriever: { + standard: { + query: { + query_string: { + query: "puggles", + }, + }, }, }, match_criteria: { diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 6ba45b3c6..d9eb29e7a 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -58,7 +58,9 @@ Set to all or any positive integer up to the total number of shards in the index [discrete] === clear_scroll -Clears the search context and results for a scrolling search. +Clear a scrolling search. + +Clear the search context and results for a scrolling search. {ref}/clear-scroll-api.html[Endpoint documentation] [source,ts] @@ -74,7 +76,12 @@ To clear all scroll IDs, use `_all`. [discrete] === close_point_in_time -Closes a point-in-time. +Close a point in time. + +A point in time must be opened explicitly before being used in search requests. +The `keep_alive` parameter tells Elasticsearch how long it should persist. +A point in time is automatically closed when the `keep_alive` period has elapsed. +However, keeping points in time has a cost; close them as soon as they are no longer required for search requests. {ref}/point-in-time-api.html[Endpoint documentation] [source,ts] @@ -389,9 +396,13 @@ Random by default. [discrete] === field_caps -The field capabilities API returns the information about the capabilities of fields among multiple indices. -The field capabilities API returns runtime fields like any other field. For example, a runtime field with a type -of keyword is returned as any other field that belongs to the `keyword` family. +Get the field capabilities. + +Get information about the capabilities of fields among multiple indices. + +For data streams, the API returns field capabilities among the stream’s backing indices. +It returns runtime fields like any other field. +For example, a runtime field with a type of keyword is returned the same as any other field that belongs to the `keyword` family. {ref}/search-field-caps.html[Endpoint documentation] [source,ts] @@ -588,7 +599,19 @@ client.info() [discrete] === knn_search -Performs a kNN search. +Run a knn search. + +NOTE: The kNN search API has been replaced by the `knn` option in the search API. + +Perform a k-nearest neighbor (kNN) search on a dense_vector field and return the matching documents. +Given a query vector, the API finds the k closest vectors and returns those documents as search hits. + +Elasticsearch uses the HNSW algorithm to support efficient kNN search. +Like most kNN algorithms, HNSW is an approximate method that sacrifices result accuracy for improved search speed. +This means the results returned are not always the true k closest neighbors. + +The kNN search API supports restricting the search using a filter. +The search will return the top k documents that also match the filter query. {ref}/search-search.html[Endpoint documentation] [source,ts] @@ -704,7 +727,7 @@ However, using computationally expensive named queries on a large number of hits [discrete] === msearch_template -Runs multiple templated searches with a single request. +Run multiple templated searches. {ref}/search-multi-search.html[Endpoint documentation] [source,ts] @@ -764,13 +787,18 @@ Random by default. [discrete] === open_point_in_time -A search request by default executes against the most recent visible data of the target indices, +Open a point in time. + +A search request by default runs against the most recent visible data of the target indices, which is called point in time. Elasticsearch pit (point in time) is a lightweight view into the state of the data as it existed when initiated. In some cases, it’s preferred to perform multiple search requests using the same point in time. For example, if refreshes happen between `search_after` requests, then the results of those requests might not be consistent as changes happening between searches are only visible to the more recent point in time. +A point in time must be opened explicitly before being used in search requests. +The `keep_alive` parameter tells Elasticsearch how long it should persist. + {ref}/point-in-time-api.html[Endpoint documentation] [source,ts] ---- @@ -828,7 +856,9 @@ If no response is received before the timeout expires, the request fails and ret [discrete] === rank_eval -Enables you to evaluate the quality of ranked search results over a set of typical search queries. +Evaluate ranked search results. + +Evaluate the quality of ranked search results over a set of typical search queries. {ref}/search-rank-eval.html[Endpoint documentation] [source,ts] @@ -900,7 +930,9 @@ client.reindexRethrottle({ task_id }) [discrete] === render_search_template -Renders a search template as a search request body. +Render a search template. + +Render a search template as a search request body. {ref}/render-search-template-api.html[Endpoint documentation] [source,ts] @@ -972,7 +1004,9 @@ client.scroll({ scroll_id }) [discrete] === search -Returns search hits that match the query defined in the request. +Run a search. + +Get search hits that match the query defined in the request. You can provide search queries using the `q` query string parameter or the request body. If both are specified, only the query parameter is used. @@ -1014,7 +1048,7 @@ A post filter has no impact on the aggregation results. NOTE: This is a debugging tool and adds significant overhead to search execution. ** *`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, script, script_score, semantic, shape, simple_query_string, span_containing, span_field_masking, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, sparse_vector, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. ** *`rescore` (Optional, { window_size, query, learning_to_rank } | { window_size, query, learning_to_rank }[])*: Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the `query` and `post_filter` phases. -** *`retriever` (Optional, { standard, knn, rrf })*: A retriever is a specification to describe top documents returned from a search. A retriever replaces other elements of the search API that also return top documents such as query and knn. +** *`retriever` (Optional, { standard, knn, rrf, text_similarity_reranker })*: A retriever is a specification to describe top documents returned from a search. A retriever replaces other elements of the search API that also return top documents such as query and knn. ** *`script_fields` (Optional, Record)*: Retrieve a script evaluation (based on different fields) for each hit. ** *`search_after` (Optional, number | number | string | boolean | null | User-defined value[])*: Used to retrieve the next page of hits using a set of sort values from the previous page. ** *`size` (Optional, number)*: The number of hits to return. @@ -1130,7 +1164,8 @@ Fetches with this enabled will be slower the enabling synthetic source natively [discrete] === search_mvt Search a vector tile. -Searches a vector tile for geospatial values. + +Search a vector tile for geospatial values. {ref}/search-vector-tile-api.html[Endpoint documentation] [source,ts] @@ -1189,7 +1224,11 @@ suggested label positions for the original features. [discrete] === search_shards -Returns information about the indices and shards that a search request would be executed against. +Get the search shards. + +Get the indices and shards that a search request would be run against. +This information can be useful for working out issues or planning optimizations with routing and shard preferences. +When filtered aliases are used, the filter is returned as part of the indices section. {ref}/search-shards.html[Endpoint documentation] [source,ts] @@ -1216,7 +1255,7 @@ Random by default. [discrete] === search_template -Runs a search with a search template. +Run a search with a search template. {ref}/search-template.html[Endpoint documentation] [source,ts] @@ -1291,7 +1330,8 @@ client.termsEnum({ index, field }) [discrete] === termvectors Get term vector information. -Returns information and statistics about terms in the fields of a particular document. + +Get information and statistics about terms in the fields of a particular document. {ref}/docs-termvectors.html[Endpoint documentation] [source,ts] @@ -1457,6 +1497,7 @@ client.updateByQueryRethrottle({ task_id }) [discrete] ==== delete Delete an async search. + If the asynchronous search is still running, it is cancelled. Otherwise, the saved search results are deleted. If the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the `cancel_task` cluster privilege. @@ -1476,6 +1517,7 @@ client.asyncSearch.delete({ id }) [discrete] ==== get Get async search results. + Retrieve the results of a previously submitted asynchronous search request. If the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it. @@ -1502,8 +1544,9 @@ By default no timeout is set meaning that the currently available results will b [discrete] ==== status -Get async search status. -Retrieve the status of a previously submitted async search request given its identifier, without retrieving search results. +Get the async search status. + +Get the status of a previously submitted async search request given its identifier, without retrieving search results. If the Elasticsearch security features are enabled, use of this API is restricted to the `monitoring_user` role. {ref}/async-search.html[Endpoint documentation] @@ -1521,6 +1564,7 @@ client.asyncSearch.status({ id }) [discrete] ==== submit Run an async search. + When the primary sort of the results is an indexed field, shards get sorted based on minimum and maximum value that they hold for that field. Partial results become available following the sort criteria that was requested. Warning: Asynchronous search does not support scroll or search requests that include only the suggest section. @@ -1634,7 +1678,9 @@ A partial reduction is performed every time the coordinating node has received a === autoscaling [discrete] ==== delete_autoscaling_policy -Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. +Delete an autoscaling policy. + +NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported. {ref}/autoscaling-delete-autoscaling-policy.html[Endpoint documentation] [source,ts] @@ -1650,7 +1696,20 @@ client.autoscaling.deleteAutoscalingPolicy({ name }) [discrete] ==== get_autoscaling_capacity -Gets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. +Get the autoscaling capacity. + +NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported. + +This API gets the current autoscaling capacity based on the configured autoscaling policy. +It will return information to size the cluster appropriately to the current workload. + +The `required_capacity` is calculated as the maximum of the `required_capacity` result of all individual deciders that are enabled for the policy. + +The operator should verify that the `current_nodes` match the operator’s knowledge of the cluster to avoid making autoscaling decisions based on stale or incomplete information. + +The response contains decider-specific information you can use to diagnose how and why autoscaling determined a certain capacity was required. +This information is provided for diagnosis only. +Do not use this information to make autoscaling decisions. {ref}/autoscaling-get-autoscaling-capacity.html[Endpoint documentation] [source,ts] @@ -1661,7 +1720,9 @@ client.autoscaling.getAutoscalingCapacity() [discrete] ==== get_autoscaling_policy -Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. +Get an autoscaling policy. + +NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported. {ref}/autoscaling-get-autoscaling-capacity.html[Endpoint documentation] [source,ts] @@ -1677,7 +1738,9 @@ client.autoscaling.getAutoscalingPolicy({ name }) [discrete] ==== put_autoscaling_policy -Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. +Create or update an autoscaling policy. + +NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported. {ref}/autoscaling-put-autoscaling-policy.html[Endpoint documentation] [source,ts] @@ -3039,8 +3102,6 @@ client.connector.syncJobCheckIn() [discrete] ==== sync_job_claim Claims a connector sync job. - -{ref}/claim-connector-sync-job-api.html[Endpoint documentation] [source,ts] ---- client.connector.syncJobClaim() @@ -5950,8 +6011,8 @@ client.ingest.putPipeline({ id }) ** *`id` (string)*: ID of the ingest pipeline to create or update. ** *`_meta` (Optional, Record)*: Optional metadata about the ingest pipeline. May have any contents. This map is not automatically generated by Elasticsearch. ** *`description` (Optional, string)*: Description of the ingest pipeline. -** *`on_failure` (Optional, { append, attachment, bytes, circle, community_id, convert, csv, date, date_index_name, dissect, dot_expander, drop, enrich, fail, fingerprint, foreach, geo_grid, geoip, grok, gsub, html_strip, inference, join, json, kv, lowercase, network_direction, pipeline, redact, registered_domain, remove, rename, reroute, script, set, set_security_user, sort, split, terminate, trim, uppercase, urldecode, uri_parts, user_agent }[])*: Processors to run immediately after a processor failure. Each processor supports a processor-level `on_failure` value. If a processor without an `on_failure` value fails, Elasticsearch uses this pipeline-level parameter as a fallback. The processors in this parameter run sequentially in the order specified. Elasticsearch will not attempt to run the pipeline's remaining processors. -** *`processors` (Optional, { append, attachment, bytes, circle, community_id, convert, csv, date, date_index_name, dissect, dot_expander, drop, enrich, fail, fingerprint, foreach, geo_grid, geoip, grok, gsub, html_strip, inference, join, json, kv, lowercase, network_direction, pipeline, redact, registered_domain, remove, rename, reroute, script, set, set_security_user, sort, split, terminate, trim, uppercase, urldecode, uri_parts, user_agent }[])*: Processors used to perform transformations on documents before indexing. Processors run sequentially in the order specified. +** *`on_failure` (Optional, { append, attachment, bytes, circle, community_id, convert, csv, date, date_index_name, dissect, dot_expander, drop, enrich, fail, fingerprint, foreach, ip_location, geo_grid, geoip, grok, gsub, html_strip, inference, join, json, kv, lowercase, network_direction, pipeline, redact, registered_domain, remove, rename, reroute, script, set, set_security_user, sort, split, terminate, trim, uppercase, urldecode, uri_parts, user_agent }[])*: Processors to run immediately after a processor failure. Each processor supports a processor-level `on_failure` value. If a processor without an `on_failure` value fails, Elasticsearch uses this pipeline-level parameter as a fallback. The processors in this parameter run sequentially in the order specified. Elasticsearch will not attempt to run the pipeline's remaining processors. +** *`processors` (Optional, { append, attachment, bytes, circle, community_id, convert, csv, date, date_index_name, dissect, dot_expander, drop, enrich, fail, fingerprint, foreach, ip_location, geo_grid, geoip, grok, gsub, html_strip, inference, join, json, kv, lowercase, network_direction, pipeline, redact, registered_domain, remove, rename, reroute, script, set, set_security_user, sort, split, terminate, trim, uppercase, urldecode, uri_parts, user_agent }[])*: Processors used to perform transformations on documents before indexing. Processors run sequentially in the order specified. ** *`version` (Optional, number)*: Version number used by external systems to track ingest pipelines. This parameter is intended for external systems only. Elasticsearch does not use or validate pipeline version numbers. ** *`deprecated` (Optional, boolean)*: Marks this ingest pipeline as deprecated. When a deprecated ingest pipeline is referenced as the default or final pipeline when creating or updating a non-deprecated index template, Elasticsearch will emit a deprecation warning. @@ -9219,14 +9280,46 @@ client.security.createApiKey({ ... }) [discrete] ==== create_cross_cluster_api_key -Creates a cross-cluster API key for API key based remote cluster access. +Create a cross-cluster API key. + +Create an API key of the `cross_cluster` type for the API key based remote cluster access. +A `cross_cluster` API key cannot be used to authenticate through the REST interface. + +IMPORTANT: To authenticate this request you must use a credential that is not an API key. Even if you use an API key that has the required privilege, the API returns an error. + +Cross-cluster API keys are created by the Elasticsearch API key service, which is automatically enabled. + +NOTE: Unlike REST API keys, a cross-cluster API key does not capture permissions of the authenticated user. The API key’s effective permission is exactly as specified with the `access` property. + +A successful request returns a JSON structure that contains the API key, its unique ID, and its name. If applicable, it also returns expiration information for the API key in milliseconds. + +By default, API keys never expire. You can specify expiration information when you create the API keys. + +Cross-cluster API keys can only be updated with the update cross-cluster API key API. +Attempting to update them with the update REST API key API or the bulk update REST API keys API will result in an error. {ref}/security-api-create-cross-cluster-api-key.html[Endpoint documentation] [source,ts] ---- -client.security.createCrossClusterApiKey() +client.security.createCrossClusterApiKey({ access, name }) ---- +[discrete] +==== Arguments + +* *Request (object):* +** *`access` ({ replication, search })*: The access to be granted to this API key. +The access is composed of permissions for cross-cluster search and cross-cluster replication. +At least one of them must be specified. + +NOTE: No explicit privileges should be specified for either search or replication access. +The creation process automatically converts the access specification to a role descriptor which has relevant privileges assigned accordingly. +** *`name` (string)*: Specifies the name for this API key. +** *`expiration` (Optional, string | -1 | 0)*: Expiration time for the API key. +By default, API keys never expire. +** *`metadata` (Optional, Record)*: Arbitrary metadata that you want to associate with the API key. +It supports nested data structure. +Within the metadata object, keys beginning with `_` are reserved for system usage. [discrete] ==== create_service_token @@ -10258,14 +10351,31 @@ client.security.updateApiKey({ id }) [discrete] ==== update_cross_cluster_api_key -Updates attributes of an existing cross-cluster API key. +Update a cross-cluster API key. + +Update the attributes of an existing cross-cluster API key, which is used for API key based remote cluster access. {ref}/security-api-update-cross-cluster-api-key.html[Endpoint documentation] [source,ts] ---- -client.security.updateCrossClusterApiKey() +client.security.updateCrossClusterApiKey({ id, access }) ---- +[discrete] +==== Arguments + +* *Request (object):* +** *`id` (string)*: The ID of the cross-cluster API key to update. +** *`access` ({ replication, search })*: The access to be granted to this API key. +The access is composed of permissions for cross cluster search and cross cluster replication. +At least one of them must be specified. +When specified, the new access assignment fully replaces the previously assigned access. +** *`expiration` (Optional, string | -1 | 0)*: Expiration time for the API key. +By default, API keys never expire. This property can be omitted to leave the value unchanged. +** *`metadata` (Optional, Record)*: Arbitrary metadata that you want to associate with the API key. +It supports nested data structure. +Within the metadata object, keys beginning with `_` are reserved for system usage. +When specified, this information fully replaces metadata previously associated with the API key. [discrete] ==== update_settings diff --git a/src/api/api/async_search.ts b/src/api/api/async_search.ts index d976537f6..98c1f1135 100644 --- a/src/api/api/async_search.ts +++ b/src/api/api/async_search.ts @@ -109,7 +109,7 @@ export default class AsyncSearch { } /** - * Get async search status. Retrieve the status of a previously submitted async search request given its identifier, without retrieving search results. If the Elasticsearch security features are enabled, use of this API is restricted to the `monitoring_user` role. + * Get the async search status. Get the status of a previously submitted async search request given its identifier, without retrieving search results. If the Elasticsearch security features are enabled, use of this API is restricted to the `monitoring_user` role. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/async-search.html | Elasticsearch API documentation} */ async status (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/api/autoscaling.ts b/src/api/api/autoscaling.ts index 46ceff779..c0e7d8623 100644 --- a/src/api/api/autoscaling.ts +++ b/src/api/api/autoscaling.ts @@ -45,7 +45,7 @@ export default class Autoscaling { } /** - * Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + * Delete an autoscaling policy. NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/autoscaling-delete-autoscaling-policy.html | Elasticsearch API documentation} */ async deleteAutoscalingPolicy (this: That, params: T.AutoscalingDeleteAutoscalingPolicyRequest | TB.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -77,7 +77,7 @@ export default class Autoscaling { } /** - * Gets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + * Get the autoscaling capacity. NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported. This API gets the current autoscaling capacity based on the configured autoscaling policy. It will return information to size the cluster appropriately to the current workload. The `required_capacity` is calculated as the maximum of the `required_capacity` result of all individual deciders that are enabled for the policy. The operator should verify that the `current_nodes` match the operator’s knowledge of the cluster to avoid making autoscaling decisions based on stale or incomplete information. The response contains decider-specific information you can use to diagnose how and why autoscaling determined a certain capacity was required. This information is provided for diagnosis only. Do not use this information to make autoscaling decisions. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/autoscaling-get-autoscaling-capacity.html | Elasticsearch API documentation} */ async getAutoscalingCapacity (this: That, params?: T.AutoscalingGetAutoscalingCapacityRequest | TB.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -107,7 +107,7 @@ export default class Autoscaling { } /** - * Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + * Get an autoscaling policy. NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/autoscaling-get-autoscaling-capacity.html | Elasticsearch API documentation} */ async getAutoscalingPolicy (this: That, params: T.AutoscalingGetAutoscalingPolicyRequest | TB.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -139,7 +139,7 @@ export default class Autoscaling { } /** - * Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. + * Create or update an autoscaling policy. NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/autoscaling-put-autoscaling-policy.html | Elasticsearch API documentation} */ async putAutoscalingPolicy (this: That, params: T.AutoscalingPutAutoscalingPolicyRequest | TB.AutoscalingPutAutoscalingPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/api/clear_scroll.ts b/src/api/api/clear_scroll.ts index 68a595e6a..3b8a26c63 100644 --- a/src/api/api/clear_scroll.ts +++ b/src/api/api/clear_scroll.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Clears the search context and results for a scrolling search. + * Clear a scrolling search. Clear the search context and results for a scrolling search. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/clear-scroll-api.html | Elasticsearch API documentation} */ export default async function ClearScrollApi (this: That, params?: T.ClearScrollRequest | TB.ClearScrollRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/api/close_point_in_time.ts b/src/api/api/close_point_in_time.ts index d549afcc2..17d61633e 100644 --- a/src/api/api/close_point_in_time.ts +++ b/src/api/api/close_point_in_time.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Closes a point-in-time. + * Close a point in time. A point in time must be opened explicitly before being used in search requests. The `keep_alive` parameter tells Elasticsearch how long it should persist. A point in time is automatically closed when the `keep_alive` period has elapsed. However, keeping points in time has a cost; close them as soon as they are no longer required for search requests. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/point-in-time-api.html | Elasticsearch API documentation} */ export default async function ClosePointInTimeApi (this: That, params: T.ClosePointInTimeRequest | TB.ClosePointInTimeRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/api/field_caps.ts b/src/api/api/field_caps.ts index 339437c45..f16ed6b3f 100644 --- a/src/api/api/field_caps.ts +++ b/src/api/api/field_caps.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * The field capabilities API returns the information about the capabilities of fields among multiple indices. The field capabilities API returns runtime fields like any other field. For example, a runtime field with a type of keyword is returned as any other field that belongs to the `keyword` family. + * Get the field capabilities. Get information about the capabilities of fields among multiple indices. For data streams, the API returns field capabilities among the stream’s backing indices. It returns runtime fields like any other field. For example, a runtime field with a type of keyword is returned the same as any other field that belongs to the `keyword` family. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-field-caps.html | Elasticsearch API documentation} */ export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/api/knn_search.ts b/src/api/api/knn_search.ts index 91d69a5f9..2c372a637 100644 --- a/src/api/api/knn_search.ts +++ b/src/api/api/knn_search.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Performs a kNN search. + * Run a knn search. NOTE: The kNN search API has been replaced by the `knn` option in the search API. Perform a k-nearest neighbor (kNN) search on a dense_vector field and return the matching documents. Given a query vector, the API finds the k closest vectors and returns those documents as search hits. Elasticsearch uses the HNSW algorithm to support efficient kNN search. Like most kNN algorithms, HNSW is an approximate method that sacrifices result accuracy for improved search speed. This means the results returned are not always the true k closest neighbors. The kNN search API supports restricting the search using a filter. The search will return the top k documents that also match the filter query. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-search.html | Elasticsearch API documentation} */ export default async function KnnSearchApi (this: That, params: T.KnnSearchRequest | TB.KnnSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> diff --git a/src/api/api/msearch_template.ts b/src/api/api/msearch_template.ts index f2f2115bc..fa61613de 100644 --- a/src/api/api/msearch_template.ts +++ b/src/api/api/msearch_template.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Runs multiple templated searches with a single request. + * Run multiple templated searches. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-multi-search.html | Elasticsearch API documentation} */ export default async function MsearchTemplateApi> (this: That, params: T.MsearchTemplateRequest | TB.MsearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise> diff --git a/src/api/api/open_point_in_time.ts b/src/api/api/open_point_in_time.ts index 69d4aa4d2..5f53791f1 100644 --- a/src/api/api/open_point_in_time.ts +++ b/src/api/api/open_point_in_time.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * A search request by default executes against the most recent visible data of the target indices, which is called point in time. Elasticsearch pit (point in time) is a lightweight view into the state of the data as it existed when initiated. In some cases, it’s preferred to perform multiple search requests using the same point in time. For example, if refreshes happen between `search_after` requests, then the results of those requests might not be consistent as changes happening between searches are only visible to the more recent point in time. + * Open a point in time. A search request by default runs against the most recent visible data of the target indices, which is called point in time. Elasticsearch pit (point in time) is a lightweight view into the state of the data as it existed when initiated. In some cases, it’s preferred to perform multiple search requests using the same point in time. For example, if refreshes happen between `search_after` requests, then the results of those requests might not be consistent as changes happening between searches are only visible to the more recent point in time. A point in time must be opened explicitly before being used in search requests. The `keep_alive` parameter tells Elasticsearch how long it should persist. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/point-in-time-api.html | Elasticsearch API documentation} */ export default async function OpenPointInTimeApi (this: That, params: T.OpenPointInTimeRequest | TB.OpenPointInTimeRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/api/rank_eval.ts b/src/api/api/rank_eval.ts index a4695ba94..802811c98 100644 --- a/src/api/api/rank_eval.ts +++ b/src/api/api/rank_eval.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Enables you to evaluate the quality of ranked search results over a set of typical search queries. + * Evaluate ranked search results. Evaluate the quality of ranked search results over a set of typical search queries. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-rank-eval.html | Elasticsearch API documentation} */ export default async function RankEvalApi (this: That, params: T.RankEvalRequest | TB.RankEvalRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/api/render_search_template.ts b/src/api/api/render_search_template.ts index df51ebd49..db9a59d93 100644 --- a/src/api/api/render_search_template.ts +++ b/src/api/api/render_search_template.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Renders a search template as a search request body. + * Render a search template. Render a search template as a search request body. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/render-search-template-api.html | Elasticsearch API documentation} */ export default async function RenderSearchTemplateApi (this: That, params?: T.RenderSearchTemplateRequest | TB.RenderSearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/api/search.ts b/src/api/api/search.ts index f0e6d7da3..8f2ddb1aa 100644 --- a/src/api/api/search.ts +++ b/src/api/api/search.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Returns search hits that match the query defined in the request. You can provide search queries using the `q` query string parameter or the request body. If both are specified, only the query parameter is used. + * Run a search. Get search hits that match the query defined in the request. You can provide search queries using the `q` query string parameter or the request body. If both are specified, only the query parameter is used. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-search.html | Elasticsearch API documentation} */ export default async function SearchApi> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> diff --git a/src/api/api/search_mvt.ts b/src/api/api/search_mvt.ts index 70b20af1f..051c56585 100644 --- a/src/api/api/search_mvt.ts +++ b/src/api/api/search_mvt.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Search a vector tile. Searches a vector tile for geospatial values. + * Search a vector tile. Search a vector tile for geospatial values. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-vector-tile-api.html | Elasticsearch API documentation} */ export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/api/search_shards.ts b/src/api/api/search_shards.ts index cffeca204..5e81d9abd 100644 --- a/src/api/api/search_shards.ts +++ b/src/api/api/search_shards.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Returns information about the indices and shards that a search request would be executed against. + * Get the search shards. Get the indices and shards that a search request would be run against. This information can be useful for working out issues or planning optimizations with routing and shard preferences. When filtered aliases are used, the filter is returned as part of the indices section. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-shards.html | Elasticsearch API documentation} */ export default async function SearchShardsApi (this: That, params?: T.SearchShardsRequest | TB.SearchShardsRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/api/search_template.ts b/src/api/api/search_template.ts index cc1d38408..303a72b24 100644 --- a/src/api/api/search_template.ts +++ b/src/api/api/search_template.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Runs a search with a search template. + * Run a search with a search template. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-template.html | Elasticsearch API documentation} */ export default async function SearchTemplateApi (this: That, params?: T.SearchTemplateRequest | TB.SearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise> diff --git a/src/api/api/security.ts b/src/api/api/security.ts index 675ca125d..3edeb29c0 100644 --- a/src/api/api/security.ts +++ b/src/api/api/security.ts @@ -483,22 +483,34 @@ export default class Security { } /** - * Creates a cross-cluster API key for API key based remote cluster access. + * Create a cross-cluster API key. Create an API key of the `cross_cluster` type for the API key based remote cluster access. A `cross_cluster` API key cannot be used to authenticate through the REST interface. IMPORTANT: To authenticate this request you must use a credential that is not an API key. Even if you use an API key that has the required privilege, the API returns an error. Cross-cluster API keys are created by the Elasticsearch API key service, which is automatically enabled. NOTE: Unlike REST API keys, a cross-cluster API key does not capture permissions of the authenticated user. The API key’s effective permission is exactly as specified with the `access` property. A successful request returns a JSON structure that contains the API key, its unique ID, and its name. If applicable, it also returns expiration information for the API key in milliseconds. By default, API keys never expire. You can specify expiration information when you create the API keys. Cross-cluster API keys can only be updated with the update cross-cluster API key API. Attempting to update them with the update REST API key API or the bulk update REST API keys API will result in an error. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-create-cross-cluster-api-key.html | Elasticsearch API documentation} */ - async createCrossClusterApiKey (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async createCrossClusterApiKey (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async createCrossClusterApiKey (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async createCrossClusterApiKey (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async createCrossClusterApiKey (this: That, params: T.SecurityCreateCrossClusterApiKeyRequest | TB.SecurityCreateCrossClusterApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async createCrossClusterApiKey (this: That, params: T.SecurityCreateCrossClusterApiKeyRequest | TB.SecurityCreateCrossClusterApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> + async createCrossClusterApiKey (this: That, params: T.SecurityCreateCrossClusterApiKeyRequest | TB.SecurityCreateCrossClusterApiKeyRequest, options?: TransportRequestOptions): Promise + async createCrossClusterApiKey (this: That, params: T.SecurityCreateCrossClusterApiKeyRequest | TB.SecurityCreateCrossClusterApiKeyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] + const acceptedBody: string[] = ['access', 'expiration', 'metadata', '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 + } - 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] } } @@ -2259,22 +2271,34 @@ export default class Security { } /** - * Updates attributes of an existing cross-cluster API key. + * Update a cross-cluster API key. Update the attributes of an existing cross-cluster API key, which is used for API key based remote cluster access. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/security-api-update-cross-cluster-api-key.html | Elasticsearch API documentation} */ - async updateCrossClusterApiKey (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async updateCrossClusterApiKey (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async updateCrossClusterApiKey (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async updateCrossClusterApiKey (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async updateCrossClusterApiKey (this: That, params: T.SecurityUpdateCrossClusterApiKeyRequest | TB.SecurityUpdateCrossClusterApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateCrossClusterApiKey (this: That, params: T.SecurityUpdateCrossClusterApiKeyRequest | TB.SecurityUpdateCrossClusterApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateCrossClusterApiKey (this: That, params: T.SecurityUpdateCrossClusterApiKeyRequest | TB.SecurityUpdateCrossClusterApiKeyRequest, options?: TransportRequestOptions): Promise + async updateCrossClusterApiKey (this: That, params: T.SecurityUpdateCrossClusterApiKeyRequest | TB.SecurityUpdateCrossClusterApiKeyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] + const acceptedBody: string[] = ['access', 'expiration', 'metadata'] 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/termvectors.ts b/src/api/api/termvectors.ts index b591c271c..e7e226795 100644 --- a/src/api/api/termvectors.ts +++ b/src/api/api/termvectors.ts @@ -39,7 +39,7 @@ import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Get term vector information. Returns information and statistics about terms in the fields of a particular document. + * Get term vector information. Get information and statistics about terms in the fields of a particular document. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.16/docs-termvectors.html | Elasticsearch API documentation} */ export default async function TermvectorsApi (this: That, params: T.TermvectorsRequest | TB.TermvectorsRequest, options?: TransportRequestOptionsWithOutMeta): Promise diff --git a/src/api/types.ts b/src/api/types.ts index 1c6b1e822..f69ce7000 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -2628,12 +2628,14 @@ export interface Retries { export interface RetrieverBase { filter?: QueryDslQueryContainer | QueryDslQueryContainer[] + min_score?: float } export interface RetrieverContainer { standard?: StandardRetriever knn?: KnnRetriever rrf?: RRFRetriever + text_similarity_reranker?: TextSimilarityReranker } export type Routing = string @@ -2798,7 +2800,6 @@ export interface StandardRetriever extends RetrieverBase { search_after?: SortResults terminate_after?: integer sort?: Sort - min_score?: float collapse?: SearchFieldCollapse } @@ -2835,6 +2836,14 @@ export interface TextEmbedding { model_text: string } +export interface TextSimilarityReranker extends RetrieverBase { + retriever: RetrieverContainer + rank_window_size?: integer + inference_id?: string + inference_text?: string + field?: string +} + export type ThreadType = 'cpu' | 'wait' | 'block' | 'gpu' | 'mem' export type TimeOfDay = string @@ -12771,6 +12780,16 @@ export interface IngestInferenceProcessor extends IngestProcessorBase { inference_config?: IngestInferenceConfig } +export interface IngestIpLocationProcessor extends IngestProcessorBase { + database_file?: string + field: Field + first_only?: boolean + ignore_missing?: boolean + properties?: string[] + target_field?: Field + download_database_on_pipeline_creation?: boolean +} + export interface IngestJoinProcessor extends IngestProcessorBase { field: Field separator: string @@ -12865,6 +12884,7 @@ export interface IngestProcessorContainer { fail?: IngestFailProcessor fingerprint?: IngestFingerprintProcessor foreach?: IngestForeachProcessor + ip_location?: IngestIpLocationProcessor geo_grid?: IngestGeoGridProcessor geoip?: IngestGeoIpProcessor grok?: IngestGrokProcessor @@ -17221,6 +17241,11 @@ export interface SearchableSnapshotsStatsResponse { total: any } +export interface SecurityAccess { + replication?: SecurityReplicationAccess[] + search?: SecuritySearchAccess[] +} + export interface SecurityApiKey { creation?: long expiration?: long @@ -17309,6 +17334,10 @@ export interface SecurityRemoteIndicesPrivileges { allow_restricted_indices?: boolean } +export interface SecurityReplicationAccess { + names: IndexName[] +} + export interface SecurityRoleDescriptor { cluster?: SecurityClusterPrivilege[] indices?: SecurityIndicesPrivileges[] @@ -17367,6 +17396,13 @@ export interface SecurityRoleTemplateScript { options?: Record } +export interface SecuritySearchAccess { + field_security?: SecurityFieldSecurity + names: IndexName[] + query?: SecurityIndicesPrivilegesQuery + allow_restricted_indices?: boolean +} + export type SecurityTemplateFormat = 'string' | 'json' export interface SecurityUser { @@ -17549,6 +17585,21 @@ export interface SecurityCreateApiKeyResponse { encoded: string } +export interface SecurityCreateCrossClusterApiKeyRequest extends RequestBase { + access: SecurityAccess + expiration?: Duration + metadata?: Metadata + name: Name +} + +export interface SecurityCreateCrossClusterApiKeyResponse { + api_key: string + expiration?: DurationValue + id: Id + name: Name + encoded: string +} + export interface SecurityCreateServiceTokenRequest extends RequestBase { namespace: Namespace service: Service @@ -18227,6 +18278,17 @@ export interface SecurityUpdateApiKeyResponse { updated: boolean } +export interface SecurityUpdateCrossClusterApiKeyRequest extends RequestBase { + id: Id + access: SecurityAccess + expiration?: Duration + metadata?: Metadata +} + +export interface SecurityUpdateCrossClusterApiKeyResponse { + updated: boolean +} + export interface SecurityUpdateUserProfileDataRequest extends RequestBase { uid: SecurityUserProfileId if_seq_no?: SequenceNumber @@ -20143,6 +20205,7 @@ export interface XpackInfoFeatures { graph: XpackInfoFeature ilm: XpackInfoFeature logstash: XpackInfoFeature + logsdb: XpackInfoFeature ml: XpackInfoFeature monitoring: XpackInfoFeature rollup: XpackInfoFeature diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index 038ec8c9e..05701387d 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -2704,12 +2704,14 @@ export interface Retries { export interface RetrieverBase { filter?: QueryDslQueryContainer | QueryDslQueryContainer[] + min_score?: float } export interface RetrieverContainer { standard?: StandardRetriever knn?: KnnRetriever rrf?: RRFRetriever + text_similarity_reranker?: TextSimilarityReranker } export type Routing = string @@ -2874,7 +2876,6 @@ export interface StandardRetriever extends RetrieverBase { search_after?: SortResults terminate_after?: integer sort?: Sort - min_score?: float collapse?: SearchFieldCollapse } @@ -2911,6 +2912,14 @@ export interface TextEmbedding { model_text: string } +export interface TextSimilarityReranker extends RetrieverBase { + retriever: RetrieverContainer + rank_window_size?: integer + inference_id?: string + inference_text?: string + field?: string +} + export type ThreadType = 'cpu' | 'wait' | 'block' | 'gpu' | 'mem' export type TimeOfDay = string @@ -12999,6 +13008,16 @@ export interface IngestInferenceProcessor extends IngestProcessorBase { inference_config?: IngestInferenceConfig } +export interface IngestIpLocationProcessor extends IngestProcessorBase { + database_file?: string + field: Field + first_only?: boolean + ignore_missing?: boolean + properties?: string[] + target_field?: Field + download_database_on_pipeline_creation?: boolean +} + export interface IngestJoinProcessor extends IngestProcessorBase { field: Field separator: string @@ -13093,6 +13112,7 @@ export interface IngestProcessorContainer { fail?: IngestFailProcessor fingerprint?: IngestFingerprintProcessor foreach?: IngestForeachProcessor + ip_location?: IngestIpLocationProcessor geo_grid?: IngestGeoGridProcessor geoip?: IngestGeoIpProcessor grok?: IngestGrokProcessor @@ -17601,6 +17621,11 @@ export interface SearchableSnapshotsStatsResponse { total: any } +export interface SecurityAccess { + replication?: SecurityReplicationAccess[] + search?: SecuritySearchAccess[] +} + export interface SecurityApiKey { creation?: long expiration?: long @@ -17689,6 +17714,10 @@ export interface SecurityRemoteIndicesPrivileges { allow_restricted_indices?: boolean } +export interface SecurityReplicationAccess { + names: IndexName[] +} + export interface SecurityRoleDescriptor { cluster?: SecurityClusterPrivilege[] indices?: SecurityIndicesPrivileges[] @@ -17747,6 +17776,13 @@ export interface SecurityRoleTemplateScript { options?: Record } +export interface SecuritySearchAccess { + field_security?: SecurityFieldSecurity + names: IndexName[] + query?: SecurityIndicesPrivilegesQuery + allow_restricted_indices?: boolean +} + export type SecurityTemplateFormat = 'string' | 'json' export interface SecurityUser { @@ -17944,6 +17980,24 @@ export interface SecurityCreateApiKeyResponse { encoded: string } +export interface SecurityCreateCrossClusterApiKeyRequest extends RequestBase { + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + access: SecurityAccess + expiration?: Duration + metadata?: Metadata + name: Name + } +} + +export interface SecurityCreateCrossClusterApiKeyResponse { + api_key: string + expiration?: DurationValue + id: Id + name: Name + encoded: string +} + export interface SecurityCreateServiceTokenRequest extends RequestBase { namespace: Namespace service: Service @@ -18681,6 +18735,20 @@ export interface SecurityUpdateApiKeyResponse { updated: boolean } +export interface SecurityUpdateCrossClusterApiKeyRequest extends RequestBase { + id: Id + /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ + body?: { + access: SecurityAccess + expiration?: Duration + metadata?: Metadata + } +} + +export interface SecurityUpdateCrossClusterApiKeyResponse { + updated: boolean +} + export interface SecurityUpdateUserProfileDataRequest extends RequestBase { uid: SecurityUserProfileId if_seq_no?: SequenceNumber @@ -20653,6 +20721,7 @@ export interface XpackInfoFeatures { graph: XpackInfoFeature ilm: XpackInfoFeature logstash: XpackInfoFeature + logsdb: XpackInfoFeature ml: XpackInfoFeature monitoring: XpackInfoFeature rollup: XpackInfoFeature