From 52f29c0665a30777a0c10fbcea3070c8ecce852a Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Wed, 1 Oct 2025 16:40:54 +0000 Subject: [PATCH] Auto-generated API code --- docs/reference/api-reference.md | 125 +++- src/api/api/async_search.ts | 117 ++- src/api/api/autoscaling.ts | 41 +- src/api/api/bulk.ts | 18 +- src/api/api/capabilities.ts | 4 +- src/api/api/cat.ts | 328 +++++--- src/api/api/ccr.ts | 155 +++- src/api/api/clear_scroll.ts | 6 +- src/api/api/close_point_in_time.ts | 5 +- src/api/api/cluster.ts | 184 ++++- src/api/api/connector.ts | 309 ++++++-- src/api/api/count.ts | 22 +- src/api/api/create.ts | 17 +- src/api/api/dangling_indices.ts | 33 +- src/api/api/delete.ts | 14 +- src/api/api/delete_by_query.ts | 38 +- src/api/api/delete_by_query_rethrottle.ts | 6 +- src/api/api/delete_script.ts | 7 +- src/api/api/enrich.ts | 50 +- src/api/api/eql.ts | 65 +- src/api/api/esql.ts | 91 ++- src/api/api/exists.ts | 16 +- src/api/api/exists_source.ts | 15 +- src/api/api/explain.ts | 19 +- src/api/api/features.ts | 21 +- src/api/api/field_caps.ts | 20 +- src/api/api/fleet.ts | 141 +++- src/api/api/get.ts | 18 +- src/api/api/get_script.ts | 6 +- src/api/api/get_script_context.ts | 4 +- src/api/api/get_script_languages.ts | 4 +- src/api/api/get_source.ts | 15 +- src/api/api/graph.ts | 20 +- src/api/api/health_report.ts | 8 +- src/api/api/ilm.ts | 100 ++- src/api/api/index.ts | 20 +- src/api/api/indices.ts | 851 +++++++++++++++++---- src/api/api/inference.ts | 381 ++++++++-- src/api/api/info.ts | 4 +- src/api/api/ingest.ts | 120 ++- src/api/api/knn_search.ts | 5 +- src/api/api/license.ts | 64 +- src/api/api/logstash.ts | 29 +- src/api/api/mget.ts | 16 +- src/api/api/migration.ts | 26 +- src/api/api/ml.ts | 865 ++++++++++++++++++---- src/api/api/monitoring.ts | 18 +- src/api/api/msearch.ts | 22 +- src/api/api/msearch_template.ts | 13 +- src/api/api/mtermvectors.ts | 19 +- src/api/api/nodes.ts | 82 +- src/api/api/open_point_in_time.ts | 15 +- src/api/api/ping.ts | 4 +- src/api/api/profiling.ts | 39 +- src/api/api/project.ts | 88 +++ src/api/api/put_script.ts | 10 +- src/api/api/query_rules.ts | 73 +- src/api/api/rank_eval.ts | 11 +- src/api/api/reindex.ts | 19 +- src/api/api/reindex_rethrottle.ts | 6 +- src/api/api/render_search_template.ts | 9 +- src/api/api/rollup.ts | 79 +- src/api/api/scripts_painless_execute.ts | 7 +- src/api/api/scroll.ts | 10 +- src/api/api/search.ts | 87 ++- src/api/api/search_application.ts | 87 ++- src/api/api/search_mvt.ts | 33 +- src/api/api/search_shards.ts | 12 +- src/api/api/search_template.ts | 25 +- src/api/api/searchable_snapshots.ts | 48 +- src/api/api/security.ts | 653 ++++++++++++---- src/api/api/shutdown.ts | 37 +- src/api/api/simulate.ts | 21 +- src/api/api/slm.ts | 88 ++- src/api/api/snapshot.ts | 178 ++++- src/api/api/sql.ts | 77 +- src/api/api/ssl.ts | 13 +- src/api/api/streams.ts | 83 ++- src/api/api/synonyms.ts | 67 +- src/api/api/tasks.ts | 40 +- src/api/api/terms_enum.ts | 12 +- src/api/api/termvectors.ts | 29 +- src/api/api/text_structure.ts | 76 +- src/api/api/transform.ts | 154 +++- src/api/api/update.ts | 26 +- src/api/api/update_by_query.ts | 41 +- src/api/api/update_by_query_rethrottle.ts | 6 +- src/api/api/watcher.ts | 128 +++- src/api/api/xpack.ts | 23 +- src/api/index.ts | 8 + src/api/types.ts | 520 +++++++++---- 91 files changed, 6068 insertions(+), 1451 deletions(-) create mode 100644 src/api/api/project.ts diff --git a/docs/reference/api-reference.md b/docs/reference/api-reference.md index 064ab34e0..ed819a820 100644 --- a/docs/reference/api-reference.md +++ b/docs/reference/api-reference.md @@ -217,6 +217,7 @@ client.count({ ... }) - **`lenient` (Optional, boolean)**: If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. This parameter can be used only when the `q` query string parameter is specified. - **`min_score` (Optional, number)**: The minimum `_score` value that documents must have to be included in the result. - **`preference` (Optional, string)**: The node or shard the operation should be performed on. By default, it is random. +- **`project_routing` (Optional, string)**: Specifies a subset of projects to target for the search using project metadata tags in a subset of Lucene query syntax. Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). Examples: _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only. - **`routing` (Optional, string)**: A custom value used to route operations to a specific shard. - **`terminate_after` (Optional, number)**: The maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting. IMPORTANT: Use with caution. Elasticsearch applies this parameter to each shard handling the request. When possible, let Elasticsearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. - **`q` (Optional, string)**: The query in Lucene query string syntax. This parameter cannot be used with a request body. @@ -673,6 +674,7 @@ client.fieldCaps({ ... }) - **`filters` (Optional, string)**: A list of filters to apply to the response. - **`types` (Optional, string[])**: A list of field types to include. Any fields that do not match one of these types will be excluded from the results. It defaults to empty, meaning that all field types are returned. - **`include_empty_fields` (Optional, boolean)**: If false, empty fields are not included in the response. +- **`project_routing` (Optional, string)**: Specifies a subset of projects to target for the field-caps query using project metadata tags in a subset of Lucene query syntax. Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). Examples: _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only. ## client.get [_get] Get a document by its ID. @@ -1101,7 +1103,7 @@ client.msearch({ ... }) #### Request (object) [_request_msearch] - **`index` (Optional, string \| string[])**: List of data streams, indices, and index aliases to search. -- **`searches` (Optional, { allow_no_indices, expand_wildcards, ignore_unavailable, index, preference, request_cache, routing, search_type, ccs_minimize_roundtrips, allow_partial_search_results, ignore_throttled } \| { aggregations, collapse, explain, ext, from, highlight, track_total_hits, indices_boost, docvalue_fields, knn, rank, min_score, post_filter, profile, query, rescore, retriever, script_fields, search_after, size, slice, sort, _source, fields, suggest, terminate_after, timeout, track_scores, version, seq_no_primary_term, stored_fields, pit, runtime_mappings, stats }[])** +- **`searches` (Optional, { allow_no_indices, expand_wildcards, ignore_unavailable, index, preference, project_routing, request_cache, routing, search_type, ccs_minimize_roundtrips, allow_partial_search_results, ignore_throttled } \| { aggregations, collapse, explain, ext, from, highlight, track_total_hits, indices_boost, docvalue_fields, knn, rank, min_score, post_filter, profile, query, rescore, retriever, script_fields, search_after, size, slice, sort, _source, fields, suggest, terminate_after, timeout, track_scores, version, seq_no_primary_term, stored_fields, pit, runtime_mappings, stats }[])** - **`allow_no_indices` (Optional, boolean)**: If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar. - **`ccs_minimize_roundtrips` (Optional, boolean)**: If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests. - **`expand_wildcards` (Optional, Enum("all" \| "open" \| "closed" \| "hidden" \| "none") \| Enum("all" \| "open" \| "closed" \| "hidden" \| "none")[])**: Type of index that wildcard expressions can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. @@ -1111,6 +1113,7 @@ client.msearch({ ... }) - **`max_concurrent_searches` (Optional, number)**: Maximum number of concurrent searches the multi search API can execute. Defaults to `max(1, (# of data nodes * min(search thread pool size, 10)))`. - **`max_concurrent_shard_requests` (Optional, number)**: Maximum number of concurrent shard requests that each sub-search request executes per node. - **`pre_filter_shard_size` (Optional, number)**: Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint. +- **`project_routing` (Optional, string)**: Specifies a subset of projects to target for a search using project metadata tags in a subset Lucene syntax. Allowed Lucene queries: the _alias tag and a single value (possible wildcarded). Examples: _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only. - **`rest_total_hits_as_int` (Optional, boolean)**: If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object. - **`routing` (Optional, string)**: Custom routing value used to route search operations to a specific shard. - **`search_type` (Optional, Enum("query_then_fetch" \| "dfs_query_then_fetch"))**: Indicates whether global term and document frequencies should be used when scoring returned documents. @@ -1143,9 +1146,10 @@ client.msearchTemplate({ ... }) #### Request (object) [_request_msearch_template] - **`index` (Optional, string \| string[])**: A list of data streams, indices, and aliases to search. It supports wildcards (`*`). To search all data streams and indices, omit this parameter or use `*`. -- **`search_templates` (Optional, { allow_no_indices, expand_wildcards, ignore_unavailable, index, preference, request_cache, routing, search_type, ccs_minimize_roundtrips, allow_partial_search_results, ignore_throttled } \| { aggregations, collapse, explain, ext, from, highlight, track_total_hits, indices_boost, docvalue_fields, knn, rank, min_score, post_filter, profile, query, rescore, retriever, script_fields, search_after, size, slice, sort, _source, fields, suggest, terminate_after, timeout, track_scores, version, seq_no_primary_term, stored_fields, pit, runtime_mappings, stats }[])** +- **`search_templates` (Optional, { allow_no_indices, expand_wildcards, ignore_unavailable, index, preference, project_routing, request_cache, routing, search_type, ccs_minimize_roundtrips, allow_partial_search_results, ignore_throttled } \| { aggregations, collapse, explain, ext, from, highlight, track_total_hits, indices_boost, docvalue_fields, knn, rank, min_score, post_filter, profile, query, rescore, retriever, script_fields, search_after, size, slice, sort, _source, fields, suggest, terminate_after, timeout, track_scores, version, seq_no_primary_term, stored_fields, pit, runtime_mappings, stats }[])** - **`ccs_minimize_roundtrips` (Optional, boolean)**: If `true`, network round-trips are minimized for cross-cluster search requests. - **`max_concurrent_searches` (Optional, number)**: The maximum number of concurrent searches the API can run. +- **`project_routing` (Optional, string)**: Specifies a subset of projects to target for the search using project metadata tags in a subset of Lucene query syntax. Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). Examples: _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only. - **`search_type` (Optional, Enum("query_then_fetch" \| "dfs_query_then_fetch"))**: The type of the search operation. - **`rest_total_hits_as_int` (Optional, boolean)**: If `true`, the response returns `hits.total` as an integer. If `false`, it returns `hits.total` as an object. - **`typed_keys` (Optional, boolean)**: If `true`, the response prefixes aggregation and suggester names with their respective types. @@ -1241,6 +1245,7 @@ client.openPointInTime({ index, keep_alive }) - **`index_filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_grid, 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 })**: Filter indices if the provided query rewrites to `match_none` on every shard. - **`ignore_unavailable` (Optional, boolean)**: If `false`, the request returns an error if it targets a missing or closed index. - **`preference` (Optional, string)**: The node or shard the operation should be performed on. By default, it is random. +- **`project_routing` (Optional, string)**: Specifies a subset of projects to target for the PIT request using project metadata tags in a subset of Lucene query syntax. Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). Examples: _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only. - **`routing` (Optional, string)**: A custom value that is used to route operations to a specific shard. - **`expand_wildcards` (Optional, Enum("all" \| "open" \| "closed" \| "hidden" \| "none") \| Enum("all" \| "open" \| "closed" \| "hidden" \| "none")[])**: The type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. It supports a list of values, such as `open,hidden`. - **`allow_partial_search_results` (Optional, boolean)**: Indicates whether the point in time tolerates unavailable shards or shard failures when initially creating the PIT. If `false`, creating a point in time request when a shard is missing or unavailable will throw an exception. If `true`, the point in time will contain all the shards that are available at the time of the request. @@ -1516,7 +1521,7 @@ client.search({ ... }) - **`post_filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_grid, 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 })**: Use the `post_filter` parameter to filter search results. The search hits are filtered after the aggregations are calculated. A post filter has no impact on the aggregation results. - **`profile` (Optional, boolean)**: Set to `true` to return detailed timing information about the execution of individual components in a search request. 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_grid, 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 })**: 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. +- **`rescore` (Optional, { window_size, query, learning_to_rank, script } \| { window_size, query, learning_to_rank, script }[])**: 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, text_similarity_reranker, rule, rescorer, linear, pinned })**: 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[])**: Used to retrieve the next page of hits using a set of sort values from the previous page. @@ -1551,6 +1556,7 @@ client.search({ ... }) - **`max_concurrent_shard_requests` (Optional, number)**: The number of concurrent shard requests per node that the search runs concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests. - **`preference` (Optional, string)**: The nodes and shards used for the search. By default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. Valid values are: * `_only_local` to run the search only on shards on the local node. * `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method. * `_only_nodes:,` to run the search on only the specified nodes IDs. If suitable shards exist on more than one selected node, use shards on those nodes using the default method. If none of the specified nodes are available, select shards from any available node using the default method. * `_prefer_nodes:,` to if possible, run the search on the specified nodes IDs. If not, select shards using the default method. * `_shards:,` to run the search only on the specified shards. You can combine this value with other `preference` values. However, the `_shards` value must come first. For example: `_shards:2,3|_local`. * `` (any string that does not start with `_`) to route searches with the same `` to the same shards in the same order. - **`pre_filter_shard_size` (Optional, number)**: A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint). When unspecified, the pre-filter phase is executed if any of these conditions is met: * The request targets more than 128 shards. * The request targets one or more read-only index. * The primary sort of the query targets an indexed field. +- **`project_routing` (Optional, string)**: Specifies a subset of projects to target for the search using project metadata tags in a subset of Lucene query syntax. Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). Examples: _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only. - **`request_cache` (Optional, boolean)**: If `true`, the caching of search results is enabled for requests where `size` is `0`. It defaults to index level settings. - **`routing` (Optional, string)**: A custom value that is used to route operations to a specific shard. - **`scroll` (Optional, string \| -1 \| 0)**: The period to retain the search context for scrolling. By default, this value cannot exceed `1d` (24 hours). You can change this limit by using the `search.max_keep_alive` cluster-level setting. @@ -1686,6 +1692,7 @@ client.searchMvt({ index, field, zoom, x, y }) - **`sort` (Optional, string \| { _score, _doc, _geo_distance, _script } \| string \| { _score, _doc, _geo_distance, _script }[])**: Sort the features in the hits layer. By default, the API calculates a bounding box for each feature. It sorts features based on this box's diagonal length, from longest to shortest. - **`track_total_hits` (Optional, boolean \| number)**: The number of hits matching the query to count accurately. If `true`, the exact number of hits is returned at the cost of some performance. If `false`, the response does not include the total number of hits matching the query. - **`with_labels` (Optional, boolean)**: If `true`, the hits and aggs layers will contain additional point features representing suggested label positions for the original features. * `Point` and `MultiPoint` features will have one of the points selected. * `Polygon` and `MultiPolygon` features will have a single point generated, either the centroid, if it is within the polygon, or another point within the polygon selected from the sorted triangle-tree. * `LineString` features will likewise provide a roughly central point selected from the triangle-tree. * The aggregation results will provide one central point for each aggregation bucket. All attributes from the original features will also be copied to the new label features. In addition, the new features will be distinguishable using the tag `_mvt_label_position`. +- **`project_routing` (Optional, string)**: Specifies a subset of projects to target for the search using project metadata tags in a subset of Lucene query syntax. Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). Examples: _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only. ## client.searchShards [_search_shards] Get the search shards. @@ -1738,6 +1745,7 @@ client.searchTemplate({ ... }) - **`ignore_throttled` (Optional, boolean)**: If `true`, specified concrete, expanded, or aliased indices are not included in the response when throttled. - **`ignore_unavailable` (Optional, boolean)**: If `false`, the request returns an error if it targets a missing or closed index. - **`preference` (Optional, string)**: The node or shard the operation should be performed on. It is random by default. +- **`project_routing` (Optional, string)**: Specifies a subset of projects to target for the search using project metadata tags in a subset of Lucene query syntax. Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). Examples: _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only. - **`routing` (Optional, string)**: A custom value used to route operations to a specific shard. - **`scroll` (Optional, string \| -1 \| 0)**: Specifies how long a consistent view of the index should be maintained for scrolled search. - **`search_type` (Optional, Enum("query_then_fetch" \| "dfs_query_then_fetch"))**: The type of the search operation. @@ -2159,7 +2167,7 @@ not included in search results and results collected by aggregations. - **`post_filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_grid, 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 })** - **`profile` (Optional, boolean)** - **`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_grid, 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 }[])** +- **`rescore` (Optional, { window_size, query, learning_to_rank, script } \| { window_size, query, learning_to_rank, script }[])** - **`script_fields` (Optional, Record)**: Retrieve a script evaluation (based on different fields) for each hit. - **`search_after` (Optional, number \| number \| string \| boolean \| null[])** - **`size` (Optional, number)**: The number of hits to return. By default, you cannot page through more @@ -2213,6 +2221,14 @@ A partial reduction is performed every time the coordinating node has received a - **`lenient` (Optional, boolean)**: Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - **`max_concurrent_shard_requests` (Optional, number)**: The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests - **`preference` (Optional, string)**: Specify the node or shard the operation should be performed on (default: random) +- **`project_routing` (Optional, string)**: Specifies a subset of projects to target for the search using project +metadata tags in a subset of Lucene query syntax. +Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). +Examples: + _alias:my-project + _alias:_origin + _alias:*pr* +Supported in serverless only. - **`request_cache` (Optional, boolean)**: Specify if request cache should be used for this request or not, defaults to true - **`routing` (Optional, string)**: A list of specific routing values - **`search_type` (Optional, Enum("query_then_fetch" \| "dfs_query_then_fetch"))**: Search operation type @@ -2272,7 +2288,6 @@ client.cat.allocation({ ... }) #### Request (object) [_request_cat.allocation] - **`node_id` (Optional, string \| string[])**: A list of node identifiers or names used to limit the returned information. -- **`bytes` (Optional, Enum("b" \| "kb" \| "mb" \| "gb" \| "tb" \| "pb"))**: The unit used to display byte values. - **`h` (Optional, Enum("shards" \| "shards.undesired" \| "write_load.forecast" \| "disk.indices.forecast" \| "disk.indices" \| "disk.used" \| "disk.avail" \| "disk.total" \| "disk.percent" \| "host" \| "ip" \| "node" \| "node.role") \| Enum("shards" \| "shards.undesired" \| "write_load.forecast" \| "disk.indices.forecast" \| "disk.indices" \| "disk.used" \| "disk.avail" \| "disk.total" \| "disk.percent" \| "host" \| "ip" \| "node" \| "node.role")[])**: A list of columns names to display. It supports simple wildcards. - **`s` (Optional, string \| string[])**: List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting `:asc` @@ -2336,6 +2351,14 @@ client.cat.count({ ... }) It supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. - **`h` (Optional, Enum("epoch" \| "timestamp" \| "count") \| Enum("epoch" \| "timestamp" \| "count")[])**: A list of columns names to display. It supports simple wildcards. +- **`project_routing` (Optional, string)**: Specifies a subset of projects to target for the search using project +metadata tags in a subset of Lucene query syntax. +Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). +Examples: + _alias:my-project + _alias:_origin + _alias:*pr* +Supported in serverless only. - **`s` (Optional, string \| string[])**: List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting `:asc` or `:desc` as a suffix to the column name. @@ -2359,7 +2382,6 @@ client.cat.fielddata({ ... }) #### Request (object) [_request_cat.fielddata] - **`fields` (Optional, string \| string[])**: List of fields used to limit returned information. To retrieve all fields, omit this parameter. -- **`bytes` (Optional, Enum("b" \| "kb" \| "mb" \| "gb" \| "tb" \| "pb"))**: The unit used to display byte values. - **`h` (Optional, Enum("id" \| "host" \| "ip" \| "node" \| "field" \| "size") \| Enum("id" \| "host" \| "ip" \| "node" \| "field" \| "size")[])**: A list of columns names to display. It supports simple wildcards. - **`s` (Optional, string \| string[])**: List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting `:asc` @@ -2387,7 +2409,6 @@ client.cat.health({ ... }) ### Arguments [_arguments_cat.health] #### Request (object) [_request_cat.health] -- **`time` (Optional, Enum("nanos" \| "micros" \| "ms" \| "s" \| "m" \| "h" \| "d"))**: The unit used to display time values. - **`ts` (Optional, boolean)**: If true, returns `HH:MM:SS` and Unix epoch timestamps. - **`h` (Optional, Enum("epoch" \| "timestamp" \| "cluster" \| "status" \| "node.total" \| "node.data" \| "shards" \| "pri" \| "relo" \| "init" \| "unassign" \| "unassign.pri" \| "pending_tasks" \| "max_task_wait_time" \| "active_shards_percent") \| Enum("epoch" \| "timestamp" \| "cluster" \| "status" \| "node.total" \| "node.data" \| "shards" \| "pri" \| "relo" \| "init" \| "unassign" \| "unassign.pri" \| "pending_tasks" \| "max_task_wait_time" \| "active_shards_percent")[])**: A list of columns names to display. It supports simple wildcards. - **`s` (Optional, string \| string[])**: List of columns that determine how the table should be sorted. @@ -2435,12 +2456,10 @@ client.cat.indices({ ... }) #### Request (object) [_request_cat.indices] - **`index` (Optional, string \| string[])**: List of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. -- **`bytes` (Optional, Enum("b" \| "kb" \| "mb" \| "gb" \| "tb" \| "pb"))**: The unit used to display byte values. - **`expand_wildcards` (Optional, Enum("all" \| "open" \| "closed" \| "hidden" \| "none") \| Enum("all" \| "open" \| "closed" \| "hidden" \| "none")[])**: The type of index that wildcard patterns can match. - **`health` (Optional, Enum("green" \| "yellow" \| "red" \| "unknown" \| "unavailable"))**: The health status used to limit returned indices. By default, the response includes indices of any health status. - **`include_unloaded_segments` (Optional, boolean)**: If true, the response includes information from segments that are not loaded into memory. - **`pri` (Optional, boolean)**: If true, the response only includes information from primary shards. -- **`time` (Optional, Enum("nanos" \| "micros" \| "ms" \| "s" \| "m" \| "h" \| "d"))**: The unit used to display time values. - **`master_timeout` (Optional, string \| -1 \| 0)**: Period to wait for a connection to the master node. - **`h` (Optional, Enum("health" \| "status" \| "index" \| "uuid" \| "pri" \| "rep" \| "docs.count" \| "docs.deleted" \| "creation.date" \| "creation.date.string" \| "store.size" \| "pri.store.size" \| "dataset.size" \| "completion.size" \| "pri.completion.size" \| "fielddata.memory_size" \| "pri.fielddata.memory_size" \| "fielddata.evictions" \| "pri.fielddata.evictions" \| "query_cache.memory_size" \| "pri.query_cache.memory_size" \| "query_cache.evictions" \| "pri.query_cache.evictions" \| "request_cache.memory_size" \| "pri.request_cache.memory_size" \| "request_cache.evictions" \| "pri.request_cache.evictions" \| "request_cache.hit_count" \| "pri.request_cache.hit_count" \| "request_cache.miss_count" \| "pri.request_cache.miss_count" \| "flush.total" \| "pri.flush.total" \| "flush.total_time" \| "pri.flush.total_time" \| "get.current" \| "pri.get.current" \| "get.time" \| "pri.get.time" \| "get.total" \| "pri.get.total" \| "get.exists_time" \| "pri.get.exists_time" \| "get.exists_total" \| "pri.get.exists_total" \| "get.missing_time" \| "pri.get.missing_time" \| "get.missing_total" \| "pri.get.missing_total" \| "indexing.delete_current" \| "pri.indexing.delete_current" \| "indexing.delete_time" \| "pri.indexing.delete_time" \| "indexing.delete_total" \| "pri.indexing.delete_total" \| "indexing.index_current" \| "pri.indexing.index_current" \| "indexing.index_time" \| "pri.indexing.index_time" \| "indexing.index_total" \| "pri.indexing.index_total" \| "indexing.index_failed" \| "pri.indexing.index_failed" \| "indexing.index_failed_due_to_version_conflict" \| "pri.indexing.index_failed_due_to_version_conflict" \| "merges.current" \| "pri.merges.current" \| "merges.current_docs" \| "pri.merges.current_docs" \| "merges.current_size" \| "pri.merges.current_size" \| "merges.total" \| "pri.merges.total" \| "merges.total_docs" \| "pri.merges.total_docs" \| "merges.total_size" \| "pri.merges.total_size" \| "merges.total_time" \| "pri.merges.total_time" \| "refresh.total" \| "pri.refresh.total" \| "refresh.time" \| "pri.refresh.time" \| "refresh.external_total" \| "pri.refresh.external_total" \| "refresh.external_time" \| "pri.refresh.external_time" \| "refresh.listeners" \| "pri.refresh.listeners" \| "search.fetch_current" \| "pri.search.fetch_current" \| "search.fetch_time" \| "pri.search.fetch_time" \| "search.fetch_total" \| "pri.search.fetch_total" \| "search.open_contexts" \| "pri.search.open_contexts" \| "search.query_current" \| "pri.search.query_current" \| "search.query_time" \| "pri.search.query_time" \| "search.query_total" \| "pri.search.query_total" \| "search.scroll_current" \| "pri.search.scroll_current" \| "search.scroll_time" \| "pri.search.scroll_time" \| "search.scroll_total" \| "pri.search.scroll_total" \| "segments.count" \| "pri.segments.count" \| "segments.memory" \| "pri.segments.memory" \| "segments.index_writer_memory" \| "pri.segments.index_writer_memory" \| "segments.version_map_memory" \| "pri.segments.version_map_memory" \| "segments.fixed_bitset_memory" \| "pri.segments.fixed_bitset_memory" \| "warmer.current" \| "pri.warmer.current" \| "warmer.total" \| "pri.warmer.total" \| "warmer.total_time" \| "pri.warmer.total_time" \| "suggest.current" \| "pri.suggest.current" \| "suggest.time" \| "pri.suggest.time" \| "suggest.total" \| "pri.suggest.total" \| "memory.total" \| "pri.memory.total" \| "bulk.total_operations" \| "pri.bulk.total_operations" \| "bulk.total_time" \| "pri.bulk.total_time" \| "bulk.total_size_in_bytes" \| "pri.bulk.total_size_in_bytes" \| "bulk.avg_time" \| "pri.bulk.avg_time" \| "bulk.avg_size_in_bytes" \| "pri.bulk.avg_size_in_bytes" \| "dense_vector.value_count" \| "pri.dense_vector.value_count" \| "sparse_vector.value_count" \| "pri.sparse_vector.value_count") \| Enum("health" \| "status" \| "index" \| "uuid" \| "pri" \| "rep" \| "docs.count" \| "docs.deleted" \| "creation.date" \| "creation.date.string" \| "store.size" \| "pri.store.size" \| "dataset.size" \| "completion.size" \| "pri.completion.size" \| "fielddata.memory_size" \| "pri.fielddata.memory_size" \| "fielddata.evictions" \| "pri.fielddata.evictions" \| "query_cache.memory_size" \| "pri.query_cache.memory_size" \| "query_cache.evictions" \| "pri.query_cache.evictions" \| "request_cache.memory_size" \| "pri.request_cache.memory_size" \| "request_cache.evictions" \| "pri.request_cache.evictions" \| "request_cache.hit_count" \| "pri.request_cache.hit_count" \| "request_cache.miss_count" \| "pri.request_cache.miss_count" \| "flush.total" \| "pri.flush.total" \| "flush.total_time" \| "pri.flush.total_time" \| "get.current" \| "pri.get.current" \| "get.time" \| "pri.get.time" \| "get.total" \| "pri.get.total" \| "get.exists_time" \| "pri.get.exists_time" \| "get.exists_total" \| "pri.get.exists_total" \| "get.missing_time" \| "pri.get.missing_time" \| "get.missing_total" \| "pri.get.missing_total" \| "indexing.delete_current" \| "pri.indexing.delete_current" \| "indexing.delete_time" \| "pri.indexing.delete_time" \| "indexing.delete_total" \| "pri.indexing.delete_total" \| "indexing.index_current" \| "pri.indexing.index_current" \| "indexing.index_time" \| "pri.indexing.index_time" \| "indexing.index_total" \| "pri.indexing.index_total" \| "indexing.index_failed" \| "pri.indexing.index_failed" \| "indexing.index_failed_due_to_version_conflict" \| "pri.indexing.index_failed_due_to_version_conflict" \| "merges.current" \| "pri.merges.current" \| "merges.current_docs" \| "pri.merges.current_docs" \| "merges.current_size" \| "pri.merges.current_size" \| "merges.total" \| "pri.merges.total" \| "merges.total_docs" \| "pri.merges.total_docs" \| "merges.total_size" \| "pri.merges.total_size" \| "merges.total_time" \| "pri.merges.total_time" \| "refresh.total" \| "pri.refresh.total" \| "refresh.time" \| "pri.refresh.time" \| "refresh.external_total" \| "pri.refresh.external_total" \| "refresh.external_time" \| "pri.refresh.external_time" \| "refresh.listeners" \| "pri.refresh.listeners" \| "search.fetch_current" \| "pri.search.fetch_current" \| "search.fetch_time" \| "pri.search.fetch_time" \| "search.fetch_total" \| "pri.search.fetch_total" \| "search.open_contexts" \| "pri.search.open_contexts" \| "search.query_current" \| "pri.search.query_current" \| "search.query_time" \| "pri.search.query_time" \| "search.query_total" \| "pri.search.query_total" \| "search.scroll_current" \| "pri.search.scroll_current" \| "search.scroll_time" \| "pri.search.scroll_time" \| "search.scroll_total" \| "pri.search.scroll_total" \| "segments.count" \| "pri.segments.count" \| "segments.memory" \| "pri.segments.memory" \| "segments.index_writer_memory" \| "pri.segments.index_writer_memory" \| "segments.version_map_memory" \| "pri.segments.version_map_memory" \| "segments.fixed_bitset_memory" \| "pri.segments.fixed_bitset_memory" \| "warmer.current" \| "pri.warmer.current" \| "warmer.total" \| "pri.warmer.total" \| "warmer.total_time" \| "pri.warmer.total_time" \| "suggest.current" \| "pri.suggest.current" \| "suggest.time" \| "pri.suggest.time" \| "suggest.total" \| "pri.suggest.total" \| "memory.total" \| "pri.memory.total" \| "bulk.total_operations" \| "pri.bulk.total_operations" \| "bulk.total_time" \| "pri.bulk.total_time" \| "bulk.total_size_in_bytes" \| "pri.bulk.total_size_in_bytes" \| "bulk.avg_time" \| "pri.bulk.avg_time" \| "bulk.avg_size_in_bytes" \| "pri.bulk.avg_size_in_bytes" \| "dense_vector.value_count" \| "pri.dense_vector.value_count" \| "sparse_vector.value_count" \| "pri.sparse_vector.value_count")[])**: A list of columns names to display. It supports simple wildcards. - **`s` (Optional, string \| string[])**: List of columns that determine how the table should be sorted. @@ -2493,11 +2512,9 @@ client.cat.mlDataFrameAnalytics({ ... }) #### Request (object) [_request_cat.ml_data_frame_analytics] - **`id` (Optional, string)**: The ID of the data frame analytics to fetch - **`allow_no_match` (Optional, boolean)**: Whether to ignore if a wildcard expression matches no configs. (This includes `_all` string or when no configs have been specified) -- **`bytes` (Optional, Enum("b" \| "kb" \| "mb" \| "gb" \| "tb" \| "pb"))**: The unit in which to display byte values - **`h` (Optional, Enum("assignment_explanation" \| "create_time" \| "description" \| "dest_index" \| "failure_reason" \| "id" \| "model_memory_limit" \| "node.address" \| "node.ephemeral_id" \| "node.id" \| "node.name" \| "progress" \| "source_index" \| "state" \| "type" \| "version") \| Enum("assignment_explanation" \| "create_time" \| "description" \| "dest_index" \| "failure_reason" \| "id" \| "model_memory_limit" \| "node.address" \| "node.ephemeral_id" \| "node.id" \| "node.name" \| "progress" \| "source_index" \| "state" \| "type" \| "version")[])**: List of column names to display. - **`s` (Optional, Enum("assignment_explanation" \| "create_time" \| "description" \| "dest_index" \| "failure_reason" \| "id" \| "model_memory_limit" \| "node.address" \| "node.ephemeral_id" \| "node.id" \| "node.name" \| "progress" \| "source_index" \| "state" \| "type" \| "version") \| Enum("assignment_explanation" \| "create_time" \| "description" \| "dest_index" \| "failure_reason" \| "id" \| "model_memory_limit" \| "node.address" \| "node.ephemeral_id" \| "node.id" \| "node.name" \| "progress" \| "source_index" \| "state" \| "type" \| "version")[])**: List of column names or column aliases used to sort the response. -- **`time` (Optional, Enum("nanos" \| "micros" \| "ms" \| "s" \| "m" \| "h" \| "d"))**: Unit used to display time values. ## client.cat.mlDatafeeds [_cat.ml_datafeeds] Get datafeeds. @@ -2532,7 +2549,6 @@ there are partial matches. If `false`, the API returns a 404 status code when th partial matches. - **`h` (Optional, Enum("ae" \| "bc" \| "id" \| "na" \| "ne" \| "ni" \| "nn" \| "sba" \| "sc" \| "seah" \| "st" \| "s") \| Enum("ae" \| "bc" \| "id" \| "na" \| "ne" \| "ni" \| "nn" \| "sba" \| "sc" \| "seah" \| "st" \| "s")[])**: List of column names to display. - **`s` (Optional, Enum("ae" \| "bc" \| "id" \| "na" \| "ne" \| "ni" \| "nn" \| "sba" \| "sc" \| "seah" \| "st" \| "s") \| Enum("ae" \| "bc" \| "id" \| "na" \| "ne" \| "ni" \| "nn" \| "sba" \| "sc" \| "seah" \| "st" \| "s")[])**: List of column names or column aliases used to sort the response. -- **`time` (Optional, Enum("nanos" \| "micros" \| "ms" \| "s" \| "m" \| "h" \| "d"))**: The unit used to display time values. ## client.cat.mlJobs [_cat.ml_jobs] Get anomaly detection jobs. @@ -2565,10 +2581,8 @@ client.cat.mlJobs({ ... }) If `true`, the API returns an empty jobs array when there are no matches and the subset of results when there are partial matches. If `false`, the API returns a 404 status code when there are no matches or only partial matches. -- **`bytes` (Optional, Enum("b" \| "kb" \| "mb" \| "gb" \| "tb" \| "pb"))**: The unit used to display byte values. - **`h` (Optional, Enum("assignment_explanation" \| "buckets.count" \| "buckets.time.exp_avg" \| "buckets.time.exp_avg_hour" \| "buckets.time.max" \| "buckets.time.min" \| "buckets.time.total" \| "data.buckets" \| "data.earliest_record" \| "data.empty_buckets" \| "data.input_bytes" \| "data.input_fields" \| "data.input_records" \| "data.invalid_dates" \| "data.last" \| "data.last_empty_bucket" \| "data.last_sparse_bucket" \| "data.latest_record" \| "data.missing_fields" \| "data.out_of_order_timestamps" \| "data.processed_fields" \| "data.processed_records" \| "data.sparse_buckets" \| "forecasts.memory.avg" \| "forecasts.memory.max" \| "forecasts.memory.min" \| "forecasts.memory.total" \| "forecasts.records.avg" \| "forecasts.records.max" \| "forecasts.records.min" \| "forecasts.records.total" \| "forecasts.time.avg" \| "forecasts.time.max" \| "forecasts.time.min" \| "forecasts.time.total" \| "forecasts.total" \| "id" \| "model.bucket_allocation_failures" \| "model.by_fields" \| "model.bytes" \| "model.bytes_exceeded" \| "model.categorization_status" \| "model.categorized_doc_count" \| "model.dead_category_count" \| "model.failed_category_count" \| "model.frequent_category_count" \| "model.log_time" \| "model.memory_limit" \| "model.memory_status" \| "model.over_fields" \| "model.partition_fields" \| "model.rare_category_count" \| "model.timestamp" \| "model.total_category_count" \| "node.address" \| "node.ephemeral_id" \| "node.id" \| "node.name" \| "opened_time" \| "state") \| Enum("assignment_explanation" \| "buckets.count" \| "buckets.time.exp_avg" \| "buckets.time.exp_avg_hour" \| "buckets.time.max" \| "buckets.time.min" \| "buckets.time.total" \| "data.buckets" \| "data.earliest_record" \| "data.empty_buckets" \| "data.input_bytes" \| "data.input_fields" \| "data.input_records" \| "data.invalid_dates" \| "data.last" \| "data.last_empty_bucket" \| "data.last_sparse_bucket" \| "data.latest_record" \| "data.missing_fields" \| "data.out_of_order_timestamps" \| "data.processed_fields" \| "data.processed_records" \| "data.sparse_buckets" \| "forecasts.memory.avg" \| "forecasts.memory.max" \| "forecasts.memory.min" \| "forecasts.memory.total" \| "forecasts.records.avg" \| "forecasts.records.max" \| "forecasts.records.min" \| "forecasts.records.total" \| "forecasts.time.avg" \| "forecasts.time.max" \| "forecasts.time.min" \| "forecasts.time.total" \| "forecasts.total" \| "id" \| "model.bucket_allocation_failures" \| "model.by_fields" \| "model.bytes" \| "model.bytes_exceeded" \| "model.categorization_status" \| "model.categorized_doc_count" \| "model.dead_category_count" \| "model.failed_category_count" \| "model.frequent_category_count" \| "model.log_time" \| "model.memory_limit" \| "model.memory_status" \| "model.over_fields" \| "model.partition_fields" \| "model.rare_category_count" \| "model.timestamp" \| "model.total_category_count" \| "node.address" \| "node.ephemeral_id" \| "node.id" \| "node.name" \| "opened_time" \| "state")[])**: List of column names to display. - **`s` (Optional, Enum("assignment_explanation" \| "buckets.count" \| "buckets.time.exp_avg" \| "buckets.time.exp_avg_hour" \| "buckets.time.max" \| "buckets.time.min" \| "buckets.time.total" \| "data.buckets" \| "data.earliest_record" \| "data.empty_buckets" \| "data.input_bytes" \| "data.input_fields" \| "data.input_records" \| "data.invalid_dates" \| "data.last" \| "data.last_empty_bucket" \| "data.last_sparse_bucket" \| "data.latest_record" \| "data.missing_fields" \| "data.out_of_order_timestamps" \| "data.processed_fields" \| "data.processed_records" \| "data.sparse_buckets" \| "forecasts.memory.avg" \| "forecasts.memory.max" \| "forecasts.memory.min" \| "forecasts.memory.total" \| "forecasts.records.avg" \| "forecasts.records.max" \| "forecasts.records.min" \| "forecasts.records.total" \| "forecasts.time.avg" \| "forecasts.time.max" \| "forecasts.time.min" \| "forecasts.time.total" \| "forecasts.total" \| "id" \| "model.bucket_allocation_failures" \| "model.by_fields" \| "model.bytes" \| "model.bytes_exceeded" \| "model.categorization_status" \| "model.categorized_doc_count" \| "model.dead_category_count" \| "model.failed_category_count" \| "model.frequent_category_count" \| "model.log_time" \| "model.memory_limit" \| "model.memory_status" \| "model.over_fields" \| "model.partition_fields" \| "model.rare_category_count" \| "model.timestamp" \| "model.total_category_count" \| "node.address" \| "node.ephemeral_id" \| "node.id" \| "node.name" \| "opened_time" \| "state") \| Enum("assignment_explanation" \| "buckets.count" \| "buckets.time.exp_avg" \| "buckets.time.exp_avg_hour" \| "buckets.time.max" \| "buckets.time.min" \| "buckets.time.total" \| "data.buckets" \| "data.earliest_record" \| "data.empty_buckets" \| "data.input_bytes" \| "data.input_fields" \| "data.input_records" \| "data.invalid_dates" \| "data.last" \| "data.last_empty_bucket" \| "data.last_sparse_bucket" \| "data.latest_record" \| "data.missing_fields" \| "data.out_of_order_timestamps" \| "data.processed_fields" \| "data.processed_records" \| "data.sparse_buckets" \| "forecasts.memory.avg" \| "forecasts.memory.max" \| "forecasts.memory.min" \| "forecasts.memory.total" \| "forecasts.records.avg" \| "forecasts.records.max" \| "forecasts.records.min" \| "forecasts.records.total" \| "forecasts.time.avg" \| "forecasts.time.max" \| "forecasts.time.min" \| "forecasts.time.total" \| "forecasts.total" \| "id" \| "model.bucket_allocation_failures" \| "model.by_fields" \| "model.bytes" \| "model.bytes_exceeded" \| "model.categorization_status" \| "model.categorized_doc_count" \| "model.dead_category_count" \| "model.failed_category_count" \| "model.frequent_category_count" \| "model.log_time" \| "model.memory_limit" \| "model.memory_status" \| "model.over_fields" \| "model.partition_fields" \| "model.rare_category_count" \| "model.timestamp" \| "model.total_category_count" \| "node.address" \| "node.ephemeral_id" \| "node.id" \| "node.name" \| "opened_time" \| "state")[])**: List of column names or column aliases used to sort the response. -- **`time` (Optional, Enum("nanos" \| "micros" \| "ms" \| "s" \| "m" \| "h" \| "d"))**: The unit used to display time values. ## client.cat.mlTrainedModels [_cat.ml_trained_models] Get trained models. @@ -2592,12 +2606,10 @@ client.cat.mlTrainedModels({ ... }) - **`allow_no_match` (Optional, boolean)**: Specifies what to do when the request: contains wildcard expressions and there are no models that match; contains the `_all` string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches. If `true`, the API returns an empty array when there are no matches and the subset of results when there are partial matches. If `false`, the API returns a 404 status code when there are no matches or only partial matches. -- **`bytes` (Optional, Enum("b" \| "kb" \| "mb" \| "gb" \| "tb" \| "pb"))**: The unit used to display byte values. - **`h` (Optional, Enum("create_time" \| "created_by" \| "data_frame_analytics_id" \| "description" \| "heap_size" \| "id" \| "ingest.count" \| "ingest.current" \| "ingest.failed" \| "ingest.pipelines" \| "ingest.time" \| "license" \| "operations" \| "version") \| Enum("create_time" \| "created_by" \| "data_frame_analytics_id" \| "description" \| "heap_size" \| "id" \| "ingest.count" \| "ingest.current" \| "ingest.failed" \| "ingest.pipelines" \| "ingest.time" \| "license" \| "operations" \| "version")[])**: A list of column names to display. - **`s` (Optional, Enum("create_time" \| "created_by" \| "data_frame_analytics_id" \| "description" \| "heap_size" \| "id" \| "ingest.count" \| "ingest.current" \| "ingest.failed" \| "ingest.pipelines" \| "ingest.time" \| "license" \| "operations" \| "version") \| Enum("create_time" \| "created_by" \| "data_frame_analytics_id" \| "description" \| "heap_size" \| "id" \| "ingest.count" \| "ingest.current" \| "ingest.failed" \| "ingest.pipelines" \| "ingest.time" \| "license" \| "operations" \| "version")[])**: A list of column names or aliases used to sort the response. - **`from` (Optional, number)**: Skips the specified number of transforms. - **`size` (Optional, number)**: The maximum number of transforms to display. -- **`time` (Optional, Enum("nanos" \| "micros" \| "ms" \| "s" \| "m" \| "h" \| "d"))**: Unit used to display time values. ## client.cat.nodeattrs [_cat.nodeattrs] Get node attribute information. @@ -2639,8 +2651,7 @@ client.cat.nodes({ ... }) ### Arguments [_arguments_cat.nodes] #### Request (object) [_request_cat.nodes] -- **`bytes` (Optional, Enum("b" \| "kb" \| "mb" \| "gb" \| "tb" \| "pb"))**: The unit used to display byte values. -- **`full_id` (Optional, boolean \| string)**: If `true`, return the full node ID. If `false`, return the shortened node ID. +- **`full_id` (Optional, boolean)**: If `true`, return the full node ID. If `false`, return the shortened node ID. - **`include_unloaded_segments` (Optional, boolean)**: If true, the response includes information from segments that are not loaded into memory. - **`h` (Optional, Enum("build" \| "completion.size" \| "cpu" \| "disk.avail" \| "disk.total" \| "disk.used" \| "disk.used_percent" \| "fielddata.evictions" \| "fielddata.memory_size" \| "file_desc.current" \| "file_desc.max" \| "file_desc.percent" \| "flush.total" \| "flush.total_time" \| "get.current" \| "get.exists_time" \| "get.exists_total" \| "get.missing_time" \| "get.missing_total" \| "get.time" \| "get.total" \| "heap.current" \| "heap.max" \| "heap.percent" \| "http_address" \| "id" \| "indexing.delete_current" \| "indexing.delete_time" \| "indexing.delete_total" \| "indexing.index_current" \| "indexing.index_failed" \| "indexing.index_failed_due_to_version_conflict" \| "indexing.index_time" \| "indexing.index_total" \| "ip" \| "jdk" \| "load_1m" \| "load_5m" \| "load_15m" \| "mappings.total_count" \| "mappings.total_estimated_overhead_in_bytes" \| "master" \| "merges.current" \| "merges.current_docs" \| "merges.current_size" \| "merges.total" \| "merges.total_docs" \| "merges.total_size" \| "merges.total_time" \| "name" \| "node.role" \| "pid" \| "port" \| "query_cache.memory_size" \| "query_cache.evictions" \| "query_cache.hit_count" \| "query_cache.miss_count" \| "ram.current" \| "ram.max" \| "ram.percent" \| "refresh.total" \| "refresh.time" \| "request_cache.memory_size" \| "request_cache.evictions" \| "request_cache.hit_count" \| "request_cache.miss_count" \| "script.compilations" \| "script.cache_evictions" \| "search.fetch_current" \| "search.fetch_time" \| "search.fetch_total" \| "search.open_contexts" \| "search.query_current" \| "search.query_time" \| "search.query_total" \| "search.scroll_current" \| "search.scroll_time" \| "search.scroll_total" \| "segments.count" \| "segments.fixed_bitset_memory" \| "segments.index_writer_memory" \| "segments.memory" \| "segments.version_map_memory" \| "shard_stats.total_count" \| "suggest.current" \| "suggest.time" \| "suggest.total" \| "uptime" \| "version") \| Enum("build" \| "completion.size" \| "cpu" \| "disk.avail" \| "disk.total" \| "disk.used" \| "disk.used_percent" \| "fielddata.evictions" \| "fielddata.memory_size" \| "file_desc.current" \| "file_desc.max" \| "file_desc.percent" \| "flush.total" \| "flush.total_time" \| "get.current" \| "get.exists_time" \| "get.exists_total" \| "get.missing_time" \| "get.missing_total" \| "get.time" \| "get.total" \| "heap.current" \| "heap.max" \| "heap.percent" \| "http_address" \| "id" \| "indexing.delete_current" \| "indexing.delete_time" \| "indexing.delete_total" \| "indexing.index_current" \| "indexing.index_failed" \| "indexing.index_failed_due_to_version_conflict" \| "indexing.index_time" \| "indexing.index_total" \| "ip" \| "jdk" \| "load_1m" \| "load_5m" \| "load_15m" \| "mappings.total_count" \| "mappings.total_estimated_overhead_in_bytes" \| "master" \| "merges.current" \| "merges.current_docs" \| "merges.current_size" \| "merges.total" \| "merges.total_docs" \| "merges.total_size" \| "merges.total_time" \| "name" \| "node.role" \| "pid" \| "port" \| "query_cache.memory_size" \| "query_cache.evictions" \| "query_cache.hit_count" \| "query_cache.miss_count" \| "ram.current" \| "ram.max" \| "ram.percent" \| "refresh.total" \| "refresh.time" \| "request_cache.memory_size" \| "request_cache.evictions" \| "request_cache.hit_count" \| "request_cache.miss_count" \| "script.compilations" \| "script.cache_evictions" \| "search.fetch_current" \| "search.fetch_time" \| "search.fetch_total" \| "search.open_contexts" \| "search.query_current" \| "search.query_time" \| "search.query_total" \| "search.scroll_current" \| "search.scroll_time" \| "search.scroll_total" \| "segments.count" \| "segments.fixed_bitset_memory" \| "segments.index_writer_memory" \| "segments.memory" \| "segments.version_map_memory" \| "shard_stats.total_count" \| "suggest.current" \| "suggest.time" \| "suggest.total" \| "uptime" \| "version")[])**: A list of columns names to display. It supports simple wildcards. @@ -2648,7 +2659,6 @@ It supports simple wildcards. Sorting defaults to ascending and can be changed by setting `:asc` or `:desc` as a suffix to the column name. - **`master_timeout` (Optional, string \| -1 \| 0)**: The period to wait for a connection to the master node. -- **`time` (Optional, Enum("nanos" \| "micros" \| "ms" \| "s" \| "m" \| "h" \| "d"))**: The unit used to display time values. ## client.cat.pendingTasks [_cat.pending_tasks] Get pending task information. @@ -2674,7 +2684,6 @@ local cluster state. If `false` the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node. - **`master_timeout` (Optional, string \| -1 \| 0)**: Period to wait for a connection to the master node. -- **`time` (Optional, Enum("nanos" \| "micros" \| "ms" \| "s" \| "m" \| "h" \| "d"))**: Unit used to display time values. ## client.cat.plugins [_cat.plugins] Get plugin information. @@ -2722,14 +2731,12 @@ client.cat.recovery({ ... }) - **`index` (Optional, string \| string[])**: A list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. - **`active_only` (Optional, boolean)**: If `true`, the response only includes ongoing shard recoveries. -- **`bytes` (Optional, Enum("b" \| "kb" \| "mb" \| "gb" \| "tb" \| "pb"))**: The unit used to display byte values. - **`detailed` (Optional, boolean)**: If `true`, the response includes detailed information about shard recoveries. - **`h` (Optional, Enum("index" \| "shard" \| "start_time" \| "start_time_millis" \| "stop_time" \| "stop_time_millis" \| "time" \| "type" \| "stage" \| "source_host" \| "source_node" \| "target_host" \| "target_node" \| "repository" \| "snapshot" \| "files" \| "files_recovered" \| "files_percent" \| "files_total" \| "bytes" \| "bytes_recovered" \| "bytes_percent" \| "bytes_total" \| "translog_ops" \| "translog_ops_recovered" \| "translog_ops_percent") \| Enum("index" \| "shard" \| "start_time" \| "start_time_millis" \| "stop_time" \| "stop_time_millis" \| "time" \| "type" \| "stage" \| "source_host" \| "source_node" \| "target_host" \| "target_node" \| "repository" \| "snapshot" \| "files" \| "files_recovered" \| "files_percent" \| "files_total" \| "bytes" \| "bytes_recovered" \| "bytes_percent" \| "bytes_total" \| "translog_ops" \| "translog_ops_recovered" \| "translog_ops_percent")[])**: A list of columns names to display. It supports simple wildcards. - **`s` (Optional, string \| string[])**: A list of column names or aliases that determines the sort order. Sorting defaults to ascending and can be changed by setting `:asc` or `:desc` as a suffix to the column name. -- **`time` (Optional, Enum("nanos" \| "micros" \| "ms" \| "s" \| "m" \| "h" \| "d"))**: The unit used to display time values. ## client.cat.repositories [_cat.repositories] Get snapshot repository information. @@ -2775,7 +2782,6 @@ client.cat.segments({ ... }) - **`index` (Optional, string \| string[])**: A list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. -- **`bytes` (Optional, Enum("b" \| "kb" \| "mb" \| "gb" \| "tb" \| "pb"))**: The unit used to display byte values. - **`h` (Optional, Enum("index" \| "shard" \| "prirep" \| "ip" \| "segment" \| "generation" \| "docs.count" \| "docs.deleted" \| "size" \| "size.memory" \| "committed" \| "searchable" \| "version" \| "compound" \| "id") \| Enum("index" \| "shard" \| "prirep" \| "ip" \| "segment" \| "generation" \| "docs.count" \| "docs.deleted" \| "size" \| "size.memory" \| "committed" \| "searchable" \| "version" \| "compound" \| "id")[])**: A list of columns names to display. It supports simple wildcards. - **`s` (Optional, string \| string[])**: A list of column names or aliases that determines the sort order. @@ -2806,13 +2812,11 @@ client.cat.shards({ ... }) - **`index` (Optional, string \| string[])**: A list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. -- **`bytes` (Optional, Enum("b" \| "kb" \| "mb" \| "gb" \| "tb" \| "pb"))**: The unit used to display byte values. - **`h` (Optional, Enum("completion.size" \| "dataset.size" \| "dense_vector.value_count" \| "docs" \| "fielddata.evictions" \| "fielddata.memory_size" \| "flush.total" \| "flush.total_time" \| "get.current" \| "get.exists_time" \| "get.exists_total" \| "get.missing_time" \| "get.missing_total" \| "get.time" \| "get.total" \| "id" \| "index" \| "indexing.delete_current" \| "indexing.delete_time" \| "indexing.delete_total" \| "indexing.index_current" \| "indexing.index_failed_due_to_version_conflict" \| "indexing.index_failed" \| "indexing.index_time" \| "indexing.index_total" \| "ip" \| "merges.current" \| "merges.current_docs" \| "merges.current_size" \| "merges.total" \| "merges.total_docs" \| "merges.total_size" \| "merges.total_time" \| "node" \| "prirep" \| "query_cache.evictions" \| "query_cache.memory_size" \| "recoverysource.type" \| "refresh.time" \| "refresh.total" \| "search.fetch_current" \| "search.fetch_time" \| "search.fetch_total" \| "search.open_contexts" \| "search.query_current" \| "search.query_time" \| "search.query_total" \| "search.scroll_current" \| "search.scroll_time" \| "search.scroll_total" \| "segments.count" \| "segments.fixed_bitset_memory" \| "segments.index_writer_memory" \| "segments.memory" \| "segments.version_map_memory" \| "seq_no.global_checkpoint" \| "seq_no.local_checkpoint" \| "seq_no.max" \| "shard" \| "dsparse_vector.value_count" \| "state" \| "store" \| "suggest.current" \| "suggest.time" \| "suggest.total" \| "sync_id" \| "unassigned.at" \| "unassigned.details" \| "unassigned.for" \| "unassigned.reason") \| Enum("completion.size" \| "dataset.size" \| "dense_vector.value_count" \| "docs" \| "fielddata.evictions" \| "fielddata.memory_size" \| "flush.total" \| "flush.total_time" \| "get.current" \| "get.exists_time" \| "get.exists_total" \| "get.missing_time" \| "get.missing_total" \| "get.time" \| "get.total" \| "id" \| "index" \| "indexing.delete_current" \| "indexing.delete_time" \| "indexing.delete_total" \| "indexing.index_current" \| "indexing.index_failed_due_to_version_conflict" \| "indexing.index_failed" \| "indexing.index_time" \| "indexing.index_total" \| "ip" \| "merges.current" \| "merges.current_docs" \| "merges.current_size" \| "merges.total" \| "merges.total_docs" \| "merges.total_size" \| "merges.total_time" \| "node" \| "prirep" \| "query_cache.evictions" \| "query_cache.memory_size" \| "recoverysource.type" \| "refresh.time" \| "refresh.total" \| "search.fetch_current" \| "search.fetch_time" \| "search.fetch_total" \| "search.open_contexts" \| "search.query_current" \| "search.query_time" \| "search.query_total" \| "search.scroll_current" \| "search.scroll_time" \| "search.scroll_total" \| "segments.count" \| "segments.fixed_bitset_memory" \| "segments.index_writer_memory" \| "segments.memory" \| "segments.version_map_memory" \| "seq_no.global_checkpoint" \| "seq_no.local_checkpoint" \| "seq_no.max" \| "shard" \| "dsparse_vector.value_count" \| "state" \| "store" \| "suggest.current" \| "suggest.time" \| "suggest.total" \| "sync_id" \| "unassigned.at" \| "unassigned.details" \| "unassigned.for" \| "unassigned.reason")[])**: List of columns to appear in the response. Supports simple wildcards. - **`s` (Optional, string \| string[])**: A list of column names or aliases that determines the sort order. Sorting defaults to ascending and can be changed by setting `:asc` or `:desc` as a suffix to the column name. - **`master_timeout` (Optional, string \| -1 \| 0)**: The period to wait for a connection to the master node. -- **`time` (Optional, Enum("nanos" \| "micros" \| "ms" \| "s" \| "m" \| "h" \| "d"))**: The unit used to display time values. ## client.cat.snapshots [_cat.snapshots] Get snapshot information. @@ -2841,7 +2845,6 @@ It supports simple wildcards. Sorting defaults to ascending and can be changed by setting `:asc` or `:desc` as a suffix to the column name. - **`master_timeout` (Optional, string \| -1 \| 0)**: Period to wait for a connection to the master node. -- **`time` (Optional, Enum("nanos" \| "micros" \| "ms" \| "s" \| "m" \| "h" \| "d"))**: Unit used to display time values. ## client.cat.tasks [_cat.tasks] Get task information. @@ -2866,7 +2869,6 @@ client.cat.tasks({ ... }) - **`s` (Optional, string \| string[])**: List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting `:asc` or `:desc` as a suffix to the column name. -- **`time` (Optional, Enum("nanos" \| "micros" \| "ms" \| "s" \| "m" \| "h" \| "d"))**: Unit used to display time values. - **`timeout` (Optional, string \| -1 \| 0)**: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. - **`wait_for_completion` (Optional, boolean)**: If `true`, the request blocks until the task has completed. @@ -2921,7 +2923,6 @@ Accepts wildcard expressions. - **`s` (Optional, string \| string[])**: A list of column names or aliases that determines the sort order. Sorting defaults to ascending and can be changed by setting `:asc` or `:desc` as a suffix to the column name. -- **`time` (Optional, Enum("nanos" \| "micros" \| "ms" \| "s" \| "m" \| "h" \| "d"))**: The unit used to display time values. - **`local` (Optional, boolean)**: If `true`, the request computes the list of selected nodes from the local cluster state. If `false` the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating @@ -2954,7 +2955,6 @@ If `false`, the request returns a 404 status code when there are no matches or o - **`from` (Optional, number)**: Skips the specified number of transforms. - **`h` (Optional, Enum("changes_last_detection_time" \| "checkpoint" \| "checkpoint_duration_time_exp_avg" \| "checkpoint_progress" \| "create_time" \| "delete_time" \| "description" \| "dest_index" \| "documents_deleted" \| "documents_indexed" \| "docs_per_second" \| "documents_processed" \| "frequency" \| "id" \| "index_failure" \| "index_time" \| "index_total" \| "indexed_documents_exp_avg" \| "last_search_time" \| "max_page_search_size" \| "pages_processed" \| "pipeline" \| "processed_documents_exp_avg" \| "processing_time" \| "reason" \| "search_failure" \| "search_time" \| "search_total" \| "source_index" \| "state" \| "transform_type" \| "trigger_count" \| "version") \| Enum("changes_last_detection_time" \| "checkpoint" \| "checkpoint_duration_time_exp_avg" \| "checkpoint_progress" \| "create_time" \| "delete_time" \| "description" \| "dest_index" \| "documents_deleted" \| "documents_indexed" \| "docs_per_second" \| "documents_processed" \| "frequency" \| "id" \| "index_failure" \| "index_time" \| "index_total" \| "indexed_documents_exp_avg" \| "last_search_time" \| "max_page_search_size" \| "pages_processed" \| "pipeline" \| "processed_documents_exp_avg" \| "processing_time" \| "reason" \| "search_failure" \| "search_time" \| "search_total" \| "source_index" \| "state" \| "transform_type" \| "trigger_count" \| "version")[])**: List of column names to display. - **`s` (Optional, Enum("changes_last_detection_time" \| "checkpoint" \| "checkpoint_duration_time_exp_avg" \| "checkpoint_progress" \| "create_time" \| "delete_time" \| "description" \| "dest_index" \| "documents_deleted" \| "documents_indexed" \| "docs_per_second" \| "documents_processed" \| "frequency" \| "id" \| "index_failure" \| "index_time" \| "index_total" \| "indexed_documents_exp_avg" \| "last_search_time" \| "max_page_search_size" \| "pages_processed" \| "pipeline" \| "processed_documents_exp_avg" \| "processing_time" \| "reason" \| "search_failure" \| "search_time" \| "search_total" \| "source_index" \| "state" \| "transform_type" \| "trigger_count" \| "version") \| Enum("changes_last_detection_time" \| "checkpoint" \| "checkpoint_duration_time_exp_avg" \| "checkpoint_progress" \| "create_time" \| "delete_time" \| "description" \| "dest_index" \| "documents_deleted" \| "documents_indexed" \| "docs_per_second" \| "documents_processed" \| "frequency" \| "id" \| "index_failure" \| "index_time" \| "index_total" \| "indexed_documents_exp_avg" \| "last_search_time" \| "max_page_search_size" \| "pages_processed" \| "pipeline" \| "processed_documents_exp_avg" \| "processing_time" \| "reason" \| "search_failure" \| "search_time" \| "search_total" \| "source_index" \| "state" \| "transform_type" \| "trigger_count" \| "version")[])**: List of column names or column aliases used to sort the response. -- **`time` (Optional, Enum("nanos" \| "micros" \| "ms" \| "s" \| "m" \| "h" \| "d"))**: The unit used to display time values. - **`size` (Optional, number)**: The maximum number of transforms to obtain. ## client.ccr.deleteAutoFollowPattern [_ccr.delete_auto_follow_pattern] @@ -4504,6 +4504,14 @@ parameter to get a smaller or larger set of samples. To retrieve more than one s - **`expand_wildcards` (Optional, Enum("all" \| "open" \| "closed" \| "hidden" \| "none") \| Enum("all" \| "open" \| "closed" \| "hidden" \| "none")[])**: Whether to expand wildcard expression to concrete indices that are open, closed or both. - **`ccs_minimize_roundtrips` (Optional, boolean)**: Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution - **`ignore_unavailable` (Optional, boolean)**: If true, missing or closed indices are not included in the response. +- **`project_routing` (Optional, string)**: Specifies a subset of projects to target for the search using project +metadata tags in a subset of Lucene query syntax. +Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). +Examples: + _alias:my-project + _alias:_origin + _alias:*pr* +Supported in serverless only. ## client.esql.asyncQuery [_esql.async_query] Run an async ES|QL query. @@ -4531,7 +4539,7 @@ and its format can change at any time but it can give some insight into the perf of each part of the query. - **`tables` (Optional, Record>)**: Tables to use with the LOOKUP operation. The top level key is the table name and the next level key is the column name. -- **`include_ccs_metadata` (Optional, boolean)**: When set to `true` and performing a cross-cluster query, the response will include an extra `_clusters` +- **`include_ccs_metadata` (Optional, boolean)**: When set to `true` and performing a cross-cluster/cross-project query, the response will include an extra `_clusters` object with information about the clusters that participated in the search along with info such as shards count. - **`wait_for_completion_timeout` (Optional, string \| -1 \| 0)**: The period to wait for the request to finish. @@ -4673,14 +4681,14 @@ client.esql.query({ query }) - **`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_grid, 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 })**: 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)** -- **`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 \| 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. - **`profile` (Optional, boolean)**: If provided and `true` the response will include an extra `profile` object with information on how the query was executed. This information is for human debugging and its format can change at any time but it can give some insight into the performance of each part of the query. - **`tables` (Optional, Record>)**: Tables to use with the LOOKUP operation. The top level key is the table name and the next level key is the column name. -- **`include_ccs_metadata` (Optional, boolean)**: When set to `true` and performing a cross-cluster query, the response will include an extra `_clusters` +- **`include_ccs_metadata` (Optional, boolean)**: When set to `true` and performing a cross-cluster/cross-project query, the response will include an extra `_clusters` object with information about the clusters that participated in the search along with info such as shards count. - **`format` (Optional, Enum("csv" \| "json" \| "tsv" \| "txt" \| "yaml" \| "cbor" \| "smile" \| "arrow"))**: A short version of the Accept header, e.g. json, yaml. @@ -4788,7 +4796,7 @@ client.fleet.msearch({ ... }) #### Request (object) [_request_fleet.msearch] - **`index` (Optional, string \| string)**: A single target to search. If the target is an index alias, it must resolve to a single index. -- **`searches` (Optional, { allow_no_indices, expand_wildcards, ignore_unavailable, index, preference, request_cache, routing, search_type, ccs_minimize_roundtrips, allow_partial_search_results, ignore_throttled } \| { aggregations, collapse, explain, ext, from, highlight, track_total_hits, indices_boost, docvalue_fields, knn, rank, min_score, post_filter, profile, query, rescore, retriever, script_fields, search_after, size, slice, sort, _source, fields, suggest, terminate_after, timeout, track_scores, version, seq_no_primary_term, stored_fields, pit, runtime_mappings, stats }[])** +- **`searches` (Optional, { allow_no_indices, expand_wildcards, ignore_unavailable, index, preference, project_routing, request_cache, routing, search_type, ccs_minimize_roundtrips, allow_partial_search_results, ignore_throttled } \| { aggregations, collapse, explain, ext, from, highlight, track_total_hits, indices_boost, docvalue_fields, knn, rank, min_score, post_filter, profile, query, rescore, retriever, script_fields, search_after, size, slice, sort, _source, fields, suggest, terminate_after, timeout, track_scores, version, seq_no_primary_term, stored_fields, pit, runtime_mappings, stats }[])** - **`allow_no_indices` (Optional, boolean)**: If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar. - **`ccs_minimize_roundtrips` (Optional, boolean)**: If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests. - **`expand_wildcards` (Optional, Enum("all" \| "open" \| "closed" \| "hidden" \| "none") \| Enum("all" \| "open" \| "closed" \| "hidden" \| "none")[])**: Type of index that wildcard expressions can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. @@ -4842,7 +4850,7 @@ not included in search results and results collected by aggregations. - **`post_filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_grid, 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 })** - **`profile` (Optional, boolean)** - **`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_grid, 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 }[])** +- **`rescore` (Optional, { window_size, query, learning_to_rank, script } \| { window_size, query, learning_to_rank, script }[])** - **`script_fields` (Optional, Record)**: Retrieve a script evaluation (based on different fields) for each hit. - **`search_after` (Optional, number \| number \| string \| boolean \| null[])** - **`size` (Optional, number)**: The number of hits to return. By default, you cannot page through more @@ -6661,7 +6669,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 @@ -6877,6 +6885,8 @@ For data streams, the API runs the refresh operation on the stream’s backing i By default, Elasticsearch periodically refreshes indices every second, but only on indices that have received one search request or more in the last 30 seconds. You can change this default interval with the `index.refresh_interval` setting. +In Elastic Cloud Serverless, the default refresh interval is 5 seconds across all indices. + Refresh requests are synchronous and do not return a response until the refresh operation completes. Refreshes are resource-intensive. @@ -7080,6 +7090,14 @@ Supports a list of values, such as `open,hidden`. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. - **`mode` (Optional, Enum("standard" \| "time_series" \| "logsdb" \| "lookup") \| Enum("standard" \| "time_series" \| "logsdb" \| "lookup")[])**: Filter indices by index mode - standard, lookup, time_series, etc. List of IndexMode. Empty means no filter. +- **`project_routing` (Optional, string)**: Specifies a subset of projects to target using project +metadata tags in a subset of Lucene query syntax. +Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). +Examples: + _alias:my-project + _alias:_origin + _alias:*pr* +Supported in serverless only. ## client.indices.rollover [_indices.rollover] Roll over to a new index. @@ -8026,7 +8044,7 @@ client.inference.putGooglevertexai({ task_type, googlevertexai_inference_id, ser - **`task_type` (Enum("rerank" \| "text_embedding" \| "completion" \| "chat_completion"))**: The type of the inference task that the model will perform. - **`googlevertexai_inference_id` (string)**: The unique identifier of the inference endpoint. - **`service` (Enum("googlevertexai"))**: The type of service supported for the specified task type. In this case, `googlevertexai`. -- **`service_settings` ({ location, model_id, project_id, rate_limit, service_account_json })**: Settings used to install the inference model. These settings are specific to the `googlevertexai` service. +- **`service_settings` ({ location, model_id, project_id, rate_limit, service_account_json, dimensions })**: Settings used to install the inference model. These settings are specific to the `googlevertexai` service. - **`chunking_settings` (Optional, { max_chunk_size, overlap, sentence_overlap, separator_group, separators, strategy })**: The chunking configuration object. - **`task_settings` (Optional, { auto_truncate, top_n, thinking_config })**: Settings to configure the inference task. These settings are specific to the task type you specified. @@ -8549,6 +8567,7 @@ client.ingest.putPipeline({ id }) - **`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. +- **`field_access_pattern` (Optional, Enum("classic" \| "flexible"))**: Controls how processors in this pipeline should read and write data on a document's source. - **`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. - **`timeout` (Optional, string \| -1 \| 0)**: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. - **`if_version` (Optional, number)**: Required version for optimistic concurrency control for pipeline updates @@ -8571,7 +8590,7 @@ client.ingest.simulate({ docs }) - **`docs` ({ _id, _index, _source }[])**: Sample documents to test in the pipeline. - **`id` (Optional, string)**: The pipeline to test. If you don't specify a `pipeline` in the request body, this parameter is required. -- **`pipeline` (Optional, { description, on_failure, processors, version, deprecated, _meta, created_date, created_date_millis, modified_date, modified_date_millis })**: The pipeline to test. +- **`pipeline` (Optional, { description, on_failure, processors, version, deprecated, _meta, created_date, created_date_millis, modified_date, modified_date_millis, field_access_pattern })**: The pipeline to test. If you don't specify the `pipeline` request path parameter, this parameter is required. If you specify both this and the request path parameter, the API only uses the request path parameter. - **`verbose` (Optional, boolean)**: If `true`, the response includes output data for each processor in the executed pipeline. @@ -8759,7 +8778,8 @@ client.logstash.putPipeline({ id }) #### Request (object) [_request_logstash.put_pipeline] - **`id` (string)**: An identifier for the pipeline. -- **`pipeline` (Optional, { description, on_failure, processors, version, deprecated, _meta, created_date, created_date_millis, modified_date, modified_date_millis })** +Pipeline IDs must begin with a letter or underscore and contain only letters, underscores, dashes, hyphens and numbers. +- **`pipeline` (Optional, { description, on_failure, processors, version, deprecated, _meta, created_date, created_date_millis, modified_date, modified_date_millis, field_access_pattern })** ## client.migration.deprecations [_migration.deprecations] Get deprecation information. @@ -9679,7 +9699,7 @@ using `_all` or by specifying `*` as the ``. - **`bucket_span` (Optional, string \| -1 \| 0)**: Refer to the description for the `bucket_span` query parameter. - **`end` (Optional, string \| Unit)**: Refer to the description for the `end` query parameter. - **`exclude_interim` (Optional, boolean)**: Refer to the description for the `exclude_interim` query parameter. -- **`overall_score` (Optional, number \| string)**: Refer to the description for the `overall_score` query parameter. +- **`overall_score` (Optional, number)**: Refer to the description for the `overall_score` query parameter. - **`start` (Optional, string \| Unit)**: Refer to the description for the `start` query parameter. - **`top_n` (Optional, number)**: Refer to the description for the `top_n` query parameter. @@ -10918,6 +10938,13 @@ A list of the following options: `_all`, `rest_actions`. - **`timeout` (Optional, string \| -1 \| 0)**: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. +## client.project.tags [_project.tags] +Return tags defined for the project +```ts +client.project.tags() +``` + + ## client.queryRules.deleteRule [_query_rules.delete_rule] Delete a query rule. Delete a query rule within a query ruleset. @@ -12319,6 +12346,16 @@ client.security.getSettings({ ... }) - **`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. +## client.security.getStats [_security.get_stats] +Get security statistics for all nodes + +[Endpoint documentation](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-stats) + +```ts +client.security.getStats() +``` + + ## client.security.getToken [_security.get_token] Get a token. @@ -13335,7 +13372,7 @@ If you specify this parameter in the request path, it is used for any documents - **`component_template_substitutions` (Optional, Record)**: A map of component template names to substitute component template definition objects. - **`index_template_substitutions` (Optional, Record)**: A map of index template names to substitute index template definition objects. - **`mapping_addition` (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 })** -- **`pipeline_substitutions` (Optional, Record)**: Pipelines to test. +- **`pipeline_substitutions` (Optional, Record)**: Pipelines to test. If you don’t specify the `pipeline` request path parameter, this parameter is required. If you specify both this and the request path parameter, the API only uses the request path parameter. - **`pipeline` (Optional, string)**: The pipeline to use as the default pipeline. @@ -14264,6 +14301,14 @@ To save a synchronous search, you must specify this parameter and the `keep_on_c - **`format` (Optional, Enum("csv" \| "json" \| "tsv" \| "txt" \| "yaml" \| "cbor" \| "smile"))**: The format for the response. You can also specify a format using the `Accept` HTTP header. If you specify both this parameter and the `Accept` HTTP header, this parameter takes precedence. +- **`project_routing` (Optional, string)**: Specifies a subset of projects to target for the search using project +metadata tags in a subset of Lucene query syntax. +Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). +Examples: + _alias:my-project + _alias:_origin + _alias:*pr* +Supported in serverless only. ## client.sql.translate [_sql.translate] Translate SQL into Elasticsearch queries. diff --git a/src/api/api/async_search.ts b/src/api/api/async_search.ts index c20284ef0..622a16fb8 100644 --- a/src/api/api/async_search.ts +++ b/src/api/api/async_search.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class AsyncSearch { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'async_search.delete': { path: [ 'id' @@ -121,6 +122,7 @@ export default class AsyncSearch { 'lenient', 'max_concurrent_shard_requests', 'preference', + 'project_routing', 'request_cache', 'routing', 'search_type', @@ -160,7 +162,7 @@ export default class AsyncSearch { async delete (this: That, params: T.AsyncSearchDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['async_search.delete'] + } = this[kAcceptedParams]['async_search.delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -190,7 +192,10 @@ export default class AsyncSearch { name: 'async_search.delete', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -205,7 +210,7 @@ export default class AsyncSearch { async get> (this: That, params: T.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['async_search.get'] + } = this[kAcceptedParams]['async_search.get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -235,7 +240,13 @@ export default class AsyncSearch { name: 'async_search.get', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'keep_alive', + 'typed_keys', + 'wait_for_completion_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -250,7 +261,7 @@ export default class AsyncSearch { async status (this: That, params: T.AsyncSearchStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['async_search.status'] + } = this[kAcceptedParams]['async_search.status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -280,7 +291,11 @@ export default class AsyncSearch { name: 'async_search.status', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'keep_alive' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -297,7 +312,7 @@ export default class AsyncSearch { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['async_search.submit'] + } = this[kAcceptedParams]['async_search.submit'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -349,7 +364,87 @@ export default class AsyncSearch { name: 'async_search.submit', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'aggregations', + 'aggs', + 'collapse', + 'explain', + 'ext', + 'from', + 'highlight', + 'track_total_hits', + 'indices_boost', + 'docvalue_fields', + 'knn', + 'min_score', + 'post_filter', + 'profile', + 'query', + 'rescore', + 'script_fields', + 'search_after', + 'size', + 'slice', + 'sort', + '_source', + 'fields', + 'suggest', + 'terminate_after', + 'timeout', + 'track_scores', + 'version', + 'seq_no_primary_term', + 'stored_fields', + 'pit', + 'runtime_mappings', + 'stats', + 'wait_for_completion_timeout', + 'keep_alive', + 'keep_on_completion', + 'allow_no_indices', + 'allow_partial_search_results', + 'analyzer', + 'analyze_wildcard', + 'batched_reduce_size', + 'ccs_minimize_roundtrips', + 'default_operator', + 'df', + 'docvalue_fields', + 'expand_wildcards', + 'explain', + 'ignore_throttled', + 'ignore_unavailable', + 'lenient', + 'max_concurrent_shard_requests', + 'preference', + 'project_routing', + 'request_cache', + 'routing', + 'search_type', + 'stats', + 'stored_fields', + 'suggest_field', + 'suggest_mode', + 'suggest_size', + 'suggest_text', + 'terminate_after', + 'timeout', + 'track_total_hits', + 'track_scores', + 'typed_keys', + 'rest_total_hits_as_int', + 'version', + '_source', + '_source_excludes', + '_source_includes', + 'seq_no_primary_term', + 'q', + 'size', + 'from', + 'sort' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/autoscaling.ts b/src/api/api/autoscaling.ts index a7f728dba..dfbe9df2c 100644 --- a/src/api/api/autoscaling.ts +++ b/src/api/api/autoscaling.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Autoscaling { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'autoscaling.delete_autoscaling_policy': { path: [ 'name' @@ -86,7 +87,7 @@ export default class Autoscaling { async deleteAutoscalingPolicy (this: That, params: T.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['autoscaling.delete_autoscaling_policy'] + } = this[kAcceptedParams]['autoscaling.delete_autoscaling_policy'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -116,7 +117,12 @@ export default class Autoscaling { name: 'autoscaling.delete_autoscaling_policy', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -131,7 +137,7 @@ export default class Autoscaling { async getAutoscalingCapacity (this: That, params?: T.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['autoscaling.get_autoscaling_capacity'] + } = this[kAcceptedParams]['autoscaling.get_autoscaling_capacity'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -159,7 +165,10 @@ export default class Autoscaling { const method = 'GET' const path = '/_autoscaling/capacity' const meta: TransportRequestMetadata = { - name: 'autoscaling.get_autoscaling_capacity' + name: 'autoscaling.get_autoscaling_capacity', + acceptedParams: [ + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -174,7 +183,7 @@ export default class Autoscaling { async getAutoscalingPolicy (this: That, params: T.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['autoscaling.get_autoscaling_policy'] + } = this[kAcceptedParams]['autoscaling.get_autoscaling_policy'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -204,7 +213,11 @@ export default class Autoscaling { name: 'autoscaling.get_autoscaling_policy', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -221,7 +234,7 @@ export default class Autoscaling { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['autoscaling.put_autoscaling_policy'] + } = this[kAcceptedParams]['autoscaling.put_autoscaling_policy'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -251,7 +264,13 @@ export default class Autoscaling { name: 'autoscaling.put_autoscaling_policy', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'policy', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/bulk.ts b/src/api/api/bulk.ts index fa2b1e66a..06cab1229 100644 --- a/src/api/api/bulk.ts +++ b/src/api/api/bulk.ts @@ -102,7 +102,23 @@ export default async function BulkApi + [kAcceptedParams]: Record } export default class Cat { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'cat.aliases': { path: [ 'name' @@ -51,7 +52,6 @@ export default class Cat { ], body: [], query: [ - 'bytes', 'h', 's', 'local', @@ -77,6 +77,7 @@ export default class Cat { body: [], query: [ 'h', + 'project_routing', 's' ] }, @@ -86,7 +87,6 @@ export default class Cat { ], body: [], query: [ - 'bytes', 'fields', 'h', 's' @@ -96,7 +96,6 @@ export default class Cat { path: [], body: [], query: [ - 'time', 'ts', 'h', 's' @@ -113,12 +112,10 @@ export default class Cat { ], body: [], query: [ - 'bytes', 'expand_wildcards', 'health', 'include_unloaded_segments', 'pri', - 'time', 'master_timeout', 'h', 's' @@ -141,10 +138,8 @@ export default class Cat { body: [], query: [ 'allow_no_match', - 'bytes', 'h', - 's', - 'time' + 's' ] }, 'cat.ml_datafeeds': { @@ -155,8 +150,7 @@ export default class Cat { query: [ 'allow_no_match', 'h', - 's', - 'time' + 's' ] }, 'cat.ml_jobs': { @@ -166,10 +160,8 @@ export default class Cat { body: [], query: [ 'allow_no_match', - 'bytes', 'h', - 's', - 'time' + 's' ] }, 'cat.ml_trained_models': { @@ -179,12 +171,10 @@ export default class Cat { body: [], query: [ 'allow_no_match', - 'bytes', 'h', 's', 'from', - 'size', - 'time' + 'size' ] }, 'cat.nodeattrs': { @@ -201,13 +191,11 @@ export default class Cat { path: [], body: [], query: [ - 'bytes', 'full_id', 'include_unloaded_segments', 'h', 's', - 'master_timeout', - 'time' + 'master_timeout' ] }, 'cat.pending_tasks': { @@ -217,8 +205,7 @@ export default class Cat { 'h', 's', 'local', - 'master_timeout', - 'time' + 'master_timeout' ] }, 'cat.plugins': { @@ -239,12 +226,10 @@ export default class Cat { body: [], query: [ 'active_only', - 'bytes', 'detailed', 'index', 'h', - 's', - 'time' + 's' ] }, 'cat.repositories': { @@ -263,7 +248,6 @@ export default class Cat { ], body: [], query: [ - 'bytes', 'h', 's', 'local', @@ -276,11 +260,9 @@ export default class Cat { ], body: [], query: [ - 'bytes', 'h', 's', - 'master_timeout', - 'time' + 'master_timeout' ] }, 'cat.snapshots': { @@ -292,8 +274,7 @@ export default class Cat { 'ignore_unavailable', 'h', 's', - 'master_timeout', - 'time' + 'master_timeout' ] }, 'cat.tasks': { @@ -306,7 +287,6 @@ export default class Cat { 'parent_task_id', 'h', 's', - 'time', 'timeout', 'wait_for_completion' ] @@ -331,7 +311,6 @@ export default class Cat { query: [ 'h', 's', - 'time', 'local', 'master_timeout' ] @@ -346,7 +325,6 @@ export default class Cat { 'from', 'h', 's', - 'time', 'size' ] } @@ -363,7 +341,7 @@ export default class Cat { async aliases (this: That, params?: T.CatAliasesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.aliases'] + } = this[kAcceptedParams]['cat.aliases'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -401,7 +379,14 @@ export default class Cat { name: 'cat.aliases', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'h', + 's', + 'expand_wildcards', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -416,7 +401,7 @@ export default class Cat { async allocation (this: That, params?: T.CatAllocationRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.allocation'] + } = this[kAcceptedParams]['cat.allocation'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -454,7 +439,14 @@ export default class Cat { name: 'cat.allocation', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id', + 'h', + 's', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -469,7 +461,7 @@ export default class Cat { async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.component_templates'] + } = this[kAcceptedParams]['cat.component_templates'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -507,7 +499,14 @@ export default class Cat { name: 'cat.component_templates', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'h', + 's', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -522,7 +521,7 @@ export default class Cat { async count (this: That, params?: T.CatCountRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.count'] + } = this[kAcceptedParams]['cat.count'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -560,7 +559,13 @@ export default class Cat { name: 'cat.count', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'h', + 'project_routing', + 's' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -575,7 +580,7 @@ export default class Cat { async fielddata (this: That, params?: T.CatFielddataRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.fielddata'] + } = this[kAcceptedParams]['cat.fielddata'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -613,7 +618,13 @@ export default class Cat { name: 'cat.fielddata', pathParts: { fields: params.fields - } + }, + acceptedParams: [ + 'fields', + 'fields', + 'h', + 's' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -628,7 +639,7 @@ export default class Cat { async health (this: That, params?: T.CatHealthRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.health'] + } = this[kAcceptedParams]['cat.health'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -656,7 +667,12 @@ export default class Cat { const method = 'GET' const path = '/_cat/health' const meta: TransportRequestMetadata = { - name: 'cat.health' + name: 'cat.health', + acceptedParams: [ + 'ts', + 'h', + 's' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -671,7 +687,7 @@ export default class Cat { async help (this: That, params?: T.CatHelpRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.help'] + } = this[kAcceptedParams]['cat.help'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -699,7 +715,9 @@ export default class Cat { const method = 'GET' const path = '/_cat' const meta: TransportRequestMetadata = { - name: 'cat.help' + name: 'cat.help', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -714,7 +732,7 @@ export default class Cat { async indices (this: That, params?: T.CatIndicesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.indices'] + } = this[kAcceptedParams]['cat.indices'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -752,7 +770,17 @@ export default class Cat { name: 'cat.indices', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'expand_wildcards', + 'health', + 'include_unloaded_segments', + 'pri', + 'master_timeout', + 'h', + 's' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -767,7 +795,7 @@ export default class Cat { async master (this: That, params?: T.CatMasterRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.master'] + } = this[kAcceptedParams]['cat.master'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -795,7 +823,13 @@ export default class Cat { const method = 'GET' const path = '/_cat/master' const meta: TransportRequestMetadata = { - name: 'cat.master' + name: 'cat.master', + acceptedParams: [ + 'h', + 's', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -810,7 +844,7 @@ export default class Cat { async mlDataFrameAnalytics (this: That, params?: T.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.ml_data_frame_analytics'] + } = this[kAcceptedParams]['cat.ml_data_frame_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -848,7 +882,13 @@ export default class Cat { name: 'cat.ml_data_frame_analytics', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'allow_no_match', + 'h', + 's' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -863,7 +903,7 @@ export default class Cat { async mlDatafeeds (this: That, params?: T.CatMlDatafeedsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.ml_datafeeds'] + } = this[kAcceptedParams]['cat.ml_datafeeds'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -901,7 +941,13 @@ export default class Cat { name: 'cat.ml_datafeeds', pathParts: { datafeed_id: params.datafeed_id - } + }, + acceptedParams: [ + 'datafeed_id', + 'allow_no_match', + 'h', + 's' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -916,7 +962,7 @@ export default class Cat { async mlJobs (this: That, params?: T.CatMlJobsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.ml_jobs'] + } = this[kAcceptedParams]['cat.ml_jobs'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -954,7 +1000,13 @@ export default class Cat { name: 'cat.ml_jobs', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'allow_no_match', + 'h', + 's' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -969,7 +1021,7 @@ export default class Cat { async mlTrainedModels (this: That, params?: T.CatMlTrainedModelsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.ml_trained_models'] + } = this[kAcceptedParams]['cat.ml_trained_models'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1007,7 +1059,15 @@ export default class Cat { name: 'cat.ml_trained_models', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'allow_no_match', + 'h', + 's', + 'from', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1022,7 +1082,7 @@ export default class Cat { async nodeattrs (this: That, params?: T.CatNodeattrsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.nodeattrs'] + } = this[kAcceptedParams]['cat.nodeattrs'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1050,7 +1110,13 @@ export default class Cat { const method = 'GET' const path = '/_cat/nodeattrs' const meta: TransportRequestMetadata = { - name: 'cat.nodeattrs' + name: 'cat.nodeattrs', + acceptedParams: [ + 'h', + 's', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1065,7 +1131,7 @@ export default class Cat { async nodes (this: That, params?: T.CatNodesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.nodes'] + } = this[kAcceptedParams]['cat.nodes'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1093,7 +1159,14 @@ export default class Cat { const method = 'GET' const path = '/_cat/nodes' const meta: TransportRequestMetadata = { - name: 'cat.nodes' + name: 'cat.nodes', + acceptedParams: [ + 'full_id', + 'include_unloaded_segments', + 'h', + 's', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1108,7 +1181,7 @@ export default class Cat { async pendingTasks (this: That, params?: T.CatPendingTasksRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.pending_tasks'] + } = this[kAcceptedParams]['cat.pending_tasks'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1136,7 +1209,13 @@ export default class Cat { const method = 'GET' const path = '/_cat/pending_tasks' const meta: TransportRequestMetadata = { - name: 'cat.pending_tasks' + name: 'cat.pending_tasks', + acceptedParams: [ + 'h', + 's', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1151,7 +1230,7 @@ export default class Cat { async plugins (this: That, params?: T.CatPluginsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.plugins'] + } = this[kAcceptedParams]['cat.plugins'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1179,7 +1258,14 @@ export default class Cat { const method = 'GET' const path = '/_cat/plugins' const meta: TransportRequestMetadata = { - name: 'cat.plugins' + name: 'cat.plugins', + acceptedParams: [ + 'h', + 's', + 'include_bootstrap', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1194,7 +1280,7 @@ export default class Cat { async recovery (this: That, params?: T.CatRecoveryRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.recovery'] + } = this[kAcceptedParams]['cat.recovery'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1232,7 +1318,15 @@ export default class Cat { name: 'cat.recovery', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'active_only', + 'detailed', + 'index', + 'h', + 's' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1247,7 +1341,7 @@ export default class Cat { async repositories (this: That, params?: T.CatRepositoriesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.repositories'] + } = this[kAcceptedParams]['cat.repositories'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1275,7 +1369,13 @@ export default class Cat { const method = 'GET' const path = '/_cat/repositories' const meta: TransportRequestMetadata = { - name: 'cat.repositories' + name: 'cat.repositories', + acceptedParams: [ + 'h', + 's', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1290,7 +1390,7 @@ export default class Cat { async segments (this: That, params?: T.CatSegmentsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.segments'] + } = this[kAcceptedParams]['cat.segments'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1328,7 +1428,14 @@ export default class Cat { name: 'cat.segments', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'h', + 's', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1343,7 +1450,7 @@ export default class Cat { async shards (this: That, params?: T.CatShardsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.shards'] + } = this[kAcceptedParams]['cat.shards'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1381,7 +1488,13 @@ export default class Cat { name: 'cat.shards', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'h', + 's', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1396,7 +1509,7 @@ export default class Cat { async snapshots (this: That, params?: T.CatSnapshotsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.snapshots'] + } = this[kAcceptedParams]['cat.snapshots'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1434,7 +1547,14 @@ export default class Cat { name: 'cat.snapshots', pathParts: { repository: params.repository - } + }, + acceptedParams: [ + 'repository', + 'ignore_unavailable', + 'h', + 's', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1449,7 +1569,7 @@ export default class Cat { async tasks (this: That, params?: T.CatTasksRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.tasks'] + } = this[kAcceptedParams]['cat.tasks'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1477,7 +1597,17 @@ export default class Cat { const method = 'GET' const path = '/_cat/tasks' const meta: TransportRequestMetadata = { - name: 'cat.tasks' + name: 'cat.tasks', + acceptedParams: [ + 'actions', + 'detailed', + 'nodes', + 'parent_task_id', + 'h', + 's', + 'timeout', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1492,7 +1622,7 @@ export default class Cat { async templates (this: That, params?: T.CatTemplatesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.templates'] + } = this[kAcceptedParams]['cat.templates'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1530,7 +1660,14 @@ export default class Cat { name: 'cat.templates', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'h', + 's', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1545,7 +1682,7 @@ export default class Cat { async threadPool (this: That, params?: T.CatThreadPoolRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.thread_pool'] + } = this[kAcceptedParams]['cat.thread_pool'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1583,7 +1720,14 @@ export default class Cat { name: 'cat.thread_pool', pathParts: { thread_pool_patterns: params.thread_pool_patterns - } + }, + acceptedParams: [ + 'thread_pool_patterns', + 'h', + 's', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1598,7 +1742,7 @@ export default class Cat { async transforms (this: That, params?: T.CatTransformsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.transforms'] + } = this[kAcceptedParams]['cat.transforms'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1636,7 +1780,15 @@ export default class Cat { name: 'cat.transforms', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'allow_no_match', + 'from', + 'h', + 's', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/ccr.ts b/src/api/api/ccr.ts index 66849dbb9..728f0077e 100644 --- a/src/api/api/ccr.ts +++ b/src/api/api/ccr.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Ccr { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'ccr.delete_auto_follow_pattern': { path: [ 'name' @@ -212,7 +213,7 @@ export default class Ccr { async deleteAutoFollowPattern (this: That, params: T.CcrDeleteAutoFollowPatternRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ccr.delete_auto_follow_pattern'] + } = this[kAcceptedParams]['ccr.delete_auto_follow_pattern'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -242,7 +243,11 @@ export default class Ccr { name: 'ccr.delete_auto_follow_pattern', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -259,7 +264,7 @@ export default class Ccr { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ccr.follow'] + } = this[kAcceptedParams]['ccr.follow'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -299,7 +304,26 @@ export default class Ccr { name: 'ccr.follow', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'data_stream_name', + 'leader_index', + 'max_outstanding_read_requests', + 'max_outstanding_write_requests', + 'max_read_request_operation_count', + 'max_read_request_size', + 'max_retry_delay', + 'max_write_buffer_count', + 'max_write_buffer_size', + 'max_write_request_operation_count', + 'max_write_request_size', + 'read_poll_timeout', + 'remote_cluster', + 'settings', + 'master_timeout', + 'wait_for_active_shards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -314,7 +338,7 @@ export default class Ccr { async followInfo (this: That, params: T.CcrFollowInfoRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ccr.follow_info'] + } = this[kAcceptedParams]['ccr.follow_info'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -344,7 +368,11 @@ export default class Ccr { name: 'ccr.follow_info', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -359,7 +387,7 @@ export default class Ccr { async followStats (this: That, params: T.CcrFollowStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ccr.follow_stats'] + } = this[kAcceptedParams]['ccr.follow_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -389,7 +417,11 @@ export default class Ccr { name: 'ccr.follow_stats', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -406,7 +438,7 @@ export default class Ccr { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ccr.forget_follower'] + } = this[kAcceptedParams]['ccr.forget_follower'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -446,7 +478,15 @@ export default class Ccr { name: 'ccr.forget_follower', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'follower_cluster', + 'follower_index', + 'follower_index_uuid', + 'leader_remote_cluster', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -461,7 +501,7 @@ export default class Ccr { async getAutoFollowPattern (this: That, params?: T.CcrGetAutoFollowPatternRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ccr.get_auto_follow_pattern'] + } = this[kAcceptedParams]['ccr.get_auto_follow_pattern'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -499,7 +539,11 @@ export default class Ccr { name: 'ccr.get_auto_follow_pattern', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -514,7 +558,7 @@ export default class Ccr { async pauseAutoFollowPattern (this: That, params: T.CcrPauseAutoFollowPatternRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ccr.pause_auto_follow_pattern'] + } = this[kAcceptedParams]['ccr.pause_auto_follow_pattern'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -544,7 +588,11 @@ export default class Ccr { name: 'ccr.pause_auto_follow_pattern', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -559,7 +607,7 @@ export default class Ccr { async pauseFollow (this: That, params: T.CcrPauseFollowRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ccr.pause_follow'] + } = this[kAcceptedParams]['ccr.pause_follow'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -589,7 +637,11 @@ export default class Ccr { name: 'ccr.pause_follow', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -606,7 +658,7 @@ export default class Ccr { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ccr.put_auto_follow_pattern'] + } = this[kAcceptedParams]['ccr.put_auto_follow_pattern'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -646,7 +698,26 @@ export default class Ccr { name: 'ccr.put_auto_follow_pattern', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'remote_cluster', + 'follow_index_pattern', + 'leader_index_patterns', + 'leader_index_exclusion_patterns', + 'max_outstanding_read_requests', + 'settings', + 'max_outstanding_write_requests', + 'read_poll_timeout', + 'max_read_request_operation_count', + 'max_read_request_size', + 'max_retry_delay', + 'max_write_buffer_count', + 'max_write_buffer_size', + 'max_write_request_operation_count', + 'max_write_request_size', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -661,7 +732,7 @@ export default class Ccr { async resumeAutoFollowPattern (this: That, params: T.CcrResumeAutoFollowPatternRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ccr.resume_auto_follow_pattern'] + } = this[kAcceptedParams]['ccr.resume_auto_follow_pattern'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -691,7 +762,11 @@ export default class Ccr { name: 'ccr.resume_auto_follow_pattern', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -708,7 +783,7 @@ export default class Ccr { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ccr.resume_follow'] + } = this[kAcceptedParams]['ccr.resume_follow'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -748,7 +823,21 @@ export default class Ccr { name: 'ccr.resume_follow', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'max_outstanding_read_requests', + 'max_outstanding_write_requests', + 'max_read_request_operation_count', + 'max_read_request_size', + 'max_retry_delay', + 'max_write_buffer_count', + 'max_write_buffer_size', + 'max_write_request_operation_count', + 'max_write_request_size', + 'read_poll_timeout', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -763,7 +852,7 @@ export default class Ccr { async stats (this: That, params?: T.CcrStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ccr.stats'] + } = this[kAcceptedParams]['ccr.stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -791,7 +880,11 @@ export default class Ccr { const method = 'GET' const path = '/_ccr/stats' const meta: TransportRequestMetadata = { - name: 'ccr.stats' + name: 'ccr.stats', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -806,7 +899,7 @@ export default class Ccr { async unfollow (this: That, params: T.CcrUnfollowRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ccr.unfollow'] + } = this[kAcceptedParams]['ccr.unfollow'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -836,7 +929,11 @@ export default class Ccr { name: 'ccr.unfollow', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/clear_scroll.ts b/src/api/api/clear_scroll.ts index f611b3bf7..509053aa9 100644 --- a/src/api/api/clear_scroll.ts +++ b/src/api/api/clear_scroll.ts @@ -91,7 +91,11 @@ export default async function ClearScrollApi (this: That, params?: T.ClearScroll name: 'clear_scroll', pathParts: { scroll_id: params.scroll_id - } + }, + acceptedParams: [ + 'scroll_id', + 'scroll_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/close_point_in_time.ts b/src/api/api/close_point_in_time.ts index 027c18182..9af0ffe94 100644 --- a/src/api/api/close_point_in_time.ts +++ b/src/api/api/close_point_in_time.ts @@ -87,7 +87,10 @@ export default async function ClosePointInTimeApi (this: That, params: T.ClosePo const method = 'DELETE' const path = '/_pit' const meta: TransportRequestMetadata = { - name: 'close_point_in_time' + name: 'close_point_in_time', + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/cluster.ts b/src/api/api/cluster.ts index 9ecac681d..27e032432 100644 --- a/src/api/api/cluster.ts +++ b/src/api/api/cluster.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Cluster { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'cluster.allocation_explain': { path: [], body: [ @@ -237,7 +238,7 @@ export default class Cluster { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['cluster.allocation_explain'] + } = this[kAcceptedParams]['cluster.allocation_explain'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -275,7 +276,20 @@ export default class Cluster { const method = body != null ? 'POST' : 'GET' const path = '/_cluster/allocation/explain' const meta: TransportRequestMetadata = { - name: 'cluster.allocation_explain' + name: 'cluster.allocation_explain', + acceptedParams: [ + 'index', + 'shard', + 'primary', + 'current_node', + 'index', + 'shard', + 'primary', + 'current_node', + 'include_disk_info', + 'include_yes_decisions', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -290,7 +304,7 @@ export default class Cluster { async deleteComponentTemplate (this: That, params: T.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.delete_component_template'] + } = this[kAcceptedParams]['cluster.delete_component_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -320,7 +334,12 @@ export default class Cluster { name: 'cluster.delete_component_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -335,7 +354,7 @@ export default class Cluster { async deleteVotingConfigExclusions (this: That, params?: T.ClusterDeleteVotingConfigExclusionsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.delete_voting_config_exclusions'] + } = this[kAcceptedParams]['cluster.delete_voting_config_exclusions'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -363,7 +382,11 @@ export default class Cluster { const method = 'DELETE' const path = '/_cluster/voting_config_exclusions' const meta: TransportRequestMetadata = { - name: 'cluster.delete_voting_config_exclusions' + name: 'cluster.delete_voting_config_exclusions', + acceptedParams: [ + 'master_timeout', + 'wait_for_removal' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -378,7 +401,7 @@ export default class Cluster { async existsComponentTemplate (this: That, params: T.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.exists_component_template'] + } = this[kAcceptedParams]['cluster.exists_component_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -408,7 +431,12 @@ export default class Cluster { name: 'cluster.exists_component_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout', + 'local' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -423,7 +451,7 @@ export default class Cluster { async getComponentTemplate (this: That, params?: T.ClusterGetComponentTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.get_component_template'] + } = this[kAcceptedParams]['cluster.get_component_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -461,7 +489,15 @@ export default class Cluster { name: 'cluster.get_component_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'flat_settings', + 'settings_filter', + 'include_defaults', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -476,7 +512,7 @@ export default class Cluster { async getSettings (this: That, params?: T.ClusterGetSettingsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.get_settings'] + } = this[kAcceptedParams]['cluster.get_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -504,7 +540,13 @@ export default class Cluster { const method = 'GET' const path = '/_cluster/settings' const meta: TransportRequestMetadata = { - name: 'cluster.get_settings' + name: 'cluster.get_settings', + acceptedParams: [ + 'flat_settings', + 'include_defaults', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -519,7 +561,7 @@ export default class Cluster { async health (this: That, params?: T.ClusterHealthRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.health'] + } = this[kAcceptedParams]['cluster.health'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -557,7 +599,21 @@ export default class Cluster { name: 'cluster.health', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'expand_wildcards', + 'level', + 'local', + 'master_timeout', + 'timeout', + 'wait_for_active_shards', + 'wait_for_events', + 'wait_for_nodes', + 'wait_for_no_initializing_shards', + 'wait_for_no_relocating_shards', + 'wait_for_status' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -572,7 +628,7 @@ export default class Cluster { async info (this: That, params: T.ClusterInfoRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.info'] + } = this[kAcceptedParams]['cluster.info'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -602,7 +658,10 @@ export default class Cluster { name: 'cluster.info', pathParts: { target: params.target - } + }, + acceptedParams: [ + 'target' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -617,7 +676,7 @@ export default class Cluster { async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.pending_tasks'] + } = this[kAcceptedParams]['cluster.pending_tasks'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -645,7 +704,11 @@ export default class Cluster { const method = 'GET' const path = '/_cluster/pending_tasks' const meta: TransportRequestMetadata = { - name: 'cluster.pending_tasks' + name: 'cluster.pending_tasks', + acceptedParams: [ + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -660,7 +723,7 @@ export default class Cluster { async postVotingConfigExclusions (this: That, params?: T.ClusterPostVotingConfigExclusionsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.post_voting_config_exclusions'] + } = this[kAcceptedParams]['cluster.post_voting_config_exclusions'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -688,7 +751,13 @@ export default class Cluster { const method = 'POST' const path = '/_cluster/voting_config_exclusions' const meta: TransportRequestMetadata = { - name: 'cluster.post_voting_config_exclusions' + name: 'cluster.post_voting_config_exclusions', + acceptedParams: [ + 'node_names', + 'node_ids', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -705,7 +774,7 @@ export default class Cluster { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['cluster.put_component_template'] + } = this[kAcceptedParams]['cluster.put_component_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -745,7 +814,17 @@ export default class Cluster { name: 'cluster.put_component_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'template', + 'version', + '_meta', + 'deprecated', + 'create', + 'cause', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -762,7 +841,7 @@ export default class Cluster { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['cluster.put_settings'] + } = this[kAcceptedParams]['cluster.put_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -800,7 +879,14 @@ export default class Cluster { const method = 'PUT' const path = '/_cluster/settings' const meta: TransportRequestMetadata = { - name: 'cluster.put_settings' + name: 'cluster.put_settings', + acceptedParams: [ + 'persistent', + 'transient', + 'flat_settings', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -815,7 +901,7 @@ export default class Cluster { async remoteInfo (this: That, params?: T.ClusterRemoteInfoRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.remote_info'] + } = this[kAcceptedParams]['cluster.remote_info'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -843,7 +929,9 @@ export default class Cluster { const method = 'GET' const path = '/_remote/info' const meta: TransportRequestMetadata = { - name: 'cluster.remote_info' + name: 'cluster.remote_info', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -860,7 +948,7 @@ export default class Cluster { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['cluster.reroute'] + } = this[kAcceptedParams]['cluster.reroute'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -898,7 +986,16 @@ export default class Cluster { const method = 'POST' const path = '/_cluster/reroute' const meta: TransportRequestMetadata = { - name: 'cluster.reroute' + name: 'cluster.reroute', + acceptedParams: [ + 'commands', + 'dry_run', + 'explain', + 'metric', + 'retry_failed', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -913,7 +1010,7 @@ export default class Cluster { async state (this: That, params?: T.ClusterStateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.state'] + } = this[kAcceptedParams]['cluster.state'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -955,7 +1052,19 @@ export default class Cluster { pathParts: { metric: params.metric, index: params.index - } + }, + acceptedParams: [ + 'metric', + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'flat_settings', + 'ignore_unavailable', + 'local', + 'master_timeout', + 'wait_for_metadata_version', + 'wait_for_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -970,7 +1079,7 @@ export default class Cluster { async stats (this: That, params?: T.ClusterStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.stats'] + } = this[kAcceptedParams]['cluster.stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1008,7 +1117,12 @@ export default class Cluster { name: 'cluster.stats', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id', + 'include_remotes', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/connector.ts b/src/api/api/connector.ts index be52c9af3..eb3745556 100644 --- a/src/api/api/connector.ts +++ b/src/api/api/connector.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Connector { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'connector.check_in': { path: [ 'connector_id' @@ -369,7 +370,7 @@ export default class Connector { async checkIn (this: That, params: T.ConnectorCheckInRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.check_in'] + } = this[kAcceptedParams]['connector.check_in'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -399,7 +400,10 @@ export default class Connector { name: 'connector.check_in', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -414,7 +418,7 @@ export default class Connector { async delete (this: That, params: T.ConnectorDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.delete'] + } = this[kAcceptedParams]['connector.delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -444,7 +448,12 @@ export default class Connector { name: 'connector.delete', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'delete_sync_jobs', + 'hard' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -459,7 +468,7 @@ export default class Connector { async get (this: That, params: T.ConnectorGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.get'] + } = this[kAcceptedParams]['connector.get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -489,7 +498,11 @@ export default class Connector { name: 'connector.get', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'include_deleted' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -506,7 +519,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.last_sync'] + } = this[kAcceptedParams]['connector.last_sync'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -546,7 +559,22 @@ export default class Connector { name: 'connector.last_sync', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'last_access_control_sync_error', + 'last_access_control_sync_scheduled_at', + 'last_access_control_sync_status', + 'last_deleted_document_count', + 'last_incremental_sync_scheduled_at', + 'last_indexed_document_count', + 'last_seen', + 'last_sync_error', + 'last_sync_scheduled_at', + 'last_sync_status', + 'last_synced', + 'sync_cursor' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -561,7 +589,7 @@ export default class Connector { async list (this: That, params?: T.ConnectorListRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.list'] + } = this[kAcceptedParams]['connector.list'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -589,7 +617,16 @@ export default class Connector { const method = 'GET' const path = '/_connector' const meta: TransportRequestMetadata = { - name: 'connector.list' + name: 'connector.list', + acceptedParams: [ + 'from', + 'size', + 'index_name', + 'connector_name', + 'service_type', + 'include_deleted', + 'query' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -606,7 +643,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.post'] + } = this[kAcceptedParams]['connector.post'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -644,7 +681,15 @@ export default class Connector { const method = 'POST' const path = '/_connector' const meta: TransportRequestMetadata = { - name: 'connector.post' + name: 'connector.post', + acceptedParams: [ + 'description', + 'index_name', + 'is_native', + 'language', + 'name', + 'service_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -661,7 +706,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.put'] + } = this[kAcceptedParams]['connector.put'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -709,7 +754,16 @@ export default class Connector { name: 'connector.put', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'description', + 'index_name', + 'is_native', + 'language', + 'name', + 'service_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -723,7 +777,7 @@ export default class Connector { async secretDelete (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.secret_delete'] + } = this[kAcceptedParams]['connector.secret_delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -753,7 +807,10 @@ export default class Connector { name: 'connector.secret_delete', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -767,7 +824,7 @@ export default class Connector { async secretGet (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.secret_get'] + } = this[kAcceptedParams]['connector.secret_get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -797,7 +854,10 @@ export default class Connector { name: 'connector.secret_get', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -811,7 +871,7 @@ export default class Connector { async secretPost (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.secret_post'] + } = this[kAcceptedParams]['connector.secret_post'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -838,7 +898,9 @@ export default class Connector { const method = 'POST' const path = '/_connector/_secret' const meta: TransportRequestMetadata = { - name: 'connector.secret_post' + name: 'connector.secret_post', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -852,7 +914,7 @@ export default class Connector { async secretPut (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.secret_put'] + } = this[kAcceptedParams]['connector.secret_put'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -882,7 +944,10 @@ export default class Connector { name: 'connector.secret_put', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -897,7 +962,7 @@ export default class Connector { async syncJobCancel (this: That, params: T.ConnectorSyncJobCancelRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.sync_job_cancel'] + } = this[kAcceptedParams]['connector.sync_job_cancel'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -927,7 +992,10 @@ export default class Connector { name: 'connector.sync_job_cancel', pathParts: { connector_sync_job_id: params.connector_sync_job_id - } + }, + acceptedParams: [ + 'connector_sync_job_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -942,7 +1010,7 @@ export default class Connector { async syncJobCheckIn (this: That, params: T.ConnectorSyncJobCheckInRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.sync_job_check_in'] + } = this[kAcceptedParams]['connector.sync_job_check_in'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -972,7 +1040,10 @@ export default class Connector { name: 'connector.sync_job_check_in', pathParts: { connector_sync_job_id: params.connector_sync_job_id - } + }, + acceptedParams: [ + 'connector_sync_job_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -989,7 +1060,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.sync_job_claim'] + } = this[kAcceptedParams]['connector.sync_job_claim'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1029,7 +1100,12 @@ export default class Connector { name: 'connector.sync_job_claim', pathParts: { connector_sync_job_id: params.connector_sync_job_id - } + }, + acceptedParams: [ + 'connector_sync_job_id', + 'sync_cursor', + 'worker_hostname' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1044,7 +1120,7 @@ export default class Connector { async syncJobDelete (this: That, params: T.ConnectorSyncJobDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.sync_job_delete'] + } = this[kAcceptedParams]['connector.sync_job_delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1074,7 +1150,10 @@ export default class Connector { name: 'connector.sync_job_delete', pathParts: { connector_sync_job_id: params.connector_sync_job_id - } + }, + acceptedParams: [ + 'connector_sync_job_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1091,7 +1170,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.sync_job_error'] + } = this[kAcceptedParams]['connector.sync_job_error'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1131,7 +1210,11 @@ export default class Connector { name: 'connector.sync_job_error', pathParts: { connector_sync_job_id: params.connector_sync_job_id - } + }, + acceptedParams: [ + 'connector_sync_job_id', + 'error' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1146,7 +1229,7 @@ export default class Connector { async syncJobGet (this: That, params: T.ConnectorSyncJobGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.sync_job_get'] + } = this[kAcceptedParams]['connector.sync_job_get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1176,7 +1259,10 @@ export default class Connector { name: 'connector.sync_job_get', pathParts: { connector_sync_job_id: params.connector_sync_job_id - } + }, + acceptedParams: [ + 'connector_sync_job_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1191,7 +1277,7 @@ export default class Connector { async syncJobList (this: That, params?: T.ConnectorSyncJobListRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.sync_job_list'] + } = this[kAcceptedParams]['connector.sync_job_list'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1219,7 +1305,14 @@ export default class Connector { const method = 'GET' const path = '/_connector/_sync_job' const meta: TransportRequestMetadata = { - name: 'connector.sync_job_list' + name: 'connector.sync_job_list', + acceptedParams: [ + 'from', + 'size', + 'status', + 'connector_id', + 'job_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1236,7 +1329,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.sync_job_post'] + } = this[kAcceptedParams]['connector.sync_job_post'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1273,7 +1366,12 @@ export default class Connector { const method = 'POST' const path = '/_connector/_sync_job' const meta: TransportRequestMetadata = { - name: 'connector.sync_job_post' + name: 'connector.sync_job_post', + acceptedParams: [ + 'id', + 'job_type', + 'trigger_method' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1290,7 +1388,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.sync_job_update_stats'] + } = this[kAcceptedParams]['connector.sync_job_update_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1330,7 +1428,16 @@ export default class Connector { name: 'connector.sync_job_update_stats', pathParts: { connector_sync_job_id: params.connector_sync_job_id - } + }, + acceptedParams: [ + 'connector_sync_job_id', + 'deleted_document_count', + 'indexed_document_count', + 'indexed_document_volume', + 'last_seen', + 'metadata', + 'total_document_count' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1345,7 +1452,7 @@ export default class Connector { async updateActiveFiltering (this: That, params: T.ConnectorUpdateActiveFilteringRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.update_active_filtering'] + } = this[kAcceptedParams]['connector.update_active_filtering'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1375,7 +1482,10 @@ export default class Connector { name: 'connector.update_active_filtering', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1392,7 +1502,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_api_key_id'] + } = this[kAcceptedParams]['connector.update_api_key_id'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1432,7 +1542,12 @@ export default class Connector { name: 'connector.update_api_key_id', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'api_key_id', + 'api_key_secret_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1449,7 +1564,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_configuration'] + } = this[kAcceptedParams]['connector.update_configuration'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1489,7 +1604,12 @@ export default class Connector { name: 'connector.update_configuration', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'configuration', + 'values' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1506,7 +1626,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_error'] + } = this[kAcceptedParams]['connector.update_error'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1546,7 +1666,11 @@ export default class Connector { name: 'connector.update_error', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'error' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1563,7 +1687,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_features'] + } = this[kAcceptedParams]['connector.update_features'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1603,7 +1727,11 @@ export default class Connector { name: 'connector.update_features', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'features' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1620,7 +1748,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_filtering'] + } = this[kAcceptedParams]['connector.update_filtering'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1660,7 +1788,13 @@ export default class Connector { name: 'connector.update_filtering', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'filtering', + 'rules', + 'advanced_snippet' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1677,7 +1811,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_filtering_validation'] + } = this[kAcceptedParams]['connector.update_filtering_validation'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1717,7 +1851,11 @@ export default class Connector { name: 'connector.update_filtering_validation', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'validation' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1734,7 +1872,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_index_name'] + } = this[kAcceptedParams]['connector.update_index_name'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1774,7 +1912,11 @@ export default class Connector { name: 'connector.update_index_name', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'index_name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1791,7 +1933,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_name'] + } = this[kAcceptedParams]['connector.update_name'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1831,7 +1973,12 @@ export default class Connector { name: 'connector.update_name', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'name', + 'description' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1848,7 +1995,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_native'] + } = this[kAcceptedParams]['connector.update_native'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1888,7 +2035,11 @@ export default class Connector { name: 'connector.update_native', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'is_native' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1905,7 +2056,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_pipeline'] + } = this[kAcceptedParams]['connector.update_pipeline'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1945,7 +2096,11 @@ export default class Connector { name: 'connector.update_pipeline', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'pipeline' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1962,7 +2117,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_scheduling'] + } = this[kAcceptedParams]['connector.update_scheduling'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2002,7 +2157,11 @@ export default class Connector { name: 'connector.update_scheduling', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'scheduling' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2019,7 +2178,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_service_type'] + } = this[kAcceptedParams]['connector.update_service_type'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2059,7 +2218,11 @@ export default class Connector { name: 'connector.update_service_type', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'service_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2076,7 +2239,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_status'] + } = this[kAcceptedParams]['connector.update_status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2116,7 +2279,11 @@ export default class Connector { name: 'connector.update_status', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'status' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/count.ts b/src/api/api/count.ts index 820cd85dc..e71b731aa 100644 --- a/src/api/api/count.ts +++ b/src/api/api/count.ts @@ -48,6 +48,7 @@ const acceptedParams: Record (this: That, params pathParts: { id: params.id, index: params.index - } + }, + acceptedParams: [ + 'id', + 'index', + 'document', + 'include_source_on_error', + 'pipeline', + 'refresh', + 'require_alias', + 'require_data_stream', + 'routing', + 'timeout', + 'version', + 'version_type', + 'wait_for_active_shards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/dangling_indices.ts b/src/api/api/dangling_indices.ts index 92cab870b..6c914f9be 100644 --- a/src/api/api/dangling_indices.ts +++ b/src/api/api/dangling_indices.ts @@ -21,18 +21,19 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } export default class DanglingIndices { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'dangling_indices.delete_dangling_index': { path: [ 'index_uuid' @@ -73,7 +74,7 @@ export default class DanglingIndices { async deleteDanglingIndex (this: That, params: T.DanglingIndicesDeleteDanglingIndexRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['dangling_indices.delete_dangling_index'] + } = this[kAcceptedParams]['dangling_indices.delete_dangling_index'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -103,7 +104,13 @@ export default class DanglingIndices { name: 'dangling_indices.delete_dangling_index', pathParts: { index_uuid: params.index_uuid - } + }, + acceptedParams: [ + 'index_uuid', + 'accept_data_loss', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -118,7 +125,7 @@ export default class DanglingIndices { async importDanglingIndex (this: That, params: T.DanglingIndicesImportDanglingIndexRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['dangling_indices.import_dangling_index'] + } = this[kAcceptedParams]['dangling_indices.import_dangling_index'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -148,7 +155,13 @@ export default class DanglingIndices { name: 'dangling_indices.import_dangling_index', pathParts: { index_uuid: params.index_uuid - } + }, + acceptedParams: [ + 'index_uuid', + 'accept_data_loss', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -163,7 +176,7 @@ export default class DanglingIndices { async listDanglingIndices (this: That, params?: T.DanglingIndicesListDanglingIndicesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['dangling_indices.list_dangling_indices'] + } = this[kAcceptedParams]['dangling_indices.list_dangling_indices'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -191,7 +204,9 @@ export default class DanglingIndices { const method = 'GET' const path = '/_dangling' const meta: TransportRequestMetadata = { - name: 'dangling_indices.list_dangling_indices' + name: 'dangling_indices.list_dangling_indices', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/delete.ts b/src/api/api/delete.ts index 2e0a2c61d..a8ea798b4 100644 --- a/src/api/api/delete.ts +++ b/src/api/api/delete.ts @@ -87,7 +87,19 @@ export default async function DeleteApi (this: That, params: T.DeleteRequest, op pathParts: { id: params.id, index: params.index - } + }, + acceptedParams: [ + 'id', + 'index', + 'if_primary_term', + 'if_seq_no', + 'refresh', + 'routing', + 'timeout', + 'version', + 'version_type', + 'wait_for_active_shards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/delete_by_query.ts b/src/api/api/delete_by_query.ts index d13a0ff6a..126746671 100644 --- a/src/api/api/delete_by_query.ts +++ b/src/api/api/delete_by_query.ts @@ -125,7 +125,43 @@ export default async function DeleteByQueryApi (this: That, params: T.DeleteByQu name: 'delete_by_query', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'max_docs', + 'query', + 'slice', + 'sort', + 'allow_no_indices', + 'analyzer', + 'analyze_wildcard', + 'conflicts', + 'default_operator', + 'df', + 'expand_wildcards', + 'from', + 'ignore_unavailable', + 'lenient', + 'max_docs', + 'preference', + 'refresh', + 'request_cache', + 'requests_per_second', + 'routing', + 'q', + 'scroll', + 'scroll_size', + 'search_timeout', + 'search_type', + 'slices', + 'sort', + 'stats', + 'terminate_after', + 'timeout', + 'version', + 'wait_for_active_shards', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/delete_by_query_rethrottle.ts b/src/api/api/delete_by_query_rethrottle.ts index edd325fa6..fa5183cdc 100644 --- a/src/api/api/delete_by_query_rethrottle.ts +++ b/src/api/api/delete_by_query_rethrottle.ts @@ -78,7 +78,11 @@ export default async function DeleteByQueryRethrottleApi (this: That, params: T. name: 'delete_by_query_rethrottle', pathParts: { task_id: params.task_id - } + }, + acceptedParams: [ + 'task_id', + 'requests_per_second' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/delete_script.ts b/src/api/api/delete_script.ts index 32f909b8b..85c17c0c1 100644 --- a/src/api/api/delete_script.ts +++ b/src/api/api/delete_script.ts @@ -79,7 +79,12 @@ export default async function DeleteScriptApi (this: That, params: T.DeleteScrip name: 'delete_script', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/enrich.ts b/src/api/api/enrich.ts index 1dd3eb590..eb2246366 100644 --- a/src/api/api/enrich.ts +++ b/src/api/api/enrich.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Enrich { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'enrich.delete_policy': { path: [ 'name' @@ -96,7 +97,7 @@ export default class Enrich { async deletePolicy (this: That, params: T.EnrichDeletePolicyRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['enrich.delete_policy'] + } = this[kAcceptedParams]['enrich.delete_policy'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -126,7 +127,11 @@ export default class Enrich { name: 'enrich.delete_policy', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -141,7 +146,7 @@ export default class Enrich { async executePolicy (this: That, params: T.EnrichExecutePolicyRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['enrich.execute_policy'] + } = this[kAcceptedParams]['enrich.execute_policy'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -171,7 +176,12 @@ export default class Enrich { name: 'enrich.execute_policy', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -186,7 +196,7 @@ export default class Enrich { async getPolicy (this: That, params?: T.EnrichGetPolicyRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['enrich.get_policy'] + } = this[kAcceptedParams]['enrich.get_policy'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -224,7 +234,11 @@ export default class Enrich { name: 'enrich.get_policy', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -241,7 +255,7 @@ export default class Enrich { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['enrich.put_policy'] + } = this[kAcceptedParams]['enrich.put_policy'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -281,7 +295,14 @@ export default class Enrich { name: 'enrich.put_policy', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'geo_match', + 'match', + 'range', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -296,7 +317,7 @@ export default class Enrich { async stats (this: That, params?: T.EnrichStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['enrich.stats'] + } = this[kAcceptedParams]['enrich.stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -324,7 +345,10 @@ export default class Enrich { const method = 'GET' const path = '/_enrich/_stats' const meta: TransportRequestMetadata = { - name: 'enrich.stats' + name: 'enrich.stats', + acceptedParams: [ + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/eql.ts b/src/api/api/eql.ts index 7e04c2c7d..4a0f403ff 100644 --- a/src/api/api/eql.ts +++ b/src/api/api/eql.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Eql { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'eql.delete': { path: [ 'id' @@ -91,6 +92,7 @@ export default class Eql { 'ignore_unavailable', 'keep_alive', 'keep_on_completion', + 'project_routing', 'wait_for_completion_timeout' ] } @@ -107,7 +109,7 @@ export default class Eql { async delete (this: That, params: T.EqlDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['eql.delete'] + } = this[kAcceptedParams]['eql.delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -137,7 +139,10 @@ export default class Eql { name: 'eql.delete', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -152,7 +157,7 @@ export default class Eql { async get (this: That, params: T.EqlGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['eql.get'] + } = this[kAcceptedParams]['eql.get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -182,7 +187,12 @@ export default class Eql { name: 'eql.get', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'keep_alive', + 'wait_for_completion_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -197,7 +207,7 @@ export default class Eql { async getStatus (this: That, params: T.EqlGetStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['eql.get_status'] + } = this[kAcceptedParams]['eql.get_status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -227,7 +237,10 @@ export default class Eql { name: 'eql.get_status', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -244,7 +257,7 @@ export default class Eql { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['eql.search'] + } = this[kAcceptedParams]['eql.search'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -284,7 +297,37 @@ export default class Eql { name: 'eql.search', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'query', + 'case_sensitive', + 'event_category_field', + 'tiebreaker_field', + 'timestamp_field', + 'fetch_size', + 'filter', + 'keep_alive', + 'keep_on_completion', + 'wait_for_completion_timeout', + 'allow_partial_search_results', + 'allow_partial_sequence_results', + 'size', + 'fields', + 'result_position', + 'runtime_mappings', + 'max_samples_per_key', + 'allow_no_indices', + 'allow_partial_search_results', + 'allow_partial_sequence_results', + 'expand_wildcards', + 'ccs_minimize_roundtrips', + 'ignore_unavailable', + 'keep_alive', + 'keep_on_completion', + 'project_routing', + 'wait_for_completion_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/esql.ts b/src/api/api/esql.ts index 8a7341f11..c6e87d7d1 100644 --- a/src/api/api/esql.ts +++ b/src/api/api/esql.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Esql { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'esql.async_query': { path: [], body: [ @@ -46,6 +47,7 @@ export default class Esql { 'query', 'tables', 'include_ccs_metadata', + 'include_execution_metadata', 'wait_for_completion_timeout', 'keep_alive', 'keep_on_completion' @@ -107,7 +109,8 @@ export default class Esql { 'profile', 'query', 'tables', - 'include_ccs_metadata' + 'include_ccs_metadata', + 'include_execution_metadata' ], query: [ 'format', @@ -131,7 +134,7 @@ export default class Esql { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['esql.async_query'] + } = this[kAcceptedParams]['esql.async_query'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -168,7 +171,25 @@ export default class Esql { const method = 'POST' const path = '/_query/async' const meta: TransportRequestMetadata = { - name: 'esql.async_query' + name: 'esql.async_query', + acceptedParams: [ + 'columnar', + 'filter', + 'locale', + 'params', + 'profile', + 'query', + 'tables', + 'include_ccs_metadata', + 'include_execution_metadata', + 'wait_for_completion_timeout', + 'keep_alive', + 'keep_on_completion', + 'allow_partial_results', + 'delimiter', + 'drop_null_columns', + 'format' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -183,7 +204,7 @@ export default class Esql { async asyncQueryDelete (this: That, params: T.EsqlAsyncQueryDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['esql.async_query_delete'] + } = this[kAcceptedParams]['esql.async_query_delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -213,7 +234,10 @@ export default class Esql { name: 'esql.async_query_delete', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -228,7 +252,7 @@ export default class Esql { async asyncQueryGet (this: That, params: T.EsqlAsyncQueryGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['esql.async_query_get'] + } = this[kAcceptedParams]['esql.async_query_get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -258,7 +282,14 @@ export default class Esql { name: 'esql.async_query_get', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'drop_null_columns', + 'format', + 'keep_alive', + 'wait_for_completion_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -273,7 +304,7 @@ export default class Esql { async asyncQueryStop (this: That, params: T.EsqlAsyncQueryStopRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['esql.async_query_stop'] + } = this[kAcceptedParams]['esql.async_query_stop'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -303,7 +334,11 @@ export default class Esql { name: 'esql.async_query_stop', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'drop_null_columns' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -318,7 +353,7 @@ export default class Esql { async getQuery (this: That, params: T.EsqlGetQueryRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['esql.get_query'] + } = this[kAcceptedParams]['esql.get_query'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -348,7 +383,10 @@ export default class Esql { name: 'esql.get_query', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -363,7 +401,7 @@ export default class Esql { async listQueries (this: That, params?: T.EsqlListQueriesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['esql.list_queries'] + } = this[kAcceptedParams]['esql.list_queries'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -391,7 +429,9 @@ export default class Esql { const method = 'GET' const path = '/_query/queries' const meta: TransportRequestMetadata = { - name: 'esql.list_queries' + name: 'esql.list_queries', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -408,7 +448,7 @@ export default class Esql { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['esql.query'] + } = this[kAcceptedParams]['esql.query'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -445,7 +485,22 @@ export default class Esql { const method = 'POST' const path = '/_query' const meta: TransportRequestMetadata = { - name: 'esql.query' + name: 'esql.query', + acceptedParams: [ + 'columnar', + 'filter', + 'locale', + 'params', + 'profile', + 'query', + 'tables', + 'include_ccs_metadata', + 'include_execution_metadata', + 'format', + 'delimiter', + 'drop_null_columns', + 'allow_partial_results' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/exists.ts b/src/api/api/exists.ts index 3c4fad80b..931870b88 100644 --- a/src/api/api/exists.ts +++ b/src/api/api/exists.ts @@ -89,7 +89,21 @@ export default async function ExistsApi (this: That, params: T.ExistsRequest, op pathParts: { id: params.id, index: params.index - } + }, + acceptedParams: [ + 'id', + 'index', + 'preference', + 'realtime', + 'refresh', + 'routing', + '_source', + '_source_excludes', + '_source_includes', + 'stored_fields', + 'version', + 'version_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/exists_source.ts b/src/api/api/exists_source.ts index 908e12489..5f03302ea 100644 --- a/src/api/api/exists_source.ts +++ b/src/api/api/exists_source.ts @@ -88,7 +88,20 @@ export default async function ExistsSourceApi (this: That, params: T.ExistsSourc pathParts: { id: params.id, index: params.index - } + }, + acceptedParams: [ + 'id', + 'index', + 'preference', + 'realtime', + 'refresh', + 'routing', + '_source', + '_source_excludes', + '_source_includes', + 'version', + 'version_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/explain.ts b/src/api/api/explain.ts index dbf9ae6ce..e8edd8afa 100644 --- a/src/api/api/explain.ts +++ b/src/api/api/explain.ts @@ -107,7 +107,24 @@ export default async function ExplainApi (this: That, param pathParts: { id: params.id, index: params.index - } + }, + acceptedParams: [ + 'id', + 'index', + 'query', + 'analyzer', + 'analyze_wildcard', + 'default_operator', + 'df', + 'lenient', + 'preference', + 'routing', + '_source', + '_source_excludes', + '_source_includes', + 'stored_fields', + 'q' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/features.ts b/src/api/api/features.ts index 2c24d0490..6e6d0dac8 100644 --- a/src/api/api/features.ts +++ b/src/api/api/features.ts @@ -21,18 +21,19 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } export default class Features { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'features.get_features': { path: [], body: [], @@ -60,7 +61,7 @@ export default class Features { async getFeatures (this: That, params?: T.FeaturesGetFeaturesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['features.get_features'] + } = this[kAcceptedParams]['features.get_features'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -88,7 +89,10 @@ export default class Features { const method = 'GET' const path = '/_features' const meta: TransportRequestMetadata = { - name: 'features.get_features' + name: 'features.get_features', + acceptedParams: [ + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -103,7 +107,7 @@ export default class Features { async resetFeatures (this: That, params?: T.FeaturesResetFeaturesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['features.reset_features'] + } = this[kAcceptedParams]['features.reset_features'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -131,7 +135,10 @@ export default class Features { const method = 'POST' const path = '/_features/_reset' const meta: TransportRequestMetadata = { - name: 'features.reset_features' + name: 'features.reset_features', + acceptedParams: [ + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/field_caps.ts b/src/api/api/field_caps.ts index c2cd39b07..000a51899 100644 --- a/src/api/api/field_caps.ts +++ b/src/api/api/field_caps.ts @@ -46,7 +46,8 @@ const acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Fleet { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'fleet.delete_secret': { path: [ 'id' @@ -185,7 +186,7 @@ export default class Fleet { async deleteSecret (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['fleet.delete_secret'] + } = this[kAcceptedParams]['fleet.delete_secret'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -215,7 +216,10 @@ export default class Fleet { name: 'fleet.delete_secret', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -229,7 +233,7 @@ export default class Fleet { async getSecret (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['fleet.get_secret'] + } = this[kAcceptedParams]['fleet.get_secret'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -259,7 +263,10 @@ export default class Fleet { name: 'fleet.get_secret', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -274,7 +281,7 @@ export default class Fleet { async globalCheckpoints (this: That, params: T.FleetGlobalCheckpointsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['fleet.global_checkpoints'] + } = this[kAcceptedParams]['fleet.global_checkpoints'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -304,7 +311,14 @@ export default class Fleet { name: 'fleet.global_checkpoints', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'wait_for_advance', + 'wait_for_index', + 'checkpoints', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -321,7 +335,7 @@ export default class Fleet { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['fleet.msearch'] + } = this[kAcceptedParams]['fleet.msearch'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -358,7 +372,24 @@ export default class Fleet { name: 'fleet.msearch', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'searches', + 'allow_no_indices', + 'ccs_minimize_roundtrips', + 'expand_wildcards', + 'ignore_throttled', + 'ignore_unavailable', + 'max_concurrent_searches', + 'max_concurrent_shard_requests', + 'pre_filter_shard_size', + 'search_type', + 'rest_total_hits_as_int', + 'typed_keys', + 'wait_for_checkpoints', + 'allow_partial_search_results' + ] } return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options) } @@ -372,7 +403,7 @@ export default class Fleet { async postSecret (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['fleet.post_secret'] + } = this[kAcceptedParams]['fleet.post_secret'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -399,7 +430,9 @@ export default class Fleet { const method = 'POST' const path = '/_fleet/secret' const meta: TransportRequestMetadata = { - name: 'fleet.post_secret' + name: 'fleet.post_secret', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -416,7 +449,7 @@ export default class Fleet { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['fleet.search'] + } = this[kAcceptedParams]['fleet.search'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -456,7 +489,85 @@ export default class Fleet { name: 'fleet.search', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'aggregations', + 'aggs', + 'collapse', + 'explain', + 'ext', + 'from', + 'highlight', + 'track_total_hits', + 'indices_boost', + 'docvalue_fields', + 'min_score', + 'post_filter', + 'profile', + 'query', + 'rescore', + 'script_fields', + 'search_after', + 'size', + 'slice', + 'sort', + '_source', + 'fields', + 'suggest', + 'terminate_after', + 'timeout', + 'track_scores', + 'version', + 'seq_no_primary_term', + 'stored_fields', + 'pit', + 'runtime_mappings', + 'stats', + 'allow_no_indices', + 'analyzer', + 'analyze_wildcard', + 'batched_reduce_size', + 'ccs_minimize_roundtrips', + 'default_operator', + 'df', + 'docvalue_fields', + 'expand_wildcards', + 'explain', + 'ignore_throttled', + 'ignore_unavailable', + 'lenient', + 'max_concurrent_shard_requests', + 'preference', + 'pre_filter_shard_size', + 'request_cache', + 'routing', + 'scroll', + 'search_type', + 'stats', + 'stored_fields', + 'suggest_field', + 'suggest_mode', + 'suggest_size', + 'suggest_text', + 'terminate_after', + 'timeout', + 'track_total_hits', + 'track_scores', + 'typed_keys', + 'rest_total_hits_as_int', + 'version', + '_source', + '_source_excludes', + '_source_includes', + 'seq_no_primary_term', + 'q', + 'size', + 'from', + 'sort', + 'wait_for_checkpoints', + 'allow_partial_search_results' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/get.ts b/src/api/api/get.ts index 5150eef02..80f660e0d 100644 --- a/src/api/api/get.ts +++ b/src/api/api/get.ts @@ -91,7 +91,23 @@ export default async function GetApi (this: That, params: T pathParts: { id: params.id, index: params.index - } + }, + acceptedParams: [ + 'id', + 'index', + 'force_synthetic_source', + 'preference', + 'realtime', + 'refresh', + 'routing', + '_source', + '_source_excludes', + '_source_exclude_vectors', + '_source_includes', + 'stored_fields', + 'version', + 'version_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/get_script.ts b/src/api/api/get_script.ts index 82891ae01..863fc3260 100644 --- a/src/api/api/get_script.ts +++ b/src/api/api/get_script.ts @@ -78,7 +78,11 @@ export default async function GetScriptApi (this: That, params: T.GetScriptReque name: 'get_script', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/get_script_context.ts b/src/api/api/get_script_context.ts index 7cd4ea26e..e80b010bd 100644 --- a/src/api/api/get_script_context.ts +++ b/src/api/api/get_script_context.ts @@ -72,7 +72,9 @@ export default async function GetScriptContextApi (this: That, params?: T.GetScr const method = 'GET' const path = '/_script_context' const meta: TransportRequestMetadata = { - name: 'get_script_context' + name: 'get_script_context', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/get_script_languages.ts b/src/api/api/get_script_languages.ts index 748b7550e..3b3827019 100644 --- a/src/api/api/get_script_languages.ts +++ b/src/api/api/get_script_languages.ts @@ -72,7 +72,9 @@ export default async function GetScriptLanguagesApi (this: That, params?: T.GetS const method = 'GET' const path = '/_script_language' const meta: TransportRequestMetadata = { - name: 'get_script_languages' + name: 'get_script_languages', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/get_source.ts b/src/api/api/get_source.ts index 889d459d3..3f30b7030 100644 --- a/src/api/api/get_source.ts +++ b/src/api/api/get_source.ts @@ -88,7 +88,20 @@ export default async function GetSourceApi (this: That, par pathParts: { id: params.id, index: params.index - } + }, + acceptedParams: [ + 'id', + 'index', + 'preference', + 'realtime', + 'refresh', + 'routing', + '_source', + '_source_excludes', + '_source_includes', + 'version', + 'version_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/graph.ts b/src/api/api/graph.ts index 7f74a9763..580a73e4a 100644 --- a/src/api/api/graph.ts +++ b/src/api/api/graph.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Graph { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'graph.explore': { path: [ 'index' @@ -65,7 +66,7 @@ export default class Graph { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['graph.explore'] + } = this[kAcceptedParams]['graph.explore'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -105,7 +106,16 @@ export default class Graph { name: 'graph.explore', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'connections', + 'controls', + 'query', + 'vertices', + 'routing', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/health_report.ts b/src/api/api/health_report.ts index 9620c003a..b9de60dd1 100644 --- a/src/api/api/health_report.ts +++ b/src/api/api/health_report.ts @@ -88,7 +88,13 @@ export default async function HealthReportApi (this: That, params?: T.HealthRepo name: 'health_report', pathParts: { feature: params.feature - } + }, + acceptedParams: [ + 'feature', + 'timeout', + 'verbose', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/ilm.ts b/src/api/api/ilm.ts index a6c11c643..70c52ab89 100644 --- a/src/api/api/ilm.ts +++ b/src/api/api/ilm.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Ilm { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'ilm.delete_lifecycle': { path: [ 'name' @@ -147,7 +148,7 @@ export default class Ilm { async deleteLifecycle (this: That, params: T.IlmDeleteLifecycleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ilm.delete_lifecycle'] + } = this[kAcceptedParams]['ilm.delete_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -177,7 +178,12 @@ export default class Ilm { name: 'ilm.delete_lifecycle', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'policy', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -192,7 +198,7 @@ export default class Ilm { async explainLifecycle (this: That, params: T.IlmExplainLifecycleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ilm.explain_lifecycle'] + } = this[kAcceptedParams]['ilm.explain_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -222,7 +228,13 @@ export default class Ilm { name: 'ilm.explain_lifecycle', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'only_errors', + 'only_managed', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -237,7 +249,7 @@ export default class Ilm { async getLifecycle (this: That, params?: T.IlmGetLifecycleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ilm.get_lifecycle'] + } = this[kAcceptedParams]['ilm.get_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -275,7 +287,12 @@ export default class Ilm { name: 'ilm.get_lifecycle', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'policy', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -290,7 +307,7 @@ export default class Ilm { async getStatus (this: That, params?: T.IlmGetStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ilm.get_status'] + } = this[kAcceptedParams]['ilm.get_status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -318,7 +335,9 @@ export default class Ilm { const method = 'GET' const path = '/_ilm/status' const meta: TransportRequestMetadata = { - name: 'ilm.get_status' + name: 'ilm.get_status', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -335,7 +354,7 @@ export default class Ilm { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ilm.migrate_to_data_tiers'] + } = this[kAcceptedParams]['ilm.migrate_to_data_tiers'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -373,7 +392,13 @@ export default class Ilm { const method = 'POST' const path = '/_ilm/migrate_to_data_tiers' const meta: TransportRequestMetadata = { - name: 'ilm.migrate_to_data_tiers' + name: 'ilm.migrate_to_data_tiers', + acceptedParams: [ + 'legacy_template_to_delete', + 'node_attribute', + 'dry_run', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -390,7 +415,7 @@ export default class Ilm { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ilm.move_to_step'] + } = this[kAcceptedParams]['ilm.move_to_step'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -430,7 +455,12 @@ export default class Ilm { name: 'ilm.move_to_step', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'current_step', + 'next_step' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -447,7 +477,7 @@ export default class Ilm { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ilm.put_lifecycle'] + } = this[kAcceptedParams]['ilm.put_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -487,7 +517,13 @@ export default class Ilm { name: 'ilm.put_lifecycle', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'policy', + 'policy', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -502,7 +538,7 @@ export default class Ilm { async removePolicy (this: That, params: T.IlmRemovePolicyRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ilm.remove_policy'] + } = this[kAcceptedParams]['ilm.remove_policy'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -532,7 +568,10 @@ export default class Ilm { name: 'ilm.remove_policy', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -547,7 +586,7 @@ export default class Ilm { async retry (this: That, params: T.IlmRetryRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ilm.retry'] + } = this[kAcceptedParams]['ilm.retry'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -577,7 +616,10 @@ export default class Ilm { name: 'ilm.retry', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -592,7 +634,7 @@ export default class Ilm { async start (this: That, params?: T.IlmStartRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ilm.start'] + } = this[kAcceptedParams]['ilm.start'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -620,7 +662,11 @@ export default class Ilm { const method = 'POST' const path = '/_ilm/start' const meta: TransportRequestMetadata = { - name: 'ilm.start' + name: 'ilm.start', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -635,7 +681,7 @@ export default class Ilm { async stop (this: That, params?: T.IlmStopRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ilm.stop'] + } = this[kAcceptedParams]['ilm.stop'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -663,7 +709,11 @@ export default class Ilm { const method = 'POST' const path = '/_ilm/stop' const meta: TransportRequestMetadata = { - name: 'ilm.stop' + name: 'ilm.stop', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/index.ts b/src/api/api/index.ts index 49c2e7c9a..e86110ed8 100644 --- a/src/api/api/index.ts +++ b/src/api/api/index.ts @@ -105,7 +105,25 @@ export default async function IndexApi (this: That, params: pathParts: { id: params.id, index: params.index - } + }, + acceptedParams: [ + 'id', + 'index', + 'document', + 'if_primary_term', + 'if_seq_no', + 'include_source_on_error', + 'op_type', + 'pipeline', + 'refresh', + 'routing', + 'timeout', + 'version', + 'version_type', + 'wait_for_active_shards', + 'require_alias', + 'require_data_stream' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/indices.ts b/src/api/api/indices.ts index 8af4331e5..849d9b4a1 100644 --- a/src/api/api/indices.ts +++ b/src/api/api/indices.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Indices { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'indices.add_block': { path: [ 'index', @@ -794,7 +795,8 @@ export default class Indices { 'expand_wildcards', 'ignore_unavailable', 'allow_no_indices', - 'mode' + 'mode', + 'project_routing' ] }, 'indices.rollover': { @@ -969,7 +971,7 @@ export default class Indices { async addBlock (this: That, params: T.IndicesAddBlockRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.add_block'] + } = this[kAcceptedParams]['indices.add_block'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1000,7 +1002,16 @@ export default class Indices { pathParts: { index: params.index, block: params.block - } + }, + acceptedParams: [ + 'index', + 'block', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1017,7 +1028,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.analyze'] + } = this[kAcceptedParams]['indices.analyze'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1065,7 +1076,20 @@ export default class Indices { name: 'indices.analyze', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'analyzer', + 'attributes', + 'char_filter', + 'explain', + 'field', + 'filter', + 'normalizer', + 'text', + 'tokenizer', + 'index' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1080,7 +1104,7 @@ export default class Indices { async cancelMigrateReindex (this: That, params: T.IndicesCancelMigrateReindexRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.cancel_migrate_reindex'] + } = this[kAcceptedParams]['indices.cancel_migrate_reindex'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1110,7 +1134,10 @@ export default class Indices { name: 'indices.cancel_migrate_reindex', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1125,7 +1152,7 @@ export default class Indices { async clearCache (this: That, params?: T.IndicesClearCacheRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.clear_cache'] + } = this[kAcceptedParams]['indices.clear_cache'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1163,7 +1190,18 @@ export default class Indices { name: 'indices.clear_cache', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'fielddata', + 'fields', + 'ignore_unavailable', + 'query', + 'request' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1180,7 +1218,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.clone'] + } = this[kAcceptedParams]['indices.clone'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1221,7 +1259,16 @@ export default class Indices { pathParts: { index: params.index, target: params.target - } + }, + acceptedParams: [ + 'index', + 'target', + 'aliases', + 'settings', + 'master_timeout', + 'timeout', + 'wait_for_active_shards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1236,7 +1283,7 @@ export default class Indices { async close (this: That, params: T.IndicesCloseRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.close'] + } = this[kAcceptedParams]['indices.close'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1266,7 +1313,16 @@ export default class Indices { name: 'indices.close', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'master_timeout', + 'timeout', + 'wait_for_active_shards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1283,7 +1339,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.create'] + } = this[kAcceptedParams]['indices.create'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1323,7 +1379,16 @@ export default class Indices { name: 'indices.create', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'aliases', + 'mappings', + 'settings', + 'master_timeout', + 'timeout', + 'wait_for_active_shards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1338,7 +1403,7 @@ export default class Indices { async createDataStream (this: That, params: T.IndicesCreateDataStreamRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.create_data_stream'] + } = this[kAcceptedParams]['indices.create_data_stream'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1368,7 +1433,12 @@ export default class Indices { name: 'indices.create_data_stream', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1385,7 +1455,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.create_from'] + } = this[kAcceptedParams]['indices.create_from'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1416,7 +1486,12 @@ export default class Indices { pathParts: { source: params.source, dest: params.dest - } + }, + acceptedParams: [ + 'source', + 'dest', + 'create_from' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1431,7 +1506,7 @@ export default class Indices { async dataStreamsStats (this: That, params?: T.IndicesDataStreamsStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.data_streams_stats'] + } = this[kAcceptedParams]['indices.data_streams_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1469,7 +1544,11 @@ export default class Indices { name: 'indices.data_streams_stats', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'expand_wildcards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1484,7 +1563,7 @@ export default class Indices { async delete (this: That, params: T.IndicesDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.delete'] + } = this[kAcceptedParams]['indices.delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1514,7 +1593,15 @@ export default class Indices { name: 'indices.delete', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1529,7 +1616,7 @@ export default class Indices { async deleteAlias (this: That, params: T.IndicesDeleteAliasRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.delete_alias'] + } = this[kAcceptedParams]['indices.delete_alias'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1567,7 +1654,13 @@ export default class Indices { pathParts: { index: params.index, name: params.name - } + }, + acceptedParams: [ + 'index', + 'name', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1582,7 +1675,7 @@ export default class Indices { async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.delete_data_lifecycle'] + } = this[kAcceptedParams]['indices.delete_data_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1612,7 +1705,13 @@ export default class Indices { name: 'indices.delete_data_lifecycle', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'expand_wildcards', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1627,7 +1726,7 @@ export default class Indices { async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.delete_data_stream'] + } = this[kAcceptedParams]['indices.delete_data_stream'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1657,7 +1756,12 @@ export default class Indices { name: 'indices.delete_data_stream', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout', + 'expand_wildcards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1672,7 +1776,7 @@ export default class Indices { async deleteDataStreamOptions (this: That, params: T.IndicesDeleteDataStreamOptionsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.delete_data_stream_options'] + } = this[kAcceptedParams]['indices.delete_data_stream_options'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1702,7 +1806,13 @@ export default class Indices { name: 'indices.delete_data_stream_options', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'expand_wildcards', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1717,7 +1827,7 @@ export default class Indices { async deleteIndexTemplate (this: That, params: T.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.delete_index_template'] + } = this[kAcceptedParams]['indices.delete_index_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1747,7 +1857,12 @@ export default class Indices { name: 'indices.delete_index_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1762,7 +1877,7 @@ export default class Indices { async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.delete_template'] + } = this[kAcceptedParams]['indices.delete_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1792,7 +1907,12 @@ export default class Indices { name: 'indices.delete_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1807,7 +1927,7 @@ export default class Indices { async diskUsage (this: That, params: T.IndicesDiskUsageRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.disk_usage'] + } = this[kAcceptedParams]['indices.disk_usage'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1837,7 +1957,15 @@ export default class Indices { name: 'indices.disk_usage', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'flush', + 'ignore_unavailable', + 'run_expensive_tasks' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1854,7 +1982,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.downsample'] + } = this[kAcceptedParams]['indices.downsample'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1885,7 +2013,12 @@ export default class Indices { pathParts: { index: params.index, target_index: params.target_index - } + }, + acceptedParams: [ + 'index', + 'target_index', + 'config' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1900,7 +2033,7 @@ export default class Indices { async exists (this: That, params: T.IndicesExistsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.exists'] + } = this[kAcceptedParams]['indices.exists'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1930,7 +2063,16 @@ export default class Indices { name: 'indices.exists', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'flat_settings', + 'ignore_unavailable', + 'include_defaults', + 'local' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1945,7 +2087,7 @@ export default class Indices { async existsAlias (this: That, params: T.IndicesExistsAliasRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.exists_alias'] + } = this[kAcceptedParams]['indices.exists_alias'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1983,7 +2125,15 @@ export default class Indices { pathParts: { name: params.name, index: params.index - } + }, + acceptedParams: [ + 'name', + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1998,7 +2148,7 @@ export default class Indices { async existsIndexTemplate (this: That, params: T.IndicesExistsIndexTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.exists_index_template'] + } = this[kAcceptedParams]['indices.exists_index_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2028,7 +2178,13 @@ export default class Indices { name: 'indices.exists_index_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'local', + 'flat_settings', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2043,7 +2199,7 @@ export default class Indices { async existsTemplate (this: That, params: T.IndicesExistsTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.exists_template'] + } = this[kAcceptedParams]['indices.exists_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2073,7 +2229,13 @@ export default class Indices { name: 'indices.exists_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'flat_settings', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2088,7 +2250,7 @@ export default class Indices { async explainDataLifecycle (this: That, params: T.IndicesExplainDataLifecycleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.explain_data_lifecycle'] + } = this[kAcceptedParams]['indices.explain_data_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2118,7 +2280,12 @@ export default class Indices { name: 'indices.explain_data_lifecycle', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'include_defaults', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2133,7 +2300,7 @@ export default class Indices { async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.field_usage_stats'] + } = this[kAcceptedParams]['indices.field_usage_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2163,7 +2330,14 @@ export default class Indices { name: 'indices.field_usage_stats', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'fields' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2178,7 +2352,7 @@ export default class Indices { async flush (this: That, params?: T.IndicesFlushRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.flush'] + } = this[kAcceptedParams]['indices.flush'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2216,7 +2390,15 @@ export default class Indices { name: 'indices.flush', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'force', + 'ignore_unavailable', + 'wait_if_ongoing' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2231,7 +2413,7 @@ export default class Indices { async forcemerge (this: That, params?: T.IndicesForcemergeRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.forcemerge'] + } = this[kAcceptedParams]['indices.forcemerge'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2269,7 +2451,17 @@ export default class Indices { name: 'indices.forcemerge', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'flush', + 'ignore_unavailable', + 'max_num_segments', + 'only_expunge_deletes', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2284,7 +2476,7 @@ export default class Indices { async get (this: That, params: T.IndicesGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get'] + } = this[kAcceptedParams]['indices.get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2314,7 +2506,18 @@ export default class Indices { name: 'indices.get', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'flat_settings', + 'ignore_unavailable', + 'include_defaults', + 'local', + 'master_timeout', + 'features' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2329,7 +2532,7 @@ export default class Indices { async getAlias (this: That, params?: T.IndicesGetAliasRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_alias'] + } = this[kAcceptedParams]['indices.get_alias'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2374,7 +2577,15 @@ export default class Indices { pathParts: { name: params.name, index: params.index - } + }, + acceptedParams: [ + 'name', + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2389,7 +2600,7 @@ export default class Indices { async getDataLifecycle (this: That, params: T.IndicesGetDataLifecycleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_data_lifecycle'] + } = this[kAcceptedParams]['indices.get_data_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2419,7 +2630,13 @@ export default class Indices { name: 'indices.get_data_lifecycle', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'expand_wildcards', + 'include_defaults', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2434,7 +2651,7 @@ export default class Indices { async getDataLifecycleStats (this: That, params?: T.IndicesGetDataLifecycleStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_data_lifecycle_stats'] + } = this[kAcceptedParams]['indices.get_data_lifecycle_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2462,7 +2679,9 @@ export default class Indices { const method = 'GET' const path = '/_lifecycle/stats' const meta: TransportRequestMetadata = { - name: 'indices.get_data_lifecycle_stats' + name: 'indices.get_data_lifecycle_stats', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2477,7 +2696,7 @@ export default class Indices { async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_data_stream'] + } = this[kAcceptedParams]['indices.get_data_stream'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2515,7 +2734,14 @@ export default class Indices { name: 'indices.get_data_stream', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'expand_wildcards', + 'include_defaults', + 'master_timeout', + 'verbose' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2530,7 +2756,7 @@ export default class Indices { async getDataStreamMappings (this: That, params: T.IndicesGetDataStreamMappingsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_data_stream_mappings'] + } = this[kAcceptedParams]['indices.get_data_stream_mappings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2560,7 +2786,11 @@ export default class Indices { name: 'indices.get_data_stream_mappings', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2575,7 +2805,7 @@ export default class Indices { async getDataStreamOptions (this: That, params: T.IndicesGetDataStreamOptionsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_data_stream_options'] + } = this[kAcceptedParams]['indices.get_data_stream_options'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2605,7 +2835,12 @@ export default class Indices { name: 'indices.get_data_stream_options', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'expand_wildcards', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2620,7 +2855,7 @@ export default class Indices { async getDataStreamSettings (this: That, params: T.IndicesGetDataStreamSettingsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_data_stream_settings'] + } = this[kAcceptedParams]['indices.get_data_stream_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2650,7 +2885,11 @@ export default class Indices { name: 'indices.get_data_stream_settings', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2665,7 +2904,7 @@ export default class Indices { async getFieldMapping (this: That, params: T.IndicesGetFieldMappingRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_field_mapping'] + } = this[kAcceptedParams]['indices.get_field_mapping'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2703,7 +2942,15 @@ export default class Indices { pathParts: { fields: params.fields, index: params.index - } + }, + acceptedParams: [ + 'fields', + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'include_defaults' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2718,7 +2965,7 @@ export default class Indices { async getIndexTemplate (this: That, params?: T.IndicesGetIndexTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_index_template'] + } = this[kAcceptedParams]['indices.get_index_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2756,7 +3003,14 @@ export default class Indices { name: 'indices.get_index_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'local', + 'flat_settings', + 'master_timeout', + 'include_defaults' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2771,7 +3025,7 @@ export default class Indices { async getMapping (this: That, params?: T.IndicesGetMappingRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_mapping'] + } = this[kAcceptedParams]['indices.get_mapping'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2809,7 +3063,15 @@ export default class Indices { name: 'indices.get_mapping', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2824,7 +3086,7 @@ export default class Indices { async getMigrateReindexStatus (this: That, params: T.IndicesGetMigrateReindexStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_migrate_reindex_status'] + } = this[kAcceptedParams]['indices.get_migrate_reindex_status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2854,7 +3116,10 @@ export default class Indices { name: 'indices.get_migrate_reindex_status', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2869,7 +3134,7 @@ export default class Indices { async getSettings (this: That, params?: T.IndicesGetSettingsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_settings'] + } = this[kAcceptedParams]['indices.get_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2914,7 +3179,18 @@ export default class Indices { pathParts: { index: params.index, name: params.name - } + }, + acceptedParams: [ + 'index', + 'name', + 'allow_no_indices', + 'expand_wildcards', + 'flat_settings', + 'ignore_unavailable', + 'include_defaults', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2929,7 +3205,7 @@ export default class Indices { async getTemplate (this: That, params?: T.IndicesGetTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_template'] + } = this[kAcceptedParams]['indices.get_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2967,7 +3243,13 @@ export default class Indices { name: 'indices.get_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'flat_settings', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2984,7 +3266,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.migrate_reindex'] + } = this[kAcceptedParams]['indices.migrate_reindex'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3011,7 +3293,10 @@ export default class Indices { const method = 'POST' const path = '/_migration/reindex' const meta: TransportRequestMetadata = { - name: 'indices.migrate_reindex' + name: 'indices.migrate_reindex', + acceptedParams: [ + 'reindex' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3026,7 +3311,7 @@ export default class Indices { async migrateToDataStream (this: That, params: T.IndicesMigrateToDataStreamRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.migrate_to_data_stream'] + } = this[kAcceptedParams]['indices.migrate_to_data_stream'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3056,7 +3341,12 @@ export default class Indices { name: 'indices.migrate_to_data_stream', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3073,7 +3363,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.modify_data_stream'] + } = this[kAcceptedParams]['indices.modify_data_stream'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3110,7 +3400,10 @@ export default class Indices { const method = 'POST' const path = '/_data_stream/_modify' const meta: TransportRequestMetadata = { - name: 'indices.modify_data_stream' + name: 'indices.modify_data_stream', + acceptedParams: [ + 'actions' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3125,7 +3418,7 @@ export default class Indices { async open (this: That, params: T.IndicesOpenRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.open'] + } = this[kAcceptedParams]['indices.open'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3155,7 +3448,16 @@ export default class Indices { name: 'indices.open', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'master_timeout', + 'timeout', + 'wait_for_active_shards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3170,7 +3472,7 @@ export default class Indices { async promoteDataStream (this: That, params: T.IndicesPromoteDataStreamRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.promote_data_stream'] + } = this[kAcceptedParams]['indices.promote_data_stream'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3200,7 +3502,11 @@ export default class Indices { name: 'indices.promote_data_stream', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3217,7 +3523,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.put_alias'] + } = this[kAcceptedParams]['indices.put_alias'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3265,7 +3571,18 @@ export default class Indices { pathParts: { index: params.index, name: params.name - } + }, + acceptedParams: [ + 'index', + 'name', + 'filter', + 'index_routing', + 'is_write_index', + 'routing', + 'search_routing', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3282,7 +3599,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.put_data_lifecycle'] + } = this[kAcceptedParams]['indices.put_data_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3322,7 +3639,16 @@ export default class Indices { name: 'indices.put_data_lifecycle', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'data_retention', + 'downsampling', + 'enabled', + 'expand_wildcards', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3339,7 +3665,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.put_data_stream_mappings'] + } = this[kAcceptedParams]['indices.put_data_stream_mappings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3369,7 +3695,14 @@ export default class Indices { name: 'indices.put_data_stream_mappings', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'mappings', + 'dry_run', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3386,7 +3719,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.put_data_stream_options'] + } = this[kAcceptedParams]['indices.put_data_stream_options'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3426,7 +3759,14 @@ export default class Indices { name: 'indices.put_data_stream_options', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'failure_store', + 'expand_wildcards', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3443,7 +3783,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.put_data_stream_settings'] + } = this[kAcceptedParams]['indices.put_data_stream_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3473,7 +3813,14 @@ export default class Indices { name: 'indices.put_data_stream_settings', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'settings', + 'dry_run', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3490,7 +3837,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.put_index_template'] + } = this[kAcceptedParams]['indices.put_index_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3530,7 +3877,23 @@ export default class Indices { name: 'indices.put_index_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'index_patterns', + 'composed_of', + 'template', + 'data_stream', + 'priority', + 'version', + '_meta', + 'allow_auto_create', + 'ignore_missing_component_templates', + 'deprecated', + 'create', + 'master_timeout', + 'cause' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3547,7 +3910,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.put_mapping'] + } = this[kAcceptedParams]['indices.put_mapping'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3587,7 +3950,27 @@ export default class Indices { name: 'indices.put_mapping', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'date_detection', + 'dynamic', + 'dynamic_date_formats', + 'dynamic_templates', + '_field_names', + '_meta', + 'numeric_detection', + 'properties', + '_routing', + '_source', + 'runtime', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'master_timeout', + 'timeout', + 'write_index_only' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3604,7 +3987,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.put_settings'] + } = this[kAcceptedParams]['indices.put_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3641,7 +4024,19 @@ export default class Indices { name: 'indices.put_settings', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'settings', + 'allow_no_indices', + 'expand_wildcards', + 'flat_settings', + 'ignore_unavailable', + 'master_timeout', + 'preserve_existing', + 'reopen', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3658,7 +4053,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.put_template'] + } = this[kAcceptedParams]['indices.put_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3698,7 +4093,20 @@ export default class Indices { name: 'indices.put_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'aliases', + 'index_patterns', + 'mappings', + 'order', + 'settings', + 'version', + 'create', + 'master_timeout', + 'order', + 'cause' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3713,7 +4121,7 @@ export default class Indices { async recovery (this: That, params?: T.IndicesRecoveryRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.recovery'] + } = this[kAcceptedParams]['indices.recovery'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3751,13 +4159,21 @@ export default class Indices { name: 'indices.recovery', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'active_only', + 'detailed', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Refresh an index. A refresh makes recent operations performed on one or more indices available for search. For data streams, the API runs the refresh operation on the stream’s backing indices. By default, Elasticsearch periodically refreshes indices every second, but only on indices that have received one search request or more in the last 30 seconds. You can change this default interval with the `index.refresh_interval` setting. Refresh requests are synchronous and do not return a response until the refresh operation completes. Refreshes are resource-intensive. To ensure good cluster performance, it's recommended to wait for Elasticsearch's periodic refresh rather than performing an explicit refresh when possible. If your application workflow indexes documents and then runs a search to retrieve the indexed document, it's recommended to use the index API's `refresh=wait_for` query parameter option. This option ensures the indexing operation waits for a periodic refresh before running the search. + * Refresh an index. A refresh makes recent operations performed on one or more indices available for search. For data streams, the API runs the refresh operation on the stream’s backing indices. By default, Elasticsearch periodically refreshes indices every second, but only on indices that have received one search request or more in the last 30 seconds. You can change this default interval with the `index.refresh_interval` setting. In Elastic Cloud Serverless, the default refresh interval is 5 seconds across all indices. Refresh requests are synchronous and do not return a response until the refresh operation completes. Refreshes are resource-intensive. To ensure good cluster performance, it's recommended to wait for Elasticsearch's periodic refresh rather than performing an explicit refresh when possible. If your application workflow indexes documents and then runs a search to retrieve the indexed document, it's recommended to use the index API's `refresh=wait_for` query parameter option. This option ensures the indexing operation waits for a periodic refresh before running the search. * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-refresh | Elasticsearch API documentation} */ async refresh (this: That, params?: T.IndicesRefreshRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -3766,7 +4182,7 @@ export default class Indices { async refresh (this: That, params?: T.IndicesRefreshRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.refresh'] + } = this[kAcceptedParams]['indices.refresh'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3804,7 +4220,13 @@ export default class Indices { name: 'indices.refresh', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3819,7 +4241,7 @@ export default class Indices { async reloadSearchAnalyzers (this: That, params: T.IndicesReloadSearchAnalyzersRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.reload_search_analyzers'] + } = this[kAcceptedParams]['indices.reload_search_analyzers'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3849,7 +4271,14 @@ export default class Indices { name: 'indices.reload_search_analyzers', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'resource' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3864,7 +4293,7 @@ export default class Indices { async removeBlock (this: That, params: T.IndicesRemoveBlockRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.remove_block'] + } = this[kAcceptedParams]['indices.remove_block'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3895,7 +4324,16 @@ export default class Indices { pathParts: { index: params.index, block: params.block - } + }, + acceptedParams: [ + 'index', + 'block', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3910,7 +4348,7 @@ export default class Indices { async resolveCluster (this: That, params?: T.IndicesResolveClusterRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.resolve_cluster'] + } = this[kAcceptedParams]['indices.resolve_cluster'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3948,7 +4386,15 @@ export default class Indices { name: 'indices.resolve_cluster', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_throttled', + 'ignore_unavailable', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3963,7 +4409,7 @@ export default class Indices { async resolveIndex (this: That, params: T.IndicesResolveIndexRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.resolve_index'] + } = this[kAcceptedParams]['indices.resolve_index'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3993,7 +4439,15 @@ export default class Indices { name: 'indices.resolve_index', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'expand_wildcards', + 'ignore_unavailable', + 'allow_no_indices', + 'mode', + 'project_routing' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4010,7 +4464,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.rollover'] + } = this[kAcceptedParams]['indices.rollover'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4058,7 +4512,20 @@ export default class Indices { pathParts: { alias: params.alias, new_index: params.new_index - } + }, + acceptedParams: [ + 'alias', + 'new_index', + 'aliases', + 'conditions', + 'mappings', + 'settings', + 'dry_run', + 'master_timeout', + 'timeout', + 'wait_for_active_shards', + 'lazy' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4073,7 +4540,7 @@ export default class Indices { async segments (this: That, params?: T.IndicesSegmentsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.segments'] + } = this[kAcceptedParams]['indices.segments'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4111,7 +4578,13 @@ export default class Indices { name: 'indices.segments', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4126,7 +4599,7 @@ export default class Indices { async shardStores (this: That, params?: T.IndicesShardStoresRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.shard_stores'] + } = this[kAcceptedParams]['indices.shard_stores'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4164,7 +4637,14 @@ export default class Indices { name: 'indices.shard_stores', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'status' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4181,7 +4661,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.shrink'] + } = this[kAcceptedParams]['indices.shrink'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4222,7 +4702,16 @@ export default class Indices { pathParts: { index: params.index, target: params.target - } + }, + acceptedParams: [ + 'index', + 'target', + 'aliases', + 'settings', + 'master_timeout', + 'timeout', + 'wait_for_active_shards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4239,7 +4728,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.simulate_index_template'] + } = this[kAcceptedParams]['indices.simulate_index_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4269,7 +4758,15 @@ export default class Indices { name: 'indices.simulate_index_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'index_template', + 'create', + 'cause', + 'master_timeout', + 'include_defaults' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4286,7 +4783,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.simulate_template'] + } = this[kAcceptedParams]['indices.simulate_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4334,7 +4831,24 @@ export default class Indices { name: 'indices.simulate_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'allow_auto_create', + 'index_patterns', + 'composed_of', + 'template', + 'data_stream', + 'priority', + 'version', + '_meta', + 'ignore_missing_component_templates', + 'deprecated', + 'create', + 'cause', + 'master_timeout', + 'include_defaults' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4351,7 +4865,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.split'] + } = this[kAcceptedParams]['indices.split'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4392,7 +4906,16 @@ export default class Indices { pathParts: { index: params.index, target: params.target - } + }, + acceptedParams: [ + 'index', + 'target', + 'aliases', + 'settings', + 'master_timeout', + 'timeout', + 'wait_for_active_shards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4407,7 +4930,7 @@ export default class Indices { async stats (this: That, params?: T.IndicesStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.stats'] + } = this[kAcceptedParams]['indices.stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4452,7 +4975,20 @@ export default class Indices { pathParts: { metric: params.metric, index: params.index - } + }, + acceptedParams: [ + 'metric', + 'index', + 'completion_fields', + 'expand_wildcards', + 'fielddata_fields', + 'fields', + 'forbid_closed_indices', + 'groups', + 'include_segment_file_sizes', + 'include_unloaded_segments', + 'level' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4469,7 +5005,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.update_aliases'] + } = this[kAcceptedParams]['indices.update_aliases'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4507,7 +5043,12 @@ export default class Indices { const method = 'POST' const path = '/_aliases' const meta: TransportRequestMetadata = { - name: 'indices.update_aliases' + name: 'indices.update_aliases', + acceptedParams: [ + 'actions', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4524,7 +5065,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.validate_query'] + } = this[kAcceptedParams]['indices.validate_query'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4572,7 +5113,23 @@ export default class Indices { name: 'indices.validate_query', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'query', + 'allow_no_indices', + 'all_shards', + 'analyzer', + 'analyze_wildcard', + 'default_operator', + 'df', + 'expand_wildcards', + 'explain', + 'ignore_unavailable', + 'lenient', + 'rewrite', + 'q' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/inference.ts b/src/api/api/inference.ts index 05d3fab06..a15aa20e4 100644 --- a/src/api/api/inference.ts +++ b/src/api/api/inference.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Inference { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'inference.chat_completion_unified': { path: [ 'inference_id' @@ -483,7 +484,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.chat_completion_unified'] + } = this[kAcceptedParams]['inference.chat_completion_unified'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -513,7 +514,12 @@ export default class Inference { name: 'inference.chat_completion_unified', pathParts: { inference_id: params.inference_id - } + }, + acceptedParams: [ + 'inference_id', + 'chat_completion_request', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -530,7 +536,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.completion'] + } = this[kAcceptedParams]['inference.completion'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -570,7 +576,13 @@ export default class Inference { name: 'inference.completion', pathParts: { inference_id: params.inference_id - } + }, + acceptedParams: [ + 'inference_id', + 'input', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -585,7 +597,7 @@ export default class Inference { async delete (this: That, params: T.InferenceDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['inference.delete'] + } = this[kAcceptedParams]['inference.delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -623,7 +635,13 @@ export default class Inference { pathParts: { task_type: params.task_type, inference_id: params.inference_id - } + }, + acceptedParams: [ + 'task_type', + 'inference_id', + 'dry_run', + 'force' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -638,7 +656,7 @@ export default class Inference { async get (this: That, params?: T.InferenceGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['inference.get'] + } = this[kAcceptedParams]['inference.get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -680,7 +698,11 @@ export default class Inference { pathParts: { task_type: params.task_type, inference_id: params.inference_id - } + }, + acceptedParams: [ + 'task_type', + 'inference_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -697,7 +719,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.inference'] + } = this[kAcceptedParams]['inference.inference'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -745,7 +767,16 @@ export default class Inference { pathParts: { task_type: params.task_type, inference_id: params.inference_id - } + }, + acceptedParams: [ + 'task_type', + 'inference_id', + 'query', + 'input', + 'input_type', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -762,7 +793,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put'] + } = this[kAcceptedParams]['inference.put'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -800,7 +831,13 @@ export default class Inference { pathParts: { task_type: params.task_type, inference_id: params.inference_id - } + }, + acceptedParams: [ + 'task_type', + 'inference_id', + 'inference_config', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -817,7 +854,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_ai21'] + } = this[kAcceptedParams]['inference.put_ai21'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -858,7 +895,14 @@ export default class Inference { pathParts: { task_type: params.task_type, ai21_inference_id: params.ai21_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'ai21_inference_id', + 'service', + 'service_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -875,7 +919,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_alibabacloud'] + } = this[kAcceptedParams]['inference.put_alibabacloud'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -916,7 +960,16 @@ export default class Inference { pathParts: { task_type: params.task_type, alibabacloud_inference_id: params.alibabacloud_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'alibabacloud_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -933,7 +986,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_amazonbedrock'] + } = this[kAcceptedParams]['inference.put_amazonbedrock'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -974,7 +1027,16 @@ export default class Inference { pathParts: { task_type: params.task_type, amazonbedrock_inference_id: params.amazonbedrock_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'amazonbedrock_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -991,7 +1053,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_amazonsagemaker'] + } = this[kAcceptedParams]['inference.put_amazonsagemaker'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1032,7 +1094,16 @@ export default class Inference { pathParts: { task_type: params.task_type, amazonsagemaker_inference_id: params.amazonsagemaker_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'amazonsagemaker_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1049,7 +1120,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_anthropic'] + } = this[kAcceptedParams]['inference.put_anthropic'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1090,7 +1161,16 @@ export default class Inference { pathParts: { task_type: params.task_type, anthropic_inference_id: params.anthropic_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'anthropic_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1107,7 +1187,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_azureaistudio'] + } = this[kAcceptedParams]['inference.put_azureaistudio'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1148,7 +1228,16 @@ export default class Inference { pathParts: { task_type: params.task_type, azureaistudio_inference_id: params.azureaistudio_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'azureaistudio_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1165,7 +1254,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_azureopenai'] + } = this[kAcceptedParams]['inference.put_azureopenai'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1206,7 +1295,16 @@ export default class Inference { pathParts: { task_type: params.task_type, azureopenai_inference_id: params.azureopenai_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'azureopenai_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1223,7 +1321,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_cohere'] + } = this[kAcceptedParams]['inference.put_cohere'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1264,7 +1362,16 @@ export default class Inference { pathParts: { task_type: params.task_type, cohere_inference_id: params.cohere_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'cohere_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1281,7 +1388,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_custom'] + } = this[kAcceptedParams]['inference.put_custom'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1322,7 +1429,15 @@ export default class Inference { pathParts: { task_type: params.task_type, custom_inference_id: params.custom_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'custom_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1339,7 +1454,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_deepseek'] + } = this[kAcceptedParams]['inference.put_deepseek'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1380,7 +1495,15 @@ export default class Inference { pathParts: { task_type: params.task_type, deepseek_inference_id: params.deepseek_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'deepseek_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1397,7 +1520,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_elasticsearch'] + } = this[kAcceptedParams]['inference.put_elasticsearch'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1438,7 +1561,16 @@ export default class Inference { pathParts: { task_type: params.task_type, elasticsearch_inference_id: params.elasticsearch_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'elasticsearch_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1455,7 +1587,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_elser'] + } = this[kAcceptedParams]['inference.put_elser'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1496,7 +1628,15 @@ export default class Inference { pathParts: { task_type: params.task_type, elser_inference_id: params.elser_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'elser_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1513,7 +1653,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_googleaistudio'] + } = this[kAcceptedParams]['inference.put_googleaistudio'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1554,7 +1694,15 @@ export default class Inference { pathParts: { task_type: params.task_type, googleaistudio_inference_id: params.googleaistudio_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'googleaistudio_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1571,7 +1719,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_googlevertexai'] + } = this[kAcceptedParams]['inference.put_googlevertexai'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1612,7 +1760,16 @@ export default class Inference { pathParts: { task_type: params.task_type, googlevertexai_inference_id: params.googlevertexai_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'googlevertexai_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1629,7 +1786,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_hugging_face'] + } = this[kAcceptedParams]['inference.put_hugging_face'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1670,7 +1827,16 @@ export default class Inference { pathParts: { task_type: params.task_type, huggingface_inference_id: params.huggingface_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'huggingface_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1687,7 +1853,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_jinaai'] + } = this[kAcceptedParams]['inference.put_jinaai'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1728,7 +1894,16 @@ export default class Inference { pathParts: { task_type: params.task_type, jinaai_inference_id: params.jinaai_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'jinaai_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1745,7 +1920,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_llama'] + } = this[kAcceptedParams]['inference.put_llama'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1786,7 +1961,15 @@ export default class Inference { pathParts: { task_type: params.task_type, llama_inference_id: params.llama_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'llama_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1803,7 +1986,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_mistral'] + } = this[kAcceptedParams]['inference.put_mistral'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1844,7 +2027,15 @@ export default class Inference { pathParts: { task_type: params.task_type, mistral_inference_id: params.mistral_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'mistral_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1861,7 +2052,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_openai'] + } = this[kAcceptedParams]['inference.put_openai'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1902,7 +2093,16 @@ export default class Inference { pathParts: { task_type: params.task_type, openai_inference_id: params.openai_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'openai_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1919,7 +2119,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_voyageai'] + } = this[kAcceptedParams]['inference.put_voyageai'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1960,7 +2160,16 @@ export default class Inference { pathParts: { task_type: params.task_type, voyageai_inference_id: params.voyageai_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'voyageai_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1977,7 +2186,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_watsonx'] + } = this[kAcceptedParams]['inference.put_watsonx'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2018,7 +2227,14 @@ export default class Inference { pathParts: { task_type: params.task_type, watsonx_inference_id: params.watsonx_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'watsonx_inference_id', + 'service', + 'service_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2035,7 +2251,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.rerank'] + } = this[kAcceptedParams]['inference.rerank'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2075,7 +2291,14 @@ export default class Inference { name: 'inference.rerank', pathParts: { inference_id: params.inference_id - } + }, + acceptedParams: [ + 'inference_id', + 'query', + 'input', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2092,7 +2315,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.sparse_embedding'] + } = this[kAcceptedParams]['inference.sparse_embedding'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2132,7 +2355,13 @@ export default class Inference { name: 'inference.sparse_embedding', pathParts: { inference_id: params.inference_id - } + }, + acceptedParams: [ + 'inference_id', + 'input', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2149,7 +2378,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.stream_completion'] + } = this[kAcceptedParams]['inference.stream_completion'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2189,7 +2418,13 @@ export default class Inference { name: 'inference.stream_completion', pathParts: { inference_id: params.inference_id - } + }, + acceptedParams: [ + 'inference_id', + 'input', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2206,7 +2441,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.text_embedding'] + } = this[kAcceptedParams]['inference.text_embedding'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2246,7 +2481,14 @@ export default class Inference { name: 'inference.text_embedding', pathParts: { inference_id: params.inference_id - } + }, + acceptedParams: [ + 'inference_id', + 'input', + 'input_type', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2263,7 +2505,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.update'] + } = this[kAcceptedParams]['inference.update'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2301,7 +2543,12 @@ export default class Inference { pathParts: { inference_id: params.inference_id, task_type: params.task_type - } + }, + acceptedParams: [ + 'inference_id', + 'task_type', + 'inference_config' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/info.ts b/src/api/api/info.ts index d490a4fac..225d118f6 100644 --- a/src/api/api/info.ts +++ b/src/api/api/info.ts @@ -72,7 +72,9 @@ export default async function InfoApi (this: That, params?: T.InfoRequest, optio const method = 'GET' const path = '/' const meta: TransportRequestMetadata = { - name: 'info' + name: 'info', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/ingest.ts b/src/api/api/ingest.ts index 732135791..2214ab286 100644 --- a/src/api/api/ingest.ts +++ b/src/api/api/ingest.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Ingest { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'ingest.delete_geoip_database': { path: [ 'id' @@ -134,7 +135,8 @@ export default class Ingest { 'on_failure', 'processors', 'version', - 'deprecated' + 'deprecated', + 'field_access_pattern' ], query: [ 'master_timeout', @@ -167,7 +169,7 @@ export default class Ingest { async deleteGeoipDatabase (this: That, params: T.IngestDeleteGeoipDatabaseRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ingest.delete_geoip_database'] + } = this[kAcceptedParams]['ingest.delete_geoip_database'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -197,7 +199,12 @@ export default class Ingest { name: 'ingest.delete_geoip_database', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -212,7 +219,7 @@ export default class Ingest { async deleteIpLocationDatabase (this: That, params: T.IngestDeleteIpLocationDatabaseRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ingest.delete_ip_location_database'] + } = this[kAcceptedParams]['ingest.delete_ip_location_database'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -242,7 +249,12 @@ export default class Ingest { name: 'ingest.delete_ip_location_database', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -257,7 +269,7 @@ export default class Ingest { async deletePipeline (this: That, params: T.IngestDeletePipelineRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ingest.delete_pipeline'] + } = this[kAcceptedParams]['ingest.delete_pipeline'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -287,7 +299,12 @@ export default class Ingest { name: 'ingest.delete_pipeline', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -302,7 +319,7 @@ export default class Ingest { async geoIpStats (this: That, params?: T.IngestGeoIpStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ingest.geo_ip_stats'] + } = this[kAcceptedParams]['ingest.geo_ip_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -330,7 +347,9 @@ export default class Ingest { const method = 'GET' const path = '/_ingest/geoip/stats' const meta: TransportRequestMetadata = { - name: 'ingest.geo_ip_stats' + name: 'ingest.geo_ip_stats', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -345,7 +364,7 @@ export default class Ingest { async getGeoipDatabase (this: That, params?: T.IngestGetGeoipDatabaseRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ingest.get_geoip_database'] + } = this[kAcceptedParams]['ingest.get_geoip_database'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -383,7 +402,10 @@ export default class Ingest { name: 'ingest.get_geoip_database', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -398,7 +420,7 @@ export default class Ingest { async getIpLocationDatabase (this: That, params?: T.IngestGetIpLocationDatabaseRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ingest.get_ip_location_database'] + } = this[kAcceptedParams]['ingest.get_ip_location_database'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -436,7 +458,10 @@ export default class Ingest { name: 'ingest.get_ip_location_database', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -451,7 +476,7 @@ export default class Ingest { async getPipeline (this: That, params?: T.IngestGetPipelineRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ingest.get_pipeline'] + } = this[kAcceptedParams]['ingest.get_pipeline'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -489,7 +514,12 @@ export default class Ingest { name: 'ingest.get_pipeline', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'master_timeout', + 'summary' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -504,7 +534,7 @@ export default class Ingest { async processorGrok (this: That, params?: T.IngestProcessorGrokRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ingest.processor_grok'] + } = this[kAcceptedParams]['ingest.processor_grok'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -532,7 +562,9 @@ export default class Ingest { const method = 'GET' const path = '/_ingest/processor/grok' const meta: TransportRequestMetadata = { - name: 'ingest.processor_grok' + name: 'ingest.processor_grok', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -549,7 +581,7 @@ export default class Ingest { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ingest.put_geoip_database'] + } = this[kAcceptedParams]['ingest.put_geoip_database'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -589,7 +621,14 @@ export default class Ingest { name: 'ingest.put_geoip_database', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'name', + 'maxmind', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -606,7 +645,7 @@ export default class Ingest { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ingest.put_ip_location_database'] + } = this[kAcceptedParams]['ingest.put_ip_location_database'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -636,7 +675,13 @@ export default class Ingest { name: 'ingest.put_ip_location_database', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'configuration', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -653,7 +698,7 @@ export default class Ingest { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ingest.put_pipeline'] + } = this[kAcceptedParams]['ingest.put_pipeline'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -693,7 +738,20 @@ export default class Ingest { name: 'ingest.put_pipeline', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + '_meta', + 'description', + 'on_failure', + 'processors', + 'version', + 'deprecated', + 'field_access_pattern', + 'master_timeout', + 'timeout', + 'if_version' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -710,7 +768,7 @@ export default class Ingest { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ingest.simulate'] + } = this[kAcceptedParams]['ingest.simulate'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -757,7 +815,13 @@ export default class Ingest { name: 'ingest.simulate', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'docs', + 'pipeline', + 'verbose' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/knn_search.ts b/src/api/api/knn_search.ts index 2fd7b462b..737050353 100644 --- a/src/api/api/knn_search.ts +++ b/src/api/api/knn_search.ts @@ -75,7 +75,10 @@ export default async function KnnSearchApi (this: That, params?: T.TODO, options name: 'knn_search', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/license.ts b/src/api/api/license.ts index b9072b867..6b501374b 100644 --- a/src/api/api/license.ts +++ b/src/api/api/license.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class License { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'license.delete': { path: [], body: [], @@ -104,7 +105,7 @@ export default class License { async delete (this: That, params?: T.LicenseDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['license.delete'] + } = this[kAcceptedParams]['license.delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -132,7 +133,11 @@ export default class License { const method = 'DELETE' const path = '/_license' const meta: TransportRequestMetadata = { - name: 'license.delete' + name: 'license.delete', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -147,7 +152,7 @@ export default class License { async get (this: That, params?: T.LicenseGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['license.get'] + } = this[kAcceptedParams]['license.get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -175,7 +180,11 @@ export default class License { const method = 'GET' const path = '/_license' const meta: TransportRequestMetadata = { - name: 'license.get' + name: 'license.get', + acceptedParams: [ + 'accept_enterprise', + 'local' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -190,7 +199,7 @@ export default class License { async getBasicStatus (this: That, params?: T.LicenseGetBasicStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['license.get_basic_status'] + } = this[kAcceptedParams]['license.get_basic_status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -218,7 +227,9 @@ export default class License { const method = 'GET' const path = '/_license/basic_status' const meta: TransportRequestMetadata = { - name: 'license.get_basic_status' + name: 'license.get_basic_status', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -233,7 +244,7 @@ export default class License { async getTrialStatus (this: That, params?: T.LicenseGetTrialStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['license.get_trial_status'] + } = this[kAcceptedParams]['license.get_trial_status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -261,7 +272,9 @@ export default class License { const method = 'GET' const path = '/_license/trial_status' const meta: TransportRequestMetadata = { - name: 'license.get_trial_status' + name: 'license.get_trial_status', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -278,7 +291,7 @@ export default class License { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['license.post'] + } = this[kAcceptedParams]['license.post'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -316,7 +329,14 @@ export default class License { const method = 'PUT' const path = '/_license' const meta: TransportRequestMetadata = { - name: 'license.post' + name: 'license.post', + acceptedParams: [ + 'license', + 'licenses', + 'acknowledge', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -331,7 +351,7 @@ export default class License { async postStartBasic (this: That, params?: T.LicensePostStartBasicRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['license.post_start_basic'] + } = this[kAcceptedParams]['license.post_start_basic'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -359,7 +379,12 @@ export default class License { const method = 'POST' const path = '/_license/start_basic' const meta: TransportRequestMetadata = { - name: 'license.post_start_basic' + name: 'license.post_start_basic', + acceptedParams: [ + 'acknowledge', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -374,7 +399,7 @@ export default class License { async postStartTrial (this: That, params?: T.LicensePostStartTrialRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['license.post_start_trial'] + } = this[kAcceptedParams]['license.post_start_trial'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -402,7 +427,12 @@ export default class License { const method = 'POST' const path = '/_license/start_trial' const meta: TransportRequestMetadata = { - name: 'license.post_start_trial' + name: 'license.post_start_trial', + acceptedParams: [ + 'acknowledge', + 'type', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/logstash.ts b/src/api/api/logstash.ts index f3909331b..4832165c8 100644 --- a/src/api/api/logstash.ts +++ b/src/api/api/logstash.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Logstash { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'logstash.delete_pipeline': { path: [ 'id' @@ -71,7 +72,7 @@ export default class Logstash { async deletePipeline (this: That, params: T.LogstashDeletePipelineRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['logstash.delete_pipeline'] + } = this[kAcceptedParams]['logstash.delete_pipeline'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -101,7 +102,10 @@ export default class Logstash { name: 'logstash.delete_pipeline', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -116,7 +120,7 @@ export default class Logstash { async getPipeline (this: That, params?: T.LogstashGetPipelineRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['logstash.get_pipeline'] + } = this[kAcceptedParams]['logstash.get_pipeline'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -154,7 +158,10 @@ export default class Logstash { name: 'logstash.get_pipeline', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -171,7 +178,7 @@ export default class Logstash { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['logstash.put_pipeline'] + } = this[kAcceptedParams]['logstash.put_pipeline'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -201,7 +208,11 @@ export default class Logstash { name: 'logstash.put_pipeline', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'pipeline' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/mget.ts b/src/api/api/mget.ts index c09cdecaf..3857df0f9 100644 --- a/src/api/api/mget.ts +++ b/src/api/api/mget.ts @@ -111,7 +111,21 @@ export default async function MgetApi (this: That, params?: name: 'mget', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'docs', + 'ids', + 'force_synthetic_source', + 'preference', + 'realtime', + 'refresh', + 'routing', + '_source', + '_source_excludes', + '_source_includes', + 'stored_fields' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/migration.ts b/src/api/api/migration.ts index 6c1cbb7bf..dd61c399d 100644 --- a/src/api/api/migration.ts +++ b/src/api/api/migration.ts @@ -21,18 +21,19 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } export default class Migration { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'migration.deprecations': { path: [ 'index' @@ -63,7 +64,7 @@ export default class Migration { async deprecations (this: That, params?: T.MigrationDeprecationsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['migration.deprecations'] + } = this[kAcceptedParams]['migration.deprecations'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -101,7 +102,10 @@ export default class Migration { name: 'migration.deprecations', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -116,7 +120,7 @@ export default class Migration { async getFeatureUpgradeStatus (this: That, params?: T.MigrationGetFeatureUpgradeStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['migration.get_feature_upgrade_status'] + } = this[kAcceptedParams]['migration.get_feature_upgrade_status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -144,7 +148,9 @@ export default class Migration { const method = 'GET' const path = '/_migration/system_features' const meta: TransportRequestMetadata = { - name: 'migration.get_feature_upgrade_status' + name: 'migration.get_feature_upgrade_status', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -159,7 +165,7 @@ export default class Migration { async postFeatureUpgrade (this: That, params?: T.MigrationPostFeatureUpgradeRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['migration.post_feature_upgrade'] + } = this[kAcceptedParams]['migration.post_feature_upgrade'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -187,7 +193,9 @@ export default class Migration { const method = 'POST' const path = '/_migration/system_features' const meta: TransportRequestMetadata = { - name: 'migration.post_feature_upgrade' + name: 'migration.post_feature_upgrade', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/ml.ts b/src/api/api/ml.ts index 55cec2dd8..a47ec8993 100644 --- a/src/api/api/ml.ts +++ b/src/api/api/ml.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Ml { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'ml.clear_trained_model_deployment_cache': { path: [ 'model_id' @@ -984,7 +985,7 @@ export default class Ml { async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.clear_trained_model_deployment_cache'] + } = this[kAcceptedParams]['ml.clear_trained_model_deployment_cache'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1014,7 +1015,10 @@ export default class Ml { name: 'ml.clear_trained_model_deployment_cache', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1031,7 +1035,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.close_job'] + } = this[kAcceptedParams]['ml.close_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1071,7 +1075,16 @@ export default class Ml { name: 'ml.close_job', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'allow_no_match', + 'force', + 'timeout', + 'allow_no_match', + 'force', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1086,7 +1099,7 @@ export default class Ml { async deleteCalendar (this: That, params: T.MlDeleteCalendarRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_calendar'] + } = this[kAcceptedParams]['ml.delete_calendar'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1116,7 +1129,10 @@ export default class Ml { name: 'ml.delete_calendar', pathParts: { calendar_id: params.calendar_id - } + }, + acceptedParams: [ + 'calendar_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1131,7 +1147,7 @@ export default class Ml { async deleteCalendarEvent (this: That, params: T.MlDeleteCalendarEventRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_calendar_event'] + } = this[kAcceptedParams]['ml.delete_calendar_event'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1162,7 +1178,11 @@ export default class Ml { pathParts: { calendar_id: params.calendar_id, event_id: params.event_id - } + }, + acceptedParams: [ + 'calendar_id', + 'event_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1177,7 +1197,7 @@ export default class Ml { async deleteCalendarJob (this: That, params: T.MlDeleteCalendarJobRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_calendar_job'] + } = this[kAcceptedParams]['ml.delete_calendar_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1208,7 +1228,11 @@ export default class Ml { pathParts: { calendar_id: params.calendar_id, job_id: params.job_id - } + }, + acceptedParams: [ + 'calendar_id', + 'job_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1223,7 +1247,7 @@ export default class Ml { async deleteDataFrameAnalytics (this: That, params: T.MlDeleteDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_data_frame_analytics'] + } = this[kAcceptedParams]['ml.delete_data_frame_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1253,7 +1277,12 @@ export default class Ml { name: 'ml.delete_data_frame_analytics', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'force', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1268,7 +1297,7 @@ export default class Ml { async deleteDatafeed (this: That, params: T.MlDeleteDatafeedRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_datafeed'] + } = this[kAcceptedParams]['ml.delete_datafeed'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1298,7 +1327,11 @@ export default class Ml { name: 'ml.delete_datafeed', pathParts: { datafeed_id: params.datafeed_id - } + }, + acceptedParams: [ + 'datafeed_id', + 'force' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1315,7 +1348,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.delete_expired_data'] + } = this[kAcceptedParams]['ml.delete_expired_data'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1363,7 +1396,14 @@ export default class Ml { name: 'ml.delete_expired_data', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'requests_per_second', + 'timeout', + 'requests_per_second', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1378,7 +1418,7 @@ export default class Ml { async deleteFilter (this: That, params: T.MlDeleteFilterRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_filter'] + } = this[kAcceptedParams]['ml.delete_filter'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1408,7 +1448,10 @@ export default class Ml { name: 'ml.delete_filter', pathParts: { filter_id: params.filter_id - } + }, + acceptedParams: [ + 'filter_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1423,7 +1466,7 @@ export default class Ml { async deleteForecast (this: That, params: T.MlDeleteForecastRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_forecast'] + } = this[kAcceptedParams]['ml.delete_forecast'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1461,7 +1504,13 @@ export default class Ml { pathParts: { job_id: params.job_id, forecast_id: params.forecast_id - } + }, + acceptedParams: [ + 'job_id', + 'forecast_id', + 'allow_no_forecasts', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1476,7 +1525,7 @@ export default class Ml { async deleteJob (this: That, params: T.MlDeleteJobRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_job'] + } = this[kAcceptedParams]['ml.delete_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1506,7 +1555,13 @@ export default class Ml { name: 'ml.delete_job', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'force', + 'delete_user_annotations', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1521,7 +1576,7 @@ export default class Ml { async deleteModelSnapshot (this: That, params: T.MlDeleteModelSnapshotRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_model_snapshot'] + } = this[kAcceptedParams]['ml.delete_model_snapshot'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1552,7 +1607,11 @@ export default class Ml { pathParts: { job_id: params.job_id, snapshot_id: params.snapshot_id - } + }, + acceptedParams: [ + 'job_id', + 'snapshot_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1567,7 +1626,7 @@ export default class Ml { async deleteTrainedModel (this: That, params: T.MlDeleteTrainedModelRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_trained_model'] + } = this[kAcceptedParams]['ml.delete_trained_model'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1597,7 +1656,12 @@ export default class Ml { name: 'ml.delete_trained_model', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'force', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1612,7 +1676,7 @@ export default class Ml { async deleteTrainedModelAlias (this: That, params: T.MlDeleteTrainedModelAliasRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_trained_model_alias'] + } = this[kAcceptedParams]['ml.delete_trained_model_alias'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1643,7 +1707,11 @@ export default class Ml { pathParts: { model_alias: params.model_alias, model_id: params.model_id - } + }, + acceptedParams: [ + 'model_alias', + 'model_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1660,7 +1728,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.estimate_model_memory'] + } = this[kAcceptedParams]['ml.estimate_model_memory'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1698,7 +1766,12 @@ export default class Ml { const method = 'POST' const path = '/_ml/anomaly_detectors/_estimate_model_memory' const meta: TransportRequestMetadata = { - name: 'ml.estimate_model_memory' + name: 'ml.estimate_model_memory', + acceptedParams: [ + 'analysis_config', + 'max_bucket_cardinality', + 'overall_cardinality' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1715,7 +1788,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.evaluate_data_frame'] + } = this[kAcceptedParams]['ml.evaluate_data_frame'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1752,7 +1825,12 @@ export default class Ml { const method = 'POST' const path = '/_ml/data_frame/_evaluate' const meta: TransportRequestMetadata = { - name: 'ml.evaluate_data_frame' + name: 'ml.evaluate_data_frame', + acceptedParams: [ + 'evaluation', + 'index', + 'query' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1769,7 +1847,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.explain_data_frame_analytics'] + } = this[kAcceptedParams]['ml.explain_data_frame_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1817,7 +1895,18 @@ export default class Ml { name: 'ml.explain_data_frame_analytics', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'source', + 'dest', + 'analysis', + 'description', + 'model_memory_limit', + 'max_num_threads', + 'analyzed_fields', + 'allow_lazy_start' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1834,7 +1923,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.flush_job'] + } = this[kAcceptedParams]['ml.flush_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1874,7 +1963,20 @@ export default class Ml { name: 'ml.flush_job', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'advance_time', + 'calc_interim', + 'end', + 'skip_time', + 'start', + 'advance_time', + 'calc_interim', + 'end', + 'skip_time', + 'start' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1891,7 +1993,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.forecast'] + } = this[kAcceptedParams]['ml.forecast'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1931,7 +2033,16 @@ export default class Ml { name: 'ml.forecast', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'duration', + 'expires_in', + 'max_model_memory', + 'duration', + 'expires_in', + 'max_model_memory' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1948,7 +2059,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.get_buckets'] + } = this[kAcceptedParams]['ml.get_buckets'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1996,7 +2107,28 @@ export default class Ml { pathParts: { job_id: params.job_id, timestamp: params.timestamp - } + }, + acceptedParams: [ + 'job_id', + 'timestamp', + 'anomaly_score', + 'desc', + 'end', + 'exclude_interim', + 'expand', + 'page', + 'sort', + 'start', + 'anomaly_score', + 'desc', + 'end', + 'exclude_interim', + 'expand', + 'from', + 'size', + 'sort', + 'start' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2011,7 +2143,7 @@ export default class Ml { async getCalendarEvents (this: That, params: T.MlGetCalendarEventsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_calendar_events'] + } = this[kAcceptedParams]['ml.get_calendar_events'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2041,7 +2173,15 @@ export default class Ml { name: 'ml.get_calendar_events', pathParts: { calendar_id: params.calendar_id - } + }, + acceptedParams: [ + 'calendar_id', + 'end', + 'from', + 'job_id', + 'size', + 'start' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2058,7 +2198,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.get_calendars'] + } = this[kAcceptedParams]['ml.get_calendars'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2106,7 +2246,13 @@ export default class Ml { name: 'ml.get_calendars', pathParts: { calendar_id: params.calendar_id - } + }, + acceptedParams: [ + 'calendar_id', + 'page', + 'from', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2123,7 +2269,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.get_categories'] + } = this[kAcceptedParams]['ml.get_categories'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2171,7 +2317,15 @@ export default class Ml { pathParts: { job_id: params.job_id, category_id: params.category_id - } + }, + acceptedParams: [ + 'job_id', + 'category_id', + 'page', + 'from', + 'partition_field_value', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2186,7 +2340,7 @@ export default class Ml { async getDataFrameAnalytics (this: That, params?: T.MlGetDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_data_frame_analytics'] + } = this[kAcceptedParams]['ml.get_data_frame_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2224,7 +2378,14 @@ export default class Ml { name: 'ml.get_data_frame_analytics', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'allow_no_match', + 'from', + 'size', + 'exclude_generated' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2239,7 +2400,7 @@ export default class Ml { async getDataFrameAnalyticsStats (this: That, params?: T.MlGetDataFrameAnalyticsStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_data_frame_analytics_stats'] + } = this[kAcceptedParams]['ml.get_data_frame_analytics_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2277,7 +2438,14 @@ export default class Ml { name: 'ml.get_data_frame_analytics_stats', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'allow_no_match', + 'from', + 'size', + 'verbose' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2292,7 +2460,7 @@ export default class Ml { async getDatafeedStats (this: That, params?: T.MlGetDatafeedStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_datafeed_stats'] + } = this[kAcceptedParams]['ml.get_datafeed_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2330,7 +2498,11 @@ export default class Ml { name: 'ml.get_datafeed_stats', pathParts: { datafeed_id: params.datafeed_id - } + }, + acceptedParams: [ + 'datafeed_id', + 'allow_no_match' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2345,7 +2517,7 @@ export default class Ml { async getDatafeeds (this: That, params?: T.MlGetDatafeedsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_datafeeds'] + } = this[kAcceptedParams]['ml.get_datafeeds'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2383,7 +2555,12 @@ export default class Ml { name: 'ml.get_datafeeds', pathParts: { datafeed_id: params.datafeed_id - } + }, + acceptedParams: [ + 'datafeed_id', + 'allow_no_match', + 'exclude_generated' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2398,7 +2575,7 @@ export default class Ml { async getFilters (this: That, params?: T.MlGetFiltersRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_filters'] + } = this[kAcceptedParams]['ml.get_filters'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2436,7 +2613,12 @@ export default class Ml { name: 'ml.get_filters', pathParts: { filter_id: params.filter_id - } + }, + acceptedParams: [ + 'filter_id', + 'from', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2453,7 +2635,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.get_influencers'] + } = this[kAcceptedParams]['ml.get_influencers'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2493,7 +2675,19 @@ export default class Ml { name: 'ml.get_influencers', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'page', + 'desc', + 'end', + 'exclude_interim', + 'influencer_score', + 'from', + 'size', + 'sort', + 'start' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2508,7 +2702,7 @@ export default class Ml { async getJobStats (this: That, params?: T.MlGetJobStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_job_stats'] + } = this[kAcceptedParams]['ml.get_job_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2546,7 +2740,11 @@ export default class Ml { name: 'ml.get_job_stats', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'allow_no_match' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2561,7 +2759,7 @@ export default class Ml { async getJobs (this: That, params?: T.MlGetJobsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_jobs'] + } = this[kAcceptedParams]['ml.get_jobs'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2599,7 +2797,12 @@ export default class Ml { name: 'ml.get_jobs', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'allow_no_match', + 'exclude_generated' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2614,7 +2817,7 @@ export default class Ml { async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_memory_stats'] + } = this[kAcceptedParams]['ml.get_memory_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2652,7 +2855,12 @@ export default class Ml { name: 'ml.get_memory_stats', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2667,7 +2875,7 @@ export default class Ml { async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_model_snapshot_upgrade_stats'] + } = this[kAcceptedParams]['ml.get_model_snapshot_upgrade_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2698,7 +2906,12 @@ export default class Ml { pathParts: { job_id: params.job_id, snapshot_id: params.snapshot_id - } + }, + acceptedParams: [ + 'job_id', + 'snapshot_id', + 'allow_no_match' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2715,7 +2928,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.get_model_snapshots'] + } = this[kAcceptedParams]['ml.get_model_snapshots'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2763,7 +2976,22 @@ export default class Ml { pathParts: { job_id: params.job_id, snapshot_id: params.snapshot_id - } + }, + acceptedParams: [ + 'job_id', + 'snapshot_id', + 'desc', + 'end', + 'page', + 'sort', + 'start', + 'desc', + 'end', + 'from', + 'size', + 'sort', + 'start' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2780,7 +3008,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.get_overall_buckets'] + } = this[kAcceptedParams]['ml.get_overall_buckets'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2820,7 +3048,24 @@ export default class Ml { name: 'ml.get_overall_buckets', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'allow_no_match', + 'bucket_span', + 'end', + 'exclude_interim', + 'overall_score', + 'start', + 'top_n', + 'allow_no_match', + 'bucket_span', + 'end', + 'exclude_interim', + 'overall_score', + 'start', + 'top_n' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2837,7 +3082,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.get_records'] + } = this[kAcceptedParams]['ml.get_records'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2877,7 +3122,25 @@ export default class Ml { name: 'ml.get_records', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'desc', + 'end', + 'exclude_interim', + 'page', + 'record_score', + 'sort', + 'start', + 'desc', + 'end', + 'exclude_interim', + 'from', + 'record_score', + 'size', + 'sort', + 'start' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2892,7 +3155,7 @@ export default class Ml { async getTrainedModels (this: That, params?: T.MlGetTrainedModelsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_trained_models'] + } = this[kAcceptedParams]['ml.get_trained_models'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2930,7 +3193,17 @@ export default class Ml { name: 'ml.get_trained_models', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'allow_no_match', + 'decompress_definition', + 'exclude_generated', + 'from', + 'include', + 'size', + 'tags' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2945,7 +3218,7 @@ export default class Ml { async getTrainedModelsStats (this: That, params?: T.MlGetTrainedModelsStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_trained_models_stats'] + } = this[kAcceptedParams]['ml.get_trained_models_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2983,7 +3256,13 @@ export default class Ml { name: 'ml.get_trained_models_stats', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'allow_no_match', + 'from', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3000,7 +3279,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.infer_trained_model'] + } = this[kAcceptedParams]['ml.infer_trained_model'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3040,7 +3319,13 @@ export default class Ml { name: 'ml.infer_trained_model', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'docs', + 'inference_config', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3055,7 +3340,7 @@ export default class Ml { async info (this: That, params?: T.MlInfoRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.info'] + } = this[kAcceptedParams]['ml.info'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3083,7 +3368,9 @@ export default class Ml { const method = 'GET' const path = '/_ml/info' const meta: TransportRequestMetadata = { - name: 'ml.info' + name: 'ml.info', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3100,7 +3387,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.open_job'] + } = this[kAcceptedParams]['ml.open_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3140,7 +3427,12 @@ export default class Ml { name: 'ml.open_job', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3157,7 +3449,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.post_calendar_events'] + } = this[kAcceptedParams]['ml.post_calendar_events'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3197,7 +3489,11 @@ export default class Ml { name: 'ml.post_calendar_events', pathParts: { calendar_id: params.calendar_id - } + }, + acceptedParams: [ + 'calendar_id', + 'events' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3214,7 +3510,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.post_data'] + } = this[kAcceptedParams]['ml.post_data'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3244,7 +3540,13 @@ export default class Ml { name: 'ml.post_data', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'data', + 'reset_end', + 'reset_start' + ] } return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options) } @@ -3261,7 +3563,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.preview_data_frame_analytics'] + } = this[kAcceptedParams]['ml.preview_data_frame_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3309,7 +3611,11 @@ export default class Ml { name: 'ml.preview_data_frame_analytics', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'config' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3326,7 +3632,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.preview_datafeed'] + } = this[kAcceptedParams]['ml.preview_datafeed'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3374,7 +3680,14 @@ export default class Ml { name: 'ml.preview_datafeed', pathParts: { datafeed_id: params.datafeed_id - } + }, + acceptedParams: [ + 'datafeed_id', + 'datafeed_config', + 'job_config', + 'start', + 'end' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3391,7 +3704,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.put_calendar'] + } = this[kAcceptedParams]['ml.put_calendar'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3431,7 +3744,12 @@ export default class Ml { name: 'ml.put_calendar', pathParts: { calendar_id: params.calendar_id - } + }, + acceptedParams: [ + 'calendar_id', + 'job_ids', + 'description' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3446,7 +3764,7 @@ export default class Ml { async putCalendarJob (this: That, params: T.MlPutCalendarJobRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.put_calendar_job'] + } = this[kAcceptedParams]['ml.put_calendar_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3477,7 +3795,11 @@ export default class Ml { pathParts: { calendar_id: params.calendar_id, job_id: params.job_id - } + }, + acceptedParams: [ + 'calendar_id', + 'job_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3494,7 +3816,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.put_data_frame_analytics'] + } = this[kAcceptedParams]['ml.put_data_frame_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3534,7 +3856,21 @@ export default class Ml { name: 'ml.put_data_frame_analytics', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'allow_lazy_start', + 'analysis', + 'analyzed_fields', + 'description', + 'dest', + 'max_num_threads', + '_meta', + 'model_memory_limit', + 'source', + 'headers', + 'version' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3551,7 +3887,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.put_datafeed'] + } = this[kAcceptedParams]['ml.put_datafeed'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3591,7 +3927,30 @@ export default class Ml { name: 'ml.put_datafeed', pathParts: { datafeed_id: params.datafeed_id - } + }, + acceptedParams: [ + 'datafeed_id', + 'aggregations', + 'aggs', + 'chunking_config', + 'delayed_data_check_config', + 'frequency', + 'indices', + 'indexes', + 'indices_options', + 'job_id', + 'max_empty_searches', + 'query', + 'query_delay', + 'runtime_mappings', + 'script_fields', + 'scroll_size', + 'headers', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_throttled', + 'ignore_unavailable' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3608,7 +3967,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.put_filter'] + } = this[kAcceptedParams]['ml.put_filter'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3648,7 +4007,12 @@ export default class Ml { name: 'ml.put_filter', pathParts: { filter_id: params.filter_id - } + }, + acceptedParams: [ + 'filter_id', + 'description', + 'items' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3665,7 +4029,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.put_job'] + } = this[kAcceptedParams]['ml.put_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3705,7 +4069,30 @@ export default class Ml { name: 'ml.put_job', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'allow_lazy_open', + 'analysis_config', + 'analysis_limits', + 'background_persist_interval', + 'custom_settings', + 'daily_model_snapshot_retention_after_days', + 'data_description', + 'datafeed_config', + 'description', + 'job_id', + 'groups', + 'model_plot_config', + 'model_snapshot_retention_days', + 'renormalization_window_days', + 'results_index_name', + 'results_retention_days', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_throttled', + 'ignore_unavailable' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3722,7 +4109,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.put_trained_model'] + } = this[kAcceptedParams]['ml.put_trained_model'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3762,7 +4149,23 @@ export default class Ml { name: 'ml.put_trained_model', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'compressed_definition', + 'definition', + 'description', + 'inference_config', + 'input', + 'metadata', + 'model_type', + 'model_size_bytes', + 'platform_architecture', + 'tags', + 'prefix_strings', + 'defer_definition_decompression', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3777,7 +4180,7 @@ export default class Ml { async putTrainedModelAlias (this: That, params: T.MlPutTrainedModelAliasRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.put_trained_model_alias'] + } = this[kAcceptedParams]['ml.put_trained_model_alias'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3808,7 +4211,12 @@ export default class Ml { pathParts: { model_alias: params.model_alias, model_id: params.model_id - } + }, + acceptedParams: [ + 'model_alias', + 'model_id', + 'reassign' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3825,7 +4233,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.put_trained_model_definition_part'] + } = this[kAcceptedParams]['ml.put_trained_model_definition_part'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3866,7 +4274,14 @@ export default class Ml { pathParts: { model_id: params.model_id, part: params.part - } + }, + acceptedParams: [ + 'model_id', + 'part', + 'definition', + 'total_definition_length', + 'total_parts' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3883,7 +4298,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.put_trained_model_vocabulary'] + } = this[kAcceptedParams]['ml.put_trained_model_vocabulary'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3923,7 +4338,13 @@ export default class Ml { name: 'ml.put_trained_model_vocabulary', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'vocabulary', + 'merges', + 'scores' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3938,7 +4359,7 @@ export default class Ml { async resetJob (this: That, params: T.MlResetJobRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.reset_job'] + } = this[kAcceptedParams]['ml.reset_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3968,7 +4389,12 @@ export default class Ml { name: 'ml.reset_job', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'wait_for_completion', + 'delete_user_annotations' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3985,7 +4411,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.revert_model_snapshot'] + } = this[kAcceptedParams]['ml.revert_model_snapshot'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4026,7 +4452,13 @@ export default class Ml { pathParts: { job_id: params.job_id, snapshot_id: params.snapshot_id - } + }, + acceptedParams: [ + 'job_id', + 'snapshot_id', + 'delete_intervening_results', + 'delete_intervening_results' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4041,7 +4473,7 @@ export default class Ml { async setUpgradeMode (this: That, params?: T.MlSetUpgradeModeRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.set_upgrade_mode'] + } = this[kAcceptedParams]['ml.set_upgrade_mode'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4069,7 +4501,11 @@ export default class Ml { const method = 'POST' const path = '/_ml/set_upgrade_mode' const meta: TransportRequestMetadata = { - name: 'ml.set_upgrade_mode' + name: 'ml.set_upgrade_mode', + acceptedParams: [ + 'enabled', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4084,7 +4520,7 @@ export default class Ml { async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.start_data_frame_analytics'] + } = this[kAcceptedParams]['ml.start_data_frame_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4114,7 +4550,11 @@ export default class Ml { name: 'ml.start_data_frame_analytics', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4131,7 +4571,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.start_datafeed'] + } = this[kAcceptedParams]['ml.start_datafeed'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4171,7 +4611,16 @@ export default class Ml { name: 'ml.start_datafeed', pathParts: { datafeed_id: params.datafeed_id - } + }, + acceptedParams: [ + 'datafeed_id', + 'end', + 'start', + 'timeout', + 'end', + 'start', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4188,7 +4637,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.start_trained_model_deployment'] + } = this[kAcceptedParams]['ml.start_trained_model_deployment'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4228,7 +4677,19 @@ export default class Ml { name: 'ml.start_trained_model_deployment', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'adaptive_allocations', + 'cache_size', + 'deployment_id', + 'number_of_allocations', + 'priority', + 'queue_capacity', + 'threads_per_allocation', + 'timeout', + 'wait_for' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4243,7 +4704,7 @@ export default class Ml { async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.stop_data_frame_analytics'] + } = this[kAcceptedParams]['ml.stop_data_frame_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4273,7 +4734,13 @@ export default class Ml { name: 'ml.stop_data_frame_analytics', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'allow_no_match', + 'force', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4290,7 +4757,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.stop_datafeed'] + } = this[kAcceptedParams]['ml.stop_datafeed'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4330,7 +4797,16 @@ export default class Ml { name: 'ml.stop_datafeed', pathParts: { datafeed_id: params.datafeed_id - } + }, + acceptedParams: [ + 'datafeed_id', + 'allow_no_match', + 'force', + 'timeout', + 'allow_no_match', + 'force', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4345,7 +4821,7 @@ export default class Ml { async stopTrainedModelDeployment (this: That, params: T.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.stop_trained_model_deployment'] + } = this[kAcceptedParams]['ml.stop_trained_model_deployment'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4375,7 +4851,12 @@ export default class Ml { name: 'ml.stop_trained_model_deployment', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'allow_no_match', + 'force' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4392,7 +4873,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.update_data_frame_analytics'] + } = this[kAcceptedParams]['ml.update_data_frame_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4432,7 +4913,14 @@ export default class Ml { name: 'ml.update_data_frame_analytics', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'description', + 'model_memory_limit', + 'max_num_threads', + 'allow_lazy_start' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4449,7 +4937,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.update_datafeed'] + } = this[kAcceptedParams]['ml.update_datafeed'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4489,7 +4977,28 @@ export default class Ml { name: 'ml.update_datafeed', pathParts: { datafeed_id: params.datafeed_id - } + }, + acceptedParams: [ + 'datafeed_id', + 'aggregations', + 'chunking_config', + 'delayed_data_check_config', + 'frequency', + 'indices', + 'indexes', + 'indices_options', + 'job_id', + 'max_empty_searches', + 'query', + 'query_delay', + 'runtime_mappings', + 'script_fields', + 'scroll_size', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_throttled', + 'ignore_unavailable' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4506,7 +5015,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.update_filter'] + } = this[kAcceptedParams]['ml.update_filter'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4546,7 +5055,13 @@ export default class Ml { name: 'ml.update_filter', pathParts: { filter_id: params.filter_id - } + }, + acceptedParams: [ + 'filter_id', + 'add_items', + 'description', + 'remove_items' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4563,7 +5078,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.update_job'] + } = this[kAcceptedParams]['ml.update_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4603,7 +5118,25 @@ export default class Ml { name: 'ml.update_job', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'allow_lazy_open', + 'analysis_limits', + 'background_persist_interval', + 'custom_settings', + 'categorization_filters', + 'description', + 'model_plot_config', + 'model_prune_window', + 'daily_model_snapshot_retention_after_days', + 'model_snapshot_retention_days', + 'renormalization_window_days', + 'results_retention_days', + 'groups', + 'detectors', + 'per_partition_categorization' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4620,7 +5153,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.update_model_snapshot'] + } = this[kAcceptedParams]['ml.update_model_snapshot'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4661,7 +5194,13 @@ export default class Ml { pathParts: { job_id: params.job_id, snapshot_id: params.snapshot_id - } + }, + acceptedParams: [ + 'job_id', + 'snapshot_id', + 'description', + 'retain' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4678,7 +5217,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.update_trained_model_deployment'] + } = this[kAcceptedParams]['ml.update_trained_model_deployment'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4718,7 +5257,13 @@ export default class Ml { name: 'ml.update_trained_model_deployment', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'number_of_allocations', + 'adaptive_allocations', + 'number_of_allocations' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4733,7 +5278,7 @@ export default class Ml { async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.upgrade_job_snapshot'] + } = this[kAcceptedParams]['ml.upgrade_job_snapshot'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4764,14 +5309,20 @@ export default class Ml { pathParts: { job_id: params.job_id, snapshot_id: params.snapshot_id - } + }, + acceptedParams: [ + 'job_id', + 'snapshot_id', + 'wait_for_completion', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } /** * Validate an anomaly detection job. - * @see {@link https://www.elastic.co/guide/en/machine-learning/master/ml-jobs.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/machine-learning/9.2/ml-jobs.html | Elasticsearch API documentation} */ async validate (this: That, params?: T.MlValidateRequest, options?: TransportRequestOptionsWithOutMeta): Promise async validate (this: That, params?: T.MlValidateRequest, options?: TransportRequestOptionsWithMeta): Promise> @@ -4781,7 +5332,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.validate'] + } = this[kAcceptedParams]['ml.validate'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4819,7 +5370,18 @@ export default class Ml { const method = 'POST' const path = '/_ml/anomaly_detectors/_validate' const meta: TransportRequestMetadata = { - name: 'ml.validate' + name: 'ml.validate', + acceptedParams: [ + 'job_id', + 'analysis_config', + 'analysis_limits', + 'data_description', + 'description', + 'model_plot', + 'model_snapshot_id', + 'model_snapshot_retention_days', + 'results_index_name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4836,7 +5398,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.validate_detector'] + } = this[kAcceptedParams]['ml.validate_detector'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4863,7 +5425,10 @@ export default class Ml { const method = 'POST' const path = '/_ml/anomaly_detectors/_validate/detector' const meta: TransportRequestMetadata = { - name: 'ml.validate_detector' + name: 'ml.validate_detector', + acceptedParams: [ + 'detector' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/monitoring.ts b/src/api/api/monitoring.ts index 8974e0c87..f8abf74f6 100644 --- a/src/api/api/monitoring.ts +++ b/src/api/api/monitoring.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Monitoring { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'monitoring.bulk': { path: [ 'type' @@ -63,7 +64,7 @@ export default class Monitoring { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['monitoring.bulk'] + } = this[kAcceptedParams]['monitoring.bulk'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -93,7 +94,14 @@ export default class Monitoring { name: 'monitoring.bulk', pathParts: { type: params.type - } + }, + acceptedParams: [ + 'type', + 'operations', + 'system_id', + 'system_api_version', + 'interval' + ] } return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options) } diff --git a/src/api/api/msearch.ts b/src/api/api/msearch.ts index 6a0d5b078..d508b62b5 100644 --- a/src/api/api/msearch.ts +++ b/src/api/api/msearch.ts @@ -47,6 +47,7 @@ const acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Nodes { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'nodes.clear_repositories_metering_archive': { path: [ 'node_id', @@ -129,7 +130,7 @@ export default class Nodes { async clearRepositoriesMeteringArchive (this: That, params: T.NodesClearRepositoriesMeteringArchiveRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['nodes.clear_repositories_metering_archive'] + } = this[kAcceptedParams]['nodes.clear_repositories_metering_archive'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -160,7 +161,11 @@ export default class Nodes { pathParts: { node_id: params.node_id, max_archive_version: params.max_archive_version - } + }, + acceptedParams: [ + 'node_id', + 'max_archive_version' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -175,7 +180,7 @@ export default class Nodes { async getRepositoriesMeteringInfo (this: That, params: T.NodesGetRepositoriesMeteringInfoRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['nodes.get_repositories_metering_info'] + } = this[kAcceptedParams]['nodes.get_repositories_metering_info'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -205,7 +210,10 @@ export default class Nodes { name: 'nodes.get_repositories_metering_info', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -220,7 +228,7 @@ export default class Nodes { async hotThreads (this: That, params?: T.NodesHotThreadsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['nodes.hot_threads'] + } = this[kAcceptedParams]['nodes.hot_threads'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -258,7 +266,17 @@ export default class Nodes { name: 'nodes.hot_threads', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id', + 'ignore_idle_threads', + 'interval', + 'snapshots', + 'threads', + 'timeout', + 'type', + 'sort' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -273,7 +291,7 @@ export default class Nodes { async info (this: That, params?: T.NodesInfoRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['nodes.info'] + } = this[kAcceptedParams]['nodes.info'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -318,7 +336,13 @@ export default class Nodes { pathParts: { node_id: params.node_id, metric: params.metric - } + }, + acceptedParams: [ + 'node_id', + 'metric', + 'flat_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -335,7 +359,7 @@ export default class Nodes { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['nodes.reload_secure_settings'] + } = this[kAcceptedParams]['nodes.reload_secure_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -383,7 +407,12 @@ export default class Nodes { name: 'nodes.reload_secure_settings', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id', + 'secure_settings_password', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -398,7 +427,7 @@ export default class Nodes { async stats (this: That, params?: T.NodesStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['nodes.stats'] + } = this[kAcceptedParams]['nodes.stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -450,7 +479,21 @@ export default class Nodes { node_id: params.node_id, metric: params.metric, index_metric: params.index_metric - } + }, + acceptedParams: [ + 'node_id', + 'metric', + 'index_metric', + 'completion_fields', + 'fielddata_fields', + 'fields', + 'groups', + 'include_segment_file_sizes', + 'level', + 'timeout', + 'types', + 'include_unloaded_segments' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -465,7 +508,7 @@ export default class Nodes { async usage (this: That, params?: T.NodesUsageRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['nodes.usage'] + } = this[kAcceptedParams]['nodes.usage'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -510,7 +553,12 @@ export default class Nodes { pathParts: { node_id: params.node_id, metric: params.metric - } + }, + acceptedParams: [ + 'node_id', + 'metric', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/open_point_in_time.ts b/src/api/api/open_point_in_time.ts index a93f89d65..1a863b1e6 100644 --- a/src/api/api/open_point_in_time.ts +++ b/src/api/api/open_point_in_time.ts @@ -40,6 +40,7 @@ const acceptedParams: Record + [kAcceptedParams]: Record } export default class Profiling { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'profiling.flamegraph': { path: [], body: [], @@ -58,7 +59,7 @@ export default class Profiling { /** * Extracts a UI-optimized structure to render flamegraphs from Universal Profiling - * @see {@link https://www.elastic.co/guide/en/observability/master/universal-profiling.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/observability/9.2/universal-profiling.html | Elasticsearch API documentation} */ async flamegraph (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise async flamegraph (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> @@ -66,7 +67,7 @@ export default class Profiling { async flamegraph (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['profiling.flamegraph'] + } = this[kAcceptedParams]['profiling.flamegraph'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -93,14 +94,16 @@ export default class Profiling { const method = 'POST' const path = '/_profiling/flamegraph' const meta: TransportRequestMetadata = { - name: 'profiling.flamegraph' + name: 'profiling.flamegraph', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } /** * Extracts raw stacktrace information from Universal Profiling - * @see {@link https://www.elastic.co/guide/en/observability/master/universal-profiling.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/observability/9.2/universal-profiling.html | Elasticsearch API documentation} */ async stacktraces (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise async stacktraces (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> @@ -108,7 +111,7 @@ export default class Profiling { async stacktraces (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['profiling.stacktraces'] + } = this[kAcceptedParams]['profiling.stacktraces'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -135,14 +138,16 @@ export default class Profiling { const method = 'POST' const path = '/_profiling/stacktraces' const meta: TransportRequestMetadata = { - name: 'profiling.stacktraces' + name: 'profiling.stacktraces', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } /** * Returns basic information about the status of Universal Profiling - * @see {@link https://www.elastic.co/guide/en/observability/master/universal-profiling.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/observability/9.2/universal-profiling.html | Elasticsearch API documentation} */ async status (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise async status (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> @@ -150,7 +155,7 @@ export default class Profiling { async status (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['profiling.status'] + } = this[kAcceptedParams]['profiling.status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -177,14 +182,16 @@ export default class Profiling { const method = 'GET' const path = '/_profiling/status' const meta: TransportRequestMetadata = { - name: 'profiling.status' + name: 'profiling.status', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } /** * Extracts a list of topN functions from Universal Profiling - * @see {@link https://www.elastic.co/guide/en/observability/master/universal-profiling.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/observability/9.2/universal-profiling.html | Elasticsearch API documentation} */ async topnFunctions (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise async topnFunctions (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> @@ -192,7 +199,7 @@ export default class Profiling { async topnFunctions (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['profiling.topn_functions'] + } = this[kAcceptedParams]['profiling.topn_functions'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -219,7 +226,9 @@ export default class Profiling { const method = 'POST' const path = '/_profiling/topn/functions' const meta: TransportRequestMetadata = { - name: 'profiling.topn_functions' + name: 'profiling.topn_functions', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/project.ts b/src/api/api/project.ts new file mode 100644 index 000000000..e8717a7a4 --- /dev/null +++ b/src/api/api/project.ts @@ -0,0 +1,88 @@ +/* + * Copyright Elasticsearch B.V. and contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* eslint-disable import/export */ +/* eslint-disable @typescript-eslint/no-misused-new */ +/* eslint-disable @typescript-eslint/no-extraneous-class */ +/* eslint-disable @typescript-eslint/no-unused-vars */ + +// This file was automatically generated by elastic/elastic-client-generator-js +// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file, +// and elastic/elastic-client-generator-js to regenerate this file again. + +import { + Transport, + TransportRequestMetadata, + TransportRequestOptions, + TransportRequestOptionsWithMeta, + TransportRequestOptionsWithOutMeta, + TransportResult +} from '@elastic/transport' +import * as T from '../types' +import { kAcceptedParams } from '../../client' + +interface That { + transport: Transport + [kAcceptedParams]: Record +} + +export default class Project { + transport: Transport + [kAcceptedParams]: Record + constructor (transport: Transport) { + this.transport = transport + this[kAcceptedParams] = { + 'project.tags': { + path: [], + body: [], + query: [] + } + } + } + + /** + * Return tags defined for the project + */ + async tags (this: That, params?: T.ProjectTagsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async tags (this: That, params?: T.ProjectTagsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async tags (this: That, params?: T.ProjectTagsRequest, options?: TransportRequestOptions): Promise + async tags (this: That, params?: T.ProjectTagsRequest, options?: TransportRequestOptions): Promise { + const { + path: acceptedPath + } = this[kAcceptedParams]['project.tags'] + + const userQuery = params?.querystring + const querystring: Record = userQuery != null ? { ...userQuery } : {} + + let body: Record | string | undefined + const userBody = params?.body + if (userBody != null) { + if (typeof userBody === 'string') { + body = userBody + } else { + body = { ...userBody } + } + } + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body' && key !== 'querystring') { + // @ts-expect-error + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = '/_project/tags' + const meta: TransportRequestMetadata = { + name: 'project.tags', + acceptedParams: [ + ] + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } +} diff --git a/src/api/api/put_script.ts b/src/api/api/put_script.ts index 6762be248..0b62ea3b4 100644 --- a/src/api/api/put_script.ts +++ b/src/api/api/put_script.ts @@ -105,7 +105,15 @@ export default async function PutScriptApi (this: That, params: T.PutScriptReque pathParts: { id: params.id, context: params.context - } + }, + acceptedParams: [ + 'id', + 'context', + 'script', + 'context', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/query_rules.ts b/src/api/api/query_rules.ts index ba218714f..cbde4cf9e 100644 --- a/src/api/api/query_rules.ts +++ b/src/api/api/query_rules.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class QueryRules { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'query_rules.delete_rule': { path: [ 'ruleset_id', @@ -117,7 +118,7 @@ export default class QueryRules { async deleteRule (this: That, params: T.QueryRulesDeleteRuleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['query_rules.delete_rule'] + } = this[kAcceptedParams]['query_rules.delete_rule'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -148,7 +149,11 @@ export default class QueryRules { pathParts: { ruleset_id: params.ruleset_id, rule_id: params.rule_id - } + }, + acceptedParams: [ + 'ruleset_id', + 'rule_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -163,7 +168,7 @@ export default class QueryRules { async deleteRuleset (this: That, params: T.QueryRulesDeleteRulesetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['query_rules.delete_ruleset'] + } = this[kAcceptedParams]['query_rules.delete_ruleset'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -193,7 +198,10 @@ export default class QueryRules { name: 'query_rules.delete_ruleset', pathParts: { ruleset_id: params.ruleset_id - } + }, + acceptedParams: [ + 'ruleset_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -208,7 +216,7 @@ export default class QueryRules { async getRule (this: That, params: T.QueryRulesGetRuleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['query_rules.get_rule'] + } = this[kAcceptedParams]['query_rules.get_rule'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -239,7 +247,11 @@ export default class QueryRules { pathParts: { ruleset_id: params.ruleset_id, rule_id: params.rule_id - } + }, + acceptedParams: [ + 'ruleset_id', + 'rule_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -254,7 +266,7 @@ export default class QueryRules { async getRuleset (this: That, params: T.QueryRulesGetRulesetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['query_rules.get_ruleset'] + } = this[kAcceptedParams]['query_rules.get_ruleset'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -284,7 +296,10 @@ export default class QueryRules { name: 'query_rules.get_ruleset', pathParts: { ruleset_id: params.ruleset_id - } + }, + acceptedParams: [ + 'ruleset_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -299,7 +314,7 @@ export default class QueryRules { async listRulesets (this: That, params?: T.QueryRulesListRulesetsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['query_rules.list_rulesets'] + } = this[kAcceptedParams]['query_rules.list_rulesets'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -327,7 +342,11 @@ export default class QueryRules { const method = 'GET' const path = '/_query_rules' const meta: TransportRequestMetadata = { - name: 'query_rules.list_rulesets' + name: 'query_rules.list_rulesets', + acceptedParams: [ + 'from', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -344,7 +363,7 @@ export default class QueryRules { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['query_rules.put_rule'] + } = this[kAcceptedParams]['query_rules.put_rule'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -385,7 +404,15 @@ export default class QueryRules { pathParts: { ruleset_id: params.ruleset_id, rule_id: params.rule_id - } + }, + acceptedParams: [ + 'ruleset_id', + 'rule_id', + 'type', + 'criteria', + 'actions', + 'priority' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -402,7 +429,7 @@ export default class QueryRules { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['query_rules.put_ruleset'] + } = this[kAcceptedParams]['query_rules.put_ruleset'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -442,7 +469,11 @@ export default class QueryRules { name: 'query_rules.put_ruleset', pathParts: { ruleset_id: params.ruleset_id - } + }, + acceptedParams: [ + 'ruleset_id', + 'rules' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -459,7 +490,7 @@ export default class QueryRules { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['query_rules.test'] + } = this[kAcceptedParams]['query_rules.test'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -499,7 +530,11 @@ export default class QueryRules { name: 'query_rules.test', pathParts: { ruleset_id: params.ruleset_id - } + }, + acceptedParams: [ + 'ruleset_id', + 'match_criteria' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/rank_eval.ts b/src/api/api/rank_eval.ts index cd7773c31..1ddb4082a 100644 --- a/src/api/api/rank_eval.ts +++ b/src/api/api/rank_eval.ts @@ -105,7 +105,16 @@ export default async function RankEvalApi (this: That, params: T.RankEvalRequest name: 'rank_eval', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'requests', + 'metric', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'search_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/reindex.ts b/src/api/api/reindex.ts index 66f6aec87..c6f7188ac 100644 --- a/src/api/api/reindex.ts +++ b/src/api/api/reindex.ts @@ -102,7 +102,24 @@ export default async function ReindexApi (this: That, params: T.ReindexRequest, const method = 'POST' const path = '/_reindex' const meta: TransportRequestMetadata = { - name: 'reindex' + name: 'reindex', + acceptedParams: [ + 'conflicts', + 'dest', + 'max_docs', + 'script', + 'size', + 'source', + 'refresh', + 'requests_per_second', + 'scroll', + 'slices', + 'max_docs', + 'timeout', + 'wait_for_active_shards', + 'wait_for_completion', + 'require_alias' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/reindex_rethrottle.ts b/src/api/api/reindex_rethrottle.ts index 9c6b73a92..8ef9381e2 100644 --- a/src/api/api/reindex_rethrottle.ts +++ b/src/api/api/reindex_rethrottle.ts @@ -78,7 +78,11 @@ export default async function ReindexRethrottleApi (this: That, params: T.Reinde name: 'reindex_rethrottle', pathParts: { task_id: params.task_id - } + }, + acceptedParams: [ + 'task_id', + 'requests_per_second' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/render_search_template.ts b/src/api/api/render_search_template.ts index b08178668..4b16d3248 100644 --- a/src/api/api/render_search_template.ts +++ b/src/api/api/render_search_template.ts @@ -101,7 +101,14 @@ export default async function RenderSearchTemplateApi (this: That, params?: T.Re name: 'render_search_template', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'id', + 'file', + 'params', + 'source' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/rollup.ts b/src/api/api/rollup.ts index bc6df9264..4f216dc29 100644 --- a/src/api/api/rollup.ts +++ b/src/api/api/rollup.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Rollup { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'rollup.delete_job': { path: [ 'id' @@ -124,7 +125,7 @@ export default class Rollup { async deleteJob (this: That, params: T.RollupDeleteJobRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['rollup.delete_job'] + } = this[kAcceptedParams]['rollup.delete_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -154,7 +155,10 @@ export default class Rollup { name: 'rollup.delete_job', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -169,7 +173,7 @@ export default class Rollup { async getJobs (this: That, params?: T.RollupGetJobsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['rollup.get_jobs'] + } = this[kAcceptedParams]['rollup.get_jobs'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -207,7 +211,10 @@ export default class Rollup { name: 'rollup.get_jobs', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -222,7 +229,7 @@ export default class Rollup { async getRollupCaps (this: That, params?: T.RollupGetRollupCapsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['rollup.get_rollup_caps'] + } = this[kAcceptedParams]['rollup.get_rollup_caps'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -260,7 +267,10 @@ export default class Rollup { name: 'rollup.get_rollup_caps', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -275,7 +285,7 @@ export default class Rollup { async getRollupIndexCaps (this: That, params: T.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['rollup.get_rollup_index_caps'] + } = this[kAcceptedParams]['rollup.get_rollup_index_caps'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -305,7 +315,10 @@ export default class Rollup { name: 'rollup.get_rollup_index_caps', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -322,7 +335,7 @@ export default class Rollup { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['rollup.put_job'] + } = this[kAcceptedParams]['rollup.put_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -362,7 +375,18 @@ export default class Rollup { name: 'rollup.put_job', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'cron', + 'groups', + 'index_pattern', + 'metrics', + 'page_size', + 'rollup_index', + 'timeout', + 'headers' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -379,7 +403,7 @@ export default class Rollup { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['rollup.rollup_search'] + } = this[kAcceptedParams]['rollup.rollup_search'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -419,7 +443,16 @@ export default class Rollup { name: 'rollup.rollup_search', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'aggregations', + 'aggs', + 'query', + 'size', + 'rest_total_hits_as_int', + 'typed_keys' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -434,7 +467,7 @@ export default class Rollup { async startJob (this: That, params: T.RollupStartJobRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['rollup.start_job'] + } = this[kAcceptedParams]['rollup.start_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -464,7 +497,10 @@ export default class Rollup { name: 'rollup.start_job', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -479,7 +515,7 @@ export default class Rollup { async stopJob (this: That, params: T.RollupStopJobRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['rollup.stop_job'] + } = this[kAcceptedParams]['rollup.stop_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -509,7 +545,12 @@ export default class Rollup { name: 'rollup.stop_job', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'timeout', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/scripts_painless_execute.ts b/src/api/api/scripts_painless_execute.ts index 1d524bc02..c8d3f3a1c 100644 --- a/src/api/api/scripts_painless_execute.ts +++ b/src/api/api/scripts_painless_execute.ts @@ -90,7 +90,12 @@ export default async function ScriptsPainlessExecuteApi (this const method = body != null ? 'POST' : 'GET' const path = '/_scripts/painless/_execute' const meta: TransportRequestMetadata = { - name: 'scripts_painless_execute' + name: 'scripts_painless_execute', + acceptedParams: [ + 'context', + 'context_setup', + 'script' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/scroll.ts b/src/api/api/scroll.ts index 2b31642cb..a2f1966d6 100644 --- a/src/api/api/scroll.ts +++ b/src/api/api/scroll.ts @@ -95,7 +95,15 @@ export default async function ScrollApi + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class SearchApplication { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'search_application.delete': { path: [ 'name' @@ -135,7 +136,7 @@ export default class SearchApplication { async delete (this: That, params: T.SearchApplicationDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['search_application.delete'] + } = this[kAcceptedParams]['search_application.delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -165,7 +166,10 @@ export default class SearchApplication { name: 'search_application.delete', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -180,7 +184,7 @@ export default class SearchApplication { async deleteBehavioralAnalytics (this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['search_application.delete_behavioral_analytics'] + } = this[kAcceptedParams]['search_application.delete_behavioral_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -210,7 +214,10 @@ export default class SearchApplication { name: 'search_application.delete_behavioral_analytics', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -225,7 +232,7 @@ export default class SearchApplication { async get (this: That, params: T.SearchApplicationGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['search_application.get'] + } = this[kAcceptedParams]['search_application.get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -255,7 +262,10 @@ export default class SearchApplication { name: 'search_application.get', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -270,7 +280,7 @@ export default class SearchApplication { async getBehavioralAnalytics (this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['search_application.get_behavioral_analytics'] + } = this[kAcceptedParams]['search_application.get_behavioral_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -308,7 +318,10 @@ export default class SearchApplication { name: 'search_application.get_behavioral_analytics', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -323,7 +336,7 @@ export default class SearchApplication { async list (this: That, params?: T.SearchApplicationListRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['search_application.list'] + } = this[kAcceptedParams]['search_application.list'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -351,7 +364,12 @@ export default class SearchApplication { const method = 'GET' const path = '/_application/search_application' const meta: TransportRequestMetadata = { - name: 'search_application.list' + name: 'search_application.list', + acceptedParams: [ + 'q', + 'from', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -368,7 +386,7 @@ export default class SearchApplication { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['search_application.post_behavioral_analytics_event'] + } = this[kAcceptedParams]['search_application.post_behavioral_analytics_event'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -399,7 +417,13 @@ export default class SearchApplication { pathParts: { collection_name: params.collection_name, event_type: params.event_type - } + }, + acceptedParams: [ + 'collection_name', + 'event_type', + 'payload', + 'debug' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -416,7 +440,7 @@ export default class SearchApplication { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['search_application.put'] + } = this[kAcceptedParams]['search_application.put'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -446,7 +470,12 @@ export default class SearchApplication { name: 'search_application.put', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'search_application', + 'create' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -461,7 +490,7 @@ export default class SearchApplication { async putBehavioralAnalytics (this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['search_application.put_behavioral_analytics'] + } = this[kAcceptedParams]['search_application.put_behavioral_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -491,7 +520,10 @@ export default class SearchApplication { name: 'search_application.put_behavioral_analytics', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -508,7 +540,7 @@ export default class SearchApplication { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['search_application.render_query'] + } = this[kAcceptedParams]['search_application.render_query'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -548,7 +580,11 @@ export default class SearchApplication { name: 'search_application.render_query', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'params' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -565,7 +601,7 @@ export default class SearchApplication { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['search_application.search'] + } = this[kAcceptedParams]['search_application.search'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -605,7 +641,12 @@ export default class SearchApplication { name: 'search_application.search', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'params', + 'typed_keys' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/search_mvt.ts b/src/api/api/search_mvt.ts index b8e5e22a2..71d524f2c 100644 --- a/src/api/api/search_mvt.ts +++ b/src/api/api/search_mvt.ts @@ -59,6 +59,7 @@ const acceptedParams: Record (this: That name: 'search_template', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'explain', + 'id', + 'params', + 'profile', + 'source', + 'allow_no_indices', + 'ccs_minimize_roundtrips', + 'expand_wildcards', + 'explain', + 'ignore_throttled', + 'ignore_unavailable', + 'preference', + 'profile', + 'project_routing', + 'routing', + 'scroll', + 'search_type', + 'rest_total_hits_as_int', + 'typed_keys' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/searchable_snapshots.ts b/src/api/api/searchable_snapshots.ts index 4342c20e6..0486d7ec1 100644 --- a/src/api/api/searchable_snapshots.ts +++ b/src/api/api/searchable_snapshots.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class SearchableSnapshots { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'searchable_snapshots.cache_stats': { path: [ 'node_id' @@ -94,7 +95,7 @@ export default class SearchableSnapshots { async cacheStats (this: That, params?: T.SearchableSnapshotsCacheStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['searchable_snapshots.cache_stats'] + } = this[kAcceptedParams]['searchable_snapshots.cache_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -132,7 +133,11 @@ export default class SearchableSnapshots { name: 'searchable_snapshots.cache_stats', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -147,7 +152,7 @@ export default class SearchableSnapshots { async clearCache (this: That, params?: T.SearchableSnapshotsClearCacheRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['searchable_snapshots.clear_cache'] + } = this[kAcceptedParams]['searchable_snapshots.clear_cache'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -185,7 +190,13 @@ export default class SearchableSnapshots { name: 'searchable_snapshots.clear_cache', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'expand_wildcards', + 'allow_no_indices', + 'ignore_unavailable' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -202,7 +213,7 @@ export default class SearchableSnapshots { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['searchable_snapshots.mount'] + } = this[kAcceptedParams]['searchable_snapshots.mount'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -243,7 +254,18 @@ export default class SearchableSnapshots { pathParts: { repository: params.repository, snapshot: params.snapshot - } + }, + acceptedParams: [ + 'repository', + 'snapshot', + 'index', + 'renamed_index', + 'index_settings', + 'ignore_index_settings', + 'master_timeout', + 'wait_for_completion', + 'storage' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -258,7 +280,7 @@ export default class SearchableSnapshots { async stats (this: That, params?: T.SearchableSnapshotsStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['searchable_snapshots.stats'] + } = this[kAcceptedParams]['searchable_snapshots.stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -296,7 +318,11 @@ export default class SearchableSnapshots { name: 'searchable_snapshots.stats', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'level' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/security.ts b/src/api/api/security.ts index 2d2236a09..6675abbd2 100644 --- a/src/api/api/security.ts +++ b/src/api/api/security.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Security { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'security.activate_user_profile': { path: [], body: [ @@ -327,6 +328,11 @@ export default class Security { 'master_timeout' ] }, + 'security.get_stats': { + path: [], + body: [], + query: [] + }, 'security.get_token': { path: [], body: [ @@ -675,7 +681,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.activate_user_profile'] + } = this[kAcceptedParams]['security.activate_user_profile'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -712,7 +718,13 @@ export default class Security { const method = 'POST' const path = '/_security/profile/_activate' const meta: TransportRequestMetadata = { - name: 'security.activate_user_profile' + name: 'security.activate_user_profile', + acceptedParams: [ + 'access_token', + 'grant_type', + 'password', + 'username' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -727,7 +739,7 @@ export default class Security { async authenticate (this: That, params?: T.SecurityAuthenticateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.authenticate'] + } = this[kAcceptedParams]['security.authenticate'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -755,7 +767,9 @@ export default class Security { const method = 'GET' const path = '/_security/_authenticate' const meta: TransportRequestMetadata = { - name: 'security.authenticate' + name: 'security.authenticate', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -772,7 +786,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.bulk_delete_role'] + } = this[kAcceptedParams]['security.bulk_delete_role'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -809,7 +823,11 @@ export default class Security { const method = 'DELETE' const path = '/_security/role' const meta: TransportRequestMetadata = { - name: 'security.bulk_delete_role' + name: 'security.bulk_delete_role', + acceptedParams: [ + 'names', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -826,7 +844,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.bulk_put_role'] + } = this[kAcceptedParams]['security.bulk_put_role'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -863,7 +881,11 @@ export default class Security { const method = 'POST' const path = '/_security/role' const meta: TransportRequestMetadata = { - name: 'security.bulk_put_role' + name: 'security.bulk_put_role', + acceptedParams: [ + 'roles', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -880,7 +902,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.bulk_update_api_keys'] + } = this[kAcceptedParams]['security.bulk_update_api_keys'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -917,7 +939,13 @@ export default class Security { const method = 'POST' const path = '/_security/api_key/_bulk_update' const meta: TransportRequestMetadata = { - name: 'security.bulk_update_api_keys' + name: 'security.bulk_update_api_keys', + acceptedParams: [ + 'expiration', + 'ids', + 'metadata', + 'role_descriptors' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -934,7 +962,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.change_password'] + } = this[kAcceptedParams]['security.change_password'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -982,7 +1010,13 @@ export default class Security { name: 'security.change_password', pathParts: { username: params.username - } + }, + acceptedParams: [ + 'username', + 'password', + 'password_hash', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -997,7 +1031,7 @@ export default class Security { async clearApiKeyCache (this: That, params: T.SecurityClearApiKeyCacheRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.clear_api_key_cache'] + } = this[kAcceptedParams]['security.clear_api_key_cache'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1027,7 +1061,10 @@ export default class Security { name: 'security.clear_api_key_cache', pathParts: { ids: params.ids - } + }, + acceptedParams: [ + 'ids' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1042,7 +1079,7 @@ export default class Security { async clearCachedPrivileges (this: That, params: T.SecurityClearCachedPrivilegesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.clear_cached_privileges'] + } = this[kAcceptedParams]['security.clear_cached_privileges'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1072,7 +1109,10 @@ export default class Security { name: 'security.clear_cached_privileges', pathParts: { application: params.application - } + }, + acceptedParams: [ + 'application' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1087,7 +1127,7 @@ export default class Security { async clearCachedRealms (this: That, params: T.SecurityClearCachedRealmsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.clear_cached_realms'] + } = this[kAcceptedParams]['security.clear_cached_realms'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1117,7 +1157,11 @@ export default class Security { name: 'security.clear_cached_realms', pathParts: { realms: params.realms - } + }, + acceptedParams: [ + 'realms', + 'usernames' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1132,7 +1176,7 @@ export default class Security { async clearCachedRoles (this: That, params: T.SecurityClearCachedRolesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.clear_cached_roles'] + } = this[kAcceptedParams]['security.clear_cached_roles'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1162,7 +1206,10 @@ export default class Security { name: 'security.clear_cached_roles', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1177,7 +1224,7 @@ export default class Security { async clearCachedServiceTokens (this: That, params: T.SecurityClearCachedServiceTokensRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.clear_cached_service_tokens'] + } = this[kAcceptedParams]['security.clear_cached_service_tokens'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1209,7 +1256,12 @@ export default class Security { namespace: params.namespace, service: params.service, name: params.name - } + }, + acceptedParams: [ + 'namespace', + 'service', + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1226,7 +1278,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.create_api_key'] + } = this[kAcceptedParams]['security.create_api_key'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1264,7 +1316,14 @@ export default class Security { const method = 'PUT' const path = '/_security/api_key' const meta: TransportRequestMetadata = { - name: 'security.create_api_key' + name: 'security.create_api_key', + acceptedParams: [ + 'expiration', + 'name', + 'role_descriptors', + 'metadata', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1281,7 +1340,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.create_cross_cluster_api_key'] + } = this[kAcceptedParams]['security.create_cross_cluster_api_key'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1318,7 +1377,13 @@ export default class Security { const method = 'POST' const path = '/_security/cross_cluster/api_key' const meta: TransportRequestMetadata = { - name: 'security.create_cross_cluster_api_key' + name: 'security.create_cross_cluster_api_key', + acceptedParams: [ + 'access', + 'expiration', + 'metadata', + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1333,7 +1398,7 @@ export default class Security { async createServiceToken (this: That, params: T.SecurityCreateServiceTokenRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.create_service_token'] + } = this[kAcceptedParams]['security.create_service_token'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1372,7 +1437,13 @@ export default class Security { namespace: params.namespace, service: params.service, name: params.name - } + }, + acceptedParams: [ + 'namespace', + 'service', + 'name', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1389,7 +1460,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.delegate_pki'] + } = this[kAcceptedParams]['security.delegate_pki'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1426,7 +1497,10 @@ export default class Security { const method = 'POST' const path = '/_security/delegate_pki' const meta: TransportRequestMetadata = { - name: 'security.delegate_pki' + name: 'security.delegate_pki', + acceptedParams: [ + 'x509_certificate_chain' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1441,7 +1515,7 @@ export default class Security { async deletePrivileges (this: That, params: T.SecurityDeletePrivilegesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.delete_privileges'] + } = this[kAcceptedParams]['security.delete_privileges'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1472,7 +1546,12 @@ export default class Security { pathParts: { application: params.application, name: params.name - } + }, + acceptedParams: [ + 'application', + 'name', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1487,7 +1566,7 @@ export default class Security { async deleteRole (this: That, params: T.SecurityDeleteRoleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.delete_role'] + } = this[kAcceptedParams]['security.delete_role'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1517,7 +1596,11 @@ export default class Security { name: 'security.delete_role', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1532,7 +1615,7 @@ export default class Security { async deleteRoleMapping (this: That, params: T.SecurityDeleteRoleMappingRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.delete_role_mapping'] + } = this[kAcceptedParams]['security.delete_role_mapping'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1562,7 +1645,11 @@ export default class Security { name: 'security.delete_role_mapping', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1577,7 +1664,7 @@ export default class Security { async deleteServiceToken (this: That, params: T.SecurityDeleteServiceTokenRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.delete_service_token'] + } = this[kAcceptedParams]['security.delete_service_token'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1609,7 +1696,13 @@ export default class Security { namespace: params.namespace, service: params.service, name: params.name - } + }, + acceptedParams: [ + 'namespace', + 'service', + 'name', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1624,7 +1717,7 @@ export default class Security { async deleteUser (this: That, params: T.SecurityDeleteUserRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.delete_user'] + } = this[kAcceptedParams]['security.delete_user'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1654,7 +1747,11 @@ export default class Security { name: 'security.delete_user', pathParts: { username: params.username - } + }, + acceptedParams: [ + 'username', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1669,7 +1766,7 @@ export default class Security { async disableUser (this: That, params: T.SecurityDisableUserRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.disable_user'] + } = this[kAcceptedParams]['security.disable_user'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1699,7 +1796,11 @@ export default class Security { name: 'security.disable_user', pathParts: { username: params.username - } + }, + acceptedParams: [ + 'username', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1714,7 +1815,7 @@ export default class Security { async disableUserProfile (this: That, params: T.SecurityDisableUserProfileRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.disable_user_profile'] + } = this[kAcceptedParams]['security.disable_user_profile'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1744,7 +1845,11 @@ export default class Security { name: 'security.disable_user_profile', pathParts: { uid: params.uid - } + }, + acceptedParams: [ + 'uid', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1759,7 +1864,7 @@ export default class Security { async enableUser (this: That, params: T.SecurityEnableUserRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.enable_user'] + } = this[kAcceptedParams]['security.enable_user'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1789,7 +1894,11 @@ export default class Security { name: 'security.enable_user', pathParts: { username: params.username - } + }, + acceptedParams: [ + 'username', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1804,7 +1913,7 @@ export default class Security { async enableUserProfile (this: That, params: T.SecurityEnableUserProfileRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.enable_user_profile'] + } = this[kAcceptedParams]['security.enable_user_profile'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1834,7 +1943,11 @@ export default class Security { name: 'security.enable_user_profile', pathParts: { uid: params.uid - } + }, + acceptedParams: [ + 'uid', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1849,7 +1962,7 @@ export default class Security { async enrollKibana (this: That, params?: T.SecurityEnrollKibanaRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.enroll_kibana'] + } = this[kAcceptedParams]['security.enroll_kibana'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1877,7 +1990,9 @@ export default class Security { const method = 'GET' const path = '/_security/enroll/kibana' const meta: TransportRequestMetadata = { - name: 'security.enroll_kibana' + name: 'security.enroll_kibana', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1892,7 +2007,7 @@ export default class Security { async enrollNode (this: That, params?: T.SecurityEnrollNodeRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.enroll_node'] + } = this[kAcceptedParams]['security.enroll_node'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1920,7 +2035,9 @@ export default class Security { const method = 'GET' const path = '/_security/enroll/node' const meta: TransportRequestMetadata = { - name: 'security.enroll_node' + name: 'security.enroll_node', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1935,7 +2052,7 @@ export default class Security { async getApiKey (this: That, params?: T.SecurityGetApiKeyRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_api_key'] + } = this[kAcceptedParams]['security.get_api_key'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1963,7 +2080,17 @@ export default class Security { const method = 'GET' const path = '/_security/api_key' const meta: TransportRequestMetadata = { - name: 'security.get_api_key' + name: 'security.get_api_key', + acceptedParams: [ + 'id', + 'name', + 'owner', + 'realm_name', + 'username', + 'with_limited_by', + 'active_only', + 'with_profile_uid' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1978,7 +2105,7 @@ export default class Security { async getBuiltinPrivileges (this: That, params?: T.SecurityGetBuiltinPrivilegesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_builtin_privileges'] + } = this[kAcceptedParams]['security.get_builtin_privileges'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2006,7 +2133,9 @@ export default class Security { const method = 'GET' const path = '/_security/privilege/_builtin' const meta: TransportRequestMetadata = { - name: 'security.get_builtin_privileges' + name: 'security.get_builtin_privileges', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2021,7 +2150,7 @@ export default class Security { async getPrivileges (this: That, params?: T.SecurityGetPrivilegesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_privileges'] + } = this[kAcceptedParams]['security.get_privileges'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2063,7 +2192,11 @@ export default class Security { pathParts: { application: params.application, name: params.name - } + }, + acceptedParams: [ + 'application', + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2078,7 +2211,7 @@ export default class Security { async getRole (this: That, params?: T.SecurityGetRoleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_role'] + } = this[kAcceptedParams]['security.get_role'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2116,7 +2249,10 @@ export default class Security { name: 'security.get_role', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2131,7 +2267,7 @@ export default class Security { async getRoleMapping (this: That, params?: T.SecurityGetRoleMappingRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_role_mapping'] + } = this[kAcceptedParams]['security.get_role_mapping'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2169,7 +2305,10 @@ export default class Security { name: 'security.get_role_mapping', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2184,7 +2323,7 @@ export default class Security { async getServiceAccounts (this: That, params?: T.SecurityGetServiceAccountsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_service_accounts'] + } = this[kAcceptedParams]['security.get_service_accounts'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2226,7 +2365,11 @@ export default class Security { pathParts: { namespace: params.namespace, service: params.service - } + }, + acceptedParams: [ + 'namespace', + 'service' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2241,7 +2384,7 @@ export default class Security { async getServiceCredentials (this: That, params: T.SecurityGetServiceCredentialsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_service_credentials'] + } = this[kAcceptedParams]['security.get_service_credentials'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2272,7 +2415,11 @@ export default class Security { pathParts: { namespace: params.namespace, service: params.service - } + }, + acceptedParams: [ + 'namespace', + 'service' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2287,7 +2434,7 @@ export default class Security { async getSettings (this: That, params?: T.SecurityGetSettingsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_settings'] + } = this[kAcceptedParams]['security.get_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2315,7 +2462,54 @@ export default class Security { const method = 'GET' const path = '/_security/settings' const meta: TransportRequestMetadata = { - name: 'security.get_settings' + name: 'security.get_settings', + acceptedParams: [ + 'master_timeout' + ] + } + return await this.transport.request({ path, method, querystring, body, meta }, options) + } + + /** + * Get security statistics for all nodes + * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-stats | Elasticsearch API documentation} + */ + async getStats (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async getStats (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async getStats (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async getStats (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { + const { + path: acceptedPath + } = this[kAcceptedParams]['security.get_stats'] + + const userQuery = params?.querystring + const querystring: Record = userQuery != null ? { ...userQuery } : {} + + let body: Record | string | undefined + const userBody = params?.body + if (userBody != null) { + if (typeof userBody === 'string') { + body = userBody + } else { + body = { ...userBody } + } + } + + params = params ?? {} + for (const key in params) { + if (acceptedPath.includes(key)) { + continue + } else if (key !== 'body' && key !== 'querystring') { + querystring[key] = params[key] + } + } + + const method = 'GET' + const path = '/_security/stats' + const meta: TransportRequestMetadata = { + name: 'security.get_stats', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2332,7 +2526,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.get_token'] + } = this[kAcceptedParams]['security.get_token'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2370,7 +2564,15 @@ export default class Security { const method = 'POST' const path = '/_security/oauth2/token' const meta: TransportRequestMetadata = { - name: 'security.get_token' + name: 'security.get_token', + acceptedParams: [ + 'grant_type', + 'scope', + 'password', + 'kerberos_ticket', + 'refresh_token', + 'username' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2385,7 +2587,7 @@ export default class Security { async getUser (this: That, params?: T.SecurityGetUserRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_user'] + } = this[kAcceptedParams]['security.get_user'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2423,7 +2625,11 @@ export default class Security { name: 'security.get_user', pathParts: { username: params.username - } + }, + acceptedParams: [ + 'username', + 'with_profile_uid' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2438,7 +2644,7 @@ export default class Security { async getUserPrivileges (this: That, params?: T.SecurityGetUserPrivilegesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_user_privileges'] + } = this[kAcceptedParams]['security.get_user_privileges'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2466,7 +2672,9 @@ export default class Security { const method = 'GET' const path = '/_security/user/_privileges' const meta: TransportRequestMetadata = { - name: 'security.get_user_privileges' + name: 'security.get_user_privileges', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2481,7 +2689,7 @@ export default class Security { async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_user_profile'] + } = this[kAcceptedParams]['security.get_user_profile'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2511,7 +2719,11 @@ export default class Security { name: 'security.get_user_profile', pathParts: { uid: params.uid - } + }, + acceptedParams: [ + 'uid', + 'data' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2528,7 +2740,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.grant_api_key'] + } = this[kAcceptedParams]['security.grant_api_key'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2565,7 +2777,16 @@ export default class Security { const method = 'POST' const path = '/_security/api_key/grant' const meta: TransportRequestMetadata = { - name: 'security.grant_api_key' + name: 'security.grant_api_key', + acceptedParams: [ + 'api_key', + 'grant_type', + 'access_token', + 'username', + 'password', + 'run_as', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2582,7 +2803,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.has_privileges'] + } = this[kAcceptedParams]['security.has_privileges'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2630,7 +2851,13 @@ export default class Security { name: 'security.has_privileges', pathParts: { user: params.user - } + }, + acceptedParams: [ + 'user', + 'application', + 'cluster', + 'index' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2647,7 +2874,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.has_privileges_user_profile'] + } = this[kAcceptedParams]['security.has_privileges_user_profile'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2684,7 +2911,11 @@ export default class Security { const method = body != null ? 'POST' : 'GET' const path = '/_security/profile/_has_privileges' const meta: TransportRequestMetadata = { - name: 'security.has_privileges_user_profile' + name: 'security.has_privileges_user_profile', + acceptedParams: [ + 'uids', + 'privileges' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2701,7 +2932,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.invalidate_api_key'] + } = this[kAcceptedParams]['security.invalidate_api_key'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2739,7 +2970,15 @@ export default class Security { const method = 'DELETE' const path = '/_security/api_key' const meta: TransportRequestMetadata = { - name: 'security.invalidate_api_key' + name: 'security.invalidate_api_key', + acceptedParams: [ + 'id', + 'ids', + 'name', + 'owner', + 'realm_name', + 'username' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2756,7 +2995,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.invalidate_token'] + } = this[kAcceptedParams]['security.invalidate_token'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2794,7 +3033,13 @@ export default class Security { const method = 'DELETE' const path = '/_security/oauth2/token' const meta: TransportRequestMetadata = { - name: 'security.invalidate_token' + name: 'security.invalidate_token', + acceptedParams: [ + 'token', + 'refresh_token', + 'realm_name', + 'username' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2811,7 +3056,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.oidc_authenticate'] + } = this[kAcceptedParams]['security.oidc_authenticate'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2848,7 +3093,13 @@ export default class Security { const method = 'POST' const path = '/_security/oidc/authenticate' const meta: TransportRequestMetadata = { - name: 'security.oidc_authenticate' + name: 'security.oidc_authenticate', + acceptedParams: [ + 'nonce', + 'realm', + 'redirect_uri', + 'state' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2865,7 +3116,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.oidc_logout'] + } = this[kAcceptedParams]['security.oidc_logout'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2902,7 +3153,11 @@ export default class Security { const method = 'POST' const path = '/_security/oidc/logout' const meta: TransportRequestMetadata = { - name: 'security.oidc_logout' + name: 'security.oidc_logout', + acceptedParams: [ + 'token', + 'refresh_token' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2919,7 +3174,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.oidc_prepare_authentication'] + } = this[kAcceptedParams]['security.oidc_prepare_authentication'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2957,7 +3212,14 @@ export default class Security { const method = 'POST' const path = '/_security/oidc/prepare' const meta: TransportRequestMetadata = { - name: 'security.oidc_prepare_authentication' + name: 'security.oidc_prepare_authentication', + acceptedParams: [ + 'iss', + 'login_hint', + 'nonce', + 'realm', + 'state' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2974,7 +3236,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.put_privileges'] + } = this[kAcceptedParams]['security.put_privileges'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3001,7 +3263,11 @@ export default class Security { const method = 'PUT' const path = '/_security/privilege' const meta: TransportRequestMetadata = { - name: 'security.put_privileges' + name: 'security.put_privileges', + acceptedParams: [ + 'privileges', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3018,7 +3284,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.put_role'] + } = this[kAcceptedParams]['security.put_role'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3058,7 +3324,21 @@ export default class Security { name: 'security.put_role', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'applications', + 'cluster', + 'global', + 'indices', + 'remote_indices', + 'remote_cluster', + 'metadata', + 'run_as', + 'description', + 'transient_metadata', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3075,7 +3355,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.put_role_mapping'] + } = this[kAcceptedParams]['security.put_role_mapping'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3115,7 +3395,17 @@ export default class Security { name: 'security.put_role_mapping', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'enabled', + 'metadata', + 'roles', + 'role_templates', + 'rules', + 'run_as', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3132,7 +3422,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.put_user'] + } = this[kAcceptedParams]['security.put_user'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3172,7 +3462,19 @@ export default class Security { name: 'security.put_user', pathParts: { username: params.username - } + }, + acceptedParams: [ + 'username', + 'username', + 'email', + 'full_name', + 'metadata', + 'password', + 'password_hash', + 'roles', + 'enabled', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3189,7 +3491,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.query_api_keys'] + } = this[kAcceptedParams]['security.query_api_keys'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3227,7 +3529,19 @@ export default class Security { const method = body != null ? 'POST' : 'GET' const path = '/_security/_query/api_key' const meta: TransportRequestMetadata = { - name: 'security.query_api_keys' + name: 'security.query_api_keys', + acceptedParams: [ + 'aggregations', + 'aggs', + 'query', + 'from', + 'sort', + 'size', + 'search_after', + 'with_limited_by', + 'with_profile_uid', + 'typed_keys' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3244,7 +3558,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.query_role'] + } = this[kAcceptedParams]['security.query_role'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3282,7 +3596,14 @@ export default class Security { const method = body != null ? 'POST' : 'GET' const path = '/_security/_query/role' const meta: TransportRequestMetadata = { - name: 'security.query_role' + name: 'security.query_role', + acceptedParams: [ + 'query', + 'from', + 'sort', + 'size', + 'search_after' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3299,7 +3620,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.query_user'] + } = this[kAcceptedParams]['security.query_user'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3337,7 +3658,15 @@ export default class Security { const method = body != null ? 'POST' : 'GET' const path = '/_security/_query/user' const meta: TransportRequestMetadata = { - name: 'security.query_user' + name: 'security.query_user', + acceptedParams: [ + 'query', + 'from', + 'sort', + 'size', + 'search_after', + 'with_profile_uid' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3354,7 +3683,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.saml_authenticate'] + } = this[kAcceptedParams]['security.saml_authenticate'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3391,7 +3720,12 @@ export default class Security { const method = 'POST' const path = '/_security/saml/authenticate' const meta: TransportRequestMetadata = { - name: 'security.saml_authenticate' + name: 'security.saml_authenticate', + acceptedParams: [ + 'content', + 'ids', + 'realm' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3408,7 +3742,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.saml_complete_logout'] + } = this[kAcceptedParams]['security.saml_complete_logout'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3445,7 +3779,13 @@ export default class Security { const method = 'POST' const path = '/_security/saml/complete_logout' const meta: TransportRequestMetadata = { - name: 'security.saml_complete_logout' + name: 'security.saml_complete_logout', + acceptedParams: [ + 'realm', + 'ids', + 'query_string', + 'content' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3462,7 +3802,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.saml_invalidate'] + } = this[kAcceptedParams]['security.saml_invalidate'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3499,7 +3839,12 @@ export default class Security { const method = 'POST' const path = '/_security/saml/invalidate' const meta: TransportRequestMetadata = { - name: 'security.saml_invalidate' + name: 'security.saml_invalidate', + acceptedParams: [ + 'acs', + 'query_string', + 'realm' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3516,7 +3861,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.saml_logout'] + } = this[kAcceptedParams]['security.saml_logout'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3553,7 +3898,11 @@ export default class Security { const method = 'POST' const path = '/_security/saml/logout' const meta: TransportRequestMetadata = { - name: 'security.saml_logout' + name: 'security.saml_logout', + acceptedParams: [ + 'token', + 'refresh_token' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3570,7 +3919,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.saml_prepare_authentication'] + } = this[kAcceptedParams]['security.saml_prepare_authentication'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3608,7 +3957,12 @@ export default class Security { const method = 'POST' const path = '/_security/saml/prepare' const meta: TransportRequestMetadata = { - name: 'security.saml_prepare_authentication' + name: 'security.saml_prepare_authentication', + acceptedParams: [ + 'acs', + 'realm', + 'relay_state' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3623,7 +3977,7 @@ export default class Security { async samlServiceProviderMetadata (this: That, params: T.SecuritySamlServiceProviderMetadataRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.saml_service_provider_metadata'] + } = this[kAcceptedParams]['security.saml_service_provider_metadata'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3653,7 +4007,10 @@ export default class Security { name: 'security.saml_service_provider_metadata', pathParts: { realm_name: params.realm_name - } + }, + acceptedParams: [ + 'realm_name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3670,7 +4027,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.suggest_user_profiles'] + } = this[kAcceptedParams]['security.suggest_user_profiles'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3708,7 +4065,14 @@ export default class Security { const method = body != null ? 'POST' : 'GET' const path = '/_security/profile/_suggest' const meta: TransportRequestMetadata = { - name: 'security.suggest_user_profiles' + name: 'security.suggest_user_profiles', + acceptedParams: [ + 'name', + 'size', + 'data', + 'hint', + 'data' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3725,7 +4089,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.update_api_key'] + } = this[kAcceptedParams]['security.update_api_key'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3765,7 +4129,13 @@ export default class Security { name: 'security.update_api_key', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'role_descriptors', + 'metadata', + 'expiration' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3782,7 +4152,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.update_cross_cluster_api_key'] + } = this[kAcceptedParams]['security.update_cross_cluster_api_key'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3822,7 +4192,13 @@ export default class Security { name: 'security.update_cross_cluster_api_key', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'access', + 'expiration', + 'metadata' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3839,7 +4215,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.update_settings'] + } = this[kAcceptedParams]['security.update_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3877,7 +4253,14 @@ export default class Security { const method = 'PUT' const path = '/_security/settings' const meta: TransportRequestMetadata = { - name: 'security.update_settings' + name: 'security.update_settings', + acceptedParams: [ + 'security', + 'security-profile', + 'security-tokens', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3894,7 +4277,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.update_user_profile_data'] + } = this[kAcceptedParams]['security.update_user_profile_data'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3934,7 +4317,15 @@ export default class Security { name: 'security.update_user_profile_data', pathParts: { uid: params.uid - } + }, + acceptedParams: [ + 'uid', + 'labels', + 'data', + 'if_seq_no', + 'if_primary_term', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/shutdown.ts b/src/api/api/shutdown.ts index 99c32f3c9..2f1f9d5c0 100644 --- a/src/api/api/shutdown.ts +++ b/src/api/api/shutdown.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Shutdown { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'shutdown.delete_node': { path: [ 'node_id' @@ -82,7 +83,7 @@ export default class Shutdown { async deleteNode (this: That, params: T.ShutdownDeleteNodeRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['shutdown.delete_node'] + } = this[kAcceptedParams]['shutdown.delete_node'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -112,7 +113,12 @@ export default class Shutdown { name: 'shutdown.delete_node', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -127,7 +133,7 @@ export default class Shutdown { async getNode (this: That, params?: T.ShutdownGetNodeRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['shutdown.get_node'] + } = this[kAcceptedParams]['shutdown.get_node'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -165,7 +171,11 @@ export default class Shutdown { name: 'shutdown.get_node', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -182,7 +192,7 @@ export default class Shutdown { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['shutdown.put_node'] + } = this[kAcceptedParams]['shutdown.put_node'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -222,7 +232,16 @@ export default class Shutdown { name: 'shutdown.put_node', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id', + 'type', + 'reason', + 'allocation_delay', + 'target_node_name', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/simulate.ts b/src/api/api/simulate.ts index 407c66002..a1dff921c 100644 --- a/src/api/api/simulate.ts +++ b/src/api/api/simulate.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Simulate { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'simulate.ingest': { path: [ 'index' @@ -66,7 +67,7 @@ export default class Simulate { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['simulate.ingest'] + } = this[kAcceptedParams]['simulate.ingest'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -113,7 +114,17 @@ export default class Simulate { name: 'simulate.ingest', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'docs', + 'component_template_substitutions', + 'index_template_substitutions', + 'mapping_addition', + 'pipeline_substitutions', + 'pipeline', + 'merge_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/slm.ts b/src/api/api/slm.ts index f1f5f5e31..c710ce10c 100644 --- a/src/api/api/slm.ts +++ b/src/api/api/slm.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Slm { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'slm.delete_lifecycle': { path: [ 'policy_id' @@ -134,7 +135,7 @@ export default class Slm { async deleteLifecycle (this: That, params: T.SlmDeleteLifecycleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['slm.delete_lifecycle'] + } = this[kAcceptedParams]['slm.delete_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -164,7 +165,12 @@ export default class Slm { name: 'slm.delete_lifecycle', pathParts: { policy_id: params.policy_id - } + }, + acceptedParams: [ + 'policy_id', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -179,7 +185,7 @@ export default class Slm { async executeLifecycle (this: That, params: T.SlmExecuteLifecycleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['slm.execute_lifecycle'] + } = this[kAcceptedParams]['slm.execute_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -209,7 +215,12 @@ export default class Slm { name: 'slm.execute_lifecycle', pathParts: { policy_id: params.policy_id - } + }, + acceptedParams: [ + 'policy_id', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -224,7 +235,7 @@ export default class Slm { async executeRetention (this: That, params?: T.SlmExecuteRetentionRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['slm.execute_retention'] + } = this[kAcceptedParams]['slm.execute_retention'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -252,7 +263,11 @@ export default class Slm { const method = 'POST' const path = '/_slm/_execute_retention' const meta: TransportRequestMetadata = { - name: 'slm.execute_retention' + name: 'slm.execute_retention', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -267,7 +282,7 @@ export default class Slm { async getLifecycle (this: That, params?: T.SlmGetLifecycleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['slm.get_lifecycle'] + } = this[kAcceptedParams]['slm.get_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -305,7 +320,12 @@ export default class Slm { name: 'slm.get_lifecycle', pathParts: { policy_id: params.policy_id - } + }, + acceptedParams: [ + 'policy_id', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -320,7 +340,7 @@ export default class Slm { async getStats (this: That, params?: T.SlmGetStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['slm.get_stats'] + } = this[kAcceptedParams]['slm.get_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -348,7 +368,11 @@ export default class Slm { const method = 'GET' const path = '/_slm/stats' const meta: TransportRequestMetadata = { - name: 'slm.get_stats' + name: 'slm.get_stats', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -363,7 +387,7 @@ export default class Slm { async getStatus (this: That, params?: T.SlmGetStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['slm.get_status'] + } = this[kAcceptedParams]['slm.get_status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -391,7 +415,11 @@ export default class Slm { const method = 'GET' const path = '/_slm/status' const meta: TransportRequestMetadata = { - name: 'slm.get_status' + name: 'slm.get_status', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -408,7 +436,7 @@ export default class Slm { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['slm.put_lifecycle'] + } = this[kAcceptedParams]['slm.put_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -448,7 +476,17 @@ export default class Slm { name: 'slm.put_lifecycle', pathParts: { policy_id: params.policy_id - } + }, + acceptedParams: [ + 'policy_id', + 'config', + 'name', + 'repository', + 'retention', + 'schedule', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -463,7 +501,7 @@ export default class Slm { async start (this: That, params?: T.SlmStartRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['slm.start'] + } = this[kAcceptedParams]['slm.start'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -491,7 +529,11 @@ export default class Slm { const method = 'POST' const path = '/_slm/start' const meta: TransportRequestMetadata = { - name: 'slm.start' + name: 'slm.start', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -506,7 +548,7 @@ export default class Slm { async stop (this: That, params?: T.SlmStopRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['slm.stop'] + } = this[kAcceptedParams]['slm.stop'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -534,7 +576,11 @@ export default class Slm { const method = 'POST' const path = '/_slm/stop' const meta: TransportRequestMetadata = { - name: 'slm.stop' + name: 'slm.stop', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/snapshot.ts b/src/api/api/snapshot.ts index c8363ad2b..556b7a8f6 100644 --- a/src/api/api/snapshot.ts +++ b/src/api/api/snapshot.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Snapshot { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'snapshot.cleanup_repository': { path: [ 'name' @@ -236,7 +237,7 @@ export default class Snapshot { async cleanupRepository (this: That, params: T.SnapshotCleanupRepositoryRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['snapshot.cleanup_repository'] + } = this[kAcceptedParams]['snapshot.cleanup_repository'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -266,7 +267,12 @@ export default class Snapshot { name: 'snapshot.cleanup_repository', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'repository', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -283,7 +289,7 @@ export default class Snapshot { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['snapshot.clone'] + } = this[kAcceptedParams]['snapshot.clone'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -325,7 +331,14 @@ export default class Snapshot { repository: params.repository, snapshot: params.snapshot, target_snapshot: params.target_snapshot - } + }, + acceptedParams: [ + 'repository', + 'snapshot', + 'target_snapshot', + 'indices', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -342,7 +355,7 @@ export default class Snapshot { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['snapshot.create'] + } = this[kAcceptedParams]['snapshot.create'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -383,7 +396,20 @@ export default class Snapshot { pathParts: { repository: params.repository, snapshot: params.snapshot - } + }, + acceptedParams: [ + 'repository', + 'snapshot', + 'expand_wildcards', + 'feature_states', + 'ignore_unavailable', + 'include_global_state', + 'indices', + 'metadata', + 'partial', + 'master_timeout', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -400,7 +426,7 @@ export default class Snapshot { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['snapshot.create_repository'] + } = this[kAcceptedParams]['snapshot.create_repository'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -430,7 +456,14 @@ export default class Snapshot { name: 'snapshot.create_repository', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'repository', + 'repository', + 'master_timeout', + 'timeout', + 'verify' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -445,7 +478,7 @@ export default class Snapshot { async delete (this: That, params: T.SnapshotDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['snapshot.delete'] + } = this[kAcceptedParams]['snapshot.delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -476,7 +509,13 @@ export default class Snapshot { pathParts: { repository: params.repository, snapshot: params.snapshot - } + }, + acceptedParams: [ + 'repository', + 'snapshot', + 'master_timeout', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -491,7 +530,7 @@ export default class Snapshot { async deleteRepository (this: That, params: T.SnapshotDeleteRepositoryRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['snapshot.delete_repository'] + } = this[kAcceptedParams]['snapshot.delete_repository'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -521,7 +560,12 @@ export default class Snapshot { name: 'snapshot.delete_repository', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'repository', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -536,7 +580,7 @@ export default class Snapshot { async get (this: That, params: T.SnapshotGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['snapshot.get'] + } = this[kAcceptedParams]['snapshot.get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -567,7 +611,25 @@ export default class Snapshot { pathParts: { repository: params.repository, snapshot: params.snapshot - } + }, + acceptedParams: [ + 'repository', + 'snapshot', + 'after', + 'from_sort_value', + 'ignore_unavailable', + 'index_details', + 'index_names', + 'include_repository', + 'master_timeout', + 'order', + 'offset', + 'size', + 'slm_policy_filter', + 'sort', + 'state', + 'verbose' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -582,7 +644,7 @@ export default class Snapshot { async getRepository (this: That, params?: T.SnapshotGetRepositoryRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['snapshot.get_repository'] + } = this[kAcceptedParams]['snapshot.get_repository'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -620,7 +682,12 @@ export default class Snapshot { name: 'snapshot.get_repository', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'repository', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -635,7 +702,7 @@ export default class Snapshot { async repositoryAnalyze (this: That, params: T.SnapshotRepositoryAnalyzeRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['snapshot.repository_analyze'] + } = this[kAcceptedParams]['snapshot.repository_analyze'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -665,7 +732,22 @@ export default class Snapshot { name: 'snapshot.repository_analyze', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'repository', + 'blob_count', + 'concurrency', + 'detailed', + 'early_read_node_count', + 'max_blob_size', + 'max_total_data_size', + 'rare_action_probability', + 'rarely_abort_writes', + 'read_node_count', + 'register_operation_count', + 'seed', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -680,7 +762,7 @@ export default class Snapshot { async repositoryVerifyIntegrity (this: That, params: T.SnapshotRepositoryVerifyIntegrityRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['snapshot.repository_verify_integrity'] + } = this[kAcceptedParams]['snapshot.repository_verify_integrity'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -710,7 +792,18 @@ export default class Snapshot { name: 'snapshot.repository_verify_integrity', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'repository', + 'blob_thread_pool_concurrency', + 'index_snapshot_verification_concurrency', + 'index_verification_concurrency', + 'max_bytes_per_sec', + 'max_failed_shard_snapshots', + 'meta_thread_pool_concurrency', + 'snapshot_verification_concurrency', + 'verify_blob_contents' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -727,7 +820,7 @@ export default class Snapshot { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['snapshot.restore'] + } = this[kAcceptedParams]['snapshot.restore'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -768,7 +861,23 @@ export default class Snapshot { pathParts: { repository: params.repository, snapshot: params.snapshot - } + }, + acceptedParams: [ + 'repository', + 'snapshot', + 'feature_states', + 'ignore_index_settings', + 'ignore_unavailable', + 'include_aliases', + 'include_global_state', + 'index_settings', + 'indices', + 'partial', + 'rename_pattern', + 'rename_replacement', + 'master_timeout', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -783,7 +892,7 @@ export default class Snapshot { async status (this: That, params?: T.SnapshotStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['snapshot.status'] + } = this[kAcceptedParams]['snapshot.status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -825,7 +934,13 @@ export default class Snapshot { pathParts: { repository: params.repository, snapshot: params.snapshot - } + }, + acceptedParams: [ + 'repository', + 'snapshot', + 'ignore_unavailable', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -840,7 +955,7 @@ export default class Snapshot { async verifyRepository (this: That, params: T.SnapshotVerifyRepositoryRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['snapshot.verify_repository'] + } = this[kAcceptedParams]['snapshot.verify_repository'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -870,7 +985,12 @@ export default class Snapshot { name: 'snapshot.verify_repository', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'repository', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/sql.ts b/src/api/api/sql.ts index 2fa3d0b02..47c411cfb 100644 --- a/src/api/api/sql.ts +++ b/src/api/api/sql.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Sql { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'sql.clear_cursor': { path: [], body: [ @@ -90,7 +91,8 @@ export default class Sql { 'wait_for_completion_timeout' ], query: [ - 'format' + 'format', + 'project_routing' ] }, 'sql.translate': { @@ -118,7 +120,7 @@ export default class Sql { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['sql.clear_cursor'] + } = this[kAcceptedParams]['sql.clear_cursor'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -155,7 +157,10 @@ export default class Sql { const method = 'POST' const path = '/_sql/close' const meta: TransportRequestMetadata = { - name: 'sql.clear_cursor' + name: 'sql.clear_cursor', + acceptedParams: [ + 'cursor' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -170,7 +175,7 @@ export default class Sql { async deleteAsync (this: That, params: T.SqlDeleteAsyncRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['sql.delete_async'] + } = this[kAcceptedParams]['sql.delete_async'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -200,7 +205,10 @@ export default class Sql { name: 'sql.delete_async', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -215,7 +223,7 @@ export default class Sql { async getAsync (this: That, params: T.SqlGetAsyncRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['sql.get_async'] + } = this[kAcceptedParams]['sql.get_async'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -245,7 +253,14 @@ export default class Sql { name: 'sql.get_async', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'delimiter', + 'format', + 'keep_alive', + 'wait_for_completion_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -260,7 +275,7 @@ export default class Sql { async getAsyncStatus (this: That, params: T.SqlGetAsyncStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['sql.get_async_status'] + } = this[kAcceptedParams]['sql.get_async_status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -290,7 +305,10 @@ export default class Sql { name: 'sql.get_async_status', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -307,7 +325,7 @@ export default class Sql { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['sql.query'] + } = this[kAcceptedParams]['sql.query'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -345,7 +363,28 @@ export default class Sql { const method = body != null ? 'POST' : 'GET' const path = '/_sql' const meta: TransportRequestMetadata = { - name: 'sql.query' + name: 'sql.query', + acceptedParams: [ + 'allow_partial_search_results', + 'catalog', + 'columnar', + 'cursor', + 'fetch_size', + 'field_multi_value_leniency', + 'filter', + 'index_using_frozen', + 'keep_alive', + 'keep_on_completion', + 'page_timeout', + 'params', + 'query', + 'request_timeout', + 'runtime_mappings', + 'time_zone', + 'wait_for_completion_timeout', + 'format', + 'project_routing' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -362,7 +401,7 @@ export default class Sql { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['sql.translate'] + } = this[kAcceptedParams]['sql.translate'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -399,7 +438,13 @@ export default class Sql { const method = body != null ? 'POST' : 'GET' const path = '/_sql/translate' const meta: TransportRequestMetadata = { - name: 'sql.translate' + name: 'sql.translate', + acceptedParams: [ + 'fetch_size', + 'filter', + 'query', + 'time_zone' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/ssl.ts b/src/api/api/ssl.ts index 1708b535e..ada1ae8db 100644 --- a/src/api/api/ssl.ts +++ b/src/api/api/ssl.ts @@ -21,18 +21,19 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } export default class Ssl { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'ssl.certificates': { path: [], body: [], @@ -51,7 +52,7 @@ export default class Ssl { async certificates (this: That, params?: T.SslCertificatesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ssl.certificates'] + } = this[kAcceptedParams]['ssl.certificates'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -79,7 +80,9 @@ export default class Ssl { const method = 'GET' const path = '/_ssl/certificates' const meta: TransportRequestMetadata = { - name: 'ssl.certificates' + name: 'ssl.certificates', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/streams.ts b/src/api/api/streams.ts index e040401cd..97ea936a6 100644 --- a/src/api/api/streams.ts +++ b/src/api/api/streams.ts @@ -21,47 +21,56 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } export default class Streams { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'streams.logs_disable': { path: [], body: [], - query: [] + query: [ + 'master_timeout', + 'timeout' + ] }, 'streams.logs_enable': { path: [], body: [], - query: [] + query: [ + 'master_timeout', + 'timeout' + ] }, 'streams.status': { path: [], body: [], - query: [] + query: [ + 'master_timeout' + ] } } } /** - * Disable the Logs Streams feature for this cluster - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/streams-logs-disable.html | Elasticsearch API documentation} + * Disable logs stream. Turn off the logs stream feature for this cluster. + * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch#TODO | Elasticsearch API documentation} */ - async logsDisable (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async logsDisable (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async logsDisable (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise - async logsDisable (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { + async logsDisable (this: That, params?: T.StreamsLogsDisableRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async logsDisable (this: That, params?: T.StreamsLogsDisableRequest, options?: TransportRequestOptionsWithMeta): Promise> + async logsDisable (this: That, params?: T.StreamsLogsDisableRequest, options?: TransportRequestOptions): Promise + async logsDisable (this: That, params?: T.StreamsLogsDisableRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['streams.logs_disable'] + } = this[kAcceptedParams]['streams.logs_disable'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -81,6 +90,7 @@ export default class Streams { if (acceptedPath.includes(key)) { continue } else if (key !== 'body' && key !== 'querystring') { + // @ts-expect-error querystring[key] = params[key] } } @@ -88,22 +98,26 @@ export default class Streams { const method = 'POST' const path = '/_streams/logs/_disable' const meta: TransportRequestMetadata = { - name: 'streams.logs_disable' + name: 'streams.logs_disable', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Enable the Logs Streams feature for this cluster - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/streams-logs-enable.html | Elasticsearch API documentation} + * Enable logs stream. Turn on the logs stream feature for this cluster. NOTE: To protect existing data, this feature can be turned on only if the cluster does not have existing indices or data streams that match the pattern `logs|logs.*`. If those indices or data streams exist, a `409 - Conflict` response and error is returned. + * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch#TODO | Elasticsearch API documentation} */ - async logsEnable (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async logsEnable (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async logsEnable (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise - async logsEnable (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { + async logsEnable (this: That, params?: T.StreamsLogsEnableRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async logsEnable (this: That, params?: T.StreamsLogsEnableRequest, options?: TransportRequestOptionsWithMeta): Promise> + async logsEnable (this: That, params?: T.StreamsLogsEnableRequest, options?: TransportRequestOptions): Promise + async logsEnable (this: That, params?: T.StreamsLogsEnableRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['streams.logs_enable'] + } = this[kAcceptedParams]['streams.logs_enable'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -123,6 +137,7 @@ export default class Streams { if (acceptedPath.includes(key)) { continue } else if (key !== 'body' && key !== 'querystring') { + // @ts-expect-error querystring[key] = params[key] } } @@ -130,22 +145,26 @@ export default class Streams { const method = 'POST' const path = '/_streams/logs/_enable' const meta: TransportRequestMetadata = { - name: 'streams.logs_enable' + name: 'streams.logs_enable', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } /** - * Return the current status of the streams feature for each streams type - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/streams-status.html | Elasticsearch API documentation} + * Get the status of streams. Get the current status for all types of streams. + * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch#TODO | Elasticsearch API documentation} */ - async status (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async status (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async status (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise - async status (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { + async status (this: That, params?: T.StreamsStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async status (this: That, params?: T.StreamsStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> + async status (this: That, params?: T.StreamsStatusRequest, options?: TransportRequestOptions): Promise + async status (this: That, params?: T.StreamsStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['streams.status'] + } = this[kAcceptedParams]['streams.status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -165,6 +184,7 @@ export default class Streams { if (acceptedPath.includes(key)) { continue } else if (key !== 'body' && key !== 'querystring') { + // @ts-expect-error querystring[key] = params[key] } } @@ -172,7 +192,10 @@ export default class Streams { const method = 'GET' const path = '/_streams/status' const meta: TransportRequestMetadata = { - name: 'streams.status' + name: 'streams.status', + acceptedParams: [ + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/synonyms.ts b/src/api/api/synonyms.ts index d2b3511a5..e672db93e 100644 --- a/src/api/api/synonyms.ts +++ b/src/api/api/synonyms.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Synonyms { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'synonyms.delete_synonym': { path: [ 'id' @@ -114,7 +115,7 @@ export default class Synonyms { async deleteSynonym (this: That, params: T.SynonymsDeleteSynonymRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['synonyms.delete_synonym'] + } = this[kAcceptedParams]['synonyms.delete_synonym'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -144,7 +145,10 @@ export default class Synonyms { name: 'synonyms.delete_synonym', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -159,7 +163,7 @@ export default class Synonyms { async deleteSynonymRule (this: That, params: T.SynonymsDeleteSynonymRuleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['synonyms.delete_synonym_rule'] + } = this[kAcceptedParams]['synonyms.delete_synonym_rule'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -190,7 +194,12 @@ export default class Synonyms { pathParts: { set_id: params.set_id, rule_id: params.rule_id - } + }, + acceptedParams: [ + 'set_id', + 'rule_id', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -205,7 +214,7 @@ export default class Synonyms { async getSynonym (this: That, params: T.SynonymsGetSynonymRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['synonyms.get_synonym'] + } = this[kAcceptedParams]['synonyms.get_synonym'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -235,7 +244,12 @@ export default class Synonyms { name: 'synonyms.get_synonym', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'from', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -250,7 +264,7 @@ export default class Synonyms { async getSynonymRule (this: That, params: T.SynonymsGetSynonymRuleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['synonyms.get_synonym_rule'] + } = this[kAcceptedParams]['synonyms.get_synonym_rule'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -281,7 +295,11 @@ export default class Synonyms { pathParts: { set_id: params.set_id, rule_id: params.rule_id - } + }, + acceptedParams: [ + 'set_id', + 'rule_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -296,7 +314,7 @@ export default class Synonyms { async getSynonymsSets (this: That, params?: T.SynonymsGetSynonymsSetsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['synonyms.get_synonyms_sets'] + } = this[kAcceptedParams]['synonyms.get_synonyms_sets'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -324,7 +342,11 @@ export default class Synonyms { const method = 'GET' const path = '/_synonyms' const meta: TransportRequestMetadata = { - name: 'synonyms.get_synonyms_sets' + name: 'synonyms.get_synonyms_sets', + acceptedParams: [ + 'from', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -341,7 +363,7 @@ export default class Synonyms { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['synonyms.put_synonym'] + } = this[kAcceptedParams]['synonyms.put_synonym'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -381,7 +403,12 @@ export default class Synonyms { name: 'synonyms.put_synonym', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'synonyms_set', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -398,7 +425,7 @@ export default class Synonyms { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['synonyms.put_synonym_rule'] + } = this[kAcceptedParams]['synonyms.put_synonym_rule'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -439,7 +466,13 @@ export default class Synonyms { pathParts: { set_id: params.set_id, rule_id: params.rule_id - } + }, + acceptedParams: [ + 'set_id', + 'rule_id', + 'synonyms', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/tasks.ts b/src/api/api/tasks.ts index c85a53d77..48de0e23f 100644 --- a/src/api/api/tasks.ts +++ b/src/api/api/tasks.ts @@ -21,18 +21,19 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } export default class Tasks { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'tasks.cancel': { path: [ 'task_id' @@ -81,7 +82,7 @@ export default class Tasks { async cancel (this: That, params?: T.TasksCancelRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['tasks.cancel'] + } = this[kAcceptedParams]['tasks.cancel'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -119,7 +120,14 @@ export default class Tasks { name: 'tasks.cancel', pathParts: { task_id: params.task_id - } + }, + acceptedParams: [ + 'task_id', + 'actions', + 'nodes', + 'parent_task_id', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -134,7 +142,7 @@ export default class Tasks { async get (this: That, params: T.TasksGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['tasks.get'] + } = this[kAcceptedParams]['tasks.get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -164,7 +172,12 @@ export default class Tasks { name: 'tasks.get', pathParts: { task_id: params.task_id - } + }, + acceptedParams: [ + 'task_id', + 'timeout', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -179,7 +192,7 @@ export default class Tasks { async list (this: That, params?: T.TasksListRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['tasks.list'] + } = this[kAcceptedParams]['tasks.list'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -207,7 +220,16 @@ export default class Tasks { const method = 'GET' const path = '/_tasks' const meta: TransportRequestMetadata = { - name: 'tasks.list' + name: 'tasks.list', + acceptedParams: [ + 'actions', + 'detailed', + 'group_by', + 'nodes', + 'parent_task_id', + 'timeout', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/terms_enum.ts b/src/api/api/terms_enum.ts index e12d731bf..dec56df1a 100644 --- a/src/api/api/terms_enum.ts +++ b/src/api/api/terms_enum.ts @@ -98,7 +98,17 @@ export default async function TermsEnumApi (this: That, params: T.TermsEnumReque name: 'terms_enum', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'field', + 'size', + 'timeout', + 'case_insensitive', + 'index_filter', + 'string', + 'search_after' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/termvectors.ts b/src/api/api/termvectors.ts index 7d1378924..b38dd64f2 100644 --- a/src/api/api/termvectors.ts +++ b/src/api/api/termvectors.ts @@ -124,7 +124,34 @@ export default async function TermvectorsApi (this: That, p pathParts: { index: params.index, id: params.id - } + }, + acceptedParams: [ + 'index', + 'id', + 'doc', + 'filter', + 'per_field_analyzer', + 'fields', + 'field_statistics', + 'offsets', + 'payloads', + 'positions', + 'term_statistics', + 'routing', + 'version', + 'version_type', + 'fields', + 'field_statistics', + 'offsets', + 'payloads', + 'positions', + 'preference', + 'realtime', + 'routing', + 'term_statistics', + 'version', + 'version_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/text_structure.ts b/src/api/api/text_structure.ts index 4d9997c24..318cadc00 100644 --- a/src/api/api/text_structure.ts +++ b/src/api/api/text_structure.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class TextStructure { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'text_structure.find_field_structure': { path: [], body: [], @@ -120,7 +121,7 @@ export default class TextStructure { async findFieldStructure (this: That, params: T.TextStructureFindFieldStructureRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['text_structure.find_field_structure'] + } = this[kAcceptedParams]['text_structure.find_field_structure'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -147,7 +148,23 @@ export default class TextStructure { const method = 'GET' const path = '/_text_structure/find_field_structure' const meta: TransportRequestMetadata = { - name: 'text_structure.find_field_structure' + name: 'text_structure.find_field_structure', + acceptedParams: [ + 'column_names', + 'delimiter', + 'documents_to_sample', + 'ecs_compatibility', + 'explain', + 'field', + 'format', + 'grok_pattern', + 'index', + 'quote', + 'should_trim_fields', + 'timeout', + 'timestamp_field', + 'timestamp_format' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -164,7 +181,7 @@ export default class TextStructure { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['text_structure.find_message_structure'] + } = this[kAcceptedParams]['text_structure.find_message_structure'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -201,7 +218,21 @@ export default class TextStructure { const method = body != null ? 'POST' : 'GET' const path = '/_text_structure/find_message_structure' const meta: TransportRequestMetadata = { - name: 'text_structure.find_message_structure' + name: 'text_structure.find_message_structure', + acceptedParams: [ + 'messages', + 'column_names', + 'delimiter', + 'ecs_compatibility', + 'explain', + 'format', + 'grok_pattern', + 'quote', + 'should_trim_fields', + 'timeout', + 'timestamp_field', + 'timestamp_format' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -218,7 +249,7 @@ export default class TextStructure { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['text_structure.find_structure'] + } = this[kAcceptedParams]['text_structure.find_structure'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -245,7 +276,25 @@ export default class TextStructure { const method = 'POST' const path = '/_text_structure/find_structure' const meta: TransportRequestMetadata = { - name: 'text_structure.find_structure' + name: 'text_structure.find_structure', + acceptedParams: [ + 'text_files', + 'charset', + 'column_names', + 'delimiter', + 'ecs_compatibility', + 'explain', + 'format', + 'grok_pattern', + 'has_header_row', + 'line_merge_size_limit', + 'lines_to_sample', + 'quote', + 'should_trim_fields', + 'timeout', + 'timestamp_field', + 'timestamp_format' + ] } return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options) } @@ -262,7 +311,7 @@ export default class TextStructure { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['text_structure.test_grok_pattern'] + } = this[kAcceptedParams]['text_structure.test_grok_pattern'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -299,7 +348,12 @@ export default class TextStructure { const method = body != null ? 'POST' : 'GET' const path = '/_text_structure/test_grok_pattern' const meta: TransportRequestMetadata = { - name: 'text_structure.test_grok_pattern' + name: 'text_structure.test_grok_pattern', + acceptedParams: [ + 'grok_pattern', + 'text', + 'ecs_compatibility' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/transform.ts b/src/api/api/transform.ts index 91f4477b1..1bddfe7b8 100644 --- a/src/api/api/transform.ts +++ b/src/api/api/transform.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Transform { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'transform.delete_transform': { path: [ 'transform_id' @@ -205,7 +206,7 @@ export default class Transform { async deleteTransform (this: That, params: T.TransformDeleteTransformRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.delete_transform'] + } = this[kAcceptedParams]['transform.delete_transform'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -235,14 +236,20 @@ export default class Transform { name: 'transform.delete_transform', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'force', + 'delete_dest_index', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } /** * Retrieves transform usage information for transform nodes - * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-transform-node-stats.html | Elasticsearch API documentation} + * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/9.2/get-transform-node-stats.html | Elasticsearch API documentation} */ async getNodeStats (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise async getNodeStats (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> @@ -250,7 +257,7 @@ export default class Transform { async getNodeStats (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.get_node_stats'] + } = this[kAcceptedParams]['transform.get_node_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -277,7 +284,9 @@ export default class Transform { const method = 'GET' const path = '/_transform/_node_stats' const meta: TransportRequestMetadata = { - name: 'transform.get_node_stats' + name: 'transform.get_node_stats', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -292,7 +301,7 @@ export default class Transform { async getTransform (this: That, params?: T.TransformGetTransformRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.get_transform'] + } = this[kAcceptedParams]['transform.get_transform'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -330,7 +339,14 @@ export default class Transform { name: 'transform.get_transform', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'allow_no_match', + 'from', + 'size', + 'exclude_generated' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -345,7 +361,7 @@ export default class Transform { async getTransformStats (this: That, params: T.TransformGetTransformStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.get_transform_stats'] + } = this[kAcceptedParams]['transform.get_transform_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -375,7 +391,14 @@ export default class Transform { name: 'transform.get_transform_stats', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'allow_no_match', + 'from', + 'size', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -392,7 +415,7 @@ export default class Transform { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['transform.preview_transform'] + } = this[kAcceptedParams]['transform.preview_transform'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -440,7 +463,20 @@ export default class Transform { name: 'transform.preview_transform', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'dest', + 'description', + 'frequency', + 'pivot', + 'source', + 'settings', + 'sync', + 'retention_policy', + 'latest', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -457,7 +493,7 @@ export default class Transform { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['transform.put_transform'] + } = this[kAcceptedParams]['transform.put_transform'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -497,7 +533,22 @@ export default class Transform { name: 'transform.put_transform', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'dest', + 'description', + 'frequency', + 'latest', + '_meta', + 'pivot', + 'retention_policy', + 'settings', + 'source', + 'sync', + 'defer_validation', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -512,7 +563,7 @@ export default class Transform { async resetTransform (this: That, params: T.TransformResetTransformRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.reset_transform'] + } = this[kAcceptedParams]['transform.reset_transform'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -542,7 +593,12 @@ export default class Transform { name: 'transform.reset_transform', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'force', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -557,7 +613,7 @@ export default class Transform { async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.schedule_now_transform'] + } = this[kAcceptedParams]['transform.schedule_now_transform'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -587,7 +643,11 @@ export default class Transform { name: 'transform.schedule_now_transform', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -602,7 +662,7 @@ export default class Transform { async setUpgradeMode (this: That, params?: T.TransformSetUpgradeModeRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.set_upgrade_mode'] + } = this[kAcceptedParams]['transform.set_upgrade_mode'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -630,7 +690,11 @@ export default class Transform { const method = 'POST' const path = '/_transform/set_upgrade_mode' const meta: TransportRequestMetadata = { - name: 'transform.set_upgrade_mode' + name: 'transform.set_upgrade_mode', + acceptedParams: [ + 'enabled', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -645,7 +709,7 @@ export default class Transform { async startTransform (this: That, params: T.TransformStartTransformRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.start_transform'] + } = this[kAcceptedParams]['transform.start_transform'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -675,7 +739,12 @@ export default class Transform { name: 'transform.start_transform', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'timeout', + 'from' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -690,7 +759,7 @@ export default class Transform { async stopTransform (this: That, params: T.TransformStopTransformRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.stop_transform'] + } = this[kAcceptedParams]['transform.stop_transform'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -720,7 +789,15 @@ export default class Transform { name: 'transform.stop_transform', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'allow_no_match', + 'force', + 'timeout', + 'wait_for_checkpoint', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -737,7 +814,7 @@ export default class Transform { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['transform.update_transform'] + } = this[kAcceptedParams]['transform.update_transform'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -777,7 +854,20 @@ export default class Transform { name: 'transform.update_transform', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'dest', + 'description', + 'frequency', + '_meta', + 'source', + 'settings', + 'sync', + 'retention_policy', + 'defer_validation', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -792,7 +882,7 @@ export default class Transform { async upgradeTransforms (this: That, params?: T.TransformUpgradeTransformsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.upgrade_transforms'] + } = this[kAcceptedParams]['transform.upgrade_transforms'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -820,7 +910,11 @@ export default class Transform { const method = 'POST' const path = '/_transform/_upgrade' const meta: TransportRequestMetadata = { - name: 'transform.upgrade_transforms' + name: 'transform.upgrade_transforms', + acceptedParams: [ + 'dry_run', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/update.ts b/src/api/api/update.ts index 982b35272..5711f8f9f 100644 --- a/src/api/api/update.ts +++ b/src/api/api/update.ts @@ -114,7 +114,31 @@ export default async function UpdateApi + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Watcher { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'watcher.ack_watch': { path: [ 'watch_id', @@ -175,7 +176,7 @@ export default class Watcher { async ackWatch (this: That, params: T.WatcherAckWatchRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['watcher.ack_watch'] + } = this[kAcceptedParams]['watcher.ack_watch'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -213,7 +214,11 @@ export default class Watcher { pathParts: { watch_id: params.watch_id, action_id: params.action_id - } + }, + acceptedParams: [ + 'watch_id', + 'action_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -228,7 +233,7 @@ export default class Watcher { async activateWatch (this: That, params: T.WatcherActivateWatchRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['watcher.activate_watch'] + } = this[kAcceptedParams]['watcher.activate_watch'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -258,7 +263,10 @@ export default class Watcher { name: 'watcher.activate_watch', pathParts: { watch_id: params.watch_id - } + }, + acceptedParams: [ + 'watch_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -273,7 +281,7 @@ export default class Watcher { async deactivateWatch (this: That, params: T.WatcherDeactivateWatchRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['watcher.deactivate_watch'] + } = this[kAcceptedParams]['watcher.deactivate_watch'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -303,7 +311,10 @@ export default class Watcher { name: 'watcher.deactivate_watch', pathParts: { watch_id: params.watch_id - } + }, + acceptedParams: [ + 'watch_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -318,7 +329,7 @@ export default class Watcher { async deleteWatch (this: That, params: T.WatcherDeleteWatchRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['watcher.delete_watch'] + } = this[kAcceptedParams]['watcher.delete_watch'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -348,7 +359,10 @@ export default class Watcher { name: 'watcher.delete_watch', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -365,7 +379,7 @@ export default class Watcher { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['watcher.execute_watch'] + } = this[kAcceptedParams]['watcher.execute_watch'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -413,7 +427,18 @@ export default class Watcher { name: 'watcher.execute_watch', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'action_modes', + 'alternative_input', + 'ignore_condition', + 'record_execution', + 'simulated_actions', + 'trigger_data', + 'watch', + 'debug' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -428,7 +453,7 @@ export default class Watcher { async getSettings (this: That, params?: T.WatcherGetSettingsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['watcher.get_settings'] + } = this[kAcceptedParams]['watcher.get_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -456,7 +481,10 @@ export default class Watcher { const method = 'GET' const path = '/_watcher/settings' const meta: TransportRequestMetadata = { - name: 'watcher.get_settings' + name: 'watcher.get_settings', + acceptedParams: [ + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -471,7 +499,7 @@ export default class Watcher { async getWatch (this: That, params: T.WatcherGetWatchRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['watcher.get_watch'] + } = this[kAcceptedParams]['watcher.get_watch'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -501,7 +529,10 @@ export default class Watcher { name: 'watcher.get_watch', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -518,7 +549,7 @@ export default class Watcher { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['watcher.put_watch'] + } = this[kAcceptedParams]['watcher.put_watch'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -558,7 +589,22 @@ export default class Watcher { name: 'watcher.put_watch', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'actions', + 'condition', + 'input', + 'metadata', + 'throttle_period', + 'throttle_period_in_millis', + 'transform', + 'trigger', + 'active', + 'if_primary_term', + 'if_seq_no', + 'version' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -575,7 +621,7 @@ export default class Watcher { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['watcher.query_watches'] + } = this[kAcceptedParams]['watcher.query_watches'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -613,7 +659,14 @@ export default class Watcher { const method = body != null ? 'POST' : 'GET' const path = '/_watcher/_query/watches' const meta: TransportRequestMetadata = { - name: 'watcher.query_watches' + name: 'watcher.query_watches', + acceptedParams: [ + 'from', + 'size', + 'query', + 'sort', + 'search_after' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -628,7 +681,7 @@ export default class Watcher { async start (this: That, params?: T.WatcherStartRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['watcher.start'] + } = this[kAcceptedParams]['watcher.start'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -656,7 +709,10 @@ export default class Watcher { const method = 'POST' const path = '/_watcher/_start' const meta: TransportRequestMetadata = { - name: 'watcher.start' + name: 'watcher.start', + acceptedParams: [ + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -671,7 +727,7 @@ export default class Watcher { async stats (this: That, params?: T.WatcherStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['watcher.stats'] + } = this[kAcceptedParams]['watcher.stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -709,7 +765,12 @@ export default class Watcher { name: 'watcher.stats', pathParts: { metric: params.metric - } + }, + acceptedParams: [ + 'metric', + 'emit_stacktraces', + 'metric' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -724,7 +785,7 @@ export default class Watcher { async stop (this: That, params?: T.WatcherStopRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['watcher.stop'] + } = this[kAcceptedParams]['watcher.stop'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -752,7 +813,10 @@ export default class Watcher { const method = 'POST' const path = '/_watcher/_stop' const meta: TransportRequestMetadata = { - name: 'watcher.stop' + name: 'watcher.stop', + acceptedParams: [ + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -769,7 +833,7 @@ export default class Watcher { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['watcher.update_settings'] + } = this[kAcceptedParams]['watcher.update_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -807,7 +871,13 @@ export default class Watcher { const method = 'PUT' const path = '/_watcher/settings' const meta: TransportRequestMetadata = { - name: 'watcher.update_settings' + name: 'watcher.update_settings', + acceptedParams: [ + 'index.auto_expand_replicas', + 'index.number_of_replicas', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/xpack.ts b/src/api/api/xpack.ts index 858e52869..1c14a1314 100644 --- a/src/api/api/xpack.ts +++ b/src/api/api/xpack.ts @@ -21,18 +21,19 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } export default class Xpack { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'xpack.info': { path: [], body: [], @@ -62,7 +63,7 @@ export default class Xpack { async info (this: That, params?: T.XpackInfoRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['xpack.info'] + } = this[kAcceptedParams]['xpack.info'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -90,7 +91,12 @@ export default class Xpack { const method = 'GET' const path = '/_xpack' const meta: TransportRequestMetadata = { - name: 'xpack.info' + name: 'xpack.info', + acceptedParams: [ + 'categories', + 'accept_enterprise', + 'human' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -105,7 +111,7 @@ export default class Xpack { async usage (this: That, params?: T.XpackUsageRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['xpack.usage'] + } = this[kAcceptedParams]['xpack.usage'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -133,7 +139,10 @@ export default class Xpack { const method = 'GET' const path = '/_xpack/usage' const meta: TransportRequestMetadata = { - name: 'xpack.usage' + name: 'xpack.usage', + acceptedParams: [ + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/index.ts b/src/api/index.ts index 90a71f688..65ffbd45e 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -65,6 +65,7 @@ import NodesApi from './api/nodes' import openPointInTimeApi from './api/open_point_in_time' import pingApi from './api/ping' import ProfilingApi from './api/profiling' +import ProjectApi from './api/project' import putScriptApi from './api/put_script' import QueryRulesApi from './api/query_rules' import rankEvalApi from './api/rank_eval' @@ -155,6 +156,7 @@ export default interface API { openPointInTime: typeof openPointInTimeApi ping: typeof pingApi profiling: ProfilingApi + project: ProjectApi putScript: typeof putScriptApi queryRules: QueryRulesApi rankEval: typeof rankEvalApi @@ -215,6 +217,7 @@ const kMl = Symbol('Ml') const kMonitoring = Symbol('Monitoring') const kNodes = Symbol('Nodes') const kProfiling = Symbol('Profiling') +const kProject = Symbol('Project') const kQueryRules = Symbol('QueryRules') const kRollup = Symbol('Rollup') const kSearchApplication = Symbol('SearchApplication') @@ -259,6 +262,7 @@ export default class API { [kMonitoring]: symbol | null [kNodes]: symbol | null [kProfiling]: symbol | null + [kProject]: symbol | null [kQueryRules]: symbol | null [kRollup]: symbol | null [kSearchApplication]: symbol | null @@ -302,6 +306,7 @@ export default class API { this[kMonitoring] = null this[kNodes] = null this[kProfiling] = null + this[kProject] = null this[kQueryRules] = null this[kRollup] = null this[kSearchApplication] = null @@ -442,6 +447,9 @@ Object.defineProperties(API.prototype, { profiling: { get () { return this[kProfiling] === null ? (this[kProfiling] = new ProfilingApi(this.transport)) : this[kProfiling] } }, + project: { + get () { return this[kProject] === null ? (this[kProject] = new ProjectApi(this.transport)) : this[kProject] } + }, queryRules: { get () { return this[kQueryRules] === null ? (this[kQueryRules] = new QueryRulesApi(this.transport)) : this[kQueryRules] } }, diff --git a/src/api/types.ts b/src/api/types.ts index 306cd712d..1db7f01e4 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -256,6 +256,15 @@ export interface CountRequest extends RequestBase { /** The node or shard the operation should be performed on. * By default, it is random. */ preference?: string + /** Specifies a subset of projects to target for the search using project + * metadata tags in a subset of Lucene query syntax. + * Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + * Examples: + * _alias:my-project + * _alias:_origin + * _alias:*pr* + * Supported in serverless only. */ + project_routing?: ProjectRouting /** A custom value used to route operations to a specific shard. */ routing?: Routing /** The maximum number of documents to collect for each shard. @@ -273,9 +282,9 @@ export interface CountRequest extends RequestBase { * with the `q` query string parameter. */ query?: QueryDslQueryContainer /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { index?: never, allow_no_indices?: never, analyzer?: never, analyze_wildcard?: never, default_operator?: never, df?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, lenient?: never, min_score?: never, preference?: never, routing?: never, terminate_after?: never, q?: never, query?: never } + body?: string | { [key: string]: any } & { index?: never, allow_no_indices?: never, analyzer?: never, analyze_wildcard?: never, default_operator?: never, df?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, lenient?: never, min_score?: never, preference?: never, project_routing?: never, routing?: never, terminate_after?: never, q?: never, query?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { index?: never, allow_no_indices?: never, analyzer?: never, analyze_wildcard?: never, default_operator?: never, df?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, lenient?: never, min_score?: never, preference?: never, routing?: never, terminate_after?: never, q?: never, query?: never } + querystring?: { [key: string]: any } & { index?: never, allow_no_indices?: never, analyzer?: never, analyze_wildcard?: never, default_operator?: never, df?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, lenient?: never, min_score?: never, preference?: never, project_routing?: never, routing?: never, terminate_after?: never, q?: never, query?: never } } export interface CountResponse { @@ -748,6 +757,15 @@ export interface FieldCapsRequest extends RequestBase { types?: string[] /** If false, empty fields are not included in the response. */ include_empty_fields?: boolean + /** Specifies a subset of projects to target for the field-caps query using project + * metadata tags in a subset of Lucene query syntax. + * Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + * Examples: + * _alias:my-project + * _alias:_origin + * _alias:*pr* + * Supported in serverless only. */ + project_routing?: ProjectRouting /** A list of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported. */ fields?: Fields /** Filter indices if the provided query rewrites to `match_none` on every shard. @@ -760,9 +778,9 @@ export interface FieldCapsRequest extends RequestBase { * These fields exist only as part of the query and take precedence over fields defined with the same name in the index mappings. */ runtime_mappings?: MappingRuntimeFields /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { index?: never, allow_no_indices?: never, expand_wildcards?: never, ignore_unavailable?: never, include_unmapped?: never, filters?: never, types?: never, include_empty_fields?: never, fields?: never, index_filter?: never, runtime_mappings?: never } + body?: string | { [key: string]: any } & { index?: never, allow_no_indices?: never, expand_wildcards?: never, ignore_unavailable?: never, include_unmapped?: never, filters?: never, types?: never, include_empty_fields?: never, project_routing?: never, fields?: never, index_filter?: never, runtime_mappings?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { index?: never, allow_no_indices?: never, expand_wildcards?: never, ignore_unavailable?: never, include_unmapped?: never, filters?: never, types?: never, include_empty_fields?: never, fields?: never, index_filter?: never, runtime_mappings?: never } + querystring?: { [key: string]: any } & { index?: never, allow_no_indices?: never, expand_wildcards?: never, ignore_unavailable?: never, include_unmapped?: never, filters?: never, types?: never, include_empty_fields?: never, project_routing?: never, fields?: never, index_filter?: never, runtime_mappings?: never } } export interface FieldCapsResponse { @@ -1305,6 +1323,7 @@ export interface MsearchMultisearchHeader { ignore_unavailable?: boolean index?: Indices preference?: string + project_routing?: ProjectRouting request_cache?: boolean routing?: Routing search_type?: SearchType @@ -1340,6 +1359,14 @@ export interface MsearchRequest extends RequestBase { max_concurrent_shard_requests?: integer /** Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint. */ pre_filter_shard_size?: long + /** Specifies a subset of projects to target for a search using project metadata + * tags in a subset Lucene syntax. Allowed Lucene queries: the _alias tag + * and a single value (possible wildcarded). Examples: + * _alias:my-project + * _alias:_origin + * _alias:*pr* + * Supported in serverless only. */ + project_routing?: ProjectRouting /** If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object. */ rest_total_hits_as_int?: boolean /** Custom routing value used to route search operations to a specific shard. */ @@ -1350,9 +1377,9 @@ export interface MsearchRequest extends RequestBase { typed_keys?: boolean searches?: MsearchRequestItem[] /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { index?: never, allow_no_indices?: never, ccs_minimize_roundtrips?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, include_named_queries_score?: never, max_concurrent_searches?: never, max_concurrent_shard_requests?: never, pre_filter_shard_size?: never, rest_total_hits_as_int?: never, routing?: never, search_type?: never, typed_keys?: never, searches?: never } + body?: string | { [key: string]: any } & { index?: never, allow_no_indices?: never, ccs_minimize_roundtrips?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, include_named_queries_score?: never, max_concurrent_searches?: never, max_concurrent_shard_requests?: never, pre_filter_shard_size?: never, project_routing?: never, rest_total_hits_as_int?: never, routing?: never, search_type?: never, typed_keys?: never, searches?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { index?: never, allow_no_indices?: never, ccs_minimize_roundtrips?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, include_named_queries_score?: never, max_concurrent_searches?: never, max_concurrent_shard_requests?: never, pre_filter_shard_size?: never, rest_total_hits_as_int?: never, routing?: never, search_type?: never, typed_keys?: never, searches?: never } + querystring?: { [key: string]: any } & { index?: never, allow_no_indices?: never, ccs_minimize_roundtrips?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, include_named_queries_score?: never, max_concurrent_searches?: never, max_concurrent_shard_requests?: never, pre_filter_shard_size?: never, project_routing?: never, rest_total_hits_as_int?: never, routing?: never, search_type?: never, typed_keys?: never, searches?: never } } export type MsearchRequestItem = MsearchMultisearchHeader | SearchSearchRequestBody @@ -1370,6 +1397,15 @@ export interface MsearchTemplateRequest extends RequestBase { ccs_minimize_roundtrips?: boolean /** The maximum number of concurrent searches the API can run. */ max_concurrent_searches?: long + /** Specifies a subset of projects to target for the search using project + * metadata tags in a subset of Lucene query syntax. + * Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + * Examples: + * _alias:my-project + * _alias:_origin + * _alias:*pr* + * Supported in serverless only. */ + project_routing?: ProjectRouting /** The type of the search operation. */ search_type?: SearchType /** If `true`, the response returns `hits.total` as an integer. @@ -1379,9 +1415,9 @@ export interface MsearchTemplateRequest extends RequestBase { typed_keys?: boolean search_templates?: MsearchTemplateRequestItem[] /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { index?: never, ccs_minimize_roundtrips?: never, max_concurrent_searches?: never, search_type?: never, rest_total_hits_as_int?: never, typed_keys?: never, search_templates?: never } + body?: string | { [key: string]: any } & { index?: never, ccs_minimize_roundtrips?: never, max_concurrent_searches?: never, project_routing?: never, search_type?: never, rest_total_hits_as_int?: never, typed_keys?: never, search_templates?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { index?: never, ccs_minimize_roundtrips?: never, max_concurrent_searches?: never, search_type?: never, rest_total_hits_as_int?: never, typed_keys?: never, search_templates?: never } + querystring?: { [key: string]: any } & { index?: never, ccs_minimize_roundtrips?: never, max_concurrent_searches?: never, project_routing?: never, search_type?: never, rest_total_hits_as_int?: never, typed_keys?: never, search_templates?: never } } export type MsearchTemplateRequestItem = MsearchMultisearchHeader | MsearchTemplateTemplateConfig @@ -1497,6 +1533,15 @@ export interface OpenPointInTimeRequest extends RequestBase { /** The node or shard the operation should be performed on. * By default, it is random. */ preference?: string + /** Specifies a subset of projects to target for the PIT request using project + * metadata tags in a subset of Lucene query syntax. + * Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + * Examples: + * _alias:my-project + * _alias:_origin + * _alias:*pr* + * Supported in serverless only. */ + project_routing?: ProjectRouting /** A custom value that is used to route operations to a specific shard. */ routing?: Routing /** The type of index that wildcard patterns can match. @@ -1512,9 +1557,9 @@ export interface OpenPointInTimeRequest extends RequestBase { /** Filter indices if the provided query rewrites to `match_none` on every shard. */ index_filter?: QueryDslQueryContainer /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { index?: never, keep_alive?: never, ignore_unavailable?: never, preference?: never, routing?: never, expand_wildcards?: never, allow_partial_search_results?: never, max_concurrent_shard_requests?: never, index_filter?: never } + body?: string | { [key: string]: any } & { index?: never, keep_alive?: never, ignore_unavailable?: never, preference?: never, project_routing?: never, routing?: never, expand_wildcards?: never, allow_partial_search_results?: never, max_concurrent_shard_requests?: never, index_filter?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { index?: never, keep_alive?: never, ignore_unavailable?: never, preference?: never, routing?: never, expand_wildcards?: never, allow_partial_search_results?: never, max_concurrent_shard_requests?: never, index_filter?: never } + querystring?: { [key: string]: any } & { index?: never, keep_alive?: never, ignore_unavailable?: never, preference?: never, project_routing?: never, routing?: never, expand_wildcards?: never, allow_partial_search_results?: never, max_concurrent_shard_requests?: never, index_filter?: never } } export interface OpenPointInTimeResponse { @@ -2038,6 +2083,15 @@ export interface SearchRequest extends RequestBase { * * The request targets one or more read-only index. * * The primary sort of the query targets an indexed field. */ pre_filter_shard_size?: long + /** Specifies a subset of projects to target for the search using project + * metadata tags in a subset of Lucene query syntax. + * Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + * Examples: + * _alias:my-project + * _alias:_origin + * _alias:*pr* + * Supported in serverless only. */ + project_routing?: ProjectRouting /** If `true`, the caching of search results is enabled for requests where `size` is `0`. * It defaults to index level settings. */ request_cache?: boolean @@ -2195,9 +2249,9 @@ export interface SearchRequest extends RequestBase { * You can retrieve these stats using the indices stats API. */ stats?: string[] /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { index?: never, allow_no_indices?: never, allow_partial_search_results?: never, analyzer?: never, analyze_wildcard?: never, batched_reduce_size?: never, ccs_minimize_roundtrips?: never, default_operator?: never, df?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, include_named_queries_score?: never, lenient?: never, max_concurrent_shard_requests?: never, preference?: never, pre_filter_shard_size?: never, request_cache?: never, routing?: never, scroll?: never, search_type?: never, suggest_field?: never, suggest_mode?: never, suggest_size?: never, suggest_text?: never, typed_keys?: never, rest_total_hits_as_int?: never, _source_excludes?: never, _source_exclude_vectors?: never, _source_includes?: never, q?: never, force_synthetic_source?: never, aggregations?: never, aggs?: never, collapse?: never, explain?: never, ext?: never, from?: never, highlight?: never, track_total_hits?: never, indices_boost?: never, docvalue_fields?: never, knn?: never, rank?: never, min_score?: never, post_filter?: never, profile?: never, query?: never, rescore?: never, retriever?: never, script_fields?: never, search_after?: never, size?: never, slice?: never, sort?: never, _source?: never, fields?: never, suggest?: never, terminate_after?: never, timeout?: never, track_scores?: never, version?: never, seq_no_primary_term?: never, stored_fields?: never, pit?: never, runtime_mappings?: never, stats?: never } + body?: string | { [key: string]: any } & { index?: never, allow_no_indices?: never, allow_partial_search_results?: never, analyzer?: never, analyze_wildcard?: never, batched_reduce_size?: never, ccs_minimize_roundtrips?: never, default_operator?: never, df?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, include_named_queries_score?: never, lenient?: never, max_concurrent_shard_requests?: never, preference?: never, pre_filter_shard_size?: never, project_routing?: never, request_cache?: never, routing?: never, scroll?: never, search_type?: never, suggest_field?: never, suggest_mode?: never, suggest_size?: never, suggest_text?: never, typed_keys?: never, rest_total_hits_as_int?: never, _source_excludes?: never, _source_exclude_vectors?: never, _source_includes?: never, q?: never, force_synthetic_source?: never, aggregations?: never, aggs?: never, collapse?: never, explain?: never, ext?: never, from?: never, highlight?: never, track_total_hits?: never, indices_boost?: never, docvalue_fields?: never, knn?: never, rank?: never, min_score?: never, post_filter?: never, profile?: never, query?: never, rescore?: never, retriever?: never, script_fields?: never, search_after?: never, size?: never, slice?: never, sort?: never, _source?: never, fields?: never, suggest?: never, terminate_after?: never, timeout?: never, track_scores?: never, version?: never, seq_no_primary_term?: never, stored_fields?: never, pit?: never, runtime_mappings?: never, stats?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { index?: never, allow_no_indices?: never, allow_partial_search_results?: never, analyzer?: never, analyze_wildcard?: never, batched_reduce_size?: never, ccs_minimize_roundtrips?: never, default_operator?: never, df?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, include_named_queries_score?: never, lenient?: never, max_concurrent_shard_requests?: never, preference?: never, pre_filter_shard_size?: never, request_cache?: never, routing?: never, scroll?: never, search_type?: never, suggest_field?: never, suggest_mode?: never, suggest_size?: never, suggest_text?: never, typed_keys?: never, rest_total_hits_as_int?: never, _source_excludes?: never, _source_exclude_vectors?: never, _source_includes?: never, q?: never, force_synthetic_source?: never, aggregations?: never, aggs?: never, collapse?: never, explain?: never, ext?: never, from?: never, highlight?: never, track_total_hits?: never, indices_boost?: never, docvalue_fields?: never, knn?: never, rank?: never, min_score?: never, post_filter?: never, profile?: never, query?: never, rescore?: never, retriever?: never, script_fields?: never, search_after?: never, size?: never, slice?: never, sort?: never, _source?: never, fields?: never, suggest?: never, terminate_after?: never, timeout?: never, track_scores?: never, version?: never, seq_no_primary_term?: never, stored_fields?: never, pit?: never, runtime_mappings?: never, stats?: never } + querystring?: { [key: string]: any } & { index?: never, allow_no_indices?: never, allow_partial_search_results?: never, analyzer?: never, analyze_wildcard?: never, batched_reduce_size?: never, ccs_minimize_roundtrips?: never, default_operator?: never, df?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, include_named_queries_score?: never, lenient?: never, max_concurrent_shard_requests?: never, preference?: never, pre_filter_shard_size?: never, project_routing?: never, request_cache?: never, routing?: never, scroll?: never, search_type?: never, suggest_field?: never, suggest_mode?: never, suggest_size?: never, suggest_text?: never, typed_keys?: never, rest_total_hits_as_int?: never, _source_excludes?: never, _source_exclude_vectors?: never, _source_includes?: never, q?: never, force_synthetic_source?: never, aggregations?: never, aggs?: never, collapse?: never, explain?: never, ext?: never, from?: never, highlight?: never, track_total_hits?: never, indices_boost?: never, docvalue_fields?: never, knn?: never, rank?: never, min_score?: never, post_filter?: never, profile?: never, query?: never, rescore?: never, retriever?: never, script_fields?: never, search_after?: never, size?: never, slice?: never, sort?: never, _source?: never, fields?: never, suggest?: never, terminate_after?: never, timeout?: never, track_scores?: never, version?: never, seq_no_primary_term?: never, stored_fields?: never, pit?: never, runtime_mappings?: never, stats?: never } } export type SearchResponse> = SearchResponseBody @@ -2804,6 +2858,7 @@ export interface SearchRescore { window_size?: integer query?: SearchRescoreQuery learning_to_rank?: SearchLearningToRank + script?: SearchScriptRescore } export interface SearchRescoreQuery { @@ -2820,6 +2875,10 @@ export interface SearchRescoreQuery { export type SearchScoreMode = 'avg' | 'max' | 'min' | 'multiply' | 'total' +export interface SearchScriptRescore { + script: Script | ScriptSource +} + export interface SearchSearchProfile { collector: SearchCollector[] query: SearchQueryProfile[] @@ -3097,6 +3156,15 @@ export interface SearchMvtRequest extends RequestBase { x: SearchMvtCoordinate /** Y coordinate for the vector tile to search */ y: SearchMvtCoordinate + /** Specifies a subset of projects to target for the search using project + * metadata tags in a subset of Lucene query syntax. + * Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + * Examples: + * _alias:my-project + * _alias:_origin + * _alias:*pr* + * Supported in serverless only. */ + project_routing?: ProjectRouting /** Sub-aggregations for the geotile_grid. * * It supports the following aggregation types: @@ -3171,9 +3239,9 @@ export interface SearchMvtRequest extends RequestBase { * In addition, the new features will be distinguishable using the tag `_mvt_label_position`. */ with_labels?: boolean /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { index?: never, field?: never, zoom?: never, x?: never, y?: never, aggs?: never, buffer?: never, exact_bounds?: never, extent?: never, fields?: never, grid_agg?: never, grid_precision?: never, grid_type?: never, query?: never, runtime_mappings?: never, size?: never, sort?: never, track_total_hits?: never, with_labels?: never } + body?: string | { [key: string]: any } & { index?: never, field?: never, zoom?: never, x?: never, y?: never, project_routing?: never, aggs?: never, buffer?: never, exact_bounds?: never, extent?: never, fields?: never, grid_agg?: never, grid_precision?: never, grid_type?: never, query?: never, runtime_mappings?: never, size?: never, sort?: never, track_total_hits?: never, with_labels?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { index?: never, field?: never, zoom?: never, x?: never, y?: never, aggs?: never, buffer?: never, exact_bounds?: never, extent?: never, fields?: never, grid_agg?: never, grid_precision?: never, grid_type?: never, query?: never, runtime_mappings?: never, size?: never, sort?: never, track_total_hits?: never, with_labels?: never } + querystring?: { [key: string]: any } & { index?: never, field?: never, zoom?: never, x?: never, y?: never, project_routing?: never, aggs?: never, buffer?: never, exact_bounds?: never, extent?: never, fields?: never, grid_agg?: never, grid_precision?: never, grid_type?: never, query?: never, runtime_mappings?: never, size?: never, sort?: never, track_total_hits?: never, with_labels?: never } } export type SearchMvtResponse = MapboxVectorTiles @@ -3266,6 +3334,15 @@ export interface SearchTemplateRequest extends RequestBase { /** The node or shard the operation should be performed on. * It is random by default. */ preference?: string + /** Specifies a subset of projects to target for the search using project + * metadata tags in a subset of Lucene query syntax. + * Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + * Examples: + * _alias:my-project + * _alias:_origin + * _alias:*pr* + * Supported in serverless only. */ + project_routing?: ProjectRouting /** A custom value used to route operations to a specific shard. */ routing?: Routing /** Specifies how long a consistent view of the index @@ -3295,9 +3372,9 @@ export interface SearchTemplateRequest extends RequestBase { * parameter is required. */ source?: ScriptSource /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { index?: never, allow_no_indices?: never, ccs_minimize_roundtrips?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, preference?: never, routing?: never, scroll?: never, search_type?: never, rest_total_hits_as_int?: never, typed_keys?: never, explain?: never, id?: never, params?: never, profile?: never, source?: never } + body?: string | { [key: string]: any } & { index?: never, allow_no_indices?: never, ccs_minimize_roundtrips?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, preference?: never, project_routing?: never, routing?: never, scroll?: never, search_type?: never, rest_total_hits_as_int?: never, typed_keys?: never, explain?: never, id?: never, params?: never, profile?: never, source?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { index?: never, allow_no_indices?: never, ccs_minimize_roundtrips?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, preference?: never, routing?: never, scroll?: never, search_type?: never, rest_total_hits_as_int?: never, typed_keys?: never, explain?: never, id?: never, params?: never, profile?: never, source?: never } + querystring?: { [key: string]: any } & { index?: never, allow_no_indices?: never, ccs_minimize_roundtrips?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, preference?: never, project_routing?: never, routing?: never, scroll?: never, search_type?: never, rest_total_hits_as_int?: never, typed_keys?: never, explain?: never, id?: never, params?: never, profile?: never, source?: never } } export interface SearchTemplateResponse { @@ -3748,6 +3825,13 @@ export type Bytes = 'b' | 'kb' | 'mb' | 'gb' | 'tb' | 'pb' export type CategoryId = string +export interface ChunkRescorer { + /** The number of chunks per document to evaluate for reranking. */ + size?: integer + /** Chunking settings to apply */ + chunking_settings?: MappingChunkRescorerChunkingSettings +} + export type ClusterAlias = string export interface ClusterDetails { @@ -4289,6 +4373,8 @@ export interface PluginStats { licensed: boolean } +export type ProjectRouting = string + export type PropertyName = string export interface QueryCacheStats { @@ -4706,10 +4792,13 @@ export interface TextSimilarityReranker extends RetrieverBase { rank_window_size?: integer /** Unique identifier of the inference endpoint created using the inference API. */ inference_id?: string - /** The text snippet used as the basis for similarity comparison */ + /** The text snippet used as the basis for similarity comparison. */ inference_text: string - /** The document field to be used for text similarity comparisons. This field should contain the text that will be evaluated against the inference_text */ + /** The document field to be used for text similarity comparisons. This field should contain the text that will be evaluated against the inference_text. */ field: string + /** Whether to rescore on only the best matching chunks. + * @beta */ + chunk_rescorer?: ChunkRescorer } export type ThreadType = 'cpu' | 'wait' | 'block' | 'gpu' | 'mem' @@ -4808,6 +4897,8 @@ export interface WriteResponseBase { _shards: ShardStatistics /** The document version, which is incremented each time the document is updated. */ _version: VersionNumber + /** The role of the failure store in this document response */ + failure_store?: BulkFailureStoreStatus forced_refresh?: boolean } @@ -5288,7 +5379,7 @@ export interface AggregationsCompositeAggregation extends AggregationsBucketAggr size?: integer /** The value sources used to build composite buckets. * Keys are returned in the order of the `sources` definition. */ - sources?: Record[] + sources?: Partial>[] } export interface AggregationsCompositeAggregationBase { @@ -6111,6 +6202,14 @@ export interface AggregationsNormalizeAggregation extends AggregationsPipelineAg export type AggregationsNormalizeMethod = 'rescale_0_1' | 'rescale_0_100' | 'percent_of_sum' | 'mean' | 'z-score' | 'softmax' +export interface AggregationsPValueHeuristic { + background_is_superset?: boolean + /** Should the results be normalized when above the given value. + * Allows for consistent significance results at various scales. + * Note: `0` is a special value which means no normalization */ + normalize_above?: long +} + export interface AggregationsParentAggregateKeys extends AggregationsSingleBucketAggregateBase { } export type AggregationsParentAggregate = AggregationsParentAggregateKeys @@ -6348,6 +6447,14 @@ export interface AggregationsSignificantTermsAggregation extends AggregationsBuc percentage?: AggregationsPercentageScoreHeuristic /** Customized score, implemented via a script. */ script_heuristic?: AggregationsScriptedHeuristic + /** Significant terms heuristic that calculates the p-value between the term existing in foreground and background sets. + * + * The p-value is the probability of obtaining test results at least as extreme as + * the results actually observed, under the assumption that the null hypothesis is + * correct. The p-value is calculated assuming that the foreground set and the + * background set are independent https://en.wikipedia.org/wiki/Bernoulli_trial, with the null + * hypothesis that the probabilities are the same. */ + p_value?: AggregationsPValueHeuristic /** Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`. * Terms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`. */ shard_min_doc_count?: long @@ -7947,6 +8054,47 @@ export interface MappingByteNumberProperty extends MappingNumberPropertyBase { null_value?: byte } +export interface MappingChunkRescorerChunkingSettings { + /** The chunking strategy: `sentence`, `word`, `none` or `recursive`. + * + * * If `strategy` is set to `recursive`, you must also specify: + * + * - `max_chunk_size` + * - either `separators` or`separator_group` + * + * Learn more about different chunking strategies in the linked documentation. */ + strategy?: string + /** Only applicable to the `recursive` strategy and required when using it. + * + * Sets a predefined list of separators in the saved chunking settings based on the selected text type. + * Values can be `markdown` or `plaintext`. + * + * Using this parameter is an alternative to manually specifying a custom `separators` list. */ + separator_group?: string + /** Only applicable to the `recursive` strategy and required when using it. + * + * A list of strings used as possible split points when chunking text. + * + * Each string can be a plain string or a regular expression (regex) pattern. + * The system tries each separator in order to split the text, starting from the first item in the list. + * + * After splitting, it attempts to recombine smaller pieces into larger chunks that stay within + * the `max_chunk_size` limit, to reduce the total number of chunks generated. */ + separators?: string[] + /** The maximum size of a chunk in words. + * This value cannot be lower than `20` (for `sentence` strategy) or `10` (for `word` strategy). + * This value should not exceed the window size for the associated model. */ + max_chunk_size: integer + /** The number of overlapping words for chunks. + * It is applicable only to a `word` chunking strategy. + * This value cannot be higher than half the `max_chunk_size` value. */ + overlap?: integer + /** The number of overlapping sentences for chunks. + * It is applicable only for a `sentence` chunking strategy. + * It can be either `1` or `0`. */ + sentence_overlap?: integer +} + export interface MappingChunkingSettings { /** The chunking strategy: `sentence`, `word`, `none` or `recursive`. * @@ -8513,6 +8661,9 @@ export interface MappingSemanticTextProperty { * chunking settings sent in the inference endpoint associated with inference_id. If chunking settings are updated, * they will not be applied to existing documents until they are reindexed. */ chunking_settings?: MappingChunkingSettings + /** Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one + * field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers. */ + fields?: Record } export interface MappingShapeProperty extends MappingDocValuesPropertyBase { @@ -10115,6 +10266,15 @@ export interface AsyncSearchSubmitRequest extends RequestBase { max_concurrent_shard_requests?: integer /** Specify the node or shard the operation should be performed on (default: random) */ preference?: string + /** Specifies a subset of projects to target for the search using project + * metadata tags in a subset of Lucene query syntax. + * Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + * Examples: + * _alias:my-project + * _alias:_origin + * _alias:*pr* + * Supported in serverless only. */ + project_routing?: ProjectRouting /** Specify if request cache should be used for this request or not, defaults to true */ request_cache?: boolean /** A comma-separated list of specific routing values */ @@ -10219,9 +10379,9 @@ export interface AsyncSearchSubmitRequest extends RequestBase { * the indices stats API. */ stats?: string[] /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { index?: never, wait_for_completion_timeout?: never, keep_alive?: never, keep_on_completion?: never, allow_no_indices?: never, allow_partial_search_results?: never, analyzer?: never, analyze_wildcard?: never, batched_reduce_size?: never, ccs_minimize_roundtrips?: never, default_operator?: never, df?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, lenient?: never, max_concurrent_shard_requests?: never, preference?: never, request_cache?: never, routing?: never, search_type?: never, suggest_field?: never, suggest_mode?: never, suggest_size?: never, suggest_text?: never, typed_keys?: never, rest_total_hits_as_int?: never, _source_excludes?: never, _source_includes?: never, q?: never, aggregations?: never, aggs?: never, collapse?: never, explain?: never, ext?: never, from?: never, highlight?: never, track_total_hits?: never, indices_boost?: never, docvalue_fields?: never, knn?: never, min_score?: never, post_filter?: never, profile?: never, query?: never, rescore?: never, script_fields?: never, search_after?: never, size?: never, slice?: never, sort?: never, _source?: never, fields?: never, suggest?: never, terminate_after?: never, timeout?: never, track_scores?: never, version?: never, seq_no_primary_term?: never, stored_fields?: never, pit?: never, runtime_mappings?: never, stats?: never } + body?: string | { [key: string]: any } & { index?: never, wait_for_completion_timeout?: never, keep_alive?: never, keep_on_completion?: never, allow_no_indices?: never, allow_partial_search_results?: never, analyzer?: never, analyze_wildcard?: never, batched_reduce_size?: never, ccs_minimize_roundtrips?: never, default_operator?: never, df?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, lenient?: never, max_concurrent_shard_requests?: never, preference?: never, project_routing?: never, request_cache?: never, routing?: never, search_type?: never, suggest_field?: never, suggest_mode?: never, suggest_size?: never, suggest_text?: never, typed_keys?: never, rest_total_hits_as_int?: never, _source_excludes?: never, _source_includes?: never, q?: never, aggregations?: never, aggs?: never, collapse?: never, explain?: never, ext?: never, from?: never, highlight?: never, track_total_hits?: never, indices_boost?: never, docvalue_fields?: never, knn?: never, min_score?: never, post_filter?: never, profile?: never, query?: never, rescore?: never, script_fields?: never, search_after?: never, size?: never, slice?: never, sort?: never, _source?: never, fields?: never, suggest?: never, terminate_after?: never, timeout?: never, track_scores?: never, version?: never, seq_no_primary_term?: never, stored_fields?: never, pit?: never, runtime_mappings?: never, stats?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { index?: never, wait_for_completion_timeout?: never, keep_alive?: never, keep_on_completion?: never, allow_no_indices?: never, allow_partial_search_results?: never, analyzer?: never, analyze_wildcard?: never, batched_reduce_size?: never, ccs_minimize_roundtrips?: never, default_operator?: never, df?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, lenient?: never, max_concurrent_shard_requests?: never, preference?: never, request_cache?: never, routing?: never, search_type?: never, suggest_field?: never, suggest_mode?: never, suggest_size?: never, suggest_text?: never, typed_keys?: never, rest_total_hits_as_int?: never, _source_excludes?: never, _source_includes?: never, q?: never, aggregations?: never, aggs?: never, collapse?: never, explain?: never, ext?: never, from?: never, highlight?: never, track_total_hits?: never, indices_boost?: never, docvalue_fields?: never, knn?: never, min_score?: never, post_filter?: never, profile?: never, query?: never, rescore?: never, script_fields?: never, search_after?: never, size?: never, slice?: never, sort?: never, _source?: never, fields?: never, suggest?: never, terminate_after?: never, timeout?: never, track_scores?: never, version?: never, seq_no_primary_term?: never, stored_fields?: never, pit?: never, runtime_mappings?: never, stats?: never } + querystring?: { [key: string]: any } & { index?: never, wait_for_completion_timeout?: never, keep_alive?: never, keep_on_completion?: never, allow_no_indices?: never, allow_partial_search_results?: never, analyzer?: never, analyze_wildcard?: never, batched_reduce_size?: never, ccs_minimize_roundtrips?: never, default_operator?: never, df?: never, expand_wildcards?: never, ignore_throttled?: never, ignore_unavailable?: never, lenient?: never, max_concurrent_shard_requests?: never, preference?: never, project_routing?: never, request_cache?: never, routing?: never, search_type?: never, suggest_field?: never, suggest_mode?: never, suggest_size?: never, suggest_text?: never, typed_keys?: never, rest_total_hits_as_int?: never, _source_excludes?: never, _source_includes?: never, q?: never, aggregations?: never, aggs?: never, collapse?: never, explain?: never, ext?: never, from?: never, highlight?: never, track_total_hits?: never, indices_boost?: never, docvalue_fields?: never, knn?: never, min_score?: never, post_filter?: never, profile?: never, query?: never, rescore?: never, script_fields?: never, search_after?: never, size?: never, slice?: never, sort?: never, _source?: never, fields?: never, suggest?: never, terminate_after?: never, timeout?: never, track_scores?: never, version?: never, seq_no_primary_term?: never, stored_fields?: never, pit?: never, runtime_mappings?: never, stats?: never } } export type AsyncSearchSubmitResponse> = AsyncSearchAsyncSearchDocumentResponseBase @@ -10602,8 +10762,6 @@ export interface CatAllocationAllocationRecord { export interface CatAllocationRequest extends CatCatRequestBase { /** A comma-separated list of node identifiers or names used to limit the returned information. */ node_id?: NodeIds - /** The unit used to display byte values. */ - bytes?: Bytes /** A comma-separated list of columns names to display. It supports simple wildcards. */ h?: CatCatAllocationColumns /** List of columns that determine how the table should be sorted. @@ -10618,9 +10776,9 @@ export interface CatAllocationRequest extends CatCatRequestBase { /** Period to wait for a connection to the master node. */ master_timeout?: Duration /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { node_id?: never, bytes?: never, h?: never, s?: never, local?: never, master_timeout?: never } + body?: string | { [key: string]: any } & { node_id?: never, h?: never, s?: never, local?: never, master_timeout?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { node_id?: never, bytes?: never, h?: never, s?: never, local?: never, master_timeout?: never } + querystring?: { [key: string]: any } & { node_id?: never, h?: never, s?: never, local?: never, master_timeout?: never } } export type CatAllocationResponse = CatAllocationAllocationRecord[] @@ -10701,14 +10859,23 @@ export interface CatCountRequest extends CatCatRequestBase { index?: Indices /** A comma-separated list of columns names to display. It supports simple wildcards. */ h?: CatCatCountColumns + /** Specifies a subset of projects to target for the search using project + * metadata tags in a subset of Lucene query syntax. + * Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + * Examples: + * _alias:my-project + * _alias:_origin + * _alias:*pr* + * Supported in serverless only. */ + project_routing?: ProjectRouting /** List of columns that determine how the table should be sorted. * Sorting defaults to ascending and can be changed by setting `:asc` * or `:desc` as a suffix to the column name. */ s?: Names /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { index?: never, h?: never, s?: never } + body?: string | { [key: string]: any } & { index?: never, h?: never, project_routing?: never, s?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { index?: never, h?: never, s?: never } + querystring?: { [key: string]: any } & { index?: never, h?: never, project_routing?: never, s?: never } } export type CatCountResponse = CatCountCountRecord[] @@ -10741,8 +10908,6 @@ export interface CatFielddataRequest extends CatCatRequestBase { /** Comma-separated list of fields used to limit returned information. * To retrieve all fields, omit this parameter. */ fields?: Fields - /** The unit used to display byte values. */ - bytes?: Bytes /** A comma-separated list of columns names to display. It supports simple wildcards. */ h?: CatCatFieldDataColumns /** List of columns that determine how the table should be sorted. @@ -10750,9 +10915,9 @@ export interface CatFielddataRequest extends CatCatRequestBase { * or `:desc` as a suffix to the column name. */ s?: Names /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { fields?: never, bytes?: never, h?: never, s?: never } + body?: string | { [key: string]: any } & { fields?: never, h?: never, s?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { fields?: never, bytes?: never, h?: never, s?: never } + querystring?: { [key: string]: any } & { fields?: never, h?: never, s?: never } } export type CatFielddataResponse = CatFielddataFielddataRecord[] @@ -10896,8 +11061,6 @@ export interface CatHealthHealthRecord { } export interface CatHealthRequest extends CatCatRequestBase { - /** The unit used to display time values. */ - time?: TimeUnit /** If true, returns `HH:MM:SS` and Unix epoch timestamps. */ ts?: boolean /** A comma-separated list of columns names to display. It supports simple wildcards. */ @@ -10907,9 +11070,9 @@ export interface CatHealthRequest extends CatCatRequestBase { * or `:desc` as a suffix to the column name. */ s?: Names /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { time?: never, ts?: never, h?: never, s?: never } + body?: string | { [key: string]: any } & { ts?: never, h?: never, s?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { time?: never, ts?: never, h?: never, s?: never } + querystring?: { [key: string]: any } & { ts?: never, h?: never, s?: never } } export type CatHealthResponse = CatHealthHealthRecord[] @@ -11653,8 +11816,6 @@ export interface CatIndicesRequest extends CatCatRequestBase { /** Comma-separated list of data streams, indices, and aliases used to limit the request. * Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. */ index?: Indices - /** The unit used to display byte values. */ - bytes?: Bytes /** The type of index that wildcard patterns can match. */ expand_wildcards?: ExpandWildcards /** The health status used to limit returned indices. By default, the response includes indices of any health status. */ @@ -11663,8 +11824,6 @@ export interface CatIndicesRequest extends CatCatRequestBase { include_unloaded_segments?: boolean /** If true, the response only includes information from primary shards. */ pri?: boolean - /** The unit used to display time values. */ - time?: TimeUnit /** Period to wait for a connection to the master node. */ master_timeout?: Duration /** A comma-separated list of columns names to display. It supports simple wildcards. */ @@ -11674,9 +11833,9 @@ export interface CatIndicesRequest extends CatCatRequestBase { * or `:desc` as a suffix to the column name. */ s?: Names /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { index?: never, bytes?: never, expand_wildcards?: never, health?: never, include_unloaded_segments?: never, pri?: never, time?: never, master_timeout?: never, h?: never, s?: never } + body?: string | { [key: string]: any } & { index?: never, expand_wildcards?: never, health?: never, include_unloaded_segments?: never, pri?: never, master_timeout?: never, h?: never, s?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { index?: never, bytes?: never, expand_wildcards?: never, health?: never, include_unloaded_segments?: never, pri?: never, time?: never, master_timeout?: never, h?: never, s?: never } + querystring?: { [key: string]: any } & { index?: never, expand_wildcards?: never, health?: never, include_unloaded_segments?: never, pri?: never, master_timeout?: never, h?: never, s?: never } } export type CatIndicesResponse = CatIndicesIndicesRecord[] @@ -11835,19 +11994,15 @@ export interface CatMlDataFrameAnalyticsRequest extends CatCatRequestBase { id?: Id /** Whether to ignore if a wildcard expression matches no configs. (This includes `_all` string or when no configs have been specified) */ allow_no_match?: boolean - /** The unit in which to display byte values */ - bytes?: Bytes /** Comma-separated list of column names to display. */ h?: CatCatDfaColumns /** Comma-separated list of column names or column aliases used to sort the * response. */ s?: CatCatDfaColumns - /** Unit used to display time values. */ - time?: TimeUnit /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { id?: never, allow_no_match?: never, bytes?: never, h?: never, s?: never, time?: never } + body?: string | { [key: string]: any } & { id?: never, allow_no_match?: never, h?: never, s?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { id?: never, allow_no_match?: never, bytes?: never, h?: never, s?: never, time?: never } + querystring?: { [key: string]: any } & { id?: never, allow_no_match?: never, h?: never, s?: never } } export type CatMlDataFrameAnalyticsResponse = CatMlDataFrameAnalyticsDataFrameAnalyticsRecord[] @@ -11968,12 +12123,10 @@ export interface CatMlDatafeedsRequest extends CatCatRequestBase { h?: CatCatDatafeedColumns /** Comma-separated list of column names or column aliases used to sort the response. */ s?: CatCatDatafeedColumns - /** The unit used to display time values. */ - time?: TimeUnit /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { datafeed_id?: never, allow_no_match?: never, h?: never, s?: never, time?: never } + body?: string | { [key: string]: any } & { datafeed_id?: never, allow_no_match?: never, h?: never, s?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { datafeed_id?: never, allow_no_match?: never, h?: never, s?: never, time?: never } + querystring?: { [key: string]: any } & { datafeed_id?: never, allow_no_match?: never, h?: never, s?: never } } export type CatMlDatafeedsResponse = CatMlDatafeedsDatafeedsRecord[] @@ -12525,18 +12678,14 @@ export interface CatMlJobsRequest extends CatCatRequestBase { * are partial matches. If `false`, the API returns a 404 status code when there are no matches or only partial * matches. */ allow_no_match?: boolean - /** The unit used to display byte values. */ - bytes?: Bytes /** Comma-separated list of column names to display. */ h?: CatCatAnomalyDetectorColumns /** Comma-separated list of column names or column aliases used to sort the response. */ s?: CatCatAnomalyDetectorColumns - /** The unit used to display time values. */ - time?: TimeUnit /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { job_id?: never, allow_no_match?: never, bytes?: never, h?: never, s?: never, time?: never } + body?: string | { [key: string]: any } & { job_id?: never, allow_no_match?: never, h?: never, s?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { job_id?: never, allow_no_match?: never, bytes?: never, h?: never, s?: never, time?: never } + querystring?: { [key: string]: any } & { job_id?: never, allow_no_match?: never, h?: never, s?: never } } export type CatMlJobsResponse = CatMlJobsJobsRecord[] @@ -12548,8 +12697,6 @@ export interface CatMlTrainedModelsRequest extends CatCatRequestBase { * If `true`, the API returns an empty array when there are no matches and the subset of results when there are partial matches. * If `false`, the API returns a 404 status code when there are no matches or only partial matches. */ allow_no_match?: boolean - /** The unit used to display byte values. */ - bytes?: Bytes /** A comma-separated list of column names to display. */ h?: CatCatTrainedModelsColumns /** A comma-separated list of column names or aliases used to sort the response. */ @@ -12558,12 +12705,10 @@ export interface CatMlTrainedModelsRequest extends CatCatRequestBase { from?: integer /** The maximum number of transforms to display. */ size?: integer - /** Unit used to display time values. */ - time?: TimeUnit /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { model_id?: never, allow_no_match?: never, bytes?: never, h?: never, s?: never, from?: never, size?: never, time?: never } + body?: string | { [key: string]: any } & { model_id?: never, allow_no_match?: never, h?: never, s?: never, from?: never, size?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { model_id?: never, allow_no_match?: never, bytes?: never, h?: never, s?: never, from?: never, size?: never, time?: never } + querystring?: { [key: string]: any } & { model_id?: never, allow_no_match?: never, h?: never, s?: never, from?: never, size?: never } } export type CatMlTrainedModelsResponse = CatMlTrainedModelsTrainedModelsRecord[] @@ -13458,10 +13603,8 @@ export interface CatNodesNodesRecord { } export interface CatNodesRequest extends CatCatRequestBase { - /** The unit used to display byte values. */ - bytes?: Bytes /** If `true`, return the full node ID. If `false`, return the shortened node ID. */ - full_id?: boolean | string + full_id?: boolean /** If true, the response includes information from segments that are not loaded into memory. */ include_unloaded_segments?: boolean /** A comma-separated list of columns names to display. @@ -13473,12 +13616,10 @@ export interface CatNodesRequest extends CatCatRequestBase { s?: Names /** The period to wait for a connection to the master node. */ master_timeout?: Duration - /** The unit used to display time values. */ - time?: TimeUnit /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { bytes?: never, full_id?: never, include_unloaded_segments?: never, h?: never, s?: never, master_timeout?: never, time?: never } + body?: string | { [key: string]: any } & { full_id?: never, include_unloaded_segments?: never, h?: never, s?: never, master_timeout?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { bytes?: never, full_id?: never, include_unloaded_segments?: never, h?: never, s?: never, master_timeout?: never, time?: never } + querystring?: { [key: string]: any } & { full_id?: never, include_unloaded_segments?: never, h?: never, s?: never, master_timeout?: never } } export type CatNodesResponse = CatNodesNodesRecord[] @@ -13520,12 +13661,10 @@ export interface CatPendingTasksRequest extends CatCatRequestBase { local?: boolean /** Period to wait for a connection to the master node. */ master_timeout?: Duration - /** Unit used to display time values. */ - time?: TimeUnit /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { h?: never, s?: never, local?: never, master_timeout?: never, time?: never } + body?: string | { [key: string]: any } & { h?: never, s?: never, local?: never, master_timeout?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { h?: never, s?: never, local?: never, master_timeout?: never, time?: never } + querystring?: { [key: string]: any } & { h?: never, s?: never, local?: never, master_timeout?: never } } export type CatPendingTasksResponse = CatPendingTasksPendingTasksRecord[] @@ -13732,8 +13871,6 @@ export interface CatRecoveryRequest extends CatCatRequestBase { index?: Indices /** If `true`, the response only includes ongoing shard recoveries. */ active_only?: boolean - /** The unit used to display byte values. */ - bytes?: Bytes /** If `true`, the response includes detailed information about shard recoveries. */ detailed?: boolean /** A comma-separated list of columns names to display. @@ -13743,12 +13880,10 @@ export interface CatRecoveryRequest extends CatCatRequestBase { * Sorting defaults to ascending and can be changed by setting `:asc` * or `:desc` as a suffix to the column name. */ s?: Names - /** The unit used to display time values. */ - time?: TimeUnit /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { index?: never, active_only?: never, bytes?: never, detailed?: never, h?: never, s?: never, time?: never } + body?: string | { [key: string]: any } & { index?: never, active_only?: never, detailed?: never, h?: never, s?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { index?: never, active_only?: never, bytes?: never, detailed?: never, h?: never, s?: never, time?: never } + querystring?: { [key: string]: any } & { index?: never, active_only?: never, detailed?: never, h?: never, s?: never } } export type CatRecoveryResponse = CatRecoveryRecoveryRecord[] @@ -13793,8 +13928,6 @@ export interface CatSegmentsRequest extends CatCatRequestBase { * Supports wildcards (`*`). * To target all data streams and indices, omit this parameter or use `*` or `_all`. */ index?: Indices - /** The unit used to display byte values. */ - bytes?: Bytes /** A comma-separated list of columns names to display. * It supports simple wildcards. */ h?: CatCatSegmentsColumns @@ -13810,9 +13943,9 @@ export interface CatSegmentsRequest extends CatCatRequestBase { /** Period to wait for a connection to the master node. */ master_timeout?: Duration /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { index?: never, bytes?: never, h?: never, s?: never, local?: never, master_timeout?: never } + body?: string | { [key: string]: any } & { index?: never, h?: never, s?: never, local?: never, master_timeout?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { index?: never, bytes?: never, h?: never, s?: never, local?: never, master_timeout?: never } + querystring?: { [key: string]: any } & { index?: never, h?: never, s?: never, local?: never, master_timeout?: never } } export type CatSegmentsResponse = CatSegmentsSegmentsRecord[] @@ -13960,8 +14093,6 @@ export interface CatShardsRequest extends CatCatRequestBase { * Supports wildcards (`*`). * To target all data streams and indices, omit this parameter or use `*` or `_all`. */ index?: Indices - /** The unit used to display byte values. */ - bytes?: Bytes /** List of columns to appear in the response. Supports simple wildcards. */ h?: CatCatShardColumns /** A comma-separated list of column names or aliases that determines the sort order. @@ -13970,12 +14101,10 @@ export interface CatShardsRequest extends CatCatRequestBase { s?: Names /** The period to wait for a connection to the master node. */ master_timeout?: Duration - /** The unit used to display time values. */ - time?: TimeUnit /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { index?: never, bytes?: never, h?: never, s?: never, master_timeout?: never, time?: never } + body?: string | { [key: string]: any } & { index?: never, h?: never, s?: never, master_timeout?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { index?: never, bytes?: never, h?: never, s?: never, master_timeout?: never, time?: never } + querystring?: { [key: string]: any } & { index?: never, h?: never, s?: never, master_timeout?: never } } export type CatShardsResponse = CatShardsShardsRecord[] @@ -14609,12 +14738,10 @@ export interface CatSnapshotsRequest extends CatCatRequestBase { s?: Names /** Period to wait for a connection to the master node. */ master_timeout?: Duration - /** Unit used to display time values. */ - time?: TimeUnit /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { repository?: never, ignore_unavailable?: never, h?: never, s?: never, master_timeout?: never, time?: never } + body?: string | { [key: string]: any } & { repository?: never, ignore_unavailable?: never, h?: never, s?: never, master_timeout?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { repository?: never, ignore_unavailable?: never, h?: never, s?: never, master_timeout?: never, time?: never } + querystring?: { [key: string]: any } & { repository?: never, ignore_unavailable?: never, h?: never, s?: never, master_timeout?: never } } export type CatSnapshotsResponse = CatSnapshotsSnapshotsRecord[] @@ -14729,17 +14856,15 @@ export interface CatTasksRequest extends CatCatRequestBase { * Sorting defaults to ascending and can be changed by setting `:asc` * or `:desc` as a suffix to the column name. */ s?: Names - /** Unit used to display time values. */ - time?: TimeUnit /** Period to wait for a response. * If no response is received before the timeout expires, the request fails and returns an error. */ timeout?: Duration /** If `true`, the request blocks until the task has completed. */ wait_for_completion?: boolean /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { actions?: never, detailed?: never, nodes?: never, parent_task_id?: never, h?: never, s?: never, time?: never, timeout?: never, wait_for_completion?: never } + body?: string | { [key: string]: any } & { actions?: never, detailed?: never, nodes?: never, parent_task_id?: never, h?: never, s?: never, timeout?: never, wait_for_completion?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { actions?: never, detailed?: never, nodes?: never, parent_task_id?: never, h?: never, s?: never, time?: never, timeout?: never, wait_for_completion?: never } + querystring?: { [key: string]: any } & { actions?: never, detailed?: never, nodes?: never, parent_task_id?: never, h?: never, s?: never, timeout?: never, wait_for_completion?: never } } export type CatTasksResponse = CatTasksTasksRecord[] @@ -14893,8 +15018,6 @@ export interface CatThreadPoolRequest extends CatCatRequestBase { * Sorting defaults to ascending and can be changed by setting `:asc` * or `:desc` as a suffix to the column name. */ s?: Names - /** The unit used to display time values. */ - time?: TimeUnit /** If `true`, the request computes the list of selected nodes from the * local cluster state. If `false` the list of selected nodes are computed * from the cluster state of the master node. In both cases the coordinating @@ -14903,9 +15026,9 @@ export interface CatThreadPoolRequest extends CatCatRequestBase { /** The period to wait for a connection to the master node. */ master_timeout?: Duration /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { thread_pool_patterns?: never, h?: never, s?: never, time?: never, local?: never, master_timeout?: never } + body?: string | { [key: string]: any } & { thread_pool_patterns?: never, h?: never, s?: never, local?: never, master_timeout?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { thread_pool_patterns?: never, h?: never, s?: never, time?: never, local?: never, master_timeout?: never } + querystring?: { [key: string]: any } & { thread_pool_patterns?: never, h?: never, s?: never, local?: never, master_timeout?: never } } export type CatThreadPoolResponse = CatThreadPoolThreadPoolRecord[] @@ -15029,14 +15152,12 @@ export interface CatTransformsRequest extends CatCatRequestBase { h?: CatCatTransformColumns /** Comma-separated list of column names or column aliases used to sort the response. */ s?: CatCatTransformColumns - /** The unit used to display time values. */ - time?: TimeUnit /** The maximum number of transforms to obtain. */ size?: integer /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { transform_id?: never, allow_no_match?: never, from?: never, h?: never, s?: never, time?: never, size?: never } + body?: string | { [key: string]: any } & { transform_id?: never, allow_no_match?: never, from?: never, h?: never, s?: never, size?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { transform_id?: never, allow_no_match?: never, from?: never, h?: never, s?: never, time?: never, size?: never } + querystring?: { [key: string]: any } & { transform_id?: never, allow_no_match?: never, from?: never, h?: never, s?: never, size?: never } } export type CatTransformsResponse = CatTransformsTransformsRecord[] @@ -17984,6 +18105,15 @@ export interface EqlSearchRequest extends RequestBase { ccs_minimize_roundtrips?: boolean /** If true, missing or closed indices are not included in the response. */ ignore_unavailable?: boolean + /** Specifies a subset of projects to target for the search using project + * metadata tags in a subset of Lucene query syntax. + * Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + * Examples: + * _alias:my-project + * _alias:_origin + * _alias:*pr* + * Supported in serverless only. */ + project_routing?: ProjectRouting /** EQL query you wish to run. */ query: string case_sensitive?: boolean @@ -18019,9 +18149,9 @@ export interface EqlSearchRequest extends RequestBase { * `max_samples_per_key` parameter. Pipes are not supported for sample queries. */ max_samples_per_key?: integer /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { index?: never, allow_no_indices?: never, expand_wildcards?: never, ccs_minimize_roundtrips?: never, ignore_unavailable?: never, query?: never, case_sensitive?: never, event_category_field?: never, tiebreaker_field?: never, timestamp_field?: never, fetch_size?: never, filter?: never, keep_alive?: never, keep_on_completion?: never, wait_for_completion_timeout?: never, allow_partial_search_results?: never, allow_partial_sequence_results?: never, size?: never, fields?: never, result_position?: never, runtime_mappings?: never, max_samples_per_key?: never } + body?: string | { [key: string]: any } & { index?: never, allow_no_indices?: never, expand_wildcards?: never, ccs_minimize_roundtrips?: never, ignore_unavailable?: never, project_routing?: never, query?: never, case_sensitive?: never, event_category_field?: never, tiebreaker_field?: never, timestamp_field?: never, fetch_size?: never, filter?: never, keep_alive?: never, keep_on_completion?: never, wait_for_completion_timeout?: never, allow_partial_search_results?: never, allow_partial_sequence_results?: never, size?: never, fields?: never, result_position?: never, runtime_mappings?: never, max_samples_per_key?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { index?: never, allow_no_indices?: never, expand_wildcards?: never, ccs_minimize_roundtrips?: never, ignore_unavailable?: never, query?: never, case_sensitive?: never, event_category_field?: never, tiebreaker_field?: never, timestamp_field?: never, fetch_size?: never, filter?: never, keep_alive?: never, keep_on_completion?: never, wait_for_completion_timeout?: never, allow_partial_search_results?: never, allow_partial_sequence_results?: never, size?: never, fields?: never, result_position?: never, runtime_mappings?: never, max_samples_per_key?: never } + querystring?: { [key: string]: any } & { index?: never, allow_no_indices?: never, expand_wildcards?: never, ccs_minimize_roundtrips?: never, ignore_unavailable?: never, project_routing?: never, query?: never, case_sensitive?: never, event_category_field?: never, tiebreaker_field?: never, timestamp_field?: never, fetch_size?: never, filter?: never, keep_alive?: never, keep_on_completion?: never, wait_for_completion_timeout?: never, allow_partial_search_results?: never, allow_partial_sequence_results?: never, size?: never, fields?: never, result_position?: never, runtime_mappings?: never, max_samples_per_key?: never } } export type EqlSearchResponse = EqlEqlSearchResponseBase @@ -18039,6 +18169,8 @@ export interface EsqlAsyncEsqlResult extends EsqlEsqlResult { is_running: boolean } +export type EsqlESQLParam = FieldValue | FieldValue[] + export interface EsqlEsqlClusterDetails { status: EsqlEsqlClusterStatus indices: string @@ -18145,10 +18277,15 @@ export interface EsqlAsyncQueryRequest extends RequestBase { /** Tables to use with the LOOKUP operation. The top level key is the table * name and the next level key is the column name. */ tables?: Record> - /** When set to `true` and performing a cross-cluster query, the response will include an extra `_clusters` + /** When set to `true` and performing a cross-cluster/cross-project query, the response will include an extra `_clusters` * object with information about the clusters that participated in the search along with info such as shards * count. */ include_ccs_metadata?: boolean + /** When set to `true` and performing a cross-cluster/cross-project query, the response will include an extra `_clusters` + * object with information about the clusters that participated in the search along with info such as shards + * count. + * @alias include_ccs_metadata */ + include_execution_metadata?: boolean /** The period to wait for the request to finish. * By default, the request waits for 1 second for the query results. * If the query completes during this period, results are returned @@ -18163,9 +18300,9 @@ export interface EsqlAsyncQueryRequest extends RequestBase { * If false, the query and its results are stored in the cluster only if the request does not complete during the period set by the `wait_for_completion_timeout` parameter. */ keep_on_completion?: boolean /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { allow_partial_results?: never, delimiter?: never, drop_null_columns?: never, format?: never, columnar?: never, filter?: never, locale?: never, params?: never, profile?: never, query?: never, tables?: never, include_ccs_metadata?: never, wait_for_completion_timeout?: never, keep_alive?: never, keep_on_completion?: never } + body?: string | { [key: string]: any } & { allow_partial_results?: never, delimiter?: never, drop_null_columns?: never, format?: never, columnar?: never, filter?: never, locale?: never, params?: never, profile?: never, query?: never, tables?: never, include_ccs_metadata?: never, include_execution_metadata?: never, wait_for_completion_timeout?: never, keep_alive?: never, keep_on_completion?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { allow_partial_results?: never, delimiter?: never, drop_null_columns?: never, format?: never, columnar?: never, filter?: never, locale?: never, params?: never, profile?: never, query?: never, tables?: never, include_ccs_metadata?: never, wait_for_completion_timeout?: never, keep_alive?: never, keep_on_completion?: never } + querystring?: { [key: string]: any } & { allow_partial_results?: never, delimiter?: never, drop_null_columns?: never, format?: never, columnar?: never, filter?: never, locale?: never, params?: never, profile?: never, query?: never, tables?: never, include_ccs_metadata?: never, include_execution_metadata?: never, wait_for_completion_timeout?: never, keep_alive?: never, keep_on_completion?: never } } export type EsqlAsyncQueryResponse = EsqlAsyncEsqlResult @@ -18284,7 +18421,7 @@ export interface EsqlQueryRequest extends RequestBase { filter?: QueryDslQueryContainer locale?: string /** 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?: FieldValue[] + params?: EsqlESQLParam[] /** If provided and `true` the response will include an extra `profile` object * with information on how the query was executed. This information is for human debugging * and its format can change at any time but it can give some insight into the performance @@ -18295,14 +18432,19 @@ export interface EsqlQueryRequest extends RequestBase { /** Tables to use with the LOOKUP operation. The top level key is the table * name and the next level key is the column name. */ tables?: Record> - /** When set to `true` and performing a cross-cluster query, the response will include an extra `_clusters` + /** When set to `true` and performing a cross-cluster/cross-project query, the response will include an extra `_clusters` * object with information about the clusters that participated in the search along with info such as shards * count. */ include_ccs_metadata?: boolean + /** When set to `true` and performing a cross-cluster/cross-project query, the response will include an extra `_clusters` + * object with information about the clusters that participated in the search along with info such as shards + * count. + * @alias include_ccs_metadata */ + include_execution_metadata?: boolean /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { format?: never, delimiter?: never, drop_null_columns?: never, allow_partial_results?: never, columnar?: never, filter?: never, locale?: never, params?: never, profile?: never, query?: never, tables?: never, include_ccs_metadata?: never } + body?: string | { [key: string]: any } & { format?: never, delimiter?: never, drop_null_columns?: never, allow_partial_results?: never, columnar?: never, filter?: never, locale?: never, params?: never, profile?: never, query?: never, tables?: never, include_ccs_metadata?: never, include_execution_metadata?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { format?: never, delimiter?: never, drop_null_columns?: never, allow_partial_results?: never, columnar?: never, filter?: never, locale?: never, params?: never, profile?: never, query?: never, tables?: never, include_ccs_metadata?: never } + querystring?: { [key: string]: any } & { format?: never, delimiter?: never, drop_null_columns?: never, allow_partial_results?: never, columnar?: never, filter?: never, locale?: never, params?: never, profile?: never, query?: never, tables?: never, include_ccs_metadata?: never, include_execution_metadata?: never } } export type EsqlQueryResponse = EsqlEsqlResult @@ -18775,6 +18917,8 @@ export interface IlmExplainLifecycleLifecycleExplainManaged { action_time?: DateTime action_time_millis?: EpochTime age?: Duration + /** @remarks This property is not supported on Elastic Cloud Serverless. */ + age_in_millis?: DurationValue failed_step?: Name failed_step_retry_count?: integer index: IndexName @@ -21757,10 +21901,19 @@ export interface IndicesResolveIndexRequest extends RequestBase { allow_no_indices?: boolean /** Filter indices by index mode - standard, lookup, time_series, etc. Comma-separated list of IndexMode. Empty means no filter. */ mode?: IndicesIndexMode | IndicesIndexMode[] + /** Specifies a subset of projects to target using project + * metadata tags in a subset of Lucene query syntax. + * Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + * Examples: + * _alias:my-project + * _alias:_origin + * _alias:*pr* + * Supported in serverless only. */ + project_routing?: ProjectRouting /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { name?: never, expand_wildcards?: never, ignore_unavailable?: never, allow_no_indices?: never, mode?: never } + body?: string | { [key: string]: any } & { name?: never, expand_wildcards?: never, ignore_unavailable?: never, allow_no_indices?: never, mode?: never, project_routing?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { name?: never, expand_wildcards?: never, ignore_unavailable?: never, allow_no_indices?: never, mode?: never } + querystring?: { [key: string]: any } & { name?: never, expand_wildcards?: never, ignore_unavailable?: never, allow_no_indices?: never, mode?: never, project_routing?: never } } export interface IndicesResolveIndexResolveIndexAliasItem { @@ -23229,6 +23382,10 @@ export interface InferenceGoogleVertexAIServiceSettings { rate_limit?: InferenceRateLimitSetting /** A valid service account in JSON format for the Google Vertex AI API. */ service_account_json: string + /** For a `text_embedding` task, the number of dimensions the resulting output embeddings should have. + * By default, the model's standard output dimension is used. + * Refer to the Google documentation for more information. */ + dimensions?: integer } export type InferenceGoogleVertexAIServiceType = 'googlevertexai' @@ -24904,6 +25061,8 @@ export interface IngestFailProcessor extends IngestProcessorBase { message: string } +export type IngestFieldAccessPattern = 'classic' | 'flexible' + export type IngestFingerprintDigest = 'MD5' | 'SHA-1' | 'SHA-256' | 'SHA-512' | 'MurmurHash3' export interface IngestFingerprintProcessor extends IngestProcessorBase { @@ -25217,6 +25376,8 @@ export interface IngestPipeline { modified_date?: DateTime /** Date and time when the pipeline was last modified, in milliseconds since the epoch. */ modified_date_millis?: EpochTime + /** Controls how processors in this pipeline should read and write data on a document's source. */ + field_access_pattern?: IngestFieldAccessPattern } export interface IngestPipelineConfig { @@ -25854,10 +26015,12 @@ export interface IngestPutPipelineRequest extends RequestBase { /** 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. */ deprecated?: boolean + /** Controls how processors in this pipeline should read and write data on a document's source. */ + field_access_pattern?: IngestFieldAccessPattern /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { id?: never, master_timeout?: never, timeout?: never, if_version?: never, _meta?: never, description?: never, on_failure?: never, processors?: never, version?: never, deprecated?: never } + body?: string | { [key: string]: any } & { id?: never, master_timeout?: never, timeout?: never, if_version?: never, _meta?: never, description?: never, on_failure?: never, processors?: never, version?: never, deprecated?: never, field_access_pattern?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { id?: never, master_timeout?: never, timeout?: never, if_version?: never, _meta?: never, description?: never, on_failure?: never, processors?: never, version?: never, deprecated?: never } + querystring?: { [key: string]: any } & { id?: never, master_timeout?: never, timeout?: never, if_version?: never, _meta?: never, description?: never, on_failure?: never, processors?: never, version?: never, deprecated?: never, field_access_pattern?: never } } export type IngestPutPipelineResponse = AcknowledgedResponseBase @@ -26099,7 +26262,8 @@ export interface LogstashGetPipelineRequest extends RequestBase { export type LogstashGetPipelineResponse = Record export interface LogstashPutPipelineRequest extends RequestBase { - /** An identifier for the pipeline. */ + /** An identifier for the pipeline. + * Pipeline IDs must begin with a letter or underscore and contain only letters, underscores, dashes, hyphens and numbers. */ id: Id pipeline?: LogstashPipeline /** All values in `body` will be added to the request body. */ @@ -27219,7 +27383,7 @@ export interface MlFillMaskInferenceOptions { tokenization?: MlTokenizationConfigContainer /** The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. */ results_field?: string - vocabulary: MlVocabulary + vocabulary?: MlVocabulary } export interface MlFillMaskInferenceUpdateOptions { @@ -27964,7 +28128,7 @@ export interface MlTextEmbeddingInferenceOptions { tokenization?: MlTokenizationConfigContainer /** The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. */ results_field?: string - vocabulary: MlVocabulary + vocabulary?: MlVocabulary } export interface MlTextEmbeddingInferenceUpdateOptions { @@ -27978,7 +28142,7 @@ export interface MlTextExpansionInferenceOptions { tokenization?: MlTokenizationConfigContainer /** The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. */ results_field?: string - vocabulary: MlVocabulary + vocabulary?: MlVocabulary } export interface MlTextExpansionInferenceUpdateOptions { @@ -29362,7 +29526,7 @@ export interface MlGetOverallBucketsRequest extends RequestBase { /** Refer to the description for the `exclude_interim` query parameter. */ exclude_interim?: boolean /** Refer to the description for the `overall_score` query parameter. */ - overall_score?: double | string + overall_score?: double /** Refer to the description for the `start` query parameter. */ start?: DateTime /** Refer to the description for the `top_n` query parameter. */ @@ -32098,6 +32262,29 @@ export interface NodesUsageResponseBase extends NodesNodesResponseBase { nodes: Record } +export interface ProjectTagsProjectTags { + origin: Partial> + linked_projects?: Record +} + +export interface ProjectTagsRequest extends RequestBase { + /** All values in `body` will be added to the request body. */ + body?: string | { [key: string]: any } + /** All values in `querystring` will be added to the request querystring. */ + querystring?: { [key: string]: any } +} + +export type ProjectTagsResponse = ProjectTagsProjectTags + +export interface ProjectTagsTagsKeys { + _id: string + _alias: string + _type: string + _organisation: string +} +export type ProjectTagsTags = ProjectTagsTagsKeys +& { [property: string]: string } + export interface QueryRulesQueryRule { /** A unique identifier for the rule. */ rule_id: Id @@ -33263,7 +33450,7 @@ export interface SecurityAuthenticateAuthenticateApiKey { id: Id name?: Name managed_by: SecurityApiKeyManagedBy - internal: boolean + internal?: boolean } export interface SecurityAuthenticateRequest extends RequestBase { @@ -35124,9 +35311,9 @@ export interface ShutdownDeleteNodeRequest extends RequestBase { /** The node id of node to be removed from the shutdown state */ node_id: NodeId /** 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. */ - master_timeout?: TimeUnit + master_timeout?: Duration /** Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. */ - timeout?: TimeUnit + timeout?: Duration /** All values in `body` will be added to the request body. */ body?: string | { [key: string]: any } & { node_id?: never, master_timeout?: never, timeout?: never } /** All values in `querystring` will be added to the request querystring. */ @@ -35158,7 +35345,7 @@ export interface ShutdownGetNodeRequest extends RequestBase { /** Which node for which to retrieve the shutdown status */ node_id?: NodeIds /** 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. */ - master_timeout?: TimeUnit + master_timeout?: Duration /** All values in `body` will be added to the request body. */ body?: string | { [key: string]: any } & { node_id?: never, master_timeout?: never } /** All values in `querystring` will be added to the request querystring. */ @@ -35185,10 +35372,10 @@ export interface ShutdownPutNodeRequest extends RequestBase { node_id: NodeId /** The 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. */ - master_timeout?: TimeUnit + master_timeout?: Duration /** The period to wait for a response. * If no response is received before the timeout expires, the request fails and returns an error. */ - timeout?: TimeUnit + timeout?: Duration /** Valid values are restart, remove, or replace. * Use restart when you need to temporarily shut down a node to perform an upgrade, make configuration changes, or perform other maintenance. * Because the node is expected to rejoin the cluster, data is not migrated off of the node. @@ -36740,6 +36927,15 @@ export interface SqlQueryRequest extends RequestBase { * You can also specify a format using the `Accept` HTTP header. * If you specify both this parameter and the `Accept` HTTP header, this parameter takes precedence. */ format?: SqlQuerySqlFormat + /** Specifies a subset of projects to target for the search using project + * metadata tags in a subset of Lucene query syntax. + * Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). + * Examples: + * _alias:my-project + * _alias:_origin + * _alias:*pr* + * Supported in serverless only. */ + project_routing?: ProjectRouting /** If `true`, the response has partial results when there are shard request timeouts or shard failures. * If `false`, the API returns an error with no partial results. */ allow_partial_search_results?: boolean @@ -36789,9 +36985,9 @@ export interface SqlQueryRequest extends RequestBase { * To save a synchronous search, you must specify this parameter and the `keep_on_completion` parameter. */ wait_for_completion_timeout?: Duration /** All values in `body` will be added to the request body. */ - body?: string | { [key: string]: any } & { format?: never, allow_partial_search_results?: never, catalog?: never, columnar?: never, cursor?: never, fetch_size?: never, field_multi_value_leniency?: never, filter?: never, index_using_frozen?: never, keep_alive?: never, keep_on_completion?: never, page_timeout?: never, params?: never, query?: never, request_timeout?: never, runtime_mappings?: never, time_zone?: never, wait_for_completion_timeout?: never } + body?: string | { [key: string]: any } & { format?: never, project_routing?: never, allow_partial_search_results?: never, catalog?: never, columnar?: never, cursor?: never, fetch_size?: never, field_multi_value_leniency?: never, filter?: never, index_using_frozen?: never, keep_alive?: never, keep_on_completion?: never, page_timeout?: never, params?: never, query?: never, request_timeout?: never, runtime_mappings?: never, time_zone?: never, wait_for_completion_timeout?: never } /** All values in `querystring` will be added to the request querystring. */ - querystring?: { [key: string]: any } & { format?: never, allow_partial_search_results?: never, catalog?: never, columnar?: never, cursor?: never, fetch_size?: never, field_multi_value_leniency?: never, filter?: never, index_using_frozen?: never, keep_alive?: never, keep_on_completion?: never, page_timeout?: never, params?: never, query?: never, request_timeout?: never, runtime_mappings?: never, time_zone?: never, wait_for_completion_timeout?: never } + querystring?: { [key: string]: any } & { format?: never, project_routing?: never, allow_partial_search_results?: never, catalog?: never, columnar?: never, cursor?: never, fetch_size?: never, field_multi_value_leniency?: never, filter?: never, index_using_frozen?: never, keep_alive?: never, keep_on_completion?: never, page_timeout?: never, params?: never, query?: never, request_timeout?: never, runtime_mappings?: never, time_zone?: never, wait_for_completion_timeout?: never } } export interface SqlQueryResponse { @@ -36843,6 +37039,7 @@ export interface SqlTranslateResponse { fields?: (QueryDslFieldAndFormat | Field)[] query?: QueryDslQueryContainer sort?: Sort + track_total_hits?: SearchTrackHits } export interface SslCertificatesCertificateInformation { @@ -36875,6 +37072,54 @@ export interface SslCertificatesRequest extends RequestBase { export type SslCertificatesResponse = SslCertificatesCertificateInformation[] +export interface StreamsLogsDisableRequest extends RequestBase { + /** The 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. */ + master_timeout?: Duration + /** The period to wait for a response. + * If no response is received before the timeout expires, the request fails and returns an error. */ + timeout?: Duration + /** All values in `body` will be added to the request body. */ + body?: string | { [key: string]: any } & { master_timeout?: never, timeout?: never } + /** All values in `querystring` will be added to the request querystring. */ + querystring?: { [key: string]: any } & { master_timeout?: never, timeout?: never } +} + +export type StreamsLogsDisableResponse = AcknowledgedResponseBase + +export interface StreamsLogsEnableRequest extends RequestBase { + /** The 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. */ + master_timeout?: Duration + /** The period to wait for a response. + * If no response is received before the timeout expires, the request fails and returns an error. */ + timeout?: Duration + /** All values in `body` will be added to the request body. */ + body?: string | { [key: string]: any } & { master_timeout?: never, timeout?: never } + /** All values in `querystring` will be added to the request querystring. */ + querystring?: { [key: string]: any } & { master_timeout?: never, timeout?: never } +} + +export type StreamsLogsEnableResponse = AcknowledgedResponseBase + +export interface StreamsStatusLogsStatus { + /** If true, the logs stream feature is enabled. */ + enabled: boolean +} + +export interface StreamsStatusRequest extends RequestBase { + /** 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. */ + master_timeout?: TimeUnit + /** All values in `body` will be added to the request body. */ + body?: string | { [key: string]: any } & { master_timeout?: never } + /** All values in `querystring` will be added to the request querystring. */ + querystring?: { [key: string]: any } & { master_timeout?: never } +} + +export interface StreamsStatusResponse { + logs: StreamsStatusLogsStatus +} + export interface SynonymsSynonymRule { /** The identifier for the synonym rule. * If you do not specify a synonym rule ID when you create a rule, an identifier is created automatically by Elasticsearch. */ @@ -39546,4 +39791,15 @@ export interface SpecUtilsCommonCatQueryParameters { help?: boolean /** When set to `true` will enable verbose output. */ v?: boolean + /** Sets the units for columns that contain a byte-size value. + * Note that byte-size value units work in terms of powers of 1024. For instance `1kb` means 1024 bytes, not 1000 bytes. + * If omitted, byte-size values are rendered with a suffix such as `kb`, `mb`, or `gb`, chosen such that the numeric value of the column is as small as possible whilst still being at least `1.0`. + * If given, byte-size values are rendered as an integer with no suffix, representing the value of the column in the chosen unit. + * Values that are not an exact multiple of the chosen unit are rounded down. */ + bytes?: Bytes + /** Sets the units for columns that contain a time duration. + * If omitted, time duration values are rendered with a suffix such as `ms`, `s`, `m` or `h`, chosen such that the numeric value of the column is as small as possible whilst still being at least `1.0`. + * If given, time duration values are rendered as an integer with no suffix. + * Values that are not an exact multiple of the chosen unit are rounded down. */ + time?: TimeUnit }