From 6806939547c92961243da6f044284730e2edcc93 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Tue, 10 Dec 2024 16:05:34 +0000 Subject: [PATCH] Auto-generated API code --- ...0c52af573c9401a2a687e86a4beb182b.asciidoc} | 2 +- .../2a67608dadbf220a2f040f3a79d3677d.asciidoc | 35 + ...48e142e6c69014e0509d4c9251749d77.asciidoc} | 3 +- .../49b31e23f8b9667b6a7b2734d55fb6ed.asciidoc | 17 - .../53d9d2ec9cb8d211772d764e76fe6890.asciidoc | 18 + .../5a70db31f587b7ffed5e9bc1445430cb.asciidoc | 22 - ...80135e8c644e34cc70ce8a4e7915d1a2.asciidoc} | 2 +- .../8cad5d95a0e7c103f08be53d0b172558.asciidoc | 22 - .../931817b168e055ecf738785c721125dd.asciidoc | 32 + ...93c77c65f1e11382f8043d0300e87b89.asciidoc} | 2 +- ...cecfaa659af6646b3b67d7b311586fa0.asciidoc} | 2 +- .../d29031409016b2b798148ef173a196ae.asciidoc | 24 + ...d5242b1ab0213f25e5e0742032274ce6.asciidoc} | 2 +- ...e77c2f41a7eca765b0c5f734a66d919f.asciidoc} | 2 +- ...ea8c4229afa6dd4f1321355542be9912.asciidoc} | 2 +- docs/reference.asciidoc | 127 +- src/api/api/async_search.ts | 53 +- src/api/api/autoscaling.ts | 44 +- src/api/api/bulk.ts | 14 +- src/api/api/capabilities.ts | 11 +- src/api/api/cat.ts | 261 +- src/api/api/ccr.ts | 171 +- src/api/api/clear_scroll.ts | 21 +- src/api/api/close_point_in_time.ts | 21 +- src/api/api/cluster.ts | 201 +- src/api/api/connector.ts | 501 +- src/api/api/count.ts | 23 +- src/api/api/create.ts | 14 +- src/api/api/dangling_indices.ts | 31 +- src/api/api/delete.ts | 11 +- src/api/api/delete_by_query.ts | 21 +- src/api/api/delete_by_query_rethrottle.ts | 11 +- src/api/api/delete_script.ts | 11 +- src/api/api/enrich.ts | 63 +- src/api/api/eql.ts | 59 +- src/api/api/esql.ts | 43 +- src/api/api/exists.ts | 11 +- src/api/api/exists_source.ts | 11 +- src/api/api/explain.ts | 21 +- src/api/api/features.ts | 21 +- src/api/api/field_caps.ts | 21 +- src/api/api/fleet.ts | 74 +- src/api/api/get.ts | 11 +- src/api/api/get_script.ts | 11 +- src/api/api/get_script_context.ts | 11 +- src/api/api/get_script_languages.ts | 11 +- src/api/api/get_source.ts | 11 +- src/api/api/graph.ts | 23 +- src/api/api/health_report.ts | 11 +- src/api/api/ilm.ts | 141 +- src/api/api/index.ts | 14 +- src/api/api/indices.ts | 751 +- src/api/api/inference.ts | 64 +- src/api/api/info.ts | 11 +- src/api/api/ingest.ts | 169 +- src/api/api/knn_search.ts | 21 +- src/api/api/license.ts | 81 +- src/api/api/logstash.ts | 34 +- src/api/api/mget.ts | 21 +- src/api/api/migration.ts | 31 +- src/api/api/ml.ts | 1107 +- src/api/api/monitoring.ts | 14 +- src/api/api/msearch.ts | 14 +- src/api/api/msearch_template.ts | 14 +- src/api/api/mtermvectors.ts | 21 +- src/api/api/nodes.ts | 81 +- src/api/api/open_point_in_time.ts | 21 +- src/api/api/ping.ts | 11 +- src/api/api/profiling.ts | 41 +- src/api/api/put_script.ts | 21 +- src/api/api/query_rules.ts | 127 +- src/api/api/rank_eval.ts | 21 +- src/api/api/reindex.ts | 21 +- src/api/api/reindex_rethrottle.ts | 11 +- src/api/api/render_search_template.ts | 21 +- src/api/api/rollup.ts | 101 +- src/api/api/scripts_painless_execute.ts | 21 +- src/api/api/scroll.ts | 21 +- src/api/api/search.ts | 23 +- src/api/api/search_application.ts | 114 +- src/api/api/search_mvt.ts | 21 +- src/api/api/search_shards.ts | 11 +- src/api/api/search_template.ts | 21 +- src/api/api/searchable_snapshots.ts | 51 +- src/api/api/security.ts | 904 +- src/api/api/shutdown.ts | 41 +- src/api/api/simulate.ts | 11 +- src/api/api/slm.ts | 101 +- src/api/api/snapshot.ts | 164 +- src/api/api/sql.ts | 103 +- src/api/api/ssl.ts | 11 +- src/api/api/synonyms.ts | 105 +- src/api/api/tasks.ts | 31 +- src/api/api/terms_enum.ts | 21 +- src/api/api/termvectors.ts | 21 +- src/api/api/text_structure.ts | 54 +- src/api/api/transform.ts | 151 +- src/api/api/update.ts | 21 +- src/api/api/update_by_query.ts | 21 +- src/api/api/update_by_query_rethrottle.ts | 11 +- src/api/api/watcher.ts | 161 +- src/api/api/xpack.ts | 21 +- src/api/types.ts | 12 +- src/api/typesWithBodyKey.ts | 21281 ---------------- 104 files changed, 3020 insertions(+), 25641 deletions(-) rename docs/doc_examples/{160986f49758f4e8345d183a842f6351.asciidoc => 0c52af573c9401a2a687e86a4beb182b.asciidoc} (92%) create mode 100644 docs/doc_examples/2a67608dadbf220a2f040f3a79d3677d.asciidoc rename docs/doc_examples/{9f16fca9813304e398ee052aa857dbcd.asciidoc => 48e142e6c69014e0509d4c9251749d77.asciidoc} (85%) delete mode 100644 docs/doc_examples/49b31e23f8b9667b6a7b2734d55fb6ed.asciidoc create mode 100644 docs/doc_examples/53d9d2ec9cb8d211772d764e76fe6890.asciidoc delete mode 100644 docs/doc_examples/5a70db31f587b7ffed5e9bc1445430cb.asciidoc rename docs/doc_examples/{f4d0ef2e0f76babee83d999fe35127f2.asciidoc => 80135e8c644e34cc70ce8a4e7915d1a2.asciidoc} (96%) delete mode 100644 docs/doc_examples/8cad5d95a0e7c103f08be53d0b172558.asciidoc create mode 100644 docs/doc_examples/931817b168e055ecf738785c721125dd.asciidoc rename docs/doc_examples/{8593715fcc70315a0816b435551258e0.asciidoc => 93c77c65f1e11382f8043d0300e87b89.asciidoc} (90%) rename docs/doc_examples/{b26b5574438e4eaf146b2428bf537c51.asciidoc => cecfaa659af6646b3b67d7b311586fa0.asciidoc} (96%) create mode 100644 docs/doc_examples/d29031409016b2b798148ef173a196ae.asciidoc rename docs/doc_examples/{35fd9549350926f8d57dc1765e2f40d3.asciidoc => d5242b1ab0213f25e5e0742032274ce6.asciidoc} (96%) rename docs/doc_examples/{5ba32ebaa7ee28a339c7693696d305ca.asciidoc => e77c2f41a7eca765b0c5f734a66d919f.asciidoc} (93%) rename docs/doc_examples/{bb5a1319c496acc862c670cc7224e59a.asciidoc => ea8c4229afa6dd4f1321355542be9912.asciidoc} (96%) delete mode 100644 src/api/typesWithBodyKey.ts diff --git a/docs/doc_examples/160986f49758f4e8345d183a842f6351.asciidoc b/docs/doc_examples/0c52af573c9401a2a687e86a4beb182b.asciidoc similarity index 92% rename from docs/doc_examples/160986f49758f4e8345d183a842f6351.asciidoc rename to docs/doc_examples/0c52af573c9401a2a687e86a4beb182b.asciidoc index 3aeb9d6f4..e0413d7dd 100644 --- a/docs/doc_examples/160986f49758f4e8345d183a842f6351.asciidoc +++ b/docs/doc_examples/0c52af573c9401a2a687e86a4beb182b.asciidoc @@ -10,7 +10,7 @@ const response = await client.ingest.putPipeline({ { attachment: { field: "data", - remove_binary: false, + remove_binary: true, }, }, ], diff --git a/docs/doc_examples/2a67608dadbf220a2f040f3a79d3677d.asciidoc b/docs/doc_examples/2a67608dadbf220a2f040f3a79d3677d.asciidoc new file mode 100644 index 000000000..93ccfa9d8 --- /dev/null +++ b/docs/doc_examples/2a67608dadbf220a2f040f3a79d3677d.asciidoc @@ -0,0 +1,35 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.ingest.putPipeline({ + id: "attachment", + description: "Extract attachment information including original binary", + processors: [ + { + attachment: { + field: "data", + remove_binary: false, + }, + }, + ], +}); +console.log(response); + +const response1 = await client.index({ + index: "my-index-000001", + id: "my_id", + pipeline: "attachment", + document: { + data: "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0=", + }, +}); +console.log(response1); + +const response2 = await client.get({ + index: "my-index-000001", + id: "my_id", +}); +console.log(response2); +---- diff --git a/docs/doc_examples/9f16fca9813304e398ee052aa857dbcd.asciidoc b/docs/doc_examples/48e142e6c69014e0509d4c9251749d77.asciidoc similarity index 85% rename from docs/doc_examples/9f16fca9813304e398ee052aa857dbcd.asciidoc rename to docs/doc_examples/48e142e6c69014e0509d4c9251749d77.asciidoc index 6be472e3b..7c4401c7d 100644 --- a/docs/doc_examples/9f16fca9813304e398ee052aa857dbcd.asciidoc +++ b/docs/doc_examples/48e142e6c69014e0509d4c9251749d77.asciidoc @@ -10,7 +10,8 @@ const response = await client.inference.put({ service: "openai", service_settings: { api_key: "", - model_id: "text-embedding-ada-002", + model_id: "text-embedding-3-small", + dimensions: 128, }, }, }); diff --git a/docs/doc_examples/49b31e23f8b9667b6a7b2734d55fb6ed.asciidoc b/docs/doc_examples/49b31e23f8b9667b6a7b2734d55fb6ed.asciidoc deleted file mode 100644 index d66581f09..000000000 --- a/docs/doc_examples/49b31e23f8b9667b6a7b2734d55fb6ed.asciidoc +++ /dev/null @@ -1,17 +0,0 @@ -// This file is autogenerated, DO NOT EDIT -// Use `node scripts/generate-docs-examples.js` to generate the docs examples - -[source, js] ----- -const response = await client.knnSearch({ - index: "my-index", - knn: { - field: "image_vector", - query_vector: [0.3, 0.1, 1.2], - k: 10, - num_candidates: 100, - }, - _source: ["name", "file_type"], -}); -console.log(response); ----- diff --git a/docs/doc_examples/53d9d2ec9cb8d211772d764e76fe6890.asciidoc b/docs/doc_examples/53d9d2ec9cb8d211772d764e76fe6890.asciidoc new file mode 100644 index 000000000..58eee5923 --- /dev/null +++ b/docs/doc_examples/53d9d2ec9cb8d211772d764e76fe6890.asciidoc @@ -0,0 +1,18 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.ingest.simulate({ + id: "query_helper_pipeline", + docs: [ + { + _source: { + content: + "artificial intelligence in medicine articles published in the last 12 months", + }, + }, + ], +}); +console.log(response); +---- diff --git a/docs/doc_examples/5a70db31f587b7ffed5e9bc1445430cb.asciidoc b/docs/doc_examples/5a70db31f587b7ffed5e9bc1445430cb.asciidoc deleted file mode 100644 index 255b2df23..000000000 --- a/docs/doc_examples/5a70db31f587b7ffed5e9bc1445430cb.asciidoc +++ /dev/null @@ -1,22 +0,0 @@ -// This file is autogenerated, DO NOT EDIT -// Use `node scripts/generate-docs-examples.js` to generate the docs examples - -[source, js] ----- -const response = await client.indices.create({ - index: "semantic-embeddings", - mappings: { - properties: { - semantic_text: { - type: "semantic_text", - inference_id: "my-elser-endpoint", - }, - content: { - type: "text", - copy_to: "semantic_text", - }, - }, - }, -}); -console.log(response); ----- diff --git a/docs/doc_examples/f4d0ef2e0f76babee83d999fe35127f2.asciidoc b/docs/doc_examples/80135e8c644e34cc70ce8a4e7915d1a2.asciidoc similarity index 96% rename from docs/doc_examples/f4d0ef2e0f76babee83d999fe35127f2.asciidoc rename to docs/doc_examples/80135e8c644e34cc70ce8a4e7915d1a2.asciidoc index 0bf72b678..bb8174e35 100644 --- a/docs/doc_examples/f4d0ef2e0f76babee83d999fe35127f2.asciidoc +++ b/docs/doc_examples/80135e8c644e34cc70ce8a4e7915d1a2.asciidoc @@ -12,7 +12,7 @@ const response = await client.ingest.putPipeline({ field: "data", indexed_chars: 11, indexed_chars_field: "max_size", - remove_binary: false, + remove_binary: true, }, }, ], diff --git a/docs/doc_examples/8cad5d95a0e7c103f08be53d0b172558.asciidoc b/docs/doc_examples/8cad5d95a0e7c103f08be53d0b172558.asciidoc deleted file mode 100644 index b5190e9a8..000000000 --- a/docs/doc_examples/8cad5d95a0e7c103f08be53d0b172558.asciidoc +++ /dev/null @@ -1,22 +0,0 @@ -// This file is autogenerated, DO NOT EDIT -// Use `node scripts/generate-docs-examples.js` to generate the docs examples - -[source, js] ----- -const response = await client.inference.put({ - task_type: "sparse_embedding", - inference_id: "my-elser-endpoint", - inference_config: { - service: "elser", - service_settings: { - adaptive_allocations: { - enabled: true, - min_number_of_allocations: 3, - max_number_of_allocations: 10, - }, - num_threads: 1, - }, - }, -}); -console.log(response); ----- diff --git a/docs/doc_examples/931817b168e055ecf738785c721125dd.asciidoc b/docs/doc_examples/931817b168e055ecf738785c721125dd.asciidoc new file mode 100644 index 000000000..3d34dce97 --- /dev/null +++ b/docs/doc_examples/931817b168e055ecf738785c721125dd.asciidoc @@ -0,0 +1,32 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.ingest.putPipeline({ + id: "query_helper_pipeline", + processors: [ + { + script: { + source: + "ctx.prompt = 'Please generate an elasticsearch search query on index `articles_index` for the following natural language query. Dates are in the field `@timestamp`, document types are in the field `type` (options are `news`, `publication`), categories in the field `category` and can be multiple (options are `medicine`, `pharmaceuticals`, `technology`), and document names are in the field `title` which should use a fuzzy match. Ignore fields which cannot be determined from the natural language query context: ' + ctx.content", + }, + }, + { + inference: { + model_id: "openai_chat_completions", + input_output: { + input_field: "prompt", + output_field: "query", + }, + }, + }, + { + remove: { + field: "prompt", + }, + }, + ], +}); +console.log(response); +---- diff --git a/docs/doc_examples/8593715fcc70315a0816b435551258e0.asciidoc b/docs/doc_examples/93c77c65f1e11382f8043d0300e87b89.asciidoc similarity index 90% rename from docs/doc_examples/8593715fcc70315a0816b435551258e0.asciidoc rename to docs/doc_examples/93c77c65f1e11382f8043d0300e87b89.asciidoc index aae698a6f..7a9809243 100644 --- a/docs/doc_examples/8593715fcc70315a0816b435551258e0.asciidoc +++ b/docs/doc_examples/93c77c65f1e11382f8043d0300e87b89.asciidoc @@ -9,7 +9,7 @@ const response = await client.indices.create({ properties: { infer_field: { type: "semantic_text", - inference_id: "my-elser-endpoint", + inference_id: ".elser-2-elasticsearch", }, source_field: { type: "text", diff --git a/docs/doc_examples/b26b5574438e4eaf146b2428bf537c51.asciidoc b/docs/doc_examples/cecfaa659af6646b3b67d7b311586fa0.asciidoc similarity index 96% rename from docs/doc_examples/b26b5574438e4eaf146b2428bf537c51.asciidoc rename to docs/doc_examples/cecfaa659af6646b3b67d7b311586fa0.asciidoc index 8945d602e..bae03c0ff 100644 --- a/docs/doc_examples/b26b5574438e4eaf146b2428bf537c51.asciidoc +++ b/docs/doc_examples/cecfaa659af6646b3b67d7b311586fa0.asciidoc @@ -14,7 +14,7 @@ const response = await client.ingest.putPipeline({ attachment: { target_field: "_ingest._value.attachment", field: "_ingest._value.data", - remove_binary: false, + remove_binary: true, }, }, }, diff --git a/docs/doc_examples/d29031409016b2b798148ef173a196ae.asciidoc b/docs/doc_examples/d29031409016b2b798148ef173a196ae.asciidoc new file mode 100644 index 000000000..fac02d172 --- /dev/null +++ b/docs/doc_examples/d29031409016b2b798148ef173a196ae.asciidoc @@ -0,0 +1,24 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.create({ + index: "test-index", + query: { + semantic: { + field: "my_semantic_field", + }, + }, + highlight: { + fields: { + my_semantic_field: { + type: "semantic", + number_of_fragments: 2, + order: "score", + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/35fd9549350926f8d57dc1765e2f40d3.asciidoc b/docs/doc_examples/d5242b1ab0213f25e5e0742032274ce6.asciidoc similarity index 96% rename from docs/doc_examples/35fd9549350926f8d57dc1765e2f40d3.asciidoc rename to docs/doc_examples/d5242b1ab0213f25e5e0742032274ce6.asciidoc index 3302992dc..865d407f9 100644 --- a/docs/doc_examples/35fd9549350926f8d57dc1765e2f40d3.asciidoc +++ b/docs/doc_examples/d5242b1ab0213f25e5e0742032274ce6.asciidoc @@ -10,7 +10,7 @@ const response = await client.ingest.putPipeline({ { attachment: { field: "data", - remove_binary: false, + remove_binary: true, }, }, ], diff --git a/docs/doc_examples/5ba32ebaa7ee28a339c7693696d305ca.asciidoc b/docs/doc_examples/e77c2f41a7eca765b0c5f734a66d919f.asciidoc similarity index 93% rename from docs/doc_examples/5ba32ebaa7ee28a339c7693696d305ca.asciidoc rename to docs/doc_examples/e77c2f41a7eca765b0c5f734a66d919f.asciidoc index d17ba0b28..76351698d 100644 --- a/docs/doc_examples/5ba32ebaa7ee28a339c7693696d305ca.asciidoc +++ b/docs/doc_examples/e77c2f41a7eca765b0c5f734a66d919f.asciidoc @@ -11,7 +11,7 @@ const response = await client.ingest.putPipeline({ attachment: { field: "data", properties: ["content", "title"], - remove_binary: false, + remove_binary: true, }, }, ], diff --git a/docs/doc_examples/bb5a1319c496acc862c670cc7224e59a.asciidoc b/docs/doc_examples/ea8c4229afa6dd4f1321355542be9912.asciidoc similarity index 96% rename from docs/doc_examples/bb5a1319c496acc862c670cc7224e59a.asciidoc rename to docs/doc_examples/ea8c4229afa6dd4f1321355542be9912.asciidoc index d3998b385..c4744fb4e 100644 --- a/docs/doc_examples/bb5a1319c496acc862c670cc7224e59a.asciidoc +++ b/docs/doc_examples/ea8c4229afa6dd4f1321355542be9912.asciidoc @@ -12,7 +12,7 @@ const response = await client.ingest.putPipeline({ field: "data", indexed_chars: 11, indexed_chars_field: "max_size", - remove_binary: false, + remove_binary: true, }, }, ], diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 52a5817a5..2830d6453 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -96,7 +96,8 @@ client.closePointInTime({ id }) [discrete] === count -Returns number of documents matching a query. +Count search results. +Get the number of documents matching a query. {ref}/search-count.html[Endpoint documentation] [source,ts] @@ -1645,8 +1646,6 @@ the indices stats API. ** *`wait_for_completion_timeout` (Optional, string | -1 | 0)*: Blocks and waits until the search is completed up to a certain timeout. When the async search completes within the timeout, the response won’t include the ID as the results are not stored in the cluster. ** *`keep_on_completion` (Optional, boolean)*: If `true`, results are stored for later retrieval when the search completes within the `wait_for_completion_timeout`. -** *`keep_alive` (Optional, string | -1 | 0)*: Specifies how long the async search needs to be available. -Ongoing async searches and any saved search results are deleted after this period. ** *`allow_no_indices` (Optional, boolean)*: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) ** *`allow_partial_search_results` (Optional, boolean)*: Indicate if an error should be returned if there is a partial search failure or timeout ** *`analyzer` (Optional, string)*: The analyzer to use for the query string @@ -1663,7 +1662,6 @@ A partial reduction is performed every time the coordinating node has received a ** *`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 ** *`min_compatible_shard_node` (Optional, string)* ** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) -** *`pre_filter_shard_size` (Optional, number)*: The default value cannot be changed, which enforces the execution of a pre-filter roundtrip to retrieve statistics from each shard so that the ones that surely don’t hold any document matching the query get skipped. ** *`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 @@ -3563,7 +3561,8 @@ client.enrich.deletePolicy({ name }) [discrete] ==== execute_policy -Creates the enrich index for an existing enrich policy. +Run an enrich policy. +Create the enrich index for an existing enrich policy. {ref}/execute-enrich-policy-api.html[Endpoint documentation] [source,ts] @@ -3632,7 +3631,8 @@ client.enrich.stats() === eql [discrete] ==== delete -Deletes an async EQL search or a stored synchronous EQL search. +Delete an async EQL search. +Delete an async EQL search or a stored synchronous EQL search. The API also deletes results for the search. {ref}/eql-search-api.html[Endpoint documentation] @@ -3651,7 +3651,8 @@ A search ID is also provided if the request’s `keep_on_completion` parameter i [discrete] ==== get -Returns the current status and available results for an async EQL search or a stored synchronous EQL search. +Get async EQL search results. +Get the current status and available results for an async EQL search or a stored synchronous EQL search. {ref}/get-async-eql-search-api.html[Endpoint documentation] [source,ts] @@ -3671,7 +3672,8 @@ Defaults to no timeout, meaning the request waits for complete search results. [discrete] ==== get_status -Returns the current status for an async EQL search or a stored synchronous EQL search without returning results. +Get the async EQL status. +Get the current status for an async EQL search or a stored synchronous EQL search without returning results. {ref}/get-async-eql-status-api.html[Endpoint documentation] [source,ts] @@ -3687,7 +3689,9 @@ client.eql.getStatus({ id }) [discrete] ==== search -Returns results matching a query expressed in Event Query Language (EQL) +Get EQL search results. +Returns search results for an Event Query Language (EQL) query. +EQL assumes each document in a data stream or index corresponds to an event. {ref}/eql-search-api.html[Endpoint documentation] [source,ts] @@ -3744,7 +3748,8 @@ client.esql.asyncQueryGet() [discrete] ==== query -Executes an ES|QL request +Run an ES|QL query. +Get search results for an ES|QL (Elasticsearch query language) query. {ref}/esql-rest.html[Endpoint documentation] [source,ts] @@ -3963,7 +3968,12 @@ which is true by default. === graph [discrete] ==== explore -Extracts and summarizes information about the documents and terms in an Elasticsearch data stream or index. +Explore graph analytics. +Extract and summarize information about the documents and terms in an Elasticsearch data stream or index. +The easiest way to understand the behavior of this API is to use the Graph UI to explore connections. +An initial request to the `_explore` API contains a seed query that identifies the documents of interest and specifies the fields that define the vertices and connections you want to include in the graph. +Subsequent requests enable you to spider out from one more vertices of interest. +You can exclude vertices that have already been returned. {ref}/graph-explore-api.html[Endpoint documentation] [source,ts] @@ -4633,7 +4643,8 @@ Valid values are: `all`, `open`, `closed`, `hidden`, `none`. [discrete] ==== exists_index_template -Returns information about whether a particular index template exists. +Check index templates. +Check whether index templates exist. {ref}/index-templates.html[Endpoint documentation] [source,ts] @@ -5447,7 +5458,8 @@ Valid values are: `all`, `open`, `closed`, `hidden`, `none`. [discrete] ==== resolve_index -Resolves the specified name(s) and/or index patterns for indices, aliases, and data streams. +Resolve indices. +Resolve the names and/or index patterns for indices, aliases, and data streams. Multiple patterns and remote clusters are supported. {ref}/indices-resolve-index-api.html[Endpoint documentation] @@ -5884,7 +5896,8 @@ client.inference.streamInference() === ingest [discrete] ==== delete_geoip_database -Deletes a geoip database configuration. +Delete GeoIP database configurations. +Delete one or more IP geolocation database configurations. {ref}/delete-geoip-database-api.html[Endpoint documentation] [source,ts] @@ -5914,7 +5927,8 @@ client.ingest.deleteIpLocationDatabase() [discrete] ==== delete_pipeline -Deletes one or more existing ingest pipeline. +Delete pipelines. +Delete one or more ingest pipelines. {ref}/delete-pipeline-api.html[Endpoint documentation] [source,ts] @@ -5935,7 +5949,8 @@ If no response is received before the timeout expires, the request fails and ret [discrete] ==== geo_ip_stats -Gets download statistics for GeoIP2 databases used with the geoip processor. +Get GeoIP statistics. +Get download statistics for GeoIP2 databases that are used with the GeoIP processor. {ref}/geoip-processor.html[Endpoint documentation] [source,ts] @@ -5946,7 +5961,8 @@ client.ingest.geoIpStats() [discrete] ==== get_geoip_database -Returns information about one or more geoip database configurations. +Get GeoIP database configurations. +Get information about one or more IP geolocation database configurations. {ref}/get-geoip-database-api.html[Endpoint documentation] [source,ts] @@ -5977,7 +5993,8 @@ client.ingest.getIpLocationDatabase() [discrete] ==== get_pipeline -Returns information about one or more ingest pipelines. +Get pipelines. +Get information about one or more ingest pipelines. This API returns a local reference of the pipeline. {ref}/get-pipeline-api.html[Endpoint documentation] @@ -5999,8 +6016,9 @@ If no response is received before the timeout expires, the request fails and ret [discrete] ==== processor_grok -Extracts structured fields out of a single text field within a document. -You choose which field to extract matched fields from, as well as the grok pattern you expect will match. +Run a grok processor. +Extract structured fields out of a single text field within a document. +You must choose which field to extract matched fields from, as well as the grok pattern you expect will match. A grok pattern is like a regular expression that supports aliased expressions that can be reused. {ref}/grok-processor.html[Endpoint documentation] @@ -6012,7 +6030,8 @@ client.ingest.processorGrok() [discrete] ==== put_geoip_database -Returns information about one or more geoip database configurations. +Create or update GeoIP database configurations. +Create or update IP geolocation database configurations. {ref}/put-geoip-database-api.html[Endpoint documentation] [source,ts] @@ -6045,7 +6064,7 @@ client.ingest.putIpLocationDatabase() [discrete] ==== put_pipeline -Creates or updates an ingest pipeline. +Create or update a pipeline. Changes made using this API take effect immediately. {ref}/ingest.html[Endpoint documentation] @@ -6072,7 +6091,9 @@ When a deprecated ingest pipeline is referenced as the default or final pipeline [discrete] ==== simulate -Executes an ingest pipeline against a set of provided documents. +Simulate a pipeline. +Run an ingest pipeline against a set of provided documents. +You can either specify an existing pipeline to use with the provided documents or supply a pipeline definition in the body of the request. {ref}/simulate-pipeline-api.html[Endpoint documentation] [source,ts] @@ -8545,7 +8566,8 @@ If no response is received before the timeout expires, the request fails and ret === query_rules [discrete] ==== delete_rule -Deletes a query rule within a query ruleset. +Delete a query rule. +Delete a query rule within a query ruleset. {ref}/delete-query-rule.html[Endpoint documentation] [source,ts] @@ -8562,7 +8584,7 @@ client.queryRules.deleteRule({ ruleset_id, rule_id }) [discrete] ==== delete_ruleset -Deletes a query ruleset. +Delete a query ruleset. {ref}/delete-query-ruleset.html[Endpoint documentation] [source,ts] @@ -8578,7 +8600,8 @@ client.queryRules.deleteRuleset({ ruleset_id }) [discrete] ==== get_rule -Returns the details about a query rule within a query ruleset +Get a query rule. +Get details about a query rule within a query ruleset. {ref}/get-query-rule.html[Endpoint documentation] [source,ts] @@ -8595,7 +8618,8 @@ client.queryRules.getRule({ ruleset_id, rule_id }) [discrete] ==== get_ruleset -Returns the details about a query ruleset +Get a query ruleset. +Get details about a query ruleset. {ref}/get-query-ruleset.html[Endpoint documentation] [source,ts] @@ -8611,7 +8635,8 @@ client.queryRules.getRuleset({ ruleset_id }) [discrete] ==== list_rulesets -Returns summarized information about existing query rulesets. +Get all query rulesets. +Get summarized information about the query rulesets. {ref}/list-query-rulesets.html[Endpoint documentation] [source,ts] @@ -8628,7 +8653,8 @@ client.queryRules.listRulesets({ ... }) [discrete] ==== put_rule -Creates or updates a query rule within a query ruleset. +Create or update a query rule. +Create or update a query rule within a query ruleset. {ref}/put-query-rule.html[Endpoint documentation] [source,ts] @@ -8649,7 +8675,7 @@ client.queryRules.putRule({ ruleset_id, rule_id, type, criteria, actions }) [discrete] ==== put_ruleset -Creates or updates a query ruleset. +Create or update a query ruleset. {ref}/put-query-ruleset.html[Endpoint documentation] [source,ts] @@ -8666,7 +8692,8 @@ client.queryRules.putRuleset({ ruleset_id, rules }) [discrete] ==== test -Creates or updates a query ruleset. +Test a query ruleset. +Evaluate match criteria against a query ruleset to identify the rules that would match that criteria. {ref}/test-query-ruleset.html[Endpoint documentation] [source,ts] @@ -10932,7 +10959,7 @@ client.snapshot.verifyRepository({ repository }) === sql [discrete] ==== clear_cursor -Clears the SQL cursor +Clear an SQL search cursor. {ref}/clear-sql-cursor-api.html[Endpoint documentation] [source,ts] @@ -10948,7 +10975,9 @@ client.sql.clearCursor({ cursor }) [discrete] ==== delete_async -Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. +Delete an async SQL search. +Delete an async SQL search or a stored synchronous SQL search. +If the search is still running, the API cancels it. {ref}/delete-async-sql-search-api.html[Endpoint documentation] [source,ts] @@ -10964,7 +10993,8 @@ client.sql.deleteAsync({ id }) [discrete] ==== get_async -Returns the current status and available results for an async SQL search or stored synchronous SQL search +Get async SQL search results. +Get the current status and available results for an async SQL search or stored synchronous SQL search. {ref}/get-async-sql-search-api.html[Endpoint documentation] [source,ts] @@ -10987,7 +11017,8 @@ meaning the request waits for complete search results. [discrete] ==== get_async_status -Returns the current status of an async SQL search or a stored synchronous SQL search +Get the async SQL search status. +Get the current status of an async SQL search or a stored synchronous SQL search. {ref}/get-async-sql-search-status-api.html[Endpoint documentation] [source,ts] @@ -11003,7 +11034,8 @@ client.sql.getAsyncStatus({ id }) [discrete] ==== query -Executes a SQL request +Get SQL search results. +Run an SQL request. {ref}/sql-search-api.html[Endpoint documentation] [source,ts] @@ -11038,7 +11070,8 @@ precedence over mapped fields with the same name. [discrete] ==== translate -Translates SQL into Elasticsearch queries +Translate SQL into Elasticsearch queries. +Translate an SQL search into a search API request containing Query DSL. {ref}/sql-translate-api.html[Endpoint documentation] [source,ts] @@ -11088,7 +11121,7 @@ client.ssl.certificates() === synonyms [discrete] ==== delete_synonym -Deletes a synonym set +Delete a synonym set. {ref}/delete-synonyms-set.html[Endpoint documentation] [source,ts] @@ -11104,7 +11137,8 @@ client.synonyms.deleteSynonym({ id }) [discrete] ==== delete_synonym_rule -Deletes a synonym rule in a synonym set +Delete a synonym rule. +Delete a synonym rule from a synonym set. {ref}/delete-synonym-rule.html[Endpoint documentation] [source,ts] @@ -11121,7 +11155,7 @@ client.synonyms.deleteSynonymRule({ set_id, rule_id }) [discrete] ==== get_synonym -Retrieves a synonym set +Get a synonym set. {ref}/get-synonyms-set.html[Endpoint documentation] [source,ts] @@ -11139,7 +11173,8 @@ client.synonyms.getSynonym({ id }) [discrete] ==== get_synonym_rule -Retrieves a synonym rule from a synonym set +Get a synonym rule. +Get a synonym rule from a synonym set. {ref}/get-synonym-rule.html[Endpoint documentation] [source,ts] @@ -11156,7 +11191,8 @@ client.synonyms.getSynonymRule({ set_id, rule_id }) [discrete] ==== get_synonyms_sets -Retrieves a summary of all defined synonym sets +Get all synonym sets. +Get a summary of all defined synonym sets. {ref}/list-synonyms-sets.html[Endpoint documentation] [source,ts] @@ -11173,7 +11209,9 @@ client.synonyms.getSynonymsSets({ ... }) [discrete] ==== put_synonym -Creates or updates a synonym set. +Create or update a synonym set. +Synonyms sets are limited to a maximum of 10,000 synonym rules per set. +If you need to manage more synonym rules, you can create multiple synonym sets. {ref}/put-synonyms-set.html[Endpoint documentation] [source,ts] @@ -11190,7 +11228,8 @@ client.synonyms.putSynonym({ id, synonyms_set }) [discrete] ==== put_synonym_rule -Creates or updates a synonym rule in a synonym set +Create or update a synonym rule. +Create or update a synonym rule in a synonym set. {ref}/put-synonym-rule.html[Endpoint documentation] [source,ts] diff --git a/src/api/api/async_search.ts b/src/api/api/async_search.ts index 8eb91b779..5180ec6dd 100644 --- a/src/api/api/async_search.ts +++ b/src/api/api/async_search.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class AsyncSearch { @@ -48,10 +47,10 @@ export default class AsyncSearch { * Delete an async search. If the asynchronous search is still running, it is cancelled. Otherwise, the saved search results are deleted. If the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the `cancel_task` cluster privilege. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/async-search.html | Elasticsearch API documentation} */ - async delete (this: That, params: T.AsyncSearchDeleteRequest | TB.AsyncSearchDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async delete (this: That, params: T.AsyncSearchDeleteRequest | TB.AsyncSearchDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> - async delete (this: That, params: T.AsyncSearchDeleteRequest | TB.AsyncSearchDeleteRequest, options?: TransportRequestOptions): Promise - async delete (this: That, params: T.AsyncSearchDeleteRequest | TB.AsyncSearchDeleteRequest, options?: TransportRequestOptions): Promise { + async delete (this: That, params: T.AsyncSearchDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async delete (this: That, params: T.AsyncSearchDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> + async delete (this: That, params: T.AsyncSearchDeleteRequest, options?: TransportRequestOptions): Promise + async delete (this: That, params: T.AsyncSearchDeleteRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class AsyncSearch { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -80,10 +79,10 @@ export default class AsyncSearch { * Get async search results. Retrieve the results of a previously submitted asynchronous search request. If the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/async-search.html | Elasticsearch API documentation} */ - async get> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise> - async get> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> - async get> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise> - async get> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise { + async get> (this: That, params: T.AsyncSearchGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise> + async get> (this: That, params: T.AsyncSearchGetRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> + async get> (this: That, params: T.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise> + async get> (this: That, params: T.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -91,7 +90,7 @@ export default class AsyncSearch { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -112,10 +111,10 @@ export default class AsyncSearch { * Get the async search status. Get the status of a previously submitted async search request given its identifier, without retrieving search results. If the Elasticsearch security features are enabled, use of this API is restricted to the `monitoring_user` role. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/async-search.html | Elasticsearch API documentation} */ - async status (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async status (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> - async status (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptions): Promise - async status (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptions): Promise { + async status (this: That, params: T.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async status (this: That, params: T.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> + async status (this: That, params: T.AsyncSearchStatusRequest, options?: TransportRequestOptions): Promise + async status (this: That, params: T.AsyncSearchStatusRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -123,7 +122,7 @@ export default class AsyncSearch { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -144,29 +143,19 @@ export default class AsyncSearch { * Run an async search. When the primary sort of the results is an indexed field, shards get sorted based on minimum and maximum value that they hold for that field. Partial results become available following the sort criteria that was requested. Warning: Asynchronous search does not support scroll or search requests that include only the suggest section. By default, Elasticsearch does not allow you to store an async search response larger than 10Mb and an attempt to do this results in an error. The maximum allowed size for a stored async search response can be set by changing the `search.max_async_search_response_size` cluster level setting. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/async-search.html | Elasticsearch API documentation} */ - async submit> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithOutMeta): Promise> - async submit> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> - async submit> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise> - async submit> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise { + async submit> (this: That, params?: T.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithOutMeta): Promise> + async submit> (this: That, params?: T.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> + async submit> (this: That, params?: T.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise> + async submit> (this: That, params?: T.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['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'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} - // @ts-expect-error if (key === 'sort' && typeof params[key] === 'string' && params[key].includes(':')) { // eslint-disable-line - // @ts-expect-error querystring[key] = params[key] } else { // @ts-expect-error @@ -174,7 +163,7 @@ export default class AsyncSearch { } } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/autoscaling.ts b/src/api/api/autoscaling.ts index e5f7ebc89..2435e13a6 100644 --- a/src/api/api/autoscaling.ts +++ b/src/api/api/autoscaling.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Autoscaling { @@ -48,10 +47,10 @@ export default class Autoscaling { * Delete an autoscaling policy. NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/autoscaling-delete-autoscaling-policy.html | Elasticsearch API documentation} */ - async deleteAutoscalingPolicy (this: That, params: T.AutoscalingDeleteAutoscalingPolicyRequest | TB.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteAutoscalingPolicy (this: That, params: T.AutoscalingDeleteAutoscalingPolicyRequest | TB.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteAutoscalingPolicy (this: That, params: T.AutoscalingDeleteAutoscalingPolicyRequest | TB.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise - async deleteAutoscalingPolicy (this: That, params: T.AutoscalingDeleteAutoscalingPolicyRequest | TB.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise { + async deleteAutoscalingPolicy (this: That, params: T.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteAutoscalingPolicy (this: That, params: T.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteAutoscalingPolicy (this: That, params: T.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise + async deleteAutoscalingPolicy (this: That, params: T.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Autoscaling { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -80,10 +79,10 @@ export default class Autoscaling { * Get the autoscaling capacity. NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported. This API gets the current autoscaling capacity based on the configured autoscaling policy. It will return information to size the cluster appropriately to the current workload. The `required_capacity` is calculated as the maximum of the `required_capacity` result of all individual deciders that are enabled for the policy. The operator should verify that the `current_nodes` match the operator’s knowledge of the cluster to avoid making autoscaling decisions based on stale or incomplete information. The response contains decider-specific information you can use to diagnose how and why autoscaling determined a certain capacity was required. This information is provided for diagnosis only. Do not use this information to make autoscaling decisions. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/autoscaling-get-autoscaling-capacity.html | Elasticsearch API documentation} */ - async getAutoscalingCapacity (this: That, params?: T.AutoscalingGetAutoscalingCapacityRequest | TB.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getAutoscalingCapacity (this: That, params?: T.AutoscalingGetAutoscalingCapacityRequest | TB.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getAutoscalingCapacity (this: That, params?: T.AutoscalingGetAutoscalingCapacityRequest | TB.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptions): Promise - async getAutoscalingCapacity (this: That, params?: T.AutoscalingGetAutoscalingCapacityRequest | TB.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptions): Promise { + async getAutoscalingCapacity (this: That, params?: T.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getAutoscalingCapacity (this: That, params?: T.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getAutoscalingCapacity (this: That, params?: T.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptions): Promise + async getAutoscalingCapacity (this: That, params?: T.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -92,7 +91,7 @@ export default class Autoscaling { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -110,10 +109,10 @@ export default class Autoscaling { * Get an autoscaling policy. NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/autoscaling-get-autoscaling-capacity.html | Elasticsearch API documentation} */ - async getAutoscalingPolicy (this: That, params: T.AutoscalingGetAutoscalingPolicyRequest | TB.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getAutoscalingPolicy (this: That, params: T.AutoscalingGetAutoscalingPolicyRequest | TB.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getAutoscalingPolicy (this: That, params: T.AutoscalingGetAutoscalingPolicyRequest | TB.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise - async getAutoscalingPolicy (this: That, params: T.AutoscalingGetAutoscalingPolicyRequest | TB.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise { + async getAutoscalingPolicy (this: That, params: T.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getAutoscalingPolicy (this: That, params: T.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getAutoscalingPolicy (this: That, params: T.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise + async getAutoscalingPolicy (this: That, params: T.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -121,7 +120,7 @@ export default class Autoscaling { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -142,15 +141,14 @@ export default class Autoscaling { * Create or update an autoscaling policy. NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/autoscaling-put-autoscaling-policy.html | Elasticsearch API documentation} */ - async putAutoscalingPolicy (this: That, params: T.AutoscalingPutAutoscalingPolicyRequest | TB.AutoscalingPutAutoscalingPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putAutoscalingPolicy (this: That, params: T.AutoscalingPutAutoscalingPolicyRequest | TB.AutoscalingPutAutoscalingPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putAutoscalingPolicy (this: That, params: T.AutoscalingPutAutoscalingPolicyRequest | TB.AutoscalingPutAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise - async putAutoscalingPolicy (this: That, params: T.AutoscalingPutAutoscalingPolicyRequest | TB.AutoscalingPutAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise { + async putAutoscalingPolicy (this: That, params: T.AutoscalingPutAutoscalingPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putAutoscalingPolicy (this: That, params: T.AutoscalingPutAutoscalingPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putAutoscalingPolicy (this: That, params: T.AutoscalingPutAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise + async putAutoscalingPolicy (this: That, params: T.AutoscalingPutAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const acceptedBody: string[] = ['policy'] const querystring: Record = {} - // @ts-expect-error - let body: any = params.body ?? undefined + let body: any for (const key in params) { if (acceptedBody.includes(key)) { @@ -158,7 +156,7 @@ export default class Autoscaling { body = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/bulk.ts b/src/api/api/bulk.ts index e8d496be1..848855eda 100644 --- a/src/api/api/bulk.ts +++ b/src/api/api/bulk.ts @@ -35,22 +35,20 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Bulk index or delete documents. Performs multiple indexing or delete operations in a single API call. This reduces overhead and can greatly increase indexing speed. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-bulk.html | Elasticsearch API documentation} */ -export default async function BulkApi (this: That, params: T.BulkRequest | TB.BulkRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function BulkApi (this: That, params: T.BulkRequest | TB.BulkRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function BulkApi (this: That, params: T.BulkRequest | TB.BulkRequest, options?: TransportRequestOptions): Promise -export default async function BulkApi (this: That, params: T.BulkRequest | TB.BulkRequest, options?: TransportRequestOptions): Promise { +export default async function BulkApi (this: That, params: T.BulkRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function BulkApi (this: That, params: T.BulkRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function BulkApi (this: That, params: T.BulkRequest, options?: TransportRequestOptions): Promise +export default async function BulkApi (this: That, params: T.BulkRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['operations'] const querystring: Record = {} - // @ts-expect-error - let body: any = params.body ?? undefined + let body: any for (const key in params) { if (acceptedBody.includes(key)) { @@ -58,7 +56,7 @@ export default async function BulkApi -export default async function CapabilitiesApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> -export default async function CapabilitiesApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise -export default async function CapabilitiesApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { +export default async function CapabilitiesApi (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function CapabilitiesApi (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> +export default async function CapabilitiesApi (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise +export default async function CapabilitiesApi (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -54,7 +53,7 @@ export default async function CapabilitiesApi (this: That, params?: T.TODO | TB. for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } diff --git a/src/api/api/cat.ts b/src/api/api/cat.ts index f62938ca8..fb7bcdb06 100644 --- a/src/api/api/cat.ts +++ b/src/api/api/cat.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Cat { @@ -48,10 +47,10 @@ export default class Cat { * Get aliases. Retrieves the cluster’s index aliases, including filter and routing information. The API does not return data stream aliases. CAT APIs are only intended for human consumption using the command line or the Kibana console. They are not intended for use by applications. For application consumption, use the aliases API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-alias.html | Elasticsearch API documentation} */ - async aliases (this: That, params?: T.CatAliasesRequest | TB.CatAliasesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async aliases (this: That, params?: T.CatAliasesRequest | TB.CatAliasesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async aliases (this: That, params?: T.CatAliasesRequest | TB.CatAliasesRequest, options?: TransportRequestOptions): Promise - async aliases (this: That, params?: T.CatAliasesRequest | TB.CatAliasesRequest, options?: TransportRequestOptions): Promise { + async aliases (this: That, params?: T.CatAliasesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async aliases (this: That, params?: T.CatAliasesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async aliases (this: That, params?: T.CatAliasesRequest, options?: TransportRequestOptions): Promise + async aliases (this: That, params?: T.CatAliasesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -60,7 +59,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -88,10 +87,10 @@ export default class Cat { * Provides a snapshot of the number of shards allocated to each data node and their disk space. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-allocation.html | Elasticsearch API documentation} */ - async allocation (this: That, params?: T.CatAllocationRequest | TB.CatAllocationRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async allocation (this: That, params?: T.CatAllocationRequest | TB.CatAllocationRequest, options?: TransportRequestOptionsWithMeta): Promise> - async allocation (this: That, params?: T.CatAllocationRequest | TB.CatAllocationRequest, options?: TransportRequestOptions): Promise - async allocation (this: That, params?: T.CatAllocationRequest | TB.CatAllocationRequest, options?: TransportRequestOptions): Promise { + async allocation (this: That, params?: T.CatAllocationRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async allocation (this: That, params?: T.CatAllocationRequest, options?: TransportRequestOptionsWithMeta): Promise> + async allocation (this: That, params?: T.CatAllocationRequest, options?: TransportRequestOptions): Promise + async allocation (this: That, params?: T.CatAllocationRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['node_id'] const querystring: Record = {} const body = undefined @@ -100,7 +99,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -128,10 +127,10 @@ export default class Cat { * Get component templates. Returns information about component templates in a cluster. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. CAT APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get component template API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-component-templates.html | Elasticsearch API documentation} */ - async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptions): Promise - async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptions): Promise { + async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest, options?: TransportRequestOptions): Promise + async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -140,7 +139,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -168,10 +167,10 @@ export default class Cat { * Get a document count. Provides quick access to a document count for a data stream, an index, or an entire cluster. The document count only includes live documents, not deleted documents which have not yet been removed by the merge process. CAT APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the count API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-count.html | Elasticsearch API documentation} */ - async count (this: That, params?: T.CatCountRequest | TB.CatCountRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async count (this: That, params?: T.CatCountRequest | TB.CatCountRequest, options?: TransportRequestOptionsWithMeta): Promise> - async count (this: That, params?: T.CatCountRequest | TB.CatCountRequest, options?: TransportRequestOptions): Promise - async count (this: That, params?: T.CatCountRequest | TB.CatCountRequest, options?: TransportRequestOptions): Promise { + async count (this: That, params?: T.CatCountRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async count (this: That, params?: T.CatCountRequest, options?: TransportRequestOptionsWithMeta): Promise> + async count (this: That, params?: T.CatCountRequest, options?: TransportRequestOptions): Promise + async count (this: That, params?: T.CatCountRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -180,7 +179,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -208,10 +207,10 @@ export default class Cat { * Returns the amount of heap memory currently used by the field data cache on every data node in the cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes stats API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-fielddata.html | Elasticsearch API documentation} */ - async fielddata (this: That, params?: T.CatFielddataRequest | TB.CatFielddataRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async fielddata (this: That, params?: T.CatFielddataRequest | TB.CatFielddataRequest, options?: TransportRequestOptionsWithMeta): Promise> - async fielddata (this: That, params?: T.CatFielddataRequest | TB.CatFielddataRequest, options?: TransportRequestOptions): Promise - async fielddata (this: That, params?: T.CatFielddataRequest | TB.CatFielddataRequest, options?: TransportRequestOptions): Promise { + async fielddata (this: That, params?: T.CatFielddataRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async fielddata (this: That, params?: T.CatFielddataRequest, options?: TransportRequestOptionsWithMeta): Promise> + async fielddata (this: That, params?: T.CatFielddataRequest, options?: TransportRequestOptions): Promise + async fielddata (this: That, params?: T.CatFielddataRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['fields'] const querystring: Record = {} const body = undefined @@ -220,7 +219,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -248,10 +247,10 @@ export default class Cat { * Returns the health status of a cluster, similar to the cluster health API. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the cluster health API. This API is often used to check malfunctioning clusters. To help you track cluster health alongside log files and alerting systems, the API returns timestamps in two formats: `HH:MM:SS`, which is human-readable but includes no date information; `Unix epoch time`, which is machine-sortable and includes date information. The latter format is useful for cluster recoveries that take multiple days. You can use the cat health API to verify cluster health across multiple nodes. You also can use the API to track the recovery of a large cluster over a longer period of time. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-health.html | Elasticsearch API documentation} */ - async health (this: That, params?: T.CatHealthRequest | TB.CatHealthRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async health (this: That, params?: T.CatHealthRequest | TB.CatHealthRequest, options?: TransportRequestOptionsWithMeta): Promise> - async health (this: That, params?: T.CatHealthRequest | TB.CatHealthRequest, options?: TransportRequestOptions): Promise - async health (this: That, params?: T.CatHealthRequest | TB.CatHealthRequest, options?: TransportRequestOptions): Promise { + async health (this: That, params?: T.CatHealthRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async health (this: That, params?: T.CatHealthRequest, options?: TransportRequestOptionsWithMeta): Promise> + async health (this: That, params?: T.CatHealthRequest, options?: TransportRequestOptions): Promise + async health (this: That, params?: T.CatHealthRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -260,7 +259,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -278,10 +277,10 @@ export default class Cat { * Get CAT help. Returns help for the CAT APIs. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat.html | Elasticsearch API documentation} */ - async help (this: That, params?: T.CatHelpRequest | TB.CatHelpRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async help (this: That, params?: T.CatHelpRequest | TB.CatHelpRequest, options?: TransportRequestOptionsWithMeta): Promise> - async help (this: That, params?: T.CatHelpRequest | TB.CatHelpRequest, options?: TransportRequestOptions): Promise - async help (this: That, params?: T.CatHelpRequest | TB.CatHelpRequest, options?: TransportRequestOptions): Promise { + async help (this: That, params?: T.CatHelpRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async help (this: That, params?: T.CatHelpRequest, options?: TransportRequestOptionsWithMeta): Promise> + async help (this: That, params?: T.CatHelpRequest, options?: TransportRequestOptions): Promise + async help (this: That, params?: T.CatHelpRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -290,7 +289,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -308,10 +307,10 @@ export default class Cat { * Get index information. Returns high-level information about indices in a cluster, including backing indices for data streams. Use this request to get the following information for each index in a cluster: - shard count - document count - deleted document count - primary store size - total store size of all shards, including shard replicas These metrics are retrieved directly from Lucene, which Elasticsearch uses internally to power indexing and search. As a result, all document counts include hidden nested documents. To get an accurate count of Elasticsearch documents, use the cat count or count APIs. CAT APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use an index endpoint. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-indices.html | Elasticsearch API documentation} */ - async indices (this: That, params?: T.CatIndicesRequest | TB.CatIndicesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async indices (this: That, params?: T.CatIndicesRequest | TB.CatIndicesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async indices (this: That, params?: T.CatIndicesRequest | TB.CatIndicesRequest, options?: TransportRequestOptions): Promise - async indices (this: That, params?: T.CatIndicesRequest | TB.CatIndicesRequest, options?: TransportRequestOptions): Promise { + async indices (this: That, params?: T.CatIndicesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async indices (this: That, params?: T.CatIndicesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async indices (this: That, params?: T.CatIndicesRequest, options?: TransportRequestOptions): Promise + async indices (this: That, params?: T.CatIndicesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -320,7 +319,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -348,10 +347,10 @@ export default class Cat { * Returns information about the master node, including the ID, bound IP address, and name. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-master.html | Elasticsearch API documentation} */ - async master (this: That, params?: T.CatMasterRequest | TB.CatMasterRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async master (this: That, params?: T.CatMasterRequest | TB.CatMasterRequest, options?: TransportRequestOptionsWithMeta): Promise> - async master (this: That, params?: T.CatMasterRequest | TB.CatMasterRequest, options?: TransportRequestOptions): Promise - async master (this: That, params?: T.CatMasterRequest | TB.CatMasterRequest, options?: TransportRequestOptions): Promise { + async master (this: That, params?: T.CatMasterRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async master (this: That, params?: T.CatMasterRequest, options?: TransportRequestOptionsWithMeta): Promise> + async master (this: That, params?: T.CatMasterRequest, options?: TransportRequestOptions): Promise + async master (this: That, params?: T.CatMasterRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -360,7 +359,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -378,10 +377,10 @@ export default class Cat { * Get data frame analytics jobs. Returns configuration and usage information about data frame analytics jobs. CAT APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get data frame analytics jobs statistics API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-dfanalytics.html | Elasticsearch API documentation} */ - async mlDataFrameAnalytics (this: That, params?: T.CatMlDataFrameAnalyticsRequest | TB.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async mlDataFrameAnalytics (this: That, params?: T.CatMlDataFrameAnalyticsRequest | TB.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async mlDataFrameAnalytics (this: That, params?: T.CatMlDataFrameAnalyticsRequest | TB.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise - async mlDataFrameAnalytics (this: That, params?: T.CatMlDataFrameAnalyticsRequest | TB.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { + async mlDataFrameAnalytics (this: That, params?: T.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async mlDataFrameAnalytics (this: That, params?: T.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async mlDataFrameAnalytics (this: That, params?: T.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise + async mlDataFrameAnalytics (this: That, params?: T.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -390,7 +389,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -418,10 +417,10 @@ export default class Cat { * Get datafeeds. Returns configuration and usage information about datafeeds. This API returns a maximum of 10,000 datafeeds. If the Elasticsearch security features are enabled, you must have `monitor_ml`, `monitor`, `manage_ml`, or `manage` cluster privileges to use this API. CAT APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get datafeed statistics API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-datafeeds.html | Elasticsearch API documentation} */ - async mlDatafeeds (this: That, params?: T.CatMlDatafeedsRequest | TB.CatMlDatafeedsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async mlDatafeeds (this: That, params?: T.CatMlDatafeedsRequest | TB.CatMlDatafeedsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async mlDatafeeds (this: That, params?: T.CatMlDatafeedsRequest | TB.CatMlDatafeedsRequest, options?: TransportRequestOptions): Promise - async mlDatafeeds (this: That, params?: T.CatMlDatafeedsRequest | TB.CatMlDatafeedsRequest, options?: TransportRequestOptions): Promise { + async mlDatafeeds (this: That, params?: T.CatMlDatafeedsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async mlDatafeeds (this: That, params?: T.CatMlDatafeedsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async mlDatafeeds (this: That, params?: T.CatMlDatafeedsRequest, options?: TransportRequestOptions): Promise + async mlDatafeeds (this: That, params?: T.CatMlDatafeedsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['datafeed_id'] const querystring: Record = {} const body = undefined @@ -430,7 +429,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -458,10 +457,10 @@ export default class Cat { * Get anomaly detection jobs. Returns configuration and usage information for anomaly detection jobs. This API returns a maximum of 10,000 jobs. If the Elasticsearch security features are enabled, you must have `monitor_ml`, `monitor`, `manage_ml`, or `manage` cluster privileges to use this API. CAT APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get anomaly detection job statistics API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-anomaly-detectors.html | Elasticsearch API documentation} */ - async mlJobs (this: That, params?: T.CatMlJobsRequest | TB.CatMlJobsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async mlJobs (this: That, params?: T.CatMlJobsRequest | TB.CatMlJobsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async mlJobs (this: That, params?: T.CatMlJobsRequest | TB.CatMlJobsRequest, options?: TransportRequestOptions): Promise - async mlJobs (this: That, params?: T.CatMlJobsRequest | TB.CatMlJobsRequest, options?: TransportRequestOptions): Promise { + async mlJobs (this: That, params?: T.CatMlJobsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async mlJobs (this: That, params?: T.CatMlJobsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async mlJobs (this: That, params?: T.CatMlJobsRequest, options?: TransportRequestOptions): Promise + async mlJobs (this: That, params?: T.CatMlJobsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id'] const querystring: Record = {} const body = undefined @@ -470,7 +469,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -498,10 +497,10 @@ export default class Cat { * Get trained models. Returns configuration and usage information about inference trained models. CAT APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get trained models statistics API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-trained-model.html | Elasticsearch API documentation} */ - async mlTrainedModels (this: That, params?: T.CatMlTrainedModelsRequest | TB.CatMlTrainedModelsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async mlTrainedModels (this: That, params?: T.CatMlTrainedModelsRequest | TB.CatMlTrainedModelsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async mlTrainedModels (this: That, params?: T.CatMlTrainedModelsRequest | TB.CatMlTrainedModelsRequest, options?: TransportRequestOptions): Promise - async mlTrainedModels (this: That, params?: T.CatMlTrainedModelsRequest | TB.CatMlTrainedModelsRequest, options?: TransportRequestOptions): Promise { + async mlTrainedModels (this: That, params?: T.CatMlTrainedModelsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async mlTrainedModels (this: That, params?: T.CatMlTrainedModelsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async mlTrainedModels (this: That, params?: T.CatMlTrainedModelsRequest, options?: TransportRequestOptions): Promise + async mlTrainedModels (this: That, params?: T.CatMlTrainedModelsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_id'] const querystring: Record = {} const body = undefined @@ -510,7 +509,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -538,10 +537,10 @@ export default class Cat { * Returns information about custom node attributes. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-nodeattrs.html | Elasticsearch API documentation} */ - async nodeattrs (this: That, params?: T.CatNodeattrsRequest | TB.CatNodeattrsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async nodeattrs (this: That, params?: T.CatNodeattrsRequest | TB.CatNodeattrsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async nodeattrs (this: That, params?: T.CatNodeattrsRequest | TB.CatNodeattrsRequest, options?: TransportRequestOptions): Promise - async nodeattrs (this: That, params?: T.CatNodeattrsRequest | TB.CatNodeattrsRequest, options?: TransportRequestOptions): Promise { + async nodeattrs (this: That, params?: T.CatNodeattrsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async nodeattrs (this: That, params?: T.CatNodeattrsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async nodeattrs (this: That, params?: T.CatNodeattrsRequest, options?: TransportRequestOptions): Promise + async nodeattrs (this: That, params?: T.CatNodeattrsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -550,7 +549,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -568,10 +567,10 @@ export default class Cat { * Returns information about the nodes in a cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-nodes.html | Elasticsearch API documentation} */ - async nodes (this: That, params?: T.CatNodesRequest | TB.CatNodesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async nodes (this: That, params?: T.CatNodesRequest | TB.CatNodesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async nodes (this: That, params?: T.CatNodesRequest | TB.CatNodesRequest, options?: TransportRequestOptions): Promise - async nodes (this: That, params?: T.CatNodesRequest | TB.CatNodesRequest, options?: TransportRequestOptions): Promise { + async nodes (this: That, params?: T.CatNodesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async nodes (this: That, params?: T.CatNodesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async nodes (this: That, params?: T.CatNodesRequest, options?: TransportRequestOptions): Promise + async nodes (this: That, params?: T.CatNodesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -580,7 +579,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -598,10 +597,10 @@ export default class Cat { * Returns cluster-level changes that have not yet been executed. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the pending cluster tasks API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-pending-tasks.html | Elasticsearch API documentation} */ - async pendingTasks (this: That, params?: T.CatPendingTasksRequest | TB.CatPendingTasksRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async pendingTasks (this: That, params?: T.CatPendingTasksRequest | TB.CatPendingTasksRequest, options?: TransportRequestOptionsWithMeta): Promise> - async pendingTasks (this: That, params?: T.CatPendingTasksRequest | TB.CatPendingTasksRequest, options?: TransportRequestOptions): Promise - async pendingTasks (this: That, params?: T.CatPendingTasksRequest | TB.CatPendingTasksRequest, options?: TransportRequestOptions): Promise { + async pendingTasks (this: That, params?: T.CatPendingTasksRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async pendingTasks (this: That, params?: T.CatPendingTasksRequest, options?: TransportRequestOptionsWithMeta): Promise> + async pendingTasks (this: That, params?: T.CatPendingTasksRequest, options?: TransportRequestOptions): Promise + async pendingTasks (this: That, params?: T.CatPendingTasksRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -610,7 +609,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -628,10 +627,10 @@ export default class Cat { * Returns a list of plugins running on each node of a cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-plugins.html | Elasticsearch API documentation} */ - async plugins (this: That, params?: T.CatPluginsRequest | TB.CatPluginsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async plugins (this: That, params?: T.CatPluginsRequest | TB.CatPluginsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async plugins (this: That, params?: T.CatPluginsRequest | TB.CatPluginsRequest, options?: TransportRequestOptions): Promise - async plugins (this: That, params?: T.CatPluginsRequest | TB.CatPluginsRequest, options?: TransportRequestOptions): Promise { + async plugins (this: That, params?: T.CatPluginsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async plugins (this: That, params?: T.CatPluginsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async plugins (this: That, params?: T.CatPluginsRequest, options?: TransportRequestOptions): Promise + async plugins (this: That, params?: T.CatPluginsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -640,7 +639,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -658,10 +657,10 @@ export default class Cat { * Returns information about ongoing and completed shard recoveries. Shard recovery is the process of initializing a shard copy, such as restoring a primary shard from a snapshot or syncing a replica shard from a primary shard. When a shard recovery completes, the recovered shard is available for search and indexing. For data streams, the API returns information about the stream’s backing indices. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index recovery API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-recovery.html | Elasticsearch API documentation} */ - async recovery (this: That, params?: T.CatRecoveryRequest | TB.CatRecoveryRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async recovery (this: That, params?: T.CatRecoveryRequest | TB.CatRecoveryRequest, options?: TransportRequestOptionsWithMeta): Promise> - async recovery (this: That, params?: T.CatRecoveryRequest | TB.CatRecoveryRequest, options?: TransportRequestOptions): Promise - async recovery (this: That, params?: T.CatRecoveryRequest | TB.CatRecoveryRequest, options?: TransportRequestOptions): Promise { + async recovery (this: That, params?: T.CatRecoveryRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async recovery (this: That, params?: T.CatRecoveryRequest, options?: TransportRequestOptionsWithMeta): Promise> + async recovery (this: That, params?: T.CatRecoveryRequest, options?: TransportRequestOptions): Promise + async recovery (this: That, params?: T.CatRecoveryRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -670,7 +669,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -698,10 +697,10 @@ export default class Cat { * Returns the snapshot repositories for a cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get snapshot repository API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-repositories.html | Elasticsearch API documentation} */ - async repositories (this: That, params?: T.CatRepositoriesRequest | TB.CatRepositoriesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async repositories (this: That, params?: T.CatRepositoriesRequest | TB.CatRepositoriesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async repositories (this: That, params?: T.CatRepositoriesRequest | TB.CatRepositoriesRequest, options?: TransportRequestOptions): Promise - async repositories (this: That, params?: T.CatRepositoriesRequest | TB.CatRepositoriesRequest, options?: TransportRequestOptions): Promise { + async repositories (this: That, params?: T.CatRepositoriesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async repositories (this: That, params?: T.CatRepositoriesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async repositories (this: That, params?: T.CatRepositoriesRequest, options?: TransportRequestOptions): Promise + async repositories (this: That, params?: T.CatRepositoriesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -710,7 +709,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -728,10 +727,10 @@ export default class Cat { * Returns low-level information about the Lucene segments in index shards. For data streams, the API returns information about the backing indices. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index segments API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-segments.html | Elasticsearch API documentation} */ - async segments (this: That, params?: T.CatSegmentsRequest | TB.CatSegmentsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async segments (this: That, params?: T.CatSegmentsRequest | TB.CatSegmentsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async segments (this: That, params?: T.CatSegmentsRequest | TB.CatSegmentsRequest, options?: TransportRequestOptions): Promise - async segments (this: That, params?: T.CatSegmentsRequest | TB.CatSegmentsRequest, options?: TransportRequestOptions): Promise { + async segments (this: That, params?: T.CatSegmentsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async segments (this: That, params?: T.CatSegmentsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async segments (this: That, params?: T.CatSegmentsRequest, options?: TransportRequestOptions): Promise + async segments (this: That, params?: T.CatSegmentsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -740,7 +739,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -768,10 +767,10 @@ export default class Cat { * Returns information about the shards in a cluster. For data streams, the API returns information about the backing indices. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-shards.html | Elasticsearch API documentation} */ - async shards (this: That, params?: T.CatShardsRequest | TB.CatShardsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async shards (this: That, params?: T.CatShardsRequest | TB.CatShardsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async shards (this: That, params?: T.CatShardsRequest | TB.CatShardsRequest, options?: TransportRequestOptions): Promise - async shards (this: That, params?: T.CatShardsRequest | TB.CatShardsRequest, options?: TransportRequestOptions): Promise { + async shards (this: That, params?: T.CatShardsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async shards (this: That, params?: T.CatShardsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async shards (this: That, params?: T.CatShardsRequest, options?: TransportRequestOptions): Promise + async shards (this: That, params?: T.CatShardsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -780,7 +779,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -808,10 +807,10 @@ export default class Cat { * Returns information about the snapshots stored in one or more repositories. A snapshot is a backup of an index or running Elasticsearch cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get snapshot API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-snapshots.html | Elasticsearch API documentation} */ - async snapshots (this: That, params?: T.CatSnapshotsRequest | TB.CatSnapshotsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async snapshots (this: That, params?: T.CatSnapshotsRequest | TB.CatSnapshotsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async snapshots (this: That, params?: T.CatSnapshotsRequest | TB.CatSnapshotsRequest, options?: TransportRequestOptions): Promise - async snapshots (this: That, params?: T.CatSnapshotsRequest | TB.CatSnapshotsRequest, options?: TransportRequestOptions): Promise { + async snapshots (this: That, params?: T.CatSnapshotsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async snapshots (this: That, params?: T.CatSnapshotsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async snapshots (this: That, params?: T.CatSnapshotsRequest, options?: TransportRequestOptions): Promise + async snapshots (this: That, params?: T.CatSnapshotsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['repository'] const querystring: Record = {} const body = undefined @@ -820,7 +819,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -848,10 +847,10 @@ export default class Cat { * Returns information about tasks currently executing in the cluster. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the task management API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/tasks.html | Elasticsearch API documentation} */ - async tasks (this: That, params?: T.CatTasksRequest | TB.CatTasksRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async tasks (this: That, params?: T.CatTasksRequest | TB.CatTasksRequest, options?: TransportRequestOptionsWithMeta): Promise> - async tasks (this: That, params?: T.CatTasksRequest | TB.CatTasksRequest, options?: TransportRequestOptions): Promise - async tasks (this: That, params?: T.CatTasksRequest | TB.CatTasksRequest, options?: TransportRequestOptions): Promise { + async tasks (this: That, params?: T.CatTasksRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async tasks (this: That, params?: T.CatTasksRequest, options?: TransportRequestOptionsWithMeta): Promise> + async tasks (this: That, params?: T.CatTasksRequest, options?: TransportRequestOptions): Promise + async tasks (this: That, params?: T.CatTasksRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -860,7 +859,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -878,10 +877,10 @@ export default class Cat { * Returns information about index templates in a cluster. You can use index templates to apply index settings and field mappings to new indices at creation. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get index template API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-templates.html | Elasticsearch API documentation} */ - async templates (this: That, params?: T.CatTemplatesRequest | TB.CatTemplatesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async templates (this: That, params?: T.CatTemplatesRequest | TB.CatTemplatesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async templates (this: That, params?: T.CatTemplatesRequest | TB.CatTemplatesRequest, options?: TransportRequestOptions): Promise - async templates (this: That, params?: T.CatTemplatesRequest | TB.CatTemplatesRequest, options?: TransportRequestOptions): Promise { + async templates (this: That, params?: T.CatTemplatesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async templates (this: That, params?: T.CatTemplatesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async templates (this: That, params?: T.CatTemplatesRequest, options?: TransportRequestOptions): Promise + async templates (this: That, params?: T.CatTemplatesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -890,7 +889,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -918,10 +917,10 @@ export default class Cat { * Returns thread pool statistics for each node in a cluster. Returned information includes all built-in thread pools and custom thread pools. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-thread-pool.html | Elasticsearch API documentation} */ - async threadPool (this: That, params?: T.CatThreadPoolRequest | TB.CatThreadPoolRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async threadPool (this: That, params?: T.CatThreadPoolRequest | TB.CatThreadPoolRequest, options?: TransportRequestOptionsWithMeta): Promise> - async threadPool (this: That, params?: T.CatThreadPoolRequest | TB.CatThreadPoolRequest, options?: TransportRequestOptions): Promise - async threadPool (this: That, params?: T.CatThreadPoolRequest | TB.CatThreadPoolRequest, options?: TransportRequestOptions): Promise { + async threadPool (this: That, params?: T.CatThreadPoolRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async threadPool (this: That, params?: T.CatThreadPoolRequest, options?: TransportRequestOptionsWithMeta): Promise> + async threadPool (this: That, params?: T.CatThreadPoolRequest, options?: TransportRequestOptions): Promise + async threadPool (this: That, params?: T.CatThreadPoolRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['thread_pool_patterns'] const querystring: Record = {} const body = undefined @@ -930,7 +929,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -958,10 +957,10 @@ export default class Cat { * Get transforms. Returns configuration and usage information about transforms. CAT APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get transform statistics API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-transforms.html | Elasticsearch API documentation} */ - async transforms (this: That, params?: T.CatTransformsRequest | TB.CatTransformsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async transforms (this: That, params?: T.CatTransformsRequest | TB.CatTransformsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async transforms (this: That, params?: T.CatTransformsRequest | TB.CatTransformsRequest, options?: TransportRequestOptions): Promise - async transforms (this: That, params?: T.CatTransformsRequest | TB.CatTransformsRequest, options?: TransportRequestOptions): Promise { + async transforms (this: That, params?: T.CatTransformsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async transforms (this: That, params?: T.CatTransformsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async transforms (this: That, params?: T.CatTransformsRequest, options?: TransportRequestOptions): Promise + async transforms (this: That, params?: T.CatTransformsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['transform_id'] const querystring: Record = {} const body = undefined @@ -970,7 +969,7 @@ export default class Cat { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/ccr.ts b/src/api/api/ccr.ts index f1521cf50..c914c0042 100644 --- a/src/api/api/ccr.ts +++ b/src/api/api/ccr.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Ccr { @@ -48,10 +47,10 @@ export default class Ccr { * Deletes auto-follow patterns. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-delete-auto-follow-pattern.html | Elasticsearch API documentation} */ - async deleteAutoFollowPattern (this: That, params: T.CcrDeleteAutoFollowPatternRequest | TB.CcrDeleteAutoFollowPatternRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteAutoFollowPattern (this: That, params: T.CcrDeleteAutoFollowPatternRequest | TB.CcrDeleteAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteAutoFollowPattern (this: That, params: T.CcrDeleteAutoFollowPatternRequest | TB.CcrDeleteAutoFollowPatternRequest, options?: TransportRequestOptions): Promise - async deleteAutoFollowPattern (this: That, params: T.CcrDeleteAutoFollowPatternRequest | TB.CcrDeleteAutoFollowPatternRequest, options?: TransportRequestOptions): Promise { + async deleteAutoFollowPattern (this: That, params: T.CcrDeleteAutoFollowPatternRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteAutoFollowPattern (this: That, params: T.CcrDeleteAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteAutoFollowPattern (this: That, params: T.CcrDeleteAutoFollowPatternRequest, options?: TransportRequestOptions): Promise + async deleteAutoFollowPattern (this: That, params: T.CcrDeleteAutoFollowPatternRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Ccr { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -80,30 +79,22 @@ export default class Ccr { * Creates a new follower index configured to follow the referenced leader index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-put-follow.html | Elasticsearch API documentation} */ - async follow (this: That, params: T.CcrFollowRequest | TB.CcrFollowRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async follow (this: That, params: T.CcrFollowRequest | TB.CcrFollowRequest, options?: TransportRequestOptionsWithMeta): Promise> - async follow (this: That, params: T.CcrFollowRequest | TB.CcrFollowRequest, options?: TransportRequestOptions): Promise - async follow (this: That, params: T.CcrFollowRequest | TB.CcrFollowRequest, options?: TransportRequestOptions): Promise { + async follow (this: That, params: T.CcrFollowRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async follow (this: That, params: T.CcrFollowRequest, options?: TransportRequestOptionsWithMeta): Promise> + async follow (this: That, params: T.CcrFollowRequest, options?: TransportRequestOptions): Promise + async follow (this: That, params: T.CcrFollowRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['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'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -124,10 +115,10 @@ export default class Ccr { * Retrieves information about all follower indices, including parameters and status for each follower index * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-get-follow-info.html | Elasticsearch API documentation} */ - async followInfo (this: That, params: T.CcrFollowInfoRequest | TB.CcrFollowInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async followInfo (this: That, params: T.CcrFollowInfoRequest | TB.CcrFollowInfoRequest, options?: TransportRequestOptionsWithMeta): Promise> - async followInfo (this: That, params: T.CcrFollowInfoRequest | TB.CcrFollowInfoRequest, options?: TransportRequestOptions): Promise - async followInfo (this: That, params: T.CcrFollowInfoRequest | TB.CcrFollowInfoRequest, options?: TransportRequestOptions): Promise { + async followInfo (this: That, params: T.CcrFollowInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async followInfo (this: That, params: T.CcrFollowInfoRequest, options?: TransportRequestOptionsWithMeta): Promise> + async followInfo (this: That, params: T.CcrFollowInfoRequest, options?: TransportRequestOptions): Promise + async followInfo (this: That, params: T.CcrFollowInfoRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -135,7 +126,7 @@ export default class Ccr { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -156,10 +147,10 @@ export default class Ccr { * Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-get-follow-stats.html | Elasticsearch API documentation} */ - async followStats (this: That, params: T.CcrFollowStatsRequest | TB.CcrFollowStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async followStats (this: That, params: T.CcrFollowStatsRequest | TB.CcrFollowStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async followStats (this: That, params: T.CcrFollowStatsRequest | TB.CcrFollowStatsRequest, options?: TransportRequestOptions): Promise - async followStats (this: That, params: T.CcrFollowStatsRequest | TB.CcrFollowStatsRequest, options?: TransportRequestOptions): Promise { + async followStats (this: That, params: T.CcrFollowStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async followStats (this: That, params: T.CcrFollowStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async followStats (this: That, params: T.CcrFollowStatsRequest, options?: TransportRequestOptions): Promise + async followStats (this: That, params: T.CcrFollowStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -167,7 +158,7 @@ export default class Ccr { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -188,30 +179,22 @@ export default class Ccr { * Removes the follower retention leases from the leader. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-post-forget-follower.html | Elasticsearch API documentation} */ - async forgetFollower (this: That, params: T.CcrForgetFollowerRequest | TB.CcrForgetFollowerRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async forgetFollower (this: That, params: T.CcrForgetFollowerRequest | TB.CcrForgetFollowerRequest, options?: TransportRequestOptionsWithMeta): Promise> - async forgetFollower (this: That, params: T.CcrForgetFollowerRequest | TB.CcrForgetFollowerRequest, options?: TransportRequestOptions): Promise - async forgetFollower (this: That, params: T.CcrForgetFollowerRequest | TB.CcrForgetFollowerRequest, options?: TransportRequestOptions): Promise { + async forgetFollower (this: That, params: T.CcrForgetFollowerRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async forgetFollower (this: That, params: T.CcrForgetFollowerRequest, options?: TransportRequestOptionsWithMeta): Promise> + async forgetFollower (this: That, params: T.CcrForgetFollowerRequest, options?: TransportRequestOptions): Promise + async forgetFollower (this: That, params: T.CcrForgetFollowerRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['follower_cluster', 'follower_index', 'follower_index_uuid', 'leader_remote_cluster'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -232,10 +215,10 @@ export default class Ccr { * Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-get-auto-follow-pattern.html | Elasticsearch API documentation} */ - async getAutoFollowPattern (this: That, params?: T.CcrGetAutoFollowPatternRequest | TB.CcrGetAutoFollowPatternRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getAutoFollowPattern (this: That, params?: T.CcrGetAutoFollowPatternRequest | TB.CcrGetAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getAutoFollowPattern (this: That, params?: T.CcrGetAutoFollowPatternRequest | TB.CcrGetAutoFollowPatternRequest, options?: TransportRequestOptions): Promise - async getAutoFollowPattern (this: That, params?: T.CcrGetAutoFollowPatternRequest | TB.CcrGetAutoFollowPatternRequest, options?: TransportRequestOptions): Promise { + async getAutoFollowPattern (this: That, params?: T.CcrGetAutoFollowPatternRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getAutoFollowPattern (this: That, params?: T.CcrGetAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getAutoFollowPattern (this: That, params?: T.CcrGetAutoFollowPatternRequest, options?: TransportRequestOptions): Promise + async getAutoFollowPattern (this: That, params?: T.CcrGetAutoFollowPatternRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -244,7 +227,7 @@ export default class Ccr { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -272,10 +255,10 @@ export default class Ccr { * Pauses an auto-follow pattern * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-pause-auto-follow-pattern.html | Elasticsearch API documentation} */ - async pauseAutoFollowPattern (this: That, params: T.CcrPauseAutoFollowPatternRequest | TB.CcrPauseAutoFollowPatternRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async pauseAutoFollowPattern (this: That, params: T.CcrPauseAutoFollowPatternRequest | TB.CcrPauseAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise> - async pauseAutoFollowPattern (this: That, params: T.CcrPauseAutoFollowPatternRequest | TB.CcrPauseAutoFollowPatternRequest, options?: TransportRequestOptions): Promise - async pauseAutoFollowPattern (this: That, params: T.CcrPauseAutoFollowPatternRequest | TB.CcrPauseAutoFollowPatternRequest, options?: TransportRequestOptions): Promise { + async pauseAutoFollowPattern (this: That, params: T.CcrPauseAutoFollowPatternRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async pauseAutoFollowPattern (this: That, params: T.CcrPauseAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise> + async pauseAutoFollowPattern (this: That, params: T.CcrPauseAutoFollowPatternRequest, options?: TransportRequestOptions): Promise + async pauseAutoFollowPattern (this: That, params: T.CcrPauseAutoFollowPatternRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -283,7 +266,7 @@ export default class Ccr { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -304,10 +287,10 @@ export default class Ccr { * Pauses a follower index. The follower index will not fetch any additional operations from the leader index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-post-pause-follow.html | Elasticsearch API documentation} */ - async pauseFollow (this: That, params: T.CcrPauseFollowRequest | TB.CcrPauseFollowRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async pauseFollow (this: That, params: T.CcrPauseFollowRequest | TB.CcrPauseFollowRequest, options?: TransportRequestOptionsWithMeta): Promise> - async pauseFollow (this: That, params: T.CcrPauseFollowRequest | TB.CcrPauseFollowRequest, options?: TransportRequestOptions): Promise - async pauseFollow (this: That, params: T.CcrPauseFollowRequest | TB.CcrPauseFollowRequest, options?: TransportRequestOptions): Promise { + async pauseFollow (this: That, params: T.CcrPauseFollowRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async pauseFollow (this: That, params: T.CcrPauseFollowRequest, options?: TransportRequestOptionsWithMeta): Promise> + async pauseFollow (this: That, params: T.CcrPauseFollowRequest, options?: TransportRequestOptions): Promise + async pauseFollow (this: That, params: T.CcrPauseFollowRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -315,7 +298,7 @@ export default class Ccr { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -336,30 +319,22 @@ export default class Ccr { * Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-put-auto-follow-pattern.html | Elasticsearch API documentation} */ - async putAutoFollowPattern (this: That, params: T.CcrPutAutoFollowPatternRequest | TB.CcrPutAutoFollowPatternRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putAutoFollowPattern (this: That, params: T.CcrPutAutoFollowPatternRequest | TB.CcrPutAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putAutoFollowPattern (this: That, params: T.CcrPutAutoFollowPatternRequest | TB.CcrPutAutoFollowPatternRequest, options?: TransportRequestOptions): Promise - async putAutoFollowPattern (this: That, params: T.CcrPutAutoFollowPatternRequest | TB.CcrPutAutoFollowPatternRequest, options?: TransportRequestOptions): Promise { + async putAutoFollowPattern (this: That, params: T.CcrPutAutoFollowPatternRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putAutoFollowPattern (this: That, params: T.CcrPutAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putAutoFollowPattern (this: That, params: T.CcrPutAutoFollowPatternRequest, options?: TransportRequestOptions): Promise + async putAutoFollowPattern (this: That, params: T.CcrPutAutoFollowPatternRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const acceptedBody: string[] = ['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'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -380,10 +355,10 @@ export default class Ccr { * Resumes an auto-follow pattern that has been paused * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-resume-auto-follow-pattern.html | Elasticsearch API documentation} */ - async resumeAutoFollowPattern (this: That, params: T.CcrResumeAutoFollowPatternRequest | TB.CcrResumeAutoFollowPatternRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async resumeAutoFollowPattern (this: That, params: T.CcrResumeAutoFollowPatternRequest | TB.CcrResumeAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise> - async resumeAutoFollowPattern (this: That, params: T.CcrResumeAutoFollowPatternRequest | TB.CcrResumeAutoFollowPatternRequest, options?: TransportRequestOptions): Promise - async resumeAutoFollowPattern (this: That, params: T.CcrResumeAutoFollowPatternRequest | TB.CcrResumeAutoFollowPatternRequest, options?: TransportRequestOptions): Promise { + async resumeAutoFollowPattern (this: That, params: T.CcrResumeAutoFollowPatternRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async resumeAutoFollowPattern (this: That, params: T.CcrResumeAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise> + async resumeAutoFollowPattern (this: That, params: T.CcrResumeAutoFollowPatternRequest, options?: TransportRequestOptions): Promise + async resumeAutoFollowPattern (this: That, params: T.CcrResumeAutoFollowPatternRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -391,7 +366,7 @@ export default class Ccr { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -412,30 +387,22 @@ export default class Ccr { * Resumes a follower index that has been paused * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-post-resume-follow.html | Elasticsearch API documentation} */ - async resumeFollow (this: That, params: T.CcrResumeFollowRequest | TB.CcrResumeFollowRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async resumeFollow (this: That, params: T.CcrResumeFollowRequest | TB.CcrResumeFollowRequest, options?: TransportRequestOptionsWithMeta): Promise> - async resumeFollow (this: That, params: T.CcrResumeFollowRequest | TB.CcrResumeFollowRequest, options?: TransportRequestOptions): Promise - async resumeFollow (this: That, params: T.CcrResumeFollowRequest | TB.CcrResumeFollowRequest, options?: TransportRequestOptions): Promise { + async resumeFollow (this: That, params: T.CcrResumeFollowRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async resumeFollow (this: That, params: T.CcrResumeFollowRequest, options?: TransportRequestOptionsWithMeta): Promise> + async resumeFollow (this: That, params: T.CcrResumeFollowRequest, options?: TransportRequestOptions): Promise + async resumeFollow (this: That, params: T.CcrResumeFollowRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['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'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -456,10 +423,10 @@ export default class Ccr { * Gets all stats related to cross-cluster replication. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-get-stats.html | Elasticsearch API documentation} */ - async stats (this: That, params?: T.CcrStatsRequest | TB.CcrStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async stats (this: That, params?: T.CcrStatsRequest | TB.CcrStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async stats (this: That, params?: T.CcrStatsRequest | TB.CcrStatsRequest, options?: TransportRequestOptions): Promise - async stats (this: That, params?: T.CcrStatsRequest | TB.CcrStatsRequest, options?: TransportRequestOptions): Promise { + async stats (this: That, params?: T.CcrStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async stats (this: That, params?: T.CcrStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async stats (this: That, params?: T.CcrStatsRequest, options?: TransportRequestOptions): Promise + async stats (this: That, params?: T.CcrStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -468,7 +435,7 @@ export default class Ccr { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -486,10 +453,10 @@ export default class Ccr { * Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-post-unfollow.html | Elasticsearch API documentation} */ - async unfollow (this: That, params: T.CcrUnfollowRequest | TB.CcrUnfollowRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async unfollow (this: That, params: T.CcrUnfollowRequest | TB.CcrUnfollowRequest, options?: TransportRequestOptionsWithMeta): Promise> - async unfollow (this: That, params: T.CcrUnfollowRequest | TB.CcrUnfollowRequest, options?: TransportRequestOptions): Promise - async unfollow (this: That, params: T.CcrUnfollowRequest | TB.CcrUnfollowRequest, options?: TransportRequestOptions): Promise { + async unfollow (this: That, params: T.CcrUnfollowRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async unfollow (this: That, params: T.CcrUnfollowRequest, options?: TransportRequestOptionsWithMeta): Promise> + async unfollow (this: That, params: T.CcrUnfollowRequest, options?: TransportRequestOptions): Promise + async unfollow (this: That, params: T.CcrUnfollowRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -497,7 +464,7 @@ export default class Ccr { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/clear_scroll.ts b/src/api/api/clear_scroll.ts index 7ec586f20..cd67cd9f2 100644 --- a/src/api/api/clear_scroll.ts +++ b/src/api/api/clear_scroll.ts @@ -35,38 +35,29 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Clear a scrolling search. Clear the search context and results for a scrolling search. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/clear-scroll-api.html | Elasticsearch API documentation} */ -export default async function ClearScrollApi (this: That, params?: T.ClearScrollRequest | TB.ClearScrollRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function ClearScrollApi (this: That, params?: T.ClearScrollRequest | TB.ClearScrollRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function ClearScrollApi (this: That, params?: T.ClearScrollRequest | TB.ClearScrollRequest, options?: TransportRequestOptions): Promise -export default async function ClearScrollApi (this: That, params?: T.ClearScrollRequest | TB.ClearScrollRequest, options?: TransportRequestOptions): Promise { +export default async function ClearScrollApi (this: That, params?: T.ClearScrollRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function ClearScrollApi (this: That, params?: T.ClearScrollRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function ClearScrollApi (this: That, params?: T.ClearScrollRequest, options?: TransportRequestOptions): Promise +export default async function ClearScrollApi (this: That, params?: T.ClearScrollRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['scroll_id'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/close_point_in_time.ts b/src/api/api/close_point_in_time.ts index 0959b88c7..d512b9bcf 100644 --- a/src/api/api/close_point_in_time.ts +++ b/src/api/api/close_point_in_time.ts @@ -35,37 +35,28 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Close a point in time. A point in time must be opened explicitly before being used in search requests. The `keep_alive` parameter tells Elasticsearch how long it should persist. A point in time is automatically closed when the `keep_alive` period has elapsed. However, keeping points in time has a cost; close them as soon as they are no longer required for search requests. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/point-in-time-api.html | Elasticsearch API documentation} */ -export default async function ClosePointInTimeApi (this: That, params: T.ClosePointInTimeRequest | TB.ClosePointInTimeRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function ClosePointInTimeApi (this: That, params: T.ClosePointInTimeRequest | TB.ClosePointInTimeRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function ClosePointInTimeApi (this: That, params: T.ClosePointInTimeRequest | TB.ClosePointInTimeRequest, options?: TransportRequestOptions): Promise -export default async function ClosePointInTimeApi (this: That, params: T.ClosePointInTimeRequest | TB.ClosePointInTimeRequest, options?: TransportRequestOptions): Promise { +export default async function ClosePointInTimeApi (this: That, params: T.ClosePointInTimeRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function ClosePointInTimeApi (this: That, params: T.ClosePointInTimeRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function ClosePointInTimeApi (this: That, params: T.ClosePointInTimeRequest, options?: TransportRequestOptions): Promise +export default async function ClosePointInTimeApi (this: That, params: T.ClosePointInTimeRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['id'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/cluster.ts b/src/api/api/cluster.ts index d4d523926..491d20aad 100644 --- a/src/api/api/cluster.ts +++ b/src/api/api/cluster.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Cluster { @@ -48,31 +47,23 @@ export default class Cluster { * Provides explanations for shard allocations in the cluster. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-allocation-explain.html | Elasticsearch API documentation} */ - async allocationExplain (this: That, params?: T.ClusterAllocationExplainRequest | TB.ClusterAllocationExplainRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async allocationExplain (this: That, params?: T.ClusterAllocationExplainRequest | TB.ClusterAllocationExplainRequest, options?: TransportRequestOptionsWithMeta): Promise> - async allocationExplain (this: That, params?: T.ClusterAllocationExplainRequest | TB.ClusterAllocationExplainRequest, options?: TransportRequestOptions): Promise - async allocationExplain (this: That, params?: T.ClusterAllocationExplainRequest | TB.ClusterAllocationExplainRequest, options?: TransportRequestOptions): Promise { + async allocationExplain (this: That, params?: T.ClusterAllocationExplainRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async allocationExplain (this: That, params?: T.ClusterAllocationExplainRequest, options?: TransportRequestOptionsWithMeta): Promise> + async allocationExplain (this: That, params?: T.ClusterAllocationExplainRequest, options?: TransportRequestOptions): Promise + async allocationExplain (this: That, params?: T.ClusterAllocationExplainRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['current_node', 'index', 'primary', 'shard'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -90,10 +81,10 @@ export default class Cluster { * Delete component templates. Deletes component templates. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-component-template.html | Elasticsearch API documentation} */ - async deleteComponentTemplate (this: That, params: T.ClusterDeleteComponentTemplateRequest | TB.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteComponentTemplate (this: That, params: T.ClusterDeleteComponentTemplateRequest | TB.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteComponentTemplate (this: That, params: T.ClusterDeleteComponentTemplateRequest | TB.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptions): Promise - async deleteComponentTemplate (this: That, params: T.ClusterDeleteComponentTemplateRequest | TB.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptions): Promise { + async deleteComponentTemplate (this: That, params: T.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteComponentTemplate (this: That, params: T.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteComponentTemplate (this: That, params: T.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptions): Promise + async deleteComponentTemplate (this: That, params: T.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -101,7 +92,7 @@ export default class Cluster { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -122,10 +113,10 @@ export default class Cluster { * Clears cluster voting config exclusions. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/voting-config-exclusions.html | Elasticsearch API documentation} */ - async deleteVotingConfigExclusions (this: That, params?: T.ClusterDeleteVotingConfigExclusionsRequest | TB.ClusterDeleteVotingConfigExclusionsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteVotingConfigExclusions (this: That, params?: T.ClusterDeleteVotingConfigExclusionsRequest | TB.ClusterDeleteVotingConfigExclusionsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteVotingConfigExclusions (this: That, params?: T.ClusterDeleteVotingConfigExclusionsRequest | TB.ClusterDeleteVotingConfigExclusionsRequest, options?: TransportRequestOptions): Promise - async deleteVotingConfigExclusions (this: That, params?: T.ClusterDeleteVotingConfigExclusionsRequest | TB.ClusterDeleteVotingConfigExclusionsRequest, options?: TransportRequestOptions): Promise { + async deleteVotingConfigExclusions (this: That, params?: T.ClusterDeleteVotingConfigExclusionsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteVotingConfigExclusions (this: That, params?: T.ClusterDeleteVotingConfigExclusionsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteVotingConfigExclusions (this: That, params?: T.ClusterDeleteVotingConfigExclusionsRequest, options?: TransportRequestOptions): Promise + async deleteVotingConfigExclusions (this: That, params?: T.ClusterDeleteVotingConfigExclusionsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -134,7 +125,7 @@ export default class Cluster { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -152,10 +143,10 @@ export default class Cluster { * Check component templates. Returns information about whether a particular component template exists. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-component-template.html | Elasticsearch API documentation} */ - async existsComponentTemplate (this: That, params: T.ClusterExistsComponentTemplateRequest | TB.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async existsComponentTemplate (this: That, params: T.ClusterExistsComponentTemplateRequest | TB.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async existsComponentTemplate (this: That, params: T.ClusterExistsComponentTemplateRequest | TB.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptions): Promise - async existsComponentTemplate (this: That, params: T.ClusterExistsComponentTemplateRequest | TB.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptions): Promise { + async existsComponentTemplate (this: That, params: T.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async existsComponentTemplate (this: That, params: T.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async existsComponentTemplate (this: That, params: T.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptions): Promise + async existsComponentTemplate (this: That, params: T.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -163,7 +154,7 @@ export default class Cluster { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -184,10 +175,10 @@ export default class Cluster { * Get component templates. Retrieves information about component templates. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-component-template.html | Elasticsearch API documentation} */ - async getComponentTemplate (this: That, params?: T.ClusterGetComponentTemplateRequest | TB.ClusterGetComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getComponentTemplate (this: That, params?: T.ClusterGetComponentTemplateRequest | TB.ClusterGetComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getComponentTemplate (this: That, params?: T.ClusterGetComponentTemplateRequest | TB.ClusterGetComponentTemplateRequest, options?: TransportRequestOptions): Promise - async getComponentTemplate (this: That, params?: T.ClusterGetComponentTemplateRequest | TB.ClusterGetComponentTemplateRequest, options?: TransportRequestOptions): Promise { + async getComponentTemplate (this: That, params?: T.ClusterGetComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getComponentTemplate (this: That, params?: T.ClusterGetComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getComponentTemplate (this: That, params?: T.ClusterGetComponentTemplateRequest, options?: TransportRequestOptions): Promise + async getComponentTemplate (this: That, params?: T.ClusterGetComponentTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -196,7 +187,7 @@ export default class Cluster { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -224,10 +215,10 @@ export default class Cluster { * Returns cluster-wide settings. By default, it returns only settings that have been explicitly defined. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-get-settings.html | Elasticsearch API documentation} */ - async getSettings (this: That, params?: T.ClusterGetSettingsRequest | TB.ClusterGetSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getSettings (this: That, params?: T.ClusterGetSettingsRequest | TB.ClusterGetSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getSettings (this: That, params?: T.ClusterGetSettingsRequest | TB.ClusterGetSettingsRequest, options?: TransportRequestOptions): Promise - async getSettings (this: That, params?: T.ClusterGetSettingsRequest | TB.ClusterGetSettingsRequest, options?: TransportRequestOptions): Promise { + async getSettings (this: That, params?: T.ClusterGetSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getSettings (this: That, params?: T.ClusterGetSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getSettings (this: That, params?: T.ClusterGetSettingsRequest, options?: TransportRequestOptions): Promise + async getSettings (this: That, params?: T.ClusterGetSettingsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -236,7 +227,7 @@ export default class Cluster { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -254,10 +245,10 @@ export default class Cluster { * The cluster health API returns a simple status on the health of the cluster. You can also use the API to get the health status of only specified data streams and indices. For data streams, the API retrieves the health status of the stream’s backing indices. The cluster health status is: green, yellow or red. On the shard level, a red status indicates that the specific shard is not allocated in the cluster, yellow means that the primary shard is allocated but replicas are not, and green means that all shards are allocated. The index level status is controlled by the worst shard status. The cluster status is controlled by the worst index status. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-health.html | Elasticsearch API documentation} */ - async health (this: That, params?: T.ClusterHealthRequest | TB.ClusterHealthRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async health (this: That, params?: T.ClusterHealthRequest | TB.ClusterHealthRequest, options?: TransportRequestOptionsWithMeta): Promise> - async health (this: That, params?: T.ClusterHealthRequest | TB.ClusterHealthRequest, options?: TransportRequestOptions): Promise - async health (this: That, params?: T.ClusterHealthRequest | TB.ClusterHealthRequest, options?: TransportRequestOptions): Promise { + async health (this: That, params?: T.ClusterHealthRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async health (this: That, params?: T.ClusterHealthRequest, options?: TransportRequestOptionsWithMeta): Promise> + async health (this: That, params?: T.ClusterHealthRequest, options?: TransportRequestOptions): Promise + async health (this: That, params?: T.ClusterHealthRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -266,7 +257,7 @@ export default class Cluster { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -294,10 +285,10 @@ export default class Cluster { * Get cluster info. Returns basic information about the cluster. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-info.html | Elasticsearch API documentation} */ - async info (this: That, params: T.ClusterInfoRequest | TB.ClusterInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async info (this: That, params: T.ClusterInfoRequest | TB.ClusterInfoRequest, options?: TransportRequestOptionsWithMeta): Promise> - async info (this: That, params: T.ClusterInfoRequest | TB.ClusterInfoRequest, options?: TransportRequestOptions): Promise - async info (this: That, params: T.ClusterInfoRequest | TB.ClusterInfoRequest, options?: TransportRequestOptions): Promise { + async info (this: That, params: T.ClusterInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async info (this: That, params: T.ClusterInfoRequest, options?: TransportRequestOptionsWithMeta): Promise> + async info (this: That, params: T.ClusterInfoRequest, options?: TransportRequestOptions): Promise + async info (this: That, params: T.ClusterInfoRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['target'] const querystring: Record = {} const body = undefined @@ -305,7 +296,7 @@ export default class Cluster { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -326,10 +317,10 @@ export default class Cluster { * Returns cluster-level changes (such as create index, update mapping, allocate or fail shard) that have not yet been executed. NOTE: This API returns a list of any pending updates to the cluster state. These are distinct from the tasks reported by the Task Management API which include periodic tasks and tasks initiated by the user, such as node stats, search queries, or create index requests. However, if a user-initiated task such as a create index command causes a cluster state update, the activity of this task might be reported by both task api and pending cluster tasks API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-pending.html | Elasticsearch API documentation} */ - async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest | TB.ClusterPendingTasksRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest | TB.ClusterPendingTasksRequest, options?: TransportRequestOptionsWithMeta): Promise> - async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest | TB.ClusterPendingTasksRequest, options?: TransportRequestOptions): Promise - async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest | TB.ClusterPendingTasksRequest, options?: TransportRequestOptions): Promise { + async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest, options?: TransportRequestOptionsWithMeta): Promise> + async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest, options?: TransportRequestOptions): Promise + async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -338,7 +329,7 @@ export default class Cluster { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -356,10 +347,10 @@ export default class Cluster { * Updates the cluster voting config exclusions by node ids or node names. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/voting-config-exclusions.html | Elasticsearch API documentation} */ - async postVotingConfigExclusions (this: That, params?: T.ClusterPostVotingConfigExclusionsRequest | TB.ClusterPostVotingConfigExclusionsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async postVotingConfigExclusions (this: That, params?: T.ClusterPostVotingConfigExclusionsRequest | TB.ClusterPostVotingConfigExclusionsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async postVotingConfigExclusions (this: That, params?: T.ClusterPostVotingConfigExclusionsRequest | TB.ClusterPostVotingConfigExclusionsRequest, options?: TransportRequestOptions): Promise - async postVotingConfigExclusions (this: That, params?: T.ClusterPostVotingConfigExclusionsRequest | TB.ClusterPostVotingConfigExclusionsRequest, options?: TransportRequestOptions): Promise { + async postVotingConfigExclusions (this: That, params?: T.ClusterPostVotingConfigExclusionsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async postVotingConfigExclusions (this: That, params?: T.ClusterPostVotingConfigExclusionsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async postVotingConfigExclusions (this: That, params?: T.ClusterPostVotingConfigExclusionsRequest, options?: TransportRequestOptions): Promise + async postVotingConfigExclusions (this: That, params?: T.ClusterPostVotingConfigExclusionsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -368,7 +359,7 @@ export default class Cluster { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -386,30 +377,22 @@ export default class Cluster { * Create or update a component template. Creates or updates a component template. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. An index template can be composed of multiple component templates. To use a component template, specify it in an index template’s `composed_of` list. Component templates are only applied to new data streams and indices as part of a matching index template. Settings and mappings specified directly in the index template or the create index request override any settings or mappings specified in a component template. Component templates are only used during index creation. For data streams, this includes data stream creation and the creation of a stream’s backing indices. Changes to component templates do not affect existing indices, including a stream’s backing indices. You can use C-style `/* *\/` block comments in component templates. You can include comments anywhere in the request body except before the opening curly bracket. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-component-template.html | Elasticsearch API documentation} */ - async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): Promise - async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): Promise { + async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): Promise + async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const acceptedBody: string[] = ['template', 'version', '_meta', 'deprecated'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -430,31 +413,23 @@ export default class Cluster { * Updates the cluster settings. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-update-settings.html | Elasticsearch API documentation} */ - async putSettings (this: That, params?: T.ClusterPutSettingsRequest | TB.ClusterPutSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putSettings (this: That, params?: T.ClusterPutSettingsRequest | TB.ClusterPutSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putSettings (this: That, params?: T.ClusterPutSettingsRequest | TB.ClusterPutSettingsRequest, options?: TransportRequestOptions): Promise - async putSettings (this: That, params?: T.ClusterPutSettingsRequest | TB.ClusterPutSettingsRequest, options?: TransportRequestOptions): Promise { + async putSettings (this: That, params?: T.ClusterPutSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putSettings (this: That, params?: T.ClusterPutSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putSettings (this: That, params?: T.ClusterPutSettingsRequest, options?: TransportRequestOptions): Promise + async putSettings (this: That, params?: T.ClusterPutSettingsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['persistent', 'transient'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -472,10 +447,10 @@ export default class Cluster { * The cluster remote info API allows you to retrieve all of the configured remote cluster information. It returns connection and endpoint information keyed by the configured remote cluster alias. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-remote-info.html | Elasticsearch API documentation} */ - async remoteInfo (this: That, params?: T.ClusterRemoteInfoRequest | TB.ClusterRemoteInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async remoteInfo (this: That, params?: T.ClusterRemoteInfoRequest | TB.ClusterRemoteInfoRequest, options?: TransportRequestOptionsWithMeta): Promise> - async remoteInfo (this: That, params?: T.ClusterRemoteInfoRequest | TB.ClusterRemoteInfoRequest, options?: TransportRequestOptions): Promise - async remoteInfo (this: That, params?: T.ClusterRemoteInfoRequest | TB.ClusterRemoteInfoRequest, options?: TransportRequestOptions): Promise { + async remoteInfo (this: That, params?: T.ClusterRemoteInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async remoteInfo (this: That, params?: T.ClusterRemoteInfoRequest, options?: TransportRequestOptionsWithMeta): Promise> + async remoteInfo (this: That, params?: T.ClusterRemoteInfoRequest, options?: TransportRequestOptions): Promise + async remoteInfo (this: That, params?: T.ClusterRemoteInfoRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -484,7 +459,7 @@ export default class Cluster { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -502,31 +477,23 @@ export default class Cluster { * Allows to manually change the allocation of individual shards in the cluster. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-reroute.html | Elasticsearch API documentation} */ - async reroute (this: That, params?: T.ClusterRerouteRequest | TB.ClusterRerouteRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async reroute (this: That, params?: T.ClusterRerouteRequest | TB.ClusterRerouteRequest, options?: TransportRequestOptionsWithMeta): Promise> - async reroute (this: That, params?: T.ClusterRerouteRequest | TB.ClusterRerouteRequest, options?: TransportRequestOptions): Promise - async reroute (this: That, params?: T.ClusterRerouteRequest | TB.ClusterRerouteRequest, options?: TransportRequestOptions): Promise { + async reroute (this: That, params?: T.ClusterRerouteRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async reroute (this: That, params?: T.ClusterRerouteRequest, options?: TransportRequestOptionsWithMeta): Promise> + async reroute (this: That, params?: T.ClusterRerouteRequest, options?: TransportRequestOptions): Promise + async reroute (this: That, params?: T.ClusterRerouteRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['commands'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -544,10 +511,10 @@ export default class Cluster { * Returns a comprehensive information about the state of the cluster. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-state.html | Elasticsearch API documentation} */ - async state (this: That, params?: T.ClusterStateRequest | TB.ClusterStateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async state (this: That, params?: T.ClusterStateRequest | TB.ClusterStateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async state (this: That, params?: T.ClusterStateRequest | TB.ClusterStateRequest, options?: TransportRequestOptions): Promise - async state (this: That, params?: T.ClusterStateRequest | TB.ClusterStateRequest, options?: TransportRequestOptions): Promise { + async state (this: That, params?: T.ClusterStateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async state (this: That, params?: T.ClusterStateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async state (this: That, params?: T.ClusterStateRequest, options?: TransportRequestOptions): Promise + async state (this: That, params?: T.ClusterStateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['metric', 'index'] const querystring: Record = {} const body = undefined @@ -556,7 +523,7 @@ export default class Cluster { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -588,10 +555,10 @@ export default class Cluster { * Returns cluster statistics. It returns basic index metrics (shard numbers, store size, memory usage) and information about the current nodes that form the cluster (number, roles, os, jvm versions, memory usage, cpu and installed plugins). * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-stats.html | Elasticsearch API documentation} */ - async stats (this: That, params?: T.ClusterStatsRequest | TB.ClusterStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async stats (this: That, params?: T.ClusterStatsRequest | TB.ClusterStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async stats (this: That, params?: T.ClusterStatsRequest | TB.ClusterStatsRequest, options?: TransportRequestOptions): Promise - async stats (this: That, params?: T.ClusterStatsRequest | TB.ClusterStatsRequest, options?: TransportRequestOptions): Promise { + async stats (this: That, params?: T.ClusterStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async stats (this: That, params?: T.ClusterStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async stats (this: That, params?: T.ClusterStatsRequest, options?: TransportRequestOptions): Promise + async stats (this: That, params?: T.ClusterStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['node_id'] const querystring: Record = {} const body = undefined @@ -600,7 +567,7 @@ export default class Cluster { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/connector.ts b/src/api/api/connector.ts index 6e2e4de9a..5439be605 100644 --- a/src/api/api/connector.ts +++ b/src/api/api/connector.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Connector { @@ -48,10 +47,10 @@ export default class Connector { * Check in a connector. Update the `last_seen` field in the connector and set it to the current timestamp. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/check-in-connector-api.html | Elasticsearch API documentation} */ - async checkIn (this: That, params: T.ConnectorCheckInRequest | TB.ConnectorCheckInRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async checkIn (this: That, params: T.ConnectorCheckInRequest | TB.ConnectorCheckInRequest, options?: TransportRequestOptionsWithMeta): Promise> - async checkIn (this: That, params: T.ConnectorCheckInRequest | TB.ConnectorCheckInRequest, options?: TransportRequestOptions): Promise - async checkIn (this: That, params: T.ConnectorCheckInRequest | TB.ConnectorCheckInRequest, options?: TransportRequestOptions): Promise { + async checkIn (this: That, params: T.ConnectorCheckInRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async checkIn (this: That, params: T.ConnectorCheckInRequest, options?: TransportRequestOptionsWithMeta): Promise> + async checkIn (this: That, params: T.ConnectorCheckInRequest, options?: TransportRequestOptions): Promise + async checkIn (this: That, params: T.ConnectorCheckInRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Connector { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -80,10 +79,10 @@ export default class Connector { * Delete a connector. Removes a connector and associated sync jobs. This is a destructive action that is not recoverable. NOTE: This action doesn’t delete any API keys, ingest pipelines, or data indices associated with the connector. These need to be removed manually. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-connector-api.html | Elasticsearch API documentation} */ - async delete (this: That, params: T.ConnectorDeleteRequest | TB.ConnectorDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async delete (this: That, params: T.ConnectorDeleteRequest | TB.ConnectorDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> - async delete (this: That, params: T.ConnectorDeleteRequest | TB.ConnectorDeleteRequest, options?: TransportRequestOptions): Promise - async delete (this: That, params: T.ConnectorDeleteRequest | TB.ConnectorDeleteRequest, options?: TransportRequestOptions): Promise { + async delete (this: That, params: T.ConnectorDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async delete (this: That, params: T.ConnectorDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> + async delete (this: That, params: T.ConnectorDeleteRequest, options?: TransportRequestOptions): Promise + async delete (this: That, params: T.ConnectorDeleteRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const querystring: Record = {} const body = undefined @@ -91,7 +90,7 @@ export default class Connector { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -112,10 +111,10 @@ export default class Connector { * Get a connector. Get the details about a connector. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-connector-api.html | Elasticsearch API documentation} */ - async get (this: That, params: T.ConnectorGetRequest | TB.ConnectorGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async get (this: That, params: T.ConnectorGetRequest | TB.ConnectorGetRequest, options?: TransportRequestOptionsWithMeta): Promise> - async get (this: That, params: T.ConnectorGetRequest | TB.ConnectorGetRequest, options?: TransportRequestOptions): Promise - async get (this: That, params: T.ConnectorGetRequest | TB.ConnectorGetRequest, options?: TransportRequestOptions): Promise { + async get (this: That, params: T.ConnectorGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async get (this: That, params: T.ConnectorGetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async get (this: That, params: T.ConnectorGetRequest, options?: TransportRequestOptions): Promise + async get (this: That, params: T.ConnectorGetRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const querystring: Record = {} const body = undefined @@ -123,7 +122,7 @@ export default class Connector { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -144,30 +143,22 @@ export default class Connector { * Update the connector last sync stats. Update the fields related to the last sync of a connector. This action is used for analytics and monitoring. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-connector-last-sync-api.html | Elasticsearch API documentation} */ - async lastSync (this: That, params: T.ConnectorLastSyncRequest | TB.ConnectorLastSyncRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async lastSync (this: That, params: T.ConnectorLastSyncRequest | TB.ConnectorLastSyncRequest, options?: TransportRequestOptionsWithMeta): Promise> - async lastSync (this: That, params: T.ConnectorLastSyncRequest | TB.ConnectorLastSyncRequest, options?: TransportRequestOptions): Promise - async lastSync (this: That, params: T.ConnectorLastSyncRequest | TB.ConnectorLastSyncRequest, options?: TransportRequestOptions): Promise { + async lastSync (this: That, params: T.ConnectorLastSyncRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async lastSync (this: That, params: T.ConnectorLastSyncRequest, options?: TransportRequestOptionsWithMeta): Promise> + async lastSync (this: That, params: T.ConnectorLastSyncRequest, options?: TransportRequestOptions): Promise + async lastSync (this: That, params: T.ConnectorLastSyncRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const acceptedBody: string[] = ['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'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -188,10 +179,10 @@ export default class Connector { * Get all connectors. Get information about all connectors. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/list-connector-api.html | Elasticsearch API documentation} */ - async list (this: That, params?: T.ConnectorListRequest | TB.ConnectorListRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async list (this: That, params?: T.ConnectorListRequest | TB.ConnectorListRequest, options?: TransportRequestOptionsWithMeta): Promise> - async list (this: That, params?: T.ConnectorListRequest | TB.ConnectorListRequest, options?: TransportRequestOptions): Promise - async list (this: That, params?: T.ConnectorListRequest | TB.ConnectorListRequest, options?: TransportRequestOptions): Promise { + async list (this: That, params?: T.ConnectorListRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async list (this: That, params?: T.ConnectorListRequest, options?: TransportRequestOptionsWithMeta): Promise> + async list (this: That, params?: T.ConnectorListRequest, options?: TransportRequestOptions): Promise + async list (this: That, params?: T.ConnectorListRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -200,7 +191,7 @@ export default class Connector { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -218,31 +209,23 @@ export default class Connector { * Create a connector. Connectors are Elasticsearch integrations that bring content from third-party data sources, which can be deployed on Elastic Cloud or hosted on your own infrastructure. Elastic managed connectors (Native connectors) are a managed service on Elastic Cloud. Self-managed connectors (Connector clients) are self-managed on your infrastructure. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/create-connector-api.html | Elasticsearch API documentation} */ - async post (this: That, params?: T.ConnectorPostRequest | TB.ConnectorPostRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async post (this: That, params?: T.ConnectorPostRequest | TB.ConnectorPostRequest, options?: TransportRequestOptionsWithMeta): Promise> - async post (this: That, params?: T.ConnectorPostRequest | TB.ConnectorPostRequest, options?: TransportRequestOptions): Promise - async post (this: That, params?: T.ConnectorPostRequest | TB.ConnectorPostRequest, options?: TransportRequestOptions): Promise { + async post (this: That, params?: T.ConnectorPostRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async post (this: That, params?: T.ConnectorPostRequest, options?: TransportRequestOptionsWithMeta): Promise> + async post (this: That, params?: T.ConnectorPostRequest, options?: TransportRequestOptions): Promise + async post (this: That, params?: T.ConnectorPostRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['description', 'index_name', 'is_native', 'language', 'name', 'service_type'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -260,31 +243,23 @@ export default class Connector { * Create or update a connector. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/create-connector-api.html | Elasticsearch API documentation} */ - async put (this: That, params?: T.ConnectorPutRequest | TB.ConnectorPutRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async put (this: That, params?: T.ConnectorPutRequest | TB.ConnectorPutRequest, options?: TransportRequestOptionsWithMeta): Promise> - async put (this: That, params?: T.ConnectorPutRequest | TB.ConnectorPutRequest, options?: TransportRequestOptions): Promise - async put (this: That, params?: T.ConnectorPutRequest | TB.ConnectorPutRequest, options?: TransportRequestOptions): Promise { + async put (this: That, params?: T.ConnectorPutRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async put (this: That, params?: T.ConnectorPutRequest, options?: TransportRequestOptionsWithMeta): Promise> + async put (this: That, params?: T.ConnectorPutRequest, options?: TransportRequestOptions): Promise + async put (this: That, params?: T.ConnectorPutRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const acceptedBody: string[] = ['description', 'index_name', 'is_native', 'language', 'name', 'service_type'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -311,10 +286,10 @@ export default class Connector { /** * Deletes a connector secret. */ - async secretDelete (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async secretDelete (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async secretDelete (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async secretDelete (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async secretDelete (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async secretDelete (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async secretDelete (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async secretDelete (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -323,7 +298,7 @@ export default class Connector { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -342,10 +317,10 @@ export default class Connector { /** * Retrieves a secret stored by Connectors. */ - async secretGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async secretGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async secretGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async secretGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async secretGet (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async secretGet (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async secretGet (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async secretGet (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -354,7 +329,7 @@ export default class Connector { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -373,10 +348,10 @@ export default class Connector { /** * Creates a secret for a Connector. */ - async secretPost (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async secretPost (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async secretPost (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async secretPost (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async secretPost (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async secretPost (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async secretPost (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async secretPost (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -385,7 +360,7 @@ export default class Connector { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -401,10 +376,10 @@ export default class Connector { /** * Creates or updates a secret for a Connector. */ - async secretPut (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async secretPut (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async secretPut (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async secretPut (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async secretPut (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async secretPut (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async secretPut (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async secretPut (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -413,7 +388,7 @@ export default class Connector { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -433,10 +408,10 @@ export default class Connector { * Cancel a connector sync job. Cancel a connector sync job, which sets the status to cancelling and updates `cancellation_requested_at` to the current time. The connector service is then responsible for setting the status of connector sync jobs to cancelled. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cancel-connector-sync-job-api.html | Elasticsearch API documentation} */ - async syncJobCancel (this: That, params: T.ConnectorSyncJobCancelRequest | TB.ConnectorSyncJobCancelRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async syncJobCancel (this: That, params: T.ConnectorSyncJobCancelRequest | TB.ConnectorSyncJobCancelRequest, options?: TransportRequestOptionsWithMeta): Promise> - async syncJobCancel (this: That, params: T.ConnectorSyncJobCancelRequest | TB.ConnectorSyncJobCancelRequest, options?: TransportRequestOptions): Promise - async syncJobCancel (this: That, params: T.ConnectorSyncJobCancelRequest | TB.ConnectorSyncJobCancelRequest, options?: TransportRequestOptions): Promise { + async syncJobCancel (this: That, params: T.ConnectorSyncJobCancelRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async syncJobCancel (this: That, params: T.ConnectorSyncJobCancelRequest, options?: TransportRequestOptionsWithMeta): Promise> + async syncJobCancel (this: That, params: T.ConnectorSyncJobCancelRequest, options?: TransportRequestOptions): Promise + async syncJobCancel (this: That, params: T.ConnectorSyncJobCancelRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_sync_job_id'] const querystring: Record = {} const body = undefined @@ -444,7 +419,7 @@ export default class Connector { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -465,10 +440,10 @@ export default class Connector { * Checks in a connector sync job (refreshes 'last_seen'). * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/check-in-connector-sync-job-api.html | Elasticsearch API documentation} */ - async syncJobCheckIn (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async syncJobCheckIn (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async syncJobCheckIn (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async syncJobCheckIn (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async syncJobCheckIn (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async syncJobCheckIn (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async syncJobCheckIn (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async syncJobCheckIn (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_sync_job_id'] const querystring: Record = {} const body = undefined @@ -477,7 +452,7 @@ export default class Connector { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -497,10 +472,10 @@ export default class Connector { * Claims a connector sync job. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/claim-connector-sync-job-api.html | Elasticsearch API documentation} */ - async syncJobClaim (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async syncJobClaim (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async syncJobClaim (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async syncJobClaim (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async syncJobClaim (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async syncJobClaim (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async syncJobClaim (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async syncJobClaim (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_sync_job_id'] const querystring: Record = {} const body = undefined @@ -509,7 +484,7 @@ export default class Connector { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -529,10 +504,10 @@ export default class Connector { * Delete a connector sync job. Remove a connector sync job and its associated data. This is a destructive action that is not recoverable. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-connector-sync-job-api.html | Elasticsearch API documentation} */ - async syncJobDelete (this: That, params: T.ConnectorSyncJobDeleteRequest | TB.ConnectorSyncJobDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async syncJobDelete (this: That, params: T.ConnectorSyncJobDeleteRequest | TB.ConnectorSyncJobDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> - async syncJobDelete (this: That, params: T.ConnectorSyncJobDeleteRequest | TB.ConnectorSyncJobDeleteRequest, options?: TransportRequestOptions): Promise - async syncJobDelete (this: That, params: T.ConnectorSyncJobDeleteRequest | TB.ConnectorSyncJobDeleteRequest, options?: TransportRequestOptions): Promise { + async syncJobDelete (this: That, params: T.ConnectorSyncJobDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async syncJobDelete (this: That, params: T.ConnectorSyncJobDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> + async syncJobDelete (this: That, params: T.ConnectorSyncJobDeleteRequest, options?: TransportRequestOptions): Promise + async syncJobDelete (this: That, params: T.ConnectorSyncJobDeleteRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_sync_job_id'] const querystring: Record = {} const body = undefined @@ -540,7 +515,7 @@ export default class Connector { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -561,10 +536,10 @@ export default class Connector { * Sets an error for a connector sync job. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/set-connector-sync-job-error-api.html | Elasticsearch API documentation} */ - async syncJobError (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async syncJobError (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async syncJobError (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async syncJobError (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async syncJobError (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async syncJobError (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async syncJobError (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async syncJobError (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_sync_job_id'] const querystring: Record = {} const body = undefined @@ -573,7 +548,7 @@ export default class Connector { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -593,10 +568,10 @@ export default class Connector { * Get a connector sync job. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-connector-sync-job-api.html | Elasticsearch API documentation} */ - async syncJobGet (this: That, params: T.ConnectorSyncJobGetRequest | TB.ConnectorSyncJobGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async syncJobGet (this: That, params: T.ConnectorSyncJobGetRequest | TB.ConnectorSyncJobGetRequest, options?: TransportRequestOptionsWithMeta): Promise> - async syncJobGet (this: That, params: T.ConnectorSyncJobGetRequest | TB.ConnectorSyncJobGetRequest, options?: TransportRequestOptions): Promise - async syncJobGet (this: That, params: T.ConnectorSyncJobGetRequest | TB.ConnectorSyncJobGetRequest, options?: TransportRequestOptions): Promise { + async syncJobGet (this: That, params: T.ConnectorSyncJobGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async syncJobGet (this: That, params: T.ConnectorSyncJobGetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async syncJobGet (this: That, params: T.ConnectorSyncJobGetRequest, options?: TransportRequestOptions): Promise + async syncJobGet (this: That, params: T.ConnectorSyncJobGetRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_sync_job_id'] const querystring: Record = {} const body = undefined @@ -604,7 +579,7 @@ export default class Connector { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -625,10 +600,10 @@ export default class Connector { * Get all connector sync jobs. Get information about all stored connector sync jobs listed by their creation date in ascending order. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/list-connector-sync-jobs-api.html | Elasticsearch API documentation} */ - async syncJobList (this: That, params?: T.ConnectorSyncJobListRequest | TB.ConnectorSyncJobListRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async syncJobList (this: That, params?: T.ConnectorSyncJobListRequest | TB.ConnectorSyncJobListRequest, options?: TransportRequestOptionsWithMeta): Promise> - async syncJobList (this: That, params?: T.ConnectorSyncJobListRequest | TB.ConnectorSyncJobListRequest, options?: TransportRequestOptions): Promise - async syncJobList (this: That, params?: T.ConnectorSyncJobListRequest | TB.ConnectorSyncJobListRequest, options?: TransportRequestOptions): Promise { + async syncJobList (this: That, params?: T.ConnectorSyncJobListRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async syncJobList (this: That, params?: T.ConnectorSyncJobListRequest, options?: TransportRequestOptionsWithMeta): Promise> + async syncJobList (this: That, params?: T.ConnectorSyncJobListRequest, options?: TransportRequestOptions): Promise + async syncJobList (this: That, params?: T.ConnectorSyncJobListRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -637,7 +612,7 @@ export default class Connector { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -655,30 +630,22 @@ export default class Connector { * Create a connector sync job. Create a connector sync job document in the internal index and initialize its counters and timestamps with default values. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/create-connector-sync-job-api.html | Elasticsearch API documentation} */ - async syncJobPost (this: That, params: T.ConnectorSyncJobPostRequest | TB.ConnectorSyncJobPostRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async syncJobPost (this: That, params: T.ConnectorSyncJobPostRequest | TB.ConnectorSyncJobPostRequest, options?: TransportRequestOptionsWithMeta): Promise> - async syncJobPost (this: That, params: T.ConnectorSyncJobPostRequest | TB.ConnectorSyncJobPostRequest, options?: TransportRequestOptions): Promise - async syncJobPost (this: That, params: T.ConnectorSyncJobPostRequest | TB.ConnectorSyncJobPostRequest, options?: TransportRequestOptions): Promise { + async syncJobPost (this: That, params: T.ConnectorSyncJobPostRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async syncJobPost (this: That, params: T.ConnectorSyncJobPostRequest, options?: TransportRequestOptionsWithMeta): Promise> + async syncJobPost (this: That, params: T.ConnectorSyncJobPostRequest, options?: TransportRequestOptions): Promise + async syncJobPost (this: That, params: T.ConnectorSyncJobPostRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['id', 'job_type', 'trigger_method'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -696,10 +663,10 @@ export default class Connector { * Updates the stats fields in the connector sync job document. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/set-connector-sync-job-stats-api.html | Elasticsearch API documentation} */ - async syncJobUpdateStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async syncJobUpdateStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async syncJobUpdateStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async syncJobUpdateStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async syncJobUpdateStats (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async syncJobUpdateStats (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async syncJobUpdateStats (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async syncJobUpdateStats (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_sync_job_id'] const querystring: Record = {} const body = undefined @@ -708,7 +675,7 @@ export default class Connector { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -728,10 +695,10 @@ export default class Connector { * Activate the connector draft filter. Activates the valid draft filtering for a connector. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-connector-filtering-api.html | Elasticsearch API documentation} */ - async updateActiveFiltering (this: That, params: T.ConnectorUpdateActiveFilteringRequest | TB.ConnectorUpdateActiveFilteringRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateActiveFiltering (this: That, params: T.ConnectorUpdateActiveFilteringRequest | TB.ConnectorUpdateActiveFilteringRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateActiveFiltering (this: That, params: T.ConnectorUpdateActiveFilteringRequest | TB.ConnectorUpdateActiveFilteringRequest, options?: TransportRequestOptions): Promise - async updateActiveFiltering (this: That, params: T.ConnectorUpdateActiveFilteringRequest | TB.ConnectorUpdateActiveFilteringRequest, options?: TransportRequestOptions): Promise { + async updateActiveFiltering (this: That, params: T.ConnectorUpdateActiveFilteringRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateActiveFiltering (this: That, params: T.ConnectorUpdateActiveFilteringRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateActiveFiltering (this: That, params: T.ConnectorUpdateActiveFilteringRequest, options?: TransportRequestOptions): Promise + async updateActiveFiltering (this: That, params: T.ConnectorUpdateActiveFilteringRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const querystring: Record = {} const body = undefined @@ -739,7 +706,7 @@ export default class Connector { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -760,30 +727,22 @@ export default class Connector { * Update the connector API key ID. Update the `api_key_id` and `api_key_secret_id` fields of a connector. You can specify the ID of the API key used for authorization and the ID of the connector secret where the API key is stored. The connector secret ID is required only for Elastic managed (native) connectors. Self-managed connectors (connector clients) do not use this field. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-connector-api-key-id-api.html | Elasticsearch API documentation} */ - async updateApiKeyId (this: That, params: T.ConnectorUpdateApiKeyIdRequest | TB.ConnectorUpdateApiKeyIdRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateApiKeyId (this: That, params: T.ConnectorUpdateApiKeyIdRequest | TB.ConnectorUpdateApiKeyIdRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateApiKeyId (this: That, params: T.ConnectorUpdateApiKeyIdRequest | TB.ConnectorUpdateApiKeyIdRequest, options?: TransportRequestOptions): Promise - async updateApiKeyId (this: That, params: T.ConnectorUpdateApiKeyIdRequest | TB.ConnectorUpdateApiKeyIdRequest, options?: TransportRequestOptions): Promise { + async updateApiKeyId (this: That, params: T.ConnectorUpdateApiKeyIdRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateApiKeyId (this: That, params: T.ConnectorUpdateApiKeyIdRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateApiKeyId (this: That, params: T.ConnectorUpdateApiKeyIdRequest, options?: TransportRequestOptions): Promise + async updateApiKeyId (this: That, params: T.ConnectorUpdateApiKeyIdRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const acceptedBody: string[] = ['api_key_id', 'api_key_secret_id'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -804,30 +763,22 @@ export default class Connector { * Update the connector configuration. Update the configuration field in the connector document. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-connector-configuration-api.html | Elasticsearch API documentation} */ - async updateConfiguration (this: That, params: T.ConnectorUpdateConfigurationRequest | TB.ConnectorUpdateConfigurationRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateConfiguration (this: That, params: T.ConnectorUpdateConfigurationRequest | TB.ConnectorUpdateConfigurationRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateConfiguration (this: That, params: T.ConnectorUpdateConfigurationRequest | TB.ConnectorUpdateConfigurationRequest, options?: TransportRequestOptions): Promise - async updateConfiguration (this: That, params: T.ConnectorUpdateConfigurationRequest | TB.ConnectorUpdateConfigurationRequest, options?: TransportRequestOptions): Promise { + async updateConfiguration (this: That, params: T.ConnectorUpdateConfigurationRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateConfiguration (this: That, params: T.ConnectorUpdateConfigurationRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateConfiguration (this: That, params: T.ConnectorUpdateConfigurationRequest, options?: TransportRequestOptions): Promise + async updateConfiguration (this: That, params: T.ConnectorUpdateConfigurationRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const acceptedBody: string[] = ['configuration', 'values'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -848,30 +799,22 @@ export default class Connector { * Update the connector error field. Set the error field for the connector. If the error provided in the request body is non-null, the connector’s status is updated to error. Otherwise, if the error is reset to null, the connector status is updated to connected. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-connector-error-api.html | Elasticsearch API documentation} */ - async updateError (this: That, params: T.ConnectorUpdateErrorRequest | TB.ConnectorUpdateErrorRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateError (this: That, params: T.ConnectorUpdateErrorRequest | TB.ConnectorUpdateErrorRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateError (this: That, params: T.ConnectorUpdateErrorRequest | TB.ConnectorUpdateErrorRequest, options?: TransportRequestOptions): Promise - async updateError (this: That, params: T.ConnectorUpdateErrorRequest | TB.ConnectorUpdateErrorRequest, options?: TransportRequestOptions): Promise { + async updateError (this: That, params: T.ConnectorUpdateErrorRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateError (this: That, params: T.ConnectorUpdateErrorRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateError (this: That, params: T.ConnectorUpdateErrorRequest, options?: TransportRequestOptions): Promise + async updateError (this: That, params: T.ConnectorUpdateErrorRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const acceptedBody: string[] = ['error'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -892,10 +835,10 @@ export default class Connector { * Updates the connector features in the connector document. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-connector-features-api.html | Elasticsearch API documentation} */ - async updateFeatures (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async updateFeatures (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async updateFeatures (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async updateFeatures (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async updateFeatures (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async updateFeatures (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async updateFeatures (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async updateFeatures (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const querystring: Record = {} const body = undefined @@ -904,7 +847,7 @@ export default class Connector { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -924,30 +867,22 @@ export default class Connector { * Update the connector filtering. Update the draft filtering configuration of a connector and marks the draft validation state as edited. The filtering draft is activated once validated by the running Elastic connector service. The filtering property is used to configure sync rules (both basic and advanced) for a connector. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-connector-filtering-api.html | Elasticsearch API documentation} */ - async updateFiltering (this: That, params: T.ConnectorUpdateFilteringRequest | TB.ConnectorUpdateFilteringRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateFiltering (this: That, params: T.ConnectorUpdateFilteringRequest | TB.ConnectorUpdateFilteringRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateFiltering (this: That, params: T.ConnectorUpdateFilteringRequest | TB.ConnectorUpdateFilteringRequest, options?: TransportRequestOptions): Promise - async updateFiltering (this: That, params: T.ConnectorUpdateFilteringRequest | TB.ConnectorUpdateFilteringRequest, options?: TransportRequestOptions): Promise { + async updateFiltering (this: That, params: T.ConnectorUpdateFilteringRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateFiltering (this: That, params: T.ConnectorUpdateFilteringRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateFiltering (this: That, params: T.ConnectorUpdateFilteringRequest, options?: TransportRequestOptions): Promise + async updateFiltering (this: That, params: T.ConnectorUpdateFilteringRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const acceptedBody: string[] = ['filtering', 'rules', 'advanced_snippet'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -968,30 +903,22 @@ export default class Connector { * Update the connector draft filtering validation. Update the draft filtering validation info for a connector. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-connector-filtering-validation-api.html | Elasticsearch API documentation} */ - async updateFilteringValidation (this: That, params: T.ConnectorUpdateFilteringValidationRequest | TB.ConnectorUpdateFilteringValidationRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateFilteringValidation (this: That, params: T.ConnectorUpdateFilteringValidationRequest | TB.ConnectorUpdateFilteringValidationRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateFilteringValidation (this: That, params: T.ConnectorUpdateFilteringValidationRequest | TB.ConnectorUpdateFilteringValidationRequest, options?: TransportRequestOptions): Promise - async updateFilteringValidation (this: That, params: T.ConnectorUpdateFilteringValidationRequest | TB.ConnectorUpdateFilteringValidationRequest, options?: TransportRequestOptions): Promise { + async updateFilteringValidation (this: That, params: T.ConnectorUpdateFilteringValidationRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateFilteringValidation (this: That, params: T.ConnectorUpdateFilteringValidationRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateFilteringValidation (this: That, params: T.ConnectorUpdateFilteringValidationRequest, options?: TransportRequestOptions): Promise + async updateFilteringValidation (this: That, params: T.ConnectorUpdateFilteringValidationRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const acceptedBody: string[] = ['validation'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1012,30 +939,22 @@ export default class Connector { * Update the connector index name. Update the `index_name` field of a connector, specifying the index where the data ingested by the connector is stored. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-connector-index-name-api.html | Elasticsearch API documentation} */ - async updateIndexName (this: That, params: T.ConnectorUpdateIndexNameRequest | TB.ConnectorUpdateIndexNameRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateIndexName (this: That, params: T.ConnectorUpdateIndexNameRequest | TB.ConnectorUpdateIndexNameRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateIndexName (this: That, params: T.ConnectorUpdateIndexNameRequest | TB.ConnectorUpdateIndexNameRequest, options?: TransportRequestOptions): Promise - async updateIndexName (this: That, params: T.ConnectorUpdateIndexNameRequest | TB.ConnectorUpdateIndexNameRequest, options?: TransportRequestOptions): Promise { + async updateIndexName (this: That, params: T.ConnectorUpdateIndexNameRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateIndexName (this: That, params: T.ConnectorUpdateIndexNameRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateIndexName (this: That, params: T.ConnectorUpdateIndexNameRequest, options?: TransportRequestOptions): Promise + async updateIndexName (this: That, params: T.ConnectorUpdateIndexNameRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const acceptedBody: string[] = ['index_name'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1056,30 +975,22 @@ export default class Connector { * Update the connector name and description. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-connector-name-description-api.html | Elasticsearch API documentation} */ - async updateName (this: That, params: T.ConnectorUpdateNameRequest | TB.ConnectorUpdateNameRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateName (this: That, params: T.ConnectorUpdateNameRequest | TB.ConnectorUpdateNameRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateName (this: That, params: T.ConnectorUpdateNameRequest | TB.ConnectorUpdateNameRequest, options?: TransportRequestOptions): Promise - async updateName (this: That, params: T.ConnectorUpdateNameRequest | TB.ConnectorUpdateNameRequest, options?: TransportRequestOptions): Promise { + async updateName (this: That, params: T.ConnectorUpdateNameRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateName (this: That, params: T.ConnectorUpdateNameRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateName (this: That, params: T.ConnectorUpdateNameRequest, options?: TransportRequestOptions): Promise + async updateName (this: That, params: T.ConnectorUpdateNameRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const acceptedBody: string[] = ['name', 'description'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1100,30 +1011,22 @@ export default class Connector { * Update the connector is_native flag. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-connector-native-api.html | Elasticsearch API documentation} */ - async updateNative (this: That, params: T.ConnectorUpdateNativeRequest | TB.ConnectorUpdateNativeRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateNative (this: That, params: T.ConnectorUpdateNativeRequest | TB.ConnectorUpdateNativeRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateNative (this: That, params: T.ConnectorUpdateNativeRequest | TB.ConnectorUpdateNativeRequest, options?: TransportRequestOptions): Promise - async updateNative (this: That, params: T.ConnectorUpdateNativeRequest | TB.ConnectorUpdateNativeRequest, options?: TransportRequestOptions): Promise { + async updateNative (this: That, params: T.ConnectorUpdateNativeRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateNative (this: That, params: T.ConnectorUpdateNativeRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateNative (this: That, params: T.ConnectorUpdateNativeRequest, options?: TransportRequestOptions): Promise + async updateNative (this: That, params: T.ConnectorUpdateNativeRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const acceptedBody: string[] = ['is_native'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1144,30 +1047,22 @@ export default class Connector { * Update the connector pipeline. When you create a new connector, the configuration of an ingest pipeline is populated with default settings. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-connector-pipeline-api.html | Elasticsearch API documentation} */ - async updatePipeline (this: That, params: T.ConnectorUpdatePipelineRequest | TB.ConnectorUpdatePipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updatePipeline (this: That, params: T.ConnectorUpdatePipelineRequest | TB.ConnectorUpdatePipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updatePipeline (this: That, params: T.ConnectorUpdatePipelineRequest | TB.ConnectorUpdatePipelineRequest, options?: TransportRequestOptions): Promise - async updatePipeline (this: That, params: T.ConnectorUpdatePipelineRequest | TB.ConnectorUpdatePipelineRequest, options?: TransportRequestOptions): Promise { + async updatePipeline (this: That, params: T.ConnectorUpdatePipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updatePipeline (this: That, params: T.ConnectorUpdatePipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updatePipeline (this: That, params: T.ConnectorUpdatePipelineRequest, options?: TransportRequestOptions): Promise + async updatePipeline (this: That, params: T.ConnectorUpdatePipelineRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const acceptedBody: string[] = ['pipeline'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1188,30 +1083,22 @@ export default class Connector { * Update the connector scheduling. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-connector-scheduling-api.html | Elasticsearch API documentation} */ - async updateScheduling (this: That, params: T.ConnectorUpdateSchedulingRequest | TB.ConnectorUpdateSchedulingRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateScheduling (this: That, params: T.ConnectorUpdateSchedulingRequest | TB.ConnectorUpdateSchedulingRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateScheduling (this: That, params: T.ConnectorUpdateSchedulingRequest | TB.ConnectorUpdateSchedulingRequest, options?: TransportRequestOptions): Promise - async updateScheduling (this: That, params: T.ConnectorUpdateSchedulingRequest | TB.ConnectorUpdateSchedulingRequest, options?: TransportRequestOptions): Promise { + async updateScheduling (this: That, params: T.ConnectorUpdateSchedulingRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateScheduling (this: That, params: T.ConnectorUpdateSchedulingRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateScheduling (this: That, params: T.ConnectorUpdateSchedulingRequest, options?: TransportRequestOptions): Promise + async updateScheduling (this: That, params: T.ConnectorUpdateSchedulingRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const acceptedBody: string[] = ['scheduling'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1232,30 +1119,22 @@ export default class Connector { * Update the connector service type. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-connector-service-type-api.html | Elasticsearch API documentation} */ - async updateServiceType (this: That, params: T.ConnectorUpdateServiceTypeRequest | TB.ConnectorUpdateServiceTypeRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateServiceType (this: That, params: T.ConnectorUpdateServiceTypeRequest | TB.ConnectorUpdateServiceTypeRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateServiceType (this: That, params: T.ConnectorUpdateServiceTypeRequest | TB.ConnectorUpdateServiceTypeRequest, options?: TransportRequestOptions): Promise - async updateServiceType (this: That, params: T.ConnectorUpdateServiceTypeRequest | TB.ConnectorUpdateServiceTypeRequest, options?: TransportRequestOptions): Promise { + async updateServiceType (this: That, params: T.ConnectorUpdateServiceTypeRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateServiceType (this: That, params: T.ConnectorUpdateServiceTypeRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateServiceType (this: That, params: T.ConnectorUpdateServiceTypeRequest, options?: TransportRequestOptions): Promise + async updateServiceType (this: That, params: T.ConnectorUpdateServiceTypeRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const acceptedBody: string[] = ['service_type'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1276,30 +1155,22 @@ export default class Connector { * Update the connector status. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-connector-status-api.html | Elasticsearch API documentation} */ - async updateStatus (this: That, params: T.ConnectorUpdateStatusRequest | TB.ConnectorUpdateStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateStatus (this: That, params: T.ConnectorUpdateStatusRequest | TB.ConnectorUpdateStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateStatus (this: That, params: T.ConnectorUpdateStatusRequest | TB.ConnectorUpdateStatusRequest, options?: TransportRequestOptions): Promise - async updateStatus (this: That, params: T.ConnectorUpdateStatusRequest | TB.ConnectorUpdateStatusRequest, options?: TransportRequestOptions): Promise { + async updateStatus (this: That, params: T.ConnectorUpdateStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateStatus (this: That, params: T.ConnectorUpdateStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateStatus (this: That, params: T.ConnectorUpdateStatusRequest, options?: TransportRequestOptions): Promise + async updateStatus (this: That, params: T.ConnectorUpdateStatusRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['connector_id'] const acceptedBody: string[] = ['status'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/count.ts b/src/api/api/count.ts index dc6e64e21..dd26ab226 100644 --- a/src/api/api/count.ts +++ b/src/api/api/count.ts @@ -35,38 +35,29 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** - * Returns number of documents matching a query. + * Count search results. Get the number of documents matching a query. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-count.html | Elasticsearch API documentation} */ -export default async function CountApi (this: That, params?: T.CountRequest | TB.CountRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function CountApi (this: That, params?: T.CountRequest | TB.CountRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function CountApi (this: That, params?: T.CountRequest | TB.CountRequest, options?: TransportRequestOptions): Promise -export default async function CountApi (this: That, params?: T.CountRequest | TB.CountRequest, options?: TransportRequestOptions): Promise { +export default async function CountApi (this: That, params?: T.CountRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function CountApi (this: That, params?: T.CountRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function CountApi (this: That, params?: T.CountRequest, options?: TransportRequestOptions): Promise +export default async function CountApi (this: That, params?: T.CountRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['query'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/create.ts b/src/api/api/create.ts index e960470b5..c6459eec7 100644 --- a/src/api/api/create.ts +++ b/src/api/api/create.ts @@ -35,22 +35,20 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Index a document. Adds a JSON document to the specified data stream or index and makes it searchable. If the target is an index and the document already exists, the request updates the document and increments its version. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-index_.html | Elasticsearch API documentation} */ -export default async function CreateApi (this: That, params: T.CreateRequest | TB.CreateRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function CreateApi (this: That, params: T.CreateRequest | TB.CreateRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function CreateApi (this: That, params: T.CreateRequest | TB.CreateRequest, options?: TransportRequestOptions): Promise -export default async function CreateApi (this: That, params: T.CreateRequest | TB.CreateRequest, options?: TransportRequestOptions): Promise { +export default async function CreateApi (this: That, params: T.CreateRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function CreateApi (this: That, params: T.CreateRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function CreateApi (this: That, params: T.CreateRequest, options?: TransportRequestOptions): Promise +export default async function CreateApi (this: That, params: T.CreateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id', 'index'] const acceptedBody: string[] = ['document'] const querystring: Record = {} - // @ts-expect-error - let body: any = params.body ?? undefined + let body: any for (const key in params) { if (acceptedBody.includes(key)) { @@ -58,7 +56,7 @@ export default async function CreateApi (this: That, params body = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/dangling_indices.ts b/src/api/api/dangling_indices.ts index 6d0d2bb62..da1988b34 100644 --- a/src/api/api/dangling_indices.ts +++ b/src/api/api/dangling_indices.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class DanglingIndices { @@ -48,10 +47,10 @@ export default class DanglingIndices { * Delete a dangling index. If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling. For example, this can happen if you delete more than `cluster.indices.tombstones.size` indices while an Elasticsearch node is offline. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-gateway-dangling-indices.html | Elasticsearch API documentation} */ - async deleteDanglingIndex (this: That, params: T.DanglingIndicesDeleteDanglingIndexRequest | TB.DanglingIndicesDeleteDanglingIndexRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteDanglingIndex (this: That, params: T.DanglingIndicesDeleteDanglingIndexRequest | TB.DanglingIndicesDeleteDanglingIndexRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteDanglingIndex (this: That, params: T.DanglingIndicesDeleteDanglingIndexRequest | TB.DanglingIndicesDeleteDanglingIndexRequest, options?: TransportRequestOptions): Promise - async deleteDanglingIndex (this: That, params: T.DanglingIndicesDeleteDanglingIndexRequest | TB.DanglingIndicesDeleteDanglingIndexRequest, options?: TransportRequestOptions): Promise { + async deleteDanglingIndex (this: That, params: T.DanglingIndicesDeleteDanglingIndexRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteDanglingIndex (this: That, params: T.DanglingIndicesDeleteDanglingIndexRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteDanglingIndex (this: That, params: T.DanglingIndicesDeleteDanglingIndexRequest, options?: TransportRequestOptions): Promise + async deleteDanglingIndex (this: That, params: T.DanglingIndicesDeleteDanglingIndexRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index_uuid'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class DanglingIndices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -80,10 +79,10 @@ export default class DanglingIndices { * Import a dangling index. If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling. For example, this can happen if you delete more than `cluster.indices.tombstones.size` indices while an Elasticsearch node is offline. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-gateway-dangling-indices.html | Elasticsearch API documentation} */ - async importDanglingIndex (this: That, params: T.DanglingIndicesImportDanglingIndexRequest | TB.DanglingIndicesImportDanglingIndexRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async importDanglingIndex (this: That, params: T.DanglingIndicesImportDanglingIndexRequest | TB.DanglingIndicesImportDanglingIndexRequest, options?: TransportRequestOptionsWithMeta): Promise> - async importDanglingIndex (this: That, params: T.DanglingIndicesImportDanglingIndexRequest | TB.DanglingIndicesImportDanglingIndexRequest, options?: TransportRequestOptions): Promise - async importDanglingIndex (this: That, params: T.DanglingIndicesImportDanglingIndexRequest | TB.DanglingIndicesImportDanglingIndexRequest, options?: TransportRequestOptions): Promise { + async importDanglingIndex (this: That, params: T.DanglingIndicesImportDanglingIndexRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async importDanglingIndex (this: That, params: T.DanglingIndicesImportDanglingIndexRequest, options?: TransportRequestOptionsWithMeta): Promise> + async importDanglingIndex (this: That, params: T.DanglingIndicesImportDanglingIndexRequest, options?: TransportRequestOptions): Promise + async importDanglingIndex (this: That, params: T.DanglingIndicesImportDanglingIndexRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index_uuid'] const querystring: Record = {} const body = undefined @@ -91,7 +90,7 @@ export default class DanglingIndices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -112,10 +111,10 @@ export default class DanglingIndices { * Get the dangling indices. If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling. For example, this can happen if you delete more than `cluster.indices.tombstones.size` indices while an Elasticsearch node is offline. Use this API to list dangling indices, which you can then import or delete. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-gateway-dangling-indices.html | Elasticsearch API documentation} */ - async listDanglingIndices (this: That, params?: T.DanglingIndicesListDanglingIndicesRequest | TB.DanglingIndicesListDanglingIndicesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async listDanglingIndices (this: That, params?: T.DanglingIndicesListDanglingIndicesRequest | TB.DanglingIndicesListDanglingIndicesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async listDanglingIndices (this: That, params?: T.DanglingIndicesListDanglingIndicesRequest | TB.DanglingIndicesListDanglingIndicesRequest, options?: TransportRequestOptions): Promise - async listDanglingIndices (this: That, params?: T.DanglingIndicesListDanglingIndicesRequest | TB.DanglingIndicesListDanglingIndicesRequest, options?: TransportRequestOptions): Promise { + async listDanglingIndices (this: That, params?: T.DanglingIndicesListDanglingIndicesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async listDanglingIndices (this: That, params?: T.DanglingIndicesListDanglingIndicesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async listDanglingIndices (this: That, params?: T.DanglingIndicesListDanglingIndicesRequest, options?: TransportRequestOptions): Promise + async listDanglingIndices (this: That, params?: T.DanglingIndicesListDanglingIndicesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -124,7 +123,7 @@ export default class DanglingIndices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/delete.ts b/src/api/api/delete.ts index 530940830..2637a94c2 100644 --- a/src/api/api/delete.ts +++ b/src/api/api/delete.ts @@ -35,17 +35,16 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Delete a document. Removes a JSON document from the specified index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-delete.html | Elasticsearch API documentation} */ -export default async function DeleteApi (this: That, params: T.DeleteRequest | TB.DeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function DeleteApi (this: That, params: T.DeleteRequest | TB.DeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function DeleteApi (this: That, params: T.DeleteRequest | TB.DeleteRequest, options?: TransportRequestOptions): Promise -export default async function DeleteApi (this: That, params: T.DeleteRequest | TB.DeleteRequest, options?: TransportRequestOptions): Promise { +export default async function DeleteApi (this: That, params: T.DeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function DeleteApi (this: That, params: T.DeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function DeleteApi (this: That, params: T.DeleteRequest, options?: TransportRequestOptions): Promise +export default async function DeleteApi (this: That, params: T.DeleteRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id', 'index'] const querystring: Record = {} const body = undefined @@ -53,7 +52,7 @@ export default async function DeleteApi (this: That, params: T.DeleteRequest | T for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/delete_by_query.ts b/src/api/api/delete_by_query.ts index f862cae66..78f023a81 100644 --- a/src/api/api/delete_by_query.ts +++ b/src/api/api/delete_by_query.ts @@ -35,37 +35,28 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Delete documents. Deletes documents that match the specified query. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-delete-by-query.html | Elasticsearch API documentation} */ -export default async function DeleteByQueryApi (this: That, params: T.DeleteByQueryRequest | TB.DeleteByQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function DeleteByQueryApi (this: That, params: T.DeleteByQueryRequest | TB.DeleteByQueryRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function DeleteByQueryApi (this: That, params: T.DeleteByQueryRequest | TB.DeleteByQueryRequest, options?: TransportRequestOptions): Promise -export default async function DeleteByQueryApi (this: That, params: T.DeleteByQueryRequest | TB.DeleteByQueryRequest, options?: TransportRequestOptions): Promise { +export default async function DeleteByQueryApi (this: That, params: T.DeleteByQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function DeleteByQueryApi (this: That, params: T.DeleteByQueryRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function DeleteByQueryApi (this: That, params: T.DeleteByQueryRequest, options?: TransportRequestOptions): Promise +export default async function DeleteByQueryApi (this: That, params: T.DeleteByQueryRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['max_docs', 'query', 'slice'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/delete_by_query_rethrottle.ts b/src/api/api/delete_by_query_rethrottle.ts index 5ef30f267..cc9ad39d8 100644 --- a/src/api/api/delete_by_query_rethrottle.ts +++ b/src/api/api/delete_by_query_rethrottle.ts @@ -35,17 +35,16 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Throttle a delete by query operation. Change the number of requests per second for a particular delete by query operation. Rethrottling that speeds up the query takes effect immediately but rethrotting that slows down the query takes effect after completing the current batch to prevent scroll timeouts. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-delete-by-query.html | Elasticsearch API documentation} */ -export default async function DeleteByQueryRethrottleApi (this: That, params: T.DeleteByQueryRethrottleRequest | TB.DeleteByQueryRethrottleRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function DeleteByQueryRethrottleApi (this: That, params: T.DeleteByQueryRethrottleRequest | TB.DeleteByQueryRethrottleRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function DeleteByQueryRethrottleApi (this: That, params: T.DeleteByQueryRethrottleRequest | TB.DeleteByQueryRethrottleRequest, options?: TransportRequestOptions): Promise -export default async function DeleteByQueryRethrottleApi (this: That, params: T.DeleteByQueryRethrottleRequest | TB.DeleteByQueryRethrottleRequest, options?: TransportRequestOptions): Promise { +export default async function DeleteByQueryRethrottleApi (this: That, params: T.DeleteByQueryRethrottleRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function DeleteByQueryRethrottleApi (this: That, params: T.DeleteByQueryRethrottleRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function DeleteByQueryRethrottleApi (this: That, params: T.DeleteByQueryRethrottleRequest, options?: TransportRequestOptions): Promise +export default async function DeleteByQueryRethrottleApi (this: That, params: T.DeleteByQueryRethrottleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['task_id'] const querystring: Record = {} const body = undefined @@ -53,7 +52,7 @@ export default async function DeleteByQueryRethrottleApi (this: That, params: T. for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/delete_script.ts b/src/api/api/delete_script.ts index 3b19a496b..f4e19ffc3 100644 --- a/src/api/api/delete_script.ts +++ b/src/api/api/delete_script.ts @@ -35,17 +35,16 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Delete a script or search template. Deletes a stored script or search template. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-scripting.html | Elasticsearch API documentation} */ -export default async function DeleteScriptApi (this: That, params: T.DeleteScriptRequest | TB.DeleteScriptRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function DeleteScriptApi (this: That, params: T.DeleteScriptRequest | TB.DeleteScriptRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function DeleteScriptApi (this: That, params: T.DeleteScriptRequest | TB.DeleteScriptRequest, options?: TransportRequestOptions): Promise -export default async function DeleteScriptApi (this: That, params: T.DeleteScriptRequest | TB.DeleteScriptRequest, options?: TransportRequestOptions): Promise { +export default async function DeleteScriptApi (this: That, params: T.DeleteScriptRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function DeleteScriptApi (this: That, params: T.DeleteScriptRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function DeleteScriptApi (this: That, params: T.DeleteScriptRequest, options?: TransportRequestOptions): Promise +export default async function DeleteScriptApi (this: That, params: T.DeleteScriptRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -53,7 +52,7 @@ export default async function DeleteScriptApi (this: That, params: T.DeleteScrip for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/enrich.ts b/src/api/api/enrich.ts index 3091760ed..46b75389d 100644 --- a/src/api/api/enrich.ts +++ b/src/api/api/enrich.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Enrich { @@ -48,10 +47,10 @@ export default class Enrich { * Delete an enrich policy. Deletes an existing enrich policy and its enrich index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-enrich-policy-api.html | Elasticsearch API documentation} */ - async deletePolicy (this: That, params: T.EnrichDeletePolicyRequest | TB.EnrichDeletePolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deletePolicy (this: That, params: T.EnrichDeletePolicyRequest | TB.EnrichDeletePolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deletePolicy (this: That, params: T.EnrichDeletePolicyRequest | TB.EnrichDeletePolicyRequest, options?: TransportRequestOptions): Promise - async deletePolicy (this: That, params: T.EnrichDeletePolicyRequest | TB.EnrichDeletePolicyRequest, options?: TransportRequestOptions): Promise { + async deletePolicy (this: That, params: T.EnrichDeletePolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deletePolicy (this: That, params: T.EnrichDeletePolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deletePolicy (this: That, params: T.EnrichDeletePolicyRequest, options?: TransportRequestOptions): Promise + async deletePolicy (this: That, params: T.EnrichDeletePolicyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Enrich { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -77,13 +76,13 @@ export default class Enrich { } /** - * Creates the enrich index for an existing enrich policy. + * Run an enrich policy. Create the enrich index for an existing enrich policy. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/execute-enrich-policy-api.html | Elasticsearch API documentation} */ - async executePolicy (this: That, params: T.EnrichExecutePolicyRequest | TB.EnrichExecutePolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async executePolicy (this: That, params: T.EnrichExecutePolicyRequest | TB.EnrichExecutePolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> - async executePolicy (this: That, params: T.EnrichExecutePolicyRequest | TB.EnrichExecutePolicyRequest, options?: TransportRequestOptions): Promise - async executePolicy (this: That, params: T.EnrichExecutePolicyRequest | TB.EnrichExecutePolicyRequest, options?: TransportRequestOptions): Promise { + async executePolicy (this: That, params: T.EnrichExecutePolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async executePolicy (this: That, params: T.EnrichExecutePolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> + async executePolicy (this: That, params: T.EnrichExecutePolicyRequest, options?: TransportRequestOptions): Promise + async executePolicy (this: That, params: T.EnrichExecutePolicyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -91,7 +90,7 @@ export default class Enrich { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -112,10 +111,10 @@ export default class Enrich { * Get an enrich policy. Returns information about an enrich policy. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-enrich-policy-api.html | Elasticsearch API documentation} */ - async getPolicy (this: That, params?: T.EnrichGetPolicyRequest | TB.EnrichGetPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getPolicy (this: That, params?: T.EnrichGetPolicyRequest | TB.EnrichGetPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getPolicy (this: That, params?: T.EnrichGetPolicyRequest | TB.EnrichGetPolicyRequest, options?: TransportRequestOptions): Promise - async getPolicy (this: That, params?: T.EnrichGetPolicyRequest | TB.EnrichGetPolicyRequest, options?: TransportRequestOptions): Promise { + async getPolicy (this: That, params?: T.EnrichGetPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getPolicy (this: That, params?: T.EnrichGetPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getPolicy (this: That, params?: T.EnrichGetPolicyRequest, options?: TransportRequestOptions): Promise + async getPolicy (this: That, params?: T.EnrichGetPolicyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -124,7 +123,7 @@ export default class Enrich { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -152,30 +151,22 @@ export default class Enrich { * Create an enrich policy. Creates an enrich policy. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-enrich-policy-api.html | Elasticsearch API documentation} */ - async putPolicy (this: That, params: T.EnrichPutPolicyRequest | TB.EnrichPutPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putPolicy (this: That, params: T.EnrichPutPolicyRequest | TB.EnrichPutPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putPolicy (this: That, params: T.EnrichPutPolicyRequest | TB.EnrichPutPolicyRequest, options?: TransportRequestOptions): Promise - async putPolicy (this: That, params: T.EnrichPutPolicyRequest | TB.EnrichPutPolicyRequest, options?: TransportRequestOptions): Promise { + async putPolicy (this: That, params: T.EnrichPutPolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putPolicy (this: That, params: T.EnrichPutPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putPolicy (this: That, params: T.EnrichPutPolicyRequest, options?: TransportRequestOptions): Promise + async putPolicy (this: That, params: T.EnrichPutPolicyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const acceptedBody: string[] = ['geo_match', 'match', 'range'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -196,10 +187,10 @@ export default class Enrich { * Get enrich stats. Returns enrich coordinator statistics and information about enrich policies that are currently executing. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/enrich-stats-api.html | Elasticsearch API documentation} */ - async stats (this: That, params?: T.EnrichStatsRequest | TB.EnrichStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async stats (this: That, params?: T.EnrichStatsRequest | TB.EnrichStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async stats (this: That, params?: T.EnrichStatsRequest | TB.EnrichStatsRequest, options?: TransportRequestOptions): Promise - async stats (this: That, params?: T.EnrichStatsRequest | TB.EnrichStatsRequest, options?: TransportRequestOptions): Promise { + async stats (this: That, params?: T.EnrichStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async stats (this: That, params?: T.EnrichStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async stats (this: That, params?: T.EnrichStatsRequest, options?: TransportRequestOptions): Promise + async stats (this: That, params?: T.EnrichStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -208,7 +199,7 @@ export default class Enrich { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/eql.ts b/src/api/api/eql.ts index aef15aeee..c23af1d60 100644 --- a/src/api/api/eql.ts +++ b/src/api/api/eql.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Eql { @@ -45,13 +44,13 @@ export default class Eql { } /** - * Deletes an async EQL search or a stored synchronous EQL search. The API also deletes results for the search. + * Delete an async EQL search. Delete an async EQL search or a stored synchronous EQL search. The API also deletes results for the search. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/eql-search-api.html | Elasticsearch API documentation} */ - async delete (this: That, params: T.EqlDeleteRequest | TB.EqlDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async delete (this: That, params: T.EqlDeleteRequest | TB.EqlDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> - async delete (this: That, params: T.EqlDeleteRequest | TB.EqlDeleteRequest, options?: TransportRequestOptions): Promise - async delete (this: That, params: T.EqlDeleteRequest | TB.EqlDeleteRequest, options?: TransportRequestOptions): Promise { + async delete (this: That, params: T.EqlDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async delete (this: That, params: T.EqlDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> + async delete (this: That, params: T.EqlDeleteRequest, options?: TransportRequestOptions): Promise + async delete (this: That, params: T.EqlDeleteRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Eql { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -77,13 +76,13 @@ export default class Eql { } /** - * Returns the current status and available results for an async EQL search or a stored synchronous EQL search. + * Get async EQL search results. Get the current status and available results for an async EQL search or a stored synchronous EQL search. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-async-eql-search-api.html | Elasticsearch API documentation} */ - async get (this: That, params: T.EqlGetRequest | TB.EqlGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise> - async get (this: That, params: T.EqlGetRequest | TB.EqlGetRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> - async get (this: That, params: T.EqlGetRequest | TB.EqlGetRequest, options?: TransportRequestOptions): Promise> - async get (this: That, params: T.EqlGetRequest | TB.EqlGetRequest, options?: TransportRequestOptions): Promise { + async get (this: That, params: T.EqlGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise> + async get (this: That, params: T.EqlGetRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> + async get (this: That, params: T.EqlGetRequest, options?: TransportRequestOptions): Promise> + async get (this: That, params: T.EqlGetRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -91,7 +90,7 @@ export default class Eql { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -109,13 +108,13 @@ export default class Eql { } /** - * Returns the current status for an async EQL search or a stored synchronous EQL search without returning results. + * Get the async EQL status. Get the current status for an async EQL search or a stored synchronous EQL search without returning results. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-async-eql-status-api.html | Elasticsearch API documentation} */ - async getStatus (this: That, params: T.EqlGetStatusRequest | TB.EqlGetStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getStatus (this: That, params: T.EqlGetStatusRequest | TB.EqlGetStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getStatus (this: That, params: T.EqlGetStatusRequest | TB.EqlGetStatusRequest, options?: TransportRequestOptions): Promise - async getStatus (this: That, params: T.EqlGetStatusRequest | TB.EqlGetStatusRequest, options?: TransportRequestOptions): Promise { + async getStatus (this: That, params: T.EqlGetStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getStatus (this: That, params: T.EqlGetStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getStatus (this: That, params: T.EqlGetStatusRequest, options?: TransportRequestOptions): Promise + async getStatus (this: That, params: T.EqlGetStatusRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -123,7 +122,7 @@ export default class Eql { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -141,33 +140,25 @@ export default class Eql { } /** - * Returns results matching a query expressed in Event Query Language (EQL) + * Get EQL search results. Returns search results for an Event Query Language (EQL) query. EQL assumes each document in a data stream or index corresponds to an event. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/eql-search-api.html | Elasticsearch API documentation} */ - async search (this: That, params: T.EqlSearchRequest | TB.EqlSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> - async search (this: That, params: T.EqlSearchRequest | TB.EqlSearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> - async search (this: That, params: T.EqlSearchRequest | TB.EqlSearchRequest, options?: TransportRequestOptions): Promise> - async search (this: That, params: T.EqlSearchRequest | TB.EqlSearchRequest, options?: TransportRequestOptions): Promise { + async search (this: That, params: T.EqlSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> + async search (this: That, params: T.EqlSearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> + async search (this: That, params: T.EqlSearchRequest, options?: TransportRequestOptions): Promise> + async search (this: That, params: T.EqlSearchRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['query', 'case_sensitive', 'event_category_field', 'tiebreaker_field', 'timestamp_field', 'fetch_size', 'filter', 'keep_alive', 'keep_on_completion', 'wait_for_completion_timeout', 'size', 'fields', 'result_position', 'runtime_mappings'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/esql.ts b/src/api/api/esql.ts index 73fe4fbc6..cb74eee92 100644 --- a/src/api/api/esql.ts +++ b/src/api/api/esql.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Esql { @@ -48,10 +47,10 @@ export default class Esql { * Executes an ESQL request asynchronously * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/esql-async-query-api.html | Elasticsearch API documentation} */ - async asyncQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async asyncQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async asyncQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async asyncQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async asyncQuery (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async asyncQuery (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async asyncQuery (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async asyncQuery (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -60,7 +59,7 @@ export default class Esql { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -77,10 +76,10 @@ export default class Esql { * Retrieves the results of a previously submitted async query request given its ID. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/esql-async-query-get-api.html | Elasticsearch API documentation} */ - async asyncQueryGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async asyncQueryGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async asyncQueryGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async asyncQueryGet (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async asyncQueryGet (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async asyncQueryGet (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async asyncQueryGet (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async asyncQueryGet (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -89,7 +88,7 @@ export default class Esql { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -106,33 +105,25 @@ export default class Esql { } /** - * Executes an ES|QL request + * Run an ES|QL query. Get search results for an ES|QL (Elasticsearch query language) query. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/esql-rest.html | Elasticsearch API documentation} */ - async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptionsWithMeta): Promise> - async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptions): Promise - async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptions): Promise { + async query (this: That, params: T.EsqlQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async query (this: That, params: T.EsqlQueryRequest, options?: TransportRequestOptionsWithMeta): Promise> + async query (this: That, params: T.EsqlQueryRequest, options?: TransportRequestOptions): Promise + async query (this: That, params: T.EsqlQueryRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['columnar', 'filter', 'locale', 'params', 'profile', 'query', 'tables'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/exists.ts b/src/api/api/exists.ts index 38f35591c..5faa57035 100644 --- a/src/api/api/exists.ts +++ b/src/api/api/exists.ts @@ -35,17 +35,16 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Check a document. Checks if a specified document exists. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-get.html | Elasticsearch API documentation} */ -export default async function ExistsApi (this: That, params: T.ExistsRequest | TB.ExistsRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function ExistsApi (this: That, params: T.ExistsRequest | TB.ExistsRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function ExistsApi (this: That, params: T.ExistsRequest | TB.ExistsRequest, options?: TransportRequestOptions): Promise -export default async function ExistsApi (this: That, params: T.ExistsRequest | TB.ExistsRequest, options?: TransportRequestOptions): Promise { +export default async function ExistsApi (this: That, params: T.ExistsRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function ExistsApi (this: That, params: T.ExistsRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function ExistsApi (this: That, params: T.ExistsRequest, options?: TransportRequestOptions): Promise +export default async function ExistsApi (this: That, params: T.ExistsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id', 'index'] const querystring: Record = {} const body = undefined @@ -53,7 +52,7 @@ export default async function ExistsApi (this: That, params: T.ExistsRequest | T for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/exists_source.ts b/src/api/api/exists_source.ts index 596444c30..8349f4344 100644 --- a/src/api/api/exists_source.ts +++ b/src/api/api/exists_source.ts @@ -35,17 +35,16 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Check for a document source. Checks if a document's `_source` is stored. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-get.html | Elasticsearch API documentation} */ -export default async function ExistsSourceApi (this: That, params: T.ExistsSourceRequest | TB.ExistsSourceRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function ExistsSourceApi (this: That, params: T.ExistsSourceRequest | TB.ExistsSourceRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function ExistsSourceApi (this: That, params: T.ExistsSourceRequest | TB.ExistsSourceRequest, options?: TransportRequestOptions): Promise -export default async function ExistsSourceApi (this: That, params: T.ExistsSourceRequest | TB.ExistsSourceRequest, options?: TransportRequestOptions): Promise { +export default async function ExistsSourceApi (this: That, params: T.ExistsSourceRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function ExistsSourceApi (this: That, params: T.ExistsSourceRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function ExistsSourceApi (this: That, params: T.ExistsSourceRequest, options?: TransportRequestOptions): Promise +export default async function ExistsSourceApi (this: That, params: T.ExistsSourceRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id', 'index'] const querystring: Record = {} const body = undefined @@ -53,7 +52,7 @@ export default async function ExistsSourceApi (this: That, params: T.ExistsSourc for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/explain.ts b/src/api/api/explain.ts index 4f6c58d90..98c120775 100644 --- a/src/api/api/explain.ts +++ b/src/api/api/explain.ts @@ -35,37 +35,28 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Explain a document match result. Returns information about why a specific document matches, or doesn’t match, a query. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-explain.html | Elasticsearch API documentation} */ -export default async function ExplainApi (this: That, params: T.ExplainRequest | TB.ExplainRequest, options?: TransportRequestOptionsWithOutMeta): Promise> -export default async function ExplainApi (this: That, params: T.ExplainRequest | TB.ExplainRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> -export default async function ExplainApi (this: That, params: T.ExplainRequest | TB.ExplainRequest, options?: TransportRequestOptions): Promise> -export default async function ExplainApi (this: That, params: T.ExplainRequest | TB.ExplainRequest, options?: TransportRequestOptions): Promise { +export default async function ExplainApi (this: That, params: T.ExplainRequest, options?: TransportRequestOptionsWithOutMeta): Promise> +export default async function ExplainApi (this: That, params: T.ExplainRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> +export default async function ExplainApi (this: That, params: T.ExplainRequest, options?: TransportRequestOptions): Promise> +export default async function ExplainApi (this: That, params: T.ExplainRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id', 'index'] const acceptedBody: string[] = ['query'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/features.ts b/src/api/api/features.ts index 5bfe953dc..aef7b1550 100644 --- a/src/api/api/features.ts +++ b/src/api/api/features.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Features { @@ -48,10 +47,10 @@ export default class Features { * Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-features-api.html | Elasticsearch API documentation} */ - async getFeatures (this: That, params?: T.FeaturesGetFeaturesRequest | TB.FeaturesGetFeaturesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getFeatures (this: That, params?: T.FeaturesGetFeaturesRequest | TB.FeaturesGetFeaturesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getFeatures (this: That, params?: T.FeaturesGetFeaturesRequest | TB.FeaturesGetFeaturesRequest, options?: TransportRequestOptions): Promise - async getFeatures (this: That, params?: T.FeaturesGetFeaturesRequest | TB.FeaturesGetFeaturesRequest, options?: TransportRequestOptions): Promise { + async getFeatures (this: That, params?: T.FeaturesGetFeaturesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getFeatures (this: That, params?: T.FeaturesGetFeaturesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getFeatures (this: That, params?: T.FeaturesGetFeaturesRequest, options?: TransportRequestOptions): Promise + async getFeatures (this: That, params?: T.FeaturesGetFeaturesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -60,7 +59,7 @@ export default class Features { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -78,10 +77,10 @@ export default class Features { * Resets the internal state of features, usually by deleting system indices * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-snapshots.html | Elasticsearch API documentation} */ - async resetFeatures (this: That, params?: T.FeaturesResetFeaturesRequest | TB.FeaturesResetFeaturesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async resetFeatures (this: That, params?: T.FeaturesResetFeaturesRequest | TB.FeaturesResetFeaturesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async resetFeatures (this: That, params?: T.FeaturesResetFeaturesRequest | TB.FeaturesResetFeaturesRequest, options?: TransportRequestOptions): Promise - async resetFeatures (this: That, params?: T.FeaturesResetFeaturesRequest | TB.FeaturesResetFeaturesRequest, options?: TransportRequestOptions): Promise { + async resetFeatures (this: That, params?: T.FeaturesResetFeaturesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async resetFeatures (this: That, params?: T.FeaturesResetFeaturesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async resetFeatures (this: That, params?: T.FeaturesResetFeaturesRequest, options?: TransportRequestOptions): Promise + async resetFeatures (this: That, params?: T.FeaturesResetFeaturesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -90,7 +89,7 @@ export default class Features { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/field_caps.ts b/src/api/api/field_caps.ts index 31d348016..c58369c5b 100644 --- a/src/api/api/field_caps.ts +++ b/src/api/api/field_caps.ts @@ -35,38 +35,29 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Get the field capabilities. Get information about the capabilities of fields among multiple indices. For data streams, the API returns field capabilities among the stream’s backing indices. It returns runtime fields like any other field. For example, a runtime field with a type of keyword is returned the same as any other field that belongs to the `keyword` family. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-field-caps.html | Elasticsearch API documentation} */ -export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise -export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise { +export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest, options?: TransportRequestOptions): Promise +export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['fields', 'index_filter', 'runtime_mappings'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/fleet.ts b/src/api/api/fleet.ts index 3c2028e59..e094df965 100644 --- a/src/api/api/fleet.ts +++ b/src/api/api/fleet.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Fleet { @@ -47,10 +46,10 @@ export default class Fleet { /** * Deletes a secret stored by Fleet. */ - async deleteSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async deleteSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async deleteSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async deleteSecret (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteSecret (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async deleteSecret (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async deleteSecret (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Fleet { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -78,10 +77,10 @@ export default class Fleet { /** * Retrieves a secret stored by Fleet. */ - async getSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async getSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async getSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async getSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async getSecret (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async getSecret (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async getSecret (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async getSecret (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -90,7 +89,7 @@ export default class Fleet { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -110,10 +109,10 @@ export default class Fleet { * Returns the current global checkpoints for an index. This API is design for internal use by the fleet server project. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-global-checkpoints.html | Elasticsearch API documentation} */ - async globalCheckpoints (this: That, params: T.FleetGlobalCheckpointsRequest | TB.FleetGlobalCheckpointsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async globalCheckpoints (this: That, params: T.FleetGlobalCheckpointsRequest | TB.FleetGlobalCheckpointsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async globalCheckpoints (this: That, params: T.FleetGlobalCheckpointsRequest | TB.FleetGlobalCheckpointsRequest, options?: TransportRequestOptions): Promise - async globalCheckpoints (this: That, params: T.FleetGlobalCheckpointsRequest | TB.FleetGlobalCheckpointsRequest, options?: TransportRequestOptions): Promise { + async globalCheckpoints (this: That, params: T.FleetGlobalCheckpointsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async globalCheckpoints (this: That, params: T.FleetGlobalCheckpointsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async globalCheckpoints (this: That, params: T.FleetGlobalCheckpointsRequest, options?: TransportRequestOptions): Promise + async globalCheckpoints (this: That, params: T.FleetGlobalCheckpointsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -121,7 +120,7 @@ export default class Fleet { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -141,15 +140,14 @@ export default class Fleet { /** * Executes several [fleet searches](https://www.elastic.co/guide/en/elasticsearch/reference/current/fleet-search.html) with a single API request. The API follows the same structure as the [multi search](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html) API. However, similar to the fleet search API, it supports the wait_for_checkpoints parameter. */ - async msearch (this: That, params: T.FleetMsearchRequest | TB.FleetMsearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> - async msearch (this: That, params: T.FleetMsearchRequest | TB.FleetMsearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> - async msearch (this: That, params: T.FleetMsearchRequest | TB.FleetMsearchRequest, options?: TransportRequestOptions): Promise> - async msearch (this: That, params: T.FleetMsearchRequest | TB.FleetMsearchRequest, options?: TransportRequestOptions): Promise { + async msearch (this: That, params: T.FleetMsearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> + async msearch (this: That, params: T.FleetMsearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> + async msearch (this: That, params: T.FleetMsearchRequest, options?: TransportRequestOptions): Promise> + async msearch (this: That, params: T.FleetMsearchRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['searches'] const querystring: Record = {} - // @ts-expect-error - let body: any = params.body ?? undefined + let body: any for (const key in params) { if (acceptedBody.includes(key)) { @@ -157,7 +155,7 @@ export default class Fleet { body = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -184,10 +182,10 @@ export default class Fleet { /** * Creates a secret stored by Fleet. */ - async postSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async postSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async postSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async postSecret (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async postSecret (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async postSecret (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async postSecret (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async postSecret (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -196,7 +194,7 @@ export default class Fleet { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -212,30 +210,22 @@ export default class Fleet { /** * The purpose of the fleet search api is to provide a search api where the search will only be executed after provided checkpoint has been processed and is visible for searches inside of Elasticsearch. */ - async search (this: That, params: T.FleetSearchRequest | TB.FleetSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> - async search (this: That, params: T.FleetSearchRequest | TB.FleetSearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> - async search (this: That, params: T.FleetSearchRequest | TB.FleetSearchRequest, options?: TransportRequestOptions): Promise> - async search (this: That, params: T.FleetSearchRequest | TB.FleetSearchRequest, options?: TransportRequestOptions): Promise { + async search (this: That, params: T.FleetSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> + async search (this: That, params: T.FleetSearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> + async search (this: That, params: T.FleetSearchRequest, options?: TransportRequestOptions): Promise> + async search (this: That, params: T.FleetSearchRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['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'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/get.ts b/src/api/api/get.ts index f09229e62..33e6e2a97 100644 --- a/src/api/api/get.ts +++ b/src/api/api/get.ts @@ -35,17 +35,16 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Get a document by its ID. Retrieves the document with the specified ID from an index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-get.html | Elasticsearch API documentation} */ -export default async function GetApi (this: That, params: T.GetRequest | TB.GetRequest, options?: TransportRequestOptionsWithOutMeta): Promise> -export default async function GetApi (this: That, params: T.GetRequest | TB.GetRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> -export default async function GetApi (this: That, params: T.GetRequest | TB.GetRequest, options?: TransportRequestOptions): Promise> -export default async function GetApi (this: That, params: T.GetRequest | TB.GetRequest, options?: TransportRequestOptions): Promise { +export default async function GetApi (this: That, params: T.GetRequest, options?: TransportRequestOptionsWithOutMeta): Promise> +export default async function GetApi (this: That, params: T.GetRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> +export default async function GetApi (this: That, params: T.GetRequest, options?: TransportRequestOptions): Promise> +export default async function GetApi (this: That, params: T.GetRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id', 'index'] const querystring: Record = {} const body = undefined @@ -53,7 +52,7 @@ export default async function GetApi (this: That, params: T for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/get_script.ts b/src/api/api/get_script.ts index 324548a65..12ca19604 100644 --- a/src/api/api/get_script.ts +++ b/src/api/api/get_script.ts @@ -35,17 +35,16 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Get a script or search template. Retrieves a stored script or search template. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-scripting.html | Elasticsearch API documentation} */ -export default async function GetScriptApi (this: That, params: T.GetScriptRequest | TB.GetScriptRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function GetScriptApi (this: That, params: T.GetScriptRequest | TB.GetScriptRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function GetScriptApi (this: That, params: T.GetScriptRequest | TB.GetScriptRequest, options?: TransportRequestOptions): Promise -export default async function GetScriptApi (this: That, params: T.GetScriptRequest | TB.GetScriptRequest, options?: TransportRequestOptions): Promise { +export default async function GetScriptApi (this: That, params: T.GetScriptRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function GetScriptApi (this: That, params: T.GetScriptRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function GetScriptApi (this: That, params: T.GetScriptRequest, options?: TransportRequestOptions): Promise +export default async function GetScriptApi (this: That, params: T.GetScriptRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -53,7 +52,7 @@ export default async function GetScriptApi (this: That, params: T.GetScriptReque for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/get_script_context.ts b/src/api/api/get_script_context.ts index 88648d78b..3cf5d2359 100644 --- a/src/api/api/get_script_context.ts +++ b/src/api/api/get_script_context.ts @@ -35,17 +35,16 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Get script contexts. Get a list of supported script contexts and their methods. * @see {@link https://www.elastic.co/guide/en/elasticsearch/painless/8.17/painless-contexts.html | Elasticsearch API documentation} */ -export default async function GetScriptContextApi (this: That, params?: T.GetScriptContextRequest | TB.GetScriptContextRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function GetScriptContextApi (this: That, params?: T.GetScriptContextRequest | TB.GetScriptContextRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function GetScriptContextApi (this: That, params?: T.GetScriptContextRequest | TB.GetScriptContextRequest, options?: TransportRequestOptions): Promise -export default async function GetScriptContextApi (this: That, params?: T.GetScriptContextRequest | TB.GetScriptContextRequest, options?: TransportRequestOptions): Promise { +export default async function GetScriptContextApi (this: That, params?: T.GetScriptContextRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function GetScriptContextApi (this: That, params?: T.GetScriptContextRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function GetScriptContextApi (this: That, params?: T.GetScriptContextRequest, options?: TransportRequestOptions): Promise +export default async function GetScriptContextApi (this: That, params?: T.GetScriptContextRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -54,7 +53,7 @@ export default async function GetScriptContextApi (this: That, params?: T.GetScr for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/get_script_languages.ts b/src/api/api/get_script_languages.ts index 40ee3119b..41335269b 100644 --- a/src/api/api/get_script_languages.ts +++ b/src/api/api/get_script_languages.ts @@ -35,17 +35,16 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Get script languages. Get a list of available script types, languages, and contexts. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-scripting.html | Elasticsearch API documentation} */ -export default async function GetScriptLanguagesApi (this: That, params?: T.GetScriptLanguagesRequest | TB.GetScriptLanguagesRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function GetScriptLanguagesApi (this: That, params?: T.GetScriptLanguagesRequest | TB.GetScriptLanguagesRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function GetScriptLanguagesApi (this: That, params?: T.GetScriptLanguagesRequest | TB.GetScriptLanguagesRequest, options?: TransportRequestOptions): Promise -export default async function GetScriptLanguagesApi (this: That, params?: T.GetScriptLanguagesRequest | TB.GetScriptLanguagesRequest, options?: TransportRequestOptions): Promise { +export default async function GetScriptLanguagesApi (this: That, params?: T.GetScriptLanguagesRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function GetScriptLanguagesApi (this: That, params?: T.GetScriptLanguagesRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function GetScriptLanguagesApi (this: That, params?: T.GetScriptLanguagesRequest, options?: TransportRequestOptions): Promise +export default async function GetScriptLanguagesApi (this: That, params?: T.GetScriptLanguagesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -54,7 +53,7 @@ export default async function GetScriptLanguagesApi (this: That, params?: T.GetS for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/get_source.ts b/src/api/api/get_source.ts index 9aab5f176..2a02139aa 100644 --- a/src/api/api/get_source.ts +++ b/src/api/api/get_source.ts @@ -35,17 +35,16 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Get a document's source. Returns the source of a document. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-get.html | Elasticsearch API documentation} */ -export default async function GetSourceApi (this: That, params: T.GetSourceRequest | TB.GetSourceRequest, options?: TransportRequestOptionsWithOutMeta): Promise> -export default async function GetSourceApi (this: That, params: T.GetSourceRequest | TB.GetSourceRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> -export default async function GetSourceApi (this: That, params: T.GetSourceRequest | TB.GetSourceRequest, options?: TransportRequestOptions): Promise> -export default async function GetSourceApi (this: That, params: T.GetSourceRequest | TB.GetSourceRequest, options?: TransportRequestOptions): Promise { +export default async function GetSourceApi (this: That, params: T.GetSourceRequest, options?: TransportRequestOptionsWithOutMeta): Promise> +export default async function GetSourceApi (this: That, params: T.GetSourceRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> +export default async function GetSourceApi (this: That, params: T.GetSourceRequest, options?: TransportRequestOptions): Promise> +export default async function GetSourceApi (this: That, params: T.GetSourceRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id', 'index'] const querystring: Record = {} const body = undefined @@ -53,7 +52,7 @@ export default async function GetSourceApi (this: That, par for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/graph.ts b/src/api/api/graph.ts index 3a4bc72a5..b68fd10e1 100644 --- a/src/api/api/graph.ts +++ b/src/api/api/graph.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Graph { @@ -45,33 +44,25 @@ export default class Graph { } /** - * Extracts and summarizes information about the documents and terms in an Elasticsearch data stream or index. + * Explore graph analytics. Extract and summarize information about the documents and terms in an Elasticsearch data stream or index. The easiest way to understand the behavior of this API is to use the Graph UI to explore connections. An initial request to the `_explore` API contains a seed query that identifies the documents of interest and specifies the fields that define the vertices and connections you want to include in the graph. Subsequent requests enable you to spider out from one more vertices of interest. You can exclude vertices that have already been returned. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/graph-explore-api.html | Elasticsearch API documentation} */ - async explore (this: That, params: T.GraphExploreRequest | TB.GraphExploreRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async explore (this: That, params: T.GraphExploreRequest | TB.GraphExploreRequest, options?: TransportRequestOptionsWithMeta): Promise> - async explore (this: That, params: T.GraphExploreRequest | TB.GraphExploreRequest, options?: TransportRequestOptions): Promise - async explore (this: That, params: T.GraphExploreRequest | TB.GraphExploreRequest, options?: TransportRequestOptions): Promise { + async explore (this: That, params: T.GraphExploreRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async explore (this: That, params: T.GraphExploreRequest, options?: TransportRequestOptionsWithMeta): Promise> + async explore (this: That, params: T.GraphExploreRequest, options?: TransportRequestOptions): Promise + async explore (this: That, params: T.GraphExploreRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['connections', 'controls', 'query', 'vertices'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/health_report.ts b/src/api/api/health_report.ts index 7094a1e4b..67da19135 100644 --- a/src/api/api/health_report.ts +++ b/src/api/api/health_report.ts @@ -35,17 +35,16 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Returns the health of the cluster. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/health-api.html | Elasticsearch API documentation} */ -export default async function HealthReportApi (this: That, params?: T.HealthReportRequest | TB.HealthReportRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function HealthReportApi (this: That, params?: T.HealthReportRequest | TB.HealthReportRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function HealthReportApi (this: That, params?: T.HealthReportRequest | TB.HealthReportRequest, options?: TransportRequestOptions): Promise -export default async function HealthReportApi (this: That, params?: T.HealthReportRequest | TB.HealthReportRequest, options?: TransportRequestOptions): Promise { +export default async function HealthReportApi (this: That, params?: T.HealthReportRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function HealthReportApi (this: That, params?: T.HealthReportRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function HealthReportApi (this: That, params?: T.HealthReportRequest, options?: TransportRequestOptions): Promise +export default async function HealthReportApi (this: That, params?: T.HealthReportRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['feature'] const querystring: Record = {} const body = undefined @@ -54,7 +53,7 @@ export default async function HealthReportApi (this: That, params?: T.HealthRepo for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/ilm.ts b/src/api/api/ilm.ts index d570a95ab..3372304a1 100644 --- a/src/api/api/ilm.ts +++ b/src/api/api/ilm.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Ilm { @@ -48,10 +47,10 @@ export default class Ilm { * Deletes the specified lifecycle policy definition. You cannot delete policies that are currently in use. If the policy is being used to manage any indices, the request fails and returns an error. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ilm-delete-lifecycle.html | Elasticsearch API documentation} */ - async deleteLifecycle (this: That, params: T.IlmDeleteLifecycleRequest | TB.IlmDeleteLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteLifecycle (this: That, params: T.IlmDeleteLifecycleRequest | TB.IlmDeleteLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteLifecycle (this: That, params: T.IlmDeleteLifecycleRequest | TB.IlmDeleteLifecycleRequest, options?: TransportRequestOptions): Promise - async deleteLifecycle (this: That, params: T.IlmDeleteLifecycleRequest | TB.IlmDeleteLifecycleRequest, options?: TransportRequestOptions): Promise { + async deleteLifecycle (this: That, params: T.IlmDeleteLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteLifecycle (this: That, params: T.IlmDeleteLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteLifecycle (this: That, params: T.IlmDeleteLifecycleRequest, options?: TransportRequestOptions): Promise + async deleteLifecycle (this: That, params: T.IlmDeleteLifecycleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Ilm { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -80,10 +79,10 @@ export default class Ilm { * Retrieves information about the index’s current lifecycle state, such as the currently executing phase, action, and step. Shows when the index entered each one, the definition of the running phase, and information about any failures. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ilm-explain-lifecycle.html | Elasticsearch API documentation} */ - async explainLifecycle (this: That, params: T.IlmExplainLifecycleRequest | TB.IlmExplainLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async explainLifecycle (this: That, params: T.IlmExplainLifecycleRequest | TB.IlmExplainLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async explainLifecycle (this: That, params: T.IlmExplainLifecycleRequest | TB.IlmExplainLifecycleRequest, options?: TransportRequestOptions): Promise - async explainLifecycle (this: That, params: T.IlmExplainLifecycleRequest | TB.IlmExplainLifecycleRequest, options?: TransportRequestOptions): Promise { + async explainLifecycle (this: That, params: T.IlmExplainLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async explainLifecycle (this: That, params: T.IlmExplainLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async explainLifecycle (this: That, params: T.IlmExplainLifecycleRequest, options?: TransportRequestOptions): Promise + async explainLifecycle (this: That, params: T.IlmExplainLifecycleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -91,7 +90,7 @@ export default class Ilm { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -112,10 +111,10 @@ export default class Ilm { * Retrieves a lifecycle policy. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ilm-get-lifecycle.html | Elasticsearch API documentation} */ - async getLifecycle (this: That, params?: T.IlmGetLifecycleRequest | TB.IlmGetLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getLifecycle (this: That, params?: T.IlmGetLifecycleRequest | TB.IlmGetLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getLifecycle (this: That, params?: T.IlmGetLifecycleRequest | TB.IlmGetLifecycleRequest, options?: TransportRequestOptions): Promise - async getLifecycle (this: That, params?: T.IlmGetLifecycleRequest | TB.IlmGetLifecycleRequest, options?: TransportRequestOptions): Promise { + async getLifecycle (this: That, params?: T.IlmGetLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getLifecycle (this: That, params?: T.IlmGetLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getLifecycle (this: That, params?: T.IlmGetLifecycleRequest, options?: TransportRequestOptions): Promise + async getLifecycle (this: That, params?: T.IlmGetLifecycleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -124,7 +123,7 @@ export default class Ilm { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -152,10 +151,10 @@ export default class Ilm { * Retrieves the current index lifecycle management (ILM) status. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ilm-get-status.html | Elasticsearch API documentation} */ - async getStatus (this: That, params?: T.IlmGetStatusRequest | TB.IlmGetStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getStatus (this: That, params?: T.IlmGetStatusRequest | TB.IlmGetStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getStatus (this: That, params?: T.IlmGetStatusRequest | TB.IlmGetStatusRequest, options?: TransportRequestOptions): Promise - async getStatus (this: That, params?: T.IlmGetStatusRequest | TB.IlmGetStatusRequest, options?: TransportRequestOptions): Promise { + async getStatus (this: That, params?: T.IlmGetStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getStatus (this: That, params?: T.IlmGetStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getStatus (this: That, params?: T.IlmGetStatusRequest, options?: TransportRequestOptions): Promise + async getStatus (this: That, params?: T.IlmGetStatusRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -164,7 +163,7 @@ export default class Ilm { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -182,31 +181,23 @@ export default class Ilm { * Switches the indices, ILM policies, and legacy, composable and component templates from using custom node attributes and attribute-based allocation filters to using data tiers, and optionally deletes one legacy index template.+ Using node roles enables ILM to automatically move the indices between data tiers. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ilm-migrate-to-data-tiers.html | Elasticsearch API documentation} */ - async migrateToDataTiers (this: That, params?: T.IlmMigrateToDataTiersRequest | TB.IlmMigrateToDataTiersRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async migrateToDataTiers (this: That, params?: T.IlmMigrateToDataTiersRequest | TB.IlmMigrateToDataTiersRequest, options?: TransportRequestOptionsWithMeta): Promise> - async migrateToDataTiers (this: That, params?: T.IlmMigrateToDataTiersRequest | TB.IlmMigrateToDataTiersRequest, options?: TransportRequestOptions): Promise - async migrateToDataTiers (this: That, params?: T.IlmMigrateToDataTiersRequest | TB.IlmMigrateToDataTiersRequest, options?: TransportRequestOptions): Promise { + async migrateToDataTiers (this: That, params?: T.IlmMigrateToDataTiersRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async migrateToDataTiers (this: That, params?: T.IlmMigrateToDataTiersRequest, options?: TransportRequestOptionsWithMeta): Promise> + async migrateToDataTiers (this: That, params?: T.IlmMigrateToDataTiersRequest, options?: TransportRequestOptions): Promise + async migrateToDataTiers (this: That, params?: T.IlmMigrateToDataTiersRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['legacy_template_to_delete', 'node_attribute'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -224,30 +215,22 @@ export default class Ilm { * Manually moves an index into the specified step and executes that step. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ilm-move-to-step.html | Elasticsearch API documentation} */ - async moveToStep (this: That, params: T.IlmMoveToStepRequest | TB.IlmMoveToStepRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async moveToStep (this: That, params: T.IlmMoveToStepRequest | TB.IlmMoveToStepRequest, options?: TransportRequestOptionsWithMeta): Promise> - async moveToStep (this: That, params: T.IlmMoveToStepRequest | TB.IlmMoveToStepRequest, options?: TransportRequestOptions): Promise - async moveToStep (this: That, params: T.IlmMoveToStepRequest | TB.IlmMoveToStepRequest, options?: TransportRequestOptions): Promise { + async moveToStep (this: That, params: T.IlmMoveToStepRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async moveToStep (this: That, params: T.IlmMoveToStepRequest, options?: TransportRequestOptionsWithMeta): Promise> + async moveToStep (this: That, params: T.IlmMoveToStepRequest, options?: TransportRequestOptions): Promise + async moveToStep (this: That, params: T.IlmMoveToStepRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['current_step', 'next_step'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -268,30 +251,22 @@ export default class Ilm { * Creates a lifecycle policy. If the specified policy exists, the policy is replaced and the policy version is incremented. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ilm-put-lifecycle.html | Elasticsearch API documentation} */ - async putLifecycle (this: That, params: T.IlmPutLifecycleRequest | TB.IlmPutLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putLifecycle (this: That, params: T.IlmPutLifecycleRequest | TB.IlmPutLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putLifecycle (this: That, params: T.IlmPutLifecycleRequest | TB.IlmPutLifecycleRequest, options?: TransportRequestOptions): Promise - async putLifecycle (this: That, params: T.IlmPutLifecycleRequest | TB.IlmPutLifecycleRequest, options?: TransportRequestOptions): Promise { + async putLifecycle (this: That, params: T.IlmPutLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putLifecycle (this: That, params: T.IlmPutLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putLifecycle (this: That, params: T.IlmPutLifecycleRequest, options?: TransportRequestOptions): Promise + async putLifecycle (this: That, params: T.IlmPutLifecycleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const acceptedBody: string[] = ['policy'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -312,10 +287,10 @@ export default class Ilm { * Removes the assigned lifecycle policy and stops managing the specified index * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ilm-remove-policy.html | Elasticsearch API documentation} */ - async removePolicy (this: That, params: T.IlmRemovePolicyRequest | TB.IlmRemovePolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async removePolicy (this: That, params: T.IlmRemovePolicyRequest | TB.IlmRemovePolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> - async removePolicy (this: That, params: T.IlmRemovePolicyRequest | TB.IlmRemovePolicyRequest, options?: TransportRequestOptions): Promise - async removePolicy (this: That, params: T.IlmRemovePolicyRequest | TB.IlmRemovePolicyRequest, options?: TransportRequestOptions): Promise { + async removePolicy (this: That, params: T.IlmRemovePolicyRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async removePolicy (this: That, params: T.IlmRemovePolicyRequest, options?: TransportRequestOptionsWithMeta): Promise> + async removePolicy (this: That, params: T.IlmRemovePolicyRequest, options?: TransportRequestOptions): Promise + async removePolicy (this: That, params: T.IlmRemovePolicyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -323,7 +298,7 @@ export default class Ilm { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -344,10 +319,10 @@ export default class Ilm { * Retries executing the policy for an index that is in the ERROR step. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ilm-retry-policy.html | Elasticsearch API documentation} */ - async retry (this: That, params: T.IlmRetryRequest | TB.IlmRetryRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async retry (this: That, params: T.IlmRetryRequest | TB.IlmRetryRequest, options?: TransportRequestOptionsWithMeta): Promise> - async retry (this: That, params: T.IlmRetryRequest | TB.IlmRetryRequest, options?: TransportRequestOptions): Promise - async retry (this: That, params: T.IlmRetryRequest | TB.IlmRetryRequest, options?: TransportRequestOptions): Promise { + async retry (this: That, params: T.IlmRetryRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async retry (this: That, params: T.IlmRetryRequest, options?: TransportRequestOptionsWithMeta): Promise> + async retry (this: That, params: T.IlmRetryRequest, options?: TransportRequestOptions): Promise + async retry (this: That, params: T.IlmRetryRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -355,7 +330,7 @@ export default class Ilm { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -376,10 +351,10 @@ export default class Ilm { * Start the index lifecycle management (ILM) plugin. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ilm-start.html | Elasticsearch API documentation} */ - async start (this: That, params?: T.IlmStartRequest | TB.IlmStartRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async start (this: That, params?: T.IlmStartRequest | TB.IlmStartRequest, options?: TransportRequestOptionsWithMeta): Promise> - async start (this: That, params?: T.IlmStartRequest | TB.IlmStartRequest, options?: TransportRequestOptions): Promise - async start (this: That, params?: T.IlmStartRequest | TB.IlmStartRequest, options?: TransportRequestOptions): Promise { + async start (this: That, params?: T.IlmStartRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async start (this: That, params?: T.IlmStartRequest, options?: TransportRequestOptionsWithMeta): Promise> + async start (this: That, params?: T.IlmStartRequest, options?: TransportRequestOptions): Promise + async start (this: That, params?: T.IlmStartRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -388,7 +363,7 @@ export default class Ilm { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -406,10 +381,10 @@ export default class Ilm { * Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ilm-stop.html | Elasticsearch API documentation} */ - async stop (this: That, params?: T.IlmStopRequest | TB.IlmStopRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async stop (this: That, params?: T.IlmStopRequest | TB.IlmStopRequest, options?: TransportRequestOptionsWithMeta): Promise> - async stop (this: That, params?: T.IlmStopRequest | TB.IlmStopRequest, options?: TransportRequestOptions): Promise - async stop (this: That, params?: T.IlmStopRequest | TB.IlmStopRequest, options?: TransportRequestOptions): Promise { + async stop (this: That, params?: T.IlmStopRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async stop (this: That, params?: T.IlmStopRequest, options?: TransportRequestOptionsWithMeta): Promise> + async stop (this: That, params?: T.IlmStopRequest, options?: TransportRequestOptions): Promise + async stop (this: That, params?: T.IlmStopRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -418,7 +393,7 @@ export default class Ilm { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/index.ts b/src/api/api/index.ts index 9b34ae499..0be6c0a47 100644 --- a/src/api/api/index.ts +++ b/src/api/api/index.ts @@ -35,22 +35,20 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Index a document. Adds a JSON document to the specified data stream or index and makes it searchable. If the target is an index and the document already exists, the request updates the document and increments its version. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-index_.html | Elasticsearch API documentation} */ -export default async function IndexApi (this: That, params: T.IndexRequest | TB.IndexRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function IndexApi (this: That, params: T.IndexRequest | TB.IndexRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function IndexApi (this: That, params: T.IndexRequest | TB.IndexRequest, options?: TransportRequestOptions): Promise -export default async function IndexApi (this: That, params: T.IndexRequest | TB.IndexRequest, options?: TransportRequestOptions): Promise { +export default async function IndexApi (this: That, params: T.IndexRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function IndexApi (this: That, params: T.IndexRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function IndexApi (this: That, params: T.IndexRequest, options?: TransportRequestOptions): Promise +export default async function IndexApi (this: That, params: T.IndexRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id', 'index'] const acceptedBody: string[] = ['document'] const querystring: Record = {} - // @ts-expect-error - let body: any = params.body ?? undefined + let body: any for (const key in params) { if (acceptedBody.includes(key)) { @@ -58,7 +56,7 @@ export default async function IndexApi (this: That, params: body = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/indices.ts b/src/api/api/indices.ts index 1d46dd084..1adebf774 100644 --- a/src/api/api/indices.ts +++ b/src/api/api/indices.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Indices { @@ -48,10 +47,10 @@ export default class Indices { * Add an index block. Limits the operations allowed on an index by blocking specific operation types. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/index-modules-blocks.html | Elasticsearch API documentation} */ - async addBlock (this: That, params: T.IndicesAddBlockRequest | TB.IndicesAddBlockRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async addBlock (this: That, params: T.IndicesAddBlockRequest | TB.IndicesAddBlockRequest, options?: TransportRequestOptionsWithMeta): Promise> - async addBlock (this: That, params: T.IndicesAddBlockRequest | TB.IndicesAddBlockRequest, options?: TransportRequestOptions): Promise - async addBlock (this: That, params: T.IndicesAddBlockRequest | TB.IndicesAddBlockRequest, options?: TransportRequestOptions): Promise { + async addBlock (this: That, params: T.IndicesAddBlockRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async addBlock (this: That, params: T.IndicesAddBlockRequest, options?: TransportRequestOptionsWithMeta): Promise> + async addBlock (this: That, params: T.IndicesAddBlockRequest, options?: TransportRequestOptions): Promise + async addBlock (this: That, params: T.IndicesAddBlockRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index', 'block'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -81,31 +80,23 @@ export default class Indices { * Get tokens from text analysis. The analyze API performs [analysis](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis.html) on a text string and returns the resulting tokens. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-analyze.html | Elasticsearch API documentation} */ - async analyze (this: That, params?: T.IndicesAnalyzeRequest | TB.IndicesAnalyzeRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async analyze (this: That, params?: T.IndicesAnalyzeRequest | TB.IndicesAnalyzeRequest, options?: TransportRequestOptionsWithMeta): Promise> - async analyze (this: That, params?: T.IndicesAnalyzeRequest | TB.IndicesAnalyzeRequest, options?: TransportRequestOptions): Promise - async analyze (this: That, params?: T.IndicesAnalyzeRequest | TB.IndicesAnalyzeRequest, options?: TransportRequestOptions): Promise { + async analyze (this: That, params?: T.IndicesAnalyzeRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async analyze (this: That, params?: T.IndicesAnalyzeRequest, options?: TransportRequestOptionsWithMeta): Promise> + async analyze (this: That, params?: T.IndicesAnalyzeRequest, options?: TransportRequestOptions): Promise + async analyze (this: That, params?: T.IndicesAnalyzeRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['analyzer', 'attributes', 'char_filter', 'explain', 'field', 'filter', 'normalizer', 'text', 'tokenizer'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -133,10 +124,10 @@ export default class Indices { * Clears the caches of one or more indices. For data streams, the API clears the caches of the stream’s backing indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-clearcache.html | Elasticsearch API documentation} */ - async clearCache (this: That, params?: T.IndicesClearCacheRequest | TB.IndicesClearCacheRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async clearCache (this: That, params?: T.IndicesClearCacheRequest | TB.IndicesClearCacheRequest, options?: TransportRequestOptionsWithMeta): Promise> - async clearCache (this: That, params?: T.IndicesClearCacheRequest | TB.IndicesClearCacheRequest, options?: TransportRequestOptions): Promise - async clearCache (this: That, params?: T.IndicesClearCacheRequest | TB.IndicesClearCacheRequest, options?: TransportRequestOptions): Promise { + async clearCache (this: That, params?: T.IndicesClearCacheRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async clearCache (this: That, params?: T.IndicesClearCacheRequest, options?: TransportRequestOptionsWithMeta): Promise> + async clearCache (this: That, params?: T.IndicesClearCacheRequest, options?: TransportRequestOptions): Promise + async clearCache (this: That, params?: T.IndicesClearCacheRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -145,7 +136,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -173,30 +164,22 @@ export default class Indices { * Clones an existing index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-clone-index.html | Elasticsearch API documentation} */ - async clone (this: That, params: T.IndicesCloneRequest | TB.IndicesCloneRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async clone (this: That, params: T.IndicesCloneRequest | TB.IndicesCloneRequest, options?: TransportRequestOptionsWithMeta): Promise> - async clone (this: That, params: T.IndicesCloneRequest | TB.IndicesCloneRequest, options?: TransportRequestOptions): Promise - async clone (this: That, params: T.IndicesCloneRequest | TB.IndicesCloneRequest, options?: TransportRequestOptions): Promise { + async clone (this: That, params: T.IndicesCloneRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async clone (this: That, params: T.IndicesCloneRequest, options?: TransportRequestOptionsWithMeta): Promise> + async clone (this: That, params: T.IndicesCloneRequest, options?: TransportRequestOptions): Promise + async clone (this: That, params: T.IndicesCloneRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index', 'target'] const acceptedBody: string[] = ['aliases', 'settings'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -218,10 +201,10 @@ export default class Indices { * Closes an index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-close.html | Elasticsearch API documentation} */ - async close (this: That, params: T.IndicesCloseRequest | TB.IndicesCloseRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async close (this: That, params: T.IndicesCloseRequest | TB.IndicesCloseRequest, options?: TransportRequestOptionsWithMeta): Promise> - async close (this: That, params: T.IndicesCloseRequest | TB.IndicesCloseRequest, options?: TransportRequestOptions): Promise - async close (this: That, params: T.IndicesCloseRequest | TB.IndicesCloseRequest, options?: TransportRequestOptions): Promise { + async close (this: That, params: T.IndicesCloseRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async close (this: That, params: T.IndicesCloseRequest, options?: TransportRequestOptionsWithMeta): Promise> + async close (this: That, params: T.IndicesCloseRequest, options?: TransportRequestOptions): Promise + async close (this: That, params: T.IndicesCloseRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -229,7 +212,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -250,30 +233,22 @@ export default class Indices { * Create an index. Creates a new index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-create-index.html | Elasticsearch API documentation} */ - async create (this: That, params: T.IndicesCreateRequest | TB.IndicesCreateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async create (this: That, params: T.IndicesCreateRequest | TB.IndicesCreateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async create (this: That, params: T.IndicesCreateRequest | TB.IndicesCreateRequest, options?: TransportRequestOptions): Promise - async create (this: That, params: T.IndicesCreateRequest | TB.IndicesCreateRequest, options?: TransportRequestOptions): Promise { + async create (this: That, params: T.IndicesCreateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async create (this: That, params: T.IndicesCreateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async create (this: That, params: T.IndicesCreateRequest, options?: TransportRequestOptions): Promise + async create (this: That, params: T.IndicesCreateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['aliases', 'mappings', 'settings'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -294,10 +269,10 @@ export default class Indices { * Create a data stream. Creates a data stream. You must have a matching index template with data stream enabled. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html | Elasticsearch API documentation} */ - async createDataStream (this: That, params: T.IndicesCreateDataStreamRequest | TB.IndicesCreateDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async createDataStream (this: That, params: T.IndicesCreateDataStreamRequest | TB.IndicesCreateDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise> - async createDataStream (this: That, params: T.IndicesCreateDataStreamRequest | TB.IndicesCreateDataStreamRequest, options?: TransportRequestOptions): Promise - async createDataStream (this: That, params: T.IndicesCreateDataStreamRequest | TB.IndicesCreateDataStreamRequest, options?: TransportRequestOptions): Promise { + async createDataStream (this: That, params: T.IndicesCreateDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async createDataStream (this: That, params: T.IndicesCreateDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise> + async createDataStream (this: That, params: T.IndicesCreateDataStreamRequest, options?: TransportRequestOptions): Promise + async createDataStream (this: That, params: T.IndicesCreateDataStreamRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -305,7 +280,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -326,10 +301,10 @@ export default class Indices { * Get data stream stats. Retrieves statistics for one or more data streams. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html | Elasticsearch API documentation} */ - async dataStreamsStats (this: That, params?: T.IndicesDataStreamsStatsRequest | TB.IndicesDataStreamsStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async dataStreamsStats (this: That, params?: T.IndicesDataStreamsStatsRequest | TB.IndicesDataStreamsStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async dataStreamsStats (this: That, params?: T.IndicesDataStreamsStatsRequest | TB.IndicesDataStreamsStatsRequest, options?: TransportRequestOptions): Promise - async dataStreamsStats (this: That, params?: T.IndicesDataStreamsStatsRequest | TB.IndicesDataStreamsStatsRequest, options?: TransportRequestOptions): Promise { + async dataStreamsStats (this: That, params?: T.IndicesDataStreamsStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async dataStreamsStats (this: That, params?: T.IndicesDataStreamsStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async dataStreamsStats (this: That, params?: T.IndicesDataStreamsStatsRequest, options?: TransportRequestOptions): Promise + async dataStreamsStats (this: That, params?: T.IndicesDataStreamsStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -338,7 +313,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -366,10 +341,10 @@ export default class Indices { * Delete indices. Deletes one or more indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-delete-index.html | Elasticsearch API documentation} */ - async delete (this: That, params: T.IndicesDeleteRequest | TB.IndicesDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async delete (this: That, params: T.IndicesDeleteRequest | TB.IndicesDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> - async delete (this: That, params: T.IndicesDeleteRequest | TB.IndicesDeleteRequest, options?: TransportRequestOptions): Promise - async delete (this: That, params: T.IndicesDeleteRequest | TB.IndicesDeleteRequest, options?: TransportRequestOptions): Promise { + async delete (this: That, params: T.IndicesDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async delete (this: That, params: T.IndicesDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> + async delete (this: That, params: T.IndicesDeleteRequest, options?: TransportRequestOptions): Promise + async delete (this: That, params: T.IndicesDeleteRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -377,7 +352,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -398,10 +373,10 @@ export default class Indices { * Delete an alias. Removes a data stream or index from an alias. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-aliases.html | Elasticsearch API documentation} */ - async deleteAlias (this: That, params: T.IndicesDeleteAliasRequest | TB.IndicesDeleteAliasRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteAlias (this: That, params: T.IndicesDeleteAliasRequest | TB.IndicesDeleteAliasRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteAlias (this: That, params: T.IndicesDeleteAliasRequest | TB.IndicesDeleteAliasRequest, options?: TransportRequestOptions): Promise - async deleteAlias (this: That, params: T.IndicesDeleteAliasRequest | TB.IndicesDeleteAliasRequest, options?: TransportRequestOptions): Promise { + async deleteAlias (this: That, params: T.IndicesDeleteAliasRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteAlias (this: That, params: T.IndicesDeleteAliasRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteAlias (this: That, params: T.IndicesDeleteAliasRequest, options?: TransportRequestOptions): Promise + async deleteAlias (this: That, params: T.IndicesDeleteAliasRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index', 'name'] const querystring: Record = {} const body = undefined @@ -409,7 +384,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -438,10 +413,10 @@ export default class Indices { * Delete data stream lifecycles. Removes the data stream lifecycle from a data stream, rendering it not managed by the data stream lifecycle. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams-delete-lifecycle.html | Elasticsearch API documentation} */ - async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest | TB.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest | TB.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest | TB.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptions): Promise - async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest | TB.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptions): Promise { + async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptions): Promise + async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -449,7 +424,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -470,10 +445,10 @@ export default class Indices { * Delete data streams. Deletes one or more data streams and their backing indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html | Elasticsearch API documentation} */ - async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest | TB.IndicesDeleteDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest | TB.IndicesDeleteDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest | TB.IndicesDeleteDataStreamRequest, options?: TransportRequestOptions): Promise - async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest | TB.IndicesDeleteDataStreamRequest, options?: TransportRequestOptions): Promise { + async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest, options?: TransportRequestOptions): Promise + async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -481,7 +456,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -502,10 +477,10 @@ export default class Indices { * Delete an index template. The provided may contain multiple template names separated by a comma. If multiple template names are specified then there is no wildcard support and the provided names should match completely with existing templates. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-delete-template.html | Elasticsearch API documentation} */ - async deleteIndexTemplate (this: That, params: T.IndicesDeleteIndexTemplateRequest | TB.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteIndexTemplate (this: That, params: T.IndicesDeleteIndexTemplateRequest | TB.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteIndexTemplate (this: That, params: T.IndicesDeleteIndexTemplateRequest | TB.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptions): Promise - async deleteIndexTemplate (this: That, params: T.IndicesDeleteIndexTemplateRequest | TB.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptions): Promise { + async deleteIndexTemplate (this: That, params: T.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteIndexTemplate (this: That, params: T.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteIndexTemplate (this: That, params: T.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptions): Promise + async deleteIndexTemplate (this: That, params: T.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -513,7 +488,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -534,10 +509,10 @@ export default class Indices { * Deletes a legacy index template. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-delete-template-v1.html | Elasticsearch API documentation} */ - async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest | TB.IndicesDeleteTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest | TB.IndicesDeleteTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest | TB.IndicesDeleteTemplateRequest, options?: TransportRequestOptions): Promise - async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest | TB.IndicesDeleteTemplateRequest, options?: TransportRequestOptions): Promise { + async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest, options?: TransportRequestOptions): Promise + async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -545,7 +520,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -566,10 +541,10 @@ export default class Indices { * Analyzes the disk usage of each field of an index or data stream. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-disk-usage.html | Elasticsearch API documentation} */ - async diskUsage (this: That, params: T.IndicesDiskUsageRequest | TB.IndicesDiskUsageRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async diskUsage (this: That, params: T.IndicesDiskUsageRequest | TB.IndicesDiskUsageRequest, options?: TransportRequestOptionsWithMeta): Promise> - async diskUsage (this: That, params: T.IndicesDiskUsageRequest | TB.IndicesDiskUsageRequest, options?: TransportRequestOptions): Promise - async diskUsage (this: That, params: T.IndicesDiskUsageRequest | TB.IndicesDiskUsageRequest, options?: TransportRequestOptions): Promise { + async diskUsage (this: That, params: T.IndicesDiskUsageRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async diskUsage (this: That, params: T.IndicesDiskUsageRequest, options?: TransportRequestOptionsWithMeta): Promise> + async diskUsage (this: That, params: T.IndicesDiskUsageRequest, options?: TransportRequestOptions): Promise + async diskUsage (this: That, params: T.IndicesDiskUsageRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -577,7 +552,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -598,15 +573,14 @@ export default class Indices { * Aggregates a time series (TSDS) index and stores pre-computed statistical summaries (`min`, `max`, `sum`, `value_count` and `avg`) for each metric field grouped by a configured time interval. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-downsample-data-stream.html | Elasticsearch API documentation} */ - async downsample (this: That, params: T.IndicesDownsampleRequest | TB.IndicesDownsampleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async downsample (this: That, params: T.IndicesDownsampleRequest | TB.IndicesDownsampleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async downsample (this: That, params: T.IndicesDownsampleRequest | TB.IndicesDownsampleRequest, options?: TransportRequestOptions): Promise - async downsample (this: That, params: T.IndicesDownsampleRequest | TB.IndicesDownsampleRequest, options?: TransportRequestOptions): Promise { + async downsample (this: That, params: T.IndicesDownsampleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async downsample (this: That, params: T.IndicesDownsampleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async downsample (this: That, params: T.IndicesDownsampleRequest, options?: TransportRequestOptions): Promise + async downsample (this: That, params: T.IndicesDownsampleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index', 'target_index'] const acceptedBody: string[] = ['config'] const querystring: Record = {} - // @ts-expect-error - let body: any = params.body ?? undefined + let body: any for (const key in params) { if (acceptedBody.includes(key)) { @@ -614,7 +588,7 @@ export default class Indices { body = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -636,10 +610,10 @@ export default class Indices { * Check indices. Checks if one or more indices, index aliases, or data streams exist. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-exists.html | Elasticsearch API documentation} */ - async exists (this: That, params: T.IndicesExistsRequest | TB.IndicesExistsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async exists (this: That, params: T.IndicesExistsRequest | TB.IndicesExistsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async exists (this: That, params: T.IndicesExistsRequest | TB.IndicesExistsRequest, options?: TransportRequestOptions): Promise - async exists (this: That, params: T.IndicesExistsRequest | TB.IndicesExistsRequest, options?: TransportRequestOptions): Promise { + async exists (this: That, params: T.IndicesExistsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async exists (this: That, params: T.IndicesExistsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async exists (this: That, params: T.IndicesExistsRequest, options?: TransportRequestOptions): Promise + async exists (this: That, params: T.IndicesExistsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -647,7 +621,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -668,10 +642,10 @@ export default class Indices { * Check aliases. Checks if one or more data stream or index aliases exist. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-aliases.html | Elasticsearch API documentation} */ - async existsAlias (this: That, params: T.IndicesExistsAliasRequest | TB.IndicesExistsAliasRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async existsAlias (this: That, params: T.IndicesExistsAliasRequest | TB.IndicesExistsAliasRequest, options?: TransportRequestOptionsWithMeta): Promise> - async existsAlias (this: That, params: T.IndicesExistsAliasRequest | TB.IndicesExistsAliasRequest, options?: TransportRequestOptions): Promise - async existsAlias (this: That, params: T.IndicesExistsAliasRequest | TB.IndicesExistsAliasRequest, options?: TransportRequestOptions): Promise { + async existsAlias (this: That, params: T.IndicesExistsAliasRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async existsAlias (this: That, params: T.IndicesExistsAliasRequest, options?: TransportRequestOptionsWithMeta): Promise> + async existsAlias (this: That, params: T.IndicesExistsAliasRequest, options?: TransportRequestOptions): Promise + async existsAlias (this: That, params: T.IndicesExistsAliasRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name', 'index'] const querystring: Record = {} const body = undefined @@ -679,7 +653,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -705,13 +679,13 @@ export default class Indices { } /** - * Returns information about whether a particular index template exists. + * Check index templates. Check whether index templates exist. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/index-templates.html | Elasticsearch API documentation} */ - async existsIndexTemplate (this: That, params: T.IndicesExistsIndexTemplateRequest | TB.IndicesExistsIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async existsIndexTemplate (this: That, params: T.IndicesExistsIndexTemplateRequest | TB.IndicesExistsIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async existsIndexTemplate (this: That, params: T.IndicesExistsIndexTemplateRequest | TB.IndicesExistsIndexTemplateRequest, options?: TransportRequestOptions): Promise - async existsIndexTemplate (this: That, params: T.IndicesExistsIndexTemplateRequest | TB.IndicesExistsIndexTemplateRequest, options?: TransportRequestOptions): Promise { + async existsIndexTemplate (this: That, params: T.IndicesExistsIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async existsIndexTemplate (this: That, params: T.IndicesExistsIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async existsIndexTemplate (this: That, params: T.IndicesExistsIndexTemplateRequest, options?: TransportRequestOptions): Promise + async existsIndexTemplate (this: That, params: T.IndicesExistsIndexTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -719,7 +693,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -740,10 +714,10 @@ export default class Indices { * Check existence of index templates. Returns information about whether a particular index template exists. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-template-exists-v1.html | Elasticsearch API documentation} */ - async existsTemplate (this: That, params: T.IndicesExistsTemplateRequest | TB.IndicesExistsTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async existsTemplate (this: That, params: T.IndicesExistsTemplateRequest | TB.IndicesExistsTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async existsTemplate (this: That, params: T.IndicesExistsTemplateRequest | TB.IndicesExistsTemplateRequest, options?: TransportRequestOptions): Promise - async existsTemplate (this: That, params: T.IndicesExistsTemplateRequest | TB.IndicesExistsTemplateRequest, options?: TransportRequestOptions): Promise { + async existsTemplate (this: That, params: T.IndicesExistsTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async existsTemplate (this: That, params: T.IndicesExistsTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async existsTemplate (this: That, params: T.IndicesExistsTemplateRequest, options?: TransportRequestOptions): Promise + async existsTemplate (this: That, params: T.IndicesExistsTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -751,7 +725,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -772,10 +746,10 @@ export default class Indices { * Get the status for a data stream lifecycle. Retrieves information about an index or data stream’s current data stream lifecycle status, such as time since index creation, time since rollover, the lifecycle configuration managing the index, or any errors encountered during lifecycle execution. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams-explain-lifecycle.html | Elasticsearch API documentation} */ - async explainDataLifecycle (this: That, params: T.IndicesExplainDataLifecycleRequest | TB.IndicesExplainDataLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async explainDataLifecycle (this: That, params: T.IndicesExplainDataLifecycleRequest | TB.IndicesExplainDataLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async explainDataLifecycle (this: That, params: T.IndicesExplainDataLifecycleRequest | TB.IndicesExplainDataLifecycleRequest, options?: TransportRequestOptions): Promise - async explainDataLifecycle (this: That, params: T.IndicesExplainDataLifecycleRequest | TB.IndicesExplainDataLifecycleRequest, options?: TransportRequestOptions): Promise { + async explainDataLifecycle (this: That, params: T.IndicesExplainDataLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async explainDataLifecycle (this: That, params: T.IndicesExplainDataLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async explainDataLifecycle (this: That, params: T.IndicesExplainDataLifecycleRequest, options?: TransportRequestOptions): Promise + async explainDataLifecycle (this: That, params: T.IndicesExplainDataLifecycleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -783,7 +757,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -804,10 +778,10 @@ export default class Indices { * Returns field usage information for each shard and field of an index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/field-usage-stats.html | Elasticsearch API documentation} */ - async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest | TB.IndicesFieldUsageStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest | TB.IndicesFieldUsageStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest | TB.IndicesFieldUsageStatsRequest, options?: TransportRequestOptions): Promise - async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest | TB.IndicesFieldUsageStatsRequest, options?: TransportRequestOptions): Promise { + async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest, options?: TransportRequestOptions): Promise + async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -815,7 +789,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -836,10 +810,10 @@ export default class Indices { * Flushes one or more data streams or indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-flush.html | Elasticsearch API documentation} */ - async flush (this: That, params?: T.IndicesFlushRequest | TB.IndicesFlushRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async flush (this: That, params?: T.IndicesFlushRequest | TB.IndicesFlushRequest, options?: TransportRequestOptionsWithMeta): Promise> - async flush (this: That, params?: T.IndicesFlushRequest | TB.IndicesFlushRequest, options?: TransportRequestOptions): Promise - async flush (this: That, params?: T.IndicesFlushRequest | TB.IndicesFlushRequest, options?: TransportRequestOptions): Promise { + async flush (this: That, params?: T.IndicesFlushRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async flush (this: That, params?: T.IndicesFlushRequest, options?: TransportRequestOptionsWithMeta): Promise> + async flush (this: That, params?: T.IndicesFlushRequest, options?: TransportRequestOptions): Promise + async flush (this: That, params?: T.IndicesFlushRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -848,7 +822,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -876,10 +850,10 @@ export default class Indices { * Performs the force merge operation on one or more indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-forcemerge.html | Elasticsearch API documentation} */ - async forcemerge (this: That, params?: T.IndicesForcemergeRequest | TB.IndicesForcemergeRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async forcemerge (this: That, params?: T.IndicesForcemergeRequest | TB.IndicesForcemergeRequest, options?: TransportRequestOptionsWithMeta): Promise> - async forcemerge (this: That, params?: T.IndicesForcemergeRequest | TB.IndicesForcemergeRequest, options?: TransportRequestOptions): Promise - async forcemerge (this: That, params?: T.IndicesForcemergeRequest | TB.IndicesForcemergeRequest, options?: TransportRequestOptions): Promise { + async forcemerge (this: That, params?: T.IndicesForcemergeRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async forcemerge (this: That, params?: T.IndicesForcemergeRequest, options?: TransportRequestOptionsWithMeta): Promise> + async forcemerge (this: That, params?: T.IndicesForcemergeRequest, options?: TransportRequestOptions): Promise + async forcemerge (this: That, params?: T.IndicesForcemergeRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -888,7 +862,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -916,10 +890,10 @@ export default class Indices { * Get index information. Returns information about one or more indices. For data streams, the API returns information about the stream’s backing indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-index.html | Elasticsearch API documentation} */ - async get (this: That, params: T.IndicesGetRequest | TB.IndicesGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async get (this: That, params: T.IndicesGetRequest | TB.IndicesGetRequest, options?: TransportRequestOptionsWithMeta): Promise> - async get (this: That, params: T.IndicesGetRequest | TB.IndicesGetRequest, options?: TransportRequestOptions): Promise - async get (this: That, params: T.IndicesGetRequest | TB.IndicesGetRequest, options?: TransportRequestOptions): Promise { + async get (this: That, params: T.IndicesGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async get (this: That, params: T.IndicesGetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async get (this: That, params: T.IndicesGetRequest, options?: TransportRequestOptions): Promise + async get (this: That, params: T.IndicesGetRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -927,7 +901,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -948,10 +922,10 @@ export default class Indices { * Get aliases. Retrieves information for one or more data stream or index aliases. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-aliases.html | Elasticsearch API documentation} */ - async getAlias (this: That, params?: T.IndicesGetAliasRequest | TB.IndicesGetAliasRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getAlias (this: That, params?: T.IndicesGetAliasRequest | TB.IndicesGetAliasRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getAlias (this: That, params?: T.IndicesGetAliasRequest | TB.IndicesGetAliasRequest, options?: TransportRequestOptions): Promise - async getAlias (this: That, params?: T.IndicesGetAliasRequest | TB.IndicesGetAliasRequest, options?: TransportRequestOptions): Promise { + async getAlias (this: That, params?: T.IndicesGetAliasRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getAlias (this: That, params?: T.IndicesGetAliasRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getAlias (this: That, params?: T.IndicesGetAliasRequest, options?: TransportRequestOptions): Promise + async getAlias (this: That, params?: T.IndicesGetAliasRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name', 'index'] const querystring: Record = {} const body = undefined @@ -960,7 +934,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -995,10 +969,10 @@ export default class Indices { * Get data stream lifecycles. Retrieves the data stream lifecycle configuration of one or more data streams. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams-get-lifecycle.html | Elasticsearch API documentation} */ - async getDataLifecycle (this: That, params: T.IndicesGetDataLifecycleRequest | TB.IndicesGetDataLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getDataLifecycle (this: That, params: T.IndicesGetDataLifecycleRequest | TB.IndicesGetDataLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getDataLifecycle (this: That, params: T.IndicesGetDataLifecycleRequest | TB.IndicesGetDataLifecycleRequest, options?: TransportRequestOptions): Promise - async getDataLifecycle (this: That, params: T.IndicesGetDataLifecycleRequest | TB.IndicesGetDataLifecycleRequest, options?: TransportRequestOptions): Promise { + async getDataLifecycle (this: That, params: T.IndicesGetDataLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getDataLifecycle (this: That, params: T.IndicesGetDataLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getDataLifecycle (this: That, params: T.IndicesGetDataLifecycleRequest, options?: TransportRequestOptions): Promise + async getDataLifecycle (this: That, params: T.IndicesGetDataLifecycleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -1006,7 +980,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1027,10 +1001,10 @@ export default class Indices { * Get data streams. Retrieves information about one or more data streams. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html | Elasticsearch API documentation} */ - async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest | TB.IndicesGetDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest | TB.IndicesGetDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest | TB.IndicesGetDataStreamRequest, options?: TransportRequestOptions): Promise - async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest | TB.IndicesGetDataStreamRequest, options?: TransportRequestOptions): Promise { + async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest, options?: TransportRequestOptions): Promise + async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -1039,7 +1013,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1067,10 +1041,10 @@ export default class Indices { * Get mapping definitions. Retrieves mapping definitions for one or more fields. For data streams, the API retrieves field mappings for the stream’s backing indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-field-mapping.html | Elasticsearch API documentation} */ - async getFieldMapping (this: That, params: T.IndicesGetFieldMappingRequest | TB.IndicesGetFieldMappingRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getFieldMapping (this: That, params: T.IndicesGetFieldMappingRequest | TB.IndicesGetFieldMappingRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getFieldMapping (this: That, params: T.IndicesGetFieldMappingRequest | TB.IndicesGetFieldMappingRequest, options?: TransportRequestOptions): Promise - async getFieldMapping (this: That, params: T.IndicesGetFieldMappingRequest | TB.IndicesGetFieldMappingRequest, options?: TransportRequestOptions): Promise { + async getFieldMapping (this: That, params: T.IndicesGetFieldMappingRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getFieldMapping (this: That, params: T.IndicesGetFieldMappingRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getFieldMapping (this: That, params: T.IndicesGetFieldMappingRequest, options?: TransportRequestOptions): Promise + async getFieldMapping (this: That, params: T.IndicesGetFieldMappingRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['fields', 'index'] const querystring: Record = {} const body = undefined @@ -1078,7 +1052,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1107,10 +1081,10 @@ export default class Indices { * Get index templates. Returns information about one or more index templates. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-template.html | Elasticsearch API documentation} */ - async getIndexTemplate (this: That, params?: T.IndicesGetIndexTemplateRequest | TB.IndicesGetIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getIndexTemplate (this: That, params?: T.IndicesGetIndexTemplateRequest | TB.IndicesGetIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getIndexTemplate (this: That, params?: T.IndicesGetIndexTemplateRequest | TB.IndicesGetIndexTemplateRequest, options?: TransportRequestOptions): Promise - async getIndexTemplate (this: That, params?: T.IndicesGetIndexTemplateRequest | TB.IndicesGetIndexTemplateRequest, options?: TransportRequestOptions): Promise { + async getIndexTemplate (this: That, params?: T.IndicesGetIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getIndexTemplate (this: That, params?: T.IndicesGetIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getIndexTemplate (this: That, params?: T.IndicesGetIndexTemplateRequest, options?: TransportRequestOptions): Promise + async getIndexTemplate (this: That, params?: T.IndicesGetIndexTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -1119,7 +1093,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1147,10 +1121,10 @@ export default class Indices { * Get mapping definitions. Retrieves mapping definitions for one or more indices. For data streams, the API retrieves mappings for the stream’s backing indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-mapping.html | Elasticsearch API documentation} */ - async getMapping (this: That, params?: T.IndicesGetMappingRequest | TB.IndicesGetMappingRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getMapping (this: That, params?: T.IndicesGetMappingRequest | TB.IndicesGetMappingRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getMapping (this: That, params?: T.IndicesGetMappingRequest | TB.IndicesGetMappingRequest, options?: TransportRequestOptions): Promise - async getMapping (this: That, params?: T.IndicesGetMappingRequest | TB.IndicesGetMappingRequest, options?: TransportRequestOptions): Promise { + async getMapping (this: That, params?: T.IndicesGetMappingRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getMapping (this: That, params?: T.IndicesGetMappingRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getMapping (this: That, params?: T.IndicesGetMappingRequest, options?: TransportRequestOptions): Promise + async getMapping (this: That, params?: T.IndicesGetMappingRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -1159,7 +1133,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1187,10 +1161,10 @@ export default class Indices { * Get index settings. Returns setting information for one or more indices. For data streams, returns setting information for the stream’s backing indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-settings.html | Elasticsearch API documentation} */ - async getSettings (this: That, params?: T.IndicesGetSettingsRequest | TB.IndicesGetSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getSettings (this: That, params?: T.IndicesGetSettingsRequest | TB.IndicesGetSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getSettings (this: That, params?: T.IndicesGetSettingsRequest | TB.IndicesGetSettingsRequest, options?: TransportRequestOptions): Promise - async getSettings (this: That, params?: T.IndicesGetSettingsRequest | TB.IndicesGetSettingsRequest, options?: TransportRequestOptions): Promise { + async getSettings (this: That, params?: T.IndicesGetSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getSettings (this: That, params?: T.IndicesGetSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getSettings (this: That, params?: T.IndicesGetSettingsRequest, options?: TransportRequestOptions): Promise + async getSettings (this: That, params?: T.IndicesGetSettingsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index', 'name'] const querystring: Record = {} const body = undefined @@ -1199,7 +1173,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1234,10 +1208,10 @@ export default class Indices { * Get index templates. Retrieves information about one or more index templates. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-get-template-v1.html | Elasticsearch API documentation} */ - async getTemplate (this: That, params?: T.IndicesGetTemplateRequest | TB.IndicesGetTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getTemplate (this: That, params?: T.IndicesGetTemplateRequest | TB.IndicesGetTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getTemplate (this: That, params?: T.IndicesGetTemplateRequest | TB.IndicesGetTemplateRequest, options?: TransportRequestOptions): Promise - async getTemplate (this: That, params?: T.IndicesGetTemplateRequest | TB.IndicesGetTemplateRequest, options?: TransportRequestOptions): Promise { + async getTemplate (this: That, params?: T.IndicesGetTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getTemplate (this: That, params?: T.IndicesGetTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getTemplate (this: That, params?: T.IndicesGetTemplateRequest, options?: TransportRequestOptions): Promise + async getTemplate (this: That, params?: T.IndicesGetTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -1246,7 +1220,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1274,10 +1248,10 @@ export default class Indices { * Convert an index alias to a data stream. Converts an index alias to a data stream. You must have a matching index template that is data stream enabled. The alias must meet the following criteria: The alias must have a write index; All indices for the alias must have a `@timestamp` field mapping of a `date` or `date_nanos` field type; The alias must not have any filters; The alias must not use custom routing. If successful, the request removes the alias and creates a data stream with the same name. The indices for the alias become hidden backing indices for the stream. The write index for the alias becomes the write index for the stream. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html | Elasticsearch API documentation} */ - async migrateToDataStream (this: That, params: T.IndicesMigrateToDataStreamRequest | TB.IndicesMigrateToDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async migrateToDataStream (this: That, params: T.IndicesMigrateToDataStreamRequest | TB.IndicesMigrateToDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise> - async migrateToDataStream (this: That, params: T.IndicesMigrateToDataStreamRequest | TB.IndicesMigrateToDataStreamRequest, options?: TransportRequestOptions): Promise - async migrateToDataStream (this: That, params: T.IndicesMigrateToDataStreamRequest | TB.IndicesMigrateToDataStreamRequest, options?: TransportRequestOptions): Promise { + async migrateToDataStream (this: That, params: T.IndicesMigrateToDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async migrateToDataStream (this: That, params: T.IndicesMigrateToDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise> + async migrateToDataStream (this: That, params: T.IndicesMigrateToDataStreamRequest, options?: TransportRequestOptions): Promise + async migrateToDataStream (this: That, params: T.IndicesMigrateToDataStreamRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -1285,7 +1259,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1306,30 +1280,22 @@ export default class Indices { * Update data streams. Performs one or more data stream modification actions in a single atomic operation. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html | Elasticsearch API documentation} */ - async modifyDataStream (this: That, params: T.IndicesModifyDataStreamRequest | TB.IndicesModifyDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async modifyDataStream (this: That, params: T.IndicesModifyDataStreamRequest | TB.IndicesModifyDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise> - async modifyDataStream (this: That, params: T.IndicesModifyDataStreamRequest | TB.IndicesModifyDataStreamRequest, options?: TransportRequestOptions): Promise - async modifyDataStream (this: That, params: T.IndicesModifyDataStreamRequest | TB.IndicesModifyDataStreamRequest, options?: TransportRequestOptions): Promise { + async modifyDataStream (this: That, params: T.IndicesModifyDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async modifyDataStream (this: That, params: T.IndicesModifyDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise> + async modifyDataStream (this: That, params: T.IndicesModifyDataStreamRequest, options?: TransportRequestOptions): Promise + async modifyDataStream (this: That, params: T.IndicesModifyDataStreamRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['actions'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1347,10 +1313,10 @@ export default class Indices { * Opens a closed index. For data streams, the API opens any closed backing indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-open-close.html | Elasticsearch API documentation} */ - async open (this: That, params: T.IndicesOpenRequest | TB.IndicesOpenRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async open (this: That, params: T.IndicesOpenRequest | TB.IndicesOpenRequest, options?: TransportRequestOptionsWithMeta): Promise> - async open (this: That, params: T.IndicesOpenRequest | TB.IndicesOpenRequest, options?: TransportRequestOptions): Promise - async open (this: That, params: T.IndicesOpenRequest | TB.IndicesOpenRequest, options?: TransportRequestOptions): Promise { + async open (this: That, params: T.IndicesOpenRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async open (this: That, params: T.IndicesOpenRequest, options?: TransportRequestOptionsWithMeta): Promise> + async open (this: That, params: T.IndicesOpenRequest, options?: TransportRequestOptions): Promise + async open (this: That, params: T.IndicesOpenRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -1358,7 +1324,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1379,10 +1345,10 @@ export default class Indices { * Promotes a data stream from a replicated data stream managed by CCR to a regular data stream * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams.html | Elasticsearch API documentation} */ - async promoteDataStream (this: That, params: T.IndicesPromoteDataStreamRequest | TB.IndicesPromoteDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async promoteDataStream (this: That, params: T.IndicesPromoteDataStreamRequest | TB.IndicesPromoteDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise> - async promoteDataStream (this: That, params: T.IndicesPromoteDataStreamRequest | TB.IndicesPromoteDataStreamRequest, options?: TransportRequestOptions): Promise - async promoteDataStream (this: That, params: T.IndicesPromoteDataStreamRequest | TB.IndicesPromoteDataStreamRequest, options?: TransportRequestOptions): Promise { + async promoteDataStream (this: That, params: T.IndicesPromoteDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async promoteDataStream (this: That, params: T.IndicesPromoteDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise> + async promoteDataStream (this: That, params: T.IndicesPromoteDataStreamRequest, options?: TransportRequestOptions): Promise + async promoteDataStream (this: That, params: T.IndicesPromoteDataStreamRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -1390,7 +1356,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1411,30 +1377,22 @@ export default class Indices { * Create or update an alias. Adds a data stream or index to an alias. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-aliases.html | Elasticsearch API documentation} */ - async putAlias (this: That, params: T.IndicesPutAliasRequest | TB.IndicesPutAliasRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putAlias (this: That, params: T.IndicesPutAliasRequest | TB.IndicesPutAliasRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putAlias (this: That, params: T.IndicesPutAliasRequest | TB.IndicesPutAliasRequest, options?: TransportRequestOptions): Promise - async putAlias (this: That, params: T.IndicesPutAliasRequest | TB.IndicesPutAliasRequest, options?: TransportRequestOptions): Promise { + async putAlias (this: That, params: T.IndicesPutAliasRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putAlias (this: That, params: T.IndicesPutAliasRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putAlias (this: That, params: T.IndicesPutAliasRequest, options?: TransportRequestOptions): Promise + async putAlias (this: That, params: T.IndicesPutAliasRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index', 'name'] const acceptedBody: string[] = ['filter', 'index_routing', 'is_write_index', 'routing', 'search_routing'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1463,30 +1421,22 @@ export default class Indices { * Update data stream lifecycles. Update the data stream lifecycle of the specified data streams. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/data-streams-put-lifecycle.html | Elasticsearch API documentation} */ - async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest | TB.IndicesPutDataLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest | TB.IndicesPutDataLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest | TB.IndicesPutDataLifecycleRequest, options?: TransportRequestOptions): Promise - async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest | TB.IndicesPutDataLifecycleRequest, options?: TransportRequestOptions): Promise { + async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest, options?: TransportRequestOptions): Promise + async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const acceptedBody: string[] = ['data_retention', 'downsampling'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1507,30 +1457,22 @@ export default class Indices { * Create or update an index template. Index templates define settings, mappings, and aliases that can be applied automatically to new indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-put-template.html | Elasticsearch API documentation} */ - async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptions): Promise - async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptions): Promise { + async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest, options?: TransportRequestOptions): Promise + async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const acceptedBody: string[] = ['index_patterns', 'composed_of', 'template', 'data_stream', 'priority', 'version', '_meta', 'allow_auto_create', 'ignore_missing_component_templates', 'deprecated'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1551,30 +1493,22 @@ export default class Indices { * Update field mappings. Adds new fields to an existing data stream or index. You can also use this API to change the search settings of existing fields. For data streams, these changes are applied to all backing indices by default. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-put-mapping.html | Elasticsearch API documentation} */ - async putMapping (this: That, params: T.IndicesPutMappingRequest | TB.IndicesPutMappingRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putMapping (this: That, params: T.IndicesPutMappingRequest | TB.IndicesPutMappingRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putMapping (this: That, params: T.IndicesPutMappingRequest | TB.IndicesPutMappingRequest, options?: TransportRequestOptions): Promise - async putMapping (this: That, params: T.IndicesPutMappingRequest | TB.IndicesPutMappingRequest, options?: TransportRequestOptions): Promise { + async putMapping (this: That, params: T.IndicesPutMappingRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putMapping (this: That, params: T.IndicesPutMappingRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putMapping (this: That, params: T.IndicesPutMappingRequest, options?: TransportRequestOptions): Promise + async putMapping (this: That, params: T.IndicesPutMappingRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['date_detection', 'dynamic', 'dynamic_date_formats', 'dynamic_templates', '_field_names', '_meta', 'numeric_detection', 'properties', '_routing', '_source', 'runtime'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1595,15 +1529,14 @@ export default class Indices { * Update index settings. Changes dynamic index settings in real time. For data streams, index setting changes are applied to all backing indices by default. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-update-settings.html | Elasticsearch API documentation} */ - async putSettings (this: That, params: T.IndicesPutSettingsRequest | TB.IndicesPutSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putSettings (this: That, params: T.IndicesPutSettingsRequest | TB.IndicesPutSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putSettings (this: That, params: T.IndicesPutSettingsRequest | TB.IndicesPutSettingsRequest, options?: TransportRequestOptions): Promise - async putSettings (this: That, params: T.IndicesPutSettingsRequest | TB.IndicesPutSettingsRequest, options?: TransportRequestOptions): Promise { + async putSettings (this: That, params: T.IndicesPutSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putSettings (this: That, params: T.IndicesPutSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putSettings (this: That, params: T.IndicesPutSettingsRequest, options?: TransportRequestOptions): Promise + async putSettings (this: That, params: T.IndicesPutSettingsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['settings'] const querystring: Record = {} - // @ts-expect-error - let body: any = params.body ?? undefined + let body: any for (const key in params) { if (acceptedBody.includes(key)) { @@ -1611,7 +1544,7 @@ export default class Indices { body = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1639,30 +1572,22 @@ export default class Indices { * Create or update an index template. Index templates define settings, mappings, and aliases that can be applied automatically to new indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-templates-v1.html | Elasticsearch API documentation} */ - async putTemplate (this: That, params: T.IndicesPutTemplateRequest | TB.IndicesPutTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putTemplate (this: That, params: T.IndicesPutTemplateRequest | TB.IndicesPutTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putTemplate (this: That, params: T.IndicesPutTemplateRequest | TB.IndicesPutTemplateRequest, options?: TransportRequestOptions): Promise - async putTemplate (this: That, params: T.IndicesPutTemplateRequest | TB.IndicesPutTemplateRequest, options?: TransportRequestOptions): Promise { + async putTemplate (this: That, params: T.IndicesPutTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putTemplate (this: That, params: T.IndicesPutTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putTemplate (this: That, params: T.IndicesPutTemplateRequest, options?: TransportRequestOptions): Promise + async putTemplate (this: That, params: T.IndicesPutTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const acceptedBody: string[] = ['aliases', 'index_patterns', 'mappings', 'order', 'settings', 'version'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1683,10 +1608,10 @@ export default class Indices { * Returns information about ongoing and completed shard recoveries for one or more indices. For data streams, the API returns information for the stream’s backing indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-recovery.html | Elasticsearch API documentation} */ - async recovery (this: That, params?: T.IndicesRecoveryRequest | TB.IndicesRecoveryRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async recovery (this: That, params?: T.IndicesRecoveryRequest | TB.IndicesRecoveryRequest, options?: TransportRequestOptionsWithMeta): Promise> - async recovery (this: That, params?: T.IndicesRecoveryRequest | TB.IndicesRecoveryRequest, options?: TransportRequestOptions): Promise - async recovery (this: That, params?: T.IndicesRecoveryRequest | TB.IndicesRecoveryRequest, options?: TransportRequestOptions): Promise { + async recovery (this: That, params?: T.IndicesRecoveryRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async recovery (this: That, params?: T.IndicesRecoveryRequest, options?: TransportRequestOptionsWithMeta): Promise> + async recovery (this: That, params?: T.IndicesRecoveryRequest, options?: TransportRequestOptions): Promise + async recovery (this: That, params?: T.IndicesRecoveryRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -1695,7 +1620,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1723,10 +1648,10 @@ export default class Indices { * 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. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-refresh.html | Elasticsearch API documentation} */ - async refresh (this: That, params?: T.IndicesRefreshRequest | TB.IndicesRefreshRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async refresh (this: That, params?: T.IndicesRefreshRequest | TB.IndicesRefreshRequest, options?: TransportRequestOptionsWithMeta): Promise> - async refresh (this: That, params?: T.IndicesRefreshRequest | TB.IndicesRefreshRequest, options?: TransportRequestOptions): Promise - async refresh (this: That, params?: T.IndicesRefreshRequest | TB.IndicesRefreshRequest, options?: TransportRequestOptions): Promise { + async refresh (this: That, params?: T.IndicesRefreshRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async refresh (this: That, params?: T.IndicesRefreshRequest, options?: TransportRequestOptionsWithMeta): Promise> + async refresh (this: That, params?: T.IndicesRefreshRequest, options?: TransportRequestOptions): Promise + async refresh (this: That, params?: T.IndicesRefreshRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -1735,7 +1660,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1763,10 +1688,10 @@ export default class Indices { * Reloads an index's search analyzers and their resources. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-reload-analyzers.html | Elasticsearch API documentation} */ - async reloadSearchAnalyzers (this: That, params: T.IndicesReloadSearchAnalyzersRequest | TB.IndicesReloadSearchAnalyzersRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async reloadSearchAnalyzers (this: That, params: T.IndicesReloadSearchAnalyzersRequest | TB.IndicesReloadSearchAnalyzersRequest, options?: TransportRequestOptionsWithMeta): Promise> - async reloadSearchAnalyzers (this: That, params: T.IndicesReloadSearchAnalyzersRequest | TB.IndicesReloadSearchAnalyzersRequest, options?: TransportRequestOptions): Promise - async reloadSearchAnalyzers (this: That, params: T.IndicesReloadSearchAnalyzersRequest | TB.IndicesReloadSearchAnalyzersRequest, options?: TransportRequestOptions): Promise { + async reloadSearchAnalyzers (this: That, params: T.IndicesReloadSearchAnalyzersRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async reloadSearchAnalyzers (this: That, params: T.IndicesReloadSearchAnalyzersRequest, options?: TransportRequestOptionsWithMeta): Promise> + async reloadSearchAnalyzers (this: That, params: T.IndicesReloadSearchAnalyzersRequest, options?: TransportRequestOptions): Promise + async reloadSearchAnalyzers (this: That, params: T.IndicesReloadSearchAnalyzersRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -1774,7 +1699,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1795,10 +1720,10 @@ export default class Indices { * Resolves the specified index expressions to return information about each cluster, including the local cluster, if included. Multiple patterns and remote clusters are supported. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-resolve-cluster-api.html | Elasticsearch API documentation} */ - async resolveCluster (this: That, params: T.IndicesResolveClusterRequest | TB.IndicesResolveClusterRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async resolveCluster (this: That, params: T.IndicesResolveClusterRequest | TB.IndicesResolveClusterRequest, options?: TransportRequestOptionsWithMeta): Promise> - async resolveCluster (this: That, params: T.IndicesResolveClusterRequest | TB.IndicesResolveClusterRequest, options?: TransportRequestOptions): Promise - async resolveCluster (this: That, params: T.IndicesResolveClusterRequest | TB.IndicesResolveClusterRequest, options?: TransportRequestOptions): Promise { + async resolveCluster (this: That, params: T.IndicesResolveClusterRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async resolveCluster (this: That, params: T.IndicesResolveClusterRequest, options?: TransportRequestOptionsWithMeta): Promise> + async resolveCluster (this: That, params: T.IndicesResolveClusterRequest, options?: TransportRequestOptions): Promise + async resolveCluster (this: That, params: T.IndicesResolveClusterRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -1806,7 +1731,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1824,13 +1749,13 @@ export default class Indices { } /** - * Resolves the specified name(s) and/or index patterns for indices, aliases, and data streams. Multiple patterns and remote clusters are supported. + * Resolve indices. Resolve the names and/or index patterns for indices, aliases, and data streams. Multiple patterns and remote clusters are supported. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-resolve-index-api.html | Elasticsearch API documentation} */ - async resolveIndex (this: That, params: T.IndicesResolveIndexRequest | TB.IndicesResolveIndexRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async resolveIndex (this: That, params: T.IndicesResolveIndexRequest | TB.IndicesResolveIndexRequest, options?: TransportRequestOptionsWithMeta): Promise> - async resolveIndex (this: That, params: T.IndicesResolveIndexRequest | TB.IndicesResolveIndexRequest, options?: TransportRequestOptions): Promise - async resolveIndex (this: That, params: T.IndicesResolveIndexRequest | TB.IndicesResolveIndexRequest, options?: TransportRequestOptions): Promise { + async resolveIndex (this: That, params: T.IndicesResolveIndexRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async resolveIndex (this: That, params: T.IndicesResolveIndexRequest, options?: TransportRequestOptionsWithMeta): Promise> + async resolveIndex (this: That, params: T.IndicesResolveIndexRequest, options?: TransportRequestOptions): Promise + async resolveIndex (this: That, params: T.IndicesResolveIndexRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -1838,7 +1763,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1859,30 +1784,22 @@ export default class Indices { * Roll over to a new index. Creates a new index for a data stream or index alias. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-rollover-index.html | Elasticsearch API documentation} */ - async rollover (this: That, params: T.IndicesRolloverRequest | TB.IndicesRolloverRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async rollover (this: That, params: T.IndicesRolloverRequest | TB.IndicesRolloverRequest, options?: TransportRequestOptionsWithMeta): Promise> - async rollover (this: That, params: T.IndicesRolloverRequest | TB.IndicesRolloverRequest, options?: TransportRequestOptions): Promise - async rollover (this: That, params: T.IndicesRolloverRequest | TB.IndicesRolloverRequest, options?: TransportRequestOptions): Promise { + async rollover (this: That, params: T.IndicesRolloverRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async rollover (this: That, params: T.IndicesRolloverRequest, options?: TransportRequestOptionsWithMeta): Promise> + async rollover (this: That, params: T.IndicesRolloverRequest, options?: TransportRequestOptions): Promise + async rollover (this: That, params: T.IndicesRolloverRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['alias', 'new_index'] const acceptedBody: string[] = ['aliases', 'conditions', 'mappings', 'settings'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1911,10 +1828,10 @@ export default class Indices { * Returns low-level information about the Lucene segments in index shards. For data streams, the API returns information about the stream’s backing indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-segments.html | Elasticsearch API documentation} */ - async segments (this: That, params?: T.IndicesSegmentsRequest | TB.IndicesSegmentsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async segments (this: That, params?: T.IndicesSegmentsRequest | TB.IndicesSegmentsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async segments (this: That, params?: T.IndicesSegmentsRequest | TB.IndicesSegmentsRequest, options?: TransportRequestOptions): Promise - async segments (this: That, params?: T.IndicesSegmentsRequest | TB.IndicesSegmentsRequest, options?: TransportRequestOptions): Promise { + async segments (this: That, params?: T.IndicesSegmentsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async segments (this: That, params?: T.IndicesSegmentsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async segments (this: That, params?: T.IndicesSegmentsRequest, options?: TransportRequestOptions): Promise + async segments (this: That, params?: T.IndicesSegmentsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -1923,7 +1840,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1951,10 +1868,10 @@ export default class Indices { * Retrieves store information about replica shards in one or more indices. For data streams, the API retrieves store information for the stream’s backing indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-shards-stores.html | Elasticsearch API documentation} */ - async shardStores (this: That, params?: T.IndicesShardStoresRequest | TB.IndicesShardStoresRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async shardStores (this: That, params?: T.IndicesShardStoresRequest | TB.IndicesShardStoresRequest, options?: TransportRequestOptionsWithMeta): Promise> - async shardStores (this: That, params?: T.IndicesShardStoresRequest | TB.IndicesShardStoresRequest, options?: TransportRequestOptions): Promise - async shardStores (this: That, params?: T.IndicesShardStoresRequest | TB.IndicesShardStoresRequest, options?: TransportRequestOptions): Promise { + async shardStores (this: That, params?: T.IndicesShardStoresRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async shardStores (this: That, params?: T.IndicesShardStoresRequest, options?: TransportRequestOptionsWithMeta): Promise> + async shardStores (this: That, params?: T.IndicesShardStoresRequest, options?: TransportRequestOptions): Promise + async shardStores (this: That, params?: T.IndicesShardStoresRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -1963,7 +1880,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1991,30 +1908,22 @@ export default class Indices { * Shrinks an existing index into a new index with fewer primary shards. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-shrink-index.html | Elasticsearch API documentation} */ - async shrink (this: That, params: T.IndicesShrinkRequest | TB.IndicesShrinkRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async shrink (this: That, params: T.IndicesShrinkRequest | TB.IndicesShrinkRequest, options?: TransportRequestOptionsWithMeta): Promise> - async shrink (this: That, params: T.IndicesShrinkRequest | TB.IndicesShrinkRequest, options?: TransportRequestOptions): Promise - async shrink (this: That, params: T.IndicesShrinkRequest | TB.IndicesShrinkRequest, options?: TransportRequestOptions): Promise { + async shrink (this: That, params: T.IndicesShrinkRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async shrink (this: That, params: T.IndicesShrinkRequest, options?: TransportRequestOptionsWithMeta): Promise> + async shrink (this: That, params: T.IndicesShrinkRequest, options?: TransportRequestOptions): Promise + async shrink (this: That, params: T.IndicesShrinkRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index', 'target'] const acceptedBody: string[] = ['aliases', 'settings'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2036,10 +1945,10 @@ export default class Indices { * Simulate an index. Returns the index configuration that would be applied to the specified index from an existing index template. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-simulate-index.html | Elasticsearch API documentation} */ - async simulateIndexTemplate (this: That, params: T.IndicesSimulateIndexTemplateRequest | TB.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async simulateIndexTemplate (this: That, params: T.IndicesSimulateIndexTemplateRequest | TB.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async simulateIndexTemplate (this: That, params: T.IndicesSimulateIndexTemplateRequest | TB.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptions): Promise - async simulateIndexTemplate (this: That, params: T.IndicesSimulateIndexTemplateRequest | TB.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptions): Promise { + async simulateIndexTemplate (this: That, params: T.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async simulateIndexTemplate (this: That, params: T.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async simulateIndexTemplate (this: That, params: T.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptions): Promise + async simulateIndexTemplate (this: That, params: T.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -2047,7 +1956,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2068,31 +1977,23 @@ export default class Indices { * Simulate an index template. Returns the index configuration that would be applied by a particular index template. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-simulate-template.html | Elasticsearch API documentation} */ - async simulateTemplate (this: That, params?: T.IndicesSimulateTemplateRequest | TB.IndicesSimulateTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async simulateTemplate (this: That, params?: T.IndicesSimulateTemplateRequest | TB.IndicesSimulateTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async simulateTemplate (this: That, params?: T.IndicesSimulateTemplateRequest | TB.IndicesSimulateTemplateRequest, options?: TransportRequestOptions): Promise - async simulateTemplate (this: That, params?: T.IndicesSimulateTemplateRequest | TB.IndicesSimulateTemplateRequest, options?: TransportRequestOptions): Promise { + async simulateTemplate (this: That, params?: T.IndicesSimulateTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async simulateTemplate (this: That, params?: T.IndicesSimulateTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async simulateTemplate (this: That, params?: T.IndicesSimulateTemplateRequest, options?: TransportRequestOptions): Promise + async simulateTemplate (this: That, params?: T.IndicesSimulateTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const acceptedBody: string[] = ['allow_auto_create', 'index_patterns', 'composed_of', 'template', 'data_stream', 'priority', 'version', '_meta', 'ignore_missing_component_templates', 'deprecated'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2120,30 +2021,22 @@ export default class Indices { * Splits an existing index into a new index with more primary shards. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-split-index.html | Elasticsearch API documentation} */ - async split (this: That, params: T.IndicesSplitRequest | TB.IndicesSplitRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async split (this: That, params: T.IndicesSplitRequest | TB.IndicesSplitRequest, options?: TransportRequestOptionsWithMeta): Promise> - async split (this: That, params: T.IndicesSplitRequest | TB.IndicesSplitRequest, options?: TransportRequestOptions): Promise - async split (this: That, params: T.IndicesSplitRequest | TB.IndicesSplitRequest, options?: TransportRequestOptions): Promise { + async split (this: That, params: T.IndicesSplitRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async split (this: That, params: T.IndicesSplitRequest, options?: TransportRequestOptionsWithMeta): Promise> + async split (this: That, params: T.IndicesSplitRequest, options?: TransportRequestOptions): Promise + async split (this: That, params: T.IndicesSplitRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index', 'target'] const acceptedBody: string[] = ['aliases', 'settings'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2165,10 +2058,10 @@ export default class Indices { * Returns statistics for one or more indices. For data streams, the API retrieves statistics for the stream’s backing indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-stats.html | Elasticsearch API documentation} */ - async stats (this: That, params?: T.IndicesStatsRequest | TB.IndicesStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async stats (this: That, params?: T.IndicesStatsRequest | TB.IndicesStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async stats (this: That, params?: T.IndicesStatsRequest | TB.IndicesStatsRequest, options?: TransportRequestOptions): Promise - async stats (this: That, params?: T.IndicesStatsRequest | TB.IndicesStatsRequest, options?: TransportRequestOptions): Promise { + async stats (this: That, params?: T.IndicesStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async stats (this: That, params?: T.IndicesStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async stats (this: That, params?: T.IndicesStatsRequest, options?: TransportRequestOptions): Promise + async stats (this: That, params?: T.IndicesStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['metric', 'index'] const querystring: Record = {} const body = undefined @@ -2177,7 +2070,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2212,10 +2105,10 @@ export default class Indices { * Unfreezes an index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/unfreeze-index-api.html | Elasticsearch API documentation} */ - async unfreeze (this: That, params: T.IndicesUnfreezeRequest | TB.IndicesUnfreezeRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async unfreeze (this: That, params: T.IndicesUnfreezeRequest | TB.IndicesUnfreezeRequest, options?: TransportRequestOptionsWithMeta): Promise> - async unfreeze (this: That, params: T.IndicesUnfreezeRequest | TB.IndicesUnfreezeRequest, options?: TransportRequestOptions): Promise - async unfreeze (this: That, params: T.IndicesUnfreezeRequest | TB.IndicesUnfreezeRequest, options?: TransportRequestOptions): Promise { + async unfreeze (this: That, params: T.IndicesUnfreezeRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async unfreeze (this: That, params: T.IndicesUnfreezeRequest, options?: TransportRequestOptionsWithMeta): Promise> + async unfreeze (this: That, params: T.IndicesUnfreezeRequest, options?: TransportRequestOptions): Promise + async unfreeze (this: That, params: T.IndicesUnfreezeRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -2223,7 +2116,7 @@ export default class Indices { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2244,31 +2137,23 @@ export default class Indices { * Create or update an alias. Adds a data stream or index to an alias. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-aliases.html | Elasticsearch API documentation} */ - async updateAliases (this: That, params?: T.IndicesUpdateAliasesRequest | TB.IndicesUpdateAliasesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateAliases (this: That, params?: T.IndicesUpdateAliasesRequest | TB.IndicesUpdateAliasesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateAliases (this: That, params?: T.IndicesUpdateAliasesRequest | TB.IndicesUpdateAliasesRequest, options?: TransportRequestOptions): Promise - async updateAliases (this: That, params?: T.IndicesUpdateAliasesRequest | TB.IndicesUpdateAliasesRequest, options?: TransportRequestOptions): Promise { + async updateAliases (this: That, params?: T.IndicesUpdateAliasesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateAliases (this: That, params?: T.IndicesUpdateAliasesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateAliases (this: That, params?: T.IndicesUpdateAliasesRequest, options?: TransportRequestOptions): Promise + async updateAliases (this: That, params?: T.IndicesUpdateAliasesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['actions'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2286,31 +2171,23 @@ export default class Indices { * Validate a query. Validates a query without running it. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-validate.html | Elasticsearch API documentation} */ - async validateQuery (this: That, params?: T.IndicesValidateQueryRequest | TB.IndicesValidateQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async validateQuery (this: That, params?: T.IndicesValidateQueryRequest | TB.IndicesValidateQueryRequest, options?: TransportRequestOptionsWithMeta): Promise> - async validateQuery (this: That, params?: T.IndicesValidateQueryRequest | TB.IndicesValidateQueryRequest, options?: TransportRequestOptions): Promise - async validateQuery (this: That, params?: T.IndicesValidateQueryRequest | TB.IndicesValidateQueryRequest, options?: TransportRequestOptions): Promise { + async validateQuery (this: That, params?: T.IndicesValidateQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async validateQuery (this: That, params?: T.IndicesValidateQueryRequest, options?: TransportRequestOptionsWithMeta): Promise> + async validateQuery (this: That, params?: T.IndicesValidateQueryRequest, options?: TransportRequestOptions): Promise + async validateQuery (this: That, params?: T.IndicesValidateQueryRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['query'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/inference.ts b/src/api/api/inference.ts index f9c1d3e61..d2d0f5914 100644 --- a/src/api/api/inference.ts +++ b/src/api/api/inference.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Inference { @@ -48,10 +47,10 @@ export default class Inference { * Delete an inference endpoint * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-inference-api.html | Elasticsearch API documentation} */ - async delete (this: That, params: T.InferenceDeleteRequest | TB.InferenceDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async delete (this: That, params: T.InferenceDeleteRequest | TB.InferenceDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> - async delete (this: That, params: T.InferenceDeleteRequest | TB.InferenceDeleteRequest, options?: TransportRequestOptions): Promise - async delete (this: That, params: T.InferenceDeleteRequest | TB.InferenceDeleteRequest, options?: TransportRequestOptions): Promise { + async delete (this: That, params: T.InferenceDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async delete (this: That, params: T.InferenceDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> + async delete (this: That, params: T.InferenceDeleteRequest, options?: TransportRequestOptions): Promise + async delete (this: That, params: T.InferenceDeleteRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['task_type', 'inference_id'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Inference { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -88,10 +87,10 @@ export default class Inference { * Get an inference endpoint * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-inference-api.html | Elasticsearch API documentation} */ - async get (this: That, params?: T.InferenceGetRequest | TB.InferenceGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async get (this: That, params?: T.InferenceGetRequest | TB.InferenceGetRequest, options?: TransportRequestOptionsWithMeta): Promise> - async get (this: That, params?: T.InferenceGetRequest | TB.InferenceGetRequest, options?: TransportRequestOptions): Promise - async get (this: That, params?: T.InferenceGetRequest | TB.InferenceGetRequest, options?: TransportRequestOptions): Promise { + async get (this: That, params?: T.InferenceGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async get (this: That, params?: T.InferenceGetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async get (this: That, params?: T.InferenceGetRequest, options?: TransportRequestOptions): Promise + async get (this: That, params?: T.InferenceGetRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['task_type', 'inference_id'] const querystring: Record = {} const body = undefined @@ -100,7 +99,7 @@ export default class Inference { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -132,30 +131,22 @@ export default class Inference { * Perform inference on the service * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/post-inference-api.html | Elasticsearch API documentation} */ - async inference (this: That, params: T.InferenceInferenceRequest | TB.InferenceInferenceRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async inference (this: That, params: T.InferenceInferenceRequest | TB.InferenceInferenceRequest, options?: TransportRequestOptionsWithMeta): Promise> - async inference (this: That, params: T.InferenceInferenceRequest | TB.InferenceInferenceRequest, options?: TransportRequestOptions): Promise - async inference (this: That, params: T.InferenceInferenceRequest | TB.InferenceInferenceRequest, options?: TransportRequestOptions): Promise { + async inference (this: That, params: T.InferenceInferenceRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async inference (this: That, params: T.InferenceInferenceRequest, options?: TransportRequestOptionsWithMeta): Promise> + async inference (this: That, params: T.InferenceInferenceRequest, options?: TransportRequestOptions): Promise + async inference (this: That, params: T.InferenceInferenceRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['task_type', 'inference_id'] const acceptedBody: string[] = ['query', 'input', 'task_settings'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -184,15 +175,14 @@ export default class Inference { * Create an inference endpoint * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-inference-api.html | Elasticsearch API documentation} */ - async put (this: That, params: T.InferencePutRequest | TB.InferencePutRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async put (this: That, params: T.InferencePutRequest | TB.InferencePutRequest, options?: TransportRequestOptionsWithMeta): Promise> - async put (this: That, params: T.InferencePutRequest | TB.InferencePutRequest, options?: TransportRequestOptions): Promise - async put (this: That, params: T.InferencePutRequest | TB.InferencePutRequest, options?: TransportRequestOptions): Promise { + async put (this: That, params: T.InferencePutRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async put (this: That, params: T.InferencePutRequest, options?: TransportRequestOptionsWithMeta): Promise> + async put (this: That, params: T.InferencePutRequest, options?: TransportRequestOptions): Promise + async put (this: That, params: T.InferencePutRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['task_type', 'inference_id'] const acceptedBody: string[] = ['inference_config'] const querystring: Record = {} - // @ts-expect-error - let body: any = params.body ?? undefined + let body: any for (const key in params) { if (acceptedBody.includes(key)) { @@ -200,7 +190,7 @@ export default class Inference { body = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -229,10 +219,10 @@ export default class Inference { * Perform streaming inference * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/post-stream-inference-api.html | Elasticsearch API documentation} */ - async streamInference (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async streamInference (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async streamInference (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async streamInference (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async streamInference (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async streamInference (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async streamInference (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async streamInference (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['inference_id', 'task_type'] const querystring: Record = {} const body = undefined @@ -241,7 +231,7 @@ export default class Inference { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } diff --git a/src/api/api/info.ts b/src/api/api/info.ts index 598225e02..9ef778d58 100644 --- a/src/api/api/info.ts +++ b/src/api/api/info.ts @@ -35,17 +35,16 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Get cluster info. Returns basic information about the cluster. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/index.html | Elasticsearch API documentation} */ -export default async function InfoApi (this: That, params?: T.InfoRequest | TB.InfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function InfoApi (this: That, params?: T.InfoRequest | TB.InfoRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function InfoApi (this: That, params?: T.InfoRequest | TB.InfoRequest, options?: TransportRequestOptions): Promise -export default async function InfoApi (this: That, params?: T.InfoRequest | TB.InfoRequest, options?: TransportRequestOptions): Promise { +export default async function InfoApi (this: That, params?: T.InfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function InfoApi (this: That, params?: T.InfoRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function InfoApi (this: That, params?: T.InfoRequest, options?: TransportRequestOptions): Promise +export default async function InfoApi (this: That, params?: T.InfoRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -54,7 +53,7 @@ export default async function InfoApi (this: That, params?: T.InfoRequest | TB.I for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/ingest.ts b/src/api/api/ingest.ts index e7322eadf..0d55ce9ba 100644 --- a/src/api/api/ingest.ts +++ b/src/api/api/ingest.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Ingest { @@ -45,13 +44,13 @@ export default class Ingest { } /** - * Deletes a geoip database configuration. + * Delete GeoIP database configurations. Delete one or more IP geolocation database configurations. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-geoip-database-api.html | Elasticsearch API documentation} */ - async deleteGeoipDatabase (this: That, params: T.IngestDeleteGeoipDatabaseRequest | TB.IngestDeleteGeoipDatabaseRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteGeoipDatabase (this: That, params: T.IngestDeleteGeoipDatabaseRequest | TB.IngestDeleteGeoipDatabaseRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteGeoipDatabase (this: That, params: T.IngestDeleteGeoipDatabaseRequest | TB.IngestDeleteGeoipDatabaseRequest, options?: TransportRequestOptions): Promise - async deleteGeoipDatabase (this: That, params: T.IngestDeleteGeoipDatabaseRequest | TB.IngestDeleteGeoipDatabaseRequest, options?: TransportRequestOptions): Promise { + async deleteGeoipDatabase (this: That, params: T.IngestDeleteGeoipDatabaseRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteGeoipDatabase (this: That, params: T.IngestDeleteGeoipDatabaseRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteGeoipDatabase (this: That, params: T.IngestDeleteGeoipDatabaseRequest, options?: TransportRequestOptions): Promise + async deleteGeoipDatabase (this: That, params: T.IngestDeleteGeoipDatabaseRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Ingest { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -80,10 +79,10 @@ export default class Ingest { * Deletes an ip location database configuration * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-ip-location-database-api.html | Elasticsearch API documentation} */ - async deleteIpLocationDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteIpLocationDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async deleteIpLocationDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async deleteIpLocationDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async deleteIpLocationDatabase (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteIpLocationDatabase (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async deleteIpLocationDatabase (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async deleteIpLocationDatabase (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -92,7 +91,7 @@ export default class Ingest { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -109,13 +108,13 @@ export default class Ingest { } /** - * Deletes one or more existing ingest pipeline. + * Delete pipelines. Delete one or more ingest pipelines. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-pipeline-api.html | Elasticsearch API documentation} */ - async deletePipeline (this: That, params: T.IngestDeletePipelineRequest | TB.IngestDeletePipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deletePipeline (this: That, params: T.IngestDeletePipelineRequest | TB.IngestDeletePipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deletePipeline (this: That, params: T.IngestDeletePipelineRequest | TB.IngestDeletePipelineRequest, options?: TransportRequestOptions): Promise - async deletePipeline (this: That, params: T.IngestDeletePipelineRequest | TB.IngestDeletePipelineRequest, options?: TransportRequestOptions): Promise { + async deletePipeline (this: That, params: T.IngestDeletePipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deletePipeline (this: That, params: T.IngestDeletePipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deletePipeline (this: That, params: T.IngestDeletePipelineRequest, options?: TransportRequestOptions): Promise + async deletePipeline (this: That, params: T.IngestDeletePipelineRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -123,7 +122,7 @@ export default class Ingest { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -141,13 +140,13 @@ export default class Ingest { } /** - * Gets download statistics for GeoIP2 databases used with the geoip processor. + * Get GeoIP statistics. Get download statistics for GeoIP2 databases that are used with the GeoIP processor. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/geoip-processor.html | Elasticsearch API documentation} */ - async geoIpStats (this: That, params?: T.IngestGeoIpStatsRequest | TB.IngestGeoIpStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async geoIpStats (this: That, params?: T.IngestGeoIpStatsRequest | TB.IngestGeoIpStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async geoIpStats (this: That, params?: T.IngestGeoIpStatsRequest | TB.IngestGeoIpStatsRequest, options?: TransportRequestOptions): Promise - async geoIpStats (this: That, params?: T.IngestGeoIpStatsRequest | TB.IngestGeoIpStatsRequest, options?: TransportRequestOptions): Promise { + async geoIpStats (this: That, params?: T.IngestGeoIpStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async geoIpStats (this: That, params?: T.IngestGeoIpStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async geoIpStats (this: That, params?: T.IngestGeoIpStatsRequest, options?: TransportRequestOptions): Promise + async geoIpStats (this: That, params?: T.IngestGeoIpStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -156,7 +155,7 @@ export default class Ingest { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -171,13 +170,13 @@ export default class Ingest { } /** - * Returns information about one or more geoip database configurations. + * Get GeoIP database configurations. Get information about one or more IP geolocation database configurations. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-geoip-database-api.html | Elasticsearch API documentation} */ - async getGeoipDatabase (this: That, params?: T.IngestGetGeoipDatabaseRequest | TB.IngestGetGeoipDatabaseRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getGeoipDatabase (this: That, params?: T.IngestGetGeoipDatabaseRequest | TB.IngestGetGeoipDatabaseRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getGeoipDatabase (this: That, params?: T.IngestGetGeoipDatabaseRequest | TB.IngestGetGeoipDatabaseRequest, options?: TransportRequestOptions): Promise - async getGeoipDatabase (this: That, params?: T.IngestGetGeoipDatabaseRequest | TB.IngestGetGeoipDatabaseRequest, options?: TransportRequestOptions): Promise { + async getGeoipDatabase (this: That, params?: T.IngestGetGeoipDatabaseRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getGeoipDatabase (this: That, params?: T.IngestGetGeoipDatabaseRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getGeoipDatabase (this: That, params?: T.IngestGetGeoipDatabaseRequest, options?: TransportRequestOptions): Promise + async getGeoipDatabase (this: That, params?: T.IngestGetGeoipDatabaseRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -186,7 +185,7 @@ export default class Ingest { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -214,10 +213,10 @@ export default class Ingest { * Returns the specified ip location database configuration * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-ip-location-database-api.html | Elasticsearch API documentation} */ - async getIpLocationDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async getIpLocationDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async getIpLocationDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async getIpLocationDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async getIpLocationDatabase (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async getIpLocationDatabase (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async getIpLocationDatabase (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async getIpLocationDatabase (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -226,7 +225,7 @@ export default class Ingest { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -250,13 +249,13 @@ export default class Ingest { } /** - * Returns information about one or more ingest pipelines. This API returns a local reference of the pipeline. + * Get pipelines. Get information about one or more ingest pipelines. This API returns a local reference of the pipeline. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-pipeline-api.html | Elasticsearch API documentation} */ - async getPipeline (this: That, params?: T.IngestGetPipelineRequest | TB.IngestGetPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getPipeline (this: That, params?: T.IngestGetPipelineRequest | TB.IngestGetPipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getPipeline (this: That, params?: T.IngestGetPipelineRequest | TB.IngestGetPipelineRequest, options?: TransportRequestOptions): Promise - async getPipeline (this: That, params?: T.IngestGetPipelineRequest | TB.IngestGetPipelineRequest, options?: TransportRequestOptions): Promise { + async getPipeline (this: That, params?: T.IngestGetPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getPipeline (this: That, params?: T.IngestGetPipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getPipeline (this: That, params?: T.IngestGetPipelineRequest, options?: TransportRequestOptions): Promise + async getPipeline (this: That, params?: T.IngestGetPipelineRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -265,7 +264,7 @@ export default class Ingest { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -290,13 +289,13 @@ export default class Ingest { } /** - * Extracts structured fields out of a single text field within a document. You choose which field to extract matched fields from, as well as the grok pattern you expect will match. A grok pattern is like a regular expression that supports aliased expressions that can be reused. + * Run a grok processor. Extract structured fields out of a single text field within a document. You must choose which field to extract matched fields from, as well as the grok pattern you expect will match. A grok pattern is like a regular expression that supports aliased expressions that can be reused. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/grok-processor.html | Elasticsearch API documentation} */ - async processorGrok (this: That, params?: T.IngestProcessorGrokRequest | TB.IngestProcessorGrokRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async processorGrok (this: That, params?: T.IngestProcessorGrokRequest | TB.IngestProcessorGrokRequest, options?: TransportRequestOptionsWithMeta): Promise> - async processorGrok (this: That, params?: T.IngestProcessorGrokRequest | TB.IngestProcessorGrokRequest, options?: TransportRequestOptions): Promise - async processorGrok (this: That, params?: T.IngestProcessorGrokRequest | TB.IngestProcessorGrokRequest, options?: TransportRequestOptions): Promise { + async processorGrok (this: That, params?: T.IngestProcessorGrokRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async processorGrok (this: That, params?: T.IngestProcessorGrokRequest, options?: TransportRequestOptionsWithMeta): Promise> + async processorGrok (this: That, params?: T.IngestProcessorGrokRequest, options?: TransportRequestOptions): Promise + async processorGrok (this: That, params?: T.IngestProcessorGrokRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -305,7 +304,7 @@ export default class Ingest { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -320,33 +319,25 @@ export default class Ingest { } /** - * Returns information about one or more geoip database configurations. + * Create or update GeoIP database configurations. Create or update IP geolocation database configurations. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-geoip-database-api.html | Elasticsearch API documentation} */ - async putGeoipDatabase (this: That, params: T.IngestPutGeoipDatabaseRequest | TB.IngestPutGeoipDatabaseRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putGeoipDatabase (this: That, params: T.IngestPutGeoipDatabaseRequest | TB.IngestPutGeoipDatabaseRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putGeoipDatabase (this: That, params: T.IngestPutGeoipDatabaseRequest | TB.IngestPutGeoipDatabaseRequest, options?: TransportRequestOptions): Promise - async putGeoipDatabase (this: That, params: T.IngestPutGeoipDatabaseRequest | TB.IngestPutGeoipDatabaseRequest, options?: TransportRequestOptions): Promise { + async putGeoipDatabase (this: That, params: T.IngestPutGeoipDatabaseRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putGeoipDatabase (this: That, params: T.IngestPutGeoipDatabaseRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putGeoipDatabase (this: That, params: T.IngestPutGeoipDatabaseRequest, options?: TransportRequestOptions): Promise + async putGeoipDatabase (this: That, params: T.IngestPutGeoipDatabaseRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const acceptedBody: string[] = ['name', 'maxmind'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -367,10 +358,10 @@ export default class Ingest { * Puts the configuration for a ip location database to be downloaded * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-ip-location-database-api.html | Elasticsearch API documentation} */ - async putIpLocationDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async putIpLocationDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async putIpLocationDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async putIpLocationDatabase (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async putIpLocationDatabase (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async putIpLocationDatabase (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async putIpLocationDatabase (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async putIpLocationDatabase (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -379,7 +370,7 @@ export default class Ingest { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -396,33 +387,25 @@ export default class Ingest { } /** - * Creates or updates an ingest pipeline. Changes made using this API take effect immediately. + * Create or update a pipeline. Changes made using this API take effect immediately. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ingest.html | Elasticsearch API documentation} */ - async putPipeline (this: That, params: T.IngestPutPipelineRequest | TB.IngestPutPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putPipeline (this: That, params: T.IngestPutPipelineRequest | TB.IngestPutPipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putPipeline (this: That, params: T.IngestPutPipelineRequest | TB.IngestPutPipelineRequest, options?: TransportRequestOptions): Promise - async putPipeline (this: That, params: T.IngestPutPipelineRequest | TB.IngestPutPipelineRequest, options?: TransportRequestOptions): Promise { + async putPipeline (this: That, params: T.IngestPutPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putPipeline (this: That, params: T.IngestPutPipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putPipeline (this: That, params: T.IngestPutPipelineRequest, options?: TransportRequestOptions): Promise + async putPipeline (this: That, params: T.IngestPutPipelineRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const acceptedBody: string[] = ['_meta', 'description', 'on_failure', 'processors', 'version', 'deprecated'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -440,33 +423,25 @@ export default class Ingest { } /** - * Executes an ingest pipeline against a set of provided documents. + * Simulate a pipeline. Run an ingest pipeline against a set of provided documents. You can either specify an existing pipeline to use with the provided documents or supply a pipeline definition in the body of the request. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/simulate-pipeline-api.html | Elasticsearch API documentation} */ - async simulate (this: That, params: T.IngestSimulateRequest | TB.IngestSimulateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async simulate (this: That, params: T.IngestSimulateRequest | TB.IngestSimulateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async simulate (this: That, params: T.IngestSimulateRequest | TB.IngestSimulateRequest, options?: TransportRequestOptions): Promise - async simulate (this: That, params: T.IngestSimulateRequest | TB.IngestSimulateRequest, options?: TransportRequestOptions): Promise { + async simulate (this: That, params: T.IngestSimulateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async simulate (this: That, params: T.IngestSimulateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async simulate (this: That, params: T.IngestSimulateRequest, options?: TransportRequestOptions): Promise + async simulate (this: That, params: T.IngestSimulateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const acceptedBody: string[] = ['docs', 'pipeline'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/knn_search.ts b/src/api/api/knn_search.ts index 1ff41fb38..c9f918719 100644 --- a/src/api/api/knn_search.ts +++ b/src/api/api/knn_search.ts @@ -35,37 +35,28 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Run a knn search. NOTE: The kNN search API has been replaced by the `knn` option in the search API. Perform a k-nearest neighbor (kNN) search on a dense_vector field and return the matching documents. Given a query vector, the API finds the k closest vectors and returns those documents as search hits. Elasticsearch uses the HNSW algorithm to support efficient kNN search. Like most kNN algorithms, HNSW is an approximate method that sacrifices result accuracy for improved search speed. This means the results returned are not always the true k closest neighbors. The kNN search API supports restricting the search using a filter. The search will return the top k documents that also match the filter query. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-search.html | Elasticsearch API documentation} */ -export default async function KnnSearchApi (this: That, params: T.KnnSearchRequest | TB.KnnSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> -export default async function KnnSearchApi (this: That, params: T.KnnSearchRequest | TB.KnnSearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> -export default async function KnnSearchApi (this: That, params: T.KnnSearchRequest | TB.KnnSearchRequest, options?: TransportRequestOptions): Promise> -export default async function KnnSearchApi (this: That, params: T.KnnSearchRequest | TB.KnnSearchRequest, options?: TransportRequestOptions): Promise { +export default async function KnnSearchApi (this: That, params: T.KnnSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> +export default async function KnnSearchApi (this: That, params: T.KnnSearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> +export default async function KnnSearchApi (this: That, params: T.KnnSearchRequest, options?: TransportRequestOptions): Promise> +export default async function KnnSearchApi (this: That, params: T.KnnSearchRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['_source', 'docvalue_fields', 'stored_fields', 'fields', 'filter', 'knn'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/license.ts b/src/api/api/license.ts index 2a9dad240..9e71c7cf7 100644 --- a/src/api/api/license.ts +++ b/src/api/api/license.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class License { @@ -48,10 +47,10 @@ export default class License { * Deletes licensing information for the cluster * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-license.html | Elasticsearch API documentation} */ - async delete (this: That, params?: T.LicenseDeleteRequest | TB.LicenseDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async delete (this: That, params?: T.LicenseDeleteRequest | TB.LicenseDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> - async delete (this: That, params?: T.LicenseDeleteRequest | TB.LicenseDeleteRequest, options?: TransportRequestOptions): Promise - async delete (this: That, params?: T.LicenseDeleteRequest | TB.LicenseDeleteRequest, options?: TransportRequestOptions): Promise { + async delete (this: That, params?: T.LicenseDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async delete (this: That, params?: T.LicenseDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> + async delete (this: That, params?: T.LicenseDeleteRequest, options?: TransportRequestOptions): Promise + async delete (this: That, params?: T.LicenseDeleteRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -60,7 +59,7 @@ export default class License { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -78,10 +77,10 @@ export default class License { * Get license information. Returns information about your Elastic license, including its type, its status, when it was issued, and when it expires. For more information about the different types of licenses, refer to [Elastic Stack subscriptions](https://www.elastic.co/subscriptions). * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-license.html | Elasticsearch API documentation} */ - async get (this: That, params?: T.LicenseGetRequest | TB.LicenseGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async get (this: That, params?: T.LicenseGetRequest | TB.LicenseGetRequest, options?: TransportRequestOptionsWithMeta): Promise> - async get (this: That, params?: T.LicenseGetRequest | TB.LicenseGetRequest, options?: TransportRequestOptions): Promise - async get (this: That, params?: T.LicenseGetRequest | TB.LicenseGetRequest, options?: TransportRequestOptions): Promise { + async get (this: That, params?: T.LicenseGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async get (this: That, params?: T.LicenseGetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async get (this: That, params?: T.LicenseGetRequest, options?: TransportRequestOptions): Promise + async get (this: That, params?: T.LicenseGetRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -90,7 +89,7 @@ export default class License { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -108,10 +107,10 @@ export default class License { * Retrieves information about the status of the basic license. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-basic-status.html | Elasticsearch API documentation} */ - async getBasicStatus (this: That, params?: T.LicenseGetBasicStatusRequest | TB.LicenseGetBasicStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getBasicStatus (this: That, params?: T.LicenseGetBasicStatusRequest | TB.LicenseGetBasicStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getBasicStatus (this: That, params?: T.LicenseGetBasicStatusRequest | TB.LicenseGetBasicStatusRequest, options?: TransportRequestOptions): Promise - async getBasicStatus (this: That, params?: T.LicenseGetBasicStatusRequest | TB.LicenseGetBasicStatusRequest, options?: TransportRequestOptions): Promise { + async getBasicStatus (this: That, params?: T.LicenseGetBasicStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getBasicStatus (this: That, params?: T.LicenseGetBasicStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getBasicStatus (this: That, params?: T.LicenseGetBasicStatusRequest, options?: TransportRequestOptions): Promise + async getBasicStatus (this: That, params?: T.LicenseGetBasicStatusRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -120,7 +119,7 @@ export default class License { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -138,10 +137,10 @@ export default class License { * Retrieves information about the status of the trial license. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-trial-status.html | Elasticsearch API documentation} */ - async getTrialStatus (this: That, params?: T.LicenseGetTrialStatusRequest | TB.LicenseGetTrialStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getTrialStatus (this: That, params?: T.LicenseGetTrialStatusRequest | TB.LicenseGetTrialStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getTrialStatus (this: That, params?: T.LicenseGetTrialStatusRequest | TB.LicenseGetTrialStatusRequest, options?: TransportRequestOptions): Promise - async getTrialStatus (this: That, params?: T.LicenseGetTrialStatusRequest | TB.LicenseGetTrialStatusRequest, options?: TransportRequestOptions): Promise { + async getTrialStatus (this: That, params?: T.LicenseGetTrialStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getTrialStatus (this: That, params?: T.LicenseGetTrialStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getTrialStatus (this: That, params?: T.LicenseGetTrialStatusRequest, options?: TransportRequestOptions): Promise + async getTrialStatus (this: That, params?: T.LicenseGetTrialStatusRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -150,7 +149,7 @@ export default class License { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -168,31 +167,23 @@ export default class License { * Updates the license for the cluster. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-license.html | Elasticsearch API documentation} */ - async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithMeta): Promise> - async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptions): Promise - async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptions): Promise { + async post (this: That, params?: T.LicensePostRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async post (this: That, params?: T.LicensePostRequest, options?: TransportRequestOptionsWithMeta): Promise> + async post (this: That, params?: T.LicensePostRequest, options?: TransportRequestOptions): Promise + async post (this: That, params?: T.LicensePostRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['license', 'licenses'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -210,10 +201,10 @@ export default class License { * The start basic API enables you to initiate an indefinite basic license, which gives access to all the basic features. If the basic license does not support all of the features that are available with your current license, however, you are notified in the response. You must then re-submit the API request with the acknowledge parameter set to true. To check the status of your basic license, use the following API: [Get basic status](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-basic-status.html). * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/start-basic.html | Elasticsearch API documentation} */ - async postStartBasic (this: That, params?: T.LicensePostStartBasicRequest | TB.LicensePostStartBasicRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async postStartBasic (this: That, params?: T.LicensePostStartBasicRequest | TB.LicensePostStartBasicRequest, options?: TransportRequestOptionsWithMeta): Promise> - async postStartBasic (this: That, params?: T.LicensePostStartBasicRequest | TB.LicensePostStartBasicRequest, options?: TransportRequestOptions): Promise - async postStartBasic (this: That, params?: T.LicensePostStartBasicRequest | TB.LicensePostStartBasicRequest, options?: TransportRequestOptions): Promise { + async postStartBasic (this: That, params?: T.LicensePostStartBasicRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async postStartBasic (this: That, params?: T.LicensePostStartBasicRequest, options?: TransportRequestOptionsWithMeta): Promise> + async postStartBasic (this: That, params?: T.LicensePostStartBasicRequest, options?: TransportRequestOptions): Promise + async postStartBasic (this: That, params?: T.LicensePostStartBasicRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -222,7 +213,7 @@ export default class License { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -240,10 +231,10 @@ export default class License { * The start trial API enables you to start a 30-day trial, which gives access to all subscription features. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/start-trial.html | Elasticsearch API documentation} */ - async postStartTrial (this: That, params?: T.LicensePostStartTrialRequest | TB.LicensePostStartTrialRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async postStartTrial (this: That, params?: T.LicensePostStartTrialRequest | TB.LicensePostStartTrialRequest, options?: TransportRequestOptionsWithMeta): Promise> - async postStartTrial (this: That, params?: T.LicensePostStartTrialRequest | TB.LicensePostStartTrialRequest, options?: TransportRequestOptions): Promise - async postStartTrial (this: That, params?: T.LicensePostStartTrialRequest | TB.LicensePostStartTrialRequest, options?: TransportRequestOptions): Promise { + async postStartTrial (this: That, params?: T.LicensePostStartTrialRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async postStartTrial (this: That, params?: T.LicensePostStartTrialRequest, options?: TransportRequestOptionsWithMeta): Promise> + async postStartTrial (this: That, params?: T.LicensePostStartTrialRequest, options?: TransportRequestOptions): Promise + async postStartTrial (this: That, params?: T.LicensePostStartTrialRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -252,7 +243,7 @@ export default class License { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/logstash.ts b/src/api/api/logstash.ts index 8477f9085..8274dfb1e 100644 --- a/src/api/api/logstash.ts +++ b/src/api/api/logstash.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Logstash { @@ -48,10 +47,10 @@ export default class Logstash { * Deletes a pipeline used for Logstash Central Management. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/logstash-api-delete-pipeline.html | Elasticsearch API documentation} */ - async deletePipeline (this: That, params: T.LogstashDeletePipelineRequest | TB.LogstashDeletePipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deletePipeline (this: That, params: T.LogstashDeletePipelineRequest | TB.LogstashDeletePipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deletePipeline (this: That, params: T.LogstashDeletePipelineRequest | TB.LogstashDeletePipelineRequest, options?: TransportRequestOptions): Promise - async deletePipeline (this: That, params: T.LogstashDeletePipelineRequest | TB.LogstashDeletePipelineRequest, options?: TransportRequestOptions): Promise { + async deletePipeline (this: That, params: T.LogstashDeletePipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deletePipeline (this: That, params: T.LogstashDeletePipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deletePipeline (this: That, params: T.LogstashDeletePipelineRequest, options?: TransportRequestOptions): Promise + async deletePipeline (this: That, params: T.LogstashDeletePipelineRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Logstash { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -80,10 +79,10 @@ export default class Logstash { * Retrieves pipelines used for Logstash Central Management. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/logstash-api-get-pipeline.html | Elasticsearch API documentation} */ - async getPipeline (this: That, params?: T.LogstashGetPipelineRequest | TB.LogstashGetPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getPipeline (this: That, params?: T.LogstashGetPipelineRequest | TB.LogstashGetPipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getPipeline (this: That, params?: T.LogstashGetPipelineRequest | TB.LogstashGetPipelineRequest, options?: TransportRequestOptions): Promise - async getPipeline (this: That, params?: T.LogstashGetPipelineRequest | TB.LogstashGetPipelineRequest, options?: TransportRequestOptions): Promise { + async getPipeline (this: That, params?: T.LogstashGetPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getPipeline (this: That, params?: T.LogstashGetPipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getPipeline (this: That, params?: T.LogstashGetPipelineRequest, options?: TransportRequestOptions): Promise + async getPipeline (this: That, params?: T.LogstashGetPipelineRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -92,7 +91,7 @@ export default class Logstash { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -120,15 +119,14 @@ export default class Logstash { * Creates or updates a pipeline used for Logstash Central Management. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/logstash-api-put-pipeline.html | Elasticsearch API documentation} */ - async putPipeline (this: That, params: T.LogstashPutPipelineRequest | TB.LogstashPutPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putPipeline (this: That, params: T.LogstashPutPipelineRequest | TB.LogstashPutPipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putPipeline (this: That, params: T.LogstashPutPipelineRequest | TB.LogstashPutPipelineRequest, options?: TransportRequestOptions): Promise - async putPipeline (this: That, params: T.LogstashPutPipelineRequest | TB.LogstashPutPipelineRequest, options?: TransportRequestOptions): Promise { + async putPipeline (this: That, params: T.LogstashPutPipelineRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putPipeline (this: That, params: T.LogstashPutPipelineRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putPipeline (this: That, params: T.LogstashPutPipelineRequest, options?: TransportRequestOptions): Promise + async putPipeline (this: That, params: T.LogstashPutPipelineRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const acceptedBody: string[] = ['pipeline'] const querystring: Record = {} - // @ts-expect-error - let body: any = params.body ?? undefined + let body: any for (const key in params) { if (acceptedBody.includes(key)) { @@ -136,7 +134,7 @@ export default class Logstash { body = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/mget.ts b/src/api/api/mget.ts index 45fd11696..285efe072 100644 --- a/src/api/api/mget.ts +++ b/src/api/api/mget.ts @@ -35,38 +35,29 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Get multiple documents. Get multiple JSON documents by ID from one or more indices. If you specify an index in the request URI, you only need to specify the document IDs in the request body. To ensure fast responses, this multi get (mget) API responds with partial results if one or more shards fail. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-multi-get.html | Elasticsearch API documentation} */ -export default async function MgetApi (this: That, params?: T.MgetRequest | TB.MgetRequest, options?: TransportRequestOptionsWithOutMeta): Promise> -export default async function MgetApi (this: That, params?: T.MgetRequest | TB.MgetRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> -export default async function MgetApi (this: That, params?: T.MgetRequest | TB.MgetRequest, options?: TransportRequestOptions): Promise> -export default async function MgetApi (this: That, params?: T.MgetRequest | TB.MgetRequest, options?: TransportRequestOptions): Promise { +export default async function MgetApi (this: That, params?: T.MgetRequest, options?: TransportRequestOptionsWithOutMeta): Promise> +export default async function MgetApi (this: That, params?: T.MgetRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> +export default async function MgetApi (this: That, params?: T.MgetRequest, options?: TransportRequestOptions): Promise> +export default async function MgetApi (this: That, params?: T.MgetRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['docs', 'ids'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/migration.ts b/src/api/api/migration.ts index 6e454fa6b..4d655f1fa 100644 --- a/src/api/api/migration.ts +++ b/src/api/api/migration.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Migration { @@ -48,10 +47,10 @@ export default class Migration { * Retrieves information about different cluster, node, and index level settings that use deprecated features that will be removed or changed in the next major version. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/migration-api-deprecation.html | Elasticsearch API documentation} */ - async deprecations (this: That, params?: T.MigrationDeprecationsRequest | TB.MigrationDeprecationsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deprecations (this: That, params?: T.MigrationDeprecationsRequest | TB.MigrationDeprecationsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deprecations (this: That, params?: T.MigrationDeprecationsRequest | TB.MigrationDeprecationsRequest, options?: TransportRequestOptions): Promise - async deprecations (this: That, params?: T.MigrationDeprecationsRequest | TB.MigrationDeprecationsRequest, options?: TransportRequestOptions): Promise { + async deprecations (this: That, params?: T.MigrationDeprecationsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deprecations (this: That, params?: T.MigrationDeprecationsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deprecations (this: That, params?: T.MigrationDeprecationsRequest, options?: TransportRequestOptions): Promise + async deprecations (this: That, params?: T.MigrationDeprecationsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -60,7 +59,7 @@ export default class Migration { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -88,10 +87,10 @@ export default class Migration { * Find out whether system features need to be upgraded or not * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/migration-api-feature-upgrade.html | Elasticsearch API documentation} */ - async getFeatureUpgradeStatus (this: That, params?: T.MigrationGetFeatureUpgradeStatusRequest | TB.MigrationGetFeatureUpgradeStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getFeatureUpgradeStatus (this: That, params?: T.MigrationGetFeatureUpgradeStatusRequest | TB.MigrationGetFeatureUpgradeStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getFeatureUpgradeStatus (this: That, params?: T.MigrationGetFeatureUpgradeStatusRequest | TB.MigrationGetFeatureUpgradeStatusRequest, options?: TransportRequestOptions): Promise - async getFeatureUpgradeStatus (this: That, params?: T.MigrationGetFeatureUpgradeStatusRequest | TB.MigrationGetFeatureUpgradeStatusRequest, options?: TransportRequestOptions): Promise { + async getFeatureUpgradeStatus (this: That, params?: T.MigrationGetFeatureUpgradeStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getFeatureUpgradeStatus (this: That, params?: T.MigrationGetFeatureUpgradeStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getFeatureUpgradeStatus (this: That, params?: T.MigrationGetFeatureUpgradeStatusRequest, options?: TransportRequestOptions): Promise + async getFeatureUpgradeStatus (this: That, params?: T.MigrationGetFeatureUpgradeStatusRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -100,7 +99,7 @@ export default class Migration { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -118,10 +117,10 @@ export default class Migration { * Begin upgrades for system features * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/migration-api-feature-upgrade.html | Elasticsearch API documentation} */ - async postFeatureUpgrade (this: That, params?: T.MigrationPostFeatureUpgradeRequest | TB.MigrationPostFeatureUpgradeRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async postFeatureUpgrade (this: That, params?: T.MigrationPostFeatureUpgradeRequest | TB.MigrationPostFeatureUpgradeRequest, options?: TransportRequestOptionsWithMeta): Promise> - async postFeatureUpgrade (this: That, params?: T.MigrationPostFeatureUpgradeRequest | TB.MigrationPostFeatureUpgradeRequest, options?: TransportRequestOptions): Promise - async postFeatureUpgrade (this: That, params?: T.MigrationPostFeatureUpgradeRequest | TB.MigrationPostFeatureUpgradeRequest, options?: TransportRequestOptions): Promise { + async postFeatureUpgrade (this: That, params?: T.MigrationPostFeatureUpgradeRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async postFeatureUpgrade (this: That, params?: T.MigrationPostFeatureUpgradeRequest, options?: TransportRequestOptionsWithMeta): Promise> + async postFeatureUpgrade (this: That, params?: T.MigrationPostFeatureUpgradeRequest, options?: TransportRequestOptions): Promise + async postFeatureUpgrade (this: That, params?: T.MigrationPostFeatureUpgradeRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -130,7 +129,7 @@ export default class Migration { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/ml.ts b/src/api/api/ml.ts index 73ee0f319..45f78b699 100644 --- a/src/api/api/ml.ts +++ b/src/api/api/ml.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Ml { @@ -48,10 +47,10 @@ export default class Ml { * Clear trained model deployment cache. Cache will be cleared on all nodes where the trained model is assigned. A trained model deployment may have an inference cache enabled. As requests are handled by each allocated node, their responses may be cached on that individual node. Calling this API clears the caches without restarting the deployment. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/clear-trained-model-deployment-cache.html | Elasticsearch API documentation} */ - async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptionsWithMeta): Promise> - async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptions): Promise - async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptions): Promise { + async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptionsWithMeta): Promise> + async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptions): Promise + async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_id'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -80,30 +79,22 @@ export default class Ml { * Close anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. A closed job cannot receive data or perform analysis operations, but you can still explore and navigate results. When you close a job, it runs housekeeping tasks such as pruning the model history, flushing buffers, calculating final results and persisting the model snapshots. Depending upon the size of the job, it could take several minutes to close and the equivalent time to re-open. After it is closed, the job has a minimal overhead on the cluster except for maintaining its meta data. Therefore it is a best practice to close jobs that are no longer required to process data. If you close an anomaly detection job whose datafeed is running, the request first tries to stop the datafeed. This behavior is equivalent to calling stop datafeed API with the same timeout and force parameters as the close job request. When a datafeed that has a specified end date stops, it automatically closes its associated job. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-close-job.html | Elasticsearch API documentation} */ - async closeJob (this: That, params: T.MlCloseJobRequest | TB.MlCloseJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async closeJob (this: That, params: T.MlCloseJobRequest | TB.MlCloseJobRequest, options?: TransportRequestOptionsWithMeta): Promise> - async closeJob (this: That, params: T.MlCloseJobRequest | TB.MlCloseJobRequest, options?: TransportRequestOptions): Promise - async closeJob (this: That, params: T.MlCloseJobRequest | TB.MlCloseJobRequest, options?: TransportRequestOptions): Promise { + async closeJob (this: That, params: T.MlCloseJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async closeJob (this: That, params: T.MlCloseJobRequest, options?: TransportRequestOptionsWithMeta): Promise> + async closeJob (this: That, params: T.MlCloseJobRequest, options?: TransportRequestOptions): Promise + async closeJob (this: That, params: T.MlCloseJobRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id'] const acceptedBody: string[] = ['allow_no_match', 'force', 'timeout'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -124,10 +115,10 @@ export default class Ml { * Delete a calendar. Removes all scheduled events from a calendar, then deletes it. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-delete-calendar.html | Elasticsearch API documentation} */ - async deleteCalendar (this: That, params: T.MlDeleteCalendarRequest | TB.MlDeleteCalendarRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteCalendar (this: That, params: T.MlDeleteCalendarRequest | TB.MlDeleteCalendarRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteCalendar (this: That, params: T.MlDeleteCalendarRequest | TB.MlDeleteCalendarRequest, options?: TransportRequestOptions): Promise - async deleteCalendar (this: That, params: T.MlDeleteCalendarRequest | TB.MlDeleteCalendarRequest, options?: TransportRequestOptions): Promise { + async deleteCalendar (this: That, params: T.MlDeleteCalendarRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteCalendar (this: That, params: T.MlDeleteCalendarRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteCalendar (this: That, params: T.MlDeleteCalendarRequest, options?: TransportRequestOptions): Promise + async deleteCalendar (this: That, params: T.MlDeleteCalendarRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['calendar_id'] const querystring: Record = {} const body = undefined @@ -135,7 +126,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -156,10 +147,10 @@ export default class Ml { * Delete events from a calendar. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-delete-calendar-event.html | Elasticsearch API documentation} */ - async deleteCalendarEvent (this: That, params: T.MlDeleteCalendarEventRequest | TB.MlDeleteCalendarEventRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteCalendarEvent (this: That, params: T.MlDeleteCalendarEventRequest | TB.MlDeleteCalendarEventRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteCalendarEvent (this: That, params: T.MlDeleteCalendarEventRequest | TB.MlDeleteCalendarEventRequest, options?: TransportRequestOptions): Promise - async deleteCalendarEvent (this: That, params: T.MlDeleteCalendarEventRequest | TB.MlDeleteCalendarEventRequest, options?: TransportRequestOptions): Promise { + async deleteCalendarEvent (this: That, params: T.MlDeleteCalendarEventRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteCalendarEvent (this: That, params: T.MlDeleteCalendarEventRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteCalendarEvent (this: That, params: T.MlDeleteCalendarEventRequest, options?: TransportRequestOptions): Promise + async deleteCalendarEvent (this: That, params: T.MlDeleteCalendarEventRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['calendar_id', 'event_id'] const querystring: Record = {} const body = undefined @@ -167,7 +158,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -189,10 +180,10 @@ export default class Ml { * Delete anomaly jobs from a calendar. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-delete-calendar-job.html | Elasticsearch API documentation} */ - async deleteCalendarJob (this: That, params: T.MlDeleteCalendarJobRequest | TB.MlDeleteCalendarJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteCalendarJob (this: That, params: T.MlDeleteCalendarJobRequest | TB.MlDeleteCalendarJobRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteCalendarJob (this: That, params: T.MlDeleteCalendarJobRequest | TB.MlDeleteCalendarJobRequest, options?: TransportRequestOptions): Promise - async deleteCalendarJob (this: That, params: T.MlDeleteCalendarJobRequest | TB.MlDeleteCalendarJobRequest, options?: TransportRequestOptions): Promise { + async deleteCalendarJob (this: That, params: T.MlDeleteCalendarJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteCalendarJob (this: That, params: T.MlDeleteCalendarJobRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteCalendarJob (this: That, params: T.MlDeleteCalendarJobRequest, options?: TransportRequestOptions): Promise + async deleteCalendarJob (this: That, params: T.MlDeleteCalendarJobRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['calendar_id', 'job_id'] const querystring: Record = {} const body = undefined @@ -200,7 +191,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -222,10 +213,10 @@ export default class Ml { * Delete a data frame analytics job. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-dfanalytics.html | Elasticsearch API documentation} */ - async deleteDataFrameAnalytics (this: That, params: T.MlDeleteDataFrameAnalyticsRequest | TB.MlDeleteDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteDataFrameAnalytics (this: That, params: T.MlDeleteDataFrameAnalyticsRequest | TB.MlDeleteDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteDataFrameAnalytics (this: That, params: T.MlDeleteDataFrameAnalyticsRequest | TB.MlDeleteDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise - async deleteDataFrameAnalytics (this: That, params: T.MlDeleteDataFrameAnalyticsRequest | TB.MlDeleteDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { + async deleteDataFrameAnalytics (this: That, params: T.MlDeleteDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteDataFrameAnalytics (this: That, params: T.MlDeleteDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteDataFrameAnalytics (this: That, params: T.MlDeleteDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise + async deleteDataFrameAnalytics (this: That, params: T.MlDeleteDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -233,7 +224,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -254,10 +245,10 @@ export default class Ml { * Delete a datafeed. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-delete-datafeed.html | Elasticsearch API documentation} */ - async deleteDatafeed (this: That, params: T.MlDeleteDatafeedRequest | TB.MlDeleteDatafeedRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteDatafeed (this: That, params: T.MlDeleteDatafeedRequest | TB.MlDeleteDatafeedRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteDatafeed (this: That, params: T.MlDeleteDatafeedRequest | TB.MlDeleteDatafeedRequest, options?: TransportRequestOptions): Promise - async deleteDatafeed (this: That, params: T.MlDeleteDatafeedRequest | TB.MlDeleteDatafeedRequest, options?: TransportRequestOptions): Promise { + async deleteDatafeed (this: That, params: T.MlDeleteDatafeedRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteDatafeed (this: That, params: T.MlDeleteDatafeedRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteDatafeed (this: That, params: T.MlDeleteDatafeedRequest, options?: TransportRequestOptions): Promise + async deleteDatafeed (this: That, params: T.MlDeleteDatafeedRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['datafeed_id'] const querystring: Record = {} const body = undefined @@ -265,7 +256,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -286,31 +277,23 @@ export default class Ml { * Delete expired ML data. Deletes all job results, model snapshots and forecast data that have exceeded their retention days period. Machine learning state documents that are not associated with any job are also deleted. You can limit the request to a single or set of anomaly detection jobs by using a job identifier, a group name, a comma-separated list of jobs, or a wildcard expression. You can delete expired data for all anomaly detection jobs by using _all, by specifying * as the , or by omitting the . * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-delete-expired-data.html | Elasticsearch API documentation} */ - async deleteExpiredData (this: That, params?: T.MlDeleteExpiredDataRequest | TB.MlDeleteExpiredDataRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteExpiredData (this: That, params?: T.MlDeleteExpiredDataRequest | TB.MlDeleteExpiredDataRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteExpiredData (this: That, params?: T.MlDeleteExpiredDataRequest | TB.MlDeleteExpiredDataRequest, options?: TransportRequestOptions): Promise - async deleteExpiredData (this: That, params?: T.MlDeleteExpiredDataRequest | TB.MlDeleteExpiredDataRequest, options?: TransportRequestOptions): Promise { + async deleteExpiredData (this: That, params?: T.MlDeleteExpiredDataRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteExpiredData (this: That, params?: T.MlDeleteExpiredDataRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteExpiredData (this: That, params?: T.MlDeleteExpiredDataRequest, options?: TransportRequestOptions): Promise + async deleteExpiredData (this: That, params?: T.MlDeleteExpiredDataRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id'] const acceptedBody: string[] = ['requests_per_second', 'timeout'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -338,10 +321,10 @@ export default class Ml { * Delete a filter. If an anomaly detection job references the filter, you cannot delete the filter. You must update or delete the job before you can delete the filter. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-delete-filter.html | Elasticsearch API documentation} */ - async deleteFilter (this: That, params: T.MlDeleteFilterRequest | TB.MlDeleteFilterRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteFilter (this: That, params: T.MlDeleteFilterRequest | TB.MlDeleteFilterRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteFilter (this: That, params: T.MlDeleteFilterRequest | TB.MlDeleteFilterRequest, options?: TransportRequestOptions): Promise - async deleteFilter (this: That, params: T.MlDeleteFilterRequest | TB.MlDeleteFilterRequest, options?: TransportRequestOptions): Promise { + async deleteFilter (this: That, params: T.MlDeleteFilterRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteFilter (this: That, params: T.MlDeleteFilterRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteFilter (this: That, params: T.MlDeleteFilterRequest, options?: TransportRequestOptions): Promise + async deleteFilter (this: That, params: T.MlDeleteFilterRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['filter_id'] const querystring: Record = {} const body = undefined @@ -349,7 +332,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -370,10 +353,10 @@ export default class Ml { * Delete forecasts from a job. By default, forecasts are retained for 14 days. You can specify a different retention period with the `expires_in` parameter in the forecast jobs API. The delete forecast API enables you to delete one or more forecasts before they expire. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-delete-forecast.html | Elasticsearch API documentation} */ - async deleteForecast (this: That, params: T.MlDeleteForecastRequest | TB.MlDeleteForecastRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteForecast (this: That, params: T.MlDeleteForecastRequest | TB.MlDeleteForecastRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteForecast (this: That, params: T.MlDeleteForecastRequest | TB.MlDeleteForecastRequest, options?: TransportRequestOptions): Promise - async deleteForecast (this: That, params: T.MlDeleteForecastRequest | TB.MlDeleteForecastRequest, options?: TransportRequestOptions): Promise { + async deleteForecast (this: That, params: T.MlDeleteForecastRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteForecast (this: That, params: T.MlDeleteForecastRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteForecast (this: That, params: T.MlDeleteForecastRequest, options?: TransportRequestOptions): Promise + async deleteForecast (this: That, params: T.MlDeleteForecastRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id', 'forecast_id'] const querystring: Record = {} const body = undefined @@ -381,7 +364,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -410,10 +393,10 @@ export default class Ml { * Delete an anomaly detection job. All job configuration, model state and results are deleted. It is not currently possible to delete multiple jobs using wildcards or a comma separated list. If you delete a job that has a datafeed, the request first tries to delete the datafeed. This behavior is equivalent to calling the delete datafeed API with the same timeout and force parameters as the delete job request. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-delete-job.html | Elasticsearch API documentation} */ - async deleteJob (this: That, params: T.MlDeleteJobRequest | TB.MlDeleteJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteJob (this: That, params: T.MlDeleteJobRequest | TB.MlDeleteJobRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteJob (this: That, params: T.MlDeleteJobRequest | TB.MlDeleteJobRequest, options?: TransportRequestOptions): Promise - async deleteJob (this: That, params: T.MlDeleteJobRequest | TB.MlDeleteJobRequest, options?: TransportRequestOptions): Promise { + async deleteJob (this: That, params: T.MlDeleteJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteJob (this: That, params: T.MlDeleteJobRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteJob (this: That, params: T.MlDeleteJobRequest, options?: TransportRequestOptions): Promise + async deleteJob (this: That, params: T.MlDeleteJobRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id'] const querystring: Record = {} const body = undefined @@ -421,7 +404,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -442,10 +425,10 @@ export default class Ml { * Delete a model snapshot. You cannot delete the active model snapshot. To delete that snapshot, first revert to a different one. To identify the active model snapshot, refer to the `model_snapshot_id` in the results from the get jobs API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-delete-snapshot.html | Elasticsearch API documentation} */ - async deleteModelSnapshot (this: That, params: T.MlDeleteModelSnapshotRequest | TB.MlDeleteModelSnapshotRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteModelSnapshot (this: That, params: T.MlDeleteModelSnapshotRequest | TB.MlDeleteModelSnapshotRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteModelSnapshot (this: That, params: T.MlDeleteModelSnapshotRequest | TB.MlDeleteModelSnapshotRequest, options?: TransportRequestOptions): Promise - async deleteModelSnapshot (this: That, params: T.MlDeleteModelSnapshotRequest | TB.MlDeleteModelSnapshotRequest, options?: TransportRequestOptions): Promise { + async deleteModelSnapshot (this: That, params: T.MlDeleteModelSnapshotRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteModelSnapshot (this: That, params: T.MlDeleteModelSnapshotRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteModelSnapshot (this: That, params: T.MlDeleteModelSnapshotRequest, options?: TransportRequestOptions): Promise + async deleteModelSnapshot (this: That, params: T.MlDeleteModelSnapshotRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id', 'snapshot_id'] const querystring: Record = {} const body = undefined @@ -453,7 +436,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -475,10 +458,10 @@ export default class Ml { * Delete an unreferenced trained model. The request deletes a trained inference model that is not referenced by an ingest pipeline. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-trained-models.html | Elasticsearch API documentation} */ - async deleteTrainedModel (this: That, params: T.MlDeleteTrainedModelRequest | TB.MlDeleteTrainedModelRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteTrainedModel (this: That, params: T.MlDeleteTrainedModelRequest | TB.MlDeleteTrainedModelRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteTrainedModel (this: That, params: T.MlDeleteTrainedModelRequest | TB.MlDeleteTrainedModelRequest, options?: TransportRequestOptions): Promise - async deleteTrainedModel (this: That, params: T.MlDeleteTrainedModelRequest | TB.MlDeleteTrainedModelRequest, options?: TransportRequestOptions): Promise { + async deleteTrainedModel (this: That, params: T.MlDeleteTrainedModelRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteTrainedModel (this: That, params: T.MlDeleteTrainedModelRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteTrainedModel (this: That, params: T.MlDeleteTrainedModelRequest, options?: TransportRequestOptions): Promise + async deleteTrainedModel (this: That, params: T.MlDeleteTrainedModelRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_id'] const querystring: Record = {} const body = undefined @@ -486,7 +469,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -507,10 +490,10 @@ export default class Ml { * Delete a trained model alias. This API deletes an existing model alias that refers to a trained model. If the model alias is missing or refers to a model other than the one identified by the `model_id`, this API returns an error. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-trained-models-aliases.html | Elasticsearch API documentation} */ - async deleteTrainedModelAlias (this: That, params: T.MlDeleteTrainedModelAliasRequest | TB.MlDeleteTrainedModelAliasRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteTrainedModelAlias (this: That, params: T.MlDeleteTrainedModelAliasRequest | TB.MlDeleteTrainedModelAliasRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteTrainedModelAlias (this: That, params: T.MlDeleteTrainedModelAliasRequest | TB.MlDeleteTrainedModelAliasRequest, options?: TransportRequestOptions): Promise - async deleteTrainedModelAlias (this: That, params: T.MlDeleteTrainedModelAliasRequest | TB.MlDeleteTrainedModelAliasRequest, options?: TransportRequestOptions): Promise { + async deleteTrainedModelAlias (this: That, params: T.MlDeleteTrainedModelAliasRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteTrainedModelAlias (this: That, params: T.MlDeleteTrainedModelAliasRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteTrainedModelAlias (this: That, params: T.MlDeleteTrainedModelAliasRequest, options?: TransportRequestOptions): Promise + async deleteTrainedModelAlias (this: That, params: T.MlDeleteTrainedModelAliasRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_alias', 'model_id'] const querystring: Record = {} const body = undefined @@ -518,7 +501,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -540,31 +523,23 @@ export default class Ml { * Estimate job model memory usage. Makes an estimation of the memory usage for an anomaly detection job model. It is based on analysis configuration details for the job and cardinality estimates for the fields it references. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-apis.html | Elasticsearch API documentation} */ - async estimateModelMemory (this: That, params?: T.MlEstimateModelMemoryRequest | TB.MlEstimateModelMemoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async estimateModelMemory (this: That, params?: T.MlEstimateModelMemoryRequest | TB.MlEstimateModelMemoryRequest, options?: TransportRequestOptionsWithMeta): Promise> - async estimateModelMemory (this: That, params?: T.MlEstimateModelMemoryRequest | TB.MlEstimateModelMemoryRequest, options?: TransportRequestOptions): Promise - async estimateModelMemory (this: That, params?: T.MlEstimateModelMemoryRequest | TB.MlEstimateModelMemoryRequest, options?: TransportRequestOptions): Promise { + async estimateModelMemory (this: That, params?: T.MlEstimateModelMemoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async estimateModelMemory (this: That, params?: T.MlEstimateModelMemoryRequest, options?: TransportRequestOptionsWithMeta): Promise> + async estimateModelMemory (this: That, params?: T.MlEstimateModelMemoryRequest, options?: TransportRequestOptions): Promise + async estimateModelMemory (this: That, params?: T.MlEstimateModelMemoryRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['analysis_config', 'max_bucket_cardinality', 'overall_cardinality'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -582,30 +557,22 @@ export default class Ml { * Evaluate data frame analytics. The API packages together commonly used evaluation metrics for various types of machine learning features. This has been designed for use on indexes created by data frame analytics. Evaluation requires both a ground truth field and an analytics result field to be present. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/evaluate-dfanalytics.html | Elasticsearch API documentation} */ - async evaluateDataFrame (this: That, params: T.MlEvaluateDataFrameRequest | TB.MlEvaluateDataFrameRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async evaluateDataFrame (this: That, params: T.MlEvaluateDataFrameRequest | TB.MlEvaluateDataFrameRequest, options?: TransportRequestOptionsWithMeta): Promise> - async evaluateDataFrame (this: That, params: T.MlEvaluateDataFrameRequest | TB.MlEvaluateDataFrameRequest, options?: TransportRequestOptions): Promise - async evaluateDataFrame (this: That, params: T.MlEvaluateDataFrameRequest | TB.MlEvaluateDataFrameRequest, options?: TransportRequestOptions): Promise { + async evaluateDataFrame (this: That, params: T.MlEvaluateDataFrameRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async evaluateDataFrame (this: That, params: T.MlEvaluateDataFrameRequest, options?: TransportRequestOptionsWithMeta): Promise> + async evaluateDataFrame (this: That, params: T.MlEvaluateDataFrameRequest, options?: TransportRequestOptions): Promise + async evaluateDataFrame (this: That, params: T.MlEvaluateDataFrameRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['evaluation', 'index', 'query'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -623,31 +590,23 @@ export default class Ml { * Explain data frame analytics config. This API provides explanations for a data frame analytics config that either exists already or one that has not been created yet. The following explanations are provided: * which fields are included or not in the analysis and why, * how much memory is estimated to be required. The estimate can be used when deciding the appropriate value for model_memory_limit setting later on. If you have object fields or fields that are excluded via source filtering, they are not included in the explanation. * @see {@link http://www.elastic.co/guide/en/elasticsearch/reference/8.17/explain-dfanalytics.html | Elasticsearch API documentation} */ - async explainDataFrameAnalytics (this: That, params?: T.MlExplainDataFrameAnalyticsRequest | TB.MlExplainDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async explainDataFrameAnalytics (this: That, params?: T.MlExplainDataFrameAnalyticsRequest | TB.MlExplainDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async explainDataFrameAnalytics (this: That, params?: T.MlExplainDataFrameAnalyticsRequest | TB.MlExplainDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise - async explainDataFrameAnalytics (this: That, params?: T.MlExplainDataFrameAnalyticsRequest | TB.MlExplainDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { + async explainDataFrameAnalytics (this: That, params?: T.MlExplainDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async explainDataFrameAnalytics (this: That, params?: T.MlExplainDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async explainDataFrameAnalytics (this: That, params?: T.MlExplainDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise + async explainDataFrameAnalytics (this: That, params?: T.MlExplainDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const acceptedBody: string[] = ['source', 'dest', 'analysis', 'description', 'model_memory_limit', 'max_num_threads', 'analyzed_fields', 'allow_lazy_start'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -675,30 +634,22 @@ export default class Ml { * Force buffered data to be processed. The flush jobs API is only applicable when sending data for analysis using the post data API. Depending on the content of the buffer, then it might additionally calculate new results. Both flush and close operations are similar, however the flush is more efficient if you are expecting to send more data for analysis. When flushing, the job remains open and is available to continue analyzing data. A close operation additionally prunes and persists the model state to disk and the job must be opened again before analyzing further data. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-flush-job.html | Elasticsearch API documentation} */ - async flushJob (this: That, params: T.MlFlushJobRequest | TB.MlFlushJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async flushJob (this: That, params: T.MlFlushJobRequest | TB.MlFlushJobRequest, options?: TransportRequestOptionsWithMeta): Promise> - async flushJob (this: That, params: T.MlFlushJobRequest | TB.MlFlushJobRequest, options?: TransportRequestOptions): Promise - async flushJob (this: That, params: T.MlFlushJobRequest | TB.MlFlushJobRequest, options?: TransportRequestOptions): Promise { + async flushJob (this: That, params: T.MlFlushJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async flushJob (this: That, params: T.MlFlushJobRequest, options?: TransportRequestOptionsWithMeta): Promise> + async flushJob (this: That, params: T.MlFlushJobRequest, options?: TransportRequestOptions): Promise + async flushJob (this: That, params: T.MlFlushJobRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id'] const acceptedBody: string[] = ['advance_time', 'calc_interim', 'end', 'skip_time', 'start'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -719,30 +670,22 @@ export default class Ml { * Predict future behavior of a time series. Forecasts are not supported for jobs that perform population analysis; an error occurs if you try to create a forecast for a job that has an `over_field_name` in its configuration. Forcasts predict future behavior based on historical data. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-forecast.html | Elasticsearch API documentation} */ - async forecast (this: That, params: T.MlForecastRequest | TB.MlForecastRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async forecast (this: That, params: T.MlForecastRequest | TB.MlForecastRequest, options?: TransportRequestOptionsWithMeta): Promise> - async forecast (this: That, params: T.MlForecastRequest | TB.MlForecastRequest, options?: TransportRequestOptions): Promise - async forecast (this: That, params: T.MlForecastRequest | TB.MlForecastRequest, options?: TransportRequestOptions): Promise { + async forecast (this: That, params: T.MlForecastRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async forecast (this: That, params: T.MlForecastRequest, options?: TransportRequestOptionsWithMeta): Promise> + async forecast (this: That, params: T.MlForecastRequest, options?: TransportRequestOptions): Promise + async forecast (this: That, params: T.MlForecastRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id'] const acceptedBody: string[] = ['duration', 'expires_in', 'max_model_memory'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -763,30 +706,22 @@ export default class Ml { * Get anomaly detection job results for buckets. The API presents a chronological view of the records, grouped by bucket. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-get-bucket.html | Elasticsearch API documentation} */ - async getBuckets (this: That, params: T.MlGetBucketsRequest | TB.MlGetBucketsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getBuckets (this: That, params: T.MlGetBucketsRequest | TB.MlGetBucketsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getBuckets (this: That, params: T.MlGetBucketsRequest | TB.MlGetBucketsRequest, options?: TransportRequestOptions): Promise - async getBuckets (this: That, params: T.MlGetBucketsRequest | TB.MlGetBucketsRequest, options?: TransportRequestOptions): Promise { + async getBuckets (this: That, params: T.MlGetBucketsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getBuckets (this: That, params: T.MlGetBucketsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getBuckets (this: That, params: T.MlGetBucketsRequest, options?: TransportRequestOptions): Promise + async getBuckets (this: That, params: T.MlGetBucketsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id', 'timestamp'] const acceptedBody: string[] = ['anomaly_score', 'desc', 'end', 'exclude_interim', 'expand', 'page', 'sort', 'start'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -815,10 +750,10 @@ export default class Ml { * Get info about events in calendars. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-get-calendar-event.html | Elasticsearch API documentation} */ - async getCalendarEvents (this: That, params: T.MlGetCalendarEventsRequest | TB.MlGetCalendarEventsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getCalendarEvents (this: That, params: T.MlGetCalendarEventsRequest | TB.MlGetCalendarEventsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getCalendarEvents (this: That, params: T.MlGetCalendarEventsRequest | TB.MlGetCalendarEventsRequest, options?: TransportRequestOptions): Promise - async getCalendarEvents (this: That, params: T.MlGetCalendarEventsRequest | TB.MlGetCalendarEventsRequest, options?: TransportRequestOptions): Promise { + async getCalendarEvents (this: That, params: T.MlGetCalendarEventsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getCalendarEvents (this: That, params: T.MlGetCalendarEventsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getCalendarEvents (this: That, params: T.MlGetCalendarEventsRequest, options?: TransportRequestOptions): Promise + async getCalendarEvents (this: That, params: T.MlGetCalendarEventsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['calendar_id'] const querystring: Record = {} const body = undefined @@ -826,7 +761,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -847,31 +782,23 @@ export default class Ml { * Get calendar configuration info. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-get-calendar.html | Elasticsearch API documentation} */ - async getCalendars (this: That, params?: T.MlGetCalendarsRequest | TB.MlGetCalendarsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getCalendars (this: That, params?: T.MlGetCalendarsRequest | TB.MlGetCalendarsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getCalendars (this: That, params?: T.MlGetCalendarsRequest | TB.MlGetCalendarsRequest, options?: TransportRequestOptions): Promise - async getCalendars (this: That, params?: T.MlGetCalendarsRequest | TB.MlGetCalendarsRequest, options?: TransportRequestOptions): Promise { + async getCalendars (this: That, params?: T.MlGetCalendarsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getCalendars (this: That, params?: T.MlGetCalendarsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getCalendars (this: That, params?: T.MlGetCalendarsRequest, options?: TransportRequestOptions): Promise + async getCalendars (this: That, params?: T.MlGetCalendarsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['calendar_id'] const acceptedBody: string[] = ['page'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -899,30 +826,22 @@ export default class Ml { * Get anomaly detection job results for categories. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-get-category.html | Elasticsearch API documentation} */ - async getCategories (this: That, params: T.MlGetCategoriesRequest | TB.MlGetCategoriesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getCategories (this: That, params: T.MlGetCategoriesRequest | TB.MlGetCategoriesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getCategories (this: That, params: T.MlGetCategoriesRequest | TB.MlGetCategoriesRequest, options?: TransportRequestOptions): Promise - async getCategories (this: That, params: T.MlGetCategoriesRequest | TB.MlGetCategoriesRequest, options?: TransportRequestOptions): Promise { + async getCategories (this: That, params: T.MlGetCategoriesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getCategories (this: That, params: T.MlGetCategoriesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getCategories (this: That, params: T.MlGetCategoriesRequest, options?: TransportRequestOptions): Promise + async getCategories (this: That, params: T.MlGetCategoriesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id', 'category_id'] const acceptedBody: string[] = ['page'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -951,10 +870,10 @@ export default class Ml { * Get data frame analytics job configuration info. You can get information for multiple data frame analytics jobs in a single API request by using a comma-separated list of data frame analytics jobs or a wildcard expression. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-dfanalytics.html | Elasticsearch API documentation} */ - async getDataFrameAnalytics (this: That, params?: T.MlGetDataFrameAnalyticsRequest | TB.MlGetDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getDataFrameAnalytics (this: That, params?: T.MlGetDataFrameAnalyticsRequest | TB.MlGetDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getDataFrameAnalytics (this: That, params?: T.MlGetDataFrameAnalyticsRequest | TB.MlGetDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise - async getDataFrameAnalytics (this: That, params?: T.MlGetDataFrameAnalyticsRequest | TB.MlGetDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { + async getDataFrameAnalytics (this: That, params?: T.MlGetDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getDataFrameAnalytics (this: That, params?: T.MlGetDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getDataFrameAnalytics (this: That, params?: T.MlGetDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise + async getDataFrameAnalytics (this: That, params?: T.MlGetDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -963,7 +882,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -991,10 +910,10 @@ export default class Ml { * Get data frame analytics jobs usage info. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-dfanalytics-stats.html | Elasticsearch API documentation} */ - async getDataFrameAnalyticsStats (this: That, params?: T.MlGetDataFrameAnalyticsStatsRequest | TB.MlGetDataFrameAnalyticsStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getDataFrameAnalyticsStats (this: That, params?: T.MlGetDataFrameAnalyticsStatsRequest | TB.MlGetDataFrameAnalyticsStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getDataFrameAnalyticsStats (this: That, params?: T.MlGetDataFrameAnalyticsStatsRequest | TB.MlGetDataFrameAnalyticsStatsRequest, options?: TransportRequestOptions): Promise - async getDataFrameAnalyticsStats (this: That, params?: T.MlGetDataFrameAnalyticsStatsRequest | TB.MlGetDataFrameAnalyticsStatsRequest, options?: TransportRequestOptions): Promise { + async getDataFrameAnalyticsStats (this: That, params?: T.MlGetDataFrameAnalyticsStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getDataFrameAnalyticsStats (this: That, params?: T.MlGetDataFrameAnalyticsStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getDataFrameAnalyticsStats (this: That, params?: T.MlGetDataFrameAnalyticsStatsRequest, options?: TransportRequestOptions): Promise + async getDataFrameAnalyticsStats (this: That, params?: T.MlGetDataFrameAnalyticsStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -1003,7 +922,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1031,10 +950,10 @@ export default class Ml { * Get datafeeds usage info. You can get statistics for multiple datafeeds in a single API request by using a comma-separated list of datafeeds or a wildcard expression. You can get statistics for all datafeeds by using `_all`, by specifying `*` as the ``, or by omitting the ``. If the datafeed is stopped, the only information you receive is the `datafeed_id` and the `state`. This API returns a maximum of 10,000 datafeeds. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-get-datafeed-stats.html | Elasticsearch API documentation} */ - async getDatafeedStats (this: That, params?: T.MlGetDatafeedStatsRequest | TB.MlGetDatafeedStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getDatafeedStats (this: That, params?: T.MlGetDatafeedStatsRequest | TB.MlGetDatafeedStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getDatafeedStats (this: That, params?: T.MlGetDatafeedStatsRequest | TB.MlGetDatafeedStatsRequest, options?: TransportRequestOptions): Promise - async getDatafeedStats (this: That, params?: T.MlGetDatafeedStatsRequest | TB.MlGetDatafeedStatsRequest, options?: TransportRequestOptions): Promise { + async getDatafeedStats (this: That, params?: T.MlGetDatafeedStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getDatafeedStats (this: That, params?: T.MlGetDatafeedStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getDatafeedStats (this: That, params?: T.MlGetDatafeedStatsRequest, options?: TransportRequestOptions): Promise + async getDatafeedStats (this: That, params?: T.MlGetDatafeedStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['datafeed_id'] const querystring: Record = {} const body = undefined @@ -1043,7 +962,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1071,10 +990,10 @@ export default class Ml { * Get datafeeds configuration info. You can get information for multiple datafeeds in a single API request by using a comma-separated list of datafeeds or a wildcard expression. You can get information for all datafeeds by using `_all`, by specifying `*` as the ``, or by omitting the ``. This API returns a maximum of 10,000 datafeeds. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-get-datafeed.html | Elasticsearch API documentation} */ - async getDatafeeds (this: That, params?: T.MlGetDatafeedsRequest | TB.MlGetDatafeedsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getDatafeeds (this: That, params?: T.MlGetDatafeedsRequest | TB.MlGetDatafeedsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getDatafeeds (this: That, params?: T.MlGetDatafeedsRequest | TB.MlGetDatafeedsRequest, options?: TransportRequestOptions): Promise - async getDatafeeds (this: That, params?: T.MlGetDatafeedsRequest | TB.MlGetDatafeedsRequest, options?: TransportRequestOptions): Promise { + async getDatafeeds (this: That, params?: T.MlGetDatafeedsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getDatafeeds (this: That, params?: T.MlGetDatafeedsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getDatafeeds (this: That, params?: T.MlGetDatafeedsRequest, options?: TransportRequestOptions): Promise + async getDatafeeds (this: That, params?: T.MlGetDatafeedsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['datafeed_id'] const querystring: Record = {} const body = undefined @@ -1083,7 +1002,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1111,10 +1030,10 @@ export default class Ml { * Get filters. You can get a single filter or all filters. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-get-filter.html | Elasticsearch API documentation} */ - async getFilters (this: That, params?: T.MlGetFiltersRequest | TB.MlGetFiltersRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getFilters (this: That, params?: T.MlGetFiltersRequest | TB.MlGetFiltersRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getFilters (this: That, params?: T.MlGetFiltersRequest | TB.MlGetFiltersRequest, options?: TransportRequestOptions): Promise - async getFilters (this: That, params?: T.MlGetFiltersRequest | TB.MlGetFiltersRequest, options?: TransportRequestOptions): Promise { + async getFilters (this: That, params?: T.MlGetFiltersRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getFilters (this: That, params?: T.MlGetFiltersRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getFilters (this: That, params?: T.MlGetFiltersRequest, options?: TransportRequestOptions): Promise + async getFilters (this: That, params?: T.MlGetFiltersRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['filter_id'] const querystring: Record = {} const body = undefined @@ -1123,7 +1042,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1151,30 +1070,22 @@ export default class Ml { * Get anomaly detection job results for influencers. Influencers are the entities that have contributed to, or are to blame for, the anomalies. Influencer results are available only if an `influencer_field_name` is specified in the job configuration. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-get-influencer.html | Elasticsearch API documentation} */ - async getInfluencers (this: That, params: T.MlGetInfluencersRequest | TB.MlGetInfluencersRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getInfluencers (this: That, params: T.MlGetInfluencersRequest | TB.MlGetInfluencersRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getInfluencers (this: That, params: T.MlGetInfluencersRequest | TB.MlGetInfluencersRequest, options?: TransportRequestOptions): Promise - async getInfluencers (this: That, params: T.MlGetInfluencersRequest | TB.MlGetInfluencersRequest, options?: TransportRequestOptions): Promise { + async getInfluencers (this: That, params: T.MlGetInfluencersRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getInfluencers (this: That, params: T.MlGetInfluencersRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getInfluencers (this: That, params: T.MlGetInfluencersRequest, options?: TransportRequestOptions): Promise + async getInfluencers (this: That, params: T.MlGetInfluencersRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id'] const acceptedBody: string[] = ['page'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1195,10 +1106,10 @@ export default class Ml { * Get anomaly detection jobs usage info. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-get-job-stats.html | Elasticsearch API documentation} */ - async getJobStats (this: That, params?: T.MlGetJobStatsRequest | TB.MlGetJobStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getJobStats (this: That, params?: T.MlGetJobStatsRequest | TB.MlGetJobStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getJobStats (this: That, params?: T.MlGetJobStatsRequest | TB.MlGetJobStatsRequest, options?: TransportRequestOptions): Promise - async getJobStats (this: That, params?: T.MlGetJobStatsRequest | TB.MlGetJobStatsRequest, options?: TransportRequestOptions): Promise { + async getJobStats (this: That, params?: T.MlGetJobStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getJobStats (this: That, params?: T.MlGetJobStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getJobStats (this: That, params?: T.MlGetJobStatsRequest, options?: TransportRequestOptions): Promise + async getJobStats (this: That, params?: T.MlGetJobStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id'] const querystring: Record = {} const body = undefined @@ -1207,7 +1118,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1235,10 +1146,10 @@ export default class Ml { * Get anomaly detection jobs configuration info. You can get information for multiple anomaly detection jobs in a single API request by using a group name, a comma-separated list of jobs, or a wildcard expression. You can get information for all anomaly detection jobs by using `_all`, by specifying `*` as the ``, or by omitting the ``. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-get-job.html | Elasticsearch API documentation} */ - async getJobs (this: That, params?: T.MlGetJobsRequest | TB.MlGetJobsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getJobs (this: That, params?: T.MlGetJobsRequest | TB.MlGetJobsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getJobs (this: That, params?: T.MlGetJobsRequest | TB.MlGetJobsRequest, options?: TransportRequestOptions): Promise - async getJobs (this: That, params?: T.MlGetJobsRequest | TB.MlGetJobsRequest, options?: TransportRequestOptions): Promise { + async getJobs (this: That, params?: T.MlGetJobsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getJobs (this: That, params?: T.MlGetJobsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getJobs (this: That, params?: T.MlGetJobsRequest, options?: TransportRequestOptions): Promise + async getJobs (this: That, params?: T.MlGetJobsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id'] const querystring: Record = {} const body = undefined @@ -1247,7 +1158,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1275,10 +1186,10 @@ export default class Ml { * Get machine learning memory usage info. Get information about how machine learning jobs and trained models are using memory, on each node, both within the JVM heap, and natively, outside of the JVM. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-ml-memory.html | Elasticsearch API documentation} */ - async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest | TB.MlGetMemoryStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest | TB.MlGetMemoryStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest | TB.MlGetMemoryStatsRequest, options?: TransportRequestOptions): Promise - async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest | TB.MlGetMemoryStatsRequest, options?: TransportRequestOptions): Promise { + async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest, options?: TransportRequestOptions): Promise + async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['node_id'] const querystring: Record = {} const body = undefined @@ -1287,7 +1198,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1315,10 +1226,10 @@ export default class Ml { * Get anomaly detection job model snapshot upgrade usage info. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-get-job-model-snapshot-upgrade-stats.html | Elasticsearch API documentation} */ - async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest | TB.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest | TB.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest | TB.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptions): Promise - async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest | TB.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptions): Promise { + async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptions): Promise + async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id', 'snapshot_id'] const querystring: Record = {} const body = undefined @@ -1326,7 +1237,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1348,30 +1259,22 @@ export default class Ml { * Get model snapshots info. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-get-snapshot.html | Elasticsearch API documentation} */ - async getModelSnapshots (this: That, params: T.MlGetModelSnapshotsRequest | TB.MlGetModelSnapshotsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getModelSnapshots (this: That, params: T.MlGetModelSnapshotsRequest | TB.MlGetModelSnapshotsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getModelSnapshots (this: That, params: T.MlGetModelSnapshotsRequest | TB.MlGetModelSnapshotsRequest, options?: TransportRequestOptions): Promise - async getModelSnapshots (this: That, params: T.MlGetModelSnapshotsRequest | TB.MlGetModelSnapshotsRequest, options?: TransportRequestOptions): Promise { + async getModelSnapshots (this: That, params: T.MlGetModelSnapshotsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getModelSnapshots (this: That, params: T.MlGetModelSnapshotsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getModelSnapshots (this: That, params: T.MlGetModelSnapshotsRequest, options?: TransportRequestOptions): Promise + async getModelSnapshots (this: That, params: T.MlGetModelSnapshotsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id', 'snapshot_id'] const acceptedBody: string[] = ['desc', 'end', 'page', 'sort', 'start'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1400,30 +1303,22 @@ export default class Ml { * Get overall bucket results. Retrievs overall bucket results that summarize the bucket results of multiple anomaly detection jobs. The `overall_score` is calculated by combining the scores of all the buckets within the overall bucket span. First, the maximum `anomaly_score` per anomaly detection job in the overall bucket is calculated. Then the `top_n` of those scores are averaged to result in the `overall_score`. This means that you can fine-tune the `overall_score` so that it is more or less sensitive to the number of jobs that detect an anomaly at the same time. For example, if you set `top_n` to `1`, the `overall_score` is the maximum bucket score in the overall bucket. Alternatively, if you set `top_n` to the number of jobs, the `overall_score` is high only when all jobs detect anomalies in that overall bucket. If you set the `bucket_span` parameter (to a value greater than its default), the `overall_score` is the maximum `overall_score` of the overall buckets that have a span equal to the jobs' largest bucket span. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-get-overall-buckets.html | Elasticsearch API documentation} */ - async getOverallBuckets (this: That, params: T.MlGetOverallBucketsRequest | TB.MlGetOverallBucketsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getOverallBuckets (this: That, params: T.MlGetOverallBucketsRequest | TB.MlGetOverallBucketsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getOverallBuckets (this: That, params: T.MlGetOverallBucketsRequest | TB.MlGetOverallBucketsRequest, options?: TransportRequestOptions): Promise - async getOverallBuckets (this: That, params: T.MlGetOverallBucketsRequest | TB.MlGetOverallBucketsRequest, options?: TransportRequestOptions): Promise { + async getOverallBuckets (this: That, params: T.MlGetOverallBucketsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getOverallBuckets (this: That, params: T.MlGetOverallBucketsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getOverallBuckets (this: That, params: T.MlGetOverallBucketsRequest, options?: TransportRequestOptions): Promise + async getOverallBuckets (this: That, params: T.MlGetOverallBucketsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id'] const acceptedBody: string[] = ['allow_no_match', 'bucket_span', 'end', 'exclude_interim', 'overall_score', 'start', 'top_n'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1444,30 +1339,22 @@ export default class Ml { * Get anomaly records for an anomaly detection job. Records contain the detailed analytical results. They describe the anomalous activity that has been identified in the input data based on the detector configuration. There can be many anomaly records depending on the characteristics and size of the input data. In practice, there are often too many to be able to manually process them. The machine learning features therefore perform a sophisticated aggregation of the anomaly records into buckets. The number of record results depends on the number of anomalies found in each bucket, which relates to the number of time series being modeled and the number of detectors. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-get-record.html | Elasticsearch API documentation} */ - async getRecords (this: That, params: T.MlGetRecordsRequest | TB.MlGetRecordsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getRecords (this: That, params: T.MlGetRecordsRequest | TB.MlGetRecordsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getRecords (this: That, params: T.MlGetRecordsRequest | TB.MlGetRecordsRequest, options?: TransportRequestOptions): Promise - async getRecords (this: That, params: T.MlGetRecordsRequest | TB.MlGetRecordsRequest, options?: TransportRequestOptions): Promise { + async getRecords (this: That, params: T.MlGetRecordsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getRecords (this: That, params: T.MlGetRecordsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getRecords (this: That, params: T.MlGetRecordsRequest, options?: TransportRequestOptions): Promise + async getRecords (this: That, params: T.MlGetRecordsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id'] const acceptedBody: string[] = ['desc', 'end', 'exclude_interim', 'page', 'record_score', 'sort', 'start'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1488,10 +1375,10 @@ export default class Ml { * Get trained model configuration info. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-trained-models.html | Elasticsearch API documentation} */ - async getTrainedModels (this: That, params?: T.MlGetTrainedModelsRequest | TB.MlGetTrainedModelsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getTrainedModels (this: That, params?: T.MlGetTrainedModelsRequest | TB.MlGetTrainedModelsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getTrainedModels (this: That, params?: T.MlGetTrainedModelsRequest | TB.MlGetTrainedModelsRequest, options?: TransportRequestOptions): Promise - async getTrainedModels (this: That, params?: T.MlGetTrainedModelsRequest | TB.MlGetTrainedModelsRequest, options?: TransportRequestOptions): Promise { + async getTrainedModels (this: That, params?: T.MlGetTrainedModelsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getTrainedModels (this: That, params?: T.MlGetTrainedModelsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getTrainedModels (this: That, params?: T.MlGetTrainedModelsRequest, options?: TransportRequestOptions): Promise + async getTrainedModels (this: That, params?: T.MlGetTrainedModelsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_id'] const querystring: Record = {} const body = undefined @@ -1500,7 +1387,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1528,10 +1415,10 @@ export default class Ml { * Get trained models usage info. You can get usage information for multiple trained models in a single API request by using a comma-separated list of model IDs or a wildcard expression. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-trained-models-stats.html | Elasticsearch API documentation} */ - async getTrainedModelsStats (this: That, params?: T.MlGetTrainedModelsStatsRequest | TB.MlGetTrainedModelsStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getTrainedModelsStats (this: That, params?: T.MlGetTrainedModelsStatsRequest | TB.MlGetTrainedModelsStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getTrainedModelsStats (this: That, params?: T.MlGetTrainedModelsStatsRequest | TB.MlGetTrainedModelsStatsRequest, options?: TransportRequestOptions): Promise - async getTrainedModelsStats (this: That, params?: T.MlGetTrainedModelsStatsRequest | TB.MlGetTrainedModelsStatsRequest, options?: TransportRequestOptions): Promise { + async getTrainedModelsStats (this: That, params?: T.MlGetTrainedModelsStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getTrainedModelsStats (this: That, params?: T.MlGetTrainedModelsStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getTrainedModelsStats (this: That, params?: T.MlGetTrainedModelsStatsRequest, options?: TransportRequestOptions): Promise + async getTrainedModelsStats (this: That, params?: T.MlGetTrainedModelsStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_id'] const querystring: Record = {} const body = undefined @@ -1540,7 +1427,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1568,30 +1455,22 @@ export default class Ml { * Evaluate a trained model. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/infer-trained-model.html | Elasticsearch API documentation} */ - async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest | TB.MlInferTrainedModelRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest | TB.MlInferTrainedModelRequest, options?: TransportRequestOptionsWithMeta): Promise> - async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest | TB.MlInferTrainedModelRequest, options?: TransportRequestOptions): Promise - async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest | TB.MlInferTrainedModelRequest, options?: TransportRequestOptions): Promise { + async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest, options?: TransportRequestOptionsWithMeta): Promise> + async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest, options?: TransportRequestOptions): Promise + async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_id'] const acceptedBody: string[] = ['docs', 'inference_config'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1612,10 +1491,10 @@ export default class Ml { * Return ML defaults and limits. Returns defaults and limits used by machine learning. This endpoint is designed to be used by a user interface that needs to fully understand machine learning configurations where some options are not specified, meaning that the defaults should be used. This endpoint may be used to find out what those defaults are. It also provides information about the maximum size of machine learning jobs that could run in the current cluster configuration. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-ml-info.html | Elasticsearch API documentation} */ - async info (this: That, params?: T.MlInfoRequest | TB.MlInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async info (this: That, params?: T.MlInfoRequest | TB.MlInfoRequest, options?: TransportRequestOptionsWithMeta): Promise> - async info (this: That, params?: T.MlInfoRequest | TB.MlInfoRequest, options?: TransportRequestOptions): Promise - async info (this: That, params?: T.MlInfoRequest | TB.MlInfoRequest, options?: TransportRequestOptions): Promise { + async info (this: That, params?: T.MlInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async info (this: That, params?: T.MlInfoRequest, options?: TransportRequestOptionsWithMeta): Promise> + async info (this: That, params?: T.MlInfoRequest, options?: TransportRequestOptions): Promise + async info (this: That, params?: T.MlInfoRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -1624,7 +1503,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1642,30 +1521,22 @@ export default class Ml { * Open anomaly detection jobs. An anomaly detection job must be opened to be ready to receive and analyze data. It can be opened and closed multiple times throughout its lifecycle. When you open a new job, it starts with an empty model. When you open an existing job, the most recent model state is automatically loaded. The job is ready to resume its analysis from where it left off, once new data is received. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-open-job.html | Elasticsearch API documentation} */ - async openJob (this: That, params: T.MlOpenJobRequest | TB.MlOpenJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async openJob (this: That, params: T.MlOpenJobRequest | TB.MlOpenJobRequest, options?: TransportRequestOptionsWithMeta): Promise> - async openJob (this: That, params: T.MlOpenJobRequest | TB.MlOpenJobRequest, options?: TransportRequestOptions): Promise - async openJob (this: That, params: T.MlOpenJobRequest | TB.MlOpenJobRequest, options?: TransportRequestOptions): Promise { + async openJob (this: That, params: T.MlOpenJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async openJob (this: That, params: T.MlOpenJobRequest, options?: TransportRequestOptionsWithMeta): Promise> + async openJob (this: That, params: T.MlOpenJobRequest, options?: TransportRequestOptions): Promise + async openJob (this: That, params: T.MlOpenJobRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id'] const acceptedBody: string[] = ['timeout'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1686,30 +1557,22 @@ export default class Ml { * Add scheduled events to the calendar. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-post-calendar-event.html | Elasticsearch API documentation} */ - async postCalendarEvents (this: That, params: T.MlPostCalendarEventsRequest | TB.MlPostCalendarEventsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async postCalendarEvents (this: That, params: T.MlPostCalendarEventsRequest | TB.MlPostCalendarEventsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async postCalendarEvents (this: That, params: T.MlPostCalendarEventsRequest | TB.MlPostCalendarEventsRequest, options?: TransportRequestOptions): Promise - async postCalendarEvents (this: That, params: T.MlPostCalendarEventsRequest | TB.MlPostCalendarEventsRequest, options?: TransportRequestOptions): Promise { + async postCalendarEvents (this: That, params: T.MlPostCalendarEventsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async postCalendarEvents (this: That, params: T.MlPostCalendarEventsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async postCalendarEvents (this: That, params: T.MlPostCalendarEventsRequest, options?: TransportRequestOptions): Promise + async postCalendarEvents (this: That, params: T.MlPostCalendarEventsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['calendar_id'] const acceptedBody: string[] = ['events'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1730,15 +1593,14 @@ export default class Ml { * Send data to an anomaly detection job for analysis. IMPORTANT: For each job, data can be accepted from only a single connection at a time. It is not currently possible to post data to multiple jobs using wildcards or a comma-separated list. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-post-data.html | Elasticsearch API documentation} */ - async postData (this: That, params: T.MlPostDataRequest | TB.MlPostDataRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async postData (this: That, params: T.MlPostDataRequest | TB.MlPostDataRequest, options?: TransportRequestOptionsWithMeta): Promise> - async postData (this: That, params: T.MlPostDataRequest | TB.MlPostDataRequest, options?: TransportRequestOptions): Promise - async postData (this: That, params: T.MlPostDataRequest | TB.MlPostDataRequest, options?: TransportRequestOptions): Promise { + async postData (this: That, params: T.MlPostDataRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async postData (this: That, params: T.MlPostDataRequest, options?: TransportRequestOptionsWithMeta): Promise> + async postData (this: That, params: T.MlPostDataRequest, options?: TransportRequestOptions): Promise + async postData (this: That, params: T.MlPostDataRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id'] const acceptedBody: string[] = ['data'] const querystring: Record = {} - // @ts-expect-error - let body: any = params.body ?? undefined + let body: any for (const key in params) { if (acceptedBody.includes(key)) { @@ -1746,7 +1608,7 @@ export default class Ml { body = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1767,31 +1629,23 @@ export default class Ml { * Preview features used by data frame analytics. Previews the extracted features used by a data frame analytics config. * @see {@link http://www.elastic.co/guide/en/elasticsearch/reference/8.17/preview-dfanalytics.html | Elasticsearch API documentation} */ - async previewDataFrameAnalytics (this: That, params?: T.MlPreviewDataFrameAnalyticsRequest | TB.MlPreviewDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async previewDataFrameAnalytics (this: That, params?: T.MlPreviewDataFrameAnalyticsRequest | TB.MlPreviewDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async previewDataFrameAnalytics (this: That, params?: T.MlPreviewDataFrameAnalyticsRequest | TB.MlPreviewDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise - async previewDataFrameAnalytics (this: That, params?: T.MlPreviewDataFrameAnalyticsRequest | TB.MlPreviewDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { + async previewDataFrameAnalytics (this: That, params?: T.MlPreviewDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async previewDataFrameAnalytics (this: That, params?: T.MlPreviewDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async previewDataFrameAnalytics (this: That, params?: T.MlPreviewDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise + async previewDataFrameAnalytics (this: That, params?: T.MlPreviewDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const acceptedBody: string[] = ['config'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1819,31 +1673,23 @@ export default class Ml { * Preview a datafeed. This API returns the first "page" of search results from a datafeed. You can preview an existing datafeed or provide configuration details for a datafeed and anomaly detection job in the API. The preview shows the structure of the data that will be passed to the anomaly detection engine. IMPORTANT: When Elasticsearch security features are enabled, the preview uses the credentials of the user that called the API. However, when the datafeed starts it uses the roles of the last user that created or updated the datafeed. To get a preview that accurately reflects the behavior of the datafeed, use the appropriate credentials. You can also use secondary authorization headers to supply the credentials. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-preview-datafeed.html | Elasticsearch API documentation} */ - async previewDatafeed (this: That, params?: T.MlPreviewDatafeedRequest | TB.MlPreviewDatafeedRequest, options?: TransportRequestOptionsWithOutMeta): Promise> - async previewDatafeed (this: That, params?: T.MlPreviewDatafeedRequest | TB.MlPreviewDatafeedRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> - async previewDatafeed (this: That, params?: T.MlPreviewDatafeedRequest | TB.MlPreviewDatafeedRequest, options?: TransportRequestOptions): Promise> - async previewDatafeed (this: That, params?: T.MlPreviewDatafeedRequest | TB.MlPreviewDatafeedRequest, options?: TransportRequestOptions): Promise { + async previewDatafeed (this: That, params?: T.MlPreviewDatafeedRequest, options?: TransportRequestOptionsWithOutMeta): Promise> + async previewDatafeed (this: That, params?: T.MlPreviewDatafeedRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> + async previewDatafeed (this: That, params?: T.MlPreviewDatafeedRequest, options?: TransportRequestOptions): Promise> + async previewDatafeed (this: That, params?: T.MlPreviewDatafeedRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['datafeed_id'] const acceptedBody: string[] = ['datafeed_config', 'job_config'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1871,30 +1717,22 @@ export default class Ml { * Create a calendar. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-put-calendar.html | Elasticsearch API documentation} */ - async putCalendar (this: That, params: T.MlPutCalendarRequest | TB.MlPutCalendarRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putCalendar (this: That, params: T.MlPutCalendarRequest | TB.MlPutCalendarRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putCalendar (this: That, params: T.MlPutCalendarRequest | TB.MlPutCalendarRequest, options?: TransportRequestOptions): Promise - async putCalendar (this: That, params: T.MlPutCalendarRequest | TB.MlPutCalendarRequest, options?: TransportRequestOptions): Promise { + async putCalendar (this: That, params: T.MlPutCalendarRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putCalendar (this: That, params: T.MlPutCalendarRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putCalendar (this: That, params: T.MlPutCalendarRequest, options?: TransportRequestOptions): Promise + async putCalendar (this: That, params: T.MlPutCalendarRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['calendar_id'] const acceptedBody: string[] = ['job_ids', 'description'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1915,10 +1753,10 @@ export default class Ml { * Add anomaly detection job to calendar. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-put-calendar-job.html | Elasticsearch API documentation} */ - async putCalendarJob (this: That, params: T.MlPutCalendarJobRequest | TB.MlPutCalendarJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putCalendarJob (this: That, params: T.MlPutCalendarJobRequest | TB.MlPutCalendarJobRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putCalendarJob (this: That, params: T.MlPutCalendarJobRequest | TB.MlPutCalendarJobRequest, options?: TransportRequestOptions): Promise - async putCalendarJob (this: That, params: T.MlPutCalendarJobRequest | TB.MlPutCalendarJobRequest, options?: TransportRequestOptions): Promise { + async putCalendarJob (this: That, params: T.MlPutCalendarJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putCalendarJob (this: That, params: T.MlPutCalendarJobRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putCalendarJob (this: That, params: T.MlPutCalendarJobRequest, options?: TransportRequestOptions): Promise + async putCalendarJob (this: That, params: T.MlPutCalendarJobRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['calendar_id', 'job_id'] const querystring: Record = {} const body = undefined @@ -1926,7 +1764,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1948,30 +1786,22 @@ export default class Ml { * Create a data frame analytics job. This API creates a data frame analytics job that performs an analysis on the source indices and stores the outcome in a destination index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-dfanalytics.html | Elasticsearch API documentation} */ - async putDataFrameAnalytics (this: That, params: T.MlPutDataFrameAnalyticsRequest | TB.MlPutDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putDataFrameAnalytics (this: That, params: T.MlPutDataFrameAnalyticsRequest | TB.MlPutDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putDataFrameAnalytics (this: That, params: T.MlPutDataFrameAnalyticsRequest | TB.MlPutDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise - async putDataFrameAnalytics (this: That, params: T.MlPutDataFrameAnalyticsRequest | TB.MlPutDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { + async putDataFrameAnalytics (this: That, params: T.MlPutDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putDataFrameAnalytics (this: That, params: T.MlPutDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putDataFrameAnalytics (this: That, params: T.MlPutDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise + async putDataFrameAnalytics (this: That, params: T.MlPutDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const acceptedBody: string[] = ['allow_lazy_start', 'analysis', 'analyzed_fields', 'description', 'dest', 'max_num_threads', 'model_memory_limit', 'source', 'headers', 'version'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1992,30 +1822,22 @@ export default class Ml { * Create a datafeed. Datafeeds retrieve data from Elasticsearch for analysis by an anomaly detection job. You can associate only one datafeed with each anomaly detection job. The datafeed contains a query that runs at a defined interval (`frequency`). If you are concerned about delayed data, you can add a delay (`query_delay') at each interval. When Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had at the time of creation and runs the query using those same roles. If you provide secondary authorization headers, those credentials are used instead. You must use Kibana, this API, or the create anomaly detection jobs API to create a datafeed. Do not add a datafeed directly to the `.ml-config` index. Do not give users `write` privileges on the `.ml-config` index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-put-datafeed.html | Elasticsearch API documentation} */ - async putDatafeed (this: That, params: T.MlPutDatafeedRequest | TB.MlPutDatafeedRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putDatafeed (this: That, params: T.MlPutDatafeedRequest | TB.MlPutDatafeedRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putDatafeed (this: That, params: T.MlPutDatafeedRequest | TB.MlPutDatafeedRequest, options?: TransportRequestOptions): Promise - async putDatafeed (this: That, params: T.MlPutDatafeedRequest | TB.MlPutDatafeedRequest, options?: TransportRequestOptions): Promise { + async putDatafeed (this: That, params: T.MlPutDatafeedRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putDatafeed (this: That, params: T.MlPutDatafeedRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putDatafeed (this: That, params: T.MlPutDatafeedRequest, options?: TransportRequestOptions): Promise + async putDatafeed (this: That, params: T.MlPutDatafeedRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['datafeed_id'] const acceptedBody: string[] = ['aggregations', 'chunking_config', 'delayed_data_check_config', 'frequency', 'indices', 'indexes', 'indices_options', 'job_id', 'max_empty_searches', 'query', 'query_delay', 'runtime_mappings', 'script_fields', 'scroll_size', 'headers'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2036,30 +1858,22 @@ export default class Ml { * Create a filter. A filter contains a list of strings. It can be used by one or more anomaly detection jobs. Specifically, filters are referenced in the `custom_rules` property of detector configuration objects. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-put-filter.html | Elasticsearch API documentation} */ - async putFilter (this: That, params: T.MlPutFilterRequest | TB.MlPutFilterRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putFilter (this: That, params: T.MlPutFilterRequest | TB.MlPutFilterRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putFilter (this: That, params: T.MlPutFilterRequest | TB.MlPutFilterRequest, options?: TransportRequestOptions): Promise - async putFilter (this: That, params: T.MlPutFilterRequest | TB.MlPutFilterRequest, options?: TransportRequestOptions): Promise { + async putFilter (this: That, params: T.MlPutFilterRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putFilter (this: That, params: T.MlPutFilterRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putFilter (this: That, params: T.MlPutFilterRequest, options?: TransportRequestOptions): Promise + async putFilter (this: That, params: T.MlPutFilterRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['filter_id'] const acceptedBody: string[] = ['description', 'items'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2080,30 +1894,22 @@ export default class Ml { * Create an anomaly detection job. If you include a `datafeed_config`, you must have read index privileges on the source index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-put-job.html | Elasticsearch API documentation} */ - async putJob (this: That, params: T.MlPutJobRequest | TB.MlPutJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putJob (this: That, params: T.MlPutJobRequest | TB.MlPutJobRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putJob (this: That, params: T.MlPutJobRequest | TB.MlPutJobRequest, options?: TransportRequestOptions): Promise - async putJob (this: That, params: T.MlPutJobRequest | TB.MlPutJobRequest, options?: TransportRequestOptions): Promise { + async putJob (this: That, params: T.MlPutJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putJob (this: That, params: T.MlPutJobRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putJob (this: That, params: T.MlPutJobRequest, options?: TransportRequestOptions): Promise + async putJob (this: That, params: T.MlPutJobRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id'] const acceptedBody: string[] = ['allow_lazy_open', 'analysis_config', 'analysis_limits', 'background_persist_interval', 'custom_settings', 'daily_model_snapshot_retention_after_days', 'data_description', 'datafeed_config', 'description', 'groups', 'model_plot_config', 'model_snapshot_retention_days', 'renormalization_window_days', 'results_index_name', 'results_retention_days'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2124,30 +1930,22 @@ export default class Ml { * Create a trained model. Enable you to supply a trained model that is not created by data frame analytics. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-trained-models.html | Elasticsearch API documentation} */ - async putTrainedModel (this: That, params: T.MlPutTrainedModelRequest | TB.MlPutTrainedModelRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putTrainedModel (this: That, params: T.MlPutTrainedModelRequest | TB.MlPutTrainedModelRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putTrainedModel (this: That, params: T.MlPutTrainedModelRequest | TB.MlPutTrainedModelRequest, options?: TransportRequestOptions): Promise - async putTrainedModel (this: That, params: T.MlPutTrainedModelRequest | TB.MlPutTrainedModelRequest, options?: TransportRequestOptions): Promise { + async putTrainedModel (this: That, params: T.MlPutTrainedModelRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putTrainedModel (this: That, params: T.MlPutTrainedModelRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putTrainedModel (this: That, params: T.MlPutTrainedModelRequest, options?: TransportRequestOptions): Promise + async putTrainedModel (this: That, params: T.MlPutTrainedModelRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_id'] const acceptedBody: string[] = ['compressed_definition', 'definition', 'description', 'inference_config', 'input', 'metadata', 'model_type', 'model_size_bytes', 'platform_architecture', 'tags', 'prefix_strings'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2168,10 +1966,10 @@ export default class Ml { * Create or update a trained model alias. A trained model alias is a logical name used to reference a single trained model. You can use aliases instead of trained model identifiers to make it easier to reference your models. For example, you can use aliases in inference aggregations and processors. An alias must be unique and refer to only a single trained model. However, you can have multiple aliases for each trained model. If you use this API to update an alias such that it references a different trained model ID and the model uses a different type of data frame analytics, an error occurs. For example, this situation occurs if you have a trained model for regression analysis and a trained model for classification analysis; you cannot reassign an alias from one type of trained model to another. If you use this API to update an alias and there are very few input fields in common between the old and new trained models for the model alias, the API returns a warning. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-trained-models-aliases.html | Elasticsearch API documentation} */ - async putTrainedModelAlias (this: That, params: T.MlPutTrainedModelAliasRequest | TB.MlPutTrainedModelAliasRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putTrainedModelAlias (this: That, params: T.MlPutTrainedModelAliasRequest | TB.MlPutTrainedModelAliasRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putTrainedModelAlias (this: That, params: T.MlPutTrainedModelAliasRequest | TB.MlPutTrainedModelAliasRequest, options?: TransportRequestOptions): Promise - async putTrainedModelAlias (this: That, params: T.MlPutTrainedModelAliasRequest | TB.MlPutTrainedModelAliasRequest, options?: TransportRequestOptions): Promise { + async putTrainedModelAlias (this: That, params: T.MlPutTrainedModelAliasRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putTrainedModelAlias (this: That, params: T.MlPutTrainedModelAliasRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putTrainedModelAlias (this: That, params: T.MlPutTrainedModelAliasRequest, options?: TransportRequestOptions): Promise + async putTrainedModelAlias (this: That, params: T.MlPutTrainedModelAliasRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_alias', 'model_id'] const querystring: Record = {} const body = undefined @@ -2179,7 +1977,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2201,30 +1999,22 @@ export default class Ml { * Create part of a trained model definition. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-trained-model-definition-part.html | Elasticsearch API documentation} */ - async putTrainedModelDefinitionPart (this: That, params: T.MlPutTrainedModelDefinitionPartRequest | TB.MlPutTrainedModelDefinitionPartRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putTrainedModelDefinitionPart (this: That, params: T.MlPutTrainedModelDefinitionPartRequest | TB.MlPutTrainedModelDefinitionPartRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putTrainedModelDefinitionPart (this: That, params: T.MlPutTrainedModelDefinitionPartRequest | TB.MlPutTrainedModelDefinitionPartRequest, options?: TransportRequestOptions): Promise - async putTrainedModelDefinitionPart (this: That, params: T.MlPutTrainedModelDefinitionPartRequest | TB.MlPutTrainedModelDefinitionPartRequest, options?: TransportRequestOptions): Promise { + async putTrainedModelDefinitionPart (this: That, params: T.MlPutTrainedModelDefinitionPartRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putTrainedModelDefinitionPart (this: That, params: T.MlPutTrainedModelDefinitionPartRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putTrainedModelDefinitionPart (this: That, params: T.MlPutTrainedModelDefinitionPartRequest, options?: TransportRequestOptions): Promise + async putTrainedModelDefinitionPart (this: That, params: T.MlPutTrainedModelDefinitionPartRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_id', 'part'] const acceptedBody: string[] = ['definition', 'total_definition_length', 'total_parts'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2246,30 +2036,22 @@ export default class Ml { * Create a trained model vocabulary. This API is supported only for natural language processing (NLP) models. The vocabulary is stored in the index as described in `inference_config.*.vocabulary` of the trained model definition. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-trained-model-vocabulary.html | Elasticsearch API documentation} */ - async putTrainedModelVocabulary (this: That, params: T.MlPutTrainedModelVocabularyRequest | TB.MlPutTrainedModelVocabularyRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putTrainedModelVocabulary (this: That, params: T.MlPutTrainedModelVocabularyRequest | TB.MlPutTrainedModelVocabularyRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putTrainedModelVocabulary (this: That, params: T.MlPutTrainedModelVocabularyRequest | TB.MlPutTrainedModelVocabularyRequest, options?: TransportRequestOptions): Promise - async putTrainedModelVocabulary (this: That, params: T.MlPutTrainedModelVocabularyRequest | TB.MlPutTrainedModelVocabularyRequest, options?: TransportRequestOptions): Promise { + async putTrainedModelVocabulary (this: That, params: T.MlPutTrainedModelVocabularyRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putTrainedModelVocabulary (this: That, params: T.MlPutTrainedModelVocabularyRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putTrainedModelVocabulary (this: That, params: T.MlPutTrainedModelVocabularyRequest, options?: TransportRequestOptions): Promise + async putTrainedModelVocabulary (this: That, params: T.MlPutTrainedModelVocabularyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_id'] const acceptedBody: string[] = ['vocabulary', 'merges', 'scores'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2290,10 +2072,10 @@ export default class Ml { * Reset an anomaly detection job. All model state and results are deleted. The job is ready to start over as if it had just been created. It is not currently possible to reset multiple jobs using wildcards or a comma separated list. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-reset-job.html | Elasticsearch API documentation} */ - async resetJob (this: That, params: T.MlResetJobRequest | TB.MlResetJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async resetJob (this: That, params: T.MlResetJobRequest | TB.MlResetJobRequest, options?: TransportRequestOptionsWithMeta): Promise> - async resetJob (this: That, params: T.MlResetJobRequest | TB.MlResetJobRequest, options?: TransportRequestOptions): Promise - async resetJob (this: That, params: T.MlResetJobRequest | TB.MlResetJobRequest, options?: TransportRequestOptions): Promise { + async resetJob (this: That, params: T.MlResetJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async resetJob (this: That, params: T.MlResetJobRequest, options?: TransportRequestOptionsWithMeta): Promise> + async resetJob (this: That, params: T.MlResetJobRequest, options?: TransportRequestOptions): Promise + async resetJob (this: That, params: T.MlResetJobRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id'] const querystring: Record = {} const body = undefined @@ -2301,7 +2083,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2322,30 +2104,22 @@ export default class Ml { * Revert to a snapshot. The machine learning features react quickly to anomalous input, learning new behaviors in data. Highly anomalous input increases the variance in the models whilst the system learns whether this is a new step-change in behavior or a one-off event. In the case where this anomalous input is known to be a one-off, then it might be appropriate to reset the model state to a time before this event. For example, you might consider reverting to a saved snapshot after Black Friday or a critical system failure. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-revert-snapshot.html | Elasticsearch API documentation} */ - async revertModelSnapshot (this: That, params: T.MlRevertModelSnapshotRequest | TB.MlRevertModelSnapshotRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async revertModelSnapshot (this: That, params: T.MlRevertModelSnapshotRequest | TB.MlRevertModelSnapshotRequest, options?: TransportRequestOptionsWithMeta): Promise> - async revertModelSnapshot (this: That, params: T.MlRevertModelSnapshotRequest | TB.MlRevertModelSnapshotRequest, options?: TransportRequestOptions): Promise - async revertModelSnapshot (this: That, params: T.MlRevertModelSnapshotRequest | TB.MlRevertModelSnapshotRequest, options?: TransportRequestOptions): Promise { + async revertModelSnapshot (this: That, params: T.MlRevertModelSnapshotRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async revertModelSnapshot (this: That, params: T.MlRevertModelSnapshotRequest, options?: TransportRequestOptionsWithMeta): Promise> + async revertModelSnapshot (this: That, params: T.MlRevertModelSnapshotRequest, options?: TransportRequestOptions): Promise + async revertModelSnapshot (this: That, params: T.MlRevertModelSnapshotRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id', 'snapshot_id'] const acceptedBody: string[] = ['delete_intervening_results'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2367,10 +2141,10 @@ export default class Ml { * Set upgrade_mode for ML indices. Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. When upgrading your cluster, in some circumstances you must restart your nodes and reindex your machine learning indices. In those circumstances, there must be no machine learning jobs running. You can close the machine learning jobs, do the upgrade, then open all the jobs again. Alternatively, you can use this API to temporarily halt tasks associated with the jobs and datafeeds and prevent new jobs from opening. You can also use this API during upgrades that do not require you to reindex your machine learning indices, though stopping jobs is not a requirement in that case. You can see the current value for the upgrade_mode setting by using the get machine learning info API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-set-upgrade-mode.html | Elasticsearch API documentation} */ - async setUpgradeMode (this: That, params?: T.MlSetUpgradeModeRequest | TB.MlSetUpgradeModeRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async setUpgradeMode (this: That, params?: T.MlSetUpgradeModeRequest | TB.MlSetUpgradeModeRequest, options?: TransportRequestOptionsWithMeta): Promise> - async setUpgradeMode (this: That, params?: T.MlSetUpgradeModeRequest | TB.MlSetUpgradeModeRequest, options?: TransportRequestOptions): Promise - async setUpgradeMode (this: That, params?: T.MlSetUpgradeModeRequest | TB.MlSetUpgradeModeRequest, options?: TransportRequestOptions): Promise { + async setUpgradeMode (this: That, params?: T.MlSetUpgradeModeRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async setUpgradeMode (this: That, params?: T.MlSetUpgradeModeRequest, options?: TransportRequestOptionsWithMeta): Promise> + async setUpgradeMode (this: That, params?: T.MlSetUpgradeModeRequest, options?: TransportRequestOptions): Promise + async setUpgradeMode (this: That, params?: T.MlSetUpgradeModeRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -2379,7 +2153,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2397,10 +2171,10 @@ export default class Ml { * Start a data frame analytics job. A data frame analytics job can be started and stopped multiple times throughout its lifecycle. If the destination index does not exist, it is created automatically the first time you start the data frame analytics job. The `index.number_of_shards` and `index.number_of_replicas` settings for the destination index are copied from the source index. If there are multiple source indices, the destination index copies the highest setting values. The mappings for the destination index are also copied from the source indices. If there are any mapping conflicts, the job fails to start. If the destination index exists, it is used as is. You can therefore set up the destination index in advance with custom settings and mappings. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/start-dfanalytics.html | Elasticsearch API documentation} */ - async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest | TB.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest | TB.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest | TB.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise - async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest | TB.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { + async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise + async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -2408,7 +2182,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2429,30 +2203,22 @@ export default class Ml { * Start datafeeds. A datafeed must be started in order to retrieve data from Elasticsearch. A datafeed can be started and stopped multiple times throughout its lifecycle. Before you can start a datafeed, the anomaly detection job must be open. Otherwise, an error occurs. If you restart a stopped datafeed, it continues processing input data from the next millisecond after it was stopped. If new data was indexed for that exact millisecond between stopping and starting, it will be ignored. When Elasticsearch security features are enabled, your datafeed remembers which roles the last user to create or update it had at the time of creation or update and runs the query using those same roles. If you provided secondary authorization headers when you created or updated the datafeed, those credentials are used instead. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-start-datafeed.html | Elasticsearch API documentation} */ - async startDatafeed (this: That, params: T.MlStartDatafeedRequest | TB.MlStartDatafeedRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async startDatafeed (this: That, params: T.MlStartDatafeedRequest | TB.MlStartDatafeedRequest, options?: TransportRequestOptionsWithMeta): Promise> - async startDatafeed (this: That, params: T.MlStartDatafeedRequest | TB.MlStartDatafeedRequest, options?: TransportRequestOptions): Promise - async startDatafeed (this: That, params: T.MlStartDatafeedRequest | TB.MlStartDatafeedRequest, options?: TransportRequestOptions): Promise { + async startDatafeed (this: That, params: T.MlStartDatafeedRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async startDatafeed (this: That, params: T.MlStartDatafeedRequest, options?: TransportRequestOptionsWithMeta): Promise> + async startDatafeed (this: That, params: T.MlStartDatafeedRequest, options?: TransportRequestOptions): Promise + async startDatafeed (this: That, params: T.MlStartDatafeedRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['datafeed_id'] const acceptedBody: string[] = ['end', 'start', 'timeout'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2473,10 +2239,10 @@ export default class Ml { * Start a trained model deployment. It allocates the model to every machine learning node. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/start-trained-model-deployment.html | Elasticsearch API documentation} */ - async startTrainedModelDeployment (this: That, params: T.MlStartTrainedModelDeploymentRequest | TB.MlStartTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async startTrainedModelDeployment (this: That, params: T.MlStartTrainedModelDeploymentRequest | TB.MlStartTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithMeta): Promise> - async startTrainedModelDeployment (this: That, params: T.MlStartTrainedModelDeploymentRequest | TB.MlStartTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise - async startTrainedModelDeployment (this: That, params: T.MlStartTrainedModelDeploymentRequest | TB.MlStartTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise { + async startTrainedModelDeployment (this: That, params: T.MlStartTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async startTrainedModelDeployment (this: That, params: T.MlStartTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithMeta): Promise> + async startTrainedModelDeployment (this: That, params: T.MlStartTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise + async startTrainedModelDeployment (this: That, params: T.MlStartTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_id'] const querystring: Record = {} const body = undefined @@ -2484,7 +2250,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2505,10 +2271,10 @@ export default class Ml { * Stop data frame analytics jobs. A data frame analytics job can be started and stopped multiple times throughout its lifecycle. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/stop-dfanalytics.html | Elasticsearch API documentation} */ - async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest | TB.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest | TB.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest | TB.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise - async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest | TB.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { + async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise + async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -2516,7 +2282,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2537,30 +2303,22 @@ export default class Ml { * Stop datafeeds. A datafeed that is stopped ceases to retrieve data from Elasticsearch. A datafeed can be started and stopped multiple times throughout its lifecycle. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-stop-datafeed.html | Elasticsearch API documentation} */ - async stopDatafeed (this: That, params: T.MlStopDatafeedRequest | TB.MlStopDatafeedRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async stopDatafeed (this: That, params: T.MlStopDatafeedRequest | TB.MlStopDatafeedRequest, options?: TransportRequestOptionsWithMeta): Promise> - async stopDatafeed (this: That, params: T.MlStopDatafeedRequest | TB.MlStopDatafeedRequest, options?: TransportRequestOptions): Promise - async stopDatafeed (this: That, params: T.MlStopDatafeedRequest | TB.MlStopDatafeedRequest, options?: TransportRequestOptions): Promise { + async stopDatafeed (this: That, params: T.MlStopDatafeedRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async stopDatafeed (this: That, params: T.MlStopDatafeedRequest, options?: TransportRequestOptionsWithMeta): Promise> + async stopDatafeed (this: That, params: T.MlStopDatafeedRequest, options?: TransportRequestOptions): Promise + async stopDatafeed (this: That, params: T.MlStopDatafeedRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['datafeed_id'] const acceptedBody: string[] = ['allow_no_match', 'force', 'timeout'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2581,10 +2339,10 @@ export default class Ml { * Stop a trained model deployment. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/stop-trained-model-deployment.html | Elasticsearch API documentation} */ - async stopTrainedModelDeployment (this: That, params: T.MlStopTrainedModelDeploymentRequest | TB.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async stopTrainedModelDeployment (this: That, params: T.MlStopTrainedModelDeploymentRequest | TB.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithMeta): Promise> - async stopTrainedModelDeployment (this: That, params: T.MlStopTrainedModelDeploymentRequest | TB.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise - async stopTrainedModelDeployment (this: That, params: T.MlStopTrainedModelDeploymentRequest | TB.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise { + async stopTrainedModelDeployment (this: That, params: T.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async stopTrainedModelDeployment (this: That, params: T.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithMeta): Promise> + async stopTrainedModelDeployment (this: That, params: T.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise + async stopTrainedModelDeployment (this: That, params: T.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_id'] const querystring: Record = {} const body = undefined @@ -2592,7 +2350,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2613,30 +2371,22 @@ export default class Ml { * Update a data frame analytics job. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-dfanalytics.html | Elasticsearch API documentation} */ - async updateDataFrameAnalytics (this: That, params: T.MlUpdateDataFrameAnalyticsRequest | TB.MlUpdateDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateDataFrameAnalytics (this: That, params: T.MlUpdateDataFrameAnalyticsRequest | TB.MlUpdateDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateDataFrameAnalytics (this: That, params: T.MlUpdateDataFrameAnalyticsRequest | TB.MlUpdateDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise - async updateDataFrameAnalytics (this: That, params: T.MlUpdateDataFrameAnalyticsRequest | TB.MlUpdateDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { + async updateDataFrameAnalytics (this: That, params: T.MlUpdateDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateDataFrameAnalytics (this: That, params: T.MlUpdateDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateDataFrameAnalytics (this: That, params: T.MlUpdateDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise + async updateDataFrameAnalytics (this: That, params: T.MlUpdateDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const acceptedBody: string[] = ['description', 'model_memory_limit', 'max_num_threads', 'allow_lazy_start'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2657,30 +2407,22 @@ export default class Ml { * Update a datafeed. You must stop and start the datafeed for the changes to be applied. When Elasticsearch security features are enabled, your datafeed remembers which roles the user who updated it had at the time of the update and runs the query using those same roles. If you provide secondary authorization headers, those credentials are used instead. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-update-datafeed.html | Elasticsearch API documentation} */ - async updateDatafeed (this: That, params: T.MlUpdateDatafeedRequest | TB.MlUpdateDatafeedRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateDatafeed (this: That, params: T.MlUpdateDatafeedRequest | TB.MlUpdateDatafeedRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateDatafeed (this: That, params: T.MlUpdateDatafeedRequest | TB.MlUpdateDatafeedRequest, options?: TransportRequestOptions): Promise - async updateDatafeed (this: That, params: T.MlUpdateDatafeedRequest | TB.MlUpdateDatafeedRequest, options?: TransportRequestOptions): Promise { + async updateDatafeed (this: That, params: T.MlUpdateDatafeedRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateDatafeed (this: That, params: T.MlUpdateDatafeedRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateDatafeed (this: That, params: T.MlUpdateDatafeedRequest, options?: TransportRequestOptions): Promise + async updateDatafeed (this: That, params: T.MlUpdateDatafeedRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['datafeed_id'] const acceptedBody: string[] = ['aggregations', 'chunking_config', 'delayed_data_check_config', 'frequency', 'indices', 'indexes', 'indices_options', 'job_id', 'max_empty_searches', 'query', 'query_delay', 'runtime_mappings', 'script_fields', 'scroll_size'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2701,30 +2443,22 @@ export default class Ml { * Update a filter. Updates the description of a filter, adds items, or removes items from the list. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-update-filter.html | Elasticsearch API documentation} */ - async updateFilter (this: That, params: T.MlUpdateFilterRequest | TB.MlUpdateFilterRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateFilter (this: That, params: T.MlUpdateFilterRequest | TB.MlUpdateFilterRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateFilter (this: That, params: T.MlUpdateFilterRequest | TB.MlUpdateFilterRequest, options?: TransportRequestOptions): Promise - async updateFilter (this: That, params: T.MlUpdateFilterRequest | TB.MlUpdateFilterRequest, options?: TransportRequestOptions): Promise { + async updateFilter (this: That, params: T.MlUpdateFilterRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateFilter (this: That, params: T.MlUpdateFilterRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateFilter (this: That, params: T.MlUpdateFilterRequest, options?: TransportRequestOptions): Promise + async updateFilter (this: That, params: T.MlUpdateFilterRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['filter_id'] const acceptedBody: string[] = ['add_items', 'description', 'remove_items'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2745,30 +2479,22 @@ export default class Ml { * Update an anomaly detection job. Updates certain properties of an anomaly detection job. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-update-job.html | Elasticsearch API documentation} */ - async updateJob (this: That, params: T.MlUpdateJobRequest | TB.MlUpdateJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateJob (this: That, params: T.MlUpdateJobRequest | TB.MlUpdateJobRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateJob (this: That, params: T.MlUpdateJobRequest | TB.MlUpdateJobRequest, options?: TransportRequestOptions): Promise - async updateJob (this: That, params: T.MlUpdateJobRequest | TB.MlUpdateJobRequest, options?: TransportRequestOptions): Promise { + async updateJob (this: That, params: T.MlUpdateJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateJob (this: That, params: T.MlUpdateJobRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateJob (this: That, params: T.MlUpdateJobRequest, options?: TransportRequestOptions): Promise + async updateJob (this: That, params: T.MlUpdateJobRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id'] const acceptedBody: string[] = ['allow_lazy_open', 'analysis_limits', 'background_persist_interval', 'custom_settings', 'categorization_filters', 'description', 'model_plot_config', 'model_prune_window', 'daily_model_snapshot_retention_after_days', 'model_snapshot_retention_days', 'renormalization_window_days', 'results_retention_days', 'groups', 'detectors', 'per_partition_categorization'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2789,30 +2515,22 @@ export default class Ml { * Update a snapshot. Updates certain properties of a snapshot. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-update-snapshot.html | Elasticsearch API documentation} */ - async updateModelSnapshot (this: That, params: T.MlUpdateModelSnapshotRequest | TB.MlUpdateModelSnapshotRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateModelSnapshot (this: That, params: T.MlUpdateModelSnapshotRequest | TB.MlUpdateModelSnapshotRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateModelSnapshot (this: That, params: T.MlUpdateModelSnapshotRequest | TB.MlUpdateModelSnapshotRequest, options?: TransportRequestOptions): Promise - async updateModelSnapshot (this: That, params: T.MlUpdateModelSnapshotRequest | TB.MlUpdateModelSnapshotRequest, options?: TransportRequestOptions): Promise { + async updateModelSnapshot (this: That, params: T.MlUpdateModelSnapshotRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateModelSnapshot (this: That, params: T.MlUpdateModelSnapshotRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateModelSnapshot (this: That, params: T.MlUpdateModelSnapshotRequest, options?: TransportRequestOptions): Promise + async updateModelSnapshot (this: That, params: T.MlUpdateModelSnapshotRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id', 'snapshot_id'] const acceptedBody: string[] = ['description', 'retain'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2834,30 +2552,22 @@ export default class Ml { * Update a trained model deployment. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-trained-model-deployment.html | Elasticsearch API documentation} */ - async updateTrainedModelDeployment (this: That, params: T.MlUpdateTrainedModelDeploymentRequest | TB.MlUpdateTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateTrainedModelDeployment (this: That, params: T.MlUpdateTrainedModelDeploymentRequest | TB.MlUpdateTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateTrainedModelDeployment (this: That, params: T.MlUpdateTrainedModelDeploymentRequest | TB.MlUpdateTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise - async updateTrainedModelDeployment (this: That, params: T.MlUpdateTrainedModelDeploymentRequest | TB.MlUpdateTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise { + async updateTrainedModelDeployment (this: That, params: T.MlUpdateTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateTrainedModelDeployment (this: That, params: T.MlUpdateTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateTrainedModelDeployment (this: That, params: T.MlUpdateTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise + async updateTrainedModelDeployment (this: That, params: T.MlUpdateTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['model_id'] const acceptedBody: string[] = ['number_of_allocations'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2878,10 +2588,10 @@ export default class Ml { * Upgrade a snapshot. Upgrades an anomaly detection model snapshot to the latest major version. Over time, older snapshot formats are deprecated and removed. Anomaly detection jobs support only snapshots that are from the current or previous major version. This API provides a means to upgrade a snapshot to the current major version. This aids in preparing the cluster for an upgrade to the next major version. Only one snapshot per anomaly detection job can be upgraded at a time and the upgraded snapshot cannot be the current snapshot of the anomaly detection job. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-upgrade-job-model-snapshot.html | Elasticsearch API documentation} */ - async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest | TB.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest | TB.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptionsWithMeta): Promise> - async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest | TB.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptions): Promise - async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest | TB.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptions): Promise { + async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptionsWithMeta): Promise> + async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptions): Promise + async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['job_id', 'snapshot_id'] const querystring: Record = {} const body = undefined @@ -2889,7 +2599,7 @@ export default class Ml { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2911,31 +2621,23 @@ export default class Ml { * Validates an anomaly detection job. * @see {@link https://www.elastic.co/guide/en/machine-learning/8.17/ml-jobs.html | Elasticsearch API documentation} */ - async validate (this: That, params?: T.MlValidateRequest | TB.MlValidateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async validate (this: That, params?: T.MlValidateRequest | TB.MlValidateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async validate (this: That, params?: T.MlValidateRequest | TB.MlValidateRequest, options?: TransportRequestOptions): Promise - async validate (this: That, params?: T.MlValidateRequest | TB.MlValidateRequest, options?: TransportRequestOptions): Promise { + async validate (this: That, params?: T.MlValidateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async validate (this: That, params?: T.MlValidateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async validate (this: That, params?: T.MlValidateRequest, options?: TransportRequestOptions): Promise + async validate (this: That, params?: T.MlValidateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['job_id', 'analysis_config', 'analysis_limits', 'data_description', 'description', 'model_plot', 'model_snapshot_id', 'model_snapshot_retention_days', 'results_index_name'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2953,15 +2655,14 @@ export default class Ml { * Validates an anomaly detection detector. * @see {@link https://www.elastic.co/guide/en/machine-learning/8.17/ml-jobs.html | Elasticsearch API documentation} */ - async validateDetector (this: That, params: T.MlValidateDetectorRequest | TB.MlValidateDetectorRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async validateDetector (this: That, params: T.MlValidateDetectorRequest | TB.MlValidateDetectorRequest, options?: TransportRequestOptionsWithMeta): Promise> - async validateDetector (this: That, params: T.MlValidateDetectorRequest | TB.MlValidateDetectorRequest, options?: TransportRequestOptions): Promise - async validateDetector (this: That, params: T.MlValidateDetectorRequest | TB.MlValidateDetectorRequest, options?: TransportRequestOptions): Promise { + async validateDetector (this: That, params: T.MlValidateDetectorRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async validateDetector (this: That, params: T.MlValidateDetectorRequest, options?: TransportRequestOptionsWithMeta): Promise> + async validateDetector (this: That, params: T.MlValidateDetectorRequest, options?: TransportRequestOptions): Promise + async validateDetector (this: That, params: T.MlValidateDetectorRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['detector'] const querystring: Record = {} - // @ts-expect-error - let body: any = params.body ?? undefined + let body: any for (const key in params) { if (acceptedBody.includes(key)) { @@ -2969,7 +2670,7 @@ export default class Ml { body = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/monitoring.ts b/src/api/api/monitoring.ts index 3e11f2be5..22b6b3166 100644 --- a/src/api/api/monitoring.ts +++ b/src/api/api/monitoring.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Monitoring { @@ -48,15 +47,14 @@ export default class Monitoring { * Used by the monitoring features to send monitoring data. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/monitor-elasticsearch-cluster.html | Elasticsearch API documentation} */ - async bulk (this: That, params: T.MonitoringBulkRequest | TB.MonitoringBulkRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async bulk (this: That, params: T.MonitoringBulkRequest | TB.MonitoringBulkRequest, options?: TransportRequestOptionsWithMeta): Promise> - async bulk (this: That, params: T.MonitoringBulkRequest | TB.MonitoringBulkRequest, options?: TransportRequestOptions): Promise - async bulk (this: That, params: T.MonitoringBulkRequest | TB.MonitoringBulkRequest, options?: TransportRequestOptions): Promise { + async bulk (this: That, params: T.MonitoringBulkRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async bulk (this: That, params: T.MonitoringBulkRequest, options?: TransportRequestOptionsWithMeta): Promise> + async bulk (this: That, params: T.MonitoringBulkRequest, options?: TransportRequestOptions): Promise + async bulk (this: That, params: T.MonitoringBulkRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['type'] const acceptedBody: string[] = ['operations'] const querystring: Record = {} - // @ts-expect-error - let body: any = params.body ?? undefined + let body: any for (const key in params) { if (acceptedBody.includes(key)) { @@ -64,7 +62,7 @@ export default class Monitoring { body = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/msearch.ts b/src/api/api/msearch.ts index e2d71314b..3b7a41c92 100644 --- a/src/api/api/msearch.ts +++ b/src/api/api/msearch.ts @@ -35,22 +35,20 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Run multiple searches. The format of the request is similar to the bulk API format and makes use of the newline delimited JSON (NDJSON) format. The structure is as follows: ``` header\n body\n header\n body\n ``` This structure is specifically optimized to reduce parsing if a specific search ends up redirected to another node. IMPORTANT: The final line of data must end with a newline character `\n`. Each newline character may be preceded by a carriage return `\r`. When sending requests to this endpoint the `Content-Type` header should be set to `application/x-ndjson`. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-multi-search.html | Elasticsearch API documentation} */ -export default async function MsearchApi> (this: That, params: T.MsearchRequest | TB.MsearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> -export default async function MsearchApi> (this: That, params: T.MsearchRequest | TB.MsearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> -export default async function MsearchApi> (this: That, params: T.MsearchRequest | TB.MsearchRequest, options?: TransportRequestOptions): Promise> -export default async function MsearchApi> (this: That, params: T.MsearchRequest | TB.MsearchRequest, options?: TransportRequestOptions): Promise { +export default async function MsearchApi> (this: That, params: T.MsearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> +export default async function MsearchApi> (this: That, params: T.MsearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> +export default async function MsearchApi> (this: That, params: T.MsearchRequest, options?: TransportRequestOptions): Promise> +export default async function MsearchApi> (this: That, params: T.MsearchRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['searches'] const querystring: Record = {} - // @ts-expect-error - let body: any = params.body ?? undefined + let body: any for (const key in params) { if (acceptedBody.includes(key)) { @@ -58,7 +56,7 @@ export default async function MsearchApi> (this: That, params: T.MsearchTemplateRequest | TB.MsearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise> -export default async function MsearchTemplateApi> (this: That, params: T.MsearchTemplateRequest | TB.MsearchTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> -export default async function MsearchTemplateApi> (this: That, params: T.MsearchTemplateRequest | TB.MsearchTemplateRequest, options?: TransportRequestOptions): Promise> -export default async function MsearchTemplateApi> (this: That, params: T.MsearchTemplateRequest | TB.MsearchTemplateRequest, options?: TransportRequestOptions): Promise { +export default async function MsearchTemplateApi> (this: That, params: T.MsearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise> +export default async function MsearchTemplateApi> (this: That, params: T.MsearchTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> +export default async function MsearchTemplateApi> (this: That, params: T.MsearchTemplateRequest, options?: TransportRequestOptions): Promise> +export default async function MsearchTemplateApi> (this: That, params: T.MsearchTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['search_templates'] const querystring: Record = {} - // @ts-expect-error - let body: any = params.body ?? undefined + let body: any for (const key in params) { if (acceptedBody.includes(key)) { @@ -58,7 +56,7 @@ export default async function MsearchTemplateApi -export default async function MtermvectorsApi (this: That, params?: T.MtermvectorsRequest | TB.MtermvectorsRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function MtermvectorsApi (this: That, params?: T.MtermvectorsRequest | TB.MtermvectorsRequest, options?: TransportRequestOptions): Promise -export default async function MtermvectorsApi (this: That, params?: T.MtermvectorsRequest | TB.MtermvectorsRequest, options?: TransportRequestOptions): Promise { +export default async function MtermvectorsApi (this: That, params?: T.MtermvectorsRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function MtermvectorsApi (this: That, params?: T.MtermvectorsRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function MtermvectorsApi (this: That, params?: T.MtermvectorsRequest, options?: TransportRequestOptions): Promise +export default async function MtermvectorsApi (this: That, params?: T.MtermvectorsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['docs', 'ids'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/nodes.ts b/src/api/api/nodes.ts index 8235710cb..e0d23ab55 100644 --- a/src/api/api/nodes.ts +++ b/src/api/api/nodes.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Nodes { @@ -48,10 +47,10 @@ export default class Nodes { * You can use this API to clear the archived repositories metering information in the cluster. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/clear-repositories-metering-archive-api.html | Elasticsearch API documentation} */ - async clearRepositoriesMeteringArchive (this: That, params: T.NodesClearRepositoriesMeteringArchiveRequest | TB.NodesClearRepositoriesMeteringArchiveRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async clearRepositoriesMeteringArchive (this: That, params: T.NodesClearRepositoriesMeteringArchiveRequest | TB.NodesClearRepositoriesMeteringArchiveRequest, options?: TransportRequestOptionsWithMeta): Promise> - async clearRepositoriesMeteringArchive (this: That, params: T.NodesClearRepositoriesMeteringArchiveRequest | TB.NodesClearRepositoriesMeteringArchiveRequest, options?: TransportRequestOptions): Promise - async clearRepositoriesMeteringArchive (this: That, params: T.NodesClearRepositoriesMeteringArchiveRequest | TB.NodesClearRepositoriesMeteringArchiveRequest, options?: TransportRequestOptions): Promise { + async clearRepositoriesMeteringArchive (this: That, params: T.NodesClearRepositoriesMeteringArchiveRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async clearRepositoriesMeteringArchive (this: That, params: T.NodesClearRepositoriesMeteringArchiveRequest, options?: TransportRequestOptionsWithMeta): Promise> + async clearRepositoriesMeteringArchive (this: That, params: T.NodesClearRepositoriesMeteringArchiveRequest, options?: TransportRequestOptions): Promise + async clearRepositoriesMeteringArchive (this: That, params: T.NodesClearRepositoriesMeteringArchiveRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['node_id', 'max_archive_version'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Nodes { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -81,10 +80,10 @@ export default class Nodes { * You can use the cluster repositories metering API to retrieve repositories metering information in a cluster. This API exposes monotonically non-decreasing counters and it’s expected that clients would durably store the information needed to compute aggregations over a period of time. Additionally, the information exposed by this API is volatile, meaning that it won’t be present after node restarts. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-repositories-metering-api.html | Elasticsearch API documentation} */ - async getRepositoriesMeteringInfo (this: That, params: T.NodesGetRepositoriesMeteringInfoRequest | TB.NodesGetRepositoriesMeteringInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getRepositoriesMeteringInfo (this: That, params: T.NodesGetRepositoriesMeteringInfoRequest | TB.NodesGetRepositoriesMeteringInfoRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getRepositoriesMeteringInfo (this: That, params: T.NodesGetRepositoriesMeteringInfoRequest | TB.NodesGetRepositoriesMeteringInfoRequest, options?: TransportRequestOptions): Promise - async getRepositoriesMeteringInfo (this: That, params: T.NodesGetRepositoriesMeteringInfoRequest | TB.NodesGetRepositoriesMeteringInfoRequest, options?: TransportRequestOptions): Promise { + async getRepositoriesMeteringInfo (this: That, params: T.NodesGetRepositoriesMeteringInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getRepositoriesMeteringInfo (this: That, params: T.NodesGetRepositoriesMeteringInfoRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getRepositoriesMeteringInfo (this: That, params: T.NodesGetRepositoriesMeteringInfoRequest, options?: TransportRequestOptions): Promise + async getRepositoriesMeteringInfo (this: That, params: T.NodesGetRepositoriesMeteringInfoRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['node_id'] const querystring: Record = {} const body = undefined @@ -92,7 +91,7 @@ export default class Nodes { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -113,10 +112,10 @@ export default class Nodes { * This API yields a breakdown of the hot threads on each selected node in the cluster. The output is plain text with a breakdown of each node’s top hot threads. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-nodes-hot-threads.html | Elasticsearch API documentation} */ - async hotThreads (this: That, params?: T.NodesHotThreadsRequest | TB.NodesHotThreadsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async hotThreads (this: That, params?: T.NodesHotThreadsRequest | TB.NodesHotThreadsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async hotThreads (this: That, params?: T.NodesHotThreadsRequest | TB.NodesHotThreadsRequest, options?: TransportRequestOptions): Promise - async hotThreads (this: That, params?: T.NodesHotThreadsRequest | TB.NodesHotThreadsRequest, options?: TransportRequestOptions): Promise { + async hotThreads (this: That, params?: T.NodesHotThreadsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async hotThreads (this: That, params?: T.NodesHotThreadsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async hotThreads (this: That, params?: T.NodesHotThreadsRequest, options?: TransportRequestOptions): Promise + async hotThreads (this: That, params?: T.NodesHotThreadsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['node_id'] const querystring: Record = {} const body = undefined @@ -125,7 +124,7 @@ export default class Nodes { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -153,10 +152,10 @@ export default class Nodes { * Returns cluster nodes information. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-nodes-info.html | Elasticsearch API documentation} */ - async info (this: That, params?: T.NodesInfoRequest | TB.NodesInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async info (this: That, params?: T.NodesInfoRequest | TB.NodesInfoRequest, options?: TransportRequestOptionsWithMeta): Promise> - async info (this: That, params?: T.NodesInfoRequest | TB.NodesInfoRequest, options?: TransportRequestOptions): Promise - async info (this: That, params?: T.NodesInfoRequest | TB.NodesInfoRequest, options?: TransportRequestOptions): Promise { + async info (this: That, params?: T.NodesInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async info (this: That, params?: T.NodesInfoRequest, options?: TransportRequestOptionsWithMeta): Promise> + async info (this: That, params?: T.NodesInfoRequest, options?: TransportRequestOptions): Promise + async info (this: That, params?: T.NodesInfoRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['node_id', 'metric'] const querystring: Record = {} const body = undefined @@ -165,7 +164,7 @@ export default class Nodes { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -200,31 +199,23 @@ export default class Nodes { * Reloads the keystore on nodes in the cluster. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/secure-settings.html#reloadable-secure-settings | Elasticsearch API documentation} */ - async reloadSecureSettings (this: That, params?: T.NodesReloadSecureSettingsRequest | TB.NodesReloadSecureSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async reloadSecureSettings (this: That, params?: T.NodesReloadSecureSettingsRequest | TB.NodesReloadSecureSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async reloadSecureSettings (this: That, params?: T.NodesReloadSecureSettingsRequest | TB.NodesReloadSecureSettingsRequest, options?: TransportRequestOptions): Promise - async reloadSecureSettings (this: That, params?: T.NodesReloadSecureSettingsRequest | TB.NodesReloadSecureSettingsRequest, options?: TransportRequestOptions): Promise { + async reloadSecureSettings (this: That, params?: T.NodesReloadSecureSettingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async reloadSecureSettings (this: That, params?: T.NodesReloadSecureSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async reloadSecureSettings (this: That, params?: T.NodesReloadSecureSettingsRequest, options?: TransportRequestOptions): Promise + async reloadSecureSettings (this: That, params?: T.NodesReloadSecureSettingsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['node_id'] const acceptedBody: string[] = ['secure_settings_password'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -252,10 +243,10 @@ export default class Nodes { * Returns cluster nodes statistics. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-nodes-stats.html | Elasticsearch API documentation} */ - async stats (this: That, params?: T.NodesStatsRequest | TB.NodesStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async stats (this: That, params?: T.NodesStatsRequest | TB.NodesStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async stats (this: That, params?: T.NodesStatsRequest | TB.NodesStatsRequest, options?: TransportRequestOptions): Promise - async stats (this: That, params?: T.NodesStatsRequest | TB.NodesStatsRequest, options?: TransportRequestOptions): Promise { + async stats (this: That, params?: T.NodesStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async stats (this: That, params?: T.NodesStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async stats (this: That, params?: T.NodesStatsRequest, options?: TransportRequestOptions): Promise + async stats (this: That, params?: T.NodesStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['node_id', 'metric', 'index_metric'] const querystring: Record = {} const body = undefined @@ -264,7 +255,7 @@ export default class Nodes { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -306,10 +297,10 @@ export default class Nodes { * Returns information on the usage of features. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-nodes-usage.html | Elasticsearch API documentation} */ - async usage (this: That, params?: T.NodesUsageRequest | TB.NodesUsageRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async usage (this: That, params?: T.NodesUsageRequest | TB.NodesUsageRequest, options?: TransportRequestOptionsWithMeta): Promise> - async usage (this: That, params?: T.NodesUsageRequest | TB.NodesUsageRequest, options?: TransportRequestOptions): Promise - async usage (this: That, params?: T.NodesUsageRequest | TB.NodesUsageRequest, options?: TransportRequestOptions): Promise { + async usage (this: That, params?: T.NodesUsageRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async usage (this: That, params?: T.NodesUsageRequest, options?: TransportRequestOptionsWithMeta): Promise> + async usage (this: That, params?: T.NodesUsageRequest, options?: TransportRequestOptions): Promise + async usage (this: That, params?: T.NodesUsageRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['node_id', 'metric'] const querystring: Record = {} const body = undefined @@ -318,7 +309,7 @@ export default class Nodes { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/open_point_in_time.ts b/src/api/api/open_point_in_time.ts index 3e3c455c6..5491e76a7 100644 --- a/src/api/api/open_point_in_time.ts +++ b/src/api/api/open_point_in_time.ts @@ -35,37 +35,28 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Open a point in time. A search request by default runs against the most recent visible data of the target indices, which is called point in time. Elasticsearch pit (point in time) is a lightweight view into the state of the data as it existed when initiated. In some cases, it’s preferred to perform multiple search requests using the same point in time. For example, if refreshes happen between `search_after` requests, then the results of those requests might not be consistent as changes happening between searches are only visible to the more recent point in time. A point in time must be opened explicitly before being used in search requests. The `keep_alive` parameter tells Elasticsearch how long it should persist. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/point-in-time-api.html | Elasticsearch API documentation} */ -export default async function OpenPointInTimeApi (this: That, params: T.OpenPointInTimeRequest | TB.OpenPointInTimeRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function OpenPointInTimeApi (this: That, params: T.OpenPointInTimeRequest | TB.OpenPointInTimeRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function OpenPointInTimeApi (this: That, params: T.OpenPointInTimeRequest | TB.OpenPointInTimeRequest, options?: TransportRequestOptions): Promise -export default async function OpenPointInTimeApi (this: That, params: T.OpenPointInTimeRequest | TB.OpenPointInTimeRequest, options?: TransportRequestOptions): Promise { +export default async function OpenPointInTimeApi (this: That, params: T.OpenPointInTimeRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function OpenPointInTimeApi (this: That, params: T.OpenPointInTimeRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function OpenPointInTimeApi (this: That, params: T.OpenPointInTimeRequest, options?: TransportRequestOptions): Promise +export default async function OpenPointInTimeApi (this: That, params: T.OpenPointInTimeRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['index_filter'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/ping.ts b/src/api/api/ping.ts index e18fd9222..1d24b1e7a 100644 --- a/src/api/api/ping.ts +++ b/src/api/api/ping.ts @@ -35,17 +35,16 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Ping the cluster. Returns whether the cluster is running. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/index.html | Elasticsearch API documentation} */ -export default async function PingApi (this: That, params?: T.PingRequest | TB.PingRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function PingApi (this: That, params?: T.PingRequest | TB.PingRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function PingApi (this: That, params?: T.PingRequest | TB.PingRequest, options?: TransportRequestOptions): Promise -export default async function PingApi (this: That, params?: T.PingRequest | TB.PingRequest, options?: TransportRequestOptions): Promise { +export default async function PingApi (this: That, params?: T.PingRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function PingApi (this: That, params?: T.PingRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function PingApi (this: That, params?: T.PingRequest, options?: TransportRequestOptions): Promise +export default async function PingApi (this: That, params?: T.PingRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -54,7 +53,7 @@ export default async function PingApi (this: That, params?: T.PingRequest | TB.P for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/profiling.ts b/src/api/api/profiling.ts index 08981b818..5bf9484c5 100644 --- a/src/api/api/profiling.ts +++ b/src/api/api/profiling.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Profiling { @@ -48,10 +47,10 @@ export default class Profiling { * Extracts a UI-optimized structure to render flamegraphs from Universal Profiling. * @see {@link https://www.elastic.co/guide/en/observability/8.17/universal-profiling.html | Elasticsearch API documentation} */ - async flamegraph (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async flamegraph (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async flamegraph (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async flamegraph (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async flamegraph (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async flamegraph (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async flamegraph (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async flamegraph (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -60,7 +59,7 @@ export default class Profiling { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -77,10 +76,10 @@ export default class Profiling { * Extracts raw stacktrace information from Universal Profiling. * @see {@link https://www.elastic.co/guide/en/observability/8.17/universal-profiling.html | Elasticsearch API documentation} */ - async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async stacktraces (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async stacktraces (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async stacktraces (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async stacktraces (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async stacktraces (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -89,7 +88,7 @@ export default class Profiling { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -106,10 +105,10 @@ export default class Profiling { * Returns basic information about the status of Universal Profiling. * @see {@link https://www.elastic.co/guide/en/observability/8.17/universal-profiling.html | Elasticsearch API documentation} */ - async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async status (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + 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 { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -118,7 +117,7 @@ export default class Profiling { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -135,10 +134,10 @@ export default class Profiling { * Extracts a list of topN functions from Universal Profiling. * @see {@link https://www.elastic.co/guide/en/observability/8.17/universal-profiling.html | Elasticsearch API documentation} */ - async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async topnFunctions (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async topnFunctions (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async topnFunctions (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async topnFunctions (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async topnFunctions (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -147,7 +146,7 @@ export default class Profiling { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } diff --git a/src/api/api/put_script.ts b/src/api/api/put_script.ts index b5a806c41..ab9b3fd13 100644 --- a/src/api/api/put_script.ts +++ b/src/api/api/put_script.ts @@ -35,37 +35,28 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Create or update a script or search template. Creates or updates a stored script or search template. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-scripting.html | Elasticsearch API documentation} */ -export default async function PutScriptApi (this: That, params: T.PutScriptRequest | TB.PutScriptRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function PutScriptApi (this: That, params: T.PutScriptRequest | TB.PutScriptRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function PutScriptApi (this: That, params: T.PutScriptRequest | TB.PutScriptRequest, options?: TransportRequestOptions): Promise -export default async function PutScriptApi (this: That, params: T.PutScriptRequest | TB.PutScriptRequest, options?: TransportRequestOptions): Promise { +export default async function PutScriptApi (this: That, params: T.PutScriptRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function PutScriptApi (this: That, params: T.PutScriptRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function PutScriptApi (this: That, params: T.PutScriptRequest, options?: TransportRequestOptions): Promise +export default async function PutScriptApi (this: That, params: T.PutScriptRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id', 'context'] const acceptedBody: string[] = ['script'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/query_rules.ts b/src/api/api/query_rules.ts index 2168ae319..e53959758 100644 --- a/src/api/api/query_rules.ts +++ b/src/api/api/query_rules.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class QueryRules { @@ -45,13 +44,13 @@ export default class QueryRules { } /** - * Deletes a query rule within a query ruleset. + * Delete a query rule. Delete a query rule within a query ruleset. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-query-rule.html | Elasticsearch API documentation} */ - async deleteRule (this: That, params: T.QueryRulesDeleteRuleRequest | TB.QueryRulesDeleteRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteRule (this: That, params: T.QueryRulesDeleteRuleRequest | TB.QueryRulesDeleteRuleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteRule (this: That, params: T.QueryRulesDeleteRuleRequest | TB.QueryRulesDeleteRuleRequest, options?: TransportRequestOptions): Promise - async deleteRule (this: That, params: T.QueryRulesDeleteRuleRequest | TB.QueryRulesDeleteRuleRequest, options?: TransportRequestOptions): Promise { + async deleteRule (this: That, params: T.QueryRulesDeleteRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteRule (this: That, params: T.QueryRulesDeleteRuleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteRule (this: That, params: T.QueryRulesDeleteRuleRequest, options?: TransportRequestOptions): Promise + async deleteRule (this: That, params: T.QueryRulesDeleteRuleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['ruleset_id', 'rule_id'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class QueryRules { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -78,13 +77,13 @@ export default class QueryRules { } /** - * Deletes a query ruleset. + * Delete a query ruleset. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-query-ruleset.html | Elasticsearch API documentation} */ - async deleteRuleset (this: That, params: T.QueryRulesDeleteRulesetRequest | TB.QueryRulesDeleteRulesetRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteRuleset (this: That, params: T.QueryRulesDeleteRulesetRequest | TB.QueryRulesDeleteRulesetRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteRuleset (this: That, params: T.QueryRulesDeleteRulesetRequest | TB.QueryRulesDeleteRulesetRequest, options?: TransportRequestOptions): Promise - async deleteRuleset (this: That, params: T.QueryRulesDeleteRulesetRequest | TB.QueryRulesDeleteRulesetRequest, options?: TransportRequestOptions): Promise { + async deleteRuleset (this: That, params: T.QueryRulesDeleteRulesetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteRuleset (this: That, params: T.QueryRulesDeleteRulesetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteRuleset (this: That, params: T.QueryRulesDeleteRulesetRequest, options?: TransportRequestOptions): Promise + async deleteRuleset (this: That, params: T.QueryRulesDeleteRulesetRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['ruleset_id'] const querystring: Record = {} const body = undefined @@ -92,7 +91,7 @@ export default class QueryRules { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -110,13 +109,13 @@ export default class QueryRules { } /** - * Returns the details about a query rule within a query ruleset + * Get a query rule. Get details about a query rule within a query ruleset. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-query-rule.html | Elasticsearch API documentation} */ - async getRule (this: That, params: T.QueryRulesGetRuleRequest | TB.QueryRulesGetRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getRule (this: That, params: T.QueryRulesGetRuleRequest | TB.QueryRulesGetRuleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getRule (this: That, params: T.QueryRulesGetRuleRequest | TB.QueryRulesGetRuleRequest, options?: TransportRequestOptions): Promise - async getRule (this: That, params: T.QueryRulesGetRuleRequest | TB.QueryRulesGetRuleRequest, options?: TransportRequestOptions): Promise { + async getRule (this: That, params: T.QueryRulesGetRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getRule (this: That, params: T.QueryRulesGetRuleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getRule (this: That, params: T.QueryRulesGetRuleRequest, options?: TransportRequestOptions): Promise + async getRule (this: That, params: T.QueryRulesGetRuleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['ruleset_id', 'rule_id'] const querystring: Record = {} const body = undefined @@ -124,7 +123,7 @@ export default class QueryRules { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -143,13 +142,13 @@ export default class QueryRules { } /** - * Returns the details about a query ruleset + * Get a query ruleset. Get details about a query ruleset. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-query-ruleset.html | Elasticsearch API documentation} */ - async getRuleset (this: That, params: T.QueryRulesGetRulesetRequest | TB.QueryRulesGetRulesetRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getRuleset (this: That, params: T.QueryRulesGetRulesetRequest | TB.QueryRulesGetRulesetRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getRuleset (this: That, params: T.QueryRulesGetRulesetRequest | TB.QueryRulesGetRulesetRequest, options?: TransportRequestOptions): Promise - async getRuleset (this: That, params: T.QueryRulesGetRulesetRequest | TB.QueryRulesGetRulesetRequest, options?: TransportRequestOptions): Promise { + async getRuleset (this: That, params: T.QueryRulesGetRulesetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getRuleset (this: That, params: T.QueryRulesGetRulesetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getRuleset (this: That, params: T.QueryRulesGetRulesetRequest, options?: TransportRequestOptions): Promise + async getRuleset (this: That, params: T.QueryRulesGetRulesetRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['ruleset_id'] const querystring: Record = {} const body = undefined @@ -157,7 +156,7 @@ export default class QueryRules { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -175,13 +174,13 @@ export default class QueryRules { } /** - * Returns summarized information about existing query rulesets. + * Get all query rulesets. Get summarized information about the query rulesets. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/list-query-rulesets.html | Elasticsearch API documentation} */ - async listRulesets (this: That, params?: T.QueryRulesListRulesetsRequest | TB.QueryRulesListRulesetsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async listRulesets (this: That, params?: T.QueryRulesListRulesetsRequest | TB.QueryRulesListRulesetsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async listRulesets (this: That, params?: T.QueryRulesListRulesetsRequest | TB.QueryRulesListRulesetsRequest, options?: TransportRequestOptions): Promise - async listRulesets (this: That, params?: T.QueryRulesListRulesetsRequest | TB.QueryRulesListRulesetsRequest, options?: TransportRequestOptions): Promise { + async listRulesets (this: That, params?: T.QueryRulesListRulesetsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async listRulesets (this: That, params?: T.QueryRulesListRulesetsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async listRulesets (this: That, params?: T.QueryRulesListRulesetsRequest, options?: TransportRequestOptions): Promise + async listRulesets (this: That, params?: T.QueryRulesListRulesetsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -190,7 +189,7 @@ export default class QueryRules { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -205,33 +204,25 @@ export default class QueryRules { } /** - * Creates or updates a query rule within a query ruleset. + * Create or update a query rule. Create or update a query rule within a query ruleset. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-query-rule.html | Elasticsearch API documentation} */ - async putRule (this: That, params: T.QueryRulesPutRuleRequest | TB.QueryRulesPutRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putRule (this: That, params: T.QueryRulesPutRuleRequest | TB.QueryRulesPutRuleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putRule (this: That, params: T.QueryRulesPutRuleRequest | TB.QueryRulesPutRuleRequest, options?: TransportRequestOptions): Promise - async putRule (this: That, params: T.QueryRulesPutRuleRequest | TB.QueryRulesPutRuleRequest, options?: TransportRequestOptions): Promise { + async putRule (this: That, params: T.QueryRulesPutRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putRule (this: That, params: T.QueryRulesPutRuleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putRule (this: That, params: T.QueryRulesPutRuleRequest, options?: TransportRequestOptions): Promise + async putRule (this: That, params: T.QueryRulesPutRuleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['ruleset_id', 'rule_id'] const acceptedBody: string[] = ['type', 'criteria', 'actions', 'priority'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -250,33 +241,25 @@ export default class QueryRules { } /** - * Creates or updates a query ruleset. + * Create or update a query ruleset. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-query-ruleset.html | Elasticsearch API documentation} */ - async putRuleset (this: That, params: T.QueryRulesPutRulesetRequest | TB.QueryRulesPutRulesetRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putRuleset (this: That, params: T.QueryRulesPutRulesetRequest | TB.QueryRulesPutRulesetRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putRuleset (this: That, params: T.QueryRulesPutRulesetRequest | TB.QueryRulesPutRulesetRequest, options?: TransportRequestOptions): Promise - async putRuleset (this: That, params: T.QueryRulesPutRulesetRequest | TB.QueryRulesPutRulesetRequest, options?: TransportRequestOptions): Promise { + async putRuleset (this: That, params: T.QueryRulesPutRulesetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putRuleset (this: That, params: T.QueryRulesPutRulesetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putRuleset (this: That, params: T.QueryRulesPutRulesetRequest, options?: TransportRequestOptions): Promise + async putRuleset (this: That, params: T.QueryRulesPutRulesetRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['ruleset_id'] const acceptedBody: string[] = ['rules'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -294,33 +277,25 @@ export default class QueryRules { } /** - * Creates or updates a query ruleset. + * Test a query ruleset. Evaluate match criteria against a query ruleset to identify the rules that would match that criteria. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/test-query-ruleset.html | Elasticsearch API documentation} */ - async test (this: That, params: T.QueryRulesTestRequest | TB.QueryRulesTestRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async test (this: That, params: T.QueryRulesTestRequest | TB.QueryRulesTestRequest, options?: TransportRequestOptionsWithMeta): Promise> - async test (this: That, params: T.QueryRulesTestRequest | TB.QueryRulesTestRequest, options?: TransportRequestOptions): Promise - async test (this: That, params: T.QueryRulesTestRequest | TB.QueryRulesTestRequest, options?: TransportRequestOptions): Promise { + async test (this: That, params: T.QueryRulesTestRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async test (this: That, params: T.QueryRulesTestRequest, options?: TransportRequestOptionsWithMeta): Promise> + async test (this: That, params: T.QueryRulesTestRequest, options?: TransportRequestOptions): Promise + async test (this: That, params: T.QueryRulesTestRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['ruleset_id'] const acceptedBody: string[] = ['match_criteria'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/rank_eval.ts b/src/api/api/rank_eval.ts index cb51870dc..6108668ac 100644 --- a/src/api/api/rank_eval.ts +++ b/src/api/api/rank_eval.ts @@ -35,37 +35,28 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Evaluate ranked search results. Evaluate the quality of ranked search results over a set of typical search queries. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-rank-eval.html | Elasticsearch API documentation} */ -export default async function RankEvalApi (this: That, params: T.RankEvalRequest | TB.RankEvalRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function RankEvalApi (this: That, params: T.RankEvalRequest | TB.RankEvalRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function RankEvalApi (this: That, params: T.RankEvalRequest | TB.RankEvalRequest, options?: TransportRequestOptions): Promise -export default async function RankEvalApi (this: That, params: T.RankEvalRequest | TB.RankEvalRequest, options?: TransportRequestOptions): Promise { +export default async function RankEvalApi (this: That, params: T.RankEvalRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function RankEvalApi (this: That, params: T.RankEvalRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function RankEvalApi (this: That, params: T.RankEvalRequest, options?: TransportRequestOptions): Promise +export default async function RankEvalApi (this: That, params: T.RankEvalRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['requests', 'metric'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/reindex.ts b/src/api/api/reindex.ts index e3d23d8a5..c86e4543c 100644 --- a/src/api/api/reindex.ts +++ b/src/api/api/reindex.ts @@ -35,37 +35,28 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Reindex documents. Copies documents from a source to a destination. The source can be any existing index, alias, or data stream. The destination must differ from the source. For example, you cannot reindex a data stream into itself. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-reindex.html | Elasticsearch API documentation} */ -export default async function ReindexApi (this: That, params: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function ReindexApi (this: That, params: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function ReindexApi (this: That, params: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptions): Promise -export default async function ReindexApi (this: That, params: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptions): Promise { +export default async function ReindexApi (this: That, params: T.ReindexRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function ReindexApi (this: That, params: T.ReindexRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function ReindexApi (this: That, params: T.ReindexRequest, options?: TransportRequestOptions): Promise +export default async function ReindexApi (this: That, params: T.ReindexRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['conflicts', 'dest', 'max_docs', 'script', 'size', 'source'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/reindex_rethrottle.ts b/src/api/api/reindex_rethrottle.ts index 331555822..b415e9716 100644 --- a/src/api/api/reindex_rethrottle.ts +++ b/src/api/api/reindex_rethrottle.ts @@ -35,17 +35,16 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Throttle a reindex operation. Change the number of requests per second for a particular reindex operation. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-reindex.html | Elasticsearch API documentation} */ -export default async function ReindexRethrottleApi (this: That, params: T.ReindexRethrottleRequest | TB.ReindexRethrottleRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function ReindexRethrottleApi (this: That, params: T.ReindexRethrottleRequest | TB.ReindexRethrottleRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function ReindexRethrottleApi (this: That, params: T.ReindexRethrottleRequest | TB.ReindexRethrottleRequest, options?: TransportRequestOptions): Promise -export default async function ReindexRethrottleApi (this: That, params: T.ReindexRethrottleRequest | TB.ReindexRethrottleRequest, options?: TransportRequestOptions): Promise { +export default async function ReindexRethrottleApi (this: That, params: T.ReindexRethrottleRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function ReindexRethrottleApi (this: That, params: T.ReindexRethrottleRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function ReindexRethrottleApi (this: That, params: T.ReindexRethrottleRequest, options?: TransportRequestOptions): Promise +export default async function ReindexRethrottleApi (this: That, params: T.ReindexRethrottleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['task_id'] const querystring: Record = {} const body = undefined @@ -53,7 +52,7 @@ export default async function ReindexRethrottleApi (this: That, params: T.Reinde for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/render_search_template.ts b/src/api/api/render_search_template.ts index a61253b76..824ade745 100644 --- a/src/api/api/render_search_template.ts +++ b/src/api/api/render_search_template.ts @@ -35,38 +35,29 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Render a search template. Render a search template as a search request body. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/render-search-template-api.html | Elasticsearch API documentation} */ -export default async function RenderSearchTemplateApi (this: That, params?: T.RenderSearchTemplateRequest | TB.RenderSearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function RenderSearchTemplateApi (this: That, params?: T.RenderSearchTemplateRequest | TB.RenderSearchTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function RenderSearchTemplateApi (this: That, params?: T.RenderSearchTemplateRequest | TB.RenderSearchTemplateRequest, options?: TransportRequestOptions): Promise -export default async function RenderSearchTemplateApi (this: That, params?: T.RenderSearchTemplateRequest | TB.RenderSearchTemplateRequest, options?: TransportRequestOptions): Promise { +export default async function RenderSearchTemplateApi (this: That, params?: T.RenderSearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function RenderSearchTemplateApi (this: That, params?: T.RenderSearchTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function RenderSearchTemplateApi (this: That, params?: T.RenderSearchTemplateRequest, options?: TransportRequestOptions): Promise +export default async function RenderSearchTemplateApi (this: That, params?: T.RenderSearchTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const acceptedBody: string[] = ['file', 'params', 'source'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/rollup.ts b/src/api/api/rollup.ts index f615d0645..c3527eb03 100644 --- a/src/api/api/rollup.ts +++ b/src/api/api/rollup.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Rollup { @@ -48,10 +47,10 @@ export default class Rollup { * Deletes an existing rollup job. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/rollup-delete-job.html | Elasticsearch API documentation} */ - async deleteJob (this: That, params: T.RollupDeleteJobRequest | TB.RollupDeleteJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteJob (this: That, params: T.RollupDeleteJobRequest | TB.RollupDeleteJobRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteJob (this: That, params: T.RollupDeleteJobRequest | TB.RollupDeleteJobRequest, options?: TransportRequestOptions): Promise - async deleteJob (this: That, params: T.RollupDeleteJobRequest | TB.RollupDeleteJobRequest, options?: TransportRequestOptions): Promise { + async deleteJob (this: That, params: T.RollupDeleteJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteJob (this: That, params: T.RollupDeleteJobRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteJob (this: That, params: T.RollupDeleteJobRequest, options?: TransportRequestOptions): Promise + async deleteJob (this: That, params: T.RollupDeleteJobRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Rollup { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -80,10 +79,10 @@ export default class Rollup { * Retrieves the configuration, stats, and status of rollup jobs. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/rollup-get-job.html | Elasticsearch API documentation} */ - async getJobs (this: That, params?: T.RollupGetJobsRequest | TB.RollupGetJobsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getJobs (this: That, params?: T.RollupGetJobsRequest | TB.RollupGetJobsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getJobs (this: That, params?: T.RollupGetJobsRequest | TB.RollupGetJobsRequest, options?: TransportRequestOptions): Promise - async getJobs (this: That, params?: T.RollupGetJobsRequest | TB.RollupGetJobsRequest, options?: TransportRequestOptions): Promise { + async getJobs (this: That, params?: T.RollupGetJobsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getJobs (this: That, params?: T.RollupGetJobsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getJobs (this: That, params?: T.RollupGetJobsRequest, options?: TransportRequestOptions): Promise + async getJobs (this: That, params?: T.RollupGetJobsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -92,7 +91,7 @@ export default class Rollup { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -120,10 +119,10 @@ export default class Rollup { * Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/rollup-get-rollup-caps.html | Elasticsearch API documentation} */ - async getRollupCaps (this: That, params?: T.RollupGetRollupCapsRequest | TB.RollupGetRollupCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getRollupCaps (this: That, params?: T.RollupGetRollupCapsRequest | TB.RollupGetRollupCapsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getRollupCaps (this: That, params?: T.RollupGetRollupCapsRequest | TB.RollupGetRollupCapsRequest, options?: TransportRequestOptions): Promise - async getRollupCaps (this: That, params?: T.RollupGetRollupCapsRequest | TB.RollupGetRollupCapsRequest, options?: TransportRequestOptions): Promise { + async getRollupCaps (this: That, params?: T.RollupGetRollupCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getRollupCaps (this: That, params?: T.RollupGetRollupCapsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getRollupCaps (this: That, params?: T.RollupGetRollupCapsRequest, options?: TransportRequestOptions): Promise + async getRollupCaps (this: That, params?: T.RollupGetRollupCapsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -132,7 +131,7 @@ export default class Rollup { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -160,10 +159,10 @@ export default class Rollup { * Returns the rollup capabilities of all jobs inside of a rollup index (for example, the index where rollup data is stored). * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/rollup-get-rollup-index-caps.html | Elasticsearch API documentation} */ - async getRollupIndexCaps (this: That, params: T.RollupGetRollupIndexCapsRequest | TB.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getRollupIndexCaps (this: That, params: T.RollupGetRollupIndexCapsRequest | TB.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getRollupIndexCaps (this: That, params: T.RollupGetRollupIndexCapsRequest | TB.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptions): Promise - async getRollupIndexCaps (this: That, params: T.RollupGetRollupIndexCapsRequest | TB.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptions): Promise { + async getRollupIndexCaps (this: That, params: T.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getRollupIndexCaps (this: That, params: T.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getRollupIndexCaps (this: That, params: T.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptions): Promise + async getRollupIndexCaps (this: That, params: T.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -171,7 +170,7 @@ export default class Rollup { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -192,30 +191,22 @@ export default class Rollup { * Creates a rollup job. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/rollup-put-job.html | Elasticsearch API documentation} */ - async putJob (this: That, params: T.RollupPutJobRequest | TB.RollupPutJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putJob (this: That, params: T.RollupPutJobRequest | TB.RollupPutJobRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putJob (this: That, params: T.RollupPutJobRequest | TB.RollupPutJobRequest, options?: TransportRequestOptions): Promise - async putJob (this: That, params: T.RollupPutJobRequest | TB.RollupPutJobRequest, options?: TransportRequestOptions): Promise { + async putJob (this: That, params: T.RollupPutJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putJob (this: That, params: T.RollupPutJobRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putJob (this: That, params: T.RollupPutJobRequest, options?: TransportRequestOptions): Promise + async putJob (this: That, params: T.RollupPutJobRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const acceptedBody: string[] = ['cron', 'groups', 'index_pattern', 'metrics', 'page_size', 'rollup_index', 'timeout', 'headers'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -236,30 +227,22 @@ export default class Rollup { * Enables searching rolled-up data using the standard Query DSL. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/rollup-search.html | Elasticsearch API documentation} */ - async rollupSearch> (this: That, params: T.RollupRollupSearchRequest | TB.RollupRollupSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> - async rollupSearch> (this: That, params: T.RollupRollupSearchRequest | TB.RollupRollupSearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> - async rollupSearch> (this: That, params: T.RollupRollupSearchRequest | TB.RollupRollupSearchRequest, options?: TransportRequestOptions): Promise> - async rollupSearch> (this: That, params: T.RollupRollupSearchRequest | TB.RollupRollupSearchRequest, options?: TransportRequestOptions): Promise { + async rollupSearch> (this: That, params: T.RollupRollupSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> + async rollupSearch> (this: That, params: T.RollupRollupSearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> + async rollupSearch> (this: That, params: T.RollupRollupSearchRequest, options?: TransportRequestOptions): Promise> + async rollupSearch> (this: That, params: T.RollupRollupSearchRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['aggregations', 'aggs', 'query', 'size'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -280,10 +263,10 @@ export default class Rollup { * Starts an existing, stopped rollup job. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/rollup-start-job.html | Elasticsearch API documentation} */ - async startJob (this: That, params: T.RollupStartJobRequest | TB.RollupStartJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async startJob (this: That, params: T.RollupStartJobRequest | TB.RollupStartJobRequest, options?: TransportRequestOptionsWithMeta): Promise> - async startJob (this: That, params: T.RollupStartJobRequest | TB.RollupStartJobRequest, options?: TransportRequestOptions): Promise - async startJob (this: That, params: T.RollupStartJobRequest | TB.RollupStartJobRequest, options?: TransportRequestOptions): Promise { + async startJob (this: That, params: T.RollupStartJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async startJob (this: That, params: T.RollupStartJobRequest, options?: TransportRequestOptionsWithMeta): Promise> + async startJob (this: That, params: T.RollupStartJobRequest, options?: TransportRequestOptions): Promise + async startJob (this: That, params: T.RollupStartJobRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -291,7 +274,7 @@ export default class Rollup { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -312,10 +295,10 @@ export default class Rollup { * Stops an existing, started rollup job. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/rollup-stop-job.html | Elasticsearch API documentation} */ - async stopJob (this: That, params: T.RollupStopJobRequest | TB.RollupStopJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async stopJob (this: That, params: T.RollupStopJobRequest | TB.RollupStopJobRequest, options?: TransportRequestOptionsWithMeta): Promise> - async stopJob (this: That, params: T.RollupStopJobRequest | TB.RollupStopJobRequest, options?: TransportRequestOptions): Promise - async stopJob (this: That, params: T.RollupStopJobRequest | TB.RollupStopJobRequest, options?: TransportRequestOptions): Promise { + async stopJob (this: That, params: T.RollupStopJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async stopJob (this: That, params: T.RollupStopJobRequest, options?: TransportRequestOptionsWithMeta): Promise> + async stopJob (this: That, params: T.RollupStopJobRequest, options?: TransportRequestOptions): Promise + async stopJob (this: That, params: T.RollupStopJobRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -323,7 +306,7 @@ export default class Rollup { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/scripts_painless_execute.ts b/src/api/api/scripts_painless_execute.ts index b04544129..d300e0918 100644 --- a/src/api/api/scripts_painless_execute.ts +++ b/src/api/api/scripts_painless_execute.ts @@ -35,38 +35,29 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Run a script. Runs a script and returns a result. * @see {@link https://www.elastic.co/guide/en/elasticsearch/painless/8.17/painless-execute-api.html | Elasticsearch API documentation} */ -export default async function ScriptsPainlessExecuteApi (this: That, params?: T.ScriptsPainlessExecuteRequest | TB.ScriptsPainlessExecuteRequest, options?: TransportRequestOptionsWithOutMeta): Promise> -export default async function ScriptsPainlessExecuteApi (this: That, params?: T.ScriptsPainlessExecuteRequest | TB.ScriptsPainlessExecuteRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> -export default async function ScriptsPainlessExecuteApi (this: That, params?: T.ScriptsPainlessExecuteRequest | TB.ScriptsPainlessExecuteRequest, options?: TransportRequestOptions): Promise> -export default async function ScriptsPainlessExecuteApi (this: That, params?: T.ScriptsPainlessExecuteRequest | TB.ScriptsPainlessExecuteRequest, options?: TransportRequestOptions): Promise { +export default async function ScriptsPainlessExecuteApi (this: That, params?: T.ScriptsPainlessExecuteRequest, options?: TransportRequestOptionsWithOutMeta): Promise> +export default async function ScriptsPainlessExecuteApi (this: That, params?: T.ScriptsPainlessExecuteRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> +export default async function ScriptsPainlessExecuteApi (this: That, params?: T.ScriptsPainlessExecuteRequest, options?: TransportRequestOptions): Promise> +export default async function ScriptsPainlessExecuteApi (this: That, params?: T.ScriptsPainlessExecuteRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['context', 'context_setup', 'script'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/scroll.ts b/src/api/api/scroll.ts index be6160335..6cd93d14b 100644 --- a/src/api/api/scroll.ts +++ b/src/api/api/scroll.ts @@ -35,37 +35,28 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Run a scrolling search. IMPORTANT: The scroll API is no longer recommend for deep pagination. If you need to preserve the index state while paging through more than 10,000 hits, use the `search_after` parameter with a point in time (PIT). The scroll API gets large sets of results from a single scrolling search request. To get the necessary scroll ID, submit a search API request that includes an argument for the `scroll` query parameter. The `scroll` parameter indicates how long Elasticsearch should retain the search context for the request. The search response returns a scroll ID in the `_scroll_id` response body parameter. You can then use the scroll ID with the scroll API to retrieve the next batch of results for the request. If the Elasticsearch security features are enabled, the access to the results of a specific scroll ID is restricted to the user or API key that submitted the search. You can also use the scroll API to specify a new scroll parameter that extends or shortens the retention period for the search context. IMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-request-body.html#request-body-search-scroll | Elasticsearch API documentation} */ -export default async function ScrollApi> (this: That, params: T.ScrollRequest | TB.ScrollRequest, options?: TransportRequestOptionsWithOutMeta): Promise> -export default async function ScrollApi> (this: That, params: T.ScrollRequest | TB.ScrollRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> -export default async function ScrollApi> (this: That, params: T.ScrollRequest | TB.ScrollRequest, options?: TransportRequestOptions): Promise> -export default async function ScrollApi> (this: That, params: T.ScrollRequest | TB.ScrollRequest, options?: TransportRequestOptions): Promise { +export default async function ScrollApi> (this: That, params: T.ScrollRequest, options?: TransportRequestOptionsWithOutMeta): Promise> +export default async function ScrollApi> (this: That, params: T.ScrollRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> +export default async function ScrollApi> (this: That, params: T.ScrollRequest, options?: TransportRequestOptions): Promise> +export default async function ScrollApi> (this: That, params: T.ScrollRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['scroll', 'scroll_id'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/search.ts b/src/api/api/search.ts index 3ded4f7ee..88dfbdba1 100644 --- a/src/api/api/search.ts +++ b/src/api/api/search.ts @@ -35,36 +35,25 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Run a search. Get search hits that match the query defined in the request. You can provide search queries using the `q` query string parameter or the request body. If both are specified, only the query parameter is used. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-search.html | Elasticsearch API documentation} */ -export default async function SearchApi> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> -export default async function SearchApi> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> -export default async function SearchApi> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptions): Promise> -export default async function SearchApi> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptions): Promise { +export default async function SearchApi> (this: That, params?: T.SearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> +export default async function SearchApi> (this: That, params?: T.SearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> +export default async function SearchApi> (this: That, params?: T.SearchRequest, options?: TransportRequestOptions): Promise> +export default async function SearchApi> (this: That, params?: T.SearchRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['aggregations', 'aggs', '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'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} - // @ts-expect-error if (key === 'sort' && typeof params[key] === 'string' && params[key].includes(':')) { // eslint-disable-line - // @ts-expect-error querystring[key] = params[key] } else { // @ts-expect-error @@ -72,7 +61,7 @@ export default async function SearchApi - async delete (this: That, params: T.SearchApplicationDeleteRequest | TB.SearchApplicationDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> - async delete (this: That, params: T.SearchApplicationDeleteRequest | TB.SearchApplicationDeleteRequest, options?: TransportRequestOptions): Promise - async delete (this: That, params: T.SearchApplicationDeleteRequest | TB.SearchApplicationDeleteRequest, options?: TransportRequestOptions): Promise { + async delete (this: That, params: T.SearchApplicationDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async delete (this: That, params: T.SearchApplicationDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> + async delete (this: That, params: T.SearchApplicationDeleteRequest, options?: TransportRequestOptions): Promise + async delete (this: That, params: T.SearchApplicationDeleteRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class SearchApplication { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -80,10 +79,10 @@ export default class SearchApplication { * Delete a behavioral analytics collection. The associated data stream is also deleted. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-analytics-collection.html | Elasticsearch API documentation} */ - async deleteBehavioralAnalytics (this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest | TB.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteBehavioralAnalytics (this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest | TB.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteBehavioralAnalytics (this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest | TB.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise - async deleteBehavioralAnalytics (this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest | TB.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise { + async deleteBehavioralAnalytics (this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteBehavioralAnalytics (this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteBehavioralAnalytics (this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise + async deleteBehavioralAnalytics (this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -91,7 +90,7 @@ export default class SearchApplication { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -112,10 +111,10 @@ export default class SearchApplication { * Get search application details. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-search-application.html | Elasticsearch API documentation} */ - async get (this: That, params: T.SearchApplicationGetRequest | TB.SearchApplicationGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async get (this: That, params: T.SearchApplicationGetRequest | TB.SearchApplicationGetRequest, options?: TransportRequestOptionsWithMeta): Promise> - async get (this: That, params: T.SearchApplicationGetRequest | TB.SearchApplicationGetRequest, options?: TransportRequestOptions): Promise - async get (this: That, params: T.SearchApplicationGetRequest | TB.SearchApplicationGetRequest, options?: TransportRequestOptions): Promise { + async get (this: That, params: T.SearchApplicationGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async get (this: That, params: T.SearchApplicationGetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async get (this: That, params: T.SearchApplicationGetRequest, options?: TransportRequestOptions): Promise + async get (this: That, params: T.SearchApplicationGetRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -123,7 +122,7 @@ export default class SearchApplication { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -144,10 +143,10 @@ export default class SearchApplication { * Get behavioral analytics collections. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/list-analytics-collection.html | Elasticsearch API documentation} */ - async getBehavioralAnalytics (this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest | TB.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getBehavioralAnalytics (this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest | TB.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getBehavioralAnalytics (this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest | TB.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise - async getBehavioralAnalytics (this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest | TB.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise { + async getBehavioralAnalytics (this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getBehavioralAnalytics (this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getBehavioralAnalytics (this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise + async getBehavioralAnalytics (this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -156,7 +155,7 @@ export default class SearchApplication { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -184,10 +183,10 @@ export default class SearchApplication { * Returns the existing search applications. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/list-search-applications.html | Elasticsearch API documentation} */ - async list (this: That, params?: T.SearchApplicationListRequest | TB.SearchApplicationListRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async list (this: That, params?: T.SearchApplicationListRequest | TB.SearchApplicationListRequest, options?: TransportRequestOptionsWithMeta): Promise> - async list (this: That, params?: T.SearchApplicationListRequest | TB.SearchApplicationListRequest, options?: TransportRequestOptions): Promise - async list (this: That, params?: T.SearchApplicationListRequest | TB.SearchApplicationListRequest, options?: TransportRequestOptions): Promise { + async list (this: That, params?: T.SearchApplicationListRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async list (this: That, params?: T.SearchApplicationListRequest, options?: TransportRequestOptionsWithMeta): Promise> + async list (this: That, params?: T.SearchApplicationListRequest, options?: TransportRequestOptions): Promise + async list (this: That, params?: T.SearchApplicationListRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -196,7 +195,7 @@ export default class SearchApplication { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -214,10 +213,10 @@ export default class SearchApplication { * Creates a behavioral analytics event for existing collection. * @see {@link http://todo.com/tbd | Elasticsearch API documentation} */ - async postBehavioralAnalyticsEvent (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async postBehavioralAnalyticsEvent (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async postBehavioralAnalyticsEvent (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async postBehavioralAnalyticsEvent (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async postBehavioralAnalyticsEvent (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async postBehavioralAnalyticsEvent (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async postBehavioralAnalyticsEvent (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async postBehavioralAnalyticsEvent (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['collection_name', 'event_type'] const querystring: Record = {} const body = undefined @@ -226,7 +225,7 @@ export default class SearchApplication { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -247,15 +246,14 @@ export default class SearchApplication { * Create or update a search application. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-search-application.html | Elasticsearch API documentation} */ - async put (this: That, params: T.SearchApplicationPutRequest | TB.SearchApplicationPutRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async put (this: That, params: T.SearchApplicationPutRequest | TB.SearchApplicationPutRequest, options?: TransportRequestOptionsWithMeta): Promise> - async put (this: That, params: T.SearchApplicationPutRequest | TB.SearchApplicationPutRequest, options?: TransportRequestOptions): Promise - async put (this: That, params: T.SearchApplicationPutRequest | TB.SearchApplicationPutRequest, options?: TransportRequestOptions): Promise { + async put (this: That, params: T.SearchApplicationPutRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async put (this: That, params: T.SearchApplicationPutRequest, options?: TransportRequestOptionsWithMeta): Promise> + async put (this: That, params: T.SearchApplicationPutRequest, options?: TransportRequestOptions): Promise + async put (this: That, params: T.SearchApplicationPutRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const acceptedBody: string[] = ['search_application'] const querystring: Record = {} - // @ts-expect-error - let body: any = params.body ?? undefined + let body: any for (const key in params) { if (acceptedBody.includes(key)) { @@ -263,7 +261,7 @@ export default class SearchApplication { body = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -284,10 +282,10 @@ export default class SearchApplication { * Create a behavioral analytics collection. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-analytics-collection.html | Elasticsearch API documentation} */ - async putBehavioralAnalytics (this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest | TB.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putBehavioralAnalytics (this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest | TB.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putBehavioralAnalytics (this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest | TB.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise - async putBehavioralAnalytics (this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest | TB.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise { + async putBehavioralAnalytics (this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putBehavioralAnalytics (this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putBehavioralAnalytics (this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise + async putBehavioralAnalytics (this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -295,7 +293,7 @@ export default class SearchApplication { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -316,10 +314,10 @@ export default class SearchApplication { * Renders a query for given search application search parameters * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-application-render-query.html | Elasticsearch API documentation} */ - async renderQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async renderQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async renderQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async renderQuery (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async renderQuery (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async renderQuery (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async renderQuery (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async renderQuery (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -328,7 +326,7 @@ export default class SearchApplication { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -348,30 +346,22 @@ export default class SearchApplication { * Run a search application search. Generate and run an Elasticsearch query that uses the specified query parameteter and the search template associated with the search application or default template. Unspecified template parameters are assigned their default values if applicable. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-application-search.html | Elasticsearch API documentation} */ - async search> (this: That, params: T.SearchApplicationSearchRequest | TB.SearchApplicationSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> - async search> (this: That, params: T.SearchApplicationSearchRequest | TB.SearchApplicationSearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> - async search> (this: That, params: T.SearchApplicationSearchRequest | TB.SearchApplicationSearchRequest, options?: TransportRequestOptions): Promise> - async search> (this: That, params: T.SearchApplicationSearchRequest | TB.SearchApplicationSearchRequest, options?: TransportRequestOptions): Promise { + async search> (this: That, params: T.SearchApplicationSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise> + async search> (this: That, params: T.SearchApplicationSearchRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> + async search> (this: That, params: T.SearchApplicationSearchRequest, options?: TransportRequestOptions): Promise> + async search> (this: That, params: T.SearchApplicationSearchRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const acceptedBody: string[] = ['params'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/search_mvt.ts b/src/api/api/search_mvt.ts index 71eafa5b0..a96185eb3 100644 --- a/src/api/api/search_mvt.ts +++ b/src/api/api/search_mvt.ts @@ -35,37 +35,28 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Search a vector tile. Search a vector tile for geospatial values. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-vector-tile-api.html | Elasticsearch API documentation} */ -export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptions): Promise -export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptions): Promise { +export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest, options?: TransportRequestOptions): Promise +export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index', 'field', 'zoom', 'x', 'y'] const acceptedBody: string[] = ['aggs', 'buffer', 'exact_bounds', 'extent', 'fields', 'grid_agg', 'grid_precision', 'grid_type', 'query', 'runtime_mappings', 'size', 'sort', 'track_total_hits', 'with_labels'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/search_shards.ts b/src/api/api/search_shards.ts index 852615082..8bbfb9429 100644 --- a/src/api/api/search_shards.ts +++ b/src/api/api/search_shards.ts @@ -35,17 +35,16 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Get the search shards. Get the indices and shards that a search request would be run against. This information can be useful for working out issues or planning optimizations with routing and shard preferences. When filtered aliases are used, the filter is returned as part of the indices section. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-shards.html | Elasticsearch API documentation} */ -export default async function SearchShardsApi (this: That, params?: T.SearchShardsRequest | TB.SearchShardsRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function SearchShardsApi (this: That, params?: T.SearchShardsRequest | TB.SearchShardsRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function SearchShardsApi (this: That, params?: T.SearchShardsRequest | TB.SearchShardsRequest, options?: TransportRequestOptions): Promise -export default async function SearchShardsApi (this: That, params?: T.SearchShardsRequest | TB.SearchShardsRequest, options?: TransportRequestOptions): Promise { +export default async function SearchShardsApi (this: That, params?: T.SearchShardsRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function SearchShardsApi (this: That, params?: T.SearchShardsRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function SearchShardsApi (this: That, params?: T.SearchShardsRequest, options?: TransportRequestOptions): Promise +export default async function SearchShardsApi (this: That, params?: T.SearchShardsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -54,7 +53,7 @@ export default async function SearchShardsApi (this: That, params?: T.SearchShar for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/search_template.ts b/src/api/api/search_template.ts index b5dace73a..21a90cb83 100644 --- a/src/api/api/search_template.ts +++ b/src/api/api/search_template.ts @@ -35,38 +35,29 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Run a search with a search template. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-template.html | Elasticsearch API documentation} */ -export default async function SearchTemplateApi (this: That, params?: T.SearchTemplateRequest | TB.SearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise> -export default async function SearchTemplateApi (this: That, params?: T.SearchTemplateRequest | TB.SearchTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> -export default async function SearchTemplateApi (this: That, params?: T.SearchTemplateRequest | TB.SearchTemplateRequest, options?: TransportRequestOptions): Promise> -export default async function SearchTemplateApi (this: That, params?: T.SearchTemplateRequest | TB.SearchTemplateRequest, options?: TransportRequestOptions): Promise { +export default async function SearchTemplateApi (this: That, params?: T.SearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise> +export default async function SearchTemplateApi (this: That, params?: T.SearchTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> +export default async function SearchTemplateApi (this: That, params?: T.SearchTemplateRequest, options?: TransportRequestOptions): Promise> +export default async function SearchTemplateApi (this: That, params?: T.SearchTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['explain', 'id', 'params', 'profile', 'source'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/searchable_snapshots.ts b/src/api/api/searchable_snapshots.ts index 11cb097d9..ebc885ed2 100644 --- a/src/api/api/searchable_snapshots.ts +++ b/src/api/api/searchable_snapshots.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class SearchableSnapshots { @@ -48,10 +47,10 @@ export default class SearchableSnapshots { * Retrieve node-level cache statistics about searchable snapshots. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/searchable-snapshots-apis.html | Elasticsearch API documentation} */ - async cacheStats (this: That, params?: T.SearchableSnapshotsCacheStatsRequest | TB.SearchableSnapshotsCacheStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async cacheStats (this: That, params?: T.SearchableSnapshotsCacheStatsRequest | TB.SearchableSnapshotsCacheStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async cacheStats (this: That, params?: T.SearchableSnapshotsCacheStatsRequest | TB.SearchableSnapshotsCacheStatsRequest, options?: TransportRequestOptions): Promise - async cacheStats (this: That, params?: T.SearchableSnapshotsCacheStatsRequest | TB.SearchableSnapshotsCacheStatsRequest, options?: TransportRequestOptions): Promise { + async cacheStats (this: That, params?: T.SearchableSnapshotsCacheStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async cacheStats (this: That, params?: T.SearchableSnapshotsCacheStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async cacheStats (this: That, params?: T.SearchableSnapshotsCacheStatsRequest, options?: TransportRequestOptions): Promise + async cacheStats (this: That, params?: T.SearchableSnapshotsCacheStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['node_id'] const querystring: Record = {} const body = undefined @@ -60,7 +59,7 @@ export default class SearchableSnapshots { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -88,10 +87,10 @@ export default class SearchableSnapshots { * Clear the cache of searchable snapshots. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/searchable-snapshots-apis.html | Elasticsearch API documentation} */ - async clearCache (this: That, params?: T.SearchableSnapshotsClearCacheRequest | TB.SearchableSnapshotsClearCacheRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async clearCache (this: That, params?: T.SearchableSnapshotsClearCacheRequest | TB.SearchableSnapshotsClearCacheRequest, options?: TransportRequestOptionsWithMeta): Promise> - async clearCache (this: That, params?: T.SearchableSnapshotsClearCacheRequest | TB.SearchableSnapshotsClearCacheRequest, options?: TransportRequestOptions): Promise - async clearCache (this: That, params?: T.SearchableSnapshotsClearCacheRequest | TB.SearchableSnapshotsClearCacheRequest, options?: TransportRequestOptions): Promise { + async clearCache (this: That, params?: T.SearchableSnapshotsClearCacheRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async clearCache (this: That, params?: T.SearchableSnapshotsClearCacheRequest, options?: TransportRequestOptionsWithMeta): Promise> + async clearCache (this: That, params?: T.SearchableSnapshotsClearCacheRequest, options?: TransportRequestOptions): Promise + async clearCache (this: That, params?: T.SearchableSnapshotsClearCacheRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -100,7 +99,7 @@ export default class SearchableSnapshots { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -128,30 +127,22 @@ export default class SearchableSnapshots { * Mount a snapshot as a searchable index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/searchable-snapshots-api-mount-snapshot.html | Elasticsearch API documentation} */ - async mount (this: That, params: T.SearchableSnapshotsMountRequest | TB.SearchableSnapshotsMountRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async mount (this: That, params: T.SearchableSnapshotsMountRequest | TB.SearchableSnapshotsMountRequest, options?: TransportRequestOptionsWithMeta): Promise> - async mount (this: That, params: T.SearchableSnapshotsMountRequest | TB.SearchableSnapshotsMountRequest, options?: TransportRequestOptions): Promise - async mount (this: That, params: T.SearchableSnapshotsMountRequest | TB.SearchableSnapshotsMountRequest, options?: TransportRequestOptions): Promise { + async mount (this: That, params: T.SearchableSnapshotsMountRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async mount (this: That, params: T.SearchableSnapshotsMountRequest, options?: TransportRequestOptionsWithMeta): Promise> + async mount (this: That, params: T.SearchableSnapshotsMountRequest, options?: TransportRequestOptions): Promise + async mount (this: That, params: T.SearchableSnapshotsMountRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['repository', 'snapshot'] const acceptedBody: string[] = ['index', 'renamed_index', 'index_settings', 'ignore_index_settings'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -173,10 +164,10 @@ export default class SearchableSnapshots { * Retrieve shard-level statistics about searchable snapshots. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/searchable-snapshots-apis.html | Elasticsearch API documentation} */ - async stats (this: That, params?: T.SearchableSnapshotsStatsRequest | TB.SearchableSnapshotsStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async stats (this: That, params?: T.SearchableSnapshotsStatsRequest | TB.SearchableSnapshotsStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async stats (this: That, params?: T.SearchableSnapshotsStatsRequest | TB.SearchableSnapshotsStatsRequest, options?: TransportRequestOptions): Promise - async stats (this: That, params?: T.SearchableSnapshotsStatsRequest | TB.SearchableSnapshotsStatsRequest, options?: TransportRequestOptions): Promise { + async stats (this: That, params?: T.SearchableSnapshotsStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async stats (this: That, params?: T.SearchableSnapshotsStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async stats (this: That, params?: T.SearchableSnapshotsStatsRequest, options?: TransportRequestOptions): Promise + async stats (this: That, params?: T.SearchableSnapshotsStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -185,7 +176,7 @@ export default class SearchableSnapshots { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/security.ts b/src/api/api/security.ts index 69c94c326..0895110d1 100644 --- a/src/api/api/security.ts +++ b/src/api/api/security.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Security { @@ -48,30 +47,22 @@ export default class Security { * Activate a user profile. Create or update a user profile on behalf of another user. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-activate-user-profile.html | Elasticsearch API documentation} */ - async activateUserProfile (this: That, params: T.SecurityActivateUserProfileRequest | TB.SecurityActivateUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async activateUserProfile (this: That, params: T.SecurityActivateUserProfileRequest | TB.SecurityActivateUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise> - async activateUserProfile (this: That, params: T.SecurityActivateUserProfileRequest | TB.SecurityActivateUserProfileRequest, options?: TransportRequestOptions): Promise - async activateUserProfile (this: That, params: T.SecurityActivateUserProfileRequest | TB.SecurityActivateUserProfileRequest, options?: TransportRequestOptions): Promise { + async activateUserProfile (this: That, params: T.SecurityActivateUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async activateUserProfile (this: That, params: T.SecurityActivateUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise> + async activateUserProfile (this: That, params: T.SecurityActivateUserProfileRequest, options?: TransportRequestOptions): Promise + async activateUserProfile (this: That, params: T.SecurityActivateUserProfileRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['access_token', 'grant_type', 'password', 'username'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -89,10 +80,10 @@ export default class Security { * Authenticate a user. Authenticates a user and returns information about the authenticated user. Include the user information in a [basic auth header](https://en.wikipedia.org/wiki/Basic_access_authentication). A successful call returns a JSON structure that shows user information such as their username, the roles that are assigned to the user, any assigned metadata, and information about the realms that authenticated and authorized the user. If the user cannot be authenticated, this API returns a 401 status code. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-authenticate.html | Elasticsearch API documentation} */ - async authenticate (this: That, params?: T.SecurityAuthenticateRequest | TB.SecurityAuthenticateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async authenticate (this: That, params?: T.SecurityAuthenticateRequest | TB.SecurityAuthenticateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async authenticate (this: That, params?: T.SecurityAuthenticateRequest | TB.SecurityAuthenticateRequest, options?: TransportRequestOptions): Promise - async authenticate (this: That, params?: T.SecurityAuthenticateRequest | TB.SecurityAuthenticateRequest, options?: TransportRequestOptions): Promise { + async authenticate (this: That, params?: T.SecurityAuthenticateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async authenticate (this: That, params?: T.SecurityAuthenticateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async authenticate (this: That, params?: T.SecurityAuthenticateRequest, options?: TransportRequestOptions): Promise + async authenticate (this: That, params?: T.SecurityAuthenticateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -101,7 +92,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -119,30 +110,22 @@ export default class Security { * Bulk delete roles. The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. The bulk delete roles API cannot delete roles that are defined in roles files. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-bulk-delete-role.html | Elasticsearch API documentation} */ - async bulkDeleteRole (this: That, params: T.SecurityBulkDeleteRoleRequest | TB.SecurityBulkDeleteRoleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async bulkDeleteRole (this: That, params: T.SecurityBulkDeleteRoleRequest | TB.SecurityBulkDeleteRoleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async bulkDeleteRole (this: That, params: T.SecurityBulkDeleteRoleRequest | TB.SecurityBulkDeleteRoleRequest, options?: TransportRequestOptions): Promise - async bulkDeleteRole (this: That, params: T.SecurityBulkDeleteRoleRequest | TB.SecurityBulkDeleteRoleRequest, options?: TransportRequestOptions): Promise { + async bulkDeleteRole (this: That, params: T.SecurityBulkDeleteRoleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async bulkDeleteRole (this: That, params: T.SecurityBulkDeleteRoleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async bulkDeleteRole (this: That, params: T.SecurityBulkDeleteRoleRequest, options?: TransportRequestOptions): Promise + async bulkDeleteRole (this: That, params: T.SecurityBulkDeleteRoleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['names'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -160,30 +143,22 @@ export default class Security { * Bulk create or update roles. The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. The bulk create or update roles API cannot update roles that are defined in roles files. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-bulk-put-role.html | Elasticsearch API documentation} */ - async bulkPutRole (this: That, params: T.SecurityBulkPutRoleRequest | TB.SecurityBulkPutRoleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async bulkPutRole (this: That, params: T.SecurityBulkPutRoleRequest | TB.SecurityBulkPutRoleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async bulkPutRole (this: That, params: T.SecurityBulkPutRoleRequest | TB.SecurityBulkPutRoleRequest, options?: TransportRequestOptions): Promise - async bulkPutRole (this: That, params: T.SecurityBulkPutRoleRequest | TB.SecurityBulkPutRoleRequest, options?: TransportRequestOptions): Promise { + async bulkPutRole (this: That, params: T.SecurityBulkPutRoleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async bulkPutRole (this: That, params: T.SecurityBulkPutRoleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async bulkPutRole (this: That, params: T.SecurityBulkPutRoleRequest, options?: TransportRequestOptions): Promise + async bulkPutRole (this: That, params: T.SecurityBulkPutRoleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['roles'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -201,10 +176,10 @@ export default class Security { * Updates the attributes of multiple existing API keys. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-bulk-update-api-keys.html | Elasticsearch API documentation} */ - async bulkUpdateApiKeys (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async bulkUpdateApiKeys (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async bulkUpdateApiKeys (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async bulkUpdateApiKeys (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async bulkUpdateApiKeys (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async bulkUpdateApiKeys (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async bulkUpdateApiKeys (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async bulkUpdateApiKeys (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -213,7 +188,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -230,31 +205,23 @@ export default class Security { * Change passwords. Change the passwords of users in the native realm and built-in users. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-change-password.html | Elasticsearch API documentation} */ - async changePassword (this: That, params?: T.SecurityChangePasswordRequest | TB.SecurityChangePasswordRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async changePassword (this: That, params?: T.SecurityChangePasswordRequest | TB.SecurityChangePasswordRequest, options?: TransportRequestOptionsWithMeta): Promise> - async changePassword (this: That, params?: T.SecurityChangePasswordRequest | TB.SecurityChangePasswordRequest, options?: TransportRequestOptions): Promise - async changePassword (this: That, params?: T.SecurityChangePasswordRequest | TB.SecurityChangePasswordRequest, options?: TransportRequestOptions): Promise { + async changePassword (this: That, params?: T.SecurityChangePasswordRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async changePassword (this: That, params?: T.SecurityChangePasswordRequest, options?: TransportRequestOptionsWithMeta): Promise> + async changePassword (this: That, params?: T.SecurityChangePasswordRequest, options?: TransportRequestOptions): Promise + async changePassword (this: That, params?: T.SecurityChangePasswordRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['username'] const acceptedBody: string[] = ['password', 'password_hash'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -282,10 +249,10 @@ export default class Security { * Clear the API key cache. Evict a subset of all entries from the API key cache. The cache is also automatically cleared on state changes of the security index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-clear-api-key-cache.html | Elasticsearch API documentation} */ - async clearApiKeyCache (this: That, params: T.SecurityClearApiKeyCacheRequest | TB.SecurityClearApiKeyCacheRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async clearApiKeyCache (this: That, params: T.SecurityClearApiKeyCacheRequest | TB.SecurityClearApiKeyCacheRequest, options?: TransportRequestOptionsWithMeta): Promise> - async clearApiKeyCache (this: That, params: T.SecurityClearApiKeyCacheRequest | TB.SecurityClearApiKeyCacheRequest, options?: TransportRequestOptions): Promise - async clearApiKeyCache (this: That, params: T.SecurityClearApiKeyCacheRequest | TB.SecurityClearApiKeyCacheRequest, options?: TransportRequestOptions): Promise { + async clearApiKeyCache (this: That, params: T.SecurityClearApiKeyCacheRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async clearApiKeyCache (this: That, params: T.SecurityClearApiKeyCacheRequest, options?: TransportRequestOptionsWithMeta): Promise> + async clearApiKeyCache (this: That, params: T.SecurityClearApiKeyCacheRequest, options?: TransportRequestOptions): Promise + async clearApiKeyCache (this: That, params: T.SecurityClearApiKeyCacheRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['ids'] const querystring: Record = {} const body = undefined @@ -293,7 +260,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -314,10 +281,10 @@ export default class Security { * Clear the privileges cache. Evict privileges from the native application privilege cache. The cache is also automatically cleared for applications that have their privileges updated. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-clear-privilege-cache.html | Elasticsearch API documentation} */ - async clearCachedPrivileges (this: That, params: T.SecurityClearCachedPrivilegesRequest | TB.SecurityClearCachedPrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async clearCachedPrivileges (this: That, params: T.SecurityClearCachedPrivilegesRequest | TB.SecurityClearCachedPrivilegesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async clearCachedPrivileges (this: That, params: T.SecurityClearCachedPrivilegesRequest | TB.SecurityClearCachedPrivilegesRequest, options?: TransportRequestOptions): Promise - async clearCachedPrivileges (this: That, params: T.SecurityClearCachedPrivilegesRequest | TB.SecurityClearCachedPrivilegesRequest, options?: TransportRequestOptions): Promise { + async clearCachedPrivileges (this: That, params: T.SecurityClearCachedPrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async clearCachedPrivileges (this: That, params: T.SecurityClearCachedPrivilegesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async clearCachedPrivileges (this: That, params: T.SecurityClearCachedPrivilegesRequest, options?: TransportRequestOptions): Promise + async clearCachedPrivileges (this: That, params: T.SecurityClearCachedPrivilegesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['application'] const querystring: Record = {} const body = undefined @@ -325,7 +292,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -346,10 +313,10 @@ export default class Security { * Clear the user cache. Evict users from the user cache. You can completely clear the cache or evict specific users. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-clear-cache.html | Elasticsearch API documentation} */ - async clearCachedRealms (this: That, params: T.SecurityClearCachedRealmsRequest | TB.SecurityClearCachedRealmsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async clearCachedRealms (this: That, params: T.SecurityClearCachedRealmsRequest | TB.SecurityClearCachedRealmsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async clearCachedRealms (this: That, params: T.SecurityClearCachedRealmsRequest | TB.SecurityClearCachedRealmsRequest, options?: TransportRequestOptions): Promise - async clearCachedRealms (this: That, params: T.SecurityClearCachedRealmsRequest | TB.SecurityClearCachedRealmsRequest, options?: TransportRequestOptions): Promise { + async clearCachedRealms (this: That, params: T.SecurityClearCachedRealmsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async clearCachedRealms (this: That, params: T.SecurityClearCachedRealmsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async clearCachedRealms (this: That, params: T.SecurityClearCachedRealmsRequest, options?: TransportRequestOptions): Promise + async clearCachedRealms (this: That, params: T.SecurityClearCachedRealmsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['realms'] const querystring: Record = {} const body = undefined @@ -357,7 +324,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -378,10 +345,10 @@ export default class Security { * Clear the roles cache. Evict roles from the native role cache. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-clear-role-cache.html | Elasticsearch API documentation} */ - async clearCachedRoles (this: That, params: T.SecurityClearCachedRolesRequest | TB.SecurityClearCachedRolesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async clearCachedRoles (this: That, params: T.SecurityClearCachedRolesRequest | TB.SecurityClearCachedRolesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async clearCachedRoles (this: That, params: T.SecurityClearCachedRolesRequest | TB.SecurityClearCachedRolesRequest, options?: TransportRequestOptions): Promise - async clearCachedRoles (this: That, params: T.SecurityClearCachedRolesRequest | TB.SecurityClearCachedRolesRequest, options?: TransportRequestOptions): Promise { + async clearCachedRoles (this: That, params: T.SecurityClearCachedRolesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async clearCachedRoles (this: That, params: T.SecurityClearCachedRolesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async clearCachedRoles (this: That, params: T.SecurityClearCachedRolesRequest, options?: TransportRequestOptions): Promise + async clearCachedRoles (this: That, params: T.SecurityClearCachedRolesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -389,7 +356,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -410,10 +377,10 @@ export default class Security { * Clear service account token caches. Evict a subset of all entries from the service account token caches. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-clear-service-token-caches.html | Elasticsearch API documentation} */ - async clearCachedServiceTokens (this: That, params: T.SecurityClearCachedServiceTokensRequest | TB.SecurityClearCachedServiceTokensRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async clearCachedServiceTokens (this: That, params: T.SecurityClearCachedServiceTokensRequest | TB.SecurityClearCachedServiceTokensRequest, options?: TransportRequestOptionsWithMeta): Promise> - async clearCachedServiceTokens (this: That, params: T.SecurityClearCachedServiceTokensRequest | TB.SecurityClearCachedServiceTokensRequest, options?: TransportRequestOptions): Promise - async clearCachedServiceTokens (this: That, params: T.SecurityClearCachedServiceTokensRequest | TB.SecurityClearCachedServiceTokensRequest, options?: TransportRequestOptions): Promise { + async clearCachedServiceTokens (this: That, params: T.SecurityClearCachedServiceTokensRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async clearCachedServiceTokens (this: That, params: T.SecurityClearCachedServiceTokensRequest, options?: TransportRequestOptionsWithMeta): Promise> + async clearCachedServiceTokens (this: That, params: T.SecurityClearCachedServiceTokensRequest, options?: TransportRequestOptions): Promise + async clearCachedServiceTokens (this: That, params: T.SecurityClearCachedServiceTokensRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['namespace', 'service', 'name'] const querystring: Record = {} const body = undefined @@ -421,7 +388,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -444,31 +411,23 @@ export default class Security { * Create an API key. Create an API key for access without requiring basic authentication. A successful request returns a JSON structure that contains the API key, its unique id, and its name. If applicable, it also returns expiration information for the API key in milliseconds. NOTE: By default, API keys never expire. You can specify expiration information when you create the API keys. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-create-api-key.html | Elasticsearch API documentation} */ - async createApiKey (this: That, params?: T.SecurityCreateApiKeyRequest | TB.SecurityCreateApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async createApiKey (this: That, params?: T.SecurityCreateApiKeyRequest | TB.SecurityCreateApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> - async createApiKey (this: That, params?: T.SecurityCreateApiKeyRequest | TB.SecurityCreateApiKeyRequest, options?: TransportRequestOptions): Promise - async createApiKey (this: That, params?: T.SecurityCreateApiKeyRequest | TB.SecurityCreateApiKeyRequest, options?: TransportRequestOptions): Promise { + async createApiKey (this: That, params?: T.SecurityCreateApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async createApiKey (this: That, params?: T.SecurityCreateApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> + async createApiKey (this: That, params?: T.SecurityCreateApiKeyRequest, options?: TransportRequestOptions): Promise + async createApiKey (this: That, params?: T.SecurityCreateApiKeyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['expiration', 'name', 'role_descriptors', 'metadata'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -486,30 +445,22 @@ export default class Security { * Create a cross-cluster API key. Create an API key of the `cross_cluster` type for the API key based remote cluster access. A `cross_cluster` API key cannot be used to authenticate through the REST interface. IMPORTANT: To authenticate this request you must use a credential that is not an API key. Even if you use an API key that has the required privilege, the API returns an error. Cross-cluster API keys are created by the Elasticsearch API key service, which is automatically enabled. NOTE: Unlike REST API keys, a cross-cluster API key does not capture permissions of the authenticated user. The API key’s effective permission is exactly as specified with the `access` property. A successful request returns a JSON structure that contains the API key, its unique ID, and its name. If applicable, it also returns expiration information for the API key in milliseconds. By default, API keys never expire. You can specify expiration information when you create the API keys. Cross-cluster API keys can only be updated with the update cross-cluster API key API. Attempting to update them with the update REST API key API or the bulk update REST API keys API will result in an error. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-create-cross-cluster-api-key.html | Elasticsearch API documentation} */ - async createCrossClusterApiKey (this: That, params: T.SecurityCreateCrossClusterApiKeyRequest | TB.SecurityCreateCrossClusterApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async createCrossClusterApiKey (this: That, params: T.SecurityCreateCrossClusterApiKeyRequest | TB.SecurityCreateCrossClusterApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> - async createCrossClusterApiKey (this: That, params: T.SecurityCreateCrossClusterApiKeyRequest | TB.SecurityCreateCrossClusterApiKeyRequest, options?: TransportRequestOptions): Promise - async createCrossClusterApiKey (this: That, params: T.SecurityCreateCrossClusterApiKeyRequest | TB.SecurityCreateCrossClusterApiKeyRequest, options?: TransportRequestOptions): Promise { + async createCrossClusterApiKey (this: That, params: T.SecurityCreateCrossClusterApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async createCrossClusterApiKey (this: That, params: T.SecurityCreateCrossClusterApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> + async createCrossClusterApiKey (this: That, params: T.SecurityCreateCrossClusterApiKeyRequest, options?: TransportRequestOptions): Promise + async createCrossClusterApiKey (this: That, params: T.SecurityCreateCrossClusterApiKeyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['access', 'expiration', 'metadata', 'name'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -527,10 +478,10 @@ export default class Security { * Create a service account token. Create a service accounts token for access without requiring basic authentication. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-create-service-token.html | Elasticsearch API documentation} */ - async createServiceToken (this: That, params: T.SecurityCreateServiceTokenRequest | TB.SecurityCreateServiceTokenRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async createServiceToken (this: That, params: T.SecurityCreateServiceTokenRequest | TB.SecurityCreateServiceTokenRequest, options?: TransportRequestOptionsWithMeta): Promise> - async createServiceToken (this: That, params: T.SecurityCreateServiceTokenRequest | TB.SecurityCreateServiceTokenRequest, options?: TransportRequestOptions): Promise - async createServiceToken (this: That, params: T.SecurityCreateServiceTokenRequest | TB.SecurityCreateServiceTokenRequest, options?: TransportRequestOptions): Promise { + async createServiceToken (this: That, params: T.SecurityCreateServiceTokenRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async createServiceToken (this: That, params: T.SecurityCreateServiceTokenRequest, options?: TransportRequestOptionsWithMeta): Promise> + async createServiceToken (this: That, params: T.SecurityCreateServiceTokenRequest, options?: TransportRequestOptions): Promise + async createServiceToken (this: That, params: T.SecurityCreateServiceTokenRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['namespace', 'service', 'name'] const querystring: Record = {} const body = undefined @@ -538,7 +489,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -568,10 +519,10 @@ export default class Security { * Delete application privileges. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-delete-privilege.html | Elasticsearch API documentation} */ - async deletePrivileges (this: That, params: T.SecurityDeletePrivilegesRequest | TB.SecurityDeletePrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deletePrivileges (this: That, params: T.SecurityDeletePrivilegesRequest | TB.SecurityDeletePrivilegesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deletePrivileges (this: That, params: T.SecurityDeletePrivilegesRequest | TB.SecurityDeletePrivilegesRequest, options?: TransportRequestOptions): Promise - async deletePrivileges (this: That, params: T.SecurityDeletePrivilegesRequest | TB.SecurityDeletePrivilegesRequest, options?: TransportRequestOptions): Promise { + async deletePrivileges (this: That, params: T.SecurityDeletePrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deletePrivileges (this: That, params: T.SecurityDeletePrivilegesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deletePrivileges (this: That, params: T.SecurityDeletePrivilegesRequest, options?: TransportRequestOptions): Promise + async deletePrivileges (this: That, params: T.SecurityDeletePrivilegesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['application', 'name'] const querystring: Record = {} const body = undefined @@ -579,7 +530,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -601,10 +552,10 @@ export default class Security { * Delete roles. Delete roles in the native realm. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-delete-role.html | Elasticsearch API documentation} */ - async deleteRole (this: That, params: T.SecurityDeleteRoleRequest | TB.SecurityDeleteRoleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteRole (this: That, params: T.SecurityDeleteRoleRequest | TB.SecurityDeleteRoleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteRole (this: That, params: T.SecurityDeleteRoleRequest | TB.SecurityDeleteRoleRequest, options?: TransportRequestOptions): Promise - async deleteRole (this: That, params: T.SecurityDeleteRoleRequest | TB.SecurityDeleteRoleRequest, options?: TransportRequestOptions): Promise { + async deleteRole (this: That, params: T.SecurityDeleteRoleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteRole (this: That, params: T.SecurityDeleteRoleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteRole (this: That, params: T.SecurityDeleteRoleRequest, options?: TransportRequestOptions): Promise + async deleteRole (this: That, params: T.SecurityDeleteRoleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -612,7 +563,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -633,10 +584,10 @@ export default class Security { * Delete role mappings. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-delete-role-mapping.html | Elasticsearch API documentation} */ - async deleteRoleMapping (this: That, params: T.SecurityDeleteRoleMappingRequest | TB.SecurityDeleteRoleMappingRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteRoleMapping (this: That, params: T.SecurityDeleteRoleMappingRequest | TB.SecurityDeleteRoleMappingRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteRoleMapping (this: That, params: T.SecurityDeleteRoleMappingRequest | TB.SecurityDeleteRoleMappingRequest, options?: TransportRequestOptions): Promise - async deleteRoleMapping (this: That, params: T.SecurityDeleteRoleMappingRequest | TB.SecurityDeleteRoleMappingRequest, options?: TransportRequestOptions): Promise { + async deleteRoleMapping (this: That, params: T.SecurityDeleteRoleMappingRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteRoleMapping (this: That, params: T.SecurityDeleteRoleMappingRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteRoleMapping (this: That, params: T.SecurityDeleteRoleMappingRequest, options?: TransportRequestOptions): Promise + async deleteRoleMapping (this: That, params: T.SecurityDeleteRoleMappingRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -644,7 +595,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -665,10 +616,10 @@ export default class Security { * Delete service account tokens. Delete service account tokens for a service in a specified namespace. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-delete-service-token.html | Elasticsearch API documentation} */ - async deleteServiceToken (this: That, params: T.SecurityDeleteServiceTokenRequest | TB.SecurityDeleteServiceTokenRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteServiceToken (this: That, params: T.SecurityDeleteServiceTokenRequest | TB.SecurityDeleteServiceTokenRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteServiceToken (this: That, params: T.SecurityDeleteServiceTokenRequest | TB.SecurityDeleteServiceTokenRequest, options?: TransportRequestOptions): Promise - async deleteServiceToken (this: That, params: T.SecurityDeleteServiceTokenRequest | TB.SecurityDeleteServiceTokenRequest, options?: TransportRequestOptions): Promise { + async deleteServiceToken (this: That, params: T.SecurityDeleteServiceTokenRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteServiceToken (this: That, params: T.SecurityDeleteServiceTokenRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteServiceToken (this: That, params: T.SecurityDeleteServiceTokenRequest, options?: TransportRequestOptions): Promise + async deleteServiceToken (this: That, params: T.SecurityDeleteServiceTokenRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['namespace', 'service', 'name'] const querystring: Record = {} const body = undefined @@ -676,7 +627,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -699,10 +650,10 @@ export default class Security { * Delete users. Delete users from the native realm. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-delete-user.html | Elasticsearch API documentation} */ - async deleteUser (this: That, params: T.SecurityDeleteUserRequest | TB.SecurityDeleteUserRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteUser (this: That, params: T.SecurityDeleteUserRequest | TB.SecurityDeleteUserRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteUser (this: That, params: T.SecurityDeleteUserRequest | TB.SecurityDeleteUserRequest, options?: TransportRequestOptions): Promise - async deleteUser (this: That, params: T.SecurityDeleteUserRequest | TB.SecurityDeleteUserRequest, options?: TransportRequestOptions): Promise { + async deleteUser (this: That, params: T.SecurityDeleteUserRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteUser (this: That, params: T.SecurityDeleteUserRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteUser (this: That, params: T.SecurityDeleteUserRequest, options?: TransportRequestOptions): Promise + async deleteUser (this: That, params: T.SecurityDeleteUserRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['username'] const querystring: Record = {} const body = undefined @@ -710,7 +661,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -731,10 +682,10 @@ export default class Security { * Disable users. Disable users in the native realm. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-disable-user.html | Elasticsearch API documentation} */ - async disableUser (this: That, params: T.SecurityDisableUserRequest | TB.SecurityDisableUserRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async disableUser (this: That, params: T.SecurityDisableUserRequest | TB.SecurityDisableUserRequest, options?: TransportRequestOptionsWithMeta): Promise> - async disableUser (this: That, params: T.SecurityDisableUserRequest | TB.SecurityDisableUserRequest, options?: TransportRequestOptions): Promise - async disableUser (this: That, params: T.SecurityDisableUserRequest | TB.SecurityDisableUserRequest, options?: TransportRequestOptions): Promise { + async disableUser (this: That, params: T.SecurityDisableUserRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async disableUser (this: That, params: T.SecurityDisableUserRequest, options?: TransportRequestOptionsWithMeta): Promise> + async disableUser (this: That, params: T.SecurityDisableUserRequest, options?: TransportRequestOptions): Promise + async disableUser (this: That, params: T.SecurityDisableUserRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['username'] const querystring: Record = {} const body = undefined @@ -742,7 +693,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -763,10 +714,10 @@ export default class Security { * Disable a user profile. Disable user profiles so that they are not visible in user profile searches. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-disable-user-profile.html | Elasticsearch API documentation} */ - async disableUserProfile (this: That, params: T.SecurityDisableUserProfileRequest | TB.SecurityDisableUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async disableUserProfile (this: That, params: T.SecurityDisableUserProfileRequest | TB.SecurityDisableUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise> - async disableUserProfile (this: That, params: T.SecurityDisableUserProfileRequest | TB.SecurityDisableUserProfileRequest, options?: TransportRequestOptions): Promise - async disableUserProfile (this: That, params: T.SecurityDisableUserProfileRequest | TB.SecurityDisableUserProfileRequest, options?: TransportRequestOptions): Promise { + async disableUserProfile (this: That, params: T.SecurityDisableUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async disableUserProfile (this: That, params: T.SecurityDisableUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise> + async disableUserProfile (this: That, params: T.SecurityDisableUserProfileRequest, options?: TransportRequestOptions): Promise + async disableUserProfile (this: That, params: T.SecurityDisableUserProfileRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['uid'] const querystring: Record = {} const body = undefined @@ -774,7 +725,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -795,10 +746,10 @@ export default class Security { * Enable users. Enable users in the native realm. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-enable-user.html | Elasticsearch API documentation} */ - async enableUser (this: That, params: T.SecurityEnableUserRequest | TB.SecurityEnableUserRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async enableUser (this: That, params: T.SecurityEnableUserRequest | TB.SecurityEnableUserRequest, options?: TransportRequestOptionsWithMeta): Promise> - async enableUser (this: That, params: T.SecurityEnableUserRequest | TB.SecurityEnableUserRequest, options?: TransportRequestOptions): Promise - async enableUser (this: That, params: T.SecurityEnableUserRequest | TB.SecurityEnableUserRequest, options?: TransportRequestOptions): Promise { + async enableUser (this: That, params: T.SecurityEnableUserRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async enableUser (this: That, params: T.SecurityEnableUserRequest, options?: TransportRequestOptionsWithMeta): Promise> + async enableUser (this: That, params: T.SecurityEnableUserRequest, options?: TransportRequestOptions): Promise + async enableUser (this: That, params: T.SecurityEnableUserRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['username'] const querystring: Record = {} const body = undefined @@ -806,7 +757,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -827,10 +778,10 @@ export default class Security { * Enable a user profile. Enable user profiles to make them visible in user profile searches. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-enable-user-profile.html | Elasticsearch API documentation} */ - async enableUserProfile (this: That, params: T.SecurityEnableUserProfileRequest | TB.SecurityEnableUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async enableUserProfile (this: That, params: T.SecurityEnableUserProfileRequest | TB.SecurityEnableUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise> - async enableUserProfile (this: That, params: T.SecurityEnableUserProfileRequest | TB.SecurityEnableUserProfileRequest, options?: TransportRequestOptions): Promise - async enableUserProfile (this: That, params: T.SecurityEnableUserProfileRequest | TB.SecurityEnableUserProfileRequest, options?: TransportRequestOptions): Promise { + async enableUserProfile (this: That, params: T.SecurityEnableUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async enableUserProfile (this: That, params: T.SecurityEnableUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise> + async enableUserProfile (this: That, params: T.SecurityEnableUserProfileRequest, options?: TransportRequestOptions): Promise + async enableUserProfile (this: That, params: T.SecurityEnableUserProfileRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['uid'] const querystring: Record = {} const body = undefined @@ -838,7 +789,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -859,10 +810,10 @@ export default class Security { * Enroll Kibana. Enable a Kibana instance to configure itself for communication with a secured Elasticsearch cluster. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-kibana-enrollment.html | Elasticsearch API documentation} */ - async enrollKibana (this: That, params?: T.SecurityEnrollKibanaRequest | TB.SecurityEnrollKibanaRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async enrollKibana (this: That, params?: T.SecurityEnrollKibanaRequest | TB.SecurityEnrollKibanaRequest, options?: TransportRequestOptionsWithMeta): Promise> - async enrollKibana (this: That, params?: T.SecurityEnrollKibanaRequest | TB.SecurityEnrollKibanaRequest, options?: TransportRequestOptions): Promise - async enrollKibana (this: That, params?: T.SecurityEnrollKibanaRequest | TB.SecurityEnrollKibanaRequest, options?: TransportRequestOptions): Promise { + async enrollKibana (this: That, params?: T.SecurityEnrollKibanaRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async enrollKibana (this: That, params?: T.SecurityEnrollKibanaRequest, options?: TransportRequestOptionsWithMeta): Promise> + async enrollKibana (this: That, params?: T.SecurityEnrollKibanaRequest, options?: TransportRequestOptions): Promise + async enrollKibana (this: That, params?: T.SecurityEnrollKibanaRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -871,7 +822,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -889,10 +840,10 @@ export default class Security { * Enroll a node. Enroll a new node to allow it to join an existing cluster with security features enabled. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-node-enrollment.html | Elasticsearch API documentation} */ - async enrollNode (this: That, params?: T.SecurityEnrollNodeRequest | TB.SecurityEnrollNodeRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async enrollNode (this: That, params?: T.SecurityEnrollNodeRequest | TB.SecurityEnrollNodeRequest, options?: TransportRequestOptionsWithMeta): Promise> - async enrollNode (this: That, params?: T.SecurityEnrollNodeRequest | TB.SecurityEnrollNodeRequest, options?: TransportRequestOptions): Promise - async enrollNode (this: That, params?: T.SecurityEnrollNodeRequest | TB.SecurityEnrollNodeRequest, options?: TransportRequestOptions): Promise { + async enrollNode (this: That, params?: T.SecurityEnrollNodeRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async enrollNode (this: That, params?: T.SecurityEnrollNodeRequest, options?: TransportRequestOptionsWithMeta): Promise> + async enrollNode (this: That, params?: T.SecurityEnrollNodeRequest, options?: TransportRequestOptions): Promise + async enrollNode (this: That, params?: T.SecurityEnrollNodeRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -901,7 +852,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -919,10 +870,10 @@ export default class Security { * Get API key information. Retrieves information for one or more API keys. NOTE: If you have only the `manage_own_api_key` privilege, this API returns only the API keys that you own. If you have `read_security`, `manage_api_key` or greater privileges (including `manage_security`), this API returns all API keys regardless of ownership. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-api-key.html | Elasticsearch API documentation} */ - async getApiKey (this: That, params?: T.SecurityGetApiKeyRequest | TB.SecurityGetApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getApiKey (this: That, params?: T.SecurityGetApiKeyRequest | TB.SecurityGetApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getApiKey (this: That, params?: T.SecurityGetApiKeyRequest | TB.SecurityGetApiKeyRequest, options?: TransportRequestOptions): Promise - async getApiKey (this: That, params?: T.SecurityGetApiKeyRequest | TB.SecurityGetApiKeyRequest, options?: TransportRequestOptions): Promise { + async getApiKey (this: That, params?: T.SecurityGetApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getApiKey (this: That, params?: T.SecurityGetApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getApiKey (this: That, params?: T.SecurityGetApiKeyRequest, options?: TransportRequestOptions): Promise + async getApiKey (this: That, params?: T.SecurityGetApiKeyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -931,7 +882,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -949,10 +900,10 @@ export default class Security { * Get builtin privileges. Get the list of cluster privileges and index privileges that are available in this version of Elasticsearch. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-builtin-privileges.html | Elasticsearch API documentation} */ - async getBuiltinPrivileges (this: That, params?: T.SecurityGetBuiltinPrivilegesRequest | TB.SecurityGetBuiltinPrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getBuiltinPrivileges (this: That, params?: T.SecurityGetBuiltinPrivilegesRequest | TB.SecurityGetBuiltinPrivilegesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getBuiltinPrivileges (this: That, params?: T.SecurityGetBuiltinPrivilegesRequest | TB.SecurityGetBuiltinPrivilegesRequest, options?: TransportRequestOptions): Promise - async getBuiltinPrivileges (this: That, params?: T.SecurityGetBuiltinPrivilegesRequest | TB.SecurityGetBuiltinPrivilegesRequest, options?: TransportRequestOptions): Promise { + async getBuiltinPrivileges (this: That, params?: T.SecurityGetBuiltinPrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getBuiltinPrivileges (this: That, params?: T.SecurityGetBuiltinPrivilegesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getBuiltinPrivileges (this: That, params?: T.SecurityGetBuiltinPrivilegesRequest, options?: TransportRequestOptions): Promise + async getBuiltinPrivileges (this: That, params?: T.SecurityGetBuiltinPrivilegesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -961,7 +912,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -979,10 +930,10 @@ export default class Security { * Get application privileges. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-privileges.html | Elasticsearch API documentation} */ - async getPrivileges (this: That, params?: T.SecurityGetPrivilegesRequest | TB.SecurityGetPrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getPrivileges (this: That, params?: T.SecurityGetPrivilegesRequest | TB.SecurityGetPrivilegesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getPrivileges (this: That, params?: T.SecurityGetPrivilegesRequest | TB.SecurityGetPrivilegesRequest, options?: TransportRequestOptions): Promise - async getPrivileges (this: That, params?: T.SecurityGetPrivilegesRequest | TB.SecurityGetPrivilegesRequest, options?: TransportRequestOptions): Promise { + async getPrivileges (this: That, params?: T.SecurityGetPrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getPrivileges (this: That, params?: T.SecurityGetPrivilegesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getPrivileges (this: That, params?: T.SecurityGetPrivilegesRequest, options?: TransportRequestOptions): Promise + async getPrivileges (this: That, params?: T.SecurityGetPrivilegesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['application', 'name'] const querystring: Record = {} const body = undefined @@ -991,7 +942,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1023,10 +974,10 @@ export default class Security { * Get roles. Get roles in the native realm. The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. The get roles API cannot retrieve roles that are defined in roles files. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-role.html | Elasticsearch API documentation} */ - async getRole (this: That, params?: T.SecurityGetRoleRequest | TB.SecurityGetRoleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getRole (this: That, params?: T.SecurityGetRoleRequest | TB.SecurityGetRoleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getRole (this: That, params?: T.SecurityGetRoleRequest | TB.SecurityGetRoleRequest, options?: TransportRequestOptions): Promise - async getRole (this: That, params?: T.SecurityGetRoleRequest | TB.SecurityGetRoleRequest, options?: TransportRequestOptions): Promise { + async getRole (this: That, params?: T.SecurityGetRoleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getRole (this: That, params?: T.SecurityGetRoleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getRole (this: That, params?: T.SecurityGetRoleRequest, options?: TransportRequestOptions): Promise + async getRole (this: That, params?: T.SecurityGetRoleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -1035,7 +986,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1063,10 +1014,10 @@ export default class Security { * Get role mappings. Role mappings define which roles are assigned to each user. The role mapping APIs are generally the preferred way to manage role mappings rather than using role mapping files. The get role mappings API cannot retrieve role mappings that are defined in role mapping files. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-role-mapping.html | Elasticsearch API documentation} */ - async getRoleMapping (this: That, params?: T.SecurityGetRoleMappingRequest | TB.SecurityGetRoleMappingRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getRoleMapping (this: That, params?: T.SecurityGetRoleMappingRequest | TB.SecurityGetRoleMappingRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getRoleMapping (this: That, params?: T.SecurityGetRoleMappingRequest | TB.SecurityGetRoleMappingRequest, options?: TransportRequestOptions): Promise - async getRoleMapping (this: That, params?: T.SecurityGetRoleMappingRequest | TB.SecurityGetRoleMappingRequest, options?: TransportRequestOptions): Promise { + async getRoleMapping (this: That, params?: T.SecurityGetRoleMappingRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getRoleMapping (this: That, params?: T.SecurityGetRoleMappingRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getRoleMapping (this: That, params?: T.SecurityGetRoleMappingRequest, options?: TransportRequestOptions): Promise + async getRoleMapping (this: That, params?: T.SecurityGetRoleMappingRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -1075,7 +1026,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1103,10 +1054,10 @@ export default class Security { * Get service accounts. Get a list of service accounts that match the provided path parameters. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-service-accounts.html | Elasticsearch API documentation} */ - async getServiceAccounts (this: That, params?: T.SecurityGetServiceAccountsRequest | TB.SecurityGetServiceAccountsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getServiceAccounts (this: That, params?: T.SecurityGetServiceAccountsRequest | TB.SecurityGetServiceAccountsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getServiceAccounts (this: That, params?: T.SecurityGetServiceAccountsRequest | TB.SecurityGetServiceAccountsRequest, options?: TransportRequestOptions): Promise - async getServiceAccounts (this: That, params?: T.SecurityGetServiceAccountsRequest | TB.SecurityGetServiceAccountsRequest, options?: TransportRequestOptions): Promise { + async getServiceAccounts (this: That, params?: T.SecurityGetServiceAccountsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getServiceAccounts (this: That, params?: T.SecurityGetServiceAccountsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getServiceAccounts (this: That, params?: T.SecurityGetServiceAccountsRequest, options?: TransportRequestOptions): Promise + async getServiceAccounts (this: That, params?: T.SecurityGetServiceAccountsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['namespace', 'service'] const querystring: Record = {} const body = undefined @@ -1115,7 +1066,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1147,10 +1098,10 @@ export default class Security { * Get service account credentials. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-service-credentials.html | Elasticsearch API documentation} */ - async getServiceCredentials (this: That, params: T.SecurityGetServiceCredentialsRequest | TB.SecurityGetServiceCredentialsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getServiceCredentials (this: That, params: T.SecurityGetServiceCredentialsRequest | TB.SecurityGetServiceCredentialsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getServiceCredentials (this: That, params: T.SecurityGetServiceCredentialsRequest | TB.SecurityGetServiceCredentialsRequest, options?: TransportRequestOptions): Promise - async getServiceCredentials (this: That, params: T.SecurityGetServiceCredentialsRequest | TB.SecurityGetServiceCredentialsRequest, options?: TransportRequestOptions): Promise { + async getServiceCredentials (this: That, params: T.SecurityGetServiceCredentialsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getServiceCredentials (this: That, params: T.SecurityGetServiceCredentialsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getServiceCredentials (this: That, params: T.SecurityGetServiceCredentialsRequest, options?: TransportRequestOptions): Promise + async getServiceCredentials (this: That, params: T.SecurityGetServiceCredentialsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['namespace', 'service'] const querystring: Record = {} const body = undefined @@ -1158,7 +1109,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1180,10 +1131,10 @@ export default class Security { * Retrieve settings for the security system indices * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-settings.html | Elasticsearch API documentation} */ - async getSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async getSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async getSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async getSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async getSettings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async getSettings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async getSettings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async getSettings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -1192,7 +1143,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -1209,31 +1160,23 @@ export default class Security { * Get a token. Create a bearer token for access without requiring basic authentication. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-token.html | Elasticsearch API documentation} */ - async getToken (this: That, params?: T.SecurityGetTokenRequest | TB.SecurityGetTokenRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getToken (this: That, params?: T.SecurityGetTokenRequest | TB.SecurityGetTokenRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getToken (this: That, params?: T.SecurityGetTokenRequest | TB.SecurityGetTokenRequest, options?: TransportRequestOptions): Promise - async getToken (this: That, params?: T.SecurityGetTokenRequest | TB.SecurityGetTokenRequest, options?: TransportRequestOptions): Promise { + async getToken (this: That, params?: T.SecurityGetTokenRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getToken (this: That, params?: T.SecurityGetTokenRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getToken (this: That, params?: T.SecurityGetTokenRequest, options?: TransportRequestOptions): Promise + async getToken (this: That, params?: T.SecurityGetTokenRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['grant_type', 'scope', 'password', 'kerberos_ticket', 'refresh_token', 'username'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1251,10 +1194,10 @@ export default class Security { * Get users. Get information about users in the native realm and built-in users. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-user.html | Elasticsearch API documentation} */ - async getUser (this: That, params?: T.SecurityGetUserRequest | TB.SecurityGetUserRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getUser (this: That, params?: T.SecurityGetUserRequest | TB.SecurityGetUserRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getUser (this: That, params?: T.SecurityGetUserRequest | TB.SecurityGetUserRequest, options?: TransportRequestOptions): Promise - async getUser (this: That, params?: T.SecurityGetUserRequest | TB.SecurityGetUserRequest, options?: TransportRequestOptions): Promise { + async getUser (this: That, params?: T.SecurityGetUserRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getUser (this: That, params?: T.SecurityGetUserRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getUser (this: That, params?: T.SecurityGetUserRequest, options?: TransportRequestOptions): Promise + async getUser (this: That, params?: T.SecurityGetUserRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['username'] const querystring: Record = {} const body = undefined @@ -1263,7 +1206,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1291,10 +1234,10 @@ export default class Security { * Get user privileges. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-user-privileges.html | Elasticsearch API documentation} */ - async getUserPrivileges (this: That, params?: T.SecurityGetUserPrivilegesRequest | TB.SecurityGetUserPrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getUserPrivileges (this: That, params?: T.SecurityGetUserPrivilegesRequest | TB.SecurityGetUserPrivilegesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getUserPrivileges (this: That, params?: T.SecurityGetUserPrivilegesRequest | TB.SecurityGetUserPrivilegesRequest, options?: TransportRequestOptions): Promise - async getUserPrivileges (this: That, params?: T.SecurityGetUserPrivilegesRequest | TB.SecurityGetUserPrivilegesRequest, options?: TransportRequestOptions): Promise { + async getUserPrivileges (this: That, params?: T.SecurityGetUserPrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getUserPrivileges (this: That, params?: T.SecurityGetUserPrivilegesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getUserPrivileges (this: That, params?: T.SecurityGetUserPrivilegesRequest, options?: TransportRequestOptions): Promise + async getUserPrivileges (this: That, params?: T.SecurityGetUserPrivilegesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -1303,7 +1246,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1321,10 +1264,10 @@ export default class Security { * Get a user profile. Get a user's profile using the unique profile ID. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-get-user-profile.html | Elasticsearch API documentation} */ - async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest | TB.SecurityGetUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest | TB.SecurityGetUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest | TB.SecurityGetUserProfileRequest, options?: TransportRequestOptions): Promise - async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest | TB.SecurityGetUserProfileRequest, options?: TransportRequestOptions): Promise { + async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest, options?: TransportRequestOptions): Promise + async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['uid'] const querystring: Record = {} const body = undefined @@ -1332,7 +1275,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1353,30 +1296,22 @@ export default class Security { * Grant an API key. Create an API key on behalf of another user. This API is similar to the create API keys API, however it creates the API key for a user that is different than the user that runs the API. The caller must have authentication credentials (either an access token, or a username and password) for the user on whose behalf the API key will be created. It is not possible to use this API to create an API key without that user’s credentials. The user, for whom the authentication credentials is provided, can optionally "run as" (impersonate) another user. In this case, the API key will be created on behalf of the impersonated user. This API is intended be used by applications that need to create and manage API keys for end users, but cannot guarantee that those users have permission to create API keys on their own behalf. A successful grant API key API call returns a JSON structure that contains the API key, its unique id, and its name. If applicable, it also returns expiration information for the API key in milliseconds. By default, API keys never expire. You can specify expiration information when you create the API keys. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-grant-api-key.html | Elasticsearch API documentation} */ - async grantApiKey (this: That, params: T.SecurityGrantApiKeyRequest | TB.SecurityGrantApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async grantApiKey (this: That, params: T.SecurityGrantApiKeyRequest | TB.SecurityGrantApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> - async grantApiKey (this: That, params: T.SecurityGrantApiKeyRequest | TB.SecurityGrantApiKeyRequest, options?: TransportRequestOptions): Promise - async grantApiKey (this: That, params: T.SecurityGrantApiKeyRequest | TB.SecurityGrantApiKeyRequest, options?: TransportRequestOptions): Promise { + async grantApiKey (this: That, params: T.SecurityGrantApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async grantApiKey (this: That, params: T.SecurityGrantApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> + async grantApiKey (this: That, params: T.SecurityGrantApiKeyRequest, options?: TransportRequestOptions): Promise + async grantApiKey (this: That, params: T.SecurityGrantApiKeyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['api_key', 'grant_type', 'access_token', 'username', 'password', 'run_as'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1394,31 +1329,23 @@ export default class Security { * Check user privileges. Determine whether the specified user has a specified list of privileges. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-has-privileges.html | Elasticsearch API documentation} */ - async hasPrivileges (this: That, params?: T.SecurityHasPrivilegesRequest | TB.SecurityHasPrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async hasPrivileges (this: That, params?: T.SecurityHasPrivilegesRequest | TB.SecurityHasPrivilegesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async hasPrivileges (this: That, params?: T.SecurityHasPrivilegesRequest | TB.SecurityHasPrivilegesRequest, options?: TransportRequestOptions): Promise - async hasPrivileges (this: That, params?: T.SecurityHasPrivilegesRequest | TB.SecurityHasPrivilegesRequest, options?: TransportRequestOptions): Promise { + async hasPrivileges (this: That, params?: T.SecurityHasPrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async hasPrivileges (this: That, params?: T.SecurityHasPrivilegesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async hasPrivileges (this: That, params?: T.SecurityHasPrivilegesRequest, options?: TransportRequestOptions): Promise + async hasPrivileges (this: That, params?: T.SecurityHasPrivilegesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['user'] const acceptedBody: string[] = ['application', 'cluster', 'index'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1446,30 +1373,22 @@ export default class Security { * Check user profile privileges. Determine whether the users associated with the specified user profile IDs have all the requested privileges. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-has-privileges-user-profile.html | Elasticsearch API documentation} */ - async hasPrivilegesUserProfile (this: That, params: T.SecurityHasPrivilegesUserProfileRequest | TB.SecurityHasPrivilegesUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async hasPrivilegesUserProfile (this: That, params: T.SecurityHasPrivilegesUserProfileRequest | TB.SecurityHasPrivilegesUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise> - async hasPrivilegesUserProfile (this: That, params: T.SecurityHasPrivilegesUserProfileRequest | TB.SecurityHasPrivilegesUserProfileRequest, options?: TransportRequestOptions): Promise - async hasPrivilegesUserProfile (this: That, params: T.SecurityHasPrivilegesUserProfileRequest | TB.SecurityHasPrivilegesUserProfileRequest, options?: TransportRequestOptions): Promise { + async hasPrivilegesUserProfile (this: That, params: T.SecurityHasPrivilegesUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async hasPrivilegesUserProfile (this: That, params: T.SecurityHasPrivilegesUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise> + async hasPrivilegesUserProfile (this: That, params: T.SecurityHasPrivilegesUserProfileRequest, options?: TransportRequestOptions): Promise + async hasPrivilegesUserProfile (this: That, params: T.SecurityHasPrivilegesUserProfileRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['uids', 'privileges'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1487,31 +1406,23 @@ export default class Security { * Invalidate API keys. This API invalidates API keys created by the create API key or grant API key APIs. Invalidated API keys fail authentication, but they can still be viewed using the get API key information and query API key information APIs, for at least the configured retention period, until they are automatically deleted. The `manage_api_key` privilege allows deleting any API keys. The `manage_own_api_key` only allows deleting API keys that are owned by the user. In addition, with the `manage_own_api_key` privilege, an invalidation request must be issued in one of the three formats: - Set the parameter `owner=true`. - Or, set both `username` and `realm_name` to match the user’s identity. - Or, if the request is issued by an API key, that is to say an API key invalidates itself, specify its ID in the `ids` field. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-invalidate-api-key.html | Elasticsearch API documentation} */ - async invalidateApiKey (this: That, params?: T.SecurityInvalidateApiKeyRequest | TB.SecurityInvalidateApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async invalidateApiKey (this: That, params?: T.SecurityInvalidateApiKeyRequest | TB.SecurityInvalidateApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> - async invalidateApiKey (this: That, params?: T.SecurityInvalidateApiKeyRequest | TB.SecurityInvalidateApiKeyRequest, options?: TransportRequestOptions): Promise - async invalidateApiKey (this: That, params?: T.SecurityInvalidateApiKeyRequest | TB.SecurityInvalidateApiKeyRequest, options?: TransportRequestOptions): Promise { + async invalidateApiKey (this: That, params?: T.SecurityInvalidateApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async invalidateApiKey (this: That, params?: T.SecurityInvalidateApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> + async invalidateApiKey (this: That, params?: T.SecurityInvalidateApiKeyRequest, options?: TransportRequestOptions): Promise + async invalidateApiKey (this: That, params?: T.SecurityInvalidateApiKeyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['id', 'ids', 'name', 'owner', 'realm_name', 'username'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1529,31 +1440,23 @@ export default class Security { * Invalidate a token. The access tokens returned by the get token API have a finite period of time for which they are valid. After that time period, they can no longer be used. The time period is defined by the `xpack.security.authc.token.timeout` setting. The refresh tokens returned by the get token API are only valid for 24 hours. They can also be used exactly once. If you want to invalidate one or more access or refresh tokens immediately, use this invalidate token API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-invalidate-token.html | Elasticsearch API documentation} */ - async invalidateToken (this: That, params?: T.SecurityInvalidateTokenRequest | TB.SecurityInvalidateTokenRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async invalidateToken (this: That, params?: T.SecurityInvalidateTokenRequest | TB.SecurityInvalidateTokenRequest, options?: TransportRequestOptionsWithMeta): Promise> - async invalidateToken (this: That, params?: T.SecurityInvalidateTokenRequest | TB.SecurityInvalidateTokenRequest, options?: TransportRequestOptions): Promise - async invalidateToken (this: That, params?: T.SecurityInvalidateTokenRequest | TB.SecurityInvalidateTokenRequest, options?: TransportRequestOptions): Promise { + async invalidateToken (this: That, params?: T.SecurityInvalidateTokenRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async invalidateToken (this: That, params?: T.SecurityInvalidateTokenRequest, options?: TransportRequestOptionsWithMeta): Promise> + async invalidateToken (this: That, params?: T.SecurityInvalidateTokenRequest, options?: TransportRequestOptions): Promise + async invalidateToken (this: That, params?: T.SecurityInvalidateTokenRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['token', 'refresh_token', 'realm_name', 'username'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1571,10 +1474,10 @@ export default class Security { * Exchanges an OpenID Connection authentication response message for an Elasticsearch access token and refresh token pair * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-oidc-authenticate.html | Elasticsearch API documentation} */ - async oidcAuthenticate (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async oidcAuthenticate (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async oidcAuthenticate (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async oidcAuthenticate (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async oidcAuthenticate (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async oidcAuthenticate (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async oidcAuthenticate (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async oidcAuthenticate (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -1583,7 +1486,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -1600,10 +1503,10 @@ export default class Security { * Invalidates a refresh token and access token that was generated from the OpenID Connect Authenticate API * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-oidc-logout.html | Elasticsearch API documentation} */ - async oidcLogout (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async oidcLogout (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async oidcLogout (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async oidcLogout (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async oidcLogout (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async oidcLogout (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async oidcLogout (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async oidcLogout (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -1612,7 +1515,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -1629,10 +1532,10 @@ export default class Security { * Creates an OAuth 2.0 authentication request as a URL string * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-oidc-prepare-authentication.html | Elasticsearch API documentation} */ - async oidcPrepareAuthentication (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async oidcPrepareAuthentication (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async oidcPrepareAuthentication (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async oidcPrepareAuthentication (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async oidcPrepareAuthentication (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async oidcPrepareAuthentication (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async oidcPrepareAuthentication (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async oidcPrepareAuthentication (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -1641,7 +1544,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -1658,15 +1561,14 @@ export default class Security { * Create or update application privileges. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-put-privileges.html | Elasticsearch API documentation} */ - async putPrivileges (this: That, params: T.SecurityPutPrivilegesRequest | TB.SecurityPutPrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putPrivileges (this: That, params: T.SecurityPutPrivilegesRequest | TB.SecurityPutPrivilegesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putPrivileges (this: That, params: T.SecurityPutPrivilegesRequest | TB.SecurityPutPrivilegesRequest, options?: TransportRequestOptions): Promise - async putPrivileges (this: That, params: T.SecurityPutPrivilegesRequest | TB.SecurityPutPrivilegesRequest, options?: TransportRequestOptions): Promise { + async putPrivileges (this: That, params: T.SecurityPutPrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putPrivileges (this: That, params: T.SecurityPutPrivilegesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putPrivileges (this: That, params: T.SecurityPutPrivilegesRequest, options?: TransportRequestOptions): Promise + async putPrivileges (this: That, params: T.SecurityPutPrivilegesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['privileges'] const querystring: Record = {} - // @ts-expect-error - let body: any = params.body ?? undefined + let body: any for (const key in params) { if (acceptedBody.includes(key)) { @@ -1674,7 +1576,7 @@ export default class Security { body = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1692,30 +1594,22 @@ export default class Security { * Create or update roles. The role management APIs are generally the preferred way to manage roles in the native realm, rather than using file-based role management. The create or update roles API cannot update roles that are defined in roles files. File-based role management is not available in Elastic Serverless. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-put-role.html | Elasticsearch API documentation} */ - async putRole (this: That, params: T.SecurityPutRoleRequest | TB.SecurityPutRoleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putRole (this: That, params: T.SecurityPutRoleRequest | TB.SecurityPutRoleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putRole (this: That, params: T.SecurityPutRoleRequest | TB.SecurityPutRoleRequest, options?: TransportRequestOptions): Promise - async putRole (this: That, params: T.SecurityPutRoleRequest | TB.SecurityPutRoleRequest, options?: TransportRequestOptions): Promise { + async putRole (this: That, params: T.SecurityPutRoleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putRole (this: That, params: T.SecurityPutRoleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putRole (this: That, params: T.SecurityPutRoleRequest, options?: TransportRequestOptions): Promise + async putRole (this: That, params: T.SecurityPutRoleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const acceptedBody: string[] = ['applications', 'cluster', 'global', 'indices', 'remote_indices', 'remote_cluster', 'metadata', 'run_as', 'description', 'transient_metadata'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1736,30 +1630,22 @@ export default class Security { * Create or update role mappings. Role mappings define which roles are assigned to each user. Each mapping has rules that identify users and a list of roles that are granted to those users. The role mapping APIs are generally the preferred way to manage role mappings rather than using role mapping files. The create or update role mappings API cannot update role mappings that are defined in role mapping files. This API does not create roles. Rather, it maps users to existing roles. Roles can be created by using the create or update roles API or roles files. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-put-role-mapping.html | Elasticsearch API documentation} */ - async putRoleMapping (this: That, params: T.SecurityPutRoleMappingRequest | TB.SecurityPutRoleMappingRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putRoleMapping (this: That, params: T.SecurityPutRoleMappingRequest | TB.SecurityPutRoleMappingRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putRoleMapping (this: That, params: T.SecurityPutRoleMappingRequest | TB.SecurityPutRoleMappingRequest, options?: TransportRequestOptions): Promise - async putRoleMapping (this: That, params: T.SecurityPutRoleMappingRequest | TB.SecurityPutRoleMappingRequest, options?: TransportRequestOptions): Promise { + async putRoleMapping (this: That, params: T.SecurityPutRoleMappingRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putRoleMapping (this: That, params: T.SecurityPutRoleMappingRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putRoleMapping (this: That, params: T.SecurityPutRoleMappingRequest, options?: TransportRequestOptions): Promise + async putRoleMapping (this: That, params: T.SecurityPutRoleMappingRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const acceptedBody: string[] = ['enabled', 'metadata', 'roles', 'role_templates', 'rules', 'run_as'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1780,30 +1666,22 @@ export default class Security { * Create or update users. A password is required for adding a new user but is optional when updating an existing user. To change a user’s password without updating any other fields, use the change password API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-put-user.html | Elasticsearch API documentation} */ - async putUser (this: That, params: T.SecurityPutUserRequest | TB.SecurityPutUserRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putUser (this: That, params: T.SecurityPutUserRequest | TB.SecurityPutUserRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putUser (this: That, params: T.SecurityPutUserRequest | TB.SecurityPutUserRequest, options?: TransportRequestOptions): Promise - async putUser (this: That, params: T.SecurityPutUserRequest | TB.SecurityPutUserRequest, options?: TransportRequestOptions): Promise { + async putUser (this: That, params: T.SecurityPutUserRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putUser (this: That, params: T.SecurityPutUserRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putUser (this: That, params: T.SecurityPutUserRequest, options?: TransportRequestOptions): Promise + async putUser (this: That, params: T.SecurityPutUserRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['username', 'email', 'full_name', 'metadata', 'password', 'password_hash', 'roles', 'enabled'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1824,31 +1702,23 @@ export default class Security { * Find API keys with a query. Get a paginated list of API keys and their information. You can optionally filter the results with a query. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-query-api-key.html | Elasticsearch API documentation} */ - async queryApiKeys (this: That, params?: T.SecurityQueryApiKeysRequest | TB.SecurityQueryApiKeysRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async queryApiKeys (this: That, params?: T.SecurityQueryApiKeysRequest | TB.SecurityQueryApiKeysRequest, options?: TransportRequestOptionsWithMeta): Promise> - async queryApiKeys (this: That, params?: T.SecurityQueryApiKeysRequest | TB.SecurityQueryApiKeysRequest, options?: TransportRequestOptions): Promise - async queryApiKeys (this: That, params?: T.SecurityQueryApiKeysRequest | TB.SecurityQueryApiKeysRequest, options?: TransportRequestOptions): Promise { + async queryApiKeys (this: That, params?: T.SecurityQueryApiKeysRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async queryApiKeys (this: That, params?: T.SecurityQueryApiKeysRequest, options?: TransportRequestOptionsWithMeta): Promise> + async queryApiKeys (this: That, params?: T.SecurityQueryApiKeysRequest, options?: TransportRequestOptions): Promise + async queryApiKeys (this: That, params?: T.SecurityQueryApiKeysRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['aggregations', 'aggs', 'query', 'from', 'sort', 'size', 'search_after'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1866,31 +1736,23 @@ export default class Security { * Find roles with a query. Get roles in a paginated manner. You can optionally filter the results with a query. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-query-role.html | Elasticsearch API documentation} */ - async queryRole (this: That, params?: T.SecurityQueryRoleRequest | TB.SecurityQueryRoleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async queryRole (this: That, params?: T.SecurityQueryRoleRequest | TB.SecurityQueryRoleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async queryRole (this: That, params?: T.SecurityQueryRoleRequest | TB.SecurityQueryRoleRequest, options?: TransportRequestOptions): Promise - async queryRole (this: That, params?: T.SecurityQueryRoleRequest | TB.SecurityQueryRoleRequest, options?: TransportRequestOptions): Promise { + async queryRole (this: That, params?: T.SecurityQueryRoleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async queryRole (this: That, params?: T.SecurityQueryRoleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async queryRole (this: That, params?: T.SecurityQueryRoleRequest, options?: TransportRequestOptions): Promise + async queryRole (this: That, params?: T.SecurityQueryRoleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['query', 'from', 'sort', 'size', 'search_after'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1908,31 +1770,23 @@ export default class Security { * Find users with a query. Get information for users in a paginated manner. You can optionally filter the results with a query. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-query-user.html | Elasticsearch API documentation} */ - async queryUser (this: That, params?: T.SecurityQueryUserRequest | TB.SecurityQueryUserRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async queryUser (this: That, params?: T.SecurityQueryUserRequest | TB.SecurityQueryUserRequest, options?: TransportRequestOptionsWithMeta): Promise> - async queryUser (this: That, params?: T.SecurityQueryUserRequest | TB.SecurityQueryUserRequest, options?: TransportRequestOptions): Promise - async queryUser (this: That, params?: T.SecurityQueryUserRequest | TB.SecurityQueryUserRequest, options?: TransportRequestOptions): Promise { + async queryUser (this: That, params?: T.SecurityQueryUserRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async queryUser (this: That, params?: T.SecurityQueryUserRequest, options?: TransportRequestOptionsWithMeta): Promise> + async queryUser (this: That, params?: T.SecurityQueryUserRequest, options?: TransportRequestOptions): Promise + async queryUser (this: That, params?: T.SecurityQueryUserRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['query', 'from', 'sort', 'size', 'search_after'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1950,30 +1804,22 @@ export default class Security { * Authenticate SAML. Submits a SAML response message to Elasticsearch for consumption. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-saml-authenticate.html | Elasticsearch API documentation} */ - async samlAuthenticate (this: That, params: T.SecuritySamlAuthenticateRequest | TB.SecuritySamlAuthenticateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async samlAuthenticate (this: That, params: T.SecuritySamlAuthenticateRequest | TB.SecuritySamlAuthenticateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async samlAuthenticate (this: That, params: T.SecuritySamlAuthenticateRequest | TB.SecuritySamlAuthenticateRequest, options?: TransportRequestOptions): Promise - async samlAuthenticate (this: That, params: T.SecuritySamlAuthenticateRequest | TB.SecuritySamlAuthenticateRequest, options?: TransportRequestOptions): Promise { + async samlAuthenticate (this: That, params: T.SecuritySamlAuthenticateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async samlAuthenticate (this: That, params: T.SecuritySamlAuthenticateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async samlAuthenticate (this: That, params: T.SecuritySamlAuthenticateRequest, options?: TransportRequestOptions): Promise + async samlAuthenticate (this: That, params: T.SecuritySamlAuthenticateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['content', 'ids', 'realm'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -1991,30 +1837,22 @@ export default class Security { * Logout of SAML completely. Verifies the logout response sent from the SAML IdP. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-saml-complete-logout.html | Elasticsearch API documentation} */ - async samlCompleteLogout (this: That, params: T.SecuritySamlCompleteLogoutRequest | TB.SecuritySamlCompleteLogoutRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async samlCompleteLogout (this: That, params: T.SecuritySamlCompleteLogoutRequest | TB.SecuritySamlCompleteLogoutRequest, options?: TransportRequestOptionsWithMeta): Promise> - async samlCompleteLogout (this: That, params: T.SecuritySamlCompleteLogoutRequest | TB.SecuritySamlCompleteLogoutRequest, options?: TransportRequestOptions): Promise - async samlCompleteLogout (this: That, params: T.SecuritySamlCompleteLogoutRequest | TB.SecuritySamlCompleteLogoutRequest, options?: TransportRequestOptions): Promise { + async samlCompleteLogout (this: That, params: T.SecuritySamlCompleteLogoutRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async samlCompleteLogout (this: That, params: T.SecuritySamlCompleteLogoutRequest, options?: TransportRequestOptionsWithMeta): Promise> + async samlCompleteLogout (this: That, params: T.SecuritySamlCompleteLogoutRequest, options?: TransportRequestOptions): Promise + async samlCompleteLogout (this: That, params: T.SecuritySamlCompleteLogoutRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['realm', 'ids', 'query_string', 'content'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2032,30 +1870,22 @@ export default class Security { * Invalidate SAML. Submits a SAML LogoutRequest message to Elasticsearch for consumption. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-saml-invalidate.html | Elasticsearch API documentation} */ - async samlInvalidate (this: That, params: T.SecuritySamlInvalidateRequest | TB.SecuritySamlInvalidateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async samlInvalidate (this: That, params: T.SecuritySamlInvalidateRequest | TB.SecuritySamlInvalidateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async samlInvalidate (this: That, params: T.SecuritySamlInvalidateRequest | TB.SecuritySamlInvalidateRequest, options?: TransportRequestOptions): Promise - async samlInvalidate (this: That, params: T.SecuritySamlInvalidateRequest | TB.SecuritySamlInvalidateRequest, options?: TransportRequestOptions): Promise { + async samlInvalidate (this: That, params: T.SecuritySamlInvalidateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async samlInvalidate (this: That, params: T.SecuritySamlInvalidateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async samlInvalidate (this: That, params: T.SecuritySamlInvalidateRequest, options?: TransportRequestOptions): Promise + async samlInvalidate (this: That, params: T.SecuritySamlInvalidateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['acs', 'query_string', 'realm'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2073,30 +1903,22 @@ export default class Security { * Logout of SAML. Submits a request to invalidate an access token and refresh token. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-saml-logout.html | Elasticsearch API documentation} */ - async samlLogout (this: That, params: T.SecuritySamlLogoutRequest | TB.SecuritySamlLogoutRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async samlLogout (this: That, params: T.SecuritySamlLogoutRequest | TB.SecuritySamlLogoutRequest, options?: TransportRequestOptionsWithMeta): Promise> - async samlLogout (this: That, params: T.SecuritySamlLogoutRequest | TB.SecuritySamlLogoutRequest, options?: TransportRequestOptions): Promise - async samlLogout (this: That, params: T.SecuritySamlLogoutRequest | TB.SecuritySamlLogoutRequest, options?: TransportRequestOptions): Promise { + async samlLogout (this: That, params: T.SecuritySamlLogoutRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async samlLogout (this: That, params: T.SecuritySamlLogoutRequest, options?: TransportRequestOptionsWithMeta): Promise> + async samlLogout (this: That, params: T.SecuritySamlLogoutRequest, options?: TransportRequestOptions): Promise + async samlLogout (this: That, params: T.SecuritySamlLogoutRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['token', 'refresh_token'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2114,31 +1936,23 @@ export default class Security { * Prepare SAML authentication. Creates a SAML authentication request (``) as a URL string, based on the configuration of the respective SAML realm in Elasticsearch. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-saml-prepare-authentication.html | Elasticsearch API documentation} */ - async samlPrepareAuthentication (this: That, params?: T.SecuritySamlPrepareAuthenticationRequest | TB.SecuritySamlPrepareAuthenticationRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async samlPrepareAuthentication (this: That, params?: T.SecuritySamlPrepareAuthenticationRequest | TB.SecuritySamlPrepareAuthenticationRequest, options?: TransportRequestOptionsWithMeta): Promise> - async samlPrepareAuthentication (this: That, params?: T.SecuritySamlPrepareAuthenticationRequest | TB.SecuritySamlPrepareAuthenticationRequest, options?: TransportRequestOptions): Promise - async samlPrepareAuthentication (this: That, params?: T.SecuritySamlPrepareAuthenticationRequest | TB.SecuritySamlPrepareAuthenticationRequest, options?: TransportRequestOptions): Promise { + async samlPrepareAuthentication (this: That, params?: T.SecuritySamlPrepareAuthenticationRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async samlPrepareAuthentication (this: That, params?: T.SecuritySamlPrepareAuthenticationRequest, options?: TransportRequestOptionsWithMeta): Promise> + async samlPrepareAuthentication (this: That, params?: T.SecuritySamlPrepareAuthenticationRequest, options?: TransportRequestOptions): Promise + async samlPrepareAuthentication (this: That, params?: T.SecuritySamlPrepareAuthenticationRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['acs', 'realm', 'relay_state'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2156,10 +1970,10 @@ export default class Security { * Create SAML service provider metadata. Generate SAML metadata for a SAML 2.0 Service Provider. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-saml-sp-metadata.html | Elasticsearch API documentation} */ - async samlServiceProviderMetadata (this: That, params: T.SecuritySamlServiceProviderMetadataRequest | TB.SecuritySamlServiceProviderMetadataRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async samlServiceProviderMetadata (this: That, params: T.SecuritySamlServiceProviderMetadataRequest | TB.SecuritySamlServiceProviderMetadataRequest, options?: TransportRequestOptionsWithMeta): Promise> - async samlServiceProviderMetadata (this: That, params: T.SecuritySamlServiceProviderMetadataRequest | TB.SecuritySamlServiceProviderMetadataRequest, options?: TransportRequestOptions): Promise - async samlServiceProviderMetadata (this: That, params: T.SecuritySamlServiceProviderMetadataRequest | TB.SecuritySamlServiceProviderMetadataRequest, options?: TransportRequestOptions): Promise { + async samlServiceProviderMetadata (this: That, params: T.SecuritySamlServiceProviderMetadataRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async samlServiceProviderMetadata (this: That, params: T.SecuritySamlServiceProviderMetadataRequest, options?: TransportRequestOptionsWithMeta): Promise> + async samlServiceProviderMetadata (this: That, params: T.SecuritySamlServiceProviderMetadataRequest, options?: TransportRequestOptions): Promise + async samlServiceProviderMetadata (this: That, params: T.SecuritySamlServiceProviderMetadataRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['realm_name'] const querystring: Record = {} const body = undefined @@ -2167,7 +1981,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2188,31 +2002,23 @@ export default class Security { * Suggest a user profile. Get suggestions for user profiles that match specified search criteria. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-suggest-user-profile.html | Elasticsearch API documentation} */ - async suggestUserProfiles (this: That, params?: T.SecuritySuggestUserProfilesRequest | TB.SecuritySuggestUserProfilesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async suggestUserProfiles (this: That, params?: T.SecuritySuggestUserProfilesRequest | TB.SecuritySuggestUserProfilesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async suggestUserProfiles (this: That, params?: T.SecuritySuggestUserProfilesRequest | TB.SecuritySuggestUserProfilesRequest, options?: TransportRequestOptions): Promise - async suggestUserProfiles (this: That, params?: T.SecuritySuggestUserProfilesRequest | TB.SecuritySuggestUserProfilesRequest, options?: TransportRequestOptions): Promise { + async suggestUserProfiles (this: That, params?: T.SecuritySuggestUserProfilesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async suggestUserProfiles (this: That, params?: T.SecuritySuggestUserProfilesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async suggestUserProfiles (this: That, params?: T.SecuritySuggestUserProfilesRequest, options?: TransportRequestOptions): Promise + async suggestUserProfiles (this: That, params?: T.SecuritySuggestUserProfilesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['name', 'size', 'data', 'hint'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2230,30 +2036,22 @@ export default class Security { * Update an API key. Updates attributes of an existing API key. Users can only update API keys that they created or that were granted to them. Use this API to update API keys created by the create API Key or grant API Key APIs. If you need to apply the same update to many API keys, you can use bulk update API Keys to reduce overhead. It’s not possible to update expired API keys, or API keys that have been invalidated by invalidate API Key. This API supports updates to an API key’s access scope and metadata. The access scope of an API key is derived from the `role_descriptors` you specify in the request, and a snapshot of the owner user’s permissions at the time of the request. The snapshot of the owner’s permissions is updated automatically on every call. If you don’t specify `role_descriptors` in the request, a call to this API might still change the API key’s access scope. This change can occur if the owner user’s permissions have changed since the API key was created or last modified. To update another user’s API key, use the `run_as` feature to submit a request on behalf of another user. IMPORTANT: It’s not possible to use an API key as the authentication credential for this API. To update an API key, the owner user’s credentials are required. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-update-api-key.html | Elasticsearch API documentation} */ - async updateApiKey (this: That, params: T.SecurityUpdateApiKeyRequest | TB.SecurityUpdateApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateApiKey (this: That, params: T.SecurityUpdateApiKeyRequest | TB.SecurityUpdateApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateApiKey (this: That, params: T.SecurityUpdateApiKeyRequest | TB.SecurityUpdateApiKeyRequest, options?: TransportRequestOptions): Promise - async updateApiKey (this: That, params: T.SecurityUpdateApiKeyRequest | TB.SecurityUpdateApiKeyRequest, options?: TransportRequestOptions): Promise { + async updateApiKey (this: That, params: T.SecurityUpdateApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateApiKey (this: That, params: T.SecurityUpdateApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateApiKey (this: That, params: T.SecurityUpdateApiKeyRequest, options?: TransportRequestOptions): Promise + async updateApiKey (this: That, params: T.SecurityUpdateApiKeyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const acceptedBody: string[] = ['role_descriptors', 'metadata', 'expiration'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2274,30 +2072,22 @@ export default class Security { * Update a cross-cluster API key. Update the attributes of an existing cross-cluster API key, which is used for API key based remote cluster access. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-update-cross-cluster-api-key.html | Elasticsearch API documentation} */ - async updateCrossClusterApiKey (this: That, params: T.SecurityUpdateCrossClusterApiKeyRequest | TB.SecurityUpdateCrossClusterApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateCrossClusterApiKey (this: That, params: T.SecurityUpdateCrossClusterApiKeyRequest | TB.SecurityUpdateCrossClusterApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateCrossClusterApiKey (this: That, params: T.SecurityUpdateCrossClusterApiKeyRequest | TB.SecurityUpdateCrossClusterApiKeyRequest, options?: TransportRequestOptions): Promise - async updateCrossClusterApiKey (this: That, params: T.SecurityUpdateCrossClusterApiKeyRequest | TB.SecurityUpdateCrossClusterApiKeyRequest, options?: TransportRequestOptions): Promise { + async updateCrossClusterApiKey (this: That, params: T.SecurityUpdateCrossClusterApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateCrossClusterApiKey (this: That, params: T.SecurityUpdateCrossClusterApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateCrossClusterApiKey (this: That, params: T.SecurityUpdateCrossClusterApiKeyRequest, options?: TransportRequestOptions): Promise + async updateCrossClusterApiKey (this: That, params: T.SecurityUpdateCrossClusterApiKeyRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const acceptedBody: string[] = ['access', 'expiration', 'metadata'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -2318,10 +2108,10 @@ export default class Security { * Update settings for the security system index * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-update-settings.html | Elasticsearch API documentation} */ - async updateSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async updateSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async updateSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async updateSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async updateSettings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async updateSettings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async updateSettings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async updateSettings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -2330,7 +2120,7 @@ export default class Security { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -2347,30 +2137,22 @@ export default class Security { * Update user profile data. Update specific data for the user profile that is associated with a unique ID. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-update-user-profile-data.html | Elasticsearch API documentation} */ - async updateUserProfileData (this: That, params: T.SecurityUpdateUserProfileDataRequest | TB.SecurityUpdateUserProfileDataRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateUserProfileData (this: That, params: T.SecurityUpdateUserProfileDataRequest | TB.SecurityUpdateUserProfileDataRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateUserProfileData (this: That, params: T.SecurityUpdateUserProfileDataRequest | TB.SecurityUpdateUserProfileDataRequest, options?: TransportRequestOptions): Promise - async updateUserProfileData (this: That, params: T.SecurityUpdateUserProfileDataRequest | TB.SecurityUpdateUserProfileDataRequest, options?: TransportRequestOptions): Promise { + async updateUserProfileData (this: That, params: T.SecurityUpdateUserProfileDataRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateUserProfileData (this: That, params: T.SecurityUpdateUserProfileDataRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateUserProfileData (this: That, params: T.SecurityUpdateUserProfileDataRequest, options?: TransportRequestOptions): Promise + async updateUserProfileData (this: That, params: T.SecurityUpdateUserProfileDataRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['uid'] const acceptedBody: string[] = ['labels', 'data'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/shutdown.ts b/src/api/api/shutdown.ts index cf83485f3..030c6678b 100644 --- a/src/api/api/shutdown.ts +++ b/src/api/api/shutdown.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Shutdown { @@ -48,10 +47,10 @@ export default class Shutdown { * Removes a node from the shutdown list. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/current | Elasticsearch API documentation} */ - async deleteNode (this: That, params: T.ShutdownDeleteNodeRequest | TB.ShutdownDeleteNodeRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteNode (this: That, params: T.ShutdownDeleteNodeRequest | TB.ShutdownDeleteNodeRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteNode (this: That, params: T.ShutdownDeleteNodeRequest | TB.ShutdownDeleteNodeRequest, options?: TransportRequestOptions): Promise - async deleteNode (this: That, params: T.ShutdownDeleteNodeRequest | TB.ShutdownDeleteNodeRequest, options?: TransportRequestOptions): Promise { + async deleteNode (this: That, params: T.ShutdownDeleteNodeRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteNode (this: That, params: T.ShutdownDeleteNodeRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteNode (this: That, params: T.ShutdownDeleteNodeRequest, options?: TransportRequestOptions): Promise + async deleteNode (this: That, params: T.ShutdownDeleteNodeRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['node_id'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Shutdown { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -80,10 +79,10 @@ export default class Shutdown { * Retrieve status of a node or nodes that are currently marked as shutting down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/current | Elasticsearch API documentation} */ - async getNode (this: That, params?: T.ShutdownGetNodeRequest | TB.ShutdownGetNodeRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getNode (this: That, params?: T.ShutdownGetNodeRequest | TB.ShutdownGetNodeRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getNode (this: That, params?: T.ShutdownGetNodeRequest | TB.ShutdownGetNodeRequest, options?: TransportRequestOptions): Promise - async getNode (this: That, params?: T.ShutdownGetNodeRequest | TB.ShutdownGetNodeRequest, options?: TransportRequestOptions): Promise { + async getNode (this: That, params?: T.ShutdownGetNodeRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getNode (this: That, params?: T.ShutdownGetNodeRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getNode (this: That, params?: T.ShutdownGetNodeRequest, options?: TransportRequestOptions): Promise + async getNode (this: That, params?: T.ShutdownGetNodeRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['node_id'] const querystring: Record = {} const body = undefined @@ -92,7 +91,7 @@ export default class Shutdown { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -120,30 +119,22 @@ export default class Shutdown { * Adds a node to be shut down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/current | Elasticsearch API documentation} */ - async putNode (this: That, params: T.ShutdownPutNodeRequest | TB.ShutdownPutNodeRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putNode (this: That, params: T.ShutdownPutNodeRequest | TB.ShutdownPutNodeRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putNode (this: That, params: T.ShutdownPutNodeRequest | TB.ShutdownPutNodeRequest, options?: TransportRequestOptions): Promise - async putNode (this: That, params: T.ShutdownPutNodeRequest | TB.ShutdownPutNodeRequest, options?: TransportRequestOptions): Promise { + async putNode (this: That, params: T.ShutdownPutNodeRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putNode (this: That, params: T.ShutdownPutNodeRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putNode (this: That, params: T.ShutdownPutNodeRequest, options?: TransportRequestOptions): Promise + async putNode (this: That, params: T.ShutdownPutNodeRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['node_id'] const acceptedBody: string[] = ['type', 'reason', 'allocation_delay', 'target_node_name'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/simulate.ts b/src/api/api/simulate.ts index 03fe8570d..39312b71f 100644 --- a/src/api/api/simulate.ts +++ b/src/api/api/simulate.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Simulate { @@ -48,10 +47,10 @@ export default class Simulate { * Simulates running ingest with example documents. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/simulate-ingest-api.html | Elasticsearch API documentation} */ - async ingest (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async ingest (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async ingest (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async ingest (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async ingest (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async ingest (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async ingest (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async ingest (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const querystring: Record = {} const body = undefined @@ -60,7 +59,7 @@ export default class Simulate { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } diff --git a/src/api/api/slm.ts b/src/api/api/slm.ts index 13c0ebe15..fc14d3663 100644 --- a/src/api/api/slm.ts +++ b/src/api/api/slm.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Slm { @@ -48,10 +47,10 @@ export default class Slm { * Deletes an existing snapshot lifecycle policy. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-delete-policy.html | Elasticsearch API documentation} */ - async deleteLifecycle (this: That, params: T.SlmDeleteLifecycleRequest | TB.SlmDeleteLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteLifecycle (this: That, params: T.SlmDeleteLifecycleRequest | TB.SlmDeleteLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteLifecycle (this: That, params: T.SlmDeleteLifecycleRequest | TB.SlmDeleteLifecycleRequest, options?: TransportRequestOptions): Promise - async deleteLifecycle (this: That, params: T.SlmDeleteLifecycleRequest | TB.SlmDeleteLifecycleRequest, options?: TransportRequestOptions): Promise { + async deleteLifecycle (this: That, params: T.SlmDeleteLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteLifecycle (this: That, params: T.SlmDeleteLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteLifecycle (this: That, params: T.SlmDeleteLifecycleRequest, options?: TransportRequestOptions): Promise + async deleteLifecycle (this: That, params: T.SlmDeleteLifecycleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['policy_id'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Slm { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -80,10 +79,10 @@ export default class Slm { * Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-execute-lifecycle.html | Elasticsearch API documentation} */ - async executeLifecycle (this: That, params: T.SlmExecuteLifecycleRequest | TB.SlmExecuteLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async executeLifecycle (this: That, params: T.SlmExecuteLifecycleRequest | TB.SlmExecuteLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async executeLifecycle (this: That, params: T.SlmExecuteLifecycleRequest | TB.SlmExecuteLifecycleRequest, options?: TransportRequestOptions): Promise - async executeLifecycle (this: That, params: T.SlmExecuteLifecycleRequest | TB.SlmExecuteLifecycleRequest, options?: TransportRequestOptions): Promise { + async executeLifecycle (this: That, params: T.SlmExecuteLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async executeLifecycle (this: That, params: T.SlmExecuteLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async executeLifecycle (this: That, params: T.SlmExecuteLifecycleRequest, options?: TransportRequestOptions): Promise + async executeLifecycle (this: That, params: T.SlmExecuteLifecycleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['policy_id'] const querystring: Record = {} const body = undefined @@ -91,7 +90,7 @@ export default class Slm { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -112,10 +111,10 @@ export default class Slm { * Deletes any snapshots that are expired according to the policy's retention rules. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-execute-retention.html | Elasticsearch API documentation} */ - async executeRetention (this: That, params?: T.SlmExecuteRetentionRequest | TB.SlmExecuteRetentionRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async executeRetention (this: That, params?: T.SlmExecuteRetentionRequest | TB.SlmExecuteRetentionRequest, options?: TransportRequestOptionsWithMeta): Promise> - async executeRetention (this: That, params?: T.SlmExecuteRetentionRequest | TB.SlmExecuteRetentionRequest, options?: TransportRequestOptions): Promise - async executeRetention (this: That, params?: T.SlmExecuteRetentionRequest | TB.SlmExecuteRetentionRequest, options?: TransportRequestOptions): Promise { + async executeRetention (this: That, params?: T.SlmExecuteRetentionRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async executeRetention (this: That, params?: T.SlmExecuteRetentionRequest, options?: TransportRequestOptionsWithMeta): Promise> + async executeRetention (this: That, params?: T.SlmExecuteRetentionRequest, options?: TransportRequestOptions): Promise + async executeRetention (this: That, params?: T.SlmExecuteRetentionRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -124,7 +123,7 @@ export default class Slm { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -142,10 +141,10 @@ export default class Slm { * Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-get-policy.html | Elasticsearch API documentation} */ - async getLifecycle (this: That, params?: T.SlmGetLifecycleRequest | TB.SlmGetLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getLifecycle (this: That, params?: T.SlmGetLifecycleRequest | TB.SlmGetLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getLifecycle (this: That, params?: T.SlmGetLifecycleRequest | TB.SlmGetLifecycleRequest, options?: TransportRequestOptions): Promise - async getLifecycle (this: That, params?: T.SlmGetLifecycleRequest | TB.SlmGetLifecycleRequest, options?: TransportRequestOptions): Promise { + async getLifecycle (this: That, params?: T.SlmGetLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getLifecycle (this: That, params?: T.SlmGetLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getLifecycle (this: That, params?: T.SlmGetLifecycleRequest, options?: TransportRequestOptions): Promise + async getLifecycle (this: That, params?: T.SlmGetLifecycleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['policy_id'] const querystring: Record = {} const body = undefined @@ -154,7 +153,7 @@ export default class Slm { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -182,10 +181,10 @@ export default class Slm { * Returns global and policy-level statistics about actions taken by snapshot lifecycle management. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-get-stats.html | Elasticsearch API documentation} */ - async getStats (this: That, params?: T.SlmGetStatsRequest | TB.SlmGetStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getStats (this: That, params?: T.SlmGetStatsRequest | TB.SlmGetStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getStats (this: That, params?: T.SlmGetStatsRequest | TB.SlmGetStatsRequest, options?: TransportRequestOptions): Promise - async getStats (this: That, params?: T.SlmGetStatsRequest | TB.SlmGetStatsRequest, options?: TransportRequestOptions): Promise { + async getStats (this: That, params?: T.SlmGetStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getStats (this: That, params?: T.SlmGetStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getStats (this: That, params?: T.SlmGetStatsRequest, options?: TransportRequestOptions): Promise + async getStats (this: That, params?: T.SlmGetStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -194,7 +193,7 @@ export default class Slm { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -212,10 +211,10 @@ export default class Slm { * Retrieves the status of snapshot lifecycle management (SLM). * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-get-status.html | Elasticsearch API documentation} */ - async getStatus (this: That, params?: T.SlmGetStatusRequest | TB.SlmGetStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getStatus (this: That, params?: T.SlmGetStatusRequest | TB.SlmGetStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getStatus (this: That, params?: T.SlmGetStatusRequest | TB.SlmGetStatusRequest, options?: TransportRequestOptions): Promise - async getStatus (this: That, params?: T.SlmGetStatusRequest | TB.SlmGetStatusRequest, options?: TransportRequestOptions): Promise { + async getStatus (this: That, params?: T.SlmGetStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getStatus (this: That, params?: T.SlmGetStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getStatus (this: That, params?: T.SlmGetStatusRequest, options?: TransportRequestOptions): Promise + async getStatus (this: That, params?: T.SlmGetStatusRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -224,7 +223,7 @@ export default class Slm { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -242,30 +241,22 @@ export default class Slm { * Creates or updates a snapshot lifecycle policy. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-put-policy.html | Elasticsearch API documentation} */ - async putLifecycle (this: That, params: T.SlmPutLifecycleRequest | TB.SlmPutLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putLifecycle (this: That, params: T.SlmPutLifecycleRequest | TB.SlmPutLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putLifecycle (this: That, params: T.SlmPutLifecycleRequest | TB.SlmPutLifecycleRequest, options?: TransportRequestOptions): Promise - async putLifecycle (this: That, params: T.SlmPutLifecycleRequest | TB.SlmPutLifecycleRequest, options?: TransportRequestOptions): Promise { + async putLifecycle (this: That, params: T.SlmPutLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putLifecycle (this: That, params: T.SlmPutLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putLifecycle (this: That, params: T.SlmPutLifecycleRequest, options?: TransportRequestOptions): Promise + async putLifecycle (this: That, params: T.SlmPutLifecycleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['policy_id'] const acceptedBody: string[] = ['config', 'name', 'repository', 'retention', 'schedule'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -286,10 +277,10 @@ export default class Slm { * Turns on snapshot lifecycle management (SLM). * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-start.html | Elasticsearch API documentation} */ - async start (this: That, params?: T.SlmStartRequest | TB.SlmStartRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async start (this: That, params?: T.SlmStartRequest | TB.SlmStartRequest, options?: TransportRequestOptionsWithMeta): Promise> - async start (this: That, params?: T.SlmStartRequest | TB.SlmStartRequest, options?: TransportRequestOptions): Promise - async start (this: That, params?: T.SlmStartRequest | TB.SlmStartRequest, options?: TransportRequestOptions): Promise { + async start (this: That, params?: T.SlmStartRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async start (this: That, params?: T.SlmStartRequest, options?: TransportRequestOptionsWithMeta): Promise> + async start (this: That, params?: T.SlmStartRequest, options?: TransportRequestOptions): Promise + async start (this: That, params?: T.SlmStartRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -298,7 +289,7 @@ export default class Slm { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -316,10 +307,10 @@ export default class Slm { * Turns off snapshot lifecycle management (SLM). * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-stop.html | Elasticsearch API documentation} */ - async stop (this: That, params?: T.SlmStopRequest | TB.SlmStopRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async stop (this: That, params?: T.SlmStopRequest | TB.SlmStopRequest, options?: TransportRequestOptionsWithMeta): Promise> - async stop (this: That, params?: T.SlmStopRequest | TB.SlmStopRequest, options?: TransportRequestOptions): Promise - async stop (this: That, params?: T.SlmStopRequest | TB.SlmStopRequest, options?: TransportRequestOptions): Promise { + async stop (this: That, params?: T.SlmStopRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async stop (this: That, params?: T.SlmStopRequest, options?: TransportRequestOptionsWithMeta): Promise> + async stop (this: That, params?: T.SlmStopRequest, options?: TransportRequestOptions): Promise + async stop (this: That, params?: T.SlmStopRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -328,7 +319,7 @@ export default class Slm { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/snapshot.ts b/src/api/api/snapshot.ts index fa39128ed..4dbb490a8 100644 --- a/src/api/api/snapshot.ts +++ b/src/api/api/snapshot.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Snapshot { @@ -48,10 +47,10 @@ export default class Snapshot { * Triggers the review of a snapshot repository’s contents and deletes any stale data not referenced by existing snapshots. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/clean-up-snapshot-repo-api.html | Elasticsearch API documentation} */ - async cleanupRepository (this: That, params: T.SnapshotCleanupRepositoryRequest | TB.SnapshotCleanupRepositoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async cleanupRepository (this: That, params: T.SnapshotCleanupRepositoryRequest | TB.SnapshotCleanupRepositoryRequest, options?: TransportRequestOptionsWithMeta): Promise> - async cleanupRepository (this: That, params: T.SnapshotCleanupRepositoryRequest | TB.SnapshotCleanupRepositoryRequest, options?: TransportRequestOptions): Promise - async cleanupRepository (this: That, params: T.SnapshotCleanupRepositoryRequest | TB.SnapshotCleanupRepositoryRequest, options?: TransportRequestOptions): Promise { + async cleanupRepository (this: That, params: T.SnapshotCleanupRepositoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async cleanupRepository (this: That, params: T.SnapshotCleanupRepositoryRequest, options?: TransportRequestOptionsWithMeta): Promise> + async cleanupRepository (this: That, params: T.SnapshotCleanupRepositoryRequest, options?: TransportRequestOptions): Promise + async cleanupRepository (this: That, params: T.SnapshotCleanupRepositoryRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Snapshot { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -80,30 +79,22 @@ export default class Snapshot { * Clones indices from one snapshot into another snapshot in the same repository. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-snapshots.html | Elasticsearch API documentation} */ - async clone (this: That, params: T.SnapshotCloneRequest | TB.SnapshotCloneRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async clone (this: That, params: T.SnapshotCloneRequest | TB.SnapshotCloneRequest, options?: TransportRequestOptionsWithMeta): Promise> - async clone (this: That, params: T.SnapshotCloneRequest | TB.SnapshotCloneRequest, options?: TransportRequestOptions): Promise - async clone (this: That, params: T.SnapshotCloneRequest | TB.SnapshotCloneRequest, options?: TransportRequestOptions): Promise { + async clone (this: That, params: T.SnapshotCloneRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async clone (this: That, params: T.SnapshotCloneRequest, options?: TransportRequestOptionsWithMeta): Promise> + async clone (this: That, params: T.SnapshotCloneRequest, options?: TransportRequestOptions): Promise + async clone (this: That, params: T.SnapshotCloneRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['repository', 'snapshot', 'target_snapshot'] const acceptedBody: string[] = ['indices'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -126,30 +117,22 @@ export default class Snapshot { * Creates a snapshot in a repository. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-snapshots.html | Elasticsearch API documentation} */ - async create (this: That, params: T.SnapshotCreateRequest | TB.SnapshotCreateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async create (this: That, params: T.SnapshotCreateRequest | TB.SnapshotCreateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async create (this: That, params: T.SnapshotCreateRequest | TB.SnapshotCreateRequest, options?: TransportRequestOptions): Promise - async create (this: That, params: T.SnapshotCreateRequest | TB.SnapshotCreateRequest, options?: TransportRequestOptions): Promise { + async create (this: That, params: T.SnapshotCreateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async create (this: That, params: T.SnapshotCreateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async create (this: That, params: T.SnapshotCreateRequest, options?: TransportRequestOptions): Promise + async create (this: That, params: T.SnapshotCreateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['repository', 'snapshot'] const acceptedBody: string[] = ['ignore_unavailable', 'include_global_state', 'indices', 'feature_states', 'metadata', 'partial'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -171,15 +154,14 @@ export default class Snapshot { * Creates a repository. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-snapshots.html | Elasticsearch API documentation} */ - async createRepository (this: That, params: T.SnapshotCreateRepositoryRequest | TB.SnapshotCreateRepositoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async createRepository (this: That, params: T.SnapshotCreateRepositoryRequest | TB.SnapshotCreateRepositoryRequest, options?: TransportRequestOptionsWithMeta): Promise> - async createRepository (this: That, params: T.SnapshotCreateRepositoryRequest | TB.SnapshotCreateRepositoryRequest, options?: TransportRequestOptions): Promise - async createRepository (this: That, params: T.SnapshotCreateRepositoryRequest | TB.SnapshotCreateRepositoryRequest, options?: TransportRequestOptions): Promise { + async createRepository (this: That, params: T.SnapshotCreateRepositoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async createRepository (this: That, params: T.SnapshotCreateRepositoryRequest, options?: TransportRequestOptionsWithMeta): Promise> + async createRepository (this: That, params: T.SnapshotCreateRepositoryRequest, options?: TransportRequestOptions): Promise + async createRepository (this: That, params: T.SnapshotCreateRepositoryRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const acceptedBody: string[] = ['repository'] const querystring: Record = {} - // @ts-expect-error - let body: any = params.body ?? undefined + let body: any for (const key in params) { if (acceptedBody.includes(key)) { @@ -187,7 +169,7 @@ export default class Snapshot { body = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -208,10 +190,10 @@ export default class Snapshot { * Deletes one or more snapshots. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-snapshots.html | Elasticsearch API documentation} */ - async delete (this: That, params: T.SnapshotDeleteRequest | TB.SnapshotDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async delete (this: That, params: T.SnapshotDeleteRequest | TB.SnapshotDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> - async delete (this: That, params: T.SnapshotDeleteRequest | TB.SnapshotDeleteRequest, options?: TransportRequestOptions): Promise - async delete (this: That, params: T.SnapshotDeleteRequest | TB.SnapshotDeleteRequest, options?: TransportRequestOptions): Promise { + async delete (this: That, params: T.SnapshotDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async delete (this: That, params: T.SnapshotDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise> + async delete (this: That, params: T.SnapshotDeleteRequest, options?: TransportRequestOptions): Promise + async delete (this: That, params: T.SnapshotDeleteRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['repository', 'snapshot'] const querystring: Record = {} const body = undefined @@ -219,7 +201,7 @@ export default class Snapshot { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -241,10 +223,10 @@ export default class Snapshot { * Deletes a repository. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-snapshots.html | Elasticsearch API documentation} */ - async deleteRepository (this: That, params: T.SnapshotDeleteRepositoryRequest | TB.SnapshotDeleteRepositoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteRepository (this: That, params: T.SnapshotDeleteRepositoryRequest | TB.SnapshotDeleteRepositoryRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteRepository (this: That, params: T.SnapshotDeleteRepositoryRequest | TB.SnapshotDeleteRepositoryRequest, options?: TransportRequestOptions): Promise - async deleteRepository (this: That, params: T.SnapshotDeleteRepositoryRequest | TB.SnapshotDeleteRepositoryRequest, options?: TransportRequestOptions): Promise { + async deleteRepository (this: That, params: T.SnapshotDeleteRepositoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteRepository (this: That, params: T.SnapshotDeleteRepositoryRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteRepository (this: That, params: T.SnapshotDeleteRepositoryRequest, options?: TransportRequestOptions): Promise + async deleteRepository (this: That, params: T.SnapshotDeleteRepositoryRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -252,7 +234,7 @@ export default class Snapshot { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -273,10 +255,10 @@ export default class Snapshot { * Returns information about a snapshot. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-snapshots.html | Elasticsearch API documentation} */ - async get (this: That, params: T.SnapshotGetRequest | TB.SnapshotGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async get (this: That, params: T.SnapshotGetRequest | TB.SnapshotGetRequest, options?: TransportRequestOptionsWithMeta): Promise> - async get (this: That, params: T.SnapshotGetRequest | TB.SnapshotGetRequest, options?: TransportRequestOptions): Promise - async get (this: That, params: T.SnapshotGetRequest | TB.SnapshotGetRequest, options?: TransportRequestOptions): Promise { + async get (this: That, params: T.SnapshotGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async get (this: That, params: T.SnapshotGetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async get (this: That, params: T.SnapshotGetRequest, options?: TransportRequestOptions): Promise + async get (this: That, params: T.SnapshotGetRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['repository', 'snapshot'] const querystring: Record = {} const body = undefined @@ -284,7 +266,7 @@ export default class Snapshot { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -306,10 +288,10 @@ export default class Snapshot { * Returns information about a repository. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-snapshots.html | Elasticsearch API documentation} */ - async getRepository (this: That, params?: T.SnapshotGetRepositoryRequest | TB.SnapshotGetRepositoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getRepository (this: That, params?: T.SnapshotGetRepositoryRequest | TB.SnapshotGetRepositoryRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getRepository (this: That, params?: T.SnapshotGetRepositoryRequest | TB.SnapshotGetRepositoryRequest, options?: TransportRequestOptions): Promise - async getRepository (this: That, params?: T.SnapshotGetRepositoryRequest | TB.SnapshotGetRepositoryRequest, options?: TransportRequestOptions): Promise { + async getRepository (this: That, params?: T.SnapshotGetRepositoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getRepository (this: That, params?: T.SnapshotGetRepositoryRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getRepository (this: That, params?: T.SnapshotGetRepositoryRequest, options?: TransportRequestOptions): Promise + async getRepository (this: That, params?: T.SnapshotGetRepositoryRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -318,7 +300,7 @@ export default class Snapshot { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -346,10 +328,10 @@ export default class Snapshot { * Analyzes a repository for correctness and performance * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-snapshots.html | Elasticsearch API documentation} */ - async repositoryAnalyze (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async repositoryAnalyze (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async repositoryAnalyze (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async repositoryAnalyze (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async repositoryAnalyze (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async repositoryAnalyze (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async repositoryAnalyze (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async repositoryAnalyze (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['repository'] const querystring: Record = {} const body = undefined @@ -358,7 +340,7 @@ export default class Snapshot { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -378,10 +360,10 @@ export default class Snapshot { * Verifies the integrity of the contents of a snapshot repository * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-snapshots.html | Elasticsearch API documentation} */ - async repositoryVerifyIntegrity (this: That, params: T.SnapshotRepositoryVerifyIntegrityRequest | TB.SnapshotRepositoryVerifyIntegrityRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async repositoryVerifyIntegrity (this: That, params: T.SnapshotRepositoryVerifyIntegrityRequest | TB.SnapshotRepositoryVerifyIntegrityRequest, options?: TransportRequestOptionsWithMeta): Promise> - async repositoryVerifyIntegrity (this: That, params: T.SnapshotRepositoryVerifyIntegrityRequest | TB.SnapshotRepositoryVerifyIntegrityRequest, options?: TransportRequestOptions): Promise - async repositoryVerifyIntegrity (this: That, params: T.SnapshotRepositoryVerifyIntegrityRequest | TB.SnapshotRepositoryVerifyIntegrityRequest, options?: TransportRequestOptions): Promise { + async repositoryVerifyIntegrity (this: That, params: T.SnapshotRepositoryVerifyIntegrityRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async repositoryVerifyIntegrity (this: That, params: T.SnapshotRepositoryVerifyIntegrityRequest, options?: TransportRequestOptionsWithMeta): Promise> + async repositoryVerifyIntegrity (this: That, params: T.SnapshotRepositoryVerifyIntegrityRequest, options?: TransportRequestOptions): Promise + async repositoryVerifyIntegrity (this: That, params: T.SnapshotRepositoryVerifyIntegrityRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -389,7 +371,7 @@ export default class Snapshot { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -410,30 +392,22 @@ export default class Snapshot { * Restores a snapshot. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-snapshots.html | Elasticsearch API documentation} */ - async restore (this: That, params: T.SnapshotRestoreRequest | TB.SnapshotRestoreRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async restore (this: That, params: T.SnapshotRestoreRequest | TB.SnapshotRestoreRequest, options?: TransportRequestOptionsWithMeta): Promise> - async restore (this: That, params: T.SnapshotRestoreRequest | TB.SnapshotRestoreRequest, options?: TransportRequestOptions): Promise - async restore (this: That, params: T.SnapshotRestoreRequest | TB.SnapshotRestoreRequest, options?: TransportRequestOptions): Promise { + async restore (this: That, params: T.SnapshotRestoreRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async restore (this: That, params: T.SnapshotRestoreRequest, options?: TransportRequestOptionsWithMeta): Promise> + async restore (this: That, params: T.SnapshotRestoreRequest, options?: TransportRequestOptions): Promise + async restore (this: That, params: T.SnapshotRestoreRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['repository', 'snapshot'] const acceptedBody: string[] = ['feature_states', 'ignore_index_settings', 'ignore_unavailable', 'include_aliases', 'include_global_state', 'index_settings', 'indices', 'partial', 'rename_pattern', 'rename_replacement'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -455,10 +429,10 @@ export default class Snapshot { * Returns information about the status of a snapshot. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-snapshots.html | Elasticsearch API documentation} */ - async status (this: That, params?: T.SnapshotStatusRequest | TB.SnapshotStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async status (this: That, params?: T.SnapshotStatusRequest | TB.SnapshotStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> - async status (this: That, params?: T.SnapshotStatusRequest | TB.SnapshotStatusRequest, options?: TransportRequestOptions): Promise - async status (this: That, params?: T.SnapshotStatusRequest | TB.SnapshotStatusRequest, options?: TransportRequestOptions): Promise { + async status (this: That, params?: T.SnapshotStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async status (this: That, params?: T.SnapshotStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> + async status (this: That, params?: T.SnapshotStatusRequest, options?: TransportRequestOptions): Promise + async status (this: That, params?: T.SnapshotStatusRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['repository', 'snapshot'] const querystring: Record = {} const body = undefined @@ -467,7 +441,7 @@ export default class Snapshot { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -499,10 +473,10 @@ export default class Snapshot { * Verifies a repository. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-snapshots.html | Elasticsearch API documentation} */ - async verifyRepository (this: That, params: T.SnapshotVerifyRepositoryRequest | TB.SnapshotVerifyRepositoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async verifyRepository (this: That, params: T.SnapshotVerifyRepositoryRequest | TB.SnapshotVerifyRepositoryRequest, options?: TransportRequestOptionsWithMeta): Promise> - async verifyRepository (this: That, params: T.SnapshotVerifyRepositoryRequest | TB.SnapshotVerifyRepositoryRequest, options?: TransportRequestOptions): Promise - async verifyRepository (this: That, params: T.SnapshotVerifyRepositoryRequest | TB.SnapshotVerifyRepositoryRequest, options?: TransportRequestOptions): Promise { + async verifyRepository (this: That, params: T.SnapshotVerifyRepositoryRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async verifyRepository (this: That, params: T.SnapshotVerifyRepositoryRequest, options?: TransportRequestOptionsWithMeta): Promise> + async verifyRepository (this: That, params: T.SnapshotVerifyRepositoryRequest, options?: TransportRequestOptions): Promise + async verifyRepository (this: That, params: T.SnapshotVerifyRepositoryRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] const querystring: Record = {} const body = undefined @@ -510,7 +484,7 @@ export default class Snapshot { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/sql.ts b/src/api/api/sql.ts index 7a97dfe85..617779506 100644 --- a/src/api/api/sql.ts +++ b/src/api/api/sql.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Sql { @@ -45,33 +44,25 @@ export default class Sql { } /** - * Clears the SQL cursor + * Clear an SQL search cursor. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/clear-sql-cursor-api.html | Elasticsearch API documentation} */ - async clearCursor (this: That, params: T.SqlClearCursorRequest | TB.SqlClearCursorRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async clearCursor (this: That, params: T.SqlClearCursorRequest | TB.SqlClearCursorRequest, options?: TransportRequestOptionsWithMeta): Promise> - async clearCursor (this: That, params: T.SqlClearCursorRequest | TB.SqlClearCursorRequest, options?: TransportRequestOptions): Promise - async clearCursor (this: That, params: T.SqlClearCursorRequest | TB.SqlClearCursorRequest, options?: TransportRequestOptions): Promise { + async clearCursor (this: That, params: T.SqlClearCursorRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async clearCursor (this: That, params: T.SqlClearCursorRequest, options?: TransportRequestOptionsWithMeta): Promise> + async clearCursor (this: That, params: T.SqlClearCursorRequest, options?: TransportRequestOptions): Promise + async clearCursor (this: That, params: T.SqlClearCursorRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['cursor'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -86,13 +77,13 @@ export default class Sql { } /** - * Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. + * Delete an async SQL search. Delete an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-async-sql-search-api.html | Elasticsearch API documentation} */ - async deleteAsync (this: That, params: T.SqlDeleteAsyncRequest | TB.SqlDeleteAsyncRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteAsync (this: That, params: T.SqlDeleteAsyncRequest | TB.SqlDeleteAsyncRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteAsync (this: That, params: T.SqlDeleteAsyncRequest | TB.SqlDeleteAsyncRequest, options?: TransportRequestOptions): Promise - async deleteAsync (this: That, params: T.SqlDeleteAsyncRequest | TB.SqlDeleteAsyncRequest, options?: TransportRequestOptions): Promise { + async deleteAsync (this: That, params: T.SqlDeleteAsyncRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteAsync (this: That, params: T.SqlDeleteAsyncRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteAsync (this: That, params: T.SqlDeleteAsyncRequest, options?: TransportRequestOptions): Promise + async deleteAsync (this: That, params: T.SqlDeleteAsyncRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -100,7 +91,7 @@ export default class Sql { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -118,13 +109,13 @@ export default class Sql { } /** - * Returns the current status and available results for an async SQL search or stored synchronous SQL search + * Get async SQL search results. Get the current status and available results for an async SQL search or stored synchronous SQL search. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-async-sql-search-api.html | Elasticsearch API documentation} */ - async getAsync (this: That, params: T.SqlGetAsyncRequest | TB.SqlGetAsyncRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getAsync (this: That, params: T.SqlGetAsyncRequest | TB.SqlGetAsyncRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getAsync (this: That, params: T.SqlGetAsyncRequest | TB.SqlGetAsyncRequest, options?: TransportRequestOptions): Promise - async getAsync (this: That, params: T.SqlGetAsyncRequest | TB.SqlGetAsyncRequest, options?: TransportRequestOptions): Promise { + async getAsync (this: That, params: T.SqlGetAsyncRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getAsync (this: That, params: T.SqlGetAsyncRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getAsync (this: That, params: T.SqlGetAsyncRequest, options?: TransportRequestOptions): Promise + async getAsync (this: That, params: T.SqlGetAsyncRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -132,7 +123,7 @@ export default class Sql { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -150,13 +141,13 @@ export default class Sql { } /** - * Returns the current status of an async SQL search or a stored synchronous SQL search + * Get the async SQL search status. Get the current status of an async SQL search or a stored synchronous SQL search. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-async-sql-search-status-api.html | Elasticsearch API documentation} */ - async getAsyncStatus (this: That, params: T.SqlGetAsyncStatusRequest | TB.SqlGetAsyncStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getAsyncStatus (this: That, params: T.SqlGetAsyncStatusRequest | TB.SqlGetAsyncStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getAsyncStatus (this: That, params: T.SqlGetAsyncStatusRequest | TB.SqlGetAsyncStatusRequest, options?: TransportRequestOptions): Promise - async getAsyncStatus (this: That, params: T.SqlGetAsyncStatusRequest | TB.SqlGetAsyncStatusRequest, options?: TransportRequestOptions): Promise { + async getAsyncStatus (this: That, params: T.SqlGetAsyncStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getAsyncStatus (this: That, params: T.SqlGetAsyncStatusRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getAsyncStatus (this: That, params: T.SqlGetAsyncStatusRequest, options?: TransportRequestOptions): Promise + async getAsyncStatus (this: That, params: T.SqlGetAsyncStatusRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -164,7 +155,7 @@ export default class Sql { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -182,34 +173,26 @@ export default class Sql { } /** - * Executes a SQL request + * Get SQL search results. Run an SQL request. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/sql-search-api.html | Elasticsearch API documentation} */ - async query (this: That, params?: T.SqlQueryRequest | TB.SqlQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async query (this: That, params?: T.SqlQueryRequest | TB.SqlQueryRequest, options?: TransportRequestOptionsWithMeta): Promise> - async query (this: That, params?: T.SqlQueryRequest | TB.SqlQueryRequest, options?: TransportRequestOptions): Promise - async query (this: That, params?: T.SqlQueryRequest | TB.SqlQueryRequest, options?: TransportRequestOptions): Promise { + async query (this: That, params?: T.SqlQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async query (this: That, params?: T.SqlQueryRequest, options?: TransportRequestOptionsWithMeta): Promise> + async query (this: That, params?: T.SqlQueryRequest, options?: TransportRequestOptions): Promise + async query (this: That, params?: T.SqlQueryRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['catalog', 'columnar', 'cursor', 'fetch_size', 'filter', 'query', 'request_timeout', 'page_timeout', 'time_zone', 'field_multi_value_leniency', 'runtime_mappings', 'wait_for_completion_timeout', 'params', 'keep_alive', 'keep_on_completion', 'index_using_frozen'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -224,33 +207,25 @@ export default class Sql { } /** - * Translates SQL into Elasticsearch queries + * Translate SQL into Elasticsearch queries. Translate an SQL search into a search API request containing Query DSL. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/sql-translate-api.html | Elasticsearch API documentation} */ - async translate (this: That, params: T.SqlTranslateRequest | TB.SqlTranslateRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async translate (this: That, params: T.SqlTranslateRequest | TB.SqlTranslateRequest, options?: TransportRequestOptionsWithMeta): Promise> - async translate (this: That, params: T.SqlTranslateRequest | TB.SqlTranslateRequest, options?: TransportRequestOptions): Promise - async translate (this: That, params: T.SqlTranslateRequest | TB.SqlTranslateRequest, options?: TransportRequestOptions): Promise { + async translate (this: That, params: T.SqlTranslateRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async translate (this: That, params: T.SqlTranslateRequest, options?: TransportRequestOptionsWithMeta): Promise> + async translate (this: That, params: T.SqlTranslateRequest, options?: TransportRequestOptions): Promise + async translate (this: That, params: T.SqlTranslateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['fetch_size', 'filter', 'query', 'time_zone'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/ssl.ts b/src/api/api/ssl.ts index aa0d2a04e..ed2d6fbec 100644 --- a/src/api/api/ssl.ts +++ b/src/api/api/ssl.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Ssl { @@ -48,10 +47,10 @@ export default class Ssl { * Get SSL certificates. Get information about the X.509 certificates that are used to encrypt communications in the cluster. The API returns a list that includes certificates from all TLS contexts including: - Settings for transport and HTTP interfaces - TLS settings that are used within authentication realms - TLS settings for remote monitoring exporters The list includes certificates that are used for configuring trust, such as those configured in the `xpack.security.transport.ssl.truststore` and `xpack.security.transport.ssl.certificate_authorities` settings. It also includes certificates that are used for configuring server identity, such as `xpack.security.http.ssl.keystore` and `xpack.security.http.ssl.certificate settings`. The list does not include certificates that are sourced from the default SSL context of the Java Runtime Environment (JRE), even if those certificates are in use within Elasticsearch. NOTE: When a PKCS#11 token is configured as the truststore of the JRE, the API returns all the certificates that are included in the PKCS#11 token irrespective of whether these are used in the Elasticsearch TLS configuration. If Elasticsearch is configured to use a keystore or truststore, the API output includes all certificates in that store, even though some of the certificates might not be in active use within the cluster. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-ssl.html | Elasticsearch API documentation} */ - async certificates (this: That, params?: T.SslCertificatesRequest | TB.SslCertificatesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async certificates (this: That, params?: T.SslCertificatesRequest | TB.SslCertificatesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async certificates (this: That, params?: T.SslCertificatesRequest | TB.SslCertificatesRequest, options?: TransportRequestOptions): Promise - async certificates (this: That, params?: T.SslCertificatesRequest | TB.SslCertificatesRequest, options?: TransportRequestOptions): Promise { + async certificates (this: That, params?: T.SslCertificatesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async certificates (this: That, params?: T.SslCertificatesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async certificates (this: That, params?: T.SslCertificatesRequest, options?: TransportRequestOptions): Promise + async certificates (this: That, params?: T.SslCertificatesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -60,7 +59,7 @@ export default class Ssl { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/synonyms.ts b/src/api/api/synonyms.ts index 8dc8a05d8..fbdb0b8ea 100644 --- a/src/api/api/synonyms.ts +++ b/src/api/api/synonyms.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Synonyms { @@ -45,13 +44,13 @@ export default class Synonyms { } /** - * Deletes a synonym set + * Delete a synonym set. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-synonyms-set.html | Elasticsearch API documentation} */ - async deleteSynonym (this: That, params: T.SynonymsDeleteSynonymRequest | TB.SynonymsDeleteSynonymRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteSynonym (this: That, params: T.SynonymsDeleteSynonymRequest | TB.SynonymsDeleteSynonymRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteSynonym (this: That, params: T.SynonymsDeleteSynonymRequest | TB.SynonymsDeleteSynonymRequest, options?: TransportRequestOptions): Promise - async deleteSynonym (this: That, params: T.SynonymsDeleteSynonymRequest | TB.SynonymsDeleteSynonymRequest, options?: TransportRequestOptions): Promise { + async deleteSynonym (this: That, params: T.SynonymsDeleteSynonymRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteSynonym (this: That, params: T.SynonymsDeleteSynonymRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteSynonym (this: That, params: T.SynonymsDeleteSynonymRequest, options?: TransportRequestOptions): Promise + async deleteSynonym (this: That, params: T.SynonymsDeleteSynonymRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Synonyms { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -77,13 +76,13 @@ export default class Synonyms { } /** - * Deletes a synonym rule in a synonym set + * Delete a synonym rule. Delete a synonym rule from a synonym set. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-synonym-rule.html | Elasticsearch API documentation} */ - async deleteSynonymRule (this: That, params: T.SynonymsDeleteSynonymRuleRequest | TB.SynonymsDeleteSynonymRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteSynonymRule (this: That, params: T.SynonymsDeleteSynonymRuleRequest | TB.SynonymsDeleteSynonymRuleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteSynonymRule (this: That, params: T.SynonymsDeleteSynonymRuleRequest | TB.SynonymsDeleteSynonymRuleRequest, options?: TransportRequestOptions): Promise - async deleteSynonymRule (this: That, params: T.SynonymsDeleteSynonymRuleRequest | TB.SynonymsDeleteSynonymRuleRequest, options?: TransportRequestOptions): Promise { + async deleteSynonymRule (this: That, params: T.SynonymsDeleteSynonymRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteSynonymRule (this: That, params: T.SynonymsDeleteSynonymRuleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteSynonymRule (this: That, params: T.SynonymsDeleteSynonymRuleRequest, options?: TransportRequestOptions): Promise + async deleteSynonymRule (this: That, params: T.SynonymsDeleteSynonymRuleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['set_id', 'rule_id'] const querystring: Record = {} const body = undefined @@ -91,7 +90,7 @@ export default class Synonyms { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -110,13 +109,13 @@ export default class Synonyms { } /** - * Retrieves a synonym set + * Get a synonym set. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-synonyms-set.html | Elasticsearch API documentation} */ - async getSynonym (this: That, params: T.SynonymsGetSynonymRequest | TB.SynonymsGetSynonymRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getSynonym (this: That, params: T.SynonymsGetSynonymRequest | TB.SynonymsGetSynonymRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getSynonym (this: That, params: T.SynonymsGetSynonymRequest | TB.SynonymsGetSynonymRequest, options?: TransportRequestOptions): Promise - async getSynonym (this: That, params: T.SynonymsGetSynonymRequest | TB.SynonymsGetSynonymRequest, options?: TransportRequestOptions): Promise { + async getSynonym (this: That, params: T.SynonymsGetSynonymRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getSynonym (this: That, params: T.SynonymsGetSynonymRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getSynonym (this: That, params: T.SynonymsGetSynonymRequest, options?: TransportRequestOptions): Promise + async getSynonym (this: That, params: T.SynonymsGetSynonymRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -124,7 +123,7 @@ export default class Synonyms { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -142,13 +141,13 @@ export default class Synonyms { } /** - * Retrieves a synonym rule from a synonym set + * Get a synonym rule. Get a synonym rule from a synonym set. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-synonym-rule.html | Elasticsearch API documentation} */ - async getSynonymRule (this: That, params: T.SynonymsGetSynonymRuleRequest | TB.SynonymsGetSynonymRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getSynonymRule (this: That, params: T.SynonymsGetSynonymRuleRequest | TB.SynonymsGetSynonymRuleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getSynonymRule (this: That, params: T.SynonymsGetSynonymRuleRequest | TB.SynonymsGetSynonymRuleRequest, options?: TransportRequestOptions): Promise - async getSynonymRule (this: That, params: T.SynonymsGetSynonymRuleRequest | TB.SynonymsGetSynonymRuleRequest, options?: TransportRequestOptions): Promise { + async getSynonymRule (this: That, params: T.SynonymsGetSynonymRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getSynonymRule (this: That, params: T.SynonymsGetSynonymRuleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getSynonymRule (this: That, params: T.SynonymsGetSynonymRuleRequest, options?: TransportRequestOptions): Promise + async getSynonymRule (this: That, params: T.SynonymsGetSynonymRuleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['set_id', 'rule_id'] const querystring: Record = {} const body = undefined @@ -156,7 +155,7 @@ export default class Synonyms { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -175,13 +174,13 @@ export default class Synonyms { } /** - * Retrieves a summary of all defined synonym sets + * Get all synonym sets. Get a summary of all defined synonym sets. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/list-synonyms-sets.html | Elasticsearch API documentation} */ - async getSynonymsSets (this: That, params?: T.SynonymsGetSynonymsSetsRequest | TB.SynonymsGetSynonymsSetsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getSynonymsSets (this: That, params?: T.SynonymsGetSynonymsSetsRequest | TB.SynonymsGetSynonymsSetsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getSynonymsSets (this: That, params?: T.SynonymsGetSynonymsSetsRequest | TB.SynonymsGetSynonymsSetsRequest, options?: TransportRequestOptions): Promise - async getSynonymsSets (this: That, params?: T.SynonymsGetSynonymsSetsRequest | TB.SynonymsGetSynonymsSetsRequest, options?: TransportRequestOptions): Promise { + async getSynonymsSets (this: That, params?: T.SynonymsGetSynonymsSetsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getSynonymsSets (this: That, params?: T.SynonymsGetSynonymsSetsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getSynonymsSets (this: That, params?: T.SynonymsGetSynonymsSetsRequest, options?: TransportRequestOptions): Promise + async getSynonymsSets (this: That, params?: T.SynonymsGetSynonymsSetsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -190,7 +189,7 @@ export default class Synonyms { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -205,33 +204,25 @@ export default class Synonyms { } /** - * Creates or updates a synonym set. + * Create or update a synonym set. Synonyms sets are limited to a maximum of 10,000 synonym rules per set. If you need to manage more synonym rules, you can create multiple synonym sets. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-synonyms-set.html | Elasticsearch API documentation} */ - async putSynonym (this: That, params: T.SynonymsPutSynonymRequest | TB.SynonymsPutSynonymRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putSynonym (this: That, params: T.SynonymsPutSynonymRequest | TB.SynonymsPutSynonymRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putSynonym (this: That, params: T.SynonymsPutSynonymRequest | TB.SynonymsPutSynonymRequest, options?: TransportRequestOptions): Promise - async putSynonym (this: That, params: T.SynonymsPutSynonymRequest | TB.SynonymsPutSynonymRequest, options?: TransportRequestOptions): Promise { + async putSynonym (this: That, params: T.SynonymsPutSynonymRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putSynonym (this: That, params: T.SynonymsPutSynonymRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putSynonym (this: That, params: T.SynonymsPutSynonymRequest, options?: TransportRequestOptions): Promise + async putSynonym (this: That, params: T.SynonymsPutSynonymRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const acceptedBody: string[] = ['synonyms_set'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -249,33 +240,25 @@ export default class Synonyms { } /** - * Creates or updates a synonym rule in a synonym set + * Create or update a synonym rule. Create or update a synonym rule in a synonym set. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-synonym-rule.html | Elasticsearch API documentation} */ - async putSynonymRule (this: That, params: T.SynonymsPutSynonymRuleRequest | TB.SynonymsPutSynonymRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putSynonymRule (this: That, params: T.SynonymsPutSynonymRuleRequest | TB.SynonymsPutSynonymRuleRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putSynonymRule (this: That, params: T.SynonymsPutSynonymRuleRequest | TB.SynonymsPutSynonymRuleRequest, options?: TransportRequestOptions): Promise - async putSynonymRule (this: That, params: T.SynonymsPutSynonymRuleRequest | TB.SynonymsPutSynonymRuleRequest, options?: TransportRequestOptions): Promise { + async putSynonymRule (this: That, params: T.SynonymsPutSynonymRuleRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putSynonymRule (this: That, params: T.SynonymsPutSynonymRuleRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putSynonymRule (this: That, params: T.SynonymsPutSynonymRuleRequest, options?: TransportRequestOptions): Promise + async putSynonymRule (this: That, params: T.SynonymsPutSynonymRuleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['set_id', 'rule_id'] const acceptedBody: string[] = ['synonyms'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/tasks.ts b/src/api/api/tasks.ts index 885facc08..7bf2b40e4 100644 --- a/src/api/api/tasks.ts +++ b/src/api/api/tasks.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Tasks { @@ -48,10 +47,10 @@ export default class Tasks { * Cancels a task, if it can be cancelled through an API. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/tasks.html | Elasticsearch API documentation} */ - async cancel (this: That, params?: T.TasksCancelRequest | TB.TasksCancelRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async cancel (this: That, params?: T.TasksCancelRequest | TB.TasksCancelRequest, options?: TransportRequestOptionsWithMeta): Promise> - async cancel (this: That, params?: T.TasksCancelRequest | TB.TasksCancelRequest, options?: TransportRequestOptions): Promise - async cancel (this: That, params?: T.TasksCancelRequest | TB.TasksCancelRequest, options?: TransportRequestOptions): Promise { + async cancel (this: That, params?: T.TasksCancelRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async cancel (this: That, params?: T.TasksCancelRequest, options?: TransportRequestOptionsWithMeta): Promise> + async cancel (this: That, params?: T.TasksCancelRequest, options?: TransportRequestOptions): Promise + async cancel (this: That, params?: T.TasksCancelRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['task_id'] const querystring: Record = {} const body = undefined @@ -60,7 +59,7 @@ export default class Tasks { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -88,10 +87,10 @@ export default class Tasks { * Get task information. Returns information about the tasks currently executing in the cluster. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/tasks.html | Elasticsearch API documentation} */ - async get (this: That, params: T.TasksGetRequest | TB.TasksGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async get (this: That, params: T.TasksGetRequest | TB.TasksGetRequest, options?: TransportRequestOptionsWithMeta): Promise> - async get (this: That, params: T.TasksGetRequest | TB.TasksGetRequest, options?: TransportRequestOptions): Promise - async get (this: That, params: T.TasksGetRequest | TB.TasksGetRequest, options?: TransportRequestOptions): Promise { + async get (this: That, params: T.TasksGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async get (this: That, params: T.TasksGetRequest, options?: TransportRequestOptionsWithMeta): Promise> + async get (this: That, params: T.TasksGetRequest, options?: TransportRequestOptions): Promise + async get (this: That, params: T.TasksGetRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['task_id'] const querystring: Record = {} const body = undefined @@ -99,7 +98,7 @@ export default class Tasks { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -120,10 +119,10 @@ export default class Tasks { * The task management API returns information about tasks currently executing on one or more nodes in the cluster. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/tasks.html | Elasticsearch API documentation} */ - async list (this: That, params?: T.TasksListRequest | TB.TasksListRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async list (this: That, params?: T.TasksListRequest | TB.TasksListRequest, options?: TransportRequestOptionsWithMeta): Promise> - async list (this: That, params?: T.TasksListRequest | TB.TasksListRequest, options?: TransportRequestOptions): Promise - async list (this: That, params?: T.TasksListRequest | TB.TasksListRequest, options?: TransportRequestOptions): Promise { + async list (this: That, params?: T.TasksListRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async list (this: That, params?: T.TasksListRequest, options?: TransportRequestOptionsWithMeta): Promise> + async list (this: That, params?: T.TasksListRequest, options?: TransportRequestOptions): Promise + async list (this: That, params?: T.TasksListRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -132,7 +131,7 @@ export default class Tasks { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/terms_enum.ts b/src/api/api/terms_enum.ts index a29d55635..6629246f5 100644 --- a/src/api/api/terms_enum.ts +++ b/src/api/api/terms_enum.ts @@ -35,37 +35,28 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Get terms in an index. Discover terms that match a partial string in an index. This "terms enum" API is designed for low-latency look-ups used in auto-complete scenarios. If the `complete` property in the response is false, the returned terms set may be incomplete and should be treated as approximate. This can occur due to a few reasons, such as a request timeout or a node error. NOTE: The terms enum API may return terms from deleted documents. Deleted documents are initially only marked as deleted. It is not until their segments are merged that documents are actually deleted. Until that happens, the terms enum API will return terms from these documents. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/search-terms-enum.html | Elasticsearch API documentation} */ -export default async function TermsEnumApi (this: That, params: T.TermsEnumRequest | TB.TermsEnumRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function TermsEnumApi (this: That, params: T.TermsEnumRequest | TB.TermsEnumRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function TermsEnumApi (this: That, params: T.TermsEnumRequest | TB.TermsEnumRequest, options?: TransportRequestOptions): Promise -export default async function TermsEnumApi (this: That, params: T.TermsEnumRequest | TB.TermsEnumRequest, options?: TransportRequestOptions): Promise { +export default async function TermsEnumApi (this: That, params: T.TermsEnumRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function TermsEnumApi (this: That, params: T.TermsEnumRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function TermsEnumApi (this: That, params: T.TermsEnumRequest, options?: TransportRequestOptions): Promise +export default async function TermsEnumApi (this: That, params: T.TermsEnumRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['field', 'size', 'timeout', 'case_insensitive', 'index_filter', 'string', 'search_after'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/termvectors.ts b/src/api/api/termvectors.ts index bcc854a45..083fd2c80 100644 --- a/src/api/api/termvectors.ts +++ b/src/api/api/termvectors.ts @@ -35,37 +35,28 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Get term vector information. Get information and statistics about terms in the fields of a particular document. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-termvectors.html | Elasticsearch API documentation} */ -export default async function TermvectorsApi (this: That, params: T.TermvectorsRequest | TB.TermvectorsRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function TermvectorsApi (this: That, params: T.TermvectorsRequest | TB.TermvectorsRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function TermvectorsApi (this: That, params: T.TermvectorsRequest | TB.TermvectorsRequest, options?: TransportRequestOptions): Promise -export default async function TermvectorsApi (this: That, params: T.TermvectorsRequest | TB.TermvectorsRequest, options?: TransportRequestOptions): Promise { +export default async function TermvectorsApi (this: That, params: T.TermvectorsRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function TermvectorsApi (this: That, params: T.TermvectorsRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function TermvectorsApi (this: That, params: T.TermvectorsRequest, options?: TransportRequestOptions): Promise +export default async function TermvectorsApi (this: That, params: T.TermvectorsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index', 'id'] const acceptedBody: string[] = ['doc', 'filter', 'per_field_analyzer'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/text_structure.ts b/src/api/api/text_structure.ts index f67eb2080..a2a9d4a7f 100644 --- a/src/api/api/text_structure.ts +++ b/src/api/api/text_structure.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class TextStructure { @@ -48,10 +47,10 @@ export default class TextStructure { * Finds the structure of a text field in an index. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/find-field-structure.html | Elasticsearch API documentation} */ - async findFieldStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async findFieldStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async findFieldStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async findFieldStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async findFieldStructure (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async findFieldStructure (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async findFieldStructure (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async findFieldStructure (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -60,7 +59,7 @@ export default class TextStructure { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -77,10 +76,10 @@ export default class TextStructure { * Finds the structure of a list of messages. The messages must contain data that is suitable to be ingested into Elasticsearch. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/find-message-structure.html | Elasticsearch API documentation} */ - async findMessageStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async findMessageStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async findMessageStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async findMessageStructure (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async findMessageStructure (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async findMessageStructure (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async findMessageStructure (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async findMessageStructure (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -89,7 +88,7 @@ export default class TextStructure { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -106,15 +105,14 @@ export default class TextStructure { * Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/find-structure.html | Elasticsearch API documentation} */ - async findStructure (this: That, params: T.TextStructureFindStructureRequest | TB.TextStructureFindStructureRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async findStructure (this: That, params: T.TextStructureFindStructureRequest | TB.TextStructureFindStructureRequest, options?: TransportRequestOptionsWithMeta): Promise> - async findStructure (this: That, params: T.TextStructureFindStructureRequest | TB.TextStructureFindStructureRequest, options?: TransportRequestOptions): Promise - async findStructure (this: That, params: T.TextStructureFindStructureRequest | TB.TextStructureFindStructureRequest, options?: TransportRequestOptions): Promise { + async findStructure (this: That, params: T.TextStructureFindStructureRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async findStructure (this: That, params: T.TextStructureFindStructureRequest, options?: TransportRequestOptionsWithMeta): Promise> + async findStructure (this: That, params: T.TextStructureFindStructureRequest, options?: TransportRequestOptions): Promise + async findStructure (this: That, params: T.TextStructureFindStructureRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['text_files'] const querystring: Record = {} - // @ts-expect-error - let body: any = params.body ?? undefined + let body: any for (const key in params) { if (acceptedBody.includes(key)) { @@ -122,7 +120,7 @@ export default class TextStructure { body = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -140,30 +138,22 @@ export default class TextStructure { * Tests a Grok pattern on some text. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/test-grok-pattern.html | Elasticsearch API documentation} */ - async testGrokPattern (this: That, params: T.TextStructureTestGrokPatternRequest | TB.TextStructureTestGrokPatternRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async testGrokPattern (this: That, params: T.TextStructureTestGrokPatternRequest | TB.TextStructureTestGrokPatternRequest, options?: TransportRequestOptionsWithMeta): Promise> - async testGrokPattern (this: That, params: T.TextStructureTestGrokPatternRequest | TB.TextStructureTestGrokPatternRequest, options?: TransportRequestOptions): Promise - async testGrokPattern (this: That, params: T.TextStructureTestGrokPatternRequest | TB.TextStructureTestGrokPatternRequest, options?: TransportRequestOptions): Promise { + async testGrokPattern (this: That, params: T.TextStructureTestGrokPatternRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async testGrokPattern (this: That, params: T.TextStructureTestGrokPatternRequest, options?: TransportRequestOptionsWithMeta): Promise> + async testGrokPattern (this: That, params: T.TextStructureTestGrokPatternRequest, options?: TransportRequestOptions): Promise + async testGrokPattern (this: That, params: T.TextStructureTestGrokPatternRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['grok_pattern', 'text'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/transform.ts b/src/api/api/transform.ts index 56029c0ba..c27c4690d 100644 --- a/src/api/api/transform.ts +++ b/src/api/api/transform.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Transform { @@ -48,10 +47,10 @@ export default class Transform { * Delete a transform. Deletes a transform. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-transform.html | Elasticsearch API documentation} */ - async deleteTransform (this: That, params: T.TransformDeleteTransformRequest | TB.TransformDeleteTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteTransform (this: That, params: T.TransformDeleteTransformRequest | TB.TransformDeleteTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteTransform (this: That, params: T.TransformDeleteTransformRequest | TB.TransformDeleteTransformRequest, options?: TransportRequestOptions): Promise - async deleteTransform (this: That, params: T.TransformDeleteTransformRequest | TB.TransformDeleteTransformRequest, options?: TransportRequestOptions): Promise { + async deleteTransform (this: That, params: T.TransformDeleteTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteTransform (this: That, params: T.TransformDeleteTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteTransform (this: That, params: T.TransformDeleteTransformRequest, options?: TransportRequestOptions): Promise + async deleteTransform (this: That, params: T.TransformDeleteTransformRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['transform_id'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Transform { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -80,10 +79,10 @@ export default class Transform { * Retrieves transform usage information for transform nodes. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-transform-node-stats.html | Elasticsearch API documentation} */ - async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async getNodeStats (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async getNodeStats (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async getNodeStats (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async getNodeStats (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -92,7 +91,7 @@ export default class Transform { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -109,10 +108,10 @@ export default class Transform { * Get transforms. Retrieves configuration information for transforms. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-transform.html | Elasticsearch API documentation} */ - async getTransform (this: That, params?: T.TransformGetTransformRequest | TB.TransformGetTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getTransform (this: That, params?: T.TransformGetTransformRequest | TB.TransformGetTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getTransform (this: That, params?: T.TransformGetTransformRequest | TB.TransformGetTransformRequest, options?: TransportRequestOptions): Promise - async getTransform (this: That, params?: T.TransformGetTransformRequest | TB.TransformGetTransformRequest, options?: TransportRequestOptions): Promise { + async getTransform (this: That, params?: T.TransformGetTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getTransform (this: That, params?: T.TransformGetTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getTransform (this: That, params?: T.TransformGetTransformRequest, options?: TransportRequestOptions): Promise + async getTransform (this: That, params?: T.TransformGetTransformRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['transform_id'] const querystring: Record = {} const body = undefined @@ -121,7 +120,7 @@ export default class Transform { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -149,10 +148,10 @@ export default class Transform { * Get transform stats. Retrieves usage information for transforms. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-transform-stats.html | Elasticsearch API documentation} */ - async getTransformStats (this: That, params: T.TransformGetTransformStatsRequest | TB.TransformGetTransformStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getTransformStats (this: That, params: T.TransformGetTransformStatsRequest | TB.TransformGetTransformStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getTransformStats (this: That, params: T.TransformGetTransformStatsRequest | TB.TransformGetTransformStatsRequest, options?: TransportRequestOptions): Promise - async getTransformStats (this: That, params: T.TransformGetTransformStatsRequest | TB.TransformGetTransformStatsRequest, options?: TransportRequestOptions): Promise { + async getTransformStats (this: That, params: T.TransformGetTransformStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getTransformStats (this: That, params: T.TransformGetTransformStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getTransformStats (this: That, params: T.TransformGetTransformStatsRequest, options?: TransportRequestOptions): Promise + async getTransformStats (this: That, params: T.TransformGetTransformStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['transform_id'] const querystring: Record = {} const body = undefined @@ -160,7 +159,7 @@ export default class Transform { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -181,31 +180,23 @@ export default class Transform { * Preview a transform. Generates a preview of the results that you will get when you create a transform with the same configuration. It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also generates a list of mappings and settings for the destination index. These values are determined based on the field types of the source index and the transform aggregations. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/preview-transform.html | Elasticsearch API documentation} */ - async previewTransform (this: That, params?: T.TransformPreviewTransformRequest | TB.TransformPreviewTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise> - async previewTransform (this: That, params?: T.TransformPreviewTransformRequest | TB.TransformPreviewTransformRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> - async previewTransform (this: That, params?: T.TransformPreviewTransformRequest | TB.TransformPreviewTransformRequest, options?: TransportRequestOptions): Promise> - async previewTransform (this: That, params?: T.TransformPreviewTransformRequest | TB.TransformPreviewTransformRequest, options?: TransportRequestOptions): Promise { + async previewTransform (this: That, params?: T.TransformPreviewTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise> + async previewTransform (this: That, params?: T.TransformPreviewTransformRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> + async previewTransform (this: That, params?: T.TransformPreviewTransformRequest, options?: TransportRequestOptions): Promise> + async previewTransform (this: That, params?: T.TransformPreviewTransformRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['transform_id'] const acceptedBody: string[] = ['dest', 'description', 'frequency', 'pivot', 'source', 'settings', 'sync', 'retention_policy', 'latest'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -233,30 +224,22 @@ export default class Transform { * Create a transform. Creates a transform. A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a unique row per entity. You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If you choose to use the pivot method for your transform, the entities are defined by the set of `group_by` fields in the pivot object. If you choose to use the latest method, the entities are defined by the `unique_key` field values in the latest object. You must have `create_index`, `index`, and `read` privileges on the destination index and `read` and `view_index_metadata` privileges on the source indices. When Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the time of creation and uses those same roles. If those roles do not have the required privileges on the source and destination indices, the transform fails when it attempts unauthorized operations. NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any `.transform-internal*` indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do not give users any privileges on `.transform-internal*` indices. If you used transforms prior to 7.5, also do not give users any privileges on `.data-frame-internal*` indices. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-transform.html | Elasticsearch API documentation} */ - async putTransform (this: That, params: T.TransformPutTransformRequest | TB.TransformPutTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putTransform (this: That, params: T.TransformPutTransformRequest | TB.TransformPutTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putTransform (this: That, params: T.TransformPutTransformRequest | TB.TransformPutTransformRequest, options?: TransportRequestOptions): Promise - async putTransform (this: That, params: T.TransformPutTransformRequest | TB.TransformPutTransformRequest, options?: TransportRequestOptions): Promise { + async putTransform (this: That, params: T.TransformPutTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putTransform (this: That, params: T.TransformPutTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putTransform (this: That, params: T.TransformPutTransformRequest, options?: TransportRequestOptions): Promise + async putTransform (this: That, params: T.TransformPutTransformRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['transform_id'] const acceptedBody: string[] = ['dest', 'description', 'frequency', 'latest', '_meta', 'pivot', 'retention_policy', 'settings', 'source', 'sync'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -277,10 +260,10 @@ export default class Transform { * Reset a transform. Resets a transform. Before you can reset it, you must stop it; alternatively, use the `force` query parameter. If the destination index was created by the transform, it is deleted. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/reset-transform.html | Elasticsearch API documentation} */ - async resetTransform (this: That, params: T.TransformResetTransformRequest | TB.TransformResetTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async resetTransform (this: That, params: T.TransformResetTransformRequest | TB.TransformResetTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> - async resetTransform (this: That, params: T.TransformResetTransformRequest | TB.TransformResetTransformRequest, options?: TransportRequestOptions): Promise - async resetTransform (this: That, params: T.TransformResetTransformRequest | TB.TransformResetTransformRequest, options?: TransportRequestOptions): Promise { + async resetTransform (this: That, params: T.TransformResetTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async resetTransform (this: That, params: T.TransformResetTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> + async resetTransform (this: That, params: T.TransformResetTransformRequest, options?: TransportRequestOptions): Promise + async resetTransform (this: That, params: T.TransformResetTransformRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['transform_id'] const querystring: Record = {} const body = undefined @@ -288,7 +271,7 @@ export default class Transform { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -309,10 +292,10 @@ export default class Transform { * Schedule a transform to start now. Instantly runs a transform to process data. If you _schedule_now a transform, it will process the new data instantly, without waiting for the configured frequency interval. After _schedule_now API is called, the transform will be processed again at now + frequency unless _schedule_now API is called again in the meantime. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/schedule-now-transform.html | Elasticsearch API documentation} */ - async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest | TB.TransformScheduleNowTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest | TB.TransformScheduleNowTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> - async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest | TB.TransformScheduleNowTransformRequest, options?: TransportRequestOptions): Promise - async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest | TB.TransformScheduleNowTransformRequest, options?: TransportRequestOptions): Promise { + async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> + async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest, options?: TransportRequestOptions): Promise + async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['transform_id'] const querystring: Record = {} const body = undefined @@ -320,7 +303,7 @@ export default class Transform { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -341,10 +324,10 @@ export default class Transform { * Start a transform. Starts a transform. When you start a transform, it creates the destination index if it does not already exist. The `number_of_shards` is set to `1` and the `auto_expand_replicas` is set to `0-1`. If it is a pivot transform, it deduces the mapping definitions for the destination index from the source indices and the transform aggregations. If fields in the destination index are derived from scripts (as in the case of `scripted_metric` or `bucket_script` aggregations), the transform uses dynamic mappings unless an index template exists. If it is a latest transform, it does not deduce mapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you start the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings in a pivot transform. When the transform starts, a series of validations occur to ensure its success. If you deferred validation when you created the transform, they occur when you start the transform—with the exception of privilege checks. When Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the time of creation and uses those same roles. If those roles do not have the required privileges on the source and destination indices, the transform fails when it attempts unauthorized operations. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/start-transform.html | Elasticsearch API documentation} */ - async startTransform (this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async startTransform (this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> - async startTransform (this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptions): Promise - async startTransform (this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptions): Promise { + async startTransform (this: That, params: T.TransformStartTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async startTransform (this: That, params: T.TransformStartTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> + async startTransform (this: That, params: T.TransformStartTransformRequest, options?: TransportRequestOptions): Promise + async startTransform (this: That, params: T.TransformStartTransformRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['transform_id'] const querystring: Record = {} const body = undefined @@ -352,7 +335,7 @@ export default class Transform { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -373,10 +356,10 @@ export default class Transform { * Stop transforms. Stops one or more transforms. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/stop-transform.html | Elasticsearch API documentation} */ - async stopTransform (this: That, params: T.TransformStopTransformRequest | TB.TransformStopTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async stopTransform (this: That, params: T.TransformStopTransformRequest | TB.TransformStopTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> - async stopTransform (this: That, params: T.TransformStopTransformRequest | TB.TransformStopTransformRequest, options?: TransportRequestOptions): Promise - async stopTransform (this: That, params: T.TransformStopTransformRequest | TB.TransformStopTransformRequest, options?: TransportRequestOptions): Promise { + async stopTransform (this: That, params: T.TransformStopTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async stopTransform (this: That, params: T.TransformStopTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> + async stopTransform (this: That, params: T.TransformStopTransformRequest, options?: TransportRequestOptions): Promise + async stopTransform (this: That, params: T.TransformStopTransformRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['transform_id'] const querystring: Record = {} const body = undefined @@ -384,7 +367,7 @@ export default class Transform { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -405,30 +388,22 @@ export default class Transform { * Update a transform. Updates certain properties of a transform. All updated properties except `description` do not take effect until after the transform starts the next checkpoint, thus there is data consistency in each checkpoint. To use this API, you must have `read` and `view_index_metadata` privileges for the source indices. You must also have `index` and `read` privileges for the destination index. When Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the time of update and runs with those privileges. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-transform.html | Elasticsearch API documentation} */ - async updateTransform (this: That, params: T.TransformUpdateTransformRequest | TB.TransformUpdateTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async updateTransform (this: That, params: T.TransformUpdateTransformRequest | TB.TransformUpdateTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> - async updateTransform (this: That, params: T.TransformUpdateTransformRequest | TB.TransformUpdateTransformRequest, options?: TransportRequestOptions): Promise - async updateTransform (this: That, params: T.TransformUpdateTransformRequest | TB.TransformUpdateTransformRequest, options?: TransportRequestOptions): Promise { + async updateTransform (this: That, params: T.TransformUpdateTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async updateTransform (this: That, params: T.TransformUpdateTransformRequest, options?: TransportRequestOptionsWithMeta): Promise> + async updateTransform (this: That, params: T.TransformUpdateTransformRequest, options?: TransportRequestOptions): Promise + async updateTransform (this: That, params: T.TransformUpdateTransformRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['transform_id'] const acceptedBody: string[] = ['dest', 'description', 'frequency', '_meta', 'source', 'settings', 'sync', 'retention_policy'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -449,10 +424,10 @@ export default class Transform { * Upgrades all transforms. This API identifies transforms that have a legacy configuration format and upgrades them to the latest version. It also cleans up the internal data structures that store the transform state and checkpoints. The upgrade does not affect the source and destination indices. The upgrade also does not affect the roles that transforms use when Elasticsearch security features are enabled; the role used to read source data and write to the destination index remains unchanged. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/upgrade-transforms.html | Elasticsearch API documentation} */ - async upgradeTransforms (this: That, params?: T.TransformUpgradeTransformsRequest | TB.TransformUpgradeTransformsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async upgradeTransforms (this: That, params?: T.TransformUpgradeTransformsRequest | TB.TransformUpgradeTransformsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async upgradeTransforms (this: That, params?: T.TransformUpgradeTransformsRequest | TB.TransformUpgradeTransformsRequest, options?: TransportRequestOptions): Promise - async upgradeTransforms (this: That, params?: T.TransformUpgradeTransformsRequest | TB.TransformUpgradeTransformsRequest, options?: TransportRequestOptions): Promise { + async upgradeTransforms (this: That, params?: T.TransformUpgradeTransformsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async upgradeTransforms (this: That, params?: T.TransformUpgradeTransformsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async upgradeTransforms (this: That, params?: T.TransformUpgradeTransformsRequest, options?: TransportRequestOptions): Promise + async upgradeTransforms (this: That, params?: T.TransformUpgradeTransformsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -461,7 +436,7 @@ export default class Transform { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/update.ts b/src/api/api/update.ts index 0ef23cbd8..27e10f03e 100644 --- a/src/api/api/update.ts +++ b/src/api/api/update.ts @@ -35,37 +35,28 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Update a document. Updates a document by running a script or passing a partial document. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-update.html | Elasticsearch API documentation} */ -export default async function UpdateApi (this: That, params: T.UpdateRequest | TB.UpdateRequest, options?: TransportRequestOptionsWithOutMeta): Promise> -export default async function UpdateApi (this: That, params: T.UpdateRequest | TB.UpdateRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> -export default async function UpdateApi (this: That, params: T.UpdateRequest | TB.UpdateRequest, options?: TransportRequestOptions): Promise> -export default async function UpdateApi (this: That, params: T.UpdateRequest | TB.UpdateRequest, options?: TransportRequestOptions): Promise { +export default async function UpdateApi (this: That, params: T.UpdateRequest, options?: TransportRequestOptionsWithOutMeta): Promise> +export default async function UpdateApi (this: That, params: T.UpdateRequest, options?: TransportRequestOptionsWithMeta): Promise, unknown>> +export default async function UpdateApi (this: That, params: T.UpdateRequest, options?: TransportRequestOptions): Promise> +export default async function UpdateApi (this: That, params: T.UpdateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id', 'index'] const acceptedBody: string[] = ['detect_noop', 'doc', 'doc_as_upsert', 'script', 'scripted_upsert', '_source', 'upsert'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/update_by_query.ts b/src/api/api/update_by_query.ts index b0ae58066..2ec7d55fb 100644 --- a/src/api/api/update_by_query.ts +++ b/src/api/api/update_by_query.ts @@ -35,37 +35,28 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Update documents. Updates documents that match the specified query. If no query is specified, performs an update on every document in the data stream or index without modifying the source, which is useful for picking up mapping changes. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-update-by-query.html | Elasticsearch API documentation} */ -export default async function UpdateByQueryApi (this: That, params: T.UpdateByQueryRequest | TB.UpdateByQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function UpdateByQueryApi (this: That, params: T.UpdateByQueryRequest | TB.UpdateByQueryRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function UpdateByQueryApi (this: That, params: T.UpdateByQueryRequest | TB.UpdateByQueryRequest, options?: TransportRequestOptions): Promise -export default async function UpdateByQueryApi (this: That, params: T.UpdateByQueryRequest | TB.UpdateByQueryRequest, options?: TransportRequestOptions): Promise { +export default async function UpdateByQueryApi (this: That, params: T.UpdateByQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function UpdateByQueryApi (this: That, params: T.UpdateByQueryRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function UpdateByQueryApi (this: That, params: T.UpdateByQueryRequest, options?: TransportRequestOptions): Promise +export default async function UpdateByQueryApi (this: That, params: T.UpdateByQueryRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] const acceptedBody: string[] = ['max_docs', 'query', 'script', 'slice', 'conflicts'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/update_by_query_rethrottle.ts b/src/api/api/update_by_query_rethrottle.ts index fc57f2793..79d2e27b6 100644 --- a/src/api/api/update_by_query_rethrottle.ts +++ b/src/api/api/update_by_query_rethrottle.ts @@ -35,17 +35,16 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } /** * Throttle an update by query operation. Change the number of requests per second for a particular update by query operation. Rethrottling that speeds up the query takes effect immediately but rethrotting that slows down the query takes effect after completing the current batch to prevent scroll timeouts. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docs-update-by-query.html | Elasticsearch API documentation} */ -export default async function UpdateByQueryRethrottleApi (this: That, params: T.UpdateByQueryRethrottleRequest | TB.UpdateByQueryRethrottleRequest, options?: TransportRequestOptionsWithOutMeta): Promise -export default async function UpdateByQueryRethrottleApi (this: That, params: T.UpdateByQueryRethrottleRequest | TB.UpdateByQueryRethrottleRequest, options?: TransportRequestOptionsWithMeta): Promise> -export default async function UpdateByQueryRethrottleApi (this: That, params: T.UpdateByQueryRethrottleRequest | TB.UpdateByQueryRethrottleRequest, options?: TransportRequestOptions): Promise -export default async function UpdateByQueryRethrottleApi (this: That, params: T.UpdateByQueryRethrottleRequest | TB.UpdateByQueryRethrottleRequest, options?: TransportRequestOptions): Promise { +export default async function UpdateByQueryRethrottleApi (this: That, params: T.UpdateByQueryRethrottleRequest, options?: TransportRequestOptionsWithOutMeta): Promise +export default async function UpdateByQueryRethrottleApi (this: That, params: T.UpdateByQueryRethrottleRequest, options?: TransportRequestOptionsWithMeta): Promise> +export default async function UpdateByQueryRethrottleApi (this: That, params: T.UpdateByQueryRethrottleRequest, options?: TransportRequestOptions): Promise +export default async function UpdateByQueryRethrottleApi (this: That, params: T.UpdateByQueryRethrottleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['task_id'] const querystring: Record = {} const body = undefined @@ -53,7 +52,7 @@ export default async function UpdateByQueryRethrottleApi (this: That, params: T. for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/api/watcher.ts b/src/api/api/watcher.ts index 1feeac116..4601bd5cb 100644 --- a/src/api/api/watcher.ts +++ b/src/api/api/watcher.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Watcher { @@ -48,10 +47,10 @@ export default class Watcher { * Acknowledges a watch, manually throttling the execution of the watch's actions. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-ack-watch.html | Elasticsearch API documentation} */ - async ackWatch (this: That, params: T.WatcherAckWatchRequest | TB.WatcherAckWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async ackWatch (this: That, params: T.WatcherAckWatchRequest | TB.WatcherAckWatchRequest, options?: TransportRequestOptionsWithMeta): Promise> - async ackWatch (this: That, params: T.WatcherAckWatchRequest | TB.WatcherAckWatchRequest, options?: TransportRequestOptions): Promise - async ackWatch (this: That, params: T.WatcherAckWatchRequest | TB.WatcherAckWatchRequest, options?: TransportRequestOptions): Promise { + async ackWatch (this: That, params: T.WatcherAckWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async ackWatch (this: That, params: T.WatcherAckWatchRequest, options?: TransportRequestOptionsWithMeta): Promise> + async ackWatch (this: That, params: T.WatcherAckWatchRequest, options?: TransportRequestOptions): Promise + async ackWatch (this: That, params: T.WatcherAckWatchRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['watch_id', 'action_id'] const querystring: Record = {} const body = undefined @@ -59,7 +58,7 @@ export default class Watcher { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -88,10 +87,10 @@ export default class Watcher { * Activates a currently inactive watch. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-activate-watch.html | Elasticsearch API documentation} */ - async activateWatch (this: That, params: T.WatcherActivateWatchRequest | TB.WatcherActivateWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async activateWatch (this: That, params: T.WatcherActivateWatchRequest | TB.WatcherActivateWatchRequest, options?: TransportRequestOptionsWithMeta): Promise> - async activateWatch (this: That, params: T.WatcherActivateWatchRequest | TB.WatcherActivateWatchRequest, options?: TransportRequestOptions): Promise - async activateWatch (this: That, params: T.WatcherActivateWatchRequest | TB.WatcherActivateWatchRequest, options?: TransportRequestOptions): Promise { + async activateWatch (this: That, params: T.WatcherActivateWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async activateWatch (this: That, params: T.WatcherActivateWatchRequest, options?: TransportRequestOptionsWithMeta): Promise> + async activateWatch (this: That, params: T.WatcherActivateWatchRequest, options?: TransportRequestOptions): Promise + async activateWatch (this: That, params: T.WatcherActivateWatchRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['watch_id'] const querystring: Record = {} const body = undefined @@ -99,7 +98,7 @@ export default class Watcher { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -120,10 +119,10 @@ export default class Watcher { * Deactivates a currently active watch. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-deactivate-watch.html | Elasticsearch API documentation} */ - async deactivateWatch (this: That, params: T.WatcherDeactivateWatchRequest | TB.WatcherDeactivateWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deactivateWatch (this: That, params: T.WatcherDeactivateWatchRequest | TB.WatcherDeactivateWatchRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deactivateWatch (this: That, params: T.WatcherDeactivateWatchRequest | TB.WatcherDeactivateWatchRequest, options?: TransportRequestOptions): Promise - async deactivateWatch (this: That, params: T.WatcherDeactivateWatchRequest | TB.WatcherDeactivateWatchRequest, options?: TransportRequestOptions): Promise { + async deactivateWatch (this: That, params: T.WatcherDeactivateWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deactivateWatch (this: That, params: T.WatcherDeactivateWatchRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deactivateWatch (this: That, params: T.WatcherDeactivateWatchRequest, options?: TransportRequestOptions): Promise + async deactivateWatch (this: That, params: T.WatcherDeactivateWatchRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['watch_id'] const querystring: Record = {} const body = undefined @@ -131,7 +130,7 @@ export default class Watcher { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -152,10 +151,10 @@ export default class Watcher { * Removes a watch from Watcher. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-delete-watch.html | Elasticsearch API documentation} */ - async deleteWatch (this: That, params: T.WatcherDeleteWatchRequest | TB.WatcherDeleteWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteWatch (this: That, params: T.WatcherDeleteWatchRequest | TB.WatcherDeleteWatchRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteWatch (this: That, params: T.WatcherDeleteWatchRequest | TB.WatcherDeleteWatchRequest, options?: TransportRequestOptions): Promise - async deleteWatch (this: That, params: T.WatcherDeleteWatchRequest | TB.WatcherDeleteWatchRequest, options?: TransportRequestOptions): Promise { + async deleteWatch (this: That, params: T.WatcherDeleteWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async deleteWatch (this: That, params: T.WatcherDeleteWatchRequest, options?: TransportRequestOptionsWithMeta): Promise> + async deleteWatch (this: That, params: T.WatcherDeleteWatchRequest, options?: TransportRequestOptions): Promise + async deleteWatch (this: That, params: T.WatcherDeleteWatchRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -163,7 +162,7 @@ export default class Watcher { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -184,31 +183,23 @@ export default class Watcher { * This API can be used to force execution of the watch outside of its triggering logic or to simulate the watch execution for debugging purposes. For testing and debugging purposes, you also have fine-grained control on how the watch runs. You can execute the watch without executing all of its actions or alternatively by simulating them. You can also force execution by ignoring the watch condition and control whether a watch record would be written to the watch history after execution. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-execute-watch.html | Elasticsearch API documentation} */ - async executeWatch (this: That, params?: T.WatcherExecuteWatchRequest | TB.WatcherExecuteWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async executeWatch (this: That, params?: T.WatcherExecuteWatchRequest | TB.WatcherExecuteWatchRequest, options?: TransportRequestOptionsWithMeta): Promise> - async executeWatch (this: That, params?: T.WatcherExecuteWatchRequest | TB.WatcherExecuteWatchRequest, options?: TransportRequestOptions): Promise - async executeWatch (this: That, params?: T.WatcherExecuteWatchRequest | TB.WatcherExecuteWatchRequest, options?: TransportRequestOptions): Promise { + async executeWatch (this: That, params?: T.WatcherExecuteWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async executeWatch (this: That, params?: T.WatcherExecuteWatchRequest, options?: TransportRequestOptionsWithMeta): Promise> + async executeWatch (this: That, params?: T.WatcherExecuteWatchRequest, options?: TransportRequestOptions): Promise + async executeWatch (this: That, params?: T.WatcherExecuteWatchRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const acceptedBody: string[] = ['action_modes', 'alternative_input', 'ignore_condition', 'record_execution', 'simulated_actions', 'trigger_data', 'watch'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -236,10 +227,10 @@ export default class Watcher { * Retrieve settings for the watcher system index * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-get-settings.html | Elasticsearch API documentation} */ - async getSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async getSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async getSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async getSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async getSettings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async getSettings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async getSettings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async getSettings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -248,7 +239,7 @@ export default class Watcher { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } @@ -265,10 +256,10 @@ export default class Watcher { * Retrieves a watch by its ID. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-get-watch.html | Elasticsearch API documentation} */ - async getWatch (this: That, params: T.WatcherGetWatchRequest | TB.WatcherGetWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getWatch (this: That, params: T.WatcherGetWatchRequest | TB.WatcherGetWatchRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getWatch (this: That, params: T.WatcherGetWatchRequest | TB.WatcherGetWatchRequest, options?: TransportRequestOptions): Promise - async getWatch (this: That, params: T.WatcherGetWatchRequest | TB.WatcherGetWatchRequest, options?: TransportRequestOptions): Promise { + async getWatch (this: That, params: T.WatcherGetWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async getWatch (this: That, params: T.WatcherGetWatchRequest, options?: TransportRequestOptionsWithMeta): Promise> + async getWatch (this: That, params: T.WatcherGetWatchRequest, options?: TransportRequestOptions): Promise + async getWatch (this: That, params: T.WatcherGetWatchRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const querystring: Record = {} const body = undefined @@ -276,7 +267,7 @@ export default class Watcher { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -297,30 +288,22 @@ export default class Watcher { * Creates a new watch, or updates an existing one. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-put-watch.html | Elasticsearch API documentation} */ - async putWatch (this: That, params: T.WatcherPutWatchRequest | TB.WatcherPutWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putWatch (this: That, params: T.WatcherPutWatchRequest | TB.WatcherPutWatchRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putWatch (this: That, params: T.WatcherPutWatchRequest | TB.WatcherPutWatchRequest, options?: TransportRequestOptions): Promise - async putWatch (this: That, params: T.WatcherPutWatchRequest | TB.WatcherPutWatchRequest, options?: TransportRequestOptions): Promise { + async putWatch (this: That, params: T.WatcherPutWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async putWatch (this: That, params: T.WatcherPutWatchRequest, options?: TransportRequestOptionsWithMeta): Promise> + async putWatch (this: That, params: T.WatcherPutWatchRequest, options?: TransportRequestOptions): Promise + async putWatch (this: That, params: T.WatcherPutWatchRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['id'] const acceptedBody: string[] = ['actions', 'condition', 'input', 'metadata', 'throttle_period', 'transform', 'trigger'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -341,31 +324,23 @@ export default class Watcher { * Retrieves stored watches. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-query-watches.html | Elasticsearch API documentation} */ - async queryWatches (this: That, params?: T.WatcherQueryWatchesRequest | TB.WatcherQueryWatchesRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async queryWatches (this: That, params?: T.WatcherQueryWatchesRequest | TB.WatcherQueryWatchesRequest, options?: TransportRequestOptionsWithMeta): Promise> - async queryWatches (this: That, params?: T.WatcherQueryWatchesRequest | TB.WatcherQueryWatchesRequest, options?: TransportRequestOptions): Promise - async queryWatches (this: That, params?: T.WatcherQueryWatchesRequest | TB.WatcherQueryWatchesRequest, options?: TransportRequestOptions): Promise { + async queryWatches (this: That, params?: T.WatcherQueryWatchesRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async queryWatches (this: That, params?: T.WatcherQueryWatchesRequest, options?: TransportRequestOptionsWithMeta): Promise> + async queryWatches (this: That, params?: T.WatcherQueryWatchesRequest, options?: TransportRequestOptions): Promise + async queryWatches (this: That, params?: T.WatcherQueryWatchesRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const acceptedBody: string[] = ['from', 'size', 'query', 'sort', 'search_after'] const querystring: Record = {} - // @ts-expect-error - const userBody: any = params?.body - let body: Record | string - if (typeof userBody === 'string') { - body = userBody - } else { - body = userBody != null ? { ...userBody } : undefined - } + const body: Record = {} params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { - body = body ?? {} // @ts-expect-error body[key] = params[key] } else if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -383,10 +358,10 @@ export default class Watcher { * Starts Watcher if it is not already running. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-start.html | Elasticsearch API documentation} */ - async start (this: That, params?: T.WatcherStartRequest | TB.WatcherStartRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async start (this: That, params?: T.WatcherStartRequest | TB.WatcherStartRequest, options?: TransportRequestOptionsWithMeta): Promise> - async start (this: That, params?: T.WatcherStartRequest | TB.WatcherStartRequest, options?: TransportRequestOptions): Promise - async start (this: That, params?: T.WatcherStartRequest | TB.WatcherStartRequest, options?: TransportRequestOptions): Promise { + async start (this: That, params?: T.WatcherStartRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async start (this: That, params?: T.WatcherStartRequest, options?: TransportRequestOptionsWithMeta): Promise> + async start (this: That, params?: T.WatcherStartRequest, options?: TransportRequestOptions): Promise + async start (this: That, params?: T.WatcherStartRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -395,7 +370,7 @@ export default class Watcher { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -413,10 +388,10 @@ export default class Watcher { * Retrieves the current Watcher metrics. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-stats.html | Elasticsearch API documentation} */ - async stats (this: That, params?: T.WatcherStatsRequest | TB.WatcherStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async stats (this: That, params?: T.WatcherStatsRequest | TB.WatcherStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> - async stats (this: That, params?: T.WatcherStatsRequest | TB.WatcherStatsRequest, options?: TransportRequestOptions): Promise - async stats (this: That, params?: T.WatcherStatsRequest | TB.WatcherStatsRequest, options?: TransportRequestOptions): Promise { + async stats (this: That, params?: T.WatcherStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async stats (this: That, params?: T.WatcherStatsRequest, options?: TransportRequestOptionsWithMeta): Promise> + async stats (this: That, params?: T.WatcherStatsRequest, options?: TransportRequestOptions): Promise + async stats (this: That, params?: T.WatcherStatsRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['metric'] const querystring: Record = {} const body = undefined @@ -425,7 +400,7 @@ export default class Watcher { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -453,10 +428,10 @@ export default class Watcher { * Stops Watcher if it is running. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-stop.html | Elasticsearch API documentation} */ - async stop (this: That, params?: T.WatcherStopRequest | TB.WatcherStopRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async stop (this: That, params?: T.WatcherStopRequest | TB.WatcherStopRequest, options?: TransportRequestOptionsWithMeta): Promise> - async stop (this: That, params?: T.WatcherStopRequest | TB.WatcherStopRequest, options?: TransportRequestOptions): Promise - async stop (this: That, params?: T.WatcherStopRequest | TB.WatcherStopRequest, options?: TransportRequestOptions): Promise { + async stop (this: That, params?: T.WatcherStopRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async stop (this: That, params?: T.WatcherStopRequest, options?: TransportRequestOptionsWithMeta): Promise> + async stop (this: That, params?: T.WatcherStopRequest, options?: TransportRequestOptions): Promise + async stop (this: That, params?: T.WatcherStopRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -465,7 +440,7 @@ export default class Watcher { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -483,10 +458,10 @@ export default class Watcher { * Update settings for the watcher system index * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-update-settings.html | Elasticsearch API documentation} */ - async updateSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise - async updateSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise> - async updateSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise - async updateSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise { + async updateSettings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise + async updateSettings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise> + async updateSettings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise + async updateSettings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -495,7 +470,7 @@ export default class Watcher { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { querystring[key] = params[key] } } diff --git a/src/api/api/xpack.ts b/src/api/api/xpack.ts index 55e3d106a..a118abc74 100644 --- a/src/api/api/xpack.ts +++ b/src/api/api/xpack.ts @@ -35,7 +35,6 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' -import * as TB from '../typesWithBodyKey' interface That { transport: Transport } export default class Xpack { @@ -48,10 +47,10 @@ export default class Xpack { * Provides general information about the installed X-Pack features. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/info-api.html | Elasticsearch API documentation} */ - async info (this: That, params?: T.XpackInfoRequest | TB.XpackInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async info (this: That, params?: T.XpackInfoRequest | TB.XpackInfoRequest, options?: TransportRequestOptionsWithMeta): Promise> - async info (this: That, params?: T.XpackInfoRequest | TB.XpackInfoRequest, options?: TransportRequestOptions): Promise - async info (this: That, params?: T.XpackInfoRequest | TB.XpackInfoRequest, options?: TransportRequestOptions): Promise { + async info (this: That, params?: T.XpackInfoRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async info (this: That, params?: T.XpackInfoRequest, options?: TransportRequestOptionsWithMeta): Promise> + async info (this: That, params?: T.XpackInfoRequest, options?: TransportRequestOptions): Promise + async info (this: That, params?: T.XpackInfoRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -60,7 +59,7 @@ export default class Xpack { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } @@ -78,10 +77,10 @@ export default class Xpack { * This API provides information about which features are currently enabled and available under the current license and some usage statistics. * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.17/usage-api.html | Elasticsearch API documentation} */ - async usage (this: That, params?: T.XpackUsageRequest | TB.XpackUsageRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async usage (this: That, params?: T.XpackUsageRequest | TB.XpackUsageRequest, options?: TransportRequestOptionsWithMeta): Promise> - async usage (this: That, params?: T.XpackUsageRequest | TB.XpackUsageRequest, options?: TransportRequestOptions): Promise - async usage (this: That, params?: T.XpackUsageRequest | TB.XpackUsageRequest, options?: TransportRequestOptions): Promise { + async usage (this: That, params?: T.XpackUsageRequest, options?: TransportRequestOptionsWithOutMeta): Promise + async usage (this: That, params?: T.XpackUsageRequest, options?: TransportRequestOptionsWithMeta): Promise> + async usage (this: That, params?: T.XpackUsageRequest, options?: TransportRequestOptions): Promise + async usage (this: That, params?: T.XpackUsageRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = [] const querystring: Record = {} const body = undefined @@ -90,7 +89,7 @@ export default class Xpack { for (const key in params) { if (acceptedPath.includes(key)) { continue - } else if (key !== 'body') { + } else { // @ts-expect-error querystring[key] = params[key] } diff --git a/src/api/types.ts b/src/api/types.ts index df2689fe0..3807a7c69 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -6674,7 +6674,6 @@ export interface AsyncSearchSubmitRequest extends RequestBase { index?: Indices wait_for_completion_timeout?: Duration keep_on_completion?: boolean - keep_alive?: Duration allow_no_indices?: boolean allow_partial_search_results?: boolean analyzer?: string @@ -6690,7 +6689,6 @@ export interface AsyncSearchSubmitRequest extends RequestBase { max_concurrent_shard_requests?: long min_compatible_shard_node?: VersionString preference?: string - pre_filter_shard_size?: long request_cache?: boolean routing?: Routing search_type?: SearchType @@ -11021,8 +11019,8 @@ export interface IndicesMappingLimitSettingsNestedObjects { } export interface IndicesMappingLimitSettingsTotalFields { - limit?: long - ignore_dynamic_beyond_limit?: boolean + limit?: long | string + ignore_dynamic_beyond_limit?: boolean | string } export interface IndicesMerge { @@ -13342,10 +13340,12 @@ export interface LogstashPutPipelineRequest extends RequestBase { export type LogstashPutPipelineResponse = boolean export interface MigrationDeprecationsDeprecation { - details: string + details?: string level: MigrationDeprecationsDeprecationLevel message: string url: string + resolve_during_rolling_upgrade: boolean + _meta?: Record } export type MigrationDeprecationsDeprecationLevel = 'none' | 'info' | 'warning' | 'critical' @@ -16509,7 +16509,7 @@ export interface NodesInfoNodeInfoPath { logs?: string home?: string repo?: string[] - data?: string[] + data?: string | string[] } export interface NodesInfoNodeInfoRepositories { diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts deleted file mode 100644 index 87b9541bb..000000000 --- a/src/api/typesWithBodyKey.ts +++ /dev/null @@ -1,21281 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* eslint-disable @typescript-eslint/array-type */ -/* eslint-disable @typescript-eslint/no-empty-interface */ -/* eslint-disable @typescript-eslint/no-unused-vars */ - -/** - * We are still working on this type, it will arrive soon. - * If it's critical for you, please open an issue. - * https://github.com/elastic/elasticsearch-js - */ -export type TODO = Record - -export interface BulkCreateOperation extends BulkWriteOperation { -} - -export interface BulkDeleteOperation extends BulkOperationBase { -} - -export interface BulkIndexOperation extends BulkWriteOperation { -} - -export interface BulkOperationBase { - _id?: Id - _index?: IndexName - routing?: Routing - if_primary_term?: long - if_seq_no?: SequenceNumber - version?: VersionNumber - version_type?: VersionType -} - -export interface BulkOperationContainer { - index?: BulkIndexOperation - create?: BulkCreateOperation - update?: BulkUpdateOperation - delete?: BulkDeleteOperation -} - -export type BulkOperationType = 'index' | 'create' | 'update' | 'delete' - -export interface BulkRequest extends RequestBase { - index?: IndexName - pipeline?: string - refresh?: Refresh - routing?: Routing - _source?: SearchSourceConfigParam - _source_excludes?: Fields - _source_includes?: Fields - timeout?: Duration - wait_for_active_shards?: WaitForActiveShards - require_alias?: boolean - /** @deprecated The use of the 'body' key has been deprecated, use 'operations' instead. */ - body?: (BulkOperationContainer | BulkUpdateAction | TDocument)[] -} - -export interface BulkResponse { - errors: boolean - items: Partial>[] - took: long - ingest_took?: long -} - -export interface BulkResponseItem { - _id?: string | null - _index: string - status: integer - error?: ErrorCause - _primary_term?: long - result?: string - _seq_no?: SequenceNumber - _shards?: ShardStatistics - _version?: VersionNumber - forced_refresh?: boolean - get?: InlineGet> -} - -export interface BulkUpdateAction { - detect_noop?: boolean - doc?: TPartialDocument - doc_as_upsert?: boolean - script?: Script | string - scripted_upsert?: boolean - _source?: SearchSourceConfig - upsert?: TDocument -} - -export interface BulkUpdateOperation extends BulkOperationBase { - require_alias?: boolean - retry_on_conflict?: integer -} - -export interface BulkWriteOperation extends BulkOperationBase { - dynamic_templates?: Record - pipeline?: string - require_alias?: boolean -} - -export interface ClearScrollRequest extends RequestBase { - scroll_id?: ScrollIds - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - scroll_id?: ScrollIds - } -} - -export interface ClearScrollResponse { - succeeded: boolean - num_freed: integer -} - -export interface ClosePointInTimeRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - id: Id - } -} - -export interface ClosePointInTimeResponse { - succeeded: boolean - num_freed: integer -} - -export interface CountRequest extends RequestBase { - index?: Indices - allow_no_indices?: boolean - analyzer?: string - analyze_wildcard?: boolean - default_operator?: QueryDslOperator - df?: string - expand_wildcards?: ExpandWildcards - ignore_throttled?: boolean - ignore_unavailable?: boolean - lenient?: boolean - min_score?: double - preference?: string - routing?: Routing - terminate_after?: long - q?: string - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - query?: QueryDslQueryContainer - } -} - -export interface CountResponse { - count: long - _shards: ShardStatistics -} - -export interface CreateRequest extends RequestBase { - id: Id - index: IndexName - pipeline?: string - refresh?: Refresh - routing?: Routing - timeout?: Duration - version?: VersionNumber - version_type?: VersionType - wait_for_active_shards?: WaitForActiveShards - /** @deprecated The use of the 'body' key has been deprecated, use 'document' instead. */ - body?: TDocument -} - -export type CreateResponse = WriteResponseBase - -export interface DeleteRequest extends RequestBase { - id: Id - index: IndexName - if_primary_term?: long - if_seq_no?: SequenceNumber - refresh?: Refresh - routing?: Routing - timeout?: Duration - version?: VersionNumber - version_type?: VersionType - wait_for_active_shards?: WaitForActiveShards -} - -export type DeleteResponse = WriteResponseBase - -export interface DeleteByQueryRequest extends RequestBase { - index: Indices - allow_no_indices?: boolean - analyzer?: string - analyze_wildcard?: boolean - conflicts?: Conflicts - default_operator?: QueryDslOperator - df?: string - expand_wildcards?: ExpandWildcards - from?: long - ignore_unavailable?: boolean - lenient?: boolean - preference?: string - refresh?: boolean - request_cache?: boolean - requests_per_second?: float - routing?: Routing - q?: string - scroll?: Duration - scroll_size?: long - search_timeout?: Duration - search_type?: SearchType - slices?: Slices - sort?: string[] - stats?: string[] - terminate_after?: long - timeout?: Duration - version?: boolean - wait_for_active_shards?: WaitForActiveShards - wait_for_completion?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - max_docs?: long - query?: QueryDslQueryContainer - slice?: SlicedScroll - } -} - -export interface DeleteByQueryResponse { - batches?: long - deleted?: long - failures?: BulkIndexByScrollFailure[] - noops?: long - requests_per_second?: float - retries?: Retries - slice_id?: integer - task?: TaskId - throttled?: Duration - throttled_millis?: DurationValue - throttled_until?: Duration - throttled_until_millis?: DurationValue - timed_out?: boolean - took?: DurationValue - total?: long - version_conflicts?: long -} - -export interface DeleteByQueryRethrottleRequest extends RequestBase { - task_id: TaskId - requests_per_second?: float -} - -export type DeleteByQueryRethrottleResponse = TasksTaskListResponseBase - -export interface DeleteScriptRequest extends RequestBase { - id: Id - master_timeout?: Duration - timeout?: Duration -} - -export type DeleteScriptResponse = AcknowledgedResponseBase - -export interface ExistsRequest extends RequestBase { - id: Id - index: IndexName - preference?: string - realtime?: boolean - refresh?: boolean - routing?: Routing - _source?: SearchSourceConfigParam - _source_excludes?: Fields - _source_includes?: Fields - stored_fields?: Fields - version?: VersionNumber - version_type?: VersionType -} - -export type ExistsResponse = boolean - -export interface ExistsSourceRequest extends RequestBase { - id: Id - index: IndexName - preference?: string - realtime?: boolean - refresh?: boolean - routing?: Routing - _source?: SearchSourceConfigParam - _source_excludes?: Fields - _source_includes?: Fields - version?: VersionNumber - version_type?: VersionType -} - -export type ExistsSourceResponse = boolean - -export interface ExplainExplanation { - description: string - details: ExplainExplanationDetail[] - value: float -} - -export interface ExplainExplanationDetail { - description: string - details?: ExplainExplanationDetail[] - value: float -} - -export interface ExplainRequest extends RequestBase { - id: Id - index: IndexName - analyzer?: string - analyze_wildcard?: boolean - default_operator?: QueryDslOperator - df?: string - lenient?: boolean - preference?: string - routing?: Routing - _source?: SearchSourceConfigParam - _source_excludes?: Fields - _source_includes?: Fields - stored_fields?: Fields - q?: string - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - query?: QueryDslQueryContainer - } -} - -export interface ExplainResponse { - _index: IndexName - _id: Id - matched: boolean - explanation?: ExplainExplanationDetail - get?: InlineGet -} - -export interface FieldCapsFieldCapability { - aggregatable: boolean - indices?: Indices - meta?: Metadata - non_aggregatable_indices?: Indices - non_searchable_indices?: Indices - searchable: boolean - type: string - metadata_field?: boolean - time_series_dimension?: boolean - time_series_metric?: MappingTimeSeriesMetricType - non_dimension_indices?: IndexName[] - metric_conflicts_indices?: IndexName[] -} - -export interface FieldCapsRequest extends RequestBase { - index?: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - include_unmapped?: boolean - filters?: string - types?: string[] - include_empty_fields?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - fields?: Fields - index_filter?: QueryDslQueryContainer - runtime_mappings?: MappingRuntimeFields - } -} - -export interface FieldCapsResponse { - indices: Indices - fields: Record> -} - -export interface GetGetResult { - _index: IndexName - fields?: Record - _ignored?: string[] - found: boolean - _id: Id - _primary_term?: long - _routing?: string - _seq_no?: SequenceNumber - _source?: TDocument - _version?: VersionNumber -} - -export interface GetRequest extends RequestBase { - id: Id - index: IndexName - force_synthetic_source?: boolean - preference?: string - realtime?: boolean - refresh?: boolean - routing?: Routing - _source?: SearchSourceConfigParam - _source_excludes?: Fields - _source_includes?: Fields - stored_fields?: Fields - version?: VersionNumber - version_type?: VersionType -} - -export type GetResponse = GetGetResult - -export interface GetScriptRequest extends RequestBase { - id: Id - master_timeout?: Duration -} - -export interface GetScriptResponse { - _id: Id - found: boolean - script?: StoredScript -} - -export interface GetScriptContextContext { - methods: GetScriptContextContextMethod[] - name: Name -} - -export interface GetScriptContextContextMethod { - name: Name - return_type: string - params: GetScriptContextContextMethodParam[] -} - -export interface GetScriptContextContextMethodParam { - name: Name - type: string -} - -export interface GetScriptContextRequest extends RequestBase { -} - -export interface GetScriptContextResponse { - contexts: GetScriptContextContext[] -} - -export interface GetScriptLanguagesLanguageContext { - contexts: string[] - language: ScriptLanguage -} - -export interface GetScriptLanguagesRequest extends RequestBase { -} - -export interface GetScriptLanguagesResponse { - language_contexts: GetScriptLanguagesLanguageContext[] - types_allowed: string[] -} - -export interface GetSourceRequest extends RequestBase { - id: Id - index: IndexName - preference?: string - realtime?: boolean - refresh?: boolean - routing?: Routing - _source?: SearchSourceConfigParam - _source_excludes?: Fields - _source_includes?: Fields - stored_fields?: Fields - version?: VersionNumber - version_type?: VersionType -} - -export type GetSourceResponse = TDocument - -export interface HealthReportBaseIndicator { - status: HealthReportIndicatorHealthStatus - symptom: string - impacts?: HealthReportImpact[] - diagnosis?: HealthReportDiagnosis[] -} - -export interface HealthReportDataStreamLifecycleDetails { - stagnating_backing_indices_count: integer - total_backing_indices_in_error: integer - stagnating_backing_indices?: HealthReportStagnatingBackingIndices[] -} - -export interface HealthReportDataStreamLifecycleIndicator extends HealthReportBaseIndicator { - details?: HealthReportDataStreamLifecycleDetails -} - -export interface HealthReportDiagnosis { - id: string - action: string - affected_resources: HealthReportDiagnosisAffectedResources - cause: string - help_url: string -} - -export interface HealthReportDiagnosisAffectedResources { - indices?: Indices - nodes?: HealthReportIndicatorNode[] - slm_policies?: string[] - feature_states?: string[] - snapshot_repositories?: string[] -} - -export interface HealthReportDiskIndicator extends HealthReportBaseIndicator { - details?: HealthReportDiskIndicatorDetails -} - -export interface HealthReportDiskIndicatorDetails { - indices_with_readonly_block: long - nodes_with_enough_disk_space: long - nodes_over_high_watermark: long - nodes_over_flood_stage_watermark: long - nodes_with_unknown_disk_status: long -} - -export interface HealthReportIlmIndicator extends HealthReportBaseIndicator { - details?: HealthReportIlmIndicatorDetails -} - -export interface HealthReportIlmIndicatorDetails { - ilm_status: LifecycleOperationMode - policies: long - stagnating_indices: integer -} - -export interface HealthReportImpact { - description: string - id: string - impact_areas: HealthReportImpactArea[] - severity: integer -} - -export type HealthReportImpactArea = 'search' | 'ingest' | 'backup' | 'deployment_management' - -export type HealthReportIndicatorHealthStatus = 'green' | 'yellow' | 'red' | 'unknown' - -export interface HealthReportIndicatorNode { - name: string | null - node_id: string | null -} - -export interface HealthReportIndicators { - master_is_stable?: HealthReportMasterIsStableIndicator - shards_availability?: HealthReportShardsAvailabilityIndicator - disk?: HealthReportDiskIndicator - repository_integrity?: HealthReportRepositoryIntegrityIndicator - data_stream_lifecycle?: HealthReportDataStreamLifecycleIndicator - ilm?: HealthReportIlmIndicator - slm?: HealthReportSlmIndicator - shards_capacity?: HealthReportShardsCapacityIndicator -} - -export interface HealthReportMasterIsStableIndicator extends HealthReportBaseIndicator { - details?: HealthReportMasterIsStableIndicatorDetails -} - -export interface HealthReportMasterIsStableIndicatorClusterFormationNode { - name?: string - node_id: string - cluster_formation_message: string -} - -export interface HealthReportMasterIsStableIndicatorDetails { - current_master: HealthReportIndicatorNode - recent_masters: HealthReportIndicatorNode[] - exception_fetching_history?: HealthReportMasterIsStableIndicatorExceptionFetchingHistory - cluster_formation?: HealthReportMasterIsStableIndicatorClusterFormationNode[] -} - -export interface HealthReportMasterIsStableIndicatorExceptionFetchingHistory { - message: string - stack_trace: string -} - -export interface HealthReportRepositoryIntegrityIndicator extends HealthReportBaseIndicator { - details?: HealthReportRepositoryIntegrityIndicatorDetails -} - -export interface HealthReportRepositoryIntegrityIndicatorDetails { - total_repositories?: long - corrupted_repositories?: long - corrupted?: string[] -} - -export interface HealthReportRequest extends RequestBase { - feature?: string | string[] - timeout?: Duration - verbose?: boolean - size?: integer -} - -export interface HealthReportResponse { - cluster_name: string - indicators: HealthReportIndicators - status?: HealthReportIndicatorHealthStatus -} - -export interface HealthReportShardsAvailabilityIndicator extends HealthReportBaseIndicator { - details?: HealthReportShardsAvailabilityIndicatorDetails -} - -export interface HealthReportShardsAvailabilityIndicatorDetails { - creating_primaries: long - creating_replicas: long - initializing_primaries: long - initializing_replicas: long - restarting_primaries: long - restarting_replicas: long - started_primaries: long - started_replicas: long - unassigned_primaries: long - unassigned_replicas: long -} - -export interface HealthReportShardsCapacityIndicator extends HealthReportBaseIndicator { - details?: HealthReportShardsCapacityIndicatorDetails -} - -export interface HealthReportShardsCapacityIndicatorDetails { - data: HealthReportShardsCapacityIndicatorTierDetail - frozen: HealthReportShardsCapacityIndicatorTierDetail -} - -export interface HealthReportShardsCapacityIndicatorTierDetail { - max_shards_in_cluster: integer - current_used_shards?: integer -} - -export interface HealthReportSlmIndicator extends HealthReportBaseIndicator { - details?: HealthReportSlmIndicatorDetails -} - -export interface HealthReportSlmIndicatorDetails { - slm_status: LifecycleOperationMode - policies: long - unhealthy_policies?: HealthReportSlmIndicatorUnhealthyPolicies -} - -export interface HealthReportSlmIndicatorUnhealthyPolicies { - count: long - invocations_since_last_success?: Record -} - -export interface HealthReportStagnatingBackingIndices { - index_name: IndexName - first_occurrence_timestamp: long - retry_count: integer -} - -export interface IndexRequest extends RequestBase { - id?: Id - index: IndexName - if_primary_term?: long - if_seq_no?: SequenceNumber - op_type?: OpType - pipeline?: string - refresh?: Refresh - routing?: Routing - timeout?: Duration - version?: VersionNumber - version_type?: VersionType - wait_for_active_shards?: WaitForActiveShards - require_alias?: boolean - /** @deprecated The use of the 'body' key has been deprecated, use 'document' instead. */ - body?: TDocument -} - -export type IndexResponse = WriteResponseBase - -export interface InfoRequest extends RequestBase { -} - -export interface InfoResponse { - cluster_name: Name - cluster_uuid: Uuid - name: Name - tagline: string - version: ElasticsearchVersionInfo -} - -export interface KnnSearchRequest extends RequestBase { - index: Indices - routing?: Routing - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - _source?: SearchSourceConfig - docvalue_fields?: (QueryDslFieldAndFormat | Field)[] - stored_fields?: Fields - fields?: Fields - filter?: QueryDslQueryContainer | QueryDslQueryContainer[] - knn: KnnSearchQuery - } -} - -export interface KnnSearchResponse { - took: long - timed_out: boolean - _shards: ShardStatistics - hits: SearchHitsMetadata - fields?: Record - max_score?: double -} - -export interface KnnSearchQuery { - field: Field - query_vector: QueryVector - k: integer - num_candidates: integer -} - -export interface MgetMultiGetError { - error: ErrorCause - _id: Id - _index: IndexName -} - -export interface MgetOperation { - _id: Id - _index?: IndexName - routing?: Routing - _source?: SearchSourceConfig - stored_fields?: Fields - version?: VersionNumber - version_type?: VersionType -} - -export interface MgetRequest extends RequestBase { - index?: IndexName - force_synthetic_source?: boolean - preference?: string - realtime?: boolean - refresh?: boolean - routing?: Routing - _source?: SearchSourceConfigParam - _source_excludes?: Fields - _source_includes?: Fields - stored_fields?: Fields - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - docs?: MgetOperation[] - ids?: Ids - } -} - -export interface MgetResponse { - docs: MgetResponseItem[] -} - -export type MgetResponseItem = GetGetResult | MgetMultiGetError - -export interface MsearchMultiSearchItem extends SearchResponseBody { - status?: integer -} - -export interface MsearchMultiSearchResult> { - took: long - responses: MsearchResponseItem[] -} - -export interface MsearchMultisearchBody { - aggregations?: Record - aggs?: Record - collapse?: SearchFieldCollapse - query?: QueryDslQueryContainer - explain?: boolean - ext?: Record - stored_fields?: Fields - docvalue_fields?: (QueryDslFieldAndFormat | Field)[] - knn?: KnnSearch | KnnSearch[] - from?: integer - highlight?: SearchHighlight - indices_boost?: Record[] - min_score?: double - post_filter?: QueryDslQueryContainer - profile?: boolean - rescore?: SearchRescore | SearchRescore[] - script_fields?: Record - search_after?: SortResults - size?: integer - sort?: Sort - _source?: SearchSourceConfig - fields?: (QueryDslFieldAndFormat | Field)[] - terminate_after?: long - stats?: string[] - timeout?: string - track_scores?: boolean - track_total_hits?: SearchTrackHits - version?: boolean - runtime_mappings?: MappingRuntimeFields - seq_no_primary_term?: boolean - pit?: SearchPointInTimeReference - suggest?: SearchSuggester -} - -export interface MsearchMultisearchHeader { - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - index?: Indices - preference?: string - request_cache?: boolean - routing?: Routing - search_type?: SearchType - ccs_minimize_roundtrips?: boolean - allow_partial_search_results?: boolean - ignore_throttled?: boolean -} - -export interface MsearchRequest extends RequestBase { - index?: Indices - allow_no_indices?: boolean - ccs_minimize_roundtrips?: boolean - expand_wildcards?: ExpandWildcards - ignore_throttled?: boolean - ignore_unavailable?: boolean - include_named_queries_score?: boolean - max_concurrent_searches?: long - max_concurrent_shard_requests?: long - pre_filter_shard_size?: long - rest_total_hits_as_int?: boolean - routing?: Routing - search_type?: SearchType - typed_keys?: boolean - /** @deprecated The use of the 'body' key has been deprecated, use 'searches' instead. */ - body?: MsearchRequestItem[] -} - -export type MsearchRequestItem = MsearchMultisearchHeader | MsearchMultisearchBody - -export type MsearchResponse> = MsearchMultiSearchResult - -export type MsearchResponseItem = MsearchMultiSearchItem | ErrorResponseBase - -export interface MsearchTemplateRequest extends RequestBase { - index?: Indices - ccs_minimize_roundtrips?: boolean - max_concurrent_searches?: long - search_type?: SearchType - rest_total_hits_as_int?: boolean - typed_keys?: boolean - /** @deprecated The use of the 'body' key has been deprecated, use 'search_templates' instead. */ - body?: MsearchTemplateRequestItem[] -} - -export type MsearchTemplateRequestItem = MsearchMultisearchHeader | MsearchTemplateTemplateConfig - -export type MsearchTemplateResponse> = MsearchMultiSearchResult - -export interface MsearchTemplateTemplateConfig { - explain?: boolean - id?: Id - params?: Record - profile?: boolean - source?: string -} - -export interface MtermvectorsOperation { - _id?: Id - _index?: IndexName - doc?: any - fields?: Fields - field_statistics?: boolean - filter?: TermvectorsFilter - offsets?: boolean - payloads?: boolean - positions?: boolean - routing?: Routing - term_statistics?: boolean - version?: VersionNumber - version_type?: VersionType -} - -export interface MtermvectorsRequest extends RequestBase { - index?: IndexName - fields?: Fields - field_statistics?: boolean - offsets?: boolean - payloads?: boolean - positions?: boolean - preference?: string - realtime?: boolean - routing?: Routing - term_statistics?: boolean - version?: VersionNumber - version_type?: VersionType - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - docs?: MtermvectorsOperation[] - ids?: Id[] - } -} - -export interface MtermvectorsResponse { - docs: MtermvectorsTermVectorsResult[] -} - -export interface MtermvectorsTermVectorsResult { - _id?: Id - _index: IndexName - _version?: VersionNumber - took?: long - found?: boolean - term_vectors?: Record - error?: ErrorCause -} - -export interface OpenPointInTimeRequest extends RequestBase { - index: Indices - keep_alive: Duration - ignore_unavailable?: boolean - preference?: string - routing?: Routing - expand_wildcards?: ExpandWildcards - allow_partial_search_results?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - index_filter?: QueryDslQueryContainer - } -} - -export interface OpenPointInTimeResponse { - _shards: ShardStatistics - id: Id -} - -export interface PingRequest extends RequestBase { -} - -export type PingResponse = boolean - -export interface PutScriptRequest extends RequestBase { - id: Id - context?: Name - master_timeout?: Duration - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - script: StoredScript - } -} - -export type PutScriptResponse = AcknowledgedResponseBase - -export interface RankEvalDocumentRating { - _id: Id - _index: IndexName - rating: integer -} - -export interface RankEvalRankEvalHit { - _id: Id - _index: IndexName - _score: double -} - -export interface RankEvalRankEvalHitItem { - hit: RankEvalRankEvalHit - rating?: double | null -} - -export interface RankEvalRankEvalMetric { - precision?: RankEvalRankEvalMetricPrecision - recall?: RankEvalRankEvalMetricRecall - mean_reciprocal_rank?: RankEvalRankEvalMetricMeanReciprocalRank - dcg?: RankEvalRankEvalMetricDiscountedCumulativeGain - expected_reciprocal_rank?: RankEvalRankEvalMetricExpectedReciprocalRank -} - -export interface RankEvalRankEvalMetricBase { - k?: integer -} - -export interface RankEvalRankEvalMetricDetail { - metric_score: double - unrated_docs: RankEvalUnratedDocument[] - hits: RankEvalRankEvalHitItem[] - metric_details: Record> -} - -export interface RankEvalRankEvalMetricDiscountedCumulativeGain extends RankEvalRankEvalMetricBase { - normalize?: boolean -} - -export interface RankEvalRankEvalMetricExpectedReciprocalRank extends RankEvalRankEvalMetricBase { - maximum_relevance: integer -} - -export interface RankEvalRankEvalMetricMeanReciprocalRank extends RankEvalRankEvalMetricRatingTreshold { -} - -export interface RankEvalRankEvalMetricPrecision extends RankEvalRankEvalMetricRatingTreshold { - ignore_unlabeled?: boolean -} - -export interface RankEvalRankEvalMetricRatingTreshold extends RankEvalRankEvalMetricBase { - relevant_rating_threshold?: integer -} - -export interface RankEvalRankEvalMetricRecall extends RankEvalRankEvalMetricRatingTreshold { -} - -export interface RankEvalRankEvalQuery { - query: QueryDslQueryContainer - size?: integer -} - -export interface RankEvalRankEvalRequestItem { - id: Id - request?: RankEvalRankEvalQuery | QueryDslQueryContainer - ratings: RankEvalDocumentRating[] - template_id?: Id - params?: Record -} - -export interface RankEvalRequest extends RequestBase { - index?: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - search_type?: string - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - requests: RankEvalRankEvalRequestItem[] - metric?: RankEvalRankEvalMetric - } -} - -export interface RankEvalResponse { - metric_score: double - details: Record - failures: Record -} - -export interface RankEvalUnratedDocument { - _id: Id - _index: IndexName -} - -export interface ReindexDestination { - index: IndexName - op_type?: OpType - pipeline?: string - routing?: Routing - version_type?: VersionType -} - -export interface ReindexRemoteSource { - connect_timeout?: Duration - headers?: Record - host: Host - username?: Username - password?: Password - socket_timeout?: Duration -} - -export interface ReindexRequest extends RequestBase { - refresh?: boolean - requests_per_second?: float - scroll?: Duration - slices?: Slices - timeout?: Duration - wait_for_active_shards?: WaitForActiveShards - wait_for_completion?: boolean - require_alias?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - conflicts?: Conflicts - dest: ReindexDestination - max_docs?: long - script?: Script | string - size?: long - source: ReindexSource - } -} - -export interface ReindexResponse { - batches?: long - created?: long - deleted?: long - failures?: BulkIndexByScrollFailure[] - noops?: long - retries?: Retries - requests_per_second?: float - slice_id?: integer - task?: TaskId - throttled_millis?: EpochTime - throttled_until_millis?: EpochTime - timed_out?: boolean - took?: DurationValue - total?: long - updated?: long - version_conflicts?: long -} - -export interface ReindexSource { - index: Indices - query?: QueryDslQueryContainer - remote?: ReindexRemoteSource - size?: integer - slice?: SlicedScroll - sort?: Sort - _source?: Fields - runtime_mappings?: MappingRuntimeFields -} - -export interface ReindexRethrottleReindexNode extends SpecUtilsBaseNode { - tasks: Record -} - -export interface ReindexRethrottleReindexStatus { - batches: long - created: long - deleted: long - noops: long - requests_per_second: float - retries: Retries - throttled?: Duration - throttled_millis: DurationValue - throttled_until?: Duration - throttled_until_millis: DurationValue - total: long - updated: long - version_conflicts: long -} - -export interface ReindexRethrottleReindexTask { - action: string - cancellable: boolean - description: string - id: long - node: Name - running_time_in_nanos: DurationValue - start_time_in_millis: EpochTime - status: ReindexRethrottleReindexStatus - type: string - headers: HttpHeaders -} - -export interface ReindexRethrottleRequest extends RequestBase { - task_id: Id - requests_per_second?: float -} - -export interface ReindexRethrottleResponse { - nodes: Record -} - -export interface RenderSearchTemplateRequest extends RequestBase { - id?: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - file?: string - params?: Record - source?: string - } -} - -export interface RenderSearchTemplateResponse { - template_output: Record -} - -export interface ScriptsPainlessExecutePainlessContextSetup { - document: any - index: IndexName - query?: QueryDslQueryContainer -} - -export interface ScriptsPainlessExecuteRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - context?: string - context_setup?: ScriptsPainlessExecutePainlessContextSetup - script?: Script | string - } -} - -export interface ScriptsPainlessExecuteResponse { - result: TResult -} - -export interface ScrollRequest extends RequestBase { - scroll_id?: ScrollId - rest_total_hits_as_int?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - scroll?: Duration - scroll_id: ScrollId - } -} - -export type ScrollResponse> = SearchResponseBody - -export interface SearchRequest extends RequestBase { - index?: Indices - allow_no_indices?: boolean - allow_partial_search_results?: boolean - analyzer?: string - analyze_wildcard?: boolean - batched_reduce_size?: long - ccs_minimize_roundtrips?: boolean - default_operator?: QueryDslOperator - df?: string - expand_wildcards?: ExpandWildcards - ignore_throttled?: boolean - ignore_unavailable?: boolean - include_named_queries_score?: boolean - lenient?: boolean - max_concurrent_shard_requests?: long - min_compatible_shard_node?: VersionString - preference?: string - pre_filter_shard_size?: long - request_cache?: boolean - routing?: Routing - scroll?: Duration - search_type?: SearchType - suggest_field?: Field - suggest_mode?: SuggestMode - suggest_size?: long - suggest_text?: string - typed_keys?: boolean - rest_total_hits_as_int?: boolean - _source_excludes?: Fields - _source_includes?: Fields - q?: string - force_synthetic_source?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - aggregations?: Record - /** @alias aggregations */ - aggs?: Record - collapse?: SearchFieldCollapse - explain?: boolean - ext?: Record - from?: integer - highlight?: SearchHighlight - track_total_hits?: SearchTrackHits - indices_boost?: Record[] - docvalue_fields?: (QueryDslFieldAndFormat | Field)[] - knn?: KnnSearch | KnnSearch[] - rank?: RankContainer - min_score?: double - post_filter?: QueryDslQueryContainer - profile?: boolean - query?: QueryDslQueryContainer - rescore?: SearchRescore | SearchRescore[] - retriever?: RetrieverContainer - script_fields?: Record - search_after?: SortResults - size?: integer - slice?: SlicedScroll - sort?: Sort - _source?: SearchSourceConfig - fields?: (QueryDslFieldAndFormat | Field)[] - suggest?: SearchSuggester - terminate_after?: long - timeout?: string - track_scores?: boolean - version?: boolean - seq_no_primary_term?: boolean - stored_fields?: Fields - pit?: SearchPointInTimeReference - runtime_mappings?: MappingRuntimeFields - stats?: string[] - } -} - -export type SearchResponse> = SearchResponseBody - -export interface SearchResponseBody> { - took: long - timed_out: boolean - _shards: ShardStatistics - hits: SearchHitsMetadata - aggregations?: TAggregations - _clusters?: ClusterStatistics - fields?: Record - max_score?: double - num_reduce_phases?: long - profile?: SearchProfile - pit_id?: Id - _scroll_id?: ScrollId - suggest?: Record[]> - terminated_early?: boolean -} - -export interface SearchAggregationBreakdown { - build_aggregation: long - build_aggregation_count: long - build_leaf_collector: long - build_leaf_collector_count: long - collect: long - collect_count: long - initialize: long - initialize_count: long - post_collection?: long - post_collection_count?: long - reduce: long - reduce_count: long -} - -export interface SearchAggregationProfile { - breakdown: SearchAggregationBreakdown - description: string - time_in_nanos: DurationValue - type: string - debug?: SearchAggregationProfileDebug - children?: SearchAggregationProfile[] -} - -export interface SearchAggregationProfileDebug { - segments_with_multi_valued_ords?: integer - collection_strategy?: string - segments_with_single_valued_ords?: integer - total_buckets?: integer - built_buckets?: integer - result_strategy?: string - has_filter?: boolean - delegate?: string - delegate_debug?: SearchAggregationProfileDebug - chars_fetched?: integer - extract_count?: integer - extract_ns?: integer - values_fetched?: integer - collect_analyzed_ns?: integer - collect_analyzed_count?: integer - surviving_buckets?: integer - ordinals_collectors_used?: integer - ordinals_collectors_overhead_too_high?: integer - string_hashing_collectors_used?: integer - numeric_collectors_used?: integer - empty_collectors_used?: integer - deferred_aggregators?: string[] - segments_with_doc_count_field?: integer - segments_with_deleted_docs?: integer - filters?: SearchAggregationProfileDelegateDebugFilter[] - segments_counted?: integer - segments_collected?: integer - map_reducer?: string - brute_force_used?: integer - dynamic_pruning_attempted?: integer - dynamic_pruning_used?: integer - skipped_due_to_no_data?: integer -} - -export interface SearchAggregationProfileDelegateDebugFilter { - results_from_metadata?: integer - query?: string - specialized_for?: string - segments_counted_in_constant_time?: integer -} - -export type SearchBoundaryScanner = 'chars' | 'sentence' | 'word' - -export interface SearchCollector { - name: string - reason: string - time_in_nanos: DurationValue - children?: SearchCollector[] -} - -export interface SearchCompletionContext { - boost?: double - context: SearchContext - neighbours?: GeoHashPrecision[] - precision?: GeoHashPrecision - prefix?: boolean -} - -export interface SearchCompletionSuggest extends SearchSuggestBase { - options: SearchCompletionSuggestOption | SearchCompletionSuggestOption[] -} - -export interface SearchCompletionSuggestOption { - collate_match?: boolean - contexts?: Record - fields?: Record - _id?: string - _index?: IndexName - _routing?: Routing - _score?: double - _source?: TDocument - text: string - score?: double -} - -export interface SearchCompletionSuggester extends SearchSuggesterBase { - contexts?: Record - fuzzy?: SearchSuggestFuzziness - regex?: SearchRegexOptions - skip_duplicates?: boolean -} - -export type SearchContext = string | GeoLocation - -export interface SearchDfsKnnProfile { - vector_operations_count?: long - query: SearchKnnQueryProfileResult[] - rewrite_time: long - collector: SearchKnnCollectorResult[] -} - -export interface SearchDfsProfile { - statistics?: SearchDfsStatisticsProfile - knn?: SearchDfsKnnProfile[] -} - -export interface SearchDfsStatisticsBreakdown { - collection_statistics: long - collection_statistics_count: long - create_weight: long - create_weight_count: long - rewrite: long - rewrite_count: long - term_statistics: long - term_statistics_count: long -} - -export interface SearchDfsStatisticsProfile { - type: string - description: string - time?: Duration - time_in_nanos: DurationValue - breakdown: SearchDfsStatisticsBreakdown - debug?: Record - children?: SearchDfsStatisticsProfile[] -} - -export interface SearchDirectGenerator { - field: Field - max_edits?: integer - max_inspections?: float - max_term_freq?: float - min_doc_freq?: float - min_word_length?: integer - post_filter?: string - pre_filter?: string - prefix_length?: integer - size?: integer - suggest_mode?: SuggestMode -} - -export interface SearchFetchProfile { - type: string - description: string - time_in_nanos: DurationValue - breakdown: SearchFetchProfileBreakdown - debug?: SearchFetchProfileDebug - children?: SearchFetchProfile[] -} - -export interface SearchFetchProfileBreakdown { - load_source?: integer - load_source_count?: integer - load_stored_fields?: integer - load_stored_fields_count?: integer - next_reader?: integer - next_reader_count?: integer - process_count?: integer - process?: integer -} - -export interface SearchFetchProfileDebug { - stored_fields?: string[] - fast_path?: integer -} - -export interface SearchFieldCollapse { - field: Field - inner_hits?: SearchInnerHits | SearchInnerHits[] - max_concurrent_group_searches?: integer - collapse?: SearchFieldCollapse -} - -export interface SearchFieldSuggester { - completion?: SearchCompletionSuggester - phrase?: SearchPhraseSuggester - term?: SearchTermSuggester - prefix?: string - regex?: string - text?: string -} - -export interface SearchHighlight extends SearchHighlightBase { - encoder?: SearchHighlighterEncoder - fields: Record -} - -export interface SearchHighlightBase { - type?: SearchHighlighterType - boundary_chars?: string - boundary_max_scan?: integer - boundary_scanner?: SearchBoundaryScanner - boundary_scanner_locale?: string - force_source?: boolean - fragmenter?: SearchHighlighterFragmenter - fragment_size?: integer - highlight_filter?: boolean - highlight_query?: QueryDslQueryContainer - max_fragment_length?: integer - max_analyzed_offset?: integer - no_match_size?: integer - number_of_fragments?: integer - options?: Record - order?: SearchHighlighterOrder - phrase_limit?: integer - post_tags?: string[] - pre_tags?: string[] - require_field_match?: boolean - tags_schema?: SearchHighlighterTagsSchema -} - -export interface SearchHighlightField extends SearchHighlightBase { - fragment_offset?: integer - matched_fields?: Fields -} - -export type SearchHighlighterEncoder = 'default' | 'html' - -export type SearchHighlighterFragmenter = 'simple' | 'span' - -export type SearchHighlighterOrder = 'score' - -export type SearchHighlighterTagsSchema = 'styled' - -export type SearchHighlighterType = 'plain' | 'fvh' | 'unified' | string - -export interface SearchHit { - _index: IndexName - _id?: Id - _score?: double | null - _explanation?: ExplainExplanation - fields?: Record - highlight?: Record - inner_hits?: Record - matched_queries?: string[] | Record - _nested?: SearchNestedIdentity - _ignored?: string[] - ignored_field_values?: Record - _shard?: string - _node?: string - _routing?: string - _source?: TDocument - _rank?: integer - _seq_no?: SequenceNumber - _primary_term?: long - _version?: VersionNumber - sort?: SortResults -} - -export interface SearchHitsMetadata { - total?: SearchTotalHits | long - hits: SearchHit[] - max_score?: double | null -} - -export interface SearchInnerHits { - name?: Name - size?: integer - from?: integer - collapse?: SearchFieldCollapse - docvalue_fields?: (QueryDslFieldAndFormat | Field)[] - explain?: boolean - highlight?: SearchHighlight - ignore_unmapped?: boolean - script_fields?: Record - seq_no_primary_term?: boolean - fields?: Fields - sort?: Sort - _source?: SearchSourceConfig - stored_fields?: Fields - track_scores?: boolean - version?: boolean -} - -export interface SearchInnerHitsResult { - hits: SearchHitsMetadata -} - -export interface SearchKnnCollectorResult { - name: string - reason: string - time?: Duration - time_in_nanos: DurationValue - children?: SearchKnnCollectorResult[] -} - -export interface SearchKnnQueryProfileBreakdown { - advance: long - advance_count: long - build_scorer: long - build_scorer_count: long - compute_max_score: long - compute_max_score_count: long - count_weight: long - count_weight_count: long - create_weight: long - create_weight_count: long - match: long - match_count: long - next_doc: long - next_doc_count: long - score: long - score_count: long - set_min_competitive_score: long - set_min_competitive_score_count: long - shallow_advance: long - shallow_advance_count: long -} - -export interface SearchKnnQueryProfileResult { - type: string - description: string - time?: Duration - time_in_nanos: DurationValue - breakdown: SearchKnnQueryProfileBreakdown - debug?: Record - children?: SearchKnnQueryProfileResult[] -} - -export interface SearchLaplaceSmoothingModel { - alpha: double -} - -export interface SearchLearningToRank { - model_id: string - params?: Record -} - -export interface SearchLinearInterpolationSmoothingModel { - bigram_lambda: double - trigram_lambda: double - unigram_lambda: double -} - -export interface SearchNestedIdentity { - field: Field - offset: integer - _nested?: SearchNestedIdentity -} - -export interface SearchPhraseSuggest extends SearchSuggestBase { - options: SearchPhraseSuggestOption | SearchPhraseSuggestOption[] -} - -export interface SearchPhraseSuggestCollate { - params?: Record - prune?: boolean - query: SearchPhraseSuggestCollateQuery -} - -export interface SearchPhraseSuggestCollateQuery { - id?: Id - source?: string -} - -export interface SearchPhraseSuggestHighlight { - post_tag: string - pre_tag: string -} - -export interface SearchPhraseSuggestOption { - text: string - score: double - highlighted?: string - collate_match?: boolean -} - -export interface SearchPhraseSuggester extends SearchSuggesterBase { - collate?: SearchPhraseSuggestCollate - confidence?: double - direct_generator?: SearchDirectGenerator[] - force_unigrams?: boolean - gram_size?: integer - highlight?: SearchPhraseSuggestHighlight - max_errors?: double - real_word_error_likelihood?: double - separator?: string - shard_size?: integer - smoothing?: SearchSmoothingModelContainer - text?: string - token_limit?: integer -} - -export interface SearchPointInTimeReference { - id: Id - keep_alive?: Duration -} - -export interface SearchProfile { - shards: SearchShardProfile[] -} - -export interface SearchQueryBreakdown { - advance: long - advance_count: long - build_scorer: long - build_scorer_count: long - create_weight: long - create_weight_count: long - match: long - match_count: long - shallow_advance: long - shallow_advance_count: long - next_doc: long - next_doc_count: long - score: long - score_count: long - compute_max_score: long - compute_max_score_count: long - count_weight: long - count_weight_count: long - set_min_competitive_score: long - set_min_competitive_score_count: long -} - -export interface SearchQueryProfile { - breakdown: SearchQueryBreakdown - description: string - time_in_nanos: DurationValue - type: string - children?: SearchQueryProfile[] -} - -export interface SearchRegexOptions { - flags?: integer | string - max_determinized_states?: integer -} - -export interface SearchRescore { - window_size?: integer - query?: SearchRescoreQuery - learning_to_rank?: SearchLearningToRank -} - -export interface SearchRescoreQuery { - rescore_query: QueryDslQueryContainer - query_weight?: double - rescore_query_weight?: double - score_mode?: SearchScoreMode -} - -export type SearchScoreMode = 'avg' | 'max' | 'min' | 'multiply' | 'total' - -export interface SearchSearchProfile { - collector: SearchCollector[] - query: SearchQueryProfile[] - rewrite_time: long -} - -export interface SearchShardProfile { - aggregations: SearchAggregationProfile[] - cluster: string - dfs?: SearchDfsProfile - fetch?: SearchFetchProfile - id: string - index: IndexName - node_id: NodeId - searches: SearchSearchProfile[] - shard_id: long -} - -export interface SearchSmoothingModelContainer { - laplace?: SearchLaplaceSmoothingModel - linear_interpolation?: SearchLinearInterpolationSmoothingModel - stupid_backoff?: SearchStupidBackoffSmoothingModel -} - -export type SearchSourceConfig = boolean | SearchSourceFilter | Fields - -export type SearchSourceConfigParam = boolean | Fields - -export interface SearchSourceFilter { - excludes?: Fields - exclude?: Fields - includes?: Fields - include?: Fields -} - -export type SearchStringDistance = 'internal' | 'damerau_levenshtein' | 'levenshtein' | 'jaro_winkler' | 'ngram' - -export interface SearchStupidBackoffSmoothingModel { - discount: double -} - -export type SearchSuggest = SearchCompletionSuggest | SearchPhraseSuggest | SearchTermSuggest - -export interface SearchSuggestBase { - length: integer - offset: integer - text: string -} - -export interface SearchSuggestFuzziness { - fuzziness?: Fuzziness - min_length?: integer - prefix_length?: integer - transpositions?: boolean - unicode_aware?: boolean -} - -export type SearchSuggestSort = 'score' | 'frequency' - -export interface SearchSuggesterKeys { - text?: string -} -export type SearchSuggester = SearchSuggesterKeys -& { [property: string]: SearchFieldSuggester | string } - -export interface SearchSuggesterBase { - field: Field - analyzer?: string - size?: integer -} - -export interface SearchTermSuggest extends SearchSuggestBase { - options: SearchTermSuggestOption | SearchTermSuggestOption[] -} - -export interface SearchTermSuggestOption { - text: string - score: double - freq: long - highlighted?: string - collate_match?: boolean -} - -export interface SearchTermSuggester extends SearchSuggesterBase { - lowercase_terms?: boolean - max_edits?: integer - max_inspections?: integer - max_term_freq?: float - min_doc_freq?: float - min_word_length?: integer - prefix_length?: integer - shard_size?: integer - sort?: SearchSuggestSort - string_distance?: SearchStringDistance - suggest_mode?: SuggestMode - text?: string -} - -export interface SearchTotalHits { - relation: SearchTotalHitsRelation - value: long -} - -export type SearchTotalHitsRelation = 'eq' | 'gte' - -export type SearchTrackHits = boolean | integer - -export interface SearchMvtRequest extends RequestBase { - index: Indices - field: Field - zoom: SearchMvtZoomLevel - x: SearchMvtCoordinate - y: SearchMvtCoordinate - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - aggs?: Record - buffer?: integer - exact_bounds?: boolean - extent?: integer - fields?: Fields - grid_agg?: SearchMvtGridAggregationType - grid_precision?: integer - grid_type?: SearchMvtGridType - query?: QueryDslQueryContainer - runtime_mappings?: MappingRuntimeFields - size?: integer - sort?: Sort - track_total_hits?: SearchTrackHits - with_labels?: boolean - } -} - -export type SearchMvtResponse = MapboxVectorTiles - -export type SearchMvtCoordinate = integer - -export type SearchMvtGridAggregationType = 'geotile' | 'geohex' - -export type SearchMvtGridType = 'grid' | 'point' | 'centroid' - -export type SearchMvtZoomLevel = integer - -export interface SearchShardsRequest extends RequestBase { - index?: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - local?: boolean - preference?: string - routing?: Routing -} - -export interface SearchShardsResponse { - nodes: Record - shards: NodeShard[][] - indices: Record -} - -export interface SearchShardsSearchShardsNodeAttributes { - name: NodeName - ephemeral_id: Id - transport_address: TransportAddress - external_id: string - attributes: Record - roles: NodeRoles - version: VersionString - min_index_version: integer - max_index_version: integer -} - -export interface SearchShardsShardStoreIndex { - aliases?: Name[] - filter?: QueryDslQueryContainer -} - -export interface SearchTemplateRequest extends RequestBase { - index?: Indices - allow_no_indices?: boolean - ccs_minimize_roundtrips?: boolean - expand_wildcards?: ExpandWildcards - ignore_throttled?: boolean - ignore_unavailable?: boolean - preference?: string - routing?: Routing - scroll?: Duration - search_type?: SearchType - rest_total_hits_as_int?: boolean - typed_keys?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - explain?: boolean - id?: Id - params?: Record - profile?: boolean - source?: string - } -} - -export interface SearchTemplateResponse { - took: long - timed_out: boolean - _shards: ShardStatistics - hits: SearchHitsMetadata - aggregations?: Record - _clusters?: ClusterStatistics - fields?: Record - max_score?: double - num_reduce_phases?: long - profile?: SearchProfile - pit_id?: Id - _scroll_id?: ScrollId - suggest?: Record[]> - terminated_early?: boolean -} - -export interface TermsEnumRequest extends RequestBase { - index: IndexName - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - field: Field - size?: integer - timeout?: Duration - case_insensitive?: boolean - index_filter?: QueryDslQueryContainer - string?: string - search_after?: string - } -} - -export interface TermsEnumResponse { - _shards: ShardStatistics - terms: string[] - complete: boolean -} - -export interface TermvectorsFieldStatistics { - doc_count: integer - sum_doc_freq: long - sum_ttf: long -} - -export interface TermvectorsFilter { - max_doc_freq?: integer - max_num_terms?: integer - max_term_freq?: integer - max_word_length?: integer - min_doc_freq?: integer - min_term_freq?: integer - min_word_length?: integer -} - -export interface TermvectorsRequest extends RequestBase { - index: IndexName - id?: Id - fields?: Fields - field_statistics?: boolean - offsets?: boolean - payloads?: boolean - positions?: boolean - preference?: string - realtime?: boolean - routing?: Routing - term_statistics?: boolean - version?: VersionNumber - version_type?: VersionType - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - doc?: TDocument - filter?: TermvectorsFilter - per_field_analyzer?: Record - } -} - -export interface TermvectorsResponse { - found: boolean - _id?: Id - _index: IndexName - term_vectors?: Record - took: long - _version: VersionNumber -} - -export interface TermvectorsTerm { - doc_freq?: integer - score?: double - term_freq: integer - tokens?: TermvectorsToken[] - ttf?: integer -} - -export interface TermvectorsTermVector { - field_statistics?: TermvectorsFieldStatistics - terms: Record -} - -export interface TermvectorsToken { - end_offset?: integer - payload?: string - position: integer - start_offset?: integer -} - -export interface UpdateRequest extends RequestBase { - id: Id - index: IndexName - if_primary_term?: long - if_seq_no?: SequenceNumber - lang?: string - refresh?: Refresh - require_alias?: boolean - retry_on_conflict?: integer - routing?: Routing - timeout?: Duration - wait_for_active_shards?: WaitForActiveShards - _source_excludes?: Fields - _source_includes?: Fields - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - detect_noop?: boolean - doc?: TPartialDocument - doc_as_upsert?: boolean - script?: Script | string - scripted_upsert?: boolean - _source?: SearchSourceConfig - upsert?: TDocument - } -} - -export type UpdateResponse = UpdateUpdateWriteResponseBase - -export interface UpdateUpdateWriteResponseBase extends WriteResponseBase { - get?: InlineGet -} - -export interface UpdateByQueryRequest extends RequestBase { - index: Indices - allow_no_indices?: boolean - analyzer?: string - analyze_wildcard?: boolean - default_operator?: QueryDslOperator - df?: string - expand_wildcards?: ExpandWildcards - from?: long - ignore_unavailable?: boolean - lenient?: boolean - pipeline?: string - preference?: string - q?: string - refresh?: boolean - request_cache?: boolean - requests_per_second?: float - routing?: Routing - scroll?: Duration - scroll_size?: long - search_timeout?: Duration - search_type?: SearchType - slices?: Slices - sort?: string[] - stats?: string[] - terminate_after?: long - timeout?: Duration - version?: boolean - version_type?: boolean - wait_for_active_shards?: WaitForActiveShards - wait_for_completion?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - max_docs?: long - query?: QueryDslQueryContainer - script?: Script | string - slice?: SlicedScroll - conflicts?: Conflicts - } -} - -export interface UpdateByQueryResponse { - batches?: long - failures?: BulkIndexByScrollFailure[] - noops?: long - deleted?: long - requests_per_second?: float - retries?: Retries - task?: TaskId - timed_out?: boolean - took?: DurationValue - total?: long - updated?: long - version_conflicts?: long - throttled?: Duration - throttled_millis?: DurationValue - throttled_until?: Duration - throttled_until_millis?: DurationValue -} - -export interface UpdateByQueryRethrottleRequest extends RequestBase { - task_id: Id - requests_per_second?: float -} - -export interface UpdateByQueryRethrottleResponse { - nodes: Record -} - -export interface UpdateByQueryRethrottleUpdateByQueryRethrottleNode extends SpecUtilsBaseNode { - tasks: Record -} - -export interface SpecUtilsBaseNode { - attributes: Record - host: Host - ip: Ip - name: Name - roles?: NodeRoles - transport_address: TransportAddress -} - -export type SpecUtilsNullValue = null - -export type SpecUtilsPipeSeparatedFlags = T | string - -export type SpecUtilsStringified = T | string - -export type SpecUtilsWithNullValue = T | SpecUtilsNullValue - -export interface AcknowledgedResponseBase { - acknowledged: boolean -} - -export type AggregateName = string - -export interface BulkIndexByScrollFailure { - cause: ErrorCause - id: Id - index: IndexName - status: integer - type: string -} - -export interface BulkStats { - total_operations: long - total_time?: Duration - total_time_in_millis: DurationValue - total_size?: ByteSize - total_size_in_bytes: long - avg_time?: Duration - avg_time_in_millis: DurationValue - avg_size?: ByteSize - avg_size_in_bytes: long -} - -export type ByteSize = long | string - -export type Bytes = 'b' | 'kb' | 'mb' | 'gb' | 'tb' | 'pb' - -export type CategoryId = string - -export type ClusterAlias = string - -export interface ClusterDetails { - status: ClusterSearchStatus - indices: string - took?: DurationValue - timed_out: boolean - _shards?: ShardStatistics - failures?: ShardFailure[] -} - -export type ClusterInfoTarget = '_all' | 'http' | 'ingest' | 'thread_pool' | 'script' - -export type ClusterInfoTargets = ClusterInfoTarget | ClusterInfoTarget[] - -export type ClusterSearchStatus = 'running' | 'successful' | 'partial' | 'skipped' | 'failed' - -export interface ClusterStatistics { - skipped: integer - successful: integer - total: integer - running: integer - partial: integer - failed: integer - details?: Record -} - -export interface CompletionStats { - size_in_bytes: long - size?: ByteSize - fields?: Record -} - -export type Conflicts = 'abort' | 'proceed' - -export interface CoordsGeoBounds { - top: double - bottom: double - left: double - right: double -} - -export type DFIIndependenceMeasure = 'standardized' | 'saturated' | 'chisquared' - -export type DFRAfterEffect = 'no' | 'b' | 'l' - -export type DFRBasicModel = 'be' | 'd' | 'g' | 'if' | 'in' | 'ine' | 'p' - -export type DataStreamName = string - -export type DataStreamNames = DataStreamName | DataStreamName[] - -export type DateFormat = string - -export type DateMath = string | Date - -export type DateTime = string | EpochTime | Date - -export type Distance = string - -export type DistanceUnit = 'in' | 'ft' | 'yd' | 'mi' | 'nmi' | 'km' | 'm' | 'cm' | 'mm' - -export interface DocStats { - count: long - deleted?: long -} - -export type Duration = string | -1 | 0 - -export type DurationLarge = string - -export type DurationValue = Unit - -export interface ElasticsearchVersionInfo { - build_date: DateTime - build_flavor: string - build_hash: string - build_snapshot: boolean - build_type: string - lucene_version: VersionString - minimum_index_compatibility_version: VersionString - minimum_wire_compatibility_version: VersionString - number: string -} - -export interface ElasticsearchVersionMinInfo { - build_flavor: string - minimum_index_compatibility_version: VersionString - minimum_wire_compatibility_version: VersionString - number: string -} - -export interface EmptyObject { -} - -export type EpochTime = Unit - -export interface ErrorCauseKeys { - type: string - reason?: string - stack_trace?: string - caused_by?: ErrorCause - root_cause?: ErrorCause[] - suppressed?: ErrorCause[] -} -export type ErrorCause = ErrorCauseKeys -& { [property: string]: any } - -export interface ErrorResponseBase { - error: ErrorCause - status: integer -} - -export type EsqlColumns = ArrayBuffer - -export type ExpandWildcard = 'all' | 'open' | 'closed' | 'hidden' | 'none' - -export type ExpandWildcards = ExpandWildcard | ExpandWildcard[] - -export type Field = string - -export interface FieldMemoryUsage { - memory_size?: ByteSize - memory_size_in_bytes: long -} - -export interface FieldSizeUsage { - size?: ByteSize - size_in_bytes: long -} - -export interface FieldSort { - missing?: AggregationsMissing - mode?: SortMode - nested?: NestedSortValue - order?: SortOrder - unmapped_type?: MappingFieldType - numeric_type?: FieldSortNumericType - format?: string -} - -export type FieldSortNumericType = 'long' | 'double' | 'date' | 'date_nanos' - -export type FieldValue = long | double | string | boolean | null | any - -export interface FielddataStats { - evictions?: long - memory_size?: ByteSize - memory_size_in_bytes: long - fields?: Record -} - -export type Fields = Field | Field[] - -export interface FlushStats { - periodic: long - total: long - total_time?: Duration - total_time_in_millis: DurationValue -} - -export type Fuzziness = string | integer - -export type GeoBounds = CoordsGeoBounds | TopLeftBottomRightGeoBounds | TopRightBottomLeftGeoBounds | WktGeoBounds - -export interface GeoDistanceSortKeys { - mode?: SortMode - distance_type?: GeoDistanceType - ignore_unmapped?: boolean - order?: SortOrder - unit?: DistanceUnit - nested?: NestedSortValue -} -export type GeoDistanceSort = GeoDistanceSortKeys -& { [property: string]: GeoLocation | GeoLocation[] | SortMode | GeoDistanceType | boolean | SortOrder | DistanceUnit | NestedSortValue } - -export type GeoDistanceType = 'arc' | 'plane' - -export type GeoHash = string - -export interface GeoHashLocation { - geohash: GeoHash -} - -export type GeoHashPrecision = number | string - -export type GeoHexCell = string - -export interface GeoLine { - type: string - coordinates: double[][] -} - -export type GeoLocation = LatLonGeoLocation | GeoHashLocation | double[] | string - -export type GeoShape = any - -export type GeoShapeRelation = 'intersects' | 'disjoint' | 'within' | 'contains' - -export type GeoTile = string - -export type GeoTilePrecision = number - -export interface GetStats { - current: long - exists_time?: Duration - exists_time_in_millis: DurationValue - exists_total: long - missing_time?: Duration - missing_time_in_millis: DurationValue - missing_total: long - time?: Duration - time_in_millis: DurationValue - total: long -} - -export type GrokPattern = string - -export type HealthStatus = 'green' | 'GREEN' | 'yellow' | 'YELLOW' | 'red' | 'RED' - -export type Host = string - -export type HttpHeaders = Record - -export type IBDistribution = 'll' | 'spl' - -export type IBLambda = 'df' | 'ttf' - -export type Id = string - -export type Ids = Id | Id[] - -export type IndexAlias = string - -export type IndexName = string - -export type IndexPattern = string - -export type IndexPatterns = IndexPattern[] - -export interface IndexingStats { - index_current: long - delete_current: long - delete_time?: Duration - delete_time_in_millis: DurationValue - delete_total: long - is_throttled: boolean - noop_update_total: long - throttle_time?: Duration - throttle_time_in_millis: DurationValue - index_time?: Duration - index_time_in_millis: DurationValue - index_total: long - index_failed: long - types?: Record - write_load?: double -} - -export type Indices = IndexName | IndexName[] - -export interface IndicesOptions { - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - ignore_throttled?: boolean -} - -export interface IndicesResponseBase extends AcknowledgedResponseBase { - _shards?: ShardStatistics -} - -export interface InlineGetKeys { - fields?: Record - found: boolean - _seq_no?: SequenceNumber - _primary_term?: long - _routing?: Routing - _source?: TDocument -} -export type InlineGet = InlineGetKeys -& { [property: string]: any } - -export type Ip = string - -export interface KnnQuery extends QueryDslQueryBase { - field: Field - query_vector?: QueryVector - query_vector_builder?: QueryVectorBuilder - num_candidates?: integer - k?: integer - filter?: QueryDslQueryContainer | QueryDslQueryContainer[] - similarity?: float -} - -export interface KnnRetriever extends RetrieverBase { - field: string - query_vector?: QueryVector - query_vector_builder?: QueryVectorBuilder - k: integer - num_candidates: integer - similarity?: float -} - -export interface KnnSearch { - field: Field - query_vector?: QueryVector - query_vector_builder?: QueryVectorBuilder - k?: integer - num_candidates?: integer - boost?: float - filter?: QueryDslQueryContainer | QueryDslQueryContainer[] - similarity?: float - inner_hits?: SearchInnerHits -} - -export interface LatLonGeoLocation { - lat: double - lon: double -} - -export type Level = 'cluster' | 'indices' | 'shards' - -export type LifecycleOperationMode = 'RUNNING' | 'STOPPING' | 'STOPPED' - -export type MapboxVectorTiles = ArrayBuffer - -export interface MergesStats { - current: long - current_docs: long - current_size?: string - current_size_in_bytes: long - total: long - total_auto_throttle?: string - total_auto_throttle_in_bytes: long - total_docs: long - total_size?: string - total_size_in_bytes: long - total_stopped_time?: Duration - total_stopped_time_in_millis: DurationValue - total_throttled_time?: Duration - total_throttled_time_in_millis: DurationValue - total_time?: Duration - total_time_in_millis: DurationValue -} - -export type Metadata = Record - -export type Metrics = string | string[] - -export type MinimumShouldMatch = integer | string - -export type MultiTermQueryRewrite = string - -export type Name = string - -export type Names = Name | Name[] - -export type Namespace = string - -export interface NestedSortValue { - filter?: QueryDslQueryContainer - max_children?: integer - nested?: NestedSortValue - path: Field -} - -export interface NodeAttributes { - attributes: Record - ephemeral_id: Id - id?: NodeId - name: NodeName - transport_address: TransportAddress -} - -export type NodeId = string - -export type NodeIds = NodeId | NodeId[] - -export type NodeName = string - -export type NodeRole = 'master' | 'data' | 'data_cold' | 'data_content' | 'data_frozen' | 'data_hot' | 'data_warm' | 'client' | 'ingest' | 'ml' | 'voting_only' | 'transform' | 'remote_cluster_client' | 'coordinating_only' - -export type NodeRoles = NodeRole[] - -export interface NodeShard { - state: IndicesStatsShardRoutingState - primary: boolean - node?: NodeName - shard: integer - index: IndexName - allocation_id?: Record - recovery_source?: Record - unassigned_info?: ClusterAllocationExplainUnassignedInformation - relocating_node?: NodeId | null - relocation_failure_info?: RelocationFailureInfo -} - -export interface NodeStatistics { - failures?: ErrorCause[] - total: integer - successful: integer - failed: integer -} - -export type Normalization = 'no' | 'h1' | 'h2' | 'h3' | 'z' - -export type OpType = 'index' | 'create' - -export type Password = string - -export type Percentage = string | float - -export type PipelineName = string - -export interface PluginStats { - classname: string - description: string - elasticsearch_version: VersionString - extended_plugins: string[] - has_native_controller: boolean - java_version: VersionString - name: Name - version: VersionString - licensed: boolean -} - -export type PropertyName = string - -export interface QueryCacheStats { - cache_count: long - cache_size: long - evictions: long - hit_count: long - memory_size?: ByteSize - memory_size_in_bytes: long - miss_count: long - total_count: long -} - -export type QueryVector = float[] - -export interface QueryVectorBuilder { - text_embedding?: TextEmbedding -} - -export interface RRFRetriever extends RetrieverBase { - retrievers: RetrieverContainer[] - rank_constant?: integer - rank_window_size?: integer -} - -export interface RankBase { -} - -export interface RankContainer { - rrf?: RrfRank -} - -export interface RecoveryStats { - current_as_source: long - current_as_target: long - throttle_time?: Duration - throttle_time_in_millis: DurationValue -} - -export type Refresh = boolean | 'true' | 'false' | 'wait_for' - -export interface RefreshStats { - external_total: long - external_total_time_in_millis: DurationValue - listeners: long - total: long - total_time?: Duration - total_time_in_millis: DurationValue -} - -export type RelationName = string - -export interface RelocationFailureInfo { - failed_attempts: integer -} - -export interface RequestBase extends SpecUtilsCommonQueryParameters { -} - -export interface RequestCacheStats { - evictions: long - hit_count: long - memory_size?: string - memory_size_in_bytes: long - miss_count: long -} - -export type Result = 'created' | 'updated' | 'deleted' | 'not_found' | 'noop' - -export interface Retries { - bulk: long - search: long -} - -export interface RetrieverBase { - filter?: QueryDslQueryContainer | QueryDslQueryContainer[] - min_score?: float -} - -export interface RetrieverContainer { - standard?: StandardRetriever - knn?: KnnRetriever - rrf?: RRFRetriever - text_similarity_reranker?: TextSimilarityReranker - rule?: RuleRetriever -} - -export type Routing = string - -export interface RrfRank { - rank_constant?: long - rank_window_size?: long -} - -export interface RuleRetriever extends RetrieverBase { - ruleset_ids: Id[] - match_criteria: any - retriever: RetrieverContainer - rank_window_size?: integer -} - -export type ScalarValue = long | double | string | boolean | null - -export interface ScoreSort { - order?: SortOrder -} - -export interface Script { - source?: string - id?: Id - params?: Record - lang?: ScriptLanguage - options?: Record -} - -export interface ScriptField { - script: Script | string - ignore_failure?: boolean -} - -export type ScriptLanguage = 'painless' | 'expression' | 'mustache' | 'java' | string - -export interface ScriptSort { - order?: SortOrder - script: Script | string - type?: ScriptSortType - mode?: SortMode - nested?: NestedSortValue -} - -export type ScriptSortType = 'string' | 'number' | 'version' - -export interface ScriptTransform { - lang?: string - params?: Record - source?: string - id?: string -} - -export type ScrollId = string - -export type ScrollIds = ScrollId | ScrollId[] - -export interface SearchStats { - fetch_current: long - fetch_time?: Duration - fetch_time_in_millis: DurationValue - fetch_total: long - open_contexts?: long - query_current: long - query_time?: Duration - query_time_in_millis: DurationValue - query_total: long - scroll_current: long - scroll_time?: Duration - scroll_time_in_millis: DurationValue - scroll_total: long - suggest_current: long - suggest_time?: Duration - suggest_time_in_millis: DurationValue - suggest_total: long - groups?: Record -} - -export interface SearchTransform { - request: WatcherSearchInputRequestDefinition - timeout: Duration -} - -export type SearchType = 'query_then_fetch' | 'dfs_query_then_fetch' - -export interface SegmentsStats { - count: integer - doc_values_memory?: ByteSize - doc_values_memory_in_bytes: long - file_sizes: Record - fixed_bit_set?: ByteSize - fixed_bit_set_memory_in_bytes: long - index_writer_memory?: ByteSize - index_writer_max_memory_in_bytes?: long - index_writer_memory_in_bytes: long - max_unsafe_auto_id_timestamp: long - memory?: ByteSize - memory_in_bytes: long - norms_memory?: ByteSize - norms_memory_in_bytes: long - points_memory?: ByteSize - points_memory_in_bytes: long - stored_memory?: ByteSize - stored_fields_memory_in_bytes: long - terms_memory_in_bytes: long - terms_memory?: ByteSize - term_vectory_memory?: ByteSize - term_vectors_memory_in_bytes: long - version_map_memory?: ByteSize - version_map_memory_in_bytes: long -} - -export type SequenceNumber = long - -export type Service = string - -export interface ShardFailure { - index?: IndexName - node?: string - reason: ErrorCause - shard: integer - status?: string -} - -export interface ShardStatistics { - failed: uint - successful: uint - total: uint - failures?: ShardFailure[] - skipped?: uint -} - -export interface ShardsOperationResponseBase { - _shards?: ShardStatistics -} - -export interface SlicedScroll { - field?: Field - id: Id - max: integer -} - -export type Slices = integer | SlicesCalculation - -export type SlicesCalculation = 'auto' - -export type Sort = SortCombinations | SortCombinations[] - -export type SortCombinations = Field | SortOptions - -export type SortMode = 'min' | 'max' | 'sum' | 'avg' | 'median' - -export interface SortOptionsKeys { - _score?: ScoreSort - _doc?: ScoreSort - _geo_distance?: GeoDistanceSort - _script?: ScriptSort -} -export type SortOptions = SortOptionsKeys -& { [property: string]: FieldSort | SortOrder | ScoreSort | GeoDistanceSort | ScriptSort } - -export type SortOrder = 'asc' | 'desc' - -export type SortResults = FieldValue[] - -export interface StandardRetriever extends RetrieverBase { - query?: QueryDslQueryContainer - search_after?: SortResults - terminate_after?: integer - sort?: Sort - collapse?: SearchFieldCollapse -} - -export interface StoreStats { - size?: ByteSize - size_in_bytes: long - reserved?: ByteSize - reserved_in_bytes: long - total_data_set_size?: ByteSize - total_data_set_size_in_bytes?: long -} - -export interface StoredScript { - lang: ScriptLanguage - options?: Record - source: string -} - -export type SuggestMode = 'missing' | 'popular' | 'always' - -export type SuggestionName = string - -export interface TaskFailure { - task_id: long - node_id: NodeId - status: string - reason: ErrorCause -} - -export type TaskId = string | integer - -export interface TextEmbedding { - model_id: string - model_text: string -} - -export interface TextSimilarityReranker extends RetrieverBase { - retriever: RetrieverContainer - rank_window_size?: integer - inference_id?: string - inference_text?: string - field?: string -} - -export type ThreadType = 'cpu' | 'wait' | 'block' | 'gpu' | 'mem' - -export type TimeOfDay = string - -export type TimeUnit = 'nanos' | 'micros' | 'ms' | 's' | 'm' | 'h' | 'd' - -export type TimeZone = string - -export interface TopLeftBottomRightGeoBounds { - top_left: GeoLocation - bottom_right: GeoLocation -} - -export interface TopRightBottomLeftGeoBounds { - top_right: GeoLocation - bottom_left: GeoLocation -} - -export interface TransformContainer { - chain?: TransformContainer[] - script?: ScriptTransform - search?: SearchTransform -} - -export interface TranslogStats { - earliest_last_modified_age: long - operations: long - size?: string - size_in_bytes: long - uncommitted_operations: integer - uncommitted_size?: string - uncommitted_size_in_bytes: long -} - -export type TransportAddress = string - -export type UnitFloatMillis = double - -export type UnitMillis = long - -export type UnitNanos = long - -export type UnitSeconds = long - -export type Username = string - -export type Uuid = string - -export type VersionNumber = long - -export type VersionString = string - -export type VersionType = 'internal' | 'external' | 'external_gte' | 'force' - -export type WaitForActiveShardOptions = 'all' | 'index-setting' - -export type WaitForActiveShards = integer | WaitForActiveShardOptions - -export type WaitForEvents = 'immediate' | 'urgent' | 'high' | 'normal' | 'low' | 'languid' - -export interface WarmerStats { - current: long - total: long - total_time?: Duration - total_time_in_millis: DurationValue -} - -export interface WktGeoBounds { - wkt: string -} - -export interface WriteResponseBase { - _id: Id - _index: IndexName - _primary_term?: long - result: Result - _seq_no?: SequenceNumber - _shards: ShardStatistics - _version: VersionNumber - forced_refresh?: boolean -} - -export type byte = number - -export type double = number - -export type float = number - -export type integer = number - -export type long = number - -export type short = number - -export type uint = number - -export type ulong = number - -export interface AggregationsAdjacencyMatrixAggregate extends AggregationsMultiBucketAggregateBase { -} - -export interface AggregationsAdjacencyMatrixAggregation extends AggregationsBucketAggregationBase { - filters?: Record - separator?: string -} - -export interface AggregationsAdjacencyMatrixBucketKeys extends AggregationsMultiBucketBase { - key: string -} -export type AggregationsAdjacencyMatrixBucket = AggregationsAdjacencyMatrixBucketKeys -& { [property: string]: AggregationsAggregate | string | long } - -export type AggregationsAggregate = AggregationsCardinalityAggregate | AggregationsHdrPercentilesAggregate | AggregationsHdrPercentileRanksAggregate | AggregationsTDigestPercentilesAggregate | AggregationsTDigestPercentileRanksAggregate | AggregationsPercentilesBucketAggregate | AggregationsMedianAbsoluteDeviationAggregate | AggregationsMinAggregate | AggregationsMaxAggregate | AggregationsSumAggregate | AggregationsAvgAggregate | AggregationsWeightedAvgAggregate | AggregationsValueCountAggregate | AggregationsSimpleValueAggregate | AggregationsDerivativeAggregate | AggregationsBucketMetricValueAggregate | AggregationsStatsAggregate | AggregationsStatsBucketAggregate | AggregationsExtendedStatsAggregate | AggregationsExtendedStatsBucketAggregate | AggregationsGeoBoundsAggregate | AggregationsGeoCentroidAggregate | AggregationsHistogramAggregate | AggregationsDateHistogramAggregate | AggregationsAutoDateHistogramAggregate | AggregationsVariableWidthHistogramAggregate | AggregationsStringTermsAggregate | AggregationsLongTermsAggregate | AggregationsDoubleTermsAggregate | AggregationsUnmappedTermsAggregate | AggregationsLongRareTermsAggregate | AggregationsStringRareTermsAggregate | AggregationsUnmappedRareTermsAggregate | AggregationsMultiTermsAggregate | AggregationsMissingAggregate | AggregationsNestedAggregate | AggregationsReverseNestedAggregate | AggregationsGlobalAggregate | AggregationsFilterAggregate | AggregationsChildrenAggregate | AggregationsParentAggregate | AggregationsSamplerAggregate | AggregationsUnmappedSamplerAggregate | AggregationsGeoHashGridAggregate | AggregationsGeoTileGridAggregate | AggregationsGeoHexGridAggregate | AggregationsRangeAggregate | AggregationsDateRangeAggregate | AggregationsGeoDistanceAggregate | AggregationsIpRangeAggregate | AggregationsIpPrefixAggregate | AggregationsFiltersAggregate | AggregationsAdjacencyMatrixAggregate | AggregationsSignificantLongTermsAggregate | AggregationsSignificantStringTermsAggregate | AggregationsUnmappedSignificantTermsAggregate | AggregationsCompositeAggregate | AggregationsFrequentItemSetsAggregate | AggregationsTimeSeriesAggregate | AggregationsScriptedMetricAggregate | AggregationsTopHitsAggregate | AggregationsInferenceAggregate | AggregationsStringStatsAggregate | AggregationsBoxPlotAggregate | AggregationsTopMetricsAggregate | AggregationsTTestAggregate | AggregationsRateAggregate | AggregationsCumulativeCardinalityAggregate | AggregationsMatrixStatsAggregate | AggregationsGeoLineAggregate - -export interface AggregationsAggregateBase { - meta?: Metadata -} - -export type AggregationsAggregateOrder = Partial> | Partial>[] - -export interface AggregationsAggregation { -} - -export interface AggregationsAggregationContainer { - aggregations?: Record - aggs?: Record - meta?: Metadata - adjacency_matrix?: AggregationsAdjacencyMatrixAggregation - auto_date_histogram?: AggregationsAutoDateHistogramAggregation - avg?: AggregationsAverageAggregation - avg_bucket?: AggregationsAverageBucketAggregation - boxplot?: AggregationsBoxplotAggregation - bucket_script?: AggregationsBucketScriptAggregation - bucket_selector?: AggregationsBucketSelectorAggregation - bucket_sort?: AggregationsBucketSortAggregation - bucket_count_ks_test?: AggregationsBucketKsAggregation - bucket_correlation?: AggregationsBucketCorrelationAggregation - cardinality?: AggregationsCardinalityAggregation - categorize_text?: AggregationsCategorizeTextAggregation - children?: AggregationsChildrenAggregation - composite?: AggregationsCompositeAggregation - cumulative_cardinality?: AggregationsCumulativeCardinalityAggregation - cumulative_sum?: AggregationsCumulativeSumAggregation - date_histogram?: AggregationsDateHistogramAggregation - date_range?: AggregationsDateRangeAggregation - derivative?: AggregationsDerivativeAggregation - diversified_sampler?: AggregationsDiversifiedSamplerAggregation - extended_stats?: AggregationsExtendedStatsAggregation - extended_stats_bucket?: AggregationsExtendedStatsBucketAggregation - frequent_item_sets?: AggregationsFrequentItemSetsAggregation - filter?: QueryDslQueryContainer - filters?: AggregationsFiltersAggregation - geo_bounds?: AggregationsGeoBoundsAggregation - geo_centroid?: AggregationsGeoCentroidAggregation - geo_distance?: AggregationsGeoDistanceAggregation - geohash_grid?: AggregationsGeoHashGridAggregation - geo_line?: AggregationsGeoLineAggregation - geotile_grid?: AggregationsGeoTileGridAggregation - geohex_grid?: AggregationsGeohexGridAggregation - global?: AggregationsGlobalAggregation - histogram?: AggregationsHistogramAggregation - ip_range?: AggregationsIpRangeAggregation - ip_prefix?: AggregationsIpPrefixAggregation - inference?: AggregationsInferenceAggregation - line?: AggregationsGeoLineAggregation - matrix_stats?: AggregationsMatrixStatsAggregation - max?: AggregationsMaxAggregation - max_bucket?: AggregationsMaxBucketAggregation - median_absolute_deviation?: AggregationsMedianAbsoluteDeviationAggregation - min?: AggregationsMinAggregation - min_bucket?: AggregationsMinBucketAggregation - missing?: AggregationsMissingAggregation - moving_avg?: AggregationsMovingAverageAggregation - moving_percentiles?: AggregationsMovingPercentilesAggregation - moving_fn?: AggregationsMovingFunctionAggregation - multi_terms?: AggregationsMultiTermsAggregation - nested?: AggregationsNestedAggregation - normalize?: AggregationsNormalizeAggregation - parent?: AggregationsParentAggregation - percentile_ranks?: AggregationsPercentileRanksAggregation - percentiles?: AggregationsPercentilesAggregation - percentiles_bucket?: AggregationsPercentilesBucketAggregation - range?: AggregationsRangeAggregation - rare_terms?: AggregationsRareTermsAggregation - rate?: AggregationsRateAggregation - reverse_nested?: AggregationsReverseNestedAggregation - random_sampler?: AggregationsRandomSamplerAggregation - sampler?: AggregationsSamplerAggregation - scripted_metric?: AggregationsScriptedMetricAggregation - serial_diff?: AggregationsSerialDifferencingAggregation - significant_terms?: AggregationsSignificantTermsAggregation - significant_text?: AggregationsSignificantTextAggregation - stats?: AggregationsStatsAggregation - stats_bucket?: AggregationsStatsBucketAggregation - string_stats?: AggregationsStringStatsAggregation - sum?: AggregationsSumAggregation - sum_bucket?: AggregationsSumBucketAggregation - terms?: AggregationsTermsAggregation - time_series?: AggregationsTimeSeriesAggregation - top_hits?: AggregationsTopHitsAggregation - t_test?: AggregationsTTestAggregation - top_metrics?: AggregationsTopMetricsAggregation - value_count?: AggregationsValueCountAggregation - weighted_avg?: AggregationsWeightedAverageAggregation - variable_width_histogram?: AggregationsVariableWidthHistogramAggregation -} - -export interface AggregationsAggregationRange { - from?: double | null - key?: string - to?: double | null -} - -export interface AggregationsArrayPercentilesItem { - key: string - value: double | null - value_as_string?: string -} - -export interface AggregationsAutoDateHistogramAggregate extends AggregationsMultiBucketAggregateBase { - interval: DurationLarge -} - -export interface AggregationsAutoDateHistogramAggregation extends AggregationsBucketAggregationBase { - buckets?: integer - field?: Field - format?: string - minimum_interval?: AggregationsMinimumInterval - missing?: DateTime - offset?: string - params?: Record - script?: Script | string - time_zone?: TimeZone -} - -export interface AggregationsAverageAggregation extends AggregationsFormatMetricAggregationBase { -} - -export interface AggregationsAverageBucketAggregation extends AggregationsPipelineAggregationBase { -} - -export interface AggregationsAvgAggregate extends AggregationsSingleMetricAggregateBase { -} - -export interface AggregationsBoxPlotAggregate extends AggregationsAggregateBase { - min: double - max: double - q1: double - q2: double - q3: double - lower: double - upper: double - min_as_string?: string - max_as_string?: string - q1_as_string?: string - q2_as_string?: string - q3_as_string?: string - lower_as_string?: string - upper_as_string?: string -} - -export interface AggregationsBoxplotAggregation extends AggregationsMetricAggregationBase { - compression?: double -} - -export interface AggregationsBucketAggregationBase { -} - -export interface AggregationsBucketCorrelationAggregation extends AggregationsBucketPathAggregation { - function: AggregationsBucketCorrelationFunction -} - -export interface AggregationsBucketCorrelationFunction { - count_correlation: AggregationsBucketCorrelationFunctionCountCorrelation -} - -export interface AggregationsBucketCorrelationFunctionCountCorrelation { - indicator: AggregationsBucketCorrelationFunctionCountCorrelationIndicator -} - -export interface AggregationsBucketCorrelationFunctionCountCorrelationIndicator { - doc_count: integer - expectations: double[] - fractions?: double[] -} - -export interface AggregationsBucketKsAggregation extends AggregationsBucketPathAggregation { - alternative?: string[] - fractions?: double[] - sampling_method?: string -} - -export interface AggregationsBucketMetricValueAggregate extends AggregationsSingleMetricAggregateBase { - keys: string[] -} - -export interface AggregationsBucketPathAggregation { - buckets_path?: AggregationsBucketsPath -} - -export interface AggregationsBucketScriptAggregation extends AggregationsPipelineAggregationBase { - script?: Script | string -} - -export interface AggregationsBucketSelectorAggregation extends AggregationsPipelineAggregationBase { - script?: Script | string -} - -export interface AggregationsBucketSortAggregation { - from?: integer - gap_policy?: AggregationsGapPolicy - size?: integer - sort?: Sort -} - -export type AggregationsBuckets = Record | TBucket[] - -export type AggregationsBucketsPath = string | string[] | Record - -export type AggregationsCalendarInterval = 'second' | '1s' | 'minute' | '1m' | 'hour' | '1h' | 'day' | '1d' | 'week' | '1w' | 'month' | '1M' | 'quarter' | '1q' | 'year' | '1y' - -export interface AggregationsCardinalityAggregate extends AggregationsAggregateBase { - value: long -} - -export interface AggregationsCardinalityAggregation extends AggregationsMetricAggregationBase { - precision_threshold?: integer - rehash?: boolean - execution_hint?: AggregationsCardinalityExecutionMode -} - -export type AggregationsCardinalityExecutionMode = 'global_ordinals' | 'segment_ordinals' | 'direct' | 'save_memory_heuristic' | 'save_time_heuristic' - -export interface AggregationsCategorizeTextAggregation { - field: Field - max_unique_tokens?: integer - max_matched_tokens?: integer - similarity_threshold?: integer - categorization_filters?: string[] - categorization_analyzer?: AggregationsCategorizeTextAnalyzer - shard_size?: integer - size?: integer - min_doc_count?: integer - shard_min_doc_count?: integer -} - -export type AggregationsCategorizeTextAnalyzer = string | AggregationsCustomCategorizeTextAnalyzer - -export interface AggregationsChiSquareHeuristic { - background_is_superset: boolean - include_negatives: boolean -} - -export interface AggregationsChildrenAggregateKeys extends AggregationsSingleBucketAggregateBase { -} -export type AggregationsChildrenAggregate = AggregationsChildrenAggregateKeys -& { [property: string]: AggregationsAggregate | long | Metadata } - -export interface AggregationsChildrenAggregation extends AggregationsBucketAggregationBase { - type?: RelationName -} - -export interface AggregationsCompositeAggregate extends AggregationsMultiBucketAggregateBase { - after_key?: AggregationsCompositeAggregateKey -} - -export type AggregationsCompositeAggregateKey = Record - -export interface AggregationsCompositeAggregation extends AggregationsBucketAggregationBase { - after?: AggregationsCompositeAggregateKey - size?: integer - sources?: Record[] -} - -export interface AggregationsCompositeAggregationBase { - field?: Field - missing_bucket?: boolean - missing_order?: AggregationsMissingOrder - script?: Script | string - value_type?: AggregationsValueType - order?: SortOrder -} - -export interface AggregationsCompositeAggregationSource { - terms?: AggregationsCompositeTermsAggregation - histogram?: AggregationsCompositeHistogramAggregation - date_histogram?: AggregationsCompositeDateHistogramAggregation - geotile_grid?: AggregationsCompositeGeoTileGridAggregation -} - -export interface AggregationsCompositeBucketKeys extends AggregationsMultiBucketBase { - key: AggregationsCompositeAggregateKey -} -export type AggregationsCompositeBucket = AggregationsCompositeBucketKeys -& { [property: string]: AggregationsAggregate | AggregationsCompositeAggregateKey | long } - -export interface AggregationsCompositeDateHistogramAggregation extends AggregationsCompositeAggregationBase { - format?: string - calendar_interval?: DurationLarge - fixed_interval?: DurationLarge - offset?: Duration - time_zone?: TimeZone -} - -export interface AggregationsCompositeGeoTileGridAggregation extends AggregationsCompositeAggregationBase { - precision?: integer - bounds?: GeoBounds -} - -export interface AggregationsCompositeHistogramAggregation extends AggregationsCompositeAggregationBase { - interval: double -} - -export interface AggregationsCompositeTermsAggregation extends AggregationsCompositeAggregationBase { -} - -export interface AggregationsCumulativeCardinalityAggregate extends AggregationsAggregateBase { - value: long - value_as_string?: string -} - -export interface AggregationsCumulativeCardinalityAggregation extends AggregationsPipelineAggregationBase { -} - -export interface AggregationsCumulativeSumAggregation extends AggregationsPipelineAggregationBase { -} - -export interface AggregationsCustomCategorizeTextAnalyzer { - char_filter?: string[] - tokenizer?: string - filter?: string[] -} - -export interface AggregationsDateHistogramAggregate extends AggregationsMultiBucketAggregateBase { -} - -export interface AggregationsDateHistogramAggregation extends AggregationsBucketAggregationBase { - calendar_interval?: AggregationsCalendarInterval - extended_bounds?: AggregationsExtendedBounds - hard_bounds?: AggregationsExtendedBounds - field?: Field - fixed_interval?: Duration - format?: string - interval?: Duration - min_doc_count?: integer - missing?: DateTime - offset?: Duration - order?: AggregationsAggregateOrder - params?: Record - script?: Script | string - time_zone?: TimeZone - keyed?: boolean -} - -export interface AggregationsDateHistogramBucketKeys extends AggregationsMultiBucketBase { - key_as_string?: string - key: EpochTime -} -export type AggregationsDateHistogramBucket = AggregationsDateHistogramBucketKeys -& { [property: string]: AggregationsAggregate | string | EpochTime | long } - -export interface AggregationsDateRangeAggregate extends AggregationsRangeAggregate { -} - -export interface AggregationsDateRangeAggregation extends AggregationsBucketAggregationBase { - field?: Field - format?: string - missing?: AggregationsMissing - ranges?: AggregationsDateRangeExpression[] - time_zone?: TimeZone - keyed?: boolean -} - -export interface AggregationsDateRangeExpression { - from?: AggregationsFieldDateMath - key?: string - to?: AggregationsFieldDateMath -} - -export interface AggregationsDerivativeAggregate extends AggregationsSingleMetricAggregateBase { - normalized_value?: double - normalized_value_as_string?: string -} - -export interface AggregationsDerivativeAggregation extends AggregationsPipelineAggregationBase { -} - -export interface AggregationsDiversifiedSamplerAggregation extends AggregationsBucketAggregationBase { - execution_hint?: AggregationsSamplerAggregationExecutionHint - max_docs_per_value?: integer - script?: Script | string - shard_size?: integer - field?: Field -} - -export interface AggregationsDoubleTermsAggregate extends AggregationsTermsAggregateBase { -} - -export interface AggregationsDoubleTermsBucketKeys extends AggregationsTermsBucketBase { - key: double - key_as_string?: string -} -export type AggregationsDoubleTermsBucket = AggregationsDoubleTermsBucketKeys -& { [property: string]: AggregationsAggregate | double | string | long } - -export interface AggregationsEwmaModelSettings { - alpha?: float -} - -export interface AggregationsEwmaMovingAverageAggregation extends AggregationsMovingAverageAggregationBase { - model: 'ewma' - settings: AggregationsEwmaModelSettings -} - -export interface AggregationsExtendedBounds { - max?: T - min?: T -} - -export interface AggregationsExtendedStatsAggregate extends AggregationsStatsAggregate { - sum_of_squares: double | null - variance: double | null - variance_population: double | null - variance_sampling: double | null - std_deviation: double | null - std_deviation_population: double | null - std_deviation_sampling: double | null - std_deviation_bounds?: AggregationsStandardDeviationBounds - sum_of_squares_as_string?: string - variance_as_string?: string - variance_population_as_string?: string - variance_sampling_as_string?: string - std_deviation_as_string?: string - std_deviation_bounds_as_string?: AggregationsStandardDeviationBoundsAsString -} - -export interface AggregationsExtendedStatsAggregation extends AggregationsFormatMetricAggregationBase { - sigma?: double -} - -export interface AggregationsExtendedStatsBucketAggregate extends AggregationsExtendedStatsAggregate { -} - -export interface AggregationsExtendedStatsBucketAggregation extends AggregationsPipelineAggregationBase { - sigma?: double -} - -export type AggregationsFieldDateMath = DateMath | double - -export interface AggregationsFilterAggregateKeys extends AggregationsSingleBucketAggregateBase { -} -export type AggregationsFilterAggregate = AggregationsFilterAggregateKeys -& { [property: string]: AggregationsAggregate | long | Metadata } - -export interface AggregationsFiltersAggregate extends AggregationsMultiBucketAggregateBase { -} - -export interface AggregationsFiltersAggregation extends AggregationsBucketAggregationBase { - filters?: AggregationsBuckets - other_bucket?: boolean - other_bucket_key?: string - keyed?: boolean -} - -export interface AggregationsFiltersBucketKeys extends AggregationsMultiBucketBase { -} -export type AggregationsFiltersBucket = AggregationsFiltersBucketKeys -& { [property: string]: AggregationsAggregate | long } - -export interface AggregationsFormatMetricAggregationBase extends AggregationsMetricAggregationBase { - format?: string -} - -export interface AggregationsFormattableMetricAggregation extends AggregationsMetricAggregationBase { - format?: string -} - -export interface AggregationsFrequentItemSetsAggregate extends AggregationsMultiBucketAggregateBase { -} - -export interface AggregationsFrequentItemSetsAggregation { - fields: AggregationsFrequentItemSetsField[] - minimum_set_size?: integer - minimum_support?: double - size?: integer - filter?: QueryDslQueryContainer -} - -export interface AggregationsFrequentItemSetsBucketKeys extends AggregationsMultiBucketBase { - key: Record - support: double -} -export type AggregationsFrequentItemSetsBucket = AggregationsFrequentItemSetsBucketKeys -& { [property: string]: AggregationsAggregate | Record | double | long } - -export interface AggregationsFrequentItemSetsField { - field: Field - exclude?: AggregationsTermsExclude - include?: AggregationsTermsInclude -} - -export type AggregationsGapPolicy = 'skip' | 'insert_zeros' | 'keep_values' - -export interface AggregationsGeoBoundsAggregate extends AggregationsAggregateBase { - bounds?: GeoBounds -} - -export interface AggregationsGeoBoundsAggregation extends AggregationsMetricAggregationBase { - wrap_longitude?: boolean -} - -export interface AggregationsGeoCentroidAggregate extends AggregationsAggregateBase { - count: long - location?: GeoLocation -} - -export interface AggregationsGeoCentroidAggregation extends AggregationsMetricAggregationBase { - count?: long - location?: GeoLocation -} - -export interface AggregationsGeoDistanceAggregate extends AggregationsRangeAggregate { -} - -export interface AggregationsGeoDistanceAggregation extends AggregationsBucketAggregationBase { - distance_type?: GeoDistanceType - field?: Field - origin?: GeoLocation - ranges?: AggregationsAggregationRange[] - unit?: DistanceUnit -} - -export interface AggregationsGeoHashGridAggregate extends AggregationsMultiBucketAggregateBase { -} - -export interface AggregationsGeoHashGridAggregation extends AggregationsBucketAggregationBase { - bounds?: GeoBounds - field?: Field - precision?: GeoHashPrecision - shard_size?: integer - size?: integer -} - -export interface AggregationsGeoHashGridBucketKeys extends AggregationsMultiBucketBase { - key: GeoHash -} -export type AggregationsGeoHashGridBucket = AggregationsGeoHashGridBucketKeys -& { [property: string]: AggregationsAggregate | GeoHash | long } - -export interface AggregationsGeoHexGridAggregate extends AggregationsMultiBucketAggregateBase { -} - -export interface AggregationsGeoHexGridBucketKeys extends AggregationsMultiBucketBase { - key: GeoHexCell -} -export type AggregationsGeoHexGridBucket = AggregationsGeoHexGridBucketKeys -& { [property: string]: AggregationsAggregate | GeoHexCell | long } - -export interface AggregationsGeoLineAggregate extends AggregationsAggregateBase { - type: string - geometry: GeoLine - properties: any -} - -export interface AggregationsGeoLineAggregation { - point: AggregationsGeoLinePoint - sort: AggregationsGeoLineSort - include_sort?: boolean - sort_order?: SortOrder - size?: integer -} - -export interface AggregationsGeoLinePoint { - field: Field -} - -export interface AggregationsGeoLineSort { - field: Field -} - -export interface AggregationsGeoTileGridAggregate extends AggregationsMultiBucketAggregateBase { -} - -export interface AggregationsGeoTileGridAggregation extends AggregationsBucketAggregationBase { - field?: Field - precision?: GeoTilePrecision - shard_size?: integer - size?: integer - bounds?: GeoBounds -} - -export interface AggregationsGeoTileGridBucketKeys extends AggregationsMultiBucketBase { - key: GeoTile -} -export type AggregationsGeoTileGridBucket = AggregationsGeoTileGridBucketKeys -& { [property: string]: AggregationsAggregate | GeoTile | long } - -export interface AggregationsGeohexGridAggregation extends AggregationsBucketAggregationBase { - field: Field - precision?: integer - bounds?: GeoBounds - size?: integer - shard_size?: integer -} - -export interface AggregationsGlobalAggregateKeys extends AggregationsSingleBucketAggregateBase { -} -export type AggregationsGlobalAggregate = AggregationsGlobalAggregateKeys -& { [property: string]: AggregationsAggregate | long | Metadata } - -export interface AggregationsGlobalAggregation extends AggregationsBucketAggregationBase { -} - -export interface AggregationsGoogleNormalizedDistanceHeuristic { - background_is_superset?: boolean -} - -export interface AggregationsHdrMethod { - number_of_significant_value_digits?: integer -} - -export interface AggregationsHdrPercentileRanksAggregate extends AggregationsPercentilesAggregateBase { -} - -export interface AggregationsHdrPercentilesAggregate extends AggregationsPercentilesAggregateBase { -} - -export interface AggregationsHistogramAggregate extends AggregationsMultiBucketAggregateBase { -} - -export interface AggregationsHistogramAggregation extends AggregationsBucketAggregationBase { - extended_bounds?: AggregationsExtendedBounds - hard_bounds?: AggregationsExtendedBounds - field?: Field - interval?: double - min_doc_count?: integer - missing?: double - offset?: double - order?: AggregationsAggregateOrder - script?: Script | string - format?: string - keyed?: boolean -} - -export interface AggregationsHistogramBucketKeys extends AggregationsMultiBucketBase { - key_as_string?: string - key: double -} -export type AggregationsHistogramBucket = AggregationsHistogramBucketKeys -& { [property: string]: AggregationsAggregate | string | double | long } - -export interface AggregationsHoltLinearModelSettings { - alpha?: float - beta?: float -} - -export interface AggregationsHoltMovingAverageAggregation extends AggregationsMovingAverageAggregationBase { - model: 'holt' - settings: AggregationsHoltLinearModelSettings -} - -export interface AggregationsHoltWintersModelSettings { - alpha?: float - beta?: float - gamma?: float - pad?: boolean - period?: integer - type?: AggregationsHoltWintersType -} - -export interface AggregationsHoltWintersMovingAverageAggregation extends AggregationsMovingAverageAggregationBase { - model: 'holt_winters' - settings: AggregationsHoltWintersModelSettings -} - -export type AggregationsHoltWintersType = 'add' | 'mult' - -export interface AggregationsInferenceAggregateKeys extends AggregationsAggregateBase { - value?: FieldValue - feature_importance?: AggregationsInferenceFeatureImportance[] - top_classes?: AggregationsInferenceTopClassEntry[] - warning?: string -} -export type AggregationsInferenceAggregate = AggregationsInferenceAggregateKeys -& { [property: string]: any } - -export interface AggregationsInferenceAggregation extends AggregationsPipelineAggregationBase { - model_id: Name - inference_config?: AggregationsInferenceConfigContainer -} - -export interface AggregationsInferenceClassImportance { - class_name: string - importance: double -} - -export interface AggregationsInferenceConfigContainer { - regression?: MlRegressionInferenceOptions - classification?: MlClassificationInferenceOptions -} - -export interface AggregationsInferenceFeatureImportance { - feature_name: string - importance?: double - classes?: AggregationsInferenceClassImportance[] -} - -export interface AggregationsInferenceTopClassEntry { - class_name: FieldValue - class_probability: double - class_score: double -} - -export interface AggregationsIpPrefixAggregate extends AggregationsMultiBucketAggregateBase { -} - -export interface AggregationsIpPrefixAggregation extends AggregationsBucketAggregationBase { - field: Field - prefix_length: integer - is_ipv6?: boolean - append_prefix_length?: boolean - keyed?: boolean - min_doc_count?: long -} - -export interface AggregationsIpPrefixBucketKeys extends AggregationsMultiBucketBase { - is_ipv6: boolean - key: string - prefix_length: integer - netmask?: string -} -export type AggregationsIpPrefixBucket = AggregationsIpPrefixBucketKeys -& { [property: string]: AggregationsAggregate | boolean | string | integer | long } - -export interface AggregationsIpRangeAggregate extends AggregationsMultiBucketAggregateBase { -} - -export interface AggregationsIpRangeAggregation extends AggregationsBucketAggregationBase { - field?: Field - ranges?: AggregationsIpRangeAggregationRange[] -} - -export interface AggregationsIpRangeAggregationRange { - from?: string | null - mask?: string - to?: string | null -} - -export interface AggregationsIpRangeBucketKeys extends AggregationsMultiBucketBase { - key?: string - from?: string - to?: string -} -export type AggregationsIpRangeBucket = AggregationsIpRangeBucketKeys -& { [property: string]: AggregationsAggregate | string | long } - -export type AggregationsKeyedPercentiles = Record - -export interface AggregationsLinearMovingAverageAggregation extends AggregationsMovingAverageAggregationBase { - model: 'linear' - settings: EmptyObject -} - -export interface AggregationsLongRareTermsAggregate extends AggregationsMultiBucketAggregateBase { -} - -export interface AggregationsLongRareTermsBucketKeys extends AggregationsMultiBucketBase { - key: long - key_as_string?: string -} -export type AggregationsLongRareTermsBucket = AggregationsLongRareTermsBucketKeys -& { [property: string]: AggregationsAggregate | long | string } - -export interface AggregationsLongTermsAggregate extends AggregationsTermsAggregateBase { -} - -export interface AggregationsLongTermsBucketKeys extends AggregationsTermsBucketBase { - key: long - key_as_string?: string -} -export type AggregationsLongTermsBucket = AggregationsLongTermsBucketKeys -& { [property: string]: AggregationsAggregate | long | string } - -export interface AggregationsMatrixAggregation { - fields?: Fields - missing?: Record -} - -export interface AggregationsMatrixStatsAggregate extends AggregationsAggregateBase { - doc_count: long - fields?: AggregationsMatrixStatsFields[] -} - -export interface AggregationsMatrixStatsAggregation extends AggregationsMatrixAggregation { - mode?: SortMode -} - -export interface AggregationsMatrixStatsFields { - name: Field - count: long - mean: double - variance: double - skewness: double - kurtosis: double - covariance: Record - correlation: Record -} - -export interface AggregationsMaxAggregate extends AggregationsSingleMetricAggregateBase { -} - -export interface AggregationsMaxAggregation extends AggregationsFormatMetricAggregationBase { -} - -export interface AggregationsMaxBucketAggregation extends AggregationsPipelineAggregationBase { -} - -export interface AggregationsMedianAbsoluteDeviationAggregate extends AggregationsSingleMetricAggregateBase { -} - -export interface AggregationsMedianAbsoluteDeviationAggregation extends AggregationsFormatMetricAggregationBase { - compression?: double -} - -export interface AggregationsMetricAggregationBase { - field?: Field - missing?: AggregationsMissing - script?: Script | string -} - -export interface AggregationsMinAggregate extends AggregationsSingleMetricAggregateBase { -} - -export interface AggregationsMinAggregation extends AggregationsFormatMetricAggregationBase { -} - -export interface AggregationsMinBucketAggregation extends AggregationsPipelineAggregationBase { -} - -export type AggregationsMinimumInterval = 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' - -export type AggregationsMissing = string | integer | double | boolean - -export interface AggregationsMissingAggregateKeys extends AggregationsSingleBucketAggregateBase { -} -export type AggregationsMissingAggregate = AggregationsMissingAggregateKeys -& { [property: string]: AggregationsAggregate | long | Metadata } - -export interface AggregationsMissingAggregation extends AggregationsBucketAggregationBase { - field?: Field - missing?: AggregationsMissing -} - -export type AggregationsMissingOrder = 'first' | 'last' | 'default' - -export type AggregationsMovingAverageAggregation = AggregationsLinearMovingAverageAggregation | AggregationsSimpleMovingAverageAggregation | AggregationsEwmaMovingAverageAggregation | AggregationsHoltMovingAverageAggregation | AggregationsHoltWintersMovingAverageAggregation - -export interface AggregationsMovingAverageAggregationBase extends AggregationsPipelineAggregationBase { - minimize?: boolean - predict?: integer - window?: integer -} - -export interface AggregationsMovingFunctionAggregation extends AggregationsPipelineAggregationBase { - script?: string - shift?: integer - window?: integer -} - -export interface AggregationsMovingPercentilesAggregation extends AggregationsPipelineAggregationBase { - window?: integer - shift?: integer - keyed?: boolean -} - -export interface AggregationsMultiBucketAggregateBase extends AggregationsAggregateBase { - buckets: AggregationsBuckets -} - -export interface AggregationsMultiBucketBase { - doc_count: long -} - -export interface AggregationsMultiTermLookup { - field: Field - missing?: AggregationsMissing -} - -export interface AggregationsMultiTermsAggregate extends AggregationsTermsAggregateBase { -} - -export interface AggregationsMultiTermsAggregation extends AggregationsBucketAggregationBase { - collect_mode?: AggregationsTermsAggregationCollectMode - order?: AggregationsAggregateOrder - min_doc_count?: long - shard_min_doc_count?: long - shard_size?: integer - show_term_doc_count_error?: boolean - size?: integer - terms: AggregationsMultiTermLookup[] -} - -export interface AggregationsMultiTermsBucketKeys extends AggregationsMultiBucketBase { - key: FieldValue[] - key_as_string?: string - doc_count_error_upper_bound?: long -} -export type AggregationsMultiTermsBucket = AggregationsMultiTermsBucketKeys -& { [property: string]: AggregationsAggregate | FieldValue[] | string | long } - -export interface AggregationsMutualInformationHeuristic { - background_is_superset?: boolean - include_negatives?: boolean -} - -export interface AggregationsNestedAggregateKeys extends AggregationsSingleBucketAggregateBase { -} -export type AggregationsNestedAggregate = AggregationsNestedAggregateKeys -& { [property: string]: AggregationsAggregate | long | Metadata } - -export interface AggregationsNestedAggregation extends AggregationsBucketAggregationBase { - path?: Field -} - -export interface AggregationsNormalizeAggregation extends AggregationsPipelineAggregationBase { - method?: AggregationsNormalizeMethod -} - -export type AggregationsNormalizeMethod = 'rescale_0_1' | 'rescale_0_100' | 'percent_of_sum' | 'mean' | 'z-score' | 'softmax' - -export interface AggregationsParentAggregateKeys extends AggregationsSingleBucketAggregateBase { -} -export type AggregationsParentAggregate = AggregationsParentAggregateKeys -& { [property: string]: AggregationsAggregate | long | Metadata } - -export interface AggregationsParentAggregation extends AggregationsBucketAggregationBase { - type?: RelationName -} - -export interface AggregationsPercentageScoreHeuristic { -} - -export interface AggregationsPercentileRanksAggregation extends AggregationsFormatMetricAggregationBase { - keyed?: boolean - values?: double[] | null - hdr?: AggregationsHdrMethod - tdigest?: AggregationsTDigest -} - -export type AggregationsPercentiles = AggregationsKeyedPercentiles | AggregationsArrayPercentilesItem[] - -export interface AggregationsPercentilesAggregateBase extends AggregationsAggregateBase { - values: AggregationsPercentiles -} - -export interface AggregationsPercentilesAggregation extends AggregationsFormatMetricAggregationBase { - keyed?: boolean - percents?: double[] - hdr?: AggregationsHdrMethod - tdigest?: AggregationsTDigest -} - -export interface AggregationsPercentilesBucketAggregate extends AggregationsPercentilesAggregateBase { -} - -export interface AggregationsPercentilesBucketAggregation extends AggregationsPipelineAggregationBase { - percents?: double[] -} - -export interface AggregationsPipelineAggregationBase extends AggregationsBucketPathAggregation { - format?: string - gap_policy?: AggregationsGapPolicy -} - -export interface AggregationsRandomSamplerAggregation extends AggregationsBucketAggregationBase { - probability: double - seed?: integer - shard_seed?: integer -} - -export interface AggregationsRangeAggregate extends AggregationsMultiBucketAggregateBase { -} - -export interface AggregationsRangeAggregation extends AggregationsBucketAggregationBase { - field?: Field - missing?: integer - ranges?: AggregationsAggregationRange[] - script?: Script | string - keyed?: boolean - format?: string -} - -export interface AggregationsRangeBucketKeys extends AggregationsMultiBucketBase { - from?: double - to?: double - from_as_string?: string - to_as_string?: string - key?: string -} -export type AggregationsRangeBucket = AggregationsRangeBucketKeys -& { [property: string]: AggregationsAggregate | double | string | long } - -export interface AggregationsRareTermsAggregation extends AggregationsBucketAggregationBase { - exclude?: AggregationsTermsExclude - field?: Field - include?: AggregationsTermsInclude - max_doc_count?: long - missing?: AggregationsMissing - precision?: double - value_type?: string -} - -export interface AggregationsRateAggregate extends AggregationsAggregateBase { - value: double - value_as_string?: string -} - -export interface AggregationsRateAggregation extends AggregationsFormatMetricAggregationBase { - unit?: AggregationsCalendarInterval - mode?: AggregationsRateMode -} - -export type AggregationsRateMode = 'sum' | 'value_count' - -export interface AggregationsReverseNestedAggregateKeys extends AggregationsSingleBucketAggregateBase { -} -export type AggregationsReverseNestedAggregate = AggregationsReverseNestedAggregateKeys -& { [property: string]: AggregationsAggregate | long | Metadata } - -export interface AggregationsReverseNestedAggregation extends AggregationsBucketAggregationBase { - path?: Field -} - -export interface AggregationsSamplerAggregateKeys extends AggregationsSingleBucketAggregateBase { -} -export type AggregationsSamplerAggregate = AggregationsSamplerAggregateKeys -& { [property: string]: AggregationsAggregate | long | Metadata } - -export interface AggregationsSamplerAggregation extends AggregationsBucketAggregationBase { - shard_size?: integer -} - -export type AggregationsSamplerAggregationExecutionHint = 'map' | 'global_ordinals' | 'bytes_hash' - -export interface AggregationsScriptedHeuristic { - script: Script | string -} - -export interface AggregationsScriptedMetricAggregate extends AggregationsAggregateBase { - value: any -} - -export interface AggregationsScriptedMetricAggregation extends AggregationsMetricAggregationBase { - combine_script?: Script | string - init_script?: Script | string - map_script?: Script | string - params?: Record - reduce_script?: Script | string -} - -export interface AggregationsSerialDifferencingAggregation extends AggregationsPipelineAggregationBase { - lag?: integer -} - -export interface AggregationsSignificantLongTermsAggregate extends AggregationsSignificantTermsAggregateBase { -} - -export interface AggregationsSignificantLongTermsBucketKeys extends AggregationsSignificantTermsBucketBase { - key: long - key_as_string?: string -} -export type AggregationsSignificantLongTermsBucket = AggregationsSignificantLongTermsBucketKeys -& { [property: string]: AggregationsAggregate | long | string | double } - -export interface AggregationsSignificantStringTermsAggregate extends AggregationsSignificantTermsAggregateBase { -} - -export interface AggregationsSignificantStringTermsBucketKeys extends AggregationsSignificantTermsBucketBase { - key: string -} -export type AggregationsSignificantStringTermsBucket = AggregationsSignificantStringTermsBucketKeys -& { [property: string]: AggregationsAggregate | string | double | long } - -export interface AggregationsSignificantTermsAggregateBase extends AggregationsMultiBucketAggregateBase { - bg_count?: long - doc_count?: long -} - -export interface AggregationsSignificantTermsAggregation extends AggregationsBucketAggregationBase { - background_filter?: QueryDslQueryContainer - chi_square?: AggregationsChiSquareHeuristic - exclude?: AggregationsTermsExclude - execution_hint?: AggregationsTermsAggregationExecutionHint - field?: Field - gnd?: AggregationsGoogleNormalizedDistanceHeuristic - include?: AggregationsTermsInclude - jlh?: EmptyObject - min_doc_count?: long - mutual_information?: AggregationsMutualInformationHeuristic - percentage?: AggregationsPercentageScoreHeuristic - script_heuristic?: AggregationsScriptedHeuristic - shard_min_doc_count?: long - shard_size?: integer - size?: integer -} - -export interface AggregationsSignificantTermsBucketBase extends AggregationsMultiBucketBase { - score: double - bg_count: long -} - -export interface AggregationsSignificantTextAggregation extends AggregationsBucketAggregationBase { - background_filter?: QueryDslQueryContainer - chi_square?: AggregationsChiSquareHeuristic - exclude?: AggregationsTermsExclude - execution_hint?: AggregationsTermsAggregationExecutionHint - field?: Field - filter_duplicate_text?: boolean - gnd?: AggregationsGoogleNormalizedDistanceHeuristic - include?: AggregationsTermsInclude - jlh?: EmptyObject - min_doc_count?: long - mutual_information?: AggregationsMutualInformationHeuristic - percentage?: AggregationsPercentageScoreHeuristic - script_heuristic?: AggregationsScriptedHeuristic - shard_min_doc_count?: long - shard_size?: integer - size?: integer - source_fields?: Fields -} - -export interface AggregationsSimpleMovingAverageAggregation extends AggregationsMovingAverageAggregationBase { - model: 'simple' - settings: EmptyObject -} - -export interface AggregationsSimpleValueAggregate extends AggregationsSingleMetricAggregateBase { -} - -export interface AggregationsSingleBucketAggregateBase extends AggregationsAggregateBase { - doc_count: long -} - -export interface AggregationsSingleMetricAggregateBase extends AggregationsAggregateBase { - value: double | null - value_as_string?: string -} - -export interface AggregationsStandardDeviationBounds { - upper: double | null - lower: double | null - upper_population: double | null - lower_population: double | null - upper_sampling: double | null - lower_sampling: double | null -} - -export interface AggregationsStandardDeviationBoundsAsString { - upper: string - lower: string - upper_population: string - lower_population: string - upper_sampling: string - lower_sampling: string -} - -export interface AggregationsStatsAggregate extends AggregationsAggregateBase { - count: long - min: double | null - max: double | null - avg: double | null - sum: double - min_as_string?: string - max_as_string?: string - avg_as_string?: string - sum_as_string?: string -} - -export interface AggregationsStatsAggregation extends AggregationsFormatMetricAggregationBase { -} - -export interface AggregationsStatsBucketAggregate extends AggregationsStatsAggregate { -} - -export interface AggregationsStatsBucketAggregation extends AggregationsPipelineAggregationBase { -} - -export interface AggregationsStringRareTermsAggregate extends AggregationsMultiBucketAggregateBase { -} - -export interface AggregationsStringRareTermsBucketKeys extends AggregationsMultiBucketBase { - key: string -} -export type AggregationsStringRareTermsBucket = AggregationsStringRareTermsBucketKeys -& { [property: string]: AggregationsAggregate | string | long } - -export interface AggregationsStringStatsAggregate extends AggregationsAggregateBase { - count: long - min_length: integer | null - max_length: integer | null - avg_length: double | null - entropy: double | null - distribution?: Record | null - min_length_as_string?: string - max_length_as_string?: string - avg_length_as_string?: string -} - -export interface AggregationsStringStatsAggregation extends AggregationsMetricAggregationBase { - show_distribution?: boolean -} - -export interface AggregationsStringTermsAggregate extends AggregationsTermsAggregateBase { -} - -export interface AggregationsStringTermsBucketKeys extends AggregationsTermsBucketBase { - key: FieldValue -} -export type AggregationsStringTermsBucket = AggregationsStringTermsBucketKeys -& { [property: string]: AggregationsAggregate | FieldValue | long } - -export interface AggregationsSumAggregate extends AggregationsSingleMetricAggregateBase { -} - -export interface AggregationsSumAggregation extends AggregationsFormatMetricAggregationBase { -} - -export interface AggregationsSumBucketAggregation extends AggregationsPipelineAggregationBase { -} - -export interface AggregationsTDigest { - compression?: integer -} - -export interface AggregationsTDigestPercentileRanksAggregate extends AggregationsPercentilesAggregateBase { -} - -export interface AggregationsTDigestPercentilesAggregate extends AggregationsPercentilesAggregateBase { -} - -export interface AggregationsTTestAggregate extends AggregationsAggregateBase { - value: double | null - value_as_string?: string -} - -export interface AggregationsTTestAggregation { - a?: AggregationsTestPopulation - b?: AggregationsTestPopulation - type?: AggregationsTTestType -} - -export type AggregationsTTestType = 'paired' | 'homoscedastic' | 'heteroscedastic' - -export interface AggregationsTermsAggregateBase extends AggregationsMultiBucketAggregateBase { - doc_count_error_upper_bound?: long - sum_other_doc_count?: long -} - -export interface AggregationsTermsAggregation extends AggregationsBucketAggregationBase { - collect_mode?: AggregationsTermsAggregationCollectMode - exclude?: AggregationsTermsExclude - execution_hint?: AggregationsTermsAggregationExecutionHint - field?: Field - include?: AggregationsTermsInclude - min_doc_count?: integer - missing?: AggregationsMissing - missing_order?: AggregationsMissingOrder - missing_bucket?: boolean - value_type?: string - order?: AggregationsAggregateOrder - script?: Script | string - shard_min_doc_count?: long - shard_size?: integer - show_term_doc_count_error?: boolean - size?: integer - format?: string -} - -export type AggregationsTermsAggregationCollectMode = 'depth_first' | 'breadth_first' - -export type AggregationsTermsAggregationExecutionHint = 'map' | 'global_ordinals' | 'global_ordinals_hash' | 'global_ordinals_low_cardinality' - -export interface AggregationsTermsBucketBase extends AggregationsMultiBucketBase { - doc_count_error_upper_bound?: long -} - -export type AggregationsTermsExclude = string | string[] - -export type AggregationsTermsInclude = string | string[] | AggregationsTermsPartition - -export interface AggregationsTermsPartition { - num_partitions: long - partition: long -} - -export interface AggregationsTestPopulation { - field: Field - script?: Script | string - filter?: QueryDslQueryContainer -} - -export interface AggregationsTimeSeriesAggregate extends AggregationsMultiBucketAggregateBase { -} - -export interface AggregationsTimeSeriesAggregation extends AggregationsBucketAggregationBase { - size?: integer - keyed?: boolean -} - -export interface AggregationsTimeSeriesBucketKeys extends AggregationsMultiBucketBase { - key: Record -} -export type AggregationsTimeSeriesBucket = AggregationsTimeSeriesBucketKeys -& { [property: string]: AggregationsAggregate | Record | long } - -export interface AggregationsTopHitsAggregate extends AggregationsAggregateBase { - hits: SearchHitsMetadata -} - -export interface AggregationsTopHitsAggregation extends AggregationsMetricAggregationBase { - docvalue_fields?: (QueryDslFieldAndFormat | Field)[] - explain?: boolean - fields?: (QueryDslFieldAndFormat | Field)[] - from?: integer - highlight?: SearchHighlight - script_fields?: Record - size?: integer - sort?: Sort - _source?: SearchSourceConfig - stored_fields?: Fields - track_scores?: boolean - version?: boolean - seq_no_primary_term?: boolean -} - -export interface AggregationsTopMetrics { - sort: (FieldValue | null)[] - metrics: Record -} - -export interface AggregationsTopMetricsAggregate extends AggregationsAggregateBase { - top: AggregationsTopMetrics[] -} - -export interface AggregationsTopMetricsAggregation extends AggregationsMetricAggregationBase { - metrics?: AggregationsTopMetricsValue | AggregationsTopMetricsValue[] - size?: integer - sort?: Sort -} - -export interface AggregationsTopMetricsValue { - field: Field -} - -export interface AggregationsUnmappedRareTermsAggregate extends AggregationsMultiBucketAggregateBase { -} - -export interface AggregationsUnmappedSamplerAggregateKeys extends AggregationsSingleBucketAggregateBase { -} -export type AggregationsUnmappedSamplerAggregate = AggregationsUnmappedSamplerAggregateKeys -& { [property: string]: AggregationsAggregate | long | Metadata } - -export interface AggregationsUnmappedSignificantTermsAggregate extends AggregationsSignificantTermsAggregateBase { -} - -export interface AggregationsUnmappedTermsAggregate extends AggregationsTermsAggregateBase { -} - -export interface AggregationsValueCountAggregate extends AggregationsSingleMetricAggregateBase { -} - -export interface AggregationsValueCountAggregation extends AggregationsFormattableMetricAggregation { -} - -export type AggregationsValueType = 'string' | 'long' | 'double' | 'number' | 'date' | 'date_nanos' | 'ip' | 'numeric' | 'geo_point' | 'boolean' - -export interface AggregationsVariableWidthHistogramAggregate extends AggregationsMultiBucketAggregateBase { -} - -export interface AggregationsVariableWidthHistogramAggregation { - field?: Field - buckets?: integer - shard_size?: integer - initial_buffer?: integer - script?: Script | string -} - -export interface AggregationsVariableWidthHistogramBucketKeys extends AggregationsMultiBucketBase { - min: double - key: double - max: double - min_as_string?: string - key_as_string?: string - max_as_string?: string -} -export type AggregationsVariableWidthHistogramBucket = AggregationsVariableWidthHistogramBucketKeys -& { [property: string]: AggregationsAggregate | double | string | long } - -export interface AggregationsWeightedAverageAggregation { - format?: string - value?: AggregationsWeightedAverageValue - value_type?: AggregationsValueType - weight?: AggregationsWeightedAverageValue -} - -export interface AggregationsWeightedAverageValue { - field?: Field - missing?: double - script?: Script | string -} - -export interface AggregationsWeightedAvgAggregate extends AggregationsSingleMetricAggregateBase { -} - -export type AnalysisAnalyzer = AnalysisCustomAnalyzer | AnalysisFingerprintAnalyzer | AnalysisKeywordAnalyzer | AnalysisLanguageAnalyzer | AnalysisNoriAnalyzer | AnalysisPatternAnalyzer | AnalysisSimpleAnalyzer | AnalysisStandardAnalyzer | AnalysisStopAnalyzer | AnalysisWhitespaceAnalyzer | AnalysisIcuAnalyzer | AnalysisKuromojiAnalyzer | AnalysisSnowballAnalyzer | AnalysisArabicAnalyzer | AnalysisArmenianAnalyzer | AnalysisBasqueAnalyzer | AnalysisBengaliAnalyzer | AnalysisBrazilianAnalyzer | AnalysisBulgarianAnalyzer | AnalysisCatalanAnalyzer | AnalysisChineseAnalyzer | AnalysisCjkAnalyzer | AnalysisCzechAnalyzer | AnalysisDanishAnalyzer | AnalysisDutchAnalyzer | AnalysisEnglishAnalyzer | AnalysisEstonianAnalyzer | AnalysisFinnishAnalyzer | AnalysisFrenchAnalyzer | AnalysisGalicianAnalyzer | AnalysisGermanAnalyzer | AnalysisGreekAnalyzer | AnalysisHindiAnalyzer | AnalysisHungarianAnalyzer | AnalysisIndonesianAnalyzer | AnalysisIrishAnalyzer | AnalysisItalianAnalyzer | AnalysisLatvianAnalyzer | AnalysisLithuanianAnalyzer | AnalysisNorwegianAnalyzer | AnalysisPersianAnalyzer | AnalysisPortugueseAnalyzer | AnalysisRomanianAnalyzer | AnalysisRussianAnalyzer | AnalysisSerbianAnalyzer | AnalysisSoraniAnalyzer | AnalysisSpanishAnalyzer | AnalysisSwedishAnalyzer | AnalysisTurkishAnalyzer | AnalysisThaiAnalyzer - -export interface AnalysisArabicAnalyzer { - type: 'arabic' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisArmenianAnalyzer { - type: 'armenian' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisAsciiFoldingTokenFilter extends AnalysisTokenFilterBase { - type: 'asciifolding' - preserve_original?: SpecUtilsStringified -} - -export interface AnalysisBasqueAnalyzer { - type: 'basque' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisBengaliAnalyzer { - type: 'bengali' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisBrazilianAnalyzer { - type: 'brazilian' - stopwords?: AnalysisStopWords - stopwords_path?: string -} - -export interface AnalysisBulgarianAnalyzer { - type: 'bulgarian' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisCatalanAnalyzer { - type: 'catalan' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export type AnalysisCharFilter = string | AnalysisCharFilterDefinition - -export interface AnalysisCharFilterBase { - version?: VersionString -} - -export type AnalysisCharFilterDefinition = AnalysisHtmlStripCharFilter | AnalysisMappingCharFilter | AnalysisPatternReplaceCharFilter | AnalysisIcuNormalizationCharFilter | AnalysisKuromojiIterationMarkCharFilter - -export interface AnalysisCharGroupTokenizer extends AnalysisTokenizerBase { - type: 'char_group' - tokenize_on_chars: string[] - max_token_length?: integer -} - -export interface AnalysisChineseAnalyzer { - type: 'chinese' - stopwords?: AnalysisStopWords - stopwords_path?: string -} - -export interface AnalysisCjkAnalyzer { - type: 'cjk' - stopwords?: AnalysisStopWords - stopwords_path?: string -} - -export interface AnalysisClassicTokenizer extends AnalysisTokenizerBase { - type: 'classic' - max_token_length?: integer -} - -export interface AnalysisCommonGramsTokenFilter extends AnalysisTokenFilterBase { - type: 'common_grams' - common_words?: string[] - common_words_path?: string - ignore_case?: boolean - query_mode?: boolean -} - -export interface AnalysisCompoundWordTokenFilterBase extends AnalysisTokenFilterBase { - hyphenation_patterns_path?: string - max_subword_size?: integer - min_subword_size?: integer - min_word_size?: integer - only_longest_match?: boolean - word_list?: string[] - word_list_path?: string -} - -export interface AnalysisConditionTokenFilter extends AnalysisTokenFilterBase { - type: 'condition' - filter: string[] - script: Script | string -} - -export interface AnalysisCustomAnalyzer { - type: 'custom' - char_filter?: string | string[] - filter?: string | string[] - position_increment_gap?: integer - position_offset_gap?: integer - tokenizer: string -} - -export interface AnalysisCustomNormalizer { - type: 'custom' - char_filter?: string[] - filter?: string[] -} - -export interface AnalysisCzechAnalyzer { - type: 'czech' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisDanishAnalyzer { - type: 'danish' - stopwords?: AnalysisStopWords - stopwords_path?: string -} - -export type AnalysisDelimitedPayloadEncoding = 'int' | 'float' | 'identity' - -export interface AnalysisDelimitedPayloadTokenFilter extends AnalysisTokenFilterBase { - type: 'delimited_payload' - delimiter?: string - encoding?: AnalysisDelimitedPayloadEncoding -} - -export interface AnalysisDictionaryDecompounderTokenFilter extends AnalysisCompoundWordTokenFilterBase { - type: 'dictionary_decompounder' -} - -export interface AnalysisDutchAnalyzer { - type: 'dutch' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export type AnalysisEdgeNGramSide = 'front' | 'back' - -export interface AnalysisEdgeNGramTokenFilter extends AnalysisTokenFilterBase { - type: 'edge_ngram' - max_gram?: integer - min_gram?: integer - side?: AnalysisEdgeNGramSide - preserve_original?: SpecUtilsStringified -} - -export interface AnalysisEdgeNGramTokenizer extends AnalysisTokenizerBase { - type: 'edge_ngram' - custom_token_chars?: string - max_gram?: integer - min_gram?: integer - token_chars?: AnalysisTokenChar[] -} - -export interface AnalysisElisionTokenFilter extends AnalysisTokenFilterBase { - type: 'elision' - articles?: string[] - articles_path?: string - articles_case?: SpecUtilsStringified -} - -export interface AnalysisEnglishAnalyzer { - type: 'english' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisEstonianAnalyzer { - type: 'estonian' - stopwords?: AnalysisStopWords - stopwords_path?: string -} - -export interface AnalysisFingerprintAnalyzer { - type: 'fingerprint' - version?: VersionString - max_output_size: integer - preserve_original: boolean - separator: string - stopwords?: AnalysisStopWords - stopwords_path?: string -} - -export interface AnalysisFingerprintTokenFilter extends AnalysisTokenFilterBase { - type: 'fingerprint' - max_output_size?: integer - separator?: string -} - -export interface AnalysisFinnishAnalyzer { - type: 'finnish' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisFrenchAnalyzer { - type: 'french' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisGalicianAnalyzer { - type: 'galician' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisGermanAnalyzer { - type: 'german' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisGreekAnalyzer { - type: 'greek' - stopwords?: AnalysisStopWords - stopwords_path?: string -} - -export interface AnalysisHindiAnalyzer { - type: 'hindi' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisHtmlStripCharFilter extends AnalysisCharFilterBase { - type: 'html_strip' - escaped_tags?: string[] -} - -export interface AnalysisHungarianAnalyzer { - type: 'hungarian' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisHunspellTokenFilter extends AnalysisTokenFilterBase { - type: 'hunspell' - dedup?: boolean - dictionary?: string - locale: string - longest_only?: boolean -} - -export interface AnalysisHyphenationDecompounderTokenFilter extends AnalysisCompoundWordTokenFilterBase { - type: 'hyphenation_decompounder' -} - -export interface AnalysisIcuAnalyzer { - type: 'icu_analyzer' - method: AnalysisIcuNormalizationType - mode: AnalysisIcuNormalizationMode -} - -export type AnalysisIcuCollationAlternate = 'shifted' | 'non-ignorable' - -export type AnalysisIcuCollationCaseFirst = 'lower' | 'upper' - -export type AnalysisIcuCollationDecomposition = 'no' | 'identical' - -export type AnalysisIcuCollationStrength = 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'identical' - -export interface AnalysisIcuCollationTokenFilter extends AnalysisTokenFilterBase { - type: 'icu_collation' - alternate?: AnalysisIcuCollationAlternate - case_first?: AnalysisIcuCollationCaseFirst - case_level?: boolean - country?: string - decomposition?: AnalysisIcuCollationDecomposition - hiragana_quaternary_mode?: boolean - language?: string - numeric?: boolean - rules?: string - strength?: AnalysisIcuCollationStrength - variable_top?: string - variant?: string -} - -export interface AnalysisIcuFoldingTokenFilter extends AnalysisTokenFilterBase { - type: 'icu_folding' - unicode_set_filter: string -} - -export interface AnalysisIcuNormalizationCharFilter extends AnalysisCharFilterBase { - type: 'icu_normalizer' - mode?: AnalysisIcuNormalizationMode - name?: AnalysisIcuNormalizationType -} - -export type AnalysisIcuNormalizationMode = 'decompose' | 'compose' - -export interface AnalysisIcuNormalizationTokenFilter extends AnalysisTokenFilterBase { - type: 'icu_normalizer' - name: AnalysisIcuNormalizationType -} - -export type AnalysisIcuNormalizationType = 'nfc' | 'nfkc' | 'nfkc_cf' - -export interface AnalysisIcuTokenizer extends AnalysisTokenizerBase { - type: 'icu_tokenizer' - rule_files: string -} - -export type AnalysisIcuTransformDirection = 'forward' | 'reverse' - -export interface AnalysisIcuTransformTokenFilter extends AnalysisTokenFilterBase { - type: 'icu_transform' - dir?: AnalysisIcuTransformDirection - id: string -} - -export interface AnalysisIndonesianAnalyzer { - type: 'indonesian' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisIrishAnalyzer { - type: 'irish' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisItalianAnalyzer { - type: 'italian' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisKStemTokenFilter extends AnalysisTokenFilterBase { - type: 'kstem' -} - -export type AnalysisKeepTypesMode = 'include' | 'exclude' - -export interface AnalysisKeepTypesTokenFilter extends AnalysisTokenFilterBase { - type: 'keep_types' - mode?: AnalysisKeepTypesMode - types?: string[] -} - -export interface AnalysisKeepWordsTokenFilter extends AnalysisTokenFilterBase { - type: 'keep' - keep_words?: string[] - keep_words_case?: boolean - keep_words_path?: string -} - -export interface AnalysisKeywordAnalyzer { - type: 'keyword' - version?: VersionString -} - -export interface AnalysisKeywordMarkerTokenFilter extends AnalysisTokenFilterBase { - type: 'keyword_marker' - ignore_case?: boolean - keywords?: string | string[] - keywords_path?: string - keywords_pattern?: string -} - -export interface AnalysisKeywordTokenizer extends AnalysisTokenizerBase { - type: 'keyword' - buffer_size?: integer -} - -export interface AnalysisKuromojiAnalyzer { - type: 'kuromoji' - mode: AnalysisKuromojiTokenizationMode - user_dictionary?: string -} - -export interface AnalysisKuromojiIterationMarkCharFilter extends AnalysisCharFilterBase { - type: 'kuromoji_iteration_mark' - normalize_kana: boolean - normalize_kanji: boolean -} - -export interface AnalysisKuromojiPartOfSpeechTokenFilter extends AnalysisTokenFilterBase { - type: 'kuromoji_part_of_speech' - stoptags: string[] -} - -export interface AnalysisKuromojiReadingFormTokenFilter extends AnalysisTokenFilterBase { - type: 'kuromoji_readingform' - use_romaji: boolean -} - -export interface AnalysisKuromojiStemmerTokenFilter extends AnalysisTokenFilterBase { - type: 'kuromoji_stemmer' - minimum_length: integer -} - -export type AnalysisKuromojiTokenizationMode = 'normal' | 'search' | 'extended' - -export interface AnalysisKuromojiTokenizer extends AnalysisTokenizerBase { - type: 'kuromoji_tokenizer' - discard_punctuation?: boolean - mode: AnalysisKuromojiTokenizationMode - nbest_cost?: integer - nbest_examples?: string - user_dictionary?: string - user_dictionary_rules?: string[] - discard_compound_token?: boolean -} - -export type AnalysisLanguage = 'Arabic' | 'Armenian' | 'Basque' | 'Brazilian' | 'Bulgarian' | 'Catalan' | 'Chinese' | 'Cjk' | 'Czech' | 'Danish' | 'Dutch' | 'English' | 'Estonian' | 'Finnish' | 'French' | 'Galician' | 'German' | 'Greek' | 'Hindi' | 'Hungarian' | 'Indonesian' | 'Irish' | 'Italian' | 'Latvian' | 'Norwegian' | 'Persian' | 'Portuguese' | 'Romanian' | 'Russian' | 'Sorani' | 'Spanish' | 'Swedish' | 'Turkish' | 'Thai' - -export interface AnalysisLanguageAnalyzer { - type: 'language' - version?: VersionString - language: AnalysisLanguage - stem_exclusion: string[] - stopwords?: AnalysisStopWords - stopwords_path?: string -} - -export interface AnalysisLatvianAnalyzer { - type: 'latvian' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisLengthTokenFilter extends AnalysisTokenFilterBase { - type: 'length' - max?: integer - min?: integer -} - -export interface AnalysisLetterTokenizer extends AnalysisTokenizerBase { - type: 'letter' -} - -export interface AnalysisLimitTokenCountTokenFilter extends AnalysisTokenFilterBase { - type: 'limit' - consume_all_tokens?: boolean - max_token_count?: SpecUtilsStringified -} - -export interface AnalysisLithuanianAnalyzer { - type: 'lithuanian' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisLowercaseNormalizer { - type: 'lowercase' -} - -export interface AnalysisLowercaseTokenFilter extends AnalysisTokenFilterBase { - type: 'lowercase' - language?: string -} - -export interface AnalysisLowercaseTokenizer extends AnalysisTokenizerBase { - type: 'lowercase' -} - -export interface AnalysisMappingCharFilter extends AnalysisCharFilterBase { - type: 'mapping' - mappings?: string[] - mappings_path?: string -} - -export interface AnalysisMultiplexerTokenFilter extends AnalysisTokenFilterBase { - type: 'multiplexer' - filters: string[] - preserve_original?: SpecUtilsStringified -} - -export interface AnalysisNGramTokenFilter extends AnalysisTokenFilterBase { - type: 'ngram' - max_gram?: integer - min_gram?: integer - preserve_original?: SpecUtilsStringified -} - -export interface AnalysisNGramTokenizer extends AnalysisTokenizerBase { - type: 'ngram' - custom_token_chars?: string - max_gram?: integer - min_gram?: integer - token_chars?: AnalysisTokenChar[] -} - -export interface AnalysisNoriAnalyzer { - type: 'nori' - version?: VersionString - decompound_mode?: AnalysisNoriDecompoundMode - stoptags?: string[] - user_dictionary?: string -} - -export type AnalysisNoriDecompoundMode = 'discard' | 'none' | 'mixed' - -export interface AnalysisNoriPartOfSpeechTokenFilter extends AnalysisTokenFilterBase { - type: 'nori_part_of_speech' - stoptags?: string[] -} - -export interface AnalysisNoriTokenizer extends AnalysisTokenizerBase { - type: 'nori_tokenizer' - decompound_mode?: AnalysisNoriDecompoundMode - discard_punctuation?: boolean - user_dictionary?: string - user_dictionary_rules?: string[] -} - -export type AnalysisNormalizer = AnalysisLowercaseNormalizer | AnalysisCustomNormalizer - -export interface AnalysisNorwegianAnalyzer { - type: 'norwegian' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisPathHierarchyTokenizer extends AnalysisTokenizerBase { - type: 'path_hierarchy' - buffer_size?: SpecUtilsStringified - delimiter?: string - replacement?: string - reverse?: SpecUtilsStringified - skip?: SpecUtilsStringified -} - -export interface AnalysisPatternAnalyzer { - type: 'pattern' - version?: VersionString - flags?: string - lowercase?: boolean - pattern: string - stopwords?: AnalysisStopWords -} - -export interface AnalysisPatternCaptureTokenFilter extends AnalysisTokenFilterBase { - type: 'pattern_capture' - patterns: string[] - preserve_original?: SpecUtilsStringified -} - -export interface AnalysisPatternReplaceCharFilter extends AnalysisCharFilterBase { - type: 'pattern_replace' - flags?: string - pattern: string - replacement?: string -} - -export interface AnalysisPatternReplaceTokenFilter extends AnalysisTokenFilterBase { - type: 'pattern_replace' - all?: boolean - flags?: string - pattern: string - replacement?: string -} - -export interface AnalysisPatternTokenizer extends AnalysisTokenizerBase { - type: 'pattern' - flags?: string - group?: integer - pattern?: string -} - -export interface AnalysisPersianAnalyzer { - type: 'persian' - stopwords?: AnalysisStopWords - stopwords_path?: string -} - -export type AnalysisPhoneticEncoder = 'metaphone' | 'double_metaphone' | 'soundex' | 'refined_soundex' | 'caverphone1' | 'caverphone2' | 'cologne' | 'nysiis' | 'koelnerphonetik' | 'haasephonetik' | 'beider_morse' | 'daitch_mokotoff' - -export type AnalysisPhoneticLanguage = 'any' | 'common' | 'cyrillic' | 'english' | 'french' | 'german' | 'hebrew' | 'hungarian' | 'polish' | 'romanian' | 'russian' | 'spanish' - -export type AnalysisPhoneticNameType = 'generic' | 'ashkenazi' | 'sephardic' - -export type AnalysisPhoneticRuleType = 'approx' | 'exact' - -export interface AnalysisPhoneticTokenFilter extends AnalysisTokenFilterBase { - type: 'phonetic' - encoder: AnalysisPhoneticEncoder - languageset?: AnalysisPhoneticLanguage | AnalysisPhoneticLanguage[] - max_code_len?: integer - name_type?: AnalysisPhoneticNameType - replace?: boolean - rule_type?: AnalysisPhoneticRuleType -} - -export interface AnalysisPorterStemTokenFilter extends AnalysisTokenFilterBase { - type: 'porter_stem' -} - -export interface AnalysisPortugueseAnalyzer { - type: 'portuguese' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisPredicateTokenFilter extends AnalysisTokenFilterBase { - type: 'predicate_token_filter' - script: Script | string -} - -export interface AnalysisRemoveDuplicatesTokenFilter extends AnalysisTokenFilterBase { - type: 'remove_duplicates' -} - -export interface AnalysisReverseTokenFilter extends AnalysisTokenFilterBase { - type: 'reverse' -} - -export interface AnalysisRomanianAnalyzer { - type: 'romanian' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisRussianAnalyzer { - type: 'russian' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisSerbianAnalyzer { - type: 'serbian' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisShingleTokenFilter extends AnalysisTokenFilterBase { - type: 'shingle' - filler_token?: string - max_shingle_size?: integer | string - min_shingle_size?: integer | string - output_unigrams?: boolean - output_unigrams_if_no_shingles?: boolean - token_separator?: string -} - -export interface AnalysisSimpleAnalyzer { - type: 'simple' - version?: VersionString -} - -export interface AnalysisSimplePatternSplitTokenizer extends AnalysisTokenizerBase { - type: 'simple_pattern_split' - pattern?: string -} - -export interface AnalysisSimplePatternTokenizer extends AnalysisTokenizerBase { - type: 'simple_pattern' - pattern?: string -} - -export interface AnalysisSnowballAnalyzer { - type: 'snowball' - version?: VersionString - language: AnalysisSnowballLanguage - stopwords?: AnalysisStopWords -} - -export type AnalysisSnowballLanguage = 'Armenian' | 'Basque' | 'Catalan' | 'Danish' | 'Dutch' | 'English' | 'Finnish' | 'French' | 'German' | 'German2' | 'Hungarian' | 'Italian' | 'Kp' | 'Lovins' | 'Norwegian' | 'Porter' | 'Portuguese' | 'Romanian' | 'Russian' | 'Spanish' | 'Swedish' | 'Turkish' - -export interface AnalysisSnowballTokenFilter extends AnalysisTokenFilterBase { - type: 'snowball' - language?: AnalysisSnowballLanguage -} - -export interface AnalysisSoraniAnalyzer { - type: 'sorani' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisSpanishAnalyzer { - type: 'spanish' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisStandardAnalyzer { - type: 'standard' - max_token_length?: integer - stopwords?: AnalysisStopWords -} - -export interface AnalysisStandardTokenizer extends AnalysisTokenizerBase { - type: 'standard' - max_token_length?: integer -} - -export interface AnalysisStemmerOverrideTokenFilter extends AnalysisTokenFilterBase { - type: 'stemmer_override' - rules?: string[] - rules_path?: string -} - -export interface AnalysisStemmerTokenFilter extends AnalysisTokenFilterBase { - type: 'stemmer' - language?: string - name?: string -} - -export interface AnalysisStopAnalyzer { - type: 'stop' - version?: VersionString - stopwords?: AnalysisStopWords - stopwords_path?: string -} - -export interface AnalysisStopTokenFilter extends AnalysisTokenFilterBase { - type: 'stop' - ignore_case?: boolean - remove_trailing?: boolean - stopwords?: AnalysisStopWords - stopwords_path?: string -} - -export type AnalysisStopWords = string | string[] - -export interface AnalysisSwedishAnalyzer { - type: 'swedish' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export type AnalysisSynonymFormat = 'solr' | 'wordnet' - -export interface AnalysisSynonymGraphTokenFilter extends AnalysisTokenFilterBase { - type: 'synonym_graph' - expand?: boolean - format?: AnalysisSynonymFormat - lenient?: boolean - synonyms?: string[] - synonyms_path?: string - synonyms_set?: string - tokenizer?: string - updateable?: boolean -} - -export interface AnalysisSynonymTokenFilter extends AnalysisTokenFilterBase { - type: 'synonym' - expand?: boolean - format?: AnalysisSynonymFormat - lenient?: boolean - synonyms?: string[] - synonyms_path?: string - synonyms_set?: string - tokenizer?: string - updateable?: boolean -} - -export interface AnalysisThaiAnalyzer { - type: 'thai' - stopwords?: AnalysisStopWords - stopwords_path?: string -} - -export interface AnalysisThaiTokenizer extends AnalysisTokenizerBase { - type: 'thai' -} - -export type AnalysisTokenChar = 'letter' | 'digit' | 'whitespace' | 'punctuation' | 'symbol' | 'custom' - -export type AnalysisTokenFilter = string | AnalysisTokenFilterDefinition - -export interface AnalysisTokenFilterBase { - version?: VersionString -} - -export type AnalysisTokenFilterDefinition = AnalysisAsciiFoldingTokenFilter | AnalysisCommonGramsTokenFilter | AnalysisConditionTokenFilter | AnalysisDelimitedPayloadTokenFilter | AnalysisEdgeNGramTokenFilter | AnalysisElisionTokenFilter | AnalysisFingerprintTokenFilter | AnalysisHunspellTokenFilter | AnalysisHyphenationDecompounderTokenFilter | AnalysisKeepTypesTokenFilter | AnalysisKeepWordsTokenFilter | AnalysisKeywordMarkerTokenFilter | AnalysisKStemTokenFilter | AnalysisLengthTokenFilter | AnalysisLimitTokenCountTokenFilter | AnalysisLowercaseTokenFilter | AnalysisMultiplexerTokenFilter | AnalysisNGramTokenFilter | AnalysisNoriPartOfSpeechTokenFilter | AnalysisPatternCaptureTokenFilter | AnalysisPatternReplaceTokenFilter | AnalysisPorterStemTokenFilter | AnalysisPredicateTokenFilter | AnalysisRemoveDuplicatesTokenFilter | AnalysisReverseTokenFilter | AnalysisShingleTokenFilter | AnalysisSnowballTokenFilter | AnalysisStemmerOverrideTokenFilter | AnalysisStemmerTokenFilter | AnalysisStopTokenFilter | AnalysisSynonymGraphTokenFilter | AnalysisSynonymTokenFilter | AnalysisTrimTokenFilter | AnalysisTruncateTokenFilter | AnalysisUniqueTokenFilter | AnalysisUppercaseTokenFilter | AnalysisWordDelimiterGraphTokenFilter | AnalysisWordDelimiterTokenFilter | AnalysisKuromojiStemmerTokenFilter | AnalysisKuromojiReadingFormTokenFilter | AnalysisKuromojiPartOfSpeechTokenFilter | AnalysisIcuCollationTokenFilter | AnalysisIcuFoldingTokenFilter | AnalysisIcuNormalizationTokenFilter | AnalysisIcuTransformTokenFilter | AnalysisPhoneticTokenFilter | AnalysisDictionaryDecompounderTokenFilter - -export type AnalysisTokenizer = string | AnalysisTokenizerDefinition - -export interface AnalysisTokenizerBase { - version?: VersionString -} - -export type AnalysisTokenizerDefinition = AnalysisCharGroupTokenizer | AnalysisClassicTokenizer | AnalysisEdgeNGramTokenizer | AnalysisKeywordTokenizer | AnalysisLetterTokenizer | AnalysisLowercaseTokenizer | AnalysisNGramTokenizer | AnalysisPathHierarchyTokenizer | AnalysisPatternTokenizer | AnalysisSimplePatternTokenizer | AnalysisSimplePatternSplitTokenizer | AnalysisStandardTokenizer | AnalysisThaiTokenizer | AnalysisUaxEmailUrlTokenizer | AnalysisWhitespaceTokenizer | AnalysisIcuTokenizer | AnalysisKuromojiTokenizer | AnalysisNoriTokenizer - -export interface AnalysisTrimTokenFilter extends AnalysisTokenFilterBase { - type: 'trim' -} - -export interface AnalysisTruncateTokenFilter extends AnalysisTokenFilterBase { - type: 'truncate' - length?: integer -} - -export interface AnalysisTurkishAnalyzer { - type: 'turkish' - stopwords?: AnalysisStopWords - stopwords_path?: string - stem_exclusion?: string[] -} - -export interface AnalysisUaxEmailUrlTokenizer extends AnalysisTokenizerBase { - type: 'uax_url_email' - max_token_length?: integer -} - -export interface AnalysisUniqueTokenFilter extends AnalysisTokenFilterBase { - type: 'unique' - only_on_same_position?: boolean -} - -export interface AnalysisUppercaseTokenFilter extends AnalysisTokenFilterBase { - type: 'uppercase' -} - -export interface AnalysisWhitespaceAnalyzer { - type: 'whitespace' - version?: VersionString -} - -export interface AnalysisWhitespaceTokenizer extends AnalysisTokenizerBase { - type: 'whitespace' - max_token_length?: integer -} - -export interface AnalysisWordDelimiterGraphTokenFilter extends AnalysisTokenFilterBase { - type: 'word_delimiter_graph' - adjust_offsets?: boolean - catenate_all?: boolean - catenate_numbers?: boolean - catenate_words?: boolean - generate_number_parts?: boolean - generate_word_parts?: boolean - ignore_keywords?: boolean - preserve_original?: SpecUtilsStringified - protected_words?: string[] - protected_words_path?: string - split_on_case_change?: boolean - split_on_numerics?: boolean - stem_english_possessive?: boolean - type_table?: string[] - type_table_path?: string -} - -export interface AnalysisWordDelimiterTokenFilter extends AnalysisTokenFilterBase { - type: 'word_delimiter' - catenate_all?: boolean - catenate_numbers?: boolean - catenate_words?: boolean - generate_number_parts?: boolean - generate_word_parts?: boolean - preserve_original?: SpecUtilsStringified - protected_words?: string[] - protected_words_path?: string - split_on_case_change?: boolean - split_on_numerics?: boolean - stem_english_possessive?: boolean - type_table?: string[] - type_table_path?: string -} - -export interface MappingAggregateMetricDoubleProperty extends MappingPropertyBase { - type: 'aggregate_metric_double' - default_metric: string - metrics: string[] - time_series_metric?: MappingTimeSeriesMetricType -} - -export interface MappingAllField { - analyzer: string - enabled: boolean - omit_norms: boolean - search_analyzer: string - similarity: string - store: boolean - store_term_vector_offsets: boolean - store_term_vector_payloads: boolean - store_term_vector_positions: boolean - store_term_vectors: boolean -} - -export interface MappingBinaryProperty extends MappingDocValuesPropertyBase { - type: 'binary' -} - -export interface MappingBooleanProperty extends MappingDocValuesPropertyBase { - boost?: double - fielddata?: IndicesNumericFielddata - index?: boolean - null_value?: boolean - type: 'boolean' -} - -export interface MappingByteNumberProperty extends MappingNumberPropertyBase { - type: 'byte' - null_value?: byte -} - -export interface MappingCompletionProperty extends MappingDocValuesPropertyBase { - analyzer?: string - contexts?: MappingSuggestContext[] - max_input_length?: integer - preserve_position_increments?: boolean - preserve_separators?: boolean - search_analyzer?: string - type: 'completion' -} - -export interface MappingCompositeSubField { - type: MappingRuntimeFieldType -} - -export interface MappingConstantKeywordProperty extends MappingPropertyBase { - value?: any - type: 'constant_keyword' -} - -export interface MappingCorePropertyBase extends MappingPropertyBase { - copy_to?: Fields - store?: boolean -} - -export interface MappingDataStreamTimestamp { - enabled: boolean -} - -export interface MappingDateNanosProperty extends MappingDocValuesPropertyBase { - boost?: double - format?: string - ignore_malformed?: boolean - index?: boolean - null_value?: DateTime - precision_step?: integer - type: 'date_nanos' -} - -export interface MappingDateProperty extends MappingDocValuesPropertyBase { - boost?: double - fielddata?: IndicesNumericFielddata - format?: string - ignore_malformed?: boolean - index?: boolean - null_value?: DateTime - precision_step?: integer - locale?: string - type: 'date' -} - -export interface MappingDateRangeProperty extends MappingRangePropertyBase { - format?: string - type: 'date_range' -} - -export interface MappingDenseVectorIndexOptions { - type: string - m?: integer - ef_construction?: integer - confidence_interval?: float -} - -export interface MappingDenseVectorProperty extends MappingPropertyBase { - type: 'dense_vector' - element_type?: string - dims?: integer - similarity?: string - index?: boolean - index_options?: MappingDenseVectorIndexOptions -} - -export interface MappingDocValuesPropertyBase extends MappingCorePropertyBase { - doc_values?: boolean -} - -export interface MappingDoubleNumberProperty extends MappingNumberPropertyBase { - type: 'double' - null_value?: double -} - -export interface MappingDoubleRangeProperty extends MappingRangePropertyBase { - type: 'double_range' -} - -export type MappingDynamicMapping = boolean | 'strict' | 'runtime' | 'true' | 'false' - -export interface MappingDynamicProperty extends MappingDocValuesPropertyBase { - type: '{dynamic_type}' - enabled?: boolean - null_value?: FieldValue - boost?: double - coerce?: boolean - script?: Script | string - on_script_error?: MappingOnScriptError - ignore_malformed?: boolean - time_series_metric?: MappingTimeSeriesMetricType - analyzer?: string - eager_global_ordinals?: boolean - index?: boolean - index_options?: MappingIndexOptions - index_phrases?: boolean - index_prefixes?: MappingTextIndexPrefixes | null - norms?: boolean - position_increment_gap?: integer - search_analyzer?: string - search_quote_analyzer?: string - term_vector?: MappingTermVectorOption - format?: string - precision_step?: integer - locale?: string -} - -export interface MappingDynamicTemplate { - mapping?: MappingProperty - runtime?: MappingProperty - match?: string | string[] - path_match?: string | string[] - unmatch?: string | string[] - path_unmatch?: string | string[] - match_mapping_type?: string | string[] - unmatch_mapping_type?: string | string[] - match_pattern?: MappingMatchType -} - -export interface MappingFieldAliasProperty extends MappingPropertyBase { - path?: Field - type: 'alias' -} - -export interface MappingFieldMapping { - full_name: string - mapping: Partial> -} - -export interface MappingFieldNamesField { - enabled: boolean -} - -export type MappingFieldType = 'none' | 'geo_point' | 'geo_shape' | 'ip' | 'binary' | 'keyword' | 'text' | 'search_as_you_type' | 'date' | 'date_nanos' | 'boolean' | 'completion' | 'nested' | 'object' | 'version' | 'murmur3' | 'token_count' | 'percolator' | 'integer' | 'long' | 'short' | 'byte' | 'float' | 'half_float' | 'scaled_float' | 'double' | 'integer_range' | 'float_range' | 'long_range' | 'double_range' | 'date_range' | 'ip_range' | 'alias' | 'join' | 'rank_feature' | 'rank_features' | 'flattened' | 'shape' | 'histogram' | 'constant_keyword' | 'aggregate_metric_double' | 'dense_vector' | 'semantic_text' | 'sparse_vector' | 'match_only_text' | 'icu_collation_keyword' - -export interface MappingFlattenedProperty extends MappingPropertyBase { - boost?: double - depth_limit?: integer - doc_values?: boolean - eager_global_ordinals?: boolean - index?: boolean - index_options?: MappingIndexOptions - null_value?: string - similarity?: string - split_queries_on_whitespace?: boolean - type: 'flattened' -} - -export interface MappingFloatNumberProperty extends MappingNumberPropertyBase { - type: 'float' - null_value?: float -} - -export interface MappingFloatRangeProperty extends MappingRangePropertyBase { - type: 'float_range' -} - -export type MappingGeoOrientation = 'right' | 'RIGHT' | 'counterclockwise' | 'ccw' | 'left' | 'LEFT' | 'clockwise' | 'cw' - -export interface MappingGeoPointProperty extends MappingDocValuesPropertyBase { - ignore_malformed?: boolean - ignore_z_value?: boolean - null_value?: GeoLocation - index?: boolean - on_script_error?: MappingOnScriptError - script?: Script | string - type: 'geo_point' -} - -export interface MappingGeoShapeProperty extends MappingDocValuesPropertyBase { - coerce?: boolean - ignore_malformed?: boolean - ignore_z_value?: boolean - orientation?: MappingGeoOrientation - strategy?: MappingGeoStrategy - type: 'geo_shape' -} - -export type MappingGeoStrategy = 'recursive' | 'term' - -export interface MappingHalfFloatNumberProperty extends MappingNumberPropertyBase { - type: 'half_float' - null_value?: float -} - -export interface MappingHistogramProperty extends MappingPropertyBase { - ignore_malformed?: boolean - type: 'histogram' -} - -export interface MappingIcuCollationProperty extends MappingDocValuesPropertyBase { - type: 'icu_collation_keyword' - norms?: boolean - index_options?: MappingIndexOptions - index?: boolean - null_value?: string - rules?: string - language?: string - country?: string - variant?: string - strength?: AnalysisIcuCollationStrength - decomposition?: AnalysisIcuCollationDecomposition - alternate?: AnalysisIcuCollationAlternate - case_level?: boolean - case_first?: AnalysisIcuCollationCaseFirst - numeric?: boolean - variable_top?: string - hiragana_quaternary_mode?: boolean -} - -export interface MappingIndexField { - enabled: boolean -} - -export type MappingIndexOptions = 'docs' | 'freqs' | 'positions' | 'offsets' - -export interface MappingIntegerNumberProperty extends MappingNumberPropertyBase { - type: 'integer' - null_value?: integer -} - -export interface MappingIntegerRangeProperty extends MappingRangePropertyBase { - type: 'integer_range' -} - -export interface MappingIpProperty extends MappingDocValuesPropertyBase { - boost?: double - index?: boolean - ignore_malformed?: boolean - null_value?: string - on_script_error?: MappingOnScriptError - script?: Script | string - time_series_dimension?: boolean - type: 'ip' -} - -export interface MappingIpRangeProperty extends MappingRangePropertyBase { - type: 'ip_range' -} - -export interface MappingJoinProperty extends MappingPropertyBase { - relations?: Record - eager_global_ordinals?: boolean - type: 'join' -} - -export interface MappingKeywordProperty extends MappingDocValuesPropertyBase { - boost?: double - eager_global_ordinals?: boolean - index?: boolean - index_options?: MappingIndexOptions - script?: Script | string - on_script_error?: MappingOnScriptError - normalizer?: string - norms?: boolean - null_value?: string - similarity?: string | null - split_queries_on_whitespace?: boolean - time_series_dimension?: boolean - type: 'keyword' -} - -export interface MappingLongNumberProperty extends MappingNumberPropertyBase { - type: 'long' - null_value?: long -} - -export interface MappingLongRangeProperty extends MappingRangePropertyBase { - type: 'long_range' -} - -export interface MappingMatchOnlyTextProperty { - type: 'match_only_text' - fields?: Record - meta?: Record - copy_to?: Fields -} - -export type MappingMatchType = 'simple' | 'regex' - -export interface MappingMurmur3HashProperty extends MappingDocValuesPropertyBase { - type: 'murmur3' -} - -export interface MappingNestedProperty extends MappingCorePropertyBase { - enabled?: boolean - include_in_parent?: boolean - include_in_root?: boolean - type: 'nested' -} - -export interface MappingNumberPropertyBase extends MappingDocValuesPropertyBase { - boost?: double - coerce?: boolean - ignore_malformed?: boolean - index?: boolean - on_script_error?: MappingOnScriptError - script?: Script | string - time_series_metric?: MappingTimeSeriesMetricType - time_series_dimension?: boolean -} - -export interface MappingObjectProperty extends MappingCorePropertyBase { - enabled?: boolean - subobjects?: boolean - type?: 'object' -} - -export type MappingOnScriptError = 'fail' | 'continue' - -export interface MappingPercolatorProperty extends MappingPropertyBase { - type: 'percolator' -} - -export interface MappingPointProperty extends MappingDocValuesPropertyBase { - ignore_malformed?: boolean - ignore_z_value?: boolean - null_value?: string - type: 'point' -} - -export type MappingProperty = MappingBinaryProperty | MappingBooleanProperty | MappingDynamicProperty | MappingJoinProperty | MappingKeywordProperty | MappingMatchOnlyTextProperty | MappingPercolatorProperty | MappingRankFeatureProperty | MappingRankFeaturesProperty | MappingSearchAsYouTypeProperty | MappingTextProperty | MappingVersionProperty | MappingWildcardProperty | MappingDateNanosProperty | MappingDateProperty | MappingAggregateMetricDoubleProperty | MappingDenseVectorProperty | MappingFlattenedProperty | MappingNestedProperty | MappingObjectProperty | MappingSemanticTextProperty | MappingSparseVectorProperty | MappingCompletionProperty | MappingConstantKeywordProperty | MappingFieldAliasProperty | MappingHistogramProperty | MappingIpProperty | MappingMurmur3HashProperty | MappingTokenCountProperty | MappingGeoPointProperty | MappingGeoShapeProperty | MappingPointProperty | MappingShapeProperty | MappingByteNumberProperty | MappingDoubleNumberProperty | MappingFloatNumberProperty | MappingHalfFloatNumberProperty | MappingIntegerNumberProperty | MappingLongNumberProperty | MappingScaledFloatNumberProperty | MappingShortNumberProperty | MappingUnsignedLongNumberProperty | MappingDateRangeProperty | MappingDoubleRangeProperty | MappingFloatRangeProperty | MappingIntegerRangeProperty | MappingIpRangeProperty | MappingLongRangeProperty | MappingIcuCollationProperty - -export interface MappingPropertyBase { - meta?: Record - properties?: Record - ignore_above?: integer - dynamic?: MappingDynamicMapping - fields?: Record -} - -export interface MappingRangePropertyBase extends MappingDocValuesPropertyBase { - boost?: double - coerce?: boolean - index?: boolean -} - -export interface MappingRankFeatureProperty extends MappingPropertyBase { - positive_score_impact?: boolean - type: 'rank_feature' -} - -export interface MappingRankFeaturesProperty extends MappingPropertyBase { - positive_score_impact?: boolean - type: 'rank_features' -} - -export interface MappingRoutingField { - required: boolean -} - -export interface MappingRuntimeField { - fields?: Record - fetch_fields?: (MappingRuntimeFieldFetchFields | Field)[] - format?: string - input_field?: Field - target_field?: Field - target_index?: IndexName - script?: Script | string - type: MappingRuntimeFieldType -} - -export interface MappingRuntimeFieldFetchFields { - field: Field - format?: string -} - -export type MappingRuntimeFieldType = 'boolean' | 'composite' | 'date' | 'double' | 'geo_point' | 'ip' | 'keyword' | 'long' | 'lookup' - -export type MappingRuntimeFields = Record - -export interface MappingScaledFloatNumberProperty extends MappingNumberPropertyBase { - type: 'scaled_float' - null_value?: double - scaling_factor?: double -} - -export interface MappingSearchAsYouTypeProperty extends MappingCorePropertyBase { - analyzer?: string - index?: boolean - index_options?: MappingIndexOptions - max_shingle_size?: integer - norms?: boolean - search_analyzer?: string - search_quote_analyzer?: string - similarity?: string | null - term_vector?: MappingTermVectorOption - type: 'search_as_you_type' -} - -export interface MappingSemanticTextProperty { - type: 'semantic_text' - meta?: Record - inference_id: Id -} - -export interface MappingShapeProperty extends MappingDocValuesPropertyBase { - coerce?: boolean - ignore_malformed?: boolean - ignore_z_value?: boolean - orientation?: MappingGeoOrientation - type: 'shape' -} - -export interface MappingShortNumberProperty extends MappingNumberPropertyBase { - type: 'short' - null_value?: short -} - -export interface MappingSizeField { - enabled: boolean -} - -export interface MappingSourceField { - compress?: boolean - compress_threshold?: string - enabled?: boolean - excludes?: string[] - includes?: string[] - mode?: MappingSourceFieldMode -} - -export type MappingSourceFieldMode = 'disabled' | 'stored' | 'synthetic' - -export interface MappingSparseVectorProperty extends MappingPropertyBase { - type: 'sparse_vector' -} - -export interface MappingSuggestContext { - name: Name - path?: Field - type: string - precision?: integer | string -} - -export type MappingTermVectorOption = 'no' | 'yes' | 'with_offsets' | 'with_positions' | 'with_positions_offsets' | 'with_positions_offsets_payloads' | 'with_positions_payloads' - -export interface MappingTextIndexPrefixes { - max_chars: integer - min_chars: integer -} - -export interface MappingTextProperty extends MappingCorePropertyBase { - analyzer?: string - boost?: double - eager_global_ordinals?: boolean - fielddata?: boolean - fielddata_frequency_filter?: IndicesFielddataFrequencyFilter - index?: boolean - index_options?: MappingIndexOptions - index_phrases?: boolean - index_prefixes?: MappingTextIndexPrefixes | null - norms?: boolean - position_increment_gap?: integer - search_analyzer?: string - search_quote_analyzer?: string - similarity?: string | null - term_vector?: MappingTermVectorOption - type: 'text' -} - -export type MappingTimeSeriesMetricType = 'gauge' | 'counter' | 'summary' | 'histogram' | 'position' - -export interface MappingTokenCountProperty extends MappingDocValuesPropertyBase { - analyzer?: string - boost?: double - index?: boolean - null_value?: double - enable_position_increments?: boolean - type: 'token_count' -} - -export interface MappingTypeMapping { - all_field?: MappingAllField - date_detection?: boolean - dynamic?: MappingDynamicMapping - dynamic_date_formats?: string[] - dynamic_templates?: Record[] - _field_names?: MappingFieldNamesField - index_field?: MappingIndexField - _meta?: Metadata - numeric_detection?: boolean - properties?: Record - _routing?: MappingRoutingField - _size?: MappingSizeField - _source?: MappingSourceField - runtime?: Record - enabled?: boolean - subobjects?: boolean - _data_stream_timestamp?: MappingDataStreamTimestamp -} - -export interface MappingUnsignedLongNumberProperty extends MappingNumberPropertyBase { - type: 'unsigned_long' - null_value?: ulong -} - -export interface MappingVersionProperty extends MappingDocValuesPropertyBase { - type: 'version' -} - -export interface MappingWildcardProperty extends MappingDocValuesPropertyBase { - type: 'wildcard' - null_value?: string -} - -export interface QueryDslBoolQuery extends QueryDslQueryBase { - filter?: QueryDslQueryContainer | QueryDslQueryContainer[] - minimum_should_match?: MinimumShouldMatch - must?: QueryDslQueryContainer | QueryDslQueryContainer[] - must_not?: QueryDslQueryContainer | QueryDslQueryContainer[] - should?: QueryDslQueryContainer | QueryDslQueryContainer[] -} - -export interface QueryDslBoostingQuery extends QueryDslQueryBase { - negative_boost: double - negative: QueryDslQueryContainer - positive: QueryDslQueryContainer -} - -export type QueryDslChildScoreMode = 'none' | 'avg' | 'sum' | 'max' | 'min' - -export type QueryDslCombinedFieldsOperator = 'or' | 'and' - -export interface QueryDslCombinedFieldsQuery extends QueryDslQueryBase { - fields: Field[] - query: string - auto_generate_synonyms_phrase_query?: boolean - operator?: QueryDslCombinedFieldsOperator - minimum_should_match?: MinimumShouldMatch - zero_terms_query?: QueryDslCombinedFieldsZeroTerms -} - -export type QueryDslCombinedFieldsZeroTerms = 'none' | 'all' - -export interface QueryDslCommonTermsQuery extends QueryDslQueryBase { - analyzer?: string - cutoff_frequency?: double - high_freq_operator?: QueryDslOperator - low_freq_operator?: QueryDslOperator - minimum_should_match?: MinimumShouldMatch - query: string -} - -export interface QueryDslConstantScoreQuery extends QueryDslQueryBase { - filter: QueryDslQueryContainer -} - -export interface QueryDslDateDecayFunctionKeys extends QueryDslDecayFunctionBase { -} -export type QueryDslDateDecayFunction = QueryDslDateDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } - -export interface QueryDslDateDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { -} - -export interface QueryDslDateRangeQuery extends QueryDslRangeQueryBase { - format?: DateFormat - time_zone?: TimeZone -} - -export type QueryDslDecayFunction = QueryDslUntypedDecayFunction | QueryDslDateDecayFunction | QueryDslNumericDecayFunction | QueryDslGeoDecayFunction - -export interface QueryDslDecayFunctionBase { - multi_value_mode?: QueryDslMultiValueMode -} - -export interface QueryDslDecayPlacement { - decay?: double - offset?: TScale - scale?: TScale - origin?: TOrigin -} - -export interface QueryDslDisMaxQuery extends QueryDslQueryBase { - queries: QueryDslQueryContainer[] - tie_breaker?: double -} - -export type QueryDslDistanceFeatureQuery = QueryDslUntypedDistanceFeatureQuery | QueryDslGeoDistanceFeatureQuery | QueryDslDateDistanceFeatureQuery - -export interface QueryDslDistanceFeatureQueryBase extends QueryDslQueryBase { - origin: TOrigin - pivot: TDistance - field: Field -} - -export interface QueryDslExistsQuery extends QueryDslQueryBase { - field: Field -} - -export interface QueryDslFieldAndFormat { - field: Field - format?: string - include_unmapped?: boolean -} - -export interface QueryDslFieldLookup { - id: Id - index?: IndexName - path?: Field - routing?: Routing -} - -export type QueryDslFieldValueFactorModifier = 'none' | 'log' | 'log1p' | 'log2p' | 'ln' | 'ln1p' | 'ln2p' | 'square' | 'sqrt' | 'reciprocal' - -export interface QueryDslFieldValueFactorScoreFunction { - field: Field - factor?: double - missing?: double - modifier?: QueryDslFieldValueFactorModifier -} - -export type QueryDslFunctionBoostMode = 'multiply' | 'replace' | 'sum' | 'avg' | 'max' | 'min' - -export interface QueryDslFunctionScoreContainer { - exp?: QueryDslDecayFunction - gauss?: QueryDslDecayFunction - linear?: QueryDslDecayFunction - field_value_factor?: QueryDslFieldValueFactorScoreFunction - random_score?: QueryDslRandomScoreFunction - script_score?: QueryDslScriptScoreFunction - filter?: QueryDslQueryContainer - weight?: double -} - -export type QueryDslFunctionScoreMode = 'multiply' | 'sum' | 'avg' | 'first' | 'max' | 'min' - -export interface QueryDslFunctionScoreQuery extends QueryDslQueryBase { - boost_mode?: QueryDslFunctionBoostMode - functions?: QueryDslFunctionScoreContainer[] - max_boost?: double - min_score?: double - query?: QueryDslQueryContainer - score_mode?: QueryDslFunctionScoreMode -} - -export interface QueryDslFuzzyQuery extends QueryDslQueryBase { - max_expansions?: integer - prefix_length?: integer - rewrite?: MultiTermQueryRewrite - transpositions?: boolean - fuzziness?: Fuzziness - value: string | double | boolean -} - -export interface QueryDslGeoBoundingBoxQueryKeys extends QueryDslQueryBase { - type?: QueryDslGeoExecution - validation_method?: QueryDslGeoValidationMethod - ignore_unmapped?: boolean -} -export type QueryDslGeoBoundingBoxQuery = QueryDslGeoBoundingBoxQueryKeys -& { [property: string]: GeoBounds | QueryDslGeoExecution | QueryDslGeoValidationMethod | boolean | float | string } - -export interface QueryDslGeoDecayFunctionKeys extends QueryDslDecayFunctionBase { -} -export type QueryDslGeoDecayFunction = QueryDslGeoDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } - -export interface QueryDslGeoDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { -} - -export interface QueryDslGeoDistanceQueryKeys extends QueryDslQueryBase { - distance: Distance - distance_type?: GeoDistanceType - validation_method?: QueryDslGeoValidationMethod - ignore_unmapped?: boolean -} -export type QueryDslGeoDistanceQuery = QueryDslGeoDistanceQueryKeys -& { [property: string]: GeoLocation | Distance | GeoDistanceType | QueryDslGeoValidationMethod | boolean | float | string } - -export type QueryDslGeoExecution = 'memory' | 'indexed' - -export interface QueryDslGeoPolygonPoints { - points: GeoLocation[] -} - -export interface QueryDslGeoPolygonQueryKeys extends QueryDslQueryBase { - validation_method?: QueryDslGeoValidationMethod - ignore_unmapped?: boolean -} -export type QueryDslGeoPolygonQuery = QueryDslGeoPolygonQueryKeys -& { [property: string]: QueryDslGeoPolygonPoints | QueryDslGeoValidationMethod | boolean | float | string } - -export interface QueryDslGeoShapeFieldQuery { - shape?: GeoShape - indexed_shape?: QueryDslFieldLookup - relation?: GeoShapeRelation -} - -export interface QueryDslGeoShapeQueryKeys extends QueryDslQueryBase { - ignore_unmapped?: boolean -} -export type QueryDslGeoShapeQuery = QueryDslGeoShapeQueryKeys -& { [property: string]: QueryDslGeoShapeFieldQuery | boolean | float | string } - -export type QueryDslGeoValidationMethod = 'coerce' | 'ignore_malformed' | 'strict' - -export interface QueryDslHasChildQuery extends QueryDslQueryBase { - ignore_unmapped?: boolean - inner_hits?: SearchInnerHits - max_children?: integer - min_children?: integer - query: QueryDslQueryContainer - score_mode?: QueryDslChildScoreMode - type: RelationName -} - -export interface QueryDslHasParentQuery extends QueryDslQueryBase { - ignore_unmapped?: boolean - inner_hits?: SearchInnerHits - parent_type: RelationName - query: QueryDslQueryContainer - score?: boolean -} - -export interface QueryDslIdsQuery extends QueryDslQueryBase { - values?: Ids -} - -export interface QueryDslIntervalsAllOf { - intervals: QueryDslIntervalsContainer[] - max_gaps?: integer - ordered?: boolean - filter?: QueryDslIntervalsFilter -} - -export interface QueryDslIntervalsAnyOf { - intervals: QueryDslIntervalsContainer[] - filter?: QueryDslIntervalsFilter -} - -export interface QueryDslIntervalsContainer { - all_of?: QueryDslIntervalsAllOf - any_of?: QueryDslIntervalsAnyOf - fuzzy?: QueryDslIntervalsFuzzy - match?: QueryDslIntervalsMatch - prefix?: QueryDslIntervalsPrefix - wildcard?: QueryDslIntervalsWildcard -} - -export interface QueryDslIntervalsFilter { - after?: QueryDslIntervalsContainer - before?: QueryDslIntervalsContainer - contained_by?: QueryDslIntervalsContainer - containing?: QueryDslIntervalsContainer - not_contained_by?: QueryDslIntervalsContainer - not_containing?: QueryDslIntervalsContainer - not_overlapping?: QueryDslIntervalsContainer - overlapping?: QueryDslIntervalsContainer - script?: Script | string -} - -export interface QueryDslIntervalsFuzzy { - analyzer?: string - fuzziness?: Fuzziness - prefix_length?: integer - term: string - transpositions?: boolean - use_field?: Field -} - -export interface QueryDslIntervalsMatch { - analyzer?: string - max_gaps?: integer - ordered?: boolean - query: string - use_field?: Field - filter?: QueryDslIntervalsFilter -} - -export interface QueryDslIntervalsPrefix { - analyzer?: string - prefix: string - use_field?: Field -} - -export interface QueryDslIntervalsQuery extends QueryDslQueryBase { - all_of?: QueryDslIntervalsAllOf - any_of?: QueryDslIntervalsAnyOf - fuzzy?: QueryDslIntervalsFuzzy - match?: QueryDslIntervalsMatch - prefix?: QueryDslIntervalsPrefix - wildcard?: QueryDslIntervalsWildcard -} - -export interface QueryDslIntervalsWildcard { - analyzer?: string - pattern: string - use_field?: Field -} - -export type QueryDslLike = string | QueryDslLikeDocument - -export interface QueryDslLikeDocument { - doc?: any - fields?: Field[] - _id?: Id - _index?: IndexName - per_field_analyzer?: Record - routing?: Routing - version?: VersionNumber - version_type?: VersionType -} - -export interface QueryDslMatchAllQuery extends QueryDslQueryBase { -} - -export interface QueryDslMatchBoolPrefixQuery extends QueryDslQueryBase { - analyzer?: string - fuzziness?: Fuzziness - fuzzy_rewrite?: MultiTermQueryRewrite - fuzzy_transpositions?: boolean - max_expansions?: integer - minimum_should_match?: MinimumShouldMatch - operator?: QueryDslOperator - prefix_length?: integer - query: string -} - -export interface QueryDslMatchNoneQuery extends QueryDslQueryBase { -} - -export interface QueryDslMatchPhrasePrefixQuery extends QueryDslQueryBase { - analyzer?: string - max_expansions?: integer - query: string - slop?: integer - zero_terms_query?: QueryDslZeroTermsQuery -} - -export interface QueryDslMatchPhraseQuery extends QueryDslQueryBase { - analyzer?: string - query: string - slop?: integer - zero_terms_query?: QueryDslZeroTermsQuery -} - -export interface QueryDslMatchQuery extends QueryDslQueryBase { - analyzer?: string - auto_generate_synonyms_phrase_query?: boolean - cutoff_frequency?: double - fuzziness?: Fuzziness - fuzzy_rewrite?: MultiTermQueryRewrite - fuzzy_transpositions?: boolean - lenient?: boolean - max_expansions?: integer - minimum_should_match?: MinimumShouldMatch - operator?: QueryDslOperator - prefix_length?: integer - query: string | float | boolean - zero_terms_query?: QueryDslZeroTermsQuery -} - -export interface QueryDslMoreLikeThisQuery extends QueryDslQueryBase { - analyzer?: string - boost_terms?: double - fail_on_unsupported_field?: boolean - fields?: Field[] - include?: boolean - like: QueryDslLike | QueryDslLike[] - max_doc_freq?: integer - max_query_terms?: integer - max_word_length?: integer - min_doc_freq?: integer - minimum_should_match?: MinimumShouldMatch - min_term_freq?: integer - min_word_length?: integer - routing?: Routing - stop_words?: AnalysisStopWords - unlike?: QueryDslLike | QueryDslLike[] - version?: VersionNumber - version_type?: VersionType -} - -export interface QueryDslMultiMatchQuery extends QueryDslQueryBase { - analyzer?: string - auto_generate_synonyms_phrase_query?: boolean - cutoff_frequency?: double - fields?: Fields - fuzziness?: Fuzziness - fuzzy_rewrite?: MultiTermQueryRewrite - fuzzy_transpositions?: boolean - lenient?: boolean - max_expansions?: integer - minimum_should_match?: MinimumShouldMatch - operator?: QueryDslOperator - prefix_length?: integer - query: string - slop?: integer - tie_breaker?: double - type?: QueryDslTextQueryType - zero_terms_query?: QueryDslZeroTermsQuery -} - -export type QueryDslMultiValueMode = 'min' | 'max' | 'avg' | 'sum' - -export interface QueryDslNestedQuery extends QueryDslQueryBase { - ignore_unmapped?: boolean - inner_hits?: SearchInnerHits - path: Field - query: QueryDslQueryContainer - score_mode?: QueryDslChildScoreMode -} - -export interface QueryDslNumberRangeQuery extends QueryDslRangeQueryBase { -} - -export interface QueryDslNumericDecayFunctionKeys extends QueryDslDecayFunctionBase { -} -export type QueryDslNumericDecayFunction = QueryDslNumericDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } - -export type QueryDslOperator = 'and' | 'AND' | 'or' | 'OR' - -export interface QueryDslParentIdQuery extends QueryDslQueryBase { - id?: Id - ignore_unmapped?: boolean - type?: RelationName -} - -export interface QueryDslPercolateQuery extends QueryDslQueryBase { - document?: any - documents?: any[] - field: Field - id?: Id - index?: IndexName - name?: string - preference?: string - routing?: Routing - version?: VersionNumber -} - -export interface QueryDslPinnedDoc { - _id: Id - _index: IndexName -} - -export interface QueryDslPinnedQuery extends QueryDslQueryBase { - organic: QueryDslQueryContainer - ids?: Id[] - docs?: QueryDslPinnedDoc[] -} - -export interface QueryDslPrefixQuery extends QueryDslQueryBase { - rewrite?: MultiTermQueryRewrite - value: string - case_insensitive?: boolean -} - -export interface QueryDslQueryBase { - boost?: float - _name?: string -} - -export interface QueryDslQueryContainer { - bool?: QueryDslBoolQuery - boosting?: QueryDslBoostingQuery - common?: Partial> - combined_fields?: QueryDslCombinedFieldsQuery - constant_score?: QueryDslConstantScoreQuery - dis_max?: QueryDslDisMaxQuery - distance_feature?: QueryDslDistanceFeatureQuery - exists?: QueryDslExistsQuery - function_score?: QueryDslFunctionScoreQuery | QueryDslFunctionScoreContainer[] - fuzzy?: Partial> - geo_bounding_box?: QueryDslGeoBoundingBoxQuery - geo_distance?: QueryDslGeoDistanceQuery - geo_polygon?: QueryDslGeoPolygonQuery - geo_shape?: QueryDslGeoShapeQuery - has_child?: QueryDslHasChildQuery - has_parent?: QueryDslHasParentQuery - ids?: QueryDslIdsQuery - intervals?: Partial> - knn?: KnnQuery - match?: Partial> - match_all?: QueryDslMatchAllQuery - match_bool_prefix?: Partial> - match_none?: QueryDslMatchNoneQuery - match_phrase?: Partial> - match_phrase_prefix?: Partial> - more_like_this?: QueryDslMoreLikeThisQuery - multi_match?: QueryDslMultiMatchQuery - nested?: QueryDslNestedQuery - parent_id?: QueryDslParentIdQuery - percolate?: QueryDslPercolateQuery - pinned?: QueryDslPinnedQuery - prefix?: Partial> - query_string?: QueryDslQueryStringQuery - range?: Partial> - rank_feature?: QueryDslRankFeatureQuery - regexp?: Partial> - rule?: QueryDslRuleQuery - script?: QueryDslScriptQuery - script_score?: QueryDslScriptScoreQuery - semantic?: QueryDslSemanticQuery - shape?: QueryDslShapeQuery - simple_query_string?: QueryDslSimpleQueryStringQuery - span_containing?: QueryDslSpanContainingQuery - span_field_masking?: QueryDslSpanFieldMaskingQuery - span_first?: QueryDslSpanFirstQuery - span_multi?: QueryDslSpanMultiTermQuery - span_near?: QueryDslSpanNearQuery - span_not?: QueryDslSpanNotQuery - span_or?: QueryDslSpanOrQuery - span_term?: Partial> - span_within?: QueryDslSpanWithinQuery - sparse_vector?: QueryDslSparseVectorQuery - term?: Partial> - terms?: QueryDslTermsQuery - terms_set?: Partial> - text_expansion?: Partial> - weighted_tokens?: Partial> - wildcard?: Partial> - wrapper?: QueryDslWrapperQuery - type?: QueryDslTypeQuery -} - -export interface QueryDslQueryStringQuery extends QueryDslQueryBase { - allow_leading_wildcard?: boolean - analyzer?: string - analyze_wildcard?: boolean - auto_generate_synonyms_phrase_query?: boolean - default_field?: Field - default_operator?: QueryDslOperator - enable_position_increments?: boolean - escape?: boolean - fields?: Field[] - fuzziness?: Fuzziness - fuzzy_max_expansions?: integer - fuzzy_prefix_length?: integer - fuzzy_rewrite?: MultiTermQueryRewrite - fuzzy_transpositions?: boolean - lenient?: boolean - max_determinized_states?: integer - minimum_should_match?: MinimumShouldMatch - phrase_slop?: double - query: string - quote_analyzer?: string - quote_field_suffix?: string - rewrite?: MultiTermQueryRewrite - tie_breaker?: double - time_zone?: TimeZone - type?: QueryDslTextQueryType -} - -export interface QueryDslRandomScoreFunction { - field?: Field - seed?: long | string -} - -export type QueryDslRangeQuery = QueryDslUntypedRangeQuery | QueryDslDateRangeQuery | QueryDslNumberRangeQuery | QueryDslTermRangeQuery - -export interface QueryDslRangeQueryBase extends QueryDslQueryBase { - relation?: QueryDslRangeRelation - gt?: T - gte?: T - lt?: T - lte?: T - from?: T | null - to?: T | null -} - -export type QueryDslRangeRelation = 'within' | 'contains' | 'intersects' - -export interface QueryDslRankFeatureFunction { -} - -export interface QueryDslRankFeatureFunctionLinear { -} - -export interface QueryDslRankFeatureFunctionLogarithm { - scaling_factor: float -} - -export interface QueryDslRankFeatureFunctionSaturation { - pivot?: float -} - -export interface QueryDslRankFeatureFunctionSigmoid { - pivot: float - exponent: float -} - -export interface QueryDslRankFeatureQuery extends QueryDslQueryBase { - field: Field - saturation?: QueryDslRankFeatureFunctionSaturation - log?: QueryDslRankFeatureFunctionLogarithm - linear?: QueryDslRankFeatureFunctionLinear - sigmoid?: QueryDslRankFeatureFunctionSigmoid -} - -export interface QueryDslRegexpQuery extends QueryDslQueryBase { - case_insensitive?: boolean - flags?: string - max_determinized_states?: integer - rewrite?: MultiTermQueryRewrite - value: string -} - -export interface QueryDslRuleQuery extends QueryDslQueryBase { - organic: QueryDslQueryContainer - ruleset_ids: Id[] - match_criteria: any -} - -export interface QueryDslScriptQuery extends QueryDslQueryBase { - script: Script | string -} - -export interface QueryDslScriptScoreFunction { - script: Script | string -} - -export interface QueryDslScriptScoreQuery extends QueryDslQueryBase { - min_score?: float - query: QueryDslQueryContainer - script: Script | string -} - -export interface QueryDslSemanticQuery extends QueryDslQueryBase { - field: string - query: string -} - -export interface QueryDslShapeFieldQuery { - indexed_shape?: QueryDslFieldLookup - relation?: GeoShapeRelation - shape?: GeoShape -} - -export interface QueryDslShapeQueryKeys extends QueryDslQueryBase { - ignore_unmapped?: boolean -} -export type QueryDslShapeQuery = QueryDslShapeQueryKeys -& { [property: string]: QueryDslShapeFieldQuery | boolean | float | string } - -export type QueryDslSimpleQueryStringFlag = 'NONE' | 'AND' | 'NOT' | 'OR' | 'PREFIX' | 'PHRASE' | 'PRECEDENCE' | 'ESCAPE' | 'WHITESPACE' | 'FUZZY' | 'NEAR' | 'SLOP' | 'ALL' - -export type QueryDslSimpleQueryStringFlags = SpecUtilsPipeSeparatedFlags - -export interface QueryDslSimpleQueryStringQuery extends QueryDslQueryBase { - analyzer?: string - analyze_wildcard?: boolean - auto_generate_synonyms_phrase_query?: boolean - default_operator?: QueryDslOperator - fields?: Field[] - flags?: QueryDslSimpleQueryStringFlags - fuzzy_max_expansions?: integer - fuzzy_prefix_length?: integer - fuzzy_transpositions?: boolean - lenient?: boolean - minimum_should_match?: MinimumShouldMatch - query: string - quote_field_suffix?: string -} - -export interface QueryDslSpanContainingQuery extends QueryDslQueryBase { - big: QueryDslSpanQuery - little: QueryDslSpanQuery -} - -export interface QueryDslSpanFieldMaskingQuery extends QueryDslQueryBase { - field: Field - query: QueryDslSpanQuery -} - -export interface QueryDslSpanFirstQuery extends QueryDslQueryBase { - end: integer - match: QueryDslSpanQuery -} - -export type QueryDslSpanGapQuery = Partial> - -export interface QueryDslSpanMultiTermQuery extends QueryDslQueryBase { - match: QueryDslQueryContainer -} - -export interface QueryDslSpanNearQuery extends QueryDslQueryBase { - clauses: QueryDslSpanQuery[] - in_order?: boolean - slop?: integer -} - -export interface QueryDslSpanNotQuery extends QueryDslQueryBase { - dist?: integer - exclude: QueryDslSpanQuery - include: QueryDslSpanQuery - post?: integer - pre?: integer -} - -export interface QueryDslSpanOrQuery extends QueryDslQueryBase { - clauses: QueryDslSpanQuery[] -} - -export interface QueryDslSpanQuery { - span_containing?: QueryDslSpanContainingQuery - span_field_masking?: QueryDslSpanFieldMaskingQuery - span_first?: QueryDslSpanFirstQuery - span_gap?: QueryDslSpanGapQuery - span_multi?: QueryDslSpanMultiTermQuery - span_near?: QueryDslSpanNearQuery - span_not?: QueryDslSpanNotQuery - span_or?: QueryDslSpanOrQuery - span_term?: Partial> - span_within?: QueryDslSpanWithinQuery -} - -export interface QueryDslSpanTermQuery extends QueryDslQueryBase { - value: string -} - -export interface QueryDslSpanWithinQuery extends QueryDslQueryBase { - big: QueryDslSpanQuery - little: QueryDslSpanQuery -} - -export interface QueryDslSparseVectorQuery extends QueryDslQueryBase { - field: Field - query_vector?: Record - inference_id?: Id - query?: string - prune?: boolean - pruning_config?: QueryDslTokenPruningConfig -} - -export interface QueryDslTermQuery extends QueryDslQueryBase { - value: FieldValue - case_insensitive?: boolean -} - -export interface QueryDslTermRangeQuery extends QueryDslRangeQueryBase { -} - -export interface QueryDslTermsLookup { - index: IndexName - id: Id - path: Field - routing?: Routing -} - -export interface QueryDslTermsQueryKeys extends QueryDslQueryBase { -} -export type QueryDslTermsQuery = QueryDslTermsQueryKeys -& { [property: string]: QueryDslTermsQueryField | float | string } - -export type QueryDslTermsQueryField = FieldValue[] | QueryDslTermsLookup - -export interface QueryDslTermsSetQuery extends QueryDslQueryBase { - minimum_should_match?: MinimumShouldMatch - minimum_should_match_field?: Field - minimum_should_match_script?: Script | string - terms: string[] -} - -export interface QueryDslTextExpansionQuery extends QueryDslQueryBase { - model_id: string - model_text: string - pruning_config?: QueryDslTokenPruningConfig -} - -export type QueryDslTextQueryType = 'best_fields' | 'most_fields' | 'cross_fields' | 'phrase' | 'phrase_prefix' | 'bool_prefix' - -export interface QueryDslTokenPruningConfig { - tokens_freq_ratio_threshold?: integer - tokens_weight_threshold?: float - only_score_pruned_tokens?: boolean -} - -export interface QueryDslTypeQuery extends QueryDslQueryBase { - value: string -} - -export interface QueryDslUntypedDecayFunctionKeys extends QueryDslDecayFunctionBase { -} -export type QueryDslUntypedDecayFunction = QueryDslUntypedDecayFunctionKeys -& { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } - -export interface QueryDslUntypedDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { -} - -export interface QueryDslUntypedRangeQuery extends QueryDslRangeQueryBase { - format?: DateFormat - time_zone?: TimeZone -} - -export interface QueryDslWeightedTokensQuery extends QueryDslQueryBase { - tokens: Record - pruning_config?: QueryDslTokenPruningConfig -} - -export interface QueryDslWildcardQuery extends QueryDslQueryBase { - case_insensitive?: boolean - rewrite?: MultiTermQueryRewrite - value?: string - wildcard?: string -} - -export interface QueryDslWrapperQuery extends QueryDslQueryBase { - query: string -} - -export type QueryDslZeroTermsQuery = 'all' | 'none' - -export interface AsyncSearchAsyncSearch> { - aggregations?: TAggregations - _clusters?: ClusterStatistics - fields?: Record - hits: SearchHitsMetadata - max_score?: double - num_reduce_phases?: long - profile?: SearchProfile - pit_id?: Id - _scroll_id?: ScrollId - _shards: ShardStatistics - suggest?: Record[]> - terminated_early?: boolean - timed_out: boolean - took: long -} - -export interface AsyncSearchAsyncSearchDocumentResponseBase> extends AsyncSearchAsyncSearchResponseBase { - response: AsyncSearchAsyncSearch -} - -export interface AsyncSearchAsyncSearchResponseBase { - id?: Id - is_partial: boolean - is_running: boolean - expiration_time?: DateTime - expiration_time_in_millis: EpochTime - start_time?: DateTime - start_time_in_millis: EpochTime - completion_time?: DateTime - completion_time_in_millis?: EpochTime -} - -export interface AsyncSearchDeleteRequest extends RequestBase { - id: Id -} - -export type AsyncSearchDeleteResponse = AcknowledgedResponseBase - -export interface AsyncSearchGetRequest extends RequestBase { - id: Id - keep_alive?: Duration - typed_keys?: boolean - wait_for_completion_timeout?: Duration -} - -export type AsyncSearchGetResponse> = AsyncSearchAsyncSearchDocumentResponseBase - -export interface AsyncSearchStatusRequest extends RequestBase { - id: Id - keep_alive?: Duration -} - -export type AsyncSearchStatusResponse = AsyncSearchStatusStatusResponseBase - -export interface AsyncSearchStatusStatusResponseBase extends AsyncSearchAsyncSearchResponseBase { - _shards: ShardStatistics - _clusters?: ClusterStatistics - completion_status?: integer -} - -export interface AsyncSearchSubmitRequest extends RequestBase { - index?: Indices - wait_for_completion_timeout?: Duration - keep_on_completion?: boolean - keep_alive?: Duration - allow_no_indices?: boolean - allow_partial_search_results?: boolean - analyzer?: string - analyze_wildcard?: boolean - batched_reduce_size?: long - ccs_minimize_roundtrips?: boolean - default_operator?: QueryDslOperator - df?: string - expand_wildcards?: ExpandWildcards - ignore_throttled?: boolean - ignore_unavailable?: boolean - lenient?: boolean - max_concurrent_shard_requests?: long - min_compatible_shard_node?: VersionString - preference?: string - pre_filter_shard_size?: long - request_cache?: boolean - routing?: Routing - search_type?: SearchType - suggest_field?: Field - suggest_mode?: SuggestMode - suggest_size?: long - suggest_text?: string - typed_keys?: boolean - rest_total_hits_as_int?: boolean - _source_excludes?: Fields - _source_includes?: Fields - q?: string - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - aggregations?: Record - /** @alias aggregations */ - aggs?: Record - collapse?: SearchFieldCollapse - explain?: boolean - ext?: Record - from?: integer - highlight?: SearchHighlight - track_total_hits?: SearchTrackHits - indices_boost?: Record[] - docvalue_fields?: (QueryDslFieldAndFormat | Field)[] - knn?: KnnSearch | KnnSearch[] - min_score?: double - post_filter?: QueryDslQueryContainer - profile?: boolean - query?: QueryDslQueryContainer - rescore?: SearchRescore | SearchRescore[] - script_fields?: Record - search_after?: SortResults - size?: integer - slice?: SlicedScroll - sort?: Sort - _source?: SearchSourceConfig - fields?: (QueryDslFieldAndFormat | Field)[] - suggest?: SearchSuggester - terminate_after?: long - timeout?: string - track_scores?: boolean - version?: boolean - seq_no_primary_term?: boolean - stored_fields?: Fields - pit?: SearchPointInTimeReference - runtime_mappings?: MappingRuntimeFields - stats?: string[] - } -} - -export type AsyncSearchSubmitResponse> = AsyncSearchAsyncSearchDocumentResponseBase - -export interface AutoscalingAutoscalingPolicy { - roles: string[] - deciders: Record -} - -export interface AutoscalingDeleteAutoscalingPolicyRequest extends RequestBase { - name: Name - master_timeout?: Duration - timeout?: Duration -} - -export type AutoscalingDeleteAutoscalingPolicyResponse = AcknowledgedResponseBase - -export interface AutoscalingGetAutoscalingCapacityAutoscalingCapacity { - node: AutoscalingGetAutoscalingCapacityAutoscalingResources - total: AutoscalingGetAutoscalingCapacityAutoscalingResources -} - -export interface AutoscalingGetAutoscalingCapacityAutoscalingDecider { - required_capacity: AutoscalingGetAutoscalingCapacityAutoscalingCapacity - reason_summary?: string - reason_details?: any -} - -export interface AutoscalingGetAutoscalingCapacityAutoscalingDeciders { - required_capacity: AutoscalingGetAutoscalingCapacityAutoscalingCapacity - current_capacity: AutoscalingGetAutoscalingCapacityAutoscalingCapacity - current_nodes: AutoscalingGetAutoscalingCapacityAutoscalingNode[] - deciders: Record -} - -export interface AutoscalingGetAutoscalingCapacityAutoscalingNode { - name: NodeName -} - -export interface AutoscalingGetAutoscalingCapacityAutoscalingResources { - storage: integer - memory: integer -} - -export interface AutoscalingGetAutoscalingCapacityRequest extends RequestBase { - master_timeout?: Duration -} - -export interface AutoscalingGetAutoscalingCapacityResponse { - policies: Record -} - -export interface AutoscalingGetAutoscalingPolicyRequest extends RequestBase { - name: Name - master_timeout?: Duration -} - -export type AutoscalingGetAutoscalingPolicyResponse = AutoscalingAutoscalingPolicy - -export interface AutoscalingPutAutoscalingPolicyRequest extends RequestBase { - name: Name - master_timeout?: Duration - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, use 'policy' instead. */ - body?: AutoscalingAutoscalingPolicy -} - -export type AutoscalingPutAutoscalingPolicyResponse = AcknowledgedResponseBase - -export type CatCatAnomalyDetectorColumn = 'assignment_explanation' | 'ae' | 'buckets.count' | 'bc' | 'bucketsCount' | 'buckets.time.exp_avg' | 'btea' | 'bucketsTimeExpAvg' | 'buckets.time.exp_avg_hour' | 'bteah' | 'bucketsTimeExpAvgHour' | 'buckets.time.max' | 'btmax' | 'bucketsTimeMax' | 'buckets.time.min' | 'btmin' | 'bucketsTimeMin' | 'buckets.time.total' | 'btt' | 'bucketsTimeTotal' | 'data.buckets' | 'db' | 'dataBuckets' | 'data.earliest_record' | 'der' | 'dataEarliestRecord' | 'data.empty_buckets' | 'deb' | 'dataEmptyBuckets' | 'data.input_bytes' | 'dib' | 'dataInputBytes' | 'data.input_fields' | 'dif' | 'dataInputFields' | 'data.input_records' | 'dir' | 'dataInputRecords' | 'data.invalid_dates' | 'did' | 'dataInvalidDates' | 'data.last' | 'dl' | 'dataLast' | 'data.last_empty_bucket' | 'dleb' | 'dataLastEmptyBucket' | 'data.last_sparse_bucket' | 'dlsb' | 'dataLastSparseBucket' | 'data.latest_record' | 'dlr' | 'dataLatestRecord' | 'data.missing_fields' | 'dmf' | 'dataMissingFields' | 'data.out_of_order_timestamps' | 'doot' | 'dataOutOfOrderTimestamps' | 'data.processed_fields' | 'dpf' | 'dataProcessedFields' | 'data.processed_records' | 'dpr' | 'dataProcessedRecords' | 'data.sparse_buckets' | 'dsb' | 'dataSparseBuckets' | 'forecasts.memory.avg' | 'fmavg' | 'forecastsMemoryAvg' | 'forecasts.memory.max' | 'fmmax' | 'forecastsMemoryMax' | 'forecasts.memory.min' | 'fmmin' | 'forecastsMemoryMin' | 'forecasts.memory.total' | 'fmt' | 'forecastsMemoryTotal' | 'forecasts.records.avg' | 'fravg' | 'forecastsRecordsAvg' | 'forecasts.records.max' | 'frmax' | 'forecastsRecordsMax' | 'forecasts.records.min' | 'frmin' | 'forecastsRecordsMin' | 'forecasts.records.total' | 'frt' | 'forecastsRecordsTotal' | 'forecasts.time.avg' | 'ftavg' | 'forecastsTimeAvg' | 'forecasts.time.max' | 'ftmax' | 'forecastsTimeMax' | 'forecasts.time.min' | 'ftmin' | 'forecastsTimeMin' | 'forecasts.time.total' | 'ftt' | 'forecastsTimeTotal' | 'forecasts.total' | 'ft' | 'forecastsTotal' | 'id' | 'model.bucket_allocation_failures' | 'mbaf' | 'modelBucketAllocationFailures' | 'model.by_fields' | 'mbf' | 'modelByFields' | 'model.bytes' | 'mb' | 'modelBytes' | 'model.bytes_exceeded' | 'mbe' | 'modelBytesExceeded' | 'model.categorization_status' | 'mcs' | 'modelCategorizationStatus' | 'model.categorized_doc_count' | 'mcdc' | 'modelCategorizedDocCount' | 'model.dead_category_count' | 'mdcc' | 'modelDeadCategoryCount' | 'model.failed_category_count' | 'mdcc' | 'modelFailedCategoryCount' | 'model.frequent_category_count' | 'mfcc' | 'modelFrequentCategoryCount' | 'model.log_time' | 'mlt' | 'modelLogTime' | 'model.memory_limit' | 'mml' | 'modelMemoryLimit' | 'model.memory_status' | 'mms' | 'modelMemoryStatus' | 'model.over_fields' | 'mof' | 'modelOverFields' | 'model.partition_fields' | 'mpf' | 'modelPartitionFields' | 'model.rare_category_count' | 'mrcc' | 'modelRareCategoryCount' | 'model.timestamp' | 'mt' | 'modelTimestamp' | 'model.total_category_count' | 'mtcc' | 'modelTotalCategoryCount' | 'node.address' | 'na' | 'nodeAddress' | 'node.ephemeral_id' | 'ne' | 'nodeEphemeralId' | 'node.id' | 'ni' | 'nodeId' | 'node.name' | 'nn' | 'nodeName' | 'opened_time' | 'ot' | 'state' | 's' - -export type CatCatAnonalyDetectorColumns = CatCatAnomalyDetectorColumn | CatCatAnomalyDetectorColumn[] - -export type CatCatDatafeedColumn = 'ae' | 'assignment_explanation' | 'bc' | 'buckets.count' | 'bucketsCount' | 'id' | 'na' | 'node.address' | 'nodeAddress' | 'ne' | 'node.ephemeral_id' | 'nodeEphemeralId' | 'ni' | 'node.id' | 'nodeId' | 'nn' | 'node.name' | 'nodeName' | 'sba' | 'search.bucket_avg' | 'searchBucketAvg' | 'sc' | 'search.count' | 'searchCount' | 'seah' | 'search.exp_avg_hour' | 'searchExpAvgHour' | 'st' | 'search.time' | 'searchTime' | 's' | 'state' - -export type CatCatDatafeedColumns = CatCatDatafeedColumn | CatCatDatafeedColumn[] - -export type CatCatDfaColumn = 'assignment_explanation' | 'ae' | 'create_time' | 'ct' | 'createTime' | 'description' | 'd' | 'dest_index' | 'di' | 'destIndex' | 'failure_reason' | 'fr' | 'failureReason' | 'id' | 'model_memory_limit' | 'mml' | 'modelMemoryLimit' | 'node.address' | 'na' | 'nodeAddress' | 'node.ephemeral_id' | 'ne' | 'nodeEphemeralId' | 'node.id' | 'ni' | 'nodeId' | 'node.name' | 'nn' | 'nodeName' | 'progress' | 'p' | 'source_index' | 'si' | 'sourceIndex' | 'state' | 's' | 'type' | 't' | 'version' | 'v' - -export type CatCatDfaColumns = CatCatDfaColumn | CatCatDfaColumn[] - -export interface CatCatRequestBase extends RequestBase, SpecUtilsCommonCatQueryParameters { -} - -export type CatCatTrainedModelsColumn = 'create_time' | 'ct' | 'created_by' | 'c' | 'createdBy' | 'data_frame_analytics_id' | 'df' | 'dataFrameAnalytics' | 'dfid' | 'description' | 'd' | 'heap_size' | 'hs' | 'modelHeapSize' | 'id' | 'ingest.count' | 'ic' | 'ingestCount' | 'ingest.current' | 'icurr' | 'ingestCurrent' | 'ingest.failed' | 'if' | 'ingestFailed' | 'ingest.pipelines' | 'ip' | 'ingestPipelines' | 'ingest.time' | 'it' | 'ingestTime' | 'license' | 'l' | 'operations' | 'o' | 'modelOperations' | 'version' | 'v' - -export type CatCatTrainedModelsColumns = CatCatTrainedModelsColumn | CatCatTrainedModelsColumn[] - -export type CatCatTransformColumn = 'changes_last_detection_time' | 'cldt' | 'checkpoint' | 'cp' | 'checkpoint_duration_time_exp_avg' | 'cdtea' | 'checkpointTimeExpAvg' | 'checkpoint_progress' | 'c' | 'checkpointProgress' | 'create_time' | 'ct' | 'createTime' | 'delete_time' | 'dtime' | 'description' | 'd' | 'dest_index' | 'di' | 'destIndex' | 'documents_deleted' | 'docd' | 'documents_indexed' | 'doci' | 'docs_per_second' | 'dps' | 'documents_processed' | 'docp' | 'frequency' | 'f' | 'id' | 'index_failure' | 'if' | 'index_time' | 'itime' | 'index_total' | 'it' | 'indexed_documents_exp_avg' | 'idea' | 'last_search_time' | 'lst' | 'lastSearchTime' | 'max_page_search_size' | 'mpsz' | 'pages_processed' | 'pp' | 'pipeline' | 'p' | 'processed_documents_exp_avg' | 'pdea' | 'processing_time' | 'pt' | 'reason' | 'r' | 'search_failure' | 'sf' | 'search_time' | 'stime' | 'search_total' | 'st' | 'source_index' | 'si' | 'sourceIndex' | 'state' | 's' | 'transform_type' | 'tt' | 'trigger_count' | 'tc' | 'version' | 'v' - -export type CatCatTransformColumns = CatCatTransformColumn | CatCatTransformColumn[] - -export interface CatAliasesAliasesRecord { - alias?: string - a?: string - index?: IndexName - i?: IndexName - idx?: IndexName - filter?: string - f?: string - fi?: string - 'routing.index'?: string - ri?: string - routingIndex?: string - 'routing.search'?: string - rs?: string - routingSearch?: string - is_write_index?: string - w?: string - isWriteIndex?: string -} - -export interface CatAliasesRequest extends CatCatRequestBase { - name?: Names - expand_wildcards?: ExpandWildcards -} - -export type CatAliasesResponse = CatAliasesAliasesRecord[] - -export interface CatAllocationAllocationRecord { - shards?: string - s?: string - 'shards.undesired'?: string | null - 'write_load.forecast'?: SpecUtilsStringified | null - wlf?: SpecUtilsStringified | null - writeLoadForecast?: SpecUtilsStringified | null - 'disk.indices.forecast'?: ByteSize | null - dif?: ByteSize | null - diskIndicesForecast?: ByteSize | null - 'disk.indices'?: ByteSize | null - di?: ByteSize | null - diskIndices?: ByteSize | null - 'disk.used'?: ByteSize | null - du?: ByteSize | null - diskUsed?: ByteSize | null - 'disk.avail'?: ByteSize | null - da?: ByteSize | null - diskAvail?: ByteSize | null - 'disk.total'?: ByteSize | null - dt?: ByteSize | null - diskTotal?: ByteSize | null - 'disk.percent'?: Percentage | null - dp?: Percentage | null - diskPercent?: Percentage | null - host?: Host | null - h?: Host | null - ip?: Ip | null - node?: string - n?: string - 'node.role'?: string | null - r?: string | null - role?: string | null - nodeRole?: string | null -} - -export interface CatAllocationRequest extends CatCatRequestBase { - node_id?: NodeIds - bytes?: Bytes -} - -export type CatAllocationResponse = CatAllocationAllocationRecord[] - -export interface CatComponentTemplatesComponentTemplate { - name: string - version: string - alias_count: string - mapping_count: string - settings_count: string - metadata_count: string - included_in: string -} - -export interface CatComponentTemplatesRequest extends CatCatRequestBase { - name?: string -} - -export type CatComponentTemplatesResponse = CatComponentTemplatesComponentTemplate[] - -export interface CatCountCountRecord { - epoch?: SpecUtilsStringified> - t?: SpecUtilsStringified> - time?: SpecUtilsStringified> - timestamp?: TimeOfDay - ts?: TimeOfDay - hms?: TimeOfDay - hhmmss?: TimeOfDay - count?: string - dc?: string - 'docs.count'?: string - docsCount?: string -} - -export interface CatCountRequest extends CatCatRequestBase { - index?: Indices -} - -export type CatCountResponse = CatCountCountRecord[] - -export interface CatFielddataFielddataRecord { - id?: string - host?: string - h?: string - ip?: string - node?: string - n?: string - field?: string - f?: string - size?: string -} - -export interface CatFielddataRequest extends CatCatRequestBase { - fields?: Fields - bytes?: Bytes -} - -export type CatFielddataResponse = CatFielddataFielddataRecord[] - -export interface CatHealthHealthRecord { - epoch?: SpecUtilsStringified> - time?: SpecUtilsStringified> - timestamp?: TimeOfDay - ts?: TimeOfDay - hms?: TimeOfDay - hhmmss?: TimeOfDay - cluster?: string - cl?: string - status?: string - st?: string - 'node.total'?: string - nt?: string - nodeTotal?: string - 'node.data'?: string - nd?: string - nodeData?: string - shards?: string - t?: string - sh?: string - 'shards.total'?: string - shardsTotal?: string - pri?: string - p?: string - 'shards.primary'?: string - shardsPrimary?: string - relo?: string - r?: string - 'shards.relocating'?: string - shardsRelocating?: string - init?: string - i?: string - 'shards.initializing'?: string - shardsInitializing?: string - 'unassign.pri'?: string - up?: string - 'shards.unassigned.primary'?: string - shardsUnassignedPrimary?: string - unassign?: string - u?: string - 'shards.unassigned'?: string - shardsUnassigned?: string - pending_tasks?: string - pt?: string - pendingTasks?: string - max_task_wait_time?: string - mtwt?: string - maxTaskWaitTime?: string - active_shards_percent?: string - asp?: string - activeShardsPercent?: string -} - -export interface CatHealthRequest extends CatCatRequestBase { - time?: TimeUnit - ts?: boolean -} - -export type CatHealthResponse = CatHealthHealthRecord[] - -export interface CatHelpHelpRecord { - endpoint: string -} - -export interface CatHelpRequest extends CatCatRequestBase { -} - -export type CatHelpResponse = CatHelpHelpRecord[] - -export interface CatIndicesIndicesRecord { - health?: string - h?: string - status?: string - s?: string - index?: string - i?: string - idx?: string - uuid?: string - id?: string - pri?: string - p?: string - 'shards.primary'?: string - shardsPrimary?: string - rep?: string - r?: string - 'shards.replica'?: string - shardsReplica?: string - 'docs.count'?: string | null - dc?: string | null - docsCount?: string | null - 'docs.deleted'?: string | null - dd?: string | null - docsDeleted?: string | null - 'creation.date'?: string - cd?: string - 'creation.date.string'?: string - cds?: string - 'store.size'?: string | null - ss?: string | null - storeSize?: string | null - 'pri.store.size'?: string | null - 'dataset.size'?: string | null - 'completion.size'?: string - cs?: string - completionSize?: string - 'pri.completion.size'?: string - 'fielddata.memory_size'?: string - fm?: string - fielddataMemory?: string - 'pri.fielddata.memory_size'?: string - 'fielddata.evictions'?: string - fe?: string - fielddataEvictions?: string - 'pri.fielddata.evictions'?: string - 'query_cache.memory_size'?: string - qcm?: string - queryCacheMemory?: string - 'pri.query_cache.memory_size'?: string - 'query_cache.evictions'?: string - qce?: string - queryCacheEvictions?: string - 'pri.query_cache.evictions'?: string - 'request_cache.memory_size'?: string - rcm?: string - requestCacheMemory?: string - 'pri.request_cache.memory_size'?: string - 'request_cache.evictions'?: string - rce?: string - requestCacheEvictions?: string - 'pri.request_cache.evictions'?: string - 'request_cache.hit_count'?: string - rchc?: string - requestCacheHitCount?: string - 'pri.request_cache.hit_count'?: string - 'request_cache.miss_count'?: string - rcmc?: string - requestCacheMissCount?: string - 'pri.request_cache.miss_count'?: string - 'flush.total'?: string - ft?: string - flushTotal?: string - 'pri.flush.total'?: string - 'flush.total_time'?: string - ftt?: string - flushTotalTime?: string - 'pri.flush.total_time'?: string - 'get.current'?: string - gc?: string - getCurrent?: string - 'pri.get.current'?: string - 'get.time'?: string - gti?: string - getTime?: string - 'pri.get.time'?: string - 'get.total'?: string - gto?: string - getTotal?: string - 'pri.get.total'?: string - 'get.exists_time'?: string - geti?: string - getExistsTime?: string - 'pri.get.exists_time'?: string - 'get.exists_total'?: string - geto?: string - getExistsTotal?: string - 'pri.get.exists_total'?: string - 'get.missing_time'?: string - gmti?: string - getMissingTime?: string - 'pri.get.missing_time'?: string - 'get.missing_total'?: string - gmto?: string - getMissingTotal?: string - 'pri.get.missing_total'?: string - 'indexing.delete_current'?: string - idc?: string - indexingDeleteCurrent?: string - 'pri.indexing.delete_current'?: string - 'indexing.delete_time'?: string - idti?: string - indexingDeleteTime?: string - 'pri.indexing.delete_time'?: string - 'indexing.delete_total'?: string - idto?: string - indexingDeleteTotal?: string - 'pri.indexing.delete_total'?: string - 'indexing.index_current'?: string - iic?: string - indexingIndexCurrent?: string - 'pri.indexing.index_current'?: string - 'indexing.index_time'?: string - iiti?: string - indexingIndexTime?: string - 'pri.indexing.index_time'?: string - 'indexing.index_total'?: string - iito?: string - indexingIndexTotal?: string - 'pri.indexing.index_total'?: string - 'indexing.index_failed'?: string - iif?: string - indexingIndexFailed?: string - 'pri.indexing.index_failed'?: string - 'merges.current'?: string - mc?: string - mergesCurrent?: string - 'pri.merges.current'?: string - 'merges.current_docs'?: string - mcd?: string - mergesCurrentDocs?: string - 'pri.merges.current_docs'?: string - 'merges.current_size'?: string - mcs?: string - mergesCurrentSize?: string - 'pri.merges.current_size'?: string - 'merges.total'?: string - mt?: string - mergesTotal?: string - 'pri.merges.total'?: string - 'merges.total_docs'?: string - mtd?: string - mergesTotalDocs?: string - 'pri.merges.total_docs'?: string - 'merges.total_size'?: string - mts?: string - mergesTotalSize?: string - 'pri.merges.total_size'?: string - 'merges.total_time'?: string - mtt?: string - mergesTotalTime?: string - 'pri.merges.total_time'?: string - 'refresh.total'?: string - rto?: string - refreshTotal?: string - 'pri.refresh.total'?: string - 'refresh.time'?: string - rti?: string - refreshTime?: string - 'pri.refresh.time'?: string - 'refresh.external_total'?: string - reto?: string - 'pri.refresh.external_total'?: string - 'refresh.external_time'?: string - reti?: string - 'pri.refresh.external_time'?: string - 'refresh.listeners'?: string - rli?: string - refreshListeners?: string - 'pri.refresh.listeners'?: string - 'search.fetch_current'?: string - sfc?: string - searchFetchCurrent?: string - 'pri.search.fetch_current'?: string - 'search.fetch_time'?: string - sfti?: string - searchFetchTime?: string - 'pri.search.fetch_time'?: string - 'search.fetch_total'?: string - sfto?: string - searchFetchTotal?: string - 'pri.search.fetch_total'?: string - 'search.open_contexts'?: string - so?: string - searchOpenContexts?: string - 'pri.search.open_contexts'?: string - 'search.query_current'?: string - sqc?: string - searchQueryCurrent?: string - 'pri.search.query_current'?: string - 'search.query_time'?: string - sqti?: string - searchQueryTime?: string - 'pri.search.query_time'?: string - 'search.query_total'?: string - sqto?: string - searchQueryTotal?: string - 'pri.search.query_total'?: string - 'search.scroll_current'?: string - scc?: string - searchScrollCurrent?: string - 'pri.search.scroll_current'?: string - 'search.scroll_time'?: string - scti?: string - searchScrollTime?: string - 'pri.search.scroll_time'?: string - 'search.scroll_total'?: string - scto?: string - searchScrollTotal?: string - 'pri.search.scroll_total'?: string - 'segments.count'?: string - sc?: string - segmentsCount?: string - 'pri.segments.count'?: string - 'segments.memory'?: string - sm?: string - segmentsMemory?: string - 'pri.segments.memory'?: string - 'segments.index_writer_memory'?: string - siwm?: string - segmentsIndexWriterMemory?: string - 'pri.segments.index_writer_memory'?: string - 'segments.version_map_memory'?: string - svmm?: string - segmentsVersionMapMemory?: string - 'pri.segments.version_map_memory'?: string - 'segments.fixed_bitset_memory'?: string - sfbm?: string - fixedBitsetMemory?: string - 'pri.segments.fixed_bitset_memory'?: string - 'warmer.current'?: string - wc?: string - warmerCurrent?: string - 'pri.warmer.current'?: string - 'warmer.total'?: string - wto?: string - warmerTotal?: string - 'pri.warmer.total'?: string - 'warmer.total_time'?: string - wtt?: string - warmerTotalTime?: string - 'pri.warmer.total_time'?: string - 'suggest.current'?: string - suc?: string - suggestCurrent?: string - 'pri.suggest.current'?: string - 'suggest.time'?: string - suti?: string - suggestTime?: string - 'pri.suggest.time'?: string - 'suggest.total'?: string - suto?: string - suggestTotal?: string - 'pri.suggest.total'?: string - 'memory.total'?: string - tm?: string - memoryTotal?: string - 'pri.memory.total'?: string - 'search.throttled'?: string - sth?: string - 'bulk.total_operations'?: string - bto?: string - bulkTotalOperation?: string - 'pri.bulk.total_operations'?: string - 'bulk.total_time'?: string - btti?: string - bulkTotalTime?: string - 'pri.bulk.total_time'?: string - 'bulk.total_size_in_bytes'?: string - btsi?: string - bulkTotalSizeInBytes?: string - 'pri.bulk.total_size_in_bytes'?: string - 'bulk.avg_time'?: string - bati?: string - bulkAvgTime?: string - 'pri.bulk.avg_time'?: string - 'bulk.avg_size_in_bytes'?: string - basi?: string - bulkAvgSizeInBytes?: string - 'pri.bulk.avg_size_in_bytes'?: string -} - -export interface CatIndicesRequest extends CatCatRequestBase { - index?: Indices - bytes?: Bytes - expand_wildcards?: ExpandWildcards - health?: HealthStatus - include_unloaded_segments?: boolean - pri?: boolean - time?: TimeUnit -} - -export type CatIndicesResponse = CatIndicesIndicesRecord[] - -export interface CatMasterMasterRecord { - id?: string - host?: string - h?: string - ip?: string - node?: string - n?: string -} - -export interface CatMasterRequest extends CatCatRequestBase { -} - -export type CatMasterResponse = CatMasterMasterRecord[] - -export interface CatMlDataFrameAnalyticsDataFrameAnalyticsRecord { - id?: Id - type?: string - t?: string - create_time?: string - ct?: string - createTime?: string - version?: VersionString - v?: VersionString - source_index?: IndexName - si?: IndexName - sourceIndex?: IndexName - dest_index?: IndexName - di?: IndexName - destIndex?: IndexName - description?: string - d?: string - model_memory_limit?: string - mml?: string - modelMemoryLimit?: string - state?: string - s?: string - failure_reason?: string - fr?: string - failureReason?: string - progress?: string - p?: string - assignment_explanation?: string - ae?: string - assignmentExplanation?: string - 'node.id'?: Id - ni?: Id - nodeId?: Id - 'node.name'?: Name - nn?: Name - nodeName?: Name - 'node.ephemeral_id'?: Id - ne?: Id - nodeEphemeralId?: Id - 'node.address'?: string - na?: string - nodeAddress?: string -} - -export interface CatMlDataFrameAnalyticsRequest extends CatCatRequestBase { - id?: Id - allow_no_match?: boolean - bytes?: Bytes - h?: CatCatDfaColumns - s?: CatCatDfaColumns - time?: Duration -} - -export type CatMlDataFrameAnalyticsResponse = CatMlDataFrameAnalyticsDataFrameAnalyticsRecord[] - -export interface CatMlDatafeedsDatafeedsRecord { - id?: string - state?: MlDatafeedState - s?: MlDatafeedState - assignment_explanation?: string - ae?: string - 'buckets.count'?: string - bc?: string - bucketsCount?: string - 'search.count'?: string - sc?: string - searchCount?: string - 'search.time'?: string - st?: string - searchTime?: string - 'search.bucket_avg'?: string - sba?: string - searchBucketAvg?: string - 'search.exp_avg_hour'?: string - seah?: string - searchExpAvgHour?: string - 'node.id'?: string - ni?: string - nodeId?: string - 'node.name'?: string - nn?: string - nodeName?: string - 'node.ephemeral_id'?: string - ne?: string - nodeEphemeralId?: string - 'node.address'?: string - na?: string - nodeAddress?: string -} - -export interface CatMlDatafeedsRequest extends CatCatRequestBase { - datafeed_id?: Id - allow_no_match?: boolean - h?: CatCatDatafeedColumns - s?: CatCatDatafeedColumns - time?: TimeUnit -} - -export type CatMlDatafeedsResponse = CatMlDatafeedsDatafeedsRecord[] - -export interface CatMlJobsJobsRecord { - id?: Id - state?: MlJobState - s?: MlJobState - opened_time?: string - ot?: string - assignment_explanation?: string - ae?: string - 'data.processed_records'?: string - dpr?: string - dataProcessedRecords?: string - 'data.processed_fields'?: string - dpf?: string - dataProcessedFields?: string - 'data.input_bytes'?: ByteSize - dib?: ByteSize - dataInputBytes?: ByteSize - 'data.input_records'?: string - dir?: string - dataInputRecords?: string - 'data.input_fields'?: string - dif?: string - dataInputFields?: string - 'data.invalid_dates'?: string - did?: string - dataInvalidDates?: string - 'data.missing_fields'?: string - dmf?: string - dataMissingFields?: string - 'data.out_of_order_timestamps'?: string - doot?: string - dataOutOfOrderTimestamps?: string - 'data.empty_buckets'?: string - deb?: string - dataEmptyBuckets?: string - 'data.sparse_buckets'?: string - dsb?: string - dataSparseBuckets?: string - 'data.buckets'?: string - db?: string - dataBuckets?: string - 'data.earliest_record'?: string - der?: string - dataEarliestRecord?: string - 'data.latest_record'?: string - dlr?: string - dataLatestRecord?: string - 'data.last'?: string - dl?: string - dataLast?: string - 'data.last_empty_bucket'?: string - dleb?: string - dataLastEmptyBucket?: string - 'data.last_sparse_bucket'?: string - dlsb?: string - dataLastSparseBucket?: string - 'model.bytes'?: ByteSize - mb?: ByteSize - modelBytes?: ByteSize - 'model.memory_status'?: MlMemoryStatus - mms?: MlMemoryStatus - modelMemoryStatus?: MlMemoryStatus - 'model.bytes_exceeded'?: ByteSize - mbe?: ByteSize - modelBytesExceeded?: ByteSize - 'model.memory_limit'?: string - mml?: string - modelMemoryLimit?: string - 'model.by_fields'?: string - mbf?: string - modelByFields?: string - 'model.over_fields'?: string - mof?: string - modelOverFields?: string - 'model.partition_fields'?: string - mpf?: string - modelPartitionFields?: string - 'model.bucket_allocation_failures'?: string - mbaf?: string - modelBucketAllocationFailures?: string - 'model.categorization_status'?: MlCategorizationStatus - mcs?: MlCategorizationStatus - modelCategorizationStatus?: MlCategorizationStatus - 'model.categorized_doc_count'?: string - mcdc?: string - modelCategorizedDocCount?: string - 'model.total_category_count'?: string - mtcc?: string - modelTotalCategoryCount?: string - 'model.frequent_category_count'?: string - modelFrequentCategoryCount?: string - 'model.rare_category_count'?: string - mrcc?: string - modelRareCategoryCount?: string - 'model.dead_category_count'?: string - mdcc?: string - modelDeadCategoryCount?: string - 'model.failed_category_count'?: string - mfcc?: string - modelFailedCategoryCount?: string - 'model.log_time'?: string - mlt?: string - modelLogTime?: string - 'model.timestamp'?: string - mt?: string - modelTimestamp?: string - 'forecasts.total'?: string - ft?: string - forecastsTotal?: string - 'forecasts.memory.min'?: string - fmmin?: string - forecastsMemoryMin?: string - 'forecasts.memory.max'?: string - fmmax?: string - forecastsMemoryMax?: string - 'forecasts.memory.avg'?: string - fmavg?: string - forecastsMemoryAvg?: string - 'forecasts.memory.total'?: string - fmt?: string - forecastsMemoryTotal?: string - 'forecasts.records.min'?: string - frmin?: string - forecastsRecordsMin?: string - 'forecasts.records.max'?: string - frmax?: string - forecastsRecordsMax?: string - 'forecasts.records.avg'?: string - fravg?: string - forecastsRecordsAvg?: string - 'forecasts.records.total'?: string - frt?: string - forecastsRecordsTotal?: string - 'forecasts.time.min'?: string - ftmin?: string - forecastsTimeMin?: string - 'forecasts.time.max'?: string - ftmax?: string - forecastsTimeMax?: string - 'forecasts.time.avg'?: string - ftavg?: string - forecastsTimeAvg?: string - 'forecasts.time.total'?: string - ftt?: string - forecastsTimeTotal?: string - 'node.id'?: NodeId - ni?: NodeId - nodeId?: NodeId - 'node.name'?: string - nn?: string - nodeName?: string - 'node.ephemeral_id'?: NodeId - ne?: NodeId - nodeEphemeralId?: NodeId - 'node.address'?: string - na?: string - nodeAddress?: string - 'buckets.count'?: string - bc?: string - bucketsCount?: string - 'buckets.time.total'?: string - btt?: string - bucketsTimeTotal?: string - 'buckets.time.min'?: string - btmin?: string - bucketsTimeMin?: string - 'buckets.time.max'?: string - btmax?: string - bucketsTimeMax?: string - 'buckets.time.exp_avg'?: string - btea?: string - bucketsTimeExpAvg?: string - 'buckets.time.exp_avg_hour'?: string - bteah?: string - bucketsTimeExpAvgHour?: string -} - -export interface CatMlJobsRequest extends CatCatRequestBase { - job_id?: Id - allow_no_match?: boolean - bytes?: Bytes - h?: CatCatAnonalyDetectorColumns - s?: CatCatAnonalyDetectorColumns - time?: TimeUnit -} - -export type CatMlJobsResponse = CatMlJobsJobsRecord[] - -export interface CatMlTrainedModelsRequest extends CatCatRequestBase { - model_id?: Id - allow_no_match?: boolean - bytes?: Bytes - h?: CatCatTrainedModelsColumns - s?: CatCatTrainedModelsColumns - from?: integer - size?: integer -} - -export type CatMlTrainedModelsResponse = CatMlTrainedModelsTrainedModelsRecord[] - -export interface CatMlTrainedModelsTrainedModelsRecord { - id?: Id - created_by?: string - c?: string - createdBy?: string - heap_size?: ByteSize - hs?: ByteSize - modelHeapSize?: ByteSize - operations?: string - o?: string - modelOperations?: string - license?: string - l?: string - create_time?: DateTime - ct?: DateTime - version?: VersionString - v?: VersionString - description?: string - d?: string - 'ingest.pipelines'?: string - ip?: string - ingestPipelines?: string - 'ingest.count'?: string - ic?: string - ingestCount?: string - 'ingest.time'?: string - it?: string - ingestTime?: string - 'ingest.current'?: string - icurr?: string - ingestCurrent?: string - 'ingest.failed'?: string - if?: string - ingestFailed?: string - 'data_frame.id'?: string - dfid?: string - dataFrameAnalytics?: string - 'data_frame.create_time'?: string - dft?: string - dataFrameAnalyticsTime?: string - 'data_frame.source_index'?: string - dfsi?: string - dataFrameAnalyticsSrcIndex?: string - 'data_frame.analysis'?: string - dfa?: string - dataFrameAnalyticsAnalysis?: string - type?: string -} - -export interface CatNodeattrsNodeAttributesRecord { - node?: string - id?: string - pid?: string - host?: string - h?: string - ip?: string - i?: string - port?: string - attr?: string - value?: string -} - -export interface CatNodeattrsRequest extends CatCatRequestBase { -} - -export type CatNodeattrsResponse = CatNodeattrsNodeAttributesRecord[] - -export interface CatNodesNodesRecord { - id?: Id - nodeId?: Id - pid?: string - p?: string - ip?: string - i?: string - port?: string - po?: string - http_address?: string - http?: string - version?: VersionString - v?: VersionString - flavor?: string - f?: string - type?: string - t?: string - build?: string - b?: string - jdk?: string - j?: string - 'disk.total'?: ByteSize - dt?: ByteSize - diskTotal?: ByteSize - 'disk.used'?: ByteSize - du?: ByteSize - diskUsed?: ByteSize - 'disk.avail'?: ByteSize - d?: ByteSize - da?: ByteSize - disk?: ByteSize - diskAvail?: ByteSize - 'disk.used_percent'?: Percentage - dup?: Percentage - diskUsedPercent?: Percentage - 'heap.current'?: string - hc?: string - heapCurrent?: string - 'heap.percent'?: Percentage - hp?: Percentage - heapPercent?: Percentage - 'heap.max'?: string - hm?: string - heapMax?: string - 'ram.current'?: string - rc?: string - ramCurrent?: string - 'ram.percent'?: Percentage - rp?: Percentage - ramPercent?: Percentage - 'ram.max'?: string - rn?: string - ramMax?: string - 'file_desc.current'?: string - fdc?: string - fileDescriptorCurrent?: string - 'file_desc.percent'?: Percentage - fdp?: Percentage - fileDescriptorPercent?: Percentage - 'file_desc.max'?: string - fdm?: string - fileDescriptorMax?: string - cpu?: string - load_1m?: string - load_5m?: string - load_15m?: string - l?: string - uptime?: string - u?: string - 'node.role'?: string - r?: string - role?: string - nodeRole?: string - master?: string - m?: string - name?: Name - n?: Name - 'completion.size'?: string - cs?: string - completionSize?: string - 'fielddata.memory_size'?: string - fm?: string - fielddataMemory?: string - 'fielddata.evictions'?: string - fe?: string - fielddataEvictions?: string - 'query_cache.memory_size'?: string - qcm?: string - queryCacheMemory?: string - 'query_cache.evictions'?: string - qce?: string - queryCacheEvictions?: string - 'query_cache.hit_count'?: string - qchc?: string - queryCacheHitCount?: string - 'query_cache.miss_count'?: string - qcmc?: string - queryCacheMissCount?: string - 'request_cache.memory_size'?: string - rcm?: string - requestCacheMemory?: string - 'request_cache.evictions'?: string - rce?: string - requestCacheEvictions?: string - 'request_cache.hit_count'?: string - rchc?: string - requestCacheHitCount?: string - 'request_cache.miss_count'?: string - rcmc?: string - requestCacheMissCount?: string - 'flush.total'?: string - ft?: string - flushTotal?: string - 'flush.total_time'?: string - ftt?: string - flushTotalTime?: string - 'get.current'?: string - gc?: string - getCurrent?: string - 'get.time'?: string - gti?: string - getTime?: string - 'get.total'?: string - gto?: string - getTotal?: string - 'get.exists_time'?: string - geti?: string - getExistsTime?: string - 'get.exists_total'?: string - geto?: string - getExistsTotal?: string - 'get.missing_time'?: string - gmti?: string - getMissingTime?: string - 'get.missing_total'?: string - gmto?: string - getMissingTotal?: string - 'indexing.delete_current'?: string - idc?: string - indexingDeleteCurrent?: string - 'indexing.delete_time'?: string - idti?: string - indexingDeleteTime?: string - 'indexing.delete_total'?: string - idto?: string - indexingDeleteTotal?: string - 'indexing.index_current'?: string - iic?: string - indexingIndexCurrent?: string - 'indexing.index_time'?: string - iiti?: string - indexingIndexTime?: string - 'indexing.index_total'?: string - iito?: string - indexingIndexTotal?: string - 'indexing.index_failed'?: string - iif?: string - indexingIndexFailed?: string - 'merges.current'?: string - mc?: string - mergesCurrent?: string - 'merges.current_docs'?: string - mcd?: string - mergesCurrentDocs?: string - 'merges.current_size'?: string - mcs?: string - mergesCurrentSize?: string - 'merges.total'?: string - mt?: string - mergesTotal?: string - 'merges.total_docs'?: string - mtd?: string - mergesTotalDocs?: string - 'merges.total_size'?: string - mts?: string - mergesTotalSize?: string - 'merges.total_time'?: string - mtt?: string - mergesTotalTime?: string - 'refresh.total'?: string - 'refresh.time'?: string - 'refresh.external_total'?: string - rto?: string - refreshTotal?: string - 'refresh.external_time'?: string - rti?: string - refreshTime?: string - 'refresh.listeners'?: string - rli?: string - refreshListeners?: string - 'script.compilations'?: string - scrcc?: string - scriptCompilations?: string - 'script.cache_evictions'?: string - scrce?: string - scriptCacheEvictions?: string - 'script.compilation_limit_triggered'?: string - scrclt?: string - scriptCacheCompilationLimitTriggered?: string - 'search.fetch_current'?: string - sfc?: string - searchFetchCurrent?: string - 'search.fetch_time'?: string - sfti?: string - searchFetchTime?: string - 'search.fetch_total'?: string - sfto?: string - searchFetchTotal?: string - 'search.open_contexts'?: string - so?: string - searchOpenContexts?: string - 'search.query_current'?: string - sqc?: string - searchQueryCurrent?: string - 'search.query_time'?: string - sqti?: string - searchQueryTime?: string - 'search.query_total'?: string - sqto?: string - searchQueryTotal?: string - 'search.scroll_current'?: string - scc?: string - searchScrollCurrent?: string - 'search.scroll_time'?: string - scti?: string - searchScrollTime?: string - 'search.scroll_total'?: string - scto?: string - searchScrollTotal?: string - 'segments.count'?: string - sc?: string - segmentsCount?: string - 'segments.memory'?: string - sm?: string - segmentsMemory?: string - 'segments.index_writer_memory'?: string - siwm?: string - segmentsIndexWriterMemory?: string - 'segments.version_map_memory'?: string - svmm?: string - segmentsVersionMapMemory?: string - 'segments.fixed_bitset_memory'?: string - sfbm?: string - fixedBitsetMemory?: string - 'suggest.current'?: string - suc?: string - suggestCurrent?: string - 'suggest.time'?: string - suti?: string - suggestTime?: string - 'suggest.total'?: string - suto?: string - suggestTotal?: string - 'bulk.total_operations'?: string - bto?: string - bulkTotalOperations?: string - 'bulk.total_time'?: string - btti?: string - bulkTotalTime?: string - 'bulk.total_size_in_bytes'?: string - btsi?: string - bulkTotalSizeInBytes?: string - 'bulk.avg_time'?: string - bati?: string - bulkAvgTime?: string - 'bulk.avg_size_in_bytes'?: string - basi?: string - bulkAvgSizeInBytes?: string -} - -export interface CatNodesRequest extends CatCatRequestBase { - bytes?: Bytes - full_id?: boolean | string - include_unloaded_segments?: boolean -} - -export type CatNodesResponse = CatNodesNodesRecord[] - -export interface CatPendingTasksPendingTasksRecord { - insertOrder?: string - o?: string - timeInQueue?: string - t?: string - priority?: string - p?: string - source?: string - s?: string -} - -export interface CatPendingTasksRequest extends CatCatRequestBase { -} - -export type CatPendingTasksResponse = CatPendingTasksPendingTasksRecord[] - -export interface CatPluginsPluginsRecord { - id?: NodeId - name?: Name - n?: Name - component?: string - c?: string - version?: VersionString - v?: VersionString - description?: string - d?: string - type?: string - t?: string -} - -export interface CatPluginsRequest extends CatCatRequestBase { -} - -export type CatPluginsResponse = CatPluginsPluginsRecord[] - -export interface CatRecoveryRecoveryRecord { - index?: IndexName - i?: IndexName - idx?: IndexName - shard?: string - s?: string - sh?: string - start_time?: DateTime - start?: DateTime - start_time_millis?: EpochTime - start_millis?: EpochTime - stop_time?: DateTime - stop?: DateTime - stop_time_millis?: EpochTime - stop_millis?: EpochTime - time?: Duration - t?: Duration - ti?: Duration - type?: string - ty?: string - stage?: string - st?: string - source_host?: string - shost?: string - source_node?: string - snode?: string - target_host?: string - thost?: string - target_node?: string - tnode?: string - repository?: string - rep?: string - snapshot?: string - snap?: string - files?: string - f?: string - files_recovered?: string - fr?: string - files_percent?: Percentage - fp?: Percentage - files_total?: string - tf?: string - bytes?: string - b?: string - bytes_recovered?: string - br?: string - bytes_percent?: Percentage - bp?: Percentage - bytes_total?: string - tb?: string - translog_ops?: string - to?: string - translog_ops_recovered?: string - tor?: string - translog_ops_percent?: Percentage - top?: Percentage -} - -export interface CatRecoveryRequest extends CatCatRequestBase { - index?: Indices - active_only?: boolean - bytes?: Bytes - detailed?: boolean -} - -export type CatRecoveryResponse = CatRecoveryRecoveryRecord[] - -export interface CatRepositoriesRepositoriesRecord { - id?: string - repoId?: string - type?: string - t?: string -} - -export interface CatRepositoriesRequest extends CatCatRequestBase { -} - -export type CatRepositoriesResponse = CatRepositoriesRepositoriesRecord[] - -export interface CatSegmentsRequest extends CatCatRequestBase { - index?: Indices - bytes?: Bytes -} - -export type CatSegmentsResponse = CatSegmentsSegmentsRecord[] - -export interface CatSegmentsSegmentsRecord { - index?: IndexName - i?: IndexName - idx?: IndexName - shard?: string - s?: string - sh?: string - prirep?: string - p?: string - pr?: string - primaryOrReplica?: string - ip?: string - id?: NodeId - segment?: string - seg?: string - generation?: string - g?: string - gen?: string - 'docs.count'?: string - dc?: string - docsCount?: string - 'docs.deleted'?: string - dd?: string - docsDeleted?: string - size?: ByteSize - si?: ByteSize - 'size.memory'?: ByteSize - sm?: ByteSize - sizeMemory?: ByteSize - committed?: string - ic?: string - isCommitted?: string - searchable?: string - is?: string - isSearchable?: string - version?: VersionString - v?: VersionString - compound?: string - ico?: string - isCompound?: string -} - -export interface CatShardsRequest extends CatCatRequestBase { - index?: Indices - bytes?: Bytes -} - -export type CatShardsResponse = CatShardsShardsRecord[] - -export interface CatShardsShardsRecord { - index?: string - i?: string - idx?: string - shard?: string - s?: string - sh?: string - prirep?: string - p?: string - pr?: string - primaryOrReplica?: string - state?: string - st?: string - docs?: string | null - d?: string | null - dc?: string | null - store?: string | null - sto?: string | null - dataset?: string | null - ip?: string | null - id?: string - node?: string | null - n?: string | null - sync_id?: string - 'unassigned.reason'?: string - ur?: string - 'unassigned.at'?: string - ua?: string - 'unassigned.for'?: string - uf?: string - 'unassigned.details'?: string - ud?: string - 'recoverysource.type'?: string - rs?: string - 'completion.size'?: string - cs?: string - completionSize?: string - 'fielddata.memory_size'?: string - fm?: string - fielddataMemory?: string - 'fielddata.evictions'?: string - fe?: string - fielddataEvictions?: string - 'query_cache.memory_size'?: string - qcm?: string - queryCacheMemory?: string - 'query_cache.evictions'?: string - qce?: string - queryCacheEvictions?: string - 'flush.total'?: string - ft?: string - flushTotal?: string - 'flush.total_time'?: string - ftt?: string - flushTotalTime?: string - 'get.current'?: string - gc?: string - getCurrent?: string - 'get.time'?: string - gti?: string - getTime?: string - 'get.total'?: string - gto?: string - getTotal?: string - 'get.exists_time'?: string - geti?: string - getExistsTime?: string - 'get.exists_total'?: string - geto?: string - getExistsTotal?: string - 'get.missing_time'?: string - gmti?: string - getMissingTime?: string - 'get.missing_total'?: string - gmto?: string - getMissingTotal?: string - 'indexing.delete_current'?: string - idc?: string - indexingDeleteCurrent?: string - 'indexing.delete_time'?: string - idti?: string - indexingDeleteTime?: string - 'indexing.delete_total'?: string - idto?: string - indexingDeleteTotal?: string - 'indexing.index_current'?: string - iic?: string - indexingIndexCurrent?: string - 'indexing.index_time'?: string - iiti?: string - indexingIndexTime?: string - 'indexing.index_total'?: string - iito?: string - indexingIndexTotal?: string - 'indexing.index_failed'?: string - iif?: string - indexingIndexFailed?: string - 'merges.current'?: string - mc?: string - mergesCurrent?: string - 'merges.current_docs'?: string - mcd?: string - mergesCurrentDocs?: string - 'merges.current_size'?: string - mcs?: string - mergesCurrentSize?: string - 'merges.total'?: string - mt?: string - mergesTotal?: string - 'merges.total_docs'?: string - mtd?: string - mergesTotalDocs?: string - 'merges.total_size'?: string - mts?: string - mergesTotalSize?: string - 'merges.total_time'?: string - mtt?: string - mergesTotalTime?: string - 'refresh.total'?: string - 'refresh.time'?: string - 'refresh.external_total'?: string - rto?: string - refreshTotal?: string - 'refresh.external_time'?: string - rti?: string - refreshTime?: string - 'refresh.listeners'?: string - rli?: string - refreshListeners?: string - 'search.fetch_current'?: string - sfc?: string - searchFetchCurrent?: string - 'search.fetch_time'?: string - sfti?: string - searchFetchTime?: string - 'search.fetch_total'?: string - sfto?: string - searchFetchTotal?: string - 'search.open_contexts'?: string - so?: string - searchOpenContexts?: string - 'search.query_current'?: string - sqc?: string - searchQueryCurrent?: string - 'search.query_time'?: string - sqti?: string - searchQueryTime?: string - 'search.query_total'?: string - sqto?: string - searchQueryTotal?: string - 'search.scroll_current'?: string - scc?: string - searchScrollCurrent?: string - 'search.scroll_time'?: string - scti?: string - searchScrollTime?: string - 'search.scroll_total'?: string - scto?: string - searchScrollTotal?: string - 'segments.count'?: string - sc?: string - segmentsCount?: string - 'segments.memory'?: string - sm?: string - segmentsMemory?: string - 'segments.index_writer_memory'?: string - siwm?: string - segmentsIndexWriterMemory?: string - 'segments.version_map_memory'?: string - svmm?: string - segmentsVersionMapMemory?: string - 'segments.fixed_bitset_memory'?: string - sfbm?: string - fixedBitsetMemory?: string - 'seq_no.max'?: string - sqm?: string - maxSeqNo?: string - 'seq_no.local_checkpoint'?: string - sql?: string - localCheckpoint?: string - 'seq_no.global_checkpoint'?: string - sqg?: string - globalCheckpoint?: string - 'warmer.current'?: string - wc?: string - warmerCurrent?: string - 'warmer.total'?: string - wto?: string - warmerTotal?: string - 'warmer.total_time'?: string - wtt?: string - warmerTotalTime?: string - 'path.data'?: string - pd?: string - dataPath?: string - 'path.state'?: string - ps?: string - statsPath?: string - 'bulk.total_operations'?: string - bto?: string - bulkTotalOperations?: string - 'bulk.total_time'?: string - btti?: string - bulkTotalTime?: string - 'bulk.total_size_in_bytes'?: string - btsi?: string - bulkTotalSizeInBytes?: string - 'bulk.avg_time'?: string - bati?: string - bulkAvgTime?: string - 'bulk.avg_size_in_bytes'?: string - basi?: string - bulkAvgSizeInBytes?: string -} - -export interface CatSnapshotsRequest extends CatCatRequestBase { - repository?: Names - ignore_unavailable?: boolean -} - -export type CatSnapshotsResponse = CatSnapshotsSnapshotsRecord[] - -export interface CatSnapshotsSnapshotsRecord { - id?: string - snapshot?: string - repository?: string - re?: string - repo?: string - status?: string - s?: string - start_epoch?: SpecUtilsStringified> - ste?: SpecUtilsStringified> - startEpoch?: SpecUtilsStringified> - start_time?: WatcherScheduleTimeOfDay - sti?: WatcherScheduleTimeOfDay - startTime?: WatcherScheduleTimeOfDay - end_epoch?: SpecUtilsStringified> - ete?: SpecUtilsStringified> - endEpoch?: SpecUtilsStringified> - end_time?: TimeOfDay - eti?: TimeOfDay - endTime?: TimeOfDay - duration?: Duration - dur?: Duration - indices?: string - i?: string - successful_shards?: string - ss?: string - failed_shards?: string - fs?: string - total_shards?: string - ts?: string - reason?: string - r?: string -} - -export interface CatTasksRequest extends CatCatRequestBase { - actions?: string[] - detailed?: boolean - node_id?: string[] - parent_task_id?: string -} - -export type CatTasksResponse = CatTasksTasksRecord[] - -export interface CatTasksTasksRecord { - id?: Id - action?: string - ac?: string - task_id?: Id - ti?: Id - parent_task_id?: string - pti?: string - type?: string - ty?: string - start_time?: string - start?: string - timestamp?: string - ts?: string - hms?: string - hhmmss?: string - running_time_ns?: string - running_time?: string - time?: string - node_id?: NodeId - ni?: NodeId - ip?: string - i?: string - port?: string - po?: string - node?: string - n?: string - version?: VersionString - v?: VersionString - x_opaque_id?: string - x?: string - description?: string - desc?: string -} - -export interface CatTemplatesRequest extends CatCatRequestBase { - name?: Name -} - -export type CatTemplatesResponse = CatTemplatesTemplatesRecord[] - -export interface CatTemplatesTemplatesRecord { - name?: Name - n?: Name - index_patterns?: string - t?: string - order?: string - o?: string - p?: string - version?: VersionString | null - v?: VersionString | null - composed_of?: string - c?: string -} - -export interface CatThreadPoolRequest extends CatCatRequestBase { - thread_pool_patterns?: Names - time?: TimeUnit -} - -export type CatThreadPoolResponse = CatThreadPoolThreadPoolRecord[] - -export interface CatThreadPoolThreadPoolRecord { - node_name?: string - nn?: string - node_id?: NodeId - id?: NodeId - ephemeral_node_id?: string - eid?: string - pid?: string - p?: string - host?: string - h?: string - ip?: string - i?: string - port?: string - po?: string - name?: string - n?: string - type?: string - t?: string - active?: string - a?: string - pool_size?: string - psz?: string - queue?: string - q?: string - queue_size?: string - qs?: string - rejected?: string - r?: string - largest?: string - l?: string - completed?: string - c?: string - core?: string | null - cr?: string | null - max?: string | null - mx?: string | null - size?: string | null - sz?: string | null - keep_alive?: string | null - ka?: string | null -} - -export interface CatTransformsRequest extends CatCatRequestBase { - transform_id?: Id - allow_no_match?: boolean - from?: integer - h?: CatCatTransformColumns - s?: CatCatTransformColumns - time?: TimeUnit - size?: integer -} - -export type CatTransformsResponse = CatTransformsTransformsRecord[] - -export interface CatTransformsTransformsRecord { - id?: Id - state?: string - s?: string - checkpoint?: string - c?: string - documents_processed?: string - docp?: string - documentsProcessed?: string - checkpoint_progress?: string | null - cp?: string | null - checkpointProgress?: string | null - last_search_time?: string | null - lst?: string | null - lastSearchTime?: string | null - changes_last_detection_time?: string | null - cldt?: string | null - create_time?: string - ct?: string - createTime?: string - version?: VersionString - v?: VersionString - source_index?: string - si?: string - sourceIndex?: string - dest_index?: string - di?: string - destIndex?: string - pipeline?: string - p?: string - description?: string - d?: string - transform_type?: string - tt?: string - frequency?: string - f?: string - max_page_search_size?: string - mpsz?: string - docs_per_second?: string - dps?: string - reason?: string - r?: string - search_total?: string - st?: string - search_failure?: string - sf?: string - search_time?: string - stime?: string - index_total?: string - it?: string - index_failure?: string - if?: string - index_time?: string - itime?: string - documents_indexed?: string - doci?: string - delete_time?: string - dtime?: string - documents_deleted?: string - docd?: string - trigger_count?: string - tc?: string - pages_processed?: string - pp?: string - processing_time?: string - pt?: string - checkpoint_duration_time_exp_avg?: string - cdtea?: string - checkpointTimeExpAvg?: string - indexed_documents_exp_avg?: string - idea?: string - processed_documents_exp_avg?: string - pdea?: string -} - -export interface CcrFollowIndexStats { - index: IndexName - shards: CcrShardStats[] -} - -export interface CcrReadException { - exception: ErrorCause - from_seq_no: SequenceNumber - retries: integer -} - -export interface CcrShardStats { - bytes_read: long - failed_read_requests: long - failed_write_requests: long - fatal_exception?: ErrorCause - follower_aliases_version: VersionNumber - follower_global_checkpoint: long - follower_index: string - follower_mapping_version: VersionNumber - follower_max_seq_no: SequenceNumber - follower_settings_version: VersionNumber - last_requested_seq_no: SequenceNumber - leader_global_checkpoint: long - leader_index: string - leader_max_seq_no: SequenceNumber - operations_read: long - operations_written: long - outstanding_read_requests: integer - outstanding_write_requests: integer - read_exceptions: CcrReadException[] - remote_cluster: string - shard_id: integer - successful_read_requests: long - successful_write_requests: long - time_since_last_read?: Duration - time_since_last_read_millis: DurationValue - total_read_remote_exec_time?: Duration - total_read_remote_exec_time_millis: DurationValue - total_read_time?: Duration - total_read_time_millis: DurationValue - total_write_time?: Duration - total_write_time_millis: DurationValue - write_buffer_operation_count: long - write_buffer_size_in_bytes: ByteSize -} - -export interface CcrDeleteAutoFollowPatternRequest extends RequestBase { - name: Name -} - -export type CcrDeleteAutoFollowPatternResponse = AcknowledgedResponseBase - -export interface CcrFollowRequest extends RequestBase { - index: IndexName - wait_for_active_shards?: WaitForActiveShards - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - leader_index?: IndexName - max_outstanding_read_requests?: long - max_outstanding_write_requests?: long - max_read_request_operation_count?: long - max_read_request_size?: string - max_retry_delay?: Duration - max_write_buffer_count?: long - max_write_buffer_size?: string - max_write_request_operation_count?: long - max_write_request_size?: string - read_poll_timeout?: Duration - remote_cluster?: string - } -} - -export interface CcrFollowResponse { - follow_index_created: boolean - follow_index_shards_acked: boolean - index_following_started: boolean -} - -export interface CcrFollowInfoFollowerIndex { - follower_index: IndexName - leader_index: IndexName - parameters?: CcrFollowInfoFollowerIndexParameters - remote_cluster: Name - status: CcrFollowInfoFollowerIndexStatus -} - -export interface CcrFollowInfoFollowerIndexParameters { - max_outstanding_read_requests: integer - max_outstanding_write_requests: integer - max_read_request_operation_count: integer - max_read_request_size: string - max_retry_delay: Duration - max_write_buffer_count: integer - max_write_buffer_size: string - max_write_request_operation_count: integer - max_write_request_size: string - read_poll_timeout: Duration -} - -export type CcrFollowInfoFollowerIndexStatus = 'active' | 'paused' - -export interface CcrFollowInfoRequest extends RequestBase { - index: Indices -} - -export interface CcrFollowInfoResponse { - follower_indices: CcrFollowInfoFollowerIndex[] -} - -export interface CcrFollowStatsRequest extends RequestBase { - index: Indices -} - -export interface CcrFollowStatsResponse { - indices: CcrFollowIndexStats[] -} - -export interface CcrForgetFollowerRequest extends RequestBase { - index: IndexName - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - follower_cluster?: string - follower_index?: IndexName - follower_index_uuid?: Uuid - leader_remote_cluster?: string - } -} - -export interface CcrForgetFollowerResponse { - _shards: ShardStatistics -} - -export interface CcrGetAutoFollowPatternAutoFollowPattern { - name: Name - pattern: CcrGetAutoFollowPatternAutoFollowPatternSummary -} - -export interface CcrGetAutoFollowPatternAutoFollowPatternSummary { - active: boolean - remote_cluster: string - follow_index_pattern?: IndexPattern - leader_index_patterns: IndexPatterns - leader_index_exclusion_patterns: IndexPatterns - max_outstanding_read_requests: integer -} - -export interface CcrGetAutoFollowPatternRequest extends RequestBase { - name?: Name -} - -export interface CcrGetAutoFollowPatternResponse { - patterns: CcrGetAutoFollowPatternAutoFollowPattern[] -} - -export interface CcrPauseAutoFollowPatternRequest extends RequestBase { - name: Name -} - -export type CcrPauseAutoFollowPatternResponse = AcknowledgedResponseBase - -export interface CcrPauseFollowRequest extends RequestBase { - index: IndexName -} - -export type CcrPauseFollowResponse = AcknowledgedResponseBase - -export interface CcrPutAutoFollowPatternRequest extends RequestBase { - name: Name - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - remote_cluster: string - follow_index_pattern?: IndexPattern - leader_index_patterns?: IndexPatterns - leader_index_exclusion_patterns?: IndexPatterns - max_outstanding_read_requests?: integer - settings?: Record - max_outstanding_write_requests?: integer - read_poll_timeout?: Duration - max_read_request_operation_count?: integer - max_read_request_size?: ByteSize - max_retry_delay?: Duration - max_write_buffer_count?: integer - max_write_buffer_size?: ByteSize - max_write_request_operation_count?: integer - max_write_request_size?: ByteSize - } -} - -export type CcrPutAutoFollowPatternResponse = AcknowledgedResponseBase - -export interface CcrResumeAutoFollowPatternRequest extends RequestBase { - name: Name -} - -export type CcrResumeAutoFollowPatternResponse = AcknowledgedResponseBase - -export interface CcrResumeFollowRequest extends RequestBase { - index: IndexName - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - max_outstanding_read_requests?: long - max_outstanding_write_requests?: long - max_read_request_operation_count?: long - max_read_request_size?: string - max_retry_delay?: Duration - max_write_buffer_count?: long - max_write_buffer_size?: string - max_write_request_operation_count?: long - max_write_request_size?: string - read_poll_timeout?: Duration - } -} - -export type CcrResumeFollowResponse = AcknowledgedResponseBase - -export interface CcrStatsAutoFollowStats { - auto_followed_clusters: CcrStatsAutoFollowedCluster[] - number_of_failed_follow_indices: long - number_of_failed_remote_cluster_state_requests: long - number_of_successful_follow_indices: long - recent_auto_follow_errors: ErrorCause[] -} - -export interface CcrStatsAutoFollowedCluster { - cluster_name: Name - last_seen_metadata_version: VersionNumber - time_since_last_check_millis: DurationValue -} - -export interface CcrStatsFollowStats { - indices: CcrFollowIndexStats[] -} - -export interface CcrStatsRequest extends RequestBase { -} - -export interface CcrStatsResponse { - auto_follow_stats: CcrStatsAutoFollowStats - follow_stats: CcrStatsFollowStats -} - -export interface CcrUnfollowRequest extends RequestBase { - index: IndexName -} - -export type CcrUnfollowResponse = AcknowledgedResponseBase - -export interface ClusterComponentTemplate { - name: Name - component_template: ClusterComponentTemplateNode -} - -export interface ClusterComponentTemplateNode { - template: ClusterComponentTemplateSummary - version?: VersionNumber - _meta?: Metadata -} - -export interface ClusterComponentTemplateSummary { - _meta?: Metadata - version?: VersionNumber - settings?: Record - mappings?: MappingTypeMapping - aliases?: Record - lifecycle?: IndicesDataStreamLifecycleWithRollover -} - -export interface ClusterAllocationExplainAllocationDecision { - decider: string - decision: ClusterAllocationExplainAllocationExplainDecision - explanation: string -} - -export type ClusterAllocationExplainAllocationExplainDecision = 'NO' | 'YES' | 'THROTTLE' | 'ALWAYS' - -export interface ClusterAllocationExplainAllocationStore { - allocation_id: string - found: boolean - in_sync: boolean - matching_size_in_bytes: long - matching_sync_id: boolean - store_exception: string -} - -export interface ClusterAllocationExplainClusterInfo { - nodes: Record - shard_sizes: Record - shard_data_set_sizes?: Record - shard_paths: Record - reserved_sizes: ClusterAllocationExplainReservedSize[] -} - -export interface ClusterAllocationExplainCurrentNode { - id: Id - name: Name - roles: NodeRoles - attributes: Record - transport_address: TransportAddress - weight_ranking: integer -} - -export type ClusterAllocationExplainDecision = 'yes' | 'no' | 'worse_balance' | 'throttled' | 'awaiting_info' | 'allocation_delayed' | 'no_valid_shard_copy' | 'no_attempt' - -export interface ClusterAllocationExplainDiskUsage { - path: string - total_bytes: long - used_bytes: long - free_bytes: long - free_disk_percent: double - used_disk_percent: double -} - -export interface ClusterAllocationExplainNodeAllocationExplanation { - deciders: ClusterAllocationExplainAllocationDecision[] - node_attributes: Record - node_decision: ClusterAllocationExplainDecision - node_id: Id - node_name: Name - roles: NodeRoles - store?: ClusterAllocationExplainAllocationStore - transport_address: TransportAddress - weight_ranking: integer -} - -export interface ClusterAllocationExplainNodeDiskUsage { - node_name: Name - least_available: ClusterAllocationExplainDiskUsage - most_available: ClusterAllocationExplainDiskUsage -} - -export interface ClusterAllocationExplainRequest extends RequestBase { - include_disk_info?: boolean - include_yes_decisions?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - current_node?: string - index?: IndexName - primary?: boolean - shard?: integer - } -} - -export interface ClusterAllocationExplainReservedSize { - node_id: Id - path: string - total: long - shards: string[] -} - -export interface ClusterAllocationExplainResponse { - allocate_explanation?: string - allocation_delay?: Duration - allocation_delay_in_millis?: DurationValue - can_allocate?: ClusterAllocationExplainDecision - can_move_to_other_node?: ClusterAllocationExplainDecision - can_rebalance_cluster?: ClusterAllocationExplainDecision - can_rebalance_cluster_decisions?: ClusterAllocationExplainAllocationDecision[] - can_rebalance_to_other_node?: ClusterAllocationExplainDecision - can_remain_decisions?: ClusterAllocationExplainAllocationDecision[] - can_remain_on_current_node?: ClusterAllocationExplainDecision - cluster_info?: ClusterAllocationExplainClusterInfo - configured_delay?: Duration - configured_delay_in_millis?: DurationValue - current_node?: ClusterAllocationExplainCurrentNode - current_state: string - index: IndexName - move_explanation?: string - node_allocation_decisions?: ClusterAllocationExplainNodeAllocationExplanation[] - primary: boolean - rebalance_explanation?: string - remaining_delay?: Duration - remaining_delay_in_millis?: DurationValue - shard: integer - unassigned_info?: ClusterAllocationExplainUnassignedInformation - note?: string -} - -export interface ClusterAllocationExplainUnassignedInformation { - at: DateTime - last_allocation_status?: string - reason: ClusterAllocationExplainUnassignedInformationReason - details?: string - failed_allocation_attempts?: integer - delayed?: boolean - allocation_status?: string -} - -export type ClusterAllocationExplainUnassignedInformationReason = 'INDEX_CREATED' | 'CLUSTER_RECOVERED' | 'INDEX_REOPENED' | 'DANGLING_INDEX_IMPORTED' | 'NEW_INDEX_RESTORED' | 'EXISTING_INDEX_RESTORED' | 'REPLICA_ADDED' | 'ALLOCATION_FAILED' | 'NODE_LEFT' | 'REROUTE_CANCELLED' | 'REINITIALIZED' | 'REALLOCATED_REPLICA' | 'PRIMARY_FAILED' | 'FORCED_EMPTY_PRIMARY' | 'MANUAL_ALLOCATION' - -export interface ClusterDeleteComponentTemplateRequest extends RequestBase { - name: Names - master_timeout?: Duration - timeout?: Duration -} - -export type ClusterDeleteComponentTemplateResponse = AcknowledgedResponseBase - -export interface ClusterDeleteVotingConfigExclusionsRequest extends RequestBase { - wait_for_removal?: boolean -} - -export type ClusterDeleteVotingConfigExclusionsResponse = boolean - -export interface ClusterExistsComponentTemplateRequest extends RequestBase { - name: Names - master_timeout?: Duration - local?: boolean -} - -export type ClusterExistsComponentTemplateResponse = boolean - -export interface ClusterGetComponentTemplateRequest extends RequestBase { - name?: Name - flat_settings?: boolean - include_defaults?: boolean - local?: boolean - master_timeout?: Duration -} - -export interface ClusterGetComponentTemplateResponse { - component_templates: ClusterComponentTemplate[] -} - -export interface ClusterGetSettingsRequest extends RequestBase { - flat_settings?: boolean - include_defaults?: boolean - master_timeout?: Duration - timeout?: Duration -} - -export interface ClusterGetSettingsResponse { - persistent: Record - transient: Record - defaults?: Record -} - -export interface ClusterHealthHealthResponseBody { - active_primary_shards: integer - active_shards: integer - active_shards_percent_as_number: Percentage - cluster_name: Name - delayed_unassigned_shards: integer - indices?: Record - initializing_shards: integer - number_of_data_nodes: integer - number_of_in_flight_fetch: integer - number_of_nodes: integer - number_of_pending_tasks: integer - relocating_shards: integer - status: HealthStatus - task_max_waiting_in_queue?: Duration - task_max_waiting_in_queue_millis: DurationValue - timed_out: boolean - unassigned_primary_shards: integer - unassigned_shards: integer -} - -export interface ClusterHealthIndexHealthStats { - active_primary_shards: integer - active_shards: integer - initializing_shards: integer - number_of_replicas: integer - number_of_shards: integer - relocating_shards: integer - shards?: Record - status: HealthStatus - unassigned_shards: integer - unassigned_primary_shards: integer -} - -export interface ClusterHealthRequest extends RequestBase { - index?: Indices - expand_wildcards?: ExpandWildcards - level?: Level - local?: boolean - master_timeout?: Duration - timeout?: Duration - wait_for_active_shards?: WaitForActiveShards - wait_for_events?: WaitForEvents - wait_for_nodes?: string | integer - wait_for_no_initializing_shards?: boolean - wait_for_no_relocating_shards?: boolean - wait_for_status?: HealthStatus -} - -export type ClusterHealthResponse = ClusterHealthHealthResponseBody - -export interface ClusterHealthShardHealthStats { - active_shards: integer - initializing_shards: integer - primary_active: boolean - relocating_shards: integer - status: HealthStatus - unassigned_shards: integer - unassigned_primary_shards: integer -} - -export interface ClusterInfoRequest extends RequestBase { - target: ClusterInfoTargets -} - -export interface ClusterInfoResponse { - cluster_name: Name - http?: NodesHttp - ingest?: NodesIngest - thread_pool?: Record - script?: NodesScripting -} - -export interface ClusterPendingTasksPendingTask { - executing: boolean - insert_order: integer - priority: string - source: string - time_in_queue?: Duration - time_in_queue_millis: DurationValue -} - -export interface ClusterPendingTasksRequest extends RequestBase { - local?: boolean - master_timeout?: Duration -} - -export interface ClusterPendingTasksResponse { - tasks: ClusterPendingTasksPendingTask[] -} - -export interface ClusterPostVotingConfigExclusionsRequest extends RequestBase { - node_names?: Names - node_ids?: Ids - timeout?: Duration -} - -export type ClusterPostVotingConfigExclusionsResponse = boolean - -export interface ClusterPutComponentTemplateRequest extends RequestBase { - name: Name - create?: boolean - master_timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - template: IndicesIndexState - version?: VersionNumber - _meta?: Metadata - deprecated?: boolean - } -} - -export type ClusterPutComponentTemplateResponse = AcknowledgedResponseBase - -export interface ClusterPutSettingsRequest extends RequestBase { - flat_settings?: boolean - master_timeout?: Duration - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - persistent?: Record - transient?: Record - } -} - -export interface ClusterPutSettingsResponse { - acknowledged: boolean - persistent: Record - transient: Record -} - -export type ClusterRemoteInfoClusterRemoteInfo = ClusterRemoteInfoClusterRemoteSniffInfo | ClusterRemoteInfoClusterRemoteProxyInfo - -export interface ClusterRemoteInfoClusterRemoteProxyInfo { - mode: 'proxy' - connected: boolean - initial_connect_timeout: Duration - skip_unavailable: boolean - proxy_address: string - server_name: string - num_proxy_sockets_connected: integer - max_proxy_socket_connections: integer -} - -export interface ClusterRemoteInfoClusterRemoteSniffInfo { - mode: 'sniff' - connected: boolean - max_connections_per_cluster: integer - num_nodes_connected: long - initial_connect_timeout: Duration - skip_unavailable: boolean - seeds: string[] -} - -export interface ClusterRemoteInfoRequest extends RequestBase { -} - -export type ClusterRemoteInfoResponse = Record - -export interface ClusterRerouteCommand { - cancel?: ClusterRerouteCommandCancelAction - move?: ClusterRerouteCommandMoveAction - allocate_replica?: ClusterRerouteCommandAllocateReplicaAction - allocate_stale_primary?: ClusterRerouteCommandAllocatePrimaryAction - allocate_empty_primary?: ClusterRerouteCommandAllocatePrimaryAction -} - -export interface ClusterRerouteCommandAllocatePrimaryAction { - index: IndexName - shard: integer - node: string - accept_data_loss: boolean -} - -export interface ClusterRerouteCommandAllocateReplicaAction { - index: IndexName - shard: integer - node: string -} - -export interface ClusterRerouteCommandCancelAction { - index: IndexName - shard: integer - node: string - allow_primary?: boolean -} - -export interface ClusterRerouteCommandMoveAction { - index: IndexName - shard: integer - from_node: string - to_node: string -} - -export interface ClusterRerouteRequest extends RequestBase { - dry_run?: boolean - explain?: boolean - metric?: Metrics - retry_failed?: boolean - master_timeout?: Duration - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - commands?: ClusterRerouteCommand[] - } -} - -export interface ClusterRerouteRerouteDecision { - decider: string - decision: string - explanation: string -} - -export interface ClusterRerouteRerouteExplanation { - command: string - decisions: ClusterRerouteRerouteDecision[] - parameters: ClusterRerouteRerouteParameters -} - -export interface ClusterRerouteRerouteParameters { - allow_primary: boolean - index: IndexName - node: NodeName - shard: integer - from_node?: NodeName - to_node?: NodeName -} - -export interface ClusterRerouteResponse { - acknowledged: boolean - explanations?: ClusterRerouteRerouteExplanation[] - state?: any -} - -export interface ClusterStateRequest extends RequestBase { - metric?: Metrics - index?: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - flat_settings?: boolean - ignore_unavailable?: boolean - local?: boolean - master_timeout?: Duration - wait_for_metadata_version?: VersionNumber - wait_for_timeout?: Duration -} - -export type ClusterStateResponse = any - -export interface ClusterStatsCharFilterTypes { - analyzer_types: ClusterStatsFieldTypes[] - built_in_analyzers: ClusterStatsFieldTypes[] - built_in_char_filters: ClusterStatsFieldTypes[] - built_in_filters: ClusterStatsFieldTypes[] - built_in_tokenizers: ClusterStatsFieldTypes[] - char_filter_types: ClusterStatsFieldTypes[] - filter_types: ClusterStatsFieldTypes[] - tokenizer_types: ClusterStatsFieldTypes[] -} - -export interface ClusterStatsClusterFileSystem { - available_in_bytes: long - free_in_bytes: long - total_in_bytes: long -} - -export interface ClusterStatsClusterIndices { - analysis: ClusterStatsCharFilterTypes - completion: CompletionStats - count: long - docs: DocStats - fielddata: FielddataStats - query_cache: QueryCacheStats - segments: SegmentsStats - shards: ClusterStatsClusterIndicesShards - store: StoreStats - mappings: ClusterStatsFieldTypesMappings - versions?: ClusterStatsIndicesVersions[] -} - -export interface ClusterStatsClusterIndicesShards { - index?: ClusterStatsClusterIndicesShardsIndex - primaries?: double - replication?: double - total?: double -} - -export interface ClusterStatsClusterIndicesShardsIndex { - primaries: ClusterStatsClusterShardMetrics - replication: ClusterStatsClusterShardMetrics - shards: ClusterStatsClusterShardMetrics -} - -export interface ClusterStatsClusterIngest { - number_of_pipelines: integer - processor_stats: Record -} - -export interface ClusterStatsClusterJvm { - max_uptime_in_millis: DurationValue - mem: ClusterStatsClusterJvmMemory - threads: long - versions: ClusterStatsClusterJvmVersion[] -} - -export interface ClusterStatsClusterJvmMemory { - heap_max_in_bytes: long - heap_used_in_bytes: long -} - -export interface ClusterStatsClusterJvmVersion { - bundled_jdk: boolean - count: integer - using_bundled_jdk: boolean - version: VersionString - vm_name: string - vm_vendor: string - vm_version: VersionString -} - -export interface ClusterStatsClusterNetworkTypes { - http_types: Record - transport_types: Record -} - -export interface ClusterStatsClusterNodeCount { - coordinating_only: integer - data: integer - data_cold: integer - data_content: integer - data_frozen?: integer - data_hot: integer - data_warm: integer - ingest: integer - master: integer - ml: integer - remote_cluster_client: integer - total: integer - transform: integer - voting_only: integer -} - -export interface ClusterStatsClusterNodes { - count: ClusterStatsClusterNodeCount - discovery_types: Record - fs: ClusterStatsClusterFileSystem - indexing_pressure: ClusterStatsIndexingPressure - ingest: ClusterStatsClusterIngest - jvm: ClusterStatsClusterJvm - network_types: ClusterStatsClusterNetworkTypes - os: ClusterStatsClusterOperatingSystem - packaging_types: ClusterStatsNodePackagingType[] - plugins: PluginStats[] - process: ClusterStatsClusterProcess - versions: VersionString[] -} - -export interface ClusterStatsClusterOperatingSystem { - allocated_processors: integer - architectures?: ClusterStatsClusterOperatingSystemArchitecture[] - available_processors: integer - mem: ClusterStatsOperatingSystemMemoryInfo - names: ClusterStatsClusterOperatingSystemName[] - pretty_names: ClusterStatsClusterOperatingSystemPrettyName[] -} - -export interface ClusterStatsClusterOperatingSystemArchitecture { - arch: string - count: integer -} - -export interface ClusterStatsClusterOperatingSystemName { - count: integer - name: Name -} - -export interface ClusterStatsClusterOperatingSystemPrettyName { - count: integer - pretty_name: Name -} - -export interface ClusterStatsClusterProcess { - cpu: ClusterStatsClusterProcessCpu - open_file_descriptors: ClusterStatsClusterProcessOpenFileDescriptors -} - -export interface ClusterStatsClusterProcessCpu { - percent: integer -} - -export interface ClusterStatsClusterProcessOpenFileDescriptors { - avg: long - max: long - min: long -} - -export interface ClusterStatsClusterProcessor { - count: long - current: long - failed: long - time?: Duration - time_in_millis: DurationValue -} - -export interface ClusterStatsClusterShardMetrics { - avg: double - max: double - min: double -} - -export interface ClusterStatsFieldTypes { - name: Name - count: integer - index_count: integer - indexed_vector_count?: long - indexed_vector_dim_max?: long - indexed_vector_dim_min?: long - script_count?: integer -} - -export interface ClusterStatsFieldTypesMappings { - field_types: ClusterStatsFieldTypes[] - runtime_field_types?: ClusterStatsRuntimeFieldTypes[] - total_field_count?: integer - total_deduplicated_field_count?: integer - total_deduplicated_mapping_size?: ByteSize - total_deduplicated_mapping_size_in_bytes?: long -} - -export interface ClusterStatsIndexingPressure { - memory: ClusterStatsIndexingPressureMemory -} - -export interface ClusterStatsIndexingPressureMemory { - current: ClusterStatsIndexingPressureMemorySummary - limit_in_bytes: long - total: ClusterStatsIndexingPressureMemorySummary -} - -export interface ClusterStatsIndexingPressureMemorySummary { - all_in_bytes: long - combined_coordinating_and_primary_in_bytes: long - coordinating_in_bytes: long - coordinating_rejections?: long - primary_in_bytes: long - primary_rejections?: long - replica_in_bytes: long - replica_rejections?: long -} - -export interface ClusterStatsIndicesVersions { - index_count: integer - primary_shard_count: integer - total_primary_bytes: long - version: VersionString -} - -export interface ClusterStatsNodePackagingType { - count: integer - flavor: string - type: string -} - -export interface ClusterStatsOperatingSystemMemoryInfo { - adjusted_total_in_bytes?: long - free_in_bytes: long - free_percent: integer - total_in_bytes: long - used_in_bytes: long - used_percent: integer -} - -export interface ClusterStatsRequest extends RequestBase { - node_id?: NodeIds - include_remotes?: boolean - timeout?: Duration -} - -export type ClusterStatsResponse = ClusterStatsStatsResponseBase - -export interface ClusterStatsRuntimeFieldTypes { - chars_max: integer - chars_total: integer - count: integer - doc_max: integer - doc_total: integer - index_count: integer - lang: string[] - lines_max: integer - lines_total: integer - name: Name - scriptless_count: integer - shadowed_count: integer - source_max: integer - source_total: integer -} - -export interface ClusterStatsStatsResponseBase extends NodesNodesResponseBase { - cluster_name: Name - cluster_uuid: Uuid - indices: ClusterStatsClusterIndices - nodes: ClusterStatsClusterNodes - status: HealthStatus - timestamp: long -} - -export interface ConnectorConnector { - api_key_id?: string - api_key_secret_id?: string - configuration: ConnectorConnectorConfiguration - custom_scheduling: ConnectorConnectorCustomScheduling - description?: string - error?: string | null - features?: ConnectorConnectorFeatures - filtering: ConnectorFilteringConfig[] - id?: Id - index_name?: IndexName | null - is_native: boolean - language?: string - last_access_control_sync_error?: string - last_access_control_sync_scheduled_at?: DateTime - last_access_control_sync_status?: ConnectorSyncStatus - last_deleted_document_count?: long - last_incremental_sync_scheduled_at?: DateTime - last_indexed_document_count?: long - last_seen?: DateTime - last_sync_error?: string - last_sync_scheduled_at?: DateTime - last_sync_status?: ConnectorSyncStatus - last_synced?: DateTime - name?: string - pipeline?: ConnectorIngestPipelineParams - scheduling: ConnectorSchedulingConfiguration - service_type?: string - status: ConnectorConnectorStatus - sync_cursor?: any - sync_now: boolean -} - -export interface ConnectorConnectorConfigProperties { - category?: string - default_value: ScalarValue - depends_on: ConnectorDependency[] - display: ConnectorDisplayType - label: string - options: ConnectorSelectOption[] - order?: integer - placeholder?: string - required: boolean - sensitive: boolean - tooltip?: string | null - type?: ConnectorConnectorFieldType - ui_restrictions?: string[] - validations?: ConnectorValidation[] - value: any -} - -export type ConnectorConnectorConfiguration = Record - -export type ConnectorConnectorCustomScheduling = Record - -export interface ConnectorConnectorFeatures { - document_level_security?: ConnectorFeatureEnabled - incremental_sync?: ConnectorFeatureEnabled - native_connector_api_keys?: ConnectorFeatureEnabled - sync_rules?: ConnectorSyncRulesFeature -} - -export type ConnectorConnectorFieldType = 'str' | 'int' | 'list' | 'bool' - -export interface ConnectorConnectorScheduling { - enabled: boolean - interval: string -} - -export type ConnectorConnectorStatus = 'created' | 'needs_configuration' | 'configured' | 'connected' | 'error' - -export interface ConnectorConnectorSyncJob { - cancelation_requested_at?: DateTime - canceled_at?: DateTime - completed_at?: DateTime - connector: ConnectorSyncJobConnectorReference - created_at: DateTime - deleted_document_count: long - error?: string - id: Id - indexed_document_count: long - indexed_document_volume: long - job_type: ConnectorSyncJobType - last_seen?: DateTime - metadata: Record - started_at?: DateTime - status: ConnectorSyncStatus - total_document_count: long - trigger_method: ConnectorSyncJobTriggerMethod - worker_hostname?: string -} - -export interface ConnectorCustomScheduling { - configuration_overrides: ConnectorCustomSchedulingConfigurationOverrides - enabled: boolean - interval: string - last_synced?: DateTime - name: string -} - -export interface ConnectorCustomSchedulingConfigurationOverrides { - max_crawl_depth?: integer - sitemap_discovery_disabled?: boolean - domain_allowlist?: string[] - sitemap_urls?: string[] - seed_urls?: string[] -} - -export interface ConnectorDependency { - field: string - value: ScalarValue -} - -export type ConnectorDisplayType = 'textbox' | 'textarea' | 'numeric' | 'toggle' | 'dropdown' - -export interface ConnectorFeatureEnabled { - enabled: boolean -} - -export interface ConnectorFilteringAdvancedSnippet { - created_at?: DateTime - updated_at?: DateTime - value: any -} - -export interface ConnectorFilteringConfig { - active: ConnectorFilteringRules - domain?: string - draft: ConnectorFilteringRules -} - -export type ConnectorFilteringPolicy = 'exclude' | 'include' - -export interface ConnectorFilteringRule { - created_at?: DateTime - field: Field - id: Id - order: integer - policy: ConnectorFilteringPolicy - rule: ConnectorFilteringRuleRule - updated_at?: DateTime - value: string -} - -export type ConnectorFilteringRuleRule = 'contains' | 'ends_with' | 'equals' | 'regex' | 'starts_with' | '>' | '<' - -export interface ConnectorFilteringRules { - advanced_snippet: ConnectorFilteringAdvancedSnippet - rules: ConnectorFilteringRule[] - validation: ConnectorFilteringRulesValidation -} - -export interface ConnectorFilteringRulesValidation { - errors: ConnectorFilteringValidation[] - state: ConnectorFilteringValidationState -} - -export interface ConnectorFilteringValidation { - ids: Id[] - messages: string[] -} - -export type ConnectorFilteringValidationState = 'edited' | 'invalid' | 'valid' - -export interface ConnectorGreaterThanValidation { - type: 'greater_than' - constraint: double -} - -export interface ConnectorIncludedInValidation { - type: 'included_in' - constraint: ScalarValue[] -} - -export interface ConnectorIngestPipelineParams { - extract_binary_content: boolean - name: string - reduce_whitespace: boolean - run_ml_inference: boolean -} - -export interface ConnectorLessThanValidation { - type: 'less_than' - constraint: double -} - -export interface ConnectorListTypeValidation { - type: 'list_type' - constraint: string -} - -export interface ConnectorRegexValidation { - type: 'regex' - constraint: string -} - -export interface ConnectorSchedulingConfiguration { - access_control?: ConnectorConnectorScheduling - full?: ConnectorConnectorScheduling - incremental?: ConnectorConnectorScheduling -} - -export interface ConnectorSelectOption { - label: string - value: ScalarValue -} - -export interface ConnectorSyncJobConnectorReference { - configuration: ConnectorConnectorConfiguration - filtering: ConnectorFilteringRules - id: Id - index_name: string - language?: string - pipeline?: ConnectorIngestPipelineParams - service_type: string - sync_cursor?: any -} - -export type ConnectorSyncJobTriggerMethod = 'on_demand' | 'scheduled' - -export type ConnectorSyncJobType = 'full' | 'incremental' | 'access_control' - -export interface ConnectorSyncRulesFeature { - advanced?: ConnectorFeatureEnabled - basic?: ConnectorFeatureEnabled -} - -export type ConnectorSyncStatus = 'canceling' | 'canceled' | 'completed' | 'error' | 'in_progress' | 'pending' | 'suspended' - -export type ConnectorValidation = ConnectorLessThanValidation | ConnectorGreaterThanValidation | ConnectorListTypeValidation | ConnectorIncludedInValidation | ConnectorRegexValidation - -export interface ConnectorCheckInRequest extends RequestBase { - connector_id: Id -} - -export interface ConnectorCheckInResponse { - result: Result -} - -export interface ConnectorDeleteRequest extends RequestBase { - connector_id: Id - delete_sync_jobs?: boolean -} - -export type ConnectorDeleteResponse = AcknowledgedResponseBase - -export interface ConnectorGetRequest extends RequestBase { - connector_id: Id -} - -export type ConnectorGetResponse = ConnectorConnector - -export interface ConnectorLastSyncRequest extends RequestBase { - connector_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - last_access_control_sync_error?: string - last_access_control_sync_scheduled_at?: DateTime - last_access_control_sync_status?: ConnectorSyncStatus - last_deleted_document_count?: long - last_incremental_sync_scheduled_at?: DateTime - last_indexed_document_count?: long - last_seen?: DateTime - last_sync_error?: string - last_sync_scheduled_at?: DateTime - last_sync_status?: ConnectorSyncStatus - last_synced?: DateTime - sync_cursor?: any - } -} - -export interface ConnectorLastSyncResponse { - result: Result -} - -export interface ConnectorListRequest extends RequestBase { - from?: integer - size?: integer - index_name?: Indices - connector_name?: Names - service_type?: Names - query?: string -} - -export interface ConnectorListResponse { - count: long - results: ConnectorConnector[] -} - -export interface ConnectorPostRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - description?: string - index_name?: IndexName - is_native?: boolean - language?: string - name?: string - service_type?: string - } -} - -export interface ConnectorPostResponse { - result: Result - id: Id -} - -export interface ConnectorPutRequest extends RequestBase { - connector_id?: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - description?: string - index_name?: IndexName - is_native?: boolean - language?: string - name?: string - service_type?: string - } -} - -export interface ConnectorPutResponse { - result: Result - id: Id -} - -export interface ConnectorSyncJobCancelRequest extends RequestBase { - connector_sync_job_id: Id -} - -export interface ConnectorSyncJobCancelResponse { - result: Result -} - -export interface ConnectorSyncJobDeleteRequest extends RequestBase { - connector_sync_job_id: Id -} - -export type ConnectorSyncJobDeleteResponse = AcknowledgedResponseBase - -export interface ConnectorSyncJobGetRequest extends RequestBase { - connector_sync_job_id: Id -} - -export type ConnectorSyncJobGetResponse = ConnectorConnectorSyncJob - -export interface ConnectorSyncJobListRequest extends RequestBase { - from?: integer - size?: integer - status?: ConnectorSyncStatus - connector_id?: Id - job_type?: ConnectorSyncJobType | ConnectorSyncJobType[] -} - -export interface ConnectorSyncJobListResponse { - count: long - results: ConnectorConnectorSyncJob[] -} - -export interface ConnectorSyncJobPostRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - id: Id - job_type?: ConnectorSyncJobType - trigger_method?: ConnectorSyncJobTriggerMethod - } -} - -export interface ConnectorSyncJobPostResponse { - id: Id -} - -export interface ConnectorUpdateActiveFilteringRequest extends RequestBase { - connector_id: Id -} - -export interface ConnectorUpdateActiveFilteringResponse { - result: Result -} - -export interface ConnectorUpdateApiKeyIdRequest extends RequestBase { - connector_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - api_key_id?: string - api_key_secret_id?: string - } -} - -export interface ConnectorUpdateApiKeyIdResponse { - result: Result -} - -export interface ConnectorUpdateConfigurationRequest extends RequestBase { - connector_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - configuration?: ConnectorConnectorConfiguration - values?: Record - } -} - -export interface ConnectorUpdateConfigurationResponse { - result: Result -} - -export interface ConnectorUpdateErrorRequest extends RequestBase { - connector_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - error: SpecUtilsWithNullValue - } -} - -export interface ConnectorUpdateErrorResponse { - result: Result -} - -export interface ConnectorUpdateFilteringRequest extends RequestBase { - connector_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - filtering?: ConnectorFilteringConfig[] - rules?: ConnectorFilteringRule[] - advanced_snippet?: ConnectorFilteringAdvancedSnippet - } -} - -export interface ConnectorUpdateFilteringResponse { - result: Result -} - -export interface ConnectorUpdateFilteringValidationRequest extends RequestBase { - connector_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - validation: ConnectorFilteringRulesValidation - } -} - -export interface ConnectorUpdateFilteringValidationResponse { - result: Result -} - -export interface ConnectorUpdateIndexNameRequest extends RequestBase { - connector_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - index_name: SpecUtilsWithNullValue - } -} - -export interface ConnectorUpdateIndexNameResponse { - result: Result -} - -export interface ConnectorUpdateNameRequest extends RequestBase { - connector_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - name?: string - description?: string - } -} - -export interface ConnectorUpdateNameResponse { - result: Result -} - -export interface ConnectorUpdateNativeRequest extends RequestBase { - connector_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - is_native: boolean - } -} - -export interface ConnectorUpdateNativeResponse { - result: Result -} - -export interface ConnectorUpdatePipelineRequest extends RequestBase { - connector_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - pipeline: ConnectorIngestPipelineParams - } -} - -export interface ConnectorUpdatePipelineResponse { - result: Result -} - -export interface ConnectorUpdateSchedulingRequest extends RequestBase { - connector_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - scheduling: ConnectorSchedulingConfiguration - } -} - -export interface ConnectorUpdateSchedulingResponse { - result: Result -} - -export interface ConnectorUpdateServiceTypeRequest extends RequestBase { - connector_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - service_type: string - } -} - -export interface ConnectorUpdateServiceTypeResponse { - result: Result -} - -export interface ConnectorUpdateStatusRequest extends RequestBase { - connector_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - status: ConnectorConnectorStatus - } -} - -export interface ConnectorUpdateStatusResponse { - result: Result -} - -export interface DanglingIndicesDeleteDanglingIndexRequest extends RequestBase { - index_uuid: Uuid - accept_data_loss: boolean - master_timeout?: Duration - timeout?: Duration -} - -export type DanglingIndicesDeleteDanglingIndexResponse = AcknowledgedResponseBase - -export interface DanglingIndicesImportDanglingIndexRequest extends RequestBase { - index_uuid: Uuid - accept_data_loss: boolean - master_timeout?: Duration - timeout?: Duration -} - -export type DanglingIndicesImportDanglingIndexResponse = AcknowledgedResponseBase - -export interface DanglingIndicesListDanglingIndicesDanglingIndex { - index_name: string - index_uuid: string - creation_date_millis: EpochTime - node_ids: Ids -} - -export interface DanglingIndicesListDanglingIndicesRequest extends RequestBase { -} - -export interface DanglingIndicesListDanglingIndicesResponse { - dangling_indices: DanglingIndicesListDanglingIndicesDanglingIndex[] -} - -export interface EnrichPolicy { - enrich_fields: Fields - indices: Indices - match_field: Field - query?: QueryDslQueryContainer - name?: Name - elasticsearch_version?: string -} - -export type EnrichPolicyType = 'geo_match' | 'match' | 'range' - -export interface EnrichSummary { - config: Partial> -} - -export interface EnrichDeletePolicyRequest extends RequestBase { - name: Name -} - -export type EnrichDeletePolicyResponse = AcknowledgedResponseBase - -export type EnrichExecutePolicyEnrichPolicyPhase = 'SCHEDULED' | 'RUNNING' | 'COMPLETE' | 'FAILED' - -export interface EnrichExecutePolicyExecuteEnrichPolicyStatus { - phase: EnrichExecutePolicyEnrichPolicyPhase -} - -export interface EnrichExecutePolicyRequest extends RequestBase { - name: Name - wait_for_completion?: boolean -} - -export interface EnrichExecutePolicyResponse { - status?: EnrichExecutePolicyExecuteEnrichPolicyStatus - task_id?: TaskId -} - -export interface EnrichGetPolicyRequest extends RequestBase { - name?: Names -} - -export interface EnrichGetPolicyResponse { - policies: EnrichSummary[] -} - -export interface EnrichPutPolicyRequest extends RequestBase { - name: Name - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - geo_match?: EnrichPolicy - match?: EnrichPolicy - range?: EnrichPolicy - } -} - -export type EnrichPutPolicyResponse = AcknowledgedResponseBase - -export interface EnrichStatsCacheStats { - node_id: Id - count: integer - hits: integer - hits_time_in_millis: DurationValue - misses: integer - misses_time_in_millis: DurationValue - evictions: integer - size_in_bytes: long -} - -export interface EnrichStatsCoordinatorStats { - executed_searches_total: long - node_id: Id - queue_size: integer - remote_requests_current: integer - remote_requests_total: long -} - -export interface EnrichStatsExecutingPolicy { - name: Name - task: TasksTaskInfo -} - -export interface EnrichStatsRequest extends RequestBase { -} - -export interface EnrichStatsResponse { - coordinator_stats: EnrichStatsCoordinatorStats[] - executing_policies: EnrichStatsExecutingPolicy[] - cache_stats?: EnrichStatsCacheStats[] -} - -export interface EqlEqlHits { - total?: SearchTotalHits - events?: EqlHitsEvent[] - sequences?: EqlHitsSequence[] -} - -export interface EqlEqlSearchResponseBase { - id?: Id - is_partial?: boolean - is_running?: boolean - took?: DurationValue - timed_out?: boolean - hits: EqlEqlHits -} - -export interface EqlHitsEvent { - _index: IndexName - _id: Id - _source: TEvent - missing?: boolean - fields?: Record -} - -export interface EqlHitsSequence { - events: EqlHitsEvent[] - join_keys?: any[] -} - -export interface EqlDeleteRequest extends RequestBase { - id: Id -} - -export type EqlDeleteResponse = AcknowledgedResponseBase - -export interface EqlGetRequest extends RequestBase { - id: Id - keep_alive?: Duration - wait_for_completion_timeout?: Duration -} - -export type EqlGetResponse = EqlEqlSearchResponseBase - -export interface EqlGetStatusRequest extends RequestBase { - id: Id -} - -export interface EqlGetStatusResponse { - id: Id - is_partial: boolean - is_running: boolean - start_time_in_millis?: EpochTime - expiration_time_in_millis?: EpochTime - completion_status?: integer -} - -export interface EqlSearchRequest extends RequestBase { - index: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - query: string - case_sensitive?: boolean - event_category_field?: Field - tiebreaker_field?: Field - timestamp_field?: Field - fetch_size?: uint - filter?: QueryDslQueryContainer | QueryDslQueryContainer[] - keep_alive?: Duration - keep_on_completion?: boolean - wait_for_completion_timeout?: Duration - size?: uint - fields?: QueryDslFieldAndFormat | Field | (QueryDslFieldAndFormat | Field)[] - result_position?: EqlSearchResultPosition - runtime_mappings?: MappingRuntimeFields - } -} - -export type EqlSearchResponse = EqlEqlSearchResponseBase - -export type EqlSearchResultPosition = 'tail' | 'head' - -export interface EsqlTableValuesContainer { - integer?: EsqlTableValuesIntegerValue[] - keyword?: EsqlTableValuesKeywordValue[] - long?: EsqlTableValuesLongValue[] - double?: EsqlTableValuesLongDouble[] -} - -export type EsqlTableValuesIntegerValue = integer | integer[] - -export type EsqlTableValuesKeywordValue = string | string[] - -export type EsqlTableValuesLongDouble = double | double[] - -export type EsqlTableValuesLongValue = long | long[] - -export type EsqlQueryEsqlFormat = 'csv' | 'json' | 'tsv' | 'txt' | 'yaml' | 'cbor' | 'smile' | 'arrow' - -export interface EsqlQueryRequest extends RequestBase { - format?: EsqlQueryEsqlFormat - delimiter?: string - drop_null_columns?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - columnar?: boolean - filter?: QueryDslQueryContainer - locale?: string - params?: FieldValue[] - profile?: boolean - query: string - tables?: Record> - } -} - -export type EsqlQueryResponse = EsqlColumns - -export interface FeaturesFeature { - name: string - description: string -} - -export interface FeaturesGetFeaturesRequest extends RequestBase { -} - -export interface FeaturesGetFeaturesResponse { - features: FeaturesFeature[] -} - -export interface FeaturesResetFeaturesRequest extends RequestBase { -} - -export interface FeaturesResetFeaturesResponse { - features: FeaturesFeature[] -} - -export type FleetCheckpoint = long - -export interface FleetGlobalCheckpointsRequest extends RequestBase { - index: IndexName | IndexAlias - wait_for_advance?: boolean - wait_for_index?: boolean - checkpoints?: FleetCheckpoint[] - timeout?: Duration -} - -export interface FleetGlobalCheckpointsResponse { - global_checkpoints: FleetCheckpoint[] - timed_out: boolean -} - -export interface FleetMsearchRequest extends RequestBase { - index?: IndexName | IndexAlias - allow_no_indices?: boolean - ccs_minimize_roundtrips?: boolean - expand_wildcards?: ExpandWildcards - ignore_throttled?: boolean - ignore_unavailable?: boolean - max_concurrent_searches?: long - max_concurrent_shard_requests?: long - pre_filter_shard_size?: long - search_type?: SearchType - rest_total_hits_as_int?: boolean - typed_keys?: boolean - wait_for_checkpoints?: FleetCheckpoint[] - allow_partial_search_results?: boolean - /** @deprecated The use of the 'body' key has been deprecated, use 'searches' instead. */ - body?: MsearchRequestItem[] -} - -export interface FleetMsearchResponse { - docs: MsearchResponseItem[] -} - -export interface FleetSearchRequest extends RequestBase { - index: IndexName | IndexAlias - allow_no_indices?: boolean - analyzer?: string - analyze_wildcard?: boolean - batched_reduce_size?: long - ccs_minimize_roundtrips?: boolean - default_operator?: QueryDslOperator - df?: string - expand_wildcards?: ExpandWildcards - ignore_throttled?: boolean - ignore_unavailable?: boolean - lenient?: boolean - max_concurrent_shard_requests?: long - min_compatible_shard_node?: VersionString - preference?: string - pre_filter_shard_size?: long - request_cache?: boolean - routing?: Routing - scroll?: Duration - search_type?: SearchType - suggest_field?: Field - suggest_mode?: SuggestMode - suggest_size?: long - suggest_text?: string - typed_keys?: boolean - rest_total_hits_as_int?: boolean - _source_excludes?: Fields - _source_includes?: Fields - q?: string - wait_for_checkpoints?: FleetCheckpoint[] - allow_partial_search_results?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - aggregations?: Record - /** @alias aggregations */ - aggs?: Record - collapse?: SearchFieldCollapse - explain?: boolean - ext?: Record - from?: integer - highlight?: SearchHighlight - track_total_hits?: SearchTrackHits - indices_boost?: Record[] - docvalue_fields?: (QueryDslFieldAndFormat | Field)[] - min_score?: double - post_filter?: QueryDslQueryContainer - profile?: boolean - query?: QueryDslQueryContainer - rescore?: SearchRescore | SearchRescore[] - script_fields?: Record - search_after?: SortResults - size?: integer - slice?: SlicedScroll - sort?: Sort - _source?: SearchSourceConfig - fields?: (QueryDslFieldAndFormat | Field)[] - suggest?: SearchSuggester - terminate_after?: long - timeout?: string - track_scores?: boolean - version?: boolean - seq_no_primary_term?: boolean - stored_fields?: Fields - pit?: SearchPointInTimeReference - runtime_mappings?: MappingRuntimeFields - stats?: string[] - } -} - -export interface FleetSearchResponse { - took: long - timed_out: boolean - _shards: ShardStatistics - hits: SearchHitsMetadata - aggregations?: Record - _clusters?: ClusterStatistics - fields?: Record - max_score?: double - num_reduce_phases?: long - profile?: SearchProfile - pit_id?: Id - _scroll_id?: ScrollId - suggest?: Record[]> - terminated_early?: boolean -} - -export interface GraphConnection { - doc_count: long - source: long - target: long - weight: double -} - -export interface GraphExploreControls { - sample_diversity?: GraphSampleDiversity - sample_size?: integer - timeout?: Duration - use_significance: boolean -} - -export interface GraphHop { - connections?: GraphHop - query: QueryDslQueryContainer - vertices: GraphVertexDefinition[] -} - -export interface GraphSampleDiversity { - field: Field - max_docs_per_value: integer -} - -export interface GraphVertex { - depth: long - field: Field - term: string - weight: double -} - -export interface GraphVertexDefinition { - exclude?: string[] - field: Field - include?: GraphVertexInclude[] - min_doc_count?: long - shard_min_doc_count?: long - size?: integer -} - -export interface GraphVertexInclude { - boost: double - term: string -} - -export interface GraphExploreRequest extends RequestBase { - index: Indices - routing?: Routing - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - connections?: GraphHop - controls?: GraphExploreControls - query?: QueryDslQueryContainer - vertices?: GraphVertexDefinition[] - } -} - -export interface GraphExploreResponse { - connections: GraphConnection[] - failures: ShardFailure[] - timed_out: boolean - took: long - vertices: GraphVertex[] -} - -export interface IlmActions { - allocate?: IlmAllocateAction - delete?: IlmDeleteAction - downsample?: IlmDownsampleAction - freeze?: EmptyObject - forcemerge?: IlmForceMergeAction - migrate?: IlmMigrateAction - readonly?: EmptyObject - rollover?: IlmRolloverAction - set_priority?: IlmSetPriorityAction - searchable_snapshot?: IlmSearchableSnapshotAction - shrink?: IlmShrinkAction - unfollow?: EmptyObject - wait_for_snapshot?: IlmWaitForSnapshotAction -} - -export interface IlmAllocateAction { - number_of_replicas?: integer - total_shards_per_node?: integer - include?: Record - exclude?: Record - require?: Record -} - -export interface IlmDeleteAction { - delete_searchable_snapshot?: boolean -} - -export interface IlmDownsampleAction { - fixed_interval: DurationLarge - wait_timeout?: Duration -} - -export interface IlmForceMergeAction { - max_num_segments: integer - index_codec?: string -} - -export interface IlmMigrateAction { - enabled?: boolean -} - -export interface IlmPhase { - actions?: IlmActions - min_age?: Duration | long -} - -export interface IlmPhases { - cold?: IlmPhase - delete?: IlmPhase - frozen?: IlmPhase - hot?: IlmPhase - warm?: IlmPhase -} - -export interface IlmPolicy { - phases: IlmPhases - _meta?: Metadata -} - -export interface IlmRolloverAction { - max_size?: ByteSize - max_primary_shard_size?: ByteSize - max_age?: Duration - max_docs?: long - max_primary_shard_docs?: long - min_size?: ByteSize - min_primary_shard_size?: ByteSize - min_age?: Duration - min_docs?: long - min_primary_shard_docs?: long -} - -export interface IlmSearchableSnapshotAction { - snapshot_repository: string - force_merge_index?: boolean -} - -export interface IlmSetPriorityAction { - priority?: integer -} - -export interface IlmShrinkAction { - number_of_shards?: integer - max_primary_shard_size?: ByteSize - allow_write_after_shrink?: boolean -} - -export interface IlmWaitForSnapshotAction { - policy: string -} - -export interface IlmDeleteLifecycleRequest extends RequestBase { - name: Name - master_timeout?: Duration - timeout?: Duration -} - -export type IlmDeleteLifecycleResponse = AcknowledgedResponseBase - -export type IlmExplainLifecycleLifecycleExplain = IlmExplainLifecycleLifecycleExplainManaged | IlmExplainLifecycleLifecycleExplainUnmanaged - -export interface IlmExplainLifecycleLifecycleExplainManaged { - action?: Name - action_time?: DateTime - action_time_millis?: EpochTime - age?: Duration - failed_step?: Name - failed_step_retry_count?: integer - index?: IndexName - index_creation_date?: DateTime - index_creation_date_millis?: EpochTime - is_auto_retryable_error?: boolean - lifecycle_date?: DateTime - lifecycle_date_millis?: EpochTime - managed: true - phase: Name - phase_time?: DateTime - phase_time_millis?: EpochTime - policy: Name - step?: Name - step_info?: Record - step_time?: DateTime - step_time_millis?: EpochTime - phase_execution?: IlmExplainLifecycleLifecycleExplainPhaseExecution - time_since_index_creation?: Duration -} - -export interface IlmExplainLifecycleLifecycleExplainPhaseExecution { - policy: Name - version: VersionNumber - modified_date_in_millis: EpochTime -} - -export interface IlmExplainLifecycleLifecycleExplainUnmanaged { - index: IndexName - managed: false -} - -export interface IlmExplainLifecycleRequest extends RequestBase { - index: IndexName - only_errors?: boolean - only_managed?: boolean - master_timeout?: Duration - timeout?: Duration -} - -export interface IlmExplainLifecycleResponse { - indices: Record -} - -export interface IlmGetLifecycleLifecycle { - modified_date: DateTime - policy: IlmPolicy - version: VersionNumber -} - -export interface IlmGetLifecycleRequest extends RequestBase { - name?: Name - master_timeout?: Duration - timeout?: Duration -} - -export type IlmGetLifecycleResponse = Record - -export interface IlmGetStatusRequest extends RequestBase { -} - -export interface IlmGetStatusResponse { - operation_mode: LifecycleOperationMode -} - -export interface IlmMigrateToDataTiersRequest extends RequestBase { - dry_run?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - legacy_template_to_delete?: string - node_attribute?: string - } -} - -export interface IlmMigrateToDataTiersResponse { - dry_run: boolean - removed_legacy_template: string - migrated_ilm_policies: string[] - migrated_indices: Indices - migrated_legacy_templates: string[] - migrated_composable_templates: string[] - migrated_component_templates: string[] -} - -export interface IlmMoveToStepRequest extends RequestBase { - index: IndexName - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - current_step: IlmMoveToStepStepKey - next_step: IlmMoveToStepStepKey - } -} - -export type IlmMoveToStepResponse = AcknowledgedResponseBase - -export interface IlmMoveToStepStepKey { - action?: string - name?: string - phase: string -} - -export interface IlmPutLifecycleRequest extends RequestBase { - name: Name - master_timeout?: Duration - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - policy?: IlmPolicy - } -} - -export type IlmPutLifecycleResponse = AcknowledgedResponseBase - -export interface IlmRemovePolicyRequest extends RequestBase { - index: IndexName -} - -export interface IlmRemovePolicyResponse { - failed_indexes: IndexName[] - has_failures: boolean -} - -export interface IlmRetryRequest extends RequestBase { - index: IndexName -} - -export type IlmRetryResponse = AcknowledgedResponseBase - -export interface IlmStartRequest extends RequestBase { - master_timeout?: Duration - timeout?: Duration -} - -export type IlmStartResponse = AcknowledgedResponseBase - -export interface IlmStopRequest extends RequestBase { - master_timeout?: Duration - timeout?: Duration -} - -export type IlmStopResponse = AcknowledgedResponseBase - -export interface IndicesAlias { - filter?: QueryDslQueryContainer - index_routing?: Routing - is_hidden?: boolean - is_write_index?: boolean - routing?: Routing - search_routing?: Routing -} - -export interface IndicesAliasDefinition { - filter?: QueryDslQueryContainer - index_routing?: string - is_write_index?: boolean - routing?: string - search_routing?: string - is_hidden?: boolean -} - -export interface IndicesCacheQueries { - enabled: boolean -} - -export interface IndicesDataStream { - _meta?: Metadata - allow_custom_routing?: boolean - failure_store?: IndicesFailureStore - generation: integer - hidden: boolean - ilm_policy?: Name - next_generation_managed_by: IndicesManagedBy - prefer_ilm: boolean - indices: IndicesDataStreamIndex[] - lifecycle?: IndicesDataStreamLifecycleWithRollover - name: DataStreamName - replicated?: boolean - rollover_on_write: boolean - status: HealthStatus - system?: boolean - template: Name - timestamp_field: IndicesDataStreamTimestampField -} - -export interface IndicesDataStreamIndex { - index_name: IndexName - index_uuid: Uuid - ilm_policy?: Name - managed_by?: IndicesManagedBy - prefer_ilm?: boolean -} - -export interface IndicesDataStreamLifecycle { - data_retention?: Duration - downsampling?: IndicesDataStreamLifecycleDownsampling -} - -export interface IndicesDataStreamLifecycleDownsampling { - rounds: IndicesDownsamplingRound[] -} - -export interface IndicesDataStreamLifecycleRolloverConditions { - min_age?: Duration - max_age?: string - min_docs?: long - max_docs?: long - min_size?: ByteSize - max_size?: ByteSize - min_primary_shard_size?: ByteSize - max_primary_shard_size?: ByteSize - min_primary_shard_docs?: long - max_primary_shard_docs?: long -} - -export interface IndicesDataStreamLifecycleWithRollover { - data_retention?: Duration - downsampling?: IndicesDataStreamLifecycleDownsampling - rollover?: IndicesDataStreamLifecycleRolloverConditions -} - -export interface IndicesDataStreamTimestampField { - name: Field -} - -export interface IndicesDataStreamVisibility { - hidden?: boolean - allow_custom_routing?: boolean -} - -export interface IndicesDownsampleConfig { - fixed_interval: DurationLarge -} - -export interface IndicesDownsamplingRound { - after: Duration - config: IndicesDownsampleConfig -} - -export interface IndicesFailureStore { - enabled: boolean - indices: IndicesDataStreamIndex[] - rollover_on_write: boolean -} - -export interface IndicesFielddataFrequencyFilter { - max: double - min: double - min_segment_size: integer -} - -export type IndicesIndexCheckOnStartup = boolean | 'true' | 'false' | 'checksum' - -export interface IndicesIndexRouting { - allocation?: IndicesIndexRoutingAllocation - rebalance?: IndicesIndexRoutingRebalance -} - -export interface IndicesIndexRoutingAllocation { - enable?: IndicesIndexRoutingAllocationOptions - include?: IndicesIndexRoutingAllocationInclude - initial_recovery?: IndicesIndexRoutingAllocationInitialRecovery - disk?: IndicesIndexRoutingAllocationDisk -} - -export interface IndicesIndexRoutingAllocationDisk { - threshold_enabled?: boolean | string -} - -export interface IndicesIndexRoutingAllocationInclude { - _tier_preference?: string - _id?: Id -} - -export interface IndicesIndexRoutingAllocationInitialRecovery { - _id?: Id -} - -export type IndicesIndexRoutingAllocationOptions = 'all' | 'primaries' | 'new_primaries' | 'none' - -export interface IndicesIndexRoutingRebalance { - enable: IndicesIndexRoutingRebalanceOptions -} - -export type IndicesIndexRoutingRebalanceOptions = 'all' | 'primaries' | 'replicas' | 'none' - -export interface IndicesIndexSegmentSort { - field?: Fields - order?: IndicesSegmentSortOrder | IndicesSegmentSortOrder[] - mode?: IndicesSegmentSortMode | IndicesSegmentSortMode[] - missing?: IndicesSegmentSortMissing | IndicesSegmentSortMissing[] -} - -export interface IndicesIndexSettingBlocks { - read_only?: SpecUtilsStringified - read_only_allow_delete?: SpecUtilsStringified - read?: SpecUtilsStringified - write?: SpecUtilsStringified - metadata?: SpecUtilsStringified -} - -export interface IndicesIndexSettingsKeys { - index?: IndicesIndexSettings - mode?: string - routing_path?: string | string[] - soft_deletes?: IndicesSoftDeletes - sort?: IndicesIndexSegmentSort - number_of_shards?: integer | string - number_of_replicas?: integer | string - number_of_routing_shards?: integer - check_on_startup?: IndicesIndexCheckOnStartup - codec?: string - routing_partition_size?: SpecUtilsStringified - load_fixed_bitset_filters_eagerly?: boolean - hidden?: boolean | string - auto_expand_replicas?: string - merge?: IndicesMerge - search?: IndicesSettingsSearch - refresh_interval?: Duration - max_result_window?: integer - max_inner_result_window?: integer - max_rescore_window?: integer - max_docvalue_fields_search?: integer - max_script_fields?: integer - max_ngram_diff?: integer - max_shingle_diff?: integer - blocks?: IndicesIndexSettingBlocks - max_refresh_listeners?: integer - analyze?: IndicesSettingsAnalyze - highlight?: IndicesSettingsHighlight - max_terms_count?: integer - max_regex_length?: integer - routing?: IndicesIndexRouting - gc_deletes?: Duration - default_pipeline?: PipelineName - final_pipeline?: PipelineName - lifecycle?: IndicesIndexSettingsLifecycle - provided_name?: Name - creation_date?: SpecUtilsStringified> - creation_date_string?: DateTime - uuid?: Uuid - version?: IndicesIndexVersioning - verified_before_close?: boolean | string - format?: string | integer - max_slices_per_scroll?: integer - translog?: IndicesTranslog - query_string?: IndicesSettingsQueryString - priority?: integer | string - top_metrics_max_size?: integer - analysis?: IndicesIndexSettingsAnalysis - settings?: IndicesIndexSettings - time_series?: IndicesIndexSettingsTimeSeries - queries?: IndicesQueries - similarity?: Record - mapping?: IndicesMappingLimitSettings - 'indexing.slowlog'?: IndicesIndexingSlowlogSettings - indexing_pressure?: IndicesIndexingPressure - store?: IndicesStorage -} -export type IndicesIndexSettings = IndicesIndexSettingsKeys -& { [property: string]: any } - -export interface IndicesIndexSettingsAnalysis { - analyzer?: Record - char_filter?: Record - filter?: Record - normalizer?: Record - tokenizer?: Record -} - -export interface IndicesIndexSettingsLifecycle { - name?: Name - indexing_complete?: SpecUtilsStringified - origination_date?: long - parse_origination_date?: boolean - step?: IndicesIndexSettingsLifecycleStep - rollover_alias?: string -} - -export interface IndicesIndexSettingsLifecycleStep { - wait_time_threshold?: Duration -} - -export interface IndicesIndexSettingsTimeSeries { - end_time?: DateTime - start_time?: DateTime -} - -export interface IndicesIndexState { - aliases?: Record - mappings?: MappingTypeMapping - settings?: IndicesIndexSettings - defaults?: IndicesIndexSettings - data_stream?: DataStreamName - lifecycle?: IndicesDataStreamLifecycle -} - -export interface IndicesIndexTemplate { - index_patterns: Names - composed_of: Name[] - template?: IndicesIndexTemplateSummary - version?: VersionNumber - priority?: long - _meta?: Metadata - allow_auto_create?: boolean - data_stream?: IndicesIndexTemplateDataStreamConfiguration - deprecated?: boolean - ignore_missing_component_templates?: Names -} - -export interface IndicesIndexTemplateDataStreamConfiguration { - hidden?: boolean - allow_custom_routing?: boolean -} - -export interface IndicesIndexTemplateSummary { - aliases?: Record - mappings?: MappingTypeMapping - settings?: IndicesIndexSettings - lifecycle?: IndicesDataStreamLifecycleWithRollover -} - -export interface IndicesIndexVersioning { - created?: VersionString - created_string?: string -} - -export interface IndicesIndexingPressure { - memory: IndicesIndexingPressureMemory -} - -export interface IndicesIndexingPressureMemory { - limit?: integer -} - -export interface IndicesIndexingSlowlogSettings { - level?: string - source?: integer - reformat?: boolean - threshold?: IndicesIndexingSlowlogTresholds -} - -export interface IndicesIndexingSlowlogTresholds { - index?: IndicesSlowlogTresholdLevels -} - -export type IndicesManagedBy = 'Index Lifecycle Management' | 'Data stream lifecycle' | 'Unmanaged' - -export interface IndicesMappingLimitSettings { - coerce?: boolean - total_fields?: IndicesMappingLimitSettingsTotalFields - depth?: IndicesMappingLimitSettingsDepth - nested_fields?: IndicesMappingLimitSettingsNestedFields - nested_objects?: IndicesMappingLimitSettingsNestedObjects - field_name_length?: IndicesMappingLimitSettingsFieldNameLength - dimension_fields?: IndicesMappingLimitSettingsDimensionFields - ignore_malformed?: boolean -} - -export interface IndicesMappingLimitSettingsDepth { - limit?: long -} - -export interface IndicesMappingLimitSettingsDimensionFields { - limit?: long -} - -export interface IndicesMappingLimitSettingsFieldNameLength { - limit?: long -} - -export interface IndicesMappingLimitSettingsNestedFields { - limit?: long -} - -export interface IndicesMappingLimitSettingsNestedObjects { - limit?: long -} - -export interface IndicesMappingLimitSettingsTotalFields { - limit?: long - ignore_dynamic_beyond_limit?: boolean -} - -export interface IndicesMerge { - scheduler?: IndicesMergeScheduler -} - -export interface IndicesMergeScheduler { - max_thread_count?: SpecUtilsStringified - max_merge_count?: SpecUtilsStringified -} - -export interface IndicesNumericFielddata { - format: IndicesNumericFielddataFormat -} - -export type IndicesNumericFielddataFormat = 'array' | 'disabled' - -export interface IndicesQueries { - cache?: IndicesCacheQueries -} - -export interface IndicesRetentionLease { - period: Duration -} - -export interface IndicesSearchIdle { - after?: Duration -} - -export type IndicesSegmentSortMissing = '_last' | '_first' - -export type IndicesSegmentSortMode = 'min' | 'MIN' | 'max' | 'MAX' - -export type IndicesSegmentSortOrder = 'asc' | 'ASC' | 'desc' | 'DESC' - -export interface IndicesSettingsAnalyze { - max_token_count?: SpecUtilsStringified -} - -export interface IndicesSettingsHighlight { - max_analyzed_offset?: integer -} - -export interface IndicesSettingsQueryString { - lenient: SpecUtilsStringified -} - -export interface IndicesSettingsSearch { - idle?: IndicesSearchIdle - slowlog?: IndicesSlowlogSettings -} - -export type IndicesSettingsSimilarity = IndicesSettingsSimilarityBm25 | IndicesSettingsSimilarityBoolean | IndicesSettingsSimilarityDfi | IndicesSettingsSimilarityDfr | IndicesSettingsSimilarityIb | IndicesSettingsSimilarityLmd | IndicesSettingsSimilarityLmj | IndicesSettingsSimilarityScripted - -export interface IndicesSettingsSimilarityBm25 { - type: 'BM25' - b?: double - discount_overlaps?: boolean - k1?: double -} - -export interface IndicesSettingsSimilarityBoolean { - type: 'boolean' -} - -export interface IndicesSettingsSimilarityDfi { - type: 'DFI' - independence_measure: DFIIndependenceMeasure -} - -export interface IndicesSettingsSimilarityDfr { - type: 'DFR' - after_effect: DFRAfterEffect - basic_model: DFRBasicModel - normalization: Normalization -} - -export interface IndicesSettingsSimilarityIb { - type: 'IB' - distribution: IBDistribution - lambda: IBLambda - normalization: Normalization -} - -export interface IndicesSettingsSimilarityLmd { - type: 'LMDirichlet' - mu?: double -} - -export interface IndicesSettingsSimilarityLmj { - type: 'LMJelinekMercer' - lambda?: double -} - -export interface IndicesSettingsSimilarityScripted { - type: 'scripted' - script: Script | string - weight_script?: Script | string -} - -export interface IndicesSlowlogSettings { - level?: string - source?: integer - reformat?: boolean - threshold?: IndicesSlowlogTresholds -} - -export interface IndicesSlowlogTresholdLevels { - warn?: Duration - info?: Duration - debug?: Duration - trace?: Duration -} - -export interface IndicesSlowlogTresholds { - query?: IndicesSlowlogTresholdLevels - fetch?: IndicesSlowlogTresholdLevels -} - -export interface IndicesSoftDeletes { - enabled?: boolean - retention_lease?: IndicesRetentionLease -} - -export interface IndicesStorage { - type: IndicesStorageType - allow_mmap?: boolean -} - -export type IndicesStorageType = 'fs' | 'niofs' | 'mmapfs' | 'hybridfs' | string - -export interface IndicesTemplateMapping { - aliases: Record - index_patterns: Name[] - mappings: MappingTypeMapping - order: integer - settings: Record - version?: VersionNumber -} - -export interface IndicesTranslog { - sync_interval?: Duration - durability?: IndicesTranslogDurability - flush_threshold_size?: ByteSize - retention?: IndicesTranslogRetention -} - -export type IndicesTranslogDurability = 'request' | 'REQUEST' | 'async' | 'ASYNC' - -export interface IndicesTranslogRetention { - size?: ByteSize - age?: Duration -} - -export type IndicesAddBlockIndicesBlockOptions = 'metadata' | 'read' | 'read_only' | 'write' - -export interface IndicesAddBlockIndicesBlockStatus { - name: IndexName - blocked: boolean -} - -export interface IndicesAddBlockRequest extends RequestBase { - index: IndexName - block: IndicesAddBlockIndicesBlockOptions - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - master_timeout?: Duration - timeout?: Duration -} - -export interface IndicesAddBlockResponse { - acknowledged: boolean - shards_acknowledged: boolean - indices: IndicesAddBlockIndicesBlockStatus[] -} - -export interface IndicesAnalyzeAnalyzeDetail { - analyzer?: IndicesAnalyzeAnalyzerDetail - charfilters?: IndicesAnalyzeCharFilterDetail[] - custom_analyzer: boolean - tokenfilters?: IndicesAnalyzeTokenDetail[] - tokenizer?: IndicesAnalyzeTokenDetail -} - -export interface IndicesAnalyzeAnalyzeToken { - end_offset: long - position: long - positionLength?: long - start_offset: long - token: string - type: string -} - -export interface IndicesAnalyzeAnalyzerDetail { - name: string - tokens: IndicesAnalyzeExplainAnalyzeToken[] -} - -export interface IndicesAnalyzeCharFilterDetail { - filtered_text: string[] - name: string -} - -export interface IndicesAnalyzeExplainAnalyzeTokenKeys { - bytes: string - end_offset: long - keyword?: boolean - position: long - positionLength: long - start_offset: long - termFrequency: long - token: string - type: string -} -export type IndicesAnalyzeExplainAnalyzeToken = IndicesAnalyzeExplainAnalyzeTokenKeys -& { [property: string]: any } - -export interface IndicesAnalyzeRequest extends RequestBase { - index?: IndexName - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - analyzer?: string - attributes?: string[] - char_filter?: AnalysisCharFilter[] - explain?: boolean - field?: Field - filter?: AnalysisTokenFilter[] - normalizer?: string - text?: IndicesAnalyzeTextToAnalyze - tokenizer?: AnalysisTokenizer - } -} - -export interface IndicesAnalyzeResponse { - detail?: IndicesAnalyzeAnalyzeDetail - tokens?: IndicesAnalyzeAnalyzeToken[] -} - -export type IndicesAnalyzeTextToAnalyze = string | string[] - -export interface IndicesAnalyzeTokenDetail { - name: string - tokens: IndicesAnalyzeExplainAnalyzeToken[] -} - -export interface IndicesClearCacheRequest extends RequestBase { - index?: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - fielddata?: boolean - fields?: Fields - ignore_unavailable?: boolean - query?: boolean - request?: boolean -} - -export type IndicesClearCacheResponse = ShardsOperationResponseBase - -export interface IndicesCloneRequest extends RequestBase { - index: IndexName - target: Name - master_timeout?: Duration - timeout?: Duration - wait_for_active_shards?: WaitForActiveShards - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - aliases?: Record - settings?: Record - } -} - -export interface IndicesCloneResponse { - acknowledged: boolean - index: IndexName - shards_acknowledged: boolean -} - -export interface IndicesCloseCloseIndexResult { - closed: boolean - shards?: Record -} - -export interface IndicesCloseCloseShardResult { - failures: ShardFailure[] -} - -export interface IndicesCloseRequest extends RequestBase { - index: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - master_timeout?: Duration - timeout?: Duration - wait_for_active_shards?: WaitForActiveShards -} - -export interface IndicesCloseResponse { - acknowledged: boolean - indices: Record - shards_acknowledged: boolean -} - -export interface IndicesCreateRequest extends RequestBase { - index: IndexName - master_timeout?: Duration - timeout?: Duration - wait_for_active_shards?: WaitForActiveShards - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - aliases?: Record - mappings?: MappingTypeMapping - settings?: IndicesIndexSettings - } -} - -export interface IndicesCreateResponse { - index: IndexName - shards_acknowledged: boolean - acknowledged: boolean -} - -export interface IndicesCreateDataStreamRequest extends RequestBase { - name: DataStreamName - master_timeout?: Duration - timeout?: Duration -} - -export type IndicesCreateDataStreamResponse = AcknowledgedResponseBase - -export interface IndicesDataStreamsStatsDataStreamsStatsItem { - backing_indices: integer - data_stream: Name - maximum_timestamp: EpochTime - store_size?: ByteSize - store_size_bytes: long -} - -export interface IndicesDataStreamsStatsRequest extends RequestBase { - name?: IndexName - expand_wildcards?: ExpandWildcards -} - -export interface IndicesDataStreamsStatsResponse { - _shards: ShardStatistics - backing_indices: integer - data_stream_count: integer - data_streams: IndicesDataStreamsStatsDataStreamsStatsItem[] - total_store_sizes?: ByteSize - total_store_size_bytes: long -} - -export interface IndicesDeleteRequest extends RequestBase { - index: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - master_timeout?: Duration - timeout?: Duration -} - -export type IndicesDeleteResponse = IndicesResponseBase - -export interface IndicesDeleteAliasRequest extends RequestBase { - index: Indices - name: Names - master_timeout?: Duration - timeout?: Duration -} - -export type IndicesDeleteAliasResponse = AcknowledgedResponseBase - -export interface IndicesDeleteDataLifecycleRequest extends RequestBase { - name: DataStreamNames - expand_wildcards?: ExpandWildcards - master_timeout?: Duration - timeout?: Duration -} - -export type IndicesDeleteDataLifecycleResponse = AcknowledgedResponseBase - -export interface IndicesDeleteDataStreamRequest extends RequestBase { - name: DataStreamNames - master_timeout?: Duration - expand_wildcards?: ExpandWildcards -} - -export type IndicesDeleteDataStreamResponse = AcknowledgedResponseBase - -export interface IndicesDeleteIndexTemplateRequest extends RequestBase { - name: Names - master_timeout?: Duration - timeout?: Duration -} - -export type IndicesDeleteIndexTemplateResponse = AcknowledgedResponseBase - -export interface IndicesDeleteTemplateRequest extends RequestBase { - name: Name - master_timeout?: Duration - timeout?: Duration -} - -export type IndicesDeleteTemplateResponse = AcknowledgedResponseBase - -export interface IndicesDiskUsageRequest extends RequestBase { - index: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - flush?: boolean - ignore_unavailable?: boolean - run_expensive_tasks?: boolean -} - -export type IndicesDiskUsageResponse = any - -export interface IndicesDownsampleRequest extends RequestBase { - index: IndexName - target_index: IndexName - /** @deprecated The use of the 'body' key has been deprecated, use 'config' instead. */ - body?: IndicesDownsampleConfig -} - -export type IndicesDownsampleResponse = any - -export interface IndicesExistsRequest extends RequestBase { - index: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - flat_settings?: boolean - ignore_unavailable?: boolean - include_defaults?: boolean - local?: boolean -} - -export type IndicesExistsResponse = boolean - -export interface IndicesExistsAliasRequest extends RequestBase { - name: Names - index?: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - local?: boolean -} - -export type IndicesExistsAliasResponse = boolean - -export interface IndicesExistsIndexTemplateRequest extends RequestBase { - name: Name - master_timeout?: Duration -} - -export type IndicesExistsIndexTemplateResponse = boolean - -export interface IndicesExistsTemplateRequest extends RequestBase { - name: Names - flat_settings?: boolean - local?: boolean - master_timeout?: Duration -} - -export type IndicesExistsTemplateResponse = boolean - -export interface IndicesExplainDataLifecycleDataStreamLifecycleExplain { - index: IndexName - managed_by_lifecycle: boolean - index_creation_date_millis?: EpochTime - time_since_index_creation?: Duration - rollover_date_millis?: EpochTime - time_since_rollover?: Duration - lifecycle?: IndicesDataStreamLifecycleWithRollover - generation_time?: Duration - error?: string -} - -export interface IndicesExplainDataLifecycleRequest extends RequestBase { - index: Indices - include_defaults?: boolean - master_timeout?: Duration -} - -export interface IndicesExplainDataLifecycleResponse { - indices: Record -} - -export interface IndicesFieldUsageStatsFieldSummary { - any: uint - stored_fields: uint - doc_values: uint - points: uint - norms: uint - term_vectors: uint - knn_vectors: uint - inverted_index: IndicesFieldUsageStatsInvertedIndex -} - -export interface IndicesFieldUsageStatsFieldsUsageBodyKeys { - _shards: ShardStatistics -} -export type IndicesFieldUsageStatsFieldsUsageBody = IndicesFieldUsageStatsFieldsUsageBodyKeys -& { [property: string]: IndicesFieldUsageStatsUsageStatsIndex | ShardStatistics } - -export interface IndicesFieldUsageStatsInvertedIndex { - terms: uint - postings: uint - proximity: uint - positions: uint - term_frequencies: uint - offsets: uint - payloads: uint -} - -export interface IndicesFieldUsageStatsRequest extends RequestBase { - index: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - fields?: Fields - master_timeout?: Duration - timeout?: Duration - wait_for_active_shards?: WaitForActiveShards -} - -export type IndicesFieldUsageStatsResponse = IndicesFieldUsageStatsFieldsUsageBody - -export interface IndicesFieldUsageStatsShardsStats { - all_fields: IndicesFieldUsageStatsFieldSummary - fields: Record -} - -export interface IndicesFieldUsageStatsUsageStatsIndex { - shards: IndicesFieldUsageStatsUsageStatsShards[] -} - -export interface IndicesFieldUsageStatsUsageStatsShards { - routing: IndicesStatsShardRouting - stats: IndicesFieldUsageStatsShardsStats - tracking_id: string - tracking_started_at_millis: EpochTime -} - -export interface IndicesFlushRequest extends RequestBase { - index?: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - force?: boolean - ignore_unavailable?: boolean - wait_if_ongoing?: boolean -} - -export type IndicesFlushResponse = ShardsOperationResponseBase - -export interface IndicesForcemergeRequest extends RequestBase { - index?: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - flush?: boolean - ignore_unavailable?: boolean - max_num_segments?: long - only_expunge_deletes?: boolean - wait_for_completion?: boolean -} - -export type IndicesForcemergeResponse = IndicesForcemergeForceMergeResponseBody - -export interface IndicesForcemergeForceMergeResponseBody extends ShardsOperationResponseBase { - task?: string -} - -export type IndicesGetFeature = 'aliases' | 'mappings' | 'settings' - -export type IndicesGetFeatures = IndicesGetFeature | IndicesGetFeature[] - -export interface IndicesGetRequest extends RequestBase { - index: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - flat_settings?: boolean - ignore_unavailable?: boolean - include_defaults?: boolean - local?: boolean - master_timeout?: Duration - features?: IndicesGetFeatures -} - -export type IndicesGetResponse = Record - -export interface IndicesGetAliasIndexAliases { - aliases: Record -} - -export interface IndicesGetAliasRequest extends RequestBase { - name?: Names - index?: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - local?: boolean -} - -export type IndicesGetAliasResponse = Record - -export interface IndicesGetDataLifecycleDataStreamWithLifecycle { - name: DataStreamName - lifecycle?: IndicesDataStreamLifecycle -} - -export interface IndicesGetDataLifecycleRequest extends RequestBase { - name: DataStreamNames - expand_wildcards?: ExpandWildcards - include_defaults?: boolean - master_timeout?: Duration -} - -export interface IndicesGetDataLifecycleResponse { - data_streams: IndicesGetDataLifecycleDataStreamWithLifecycle[] -} - -export interface IndicesGetDataStreamRequest extends RequestBase { - name?: DataStreamNames - expand_wildcards?: ExpandWildcards - include_defaults?: boolean - master_timeout?: Duration - verbose?: boolean -} - -export interface IndicesGetDataStreamResponse { - data_streams: IndicesDataStream[] -} - -export interface IndicesGetFieldMappingRequest extends RequestBase { - fields: Fields - index?: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - include_defaults?: boolean - local?: boolean -} - -export type IndicesGetFieldMappingResponse = Record - -export interface IndicesGetFieldMappingTypeFieldMappings { - mappings: Record -} - -export interface IndicesGetIndexTemplateIndexTemplateItem { - name: Name - index_template: IndicesIndexTemplate -} - -export interface IndicesGetIndexTemplateRequest extends RequestBase { - name?: Name - local?: boolean - flat_settings?: boolean - master_timeout?: Duration - include_defaults?: boolean -} - -export interface IndicesGetIndexTemplateResponse { - index_templates: IndicesGetIndexTemplateIndexTemplateItem[] -} - -export interface IndicesGetMappingIndexMappingRecord { - item?: MappingTypeMapping - mappings: MappingTypeMapping -} - -export interface IndicesGetMappingRequest extends RequestBase { - index?: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - local?: boolean - master_timeout?: Duration -} - -export type IndicesGetMappingResponse = Record - -export interface IndicesGetSettingsRequest extends RequestBase { - index?: Indices - name?: Names - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - flat_settings?: boolean - ignore_unavailable?: boolean - include_defaults?: boolean - local?: boolean - master_timeout?: Duration -} - -export type IndicesGetSettingsResponse = Record - -export interface IndicesGetTemplateRequest extends RequestBase { - name?: Names - flat_settings?: boolean - local?: boolean - master_timeout?: Duration -} - -export type IndicesGetTemplateResponse = Record - -export interface IndicesMigrateToDataStreamRequest extends RequestBase { - name: IndexName - master_timeout?: Duration - timeout?: Duration -} - -export type IndicesMigrateToDataStreamResponse = AcknowledgedResponseBase - -export interface IndicesModifyDataStreamAction { - add_backing_index?: IndicesModifyDataStreamIndexAndDataStreamAction - remove_backing_index?: IndicesModifyDataStreamIndexAndDataStreamAction -} - -export interface IndicesModifyDataStreamIndexAndDataStreamAction { - data_stream: DataStreamName - index: IndexName -} - -export interface IndicesModifyDataStreamRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - actions: IndicesModifyDataStreamAction[] - } -} - -export type IndicesModifyDataStreamResponse = AcknowledgedResponseBase - -export interface IndicesOpenRequest extends RequestBase { - index: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - master_timeout?: Duration - timeout?: Duration - wait_for_active_shards?: WaitForActiveShards -} - -export interface IndicesOpenResponse { - acknowledged: boolean - shards_acknowledged: boolean -} - -export interface IndicesPromoteDataStreamRequest extends RequestBase { - name: IndexName - master_timeout?: Duration -} - -export type IndicesPromoteDataStreamResponse = any - -export interface IndicesPutAliasRequest extends RequestBase { - index: Indices - name: Name - master_timeout?: Duration - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - filter?: QueryDslQueryContainer - index_routing?: Routing - is_write_index?: boolean - routing?: Routing - search_routing?: Routing - } -} - -export type IndicesPutAliasResponse = AcknowledgedResponseBase - -export interface IndicesPutDataLifecycleRequest extends RequestBase { - name: DataStreamNames - expand_wildcards?: ExpandWildcards - master_timeout?: Duration - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - data_retention?: Duration - downsampling?: IndicesDataStreamLifecycleDownsampling - } -} - -export type IndicesPutDataLifecycleResponse = AcknowledgedResponseBase - -export interface IndicesPutIndexTemplateIndexTemplateMapping { - aliases?: Record - mappings?: MappingTypeMapping - settings?: IndicesIndexSettings - lifecycle?: IndicesDataStreamLifecycle -} - -export interface IndicesPutIndexTemplateRequest extends RequestBase { - name: Name - create?: boolean - master_timeout?: Duration - cause?: string - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - index_patterns?: Indices - composed_of?: Name[] - template?: IndicesPutIndexTemplateIndexTemplateMapping - data_stream?: IndicesDataStreamVisibility - priority?: long - version?: VersionNumber - _meta?: Metadata - allow_auto_create?: boolean - ignore_missing_component_templates?: string[] - deprecated?: boolean - } -} - -export type IndicesPutIndexTemplateResponse = AcknowledgedResponseBase - -export interface IndicesPutMappingRequest extends RequestBase { - index: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - master_timeout?: Duration - timeout?: Duration - write_index_only?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - date_detection?: boolean - dynamic?: MappingDynamicMapping - dynamic_date_formats?: string[] - dynamic_templates?: Record | Record[] - _field_names?: MappingFieldNamesField - _meta?: Metadata - numeric_detection?: boolean - properties?: Record - _routing?: MappingRoutingField - _source?: MappingSourceField - runtime?: MappingRuntimeFields - } -} - -export type IndicesPutMappingResponse = IndicesResponseBase - -export interface IndicesPutSettingsRequest extends RequestBase { - index?: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - flat_settings?: boolean - ignore_unavailable?: boolean - master_timeout?: Duration - preserve_existing?: boolean - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, use 'settings' instead. */ - body?: IndicesIndexSettings -} - -export type IndicesPutSettingsResponse = AcknowledgedResponseBase - -export interface IndicesPutTemplateRequest extends RequestBase { - name: Name - create?: boolean - master_timeout?: Duration - cause?: string - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - aliases?: Record - index_patterns?: string | string[] - mappings?: MappingTypeMapping - order?: integer - settings?: IndicesIndexSettings - version?: VersionNumber - } -} - -export type IndicesPutTemplateResponse = AcknowledgedResponseBase - -export interface IndicesRecoveryFileDetails { - length: long - name: string - recovered: long -} - -export interface IndicesRecoveryRecoveryBytes { - percent: Percentage - recovered?: ByteSize - recovered_in_bytes: ByteSize - recovered_from_snapshot?: ByteSize - recovered_from_snapshot_in_bytes?: ByteSize - reused?: ByteSize - reused_in_bytes: ByteSize - total?: ByteSize - total_in_bytes: ByteSize -} - -export interface IndicesRecoveryRecoveryFiles { - details?: IndicesRecoveryFileDetails[] - percent: Percentage - recovered: long - reused: long - total: long -} - -export interface IndicesRecoveryRecoveryIndexStatus { - bytes?: IndicesRecoveryRecoveryBytes - files: IndicesRecoveryRecoveryFiles - size: IndicesRecoveryRecoveryBytes - source_throttle_time?: Duration - source_throttle_time_in_millis: DurationValue - target_throttle_time?: Duration - target_throttle_time_in_millis: DurationValue - total_time?: Duration - total_time_in_millis: DurationValue -} - -export interface IndicesRecoveryRecoveryOrigin { - hostname?: string - host?: Host - transport_address?: TransportAddress - id?: Id - ip?: Ip - name?: Name - bootstrap_new_history_uuid?: boolean - repository?: Name - snapshot?: Name - version?: VersionString - restoreUUID?: Uuid - index?: IndexName -} - -export interface IndicesRecoveryRecoveryStartStatus { - check_index_time?: Duration - check_index_time_in_millis: DurationValue - total_time?: Duration - total_time_in_millis: DurationValue -} - -export interface IndicesRecoveryRecoveryStatus { - shards: IndicesRecoveryShardRecovery[] -} - -export interface IndicesRecoveryRequest extends RequestBase { - index?: Indices - active_only?: boolean - detailed?: boolean -} - -export type IndicesRecoveryResponse = Record - -export interface IndicesRecoveryShardRecovery { - id: long - index: IndicesRecoveryRecoveryIndexStatus - primary: boolean - source: IndicesRecoveryRecoveryOrigin - stage: string - start?: IndicesRecoveryRecoveryStartStatus - start_time?: DateTime - start_time_in_millis: EpochTime - stop_time?: DateTime - stop_time_in_millis?: EpochTime - target: IndicesRecoveryRecoveryOrigin - total_time?: Duration - total_time_in_millis: DurationValue - translog: IndicesRecoveryTranslogStatus - type: string - verify_index: IndicesRecoveryVerifyIndex -} - -export interface IndicesRecoveryTranslogStatus { - percent: Percentage - recovered: long - total: long - total_on_start: long - total_time?: Duration - total_time_in_millis: DurationValue -} - -export interface IndicesRecoveryVerifyIndex { - check_index_time?: Duration - check_index_time_in_millis: DurationValue - total_time?: Duration - total_time_in_millis: DurationValue -} - -export interface IndicesRefreshRequest extends RequestBase { - index?: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean -} - -export type IndicesRefreshResponse = ShardsOperationResponseBase - -export interface IndicesReloadSearchAnalyzersReloadDetails { - index: string - reloaded_analyzers: string[] - reloaded_node_ids: string[] -} - -export interface IndicesReloadSearchAnalyzersReloadResult { - reload_details: IndicesReloadSearchAnalyzersReloadDetails[] - _shards: ShardStatistics -} - -export interface IndicesReloadSearchAnalyzersRequest extends RequestBase { - index: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean -} - -export type IndicesReloadSearchAnalyzersResponse = IndicesReloadSearchAnalyzersReloadResult - -export interface IndicesResolveClusterRequest extends RequestBase { - name: Names - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_throttled?: boolean - ignore_unavailable?: boolean -} - -export interface IndicesResolveClusterResolveClusterInfo { - connected: boolean - skip_unavailable: boolean - matching_indices?: boolean - error?: string - version?: ElasticsearchVersionMinInfo -} - -export type IndicesResolveClusterResponse = Record - -export interface IndicesResolveIndexRequest extends RequestBase { - name: Names - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - allow_no_indices?: boolean -} - -export interface IndicesResolveIndexResolveIndexAliasItem { - name: Name - indices: Indices -} - -export interface IndicesResolveIndexResolveIndexDataStreamsItem { - name: DataStreamName - timestamp_field: Field - backing_indices: Indices -} - -export interface IndicesResolveIndexResolveIndexItem { - name: Name - aliases?: string[] - attributes: string[] - data_stream?: DataStreamName -} - -export interface IndicesResolveIndexResponse { - indices: IndicesResolveIndexResolveIndexItem[] - aliases: IndicesResolveIndexResolveIndexAliasItem[] - data_streams: IndicesResolveIndexResolveIndexDataStreamsItem[] -} - -export interface IndicesRolloverRequest extends RequestBase { - alias: IndexAlias - new_index?: IndexName - dry_run?: boolean - master_timeout?: Duration - timeout?: Duration - wait_for_active_shards?: WaitForActiveShards - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - aliases?: Record - conditions?: IndicesRolloverRolloverConditions - mappings?: MappingTypeMapping - settings?: Record - } -} - -export interface IndicesRolloverResponse { - acknowledged: boolean - conditions: Record - dry_run: boolean - new_index: string - old_index: string - rolled_over: boolean - shards_acknowledged: boolean -} - -export interface IndicesRolloverRolloverConditions { - min_age?: Duration - max_age?: Duration - max_age_millis?: DurationValue - min_docs?: long - max_docs?: long - max_size?: ByteSize - max_size_bytes?: long - min_size?: ByteSize - min_size_bytes?: long - max_primary_shard_size?: ByteSize - max_primary_shard_size_bytes?: long - min_primary_shard_size?: ByteSize - min_primary_shard_size_bytes?: long - max_primary_shard_docs?: long - min_primary_shard_docs?: long -} - -export interface IndicesSegmentsIndexSegment { - shards: Record -} - -export interface IndicesSegmentsRequest extends RequestBase { - index?: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - verbose?: boolean -} - -export interface IndicesSegmentsResponse { - indices: Record - _shards: ShardStatistics -} - -export interface IndicesSegmentsSegment { - attributes: Record - committed: boolean - compound: boolean - deleted_docs: long - generation: integer - search: boolean - size_in_bytes: double - num_docs: long - version: VersionString -} - -export interface IndicesSegmentsShardSegmentRouting { - node: string - primary: boolean - state: string -} - -export interface IndicesSegmentsShardsSegment { - num_committed_segments: integer - routing: IndicesSegmentsShardSegmentRouting - num_search_segments: integer - segments: Record -} - -export interface IndicesShardStoresIndicesShardStores { - shards: Record -} - -export interface IndicesShardStoresRequest extends RequestBase { - index?: Indices - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - status?: IndicesShardStoresShardStoreStatus | IndicesShardStoresShardStoreStatus[] -} - -export interface IndicesShardStoresResponse { - indices: Record -} - -export interface IndicesShardStoresShardStoreKeys { - allocation: IndicesShardStoresShardStoreAllocation - allocation_id?: Id - store_exception?: IndicesShardStoresShardStoreException -} -export type IndicesShardStoresShardStore = IndicesShardStoresShardStoreKeys -& { [property: string]: IndicesShardStoresShardStoreNode | IndicesShardStoresShardStoreAllocation | Id | IndicesShardStoresShardStoreException } - -export type IndicesShardStoresShardStoreAllocation = 'primary' | 'replica' | 'unused' - -export interface IndicesShardStoresShardStoreException { - reason: string - type: string -} - -export interface IndicesShardStoresShardStoreNode { - attributes: Record - ephemeral_id?: string - external_id?: string - name: Name - roles: string[] - transport_address: TransportAddress -} - -export type IndicesShardStoresShardStoreStatus = 'green' | 'yellow' | 'red' | 'all' - -export interface IndicesShardStoresShardStoreWrapper { - stores: IndicesShardStoresShardStore[] -} - -export interface IndicesShrinkRequest extends RequestBase { - index: IndexName - target: IndexName - master_timeout?: Duration - timeout?: Duration - wait_for_active_shards?: WaitForActiveShards - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - aliases?: Record - settings?: Record - } -} - -export interface IndicesShrinkResponse { - acknowledged: boolean - shards_acknowledged: boolean - index: IndexName -} - -export interface IndicesSimulateIndexTemplateRequest extends RequestBase { - name: Name - master_timeout?: Duration - include_defaults?: boolean -} - -export interface IndicesSimulateIndexTemplateResponse { - overlapping?: IndicesSimulateTemplateOverlapping[] - template: IndicesSimulateTemplateTemplate -} - -export interface IndicesSimulateTemplateOverlapping { - name: Name - index_patterns: string[] -} - -export interface IndicesSimulateTemplateRequest extends RequestBase { - name?: Name - create?: boolean - master_timeout?: Duration - include_defaults?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - allow_auto_create?: boolean - index_patterns?: Indices - composed_of?: Name[] - template?: IndicesPutIndexTemplateIndexTemplateMapping - data_stream?: IndicesDataStreamVisibility - priority?: long - version?: VersionNumber - _meta?: Metadata - ignore_missing_component_templates?: string[] - deprecated?: boolean - } -} - -export interface IndicesSimulateTemplateResponse { - overlapping?: IndicesSimulateTemplateOverlapping[] - template: IndicesSimulateTemplateTemplate -} - -export interface IndicesSimulateTemplateTemplate { - aliases: Record - mappings: MappingTypeMapping - settings: IndicesIndexSettings -} - -export interface IndicesSplitRequest extends RequestBase { - index: IndexName - target: IndexName - master_timeout?: Duration - timeout?: Duration - wait_for_active_shards?: WaitForActiveShards - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - aliases?: Record - settings?: Record - } -} - -export interface IndicesSplitResponse { - acknowledged: boolean - shards_acknowledged: boolean - index: IndexName -} - -export type IndicesStatsIndexMetadataState = 'open' | 'close' - -export interface IndicesStatsIndexStats { - completion?: CompletionStats - docs?: DocStats - fielddata?: FielddataStats - flush?: FlushStats - get?: GetStats - indexing?: IndexingStats - indices?: IndicesStatsIndicesStats - merges?: MergesStats - query_cache?: QueryCacheStats - recovery?: RecoveryStats - refresh?: RefreshStats - request_cache?: RequestCacheStats - search?: SearchStats - segments?: SegmentsStats - store?: StoreStats - translog?: TranslogStats - warmer?: WarmerStats - bulk?: BulkStats - shard_stats?: IndicesStatsShardsTotalStats -} - -export interface IndicesStatsIndicesStats { - primaries?: IndicesStatsIndexStats - shards?: Record - total?: IndicesStatsIndexStats - uuid?: Uuid - health?: HealthStatus - status?: IndicesStatsIndexMetadataState -} - -export interface IndicesStatsMappingStats { - total_count: long - total_estimated_overhead?: ByteSize - total_estimated_overhead_in_bytes: long -} - -export interface IndicesStatsRequest extends RequestBase { - metric?: Metrics - index?: Indices - completion_fields?: Fields - expand_wildcards?: ExpandWildcards - fielddata_fields?: Fields - fields?: Fields - forbid_closed_indices?: boolean - groups?: string | string[] - include_segment_file_sizes?: boolean - include_unloaded_segments?: boolean - level?: Level -} - -export interface IndicesStatsResponse { - indices?: Record - _shards: ShardStatistics - _all: IndicesStatsIndicesStats -} - -export interface IndicesStatsShardCommit { - generation: integer - id: Id - num_docs: long - user_data: Record -} - -export interface IndicesStatsShardFileSizeInfo { - description: string - size_in_bytes: long - min_size_in_bytes?: long - max_size_in_bytes?: long - average_size_in_bytes?: long - count?: long -} - -export interface IndicesStatsShardLease { - id: Id - retaining_seq_no: SequenceNumber - timestamp: long - source: string -} - -export interface IndicesStatsShardPath { - data_path: string - is_custom_data_path: boolean - state_path: string -} - -export interface IndicesStatsShardQueryCache { - cache_count: long - cache_size: long - evictions: long - hit_count: long - memory_size_in_bytes: long - miss_count: long - total_count: long -} - -export interface IndicesStatsShardRetentionLeases { - primary_term: long - version: VersionNumber - leases: IndicesStatsShardLease[] -} - -export interface IndicesStatsShardRouting { - node: string - primary: boolean - relocating_node?: string | null - state: IndicesStatsShardRoutingState -} - -export type IndicesStatsShardRoutingState = 'UNASSIGNED' | 'INITIALIZING' | 'STARTED' | 'RELOCATING' - -export interface IndicesStatsShardSequenceNumber { - global_checkpoint: long - local_checkpoint: long - max_seq_no: SequenceNumber -} - -export interface IndicesStatsShardStats { - commit?: IndicesStatsShardCommit - completion?: CompletionStats - docs?: DocStats - fielddata?: FielddataStats - flush?: FlushStats - get?: GetStats - indexing?: IndexingStats - mappings?: IndicesStatsMappingStats - merges?: MergesStats - shard_path?: IndicesStatsShardPath - query_cache?: IndicesStatsShardQueryCache - recovery?: RecoveryStats - refresh?: RefreshStats - request_cache?: RequestCacheStats - retention_leases?: IndicesStatsShardRetentionLeases - routing?: IndicesStatsShardRouting - search?: SearchStats - segments?: SegmentsStats - seq_no?: IndicesStatsShardSequenceNumber - store?: StoreStats - translog?: TranslogStats - warmer?: WarmerStats - bulk?: BulkStats - shards?: Record - shard_stats?: IndicesStatsShardsTotalStats - indices?: IndicesStatsIndicesStats -} - -export interface IndicesStatsShardsTotalStats { - total_count: long -} - -export interface IndicesUnfreezeRequest extends RequestBase { - index: IndexName - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_unavailable?: boolean - master_timeout?: Duration - timeout?: Duration - wait_for_active_shards?: string -} - -export interface IndicesUnfreezeResponse { - acknowledged: boolean - shards_acknowledged: boolean -} - -export interface IndicesUpdateAliasesAction { - add?: IndicesUpdateAliasesAddAction - remove?: IndicesUpdateAliasesRemoveAction - remove_index?: IndicesUpdateAliasesRemoveIndexAction -} - -export interface IndicesUpdateAliasesAddAction { - alias?: IndexAlias - aliases?: IndexAlias | IndexAlias[] - filter?: QueryDslQueryContainer - index?: IndexName - indices?: Indices - index_routing?: Routing - is_hidden?: boolean - is_write_index?: boolean - routing?: Routing - search_routing?: Routing - must_exist?: boolean -} - -export interface IndicesUpdateAliasesRemoveAction { - alias?: IndexAlias - aliases?: IndexAlias | IndexAlias[] - index?: IndexName - indices?: Indices - must_exist?: boolean -} - -export interface IndicesUpdateAliasesRemoveIndexAction { - index?: IndexName - indices?: Indices - must_exist?: boolean -} - -export interface IndicesUpdateAliasesRequest extends RequestBase { - master_timeout?: Duration - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - actions?: IndicesUpdateAliasesAction[] - } -} - -export type IndicesUpdateAliasesResponse = AcknowledgedResponseBase - -export interface IndicesValidateQueryIndicesValidationExplanation { - error?: string - explanation?: string - index: IndexName - valid: boolean -} - -export interface IndicesValidateQueryRequest extends RequestBase { - index?: Indices - allow_no_indices?: boolean - all_shards?: boolean - analyzer?: string - analyze_wildcard?: boolean - default_operator?: QueryDslOperator - df?: string - expand_wildcards?: ExpandWildcards - explain?: boolean - ignore_unavailable?: boolean - lenient?: boolean - rewrite?: boolean - q?: string - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - query?: QueryDslQueryContainer - } -} - -export interface IndicesValidateQueryResponse { - explanations?: IndicesValidateQueryIndicesValidationExplanation[] - _shards?: ShardStatistics - valid: boolean - error?: string -} - -export interface InferenceCompletionResult { - result: string -} - -export interface InferenceDeleteInferenceEndpointResult extends AcknowledgedResponseBase { - pipelines: string[] -} - -export type InferenceDenseByteVector = byte[] - -export type InferenceDenseVector = float[] - -export interface InferenceInferenceEndpoint { - service: string - service_settings: InferenceServiceSettings - task_settings?: InferenceTaskSettings -} - -export interface InferenceInferenceEndpointInfo extends InferenceInferenceEndpoint { - inference_id: string - task_type: InferenceTaskType -} - -export interface InferenceInferenceResult { - text_embedding_bytes?: InferenceTextEmbeddingByteResult[] - text_embedding?: InferenceTextEmbeddingResult[] - sparse_embedding?: InferenceSparseEmbeddingResult[] - completion?: InferenceCompletionResult[] - rerank?: InferenceRankedDocument[] -} - -export interface InferenceRankedDocument { - index: integer - score: float - text?: string -} - -export type InferenceServiceSettings = any - -export interface InferenceSparseEmbeddingResult { - embedding: InferenceSparseVector -} - -export type InferenceSparseVector = Record - -export type InferenceTaskSettings = any - -export type InferenceTaskType = 'sparse_embedding' | 'text_embedding' | 'rerank' | 'completion' - -export interface InferenceTextEmbeddingByteResult { - embedding: InferenceDenseByteVector -} - -export interface InferenceTextEmbeddingResult { - embedding: InferenceDenseVector -} - -export interface InferenceDeleteRequest extends RequestBase { - task_type?: InferenceTaskType - inference_id: Id - dry_run?: boolean - force?: boolean -} - -export type InferenceDeleteResponse = InferenceDeleteInferenceEndpointResult - -export interface InferenceGetRequest extends RequestBase { - task_type?: InferenceTaskType - inference_id?: Id -} - -export interface InferenceGetResponse { - endpoints: InferenceInferenceEndpointInfo[] -} - -export interface InferenceInferenceRequest extends RequestBase { - task_type?: InferenceTaskType - inference_id: Id - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - query?: string - input: string | string[] - task_settings?: InferenceTaskSettings - } -} - -export type InferenceInferenceResponse = InferenceInferenceResult - -export interface InferencePutRequest extends RequestBase { - task_type?: InferenceTaskType - inference_id: Id - /** @deprecated The use of the 'body' key has been deprecated, use 'inference_config' instead. */ - body?: InferenceInferenceEndpoint -} - -export type InferencePutResponse = InferenceInferenceEndpointInfo - -export interface IngestAppendProcessor extends IngestProcessorBase { - field: Field - value: any | any[] - allow_duplicates?: boolean -} - -export interface IngestAttachmentProcessor extends IngestProcessorBase { - field: Field - ignore_missing?: boolean - indexed_chars?: long - indexed_chars_field?: Field - properties?: string[] - target_field?: Field - remove_binary?: boolean - resource_name?: string -} - -export interface IngestBytesProcessor extends IngestProcessorBase { - field: Field - ignore_missing?: boolean - target_field?: Field -} - -export interface IngestCircleProcessor extends IngestProcessorBase { - error_distance: double - field: Field - ignore_missing?: boolean - shape_type: IngestShapeType - target_field?: Field -} - -export interface IngestCommunityIDProcessor extends IngestProcessorBase { - source_ip?: Field - source_port?: Field - destination_ip?: Field - destination_port?: Field - iana_number?: Field - icmp_type?: Field - icmp_code?: Field - transport?: Field - target_field?: Field - seed?: integer - ignore_missing?: boolean -} - -export interface IngestConvertProcessor extends IngestProcessorBase { - field: Field - ignore_missing?: boolean - target_field?: Field - type: IngestConvertType -} - -export type IngestConvertType = 'integer' | 'long' | 'double' | 'float' | 'boolean' | 'ip' | 'string' | 'auto' - -export interface IngestCsvProcessor extends IngestProcessorBase { - empty_value?: any - field: Field - ignore_missing?: boolean - quote?: string - separator?: string - target_fields: Fields - trim?: boolean -} - -export interface IngestDatabaseConfiguration { - name: Name - maxmind: IngestMaxmind -} - -export interface IngestDateIndexNameProcessor extends IngestProcessorBase { - date_formats: string[] - date_rounding: string - field: Field - index_name_format?: string - index_name_prefix?: string - locale?: string - timezone?: string -} - -export interface IngestDateProcessor extends IngestProcessorBase { - field: Field - formats: string[] - locale?: string - target_field?: Field - timezone?: string - output_format?: string -} - -export interface IngestDissectProcessor extends IngestProcessorBase { - append_separator?: string - field: Field - ignore_missing?: boolean - pattern: string -} - -export interface IngestDotExpanderProcessor extends IngestProcessorBase { - field: Field - override?: boolean - path?: string -} - -export interface IngestDropProcessor extends IngestProcessorBase { -} - -export interface IngestEnrichProcessor extends IngestProcessorBase { - field: Field - ignore_missing?: boolean - max_matches?: integer - override?: boolean - policy_name: string - shape_relation?: GeoShapeRelation - target_field: Field -} - -export interface IngestFailProcessor extends IngestProcessorBase { - message: string -} - -export type IngestFingerprintDigest = 'MD5' | 'SHA-1' | 'SHA-256' | 'SHA-512' | 'MurmurHash3' - -export interface IngestFingerprintProcessor extends IngestProcessorBase { - fields: Fields - target_field?: Field - salt?: string - method?: IngestFingerprintDigest - ignore_missing?: boolean -} - -export interface IngestForeachProcessor extends IngestProcessorBase { - field: Field - ignore_missing?: boolean - processor: IngestProcessorContainer -} - -export interface IngestGeoGridProcessor extends IngestProcessorBase { - field: string - tile_type: IngestGeoGridTileType - target_field?: Field - parent_field?: Field - children_field?: Field - non_children_field?: Field - precision_field?: Field - ignore_missing?: boolean - target_format?: IngestGeoGridTargetFormat -} - -export type IngestGeoGridTargetFormat = 'geojson' | 'wkt' - -export type IngestGeoGridTileType = 'geotile' | 'geohex' | 'geohash' - -export interface IngestGeoIpProcessor extends IngestProcessorBase { - database_file?: string - field: Field - first_only?: boolean - ignore_missing?: boolean - properties?: string[] - target_field?: Field - download_database_on_pipeline_creation?: boolean -} - -export interface IngestGrokProcessor extends IngestProcessorBase { - ecs_compatibility?: string - field: Field - ignore_missing?: boolean - pattern_definitions?: Record - patterns: GrokPattern[] - trace_match?: boolean -} - -export interface IngestGsubProcessor extends IngestProcessorBase { - field: Field - ignore_missing?: boolean - pattern: string - replacement: string - target_field?: Field -} - -export interface IngestHtmlStripProcessor extends IngestProcessorBase { - field: Field - ignore_missing?: boolean - target_field?: Field -} - -export interface IngestInferenceConfig { - regression?: IngestInferenceConfigRegression - classification?: IngestInferenceConfigClassification -} - -export interface IngestInferenceConfigClassification { - num_top_classes?: integer - num_top_feature_importance_values?: integer - results_field?: Field - top_classes_results_field?: Field - prediction_field_type?: string -} - -export interface IngestInferenceConfigRegression { - results_field?: Field - num_top_feature_importance_values?: integer -} - -export interface IngestInferenceProcessor extends IngestProcessorBase { - model_id: Id - target_field?: Field - field_map?: Record - inference_config?: IngestInferenceConfig -} - -export interface IngestIpLocationProcessor extends IngestProcessorBase { - database_file?: string - field: Field - first_only?: boolean - ignore_missing?: boolean - properties?: string[] - target_field?: Field - download_database_on_pipeline_creation?: boolean -} - -export interface IngestJoinProcessor extends IngestProcessorBase { - field: Field - separator: string - target_field?: Field -} - -export interface IngestJsonProcessor extends IngestProcessorBase { - add_to_root?: boolean - add_to_root_conflict_strategy?: IngestJsonProcessorConflictStrategy - allow_duplicate_keys?: boolean - field: Field - target_field?: Field -} - -export type IngestJsonProcessorConflictStrategy = 'replace' | 'merge' - -export interface IngestKeyValueProcessor extends IngestProcessorBase { - exclude_keys?: string[] - field: Field - field_split: string - ignore_missing?: boolean - include_keys?: string[] - prefix?: string - strip_brackets?: boolean - target_field?: Field - trim_key?: string - trim_value?: string - value_split: string -} - -export interface IngestLowercaseProcessor extends IngestProcessorBase { - field: Field - ignore_missing?: boolean - target_field?: Field -} - -export interface IngestMaxmind { - account_id: Id -} - -export interface IngestNetworkDirectionProcessor extends IngestProcessorBase { - source_ip?: Field - destination_ip?: Field - target_field?: Field - internal_networks?: string[] - internal_networks_field?: Field - ignore_missing?: boolean -} - -export interface IngestPipeline { - description?: string - on_failure?: IngestProcessorContainer[] - processors?: IngestProcessorContainer[] - version?: VersionNumber - deprecated?: boolean - _meta?: Metadata -} - -export interface IngestPipelineConfig { - description?: string - version?: VersionNumber - processors: IngestProcessorContainer[] -} - -export interface IngestPipelineProcessor extends IngestProcessorBase { - name: Name - ignore_missing_pipeline?: boolean -} - -export interface IngestProcessorBase { - description?: string - if?: string - ignore_failure?: boolean - on_failure?: IngestProcessorContainer[] - tag?: string -} - -export interface IngestProcessorContainer { - append?: IngestAppendProcessor - attachment?: IngestAttachmentProcessor - bytes?: IngestBytesProcessor - circle?: IngestCircleProcessor - community_id?: IngestCommunityIDProcessor - convert?: IngestConvertProcessor - csv?: IngestCsvProcessor - date?: IngestDateProcessor - date_index_name?: IngestDateIndexNameProcessor - dissect?: IngestDissectProcessor - dot_expander?: IngestDotExpanderProcessor - drop?: IngestDropProcessor - enrich?: IngestEnrichProcessor - fail?: IngestFailProcessor - fingerprint?: IngestFingerprintProcessor - foreach?: IngestForeachProcessor - ip_location?: IngestIpLocationProcessor - geo_grid?: IngestGeoGridProcessor - geoip?: IngestGeoIpProcessor - grok?: IngestGrokProcessor - gsub?: IngestGsubProcessor - html_strip?: IngestHtmlStripProcessor - inference?: IngestInferenceProcessor - join?: IngestJoinProcessor - json?: IngestJsonProcessor - kv?: IngestKeyValueProcessor - lowercase?: IngestLowercaseProcessor - network_direction?: IngestNetworkDirectionProcessor - pipeline?: IngestPipelineProcessor - redact?: IngestRedactProcessor - registered_domain?: IngestRegisteredDomainProcessor - remove?: IngestRemoveProcessor - rename?: IngestRenameProcessor - reroute?: IngestRerouteProcessor - script?: IngestScriptProcessor - set?: IngestSetProcessor - set_security_user?: IngestSetSecurityUserProcessor - sort?: IngestSortProcessor - split?: IngestSplitProcessor - terminate?: IngestTerminateProcessor - trim?: IngestTrimProcessor - uppercase?: IngestUppercaseProcessor - urldecode?: IngestUrlDecodeProcessor - uri_parts?: IngestUriPartsProcessor - user_agent?: IngestUserAgentProcessor -} - -export interface IngestRedactProcessor extends IngestProcessorBase { - field: Field - patterns: GrokPattern[] - pattern_definitions?: Record - prefix?: string - suffix?: string - ignore_missing?: boolean - skip_if_unlicensed?: boolean - trace_redact?: boolean -} - -export interface IngestRegisteredDomainProcessor extends IngestProcessorBase { - field: Field - target_field?: Field - ignore_missing?: boolean -} - -export interface IngestRemoveProcessor extends IngestProcessorBase { - field: Fields - keep?: Fields - ignore_missing?: boolean -} - -export interface IngestRenameProcessor extends IngestProcessorBase { - field: Field - ignore_missing?: boolean - target_field: Field -} - -export interface IngestRerouteProcessor extends IngestProcessorBase { - destination?: string - dataset?: string | string[] - namespace?: string | string[] -} - -export interface IngestScriptProcessor extends IngestProcessorBase { - id?: Id - lang?: string - params?: Record - source?: string -} - -export interface IngestSetProcessor extends IngestProcessorBase { - copy_from?: Field - field: Field - ignore_empty_value?: boolean - media_type?: string - override?: boolean - value?: any -} - -export interface IngestSetSecurityUserProcessor extends IngestProcessorBase { - field: Field - properties?: string[] -} - -export type IngestShapeType = 'geo_shape' | 'shape' - -export interface IngestSortProcessor extends IngestProcessorBase { - field: Field - order?: SortOrder - target_field?: Field -} - -export interface IngestSplitProcessor extends IngestProcessorBase { - field: Field - ignore_missing?: boolean - preserve_trailing?: boolean - separator: string - target_field?: Field -} - -export interface IngestTerminateProcessor extends IngestProcessorBase { -} - -export interface IngestTrimProcessor extends IngestProcessorBase { - field: Field - ignore_missing?: boolean - target_field?: Field -} - -export interface IngestUppercaseProcessor extends IngestProcessorBase { - field: Field - ignore_missing?: boolean - target_field?: Field -} - -export interface IngestUriPartsProcessor extends IngestProcessorBase { - field: Field - ignore_missing?: boolean - keep_original?: boolean - remove_if_successful?: boolean - target_field?: Field -} - -export interface IngestUrlDecodeProcessor extends IngestProcessorBase { - field: Field - ignore_missing?: boolean - target_field?: Field -} - -export interface IngestUserAgentProcessor extends IngestProcessorBase { - field: Field - ignore_missing?: boolean - regex_file?: string - target_field?: Field - properties?: IngestUserAgentProperty[] - extract_device_type?: boolean -} - -export type IngestUserAgentProperty = 'name' | 'os' | 'device' | 'original' | 'version' - -export interface IngestDeleteGeoipDatabaseRequest extends RequestBase { - id: Ids - master_timeout?: Duration - timeout?: Duration -} - -export type IngestDeleteGeoipDatabaseResponse = AcknowledgedResponseBase - -export interface IngestDeletePipelineRequest extends RequestBase { - id: Id - master_timeout?: Duration - timeout?: Duration -} - -export type IngestDeletePipelineResponse = AcknowledgedResponseBase - -export interface IngestGeoIpStatsGeoIpDownloadStatistics { - successful_downloads: integer - failed_downloads: integer - total_download_time: DurationValue - databases_count: integer - skipped_updates: integer - expired_databases: integer -} - -export interface IngestGeoIpStatsGeoIpNodeDatabaseName { - name: Name -} - -export interface IngestGeoIpStatsGeoIpNodeDatabases { - databases: IngestGeoIpStatsGeoIpNodeDatabaseName[] - files_in_temp: string[] -} - -export interface IngestGeoIpStatsRequest extends RequestBase { -} - -export interface IngestGeoIpStatsResponse { - stats: IngestGeoIpStatsGeoIpDownloadStatistics - nodes: Record -} - -export interface IngestGetGeoipDatabaseDatabaseConfigurationMetadata { - id: Id - version: long - modified_date_millis: EpochTime - database: IngestDatabaseConfiguration -} - -export interface IngestGetGeoipDatabaseRequest extends RequestBase { - id?: Ids - master_timeout?: Duration -} - -export interface IngestGetGeoipDatabaseResponse { - databases: IngestGetGeoipDatabaseDatabaseConfigurationMetadata[] -} - -export interface IngestGetPipelineRequest extends RequestBase { - id?: Id - master_timeout?: Duration - summary?: boolean -} - -export type IngestGetPipelineResponse = Record - -export interface IngestProcessorGrokRequest extends RequestBase { -} - -export interface IngestProcessorGrokResponse { - patterns: Record -} - -export interface IngestPutGeoipDatabaseRequest extends RequestBase { - id: Id - master_timeout?: Duration - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - name: Name - maxmind: IngestMaxmind - } -} - -export type IngestPutGeoipDatabaseResponse = AcknowledgedResponseBase - -export interface IngestPutPipelineRequest extends RequestBase { - id: Id - master_timeout?: Duration - timeout?: Duration - if_version?: VersionNumber - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - _meta?: Metadata - description?: string - on_failure?: IngestProcessorContainer[] - processors?: IngestProcessorContainer[] - version?: VersionNumber - deprecated?: boolean - } -} - -export type IngestPutPipelineResponse = AcknowledgedResponseBase - -export interface IngestSimulateDocument { - _id?: Id - _index?: IndexName - _source: any -} - -export interface IngestSimulateDocumentSimulationKeys { - _id: Id - _index: IndexName - _ingest: IngestSimulateIngest - _routing?: string - _source: Record - _version?: SpecUtilsStringified - _version_type?: VersionType -} -export type IngestSimulateDocumentSimulation = IngestSimulateDocumentSimulationKeys -& { [property: string]: string | Id | IndexName | IngestSimulateIngest | Record | SpecUtilsStringified | VersionType } - -export interface IngestSimulateIngest { - _redact?: IngestSimulateRedact - timestamp: DateTime - pipeline?: Name -} - -export interface IngestSimulatePipelineSimulation { - doc?: IngestSimulateDocumentSimulation - tag?: string - processor_type?: string - status?: WatcherActionStatusOptions - description?: string - ignored_error?: ErrorCause - error?: ErrorCause -} - -export interface IngestSimulateRedact { - _is_redacted: boolean -} - -export interface IngestSimulateRequest extends RequestBase { - id?: Id - verbose?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - docs: IngestSimulateDocument[] - pipeline?: IngestPipeline - } -} - -export interface IngestSimulateResponse { - docs: IngestSimulateSimulateDocumentResult[] -} - -export interface IngestSimulateSimulateDocumentResult { - doc?: IngestSimulateDocumentSimulation - error?: ErrorCause - processor_results?: IngestSimulatePipelineSimulation[] -} - -export interface LicenseLicense { - expiry_date_in_millis: EpochTime - issue_date_in_millis: EpochTime - start_date_in_millis?: EpochTime - issued_to: string - issuer: string - max_nodes?: long | null - max_resource_units?: long - signature: string - type: LicenseLicenseType - uid: string -} - -export type LicenseLicenseStatus = 'active' | 'valid' | 'invalid' | 'expired' - -export type LicenseLicenseType = 'missing' | 'trial' | 'basic' | 'standard' | 'dev' | 'silver' | 'gold' | 'platinum' | 'enterprise' - -export interface LicenseDeleteRequest extends RequestBase { -} - -export type LicenseDeleteResponse = AcknowledgedResponseBase - -export interface LicenseGetLicenseInformation { - expiry_date?: DateTime - expiry_date_in_millis?: EpochTime - issue_date: DateTime - issue_date_in_millis: EpochTime - issued_to: string - issuer: string - max_nodes: long | null - max_resource_units?: integer | null - status: LicenseLicenseStatus - type: LicenseLicenseType - uid: Uuid - start_date_in_millis: EpochTime -} - -export interface LicenseGetRequest extends RequestBase { - accept_enterprise?: boolean - local?: boolean -} - -export interface LicenseGetResponse { - license: LicenseGetLicenseInformation -} - -export interface LicenseGetBasicStatusRequest extends RequestBase { -} - -export interface LicenseGetBasicStatusResponse { - eligible_to_start_basic: boolean -} - -export interface LicenseGetTrialStatusRequest extends RequestBase { -} - -export interface LicenseGetTrialStatusResponse { - eligible_to_start_trial: boolean -} - -export interface LicensePostAcknowledgement { - license: string[] - message: string -} - -export interface LicensePostRequest extends RequestBase { - acknowledge?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - license?: LicenseLicense - licenses?: LicenseLicense[] - } -} - -export interface LicensePostResponse { - acknowledge?: LicensePostAcknowledgement - acknowledged: boolean - license_status: LicenseLicenseStatus -} - -export interface LicensePostStartBasicRequest extends RequestBase { - acknowledge?: boolean -} - -export interface LicensePostStartBasicResponse { - acknowledged: boolean - basic_was_started: boolean - error_message?: string - type?: LicenseLicenseType - acknowledge?: Record -} - -export interface LicensePostStartTrialRequest extends RequestBase { - acknowledge?: boolean - type_query_string?: string -} - -export interface LicensePostStartTrialResponse { - acknowledged: boolean - error_message?: string - trial_was_started: boolean - type?: LicenseLicenseType -} - -export interface LogstashPipeline { - description: string - last_modified: DateTime - pipeline_metadata: LogstashPipelineMetadata - username: string - pipeline: string - pipeline_settings: LogstashPipelineSettings -} - -export interface LogstashPipelineMetadata { - type: string - version: string -} - -export interface LogstashPipelineSettings { - 'pipeline.workers': integer - 'pipeline.batch.size': integer - 'pipeline.batch.delay': integer - 'queue.type': string - 'queue.max_bytes.number': integer - 'queue.max_bytes.units': string - 'queue.checkpoint.writes': integer -} - -export interface LogstashDeletePipelineRequest extends RequestBase { - id: Id -} - -export type LogstashDeletePipelineResponse = boolean - -export interface LogstashGetPipelineRequest extends RequestBase { - id?: Ids -} - -export type LogstashGetPipelineResponse = Record - -export interface LogstashPutPipelineRequest extends RequestBase { - id: Id - /** @deprecated The use of the 'body' key has been deprecated, use 'pipeline' instead. */ - body?: LogstashPipeline -} - -export type LogstashPutPipelineResponse = boolean - -export interface MigrationDeprecationsDeprecation { - details: string - level: MigrationDeprecationsDeprecationLevel - message: string - url: string -} - -export type MigrationDeprecationsDeprecationLevel = 'none' | 'info' | 'warning' | 'critical' - -export interface MigrationDeprecationsRequest extends RequestBase { - index?: IndexName -} - -export interface MigrationDeprecationsResponse { - cluster_settings: MigrationDeprecationsDeprecation[] - index_settings: Record - data_streams: Record - node_settings: MigrationDeprecationsDeprecation[] - ml_settings: MigrationDeprecationsDeprecation[] -} - -export interface MigrationGetFeatureUpgradeStatusMigrationFeature { - feature_name: string - minimum_index_version: VersionString - migration_status: MigrationGetFeatureUpgradeStatusMigrationStatus - indices: MigrationGetFeatureUpgradeStatusMigrationFeatureIndexInfo[] -} - -export interface MigrationGetFeatureUpgradeStatusMigrationFeatureIndexInfo { - index: IndexName - version: VersionString - failure_cause?: ErrorCause -} - -export type MigrationGetFeatureUpgradeStatusMigrationStatus = 'NO_MIGRATION_NEEDED' | 'MIGRATION_NEEDED' | 'IN_PROGRESS' | 'ERROR' - -export interface MigrationGetFeatureUpgradeStatusRequest extends RequestBase { -} - -export interface MigrationGetFeatureUpgradeStatusResponse { - features: MigrationGetFeatureUpgradeStatusMigrationFeature[] - migration_status: MigrationGetFeatureUpgradeStatusMigrationStatus -} - -export interface MigrationPostFeatureUpgradeMigrationFeature { - feature_name: string -} - -export interface MigrationPostFeatureUpgradeRequest extends RequestBase { -} - -export interface MigrationPostFeatureUpgradeResponse { - accepted: boolean - features: MigrationPostFeatureUpgradeMigrationFeature[] -} - -export interface MlAnalysisConfig { - bucket_span?: Duration - categorization_analyzer?: MlCategorizationAnalyzer - categorization_field_name?: Field - categorization_filters?: string[] - detectors: MlDetector[] - influencers?: Field[] - latency?: Duration - model_prune_window?: Duration - multivariate_by_fields?: boolean - per_partition_categorization?: MlPerPartitionCategorization - summary_count_field_name?: Field -} - -export interface MlAnalysisConfigRead { - bucket_span: Duration - categorization_analyzer?: MlCategorizationAnalyzer - categorization_field_name?: Field - categorization_filters?: string[] - detectors: MlDetectorRead[] - influencers: Field[] - model_prune_window?: Duration - latency?: Duration - multivariate_by_fields?: boolean - per_partition_categorization?: MlPerPartitionCategorization - summary_count_field_name?: Field -} - -export interface MlAnalysisLimits { - categorization_examples_limit?: long - model_memory_limit?: string -} - -export interface MlAnalysisMemoryLimit { - model_memory_limit: string -} - -export interface MlAnomaly { - actual?: double[] - anomaly_score_explanation?: MlAnomalyExplanation - bucket_span: DurationValue - by_field_name?: string - by_field_value?: string - causes?: MlAnomalyCause[] - detector_index: integer - field_name?: string - function?: string - function_description?: string - geo_results?: MlGeoResults - influencers?: MlInfluence[] - initial_record_score: double - is_interim: boolean - job_id: string - over_field_name?: string - over_field_value?: string - partition_field_name?: string - partition_field_value?: string - probability: double - record_score: double - result_type: string - timestamp: EpochTime - typical?: double[] -} - -export interface MlAnomalyCause { - actual: double[] - by_field_name: Name - by_field_value: string - correlated_by_field_value: string - field_name: Field - function: string - function_description: string - influencers: MlInfluence[] - over_field_name: Name - over_field_value: string - partition_field_name: string - partition_field_value: string - probability: double - typical: double[] -} - -export interface MlAnomalyExplanation { - anomaly_characteristics_impact?: integer - anomaly_length?: integer - anomaly_type?: string - high_variance_penalty?: boolean - incomplete_bucket_penalty?: boolean - lower_confidence_bound?: double - multi_bucket_impact?: integer - single_bucket_impact?: integer - typical_value?: double - upper_confidence_bound?: double -} - -export interface MlApiKeyAuthorization { - id: string - name: string -} - -export type MlAppliesTo = 'actual' | 'typical' | 'diff_from_typical' | 'time' - -export interface MlBucketInfluencer { - anomaly_score: double - bucket_span: DurationValue - influencer_field_name: Field - initial_anomaly_score: double - is_interim: boolean - job_id: Id - probability: double - raw_anomaly_score: double - result_type: string - timestamp: EpochTime - timestamp_string?: DateTime -} - -export interface MlBucketSummary { - anomaly_score: double - bucket_influencers: MlBucketInfluencer[] - bucket_span: DurationValue - event_count: long - initial_anomaly_score: double - is_interim: boolean - job_id: Id - processing_time_ms: DurationValue - result_type: string - timestamp: EpochTime - timestamp_string?: DateTime -} - -export interface MlCalendarEvent { - calendar_id?: Id - event_id?: Id - description: string - end_time: DateTime - start_time: DateTime -} - -export type MlCategorizationAnalyzer = string | MlCategorizationAnalyzerDefinition - -export interface MlCategorizationAnalyzerDefinition { - char_filter?: AnalysisCharFilter[] - filter?: AnalysisTokenFilter[] - tokenizer?: AnalysisTokenizer -} - -export type MlCategorizationStatus = 'ok' | 'warn' - -export interface MlCategory { - category_id: ulong - examples: string[] - grok_pattern?: GrokPattern - job_id: Id - max_matching_length: ulong - partition_field_name?: string - partition_field_value?: string - regex: string - terms: string - num_matches?: long - preferred_to_categories?: Id[] - p?: string - result_type: string - mlcategory: string -} - -export interface MlChunkingConfig { - mode: MlChunkingMode - time_span?: Duration -} - -export type MlChunkingMode = 'auto' | 'manual' | 'off' - -export interface MlClassificationInferenceOptions { - num_top_classes?: integer - num_top_feature_importance_values?: integer - prediction_field_type?: string - results_field?: string - top_classes_results_field?: string -} - -export type MlConditionOperator = 'gt' | 'gte' | 'lt' | 'lte' - -export type MlCustomSettings = any - -export interface MlDataCounts { - bucket_count: long - earliest_record_timestamp?: long - empty_bucket_count: long - input_bytes: long - input_field_count: long - input_record_count: long - invalid_date_count: long - job_id: Id - last_data_time?: long - latest_empty_bucket_timestamp?: long - latest_record_timestamp?: long - latest_sparse_bucket_timestamp?: long - latest_bucket_timestamp?: long - log_time?: long - missing_field_count: long - out_of_order_timestamp_count: long - processed_field_count: long - processed_record_count: long - sparse_bucket_count: long -} - -export interface MlDataDescription { - format?: string - time_field?: Field - time_format?: string - field_delimiter?: string -} - -export interface MlDatafeed { - aggregations?: Record - aggs?: Record - authorization?: MlDatafeedAuthorization - chunking_config?: MlChunkingConfig - datafeed_id: Id - frequency?: Duration - indices: string[] - indexes?: string[] - job_id: Id - max_empty_searches?: integer - query: QueryDslQueryContainer - query_delay?: Duration - script_fields?: Record - scroll_size?: integer - delayed_data_check_config: MlDelayedDataCheckConfig - runtime_mappings?: MappingRuntimeFields - indices_options?: IndicesOptions -} - -export interface MlDatafeedAuthorization { - api_key?: MlApiKeyAuthorization - roles?: string[] - service_account?: string -} - -export interface MlDatafeedConfig { - aggregations?: Record - aggs?: Record - chunking_config?: MlChunkingConfig - datafeed_id?: Id - delayed_data_check_config?: MlDelayedDataCheckConfig - frequency?: Duration - indices?: Indices - indexes?: Indices - indices_options?: IndicesOptions - job_id?: Id - max_empty_searches?: integer - query?: QueryDslQueryContainer - query_delay?: Duration - runtime_mappings?: MappingRuntimeFields - script_fields?: Record - scroll_size?: integer -} - -export interface MlDatafeedRunningState { - real_time_configured: boolean - real_time_running: boolean - search_interval?: MlRunningStateSearchInterval -} - -export type MlDatafeedState = 'started' | 'stopped' | 'starting' | 'stopping' - -export interface MlDatafeedStats { - assignment_explanation?: string - datafeed_id: Id - node?: MlDiscoveryNode - state: MlDatafeedState - timing_stats: MlDatafeedTimingStats - running_state?: MlDatafeedRunningState -} - -export interface MlDatafeedTimingStats { - bucket_count: long - exponential_average_search_time_per_hour_ms: DurationValue - job_id: Id - search_count: long - total_search_time_ms: DurationValue - average_search_time_per_bucket_ms?: DurationValue -} - -export interface MlDataframeAnalysis { - alpha?: double - dependent_variable: string - downsample_factor?: double - early_stopping_enabled?: boolean - eta?: double - eta_growth_rate_per_tree?: double - feature_bag_fraction?: double - feature_processors?: MlDataframeAnalysisFeatureProcessor[] - gamma?: double - lambda?: double - max_optimization_rounds_per_hyperparameter?: integer - max_trees?: integer - maximum_number_trees?: integer - num_top_feature_importance_values?: integer - prediction_field_name?: Field - randomize_seed?: double - soft_tree_depth_limit?: integer - soft_tree_depth_tolerance?: double - training_percent?: Percentage -} - -export interface MlDataframeAnalysisAnalyzedFields { - includes: string[] - excludes: string[] -} - -export interface MlDataframeAnalysisClassification extends MlDataframeAnalysis { - class_assignment_objective?: string - num_top_classes?: integer -} - -export interface MlDataframeAnalysisContainer { - classification?: MlDataframeAnalysisClassification - outlier_detection?: MlDataframeAnalysisOutlierDetection - regression?: MlDataframeAnalysisRegression -} - -export interface MlDataframeAnalysisFeatureProcessor { - frequency_encoding?: MlDataframeAnalysisFeatureProcessorFrequencyEncoding - multi_encoding?: MlDataframeAnalysisFeatureProcessorMultiEncoding - n_gram_encoding?: MlDataframeAnalysisFeatureProcessorNGramEncoding - one_hot_encoding?: MlDataframeAnalysisFeatureProcessorOneHotEncoding - target_mean_encoding?: MlDataframeAnalysisFeatureProcessorTargetMeanEncoding -} - -export interface MlDataframeAnalysisFeatureProcessorFrequencyEncoding { - feature_name: Name - field: Field - frequency_map: Record -} - -export interface MlDataframeAnalysisFeatureProcessorMultiEncoding { - processors: integer[] -} - -export interface MlDataframeAnalysisFeatureProcessorNGramEncoding { - feature_prefix?: string - field: Field - length?: integer - n_grams: integer[] - start?: integer - custom?: boolean -} - -export interface MlDataframeAnalysisFeatureProcessorOneHotEncoding { - field: Field - hot_map: string -} - -export interface MlDataframeAnalysisFeatureProcessorTargetMeanEncoding { - default_value: integer - feature_name: Name - field: Field - target_map: Record -} - -export interface MlDataframeAnalysisOutlierDetection { - compute_feature_influence?: boolean - feature_influence_threshold?: double - method?: string - n_neighbors?: integer - outlier_fraction?: double - standardization_enabled?: boolean -} - -export interface MlDataframeAnalysisRegression extends MlDataframeAnalysis { - loss_function?: string - loss_function_parameter?: double -} - -export interface MlDataframeAnalytics { - analysis_stats?: MlDataframeAnalyticsStatsContainer - assignment_explanation?: string - data_counts: MlDataframeAnalyticsStatsDataCounts - id: Id - memory_usage: MlDataframeAnalyticsStatsMemoryUsage - node?: NodeAttributes - progress: MlDataframeAnalyticsStatsProgress[] - state: MlDataframeState -} - -export interface MlDataframeAnalyticsAuthorization { - api_key?: MlApiKeyAuthorization - roles?: string[] - service_account?: string -} - -export interface MlDataframeAnalyticsDestination { - index: IndexName - results_field?: Field -} - -export interface MlDataframeAnalyticsFieldSelection { - is_included: boolean - is_required: boolean - feature_type?: string - mapping_types: string[] - name: Field - reason?: string -} - -export interface MlDataframeAnalyticsMemoryEstimation { - expected_memory_with_disk: string - expected_memory_without_disk: string -} - -export interface MlDataframeAnalyticsSource { - index: Indices - query?: QueryDslQueryContainer - runtime_mappings?: MappingRuntimeFields - _source?: MlDataframeAnalysisAnalyzedFields | string[] -} - -export interface MlDataframeAnalyticsStatsContainer { - classification_stats?: MlDataframeAnalyticsStatsHyperparameters - outlier_detection_stats?: MlDataframeAnalyticsStatsOutlierDetection - regression_stats?: MlDataframeAnalyticsStatsHyperparameters -} - -export interface MlDataframeAnalyticsStatsDataCounts { - skipped_docs_count: integer - test_docs_count: integer - training_docs_count: integer -} - -export interface MlDataframeAnalyticsStatsHyperparameters { - hyperparameters: MlHyperparameters - iteration: integer - timestamp: EpochTime - timing_stats: MlTimingStats - validation_loss: MlValidationLoss -} - -export interface MlDataframeAnalyticsStatsMemoryUsage { - memory_reestimate_bytes?: long - peak_usage_bytes: long - status: string - timestamp?: EpochTime -} - -export interface MlDataframeAnalyticsStatsOutlierDetection { - parameters: MlOutlierDetectionParameters - timestamp: EpochTime - timing_stats: MlTimingStats -} - -export interface MlDataframeAnalyticsStatsProgress { - phase: string - progress_percent: integer -} - -export interface MlDataframeAnalyticsSummary { - allow_lazy_start?: boolean - analysis: MlDataframeAnalysisContainer - analyzed_fields?: MlDataframeAnalysisAnalyzedFields | string[] - authorization?: MlDataframeAnalyticsAuthorization - create_time?: EpochTime - description?: string - dest: MlDataframeAnalyticsDestination - id: Id - max_num_threads?: integer - model_memory_limit?: string - source: MlDataframeAnalyticsSource - version?: VersionString -} - -export interface MlDataframeEvaluationClassification { - actual_field: Field - predicted_field?: Field - top_classes_field?: Field - metrics?: MlDataframeEvaluationClassificationMetrics -} - -export interface MlDataframeEvaluationClassificationMetrics extends MlDataframeEvaluationMetrics { - accuracy?: Record - multiclass_confusion_matrix?: Record -} - -export interface MlDataframeEvaluationClassificationMetricsAucRoc { - class_name?: Name - include_curve?: boolean -} - -export interface MlDataframeEvaluationContainer { - classification?: MlDataframeEvaluationClassification - outlier_detection?: MlDataframeEvaluationOutlierDetection - regression?: MlDataframeEvaluationRegression -} - -export interface MlDataframeEvaluationMetrics { - auc_roc?: MlDataframeEvaluationClassificationMetricsAucRoc - precision?: Record - recall?: Record -} - -export interface MlDataframeEvaluationOutlierDetection { - actual_field: Field - predicted_probability_field: Field - metrics?: MlDataframeEvaluationOutlierDetectionMetrics -} - -export interface MlDataframeEvaluationOutlierDetectionMetrics extends MlDataframeEvaluationMetrics { - confusion_matrix?: Record -} - -export interface MlDataframeEvaluationRegression { - actual_field: Field - predicted_field: Field - metrics?: MlDataframeEvaluationRegressionMetrics -} - -export interface MlDataframeEvaluationRegressionMetrics { - mse?: Record - msle?: MlDataframeEvaluationRegressionMetricsMsle - huber?: MlDataframeEvaluationRegressionMetricsHuber - r_squared?: Record -} - -export interface MlDataframeEvaluationRegressionMetricsHuber { - delta?: double -} - -export interface MlDataframeEvaluationRegressionMetricsMsle { - offset?: double -} - -export type MlDataframeState = 'started' | 'stopped' | 'starting' | 'stopping' | 'failed' - -export interface MlDelayedDataCheckConfig { - check_window?: Duration - enabled: boolean -} - -export type MlDeploymentAllocationState = 'started' | 'starting' | 'fully_allocated' - -export type MlDeploymentAssignmentState = 'started' | 'starting' | 'stopping' | 'failed' - -export interface MlDetectionRule { - actions?: MlRuleAction[] - conditions?: MlRuleCondition[] - scope?: Record -} - -export interface MlDetector { - by_field_name?: Field - custom_rules?: MlDetectionRule[] - detector_description?: string - detector_index?: integer - exclude_frequent?: MlExcludeFrequent - field_name?: Field - function?: string - over_field_name?: Field - partition_field_name?: Field - use_null?: boolean -} - -export interface MlDetectorRead { - by_field_name?: Field - custom_rules?: MlDetectionRule[] - detector_description?: string - detector_index?: integer - exclude_frequent?: MlExcludeFrequent - field_name?: Field - function: string - over_field_name?: Field - partition_field_name?: Field - use_null?: boolean -} - -export interface MlDiscoveryNode { - attributes: Record - ephemeral_id: Id - id: Id - name: Name - transport_address: TransportAddress -} - -export type MlExcludeFrequent = 'all' | 'none' | 'by' | 'over' - -export interface MlFillMaskInferenceOptions { - mask_token?: string - num_top_classes?: integer - tokenization?: MlTokenizationConfigContainer - results_field?: string -} - -export interface MlFillMaskInferenceUpdateOptions { - num_top_classes?: integer - tokenization?: MlNlpTokenizationUpdateOptions - results_field?: string -} - -export interface MlFilter { - description?: string - filter_id: Id - items: string[] -} - -export interface MlFilterRef { - filter_id: Id - filter_type?: MlFilterType -} - -export type MlFilterType = 'include' | 'exclude' - -export interface MlGeoResults { - actual_point: string - typical_point: string -} - -export interface MlHyperparameter { - absolute_importance?: double - name: Name - relative_importance?: double - supplied: boolean - value: double -} - -export interface MlHyperparameters { - alpha?: double - lambda?: double - gamma?: double - eta?: double - eta_growth_rate_per_tree?: double - feature_bag_fraction?: double - downsample_factor?: double - max_attempts_to_add_tree?: integer - max_optimization_rounds_per_hyperparameter?: integer - max_trees?: integer - num_folds?: integer - num_splits_per_feature?: integer - soft_tree_depth_limit?: integer - soft_tree_depth_tolerance?: double -} - -export type MlInclude = 'definition' | 'feature_importance_baseline' | 'hyperparameters' | 'total_feature_importance' | 'definition_status' - -export interface MlInferenceConfigCreateContainer { - regression?: MlRegressionInferenceOptions - classification?: MlClassificationInferenceOptions - text_classification?: MlTextClassificationInferenceOptions - zero_shot_classification?: MlZeroShotClassificationInferenceOptions - fill_mask?: MlFillMaskInferenceOptions - ner?: MlNerInferenceOptions - pass_through?: MlPassThroughInferenceOptions - text_embedding?: MlTextEmbeddingInferenceOptions - text_expansion?: MlTextExpansionInferenceOptions - question_answering?: MlQuestionAnsweringInferenceOptions -} - -export interface MlInferenceConfigUpdateContainer { - regression?: MlRegressionInferenceOptions - classification?: MlClassificationInferenceOptions - text_classification?: MlTextClassificationInferenceUpdateOptions - zero_shot_classification?: MlZeroShotClassificationInferenceUpdateOptions - fill_mask?: MlFillMaskInferenceUpdateOptions - ner?: MlNerInferenceUpdateOptions - pass_through?: MlPassThroughInferenceUpdateOptions - text_embedding?: MlTextEmbeddingInferenceUpdateOptions - text_expansion?: MlTextExpansionInferenceUpdateOptions - question_answering?: MlQuestionAnsweringInferenceUpdateOptions -} - -export interface MlInferenceResponseResult { - entities?: MlTrainedModelEntities[] - is_truncated?: boolean - predicted_value?: MlPredictedValue | MlPredictedValue[] - predicted_value_sequence?: string - prediction_probability?: double - prediction_score?: double - top_classes?: MlTopClassEntry[] - warning?: string - feature_importance?: MlTrainedModelInferenceFeatureImportance[] -} - -export interface MlInfluence { - influencer_field_name: string - influencer_field_values: string[] -} - -export interface MlInfluencer { - bucket_span: DurationValue - influencer_score: double - influencer_field_name: Field - influencer_field_value: string - initial_influencer_score: double - is_interim: boolean - job_id: Id - probability: double - result_type: string - timestamp: EpochTime - foo?: string -} - -export interface MlJob { - allow_lazy_open: boolean - analysis_config: MlAnalysisConfig - analysis_limits?: MlAnalysisLimits - background_persist_interval?: Duration - blocked?: MlJobBlocked - create_time?: DateTime - custom_settings?: MlCustomSettings - daily_model_snapshot_retention_after_days?: long - data_description: MlDataDescription - datafeed_config?: MlDatafeed - deleting?: boolean - description?: string - finished_time?: DateTime - groups?: string[] - job_id: Id - job_type?: string - job_version?: VersionString - model_plot_config?: MlModelPlotConfig - model_snapshot_id?: Id - model_snapshot_retention_days: long - renormalization_window_days?: long - results_index_name: IndexName - results_retention_days?: long -} - -export interface MlJobBlocked { - reason: MlJobBlockedReason - task_id?: TaskId -} - -export type MlJobBlockedReason = 'delete' | 'reset' | 'revert' - -export interface MlJobConfig { - allow_lazy_open?: boolean - analysis_config: MlAnalysisConfig - analysis_limits?: MlAnalysisLimits - background_persist_interval?: Duration - custom_settings?: MlCustomSettings - daily_model_snapshot_retention_after_days?: long - data_description: MlDataDescription - datafeed_config?: MlDatafeedConfig - description?: string - groups?: string[] - job_id?: Id - job_type?: string - model_plot_config?: MlModelPlotConfig - model_snapshot_retention_days?: long - renormalization_window_days?: long - results_index_name?: IndexName - results_retention_days?: long -} - -export interface MlJobForecastStatistics { - memory_bytes?: MlJobStatistics - processing_time_ms?: MlJobStatistics - records?: MlJobStatistics - status?: Record - total: long - forecasted_jobs: integer -} - -export type MlJobState = 'closing' | 'closed' | 'opened' | 'failed' | 'opening' - -export interface MlJobStatistics { - avg: double - max: double - min: double - total: double -} - -export interface MlJobStats { - assignment_explanation?: string - data_counts: MlDataCounts - forecasts_stats: MlJobForecastStatistics - job_id: string - model_size_stats: MlModelSizeStats - node?: MlDiscoveryNode - open_time?: DateTime - state: MlJobState - timing_stats: MlJobTimingStats - deleting?: boolean -} - -export interface MlJobTimingStats { - average_bucket_processing_time_ms?: DurationValue - bucket_count: long - exponential_average_bucket_processing_time_ms?: DurationValue - exponential_average_bucket_processing_time_per_hour_ms: DurationValue - job_id: Id - total_bucket_processing_time_ms: DurationValue - maximum_bucket_processing_time_ms?: DurationValue - minimum_bucket_processing_time_ms?: DurationValue -} - -export type MlMemoryStatus = 'ok' | 'soft_limit' | 'hard_limit' - -export interface MlModelPlotConfig { - annotations_enabled?: boolean - enabled?: boolean - terms?: Field -} - -export interface MlModelSizeStats { - bucket_allocation_failures_count: long - job_id: Id - log_time: DateTime - memory_status: MlMemoryStatus - model_bytes: ByteSize - model_bytes_exceeded?: ByteSize - model_bytes_memory_limit?: ByteSize - peak_model_bytes?: ByteSize - assignment_memory_basis?: string - result_type: string - total_by_field_count: long - total_over_field_count: long - total_partition_field_count: long - categorization_status: MlCategorizationStatus - categorized_doc_count: integer - dead_category_count: integer - failed_category_count: integer - frequent_category_count: integer - rare_category_count: integer - total_category_count: integer - timestamp?: long -} - -export interface MlModelSnapshot { - description?: string - job_id: Id - latest_record_time_stamp?: integer - latest_result_time_stamp?: integer - min_version: VersionString - model_size_stats?: MlModelSizeStats - retain: boolean - snapshot_doc_count: long - snapshot_id: Id - timestamp: long -} - -export interface MlModelSnapshotUpgrade { - job_id: Id - snapshot_id: Id - state: MlSnapshotUpgradeState - node: MlDiscoveryNode - assignment_explanation: string -} - -export interface MlNerInferenceOptions { - tokenization?: MlTokenizationConfigContainer - results_field?: string - classification_labels?: string[] - vocabulary?: MlVocabulary -} - -export interface MlNerInferenceUpdateOptions { - tokenization?: MlNlpTokenizationUpdateOptions - results_field?: string -} - -export interface MlNlpBertTokenizationConfig { - do_lower_case?: boolean - with_special_tokens?: boolean - max_sequence_length?: integer - truncate?: MlTokenizationTruncate - span?: integer -} - -export interface MlNlpRobertaTokenizationConfig { - add_prefix_space?: boolean - with_special_tokens?: boolean - max_sequence_length?: integer - truncate?: MlTokenizationTruncate - span?: integer -} - -export interface MlNlpTokenizationUpdateOptions { - truncate?: MlTokenizationTruncate - span?: integer -} - -export interface MlOutlierDetectionParameters { - compute_feature_influence?: boolean - feature_influence_threshold?: double - method?: string - n_neighbors?: integer - outlier_fraction?: double - standardization_enabled?: boolean -} - -export interface MlOverallBucket { - bucket_span: DurationValue - is_interim: boolean - jobs: MlOverallBucketJob[] - overall_score: double - result_type: string - timestamp: EpochTime - timestamp_string: DateTime -} - -export interface MlOverallBucketJob { - job_id: Id - max_anomaly_score: double -} - -export interface MlPage { - from?: integer - size?: integer -} - -export interface MlPassThroughInferenceOptions { - tokenization?: MlTokenizationConfigContainer - results_field?: string - vocabulary?: MlVocabulary -} - -export interface MlPassThroughInferenceUpdateOptions { - tokenization?: MlNlpTokenizationUpdateOptions - results_field?: string -} - -export interface MlPerPartitionCategorization { - enabled?: boolean - stop_on_warn?: boolean -} - -export type MlPredictedValue = ScalarValue | ScalarValue[] - -export interface MlQuestionAnsweringInferenceOptions { - num_top_classes?: integer - tokenization?: MlTokenizationConfigContainer - results_field?: string - max_answer_length?: integer -} - -export interface MlQuestionAnsweringInferenceUpdateOptions { - question: string - num_top_classes?: integer - tokenization?: MlNlpTokenizationUpdateOptions - results_field?: string - max_answer_length?: integer -} - -export interface MlRegressionInferenceOptions { - results_field?: Field - num_top_feature_importance_values?: integer -} - -export type MlRoutingState = 'failed' | 'started' | 'starting' | 'stopped' | 'stopping' - -export type MlRuleAction = 'skip_result' | 'skip_model_update' - -export interface MlRuleCondition { - applies_to: MlAppliesTo - operator: MlConditionOperator - value: double -} - -export interface MlRunningStateSearchInterval { - end?: Duration - end_ms: DurationValue - start?: Duration - start_ms: DurationValue -} - -export type MlSnapshotUpgradeState = 'loading_old_state' | 'saving_new_state' | 'stopped' | 'failed' - -export interface MlTextClassificationInferenceOptions { - num_top_classes?: integer - tokenization?: MlTokenizationConfigContainer - results_field?: string - classification_labels?: string[] -} - -export interface MlTextClassificationInferenceUpdateOptions { - num_top_classes?: integer - tokenization?: MlNlpTokenizationUpdateOptions - results_field?: string - classification_labels?: string[] -} - -export interface MlTextEmbeddingInferenceOptions { - embedding_size?: integer - tokenization?: MlTokenizationConfigContainer - results_field?: string -} - -export interface MlTextEmbeddingInferenceUpdateOptions { - tokenization?: MlNlpTokenizationUpdateOptions - results_field?: string -} - -export interface MlTextExpansionInferenceOptions { - tokenization?: MlTokenizationConfigContainer - results_field?: string -} - -export interface MlTextExpansionInferenceUpdateOptions { - tokenization?: MlNlpTokenizationUpdateOptions - results_field?: string -} - -export interface MlTimingStats { - elapsed_time: DurationValue - iteration_time?: DurationValue -} - -export interface MlTokenizationConfigContainer { - bert?: MlNlpBertTokenizationConfig - mpnet?: MlNlpBertTokenizationConfig - roberta?: MlNlpRobertaTokenizationConfig -} - -export type MlTokenizationTruncate = 'first' | 'second' | 'none' - -export interface MlTopClassEntry { - class_name: string - class_probability: double - class_score: double -} - -export interface MlTotalFeatureImportance { - feature_name: Name - importance: MlTotalFeatureImportanceStatistics[] - classes: MlTotalFeatureImportanceClass[] -} - -export interface MlTotalFeatureImportanceClass { - class_name: Name - importance: MlTotalFeatureImportanceStatistics[] -} - -export interface MlTotalFeatureImportanceStatistics { - mean_magnitude: double - max: integer - min: integer -} - -export interface MlTrainedModelAssignment { - assignment_state: MlDeploymentAssignmentState - max_assigned_allocations?: integer - routing_table: Record - start_time: DateTime - task_parameters: MlTrainedModelAssignmentTaskParameters -} - -export interface MlTrainedModelAssignmentRoutingTable { - reason: string - routing_state: MlRoutingState - current_allocations: integer - target_allocations: integer -} - -export interface MlTrainedModelAssignmentTaskParameters { - model_bytes: integer - model_id: Id - deployment_id: Id - cache_size: ByteSize - number_of_allocations: integer - priority: MlTrainingPriority - queue_capacity: integer - threads_per_allocation: integer -} - -export interface MlTrainedModelConfig { - model_id: Id - model_type?: MlTrainedModelType - tags: string[] - version?: VersionString - compressed_definition?: string - created_by?: string - create_time?: DateTime - default_field_map?: Record - description?: string - estimated_heap_memory_usage_bytes?: integer - estimated_operations?: integer - fully_defined?: boolean - inference_config?: MlInferenceConfigCreateContainer - input: MlTrainedModelConfigInput - license_level?: string - metadata?: MlTrainedModelConfigMetadata - model_size_bytes?: ByteSize - location?: MlTrainedModelLocation - prefix_strings?: MlTrainedModelPrefixStrings -} - -export interface MlTrainedModelConfigInput { - field_names: Field[] -} - -export interface MlTrainedModelConfigMetadata { - model_aliases?: string[] - feature_importance_baseline?: Record - hyperparameters?: MlHyperparameter[] - total_feature_importance?: MlTotalFeatureImportance[] -} - -export interface MlTrainedModelDeploymentAllocationStatus { - allocation_count: integer - state: MlDeploymentAllocationState - target_allocation_count: integer -} - -export interface MlTrainedModelDeploymentNodesStats { - average_inference_time_ms: DurationValue - error_count: integer - inference_count: integer - last_access: long - node: MlDiscoveryNode - number_of_allocations: integer - number_of_pending_requests: integer - rejection_execution_count: integer - routing_state: MlTrainedModelAssignmentRoutingTable - start_time: EpochTime - threads_per_allocation: integer - timeout_count: integer -} - -export interface MlTrainedModelDeploymentStats { - allocation_status: MlTrainedModelDeploymentAllocationStatus - cache_size?: ByteSize - deployment_id: Id - error_count: integer - inference_count: integer - model_id: Id - nodes: MlTrainedModelDeploymentNodesStats[] - number_of_allocations: integer - queue_capacity: integer - rejected_execution_count: integer - reason: string - start_time: EpochTime - state: MlDeploymentAssignmentState - threads_per_allocation: integer - timeout_count: integer -} - -export interface MlTrainedModelEntities { - class_name: string - class_probability: double - entity: string - start_pos: integer - end_pos: integer -} - -export interface MlTrainedModelInferenceClassImportance { - class_name: string - importance: double -} - -export interface MlTrainedModelInferenceFeatureImportance { - feature_name: string - importance?: double - classes?: MlTrainedModelInferenceClassImportance[] -} - -export interface MlTrainedModelInferenceStats { - cache_miss_count: integer - failure_count: integer - inference_count: integer - missing_all_fields_count: integer - timestamp: EpochTime -} - -export interface MlTrainedModelLocation { - index: MlTrainedModelLocationIndex -} - -export interface MlTrainedModelLocationIndex { - name: IndexName -} - -export interface MlTrainedModelPrefixStrings { - ingest?: string - search?: string -} - -export interface MlTrainedModelSizeStats { - model_size_bytes: ByteSize - required_native_memory_bytes: ByteSize -} - -export interface MlTrainedModelStats { - deployment_stats?: MlTrainedModelDeploymentStats - inference_stats?: MlTrainedModelInferenceStats - ingest?: Record - model_id: Id - model_size_stats: MlTrainedModelSizeStats - pipeline_count: integer -} - -export type MlTrainedModelType = 'tree_ensemble' | 'lang_ident' | 'pytorch' - -export type MlTrainingPriority = 'normal' | 'low' - -export interface MlTransformAuthorization { - api_key?: MlApiKeyAuthorization - roles?: string[] - service_account?: string -} - -export interface MlValidationLoss { - fold_values: string[] - loss_type: string -} - -export interface MlVocabulary { - index: IndexName -} - -export interface MlZeroShotClassificationInferenceOptions { - tokenization?: MlTokenizationConfigContainer - hypothesis_template?: string - classification_labels: string[] - results_field?: string - multi_label?: boolean - labels?: string[] -} - -export interface MlZeroShotClassificationInferenceUpdateOptions { - tokenization?: MlNlpTokenizationUpdateOptions - results_field?: string - multi_label?: boolean - labels: string[] -} - -export interface MlClearTrainedModelDeploymentCacheRequest extends RequestBase { - model_id: Id -} - -export interface MlClearTrainedModelDeploymentCacheResponse { - cleared: boolean -} - -export interface MlCloseJobRequest extends RequestBase { - job_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - allow_no_match?: boolean - force?: boolean - timeout?: Duration - } -} - -export interface MlCloseJobResponse { - closed: boolean -} - -export interface MlDeleteCalendarRequest extends RequestBase { - calendar_id: Id -} - -export type MlDeleteCalendarResponse = AcknowledgedResponseBase - -export interface MlDeleteCalendarEventRequest extends RequestBase { - calendar_id: Id - event_id: Id -} - -export type MlDeleteCalendarEventResponse = AcknowledgedResponseBase - -export interface MlDeleteCalendarJobRequest extends RequestBase { - calendar_id: Id - job_id: Ids -} - -export interface MlDeleteCalendarJobResponse { - calendar_id: Id - description?: string - job_ids: Ids -} - -export interface MlDeleteDataFrameAnalyticsRequest extends RequestBase { - id: Id - force?: boolean - timeout?: Duration -} - -export type MlDeleteDataFrameAnalyticsResponse = AcknowledgedResponseBase - -export interface MlDeleteDatafeedRequest extends RequestBase { - datafeed_id: Id - force?: boolean -} - -export type MlDeleteDatafeedResponse = AcknowledgedResponseBase - -export interface MlDeleteExpiredDataRequest extends RequestBase { - job_id?: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - requests_per_second?: float - timeout?: Duration - } -} - -export interface MlDeleteExpiredDataResponse { - deleted: boolean -} - -export interface MlDeleteFilterRequest extends RequestBase { - filter_id: Id -} - -export type MlDeleteFilterResponse = AcknowledgedResponseBase - -export interface MlDeleteForecastRequest extends RequestBase { - job_id: Id - forecast_id?: Id - allow_no_forecasts?: boolean - timeout?: Duration -} - -export type MlDeleteForecastResponse = AcknowledgedResponseBase - -export interface MlDeleteJobRequest extends RequestBase { - job_id: Id - force?: boolean - delete_user_annotations?: boolean - wait_for_completion?: boolean -} - -export type MlDeleteJobResponse = AcknowledgedResponseBase - -export interface MlDeleteModelSnapshotRequest extends RequestBase { - job_id: Id - snapshot_id: Id -} - -export type MlDeleteModelSnapshotResponse = AcknowledgedResponseBase - -export interface MlDeleteTrainedModelRequest extends RequestBase { - model_id: Id - force?: boolean -} - -export type MlDeleteTrainedModelResponse = AcknowledgedResponseBase - -export interface MlDeleteTrainedModelAliasRequest extends RequestBase { - model_alias: Name - model_id: Id -} - -export type MlDeleteTrainedModelAliasResponse = AcknowledgedResponseBase - -export interface MlEstimateModelMemoryRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - analysis_config?: MlAnalysisConfig - max_bucket_cardinality?: Record - overall_cardinality?: Record - } -} - -export interface MlEstimateModelMemoryResponse { - model_memory_estimate: string -} - -export interface MlEvaluateDataFrameConfusionMatrixItem { - actual_class: Name - actual_class_doc_count: integer - predicted_classes: MlEvaluateDataFrameConfusionMatrixPrediction[] - other_predicted_class_doc_count: integer -} - -export interface MlEvaluateDataFrameConfusionMatrixPrediction { - predicted_class: Name - count: integer -} - -export interface MlEvaluateDataFrameConfusionMatrixThreshold { - tp: integer - fp: integer - tn: integer - fn: integer -} - -export interface MlEvaluateDataFrameDataframeClassificationSummary { - auc_roc?: MlEvaluateDataFrameDataframeEvaluationSummaryAucRoc - accuracy?: MlEvaluateDataFrameDataframeClassificationSummaryAccuracy - multiclass_confusion_matrix?: MlEvaluateDataFrameDataframeClassificationSummaryMulticlassConfusionMatrix - precision?: MlEvaluateDataFrameDataframeClassificationSummaryPrecision - recall?: MlEvaluateDataFrameDataframeClassificationSummaryRecall -} - -export interface MlEvaluateDataFrameDataframeClassificationSummaryAccuracy { - classes: MlEvaluateDataFrameDataframeEvaluationClass[] - overall_accuracy: double -} - -export interface MlEvaluateDataFrameDataframeClassificationSummaryMulticlassConfusionMatrix { - confusion_matrix: MlEvaluateDataFrameConfusionMatrixItem[] - other_actual_class_count: integer -} - -export interface MlEvaluateDataFrameDataframeClassificationSummaryPrecision { - classes: MlEvaluateDataFrameDataframeEvaluationClass[] - avg_precision: double -} - -export interface MlEvaluateDataFrameDataframeClassificationSummaryRecall { - classes: MlEvaluateDataFrameDataframeEvaluationClass[] - avg_recall: double -} - -export interface MlEvaluateDataFrameDataframeEvaluationClass extends MlEvaluateDataFrameDataframeEvaluationValue { - class_name: Name -} - -export interface MlEvaluateDataFrameDataframeEvaluationSummaryAucRoc extends MlEvaluateDataFrameDataframeEvaluationValue { - curve?: MlEvaluateDataFrameDataframeEvaluationSummaryAucRocCurveItem[] -} - -export interface MlEvaluateDataFrameDataframeEvaluationSummaryAucRocCurveItem { - tpr: double - fpr: double - threshold: double -} - -export interface MlEvaluateDataFrameDataframeEvaluationValue { - value: double -} - -export interface MlEvaluateDataFrameDataframeOutlierDetectionSummary { - auc_roc?: MlEvaluateDataFrameDataframeEvaluationSummaryAucRoc - precision?: Record - recall?: Record - confusion_matrix?: Record -} - -export interface MlEvaluateDataFrameDataframeRegressionSummary { - huber?: MlEvaluateDataFrameDataframeEvaluationValue - mse?: MlEvaluateDataFrameDataframeEvaluationValue - msle?: MlEvaluateDataFrameDataframeEvaluationValue - r_squared?: MlEvaluateDataFrameDataframeEvaluationValue -} - -export interface MlEvaluateDataFrameRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - evaluation: MlDataframeEvaluationContainer - index: IndexName - query?: QueryDslQueryContainer - } -} - -export interface MlEvaluateDataFrameResponse { - classification?: MlEvaluateDataFrameDataframeClassificationSummary - outlier_detection?: MlEvaluateDataFrameDataframeOutlierDetectionSummary - regression?: MlEvaluateDataFrameDataframeRegressionSummary -} - -export interface MlExplainDataFrameAnalyticsRequest extends RequestBase { - id?: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - source?: MlDataframeAnalyticsSource - dest?: MlDataframeAnalyticsDestination - analysis?: MlDataframeAnalysisContainer - description?: string - model_memory_limit?: string - max_num_threads?: integer - analyzed_fields?: MlDataframeAnalysisAnalyzedFields | string[] - allow_lazy_start?: boolean - } -} - -export interface MlExplainDataFrameAnalyticsResponse { - field_selection: MlDataframeAnalyticsFieldSelection[] - memory_estimation: MlDataframeAnalyticsMemoryEstimation -} - -export interface MlFlushJobRequest extends RequestBase { - job_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - advance_time?: DateTime - calc_interim?: boolean - end?: DateTime - skip_time?: DateTime - start?: DateTime - } -} - -export interface MlFlushJobResponse { - flushed: boolean - last_finalized_bucket_end?: integer -} - -export interface MlForecastRequest extends RequestBase { - job_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - duration?: Duration - expires_in?: Duration - max_model_memory?: string - } -} - -export interface MlForecastResponse { - acknowledged: boolean - forecast_id: Id -} - -export interface MlGetBucketsRequest extends RequestBase { - job_id: Id - timestamp?: DateTime - from?: integer - size?: integer - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - anomaly_score?: double - desc?: boolean - end?: DateTime - exclude_interim?: boolean - expand?: boolean - page?: MlPage - sort?: Field - start?: DateTime - } -} - -export interface MlGetBucketsResponse { - buckets: MlBucketSummary[] - count: long -} - -export interface MlGetCalendarEventsRequest extends RequestBase { - calendar_id: Id - end?: DateTime - from?: integer - job_id?: Id - size?: integer - start?: DateTime -} - -export interface MlGetCalendarEventsResponse { - count: long - events: MlCalendarEvent[] -} - -export interface MlGetCalendarsCalendar { - calendar_id: Id - description?: string - job_ids: Id[] -} - -export interface MlGetCalendarsRequest extends RequestBase { - calendar_id?: Id - from?: integer - size?: integer - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - page?: MlPage - } -} - -export interface MlGetCalendarsResponse { - calendars: MlGetCalendarsCalendar[] - count: long -} - -export interface MlGetCategoriesRequest extends RequestBase { - job_id: Id - category_id?: CategoryId - from?: integer - partition_field_value?: string - size?: integer - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - page?: MlPage - } -} - -export interface MlGetCategoriesResponse { - categories: MlCategory[] - count: long -} - -export interface MlGetDataFrameAnalyticsRequest extends RequestBase { - id?: Id - allow_no_match?: boolean - from?: integer - size?: integer - exclude_generated?: boolean -} - -export interface MlGetDataFrameAnalyticsResponse { - count: integer - data_frame_analytics: MlDataframeAnalyticsSummary[] -} - -export interface MlGetDataFrameAnalyticsStatsRequest extends RequestBase { - id?: Id - allow_no_match?: boolean - from?: integer - size?: integer - verbose?: boolean -} - -export interface MlGetDataFrameAnalyticsStatsResponse { - count: long - data_frame_analytics: MlDataframeAnalytics[] -} - -export interface MlGetDatafeedStatsRequest extends RequestBase { - datafeed_id?: Ids - allow_no_match?: boolean -} - -export interface MlGetDatafeedStatsResponse { - count: long - datafeeds: MlDatafeedStats[] -} - -export interface MlGetDatafeedsRequest extends RequestBase { - datafeed_id?: Ids - allow_no_match?: boolean - exclude_generated?: boolean -} - -export interface MlGetDatafeedsResponse { - count: long - datafeeds: MlDatafeed[] -} - -export interface MlGetFiltersRequest extends RequestBase { - filter_id?: Ids - from?: integer - size?: integer -} - -export interface MlGetFiltersResponse { - count: long - filters: MlFilter[] -} - -export interface MlGetInfluencersRequest extends RequestBase { - job_id: Id - desc?: boolean - end?: DateTime - exclude_interim?: boolean - influencer_score?: double - from?: integer - size?: integer - sort?: Field - start?: DateTime - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - page?: MlPage - } -} - -export interface MlGetInfluencersResponse { - count: long - influencers: MlInfluencer[] -} - -export interface MlGetJobStatsRequest extends RequestBase { - job_id?: Id - allow_no_match?: boolean -} - -export interface MlGetJobStatsResponse { - count: long - jobs: MlJobStats[] -} - -export interface MlGetJobsRequest extends RequestBase { - job_id?: Ids - allow_no_match?: boolean - exclude_generated?: boolean -} - -export interface MlGetJobsResponse { - count: long - jobs: MlJob[] -} - -export interface MlGetMemoryStatsJvmStats { - heap_max?: ByteSize - heap_max_in_bytes: integer - java_inference?: ByteSize - java_inference_in_bytes: integer - java_inference_max?: ByteSize - java_inference_max_in_bytes: integer -} - -export interface MlGetMemoryStatsMemMlStats { - anomaly_detectors?: ByteSize - anomaly_detectors_in_bytes: integer - data_frame_analytics?: ByteSize - data_frame_analytics_in_bytes: integer - max?: ByteSize - max_in_bytes: integer - native_code_overhead?: ByteSize - native_code_overhead_in_bytes: integer - native_inference?: ByteSize - native_inference_in_bytes: integer -} - -export interface MlGetMemoryStatsMemStats { - adjusted_total?: ByteSize - adjusted_total_in_bytes: integer - total?: ByteSize - total_in_bytes: integer - ml: MlGetMemoryStatsMemMlStats -} - -export interface MlGetMemoryStatsMemory { - attributes: Record - jvm: MlGetMemoryStatsJvmStats - mem: MlGetMemoryStatsMemStats - name: Name - roles: string[] - transport_address: TransportAddress - ephemeral_id: Id -} - -export interface MlGetMemoryStatsRequest extends RequestBase { - node_id?: Id - human?: boolean - master_timeout?: Duration - timeout?: Duration -} - -export interface MlGetMemoryStatsResponse { - _nodes: NodeStatistics - cluster_name: Name - nodes: Record -} - -export interface MlGetModelSnapshotUpgradeStatsRequest extends RequestBase { - job_id: Id - snapshot_id: Id - allow_no_match?: boolean -} - -export interface MlGetModelSnapshotUpgradeStatsResponse { - count: long - model_snapshot_upgrades: MlModelSnapshotUpgrade[] -} - -export interface MlGetModelSnapshotsRequest extends RequestBase { - job_id: Id - snapshot_id?: Id - from?: integer - size?: integer - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - desc?: boolean - end?: DateTime - page?: MlPage - sort?: Field - start?: DateTime - } -} - -export interface MlGetModelSnapshotsResponse { - count: long - model_snapshots: MlModelSnapshot[] -} - -export interface MlGetOverallBucketsRequest extends RequestBase { - job_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - allow_no_match?: boolean - bucket_span?: Duration - end?: DateTime - exclude_interim?: boolean - overall_score?: double | string - start?: DateTime - top_n?: integer - } -} - -export interface MlGetOverallBucketsResponse { - count: long - overall_buckets: MlOverallBucket[] -} - -export interface MlGetRecordsRequest extends RequestBase { - job_id: Id - from?: integer - size?: integer - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - desc?: boolean - end?: DateTime - exclude_interim?: boolean - page?: MlPage - record_score?: double - sort?: Field - start?: DateTime - } -} - -export interface MlGetRecordsResponse { - count: long - records: MlAnomaly[] -} - -export interface MlGetTrainedModelsRequest extends RequestBase { - model_id?: Ids - allow_no_match?: boolean - decompress_definition?: boolean - exclude_generated?: boolean - from?: integer - include?: MlInclude - size?: integer - tags?: string | string[] -} - -export interface MlGetTrainedModelsResponse { - count: integer - trained_model_configs: MlTrainedModelConfig[] -} - -export interface MlGetTrainedModelsStatsRequest extends RequestBase { - model_id?: Ids - allow_no_match?: boolean - from?: integer - size?: integer -} - -export interface MlGetTrainedModelsStatsResponse { - count: integer - trained_model_stats: MlTrainedModelStats[] -} - -export interface MlInferTrainedModelRequest extends RequestBase { - model_id: Id - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - docs: Record[] - inference_config?: MlInferenceConfigUpdateContainer - } -} - -export interface MlInferTrainedModelResponse { - inference_results: MlInferenceResponseResult[] -} - -export interface MlInfoAnomalyDetectors { - categorization_analyzer: MlCategorizationAnalyzer - categorization_examples_limit: integer - model_memory_limit: string - model_snapshot_retention_days: integer - daily_model_snapshot_retention_after_days: integer -} - -export interface MlInfoDatafeeds { - scroll_size: integer -} - -export interface MlInfoDefaults { - anomaly_detectors: MlInfoAnomalyDetectors - datafeeds: MlInfoDatafeeds -} - -export interface MlInfoLimits { - max_model_memory_limit?: string - effective_max_model_memory_limit: string - total_ml_memory: string -} - -export interface MlInfoNativeCode { - build_hash: string - version: VersionString -} - -export interface MlInfoRequest extends RequestBase { -} - -export interface MlInfoResponse { - defaults: MlInfoDefaults - limits: MlInfoLimits - upgrade_mode: boolean - native_code: MlInfoNativeCode -} - -export interface MlOpenJobRequest extends RequestBase { - job_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - timeout?: Duration - } -} - -export interface MlOpenJobResponse { - opened: boolean - node: NodeId -} - -export interface MlPostCalendarEventsRequest extends RequestBase { - calendar_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - events: MlCalendarEvent[] - } -} - -export interface MlPostCalendarEventsResponse { - events: MlCalendarEvent[] -} - -export interface MlPostDataRequest extends RequestBase { - job_id: Id - reset_end?: DateTime - reset_start?: DateTime - /** @deprecated The use of the 'body' key has been deprecated, use 'data' instead. */ - body?: TData[] -} - -export interface MlPostDataResponse { - bucket_count: long - earliest_record_timestamp: long - empty_bucket_count: long - input_bytes: long - input_field_count: long - input_record_count: long - invalid_date_count: long - job_id: Id - last_data_time: integer - latest_record_timestamp: long - missing_field_count: long - out_of_order_timestamp_count: long - processed_field_count: long - processed_record_count: long - sparse_bucket_count: long -} - -export interface MlPreviewDataFrameAnalyticsDataframePreviewConfig { - source: MlDataframeAnalyticsSource - analysis: MlDataframeAnalysisContainer - model_memory_limit?: string - max_num_threads?: integer - analyzed_fields?: MlDataframeAnalysisAnalyzedFields | string[] -} - -export interface MlPreviewDataFrameAnalyticsRequest extends RequestBase { - id?: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - config?: MlPreviewDataFrameAnalyticsDataframePreviewConfig - } -} - -export interface MlPreviewDataFrameAnalyticsResponse { - feature_values: Record[] -} - -export interface MlPreviewDatafeedRequest extends RequestBase { - datafeed_id?: Id - start?: DateTime - end?: DateTime - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - datafeed_config?: MlDatafeedConfig - job_config?: MlJobConfig - } -} - -export type MlPreviewDatafeedResponse = TDocument[] - -export interface MlPutCalendarRequest extends RequestBase { - calendar_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - job_ids?: Id[] - description?: string - } -} - -export interface MlPutCalendarResponse { - calendar_id: Id - description?: string - job_ids: Ids -} - -export interface MlPutCalendarJobRequest extends RequestBase { - calendar_id: Id - job_id: Ids -} - -export interface MlPutCalendarJobResponse { - calendar_id: Id - description?: string - job_ids: Ids -} - -export interface MlPutDataFrameAnalyticsRequest extends RequestBase { - id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - allow_lazy_start?: boolean - analysis: MlDataframeAnalysisContainer - analyzed_fields?: MlDataframeAnalysisAnalyzedFields | string[] - description?: string - dest: MlDataframeAnalyticsDestination - max_num_threads?: integer - model_memory_limit?: string - source: MlDataframeAnalyticsSource - headers?: HttpHeaders - version?: VersionString - } -} - -export interface MlPutDataFrameAnalyticsResponse { - authorization?: MlDataframeAnalyticsAuthorization - allow_lazy_start: boolean - analysis: MlDataframeAnalysisContainer - analyzed_fields?: MlDataframeAnalysisAnalyzedFields | string[] - create_time: EpochTime - description?: string - dest: MlDataframeAnalyticsDestination - id: Id - max_num_threads: integer - model_memory_limit: string - source: MlDataframeAnalyticsSource - version: VersionString -} - -export interface MlPutDatafeedRequest extends RequestBase { - datafeed_id: Id - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_throttled?: boolean - ignore_unavailable?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - aggregations?: Record - chunking_config?: MlChunkingConfig - delayed_data_check_config?: MlDelayedDataCheckConfig - frequency?: Duration - indices?: Indices - /** @alias indices */ - indexes?: Indices - indices_options?: IndicesOptions - job_id?: Id - max_empty_searches?: integer - query?: QueryDslQueryContainer - query_delay?: Duration - runtime_mappings?: MappingRuntimeFields - script_fields?: Record - scroll_size?: integer - headers?: HttpHeaders - } -} - -export interface MlPutDatafeedResponse { - aggregations?: Record - authorization?: MlDatafeedAuthorization - chunking_config: MlChunkingConfig - delayed_data_check_config?: MlDelayedDataCheckConfig - datafeed_id: Id - frequency?: Duration - indices: string[] - job_id: Id - indices_options?: IndicesOptions - max_empty_searches?: integer - query: QueryDslQueryContainer - query_delay: Duration - runtime_mappings?: MappingRuntimeFields - script_fields?: Record - scroll_size: integer -} - -export interface MlPutFilterRequest extends RequestBase { - filter_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - description?: string - items?: string[] - } -} - -export interface MlPutFilterResponse { - description: string - filter_id: Id - items: string[] -} - -export interface MlPutJobRequest extends RequestBase { - job_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - allow_lazy_open?: boolean - analysis_config: MlAnalysisConfig - analysis_limits?: MlAnalysisLimits - background_persist_interval?: Duration - custom_settings?: MlCustomSettings - daily_model_snapshot_retention_after_days?: long - data_description: MlDataDescription - datafeed_config?: MlDatafeedConfig - description?: string - groups?: string[] - model_plot_config?: MlModelPlotConfig - model_snapshot_retention_days?: long - renormalization_window_days?: long - results_index_name?: IndexName - results_retention_days?: long - } -} - -export interface MlPutJobResponse { - allow_lazy_open: boolean - analysis_config: MlAnalysisConfigRead - analysis_limits: MlAnalysisLimits - background_persist_interval?: Duration - create_time: DateTime - custom_settings?: MlCustomSettings - daily_model_snapshot_retention_after_days: long - data_description: MlDataDescription - datafeed_config?: MlDatafeed - description?: string - groups?: string[] - job_id: Id - job_type: string - job_version: string - model_plot_config?: MlModelPlotConfig - model_snapshot_id?: Id - model_snapshot_retention_days: long - renormalization_window_days?: long - results_index_name: string - results_retention_days?: long -} - -export interface MlPutTrainedModelAggregateOutput { - logistic_regression?: MlPutTrainedModelWeights - weighted_sum?: MlPutTrainedModelWeights - weighted_mode?: MlPutTrainedModelWeights - exponent?: MlPutTrainedModelWeights -} - -export interface MlPutTrainedModelDefinition { - preprocessors?: MlPutTrainedModelPreprocessor[] - trained_model: MlPutTrainedModelTrainedModel -} - -export interface MlPutTrainedModelEnsemble { - aggregate_output?: MlPutTrainedModelAggregateOutput - classification_labels?: string[] - feature_names?: string[] - target_type?: string - trained_models: MlPutTrainedModelTrainedModel[] -} - -export interface MlPutTrainedModelFrequencyEncodingPreprocessor { - field: string - feature_name: string - frequency_map: Record -} - -export interface MlPutTrainedModelInput { - field_names: Names -} - -export interface MlPutTrainedModelOneHotEncodingPreprocessor { - field: string - hot_map: Record -} - -export interface MlPutTrainedModelPreprocessor { - frequency_encoding?: MlPutTrainedModelFrequencyEncodingPreprocessor - one_hot_encoding?: MlPutTrainedModelOneHotEncodingPreprocessor - target_mean_encoding?: MlPutTrainedModelTargetMeanEncodingPreprocessor -} - -export interface MlPutTrainedModelRequest extends RequestBase { - model_id: Id - defer_definition_decompression?: boolean - wait_for_completion?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - compressed_definition?: string - definition?: MlPutTrainedModelDefinition - description?: string - inference_config?: MlInferenceConfigCreateContainer - input?: MlPutTrainedModelInput - metadata?: any - model_type?: MlTrainedModelType - model_size_bytes?: long - platform_architecture?: string - tags?: string[] - prefix_strings?: MlTrainedModelPrefixStrings - } -} - -export type MlPutTrainedModelResponse = MlTrainedModelConfig - -export interface MlPutTrainedModelTargetMeanEncodingPreprocessor { - field: string - feature_name: string - target_map: Record - default_value: double -} - -export interface MlPutTrainedModelTrainedModel { - tree?: MlPutTrainedModelTrainedModelTree - tree_node?: MlPutTrainedModelTrainedModelTreeNode - ensemble?: MlPutTrainedModelEnsemble -} - -export interface MlPutTrainedModelTrainedModelTree { - classification_labels?: string[] - feature_names: string[] - target_type?: string - tree_structure: MlPutTrainedModelTrainedModelTreeNode[] -} - -export interface MlPutTrainedModelTrainedModelTreeNode { - decision_type?: string - default_left?: boolean - leaf_value?: double - left_child?: integer - node_index: integer - right_child?: integer - split_feature?: integer - split_gain?: integer - threshold?: double -} - -export interface MlPutTrainedModelWeights { - weights: double -} - -export interface MlPutTrainedModelAliasRequest extends RequestBase { - model_alias: Name - model_id: Id - reassign?: boolean -} - -export type MlPutTrainedModelAliasResponse = AcknowledgedResponseBase - -export interface MlPutTrainedModelDefinitionPartRequest extends RequestBase { - model_id: Id - part: integer - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - definition: string - total_definition_length: long - total_parts: integer - } -} - -export type MlPutTrainedModelDefinitionPartResponse = AcknowledgedResponseBase - -export interface MlPutTrainedModelVocabularyRequest extends RequestBase { - model_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - vocabulary: string[] - merges?: string[] - scores?: double[] - } -} - -export type MlPutTrainedModelVocabularyResponse = AcknowledgedResponseBase - -export interface MlResetJobRequest extends RequestBase { - job_id: Id - wait_for_completion?: boolean - delete_user_annotations?: boolean -} - -export type MlResetJobResponse = AcknowledgedResponseBase - -export interface MlRevertModelSnapshotRequest extends RequestBase { - job_id: Id - snapshot_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - delete_intervening_results?: boolean - } -} - -export interface MlRevertModelSnapshotResponse { - model: MlModelSnapshot -} - -export interface MlSetUpgradeModeRequest extends RequestBase { - enabled?: boolean - timeout?: Duration -} - -export type MlSetUpgradeModeResponse = AcknowledgedResponseBase - -export interface MlStartDataFrameAnalyticsRequest extends RequestBase { - id: Id - timeout?: Duration -} - -export interface MlStartDataFrameAnalyticsResponse { - acknowledged: boolean - node: NodeId -} - -export interface MlStartDatafeedRequest extends RequestBase { - datafeed_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - end?: DateTime - start?: DateTime - timeout?: Duration - } -} - -export interface MlStartDatafeedResponse { - node: NodeIds - started: boolean -} - -export interface MlStartTrainedModelDeploymentRequest extends RequestBase { - model_id: Id - cache_size?: ByteSize - deployment_id?: string - number_of_allocations?: integer - priority?: MlTrainingPriority - queue_capacity?: integer - threads_per_allocation?: integer - timeout?: Duration - wait_for?: MlDeploymentAllocationState -} - -export interface MlStartTrainedModelDeploymentResponse { - assignment: MlTrainedModelAssignment -} - -export interface MlStopDataFrameAnalyticsRequest extends RequestBase { - id: Id - allow_no_match?: boolean - force?: boolean - timeout?: Duration -} - -export interface MlStopDataFrameAnalyticsResponse { - stopped: boolean -} - -export interface MlStopDatafeedRequest extends RequestBase { - datafeed_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - allow_no_match?: boolean - force?: boolean - timeout?: Duration - } -} - -export interface MlStopDatafeedResponse { - stopped: boolean -} - -export interface MlStopTrainedModelDeploymentRequest extends RequestBase { - model_id: Id - allow_no_match?: boolean - force?: boolean -} - -export interface MlStopTrainedModelDeploymentResponse { - stopped: boolean -} - -export interface MlUpdateDataFrameAnalyticsRequest extends RequestBase { - id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - description?: string - model_memory_limit?: string - max_num_threads?: integer - allow_lazy_start?: boolean - } -} - -export interface MlUpdateDataFrameAnalyticsResponse { - authorization?: MlDataframeAnalyticsAuthorization - allow_lazy_start: boolean - analysis: MlDataframeAnalysisContainer - analyzed_fields?: MlDataframeAnalysisAnalyzedFields | string[] - create_time: long - description?: string - dest: MlDataframeAnalyticsDestination - id: Id - max_num_threads: integer - model_memory_limit: string - source: MlDataframeAnalyticsSource - version: VersionString -} - -export interface MlUpdateDatafeedRequest extends RequestBase { - datafeed_id: Id - allow_no_indices?: boolean - expand_wildcards?: ExpandWildcards - ignore_throttled?: boolean - ignore_unavailable?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - aggregations?: Record - chunking_config?: MlChunkingConfig - delayed_data_check_config?: MlDelayedDataCheckConfig - frequency?: Duration - indices?: string[] - /** @alias indices */ - indexes?: string[] - indices_options?: IndicesOptions - job_id?: Id - max_empty_searches?: integer - query?: QueryDslQueryContainer - query_delay?: Duration - runtime_mappings?: MappingRuntimeFields - script_fields?: Record - scroll_size?: integer - } -} - -export interface MlUpdateDatafeedResponse { - authorization?: MlDatafeedAuthorization - aggregations?: Record - chunking_config: MlChunkingConfig - delayed_data_check_config?: MlDelayedDataCheckConfig - datafeed_id: Id - frequency?: Duration - indices: string[] - indices_options?: IndicesOptions - job_id: Id - max_empty_searches?: integer - query: QueryDslQueryContainer - query_delay: Duration - runtime_mappings?: MappingRuntimeFields - script_fields?: Record - scroll_size: integer -} - -export interface MlUpdateFilterRequest extends RequestBase { - filter_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - add_items?: string[] - description?: string - remove_items?: string[] - } -} - -export interface MlUpdateFilterResponse { - description: string - filter_id: Id - items: string[] -} - -export interface MlUpdateJobRequest extends RequestBase { - job_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - allow_lazy_open?: boolean - analysis_limits?: MlAnalysisMemoryLimit - background_persist_interval?: Duration - custom_settings?: Record - categorization_filters?: string[] - description?: string - model_plot_config?: MlModelPlotConfig - model_prune_window?: Duration - daily_model_snapshot_retention_after_days?: long - model_snapshot_retention_days?: long - renormalization_window_days?: long - results_retention_days?: long - groups?: string[] - detectors?: MlDetector[] - per_partition_categorization?: MlPerPartitionCategorization - } -} - -export interface MlUpdateJobResponse { - allow_lazy_open: boolean - analysis_config: MlAnalysisConfigRead - analysis_limits: MlAnalysisLimits - background_persist_interval?: Duration - create_time: EpochTime - finished_time?: EpochTime - custom_settings?: Record - daily_model_snapshot_retention_after_days: long - data_description: MlDataDescription - datafeed_config?: MlDatafeed - description?: string - groups?: string[] - job_id: Id - job_type: string - job_version: VersionString - model_plot_config?: MlModelPlotConfig - model_snapshot_id?: Id - model_snapshot_retention_days: long - renormalization_window_days?: long - results_index_name: IndexName - results_retention_days?: long -} - -export interface MlUpdateModelSnapshotRequest extends RequestBase { - job_id: Id - snapshot_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - description?: string - retain?: boolean - } -} - -export interface MlUpdateModelSnapshotResponse { - acknowledged: boolean - model: MlModelSnapshot -} - -export interface MlUpdateTrainedModelDeploymentRequest extends RequestBase { - model_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - number_of_allocations?: integer - } -} - -export interface MlUpdateTrainedModelDeploymentResponse { - assignment: MlTrainedModelAssignment -} - -export interface MlUpgradeJobSnapshotRequest extends RequestBase { - job_id: Id - snapshot_id: Id - wait_for_completion?: boolean - timeout?: Duration -} - -export interface MlUpgradeJobSnapshotResponse { - node: NodeId - completed: boolean -} - -export interface MlValidateRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - job_id?: Id - analysis_config?: MlAnalysisConfig - analysis_limits?: MlAnalysisLimits - data_description?: MlDataDescription - description?: string - model_plot?: MlModelPlotConfig - model_snapshot_id?: Id - model_snapshot_retention_days?: long - results_index_name?: IndexName - } -} - -export type MlValidateResponse = AcknowledgedResponseBase - -export interface MlValidateDetectorRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, use 'detector' instead. */ - body?: MlDetector -} - -export type MlValidateDetectorResponse = AcknowledgedResponseBase - -export interface MonitoringBulkRequest extends RequestBase { - type?: string - system_id: string - system_api_version: string - interval: Duration - /** @deprecated The use of the 'body' key has been deprecated, use 'operations' instead. */ - body?: (BulkOperationContainer | BulkUpdateAction | TDocument)[] -} - -export interface MonitoringBulkResponse { - error?: ErrorCause - errors: boolean - ignored: boolean - took: long -} - -export interface NodesAdaptiveSelection { - avg_queue_size?: long - avg_response_time?: Duration - avg_response_time_ns?: long - avg_service_time?: Duration - avg_service_time_ns?: long - outgoing_searches?: long - rank?: string -} - -export interface NodesBreaker { - estimated_size?: string - estimated_size_in_bytes?: long - limit_size?: string - limit_size_in_bytes?: long - overhead?: float - tripped?: float -} - -export interface NodesCgroup { - cpuacct?: NodesCpuAcct - cpu?: NodesCgroupCpu - memory?: NodesCgroupMemory -} - -export interface NodesCgroupCpu { - control_group?: string - cfs_period_micros?: integer - cfs_quota_micros?: integer - stat?: NodesCgroupCpuStat -} - -export interface NodesCgroupCpuStat { - number_of_elapsed_periods?: long - number_of_times_throttled?: long - time_throttled_nanos?: DurationValue -} - -export interface NodesCgroupMemory { - control_group?: string - limit_in_bytes?: string - usage_in_bytes?: string -} - -export interface NodesClient { - id?: long - agent?: string - local_address?: string - remote_address?: string - last_uri?: string - opened_time_millis?: long - closed_time_millis?: long - last_request_time_millis?: long - request_count?: long - request_size_bytes?: long - x_opaque_id?: string -} - -export interface NodesClusterAppliedStats { - recordings?: NodesRecording[] -} - -export interface NodesClusterStateQueue { - total?: long - pending?: long - committed?: long -} - -export interface NodesClusterStateUpdate { - count: long - computation_time?: Duration - computation_time_millis?: DurationValue - publication_time?: Duration - publication_time_millis?: DurationValue - context_construction_time?: Duration - context_construction_time_millis?: DurationValue - commit_time?: Duration - commit_time_millis?: DurationValue - completion_time?: Duration - completion_time_millis?: DurationValue - master_apply_time?: Duration - master_apply_time_millis?: DurationValue - notification_time?: Duration - notification_time_millis?: DurationValue -} - -export interface NodesContext { - context?: string - compilations?: long - cache_evictions?: long - compilation_limit_triggered?: long -} - -export interface NodesCpu { - percent?: integer - sys?: Duration - sys_in_millis?: DurationValue - total?: Duration - total_in_millis?: DurationValue - user?: Duration - user_in_millis?: DurationValue - load_average?: Record -} - -export interface NodesCpuAcct { - control_group?: string - usage_nanos?: DurationValue -} - -export interface NodesDataPathStats { - available?: string - available_in_bytes?: long - disk_queue?: string - disk_reads?: long - disk_read_size?: string - disk_read_size_in_bytes?: long - disk_writes?: long - disk_write_size?: string - disk_write_size_in_bytes?: long - free?: string - free_in_bytes?: long - mount?: string - path?: string - total?: string - total_in_bytes?: long - type?: string -} - -export interface NodesDiscovery { - cluster_state_queue?: NodesClusterStateQueue - published_cluster_states?: NodesPublishedClusterStates - cluster_state_update?: Record - serialized_cluster_states?: NodesSerializedClusterState - cluster_applier_stats?: NodesClusterAppliedStats -} - -export interface NodesExtendedMemoryStats extends NodesMemoryStats { - free_percent?: integer - used_percent?: integer -} - -export interface NodesFileSystem { - data?: NodesDataPathStats[] - timestamp?: long - total?: NodesFileSystemTotal - io_stats?: NodesIoStats -} - -export interface NodesFileSystemTotal { - available?: string - available_in_bytes?: long - free?: string - free_in_bytes?: long - total?: string - total_in_bytes?: long -} - -export interface NodesGarbageCollector { - collectors?: Record -} - -export interface NodesGarbageCollectorTotal { - collection_count?: long - collection_time?: string - collection_time_in_millis?: long -} - -export interface NodesHttp { - current_open?: integer - total_opened?: long - clients?: NodesClient[] - routes: Record -} - -export interface NodesHttpRoute { - requests: NodesHttpRouteRequests - responses: NodesHttpRouteResponses -} - -export interface NodesHttpRouteRequests { - count: long - total_size_in_bytes: long - size_histogram: NodesSizeHttpHistogram[] -} - -export interface NodesHttpRouteResponses { - count: long - total_size_in_bytes: long - handling_time_histogram: NodesTimeHttpHistogram[] - size_histogram: NodesSizeHttpHistogram[] -} - -export interface NodesIndexingPressure { - memory?: NodesIndexingPressureMemory -} - -export interface NodesIndexingPressureMemory { - limit?: ByteSize - limit_in_bytes?: long - current?: NodesPressureMemory - total?: NodesPressureMemory -} - -export interface NodesIngest { - pipelines?: Record - total?: NodesIngestTotal -} - -export interface NodesIngestStats { - count: long - current: long - failed: long - processors: Record[] - time_in_millis: DurationValue - ingested_as_first_pipeline_in_bytes: long - produced_as_first_pipeline_in_bytes: long -} - -export interface NodesIngestTotal { - count: long - current: long - failed: long - time_in_millis: DurationValue -} - -export interface NodesIoStatDevice { - device_name?: string - operations?: long - read_kilobytes?: long - read_operations?: long - write_kilobytes?: long - write_operations?: long -} - -export interface NodesIoStats { - devices?: NodesIoStatDevice[] - total?: NodesIoStatDevice -} - -export interface NodesJvm { - buffer_pools?: Record - classes?: NodesJvmClasses - gc?: NodesGarbageCollector - mem?: NodesJvmMemoryStats - threads?: NodesJvmThreads - timestamp?: long - uptime?: string - uptime_in_millis?: long -} - -export interface NodesJvmClasses { - current_loaded_count?: long - total_loaded_count?: long - total_unloaded_count?: long -} - -export interface NodesJvmMemoryStats { - heap_used_in_bytes?: long - heap_used_percent?: long - heap_committed_in_bytes?: long - heap_max_in_bytes?: long - non_heap_used_in_bytes?: long - non_heap_committed_in_bytes?: long - pools?: Record -} - -export interface NodesJvmThreads { - count?: long - peak_count?: long -} - -export interface NodesKeyedProcessor { - stats?: NodesProcessor - type?: string -} - -export interface NodesMemoryStats { - adjusted_total_in_bytes?: long - resident?: string - resident_in_bytes?: long - share?: string - share_in_bytes?: long - total_virtual?: string - total_virtual_in_bytes?: long - total_in_bytes?: long - free_in_bytes?: long - used_in_bytes?: long -} - -export interface NodesNodeBufferPool { - count?: long - total_capacity?: string - total_capacity_in_bytes?: long - used?: string - used_in_bytes?: long -} - -export interface NodesNodeReloadError { - name: Name - reload_exception?: ErrorCause -} - -export type NodesNodeReloadResult = NodesStats | NodesNodeReloadError - -export interface NodesNodesResponseBase { - _nodes?: NodeStatistics -} - -export interface NodesOperatingSystem { - cpu?: NodesCpu - mem?: NodesExtendedMemoryStats - swap?: NodesMemoryStats - cgroup?: NodesCgroup - timestamp?: long -} - -export interface NodesPool { - used_in_bytes?: long - max_in_bytes?: long - peak_used_in_bytes?: long - peak_max_in_bytes?: long -} - -export interface NodesPressureMemory { - all?: ByteSize - all_in_bytes?: long - combined_coordinating_and_primary?: ByteSize - combined_coordinating_and_primary_in_bytes?: long - coordinating?: ByteSize - coordinating_in_bytes?: long - primary?: ByteSize - primary_in_bytes?: long - replica?: ByteSize - replica_in_bytes?: long - coordinating_rejections?: long - primary_rejections?: long - replica_rejections?: long -} - -export interface NodesProcess { - cpu?: NodesCpu - mem?: NodesMemoryStats - open_file_descriptors?: integer - max_file_descriptors?: integer - timestamp?: long -} - -export interface NodesProcessor { - count?: long - current?: long - failed?: long - time_in_millis?: DurationValue -} - -export interface NodesPublishedClusterStates { - full_states?: long - incompatible_diffs?: long - compatible_diffs?: long -} - -export interface NodesRecording { - name?: string - cumulative_execution_count?: long - cumulative_execution_time?: Duration - cumulative_execution_time_millis?: DurationValue -} - -export interface NodesRepositoryLocation { - base_path: string - container?: string - bucket?: string -} - -export interface NodesRepositoryMeteringInformation { - repository_name: Name - repository_type: string - repository_location: NodesRepositoryLocation - repository_ephemeral_id: Id - repository_started_at: EpochTime - repository_stopped_at?: EpochTime - archived: boolean - cluster_version?: VersionNumber - request_counts: NodesRequestCounts -} - -export interface NodesRequestCounts { - GetBlobProperties?: long - GetBlob?: long - ListBlobs?: long - PutBlob?: long - PutBlock?: long - PutBlockList?: long - GetObject?: long - ListObjects?: long - InsertObject?: long - PutObject?: long - PutMultipartObject?: long -} - -export interface NodesScriptCache { - cache_evictions?: long - compilation_limit_triggered?: long - compilations?: long - context?: string -} - -export interface NodesScripting { - cache_evictions?: long - compilations?: long - compilations_history?: Record - compilation_limit_triggered?: long - contexts?: NodesContext[] -} - -export interface NodesSerializedClusterState { - full_states?: NodesSerializedClusterStateDetail - diffs?: NodesSerializedClusterStateDetail -} - -export interface NodesSerializedClusterStateDetail { - count?: long - uncompressed_size?: string - uncompressed_size_in_bytes?: long - compressed_size?: string - compressed_size_in_bytes?: long -} - -export interface NodesSizeHttpHistogram { - count: long - ge_bytes?: long - lt_bytes?: long -} - -export interface NodesStats { - adaptive_selection?: Record - breakers?: Record - fs?: NodesFileSystem - host?: Host - http?: NodesHttp - ingest?: NodesIngest - ip?: Ip | Ip[] - jvm?: NodesJvm - name?: Name - os?: NodesOperatingSystem - process?: NodesProcess - roles?: NodeRoles - script?: NodesScripting - script_cache?: Record - thread_pool?: Record - timestamp?: long - transport?: NodesTransport - transport_address?: TransportAddress - attributes?: Record - discovery?: NodesDiscovery - indexing_pressure?: NodesIndexingPressure - indices?: IndicesStatsShardStats -} - -export interface NodesThreadCount { - active?: long - completed?: long - largest?: long - queue?: long - rejected?: long - threads?: long -} - -export interface NodesTimeHttpHistogram { - count: long - ge_millis?: long - lt_millis?: long -} - -export interface NodesTransport { - inbound_handling_time_histogram?: NodesTransportHistogram[] - outbound_handling_time_histogram?: NodesTransportHistogram[] - rx_count?: long - rx_size?: string - rx_size_in_bytes?: long - server_open?: integer - tx_count?: long - tx_size?: string - tx_size_in_bytes?: long - total_outbound_connections?: long -} - -export interface NodesTransportHistogram { - count?: long - lt_millis?: long - ge_millis?: long -} - -export interface NodesClearRepositoriesMeteringArchiveRequest extends RequestBase { - node_id: NodeIds - max_archive_version: long -} - -export type NodesClearRepositoriesMeteringArchiveResponse = NodesClearRepositoriesMeteringArchiveResponseBase - -export interface NodesClearRepositoriesMeteringArchiveResponseBase extends NodesNodesResponseBase { - cluster_name: Name - nodes: Record -} - -export interface NodesGetRepositoriesMeteringInfoRequest extends RequestBase { - node_id: NodeIds -} - -export type NodesGetRepositoriesMeteringInfoResponse = NodesGetRepositoriesMeteringInfoResponseBase - -export interface NodesGetRepositoriesMeteringInfoResponseBase extends NodesNodesResponseBase { - cluster_name: Name - nodes: Record -} - -export interface NodesHotThreadsRequest extends RequestBase { - node_id?: NodeIds - ignore_idle_threads?: boolean - interval?: Duration - snapshots?: long - master_timeout?: Duration - threads?: long - timeout?: Duration - type?: ThreadType - sort?: ThreadType -} - -export interface NodesHotThreadsResponse { -} - -export interface NodesInfoDeprecationIndexing { - enabled: boolean | string -} - -export interface NodesInfoNodeInfo { - attributes: Record - build_flavor: string - build_hash: string - build_type: string - host: Host - http?: NodesInfoNodeInfoHttp - ip: Ip - jvm?: NodesInfoNodeJvmInfo - name: Name - network?: NodesInfoNodeInfoNetwork - os?: NodesInfoNodeOperatingSystemInfo - plugins?: PluginStats[] - process?: NodesInfoNodeProcessInfo - roles: NodeRoles - settings?: NodesInfoNodeInfoSettings - thread_pool?: Record - total_indexing_buffer?: long - total_indexing_buffer_in_bytes?: ByteSize - transport?: NodesInfoNodeInfoTransport - transport_address: TransportAddress - version: VersionString - modules?: PluginStats[] - ingest?: NodesInfoNodeInfoIngest - aggregations?: Record -} - -export interface NodesInfoNodeInfoAction { - destructive_requires_name: string -} - -export interface NodesInfoNodeInfoAggregation { - types: string[] -} - -export interface NodesInfoNodeInfoBootstrap { - memory_lock: string -} - -export interface NodesInfoNodeInfoClient { - type: string -} - -export interface NodesInfoNodeInfoDiscoverKeys { - seed_hosts?: string[] - type?: string - seed_providers?: string[] -} -export type NodesInfoNodeInfoDiscover = NodesInfoNodeInfoDiscoverKeys -& { [property: string]: any } - -export interface NodesInfoNodeInfoHttp { - bound_address: string[] - max_content_length?: ByteSize - max_content_length_in_bytes: long - publish_address: string -} - -export interface NodesInfoNodeInfoIngest { - processors: NodesInfoNodeInfoIngestProcessor[] -} - -export interface NodesInfoNodeInfoIngestDownloader { - enabled: string -} - -export interface NodesInfoNodeInfoIngestInfo { - downloader: NodesInfoNodeInfoIngestDownloader -} - -export interface NodesInfoNodeInfoIngestProcessor { - type: string -} - -export interface NodesInfoNodeInfoJvmMemory { - direct_max?: ByteSize - direct_max_in_bytes: long - heap_init?: ByteSize - heap_init_in_bytes: long - heap_max?: ByteSize - heap_max_in_bytes: long - non_heap_init?: ByteSize - non_heap_init_in_bytes: long - non_heap_max?: ByteSize - non_heap_max_in_bytes: long -} - -export interface NodesInfoNodeInfoMemory { - total: string - total_in_bytes: long -} - -export interface NodesInfoNodeInfoNetwork { - primary_interface: NodesInfoNodeInfoNetworkInterface - refresh_interval: integer -} - -export interface NodesInfoNodeInfoNetworkInterface { - address: string - mac_address: string - name: Name -} - -export interface NodesInfoNodeInfoOSCPU { - cache_size: string - cache_size_in_bytes: integer - cores_per_socket: integer - mhz: integer - model: string - total_cores: integer - total_sockets: integer - vendor: string -} - -export interface NodesInfoNodeInfoPath { - logs?: string - home?: string - repo?: string[] - data?: string[] -} - -export interface NodesInfoNodeInfoRepositories { - url: NodesInfoNodeInfoRepositoriesUrl -} - -export interface NodesInfoNodeInfoRepositoriesUrl { - allowed_urls: string -} - -export interface NodesInfoNodeInfoScript { - allowed_types: string - disable_max_compilations_rate?: string -} - -export interface NodesInfoNodeInfoSearch { - remote: NodesInfoNodeInfoSearchRemote -} - -export interface NodesInfoNodeInfoSearchRemote { - connect: string -} - -export interface NodesInfoNodeInfoSettings { - cluster: NodesInfoNodeInfoSettingsCluster - node: NodesInfoNodeInfoSettingsNode - path?: NodesInfoNodeInfoPath - repositories?: NodesInfoNodeInfoRepositories - discovery?: NodesInfoNodeInfoDiscover - action?: NodesInfoNodeInfoAction - client?: NodesInfoNodeInfoClient - http: NodesInfoNodeInfoSettingsHttp - bootstrap?: NodesInfoNodeInfoBootstrap - transport: NodesInfoNodeInfoSettingsTransport - network?: NodesInfoNodeInfoSettingsNetwork - xpack?: NodesInfoNodeInfoXpack - script?: NodesInfoNodeInfoScript - search?: NodesInfoNodeInfoSearch - ingest?: NodesInfoNodeInfoSettingsIngest -} - -export interface NodesInfoNodeInfoSettingsCluster { - name: Name - routing?: IndicesIndexRouting - election: NodesInfoNodeInfoSettingsClusterElection - initial_master_nodes?: string[] - deprecation_indexing?: NodesInfoDeprecationIndexing -} - -export interface NodesInfoNodeInfoSettingsClusterElection { - strategy: Name -} - -export interface NodesInfoNodeInfoSettingsHttp { - type: NodesInfoNodeInfoSettingsHttpType | string - 'type.default'?: string - compression?: boolean | string - port?: integer | string -} - -export interface NodesInfoNodeInfoSettingsHttpType { - default: string -} - -export interface NodesInfoNodeInfoSettingsIngest { - attachment?: NodesInfoNodeInfoIngestInfo - append?: NodesInfoNodeInfoIngestInfo - csv?: NodesInfoNodeInfoIngestInfo - convert?: NodesInfoNodeInfoIngestInfo - date?: NodesInfoNodeInfoIngestInfo - date_index_name?: NodesInfoNodeInfoIngestInfo - dot_expander?: NodesInfoNodeInfoIngestInfo - enrich?: NodesInfoNodeInfoIngestInfo - fail?: NodesInfoNodeInfoIngestInfo - foreach?: NodesInfoNodeInfoIngestInfo - json?: NodesInfoNodeInfoIngestInfo - user_agent?: NodesInfoNodeInfoIngestInfo - kv?: NodesInfoNodeInfoIngestInfo - geoip?: NodesInfoNodeInfoIngestInfo - grok?: NodesInfoNodeInfoIngestInfo - gsub?: NodesInfoNodeInfoIngestInfo - join?: NodesInfoNodeInfoIngestInfo - lowercase?: NodesInfoNodeInfoIngestInfo - remove?: NodesInfoNodeInfoIngestInfo - rename?: NodesInfoNodeInfoIngestInfo - script?: NodesInfoNodeInfoIngestInfo - set?: NodesInfoNodeInfoIngestInfo - sort?: NodesInfoNodeInfoIngestInfo - split?: NodesInfoNodeInfoIngestInfo - trim?: NodesInfoNodeInfoIngestInfo - uppercase?: NodesInfoNodeInfoIngestInfo - urldecode?: NodesInfoNodeInfoIngestInfo - bytes?: NodesInfoNodeInfoIngestInfo - dissect?: NodesInfoNodeInfoIngestInfo - set_security_user?: NodesInfoNodeInfoIngestInfo - pipeline?: NodesInfoNodeInfoIngestInfo - drop?: NodesInfoNodeInfoIngestInfo - circle?: NodesInfoNodeInfoIngestInfo - inference?: NodesInfoNodeInfoIngestInfo -} - -export interface NodesInfoNodeInfoSettingsNetwork { - host?: Host | Host[] -} - -export interface NodesInfoNodeInfoSettingsNode { - name: Name - attr: Record - max_local_storage_nodes?: string -} - -export interface NodesInfoNodeInfoSettingsTransport { - type: NodesInfoNodeInfoSettingsTransportType | string - 'type.default'?: string - features?: NodesInfoNodeInfoSettingsTransportFeatures -} - -export interface NodesInfoNodeInfoSettingsTransportFeatures { - 'x-pack': string -} - -export interface NodesInfoNodeInfoSettingsTransportType { - default: string -} - -export interface NodesInfoNodeInfoTransport { - bound_address: string[] - publish_address: string - profiles: Record -} - -export interface NodesInfoNodeInfoXpack { - license?: NodesInfoNodeInfoXpackLicense - security: NodesInfoNodeInfoXpackSecurity - notification?: Record - ml?: NodesInfoNodeInfoXpackMl -} - -export interface NodesInfoNodeInfoXpackLicense { - self_generated: NodesInfoNodeInfoXpackLicenseType -} - -export interface NodesInfoNodeInfoXpackLicenseType { - type: string -} - -export interface NodesInfoNodeInfoXpackMl { - use_auto_machine_memory_percent?: boolean -} - -export interface NodesInfoNodeInfoXpackSecurity { - http?: NodesInfoNodeInfoXpackSecuritySsl - enabled: string - transport?: NodesInfoNodeInfoXpackSecuritySsl - authc?: NodesInfoNodeInfoXpackSecurityAuthc -} - -export interface NodesInfoNodeInfoXpackSecurityAuthc { - realms?: NodesInfoNodeInfoXpackSecurityAuthcRealms - token?: NodesInfoNodeInfoXpackSecurityAuthcToken -} - -export interface NodesInfoNodeInfoXpackSecurityAuthcRealms { - file?: Record - native?: Record - pki?: Record -} - -export interface NodesInfoNodeInfoXpackSecurityAuthcRealmsStatus { - enabled?: string - order: string -} - -export interface NodesInfoNodeInfoXpackSecurityAuthcToken { - enabled: string -} - -export interface NodesInfoNodeInfoXpackSecuritySsl { - ssl: Record -} - -export interface NodesInfoNodeJvmInfo { - gc_collectors: string[] - mem: NodesInfoNodeInfoJvmMemory - memory_pools: string[] - pid: integer - start_time_in_millis: EpochTime - version: VersionString - vm_name: Name - vm_vendor: string - vm_version: VersionString - using_bundled_jdk: boolean - bundled_jdk: boolean - using_compressed_ordinary_object_pointers?: boolean | string - input_arguments: string[] -} - -export interface NodesInfoNodeOperatingSystemInfo { - arch: string - available_processors: integer - allocated_processors?: integer - name: Name - pretty_name: Name - refresh_interval_in_millis: DurationValue - version: VersionString - cpu?: NodesInfoNodeInfoOSCPU - mem?: NodesInfoNodeInfoMemory - swap?: NodesInfoNodeInfoMemory -} - -export interface NodesInfoNodeProcessInfo { - id: long - mlockall: boolean - refresh_interval_in_millis: DurationValue -} - -export interface NodesInfoNodeThreadPoolInfo { - core?: integer - keep_alive?: Duration - max?: integer - queue_size: integer - size?: integer - type: string -} - -export interface NodesInfoRequest extends RequestBase { - node_id?: NodeIds - metric?: Metrics - flat_settings?: boolean - master_timeout?: Duration - timeout?: Duration -} - -export type NodesInfoResponse = NodesInfoResponseBase - -export interface NodesInfoResponseBase extends NodesNodesResponseBase { - cluster_name: Name - nodes: Record -} - -export interface NodesReloadSecureSettingsRequest extends RequestBase { - node_id?: NodeIds - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - secure_settings_password?: Password - } -} - -export type NodesReloadSecureSettingsResponse = NodesReloadSecureSettingsResponseBase - -export interface NodesReloadSecureSettingsResponseBase extends NodesNodesResponseBase { - cluster_name: Name - nodes: Record -} - -export interface NodesStatsRequest extends RequestBase { - node_id?: NodeIds - metric?: Metrics - index_metric?: Metrics - completion_fields?: Fields - fielddata_fields?: Fields - fields?: Fields - groups?: boolean - include_segment_file_sizes?: boolean - level?: Level - master_timeout?: Duration - timeout?: Duration - types?: string[] - include_unloaded_segments?: boolean -} - -export type NodesStatsResponse = NodesStatsResponseBase - -export interface NodesStatsResponseBase extends NodesNodesResponseBase { - cluster_name?: Name - nodes: Record -} - -export interface NodesUsageNodeUsage { - rest_actions: Record - since: EpochTime - timestamp: EpochTime - aggregations: Record -} - -export interface NodesUsageRequest extends RequestBase { - node_id?: NodeIds - metric?: Metrics - timeout?: Duration -} - -export type NodesUsageResponse = NodesUsageResponseBase - -export interface NodesUsageResponseBase extends NodesNodesResponseBase { - cluster_name: Name - nodes: Record -} - -export interface QueryRulesQueryRule { - rule_id: Id - type: QueryRulesQueryRuleType - criteria: QueryRulesQueryRuleCriteria | QueryRulesQueryRuleCriteria[] - actions: QueryRulesQueryRuleActions - priority?: integer -} - -export interface QueryRulesQueryRuleActions { - ids?: Id[] - docs?: QueryDslPinnedDoc[] -} - -export interface QueryRulesQueryRuleCriteria { - type: QueryRulesQueryRuleCriteriaType - metadata?: string - values?: any[] -} - -export type QueryRulesQueryRuleCriteriaType = 'global' | 'exact' | 'exact_fuzzy' | 'fuzzy' | 'prefix' | 'suffix' | 'contains' | 'lt' | 'lte' | 'gt' | 'gte' | 'always' - -export type QueryRulesQueryRuleType = 'pinned' | 'exclude' - -export interface QueryRulesQueryRuleset { - ruleset_id: Id - rules: QueryRulesQueryRule[] -} - -export interface QueryRulesDeleteRuleRequest extends RequestBase { - ruleset_id: Id - rule_id: Id -} - -export type QueryRulesDeleteRuleResponse = AcknowledgedResponseBase - -export interface QueryRulesDeleteRulesetRequest extends RequestBase { - ruleset_id: Id -} - -export type QueryRulesDeleteRulesetResponse = AcknowledgedResponseBase - -export interface QueryRulesGetRuleRequest extends RequestBase { - ruleset_id: Id - rule_id: Id -} - -export type QueryRulesGetRuleResponse = QueryRulesQueryRule - -export interface QueryRulesGetRulesetRequest extends RequestBase { - ruleset_id: Id -} - -export type QueryRulesGetRulesetResponse = QueryRulesQueryRuleset - -export interface QueryRulesListRulesetsQueryRulesetListItem { - ruleset_id: Id - rule_total_count: integer - rule_criteria_types_counts: Record - rule_type_counts: Record -} - -export interface QueryRulesListRulesetsRequest extends RequestBase { - from?: integer - size?: integer -} - -export interface QueryRulesListRulesetsResponse { - count: long - results: QueryRulesListRulesetsQueryRulesetListItem[] -} - -export interface QueryRulesPutRuleRequest extends RequestBase { - ruleset_id: Id - rule_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - type: QueryRulesQueryRuleType - criteria: QueryRulesQueryRuleCriteria | QueryRulesQueryRuleCriteria[] - actions: QueryRulesQueryRuleActions - priority?: integer - } -} - -export interface QueryRulesPutRuleResponse { - result: Result -} - -export interface QueryRulesPutRulesetRequest extends RequestBase { - ruleset_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - rules: QueryRulesQueryRule | QueryRulesQueryRule[] - } -} - -export interface QueryRulesPutRulesetResponse { - result: Result -} - -export interface QueryRulesTestQueryRulesetMatchedRule { - ruleset_id: Id - rule_id: Id -} - -export interface QueryRulesTestRequest extends RequestBase { - ruleset_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - match_criteria: Record - } -} - -export interface QueryRulesTestResponse { - total_matched_rules: integer - matched_rules: QueryRulesTestQueryRulesetMatchedRule[] -} - -export interface RollupDateHistogramGrouping { - delay?: Duration - field: Field - format?: string - interval?: Duration - calendar_interval?: Duration - fixed_interval?: Duration - time_zone?: TimeZone -} - -export interface RollupFieldMetric { - field: Field - metrics: RollupMetric[] -} - -export interface RollupGroupings { - date_histogram?: RollupDateHistogramGrouping - histogram?: RollupHistogramGrouping - terms?: RollupTermsGrouping -} - -export interface RollupHistogramGrouping { - fields: Fields - interval: long -} - -export type RollupMetric = 'min' | 'max' | 'sum' | 'avg' | 'value_count' - -export interface RollupTermsGrouping { - fields: Fields -} - -export interface RollupDeleteJobRequest extends RequestBase { - id: Id -} - -export interface RollupDeleteJobResponse { - acknowledged: boolean - task_failures?: TaskFailure[] -} - -export type RollupGetJobsIndexingJobState = 'started' | 'indexing' | 'stopping' | 'stopped' | 'aborting' - -export interface RollupGetJobsRequest extends RequestBase { - id?: Id -} - -export interface RollupGetJobsResponse { - jobs: RollupGetJobsRollupJob[] -} - -export interface RollupGetJobsRollupJob { - config: RollupGetJobsRollupJobConfiguration - stats: RollupGetJobsRollupJobStats - status: RollupGetJobsRollupJobStatus -} - -export interface RollupGetJobsRollupJobConfiguration { - cron: string - groups: RollupGroupings - id: Id - index_pattern: string - metrics: RollupFieldMetric[] - page_size: long - rollup_index: IndexName - timeout: Duration -} - -export interface RollupGetJobsRollupJobStats { - documents_processed: long - index_failures: long - index_time_in_ms: DurationValue - index_total: long - pages_processed: long - rollups_indexed: long - search_failures: long - search_time_in_ms: DurationValue - search_total: long - trigger_count: long - processing_time_in_ms: DurationValue - processing_total: long -} - -export interface RollupGetJobsRollupJobStatus { - current_position?: Record - job_state: RollupGetJobsIndexingJobState - upgraded_doc_id?: boolean -} - -export interface RollupGetRollupCapsRequest extends RequestBase { - id?: Id -} - -export type RollupGetRollupCapsResponse = Record - -export interface RollupGetRollupCapsRollupCapabilities { - rollup_jobs: RollupGetRollupCapsRollupCapabilitySummary[] -} - -export interface RollupGetRollupCapsRollupCapabilitySummary { - fields: Record - index_pattern: string - job_id: string - rollup_index: string -} - -export interface RollupGetRollupCapsRollupFieldSummary { - agg: string - calendar_interval?: Duration - time_zone?: TimeZone -} - -export interface RollupGetRollupIndexCapsIndexCapabilities { - rollup_jobs: RollupGetRollupIndexCapsRollupJobSummary[] -} - -export interface RollupGetRollupIndexCapsRequest extends RequestBase { - index: Ids -} - -export type RollupGetRollupIndexCapsResponse = Record - -export interface RollupGetRollupIndexCapsRollupJobSummary { - fields: Record - index_pattern: string - job_id: Id - rollup_index: IndexName -} - -export interface RollupGetRollupIndexCapsRollupJobSummaryField { - agg: string - time_zone?: TimeZone - calendar_interval?: Duration -} - -export interface RollupPutJobRequest extends RequestBase { - id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - cron: string - groups: RollupGroupings - index_pattern: string - metrics?: RollupFieldMetric[] - page_size: integer - rollup_index: IndexName - timeout?: Duration - headers?: HttpHeaders - } -} - -export type RollupPutJobResponse = AcknowledgedResponseBase - -export interface RollupRollupSearchRequest extends RequestBase { - index: Indices - rest_total_hits_as_int?: boolean - typed_keys?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - aggregations?: Record - /** @alias aggregations */ - aggs?: Record - query?: QueryDslQueryContainer - size?: integer - } -} - -export interface RollupRollupSearchResponse> { - took: long - timed_out: boolean - terminated_early?: boolean - _shards: ShardStatistics - hits: SearchHitsMetadata - aggregations?: TAggregations -} - -export interface RollupStartJobRequest extends RequestBase { - id: Id -} - -export interface RollupStartJobResponse { - started: boolean -} - -export interface RollupStopJobRequest extends RequestBase { - id: Id - timeout?: Duration - wait_for_completion?: boolean -} - -export interface RollupStopJobResponse { - stopped: boolean -} - -export interface SearchApplicationAnalyticsCollection { - event_data_stream: SearchApplicationEventDataStream -} - -export interface SearchApplicationEventDataStream { - name: IndexName -} - -export interface SearchApplicationSearchApplication { - name: Name - indices: IndexName[] - updated_at_millis: EpochTime - analytics_collection_name?: Name - template?: SearchApplicationSearchApplicationTemplate -} - -export interface SearchApplicationSearchApplicationTemplate { - script: Script | string -} - -export interface SearchApplicationDeleteRequest extends RequestBase { - name: Name -} - -export type SearchApplicationDeleteResponse = AcknowledgedResponseBase - -export interface SearchApplicationDeleteBehavioralAnalyticsRequest extends RequestBase { - name: Name -} - -export type SearchApplicationDeleteBehavioralAnalyticsResponse = AcknowledgedResponseBase - -export interface SearchApplicationGetRequest extends RequestBase { - name: Name -} - -export type SearchApplicationGetResponse = SearchApplicationSearchApplication - -export interface SearchApplicationGetBehavioralAnalyticsRequest extends RequestBase { - name?: Name[] -} - -export type SearchApplicationGetBehavioralAnalyticsResponse = Record - -export interface SearchApplicationListRequest extends RequestBase { - q?: string - from?: integer - size?: integer -} - -export interface SearchApplicationListResponse { - count: long - results: SearchApplicationListSearchApplicationListItem[] -} - -export interface SearchApplicationListSearchApplicationListItem { - name: Name - indices: IndexName[] - updated_at_millis: EpochTime - analytics_collection_name?: Name -} - -export interface SearchApplicationPutRequest extends RequestBase { - name: Name - create?: boolean - /** @deprecated The use of the 'body' key has been deprecated, use 'search_application' instead. */ - body?: SearchApplicationSearchApplication -} - -export interface SearchApplicationPutResponse { - result: Result -} - -export interface SearchApplicationPutBehavioralAnalyticsAnalyticsAcknowledgeResponseBase extends AcknowledgedResponseBase { - name: Name -} - -export interface SearchApplicationPutBehavioralAnalyticsRequest extends RequestBase { - name: Name -} - -export type SearchApplicationPutBehavioralAnalyticsResponse = SearchApplicationPutBehavioralAnalyticsAnalyticsAcknowledgeResponseBase - -export interface SearchApplicationSearchRequest extends RequestBase { - name: Name - typed_keys?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - params?: Record - } -} - -export type SearchApplicationSearchResponse> = SearchResponseBody - -export type SearchableSnapshotsStatsLevel = 'cluster' | 'indices' | 'shards' - -export interface SearchableSnapshotsCacheStatsNode { - shared_cache: SearchableSnapshotsCacheStatsShared -} - -export interface SearchableSnapshotsCacheStatsRequest extends RequestBase { - node_id?: NodeIds - master_timeout?: Duration -} - -export interface SearchableSnapshotsCacheStatsResponse { - nodes: Record -} - -export interface SearchableSnapshotsCacheStatsShared { - reads: long - bytes_read_in_bytes: ByteSize - writes: long - bytes_written_in_bytes: ByteSize - evictions: long - num_regions: integer - size_in_bytes: ByteSize - region_size_in_bytes: ByteSize -} - -export interface SearchableSnapshotsClearCacheRequest extends RequestBase { - index?: Indices - expand_wildcards?: ExpandWildcards - allow_no_indices?: boolean - ignore_unavailable?: boolean - pretty?: boolean - human?: boolean -} - -export type SearchableSnapshotsClearCacheResponse = any - -export interface SearchableSnapshotsMountMountedSnapshot { - snapshot: Name - indices: Indices - shards: ShardStatistics -} - -export interface SearchableSnapshotsMountRequest extends RequestBase { - repository: Name - snapshot: Name - master_timeout?: Duration - wait_for_completion?: boolean - storage?: string - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - index: IndexName - renamed_index?: IndexName - index_settings?: Record - ignore_index_settings?: string[] - } -} - -export interface SearchableSnapshotsMountResponse { - snapshot: SearchableSnapshotsMountMountedSnapshot -} - -export interface SearchableSnapshotsStatsRequest extends RequestBase { - index?: Indices - level?: SearchableSnapshotsStatsLevel -} - -export interface SearchableSnapshotsStatsResponse { - stats: any - total: any -} - -export interface SecurityAccess { - replication?: SecurityReplicationAccess[] - search?: SecuritySearchAccess[] -} - -export interface SecurityApiKey { - id: Id - name: Name - type: SecurityApiKeyType - creation: EpochTime - expiration?: EpochTime - invalidated: boolean - invalidation?: EpochTime - username: Username - realm: string - realm_type?: string - metadata: Metadata - role_descriptors?: Record - limited_by?: Record[] - access?: SecurityAccess - profile_uid?: string - _sort?: SortResults -} - -export type SecurityApiKeyType = 'rest' | 'cross_cluster' - -export interface SecurityApplicationGlobalUserPrivileges { - manage: SecurityManageUserPrivileges -} - -export interface SecurityApplicationPrivileges { - application: string - privileges: string[] - resources: string[] -} - -export interface SecurityBulkError { - count: integer - details: Record -} - -export interface SecurityClusterNode { - name: Name -} - -export type SecurityClusterPrivilege = 'all' | 'cancel_task' | 'create_snapshot' | 'cross_cluster_replication' | 'cross_cluster_search' | 'delegate_pki' | 'grant_api_key' | 'manage' | 'manage_api_key' | 'manage_autoscaling' | 'manage_behavioral_analytics' | 'manage_ccr' | 'manage_data_frame_transforms' | 'manage_data_stream_global_retention' | 'manage_enrich' | 'manage_ilm' | 'manage_index_templates' | 'manage_inference' | 'manage_ingest_pipelines' | 'manage_logstash_pipelines' | 'manage_ml' | 'manage_oidc' | 'manage_own_api_key' | 'manage_pipeline' | 'manage_rollup' | 'manage_saml' | 'manage_search_application' | 'manage_search_query_rules' | 'manage_search_synonyms' | 'manage_security' | 'manage_service_account' | 'manage_slm' | 'manage_token' | 'manage_transform' | 'manage_user_profile' | 'manage_watcher' | 'monitor' | 'monitor_data_frame_transforms' | 'monitor_data_stream_global_retention' | 'monitor_enrich' | 'monitor_inference' | 'monitor_ml' | 'monitor_rollup' | 'monitor_snapshot' | 'monitor_stats' | 'monitor_text_structure' | 'monitor_transform' | 'monitor_watcher' | 'none' | 'post_behavioral_analytics_event' | 'read_ccr' | 'read_fleet_secrets' | 'read_ilm' | 'read_pipeline' | 'read_security' | 'read_slm' | 'transport_client' | 'write_connector_secrets' | 'write_fleet_secrets' | string - -export interface SecurityCreatedStatus { - created: boolean -} - -export interface SecurityFieldRule { - username?: Names - dn?: Names - groups?: Names -} - -export interface SecurityFieldSecurity { - except?: Fields - grant?: Fields -} - -export interface SecurityGlobalPrivilege { - application: SecurityApplicationGlobalUserPrivileges -} - -export type SecurityGrantType = 'password' | 'access_token' - -export type SecurityIndexPrivilege = 'all' | 'auto_configure' | 'create' | 'create_doc' | 'create_index' | 'cross_cluster_replication' | 'cross_cluster_replication_internal' | 'delete' | 'delete_index' | 'index' | 'maintenance' | 'manage' | 'manage_data_stream_lifecycle' | 'manage_follow_index' | 'manage_ilm' | 'manage_leader_index' | 'monitor' | 'none' | 'read' | 'read_cross_cluster' | 'view_index_metadata' | 'write' | string - -export interface SecurityIndicesPrivileges { - field_security?: SecurityFieldSecurity - names: IndexName | IndexName[] - privileges: SecurityIndexPrivilege[] - query?: SecurityIndicesPrivilegesQuery - allow_restricted_indices?: boolean -} - -export type SecurityIndicesPrivilegesQuery = string | QueryDslQueryContainer | SecurityRoleTemplateQuery - -export interface SecurityManageUserPrivileges { - applications: string[] -} - -export interface SecurityRealmInfo { - name: Name - type: string -} - -export type SecurityRemoteClusterPrivilege = 'monitor_enrich' | 'monitor_stats' - -export interface SecurityRemoteClusterPrivileges { - clusters: Names - privileges: SecurityRemoteClusterPrivilege[] -} - -export interface SecurityRemoteIndicesPrivileges { - clusters: Names - field_security?: SecurityFieldSecurity - names: IndexName | IndexName[] - privileges: SecurityIndexPrivilege[] - query?: SecurityIndicesPrivilegesQuery - allow_restricted_indices?: boolean -} - -export interface SecurityReplicationAccess { - names: IndexName | IndexName[] - allow_restricted_indices?: boolean -} - -export interface SecurityRestriction { - workflows: SecurityRestrictionWorkflow[] -} - -export type SecurityRestrictionWorkflow = 'search_application_query' | string - -export interface SecurityRoleDescriptor { - cluster?: SecurityClusterPrivilege[] - indices?: SecurityIndicesPrivileges[] - index?: SecurityIndicesPrivileges[] - remote_indices?: SecurityRemoteIndicesPrivileges[] - remote_cluster?: SecurityRemoteClusterPrivileges[] - global?: SecurityGlobalPrivilege[] | SecurityGlobalPrivilege - applications?: SecurityApplicationPrivileges[] - metadata?: Metadata - run_as?: string[] - description?: string - restriction?: SecurityRestriction - transient_metadata?: Record -} - -export interface SecurityRoleDescriptorRead { - cluster: SecurityClusterPrivilege[] - indices: SecurityIndicesPrivileges[] - index: SecurityIndicesPrivileges[] - remote_indices?: SecurityRemoteIndicesPrivileges[] - remote_cluster?: SecurityRemoteClusterPrivileges[] - global?: SecurityGlobalPrivilege[] | SecurityGlobalPrivilege - applications?: SecurityApplicationPrivileges[] - metadata?: Metadata - run_as?: string[] - description?: string - restriction?: SecurityRestriction - transient_metadata?: Record -} - -export interface SecurityRoleMapping { - enabled: boolean - metadata: Metadata - roles?: string[] - role_templates?: SecurityRoleTemplate[] - rules: SecurityRoleMappingRule -} - -export interface SecurityRoleMappingRule { - any?: SecurityRoleMappingRule[] - all?: SecurityRoleMappingRule[] - field?: SecurityFieldRule - except?: SecurityRoleMappingRule -} - -export interface SecurityRoleTemplate { - format?: SecurityTemplateFormat - template: Script | string -} - -export type SecurityRoleTemplateInlineQuery = string | QueryDslQueryContainer - -export interface SecurityRoleTemplateQuery { - template?: SecurityRoleTemplateScript | SecurityRoleTemplateInlineQuery -} - -export interface SecurityRoleTemplateScript { - source?: SecurityRoleTemplateInlineQuery - id?: Id - params?: Record - lang?: ScriptLanguage - options?: Record -} - -export interface SecuritySearchAccess { - field_security?: SecurityFieldSecurity - names: IndexName | IndexName[] - query?: SecurityIndicesPrivilegesQuery - allow_restricted_indices?: boolean -} - -export type SecurityTemplateFormat = 'string' | 'json' - -export interface SecurityUser { - email?: string | null - full_name?: Name | null - metadata: Metadata - roles: string[] - username: Username - enabled: boolean - profile_uid?: SecurityUserProfileId -} - -export interface SecurityUserIndicesPrivileges { - field_security?: SecurityFieldSecurity[] - names: IndexName | IndexName[] - privileges: SecurityIndexPrivilege[] - query?: SecurityIndicesPrivilegesQuery[] - allow_restricted_indices: boolean -} - -export interface SecurityUserProfile { - uid: SecurityUserProfileId - user: SecurityUserProfileUser - data: Record - labels: Record - enabled?: boolean -} - -export interface SecurityUserProfileHitMetadata { - _primary_term: long - _seq_no: SequenceNumber -} - -export type SecurityUserProfileId = string - -export interface SecurityUserProfileUser { - email?: string | null - full_name?: Name | null - realm_name: Name - realm_domain?: Name - roles: string[] - username: Username -} - -export interface SecurityUserProfileWithMetadata extends SecurityUserProfile { - last_synchronized: long - _doc: SecurityUserProfileHitMetadata -} - -export interface SecurityActivateUserProfileRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - access_token?: string - grant_type: SecurityGrantType - password?: string - username?: string - } -} - -export type SecurityActivateUserProfileResponse = SecurityUserProfileWithMetadata - -export interface SecurityAuthenticateAuthenticateApiKey { - id: Id - name?: Name -} - -export interface SecurityAuthenticateRequest extends RequestBase { -} - -export interface SecurityAuthenticateResponse { - api_key?: SecurityAuthenticateAuthenticateApiKey - authentication_realm: SecurityRealmInfo - email?: string | null - full_name?: Name | null - lookup_realm: SecurityRealmInfo - metadata: Metadata - roles: string[] - username: Username - enabled: boolean - authentication_type: string - token?: SecurityAuthenticateToken -} - -export interface SecurityAuthenticateToken { - name: Name - type?: string -} - -export interface SecurityBulkDeleteRoleRequest extends RequestBase { - refresh?: Refresh - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - names: string[] - } -} - -export interface SecurityBulkDeleteRoleResponse { - deleted?: string[] - not_found?: string[] - errors?: SecurityBulkError -} - -export interface SecurityBulkPutRoleRequest extends RequestBase { - refresh?: Refresh - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - roles: Record - } -} - -export interface SecurityBulkPutRoleResponse { - created?: string[] - updated?: string[] - noop?: string[] - errors?: SecurityBulkError -} - -export interface SecurityChangePasswordRequest extends RequestBase { - username?: Username - refresh?: Refresh - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - password?: Password - password_hash?: string - } -} - -export interface SecurityChangePasswordResponse { -} - -export interface SecurityClearApiKeyCacheRequest extends RequestBase { - ids: Ids -} - -export interface SecurityClearApiKeyCacheResponse { - _nodes: NodeStatistics - cluster_name: Name - nodes: Record -} - -export interface SecurityClearCachedPrivilegesRequest extends RequestBase { - application: Name -} - -export interface SecurityClearCachedPrivilegesResponse { - _nodes: NodeStatistics - cluster_name: Name - nodes: Record -} - -export interface SecurityClearCachedRealmsRequest extends RequestBase { - realms: Names - usernames?: string[] -} - -export interface SecurityClearCachedRealmsResponse { - _nodes: NodeStatistics - cluster_name: Name - nodes: Record -} - -export interface SecurityClearCachedRolesRequest extends RequestBase { - name: Names -} - -export interface SecurityClearCachedRolesResponse { - _nodes: NodeStatistics - cluster_name: Name - nodes: Record -} - -export interface SecurityClearCachedServiceTokensRequest extends RequestBase { - namespace: Namespace - service: Service - name: Names -} - -export interface SecurityClearCachedServiceTokensResponse { - _nodes: NodeStatistics - cluster_name: Name - nodes: Record -} - -export interface SecurityCreateApiKeyRequest extends RequestBase { - refresh?: Refresh - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - expiration?: Duration - name?: Name - role_descriptors?: Record - metadata?: Metadata - } -} - -export interface SecurityCreateApiKeyResponse { - api_key: string - expiration?: long - id: Id - name: Name - encoded: string -} - -export interface SecurityCreateCrossClusterApiKeyRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - access: SecurityAccess - expiration?: Duration - metadata?: Metadata - name: Name - } -} - -export interface SecurityCreateCrossClusterApiKeyResponse { - api_key: string - expiration?: DurationValue - id: Id - name: Name - encoded: string -} - -export interface SecurityCreateServiceTokenRequest extends RequestBase { - namespace: Namespace - service: Service - name?: Name - refresh?: Refresh -} - -export interface SecurityCreateServiceTokenResponse { - created: boolean - token: SecurityCreateServiceTokenToken -} - -export interface SecurityCreateServiceTokenToken { - name: Name - value: string -} - -export interface SecurityDeletePrivilegesFoundStatus { - found: boolean -} - -export interface SecurityDeletePrivilegesRequest extends RequestBase { - application: Name - name: Names - refresh?: Refresh -} - -export type SecurityDeletePrivilegesResponse = Record> - -export interface SecurityDeleteRoleRequest extends RequestBase { - name: Name - refresh?: Refresh -} - -export interface SecurityDeleteRoleResponse { - found: boolean -} - -export interface SecurityDeleteRoleMappingRequest extends RequestBase { - name: Name - refresh?: Refresh -} - -export interface SecurityDeleteRoleMappingResponse { - found: boolean -} - -export interface SecurityDeleteServiceTokenRequest extends RequestBase { - namespace: Namespace - service: Service - name: Name - refresh?: Refresh -} - -export interface SecurityDeleteServiceTokenResponse { - found: boolean -} - -export interface SecurityDeleteUserRequest extends RequestBase { - username: Username - refresh?: Refresh -} - -export interface SecurityDeleteUserResponse { - found: boolean -} - -export interface SecurityDisableUserRequest extends RequestBase { - username: Username - refresh?: Refresh -} - -export interface SecurityDisableUserResponse { -} - -export interface SecurityDisableUserProfileRequest extends RequestBase { - uid: SecurityUserProfileId - refresh?: Refresh -} - -export type SecurityDisableUserProfileResponse = AcknowledgedResponseBase - -export interface SecurityEnableUserRequest extends RequestBase { - username: Username - refresh?: Refresh -} - -export interface SecurityEnableUserResponse { -} - -export interface SecurityEnableUserProfileRequest extends RequestBase { - uid: SecurityUserProfileId - refresh?: Refresh -} - -export type SecurityEnableUserProfileResponse = AcknowledgedResponseBase - -export interface SecurityEnrollKibanaRequest extends RequestBase { -} - -export interface SecurityEnrollKibanaResponse { - token: SecurityEnrollKibanaToken - http_ca: string -} - -export interface SecurityEnrollKibanaToken { - name: string - value: string -} - -export interface SecurityEnrollNodeRequest extends RequestBase { -} - -export interface SecurityEnrollNodeResponse { - http_ca_key: string - http_ca_cert: string - transport_ca_cert: string - transport_key: string - transport_cert: string - nodes_addresses: string[] -} - -export interface SecurityGetApiKeyRequest extends RequestBase { - id?: Id - name?: Name - owner?: boolean - realm_name?: Name - username?: Username - with_limited_by?: boolean - active_only?: boolean - with_profile_uid?: boolean -} - -export interface SecurityGetApiKeyResponse { - api_keys: SecurityApiKey[] -} - -export interface SecurityGetBuiltinPrivilegesRequest extends RequestBase { -} - -export interface SecurityGetBuiltinPrivilegesResponse { - cluster: SecurityClusterPrivilege[] - index: Indices - remote_cluster: SecurityRemoteClusterPrivilege[] -} - -export interface SecurityGetPrivilegesRequest extends RequestBase { - application?: Name - name?: Names -} - -export type SecurityGetPrivilegesResponse = Record> - -export interface SecurityGetRoleRequest extends RequestBase { - name?: Names -} - -export type SecurityGetRoleResponse = Record - -export interface SecurityGetRoleRole { - cluster: SecurityClusterPrivilege[] - indices: SecurityIndicesPrivileges[] - remote_indices?: SecurityRemoteIndicesPrivileges[] - remote_cluster?: SecurityRemoteClusterPrivileges[] - metadata: Metadata - run_as: string[] - transient_metadata?: Record - applications: SecurityApplicationPrivileges[] - role_templates?: SecurityRoleTemplate[] - global?: Record>> -} - -export interface SecurityGetRoleMappingRequest extends RequestBase { - name?: Names -} - -export type SecurityGetRoleMappingResponse = Record - -export interface SecurityGetServiceAccountsRequest extends RequestBase { - namespace?: Namespace - service?: Service -} - -export type SecurityGetServiceAccountsResponse = Record - -export interface SecurityGetServiceAccountsRoleDescriptorWrapper { - role_descriptor: SecurityRoleDescriptorRead -} - -export interface SecurityGetServiceCredentialsNodesCredentials { - _nodes: NodeStatistics - file_tokens: Record -} - -export interface SecurityGetServiceCredentialsNodesCredentialsFileToken { - nodes: string[] -} - -export interface SecurityGetServiceCredentialsRequest extends RequestBase { - namespace: Namespace - service: Name -} - -export interface SecurityGetServiceCredentialsResponse { - service_account: string - count: integer - tokens: Record - nodes_credentials: SecurityGetServiceCredentialsNodesCredentials -} - -export type SecurityGetTokenAccessTokenGrantType = 'password' | 'client_credentials' | '_kerberos' | 'refresh_token' - -export interface SecurityGetTokenAuthenticatedUser extends SecurityUser { - authentication_realm: SecurityGetTokenUserRealm - lookup_realm: SecurityGetTokenUserRealm - authentication_provider?: SecurityGetTokenAuthenticationProvider - authentication_type: string -} - -export interface SecurityGetTokenAuthenticationProvider { - type: string - name: Name -} - -export interface SecurityGetTokenRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - grant_type?: SecurityGetTokenAccessTokenGrantType - scope?: string - password?: Password - kerberos_ticket?: string - refresh_token?: string - username?: Username - } -} - -export interface SecurityGetTokenResponse { - access_token: string - expires_in: long - scope?: string - type: string - refresh_token?: string - kerberos_authentication_response_token?: string - authentication: SecurityGetTokenAuthenticatedUser -} - -export interface SecurityGetTokenUserRealm { - name: Name - type: string -} - -export interface SecurityGetUserRequest extends RequestBase { - username?: Username | Username[] - with_profile_uid?: boolean -} - -export type SecurityGetUserResponse = Record - -export interface SecurityGetUserPrivilegesRequest extends RequestBase { - application?: Name - priviledge?: Name - username?: Name | null -} - -export interface SecurityGetUserPrivilegesResponse { - applications: SecurityApplicationPrivileges[] - cluster: string[] - global: SecurityGlobalPrivilege[] - indices: SecurityUserIndicesPrivileges[] - run_as: string[] -} - -export interface SecurityGetUserProfileGetUserProfileErrors { - count: long - details: Record -} - -export interface SecurityGetUserProfileRequest extends RequestBase { - uid: SecurityUserProfileId | SecurityUserProfileId[] - data?: string | string[] -} - -export interface SecurityGetUserProfileResponse { - profiles: SecurityUserProfileWithMetadata[] - errors?: SecurityGetUserProfileGetUserProfileErrors -} - -export type SecurityGrantApiKeyApiKeyGrantType = 'access_token' | 'password' - -export interface SecurityGrantApiKeyGrantApiKey { - name: Name - expiration?: DurationLarge - role_descriptors?: Record | Record[] - metadata?: Metadata -} - -export interface SecurityGrantApiKeyRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - api_key: SecurityGrantApiKeyGrantApiKey - grant_type: SecurityGrantApiKeyApiKeyGrantType - access_token?: string - username?: Username - password?: Password - run_as?: Username - } -} - -export interface SecurityGrantApiKeyResponse { - api_key: string - id: Id - name: Name - expiration?: EpochTime - encoded: string -} - -export interface SecurityHasPrivilegesApplicationPrivilegesCheck { - application: string - privileges: string[] - resources: string[] -} - -export type SecurityHasPrivilegesApplicationsPrivileges = Record - -export interface SecurityHasPrivilegesIndexPrivilegesCheck { - names: Indices - privileges: SecurityIndexPrivilege[] - allow_restricted_indices?: boolean -} - -export type SecurityHasPrivilegesPrivileges = Record - -export interface SecurityHasPrivilegesRequest extends RequestBase { - user?: Name - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - application?: SecurityHasPrivilegesApplicationPrivilegesCheck[] - cluster?: SecurityClusterPrivilege[] - index?: SecurityHasPrivilegesIndexPrivilegesCheck[] - } -} - -export type SecurityHasPrivilegesResourcePrivileges = Record - -export interface SecurityHasPrivilegesResponse { - application: SecurityHasPrivilegesApplicationsPrivileges - cluster: Record - has_all_requested: boolean - index: Record - username: Username -} - -export interface SecurityHasPrivilegesUserProfileHasPrivilegesUserProfileErrors { - count: long - details: Record -} - -export interface SecurityHasPrivilegesUserProfilePrivilegesCheck { - application?: SecurityHasPrivilegesApplicationPrivilegesCheck[] - cluster?: SecurityClusterPrivilege[] - index?: SecurityHasPrivilegesIndexPrivilegesCheck[] -} - -export interface SecurityHasPrivilegesUserProfileRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - uids: SecurityUserProfileId[] - privileges: SecurityHasPrivilegesUserProfilePrivilegesCheck - } -} - -export interface SecurityHasPrivilegesUserProfileResponse { - has_privilege_uids: SecurityUserProfileId[] - errors?: SecurityHasPrivilegesUserProfileHasPrivilegesUserProfileErrors -} - -export interface SecurityInvalidateApiKeyRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - id?: Id - ids?: Id[] - name?: Name - owner?: boolean - realm_name?: string - username?: Username - } -} - -export interface SecurityInvalidateApiKeyResponse { - error_count: integer - error_details?: ErrorCause[] - invalidated_api_keys: string[] - previously_invalidated_api_keys: string[] -} - -export interface SecurityInvalidateTokenRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - token?: string - refresh_token?: string - realm_name?: Name - username?: Username - } -} - -export interface SecurityInvalidateTokenResponse { - error_count: long - error_details?: ErrorCause[] - invalidated_tokens: long - previously_invalidated_tokens: long -} - -export interface SecurityPutPrivilegesActions { - actions: string[] - application?: string - name?: Name - metadata?: Metadata -} - -export interface SecurityPutPrivilegesRequest extends RequestBase { - refresh?: Refresh - /** @deprecated The use of the 'body' key has been deprecated, use 'privileges' instead. */ - body?: Record> -} - -export type SecurityPutPrivilegesResponse = Record> - -export interface SecurityPutRoleRequest extends RequestBase { - name: Name - refresh?: Refresh - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - applications?: SecurityApplicationPrivileges[] - cluster?: SecurityClusterPrivilege[] - global?: Record - indices?: SecurityIndicesPrivileges[] - remote_indices?: SecurityRemoteIndicesPrivileges[] - remote_cluster?: SecurityRemoteClusterPrivileges[] - metadata?: Metadata - run_as?: string[] - description?: string - transient_metadata?: Record - } -} - -export interface SecurityPutRoleResponse { - role: SecurityCreatedStatus -} - -export interface SecurityPutRoleMappingRequest extends RequestBase { - name: Name - refresh?: Refresh - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - enabled?: boolean - metadata?: Metadata - roles?: string[] - role_templates?: SecurityRoleTemplate[] - rules?: SecurityRoleMappingRule - run_as?: string[] - } -} - -export interface SecurityPutRoleMappingResponse { - created?: boolean - role_mapping: SecurityCreatedStatus -} - -export interface SecurityPutUserRequest extends RequestBase { - username: Username - refresh?: Refresh - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - username?: Username - email?: string | null - full_name?: string | null - metadata?: Metadata - password?: Password - password_hash?: string - roles?: string[] - enabled?: boolean - } -} - -export interface SecurityPutUserResponse { - created: boolean -} - -export type SecurityQueryApiKeysApiKeyAggregate = AggregationsCardinalityAggregate | AggregationsValueCountAggregate | AggregationsStringTermsAggregate | AggregationsLongTermsAggregate | AggregationsDoubleTermsAggregate | AggregationsUnmappedTermsAggregate | AggregationsMultiTermsAggregate | AggregationsMissingAggregate | AggregationsFilterAggregate | AggregationsFiltersAggregate | AggregationsRangeAggregate | AggregationsDateRangeAggregate | AggregationsCompositeAggregate - -export interface SecurityQueryApiKeysApiKeyAggregationContainer { - aggregations?: Record - aggs?: Record - meta?: Metadata - cardinality?: AggregationsCardinalityAggregation - composite?: AggregationsCompositeAggregation - date_range?: AggregationsDateRangeAggregation - filter?: SecurityQueryApiKeysApiKeyQueryContainer - filters?: SecurityQueryApiKeysApiKeyFiltersAggregation - missing?: AggregationsMissingAggregation - range?: AggregationsRangeAggregation - terms?: AggregationsTermsAggregation - value_count?: AggregationsValueCountAggregation -} - -export interface SecurityQueryApiKeysApiKeyFiltersAggregation extends AggregationsBucketAggregationBase { - filters?: AggregationsBuckets - other_bucket?: boolean - other_bucket_key?: string - keyed?: boolean -} - -export interface SecurityQueryApiKeysApiKeyQueryContainer { - bool?: QueryDslBoolQuery - exists?: QueryDslExistsQuery - ids?: QueryDslIdsQuery - match?: Partial> - match_all?: QueryDslMatchAllQuery - prefix?: Partial> - range?: Partial> - simple_query_string?: QueryDslSimpleQueryStringQuery - term?: Partial> - terms?: QueryDslTermsQuery - wildcard?: Partial> -} - -export interface SecurityQueryApiKeysRequest extends RequestBase { - with_limited_by?: boolean - with_profile_uid?: boolean - typed_keys?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - aggregations?: Record - /** @alias aggregations */ - aggs?: Record - query?: SecurityQueryApiKeysApiKeyQueryContainer - from?: integer - sort?: Sort - size?: integer - search_after?: SortResults - } -} - -export interface SecurityQueryApiKeysResponse { - total: integer - count: integer - api_keys: SecurityApiKey[] - aggregations?: Record -} - -export interface SecurityQueryRoleQueryRole extends SecurityRoleDescriptor { - _sort?: SortResults - name: string -} - -export interface SecurityQueryRoleRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - query?: SecurityQueryRoleRoleQueryContainer - from?: integer - sort?: Sort - size?: integer - search_after?: SortResults - } -} - -export interface SecurityQueryRoleResponse { - total: integer - count: integer - roles: SecurityQueryRoleQueryRole[] -} - -export interface SecurityQueryRoleRoleQueryContainer { - bool?: QueryDslBoolQuery - exists?: QueryDslExistsQuery - ids?: QueryDslIdsQuery - match?: Partial> - match_all?: QueryDslMatchAllQuery - prefix?: Partial> - range?: Partial> - simple_query_string?: QueryDslSimpleQueryStringQuery - term?: Partial> - terms?: QueryDslTermsQuery - wildcard?: Partial> -} - -export interface SecurityQueryUserQueryUser extends SecurityUser { - _sort?: SortResults -} - -export interface SecurityQueryUserRequest extends RequestBase { - with_profile_uid?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - query?: SecurityQueryUserUserQueryContainer - from?: integer - sort?: Sort - size?: integer - search_after?: SortResults - } -} - -export interface SecurityQueryUserResponse { - total: integer - count: integer - users: SecurityQueryUserQueryUser[] -} - -export interface SecurityQueryUserUserQueryContainer { - ids?: QueryDslIdsQuery - bool?: QueryDslBoolQuery - exists?: QueryDslExistsQuery - match?: Partial> - match_all?: QueryDslMatchAllQuery - prefix?: Partial> - range?: Partial> - simple_query_string?: QueryDslSimpleQueryStringQuery - term?: Partial> - terms?: QueryDslTermsQuery - wildcard?: Partial> -} - -export interface SecuritySamlAuthenticateRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - content: string - ids: Ids - realm?: string - } -} - -export interface SecuritySamlAuthenticateResponse { - access_token: string - username: string - expires_in: integer - refresh_token: string - realm: string -} - -export interface SecuritySamlCompleteLogoutRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - realm: string - ids: Ids - query_string?: string - content?: string - } -} - -export type SecuritySamlCompleteLogoutResponse = boolean - -export interface SecuritySamlInvalidateRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - acs?: string - query_string: string - realm?: string - } -} - -export interface SecuritySamlInvalidateResponse { - invalidated: integer - realm: string - redirect: string -} - -export interface SecuritySamlLogoutRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - token: string - refresh_token?: string - } -} - -export interface SecuritySamlLogoutResponse { - redirect: string -} - -export interface SecuritySamlPrepareAuthenticationRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - acs?: string - realm?: string - relay_state?: string - } -} - -export interface SecuritySamlPrepareAuthenticationResponse { - id: Id - realm: string - redirect: string -} - -export interface SecuritySamlServiceProviderMetadataRequest extends RequestBase { - realm_name: Name -} - -export interface SecuritySamlServiceProviderMetadataResponse { - metadata: string -} - -export interface SecuritySuggestUserProfilesHint { - uids?: SecurityUserProfileId[] - labels?: Record -} - -export interface SecuritySuggestUserProfilesRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - name?: string - size?: long - data?: string | string[] - hint?: SecuritySuggestUserProfilesHint - } -} - -export interface SecuritySuggestUserProfilesResponse { - total: SecuritySuggestUserProfilesTotalUserProfiles - took: long - profiles: SecurityUserProfile[] -} - -export interface SecuritySuggestUserProfilesTotalUserProfiles { - value: long - relation: RelationName -} - -export interface SecurityUpdateApiKeyRequest extends RequestBase { - id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - role_descriptors?: Record - metadata?: Metadata - expiration?: Duration - } -} - -export interface SecurityUpdateApiKeyResponse { - updated: boolean -} - -export interface SecurityUpdateCrossClusterApiKeyRequest extends RequestBase { - id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - access: SecurityAccess - expiration?: Duration - metadata?: Metadata - } -} - -export interface SecurityUpdateCrossClusterApiKeyResponse { - updated: boolean -} - -export interface SecurityUpdateUserProfileDataRequest extends RequestBase { - uid: SecurityUserProfileId - if_seq_no?: SequenceNumber - if_primary_term?: long - refresh?: Refresh - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - labels?: Record - data?: Record - } -} - -export type SecurityUpdateUserProfileDataResponse = AcknowledgedResponseBase - -export type ShutdownType = 'restart' | 'remove' | 'replace' - -export interface ShutdownDeleteNodeRequest extends RequestBase { - node_id: NodeId - master_timeout?: TimeUnit - timeout?: TimeUnit -} - -export type ShutdownDeleteNodeResponse = AcknowledgedResponseBase - -export interface ShutdownGetNodeNodeShutdownStatus { - node_id: NodeId - type: ShutdownGetNodeShutdownType - reason: string - shutdown_startedmillis: EpochTime - status: ShutdownGetNodeShutdownStatus - shard_migration: ShutdownGetNodeShardMigrationStatus - persistent_tasks: ShutdownGetNodePersistentTaskStatus - plugins: ShutdownGetNodePluginsStatus -} - -export interface ShutdownGetNodePersistentTaskStatus { - status: ShutdownGetNodeShutdownStatus -} - -export interface ShutdownGetNodePluginsStatus { - status: ShutdownGetNodeShutdownStatus -} - -export interface ShutdownGetNodeRequest extends RequestBase { - node_id?: NodeIds - master_timeout?: TimeUnit - timeout?: TimeUnit -} - -export interface ShutdownGetNodeResponse { - nodes: ShutdownGetNodeNodeShutdownStatus[] -} - -export interface ShutdownGetNodeShardMigrationStatus { - status: ShutdownGetNodeShutdownStatus -} - -export type ShutdownGetNodeShutdownStatus = 'not_started' | 'in_progress' | 'stalled' | 'complete' - -export type ShutdownGetNodeShutdownType = 'remove' | 'restart' - -export interface ShutdownPutNodeRequest extends RequestBase { - node_id: NodeId - master_timeout?: TimeUnit - timeout?: TimeUnit - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - type: ShutdownType - reason: string - allocation_delay?: string - target_node_name?: string - } -} - -export type ShutdownPutNodeResponse = AcknowledgedResponseBase - -export interface SlmConfiguration { - ignore_unavailable?: boolean - indices?: Indices - include_global_state?: boolean - feature_states?: string[] - metadata?: Metadata - partial?: boolean -} - -export interface SlmInProgress { - name: Name - start_time_millis: EpochTime - state: string - uuid: Uuid -} - -export interface SlmInvocation { - snapshot_name: Name - time: DateTime -} - -export interface SlmPolicy { - config?: SlmConfiguration - name: Name - repository: string - retention?: SlmRetention - schedule: WatcherCronExpression -} - -export interface SlmRetention { - expire_after: Duration - max_count: integer - min_count: integer -} - -export interface SlmSnapshotLifecycle { - in_progress?: SlmInProgress - last_failure?: SlmInvocation - last_success?: SlmInvocation - modified_date?: DateTime - modified_date_millis: EpochTime - next_execution?: DateTime - next_execution_millis: EpochTime - policy: SlmPolicy - version: VersionNumber - stats: SlmStatistics -} - -export interface SlmStatistics { - retention_deletion_time?: Duration - retention_deletion_time_millis?: DurationValue - retention_failed?: long - retention_runs?: long - retention_timed_out?: long - policy?: Id - total_snapshots_deleted?: long - snapshots_deleted?: long - total_snapshot_deletion_failures?: long - snapshot_deletion_failures?: long - total_snapshots_failed?: long - snapshots_failed?: long - total_snapshots_taken?: long - snapshots_taken?: long -} - -export interface SlmDeleteLifecycleRequest extends RequestBase { - policy_id: Name -} - -export type SlmDeleteLifecycleResponse = AcknowledgedResponseBase - -export interface SlmExecuteLifecycleRequest extends RequestBase { - policy_id: Name -} - -export interface SlmExecuteLifecycleResponse { - snapshot_name: Name -} - -export interface SlmExecuteRetentionRequest extends RequestBase { -} - -export type SlmExecuteRetentionResponse = AcknowledgedResponseBase - -export interface SlmGetLifecycleRequest extends RequestBase { - policy_id?: Names -} - -export type SlmGetLifecycleResponse = Record - -export interface SlmGetStatsRequest extends RequestBase { -} - -export interface SlmGetStatsResponse { - retention_deletion_time: Duration - retention_deletion_time_millis: DurationValue - retention_failed: long - retention_runs: long - retention_timed_out: long - total_snapshots_deleted: long - total_snapshot_deletion_failures: long - total_snapshots_failed: long - total_snapshots_taken: long - policy_stats: string[] -} - -export interface SlmGetStatusRequest extends RequestBase { -} - -export interface SlmGetStatusResponse { - operation_mode: LifecycleOperationMode -} - -export interface SlmPutLifecycleRequest extends RequestBase { - policy_id: Name - master_timeout?: Duration - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - config?: SlmConfiguration - name?: Name - repository?: string - retention?: SlmRetention - schedule?: WatcherCronExpression - } -} - -export type SlmPutLifecycleResponse = AcknowledgedResponseBase - -export interface SlmStartRequest extends RequestBase { -} - -export type SlmStartResponse = AcknowledgedResponseBase - -export interface SlmStopRequest extends RequestBase { -} - -export type SlmStopResponse = AcknowledgedResponseBase - -export interface SnapshotAzureRepository extends SnapshotRepositoryBase { - type: 'azure' - settings: SnapshotAzureRepositorySettings -} - -export interface SnapshotAzureRepositorySettings extends SnapshotRepositorySettingsBase { - client?: string - container?: string - base_path?: string - readonly?: boolean - location_mode?: string -} - -export interface SnapshotFileCountSnapshotStats { - file_count: integer - size_in_bytes: long -} - -export interface SnapshotGcsRepository extends SnapshotRepositoryBase { - type: 'gcs' - settings: SnapshotGcsRepositorySettings -} - -export interface SnapshotGcsRepositorySettings extends SnapshotRepositorySettingsBase { - bucket: string - client?: string - base_path?: string - readonly?: boolean - application_name?: string -} - -export interface SnapshotIndexDetails { - shard_count: integer - size?: ByteSize - size_in_bytes: long - max_segments_per_shard: long -} - -export interface SnapshotInfoFeatureState { - feature_name: string - indices: Indices -} - -export interface SnapshotReadOnlyUrlRepository extends SnapshotRepositoryBase { - type: 'url' - settings: SnapshotReadOnlyUrlRepositorySettings -} - -export interface SnapshotReadOnlyUrlRepositorySettings extends SnapshotRepositorySettingsBase { - http_max_retries?: integer - http_socket_timeout?: Duration - max_number_of_snapshots?: integer - url: string -} - -export type SnapshotRepository = SnapshotAzureRepository | SnapshotGcsRepository | SnapshotS3Repository | SnapshotSharedFileSystemRepository | SnapshotReadOnlyUrlRepository | SnapshotSourceOnlyRepository - -export interface SnapshotRepositoryBase { - uuid?: Uuid -} - -export interface SnapshotRepositorySettingsBase { - chunk_size?: ByteSize - compress?: boolean - max_restore_bytes_per_sec?: ByteSize - max_snapshot_bytes_per_sec?: ByteSize -} - -export interface SnapshotS3Repository extends SnapshotRepositoryBase { - type: 's3' - settings: SnapshotS3RepositorySettings -} - -export interface SnapshotS3RepositorySettings extends SnapshotRepositorySettingsBase { - bucket: string - client?: string - base_path?: string - readonly?: boolean - server_side_encryption?: boolean - buffer_size?: ByteSize - canned_acl?: string - storage_class?: string -} - -export interface SnapshotShardsStats { - done: long - failed: long - finalizing: long - initializing: long - started: long - total: long -} - -export type SnapshotShardsStatsStage = 'DONE' | 'FAILURE' | 'FINALIZE' | 'INIT' | 'STARTED' - -export interface SnapshotShardsStatsSummary { - incremental: SnapshotShardsStatsSummaryItem - total: SnapshotShardsStatsSummaryItem - start_time_in_millis: EpochTime - time?: Duration - time_in_millis: DurationValue -} - -export interface SnapshotShardsStatsSummaryItem { - file_count: long - size_in_bytes: long -} - -export interface SnapshotSharedFileSystemRepository extends SnapshotRepositoryBase { - type: 'fs' - settings: SnapshotSharedFileSystemRepositorySettings -} - -export interface SnapshotSharedFileSystemRepositorySettings extends SnapshotRepositorySettingsBase { - location: string - max_number_of_snapshots?: integer - readonly?: boolean -} - -export interface SnapshotSnapshotIndexStats { - shards: Record - shards_stats: SnapshotShardsStats - stats: SnapshotSnapshotStats -} - -export interface SnapshotSnapshotInfo { - data_streams: string[] - duration?: Duration - duration_in_millis?: DurationValue - end_time?: DateTime - end_time_in_millis?: EpochTime - failures?: SnapshotSnapshotShardFailure[] - include_global_state?: boolean - indices?: IndexName[] - index_details?: Record - metadata?: Metadata - reason?: string - repository?: Name - snapshot: Name - shards?: ShardStatistics - start_time?: DateTime - start_time_in_millis?: EpochTime - state?: string - uuid: Uuid - version?: VersionString - version_id?: VersionNumber - feature_states?: SnapshotInfoFeatureState[] -} - -export interface SnapshotSnapshotShardFailure { - index: IndexName - node_id?: Id - reason: string - shard_id: Id - index_uuid: Id - status: string -} - -export interface SnapshotSnapshotShardsStatus { - stage: SnapshotShardsStatsStage - stats: SnapshotShardsStatsSummary -} - -export type SnapshotSnapshotSort = 'start_time' | 'duration' | 'name' | 'index_count' | 'repository' | 'shard_count' | 'failed_shard_count' - -export interface SnapshotSnapshotStats { - incremental: SnapshotFileCountSnapshotStats - start_time_in_millis: EpochTime - time?: Duration - time_in_millis: DurationValue - total: SnapshotFileCountSnapshotStats -} - -export interface SnapshotSourceOnlyRepository extends SnapshotRepositoryBase { - type: 'source' - settings: SnapshotSourceOnlyRepositorySettings -} - -export interface SnapshotSourceOnlyRepositorySettings extends SnapshotRepositorySettingsBase { - delegate_type?: string - max_number_of_snapshots?: integer - read_only?: boolean - readonly?: boolean -} - -export interface SnapshotStatus { - include_global_state: boolean - indices: Record - repository: string - shards_stats: SnapshotShardsStats - snapshot: string - state: string - stats: SnapshotSnapshotStats - uuid: Uuid -} - -export interface SnapshotCleanupRepositoryCleanupRepositoryResults { - deleted_blobs: long - deleted_bytes: long -} - -export interface SnapshotCleanupRepositoryRequest extends RequestBase { - name: Name - master_timeout?: Duration - timeout?: Duration -} - -export interface SnapshotCleanupRepositoryResponse { - results: SnapshotCleanupRepositoryCleanupRepositoryResults -} - -export interface SnapshotCloneRequest extends RequestBase { - repository: Name - snapshot: Name - target_snapshot: Name - master_timeout?: Duration - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - indices: string - } -} - -export type SnapshotCloneResponse = AcknowledgedResponseBase - -export interface SnapshotCreateRequest extends RequestBase { - repository: Name - snapshot: Name - master_timeout?: Duration - wait_for_completion?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - ignore_unavailable?: boolean - include_global_state?: boolean - indices?: Indices - feature_states?: string[] - metadata?: Metadata - partial?: boolean - } -} - -export interface SnapshotCreateResponse { - accepted?: boolean - snapshot?: SnapshotSnapshotInfo -} - -export interface SnapshotCreateRepositoryRequest extends RequestBase { - name: Name - master_timeout?: Duration - timeout?: Duration - verify?: boolean - /** @deprecated The use of the 'body' key has been deprecated, use 'repository' instead. */ - body?: SnapshotRepository -} - -export type SnapshotCreateRepositoryResponse = AcknowledgedResponseBase - -export interface SnapshotDeleteRequest extends RequestBase { - repository: Name - snapshot: Name - master_timeout?: Duration -} - -export type SnapshotDeleteResponse = AcknowledgedResponseBase - -export interface SnapshotDeleteRepositoryRequest extends RequestBase { - name: Names - master_timeout?: Duration - timeout?: Duration -} - -export type SnapshotDeleteRepositoryResponse = AcknowledgedResponseBase - -export interface SnapshotGetRequest extends RequestBase { - repository: Name - snapshot: Names - ignore_unavailable?: boolean - master_timeout?: Duration - verbose?: boolean - index_details?: boolean - index_names?: boolean - include_repository?: boolean - sort?: SnapshotSnapshotSort - size?: integer - order?: SortOrder - after?: string - offset?: integer - from_sort_value?: string - slm_policy_filter?: Name -} - -export interface SnapshotGetResponse { - responses?: SnapshotGetSnapshotResponseItem[] - snapshots?: SnapshotSnapshotInfo[] - total: integer - remaining: integer -} - -export interface SnapshotGetSnapshotResponseItem { - repository: Name - snapshots?: SnapshotSnapshotInfo[] - error?: ErrorCause -} - -export interface SnapshotGetRepositoryRequest extends RequestBase { - name?: Names - local?: boolean - master_timeout?: Duration -} - -export type SnapshotGetRepositoryResponse = Record - -export interface SnapshotRepositoryVerifyIntegrityRequest extends RequestBase { - name: Names - meta_thread_pool_concurrency?: integer - blob_thread_pool_concurrency?: integer - snapshot_verification_concurrency?: integer - index_verification_concurrency?: integer - index_snapshot_verification_concurrency?: integer - max_failed_shard_snapshots?: integer - verify_blob_contents?: boolean - max_bytes_per_sec?: string -} - -export type SnapshotRepositoryVerifyIntegrityResponse = any - -export interface SnapshotRestoreRequest extends RequestBase { - repository: Name - snapshot: Name - master_timeout?: Duration - wait_for_completion?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - feature_states?: string[] - ignore_index_settings?: string[] - ignore_unavailable?: boolean - include_aliases?: boolean - include_global_state?: boolean - index_settings?: IndicesIndexSettings - indices?: Indices - partial?: boolean - rename_pattern?: string - rename_replacement?: string - } -} - -export interface SnapshotRestoreResponse { - accepted?: boolean - snapshot?: SnapshotRestoreSnapshotRestore -} - -export interface SnapshotRestoreSnapshotRestore { - indices: IndexName[] - snapshot: string - shards: ShardStatistics -} - -export interface SnapshotStatusRequest extends RequestBase { - repository?: Name - snapshot?: Names - ignore_unavailable?: boolean - master_timeout?: Duration -} - -export interface SnapshotStatusResponse { - snapshots: SnapshotStatus[] -} - -export interface SnapshotVerifyRepositoryCompactNodeInfo { - name: Name -} - -export interface SnapshotVerifyRepositoryRequest extends RequestBase { - name: Name - master_timeout?: Duration - timeout?: Duration -} - -export interface SnapshotVerifyRepositoryResponse { - nodes: Record -} - -export interface SqlColumn { - name: Name - type: string -} - -export type SqlRow = any[] - -export interface SqlClearCursorRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - cursor: string - } -} - -export interface SqlClearCursorResponse { - succeeded: boolean -} - -export interface SqlDeleteAsyncRequest extends RequestBase { - id: Id -} - -export type SqlDeleteAsyncResponse = AcknowledgedResponseBase - -export interface SqlGetAsyncRequest extends RequestBase { - id: Id - delimiter?: string - format?: string - keep_alive?: Duration - wait_for_completion_timeout?: Duration -} - -export interface SqlGetAsyncResponse { - id: Id - is_running: boolean - is_partial: boolean - columns?: SqlColumn[] - cursor?: string - rows: SqlRow[] -} - -export interface SqlGetAsyncStatusRequest extends RequestBase { - id: Id -} - -export interface SqlGetAsyncStatusResponse { - id: string - is_running: boolean - is_partial: boolean - start_time_in_millis: EpochTime - expiration_time_in_millis: EpochTime - completion_status?: uint -} - -export interface SqlQueryRequest extends RequestBase { - format?: SqlQuerySqlFormat - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - catalog?: string - columnar?: boolean - cursor?: string - fetch_size?: integer - filter?: QueryDslQueryContainer - query?: string - request_timeout?: Duration - page_timeout?: Duration - time_zone?: TimeZone - field_multi_value_leniency?: boolean - runtime_mappings?: MappingRuntimeFields - wait_for_completion_timeout?: Duration - params?: Record - keep_alive?: Duration - keep_on_completion?: boolean - index_using_frozen?: boolean - } -} - -export interface SqlQueryResponse { - id?: Id - is_running?: boolean - is_partial?: boolean - columns?: SqlColumn[] - cursor?: string - rows: SqlRow[] -} - -export type SqlQuerySqlFormat = 'csv' | 'json' | 'tsv' | 'txt' | 'yaml' | 'cbor' | 'smile' - -export interface SqlTranslateRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - fetch_size?: integer - filter?: QueryDslQueryContainer - query: string - time_zone?: TimeZone - } -} - -export interface SqlTranslateResponse { - aggregations?: Record - size?: long - _source?: SearchSourceConfig - fields?: (QueryDslFieldAndFormat | Field)[] - query?: QueryDslQueryContainer - sort?: Sort -} - -export interface SslCertificatesCertificateInformation { - alias: string | null - expiry: DateTime - format: string - has_private_key: boolean - issuer?: string - path: string - serial_number: string - subject_dn: string -} - -export interface SslCertificatesRequest extends RequestBase { -} - -export type SslCertificatesResponse = SslCertificatesCertificateInformation[] - -export interface SynonymsSynonymRule { - id?: Id - synonyms: SynonymsSynonymString -} - -export interface SynonymsSynonymRuleRead { - id: Id - synonyms: SynonymsSynonymString -} - -export type SynonymsSynonymString = string - -export interface SynonymsSynonymsUpdateResult { - result: Result - reload_analyzers_details: IndicesReloadSearchAnalyzersReloadResult -} - -export interface SynonymsDeleteSynonymRequest extends RequestBase { - id: Id -} - -export type SynonymsDeleteSynonymResponse = AcknowledgedResponseBase - -export interface SynonymsDeleteSynonymRuleRequest extends RequestBase { - set_id: Id - rule_id: Id -} - -export type SynonymsDeleteSynonymRuleResponse = SynonymsSynonymsUpdateResult - -export interface SynonymsGetSynonymRequest extends RequestBase { - id: Id - from?: integer - size?: integer -} - -export interface SynonymsGetSynonymResponse { - count: integer - synonyms_set: SynonymsSynonymRuleRead[] -} - -export interface SynonymsGetSynonymRuleRequest extends RequestBase { - set_id: Id - rule_id: Id -} - -export type SynonymsGetSynonymRuleResponse = SynonymsSynonymRuleRead - -export interface SynonymsGetSynonymsSetsRequest extends RequestBase { - from?: integer - size?: integer -} - -export interface SynonymsGetSynonymsSetsResponse { - count: integer - results: SynonymsGetSynonymsSetsSynonymsSetItem[] -} - -export interface SynonymsGetSynonymsSetsSynonymsSetItem { - synonyms_set: Id - count: integer -} - -export interface SynonymsPutSynonymRequest extends RequestBase { - id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - synonyms_set: SynonymsSynonymRule | SynonymsSynonymRule[] - } -} - -export interface SynonymsPutSynonymResponse { - result: Result - reload_analyzers_details: IndicesReloadSearchAnalyzersReloadResult -} - -export interface SynonymsPutSynonymRuleRequest extends RequestBase { - set_id: Id - rule_id: Id - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - synonyms: SynonymsSynonymString - } -} - -export type SynonymsPutSynonymRuleResponse = SynonymsSynonymsUpdateResult - -export type TasksGroupBy = 'nodes' | 'parents' | 'none' - -export interface TasksNodeTasks { - name?: NodeId - transport_address?: TransportAddress - host?: Host - ip?: Ip - roles?: string[] - attributes?: Record - tasks: Record -} - -export interface TasksParentTaskInfo extends TasksTaskInfo { - children?: TasksTaskInfo[] -} - -export interface TasksTaskInfo { - action: string - cancelled?: boolean - cancellable: boolean - description?: string - headers: Record - id: long - node: NodeId - running_time?: Duration - running_time_in_nanos: DurationValue - start_time_in_millis: EpochTime - status?: any - type: string - parent_task_id?: TaskId -} - -export type TasksTaskInfos = TasksTaskInfo[] | Record - -export interface TasksTaskListResponseBase { - node_failures?: ErrorCause[] - task_failures?: TaskFailure[] - nodes?: Record - tasks?: TasksTaskInfos -} - -export interface TasksCancelRequest extends RequestBase { - task_id?: TaskId - actions?: string | string[] - nodes?: string[] - parent_task_id?: string - wait_for_completion?: boolean -} - -export type TasksCancelResponse = TasksTaskListResponseBase - -export interface TasksGetRequest extends RequestBase { - task_id: Id - timeout?: Duration - wait_for_completion?: boolean -} - -export interface TasksGetResponse { - completed: boolean - task: TasksTaskInfo - response?: any - error?: ErrorCause -} - -export interface TasksListRequest extends RequestBase { - actions?: string | string[] - detailed?: boolean - group_by?: TasksGroupBy - nodes?: NodeIds - parent_task_id?: Id - master_timeout?: Duration - timeout?: Duration - wait_for_completion?: boolean -} - -export type TasksListResponse = TasksTaskListResponseBase - -export interface TextStructureFindStructureFieldStat { - count: integer - cardinality: integer - top_hits: TextStructureFindStructureTopHit[] - mean_value?: integer - median_value?: integer - max_value?: integer - min_value?: integer - earliest?: string - latest?: string -} - -export interface TextStructureFindStructureRequest { - charset?: string - column_names?: string - delimiter?: string - ecs_compatibility?: string - explain?: boolean - format?: string - grok_pattern?: GrokPattern - has_header_row?: boolean - line_merge_size_limit?: uint - lines_to_sample?: uint - quote?: string - should_trim_fields?: boolean - timeout?: Duration - timestamp_field?: Field - timestamp_format?: string - /** @deprecated The use of the 'body' key has been deprecated, use 'text_files' instead. */ - body?: TJsonDocument[] -} - -export interface TextStructureFindStructureResponse { - charset: string - has_header_row?: boolean - has_byte_order_marker: boolean - format: string - field_stats: Record - sample_start: string - num_messages_analyzed: integer - mappings: MappingTypeMapping - quote?: string - delimiter?: string - need_client_timezone: boolean - num_lines_analyzed: integer - column_names?: string[] - explanation?: string[] - grok_pattern?: GrokPattern - multiline_start_pattern?: string - exclude_lines_pattern?: string - java_timestamp_formats?: string[] - joda_timestamp_formats?: string[] - timestamp_field?: Field - should_trim_fields?: boolean - ingest_pipeline: IngestPipelineConfig -} - -export interface TextStructureFindStructureTopHit { - count: long - value: any -} - -export interface TextStructureTestGrokPatternMatchedField { - match: string - offset: integer - length: integer -} - -export interface TextStructureTestGrokPatternMatchedText { - matched: boolean - fields?: Record -} - -export interface TextStructureTestGrokPatternRequest extends RequestBase { - ecs_compatibility?: string - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - grok_pattern: GrokPattern - text: string[] - } -} - -export interface TextStructureTestGrokPatternResponse { - matches: TextStructureTestGrokPatternMatchedText[] -} - -export interface TransformDestination { - index?: IndexName - pipeline?: string -} - -export interface TransformLatest { - sort: Field - unique_key: Field[] -} - -export interface TransformPivot { - aggregations?: Record - aggs?: Record - group_by?: Record -} - -export interface TransformPivotGroupByContainer { - date_histogram?: AggregationsDateHistogramAggregation - geotile_grid?: AggregationsGeoTileGridAggregation - histogram?: AggregationsHistogramAggregation - terms?: AggregationsTermsAggregation -} - -export interface TransformRetentionPolicy { - field: Field - max_age: Duration -} - -export interface TransformRetentionPolicyContainer { - time?: TransformRetentionPolicy -} - -export interface TransformSettings { - align_checkpoints?: boolean - dates_as_epoch_millis?: boolean - deduce_mappings?: boolean - docs_per_second?: float - max_page_search_size?: integer - unattended?: boolean -} - -export interface TransformSource { - index: Indices - query?: QueryDslQueryContainer - runtime_mappings?: MappingRuntimeFields -} - -export interface TransformSyncContainer { - time?: TransformTimeSync -} - -export interface TransformTimeSync { - delay?: Duration - field: Field -} - -export interface TransformDeleteTransformRequest extends RequestBase { - transform_id: Id - force?: boolean - delete_dest_index?: boolean - timeout?: Duration -} - -export type TransformDeleteTransformResponse = AcknowledgedResponseBase - -export interface TransformGetTransformRequest extends RequestBase { - transform_id?: Names - allow_no_match?: boolean - from?: integer - size?: integer - exclude_generated?: boolean -} - -export interface TransformGetTransformResponse { - count: long - transforms: TransformGetTransformTransformSummary[] -} - -export interface TransformGetTransformTransformSummary { - authorization?: MlTransformAuthorization - create_time?: EpochTime - description?: string - dest: ReindexDestination - frequency?: Duration - id: Id - latest?: TransformLatest - pivot?: TransformPivot - retention_policy?: TransformRetentionPolicyContainer - settings?: TransformSettings - source: TransformSource - sync?: TransformSyncContainer - version?: VersionString - _meta?: Metadata -} - -export interface TransformGetTransformStatsCheckpointStats { - checkpoint: long - checkpoint_progress?: TransformGetTransformStatsTransformProgress - timestamp?: DateTime - timestamp_millis?: EpochTime - time_upper_bound?: DateTime - time_upper_bound_millis?: EpochTime -} - -export interface TransformGetTransformStatsCheckpointing { - changes_last_detected_at?: long - changes_last_detected_at_date_time?: DateTime - last: TransformGetTransformStatsCheckpointStats - next?: TransformGetTransformStatsCheckpointStats - operations_behind?: long - last_search_time?: long -} - -export interface TransformGetTransformStatsRequest extends RequestBase { - transform_id: Names - allow_no_match?: boolean - from?: long - size?: long - timeout?: Duration -} - -export interface TransformGetTransformStatsResponse { - count: long - transforms: TransformGetTransformStatsTransformStats[] -} - -export interface TransformGetTransformStatsTransformIndexerStats { - delete_time_in_ms?: EpochTime - documents_indexed: long - documents_deleted?: long - documents_processed: long - exponential_avg_checkpoint_duration_ms: DurationValue - exponential_avg_documents_indexed: double - exponential_avg_documents_processed: double - index_failures: long - index_time_in_ms: DurationValue - index_total: long - pages_processed: long - processing_time_in_ms: DurationValue - processing_total: long - search_failures: long - search_time_in_ms: DurationValue - search_total: long - trigger_count: long -} - -export interface TransformGetTransformStatsTransformProgress { - docs_indexed: long - docs_processed: long - docs_remaining?: long - percent_complete?: double - total_docs?: long -} - -export interface TransformGetTransformStatsTransformStats { - checkpointing: TransformGetTransformStatsCheckpointing - health?: TransformGetTransformStatsTransformStatsHealth - id: Id - node?: NodeAttributes - reason?: string - state: string - stats: TransformGetTransformStatsTransformIndexerStats -} - -export interface TransformGetTransformStatsTransformStatsHealth { - status: HealthStatus -} - -export interface TransformPreviewTransformRequest extends RequestBase { - transform_id?: Id - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - dest?: TransformDestination - description?: string - frequency?: Duration - pivot?: TransformPivot - source?: TransformSource - settings?: TransformSettings - sync?: TransformSyncContainer - retention_policy?: TransformRetentionPolicyContainer - latest?: TransformLatest - } -} - -export interface TransformPreviewTransformResponse { - generated_dest_index: IndicesIndexState - preview: TTransform[] -} - -export interface TransformPutTransformRequest extends RequestBase { - transform_id: Id - defer_validation?: boolean - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - dest: TransformDestination - description?: string - frequency?: Duration - latest?: TransformLatest - _meta?: Metadata - pivot?: TransformPivot - retention_policy?: TransformRetentionPolicyContainer - settings?: TransformSettings - source: TransformSource - sync?: TransformSyncContainer - } -} - -export type TransformPutTransformResponse = AcknowledgedResponseBase - -export interface TransformResetTransformRequest extends RequestBase { - transform_id: Id - force?: boolean -} - -export type TransformResetTransformResponse = AcknowledgedResponseBase - -export interface TransformScheduleNowTransformRequest extends RequestBase { - transform_id: Id - timeout?: Duration -} - -export type TransformScheduleNowTransformResponse = AcknowledgedResponseBase - -export interface TransformStartTransformRequest extends RequestBase { - transform_id: Id - timeout?: Duration - from?: string -} - -export type TransformStartTransformResponse = AcknowledgedResponseBase - -export interface TransformStopTransformRequest extends RequestBase { - transform_id: Name - allow_no_match?: boolean - force?: boolean - timeout?: Duration - wait_for_checkpoint?: boolean - wait_for_completion?: boolean -} - -export type TransformStopTransformResponse = AcknowledgedResponseBase - -export interface TransformUpdateTransformRequest extends RequestBase { - transform_id: Id - defer_validation?: boolean - timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - dest?: TransformDestination - description?: string - frequency?: Duration - _meta?: Metadata - source?: TransformSource - settings?: TransformSettings - sync?: TransformSyncContainer - retention_policy?: TransformRetentionPolicyContainer | null - } -} - -export interface TransformUpdateTransformResponse { - authorization?: MlTransformAuthorization - create_time: long - description: string - dest: ReindexDestination - frequency?: Duration - id: Id - latest?: TransformLatest - pivot?: TransformPivot - retention_policy?: TransformRetentionPolicyContainer - settings: TransformSettings - source: ReindexSource - sync?: TransformSyncContainer - version: VersionString - _meta?: Metadata -} - -export interface TransformUpgradeTransformsRequest extends RequestBase { - dry_run?: boolean - timeout?: Duration -} - -export interface TransformUpgradeTransformsResponse { - needs_update: integer - no_action: integer - updated: integer -} - -export interface WatcherAcknowledgeState { - state: WatcherAcknowledgementOptions - timestamp: DateTime -} - -export type WatcherAcknowledgementOptions = 'awaits_successful_execution' | 'ackable' | 'acked' - -export interface WatcherAction { - action_type?: WatcherActionType - condition?: WatcherConditionContainer - foreach?: string - max_iterations?: integer - name?: Name - throttle_period?: Duration - throttle_period_in_millis?: DurationValue - transform?: TransformContainer - index?: WatcherIndexAction - logging?: WatcherLoggingAction - email?: WatcherEmailAction - pagerduty?: WatcherPagerDutyAction - slack?: WatcherSlackAction - webhook?: WatcherWebhookAction -} - -export type WatcherActionExecutionMode = 'simulate' | 'force_simulate' | 'execute' | 'force_execute' | 'skip' - -export interface WatcherActionStatus { - ack: WatcherAcknowledgeState - last_execution?: WatcherExecutionState - last_successful_execution?: WatcherExecutionState - last_throttle?: WatcherThrottleState -} - -export type WatcherActionStatusOptions = 'success' | 'failure' | 'simulated' | 'throttled' - -export type WatcherActionType = 'email' | 'webhook' | 'index' | 'logging' | 'slack' | 'pagerduty' - -export type WatcherActions = Record - -export interface WatcherActivationState { - active: boolean - timestamp: DateTime -} - -export interface WatcherActivationStatus { - actions: WatcherActions - state: WatcherActivationState - version: VersionNumber -} - -export interface WatcherAlwaysCondition { -} - -export interface WatcherArrayCompareConditionKeys { - path: string -} -export type WatcherArrayCompareCondition = WatcherArrayCompareConditionKeys -& { [property: string]: WatcherArrayCompareOpParams | string } - -export interface WatcherArrayCompareOpParams { - quantifier: WatcherQuantifier - value: FieldValue -} - -export interface WatcherChainInput { - inputs: Partial>[] -} - -export interface WatcherConditionContainer { - always?: WatcherAlwaysCondition - array_compare?: Partial> - compare?: Partial>>> - never?: WatcherNeverCondition - script?: WatcherScriptCondition -} - -export type WatcherConditionOp = 'not_eq' | 'eq' | 'lt' | 'gt' | 'lte' | 'gte' - -export type WatcherConditionType = 'always' | 'never' | 'script' | 'compare' | 'array_compare' - -export type WatcherConnectionScheme = 'http' | 'https' - -export type WatcherCronExpression = string - -export interface WatcherDailySchedule { - at: WatcherScheduleTimeOfDay[] -} - -export type WatcherDataAttachmentFormat = 'json' | 'yaml' - -export interface WatcherDataEmailAttachment { - format?: WatcherDataAttachmentFormat -} - -export type WatcherDay = 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' - -export interface WatcherEmail { - id?: Id - bcc?: string[] - body?: WatcherEmailBody - cc?: string[] - from?: string - priority?: WatcherEmailPriority - reply_to?: string[] - sent_date?: DateTime - subject: string - to: string[] - attachments?: Record -} - -export interface WatcherEmailAction extends WatcherEmail { -} - -export interface WatcherEmailAttachmentContainer { - http?: WatcherHttpEmailAttachment - reporting?: WatcherReportingEmailAttachment - data?: WatcherDataEmailAttachment -} - -export interface WatcherEmailBody { - html?: string - text?: string -} - -export type WatcherEmailPriority = 'lowest' | 'low' | 'normal' | 'high' | 'highest' - -export interface WatcherEmailResult { - account?: string - message: WatcherEmail - reason?: string -} - -export type WatcherExecutionPhase = 'awaits_execution' | 'started' | 'input' | 'condition' | 'actions' | 'watch_transform' | 'aborted' | 'finished' - -export interface WatcherExecutionResult { - actions: WatcherExecutionResultAction[] - condition: WatcherExecutionResultCondition - execution_duration: DurationValue - execution_time: DateTime - input: WatcherExecutionResultInput -} - -export interface WatcherExecutionResultAction { - email?: WatcherEmailResult - id: Id - index?: WatcherIndexResult - logging?: WatcherLoggingResult - pagerduty?: WatcherPagerDutyResult - reason?: string - slack?: WatcherSlackResult - status: WatcherActionStatusOptions - type: WatcherActionType - webhook?: WatcherWebhookResult - error?: ErrorCause -} - -export interface WatcherExecutionResultCondition { - met: boolean - status: WatcherActionStatusOptions - type: WatcherConditionType -} - -export interface WatcherExecutionResultInput { - payload: Record - status: WatcherActionStatusOptions - type: WatcherInputType -} - -export interface WatcherExecutionState { - successful: boolean - timestamp: DateTime - reason?: string -} - -export type WatcherExecutionStatus = 'awaits_execution' | 'checking' | 'execution_not_needed' | 'throttled' | 'executed' | 'failed' | 'deleted_while_queued' | 'not_executed_already_queued' - -export interface WatcherExecutionThreadPool { - max_size: long - queue_size: long -} - -export interface WatcherHourAndMinute { - hour: integer[] - minute: integer[] -} - -export interface WatcherHourlySchedule { - minute: integer[] -} - -export interface WatcherHttpEmailAttachment { - content_type?: string - inline?: boolean - request?: WatcherHttpInputRequestDefinition -} - -export interface WatcherHttpInput { - extract?: string[] - request?: WatcherHttpInputRequestDefinition - response_content_type?: WatcherResponseContentType -} - -export interface WatcherHttpInputAuthentication { - basic: WatcherHttpInputBasicAuthentication -} - -export interface WatcherHttpInputBasicAuthentication { - password: Password - username: Username -} - -export type WatcherHttpInputMethod = 'head' | 'get' | 'post' | 'put' | 'delete' - -export interface WatcherHttpInputProxy { - host: Host - port: uint -} - -export interface WatcherHttpInputRequestDefinition { - auth?: WatcherHttpInputAuthentication - body?: string - connection_timeout?: Duration - headers?: Record - host?: Host - method?: WatcherHttpInputMethod - params?: Record - path?: string - port?: uint - proxy?: WatcherHttpInputProxy - read_timeout?: Duration - scheme?: WatcherConnectionScheme - url?: string -} - -export interface WatcherHttpInputRequestResult extends WatcherHttpInputRequestDefinition { -} - -export interface WatcherHttpInputResponseResult { - body: string - headers: HttpHeaders - status: integer -} - -export interface WatcherIndexAction { - index: IndexName - doc_id?: Id - refresh?: Refresh - op_type?: OpType - timeout?: Duration - execution_time_field?: Field -} - -export interface WatcherIndexResult { - response: WatcherIndexResultSummary -} - -export interface WatcherIndexResultSummary { - created: boolean - id: Id - index: IndexName - result: Result - version: VersionNumber -} - -export interface WatcherInputContainer { - chain?: WatcherChainInput - http?: WatcherHttpInput - search?: WatcherSearchInput - simple?: Record -} - -export type WatcherInputType = 'http' | 'search' | 'simple' - -export interface WatcherLoggingAction { - level?: string - text: string - category?: string -} - -export interface WatcherLoggingResult { - logged_text: string -} - -export type WatcherMonth = 'january' | 'february' | 'march' | 'april' | 'may' | 'june' | 'july' | 'august' | 'september' | 'october' | 'november' | 'december' - -export interface WatcherNeverCondition { -} - -export interface WatcherPagerDutyAction extends WatcherPagerDutyEvent { -} - -export interface WatcherPagerDutyContext { - href?: string - src?: string - type: WatcherPagerDutyContextType -} - -export type WatcherPagerDutyContextType = 'link' | 'image' - -export interface WatcherPagerDutyEvent { - account?: string - attach_payload: boolean - client?: string - client_url?: string - contexts?: WatcherPagerDutyContext[] - context?: WatcherPagerDutyContext[] - description: string - event_type?: WatcherPagerDutyEventType - incident_key: string - proxy?: WatcherPagerDutyEventProxy -} - -export interface WatcherPagerDutyEventProxy { - host?: Host - port?: integer -} - -export type WatcherPagerDutyEventType = 'trigger' | 'resolve' | 'acknowledge' - -export interface WatcherPagerDutyResult { - event: WatcherPagerDutyEvent - reason?: string - request?: WatcherHttpInputRequestResult - response?: WatcherHttpInputResponseResult -} - -export type WatcherQuantifier = 'some' | 'all' - -export interface WatcherQueryWatch { - _id: Id - status?: WatcherWatchStatus - watch?: WatcherWatch - _primary_term?: integer - _seq_no?: SequenceNumber -} - -export interface WatcherReportingEmailAttachment { - url: string - inline?: boolean - retries?: integer - interval?: Duration - request?: WatcherHttpInputRequestDefinition -} - -export type WatcherResponseContentType = 'json' | 'yaml' | 'text' - -export interface WatcherScheduleContainer { - cron?: WatcherCronExpression - daily?: WatcherDailySchedule - hourly?: WatcherHourlySchedule - interval?: Duration - monthly?: WatcherTimeOfMonth | WatcherTimeOfMonth[] - weekly?: WatcherTimeOfWeek | WatcherTimeOfWeek[] - yearly?: WatcherTimeOfYear | WatcherTimeOfYear[] -} - -export type WatcherScheduleTimeOfDay = string | WatcherHourAndMinute - -export interface WatcherScheduleTriggerEvent { - scheduled_time: DateTime - triggered_time?: DateTime -} - -export interface WatcherScriptCondition { - lang?: string - params?: Record - source?: string - id?: string -} - -export interface WatcherSearchInput { - extract?: string[] - request: WatcherSearchInputRequestDefinition - timeout?: Duration -} - -export interface WatcherSearchInputRequestBody { - query: QueryDslQueryContainer -} - -export interface WatcherSearchInputRequestDefinition { - body?: WatcherSearchInputRequestBody - indices?: IndexName[] - indices_options?: IndicesOptions - search_type?: SearchType - template?: WatcherSearchTemplateRequestBody - rest_total_hits_as_int?: boolean -} - -export interface WatcherSearchTemplateRequestBody { - explain?: boolean - id?: Id - params?: Record - profile?: boolean - source?: string -} - -export interface WatcherSimulatedActions { - actions: string[] - all: WatcherSimulatedActions - use_all: boolean -} - -export interface WatcherSlackAction { - account?: string - message: WatcherSlackMessage -} - -export interface WatcherSlackAttachment { - author_icon?: string - author_link?: string - author_name: string - color?: string - fallback?: string - fields?: WatcherSlackAttachmentField[] - footer?: string - footer_icon?: string - image_url?: string - pretext?: string - text?: string - thumb_url?: string - title: string - title_link?: string - ts?: EpochTime -} - -export interface WatcherSlackAttachmentField { - short: boolean - title: string - value: string -} - -export interface WatcherSlackDynamicAttachment { - attachment_template: WatcherSlackAttachment - list_path: string -} - -export interface WatcherSlackMessage { - attachments: WatcherSlackAttachment[] - dynamic_attachments?: WatcherSlackDynamicAttachment - from: string - icon?: string - text: string - to: string[] -} - -export interface WatcherSlackResult { - account?: string - message: WatcherSlackMessage -} - -export interface WatcherThrottleState { - reason: string - timestamp: DateTime -} - -export interface WatcherTimeOfMonth { - at: string[] - on: integer[] -} - -export interface WatcherTimeOfWeek { - at: string[] - on: WatcherDay[] -} - -export interface WatcherTimeOfYear { - at: string[] - int: WatcherMonth[] - on: integer[] -} - -export interface WatcherTriggerContainer { - schedule?: WatcherScheduleContainer -} - -export interface WatcherTriggerEventContainer { - schedule?: WatcherScheduleTriggerEvent -} - -export interface WatcherTriggerEventResult { - manual: WatcherTriggerEventContainer - triggered_time: DateTime - type: string -} - -export interface WatcherWatch { - actions: Record - condition: WatcherConditionContainer - input: WatcherInputContainer - metadata?: Metadata - status?: WatcherWatchStatus - throttle_period?: Duration - throttle_period_in_millis?: DurationValue - transform?: TransformContainer - trigger: WatcherTriggerContainer -} - -export interface WatcherWatchStatus { - actions: WatcherActions - last_checked?: DateTime - last_met_condition?: DateTime - state: WatcherActivationState - version: VersionNumber - execution_state?: string -} - -export interface WatcherWebhookAction extends WatcherHttpInputRequestDefinition { -} - -export interface WatcherWebhookResult { - request: WatcherHttpInputRequestResult - response?: WatcherHttpInputResponseResult -} - -export interface WatcherAckWatchRequest extends RequestBase { - watch_id: Name - action_id?: Names -} - -export interface WatcherAckWatchResponse { - status: WatcherWatchStatus -} - -export interface WatcherActivateWatchRequest extends RequestBase { - watch_id: Name -} - -export interface WatcherActivateWatchResponse { - status: WatcherActivationStatus -} - -export interface WatcherDeactivateWatchRequest extends RequestBase { - watch_id: Name -} - -export interface WatcherDeactivateWatchResponse { - status: WatcherActivationStatus -} - -export interface WatcherDeleteWatchRequest extends RequestBase { - id: Name -} - -export interface WatcherDeleteWatchResponse { - found: boolean - _id: Id - _version: VersionNumber -} - -export interface WatcherExecuteWatchRequest extends RequestBase { - id?: Id - debug?: boolean - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - action_modes?: Record - alternative_input?: Record - ignore_condition?: boolean - record_execution?: boolean - simulated_actions?: WatcherSimulatedActions - trigger_data?: WatcherScheduleTriggerEvent - watch?: WatcherWatch - } -} - -export interface WatcherExecuteWatchResponse { - _id: Id - watch_record: WatcherExecuteWatchWatchRecord -} - -export interface WatcherExecuteWatchWatchRecord { - condition: WatcherConditionContainer - input: WatcherInputContainer - messages: string[] - metadata?: Metadata - node: string - result: WatcherExecutionResult - state: WatcherExecutionStatus - trigger_event: WatcherTriggerEventResult - user: Username - watch_id: Id - status?: WatcherWatchStatus -} - -export interface WatcherGetWatchRequest extends RequestBase { - id: Name -} - -export interface WatcherGetWatchResponse { - found: boolean - _id: Id - status?: WatcherWatchStatus - watch?: WatcherWatch - _primary_term?: integer - _seq_no?: SequenceNumber - _version?: VersionNumber -} - -export interface WatcherPutWatchRequest extends RequestBase { - id: Id - active?: boolean - if_primary_term?: long - if_seq_no?: SequenceNumber - version?: VersionNumber - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - actions?: Record - condition?: WatcherConditionContainer - input?: WatcherInputContainer - metadata?: Metadata - throttle_period?: string - transform?: TransformContainer - trigger?: WatcherTriggerContainer - } -} - -export interface WatcherPutWatchResponse { - created: boolean - _id: Id - _primary_term: long - _seq_no: SequenceNumber - _version: VersionNumber -} - -export interface WatcherQueryWatchesRequest extends RequestBase { - /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ - body?: { - from?: integer - size?: integer - query?: QueryDslQueryContainer - sort?: Sort - search_after?: SortResults - } -} - -export interface WatcherQueryWatchesResponse { - count: integer - watches: WatcherQueryWatch[] -} - -export interface WatcherStartRequest extends RequestBase { -} - -export type WatcherStartResponse = AcknowledgedResponseBase - -export interface WatcherStatsRequest extends RequestBase { - metric?: WatcherStatsWatcherMetric | WatcherStatsWatcherMetric[] - emit_stacktraces?: boolean -} - -export interface WatcherStatsResponse { - _nodes: NodeStatistics - cluster_name: Name - manually_stopped: boolean - stats: WatcherStatsWatcherNodeStats[] -} - -export interface WatcherStatsWatchRecordQueuedStats { - execution_time: DateTime -} - -export interface WatcherStatsWatchRecordStats extends WatcherStatsWatchRecordQueuedStats { - execution_phase: WatcherExecutionPhase - triggered_time: DateTime - executed_actions?: string[] - watch_id: Id - watch_record_id: Id -} - -export type WatcherStatsWatcherMetric = '_all' | 'all' | 'queued_watches' | 'current_watches' | 'pending_watches' - -export interface WatcherStatsWatcherNodeStats { - current_watches?: WatcherStatsWatchRecordStats[] - execution_thread_pool: WatcherExecutionThreadPool - queued_watches?: WatcherStatsWatchRecordQueuedStats[] - watch_count: long - watcher_state: WatcherStatsWatcherState - node_id: Id -} - -export type WatcherStatsWatcherState = 'stopped' | 'starting' | 'started' | 'stopping' - -export interface WatcherStopRequest extends RequestBase { -} - -export type WatcherStopResponse = AcknowledgedResponseBase - -export interface XpackInfoBuildInformation { - date: DateTime - hash: string -} - -export interface XpackInfoFeature { - available: boolean - description?: string - enabled: boolean - native_code_info?: XpackInfoNativeCodeInformation -} - -export interface XpackInfoFeatures { - aggregate_metric: XpackInfoFeature - analytics: XpackInfoFeature - ccr: XpackInfoFeature - data_streams: XpackInfoFeature - data_tiers: XpackInfoFeature - enrich: XpackInfoFeature - enterprise_search: XpackInfoFeature - eql: XpackInfoFeature - esql: XpackInfoFeature - frozen_indices: XpackInfoFeature - graph: XpackInfoFeature - ilm: XpackInfoFeature - logstash: XpackInfoFeature - logsdb: XpackInfoFeature - ml: XpackInfoFeature - monitoring: XpackInfoFeature - rollup: XpackInfoFeature - runtime_fields?: XpackInfoFeature - searchable_snapshots: XpackInfoFeature - security: XpackInfoFeature - slm: XpackInfoFeature - spatial: XpackInfoFeature - sql: XpackInfoFeature - transform: XpackInfoFeature - universal_profiling: XpackInfoFeature - voting_only: XpackInfoFeature - watcher: XpackInfoFeature - archive: XpackInfoFeature -} - -export interface XpackInfoMinimalLicenseInformation { - expiry_date_in_millis: EpochTime - mode: LicenseLicenseType - status: LicenseLicenseStatus - type: LicenseLicenseType - uid: string -} - -export interface XpackInfoNativeCodeInformation { - build_hash: string - version: VersionString -} - -export interface XpackInfoRequest extends RequestBase { - categories?: XpackInfoXPackCategory[] - accept_enterprise?: boolean - human?: boolean -} - -export interface XpackInfoResponse { - build: XpackInfoBuildInformation - features: XpackInfoFeatures - license: XpackInfoMinimalLicenseInformation - tagline: string -} - -export type XpackInfoXPackCategory = 'build' | 'features' | 'license' - -export interface XpackUsageAnalytics extends XpackUsageBase { - stats: XpackUsageAnalyticsStatistics -} - -export interface XpackUsageAnalyticsStatistics { - boxplot_usage: long - cumulative_cardinality_usage: long - string_stats_usage: long - top_metrics_usage: long - t_test_usage: long - moving_percentiles_usage: long - normalize_usage: long - rate_usage: long - multi_terms_usage?: long -} - -export interface XpackUsageArchive extends XpackUsageBase { - indices_count: long -} - -export interface XpackUsageAudit extends XpackUsageFeatureToggle { - outputs?: string[] -} - -export interface XpackUsageBase { - available: boolean - enabled: boolean -} - -export interface XpackUsageCcr extends XpackUsageBase { - auto_follow_patterns_count: integer - follower_indices_count: integer -} - -export interface XpackUsageCounter { - active: long - total: long -} - -export interface XpackUsageDataStreams extends XpackUsageBase { - data_streams: long - indices_count: long -} - -export interface XpackUsageDataTierPhaseStatistics { - node_count: long - index_count: long - total_shard_count: long - primary_shard_count: long - doc_count: long - total_size_bytes: long - primary_size_bytes: long - primary_shard_size_avg_bytes: long - primary_shard_size_median_bytes: long - primary_shard_size_mad_bytes: long -} - -export interface XpackUsageDataTiers extends XpackUsageBase { - data_warm: XpackUsageDataTierPhaseStatistics - data_frozen?: XpackUsageDataTierPhaseStatistics - data_cold: XpackUsageDataTierPhaseStatistics - data_content: XpackUsageDataTierPhaseStatistics - data_hot: XpackUsageDataTierPhaseStatistics -} - -export interface XpackUsageDatafeed { - count: long -} - -export interface XpackUsageEql extends XpackUsageBase { - features: XpackUsageEqlFeatures - queries: Record -} - -export interface XpackUsageEqlFeatures { - join: uint - joins: XpackUsageEqlFeaturesJoin - keys: XpackUsageEqlFeaturesKeys - event: uint - pipes: XpackUsageEqlFeaturesPipes - sequence: uint - sequences: XpackUsageEqlFeaturesSequences -} - -export interface XpackUsageEqlFeaturesJoin { - join_queries_two: uint - join_queries_three: uint - join_until: uint - join_queries_five_or_more: uint - join_queries_four: uint -} - -export interface XpackUsageEqlFeaturesKeys { - join_keys_two: uint - join_keys_one: uint - join_keys_three: uint - join_keys_five_or_more: uint - join_keys_four: uint -} - -export interface XpackUsageEqlFeaturesPipes { - pipe_tail: uint - pipe_head: uint -} - -export interface XpackUsageEqlFeaturesSequences { - sequence_queries_three: uint - sequence_queries_four: uint - sequence_queries_two: uint - sequence_until: uint - sequence_queries_five_or_more: uint - sequence_maxspan: uint -} - -export interface XpackUsageFeatureToggle { - enabled: boolean -} - -export interface XpackUsageFlattened extends XpackUsageBase { - field_count: integer -} - -export interface XpackUsageFrozenIndices extends XpackUsageBase { - indices_count: long -} - -export interface XpackUsageHealthStatistics extends XpackUsageBase { - invocations: XpackUsageInvocations -} - -export interface XpackUsageIlm { - policy_count: integer - policy_stats: XpackUsageIlmPolicyStatistics[] -} - -export interface XpackUsageIlmPolicyStatistics { - indices_managed: integer - phases: IlmPhases -} - -export interface XpackUsageInvocations { - total: long -} - -export interface XpackUsageIpFilter { - http: boolean - transport: boolean -} - -export interface XpackUsageJobUsage { - count: integer - created_by: Record - detectors: MlJobStatistics - forecasts: XpackUsageMlJobForecasts - model_size: MlJobStatistics -} - -export interface XpackUsageMachineLearning extends XpackUsageBase { - datafeeds: Record - jobs: Record - node_count: integer - data_frame_analytics_jobs: XpackUsageMlDataFrameAnalyticsJobs - inference: XpackUsageMlInference -} - -export interface XpackUsageMlCounter { - count: long -} - -export interface XpackUsageMlDataFrameAnalyticsJobs { - memory_usage?: XpackUsageMlDataFrameAnalyticsJobsMemory - _all: XpackUsageMlDataFrameAnalyticsJobsCount - analysis_counts?: XpackUsageMlDataFrameAnalyticsJobsAnalysis - stopped?: XpackUsageMlDataFrameAnalyticsJobsCount -} - -export interface XpackUsageMlDataFrameAnalyticsJobsAnalysis { - classification?: integer - outlier_detection?: integer - regression?: integer -} - -export interface XpackUsageMlDataFrameAnalyticsJobsCount { - count: long -} - -export interface XpackUsageMlDataFrameAnalyticsJobsMemory { - peak_usage_bytes: MlJobStatistics -} - -export interface XpackUsageMlInference { - ingest_processors: Record - trained_models: XpackUsageMlInferenceTrainedModels - deployments?: XpackUsageMlInferenceDeployments -} - -export interface XpackUsageMlInferenceDeployments { - count: integer - inference_counts: MlJobStatistics - model_sizes_bytes: MlJobStatistics - time_ms: XpackUsageMlInferenceDeploymentsTimeMs -} - -export interface XpackUsageMlInferenceDeploymentsTimeMs { - avg: double -} - -export interface XpackUsageMlInferenceIngestProcessor { - num_docs_processed: XpackUsageMlInferenceIngestProcessorCount - pipelines: XpackUsageMlCounter - num_failures: XpackUsageMlInferenceIngestProcessorCount - time_ms: XpackUsageMlInferenceIngestProcessorCount -} - -export interface XpackUsageMlInferenceIngestProcessorCount { - max: long - sum: long - min: long -} - -export interface XpackUsageMlInferenceTrainedModels { - estimated_operations?: MlJobStatistics - estimated_heap_memory_usage_bytes?: MlJobStatistics - count?: XpackUsageMlInferenceTrainedModelsCount - _all: XpackUsageMlCounter - model_size_bytes?: MlJobStatistics -} - -export interface XpackUsageMlInferenceTrainedModelsCount { - total: long - prepackaged: long - other: long - pass_through?: long - regression?: long - classification?: long - ner?: long - text_embedding?: long -} - -export interface XpackUsageMlJobForecasts { - total: long - forecasted_jobs: long -} - -export interface XpackUsageMonitoring extends XpackUsageBase { - collection_enabled: boolean - enabled_exporters: Record -} - -export interface XpackUsageQuery { - count?: integer - failed?: integer - paging?: integer - total?: integer -} - -export interface XpackUsageRealm extends XpackUsageBase { - name?: string[] - order?: long[] - size?: long[] - cache?: XpackUsageRealmCache[] - has_authorization_realms?: boolean[] - has_default_username_pattern?: boolean[] - has_truststore?: boolean[] - is_authentication_delegated?: boolean[] -} - -export interface XpackUsageRealmCache { - size: long -} - -export interface XpackUsageRequest extends RequestBase { - master_timeout?: Duration -} - -export interface XpackUsageResponse { - aggregate_metric: XpackUsageBase - analytics: XpackUsageAnalytics - archive: XpackUsageArchive - watcher: XpackUsageWatcher - ccr: XpackUsageCcr - data_frame?: XpackUsageBase - data_science?: XpackUsageBase - data_streams?: XpackUsageDataStreams - data_tiers: XpackUsageDataTiers - enrich?: XpackUsageBase - eql: XpackUsageEql - flattened?: XpackUsageFlattened - frozen_indices: XpackUsageFrozenIndices - graph: XpackUsageBase - health_api?: XpackUsageHealthStatistics - ilm: XpackUsageIlm - logstash: XpackUsageBase - ml: XpackUsageMachineLearning - monitoring: XpackUsageMonitoring - rollup: XpackUsageBase - runtime_fields?: XpackUsageRuntimeFieldTypes - spatial: XpackUsageBase - searchable_snapshots: XpackUsageSearchableSnapshots - security: XpackUsageSecurity - slm: XpackUsageSlm - sql: XpackUsageSql - transform: XpackUsageBase - vectors?: XpackUsageVector - voting_only: XpackUsageBase -} - -export interface XpackUsageRoleMapping { - enabled: integer - size: integer -} - -export interface XpackUsageRuntimeFieldTypes extends XpackUsageBase { - field_types: XpackUsageRuntimeFieldsType[] -} - -export interface XpackUsageRuntimeFieldsType { - chars_max: long - chars_total: long - count: long - doc_max: long - doc_total: long - index_count: long - lang: string[] - lines_max: long - lines_total: long - name: Field - scriptless_count: long - shadowed_count: long - source_max: long - source_total: long -} - -export interface XpackUsageSearchableSnapshots extends XpackUsageBase { - indices_count: integer - full_copy_indices_count?: integer - shared_cache_indices_count?: integer -} - -export interface XpackUsageSecurity extends XpackUsageBase { - api_key_service: XpackUsageFeatureToggle - anonymous: XpackUsageFeatureToggle - audit: XpackUsageAudit - fips_140: XpackUsageFeatureToggle - ipfilter: XpackUsageIpFilter - realms: Record - role_mapping: Record - roles: XpackUsageSecurityRoles - ssl: XpackUsageSsl - system_key?: XpackUsageFeatureToggle - token_service: XpackUsageFeatureToggle - operator_privileges: XpackUsageBase -} - -export interface XpackUsageSecurityRoles { - native: XpackUsageSecurityRolesNative - dls: XpackUsageSecurityRolesDls - file: XpackUsageSecurityRolesFile -} - -export interface XpackUsageSecurityRolesDls { - bit_set_cache: XpackUsageSecurityRolesDlsBitSetCache -} - -export interface XpackUsageSecurityRolesDlsBitSetCache { - count: integer - memory?: ByteSize - memory_in_bytes: ulong -} - -export interface XpackUsageSecurityRolesFile { - dls: boolean - fls: boolean - size: long -} - -export interface XpackUsageSecurityRolesNative { - dls: boolean - fls: boolean - size: long -} - -export interface XpackUsageSlm extends XpackUsageBase { - policy_count?: integer - policy_stats?: SlmStatistics -} - -export interface XpackUsageSql extends XpackUsageBase { - features: Record - queries: Record -} - -export interface XpackUsageSsl { - http: XpackUsageFeatureToggle - transport: XpackUsageFeatureToggle -} - -export interface XpackUsageVector extends XpackUsageBase { - dense_vector_dims_avg_count: integer - dense_vector_fields_count: integer - sparse_vector_fields_count?: integer -} - -export interface XpackUsageWatcher extends XpackUsageBase { - execution: XpackUsageWatcherActions - watch: XpackUsageWatcherWatch - count: XpackUsageCounter -} - -export interface XpackUsageWatcherActionTotals { - total: Duration - total_time_in_ms: DurationValue -} - -export interface XpackUsageWatcherActions { - actions: Record -} - -export interface XpackUsageWatcherWatch { - input: Record - condition?: Record - action?: Record - trigger: XpackUsageWatcherWatchTrigger -} - -export interface XpackUsageWatcherWatchTrigger { - schedule?: XpackUsageWatcherWatchTriggerSchedule - _all: XpackUsageCounter -} - -export interface XpackUsageWatcherWatchTriggerSchedule extends XpackUsageCounter { - cron: XpackUsageCounter - _all: XpackUsageCounter -} - -export interface SpecUtilsAdditionalProperties { -} - -export interface SpecUtilsAdditionalProperty { -} - -export interface SpecUtilsCommonQueryParameters { - error_trace?: boolean - filter_path?: string | string[] - human?: boolean - pretty?: boolean -} - -export interface SpecUtilsCommonCatQueryParameters { - format?: string - h?: Names - help?: boolean - local?: boolean - master_timeout?: Duration - s?: Names - v?: boolean -} - -export interface SpecUtilsOverloadOf { -}