diff --git a/.buildkite/create-serverless.sh b/.buildkite/create-serverless.sh index 355805f..1b4914f 100755 --- a/.buildkite/create-serverless.sh +++ b/.buildkite/create-serverless.sh @@ -10,7 +10,7 @@ export EC_PROJECT_NAME="$EC_PROJECT_PREFIX-$BUILDKITE_JOB_ID" # fetch cloud creds used by qaf CLOUD_ACCESS_KEY=$(vault read -field="$EC_ENV" "$CLOUD_CREDENTIALS_PATH") -echo "{\"api_key\":{\"$EC_ENV\":\"$CLOUD_ACCESS_KEY\"}}" > "$(pwd)/cloud.json" +echo "{\"api_key\":{\"$EC_ENV\":\"$CLOUD_ACCESS_KEY\"}}" >"$(pwd)/cloud.json" run_qaf() { cmd=$1 diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 1b5fc4b..8220bcd 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -9,6 +9,7 @@ steps: nodejs: - "18" - "20" + - "22" env: NODE_VERSION: "{{ matrix.nodejs }}" EC_PROJECT_PREFIX: "elasticsearch-serverless-js-node{{ matrix.nodejs }}" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2259a2f..c61bb03 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ jobs: name: Detect files changed runs-on: ubuntu-latest outputs: - src-only: '${{ steps.changes.outputs.src-only }}' + src-only: "${{ steps.changes.outputs.src-only }}" steps: - uses: actions/checkout@v4 - uses: dorny/paths-filter/@v2.11.1 @@ -28,7 +28,7 @@ jobs: strategy: matrix: - node-version: [18.x, 20.x] + node-version: [18.x, 20.x, 22.x] os: [ubuntu-latest, windows-latest, macOS-latest] steps: @@ -57,7 +57,7 @@ jobs: strategy: matrix: - node-version: [20.x] + node-version: [22.x] steps: - uses: actions/checkout@v4 diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 761f0e7..fe891c5 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -820,7 +820,7 @@ A post filter has no impact on the aggregation results. ** *`profile` (Optional, boolean)*: Set to `true` to return detailed timing information about the execution of individual components in a search request. NOTE: This is a debugging tool and adds significant overhead to search execution. ** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. -** *`rescore` (Optional, { query, window_size } | { query, window_size }[])*: Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the `query` and `post_filter` phases. +** *`rescore` (Optional, { window_size, query, learning_to_rank } | { window_size, query, learning_to_rank }[])*: Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the `query` and `post_filter` phases. ** *`script_fields` (Optional, Record)*: Retrieve a script evaluation (based on different fields) for each hit. ** *`search_after` (Optional, number | number | string | boolean | null | User-defined value[])*: Used to retrieve the next page of hits using a set of sort values from the previous page. ** *`size` (Optional, number)*: The number of hits to return. @@ -1284,7 +1284,7 @@ not included in the search results. ** *`post_filter` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })* ** *`profile` (Optional, boolean)* ** *`query` (Optional, { bool, boosting, common, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. -** *`rescore` (Optional, { query, window_size } | { query, window_size }[])* +** *`rescore` (Optional, { window_size, query, learning_to_rank } | { window_size, query, learning_to_rank }[])* ** *`script_fields` (Optional, Record)*: Retrieve a script evaluation (based on different fields) for each hit. ** *`search_after` (Optional, number | number | string | boolean | null | User-defined value[])* ** *`size` (Optional, number)*: The number of hits to return. By default, you cannot page through more @@ -1670,10 +1670,6 @@ Elastic Agent uses these templates to configure backing indices for its data str If you use Elastic Agent and want to overwrite one of these templates, set the `version` for your replacement template higher than the current version. If you don’t use Elastic Agent and want to disable all built-in component and index templates, set `stack.templates.enabled` to `false` using the cluster update settings API. ** *`template` ({ aliases, mappings, settings, defaults, data_stream })*: The template to be applied which includes mappings, settings, or aliases configuration. -** *`allow_auto_create` (Optional, boolean)*: This setting overrides the value of the `action.auto_create_index` cluster setting. -If set to `true` in a template, then indices can be automatically created using that -template even if auto-creation of indices is disabled via `actions.auto_create_index`. -If set to `false` then data streams matching the template must always be explicitly created. ** *`version` (Optional, number)*: Version number used to manage component templates externally. This number isn't automatically generated or incremented by Elasticsearch. To unset a version, replace the template without specifying a version. @@ -1681,9 +1677,12 @@ To unset a version, replace the template without specifying a version. May have any contents. This map is not automatically generated by Elasticsearch. This information is stored in the cluster state, so keeping it short is preferable. To unset `_meta`, replace the template without specifying this information. +** *`deprecated` (Optional, boolean)*: Marks this index template as deprecated. When creating or updating a non-deprecated index template +that uses deprecated components, Elasticsearch will emit a deprecation warning. ** *`create` (Optional, boolean)*: If `true`, this request cannot replace or update existing component templates. ** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. +** *`cause` (Optional, string)* [discrete] === enrich @@ -1925,12 +1924,12 @@ If no index is specified or the index does not have a default analyzer, the anal ** *`analyzer` (Optional, string)*: The name of the analyzer that should be applied to the provided `text`. This could be a built-in analyzer, or an analyzer that’s been configured in the index. ** *`attributes` (Optional, string[])*: Array of token attributes used to filter the output of the `explain` parameter. -** *`char_filter` (Optional, string | { type } | { type, mappings, mappings_path } | { type, flags, pattern, replacement } | { type, mode, name } | { type, normalize_kana, normalize_kanji }[])*: Array of character filters used to preprocess characters before the tokenizer. +** *`char_filter` (Optional, string | { type, escaped_tags } | { type, mappings, mappings_path } | { type, flags, pattern, replacement } | { type, mode, name } | { type, normalize_kana, normalize_kanji }[])*: Array of character filters used to preprocess characters before the tokenizer. ** *`explain` (Optional, boolean)*: If `true`, the response includes token attributes and additional details. ** *`field` (Optional, string)*: Field used to derive the analyzer. To use this parameter, you must specify an index. If specified, the `analyzer` parameter overrides this value. -** *`filter` (Optional, string | { type, preserve_original } | { type, common_words, common_words_path, ignore_case, query_mode } | { type, filter, script } | { type, delimiter, encoding } | { type, max_gram, min_gram, side, preserve_original } | { type, articles, articles_path, articles_case } | { type, max_output_size, separator } | { type, dedup, dictionary, locale, longest_only } | { type } | { type, mode, types } | { type, keep_words, keep_words_case, keep_words_path } | { type, ignore_case, keywords, keywords_path, keywords_pattern } | { type } | { type, max, min } | { type, consume_all_tokens, max_token_count } | { type, language } | { type, filters, preserve_original } | { type, max_gram, min_gram, preserve_original } | { type, stoptags } | { type, patterns, preserve_original } | { type, all, flags, pattern, replacement } | { type } | { type, script } | { type } | { type } | { type, filler_token, max_shingle_size, min_shingle_size, output_unigrams, output_unigrams_if_no_shingles, token_separator } | { type, language } | { type, rules, rules_path } | { type, language } | { type, ignore_case, remove_trailing, stopwords, stopwords_path } | { type, expand, format, lenient, synonyms, synonyms_path, tokenizer, updateable } | { type, expand, format, lenient, synonyms, synonyms_path, tokenizer, updateable } | { type } | { type, length } | { type, only_on_same_position } | { type } | { type, adjust_offsets, catenate_all, catenate_numbers, catenate_words, generate_number_parts, generate_word_parts, ignore_keywords, preserve_original, protected_words, protected_words_path, split_on_case_change, split_on_numerics, stem_english_possessive, type_table, type_table_path } | { type, catenate_all, catenate_numbers, catenate_words, generate_number_parts, generate_word_parts, preserve_original, protected_words, protected_words_path, split_on_case_change, split_on_numerics, stem_english_possessive, type_table, type_table_path } | { type, minimum_length } | { type, use_romaji } | { type, stoptags } | { type, alternate, caseFirst, caseLevel, country, decomposition, hiraganaQuaternaryMode, language, numeric, rules, strength, variableTop, variant } | { type, unicode_set_filter } | { type, name } | { type, dir, id } | { type, encoder, languageset, max_code_len, name_type, replace, rule_type } | { type }[])*: Array of token filters used to apply after the tokenizer. +** *`filter` (Optional, string | { type, preserve_original } | { type, common_words, common_words_path, ignore_case, query_mode } | { type, filter, script } | { type, delimiter, encoding } | { type, max_gram, min_gram, side, preserve_original } | { type, articles, articles_path, articles_case } | { type, max_output_size, separator } | { type, dedup, dictionary, locale, longest_only } | { type } | { type, mode, types } | { type, keep_words, keep_words_case, keep_words_path } | { type, ignore_case, keywords, keywords_path, keywords_pattern } | { type } | { type, max, min } | { type, consume_all_tokens, max_token_count } | { type, language } | { type, filters, preserve_original } | { type, max_gram, min_gram, preserve_original } | { type, stoptags } | { type, patterns, preserve_original } | { type, all, flags, pattern, replacement } | { type } | { type, script } | { type } | { type } | { type, filler_token, max_shingle_size, min_shingle_size, output_unigrams, output_unigrams_if_no_shingles, token_separator } | { type, language } | { type, rules, rules_path } | { type, language } | { type, ignore_case, remove_trailing, stopwords, stopwords_path } | { type, expand, format, lenient, synonyms, synonyms_path, synonyms_set, tokenizer, updateable } | { type, expand, format, lenient, synonyms, synonyms_path, synonyms_set, tokenizer, updateable } | { type } | { type, length } | { type, only_on_same_position } | { type } | { type, adjust_offsets, catenate_all, catenate_numbers, catenate_words, generate_number_parts, generate_word_parts, ignore_keywords, preserve_original, protected_words, protected_words_path, split_on_case_change, split_on_numerics, stem_english_possessive, type_table, type_table_path } | { type, catenate_all, catenate_numbers, catenate_words, generate_number_parts, generate_word_parts, preserve_original, protected_words, protected_words_path, split_on_case_change, split_on_numerics, stem_english_possessive, type_table, type_table_path } | { type, minimum_length } | { type, use_romaji } | { type, stoptags } | { type, alternate, caseFirst, caseLevel, country, decomposition, hiraganaQuaternaryMode, language, numeric, rules, strength, variableTop, variant } | { type, unicode_set_filter } | { type, name } | { type, dir, id } | { type, encoder, languageset, max_code_len, name_type, replace, rule_type } | { type }[])*: Array of token filters used to apply after the tokenizer. ** *`normalizer` (Optional, string)*: Normalizer to use to convert text into a single token. ** *`text` (Optional, string | string[])*: Text to analyze. If an array of strings is provided, it is analyzed as a multi-value field. @@ -1961,7 +1960,7 @@ client.indices.create({ index }) If no response is received before the timeout expires, the request fails and returns an error. ** *`timeout` (Optional, string | -1 | 0)*: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. -** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: The number of shard copies that must be active before proceeding with the operation. +** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: The number of shard copies that must be active before proceeding with the operation. Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). [discrete] @@ -2512,7 +2511,17 @@ This number is not automatically generated by Elasticsearch. ** *`_meta` (Optional, Record)*: Optional user metadata about the index template. May have any contents. This map is not automatically generated by Elasticsearch. +** *`allow_auto_create` (Optional, boolean)*: This setting overrides the value of the `action.auto_create_index` cluster setting. +If set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`. +If set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created. +** *`ignore_missing_component_templates` (Optional, string[])*: The configuration option ignore_missing_component_templates can be used when an index template +references a component template that might not exist +** *`deprecated` (Optional, boolean)*: Marks this index template as deprecated. When creating or updating a non-deprecated index template +that uses deprecated components, Elasticsearch will emit a deprecation warning. ** *`create` (Optional, boolean)*: If `true`, this request cannot replace or update existing index templates. +** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node. +If no response is received before the timeout expires, the request fails and returns an error. +** *`cause` (Optional, string)*: User defined reason for creating/updating the index template [discrete] ==== put_mapping @@ -2625,11 +2634,9 @@ Templates with lower 'order' values are merged first. Templates with higher ** *`version` (Optional, number)*: Version number used to manage index templates externally. This number is not automatically generated by Elasticsearch. ** *`create` (Optional, boolean)*: If true, this request cannot replace or update existing index templates. -** *`flat_settings` (Optional, boolean)*: If `true`, returns settings in flat format. ** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. -** *`timeout` (Optional, string | -1 | 0)*: Period to wait for a response. -If no response is received before the timeout expires, the request fails and returns an error. +** *`cause` (Optional, string)* [discrete] ==== refresh @@ -2729,7 +2736,25 @@ client.indices.simulateIndexTemplate({ name }) ==== Arguments * *Request (object):* -** *`name` (string)*: Index or template name to simulate +** *`name` (string)*: Name of the index to simulate +** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + +[discrete] +==== simulate_template +Simulate resolving the given template name or body + +{ref}/indices-simulate-template.html[Endpoint documentation] +[source,ts] +---- +client.indices.simulateTemplate({ ... }) +---- + +[discrete] +==== Arguments + +* *Request (object):* +** *`name` (Optional, string)*: Name of the index template to simulate. To test a template configuration before you add it to the cluster, omit +this parameter and specify the template configuration in the request body. ** *`allow_auto_create` (Optional, boolean)*: This setting overrides the value of the `action.auto_create_index` cluster setting. If set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`. If set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created. @@ -2750,31 +2775,10 @@ This number is not automatically generated by Elasticsearch. ** *`_meta` (Optional, Record)*: Optional user metadata about the index template. May have any contents. This map is not automatically generated by Elasticsearch. -** *`create` (Optional, boolean)*: If `true`, the template passed in the body is only used if no existing -templates match the same index patterns. If `false`, the simulation uses -the template with the highest priority. Note that the template is not -permanently added or updated in either case; it is only used for the -simulation. -** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node. If no response is received -before the timeout expires, the request fails and returns an error. - -[discrete] -==== simulate_template -Simulate resolving the given template name or body - -{ref}/indices-simulate-template.html[Endpoint documentation] -[source,ts] ----- -client.indices.simulateTemplate({ ... }) ----- - -[discrete] -==== Arguments - -* *Request (object):* -** *`name` (Optional, string)*: Name of the index template to simulate. To test a template configuration before you add it to the cluster, omit -this parameter and specify the template configuration in the request body. -** *`template` (Optional, { index_patterns, composed_of, template, version, priority, _meta, allow_auto_create, data_stream })* +** *`ignore_missing_component_templates` (Optional, string[])*: The configuration option ignore_missing_component_templates can be used when an index template +references a component template that might not exist +** *`deprecated` (Optional, boolean)*: Marks this index template as deprecated. When creating or updating a non-deprecated index template +that uses deprecated components, Elasticsearch will emit a deprecation warning. ** *`create` (Optional, boolean)*: If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. ** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. @@ -2838,13 +2842,13 @@ Valid values are: `all`, `open`, `closed`, `hidden`, `none`. [discrete] === inference [discrete] -==== delete_model -Delete model in the Inference API +==== delete +Delete an inference endpoint {ref}/delete-inference-api.html[Endpoint documentation] [source,ts] ---- -client.inference.deleteModel({ inference_id }) +client.inference.delete({ inference_id }) ---- [discrete] @@ -2852,28 +2856,28 @@ client.inference.deleteModel({ inference_id }) * *Request (object):* ** *`inference_id` (string)*: The inference Id -** *`task_type` (Optional, Enum("sparse_embedding" | "text_embedding"))*: The task type +** *`task_type` (Optional, Enum("sparse_embedding" | "text_embedding" | "rerank" | "completion"))*: The task type [discrete] -==== get_model -Get a model in the Inference API +==== get +Get an inference endpoint {ref}/get-inference-api.html[Endpoint documentation] [source,ts] ---- -client.inference.getModel({ inference_id }) +client.inference.get({ ... }) ---- [discrete] ==== Arguments * *Request (object):* -** *`inference_id` (string)*: The inference Id -** *`task_type` (Optional, Enum("sparse_embedding" | "text_embedding"))*: The task type +** *`task_type` (Optional, Enum("sparse_embedding" | "text_embedding" | "rerank" | "completion"))*: The task type +** *`inference_id` (Optional, string)*: The inference Id [discrete] ==== inference -Perform inference on a model +Perform inference {ref}/post-inference-api.html[Endpoint documentation] [source,ts] @@ -2886,19 +2890,22 @@ client.inference.inference({ inference_id, input }) * *Request (object):* ** *`inference_id` (string)*: The inference Id -** *`input` (string | string[])*: Text input to the model. +** *`input` (string | string[])*: Inference input. Either a string or an array of strings. -** *`task_type` (Optional, Enum("sparse_embedding" | "text_embedding"))*: The task type +** *`task_type` (Optional, Enum("sparse_embedding" | "text_embedding" | "rerank" | "completion"))*: The task type +** *`query` (Optional, string)*: Query input, required for rerank task. +Not required for other tasks. ** *`task_settings` (Optional, User-defined value)*: Optional task settings +** *`timeout` (Optional, string | -1 | 0)*: Specifies the amount of time to wait for the inference request to complete. [discrete] -==== put_model -Configure a model for use in the Inference API +==== put +Configure an inference endpoint for use in the Inference API {ref}/put-inference-api.html[Endpoint documentation] [source,ts] ---- -client.inference.putModel({ inference_id }) +client.inference.put({ inference_id }) ---- [discrete] @@ -2906,8 +2913,8 @@ client.inference.putModel({ inference_id }) * *Request (object):* ** *`inference_id` (string)*: The inference Id -** *`task_type` (Optional, Enum("sparse_embedding" | "text_embedding"))*: The task type -** *`model_config` (Optional, { service, service_settings, task_settings })* +** *`task_type` (Optional, Enum("sparse_embedding" | "text_embedding" | "rerank" | "completion"))*: The task type +** *`inference_config` (Optional, { service, service_settings, task_settings })* [discrete] === ingest @@ -4712,7 +4719,7 @@ client.security.hasPrivileges({ ... }) * *Request (object):* ** *`user` (Optional, string)*: Username ** *`application` (Optional, { application, privileges, resources }[])* -** *`cluster` (Optional, Enum("all" | "cancel_task" | "create_snapshot" | "grant_api_key" | "manage" | "manage_api_key" | "manage_ccr" | "manage_enrich" | "manage_ilm" | "manage_index_templates" | "manage_ingest_pipelines" | "manage_logstash_pipelines" | "manage_ml" | "manage_oidc" | "manage_own_api_key" | "manage_pipeline" | "manage_rollup" | "manage_saml" | "manage_security" | "manage_service_account" | "manage_slm" | "manage_token" | "manage_transform" | "manage_user_profile" | "manage_watcher" | "monitor" | "monitor_ml" | "monitor_rollup" | "monitor_snapshot" | "monitor_text_structure" | "monitor_transform" | "monitor_watcher" | "read_ccr" | "read_ilm" | "read_pipeline" | "read_slm" | "transport_client")[])*: A list of the cluster privileges that you want to check. +** *`cluster` (Optional, Enum("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_text_structure" | "monitor_transform" | "monitor_watcher" | "none" | "post_behavioral_analytics_event" | "read_ccr" | "read_connector_secrets" | "read_fleet_secrets" | "read_ilm" | "read_pipeline" | "read_security" | "read_slm" | "transport_client" | "write_connector_secrets" | "write_fleet_secrets")[])*: A list of the cluster privileges that you want to check. ** *`index` (Optional, { names, privileges, allow_restricted_indices }[])* [discrete] diff --git a/src/api/api/cluster.ts b/src/api/api/cluster.ts index 86c03fa..40a69a8 100644 --- a/src/api/api/cluster.ts +++ b/src/api/api/cluster.ts @@ -164,7 +164,7 @@ export default class Cluster { async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): Promise async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] - const acceptedBody: string[] = ['allow_auto_create', 'template', 'version', '_meta'] + const acceptedBody: string[] = ['template', 'version', '_meta', 'deprecated'] const querystring: Record = {} // @ts-expect-error const userBody: any = params?.body diff --git a/src/api/api/indices.ts b/src/api/api/indices.ts index c19223e..2acb036 100644 --- a/src/api/api/indices.ts +++ b/src/api/api/indices.ts @@ -851,7 +851,7 @@ export default class Indices { async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptions): Promise async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] - const acceptedBody: string[] = ['index_patterns', 'composed_of', 'template', 'data_stream', 'priority', 'version', '_meta'] + 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 @@ -1108,23 +1108,11 @@ export default class Indices { async simulateIndexTemplate (this: That, params: T.IndicesSimulateIndexTemplateRequest | TB.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptions): Promise async simulateIndexTemplate (this: That, params: T.IndicesSimulateIndexTemplateRequest | TB.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] - const acceptedBody: string[] = ['allow_auto_create', 'index_patterns', 'composed_of', 'template', 'data_stream', 'priority', 'version', '_meta'] 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 = undefined for (const key in params) { - if (acceptedBody.includes(key)) { - body = body ?? {} - // @ts-expect-error - body[key] = params[key] - } else if (acceptedPath.includes(key)) { + if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { // @ts-expect-error @@ -1141,20 +1129,28 @@ export default class Indices { * Simulate resolving the given template name or body * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/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 | 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 { const acceptedPath: string[] = ['name'] - const acceptedBody: string[] = ['template'] + 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 - let body: any = params.body ?? undefined + const userBody: any = params?.body + let body: Record | string + if (typeof userBody === 'string') { + body = userBody + } else { + body = userBody != null ? { ...userBody } : undefined + } + params = params ?? {} for (const key in params) { if (acceptedBody.includes(key)) { + body = body ?? {} // @ts-expect-error - body = params[key] + body[key] = params[key] } else if (acceptedPath.includes(key)) { continue } else if (key !== 'body') { diff --git a/src/api/api/inference.ts b/src/api/api/inference.ts index e024870..16dc527 100644 --- a/src/api/api/inference.ts +++ b/src/api/api/inference.ts @@ -44,13 +44,13 @@ export default class Inference { } /** - * Delete model in the Inference API + * Delete an inference endpoint * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-inference-api.html | Elasticsearch API documentation} */ - async deleteModel (this: That, params: T.InferenceDeleteModelRequest | TB.InferenceDeleteModelRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async deleteModel (this: That, params: T.InferenceDeleteModelRequest | TB.InferenceDeleteModelRequest, options?: TransportRequestOptionsWithMeta): Promise> - async deleteModel (this: That, params: T.InferenceDeleteModelRequest | TB.InferenceDeleteModelRequest, options?: TransportRequestOptions): Promise - async deleteModel (this: That, params: T.InferenceDeleteModelRequest | TB.InferenceDeleteModelRequest, options?: TransportRequestOptions): Promise { + 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 { const acceptedPath: string[] = ['task_type', 'inference_id'] const querystring: Record = {} const body = undefined @@ -77,17 +77,18 @@ export default class Inference { } /** - * Get a model in the Inference API + * Get an inference endpoint * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-inference-api.html | Elasticsearch API documentation} */ - async getModel (this: That, params: T.InferenceGetModelRequest | TB.InferenceGetModelRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async getModel (this: That, params: T.InferenceGetModelRequest | TB.InferenceGetModelRequest, options?: TransportRequestOptionsWithMeta): Promise> - async getModel (this: That, params: T.InferenceGetModelRequest | TB.InferenceGetModelRequest, options?: TransportRequestOptions): Promise - async getModel (this: That, params: T.InferenceGetModelRequest | TB.InferenceGetModelRequest, options?: TransportRequestOptions): Promise { + 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 { const acceptedPath: string[] = ['task_type', 'inference_id'] const querystring: Record = {} const body = undefined + params = params ?? {} for (const key in params) { if (acceptedPath.includes(key)) { continue @@ -102,15 +103,18 @@ export default class Inference { if (params.task_type != null && params.inference_id != null) { method = 'GET' path = `/_inference/${encodeURIComponent(params.task_type.toString())}/${encodeURIComponent(params.inference_id.toString())}` - } else { + } else if (params.inference_id != null) { method = 'GET' path = `/_inference/${encodeURIComponent(params.inference_id.toString())}` + } else { + method = 'GET' + path = '/_inference' } return await this.transport.request({ path, method, querystring, body }, options) } /** - * Perform inference on a model + * Perform inference * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html | Elasticsearch API documentation} */ async inference (this: That, params: T.InferenceInferenceRequest | TB.InferenceInferenceRequest, options?: TransportRequestOptionsWithOutMeta): Promise @@ -118,7 +122,7 @@ export default class Inference { async inference (this: That, params: T.InferenceInferenceRequest | TB.InferenceInferenceRequest, options?: TransportRequestOptions): Promise async inference (this: That, params: T.InferenceInferenceRequest | TB.InferenceInferenceRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['task_type', 'inference_id'] - const acceptedBody: string[] = ['input', 'task_settings'] + const acceptedBody: string[] = ['query', 'input', 'task_settings'] const querystring: Record = {} // @ts-expect-error const userBody: any = params?.body @@ -155,15 +159,15 @@ export default class Inference { } /** - * Configure a model for use in the Inference API + * Configure an inference endpoint for use in the Inference API * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html | Elasticsearch API documentation} */ - async putModel (this: That, params: T.InferencePutModelRequest | TB.InferencePutModelRequest, options?: TransportRequestOptionsWithOutMeta): Promise - async putModel (this: That, params: T.InferencePutModelRequest | TB.InferencePutModelRequest, options?: TransportRequestOptionsWithMeta): Promise> - async putModel (this: That, params: T.InferencePutModelRequest | TB.InferencePutModelRequest, options?: TransportRequestOptions): Promise - async putModel (this: That, params: T.InferencePutModelRequest | TB.InferencePutModelRequest, options?: TransportRequestOptions): Promise { + 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 { const acceptedPath: string[] = ['task_type', 'inference_id'] - const acceptedBody: string[] = ['model_config'] + const acceptedBody: string[] = ['inference_config'] const querystring: Record = {} // @ts-expect-error let body: any = params.body ?? undefined diff --git a/src/api/types.ts b/src/api/types.ts index 65c535d..d18d06b 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -1450,6 +1450,11 @@ export interface SearchLaplaceSmoothingModel { alpha: double } +export interface SearchLearningToRank { + model_id: string + params?: Record +} + export interface SearchLinearInterpolationSmoothingModel { bigram_lambda: double trigram_lambda: double @@ -1549,8 +1554,9 @@ export interface SearchRegexOptions { } export interface SearchRescore { - query: SearchRescoreQuery window_size?: integer + query?: SearchRescoreQuery + learning_to_rank?: SearchLearningToRank } export interface SearchRescoreQuery { @@ -1941,10 +1947,14 @@ export interface SpecUtilsBaseNode { 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 } @@ -2031,9 +2041,9 @@ export type DataStreamNames = DataStreamName | DataStreamName[] export type DateFormat = string -export type DateMath = string +export type DateMath = string | Date -export type DateTime = string | EpochTime +export type DateTime = string | EpochTime | Date export type Distance = string @@ -2264,12 +2274,21 @@ export interface InlineScript extends ScriptBase { export type Ip = string -export interface KnnQuery { +export interface KnnQuery extends QueryDslQueryBase { field: Field query_vector?: QueryVector query_vector_builder?: QueryVectorBuilder - k: long - num_candidates: long + num_candidates?: long + filter?: QueryDslQueryContainer | QueryDslQueryContainer[] + similarity?: float +} + +export interface KnnSearch { + field: Field + query_vector?: QueryVector + query_vector_builder?: QueryVectorBuilder + k?: long + num_candidates?: long boost?: float filter?: QueryDslQueryContainer | QueryDslQueryContainer[] similarity?: float @@ -2391,14 +2410,14 @@ export interface PluginStats { export type PropertyName = string export interface QueryCacheStats { - cache_count: integer - cache_size: integer - evictions: integer - hit_count: integer + cache_count: long + cache_size: long + evictions: long + hit_count: long memory_size?: ByteSize memory_size_in_bytes: long - miss_count: integer - total_count: integer + miss_count: long + total_count: long } export type QueryVector = float[] @@ -2722,7 +2741,7 @@ export interface WktGeoBounds { export interface WriteResponseBase { _id: Id _index: IndexName - _primary_term: long + _primary_term?: long result: Result _seq_no: SequenceNumber _shards: ShardStatistics @@ -2768,8 +2787,6 @@ export interface AggregationsAggregateBase { export type AggregationsAggregateOrder = Partial> | Partial>[] export interface AggregationsAggregation { - meta?: Metadata - name?: string } export interface AggregationsAggregationContainer { @@ -2909,7 +2926,7 @@ export interface AggregationsBoxplotAggregation extends AggregationsMetricAggreg compression?: double } -export interface AggregationsBucketAggregationBase extends AggregationsAggregation { +export interface AggregationsBucketAggregationBase { } export interface AggregationsBucketCorrelationAggregation extends AggregationsBucketPathAggregation { @@ -2940,7 +2957,7 @@ export interface AggregationsBucketMetricValueAggregate extends AggregationsSing keys: string[] } -export interface AggregationsBucketPathAggregation extends AggregationsAggregation { +export interface AggregationsBucketPathAggregation { buckets_path?: AggregationsBucketsPath } @@ -2952,7 +2969,7 @@ export interface AggregationsBucketSelectorAggregation extends AggregationsPipel script?: Script } -export interface AggregationsBucketSortAggregation extends AggregationsAggregation { +export interface AggregationsBucketSortAggregation { from?: integer gap_policy?: AggregationsGapPolicy size?: integer @@ -2977,7 +2994,7 @@ export interface AggregationsCardinalityAggregation extends AggregationsMetricAg export type AggregationsCardinalityExecutionMode = 'global_ordinals' | 'segment_ordinals' | 'direct' | 'save_memory_heuristic' | 'save_time_heuristic' -export interface AggregationsCategorizeTextAggregation extends AggregationsAggregation { +export interface AggregationsCategorizeTextAggregation { field: Field max_unique_tokens?: integer max_matched_tokens?: integer @@ -3159,8 +3176,8 @@ export interface AggregationsEwmaMovingAverageAggregation extends AggregationsMo } export interface AggregationsExtendedBounds { - max: T - min: T + max?: T + min?: T } export interface AggregationsExtendedStatsAggregate extends AggregationsStatsAggregate { @@ -3527,7 +3544,7 @@ export interface AggregationsLongTermsBucketKeys extends AggregationsTermsBucket export type AggregationsLongTermsBucket = AggregationsLongTermsBucketKeys & { [property: string]: AggregationsAggregate | long | string } -export interface AggregationsMatrixAggregation extends AggregationsAggregation { +export interface AggregationsMatrixAggregation { fields?: Fields missing?: Record } @@ -3983,7 +4000,7 @@ export interface AggregationsTTestAggregate extends AggregationsAggregateBase { value_as_string?: string } -export interface AggregationsTTestAggregation extends AggregationsAggregation { +export interface AggregationsTTestAggregation { a?: AggregationsTestPopulation b?: AggregationsTestPopulation type?: AggregationsTTestType @@ -4043,8 +4060,9 @@ export interface AggregationsTopHitsAggregate extends AggregationsAggregateBase } export interface AggregationsTopHitsAggregation extends AggregationsMetricAggregationBase { - docvalue_fields?: Fields + docvalue_fields?: (QueryDslFieldAndFormat | Field)[] explain?: boolean + fields?: (QueryDslFieldAndFormat | Field)[] from?: integer highlight?: SearchHighlight script_fields?: Record @@ -4106,6 +4124,7 @@ export interface AggregationsVariableWidthHistogramAggregation { buckets?: integer shard_size?: integer initial_buffer?: integer + script?: Script } export interface AggregationsVariableWidthHistogramBucketKeys extends AggregationsMultiBucketBase { @@ -4119,7 +4138,7 @@ export interface AggregationsVariableWidthHistogramBucketKeys extends Aggregatio export type AggregationsVariableWidthHistogramBucket = AggregationsVariableWidthHistogramBucketKeys & { [property: string]: AggregationsAggregate | double | string | long } -export interface AggregationsWeightedAverageAggregation extends AggregationsAggregation { +export interface AggregationsWeightedAverageAggregation { format?: string value?: AggregationsWeightedAverageValue value_type?: AggregationsValueType @@ -4255,6 +4274,7 @@ export interface AnalysisFingerprintTokenFilter extends AnalysisTokenFilterBase export interface AnalysisHtmlStripCharFilter extends AnalysisCharFilterBase { type: 'html_strip' + escaped_tags?: string[] } export interface AnalysisHunspellTokenFilter extends AnalysisTokenFilterBase { @@ -4660,6 +4680,7 @@ export interface AnalysisSynonymGraphTokenFilter extends AnalysisTokenFilterBase lenient?: boolean synonyms?: string[] synonyms_path?: string + synonyms_set?: string tokenizer?: string updateable?: boolean } @@ -4671,6 +4692,7 @@ export interface AnalysisSynonymTokenFilter extends AnalysisTokenFilterBase { lenient?: boolean synonyms?: string[] synonyms_path?: string + synonyms_set?: string tokenizer?: string updateable?: boolean } @@ -4881,7 +4903,7 @@ export interface MappingDoubleRangeProperty extends MappingRangePropertyBase { export type MappingDynamicMapping = boolean | 'strict' | 'runtime' | 'true' | 'false' export interface MappingDynamicProperty extends MappingDocValuesPropertyBase { - type: '{dynamic_property}' + type: '{dynamic_type}' enabled?: boolean null_value?: FieldValue boost?: double @@ -5136,7 +5158,7 @@ export interface MappingRuntimeFieldFetchFields { format?: string } -export type MappingRuntimeFieldType = 'boolean' | 'date' | 'double' | 'geo_point' | 'ip' | 'keyword' | 'long' | 'lookup' +export type MappingRuntimeFieldType = 'boolean' | 'composite' | 'date' | 'double' | 'geo_point' | 'ip' | 'keyword' | 'long' | 'lookup' export type MappingRuntimeFields = Record @@ -5633,7 +5655,6 @@ export interface QueryDslMoreLikeThisQuery extends QueryDslQueryBase { minimum_should_match?: MinimumShouldMatch min_term_freq?: integer min_word_length?: integer - per_field_analyzer?: Record routing?: Routing stop_words?: AnalysisStopWords unlike?: QueryDslLike | QueryDslLike[] @@ -5817,7 +5838,7 @@ export interface QueryDslRandomScoreFunction { seed?: long | string } -export type QueryDslRangeQuery = QueryDslDateRangeQuery | QueryDslNumberRangeQuery +export type QueryDslRangeQuery = QueryDslDateRangeQuery | QueryDslNumberRangeQuery | QueryDslTermsRangeQuery export interface QueryDslRangeQueryBase extends QueryDslQueryBase { relation?: QueryDslRangeRelation @@ -5990,6 +6011,15 @@ export type QueryDslTermsQuery = QueryDslTermsQueryKeys export type QueryDslTermsQueryField = FieldValue[] | QueryDslTermsLookup +export interface QueryDslTermsRangeQuery extends QueryDslRangeQueryBase { + gt?: string + gte?: string + lt?: string + lte?: string + from?: string | null + to?: string | null +} + export interface QueryDslTermsSetQuery extends QueryDslQueryBase { minimum_should_match_field?: Field minimum_should_match_script?: Script @@ -8523,10 +8553,11 @@ export interface ClusterPutComponentTemplateRequest extends RequestBase { name: Name create?: boolean master_timeout?: Duration - allow_auto_create?: boolean + cause?: string template: IndicesIndexState version?: VersionNumber _meta?: Metadata + deprecated?: boolean } export type ClusterPutComponentTemplateResponse = AcknowledgedResponseBase @@ -8913,6 +8944,480 @@ export interface ClusterStatsStatsResponseBase extends NodesNodesResponseBase { timestamp: long } +export interface ConnectorConnector { + api_key_id?: string + configuration: ConnectorConnectorConfiguration + custom_scheduling: ConnectorConnectorCustomScheduling + description?: string + error?: string + features?: ConnectorConnectorFeatures + filtering: ConnectorFilteringConfig[] + id?: Id + index_name?: IndexName + 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_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 + type: ConnectorConnectorFieldType + ui_restrictions: string[] + validations: ConnectorValidation[] + value: ScalarValue +} + +export type ConnectorConnectorConfiguration = Record + +export type ConnectorConnectorCustomScheduling = Record + +export interface ConnectorConnectorFeatures { + document_level_security?: ConnectorFeatureEnabled + filtering_advanced_config?: boolean + filtering_rules?: boolean + incremental_sync?: 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: Record +} + +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: string +} + +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: ScalarValue[] +} + +export interface ConnectorRegexValidation { + type: 'regex' + constraint: string +} + +export interface ConnectorSchedulingConfiguration { + access_control?: ConnectorConnectorScheduling + full?: ConnectorConnectorScheduling + incremental?: ConnectorConnectorScheduling +} + +export interface ConnectorSelectOption { + label: string + value: string +} + +export interface ConnectorSyncJobConnectorReference { + configuration: ConnectorConnectorConfiguration + filtering: ConnectorFilteringRules + id: Id + index_name: string + language?: string + pipeline?: ConnectorIngestPipelineParams + service_type: string +} + +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 + last_access_control_sync_error?: SpecUtilsWithNullValue + 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?: SpecUtilsWithNullValue + last_sync_error?: SpecUtilsWithNullValue + last_sync_scheduled_at?: DateTime + last_sync_status?: ConnectorSyncStatus + last_synced?: DateTime +} + +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 { + description?: string + index_name: SpecUtilsWithNullValue + is_native?: boolean + language?: string + name?: string + service_type?: string +} + +export interface ConnectorPostResponse { + id: Id +} + +export interface ConnectorPutRequest extends RequestBase { + connector_id: Id + description?: string + index_name: SpecUtilsWithNullValue + is_native?: boolean + language?: string + name?: string + service_type?: string +} + +export interface ConnectorPutResponse { + result: Result +} + +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[] +} + +export interface ConnectorSyncJobListResponse { + count: long + results: ConnectorConnectorSyncJob[] +} + +export interface ConnectorSyncJobPostRequest extends RequestBase { + 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 + api_key_id?: SpecUtilsWithNullValue + api_key_secret_id?: SpecUtilsWithNullValue +} + +export interface ConnectorUpdateApiKeyIdResponse { + result: Result +} + +export interface ConnectorUpdateConfigurationRequest extends RequestBase { + connector_id: Id + configuration?: ConnectorConnectorConfiguration + values?: Record +} + +export interface ConnectorUpdateConfigurationResponse { + result: Result +} + +export interface ConnectorUpdateErrorRequest extends RequestBase { + connector_id: Id + error: SpecUtilsWithNullValue +} + +export interface ConnectorUpdateErrorResponse { + result: Result +} + +export interface ConnectorUpdateFilteringRequest extends RequestBase { + connector_id: Id + filtering?: ConnectorFilteringConfig[] + rules?: ConnectorFilteringRule[] + advanced_snippet?: ConnectorFilteringAdvancedSnippet +} + +export interface ConnectorUpdateFilteringResponse { + result: Result +} + +export interface ConnectorUpdateFilteringValidationRequest extends RequestBase { + connector_id: Id + validation: ConnectorFilteringRulesValidation +} + +export interface ConnectorUpdateFilteringValidationResponse { + result: Result +} + +export interface ConnectorUpdateIndexNameRequest extends RequestBase { + connector_id: Id + index_name: SpecUtilsWithNullValue +} + +export interface ConnectorUpdateIndexNameResponse { + result: Result +} + +export interface ConnectorUpdateNameRequest extends RequestBase { + connector_id: Id + name: string + description?: string +} + +export interface ConnectorUpdateNameResponse { + result: Result +} + +export interface ConnectorUpdateNativeRequest extends RequestBase { + connector_id: Id + is_native: boolean +} + +export interface ConnectorUpdateNativeResponse { + result: Result +} + +export interface ConnectorUpdatePipelineRequest extends RequestBase { + connector_id: Id + pipeline: ConnectorIngestPipelineParams +} + +export interface ConnectorUpdatePipelineResponse { + result: Result +} + +export interface ConnectorUpdateSchedulingRequest extends RequestBase { + connector_id: Id + scheduling: ConnectorSchedulingConfiguration +} + +export interface ConnectorUpdateSchedulingResponse { + result: Result +} + +export interface ConnectorUpdateServiceTypeRequest extends RequestBase { + connector_id: Id + service_type: string +} + +export interface ConnectorUpdateServiceTypeResponse { + result: Result +} + +export interface ConnectorUpdateStatusRequest extends RequestBase { + connector_id: Id + status: ConnectorConnectorStatus +} + +export interface ConnectorUpdateStatusResponse { + result: Result +} + export interface DanglingIndicesDeleteDanglingIndexRequest extends RequestBase { index_uuid: Uuid accept_data_loss: boolean @@ -9106,6 +9611,12 @@ export type EqlSearchResponse = EqlEqlSearchResponseBase origination_date?: long parse_origination_date?: boolean @@ -10587,13 +11099,18 @@ export interface IndicesPutIndexTemplateIndexTemplateMapping { export interface IndicesPutIndexTemplateRequest extends RequestBase { name: Name create?: boolean + master_timeout?: Duration + cause?: string index_patterns?: Indices composed_of?: Name[] template?: IndicesPutIndexTemplateIndexTemplateMapping data_stream?: IndicesDataStreamVisibility - priority?: integer + priority?: long version?: VersionNumber _meta?: Metadata + allow_auto_create?: boolean + ignore_missing_component_templates?: string[] + deprecated?: boolean } export type IndicesPutIndexTemplateResponse = AcknowledgedResponseBase @@ -10638,9 +11155,8 @@ export type IndicesPutSettingsResponse = AcknowledgedResponseBase export interface IndicesPutTemplateRequest extends RequestBase { name: Name create?: boolean - flat_settings?: boolean master_timeout?: Duration - timeout?: Duration + cause?: string aliases?: Record index_patterns?: string | string[] mappings?: MappingTypeMapping @@ -10981,19 +11497,12 @@ export interface IndicesShrinkResponse { export interface IndicesSimulateIndexTemplateRequest extends RequestBase { name: Name - create?: boolean master_timeout?: Duration - allow_auto_create?: boolean - index_patterns?: Indices - composed_of?: Name[] - template?: IndicesPutIndexTemplateIndexTemplateMapping - data_stream?: IndicesDataStreamVisibility - priority?: integer - version?: VersionNumber - _meta?: Metadata } export interface IndicesSimulateIndexTemplateResponse { + overlapping?: IndicesSimulateTemplateOverlapping[] + template: IndicesSimulateTemplateTemplate } export interface IndicesSimulateTemplateOverlapping { @@ -11005,7 +11514,16 @@ export interface IndicesSimulateTemplateRequest extends RequestBase { name?: Name create?: boolean master_timeout?: Duration - template?: IndicesIndexTemplate + 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 { @@ -11271,27 +11789,39 @@ export interface IndicesValidateQueryResponse { error?: string } +export interface InferenceCompletionResult { + result: string +} + export type InferenceDenseByteVector = byte[] export type InferenceDenseVector = float[] -export interface InferenceInferenceResult { - text_embedding_bytes?: InferenceTextEmbeddingByteResult[] - text_embedding?: InferenceTextEmbeddingResult[] - sparse_embedding?: InferenceSparseEmbeddingResult[] -} - -export interface InferenceModelConfig { +export interface InferenceInferenceEndpoint { service: string service_settings: InferenceServiceSettings task_settings: InferenceTaskSettings } -export interface InferenceModelConfigContainer extends InferenceModelConfig { - model_id: string +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 { @@ -11302,7 +11832,7 @@ export type InferenceSparseVector = Record export type InferenceTaskSettings = any -export type InferenceTaskType = 'sparse_embedding' | 'text_embedding' +export type InferenceTaskType = 'sparse_embedding' | 'text_embedding' | 'rerank' | 'completion' export interface InferenceTextEmbeddingByteResult { embedding: InferenceDenseByteVector @@ -11312,38 +11842,40 @@ export interface InferenceTextEmbeddingResult { embedding: InferenceDenseVector } -export interface InferenceDeleteModelRequest extends RequestBase { +export interface InferenceDeleteRequest extends RequestBase { task_type?: InferenceTaskType inference_id: Id } -export type InferenceDeleteModelResponse = AcknowledgedResponseBase +export type InferenceDeleteResponse = AcknowledgedResponseBase -export interface InferenceGetModelRequest extends RequestBase { +export interface InferenceGetRequest extends RequestBase { task_type?: InferenceTaskType - inference_id: Id + inference_id?: Id } -export interface InferenceGetModelResponse { - models: InferenceModelConfigContainer[] +export interface InferenceGetResponse { + endpoints: InferenceInferenceEndpointInfo[] } export interface InferenceInferenceRequest extends RequestBase { task_type?: InferenceTaskType inference_id: Id + timeout?: Duration + query?: string input: string | string[] task_settings?: InferenceTaskSettings } export type InferenceInferenceResponse = InferenceInferenceResult -export interface InferencePutModelRequest extends RequestBase { +export interface InferencePutRequest extends RequestBase { task_type?: InferenceTaskType inference_id: Id - model_config?: InferenceModelConfig + inference_config?: InferenceInferenceEndpoint } -export type InferencePutModelResponse = InferenceModelConfigContainer +export type InferencePutResponse = InferenceInferenceEndpointInfo export interface IngestAppendProcessor extends IngestProcessorBase { field: Field @@ -15755,7 +16287,7 @@ export interface SecurityClusterNode { name: Name } -export type SecurityClusterPrivilege = 'all' | 'cancel_task' | 'create_snapshot' | 'grant_api_key' | 'manage' | 'manage_api_key' | 'manage_ccr' | 'manage_enrich' | 'manage_ilm' | 'manage_index_templates' | 'manage_ingest_pipelines' | 'manage_logstash_pipelines' | 'manage_ml' | 'manage_oidc' | 'manage_own_api_key' | 'manage_pipeline' | 'manage_rollup' | 'manage_saml' | 'manage_security' | 'manage_service_account' | 'manage_slm' | 'manage_token' | 'manage_transform' | 'manage_user_profile' | 'manage_watcher' | 'monitor' | 'monitor_ml' | 'monitor_rollup' | 'monitor_snapshot' | 'monitor_text_structure' | 'monitor_transform' | 'monitor_watcher' | 'read_ccr' | 'read_ilm' | 'read_pipeline' | 'read_slm' | 'transport_client' | string +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_text_structure' | 'monitor_transform' | 'monitor_watcher' | 'none' | 'post_behavioral_analytics_event' | 'read_ccr' | 'read_connector_secrets' | '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 @@ -15778,7 +16310,7 @@ export interface SecurityGlobalPrivilege { export type SecurityGrantType = 'password' | 'access_token' -export type SecurityIndexPrivilege = 'none' | 'all' | 'auto_configure' | 'create' | 'create_doc' | 'create_index' | 'delete' | 'delete_index' | 'index' | 'maintenance' | 'manage' | 'manage_follow_index' | 'manage_ilm' | 'manage_leader_index' | 'monitor' | 'read' | 'read_cross_cluster' | 'view_index_metadata' | 'write' | string +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 @@ -15824,9 +16356,9 @@ export interface SecurityRoleDescriptorRead { export interface SecurityRoleMapping { enabled: boolean metadata: Metadata - roles: string[] - rules: SecurityRoleMappingRule + roles?: string[] role_templates?: SecurityRoleTemplate[] + rules: SecurityRoleMappingRule } export interface SecurityRoleMappingRule { @@ -16458,31 +16990,31 @@ export interface SecurityPutUserResponse { created: boolean } -export type SecurityQueryApiKeysAPIKeyAggregate = AggregationsCardinalityAggregate | AggregationsValueCountAggregate | AggregationsStringTermsAggregate | AggregationsLongTermsAggregate | AggregationsDoubleTermsAggregate | AggregationsUnmappedTermsAggregate | AggregationsMultiTermsAggregate | AggregationsMissingAggregate | AggregationsFilterAggregate | AggregationsFiltersAggregate | AggregationsRangeAggregate | AggregationsDateRangeAggregate | AggregationsCompositeAggregate +export type SecurityQueryApiKeysApiKeyAggregate = AggregationsCardinalityAggregate | AggregationsValueCountAggregate | AggregationsStringTermsAggregate | AggregationsLongTermsAggregate | AggregationsDoubleTermsAggregate | AggregationsUnmappedTermsAggregate | AggregationsMultiTermsAggregate | AggregationsMissingAggregate | AggregationsFilterAggregate | AggregationsFiltersAggregate | AggregationsRangeAggregate | AggregationsDateRangeAggregate | AggregationsCompositeAggregate -export interface SecurityQueryApiKeysAPIKeyAggregationContainer { - aggregations?: Record - aggs?: Record +export interface SecurityQueryApiKeysApiKeyAggregationContainer { + aggregations?: Record + aggs?: Record meta?: Metadata cardinality?: AggregationsCardinalityAggregation composite?: AggregationsCompositeAggregation date_range?: AggregationsDateRangeAggregation - filter?: SecurityQueryApiKeysAPIKeyQueryContainer - filters?: SecurityQueryApiKeysAPIKeyFiltersAggregation + filter?: SecurityQueryApiKeysApiKeyQueryContainer + filters?: SecurityQueryApiKeysApiKeyFiltersAggregation missing?: AggregationsMissingAggregation range?: AggregationsRangeAggregation terms?: AggregationsTermsAggregation value_count?: AggregationsValueCountAggregation } -export interface SecurityQueryApiKeysAPIKeyFiltersAggregation extends AggregationsBucketAggregationBase { - filters?: AggregationsBuckets +export interface SecurityQueryApiKeysApiKeyFiltersAggregation extends AggregationsBucketAggregationBase { + filters?: AggregationsBuckets other_bucket?: boolean other_bucket_key?: string keyed?: boolean } -export interface SecurityQueryApiKeysAPIKeyQueryContainer { +export interface SecurityQueryApiKeysApiKeyQueryContainer { bool?: QueryDslBoolQuery exists?: QueryDslExistsQuery ids?: QueryDslIdsQuery @@ -16497,10 +17029,10 @@ export interface SecurityQueryApiKeysAPIKeyQueryContainer { } export interface SecurityQueryApiKeysRequest extends RequestBase { - aggregations?: Record + aggregations?: Record /** @alias aggregations */ - aggs?: Record - query?: SecurityQueryApiKeysAPIKeyQueryContainer + aggs?: Record + query?: SecurityQueryApiKeysApiKeyQueryContainer from?: integer sort?: Sort size?: integer @@ -16511,7 +17043,7 @@ export interface SecurityQueryApiKeysResponse { total: integer count: integer api_keys: SecurityApiKey[] - aggregations?: Record + aggregations?: Record } export interface SecuritySamlAuthenticateRequest extends RequestBase { diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index 4f99171..c93cee9 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -1505,6 +1505,11 @@ export interface SearchLaplaceSmoothingModel { alpha: double } +export interface SearchLearningToRank { + model_id: string + params?: Record +} + export interface SearchLinearInterpolationSmoothingModel { bigram_lambda: double trigram_lambda: double @@ -1604,8 +1609,9 @@ export interface SearchRegexOptions { } export interface SearchRescore { - query: SearchRescoreQuery window_size?: integer + query?: SearchRescoreQuery + learning_to_rank?: SearchLearningToRank } export interface SearchRescoreQuery { @@ -2014,10 +2020,14 @@ export interface SpecUtilsBaseNode { 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 } @@ -2104,9 +2114,9 @@ export type DataStreamNames = DataStreamName | DataStreamName[] export type DateFormat = string -export type DateMath = string +export type DateMath = string | Date -export type DateTime = string | EpochTime +export type DateTime = string | EpochTime | Date export type Distance = string @@ -2337,12 +2347,21 @@ export interface InlineScript extends ScriptBase { export type Ip = string -export interface KnnQuery { +export interface KnnQuery extends QueryDslQueryBase { field: Field query_vector?: QueryVector query_vector_builder?: QueryVectorBuilder - k: long - num_candidates: long + num_candidates?: long + filter?: QueryDslQueryContainer | QueryDslQueryContainer[] + similarity?: float +} + +export interface KnnSearch { + field: Field + query_vector?: QueryVector + query_vector_builder?: QueryVectorBuilder + k?: long + num_candidates?: long boost?: float filter?: QueryDslQueryContainer | QueryDslQueryContainer[] similarity?: float @@ -2464,14 +2483,14 @@ export interface PluginStats { export type PropertyName = string export interface QueryCacheStats { - cache_count: integer - cache_size: integer - evictions: integer - hit_count: integer + cache_count: long + cache_size: long + evictions: long + hit_count: long memory_size?: ByteSize memory_size_in_bytes: long - miss_count: integer - total_count: integer + miss_count: long + total_count: long } export type QueryVector = float[] @@ -2795,7 +2814,7 @@ export interface WktGeoBounds { export interface WriteResponseBase { _id: Id _index: IndexName - _primary_term: long + _primary_term?: long result: Result _seq_no: SequenceNumber _shards: ShardStatistics @@ -2841,8 +2860,6 @@ export interface AggregationsAggregateBase { export type AggregationsAggregateOrder = Partial> | Partial>[] export interface AggregationsAggregation { - meta?: Metadata - name?: string } export interface AggregationsAggregationContainer { @@ -2982,7 +2999,7 @@ export interface AggregationsBoxplotAggregation extends AggregationsMetricAggreg compression?: double } -export interface AggregationsBucketAggregationBase extends AggregationsAggregation { +export interface AggregationsBucketAggregationBase { } export interface AggregationsBucketCorrelationAggregation extends AggregationsBucketPathAggregation { @@ -3013,7 +3030,7 @@ export interface AggregationsBucketMetricValueAggregate extends AggregationsSing keys: string[] } -export interface AggregationsBucketPathAggregation extends AggregationsAggregation { +export interface AggregationsBucketPathAggregation { buckets_path?: AggregationsBucketsPath } @@ -3025,7 +3042,7 @@ export interface AggregationsBucketSelectorAggregation extends AggregationsPipel script?: Script } -export interface AggregationsBucketSortAggregation extends AggregationsAggregation { +export interface AggregationsBucketSortAggregation { from?: integer gap_policy?: AggregationsGapPolicy size?: integer @@ -3050,7 +3067,7 @@ export interface AggregationsCardinalityAggregation extends AggregationsMetricAg export type AggregationsCardinalityExecutionMode = 'global_ordinals' | 'segment_ordinals' | 'direct' | 'save_memory_heuristic' | 'save_time_heuristic' -export interface AggregationsCategorizeTextAggregation extends AggregationsAggregation { +export interface AggregationsCategorizeTextAggregation { field: Field max_unique_tokens?: integer max_matched_tokens?: integer @@ -3232,8 +3249,8 @@ export interface AggregationsEwmaMovingAverageAggregation extends AggregationsMo } export interface AggregationsExtendedBounds { - max: T - min: T + max?: T + min?: T } export interface AggregationsExtendedStatsAggregate extends AggregationsStatsAggregate { @@ -3600,7 +3617,7 @@ export interface AggregationsLongTermsBucketKeys extends AggregationsTermsBucket export type AggregationsLongTermsBucket = AggregationsLongTermsBucketKeys & { [property: string]: AggregationsAggregate | long | string } -export interface AggregationsMatrixAggregation extends AggregationsAggregation { +export interface AggregationsMatrixAggregation { fields?: Fields missing?: Record } @@ -4056,7 +4073,7 @@ export interface AggregationsTTestAggregate extends AggregationsAggregateBase { value_as_string?: string } -export interface AggregationsTTestAggregation extends AggregationsAggregation { +export interface AggregationsTTestAggregation { a?: AggregationsTestPopulation b?: AggregationsTestPopulation type?: AggregationsTTestType @@ -4116,8 +4133,9 @@ export interface AggregationsTopHitsAggregate extends AggregationsAggregateBase } export interface AggregationsTopHitsAggregation extends AggregationsMetricAggregationBase { - docvalue_fields?: Fields + docvalue_fields?: (QueryDslFieldAndFormat | Field)[] explain?: boolean + fields?: (QueryDslFieldAndFormat | Field)[] from?: integer highlight?: SearchHighlight script_fields?: Record @@ -4179,6 +4197,7 @@ export interface AggregationsVariableWidthHistogramAggregation { buckets?: integer shard_size?: integer initial_buffer?: integer + script?: Script } export interface AggregationsVariableWidthHistogramBucketKeys extends AggregationsMultiBucketBase { @@ -4192,7 +4211,7 @@ export interface AggregationsVariableWidthHistogramBucketKeys extends Aggregatio export type AggregationsVariableWidthHistogramBucket = AggregationsVariableWidthHistogramBucketKeys & { [property: string]: AggregationsAggregate | double | string | long } -export interface AggregationsWeightedAverageAggregation extends AggregationsAggregation { +export interface AggregationsWeightedAverageAggregation { format?: string value?: AggregationsWeightedAverageValue value_type?: AggregationsValueType @@ -4328,6 +4347,7 @@ export interface AnalysisFingerprintTokenFilter extends AnalysisTokenFilterBase export interface AnalysisHtmlStripCharFilter extends AnalysisCharFilterBase { type: 'html_strip' + escaped_tags?: string[] } export interface AnalysisHunspellTokenFilter extends AnalysisTokenFilterBase { @@ -4733,6 +4753,7 @@ export interface AnalysisSynonymGraphTokenFilter extends AnalysisTokenFilterBase lenient?: boolean synonyms?: string[] synonyms_path?: string + synonyms_set?: string tokenizer?: string updateable?: boolean } @@ -4744,6 +4765,7 @@ export interface AnalysisSynonymTokenFilter extends AnalysisTokenFilterBase { lenient?: boolean synonyms?: string[] synonyms_path?: string + synonyms_set?: string tokenizer?: string updateable?: boolean } @@ -4954,7 +4976,7 @@ export interface MappingDoubleRangeProperty extends MappingRangePropertyBase { export type MappingDynamicMapping = boolean | 'strict' | 'runtime' | 'true' | 'false' export interface MappingDynamicProperty extends MappingDocValuesPropertyBase { - type: '{dynamic_property}' + type: '{dynamic_type}' enabled?: boolean null_value?: FieldValue boost?: double @@ -5209,7 +5231,7 @@ export interface MappingRuntimeFieldFetchFields { format?: string } -export type MappingRuntimeFieldType = 'boolean' | 'date' | 'double' | 'geo_point' | 'ip' | 'keyword' | 'long' | 'lookup' +export type MappingRuntimeFieldType = 'boolean' | 'composite' | 'date' | 'double' | 'geo_point' | 'ip' | 'keyword' | 'long' | 'lookup' export type MappingRuntimeFields = Record @@ -5706,7 +5728,6 @@ export interface QueryDslMoreLikeThisQuery extends QueryDslQueryBase { minimum_should_match?: MinimumShouldMatch min_term_freq?: integer min_word_length?: integer - per_field_analyzer?: Record routing?: Routing stop_words?: AnalysisStopWords unlike?: QueryDslLike | QueryDslLike[] @@ -5890,7 +5911,7 @@ export interface QueryDslRandomScoreFunction { seed?: long | string } -export type QueryDslRangeQuery = QueryDslDateRangeQuery | QueryDslNumberRangeQuery +export type QueryDslRangeQuery = QueryDslDateRangeQuery | QueryDslNumberRangeQuery | QueryDslTermsRangeQuery export interface QueryDslRangeQueryBase extends QueryDslQueryBase { relation?: QueryDslRangeRelation @@ -6063,6 +6084,15 @@ export type QueryDslTermsQuery = QueryDslTermsQueryKeys export type QueryDslTermsQueryField = FieldValue[] | QueryDslTermsLookup +export interface QueryDslTermsRangeQuery extends QueryDslRangeQueryBase { + gt?: string + gte?: string + lt?: string + lte?: string + from?: string | null + to?: string | null +} + export interface QueryDslTermsSetQuery extends QueryDslQueryBase { minimum_should_match_field?: Field minimum_should_match_script?: Script @@ -8615,12 +8645,13 @@ export interface ClusterPutComponentTemplateRequest 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?: { - allow_auto_create?: boolean template: IndicesIndexState version?: VersionNumber _meta?: Metadata + deprecated?: boolean } } @@ -9014,6 +9045,528 @@ export interface ClusterStatsStatsResponseBase extends NodesNodesResponseBase { timestamp: long } +export interface ConnectorConnector { + api_key_id?: string + configuration: ConnectorConnectorConfiguration + custom_scheduling: ConnectorConnectorCustomScheduling + description?: string + error?: string + features?: ConnectorConnectorFeatures + filtering: ConnectorFilteringConfig[] + id?: Id + index_name?: IndexName + 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_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 + type: ConnectorConnectorFieldType + ui_restrictions: string[] + validations: ConnectorValidation[] + value: ScalarValue +} + +export type ConnectorConnectorConfiguration = Record + +export type ConnectorConnectorCustomScheduling = Record + +export interface ConnectorConnectorFeatures { + document_level_security?: ConnectorFeatureEnabled + filtering_advanced_config?: boolean + filtering_rules?: boolean + incremental_sync?: 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: Record +} + +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: string +} + +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: ScalarValue[] +} + +export interface ConnectorRegexValidation { + type: 'regex' + constraint: string +} + +export interface ConnectorSchedulingConfiguration { + access_control?: ConnectorConnectorScheduling + full?: ConnectorConnectorScheduling + incremental?: ConnectorConnectorScheduling +} + +export interface ConnectorSelectOption { + label: string + value: string +} + +export interface ConnectorSyncJobConnectorReference { + configuration: ConnectorConnectorConfiguration + filtering: ConnectorFilteringRules + id: Id + index_name: string + language?: string + pipeline?: ConnectorIngestPipelineParams + service_type: string +} + +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?: SpecUtilsWithNullValue + 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?: SpecUtilsWithNullValue + last_sync_error?: SpecUtilsWithNullValue + last_sync_scheduled_at?: DateTime + last_sync_status?: ConnectorSyncStatus + last_synced?: DateTime + } +} + +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: SpecUtilsWithNullValue + is_native?: boolean + language?: string + name?: string + service_type?: string + } +} + +export interface ConnectorPostResponse { + 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: SpecUtilsWithNullValue + is_native?: boolean + language?: string + name?: string + service_type?: string + } +} + +export interface ConnectorPutResponse { + result: Result +} + +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[] +} + +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?: SpecUtilsWithNullValue + api_key_secret_id?: SpecUtilsWithNullValue + } +} + +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 @@ -9213,6 +9766,12 @@ export type EqlSearchResponse = EqlEqlSearchResponseBase origination_date?: long parse_origination_date?: boolean @@ -10732,15 +11292,20 @@ export interface IndicesPutIndexTemplateIndexTemplateMapping { 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?: integer + priority?: long version?: VersionNumber _meta?: Metadata + allow_auto_create?: boolean + ignore_missing_component_templates?: string[] + deprecated?: boolean } } @@ -10790,9 +11355,8 @@ export type IndicesPutSettingsResponse = AcknowledgedResponseBase export interface IndicesPutTemplateRequest extends RequestBase { name: Name create?: boolean - flat_settings?: boolean master_timeout?: Duration - 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 @@ -11142,22 +11706,12 @@ export interface IndicesShrinkResponse { export interface IndicesSimulateIndexTemplateRequest 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?: { - allow_auto_create?: boolean - index_patterns?: Indices - composed_of?: Name[] - template?: IndicesPutIndexTemplateIndexTemplateMapping - data_stream?: IndicesDataStreamVisibility - priority?: integer - version?: VersionNumber - _meta?: Metadata - } } export interface IndicesSimulateIndexTemplateResponse { + overlapping?: IndicesSimulateTemplateOverlapping[] + template: IndicesSimulateTemplateTemplate } export interface IndicesSimulateTemplateOverlapping { @@ -11169,8 +11723,19 @@ export interface IndicesSimulateTemplateRequest extends RequestBase { name?: Name create?: boolean master_timeout?: Duration - /** @deprecated The use of the 'body' key has been deprecated, use 'template' instead. */ - body?: IndicesIndexTemplate + /** @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 { @@ -11445,27 +12010,39 @@ export interface IndicesValidateQueryResponse { error?: string } +export interface InferenceCompletionResult { + result: string +} + export type InferenceDenseByteVector = byte[] export type InferenceDenseVector = float[] -export interface InferenceInferenceResult { - text_embedding_bytes?: InferenceTextEmbeddingByteResult[] - text_embedding?: InferenceTextEmbeddingResult[] - sparse_embedding?: InferenceSparseEmbeddingResult[] -} - -export interface InferenceModelConfig { +export interface InferenceInferenceEndpoint { service: string service_settings: InferenceServiceSettings task_settings: InferenceTaskSettings } -export interface InferenceModelConfigContainer extends InferenceModelConfig { - model_id: string +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 { @@ -11476,7 +12053,7 @@ export type InferenceSparseVector = Record export type InferenceTaskSettings = any -export type InferenceTaskType = 'sparse_embedding' | 'text_embedding' +export type InferenceTaskType = 'sparse_embedding' | 'text_embedding' | 'rerank' | 'completion' export interface InferenceTextEmbeddingByteResult { embedding: InferenceDenseByteVector @@ -11486,27 +12063,29 @@ export interface InferenceTextEmbeddingResult { embedding: InferenceDenseVector } -export interface InferenceDeleteModelRequest extends RequestBase { +export interface InferenceDeleteRequest extends RequestBase { task_type?: InferenceTaskType inference_id: Id } -export type InferenceDeleteModelResponse = AcknowledgedResponseBase +export type InferenceDeleteResponse = AcknowledgedResponseBase -export interface InferenceGetModelRequest extends RequestBase { +export interface InferenceGetRequest extends RequestBase { task_type?: InferenceTaskType - inference_id: Id + inference_id?: Id } -export interface InferenceGetModelResponse { - models: InferenceModelConfigContainer[] +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 } @@ -11514,14 +12093,14 @@ export interface InferenceInferenceRequest extends RequestBase { export type InferenceInferenceResponse = InferenceInferenceResult -export interface InferencePutModelRequest extends RequestBase { +export interface InferencePutRequest extends RequestBase { task_type?: InferenceTaskType inference_id: Id - /** @deprecated The use of the 'body' key has been deprecated, use 'model_config' instead. */ - body?: InferenceModelConfig + /** @deprecated The use of the 'body' key has been deprecated, use 'inference_config' instead. */ + body?: InferenceInferenceEndpoint } -export type InferencePutModelResponse = InferenceModelConfigContainer +export type InferencePutResponse = InferenceInferenceEndpointInfo export interface IngestAppendProcessor extends IngestProcessorBase { field: Field @@ -16073,7 +16652,7 @@ export interface SecurityClusterNode { name: Name } -export type SecurityClusterPrivilege = 'all' | 'cancel_task' | 'create_snapshot' | 'grant_api_key' | 'manage' | 'manage_api_key' | 'manage_ccr' | 'manage_enrich' | 'manage_ilm' | 'manage_index_templates' | 'manage_ingest_pipelines' | 'manage_logstash_pipelines' | 'manage_ml' | 'manage_oidc' | 'manage_own_api_key' | 'manage_pipeline' | 'manage_rollup' | 'manage_saml' | 'manage_security' | 'manage_service_account' | 'manage_slm' | 'manage_token' | 'manage_transform' | 'manage_user_profile' | 'manage_watcher' | 'monitor' | 'monitor_ml' | 'monitor_rollup' | 'monitor_snapshot' | 'monitor_text_structure' | 'monitor_transform' | 'monitor_watcher' | 'read_ccr' | 'read_ilm' | 'read_pipeline' | 'read_slm' | 'transport_client' | string +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_text_structure' | 'monitor_transform' | 'monitor_watcher' | 'none' | 'post_behavioral_analytics_event' | 'read_ccr' | 'read_connector_secrets' | '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 @@ -16096,7 +16675,7 @@ export interface SecurityGlobalPrivilege { export type SecurityGrantType = 'password' | 'access_token' -export type SecurityIndexPrivilege = 'none' | 'all' | 'auto_configure' | 'create' | 'create_doc' | 'create_index' | 'delete' | 'delete_index' | 'index' | 'maintenance' | 'manage' | 'manage_follow_index' | 'manage_ilm' | 'manage_leader_index' | 'monitor' | 'read' | 'read_cross_cluster' | 'view_index_metadata' | 'write' | string +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 @@ -16142,9 +16721,9 @@ export interface SecurityRoleDescriptorRead { export interface SecurityRoleMapping { enabled: boolean metadata: Metadata - roles: string[] - rules: SecurityRoleMappingRule + roles?: string[] role_templates?: SecurityRoleTemplate[] + rules: SecurityRoleMappingRule } export interface SecurityRoleMappingRule { @@ -16814,31 +17393,31 @@ export interface SecurityPutUserResponse { created: boolean } -export type SecurityQueryApiKeysAPIKeyAggregate = AggregationsCardinalityAggregate | AggregationsValueCountAggregate | AggregationsStringTermsAggregate | AggregationsLongTermsAggregate | AggregationsDoubleTermsAggregate | AggregationsUnmappedTermsAggregate | AggregationsMultiTermsAggregate | AggregationsMissingAggregate | AggregationsFilterAggregate | AggregationsFiltersAggregate | AggregationsRangeAggregate | AggregationsDateRangeAggregate | AggregationsCompositeAggregate +export type SecurityQueryApiKeysApiKeyAggregate = AggregationsCardinalityAggregate | AggregationsValueCountAggregate | AggregationsStringTermsAggregate | AggregationsLongTermsAggregate | AggregationsDoubleTermsAggregate | AggregationsUnmappedTermsAggregate | AggregationsMultiTermsAggregate | AggregationsMissingAggregate | AggregationsFilterAggregate | AggregationsFiltersAggregate | AggregationsRangeAggregate | AggregationsDateRangeAggregate | AggregationsCompositeAggregate -export interface SecurityQueryApiKeysAPIKeyAggregationContainer { - aggregations?: Record - aggs?: Record +export interface SecurityQueryApiKeysApiKeyAggregationContainer { + aggregations?: Record + aggs?: Record meta?: Metadata cardinality?: AggregationsCardinalityAggregation composite?: AggregationsCompositeAggregation date_range?: AggregationsDateRangeAggregation - filter?: SecurityQueryApiKeysAPIKeyQueryContainer - filters?: SecurityQueryApiKeysAPIKeyFiltersAggregation + filter?: SecurityQueryApiKeysApiKeyQueryContainer + filters?: SecurityQueryApiKeysApiKeyFiltersAggregation missing?: AggregationsMissingAggregation range?: AggregationsRangeAggregation terms?: AggregationsTermsAggregation value_count?: AggregationsValueCountAggregation } -export interface SecurityQueryApiKeysAPIKeyFiltersAggregation extends AggregationsBucketAggregationBase { - filters?: AggregationsBuckets +export interface SecurityQueryApiKeysApiKeyFiltersAggregation extends AggregationsBucketAggregationBase { + filters?: AggregationsBuckets other_bucket?: boolean other_bucket_key?: string keyed?: boolean } -export interface SecurityQueryApiKeysAPIKeyQueryContainer { +export interface SecurityQueryApiKeysApiKeyQueryContainer { bool?: QueryDslBoolQuery exists?: QueryDslExistsQuery ids?: QueryDslIdsQuery @@ -16855,10 +17434,10 @@ export interface SecurityQueryApiKeysAPIKeyQueryContainer { export interface SecurityQueryApiKeysRequest extends RequestBase { /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ body?: { - aggregations?: Record + aggregations?: Record /** @alias aggregations */ - aggs?: Record - query?: SecurityQueryApiKeysAPIKeyQueryContainer + aggs?: Record + query?: SecurityQueryApiKeysApiKeyQueryContainer from?: integer sort?: Sort size?: integer @@ -16870,7 +17449,7 @@ export interface SecurityQueryApiKeysResponse { total: integer count: integer api_keys: SecurityApiKey[] - aggregations?: Record + aggregations?: Record } export interface SecuritySamlAuthenticateRequest extends RequestBase { diff --git a/test/integration/index.js b/test/integration/index.js index b68aea4..62d9ddf 100644 --- a/test/integration/index.js +++ b/test/integration/index.js @@ -58,6 +58,19 @@ const skips = { // TODO: expects {"outlier_detection.auc_roc.value":0.99995}, gets {"outlier_detection.auc_roc.value":0.5} // remove if/when https://github.com/elastic/elasticsearch-clients-tests/issues/37 is resolved 'machine_learning/data_frame_evaluate.yml': ['*'], + // TODO: wait_for_active_shards and rollover with conditions are not supported on serverless + // see https://github.com/elastic/elasticsearch-clients-tests/issues/55 + 'indices/rollover.yml': ['*'], + // TODO: test runner needs to support ignoring 410 errors + 'indices/data_lifecycle.yml': ['*'], + // TODO: test runner needs to support ignoring 410 errors + 'enrich/10_basic.yml': ['*'], + // TODO: parameter `enabled` is not allowed in source + // Same underlying problem as https://github.com/elastic/elasticsearch-clients-tests/issues/55 + 'cluster/component_templates.yml': ['*'], + // TODO: expecting `ct_field` field mapping to be returned, but instead only finds `field` + 'indices/simulate_template.yml': ['*'], + 'indices/simulate_index_template.yml': ['*'], } const shouldSkip = (file, name) => { @@ -132,9 +145,9 @@ async function start ({ client }) { const fileTime = now() const data = readFileSync(file, 'utf8') - // get the test yaml (as object), some file has multiple yaml documents inside, - // every document is separated by '---', so we split on the separator - // and then we remove the empty strings, finally we parse them + // get the test yaml as an object. files have multiple YAML documents inside, + // separated by '---', so we split on the separator and remove the empty strings + // before parsing them const tests = data .split('\n---\n') .map(s => s.trim()) @@ -144,12 +157,14 @@ async function start ({ client }) { // null values .filter(Boolean) - // get setup and teardown if present + // get setup, teardown and requires rules if present let setupTest = null let teardownTest = null + let requires = null for (const test of tests) { if (test.setup) setupTest = test.setup if (test.teardown) teardownTest = test.teardown + if (test.requires) requires = test.requires } const cleanPath = file.slice(file.lastIndexOf(apiName)) @@ -157,6 +172,9 @@ async function start ({ client }) { // skip if --suite CLI arg doesn't match if (options.suite && !cleanPath.endsWith(options.suite)) continue + // skip if `requires.serverless` is not true + if (typeof requires === 'object' && requires.serverless != true) continue + const junitTestSuite = junitTestSuites.testsuite(apiName.slice(1) + ' - ' + cleanPath) for (const test of tests) { @@ -164,7 +182,7 @@ async function start ({ client }) { const name = Object.keys(test)[0] // skip setups, teardowns and anything that doesn't match --test flag when present - if (name === 'setup' || name === 'teardown') continue + if (name === 'setup' || name === 'teardown' || name === 'requires') continue if (options.test && !name.endsWith(options.test)) continue const junitTestCase = junitTestSuite.testcase(name, `node_${process.version}: ${cleanPath}`) diff --git a/test/integration/test-runner.js b/test/integration/test-runner.js index a104271..64b1cd6 100644 --- a/test/integration/test-runner.js +++ b/test/integration/test-runner.js @@ -308,10 +308,14 @@ function build (opts = {}) { if (JSON.stringify(exc).includes('resource_already_exists_exception')) { console.warn(`Resource already exists: ${JSON.stringify(cmd.params)}`) // setup task was already done because cleanup didn't catch it? do nothing + } else if (JSON.stringify(exc).includes('api_not_available_exception')) { + // 410 api_not_available_exception should be ignored + console.warn(`API not available on serverless: ${cmd.method}`) } else { throw exc } } + let warnings = result ? result.warnings : null const body = result ? result.body : null @@ -881,6 +885,7 @@ async function deleteIndices(client) { .trim() .split('\n') .map(row => row.split(' ')[2]) + .filter(Boolean) .filter(name => !name.startsWith('.')) if (indexNames.length > 0) { await client.indices.delete({