diff --git a/compiler/model/metamodel.ts b/compiler/model/metamodel.ts index 4dc46436da..9c77b7617f 100644 --- a/compiler/model/metamodel.ts +++ b/compiler/model/metamodel.ts @@ -160,6 +160,14 @@ export abstract class BaseType { kind: string /** Variant name for externally tagged variants */ variantName?: string + /** + * Additional identifiers for use by code generators. Usage depends on the actual type: + * - on unions (modeled as alias(union_of)), these are identifiers for the union members + * - for additional properties, this is the name of the dict that holds these properties + * - for additional property, this is the name of the key and value fields that hold the + * additional property + */ + codegenNames?: string[] } export type Variants = ExternalTag | InternalTag | Container diff --git a/compiler/model/utils.ts b/compiler/model/utils.ts index b11ab61522..353efffc5a 100644 --- a/compiler/model/utils.ts +++ b/compiler/model/utils.ts @@ -627,7 +627,7 @@ export function hoistTypeAnnotations (type: model.TypeDefinition, jsDocs: JSDoc[ // We want to enforce a single jsDoc block. assert(jsDocs, jsDocs.length < 2, 'Use a single multiline jsDoc block instead of multiple single line blocks') - const validTags = ['class_serializer', 'doc_url', 'behavior', 'variants', 'variant', 'shortcut_property'] + const validTags = ['class_serializer', 'doc_url', 'behavior', 'variants', 'variant', 'shortcut_property', 'codegen_names'] const tags = parseJsDocTags(jsDocs) if (jsDocs.length === 1) { const description = jsDocs[0].getDescription() @@ -648,6 +648,12 @@ export function hoistTypeAnnotations (type: model.TypeDefinition, jsDocs: JSDoc[ } else if (tag === 'doc_url') { assert(jsDocs, isValidUrl(value), '@doc_url is not a valid url') type.docUrl = value + } else if (tag === 'codegen_names') { + type.codegenNames = value.split(',').map(v => v.trim()) + assert(jsDocs, + type.kind === 'type_alias' && type.type.kind === 'union_of' && type.type.items.length === type.codegenNames.length, + '@codegen_names must have the number of items as the union definition' + ) } else { assert(jsDocs, false, `Unhandled tag: '${tag}' with value: '${value}' on type ${type.name.name}`) } diff --git a/output/schema/schema.json b/output/schema/schema.json index 3b2cce6eac..3619221e6b 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -13586,23 +13586,11 @@ "name": "_source", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Fields", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "GetSourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -15153,23 +15141,11 @@ "name": "_source", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Fields", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "GetSourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -15695,23 +15671,11 @@ "name": "_source", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Fields", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "GetSourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -15897,23 +15861,11 @@ "name": "_source", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Fields", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "GetSourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -16226,23 +16178,11 @@ "name": "_source", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Fields", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "GetSourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -16791,23 +16731,11 @@ "name": "_source", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Fields", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "GetSourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -17468,23 +17396,11 @@ "name": "_source", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Fields", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "GetSourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -18096,30 +18012,11 @@ "name": "_source", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Fields", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "SourceFilter", - "namespace": "_global.search._types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "SourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -18297,23 +18194,11 @@ "name": "_source", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Fields", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "GetSourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -18475,57 +18360,22 @@ "name": "track_total_hits", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "TrackHits", + "namespace": "_global.search._types" + } } }, { "name": "suggest", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "SuggestContainer", - "namespace": "_global.search._types" - } - }, - { - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "SuggestContainer", - "namespace": "_global.search._types" - } - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "Suggester", + "namespace": "_global.search._types" + } } } ] @@ -19782,7 +19632,7 @@ "properties": [ { "name": "script", - "required": false, + "required": true, "type": { "kind": "instance_of", "type": { @@ -22075,23 +21925,11 @@ "name": "track_total_hits", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "TrackHits", + "namespace": "_global.search._types" + } } }, { @@ -22125,38 +21963,14 @@ "name": "docvalue_fields", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "DocValueField", - "namespace": "_global.search._types" - } - }, - { - "kind": "array_of", - "value": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "Field", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "DocValueField", - "namespace": "_global.search._types" - } - } - ], - "kind": "union_of" - } + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "FieldAndFormat", + "namespace": "_types.query_dsl" } - ], - "kind": "union_of" + } } }, { @@ -22306,30 +22120,11 @@ "name": "_source", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Fields", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "SourceFilter", - "namespace": "_global.search._types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "SourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -22339,23 +22134,11 @@ "type": { "kind": "array_of", "value": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "Field", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "DateField", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "FieldAndFormat", + "namespace": "_types.query_dsl" + } } } }, @@ -22363,34 +22146,11 @@ "name": "suggest", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "SuggestContainer", - "namespace": "_global.search._types" - } - }, - { - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "SuggestContainer", - "namespace": "_global.search._types" - } - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "Suggester", + "namespace": "_global.search._types" + } } }, { @@ -22916,23 +22676,11 @@ "name": "track_total_hits", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "TrackHits", + "namespace": "_global.search._types" + } } }, { @@ -22988,23 +22736,11 @@ "name": "_source", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Fields", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "GetSourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -23944,6 +23680,25 @@ "namespace": "_global.search._types" } }, + { + "kind": "enum", + "members": [ + { + "name": "plain" + }, + { + "codegenName": "fast_vector", + "name": "fvh" + }, + { + "name": "unified" + } + ], + "name": { + "name": "BuiltinHighlighterType", + "namespace": "_global.search._types" + } + }, { "kind": "interface", "name": { @@ -24000,6 +23755,74 @@ } ] }, + { + "kind": "interface", + "name": { + "name": "CompletionContext", + "namespace": "_global.search._types" + }, + "properties": [ + { + "name": "boost", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + } + }, + { + "name": "context", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Context", + "namespace": "_global.search._types" + } + } + }, + { + "name": "neighbours", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "GeoHashPrecision", + "namespace": "_types" + } + } + } + }, + { + "name": "precision", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "GeoHashPrecision", + "namespace": "_types" + } + } + }, + { + "name": "prefix", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "internal" + } + } + } + ], + "shortcutProperty": "context" + }, { "generics": [ { @@ -24166,8 +23989,8 @@ "key": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "internal" + "name": "Field", + "namespace": "_types" } }, "kind": "dictionary_of", @@ -24177,25 +24000,8 @@ { "kind": "instance_of", "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - }, - { - "kind": "instance_of", - "type": { - "name": "GeoLocation", - "namespace": "_types.query_dsl" + "name": "CompletionContext", + "namespace": "_global.search._types" } }, { @@ -24203,7 +24009,7 @@ "value": { "kind": "instance_of", "type": { - "name": "SuggestContextQuery", + "name": "CompletionContext", "namespace": "_global.search._types" } } @@ -24260,7 +24066,11 @@ ] }, { - "description": "Text that we want similar documents for or a lookup to a document's field for the text.", + "codegenNames": [ + "category", + "location" + ], + "description": "Text or location that we want similar documents for or a lookup to a document's field for the text.", "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html#_document_input_parameters", "kind": "type_alias", "name": { @@ -24280,7 +24090,7 @@ "kind": "instance_of", "type": { "name": "GeoLocation", - "namespace": "_types.query_dsl" + "namespace": "_types" } } ], @@ -24417,37 +24227,6 @@ } ] }, - { - "kind": "interface", - "name": { - "name": "DocValueField", - "namespace": "_global.search._types" - }, - "properties": [ - { - "name": "field", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "Field", - "namespace": "_types" - } - } - }, - { - "name": "format", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - } - ] - }, { "kind": "interface", "name": { @@ -24635,49 +24414,6 @@ } ] }, - { - "kind": "interface", - "name": { - "name": "FieldAndFormat", - "namespace": "_global.search._types" - }, - "properties": [ - { - "name": "field", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "Field", - "namespace": "_types" - } - } - }, - { - "name": "format", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - }, - { - "name": "include_unmapped", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - } - } - ], - "shortcutProperty": "field" - }, { "kind": "interface", "name": { @@ -24796,8 +24532,130 @@ "namespace": "_types.mapping" } } + }, + { + "name": "numeric_type", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "FieldSortNumericType", + "namespace": "_global.search._types" + } + } + }, + { + "name": "format", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } } - ] + ], + "shortcutProperty": "order" + }, + { + "kind": "enum", + "members": [ + { + "name": "long" + }, + { + "name": "double" + }, + { + "name": "date" + }, + { + "name": "date_nanos" + } + ], + "name": { + "name": "FieldSortNumericType", + "namespace": "_global.search._types" + } + }, + { + "kind": "interface", + "name": { + "name": "FieldSuggester", + "namespace": "_global.search._types" + }, + "properties": [ + { + "name": "completion", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "CompletionSuggester", + "namespace": "_global.search._types" + } + } + }, + { + "name": "phrase", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "PhraseSuggester", + "namespace": "_global.search._types" + } + } + }, + { + "name": "prefix", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } + }, + { + "name": "regex", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } + }, + { + "name": "term", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "TermSuggester", + "namespace": "_global.search._types" + } + } + }, + { + "name": "text", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } + } + ], + "variants": { + "kind": "container" + } }, { "attachedBehaviors": [ @@ -24819,7 +24677,7 @@ "kind": "instance_of", "type": { "name": "GeoLocation", - "namespace": "_types.query_dsl" + "namespace": "_types" } }, { @@ -24828,7 +24686,7 @@ "kind": "instance_of", "type": { "name": "GeoLocation", - "namespace": "_types.query_dsl" + "namespace": "_types" } } } @@ -24870,6 +24728,17 @@ } } }, + { + "name": "ignore_unmapped", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "internal" + } + } + }, { "name": "order", "required": false, @@ -24894,6 +24763,36 @@ } ] }, + { + "codegenNames": [ + "fetch", + "fields" + ], + "kind": "type_alias", + "name": { + "name": "GetSourceConfig", + "namespace": "_global.search._types" + }, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "internal" + } + }, + { + "kind": "instance_of", + "type": { + "name": "Fields", + "namespace": "_types" + } + } + ], + "kind": "union_of" + } + }, { "kind": "interface", "name": { @@ -25389,23 +25288,11 @@ "name": "type", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "HighlighterType", - "namespace": "_global.search._types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "HighlighterType", + "namespace": "_global.search._types" + } } } ] @@ -25465,21 +25352,33 @@ } }, { - "kind": "enum", - "members": [ - { - "name": "plain" - }, - { - "name": "fvh" - }, - { - "name": "unified" - } + "codegenNames": [ + "builtin", + "custom" ], + "kind": "type_alias", "name": { "name": "HighlighterType", "namespace": "_global.search._types" + }, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "BuiltinHighlighterType", + "namespace": "_global.search._types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } + ], + "kind": "union_of" } }, { @@ -25876,7 +25775,7 @@ "kind": "instance_of", "type": { "name": "FieldAndFormat", - "namespace": "_global.search._types" + "namespace": "_types.query_dsl" } } } @@ -25973,23 +25872,11 @@ "name": "_source", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "SourceFilter", - "namespace": "_global.search._types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "SourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -26031,90 +25918,22 @@ { "kind": "interface", "name": { - "name": "InnerHitsMetadata", + "name": "InnerHitsResult", "namespace": "_global.search._types" }, "properties": [ { - "name": "total", + "name": "hits", "required": true, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "TotalHits", - "namespace": "_global.search._types" - } - }, + "generics": [ { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } + "kind": "user_defined_value" } ], - "kind": "union_of" - } - }, - { - "name": "hits", - "required": true, - "type": { - "kind": "array_of", - "value": { - "generics": [ - { - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "user_defined_value" - } - } - ], - "kind": "instance_of", - "type": { - "name": "Hit", - "namespace": "_global.search._types" - } - } - } - }, - { - "name": "max_score", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - } - ] - }, - { - "kind": "interface", - "name": { - "name": "InnerHitsResult", - "namespace": "_global.search._types" - }, - "properties": [ - { - "name": "hits", - "required": true, - "type": { "kind": "instance_of", "type": { - "name": "InnerHitsMetadata", + "name": "HitsMetadata", "namespace": "_global.search._types" } } @@ -26254,6 +26073,17 @@ } } }, + { + "name": "nested", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "NestedSortValue", + "namespace": "_global.search._types" + } + } + }, { "name": "path", "required": true, @@ -27025,17 +26855,6 @@ "namespace": "_global.search._types" }, "properties": [ - { - "name": "mode", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "SortMode", - "namespace": "_global.search._types" - } - } - }, { "name": "order", "required": false, @@ -27084,13 +26903,50 @@ "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "internal" + "name": "ScriptSortType", + "namespace": "_global.search._types" + } + } + }, + { + "name": "mode", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "SortMode", + "namespace": "_global.search._types" + } + } + }, + { + "name": "nested", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "NestedSortValue", + "namespace": "_global.search._types" } } } ] }, + { + "kind": "enum", + "members": [ + { + "name": "string" + }, + { + "name": "number" + } + ], + "name": { + "name": "ScriptSortType", + "namespace": "_global.search._types" + } + }, { "kind": "interface", "name": { @@ -27273,6 +27129,10 @@ } }, { + "codegenNames": [ + "field", + "options" + ], "kind": "type_alias", "name": { "name": "SortCombinations", @@ -27290,14 +27150,7 @@ { "kind": "instance_of", "type": { - "name": "SortContainer", - "namespace": "_global.search._types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "SortOrder", + "name": "SortOptions", "namespace": "_global.search._types" } } @@ -27305,9 +27158,33 @@ "kind": "union_of" } }, + { + "kind": "enum", + "members": [ + { + "name": "min" + }, + { + "name": "max" + }, + { + "name": "sum" + }, + { + "name": "avg" + }, + { + "name": "median" + } + ], + "name": { + "name": "SortMode", + "namespace": "_global.search._types" + } + }, { "attachedBehaviors": [ - "AdditionalProperties" + "AdditionalProperty" ], "behaviors": [ { @@ -27320,34 +27197,23 @@ } }, { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "FieldSort", - "namespace": "_global.search._types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "SortOrder", - "namespace": "_global.search._types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "FieldSort", + "namespace": "_global.search._types" + } } ], "type": { - "name": "AdditionalProperties", + "name": "AdditionalProperty", "namespace": "_spec_utils" } } ], + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/current/sort-search-results.html", "kind": "interface", "name": { - "name": "SortContainer", + "name": "SortOptions", "namespace": "_global.search._types" }, "properties": [ @@ -27395,30 +27261,9 @@ } } } - ] - }, - { - "kind": "enum", - "members": [ - { - "name": "min" - }, - { - "name": "max" - }, - { - "name": "sum" - }, - { - "name": "avg" - }, - { - "name": "median" - } ], - "name": { - "name": "SortMode", - "namespace": "_global.search._types" + "variants": { + "kind": "container" } }, { @@ -27429,10 +27274,6 @@ }, { "name": "desc" - }, - { - "codegenName": "Document", - "name": "_doc" } ], "name": { @@ -27484,36 +27325,48 @@ } }, { - "kind": "interface", + "codegenNames": [ + "fetch", + "filter" + ], + "description": "Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.", + "kind": "type_alias", "name": { - "name": "SourceFilter", + "name": "SourceConfig", "namespace": "_global.search._types" }, - "properties": [ - { - "name": "excludes", - "required": false, - "type": { + "type": { + "items": [ + { "kind": "instance_of", "type": { - "name": "Fields", - "namespace": "_types" + "name": "boolean", + "namespace": "internal" } - } - }, - { - "name": "includes", - "required": false, - "type": { + }, + { "kind": "instance_of", "type": { - "name": "Fields", - "namespace": "_types" + "name": "SourceFilter", + "namespace": "_global.search._types" } } - }, + ], + "kind": "union_of" + } + }, + { + "kind": "interface", + "name": { + "name": "SourceFilter", + "namespace": "_global.search._types" + }, + "properties": [ { - "name": "exclude", + "aliases": [ + "exclude" + ], + "name": "excludes", "required": false, "type": { "kind": "instance_of", @@ -27524,7 +27377,10 @@ } }, { - "name": "include", + "aliases": [ + "include" + ], + "name": "includes", "required": false, "type": { "kind": "instance_of", @@ -27534,7 +27390,8 @@ } } } - ] + ], + "shortcutProperty": "includes" }, { "kind": "enum", @@ -27651,178 +27508,6 @@ } ] }, - { - "kind": "interface", - "name": { - "name": "SuggestContainer", - "namespace": "_global.search._types" - }, - "properties": [ - { - "name": "completion", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "CompletionSuggester", - "namespace": "_global.search._types" - } - } - }, - { - "name": "phrase", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "PhraseSuggester", - "namespace": "_global.search._types" - } - } - }, - { - "name": "prefix", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - }, - { - "name": "regex", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - }, - { - "name": "term", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TermSuggester", - "namespace": "_global.search._types" - } - } - }, - { - "name": "text", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - } - ], - "variants": { - "kind": "container" - } - }, - { - "kind": "interface", - "name": { - "name": "SuggestContextQuery", - "namespace": "_global.search._types" - }, - "properties": [ - { - "name": "boost", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - }, - { - "name": "context", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "Context", - "namespace": "_global.search._types" - } - } - }, - { - "name": "neighbours", - "required": false, - "type": { - "items": [ - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "Distance", - "namespace": "_types" - } - } - }, - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - } - ], - "kind": "union_of" - } - }, - { - "name": "precision", - "required": false, - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "Distance", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - ], - "kind": "union_of" - } - }, - { - "name": "prefix", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - } - } - ] - }, { "kind": "interface", "name": { @@ -27888,6 +27573,11 @@ ] }, { + "codegenNames": [ + "completion", + "phrase", + "term" + ], "generics": [ { "name": "TDocument", @@ -27950,6 +27640,54 @@ "namespace": "_global.search._types" } }, + { + "attachedBehaviors": [ + "AdditionalProperties" + ], + "behaviors": [ + { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + }, + { + "kind": "instance_of", + "type": { + "name": "FieldSuggester", + "namespace": "_global.search._types" + } + } + ], + "type": { + "name": "AdditionalProperties", + "namespace": "_spec_utils" + } + } + ], + "kind": "interface", + "name": { + "name": "Suggester", + "namespace": "_global.search._types" + }, + "properties": [ + { + "description": "Global suggest text, to avoid repetition when the same text is used in several suggesters", + "name": "text", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } + } + ] + }, { "kind": "interface", "name": { @@ -28229,6 +27967,37 @@ "namespace": "_global.search._types" } }, + { + "codegenNames": [ + "enabled", + "count" + ], + "description": "Number of hits matching the query to count accurately. If true, the exact\nnumber of hits is returned at the cost of some performance. If false, the\nresponse does not include the total number of hits matching the query.\nDefaults to 10,000 hits.", + "kind": "type_alias", + "name": { + "name": "TrackHits", + "namespace": "_global.search._types" + }, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "internal" + } + }, + { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + ], + "kind": "union_of" + } + }, { "attachedBehaviors": [ "CommonQueryParameters" @@ -30029,23 +29798,11 @@ "required": false, "serverDefault": "true", "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "SourceFilter", - "namespace": "_global.search._types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "SourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -30243,23 +30000,11 @@ "required": false, "serverDefault": "true", "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Fields", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "GetSourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -30719,23 +30464,11 @@ "name": "_source", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Fields", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "GetSourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -31276,6 +31009,27 @@ } } }, + { + "kind": "enum", + "members": [ + { + "name": "painless" + }, + { + "name": "expression" + }, + { + "name": "mustache" + }, + { + "name": "java" + } + ], + "name": { + "name": "BuiltinScriptLanguage", + "namespace": "_types" + } + }, { "kind": "interface", "name": { @@ -31655,6 +31409,59 @@ "namespace": "_types" } }, + { + "kind": "interface", + "name": { + "name": "CoordsGeoBounds", + "namespace": "_types" + }, + "properties": [ + { + "name": "top", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + } + }, + { + "name": "bottom", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + } + }, + { + "name": "left", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + } + }, + { + "name": "right", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + } + } + ] + }, { "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-data-stream.html#indices-create-data-stream-api-path-params", "kind": "type_alias", @@ -31699,49 +31506,6 @@ "kind": "union_of" } }, - { - "description": "A reference to a date field with formatting instructions on how to return the date", - "kind": "interface", - "name": { - "name": "DateField", - "namespace": "_types" - }, - "properties": [ - { - "name": "field", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "Field", - "namespace": "_types" - } - } - }, - { - "name": "format", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - }, - { - "name": "include_unmapped", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - } - } - ] - }, { "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/7.x/mapping-date-format.html", "kind": "type_alias", @@ -32230,7 +31994,7 @@ } ], "name": { - "name": "ExpandWildcardOptions", + "name": "ExpandWildcard", "namespace": "_types" } }, @@ -32245,7 +32009,7 @@ { "kind": "instance_of", "type": { - "name": "ExpandWildcardOptions", + "name": "ExpandWildcard", "namespace": "_types" } }, @@ -32254,17 +32018,10 @@ "value": { "kind": "instance_of", "type": { - "name": "ExpandWildcardOptions", + "name": "ExpandWildcard", "namespace": "_types" } } - }, - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } } ], "kind": "union_of" @@ -32347,6 +32104,53 @@ } ] }, + { + "codegenNames": [ + "long", + "double", + "string", + "boolean" + ], + "description": "A field value.", + "kind": "type_alias", + "name": { + "name": "FieldValue", + "namespace": "_types" + }, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + }, + { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "internal" + } + } + ], + "kind": "union_of" + } + }, { "kind": "interface", "name": { @@ -32519,6 +32323,53 @@ "kind": "union_of" } }, + { + "codegenNames": [ + "coords", + "tlbr", + "trbl", + "wkt" + ], + "description": "A geo bounding box. It can be represented in various ways:\n- as 4 top/bottom/left/right coordinates\n- as 2 top_left / bottom_right points\n- as 2 top_right / bottom_left points\n- as a WKT bounding box", + "kind": "type_alias", + "name": { + "name": "GeoBounds", + "namespace": "_types" + }, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "CoordsGeoBounds", + "namespace": "_types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "TopLeftBottomRightGeoBounds", + "namespace": "_types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "TopRightBottomLeftGeoBounds", + "namespace": "_types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "WktGeoBounds", + "namespace": "_types" + } + } + ], + "kind": "union_of" + } + }, { "kind": "enum", "members": [ @@ -32549,17 +32400,54 @@ } }, { + "kind": "interface", + "name": { + "name": "GeoHashLocation", + "namespace": "_types" + }, + "properties": [ + { + "name": "geohash", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "GeoHash", + "namespace": "_types" + } + } + } + ] + }, + { + "codegenNames": [ + "geohash_length", + "distance" + ], + "description": "A precision that can be expressed as a geohash length between 1 and 12, or a distance measure like \"1km\", \"10m\".", "kind": "type_alias", "name": { "name": "GeoHashPrecision", "namespace": "_types" }, "type": { - "kind": "instance_of", - "type": { - "name": "number", - "namespace": "internal" - } + "items": [ + { + "kind": "instance_of", + "type": { + "name": "number", + "namespace": "internal" + } + }, + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } + ], + "kind": "union_of" } }, { @@ -32602,6 +32490,56 @@ } ] }, + { + "codegenNames": [ + "latlon", + "geohash", + "coords", + "text" + ], + "description": "A latitude/longitude as a 2 dimensional point. It can be represented in various ways:\n- as a `{lat, long}` object\n- as a geo hash value\n- as a `[lon, lat]` array\n- as a string in `\", \"` or WKT point formats", + "kind": "type_alias", + "name": { + "name": "GeoLocation", + "namespace": "_types" + }, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "LatLonGeoLocation", + "namespace": "_types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "GeoHashLocation", + "namespace": "_types" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + } + }, + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } + ], + "kind": "union_of" + } + }, { "description": "A GeoJson shape, that can also use Elasticsearch's `envelope` extension.", "kind": "type_alias", @@ -32782,24 +32720,6 @@ } ] }, - { - "kind": "enum", - "members": [ - { - "name": "nodes" - }, - { - "name": "parents" - }, - { - "name": "none" - } - ], - "name": { - "name": "GroupBy", - "namespace": "_types" - } - }, { "kind": "enum", "members": [ @@ -32977,32 +32897,6 @@ } } }, - { - "inherits": { - "type": { - "name": "ScriptBase", - "namespace": "_types" - } - }, - "kind": "interface", - "name": { - "name": "IndexedScript", - "namespace": "_types" - }, - "properties": [ - { - "name": "id", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "Id", - "namespace": "_types" - } - } - } - ] - }, { "kind": "interface", "name": { @@ -33356,6 +33250,39 @@ "namespace": "_types" }, "properties": [ + { + "name": "lang", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "ScriptLanguage", + "namespace": "_types" + } + } + }, + { + "name": "options", + "required": false, + "type": { + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } + } + }, { "name": "source", "required": true, @@ -33367,7 +33294,8 @@ } } } - ] + ], + "shortcutProperty": "source" }, { "kind": "type_alias", @@ -33386,7 +33314,7 @@ { "kind": "interface", "name": { - "name": "LatLon", + "name": "LatLonGeoLocation", "namespace": "_types" }, "properties": [ @@ -34550,41 +34478,21 @@ } ] }, - { - "kind": "type_alias", - "name": { - "name": "Refresh", - "namespace": "_types" - }, - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "RefreshOptions", - "namespace": "_types" - } - } - ], - "kind": "union_of" - } - }, { "kind": "enum", "members": [ + { + "name": "true" + }, + { + "name": "false" + }, { "name": "wait_for" } ], "name": { - "name": "RefreshOptions", + "name": "Refresh", "namespace": "_types" } }, @@ -34834,47 +34742,10 @@ } }, { - "description": "A single value", - "kind": "type_alias", - "name": { - "name": "ScalarValue", - "namespace": "_types" - }, - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - } - ], - "kind": "union_of" - } - }, - { + "codegenNames": [ + "inline", + "stored" + ], "kind": "type_alias", "name": { "name": "Script", @@ -34892,16 +34763,9 @@ { "kind": "instance_of", "type": { - "name": "IndexedScript", + "name": "StoredScriptId", "namespace": "_types" } - }, - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } } ], "kind": "union_of" @@ -34914,29 +34778,6 @@ "namespace": "_types" }, "properties": [ - { - "name": "lang", - "required": false, - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "ScriptLanguage", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - ], - "kind": "union_of" - } - }, { "name": "params", "required": false, @@ -34989,24 +34830,34 @@ ] }, { - "kind": "enum", - "members": [ - { - "name": "painless" - }, - { - "name": "expression" - }, - { - "name": "mustache" - }, - { - "name": "java" - } + "codegenNames": [ + "builtin", + "custom" ], + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html", + "kind": "type_alias", "name": { "name": "ScriptLanguage", "namespace": "_types" + }, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "BuiltinScriptLanguage", + "namespace": "_types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } + ], + "kind": "union_of" } }, { @@ -35595,24 +35446,6 @@ } } }, - { - "kind": "enum", - "members": [ - { - "name": "intersects" - }, - { - "name": "disjoint" - }, - { - "name": "within" - } - ], - "name": { - "name": "ShapeRelation", - "namespace": "_types" - } - }, { "kind": "interface", "name": { @@ -35764,33 +35597,6 @@ } ] }, - { - "kind": "enum", - "members": [ - { - "name": "Raw" - }, - { - "name": "k" - }, - { - "name": "m" - }, - { - "name": "g" - }, - { - "name": "t" - }, - { - "name": "p" - } - ], - "name": { - "name": "Size", - "namespace": "_types" - } - }, { "kind": "interface", "name": { @@ -35917,25 +35723,35 @@ "properties": [ { "name": "lang", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "ScriptLanguage", + "namespace": "_types" + } + } + }, + { + "name": "options", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "ScriptLanguage", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" } - ], - "kind": "union_of" + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } } }, { @@ -35951,6 +35767,32 @@ } ] }, + { + "inherits": { + "type": { + "name": "ScriptBase", + "namespace": "_types" + } + }, + "kind": "interface", + "name": { + "name": "StoredScriptId", + "namespace": "_types" + }, + "properties": [ + { + "name": "id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + } + ] + }, { "kind": "enum", "members": [ @@ -36029,8 +35871,12 @@ } }, { + "codegenNames": [ + "time", + "offset" + ], "description": "Whenever durations need to be specified, e.g. for a timeout parameter, the duration must specify the unit, like 2d for 2 days.", - "docUrl": "https://github.com/elastic/elasticsearch/blob/master/libs/core/src/main/java/org/elasticsearch/common/unit/TimeValue.java\nhttps://github.com/elastic/elasticsearch/blob/master/libs/core/src/main/java/org/elasticsearch/common/unit/TimeValue.java\nOnly support 0 and -1 but we have no way to encode these as constants at the moment", + "docUrl": "https://github.com/elastic/elasticsearch/blob/master/libs/core/src/main/java/org/elasticsearch/core/TimeValue.java", "kind": "type_alias", "name": { "name": "Time", @@ -36135,6 +35981,68 @@ } } }, + { + "kind": "interface", + "name": { + "name": "TopLeftBottomRightGeoBounds", + "namespace": "_types" + }, + "properties": [ + { + "name": "top_left", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "GeoLocation", + "namespace": "_types" + } + } + }, + { + "name": "bottom_right", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "GeoLocation", + "namespace": "_types" + } + } + } + ] + }, + { + "kind": "interface", + "name": { + "name": "TopRightBottomLeftGeoBounds", + "namespace": "_types" + }, + "properties": [ + { + "name": "top_right", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "GeoLocation", + "namespace": "_types" + } + } + }, + { + "name": "bottom_left", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "GeoLocation", + "namespace": "_types" + } + } + } + ] + }, { "kind": "interface", "name": { @@ -36421,6 +36329,10 @@ } }, { + "codegenNames": [ + "count", + "option" + ], "kind": "type_alias", "name": { "name": "WaitForActiveShards", @@ -36544,6 +36456,26 @@ } ] }, + { + "kind": "interface", + "name": { + "name": "WktGeoBounds", + "namespace": "_types" + }, + "properties": [ + { + "name": "wkt", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } + } + ] + }, { "kind": "interface", "name": { @@ -38871,6 +38803,10 @@ ] }, { + "codegenNames": [ + "keyed", + "array" + ], "description": "Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for\nthe different buckets, the result is a dictionary.", "generics": [ { @@ -38917,6 +38853,116 @@ "kind": "union_of" } }, + { + "codegenNames": [ + "single", + "array", + "dict" + ], + "description": "Buckets path can be expressed in different ways, and an aggregation may accept some or all of these\nforms depending on its type. Please refer to each aggregation's documentation to know what buckets\npath forms they accept.", + "kind": "type_alias", + "name": { + "name": "BucketsPath", + "namespace": "_types.aggregations" + }, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } + }, + { + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } + } + ], + "kind": "union_of" + } + }, + { + "kind": "enum", + "members": [ + { + "aliases": [ + "1s" + ], + "name": "second" + }, + { + "aliases": [ + "1m" + ], + "name": "minute" + }, + { + "aliases": [ + "1h" + ], + "name": "hour" + }, + { + "aliases": [ + "1d" + ], + "name": "day" + }, + { + "aliases": [ + "1w" + ], + "name": "week" + }, + { + "aliases": [ + "1M" + ], + "name": "month" + }, + { + "aliases": [ + "1q" + ], + "name": "quarter" + }, + { + "aliases": [ + "1Y" + ], + "name": "year" + } + ], + "name": { + "name": "CalendarInterval", + "namespace": "_types.aggregations" + } + }, { "inherits": { "type": { @@ -39481,23 +39527,11 @@ "name": "calendar_interval", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "DateInterval", - "namespace": "_types.aggregations" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Time", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "CalendarInterval", + "namespace": "_types.aggregations" + } } }, { @@ -39506,23 +39540,11 @@ "type": { "generics": [ { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "DateMath", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "FieldDateMath", + "namespace": "_types.aggregations" + } } ], "kind": "instance_of", @@ -39538,23 +39560,11 @@ "type": { "generics": [ { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "DateMath", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "FieldDateMath", + "namespace": "_types.aggregations" + } } ], "kind": "instance_of", @@ -39579,23 +39589,11 @@ "name": "fixed_interval", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "DateInterval", - "namespace": "_types.aggregations" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Time", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "Time", + "namespace": "_types" + } } }, { @@ -39613,23 +39611,11 @@ "name": "interval", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "DateInterval", - "namespace": "_types.aggregations" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Time", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "Time", + "namespace": "_types" + } } }, { @@ -39769,39 +39755,6 @@ } ] }, - { - "kind": "enum", - "members": [ - { - "name": "second" - }, - { - "name": "minute" - }, - { - "name": "hour" - }, - { - "name": "day" - }, - { - "name": "week" - }, - { - "name": "month" - }, - { - "name": "quarter" - }, - { - "name": "year" - } - ], - "name": { - "name": "DateInterval", - "namespace": "_types.aggregations" - } - }, { "description": "Result of a `date_range` aggregation. Same format as a for a `range` aggregation: `from` and `to`\nin `buckets` are milliseconds since the Epoch, represented as a floating point number.", "inherits": { @@ -39912,45 +39865,11 @@ { "name": "from", "required": false, - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "DateMath", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "float", - "namespace": "_types" - } - } - ], - "kind": "union_of" - } - }, - { - "name": "from_as_string", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - }, - { - "name": "to_as_string", - "required": false, "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "internal" + "name": "FieldDateMath", + "namespace": "_types.aggregations" } } }, @@ -39968,34 +39887,11 @@ { "name": "to", "required": false, - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "DateMath", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "float", - "namespace": "_types" - } - } - ], - "kind": "union_of" - } - }, - { - "name": "doc_count", - "required": false, "type": { "kind": "instance_of", "type": { - "name": "long", - "namespace": "_types" + "name": "FieldDateMath", + "namespace": "_types.aggregations" } } } @@ -40208,6 +40104,40 @@ } ] }, + { + "inherits": { + "type": { + "name": "MovingAverageAggregationBase", + "namespace": "_types.aggregations" + } + }, + "kind": "interface", + "name": { + "name": "EwmaMovingAverageAggregation", + "namespace": "_types.aggregations" + }, + "properties": [ + { + "name": "model", + "required": true, + "type": { + "kind": "literal_value", + "value": "ewma" + } + }, + { + "name": "settings", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "EwmaModelSettings", + "namespace": "_types.aggregations" + } + } + } + ] + }, { "generics": [ { @@ -40520,6 +40450,37 @@ } ] }, + { + "codegenNames": [ + "expr", + "value" + ], + "description": "A date range limit, represented either as a DateMath expression or a number expressed\naccording to the target field's precision.", + "kind": "type_alias", + "name": { + "name": "FieldDateMath", + "namespace": "_types.aggregations" + }, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "DateMath", + "namespace": "_types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + } + ], + "kind": "union_of" + } + }, { "inherits": { "type": { @@ -40576,37 +40537,20 @@ "name": "filters", "required": false, "type": { - "items": [ - { - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "QueryContainer", - "namespace": "_types.query_dsl" - } - } - }, + "generics": [ { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "QueryContainer", - "namespace": "_types.query_dsl" - } + "kind": "instance_of", + "type": { + "name": "QueryContainer", + "namespace": "_types.query_dsl" } } ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "Buckets", + "namespace": "_types.aggregations" + } } }, { @@ -40728,37 +40672,6 @@ "namespace": "_types.aggregations" } }, - { - "kind": "interface", - "name": { - "name": "GeoBounds", - "namespace": "_types.aggregations" - }, - "properties": [ - { - "name": "bottom_right", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "LatLon", - "namespace": "_types" - } - } - }, - { - "name": "top_left", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "LatLon", - "namespace": "_types" - } - } - } - ] - }, { "inherits": { "type": { @@ -40779,7 +40692,7 @@ "kind": "instance_of", "type": { "name": "GeoBounds", - "namespace": "_types.aggregations" + "namespace": "_types" } } } @@ -40843,7 +40756,7 @@ "kind": "instance_of", "type": { "name": "GeoLocation", - "namespace": "_types.query_dsl" + "namespace": "_types" } } } @@ -40881,7 +40794,7 @@ "kind": "instance_of", "type": { "name": "GeoLocation", - "namespace": "_types.query_dsl" + "namespace": "_types" } } } @@ -40942,23 +40855,11 @@ "name": "origin", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "GeoLocation", - "namespace": "_types.query_dsl" - } - }, - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "GeoLocation", + "namespace": "_types" + } } }, { @@ -41031,8 +40932,8 @@ "type": { "kind": "instance_of", "type": { - "name": "BoundingBox", - "namespace": "_types.query_dsl" + "name": "GeoBounds", + "namespace": "_types" } } }, @@ -41128,8 +41029,11 @@ "name": "type", "required": true, "type": { - "kind": "literal_value", - "value": "Feature" + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } } }, { @@ -41338,7 +41242,7 @@ "kind": "instance_of", "type": { "name": "GeoBounds", - "namespace": "_types.aggregations" + "namespace": "_types" } } } @@ -41752,6 +41656,40 @@ } ] }, + { + "inherits": { + "type": { + "name": "MovingAverageAggregationBase", + "namespace": "_types.aggregations" + } + }, + "kind": "interface", + "name": { + "name": "HoltMovingAverageAggregation", + "namespace": "_types.aggregations" + }, + "properties": [ + { + "name": "model", + "required": true, + "type": { + "kind": "literal_value", + "value": "holt" + } + }, + { + "name": "settings", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "HoltLinearModelSettings", + "namespace": "_types.aggregations" + } + } + } + ] + }, { "kind": "interface", "name": { @@ -41827,6 +41765,40 @@ } ] }, + { + "inherits": { + "type": { + "name": "MovingAverageAggregationBase", + "namespace": "_types.aggregations" + } + }, + "kind": "interface", + "name": { + "name": "HoltWintersMovingAverageAggregation", + "namespace": "_types.aggregations" + }, + "properties": [ + { + "name": "model", + "required": true, + "type": { + "kind": "literal_value", + "value": "holt_winters" + } + }, + { + "name": "settings", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "HoltWintersModelSettings", + "namespace": "_types.aggregations" + } + } + } + ] + }, { "kind": "enum", "members": [ @@ -41886,7 +41858,7 @@ "type": { "kind": "instance_of", "type": { - "name": "ScalarValue", + "name": "FieldValue", "namespace": "_types" } } @@ -42092,7 +42064,7 @@ "type": { "kind": "instance_of", "type": { - "name": "ScalarValue", + "name": "FieldValue", "namespace": "_types" } } @@ -42311,6 +42283,40 @@ } } }, + { + "inherits": { + "type": { + "name": "MovingAverageAggregationBase", + "namespace": "_types.aggregations" + } + }, + "kind": "interface", + "name": { + "name": "LinearMovingAverageAggregation", + "namespace": "_types.aggregations" + }, + "properties": [ + { + "name": "model", + "required": true, + "type": { + "kind": "literal_value", + "value": "linear" + } + }, + { + "name": "settings", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "EmptyObject", + "namespace": "_types" + } + } + } + ] + }, { "description": "Result of the `rare_terms` aggregation when the field is some kind of whole number like a integer, long, or a date.", "inherits": { @@ -43006,130 +43012,54 @@ } }, { - "inherits": { - "type": { - "name": "PipelineAggregationBase", - "namespace": "_types.aggregations" - } - }, - "kind": "interface", + "kind": "type_alias", "name": { "name": "MovingAverageAggregation", "namespace": "_types.aggregations" }, - "properties": [ - { - "name": "minimize", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - } - }, - { - "name": "model", - "required": false, - "type": { + "type": { + "items": [ + { "kind": "instance_of", "type": { - "name": "MovingAverageModel", + "name": "LinearMovingAverageAggregation", "namespace": "_types.aggregations" } - } - }, - { - "name": "settings", - "required": true, - "type": { + }, + { "kind": "instance_of", "type": { - "name": "MovingAverageSettings", + "name": "SimpleMovingAverageAggregation", "namespace": "_types.aggregations" } - } - }, - { - "name": "predict", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - }, - { - "name": "window", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - } - ] - }, - { - "kind": "enum", - "members": [ - { - "name": "linear" - }, - { - "name": "simple" - }, - { - "name": "ewma" - }, - { - "name": "holt" - }, - { - "name": "holt_winters" - } - ], - "name": { - "name": "MovingAverageModel", - "namespace": "_types.aggregations" - } - }, - { - "kind": "type_alias", - "name": { - "name": "MovingAverageSettings", - "namespace": "_types.aggregations" - }, - "type": { - "items": [ + }, { "kind": "instance_of", "type": { - "name": "EwmaModelSettings", + "name": "EwmaMovingAverageAggregation", "namespace": "_types.aggregations" } }, { "kind": "instance_of", "type": { - "name": "HoltLinearModelSettings", + "name": "HoltMovingAverageAggregation", "namespace": "_types.aggregations" } }, { "kind": "instance_of", "type": { - "name": "HoltWintersModelSettings", + "name": "HoltWintersMovingAverageAggregation", "namespace": "_types.aggregations" } } ], "kind": "union_of" + }, + "variants": { + "kind": "internal_tag", + "tag": "model" } }, { @@ -43141,23 +43071,71 @@ }, "kind": "interface", "name": { - "name": "MovingFunctionAggregation", + "name": "MovingAverageAggregationBase", "namespace": "_types.aggregations" }, "properties": [ { - "name": "script", + "name": "minimize", "required": false, "type": { "kind": "instance_of", "type": { - "name": "string", + "name": "boolean", "namespace": "internal" } } }, { - "name": "shift", + "name": "predict", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "window", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + } + ] + }, + { + "inherits": { + "type": { + "name": "PipelineAggregationBase", + "namespace": "_types.aggregations" + } + }, + "kind": "interface", + "name": { + "name": "MovingFunctionAggregation", + "namespace": "_types.aggregations" + }, + "properties": [ + { + "name": "script", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } + }, + { + "name": "shift", "required": false, "type": { "kind": "instance_of", @@ -43685,6 +43663,39 @@ } ] }, + { + "codegenNames": [ + "keyed", + "array" + ], + "kind": "type_alias", + "name": { + "name": "Percentiles", + "namespace": "_types.aggregations" + }, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "KeyedPercentiles", + "namespace": "_types.aggregations" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "ArrayPercentilesItem", + "namespace": "_types.aggregations" + } + } + } + ], + "kind": "union_of" + } + }, { "inherits": { "type": { @@ -43702,26 +43713,11 @@ "name": "values", "required": true, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "KeyedPercentiles", - "namespace": "_types.aggregations" - } - }, - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "ArrayPercentilesItem", - "namespace": "_types.aggregations" - } - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "Percentiles", + "namespace": "_types.aggregations" + } } } ] @@ -43849,44 +43845,11 @@ "name": "buckets_path", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - }, - { - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "BucketsPath", + "namespace": "_types.aggregations" + } } }, { @@ -44089,26 +44052,11 @@ "name": "exclude", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "TermsExclude", + "namespace": "_types.aggregations" + } } }, { @@ -44126,33 +44074,11 @@ "name": "include", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - }, - { - "kind": "instance_of", - "type": { - "name": "TermsInclude", - "namespace": "_types.aggregations" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "TermsInclude", + "namespace": "_types.aggregations" + } } }, { @@ -44258,7 +44184,7 @@ "type": { "kind": "instance_of", "type": { - "name": "DateInterval", + "name": "CalendarInterval", "namespace": "_types.aggregations" } } @@ -44727,26 +44653,11 @@ "name": "exclude", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "TermsExclude", + "namespace": "_types.aggregations" + } } }, { @@ -44964,76 +44875,61 @@ }, { "name": "exclude", - "required": false, - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - } - ], - "kind": "union_of" - } - }, - { - "name": "execution_hint", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TermsAggregationExecutionHint", - "namespace": "_types.aggregations" - } - } - }, - { - "name": "field", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Field", - "namespace": "_types" - } - } - }, - { - "name": "filter_duplicate_text", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - } - }, - { - "name": "gnd", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "GoogleNormalizedDistanceHeuristic", - "namespace": "_types.aggregations" - } - } - }, - { - "name": "include", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "TermsExclude", + "namespace": "_types.aggregations" + } + } + }, + { + "name": "execution_hint", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "TermsAggregationExecutionHint", + "namespace": "_types.aggregations" + } + } + }, + { + "name": "field", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Field", + "namespace": "_types" + } + } + }, + { + "name": "filter_duplicate_text", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "internal" + } + } + }, + { + "name": "gnd", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "GoogleNormalizedDistanceHeuristic", + "namespace": "_types.aggregations" + } + } + }, + { + "name": "include", "required": false, "type": { "items": [ @@ -45148,6 +45044,40 @@ } ] }, + { + "inherits": { + "type": { + "name": "MovingAverageAggregationBase", + "namespace": "_types.aggregations" + } + }, + "kind": "interface", + "name": { + "name": "SimpleMovingAverageAggregation", + "namespace": "_types.aggregations" + }, + "properties": [ + { + "name": "model", + "required": true, + "type": { + "kind": "literal_value", + "value": "simple" + } + }, + { + "name": "settings", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "EmptyObject", + "namespace": "_types" + } + } + } + ] + }, { "inherits": { "type": { @@ -46255,26 +46185,11 @@ "name": "exclude", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "TermsExclude", + "namespace": "_types.aggregations" + } } }, { @@ -46303,33 +46218,11 @@ "name": "include", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - }, - { - "kind": "instance_of", - "type": { - "name": "TermsInclude", - "namespace": "_types.aggregations" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "TermsInclude", + "namespace": "_types.aggregations" + } } }, { @@ -46488,19 +46381,12 @@ }, "type": { "items": [ - { - "kind": "instance_of", - "type": { - "name": "SortOrder", - "namespace": "_global.search._types" - } - }, { "key": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "internal" + "name": "Field", + "namespace": "_types" } }, "kind": "dictionary_of", @@ -46519,8 +46405,8 @@ "key": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "internal" + "name": "Field", + "namespace": "_types" } }, "kind": "dictionary_of", @@ -46568,11 +46454,85 @@ ] }, { - "kind": "interface", + "codegenNames": [ + "regexp", + "terms" + ], + "kind": "type_alias", + "name": { + "name": "TermsExclude", + "namespace": "_types.aggregations" + }, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } + } + ], + "kind": "union_of" + } + }, + { + "codegenNames": [ + "regexp", + "terms", + "partition" + ], + "kind": "type_alias", "name": { "name": "TermsInclude", "namespace": "_types.aggregations" }, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } + }, + { + "kind": "instance_of", + "type": { + "name": "TermsPartition", + "namespace": "_types.aggregations" + } + } + ], + "kind": "union_of" + } + }, + { + "kind": "interface", + "name": { + "name": "TermsPartition", + "namespace": "_types.aggregations" + }, "properties": [ { "name": "num_partitions", @@ -46777,30 +46737,11 @@ "name": "_source", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "SourceFilter", - "namespace": "_global.search._types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Fields", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "SourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -46866,7 +46807,7 @@ { "kind": "instance_of", "type": { - "name": "ScalarValue", + "name": "FieldValue", "namespace": "_types" } }, @@ -46900,7 +46841,7 @@ { "kind": "instance_of", "type": { - "name": "ScalarValue", + "name": "FieldValue", "namespace": "_types" } }, @@ -47628,11 +47569,61 @@ ] }, { + "codegenNames": [ + "name", + "definition" + ], "kind": "type_alias", "name": { "name": "CharFilter", "namespace": "_types.analysis" }, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + }, + { + "kind": "instance_of", + "type": { + "name": "CharFilterDefinition", + "namespace": "_types.analysis" + } + } + ], + "kind": "union_of" + } + }, + { + "kind": "interface", + "name": { + "name": "CharFilterBase", + "namespace": "_types.analysis" + }, + "properties": [ + { + "name": "version", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "VersionString", + "namespace": "_types" + } + } + } + ] + }, + { + "kind": "type_alias", + "name": { + "name": "CharFilterDefinition", + "namespace": "_types.analysis" + }, "type": { "items": [ { @@ -47678,26 +47669,6 @@ "tag": "type" } }, - { - "kind": "interface", - "name": { - "name": "CharFilterBase", - "namespace": "_types.analysis" - }, - "properties": [ - { - "name": "version", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "VersionString", - "namespace": "_types" - } - } - } - ] - }, { "inherits": { "type": { @@ -52066,11 +52037,61 @@ } }, { + "codegenNames": [ + "name", + "definition" + ], "kind": "type_alias", "name": { "name": "TokenFilter", "namespace": "_types.analysis" }, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + }, + { + "kind": "instance_of", + "type": { + "name": "TokenFilterDefinition", + "namespace": "_types.analysis" + } + } + ], + "kind": "union_of" + } + }, + { + "kind": "interface", + "name": { + "name": "TokenFilterBase", + "namespace": "_types.analysis" + }, + "properties": [ + { + "name": "version", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "VersionString", + "namespace": "_types" + } + } + } + ] + }, + { + "kind": "type_alias", + "name": { + "name": "TokenFilterDefinition", + "namespace": "_types.analysis" + }, "type": { "items": [ { @@ -52417,10 +52438,40 @@ "tag": "type" } }, + { + "codegenNames": [ + "name", + "definition" + ], + "kind": "type_alias", + "name": { + "name": "Tokenizer", + "namespace": "_types.analysis" + }, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + }, + { + "kind": "instance_of", + "type": { + "name": "TokenizerDefinition", + "namespace": "_types.analysis" + } + } + ], + "kind": "union_of" + } + }, { "kind": "interface", "name": { - "name": "TokenFilterBase", + "name": "TokenizerBase", "namespace": "_types.analysis" }, "properties": [ @@ -52440,7 +52491,7 @@ { "kind": "type_alias", "name": { - "name": "Tokenizer", + "name": "TokenizerDefinition", "namespace": "_types.analysis" }, "type": { @@ -52552,19 +52603,90 @@ } }, { + "inherits": { + "type": { + "name": "TokenFilterBase", + "namespace": "_types.analysis" + } + }, "kind": "interface", "name": { - "name": "TokenizerBase", + "name": "TrimTokenFilter", "namespace": "_types.analysis" }, "properties": [ { - "name": "version", + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "trim" + } + } + ] + }, + { + "inherits": { + "type": { + "name": "TokenFilterBase", + "namespace": "_types.analysis" + } + }, + "kind": "interface", + "name": { + "name": "TruncateTokenFilter", + "namespace": "_types.analysis" + }, + "properties": [ + { + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "truncate" + } + }, + { + "name": "length", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + } + ] + }, + { + "inherits": { + "type": { + "name": "TokenizerBase", + "namespace": "_types.analysis" + } + }, + "kind": "interface", + "name": { + "name": "UaxEmailUrlTokenizer", + "namespace": "_types.analysis" + }, + "properties": [ + { + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "uax_url_email" + } + }, + { + "name": "max_token_length", "required": false, "type": { "kind": "instance_of", "type": { - "name": "VersionString", + "name": "integer", "namespace": "_types" } } @@ -52580,7 +52702,7 @@ }, "kind": "interface", "name": { - "name": "TrimTokenFilter", + "name": "UniqueTokenFilter", "namespace": "_types.analysis" }, "properties": [ @@ -52589,7 +52711,18 @@ "required": true, "type": { "kind": "literal_value", - "value": "trim" + "value": "unique" + } + }, + { + "name": "only_on_same_position", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "internal" + } } } ] @@ -52603,7 +52736,7 @@ }, "kind": "interface", "name": { - "name": "TruncateTokenFilter", + "name": "UppercaseTokenFilter", "namespace": "_types.analysis" }, "properties": [ @@ -52612,16 +52745,33 @@ "required": true, "type": { "kind": "literal_value", - "value": "truncate" + "value": "uppercase" } - }, + } + ] + }, + { + "kind": "interface", + "name": { + "name": "WhitespaceAnalyzer", + "namespace": "_types.analysis" + }, + "properties": [ { - "name": "length", + "name": "type", "required": true, + "type": { + "kind": "literal_value", + "value": "whitespace" + } + }, + { + "name": "version", + "required": false, "type": { "kind": "instance_of", "type": { - "name": "integer", + "name": "VersionString", "namespace": "_types" } } @@ -52637,7 +52787,7 @@ }, "kind": "interface", "name": { - "name": "UaxEmailUrlTokenizer", + "name": "WhitespaceTokenizer", "namespace": "_types.analysis" }, "properties": [ @@ -52646,126 +52796,7 @@ "required": true, "type": { "kind": "literal_value", - "value": "uax_url_email" - } - }, - { - "name": "max_token_length", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - } - ] - }, - { - "inherits": { - "type": { - "name": "TokenFilterBase", - "namespace": "_types.analysis" - } - }, - "kind": "interface", - "name": { - "name": "UniqueTokenFilter", - "namespace": "_types.analysis" - }, - "properties": [ - { - "name": "type", - "required": true, - "type": { - "kind": "literal_value", - "value": "unique" - } - }, - { - "name": "only_on_same_position", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - } - } - ] - }, - { - "inherits": { - "type": { - "name": "TokenFilterBase", - "namespace": "_types.analysis" - } - }, - "kind": "interface", - "name": { - "name": "UppercaseTokenFilter", - "namespace": "_types.analysis" - }, - "properties": [ - { - "name": "type", - "required": true, - "type": { - "kind": "literal_value", - "value": "uppercase" - } - } - ] - }, - { - "kind": "interface", - "name": { - "name": "WhitespaceAnalyzer", - "namespace": "_types.analysis" - }, - "properties": [ - { - "name": "type", - "required": true, - "type": { - "kind": "literal_value", - "value": "whitespace" - } - }, - { - "name": "version", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "VersionString", - "namespace": "_types" - } - } - } - ] - }, - { - "inherits": { - "type": { - "name": "TokenizerBase", - "namespace": "_types.analysis" - } - }, - "kind": "interface", - "name": { - "name": "WhitespaceTokenizer", - "namespace": "_types.analysis" - }, - "properties": [ - { - "name": "type", - "required": true, - "type": { - "kind": "literal_value", - "value": "whitespace" + "value": "whitespace" } }, { @@ -54947,7 +54978,7 @@ "kind": "instance_of", "type": { "name": "GeoLocation", - "namespace": "_types.query_dsl" + "namespace": "_types" } } }, @@ -56055,23 +56086,11 @@ "name": "dynamic", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "DynamicMapping", - "namespace": "_types.mapping" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "DynamicMapping", + "namespace": "_types.mapping" + } } }, { @@ -57193,23 +57212,11 @@ "name": "dynamic", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "DynamicMapping", - "namespace": "_types.mapping" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "DynamicMapping", + "namespace": "_types.mapping" + } } }, { @@ -57679,115 +57686,6 @@ } ] }, - { - "description": "A geo bounding box. The various coordinates can be mixed. When set, `wkt` takes precedence over all other fields.", - "kind": "interface", - "name": { - "name": "BoundingBox", - "namespace": "_types.query_dsl" - }, - "properties": [ - { - "name": "bottom_right", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "GeoLocation", - "namespace": "_types.query_dsl" - } - } - }, - { - "name": "top_left", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "GeoLocation", - "namespace": "_types.query_dsl" - } - } - }, - { - "name": "top_right", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "GeoLocation", - "namespace": "_types.query_dsl" - } - } - }, - { - "name": "bottom_left", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "GeoLocation", - "namespace": "_types.query_dsl" - } - } - }, - { - "name": "top", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - }, - { - "name": "left", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - }, - { - "name": "right", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - }, - { - "name": "bottom", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - }, - { - "name": "wkt", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - } - ] - }, { "kind": "enum", "members": [ @@ -58228,6 +58126,11 @@ ] }, { + "codegenNames": [ + "date", + "numeric", + "geo" + ], "kind": "type_alias", "name": { "name": "DecayFunction", @@ -58391,6 +58294,10 @@ ] }, { + "codegenNames": [ + "geo", + "date" + ], "kind": "type_alias", "name": { "name": "DistanceFeatureQuery", @@ -58500,6 +58407,52 @@ } ] }, + { + "description": "A reference to a field with formatting instructions on how to return the value", + "kind": "interface", + "name": { + "name": "FieldAndFormat", + "namespace": "_types.query_dsl" + }, + "properties": [ + { + "description": "Wildcard pattern. The request returns values for field names matching this pattern.", + "name": "field", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Field", + "namespace": "_types" + } + } + }, + { + "description": "Format in which the values are returned.", + "name": "format", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } + }, + { + "name": "include_unmapped", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "internal" + } + } + } + ], + "shortcutProperty": "field" + }, { "kind": "interface", "name": { @@ -59009,8 +58962,8 @@ { "kind": "instance_of", "type": { - "name": "BoundingBox", - "namespace": "_types.query_dsl" + "name": "GeoBounds", + "namespace": "_types" } } ], @@ -59072,43 +59025,6 @@ } ] }, - { - "description": "Represents a Latitude/Longitude and optional Z value as a 2 or 3 dimensional point", - "kind": "type_alias", - "name": { - "name": "GeoCoordinate", - "namespace": "_types.query_dsl" - }, - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - }, - { - "kind": "instance_of", - "type": { - "name": "ThreeDimensionalPoint", - "namespace": "_types.query_dsl" - } - } - ], - "kind": "union_of" - } - }, { "attachedBehaviors": [ "AdditionalProperty" @@ -59129,7 +59045,7 @@ "kind": "instance_of", "type": { "name": "GeoLocation", - "namespace": "_types.query_dsl" + "namespace": "_types" } }, { @@ -59172,8 +59088,8 @@ { "kind": "instance_of", "type": { - "name": "GeoCoordinate", - "namespace": "_types.query_dsl" + "name": "GeoLocation", + "namespace": "_types" } }, { @@ -59214,7 +59130,7 @@ "kind": "instance_of", "type": { "name": "GeoLocation", - "namespace": "_types.query_dsl" + "namespace": "_types" } } ], @@ -59288,43 +59204,6 @@ "namespace": "_types.query_dsl" } }, - { - "description": "Represents a Latitude/Longitude as a 2 dimensional point", - "kind": "type_alias", - "name": { - "name": "GeoLocation", - "namespace": "_types.query_dsl" - }, - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - }, - { - "kind": "instance_of", - "type": { - "name": "TwoDimensionalPoint", - "namespace": "_types.query_dsl" - } - } - ], - "kind": "union_of" - } - }, { "kind": "interface", "name": { @@ -59341,7 +59220,7 @@ "kind": "instance_of", "type": { "name": "GeoLocation", - "namespace": "_types.query_dsl" + "namespace": "_types" } } } @@ -60326,6 +60205,10 @@ ] }, { + "codegenNames": [ + "text", + "document" + ], "description": "Text that we want similar documents for or a lookup to a document's field for the text.", "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html#_document_input_parameters", "kind": "type_alias", @@ -61683,9 +61566,15 @@ "kind": "enum", "members": [ { + "aliases": [ + "AND" + ], "name": "and" }, { + "aliases": [ + "OR" + ], "name": "or" } ], @@ -63135,6 +63024,10 @@ ] }, { + "codegenNames": [ + "date", + "number" + ], "kind": "type_alias", "name": { "name": "RangeQuery", @@ -63597,17 +63490,6 @@ "namespace": "_types.query_dsl" }, "properties": [ - { - "name": "ignore_unmapped", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - } - }, { "name": "indexed_shape", "required": false, @@ -63625,7 +63507,7 @@ "type": { "kind": "instance_of", "type": { - "name": "ShapeRelation", + "name": "GeoShapeRelation", "namespace": "_types" } } @@ -63682,7 +63564,19 @@ "name": "ShapeQuery", "namespace": "_types.query_dsl" }, - "properties": [] + "properties": [ + { + "name": "ignore_unmapped", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "internal" + } + } + } + ] }, { "kind": "enum", @@ -63727,9 +63621,41 @@ "name": "ALL" } ], + "name": { + "name": "SimpleQueryStringFlag", + "namespace": "_types.query_dsl" + } + }, + { + "codegenNames": [ + "single", + "multiple" + ], + "description": "Query flags can be either a single flag or a combination of flags, e.g. `OR|AND|PREFIX`", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/7.15/query-dsl-simple-query-string-query.html#supported-flags", + "kind": "type_alias", "name": { "name": "SimpleQueryStringFlags", "namespace": "_types.query_dsl" + }, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "SimpleQueryStringFlag", + "namespace": "_types.query_dsl" + } + }, + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + } + ], + "kind": "union_of" } }, { @@ -63810,23 +63736,11 @@ "name": "flags", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "SimpleQueryStringFlags", - "namespace": "_types.query_dsl" - } - }, - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "SimpleQueryStringFlags", + "namespace": "_types.query_dsl" + } } }, { @@ -64439,30 +64353,11 @@ "name": "value", "required": true, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "float", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "FieldValue", + "namespace": "_types" + } } }, { @@ -64548,36 +64443,11 @@ } }, { - "items": [ - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - }, - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "kind": "instance_of", - "type": { - "name": "TermsLookup", - "namespace": "_types.query_dsl" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "TermsQueryField", + "namespace": "_types.query_dsl" + } } ], "type": { @@ -64599,6 +64469,39 @@ }, "properties": [] }, + { + "codegenNames": [ + "value", + "lookup" + ], + "kind": "type_alias", + "name": { + "name": "TermsQueryField", + "namespace": "_types.query_dsl" + }, + "type": { + "items": [ + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "FieldValue", + "namespace": "_types" + } + } + }, + { + "kind": "instance_of", + "type": { + "name": "TermsLookup", + "namespace": "_types.query_dsl" + } + } + ], + "kind": "union_of" + } + }, { "inherits": { "type": { @@ -64677,79 +64580,6 @@ "namespace": "_types.query_dsl" } }, - { - "kind": "interface", - "name": { - "name": "ThreeDimensionalPoint", - "namespace": "_types.query_dsl" - }, - "properties": [ - { - "name": "lat", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - }, - { - "name": "lon", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - }, - { - "name": "z", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - } - ] - }, - { - "kind": "interface", - "name": { - "name": "TwoDimensionalPoint", - "namespace": "_types.query_dsl" - }, - "properties": [ - { - "name": "lat", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - }, - { - "name": "lon", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - } - ] - }, { "inherits": { "type": { @@ -65502,23 +65332,11 @@ "name": "track_total_hits", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "TrackHits", + "namespace": "_global.search._types" + } } }, { @@ -65552,38 +65370,14 @@ "name": "docvalue_fields", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "DocValueField", - "namespace": "_global.search._types" - } - }, - { - "kind": "array_of", - "value": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "Field", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "DocValueField", - "namespace": "_global.search._types" - } - } - ], - "kind": "union_of" - } + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "FieldAndFormat", + "namespace": "_types.query_dsl" } - ], - "kind": "union_of" + } } }, { @@ -65733,30 +65527,11 @@ "name": "_source", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Fields", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "SourceFilter", - "namespace": "_global.search._types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "SourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -65766,23 +65541,11 @@ "type": { "kind": "array_of", "value": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "Field", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "DateField", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "FieldAndFormat", + "namespace": "_types.query_dsl" + } } } }, @@ -65790,34 +65553,11 @@ "name": "suggest", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "SuggestContainer", - "namespace": "_global.search._types" - } - }, - { - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "SuggestContainer", - "namespace": "_global.search._types" - } - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "Suggester", + "namespace": "_global.search._types" + } } }, { @@ -66366,23 +66106,11 @@ "name": "track_total_hits", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "TrackHits", + "namespace": "_global.search._types" + } } }, { @@ -66437,23 +66165,11 @@ "name": "_source", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Fields", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "GetSourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -77295,23 +77011,11 @@ "name": "size", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "Size", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "ThreadPoolSize", + "namespace": "cat.thread_pool" + } } } ] @@ -77645,6 +77349,30 @@ } ] }, + { + "kind": "enum", + "members": [ + { + "name": "k" + }, + { + "name": "m" + }, + { + "name": "g" + }, + { + "name": "t" + }, + { + "name": "p" + } + ], + "name": { + "name": "ThreadPoolSize", + "namespace": "cat.thread_pool" + } + }, { "attachedBehaviors": [ "CommonCatQueryParameters", @@ -87858,23 +87586,11 @@ "name": "size", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "uint", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "float", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "uint", + "namespace": "_types" + } } }, { @@ -87882,25 +87598,10 @@ "name": "fields", "required": false, "type": { - "kind": "array_of", - "value": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "Field", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "SearchFieldFormatted", - "namespace": "eql.search" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "FieldAndFormat", + "namespace": "_types.query_dsl" } } }, @@ -88071,39 +87772,6 @@ "namespace": "eql.search" } }, - { - "kind": "interface", - "name": { - "name": "SearchFieldFormatted", - "namespace": "eql.search" - }, - "properties": [ - { - "description": "Wildcard pattern. The request returns values for field names matching this pattern.", - "name": "field", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "Field", - "namespace": "_types" - } - } - }, - { - "description": "Format in which the values are returned.", - "name": "format", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - } - ] - }, { "kind": "interface", "name": { @@ -88776,12 +88444,14 @@ } }, { - "kind": "interface", + "kind": "type_alias", "name": { - "name": "Action", + "name": "Actions", "namespace": "ilm._types" }, - "properties": [] + "type": { + "kind": "user_defined_value" + } }, { "kind": "interface", @@ -88794,37 +88464,11 @@ "name": "actions", "required": false, "type": { - "items": [ - { - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "Action", - "namespace": "ilm._types" - } - } - }, - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "Actions", + "namespace": "ilm._types" + } } }, { @@ -88837,51 +88481,6 @@ "namespace": "_types" } } - }, - { - "name": "configurations", - "required": false, - "type": { - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - ], - "kind": "union_of" - } - } - } } ] }, @@ -91698,23 +91297,11 @@ "name": "settings", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "IndexSettings", - "namespace": "indices._types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "IndexStatePrefixedSettings", - "namespace": "indices._types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "IndexSettings", + "namespace": "indices._types" + } } }, { @@ -91730,26 +91317,6 @@ } ] }, - { - "kind": "interface", - "name": { - "name": "IndexStatePrefixedSettings", - "namespace": "indices._types" - }, - "properties": [ - { - "name": "index", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "IndexSettings", - "namespace": "indices._types" - } - } - } - ] - }, { "kind": "interface", "name": { @@ -92599,23 +92166,11 @@ "type": { "kind": "array_of", "value": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "CharFilter", - "namespace": "_types.analysis" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "CharFilter", + "namespace": "_types.analysis" + } } } }, @@ -92647,23 +92202,11 @@ "type": { "kind": "array_of", "value": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "TokenFilter", - "namespace": "_types.analysis" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "TokenFilter", + "namespace": "_types.analysis" + } } } }, @@ -92693,23 +92236,11 @@ "name": "tokenizer", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Tokenizer", - "namespace": "_types.analysis" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "Tokenizer", + "namespace": "_types.analysis" + } } } ] @@ -97529,23 +97060,11 @@ "name": "dynamic", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "DynamicMapping", - "namespace": "_types.mapping" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "DynamicMapping", + "namespace": "_types.mapping" + } } }, { @@ -99642,6 +99161,47 @@ "namespace": "indices.resolve_index" } }, + { + "codegenNames": [ + "single", + "by_type" + ], + "kind": "type_alias", + "name": { + "name": "IndexRolloverMapping", + "namespace": "indices.rollover" + }, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "TypeMapping", + "namespace": "_types.mapping" + } + }, + { + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "TypeMapping", + "namespace": "_types.mapping" + } + } + } + ], + "kind": "union_of" + } + }, { "attachedBehaviors": [ "CommonQueryParameters" @@ -99686,34 +99246,11 @@ "name": "mappings", "required": false, "type": { - "items": [ - { - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "TypeMapping", - "namespace": "_types.mapping" - } - } - }, - { - "kind": "instance_of", - "type": { - "name": "TypeMapping", - "namespace": "_types.mapping" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "IndexRolloverMapping", + "namespace": "indices.rollover" + } } }, { @@ -104106,26 +103643,15 @@ } }, { + "description": "How to round the date when formatting the date into the index name. Valid values are:\n`y` (year), `M` (month), `w` (week), `d` (day), `h` (hour), `m` (minute) and `s` (second).\nSupports template snippets.", "name": "date_rounding", "required": true, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "DateRounding", - "namespace": "ingest._types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } } }, { @@ -104258,43 +103784,6 @@ } ] }, - { - "kind": "enum", - "members": [ - { - "codegenName": "Second", - "name": "s" - }, - { - "codegenName": "Minute", - "name": "m" - }, - { - "codegenName": "Hour", - "name": "h" - }, - { - "codegenName": "Day", - "name": "d" - }, - { - "codegenName": "Week", - "name": "w" - }, - { - "codegenName": "Month", - "name": "M" - }, - { - "codegenName": "Year", - "name": "y" - } - ], - "name": { - "name": "DateRounding", - "namespace": "ingest._types" - } - }, { "inherits": { "type": { @@ -108666,23 +108155,11 @@ "name": "categorization_analyzer", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "CategorizationAnalyzer", - "namespace": "ml._types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "CategorizationAnalyzer", + "namespace": "ml._types" + } } }, { @@ -108849,23 +108326,11 @@ "name": "categorization_analyzer", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "CategorizationAnalyzer", - "namespace": "ml._types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "CategorizationAnalyzer", + "namespace": "ml._types" + } } }, { @@ -109829,87 +109294,82 @@ ] }, { - "kind": "interface", + "codegenNames": [ + "name", + "definition" + ], + "kind": "type_alias", "name": { "name": "CategorizationAnalyzer", "namespace": "ml._types" }, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + }, + { + "kind": "instance_of", + "type": { + "name": "CategorizationAnalyzerDefinition", + "namespace": "ml._types" + } + } + ], + "kind": "union_of" + } + }, + { + "kind": "interface", + "name": { + "name": "CategorizationAnalyzerDefinition", + "namespace": "ml._types" + }, "properties": [ { + "description": "One or more character filters. In addition to the built-in character filters, other plugins can provide more character filters. If this property is not specified, no character filters are applied prior to categorization. If you are customizing some other aspect of the analyzer and you need to achieve the equivalent of `categorization_filters` (which are not permitted when some other aspect of the analyzer is customized), add them here as pattern replace character filters.", "name": "char_filter", "required": false, "type": { "kind": "array_of", "value": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "CharFilter", - "namespace": "_types.analysis" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "CharFilter", + "namespace": "_types.analysis" + } } } }, { - "description": "One or more character filters. In addition to the built-in character filters, other plugins can provide more character filters. If this property is not specified, no character filters are applied prior to categorization. If you are customizing some other aspect of the analyzer and you need to achieve the equivalent of `categorization_filters` (which are not permitted when some other aspect of the analyzer is customized), add them here as pattern replace character filters.", + "description": "One or more token filters. In addition to the built-in token filters, other plugins can provide more token filters. If this property is not specified, no token filters are applied prior to categorization.", "name": "filter", "required": false, "type": { "kind": "array_of", "value": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "TokenFilter", - "namespace": "_types.analysis" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "TokenFilter", + "namespace": "_types.analysis" + } } } }, { - "description": "One or more token filters. In addition to the built-in token filters, other plugins can provide more token filters. If this property is not specified, no token filters are applied prior to categorization.", + "description": "The name or definition of the tokenizer to use after character filters are applied. This property is compulsory if `categorization_analyzer` is specified as an object. Machine learning provides a tokenizer called `ml_standard` that tokenizes in a way that has been determined to produce good categorization results on a variety of log file formats for logs in English. If you want to use that tokenizer but change the character or token filters, specify \"tokenizer\": \"ml_standard\" in your `categorization_analyzer`. Additionally, the `ml_classic` tokenizer is available, which tokenizes in the same way as the non-customizable tokenizer in old versions of the product (before 6.2). `ml_classic` was the default categorization tokenizer in versions 6.2 to 7.13, so if you need categorization identical to the default for jobs created in these versions, specify \"tokenizer\": \"ml_classic\" in your `categorization_analyzer`.", "name": "tokenizer", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Tokenizer", - "namespace": "_types.analysis" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "Tokenizer", + "namespace": "_types.analysis" + } } } ] @@ -110183,60 +109643,15 @@ } }, { - "kind": "interface", + "description": "Custom metadata about the job", + "kind": "type_alias", "name": { "name": "CustomSettings", "namespace": "ml._types" }, - "properties": [ - { - "name": "custom_urls", - "required": false, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "UrlConfig", - "namespace": "xpack.usage" - } - } - } - }, - { - "name": "created_by", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - }, - { - "name": "job_tags", - "required": false, - "type": { - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - } - } - ] + "type": { + "kind": "user_defined_value" + } }, { "kind": "interface", @@ -111373,39 +110788,10 @@ } ] }, - { - "kind": "type_alias", - "name": { - "name": "DataframeAnalysisAnalyzedFields", - "namespace": "ml._types" - }, - "type": { - "items": [ - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - }, - { - "kind": "instance_of", - "type": { - "name": "DataframeAnalysisAnalyzedFieldsIncludeExclude", - "namespace": "ml._types" - } - } - ], - "kind": "union_of" - } - }, { "kind": "interface", "name": { - "name": "DataframeAnalysisAnalyzedFieldsIncludeExclude", + "name": "DataframeAnalysisAnalyzedFields", "namespace": "ml._types" }, "properties": [ @@ -111439,7 +110825,8 @@ } } } - ] + ], + "shortcutProperty": "includes" }, { "inherits": { @@ -130170,23 +129557,11 @@ "name": "type", "required": true, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "NodeInfoSettingsHttpType", - "namespace": "nodes.info" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "NodeInfoSettingsHttpType", + "namespace": "nodes.info" + } } }, { @@ -130266,7 +129641,8 @@ } } } - ] + ], + "shortcutProperty": "default" }, { "kind": "interface", @@ -130731,23 +130107,11 @@ "name": "type", "required": true, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "NodeInfoSettingsTransportType", - "namespace": "nodes.info" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "NodeInfoSettingsTransportType", + "namespace": "nodes.info" + } } }, { @@ -130812,7 +130176,8 @@ } } } - ] + ], + "shortcutProperty": "default" }, { "kind": "interface", @@ -131759,7 +131124,7 @@ { "kind": "interface", "name": { - "name": "NodeReloadException", + "name": "NodeReloadError", "namespace": "nodes.reload_secure_settings" }, "properties": [ @@ -131780,54 +131145,42 @@ "type": { "kind": "instance_of", "type": { - "name": "NodeReloadExceptionCausedBy", - "namespace": "nodes.reload_secure_settings" + "name": "ErrorCause", + "namespace": "_types" } } } ] }, { - "kind": "interface", + "codegenNames": [ + "stats", + "error" + ], + "kind": "type_alias", "name": { - "name": "NodeReloadExceptionCausedBy", + "name": "NodeReloadResult", "namespace": "nodes.reload_secure_settings" }, - "properties": [ - { - "name": "type", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - }, - { - "name": "reason", - "required": true, - "type": { + "type": { + "items": [ + { "kind": "instance_of", "type": { - "name": "string", - "namespace": "internal" + "name": "Stats", + "namespace": "nodes._types" } - } - }, - { - "name": "caused_by", - "required": false, - "type": { + }, + { "kind": "instance_of", "type": { - "name": "NodeReloadExceptionCausedBy", + "name": "NodeReloadError", "namespace": "nodes.reload_secure_settings" } } - } - ] + ], + "kind": "union_of" + } }, { "attachedBehaviors": [ @@ -131919,23 +131272,11 @@ "kind": "dictionary_of", "singleKey": false, "value": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "Stats", - "namespace": "nodes._types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "NodeReloadException", - "namespace": "nodes.reload_secure_settings" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "NodeReloadResult", + "namespace": "nodes.reload_secure_settings" + } } } } @@ -134963,10 +134304,13 @@ } }, { - "kind": "instance_of", - "type": { - "name": "QueryContainer", - "namespace": "_types.query_dsl" + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } } } ], @@ -137294,88 +136638,6 @@ "namespace": "security.get_privileges" } }, - { - "kind": "interface", - "name": { - "name": "InlineRoleTemplate", - "namespace": "security.get_role" - }, - "properties": [ - { - "name": "template", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "InlineRoleTemplateSource", - "namespace": "security.get_role" - } - } - }, - { - "name": "format", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TemplateFormat", - "namespace": "security.get_role" - } - } - } - ] - }, - { - "kind": "interface", - "name": { - "name": "InlineRoleTemplateSource", - "namespace": "security.get_role" - }, - "properties": [ - { - "name": "source", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - } - ] - }, - { - "kind": "interface", - "name": { - "name": "InvalidRoleTemplate", - "namespace": "security.get_role" - }, - "properties": [ - { - "name": "template", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - }, - { - "name": "format", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TemplateFormat", - "namespace": "security.get_role" - } - } - } - ] - }, { "attachedBehaviors": [ "CommonQueryParameters" @@ -137545,57 +136807,13 @@ } ] }, - { - "kind": "type_alias", - "name": { - "name": "RoleTemplate", - "namespace": "security.get_role" - }, - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "InlineRoleTemplate", - "namespace": "security.get_role" - } - }, - { - "kind": "instance_of", - "type": { - "name": "StoredRoleTemplate", - "namespace": "security.get_role" - } - }, - { - "kind": "instance_of", - "type": { - "name": "InvalidRoleTemplate", - "namespace": "security.get_role" - } - } - ], - "kind": "union_of" - } - }, { "kind": "interface", "name": { - "name": "StoredRoleTemplate", + "name": "RoleTemplate", "namespace": "security.get_role" }, "properties": [ - { - "name": "template", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "StoredRoleTemplateId", - "namespace": "security.get_role" - } - } - }, { "name": "format", "required": false, @@ -137606,24 +136824,15 @@ "namespace": "security.get_role" } } - } - ] - }, - { - "kind": "interface", - "name": { - "name": "StoredRoleTemplateId", - "namespace": "security.get_role" - }, - "properties": [ + }, { - "name": "id", + "name": "template", "required": true, "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "internal" + "name": "Script", + "namespace": "_types" } } } @@ -144508,30 +143717,11 @@ "name": "_source", "required": true, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "internal" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Fields", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "SourceFilter", - "namespace": "_global.search._types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "SourceConfig", + "namespace": "_global.search._types" + } } }, { @@ -144706,6 +143896,24 @@ "namespace": "ssl.certificates" } }, + { + "kind": "enum", + "members": [ + { + "name": "nodes" + }, + { + "name": "parents" + }, + { + "name": "none" + } + ], + "name": { + "name": "GroupBy", + "namespace": "tasks._types" + } + }, { "kind": "interface", "name": { @@ -145550,7 +144758,7 @@ "kind": "instance_of", "type": { "name": "GroupBy", - "namespace": "_types" + "namespace": "tasks._types" } } }, @@ -145651,37 +144859,22 @@ "name": "tasks", "required": false, "type": { - "items": [ - { - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "Info", - "namespace": "tasks._types" - } - } - }, - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "Info", - "namespace": "tasks._types" - } - } + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" } - ], - "kind": "union_of" + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "Info", + "namespace": "tasks._types" + } + } } } ] @@ -148939,26 +148132,14 @@ "name": "at", "required": true, "type": { - "items": [ - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - }, - { - "kind": "instance_of", - "type": { - "name": "TimeOfDay", - "namespace": "watcher._types" - } + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "TimeOfDay", + "namespace": "watcher._types" } - ], - "kind": "union_of" + } } } ] @@ -149440,6 +148621,43 @@ } ] }, + { + "kind": "interface", + "name": { + "name": "HourAndMinute", + "namespace": "watcher._types" + }, + "properties": [ + { + "name": "hour", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + } + }, + { + "name": "minute", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + } + } + ] + }, { "kind": "interface", "name": { @@ -150695,46 +149913,22 @@ "name": "scheduled_time", "required": true, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "DateString", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "DateString", + "namespace": "_types" + } } }, { "name": "triggered_time", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "DateString", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "DateString", + "namespace": "_types" + } } } ] @@ -151370,41 +150564,34 @@ ] }, { - "kind": "interface", + "codegenNames": [ + "text", + "hour_minute" + ], + "kind": "type_alias", "name": { "name": "TimeOfDay", "namespace": "watcher._types" }, - "properties": [ - { - "name": "hour", - "required": true, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" } - } - }, - { - "name": "minute", - "required": true, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } + }, + { + "kind": "instance_of", + "type": { + "name": "HourAndMinute", + "namespace": "watcher._types" } } - } - ] + ], + "kind": "union_of" + } }, { "kind": "interface", @@ -154227,37 +153414,6 @@ } ] }, - { - "kind": "interface", - "name": { - "name": "BaseUrlConfig", - "namespace": "xpack.usage" - }, - "properties": [ - { - "name": "url_name", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - }, - { - "name": "url_value", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - } - } - ] - }, { "inherits": { "type": { @@ -155110,26 +154266,47 @@ ] }, { - "inherits": { - "type": { - "name": "BaseUrlConfig", - "namespace": "xpack.usage" + "attachedBehaviors": [ + "AdditionalProperties" + ], + "behaviors": [ + { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "internal" + } + }, + { + "kind": "instance_of", + "type": { + "name": "Job", + "namespace": "ml._types" + } + } + ], + "type": { + "name": "AdditionalProperties", + "namespace": "_spec_utils" + } } - }, + ], "kind": "interface", "name": { - "name": "KibanaUrlConfig", + "name": "Jobs", "namespace": "xpack.usage" }, "properties": [ { - "name": "time_range", + "name": "_all", "required": false, "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "internal" + "name": "AllJobs", + "namespace": "xpack.usage" } } } @@ -155174,45 +154351,11 @@ "name": "jobs", "required": true, "type": { - "items": [ - { - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "Job", - "namespace": "ml._types" - } - } - }, - { - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "internal" - } - }, - "kind": "dictionary_of", - "singleKey": true, - "value": { - "kind": "instance_of", - "type": { - "name": "AllJobs", - "namespace": "xpack.usage" - } - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "Jobs", + "namespace": "xpack.usage" + } } }, { @@ -156956,32 +156099,6 @@ } ] }, - { - "kind": "type_alias", - "name": { - "name": "UrlConfig", - "namespace": "xpack.usage" - }, - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "BaseUrlConfig", - "namespace": "xpack.usage" - } - }, - { - "kind": "instance_of", - "type": { - "name": "KibanaUrlConfig", - "namespace": "xpack.usage" - } - } - ], - "kind": "union_of" - } - }, { "inherits": { "type": { diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 1cfd231116..efddc3ab70 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -1365,9 +1365,7 @@ "request": [ "Request: should not have a body" ], - "response": [ - "type_alias definition xpack.usage:UrlConfig / union_of / instance_of - Non-leaf type cannot be used here: 'xpack.usage:BaseUrlConfig'" - ] + "response": [] }, "ml.get_overall_buckets": { "request": [ diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 4ba35b5eae..b211b560db 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -51,7 +51,7 @@ export interface BulkRequest extends RequestBase { pipeline?: string refresh?: Refresh routing?: Routing - _source?: boolean | Fields + _source?: SearchGetSourceConfig _source_excludes?: Fields _source_includes?: Fields timeout?: Time @@ -204,7 +204,7 @@ export interface DeleteByQueryRequest extends RequestBase { size?: long slices?: long sort?: string[] - _source?: boolean | Fields + _source?: SearchGetSourceConfig _source_excludes?: Fields _source_includes?: Fields stats?: string[] @@ -262,7 +262,7 @@ export interface ExistsRequest extends RequestBase { realtime?: boolean refresh?: boolean routing?: Routing - _source?: boolean | Fields + _source?: SearchGetSourceConfig _source_excludes?: Fields _source_includes?: Fields stored_fields?: Fields @@ -280,7 +280,7 @@ export interface ExistsSourceRequest extends RequestBase { realtime?: boolean refresh?: boolean routing?: Routing - _source?: boolean | Fields + _source?: SearchGetSourceConfig _source_excludes?: Fields _source_includes?: Fields version?: VersionNumber @@ -312,7 +312,7 @@ export interface ExplainRequest extends RequestBase { lenient?: boolean preference?: string routing?: Routing - _source?: boolean | Fields + _source?: SearchGetSourceConfig _source_excludes?: Fields _source_includes?: Fields stored_fields?: Fields @@ -368,7 +368,7 @@ export interface GetRequest extends RequestBase { realtime?: boolean refresh?: boolean routing?: Routing - _source?: boolean | Fields + _source?: SearchGetSourceConfig _source_excludes?: Fields _source_includes?: Fields stored_fields?: Fields @@ -444,7 +444,7 @@ export interface GetSourceRequest { realtime?: boolean refresh?: boolean routing?: Routing - _source?: boolean | Fields + _source?: SearchGetSourceConfig _source_excludes?: Fields _source_includes?: Fields stored_fields?: Fields @@ -506,7 +506,7 @@ export interface MgetOperation { _id: MgetMultiGetId _index?: IndexName routing?: Routing - _source?: boolean | Fields | SearchSourceFilter + _source?: SearchSourceConfig stored_fields?: Fields _type?: Type version?: VersionNumber @@ -520,7 +520,7 @@ export interface MgetRequest extends RequestBase { realtime?: boolean refresh?: boolean routing?: Routing - _source?: boolean | Fields + _source?: SearchGetSourceConfig _source_excludes?: Fields _source_includes?: Fields stored_fields?: Fields @@ -541,8 +541,8 @@ export interface MsearchBody { from?: integer size?: integer pit?: SearchPointInTimeReference - track_total_hits?: boolean | integer - suggest?: SearchSuggestContainer | Record + track_total_hits?: SearchTrackHits + suggest?: SearchSuggester } export interface MsearchHeader { @@ -675,7 +675,7 @@ export interface PutScriptRequest extends RequestBase { master_timeout?: Time timeout?: Time body?: { - script?: StoredScript + script: StoredScript } } @@ -905,7 +905,7 @@ export interface ScriptsPainlessExecuteRequest extends RequestBase { body?: { context?: string context_setup?: ScriptsPainlessExecutePainlessContextSetup - script?: InlineScript + script?: InlineScript | string } } @@ -959,12 +959,12 @@ export interface SearchRequest extends RequestBase { suggest_text?: string terminate_after?: long timeout?: Time - track_total_hits?: boolean | integer + track_total_hits?: SearchTrackHits track_scores?: boolean typed_keys?: boolean rest_total_hits_as_int?: boolean version?: boolean - _source?: boolean | Fields + _source?: SearchGetSourceConfig _source_excludes?: Fields _source_includes?: Fields seq_no_primary_term?: boolean @@ -979,9 +979,9 @@ export interface SearchRequest extends RequestBase { explain?: boolean from?: integer highlight?: SearchHighlight - track_total_hits?: boolean | integer + track_total_hits?: SearchTrackHits indices_boost?: Record[] - docvalue_fields?: SearchDocValueField | (Field | SearchDocValueField)[] + docvalue_fields?: (QueryDslFieldAndFormat | Field)[] min_score?: double post_filter?: QueryDslQueryContainer profile?: boolean @@ -992,9 +992,9 @@ export interface SearchRequest extends RequestBase { size?: integer slice?: SlicedScroll sort?: SearchSort - _source?: boolean | Fields | SearchSourceFilter - fields?: (Field | DateField)[] - suggest?: SearchSuggestContainer | Record + _source?: SearchSourceConfig + fields?: (QueryDslFieldAndFormat | Field)[] + suggest?: SearchSuggester terminate_after?: long timeout?: string track_scores?: boolean @@ -1090,6 +1090,8 @@ export interface SearchAggregationProfileDelegateDebugFilter { export type SearchBoundaryScanner = 'chars' | 'sentence' | 'word' +export type SearchBuiltinHighlighterType = 'plain' | 'fvh' | 'unified' + export interface SearchCollector { name: string reason: string @@ -1097,6 +1099,14 @@ export interface SearchCollector { children?: SearchCollector[] } +export interface SearchCompletionContext { + boost?: double + context: SearchContext + neighbours?: GeoHashPrecision[] + precision?: GeoHashPrecision + prefix?: boolean +} + export interface SearchCompletionSuggestOption { collate_match?: boolean contexts?: Record @@ -1111,14 +1121,14 @@ export interface SearchCompletionSuggestOption { } export interface SearchCompletionSuggester extends SearchSuggesterBase { - contexts?: Record + contexts?: Record fuzzy?: SearchSuggestFuzziness prefix?: string regex?: string skip_duplicates?: boolean } -export type SearchContext = string | QueryDslGeoLocation +export type SearchContext = string | GeoLocation export interface SearchDirectGenerator { field: Field @@ -1134,11 +1144,6 @@ export interface SearchDirectGenerator { suggest_mode?: SuggestMode } -export interface SearchDocValueField { - field: Field - format?: string -} - export interface SearchFetchProfile { type: string description: string @@ -1162,12 +1167,6 @@ export interface SearchFetchProfileDebug { fast_path?: integer } -export interface SearchFieldAndFormat { - field: Field - format?: string - include_unmapped?: boolean -} - export interface SearchFieldCollapse { field: Field inner_hits?: SearchInnerHits | SearchInnerHits[] @@ -1180,16 +1179,32 @@ export interface SearchFieldSort { nested?: SearchNestedSortValue order?: SearchSortOrder unmapped_type?: MappingFieldType + numeric_type?: SearchFieldSortNumericType + format?: string +} + +export type SearchFieldSortNumericType = 'long' | 'double' | 'date' | 'date_nanos' + +export interface SearchFieldSuggester { + completion?: SearchCompletionSuggester + phrase?: SearchPhraseSuggester + prefix?: string + regex?: string + term?: SearchTermSuggester + text?: string } export interface SearchGeoDistanceSortKeys { mode?: SearchSortMode distance_type?: GeoDistanceType + ignore_unmapped?: boolean order?: SearchSortOrder unit?: DistanceUnit } export type SearchGeoDistanceSort = SearchGeoDistanceSortKeys - & { [property: string]: QueryDslGeoLocation | QueryDslGeoLocation[] | SearchSortMode | GeoDistanceType | SearchSortOrder | DistanceUnit } + & { [property: string]: GeoLocation | GeoLocation[] | SearchSortMode | GeoDistanceType | boolean | SearchSortOrder | DistanceUnit } + +export type SearchGetSourceConfig = boolean | Fields export interface SearchHighlight { fields: Record @@ -1235,7 +1250,7 @@ export interface SearchHighlightField { pre_tags?: string[] require_field_match?: boolean tags_schema?: SearchHighlighterTagsSchema - type?: SearchHighlighterType | string + type?: SearchHighlighterType } export type SearchHighlighterEncoder = 'default' | 'html' @@ -1246,7 +1261,7 @@ export type SearchHighlighterOrder = 'score' export type SearchHighlighterTagsSchema = 'styled' -export type SearchHighlighterType = 'plain' | 'fvh' | 'unified' +export type SearchHighlighterType = SearchBuiltinHighlighterType | string export interface SearchHit { _index: IndexName @@ -1281,7 +1296,7 @@ export interface SearchInnerHits { size?: integer from?: integer collapse?: SearchFieldCollapse - docvalue_fields?: (SearchFieldAndFormat | Field)[] + docvalue_fields?: (QueryDslFieldAndFormat | Field)[] explain?: boolean highlight?: SearchHighlight ignore_unmapped?: boolean @@ -1289,20 +1304,14 @@ export interface SearchInnerHits { seq_no_primary_term?: boolean fields?: Fields sort?: SearchSort - _source?: boolean | SearchSourceFilter + _source?: SearchSourceConfig stored_field?: Fields track_scores?: boolean version?: boolean } -export interface SearchInnerHitsMetadata { - total: SearchTotalHits | long - hits: SearchHit>[] - max_score?: double -} - export interface SearchInnerHitsResult { - hits: SearchInnerHitsMetadata + hits: SearchHitsMetadata } export interface SearchLaplaceSmoothingModel { @@ -1324,6 +1333,7 @@ export interface SearchNestedIdentity { export interface SearchNestedSortValue { filter?: QueryDslQueryContainer max_children?: integer + nested?: SearchNestedSortValue path: Field } @@ -1418,16 +1428,19 @@ export interface SearchRescoreQuery { export type SearchScoreMode = 'avg' | 'max' | 'min' | 'multiply' | 'total' export interface SearchScoreSort { - mode?: SearchSortMode order?: SearchSortOrder } export interface SearchScriptSort { order?: SearchSortOrder script: Script - type?: string + type?: SearchScriptSortType + mode?: SearchSortMode + nested?: SearchNestedSortValue } +export type SearchScriptSortType = 'string' | 'number' + export interface SearchSearchProfile { collector: SearchCollector[] query: SearchQueryProfile[] @@ -1449,27 +1462,29 @@ export interface SearchSmoothingModelContainer { export type SearchSort = SearchSortCombinations | SearchSortCombinations[] -export type SearchSortCombinations = Field | SearchSortContainer | SearchSortOrder +export type SearchSortCombinations = Field | SearchSortOptions + +export type SearchSortMode = 'min' | 'max' | 'sum' | 'avg' | 'median' -export interface SearchSortContainerKeys { +export interface SearchSortOptionsKeys { _score?: SearchScoreSort _doc?: SearchScoreSort _geo_distance?: SearchGeoDistanceSort _script?: SearchScriptSort } -export type SearchSortContainer = SearchSortContainerKeys +export type SearchSortOptions = SearchSortOptionsKeys & { [property: string]: SearchFieldSort | SearchSortOrder | SearchScoreSort | SearchGeoDistanceSort | SearchScriptSort } -export type SearchSortMode = 'min' | 'max' | 'sum' | 'avg' | 'median' - -export type SearchSortOrder = 'asc' | 'desc' | '_doc' +export type SearchSortOrder = 'asc' | 'desc' export type SearchSortResults = (long | double | string | null)[] +export type SearchSourceConfig = boolean | SearchSourceFilter | Fields + export interface SearchSourceFilter { excludes?: Fields - includes?: Fields exclude?: Fields + includes?: Fields include?: Fields } @@ -1486,23 +1501,6 @@ export interface SearchSuggest { text: string } -export interface SearchSuggestContainer { - completion?: SearchCompletionSuggester - phrase?: SearchPhraseSuggester - prefix?: string - regex?: string - term?: SearchTermSuggester - text?: string -} - -export interface SearchSuggestContextQuery { - boost?: double - context: SearchContext - neighbours?: Distance[] | integer[] - precision?: Distance | integer - prefix?: boolean -} - export interface SearchSuggestFuzziness { fuzziness: Fuzziness min_length: integer @@ -1515,6 +1513,12 @@ export type SearchSuggestOption = SearchCompletionSuggestOp export type SearchSuggestSort = 'score' | 'frequency' +export interface SearchSuggesterKeys { + text?: string +} +export type SearchSuggester = SearchSuggesterKeys + & { [property: string]: SearchFieldSuggester | string } + export interface SearchSuggesterBase { field: Field analyzer?: string @@ -1549,6 +1553,8 @@ export interface SearchTotalHits { export type SearchTotalHitsRelation = 'eq' | 'gte' +export type SearchTrackHits = boolean | integer + export interface SearchMvtRequest extends RequestBase { index: Indices field: Field @@ -1735,7 +1741,7 @@ export interface UpdateRequest routing?: Routing timeout?: Time wait_for_active_shards?: WaitForActiveShards - _source?: boolean | Fields + _source?: SearchGetSourceConfig _source_excludes?: Fields _source_includes?: Fields body?: { @@ -1744,7 +1750,7 @@ export interface UpdateRequest doc_as_upsert?: boolean script?: Script scripted_upsert?: boolean - _source?: boolean | SearchSourceFilter + _source?: SearchSourceConfig upsert?: TDocument } } @@ -1779,7 +1785,7 @@ export interface UpdateByQueryRequest extends RequestBase { size?: long slices?: long sort?: string[] - _source?: boolean | Fields + _source?: SearchGetSourceConfig _source_excludes?: Fields _source_includes?: Fields stats?: string[] @@ -1845,6 +1851,8 @@ export interface AcknowledgedResponseBase { export type AggregateName = string +export type BuiltinScriptLanguage = 'painless' | 'expression' | 'mustache' | 'java' + export interface BulkIndexByScrollFailure { cause: ErrorCause id: Id @@ -1889,16 +1897,17 @@ export interface CompletionStats { export type Conflicts = 'abort' | 'proceed' +export interface CoordsGeoBounds { + top: double + bottom: double + left: double + right: double +} + export type DataStreamName = string export type DataStreamNames = DataStreamName | DataStreamName[] -export interface DateField { - field: Field - format?: string - include_unmapped?: boolean -} - export type DateFormat = string export type DateMath = string @@ -1956,9 +1965,9 @@ export interface ErrorResponseBase { status: integer } -export type ExpandWildcardOptions = 'all' | 'open' | 'closed' | 'hidden' | 'none' +export type ExpandWildcard = 'all' | 'open' | 'closed' | 'hidden' | 'none' -export type ExpandWildcards = ExpandWildcardOptions | ExpandWildcardOptions[] | string +export type ExpandWildcards = ExpandWildcard | ExpandWildcard[] export type Field = string @@ -1972,6 +1981,8 @@ export interface FieldSizeUsage { size_in_bytes: long } +export type FieldValue = long | double | string | boolean + export interface FielddataStats { evictions?: long memory_size?: ByteSize @@ -1990,17 +2001,25 @@ export interface FlushStats { export type Fuzziness = string | integer +export type GeoBounds = CoordsGeoBounds | TopLeftBottomRightGeoBounds | TopRightBottomLeftGeoBounds | WktGeoBounds + export type GeoDistanceType = 'arc' | 'plane' export type GeoHash = string -export type GeoHashPrecision = number +export interface GeoHashLocation { + geohash: GeoHash +} + +export type GeoHashPrecision = number | string export interface GeoLine { type: string coordinates: double[][] } +export type GeoLocation = LatLonGeoLocation | GeoHashLocation | double[] | string + export type GeoShape = any export type GeoShapeRelation = 'intersects' | 'disjoint' | 'within' | 'contains' @@ -2022,8 +2041,6 @@ export interface GetStats { total: long } -export type GroupBy = 'nodes' | 'parents' | 'none' - export type Health = 'green' | 'yellow' | 'red' export type Host = string @@ -2042,10 +2059,6 @@ export type IndexPattern = string export type IndexPatterns = IndexPattern[] -export interface IndexedScript extends ScriptBase { - id: Id -} - export interface IndexingStats { index_current: long delete_current: long @@ -2081,12 +2094,14 @@ export type InlineGet = InlineGetKeys & { [property: string]: any } export interface InlineScript extends ScriptBase { + lang?: ScriptLanguage + options?: Record source: string } export type Ip = string -export interface LatLon { +export interface LatLonGeoLocation { lat: double lon: double } @@ -2208,9 +2223,7 @@ export interface RecoveryStats { throttle_time_in_millis: long } -export type Refresh = boolean | RefreshOptions - -export type RefreshOptions = 'wait_for' +export type Refresh = boolean | 'true' | 'false' | 'wait_for' export interface RefreshStats { external_total: long @@ -2243,12 +2256,9 @@ export interface Retries { export type Routing = string -export type ScalarValue = long | double | string | boolean - -export type Script = InlineScript | IndexedScript | string +export type Script = InlineScript | string | StoredScriptId export interface ScriptBase { - lang?: ScriptLanguage | string params?: Record } @@ -2257,7 +2267,7 @@ export interface ScriptField { ignore_failure?: boolean } -export type ScriptLanguage = 'painless' | 'expression' | 'mustache' | 'java' +export type ScriptLanguage = BuiltinScriptLanguage | string export interface ScriptTransform { lang: string @@ -2321,8 +2331,6 @@ export type SequenceNumber = long export type Service = string -export type ShapeRelation = 'intersects' | 'disjoint' | 'within' - export interface ShardFailure { index?: IndexName node?: string @@ -2343,8 +2351,6 @@ export interface ShardsOperationResponseBase { _shards: ShardStatistics } -export type Size = 'Raw' | 'k' | 'm' | 'g' | 't' | 'p' - export interface SlicedScroll { field?: Field id: integer @@ -2361,10 +2367,15 @@ export interface StoreStats { } export interface StoredScript { - lang?: ScriptLanguage | string + lang: ScriptLanguage + options?: Record source: string } +export interface StoredScriptId extends ScriptBase { + id: Id +} + export type SuggestMode = 'missing' | 'popular' | 'always' export type SuggestionName = string @@ -2383,6 +2394,16 @@ export type TimeZone = string export type Timestamp = string +export interface TopLeftBottomRightGeoBounds { + top_left: GeoLocation + bottom_right: GeoLocation +} + +export interface TopRightBottomLeftGeoBounds { + top_right: GeoLocation + bottom_left: GeoLocation +} + export interface Transform { [key: string]: never } @@ -2434,6 +2455,10 @@ export interface WarmerStats { total_time_in_millis: long } +export interface WktGeoBounds { + wkt: string +} + export interface WriteResponseBase { _id: Id _index: IndexName @@ -2643,6 +2668,10 @@ export interface AggregationsBucketSortAggregation extends AggregationsAggregati export type AggregationsBuckets = Record | TBucket[] +export type AggregationsBucketsPath = string | string[] | Record + +export type AggregationsCalendarInterval = 'second' | '1s' | 'minute' | '1m' | 'hour' | '1h' | 'day' | '1d' | 'week' | '1w' | 'month' | '1M' | 'quarter' | '1q' | 'year' | '1Y' + export interface AggregationsCardinalityAggregate extends AggregationsAggregateBase { value: long } @@ -2715,13 +2744,13 @@ export interface AggregationsDateHistogramAggregate extends AggregationsMultiBuc } export interface AggregationsDateHistogramAggregation extends AggregationsBucketAggregationBase { - calendar_interval?: AggregationsDateInterval | Time - extended_bounds?: AggregationsExtendedBounds - hard_bounds?: AggregationsExtendedBounds + calendar_interval?: AggregationsCalendarInterval + extended_bounds?: AggregationsExtendedBounds + hard_bounds?: AggregationsExtendedBounds field?: Field - fixed_interval?: AggregationsDateInterval | Time + fixed_interval?: Time format?: string - interval?: AggregationsDateInterval | Time + interval?: Time min_doc_count?: integer missing?: DateString offset?: Time @@ -2739,8 +2768,6 @@ export interface AggregationsDateHistogramBucketKeys extends AggregationsMultiBu export type AggregationsDateHistogramBucket = AggregationsDateHistogramBucketKeys & { [property: string]: AggregationsAggregate | string | EpochMillis | long } -export type AggregationsDateInterval = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year' - export interface AggregationsDateRangeAggregate extends AggregationsRangeAggregate { } @@ -2754,12 +2781,9 @@ export interface AggregationsDateRangeAggregation extends AggregationsBucketAggr } export interface AggregationsDateRangeExpression { - from?: DateMath | float - from_as_string?: string - to_as_string?: string + from?: AggregationsFieldDateMath key?: string - to?: DateMath | float - doc_count?: long + to?: AggregationsFieldDateMath } export interface AggregationsDerivativeAggregate extends AggregationsSingleMetricAggregateBase { @@ -2792,6 +2816,11 @@ export interface AggregationsEwmaModelSettings { alpha?: float } +export interface AggregationsEwmaMovingAverageAggregation extends AggregationsMovingAverageAggregationBase { + model: 'ewma' + settings: AggregationsEwmaModelSettings +} + export interface AggregationsExtendedBounds { max: T min: T @@ -2823,6 +2852,8 @@ export interface AggregationsExtendedStatsBucketAggregation extends Aggregations sigma?: double } +export type AggregationsFieldDateMath = DateMath | double + export interface AggregationsFilterAggregate extends AggregationsSingleBucketAggregateBase { } @@ -2830,7 +2861,7 @@ export interface AggregationsFiltersAggregate extends AggregationsMultiBucketAgg } export interface AggregationsFiltersAggregation extends AggregationsBucketAggregationBase { - filters?: Record | QueryDslQueryContainer[] + filters?: AggregationsBuckets other_bucket?: boolean other_bucket_key?: string keyed?: boolean @@ -2851,13 +2882,8 @@ export interface AggregationsFormattableMetricAggregation extends AggregationsMe export type AggregationsGapPolicy = 'skip' | 'insert_zeros' -export interface AggregationsGeoBounds { - bottom_right: LatLon - top_left: LatLon -} - export interface AggregationsGeoBoundsAggregate extends AggregationsAggregateBase { - bounds: AggregationsGeoBounds + bounds: GeoBounds } export interface AggregationsGeoBoundsAggregation extends AggregationsMetricAggregationBase { @@ -2866,12 +2892,12 @@ export interface AggregationsGeoBoundsAggregation extends AggregationsMetricAggr export interface AggregationsGeoCentroidAggregate extends AggregationsAggregateBase { count: long - location?: QueryDslGeoLocation + location?: GeoLocation } export interface AggregationsGeoCentroidAggregation extends AggregationsMetricAggregationBase { count?: long - location?: QueryDslGeoLocation + location?: GeoLocation } export interface AggregationsGeoDistanceAggregate extends AggregationsRangeAggregate { @@ -2880,7 +2906,7 @@ export interface AggregationsGeoDistanceAggregate extends AggregationsRangeAggre export interface AggregationsGeoDistanceAggregation extends AggregationsBucketAggregationBase { distance_type?: GeoDistanceType field?: Field - origin?: QueryDslGeoLocation | string + origin?: GeoLocation ranges?: AggregationsAggregationRange[] unit?: DistanceUnit } @@ -2889,7 +2915,7 @@ export interface AggregationsGeoHashGridAggregate extends AggregationsMultiBucke } export interface AggregationsGeoHashGridAggregation extends AggregationsBucketAggregationBase { - bounds?: QueryDslBoundingBox + bounds?: GeoBounds field?: Field precision?: GeoHashPrecision shard_size?: integer @@ -2903,7 +2929,7 @@ export type AggregationsGeoHashGridBucket = AggregationsGeoHashGridBucketKeys & { [property: string]: AggregationsAggregate | GeoHash | long } export interface AggregationsGeoLineAggregate extends AggregationsAggregateBase { - type: 'Feature' + type: string geometry: GeoLine } @@ -2931,7 +2957,7 @@ export interface AggregationsGeoTileGridAggregation extends AggregationsBucketAg precision?: GeoTilePrecision shard_size?: integer size?: integer - bounds?: AggregationsGeoBounds + bounds?: GeoBounds } export interface AggregationsGeoTileGridBucketKeys extends AggregationsMultiBucketBase { @@ -2994,6 +3020,11 @@ export interface AggregationsHoltLinearModelSettings { beta?: float } +export interface AggregationsHoltMovingAverageAggregation extends AggregationsMovingAverageAggregationBase { + model: 'holt' + settings: AggregationsHoltLinearModelSettings +} + export interface AggregationsHoltWintersModelSettings { alpha?: float beta?: float @@ -3003,10 +3034,15 @@ export interface AggregationsHoltWintersModelSettings { type?: AggregationsHoltWintersType } +export interface AggregationsHoltWintersMovingAverageAggregation extends AggregationsMovingAverageAggregationBase { + model: 'holt_winters' + settings: AggregationsHoltWintersModelSettings +} + export type AggregationsHoltWintersType = 'add' | 'mult' export interface AggregationsInferenceAggregateKeys extends AggregationsAggregateBase { - value?: ScalarValue + value?: FieldValue feature_importance?: AggregationsInferenceFeatureImportance[] top_classes?: AggregationsInferenceTopClassEntry[] warning?: string @@ -3036,7 +3072,7 @@ export interface AggregationsInferenceFeatureImportance { } export interface AggregationsInferenceTopClassEntry { - class_name: ScalarValue + class_name: FieldValue class_probability: double class_score: double } @@ -3064,6 +3100,11 @@ export type AggregationsIpRangeBucket = AggregationsIpRangeBucketKeys export type AggregationsKeyedPercentiles = Record +export interface AggregationsLinearMovingAverageAggregation extends AggregationsMovingAverageAggregationBase { + model: 'linear' + settings: EmptyObject +} + export interface AggregationsLongRareTermsAggregate extends AggregationsMultiBucketAggregateBase { } @@ -3156,18 +3197,14 @@ export interface AggregationsMissingAggregation extends AggregationsBucketAggreg export type AggregationsMissingOrder = 'first' | 'last' | 'default' -export interface AggregationsMovingAverageAggregation extends AggregationsPipelineAggregationBase { +export type AggregationsMovingAverageAggregation = AggregationsLinearMovingAverageAggregation | AggregationsSimpleMovingAverageAggregation | AggregationsEwmaMovingAverageAggregation | AggregationsHoltMovingAverageAggregation | AggregationsHoltWintersMovingAverageAggregation + +export interface AggregationsMovingAverageAggregationBase extends AggregationsPipelineAggregationBase { minimize?: boolean - model?: AggregationsMovingAverageModel - settings: AggregationsMovingAverageSettings predict?: integer window?: integer } -export type AggregationsMovingAverageModel = 'linear' | 'simple' | 'ewma' | 'holt' | 'holt_winters' - -export type AggregationsMovingAverageSettings = AggregationsEwmaModelSettings | AggregationsHoltLinearModelSettings | AggregationsHoltWintersModelSettings - export interface AggregationsMovingFunctionAggregation extends AggregationsPipelineAggregationBase { script?: string shift?: integer @@ -3240,8 +3277,10 @@ export interface AggregationsPercentileRanksAggregation extends AggregationsForm tdigest?: AggregationsTDigest } +export type AggregationsPercentiles = AggregationsKeyedPercentiles | AggregationsArrayPercentilesItem[] + export interface AggregationsPercentilesAggregateBase extends AggregationsAggregateBase { - values: AggregationsKeyedPercentiles | AggregationsArrayPercentilesItem[] + values: AggregationsPercentiles } export interface AggregationsPercentilesAggregation extends AggregationsFormatMetricAggregationBase { @@ -3259,7 +3298,7 @@ export interface AggregationsPercentilesBucketAggregation extends AggregationsPi } export interface AggregationsPipelineAggregationBase extends AggregationsAggregation { - buckets_path?: string | string[] | Record + buckets_path?: AggregationsBucketsPath format?: string gap_policy?: AggregationsGapPolicy } @@ -3285,9 +3324,9 @@ export type AggregationsRangeBucket = AggregationsRangeBucketKeys & { [property: string]: AggregationsAggregate | double | string | long } export interface AggregationsRareTermsAggregation extends AggregationsBucketAggregationBase { - exclude?: string | string[] + exclude?: AggregationsTermsExclude field?: Field - include?: string | string[] | AggregationsTermsInclude + include?: AggregationsTermsInclude max_doc_count?: long missing?: AggregationsMissing precision?: double @@ -3300,7 +3339,7 @@ export interface AggregationsRateAggregate extends AggregationsAggregateBase { } export interface AggregationsRateAggregation extends AggregationsFormatMetricAggregationBase { - unit?: AggregationsDateInterval + unit?: AggregationsCalendarInterval mode?: AggregationsRateMode } @@ -3369,7 +3408,7 @@ export type AggregationsSignificantStringTermsBucket = AggregationsSignificantSt export interface AggregationsSignificantTermsAggregation extends AggregationsBucketAggregationBase { background_filter?: QueryDslQueryContainer chi_square?: AggregationsChiSquareHeuristic - exclude?: string | string[] + exclude?: AggregationsTermsExclude execution_hint?: AggregationsTermsAggregationExecutionHint field?: Field gnd?: AggregationsGoogleNormalizedDistanceHeuristic @@ -3391,7 +3430,7 @@ export interface AggregationsSignificantTermsBucketBase extends AggregationsMult export interface AggregationsSignificantTextAggregation extends AggregationsBucketAggregationBase { background_filter?: QueryDslQueryContainer chi_square?: AggregationsChiSquareHeuristic - exclude?: string | string[] + exclude?: AggregationsTermsExclude execution_hint?: AggregationsTermsAggregationExecutionHint field?: Field filter_duplicate_text?: boolean @@ -3407,6 +3446,11 @@ export interface AggregationsSignificantTextAggregation extends AggregationsBuck source_fields?: Fields } +export interface AggregationsSimpleMovingAverageAggregation extends AggregationsMovingAverageAggregationBase { + model: 'simple' + settings: EmptyObject +} + export interface AggregationsSimpleValueAggregate extends AggregationsSingleMetricAggregateBase { } @@ -3531,10 +3575,10 @@ export interface AggregationsTermsAggregateBase extends Aggre export interface AggregationsTermsAggregation extends AggregationsBucketAggregationBase { collect_mode?: AggregationsTermsAggregationCollectMode - exclude?: string | string[] + exclude?: AggregationsTermsExclude execution_hint?: AggregationsTermsAggregationExecutionHint field?: Field - include?: string | string[] | AggregationsTermsInclude + include?: AggregationsTermsInclude min_doc_count?: integer missing?: AggregationsMissing missing_order?: AggregationsMissingOrder @@ -3551,13 +3595,17 @@ export type AggregationsTermsAggregationCollectMode = 'depth_first' | 'breadth_f export type AggregationsTermsAggregationExecutionHint = 'map' | 'global_ordinals' | 'global_ordinals_hash' | 'global_ordinals_low_cardinality' -export type AggregationsTermsAggregationOrder = SearchSortOrder | Record | Record[] +export type AggregationsTermsAggregationOrder = Record | Record[] export interface AggregationsTermsBucketBase extends AggregationsMultiBucketBase { doc_count_error?: long } -export interface AggregationsTermsInclude { +export type AggregationsTermsExclude = string | string[] + +export type AggregationsTermsInclude = string | string[] | AggregationsTermsPartition + +export interface AggregationsTermsPartition { num_partitions: long partition: long } @@ -3580,7 +3628,7 @@ export interface AggregationsTopHitsAggregation extends AggregationsMetricAggreg script_fields?: Record size?: integer sort?: SearchSort - _source?: boolean | SearchSourceFilter | Fields + _source?: SearchSourceConfig stored_fields?: Fields track_scores?: boolean version?: boolean @@ -3588,8 +3636,8 @@ export interface AggregationsTopHitsAggregation extends AggregationsMetricAggreg } export interface AggregationsTopMetrics { - sort: (ScalarValue | null)[] - metrics: Record + sort: (FieldValue | null)[] + metrics: Record } export interface AggregationsTopMetricsAggregate extends AggregationsMultiBucketAggregateBase { @@ -3672,12 +3720,14 @@ export interface AnalysisAsciiFoldingTokenFilter extends AnalysisTokenFilterBase preserve_original: boolean } -export type AnalysisCharFilter = AnalysisHtmlStripCharFilter | AnalysisMappingCharFilter | AnalysisPatternReplaceCharFilter | AnalysisIcuNormalizationCharFilter | AnalysisKuromojiIterationMarkCharFilter +export type AnalysisCharFilter = string | AnalysisCharFilterDefinition export interface AnalysisCharFilterBase { version?: VersionString } +export type AnalysisCharFilterDefinition = AnalysisHtmlStripCharFilter | AnalysisMappingCharFilter | AnalysisPatternReplaceCharFilter | AnalysisIcuNormalizationCharFilter | AnalysisKuromojiIterationMarkCharFilter + export interface AnalysisCharGroupTokenizer extends AnalysisTokenizerBase { type: 'char_group' tokenize_on_chars: string[] @@ -4201,18 +4251,22 @@ export interface AnalysisSynonymTokenFilter extends AnalysisTokenFilterBase { export type AnalysisTokenChar = 'letter' | 'digit' | 'whitespace' | 'punctuation' | 'symbol' | 'custom' -export type AnalysisTokenFilter = AnalysisAsciiFoldingTokenFilter | AnalysisCommonGramsTokenFilter | AnalysisConditionTokenFilter | AnalysisDelimitedPayloadTokenFilter | AnalysisEdgeNGramTokenFilter | AnalysisElisionTokenFilter | AnalysisFingerprintTokenFilter | AnalysisHunspellTokenFilter | AnalysisHyphenationDecompounderTokenFilter | AnalysisKeepTypesTokenFilter | AnalysisKeepWordsTokenFilter | AnalysisKeywordMarkerTokenFilter | AnalysisKStemTokenFilter | AnalysisLengthTokenFilter | AnalysisLimitTokenCountTokenFilter | AnalysisLowercaseTokenFilter | AnalysisMultiplexerTokenFilter | AnalysisNGramTokenFilter | AnalysisNoriPartOfSpeechTokenFilter | AnalysisPatternCaptureTokenFilter | AnalysisPatternReplaceTokenFilter | AnalysisPorterStemTokenFilter | AnalysisPredicateTokenFilter | AnalysisRemoveDuplicatesTokenFilter | AnalysisReverseTokenFilter | AnalysisShingleTokenFilter | AnalysisSnowballTokenFilter | AnalysisStemmerOverrideTokenFilter | AnalysisStemmerTokenFilter | AnalysisStopTokenFilter | AnalysisSynonymGraphTokenFilter | AnalysisSynonymTokenFilter | AnalysisTrimTokenFilter | AnalysisTruncateTokenFilter | AnalysisUniqueTokenFilter | AnalysisUppercaseTokenFilter | AnalysisWordDelimiterGraphTokenFilter | AnalysisWordDelimiterTokenFilter | AnalysisKuromojiStemmerTokenFilter | AnalysisKuromojiReadingFormTokenFilter | AnalysisKuromojiPartOfSpeechTokenFilter | AnalysisIcuTokenizer | AnalysisIcuCollationTokenFilter | AnalysisIcuFoldingTokenFilter | AnalysisIcuNormalizationTokenFilter | AnalysisIcuTransformTokenFilter | AnalysisPhoneticTokenFilter | AnalysisDictionaryDecompounderTokenFilter +export type AnalysisTokenFilter = string | AnalysisTokenFilterDefinition export interface AnalysisTokenFilterBase { version?: VersionString } -export type AnalysisTokenizer = AnalysisCharGroupTokenizer | AnalysisEdgeNGramTokenizer | AnalysisKeywordTokenizer | AnalysisLetterTokenizer | AnalysisLowercaseTokenizer | AnalysisNGramTokenizer | AnalysisNoriTokenizer | AnalysisPathHierarchyTokenizer | AnalysisStandardTokenizer | AnalysisUaxEmailUrlTokenizer | AnalysisWhitespaceTokenizer | AnalysisKuromojiTokenizer | AnalysisPatternTokenizer | AnalysisIcuTokenizer +export type AnalysisTokenFilterDefinition = AnalysisAsciiFoldingTokenFilter | AnalysisCommonGramsTokenFilter | AnalysisConditionTokenFilter | AnalysisDelimitedPayloadTokenFilter | AnalysisEdgeNGramTokenFilter | AnalysisElisionTokenFilter | AnalysisFingerprintTokenFilter | AnalysisHunspellTokenFilter | AnalysisHyphenationDecompounderTokenFilter | AnalysisKeepTypesTokenFilter | AnalysisKeepWordsTokenFilter | AnalysisKeywordMarkerTokenFilter | AnalysisKStemTokenFilter | AnalysisLengthTokenFilter | AnalysisLimitTokenCountTokenFilter | AnalysisLowercaseTokenFilter | AnalysisMultiplexerTokenFilter | AnalysisNGramTokenFilter | AnalysisNoriPartOfSpeechTokenFilter | AnalysisPatternCaptureTokenFilter | AnalysisPatternReplaceTokenFilter | AnalysisPorterStemTokenFilter | AnalysisPredicateTokenFilter | AnalysisRemoveDuplicatesTokenFilter | AnalysisReverseTokenFilter | AnalysisShingleTokenFilter | AnalysisSnowballTokenFilter | AnalysisStemmerOverrideTokenFilter | AnalysisStemmerTokenFilter | AnalysisStopTokenFilter | AnalysisSynonymGraphTokenFilter | AnalysisSynonymTokenFilter | AnalysisTrimTokenFilter | AnalysisTruncateTokenFilter | AnalysisUniqueTokenFilter | AnalysisUppercaseTokenFilter | AnalysisWordDelimiterGraphTokenFilter | AnalysisWordDelimiterTokenFilter | AnalysisKuromojiStemmerTokenFilter | AnalysisKuromojiReadingFormTokenFilter | AnalysisKuromojiPartOfSpeechTokenFilter | AnalysisIcuTokenizer | AnalysisIcuCollationTokenFilter | AnalysisIcuFoldingTokenFilter | AnalysisIcuNormalizationTokenFilter | AnalysisIcuTransformTokenFilter | AnalysisPhoneticTokenFilter | AnalysisDictionaryDecompounderTokenFilter + +export type AnalysisTokenizer = string | AnalysisTokenizerDefinition export interface AnalysisTokenizerBase { version?: VersionString } +export type AnalysisTokenizerDefinition = AnalysisCharGroupTokenizer | AnalysisEdgeNGramTokenizer | AnalysisKeywordTokenizer | AnalysisLetterTokenizer | AnalysisLowercaseTokenizer | AnalysisNGramTokenizer | AnalysisNoriTokenizer | AnalysisPathHierarchyTokenizer | AnalysisStandardTokenizer | AnalysisUaxEmailUrlTokenizer | AnalysisWhitespaceTokenizer | AnalysisKuromojiTokenizer | AnalysisPatternTokenizer | AnalysisIcuTokenizer + export interface AnalysisTrimTokenFilter extends AnalysisTokenFilterBase { type: 'trim' } @@ -4397,7 +4451,7 @@ export interface MappingDoubleRangeProperty extends MappingRangePropertyBase { type: 'double_range' } -export type MappingDynamicMapping = 'strict' | 'runtime' | 'true' | 'false' +export type MappingDynamicMapping = boolean | 'strict' | 'runtime' | 'true' | 'false' export interface MappingDynamicTemplate { mapping?: MappingProperty @@ -4467,7 +4521,7 @@ export type MappingGeoOrientation = 'right' | 'RIGHT' | 'counterclockwise' | 'cc export interface MappingGeoPointProperty extends MappingDocValuesPropertyBase { ignore_malformed?: boolean ignore_z_value?: boolean - null_value?: QueryDslGeoLocation + null_value?: GeoLocation type: 'geo_point' } @@ -4591,7 +4645,7 @@ export interface MappingPropertyBase { name?: PropertyName properties?: Record ignore_above?: integer - dynamic?: boolean | MappingDynamicMapping + dynamic?: MappingDynamicMapping fields?: Record } @@ -4720,7 +4774,7 @@ export interface MappingTokenCountProperty extends MappingDocValuesPropertyBase export interface MappingTypeMapping { all_field?: MappingAllField date_detection?: boolean - dynamic?: boolean | MappingDynamicMapping + dynamic?: MappingDynamicMapping dynamic_date_formats?: string[] dynamic_templates?: Record | Record[] _field_names?: MappingFieldNamesField @@ -4763,18 +4817,6 @@ export interface QueryDslBoostingQuery extends QueryDslQueryBase { positive: QueryDslQueryContainer } -export interface QueryDslBoundingBox { - bottom_right?: QueryDslGeoLocation - top_left?: QueryDslGeoLocation - top_right?: QueryDslGeoLocation - bottom_left?: QueryDslGeoLocation - top?: double - left?: double - right?: double - bottom?: double - wkt?: string -} - export type QueryDslChildScoreMode = 'none' | 'avg' | 'sum' | 'max' | 'min' export type QueryDslCombinedFieldsOperator = 'or' | 'and' @@ -4852,6 +4894,12 @@ export interface QueryDslExistsQuery extends QueryDslQueryBase { field: Field } +export interface QueryDslFieldAndFormat { + field: Field + format?: string + include_unmapped?: boolean +} + export interface QueryDslFieldLookup { id: Id index?: IndexName @@ -4907,16 +4955,14 @@ export interface QueryDslGeoBoundingBoxQueryKeys extends QueryDslQueryBase { ignore_unmapped?: boolean } export type QueryDslGeoBoundingBoxQuery = QueryDslGeoBoundingBoxQueryKeys - & { [property: string]: QueryDslBoundingBox | QueryDslGeoExecution | QueryDslGeoValidationMethod | boolean | float | string } - -export type QueryDslGeoCoordinate = string | double[] | QueryDslThreeDimensionalPoint + & { [property: string]: GeoBounds | QueryDslGeoExecution | QueryDslGeoValidationMethod | boolean | float | string } export interface QueryDslGeoDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslGeoDecayFunction = QueryDslGeoDecayFunctionKeys - & { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode | QueryDslQueryContainer | double } + & { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode | QueryDslQueryContainer | double } -export interface QueryDslGeoDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { +export interface QueryDslGeoDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } export interface QueryDslGeoDistanceQueryKeys extends QueryDslQueryBase { @@ -4925,14 +4971,12 @@ export interface QueryDslGeoDistanceQueryKeys extends QueryDslQueryBase { validation_method?: QueryDslGeoValidationMethod } export type QueryDslGeoDistanceQuery = QueryDslGeoDistanceQueryKeys - & { [property: string]: QueryDslGeoLocation | Distance | GeoDistanceType | QueryDslGeoValidationMethod | float | string } + & { [property: string]: GeoLocation | Distance | GeoDistanceType | QueryDslGeoValidationMethod | float | string } export type QueryDslGeoExecution = 'memory' | 'indexed' -export type QueryDslGeoLocation = string | double[] | QueryDslTwoDimensionalPoint - export interface QueryDslGeoPolygonPoints { - points: QueryDslGeoLocation[] + points: GeoLocation[] } export interface QueryDslGeoPolygonQueryKeys extends QueryDslQueryBase { @@ -5181,7 +5225,7 @@ export interface QueryDslNumericDecayFunctionKeys extends QueryDslDecayFunctionB export type QueryDslNumericDecayFunction = QueryDslNumericDecayFunctionKeys & { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode | QueryDslQueryContainer | double } -export type QueryDslOperator = 'and' | 'or' +export type QueryDslOperator = 'and' | 'AND' | 'or' | 'OR' export interface QueryDslParentIdQuery extends QueryDslQueryBase { id?: Id @@ -5272,7 +5316,7 @@ export interface QueryDslQueryContainer { span_or?: QueryDslSpanOrQuery span_term?: Partial> span_within?: QueryDslSpanWithinQuery - term?: Partial> + term?: Partial> terms?: QueryDslTermsQuery terms_set?: Partial> wildcard?: Partial> @@ -5377,18 +5421,20 @@ export interface QueryDslScriptScoreQuery extends QueryDslQueryBase { } export interface QueryDslShapeFieldQuery { - ignore_unmapped?: boolean indexed_shape?: QueryDslFieldLookup - relation?: ShapeRelation + relation?: GeoShapeRelation shape?: GeoShape } export interface QueryDslShapeQueryKeys extends QueryDslQueryBase { + ignore_unmapped?: boolean } export type QueryDslShapeQuery = QueryDslShapeQueryKeys - & { [property: string]: QueryDslShapeFieldQuery | float | string } + & { [property: string]: QueryDslShapeFieldQuery | boolean | float | string } + +export type QueryDslSimpleQueryStringFlag = 'NONE' | 'AND' | 'OR' | 'NOT' | 'PREFIX' | 'PHRASE' | 'PRECEDENCE' | 'ESCAPE' | 'WHITESPACE' | 'FUZZY' | 'NEAR' | 'SLOP' | 'ALL' -export type QueryDslSimpleQueryStringFlags = 'NONE' | 'AND' | 'OR' | 'NOT' | 'PREFIX' | 'PHRASE' | 'PRECEDENCE' | 'ESCAPE' | 'WHITESPACE' | 'FUZZY' | 'NEAR' | 'SLOP' | 'ALL' +export type QueryDslSimpleQueryStringFlags = QueryDslSimpleQueryStringFlag | string export interface QueryDslSimpleQueryStringQuery extends QueryDslQueryBase { analyzer?: string @@ -5396,7 +5442,7 @@ export interface QueryDslSimpleQueryStringQuery extends QueryDslQueryBase { auto_generate_synonyms_phrase_query?: boolean default_operator?: QueryDslOperator fields?: Field[] - flags?: QueryDslSimpleQueryStringFlags | string + flags?: QueryDslSimpleQueryStringFlags fuzzy_max_expansions?: integer fuzzy_prefix_length?: integer fuzzy_transpositions?: boolean @@ -5468,7 +5514,7 @@ export interface QueryDslSpanWithinQuery extends QueryDslQueryBase { } export interface QueryDslTermQuery extends QueryDslQueryBase { - value: string | float | boolean + value: FieldValue case_insensitive?: boolean } @@ -5482,7 +5528,9 @@ export interface QueryDslTermsLookup { export interface QueryDslTermsQueryKeys extends QueryDslQueryBase { } export type QueryDslTermsQuery = QueryDslTermsQueryKeys - & { [property: string]: string[] | long[] | QueryDslTermsLookup | float | string } + & { [property: string]: QueryDslTermsQueryField | float | string } + +export type QueryDslTermsQueryField = FieldValue[] | QueryDslTermsLookup export interface QueryDslTermsSetQuery extends QueryDslQueryBase { minimum_should_match_field?: Field @@ -5492,17 +5540,6 @@ export interface QueryDslTermsSetQuery extends QueryDslQueryBase { export type QueryDslTextQueryType = 'best_fields' | 'most_fields' | 'cross_fields' | 'phrase' | 'phrase_prefix' | 'bool_prefix' -export interface QueryDslThreeDimensionalPoint { - lat: double - lon: double - z?: double -} - -export interface QueryDslTwoDimensionalPoint { - lat: double - lon: double -} - export interface QueryDslTypeQuery extends QueryDslQueryBase { value: string } @@ -5606,12 +5643,12 @@ export interface AsyncSearchSubmitRequest extends RequestBase { suggest_text?: string terminate_after?: long timeout?: Time - track_total_hits?: boolean | integer + track_total_hits?: SearchTrackHits track_scores?: boolean typed_keys?: boolean rest_total_hits_as_int?: boolean version?: boolean - _source?: boolean | Fields + _source?: SearchGetSourceConfig _source_excludes?: Fields _source_includes?: Fields seq_no_primary_term?: boolean @@ -5626,9 +5663,9 @@ export interface AsyncSearchSubmitRequest extends RequestBase { explain?: boolean from?: integer highlight?: SearchHighlight - track_total_hits?: boolean | integer + track_total_hits?: SearchTrackHits indices_boost?: Record[] - docvalue_fields?: SearchDocValueField | (Field | SearchDocValueField)[] + docvalue_fields?: (QueryDslFieldAndFormat | Field)[] min_score?: double post_filter?: QueryDslQueryContainer profile?: boolean @@ -5639,9 +5676,9 @@ export interface AsyncSearchSubmitRequest extends RequestBase { size?: integer slice?: SlicedScroll sort?: SearchSort - _source?: boolean | Fields | SearchSourceFilter - fields?: (Field | DateField)[] - suggest?: SearchSuggestContainer | Record + _source?: SearchSourceConfig + fields?: (QueryDslFieldAndFormat | Field)[] + suggest?: SearchSuggester terminate_after?: long timeout?: string track_scores?: boolean @@ -7321,7 +7358,7 @@ export interface CatTemplatesTemplatesRecord { export interface CatThreadPoolRequest extends CatCatRequestBase { thread_pool_patterns?: Names - size?: Size | boolean + size?: CatThreadPoolThreadPoolSize } export type CatThreadPoolResponse = CatThreadPoolThreadPoolRecord[] @@ -7369,6 +7406,8 @@ export interface CatThreadPoolThreadPoolRecord { ka?: string } +export type CatThreadPoolThreadPoolSize = 'k' | 'm' | 'g' | 't' | 'p' + export interface CatTransformsRequest extends CatCatRequestBase { transform_id?: Id allow_no_match?: boolean @@ -8540,8 +8579,8 @@ export interface EqlSearchRequest extends RequestBase { keep_alive?: Time keep_on_completion?: boolean wait_for_completion_timeout?: Time - size?: uint | float - fields?: (Field | EqlSearchSearchFieldFormatted)[] + size?: uint + fields?: QueryDslFieldAndFormat | Field result_position?: EqlSearchResultPosition } } @@ -8551,11 +8590,6 @@ export interface EqlSearchResponse extends EqlEqlSearchRespons export type EqlSearchResultPosition = 'tail' | 'head' -export interface EqlSearchSearchFieldFormatted { - field: Field - format?: string -} - export interface FeaturesFeature { name: string description: string @@ -8642,14 +8676,11 @@ export interface GraphExploreResponse { vertices: GraphVertex[] } -export interface IlmAction { - [key: string]: never -} +export type IlmActions = any export interface IlmPhase { - actions?: Record | string[] + actions?: IlmActions min_age?: Time - configurations?: Record> } export interface IlmPhases { @@ -8821,7 +8852,7 @@ export interface IndicesFielddataFrequencyFilter { min_segment_size: integer } -export type IndicesIndexCheckOnStartup = 'false' | 'checksum' | 'true' +export type IndicesIndexCheckOnStartup = boolean | 'false' | 'checksum' | 'true' export interface IndicesIndexRouting { allocation?: IndicesIndexRoutingAllocation @@ -8998,14 +9029,10 @@ export interface IndicesIndexSettingsLifecycle { export interface IndicesIndexState { aliases?: Record mappings?: MappingTypeMapping - settings?: IndicesIndexSettings | IndicesIndexStatePrefixedSettings + settings?: IndicesIndexSettings data_stream?: DataStreamName } -export interface IndicesIndexStatePrefixedSettings { - index: IndicesIndexSettings -} - export interface IndicesIndexVersioning { created: VersionString } @@ -9112,13 +9139,13 @@ export interface IndicesAnalyzeRequest extends RequestBase { body?: { analyzer?: string attributes?: string[] - char_filter?: (string | AnalysisCharFilter)[] + char_filter?: AnalysisCharFilter[] explain?: boolean field?: Field - filter?: (string | AnalysisTokenFilter)[] + filter?: AnalysisTokenFilter[] normalizer?: string text?: IndicesAnalyzeTextToAnalyze - tokenizer?: string | AnalysisTokenizer + tokenizer?: AnalysisTokenizer } } @@ -9644,7 +9671,7 @@ export interface IndicesPutMappingRequest extends RequestBase { write_index_only?: boolean body?: { date_detection?: boolean - dynamic?: boolean | MappingDynamicMapping + dynamic?: MappingDynamicMapping dynamic_date_formats?: string[] dynamic_templates?: Record | Record[] _field_names?: MappingFieldNamesField @@ -9859,6 +9886,8 @@ export interface IndicesResolveIndexResponse { data_streams: IndicesResolveIndexResolveIndexDataStreamsItem[] } +export type IndicesRolloverIndexRolloverMapping = MappingTypeMapping | Record + export interface IndicesRolloverRequest extends RequestBase { alias: IndexAlias new_index?: IndexName @@ -9870,7 +9899,7 @@ export interface IndicesRolloverRequest extends RequestBase { body?: { aliases?: Record conditions?: IndicesRolloverRolloverConditions - mappings?: Record | MappingTypeMapping + mappings?: IndicesRolloverIndexRolloverMapping settings?: Record } } @@ -10338,7 +10367,7 @@ export interface IngestCsvProcessor extends IngestProcessorBase { export interface IngestDateIndexNameProcessor extends IngestProcessorBase { date_formats: string[] - date_rounding: string | IngestDateRounding + date_rounding: string field: Field index_name_format: string index_name_prefix: string @@ -10354,8 +10383,6 @@ export interface IngestDateProcessor extends IngestProcessorBase { timezone?: string } -export type IngestDateRounding = 's' | 'm' | 'h' | 'd' | 'w' | 'M' | 'y' - export interface IngestDissectProcessor extends IngestProcessorBase { append_separator: string field: Field @@ -10864,7 +10891,7 @@ export interface MigrationDeprecationsResponse { export interface MlAnalysisConfig { bucket_span: TimeSpan - categorization_analyzer?: MlCategorizationAnalyzer | string + categorization_analyzer?: MlCategorizationAnalyzer categorization_field_name?: Field categorization_filters?: string[] detectors: MlDetector[] @@ -10878,7 +10905,7 @@ export interface MlAnalysisConfig { export interface MlAnalysisConfigRead { bucket_span: TimeSpan - categorization_analyzer?: MlCategorizationAnalyzer | string + categorization_analyzer?: MlCategorizationAnalyzer categorization_field_name?: Field categorization_filters?: string[] detectors: MlDetector[] @@ -10977,10 +11004,12 @@ export interface MlCalendarEvent { start_time: EpochMillis } -export interface MlCategorizationAnalyzer { - char_filter?: (string | AnalysisCharFilter)[] - filter?: (string | AnalysisTokenFilter)[] - tokenizer?: string | AnalysisTokenizer +export type MlCategorizationAnalyzer = string | MlCategorizationAnalyzerDefinition + +export interface MlCategorizationAnalyzerDefinition { + char_filter?: AnalysisCharFilter[] + filter?: AnalysisTokenFilter[] + tokenizer?: AnalysisTokenizer } export type MlCategorizationStatus = 'ok' | 'warn' @@ -11011,11 +11040,7 @@ export type MlChunkingMode = 'auto' | 'manual' | 'off' export type MlConditionOperator = 'gt' | 'gte' | 'lt' | 'lte' -export interface MlCustomSettings { - custom_urls?: XpackUsageUrlConfig[] - created_by?: string - job_tags?: Record -} +export type MlCustomSettings = any export interface MlDataCounts { bucket_count: long @@ -11131,9 +11156,7 @@ export interface MlDataframeAnalysis { training_percent?: Percentage } -export type MlDataframeAnalysisAnalyzedFields = string[] | MlDataframeAnalysisAnalyzedFieldsIncludeExclude - -export interface MlDataframeAnalysisAnalyzedFieldsIncludeExclude { +export interface MlDataframeAnalysisAnalyzedFields { includes: string[] excludes: string[] } @@ -11236,7 +11259,7 @@ export interface MlDataframeAnalyticsSource { index: Indices query?: QueryDslQueryContainer runtime_mappings?: MappingRuntimeFields - _source?: MlDataframeAnalysisAnalyzedFields + _source?: MlDataframeAnalysisAnalyzedFields | string[] } export interface MlDataframeAnalyticsStatsContainer { @@ -11285,7 +11308,7 @@ export interface MlDataframeAnalyticsSummary { description?: string model_memory_limit?: string max_num_threads?: integer - analyzed_fields?: MlDataframeAnalysisAnalyzedFields + analyzed_fields?: MlDataframeAnalysisAnalyzedFields | string[] allow_lazy_start?: boolean create_time?: long version?: VersionString @@ -11929,7 +11952,7 @@ export interface MlExplainDataFrameAnalyticsRequest extends RequestBase { description?: string model_memory_limit?: string max_num_threads?: integer - analyzed_fields?: MlDataframeAnalysisAnalyzedFields + analyzed_fields?: MlDataframeAnalysisAnalyzedFields | string[] allow_lazy_start?: boolean } } @@ -12329,7 +12352,7 @@ export interface MlPreviewDataFrameAnalyticsDataframePreviewConfig { analysis: MlDataframeAnalysisContainer model_memory_limit?: string max_num_threads?: integer - analyzed_fields?: MlDataframeAnalysisAnalyzedFields + analyzed_fields?: MlDataframeAnalysisAnalyzedFields | string[] } export interface MlPreviewDataFrameAnalyticsRequest extends RequestBase { @@ -12384,7 +12407,7 @@ export interface MlPutDataFrameAnalyticsRequest extends RequestBase { body?: { allow_lazy_start?: boolean analysis: MlDataframeAnalysisContainer - analyzed_fields?: MlDataframeAnalysisAnalyzedFields + analyzed_fields?: MlDataframeAnalysisAnalyzedFields | string[] description?: string dest: MlDataframeAnalyticsDestination max_num_threads?: integer @@ -12404,7 +12427,7 @@ export interface MlPutDataFrameAnalyticsResponse { allow_lazy_start: boolean max_num_threads: integer analysis: MlDataframeAnalysisContainer - analyzed_fields?: MlDataframeAnalysisAnalyzedFields + analyzed_fields?: MlDataframeAnalysisAnalyzedFields | string[] } export interface MlPutDatafeedRequest extends RequestBase { @@ -12706,7 +12729,7 @@ export interface MlUpdateDataFrameAnalyticsResponse { allow_lazy_start: boolean max_num_threads: integer analysis: MlDataframeAnalysisContainer - analyzed_fields?: MlDataframeAnalysisAnalyzedFields + analyzed_fields?: MlDataframeAnalysisAnalyzedFields | string[] } export interface MlUpdateDatafeedRequest extends RequestBase { @@ -13268,7 +13291,7 @@ export interface NodesInfoNodeInfoSettingsClusterElection { } export interface NodesInfoNodeInfoSettingsHttp { - type: string | NodesInfoNodeInfoSettingsHttpType + type: NodesInfoNodeInfoSettingsHttpType | string 'type.default'?: string compression?: boolean | string port?: integer | string @@ -13326,7 +13349,7 @@ export interface NodesInfoNodeInfoSettingsNode { } export interface NodesInfoNodeInfoSettingsTransport { - type: string | NodesInfoNodeInfoSettingsTransportType + type: NodesInfoNodeInfoSettingsTransportType | string 'type.default'?: string features?: NodesInfoNodeInfoSettingsTransportFeatures } @@ -13447,16 +13470,12 @@ export interface NodesInfoResponse extends NodesNodesResponseBase { nodes: Record } -export interface NodesReloadSecureSettingsNodeReloadException { +export interface NodesReloadSecureSettingsNodeReloadError { name: Name - reload_exception?: NodesReloadSecureSettingsNodeReloadExceptionCausedBy + reload_exception?: ErrorCause } -export interface NodesReloadSecureSettingsNodeReloadExceptionCausedBy { - type: string - reason: string - caused_by?: NodesReloadSecureSettingsNodeReloadExceptionCausedBy -} +export type NodesReloadSecureSettingsNodeReloadResult = NodesStats | NodesReloadSecureSettingsNodeReloadError export interface NodesReloadSecureSettingsRequest extends RequestBase { node_id?: NodeIds @@ -13468,7 +13487,7 @@ export interface NodesReloadSecureSettingsRequest extends RequestBase { export interface NodesReloadSecureSettingsResponse extends NodesNodesResponseBase { cluster_name: Name - nodes: Record + nodes: Record } export interface NodesStatsRequest extends RequestBase { @@ -13805,7 +13824,7 @@ export interface SecurityIndicesPrivileges { field_security?: SecurityFieldSecurity names: Indices privileges: SecurityIndexPrivilege[] - query?: string | QueryDslQueryContainer + query?: string | string[] allow_restricted_indices?: boolean } @@ -14081,20 +14100,6 @@ export interface SecurityGetPrivilegesRequest extends RequestBase { export interface SecurityGetPrivilegesResponse extends DictionaryResponseBase> { } -export interface SecurityGetRoleInlineRoleTemplate { - template: SecurityGetRoleInlineRoleTemplateSource - format?: SecurityGetRoleTemplateFormat -} - -export interface SecurityGetRoleInlineRoleTemplateSource { - source: string -} - -export interface SecurityGetRoleInvalidRoleTemplate { - template: string - format?: SecurityGetRoleTemplateFormat -} - export interface SecurityGetRoleRequest extends RequestBase { name?: Name } @@ -14112,15 +14117,9 @@ export interface SecurityGetRoleRole { role_templates?: SecurityGetRoleRoleTemplate[] } -export type SecurityGetRoleRoleTemplate = SecurityGetRoleInlineRoleTemplate | SecurityGetRoleStoredRoleTemplate | SecurityGetRoleInvalidRoleTemplate - -export interface SecurityGetRoleStoredRoleTemplate { - template: SecurityGetRoleStoredRoleTemplateId +export interface SecurityGetRoleRoleTemplate { format?: SecurityGetRoleTemplateFormat -} - -export interface SecurityGetRoleStoredRoleTemplateId { - id: string + template: Script } export type SecurityGetRoleTemplateFormat = 'string' | 'json' @@ -14919,7 +14918,7 @@ export interface SqlTranslateRequest extends RequestBase { export interface SqlTranslateResponse { size: long - _source: boolean | Fields | SearchSourceFilter + _source: SearchSourceConfig fields: Record[] sort: SearchSort } @@ -14939,6 +14938,8 @@ export interface SslCertificatesRequest extends RequestBase { export type SslCertificatesResponse = SslCertificatesCertificateInformation[] +export type TasksGroupBy = 'nodes' | 'parents' | 'none' + export interface TasksInfo { action: string cancellable: boolean @@ -15021,7 +15022,7 @@ export interface TasksGetResponse { export interface TasksListRequest extends RequestBase { actions?: string | string[] detailed?: boolean - group_by?: GroupBy + group_by?: TasksGroupBy nodes?: string[] parent_task_id?: Id timeout?: Time @@ -15031,7 +15032,7 @@ export interface TasksListRequest extends RequestBase { export interface TasksListResponse { node_failures?: ErrorCause[] nodes?: Record - tasks?: Record | TasksInfo[] + tasks?: Record } export interface TextStructureFindStructureFieldStat { @@ -15407,7 +15408,7 @@ export type WatcherConnectionScheme = 'http' | 'https' export type WatcherCronExpression = string export interface WatcherDailySchedule { - at: string[] | WatcherTimeOfDay + at: WatcherTimeOfDay[] } export type WatcherDay = 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' @@ -15465,6 +15466,11 @@ export interface WatcherExecutionThreadPool { queue_size: long } +export interface WatcherHourAndMinute { + hour: integer[] + minute: integer[] +} + export interface WatcherHourlySchedule { minute: integer[] } @@ -15623,8 +15629,8 @@ export interface WatcherScheduleContainer { } export interface WatcherScheduleTriggerEvent { - scheduled_time: DateString | string - triggered_time?: DateString | string + scheduled_time: DateString + triggered_time?: DateString } export interface WatcherScriptCondition { @@ -15706,10 +15712,7 @@ export interface WatcherThrottleState { timestamp: DateString } -export interface WatcherTimeOfDay { - hour: integer[] - minute: integer[] -} +export type WatcherTimeOfDay = string | WatcherHourAndMinute export interface WatcherTimeOfMonth { at: string[] @@ -16036,11 +16039,6 @@ export interface XpackUsageBase { enabled: boolean } -export interface XpackUsageBaseUrlConfig { - url_name: string - url_value: string -} - export interface XpackUsageCcr extends XpackUsageBase { auto_follow_patterns_count: integer follower_indices_count: integer @@ -16153,13 +16151,15 @@ export interface XpackUsageIpFilter { transport: boolean } -export interface XpackUsageKibanaUrlConfig extends XpackUsageBaseUrlConfig { - time_range?: string +export interface XpackUsageJobsKeys { + _all?: XpackUsageAllJobs } +export type XpackUsageJobs = XpackUsageJobsKeys + & { [property: string]: MlJob | XpackUsageAllJobs } export interface XpackUsageMachineLearning extends XpackUsageBase { datafeeds: Record - jobs: Record | Partial> + jobs: XpackUsageJobs node_count: integer data_frame_analytics_jobs: XpackUsageMlDataFrameAnalyticsJobs inference: XpackUsageMlInference @@ -16367,8 +16367,6 @@ export interface XpackUsageSsl { transport: XpackUsageFeatureToggle } -export type XpackUsageUrlConfig = XpackUsageBaseUrlConfig | XpackUsageKibanaUrlConfig - export interface XpackUsageVector extends XpackUsageBase { dense_vector_dims_avg_count: integer dense_vector_fields_count: integer diff --git a/specification/_global/bulk/BulkRequest.ts b/specification/_global/bulk/BulkRequest.ts index fa6d962097..29c68ee12e 100644 --- a/specification/_global/bulk/BulkRequest.ts +++ b/specification/_global/bulk/BulkRequest.ts @@ -28,6 +28,7 @@ import { } from '@_types/common' import { Time } from '@_types/Time' import { OperationContainer } from './types' +import { GetSourceConfig } from '@global/search/_types/SourceFilter' /** * @rest_spec_name bulk @@ -44,7 +45,7 @@ export interface Request extends RequestBase { pipeline?: string refresh?: Refresh routing?: Routing - _source?: boolean | Fields + _source?: GetSourceConfig _source_excludes?: Fields _source_includes?: Fields timeout?: Time diff --git a/specification/_global/delete_by_query/DeleteByQueryRequest.ts b/specification/_global/delete_by_query/DeleteByQueryRequest.ts index 7a669954c1..e60bd6255d 100644 --- a/specification/_global/delete_by_query/DeleteByQueryRequest.ts +++ b/specification/_global/delete_by_query/DeleteByQueryRequest.ts @@ -33,6 +33,7 @@ import { long } from '@_types/Numeric' import { QueryContainer } from '@_types/query_dsl/abstractions' import { SlicedScroll } from '@_types/SlicedScroll' import { Time } from '@_types/Time' +import { GetSourceConfig } from '@global/search/_types/SourceFilter' /** * @rest_spec_name delete_by_query @@ -69,7 +70,7 @@ export interface Request extends RequestBase { size?: long slices?: long sort?: string[] - _source?: boolean | Fields + _source?: GetSourceConfig _source_excludes?: Fields _source_includes?: Fields stats?: string[] diff --git a/specification/_global/exists/DocumentExistsRequest.ts b/specification/_global/exists/DocumentExistsRequest.ts index 81af68aea1..9c53829428 100644 --- a/specification/_global/exists/DocumentExistsRequest.ts +++ b/specification/_global/exists/DocumentExistsRequest.ts @@ -27,6 +27,7 @@ import { VersionNumber, VersionType } from '@_types/common' +import { GetSourceConfig } from '@global/search/_types/SourceFilter' /** * @rest_spec_name exists @@ -44,7 +45,7 @@ export interface Request extends RequestBase { realtime?: boolean refresh?: boolean routing?: Routing - _source?: boolean | Fields + _source?: GetSourceConfig _source_excludes?: Fields _source_includes?: Fields stored_fields?: Fields diff --git a/specification/_global/exists_source/SourceExistsRequest.ts b/specification/_global/exists_source/SourceExistsRequest.ts index b2b8c8292e..a19cb8761f 100644 --- a/specification/_global/exists_source/SourceExistsRequest.ts +++ b/specification/_global/exists_source/SourceExistsRequest.ts @@ -27,6 +27,7 @@ import { VersionNumber, VersionType } from '@_types/common' +import { GetSourceConfig } from '@global/search/_types/SourceFilter' /** * @rest_spec_name exists_source @@ -44,7 +45,7 @@ export interface Request extends RequestBase { realtime?: boolean refresh?: boolean routing?: Routing - _source?: boolean | Fields + _source?: GetSourceConfig _source_excludes?: Fields _source_includes?: Fields version?: VersionNumber diff --git a/specification/_global/explain/ExplainRequest.ts b/specification/_global/explain/ExplainRequest.ts index f7c98cb615..274fb6b0f5 100644 --- a/specification/_global/explain/ExplainRequest.ts +++ b/specification/_global/explain/ExplainRequest.ts @@ -27,6 +27,7 @@ import { Type } from '@_types/common' import { QueryContainer } from '@_types/query_dsl/abstractions' +import { GetSourceConfig } from '@global/search/_types/SourceFilter' /** * @rest_spec_name explain @@ -47,7 +48,7 @@ export interface Request extends RequestBase { lenient?: boolean preference?: string routing?: Routing - _source?: boolean | Fields + _source?: GetSourceConfig _source_excludes?: Fields _source_includes?: Fields stored_fields?: Fields diff --git a/specification/_global/get/GetRequest.ts b/specification/_global/get/GetRequest.ts index a00e0e727e..937462be42 100644 --- a/specification/_global/get/GetRequest.ts +++ b/specification/_global/get/GetRequest.ts @@ -27,6 +27,7 @@ import { VersionNumber, VersionType } from '@_types/common' +import { GetSourceConfig } from '@global/search/_types/SourceFilter' /** * @rest_spec_name get @@ -65,7 +66,7 @@ export interface Request extends RequestBase { /** * True or false to return the _source field or not, or a list of fields to return. */ - _source?: boolean | Fields + _source?: GetSourceConfig /** * A comma-separated list of source fields to exclude in the response. */ diff --git a/specification/_global/get_source/SourceRequest.ts b/specification/_global/get_source/SourceRequest.ts index 305e08fb5c..5840c3981c 100644 --- a/specification/_global/get_source/SourceRequest.ts +++ b/specification/_global/get_source/SourceRequest.ts @@ -26,6 +26,7 @@ import { VersionNumber, VersionType } from '@_types/common' +import { GetSourceConfig } from '@global/search/_types/SourceFilter' /** * @rest_spec_name get_source @@ -68,7 +69,7 @@ export interface Request { /** * True or false to return the _source field or not, or a list of fields to return. */ - _source?: boolean | Fields + _source?: GetSourceConfig /** * A comma-separated list of source fields to exclude in the response. */ diff --git a/specification/_global/mget/MultiGetRequest.ts b/specification/_global/mget/MultiGetRequest.ts index e443365151..f14e9f6a3b 100644 --- a/specification/_global/mget/MultiGetRequest.ts +++ b/specification/_global/mget/MultiGetRequest.ts @@ -20,6 +20,7 @@ import { RequestBase } from '@_types/Base' import { Fields, IndexName, Routing, Type } from '@_types/common' import { MultiGetId, Operation } from './types' +import { GetSourceConfig } from '@global/search/_types/SourceFilter' /** * @rest_spec_name mget @@ -37,7 +38,7 @@ export interface Request extends RequestBase { realtime?: boolean // default: true refresh?: boolean // default: false routing?: Routing - _source?: boolean | Fields + _source?: GetSourceConfig _source_excludes?: Fields _source_includes?: Fields stored_fields?: Fields diff --git a/specification/_global/mget/types.ts b/specification/_global/mget/types.ts index 921fb0ac86..7e9408803f 100644 --- a/specification/_global/mget/types.ts +++ b/specification/_global/mget/types.ts @@ -17,7 +17,7 @@ * under the License. */ -import { SourceFilter } from '@global/search/_types/SourceFilter' +import { SourceConfig } from '@global/search/_types/SourceFilter' import { Dictionary } from '@spec_utils/Dictionary' import { UserDefinedValue } from '@spec_utils/UserDefinedValue' import { @@ -37,7 +37,7 @@ export class Operation { _id: MultiGetId _index?: IndexName routing?: Routing - _source?: boolean | Fields | SourceFilter + _source?: SourceConfig stored_fields?: Fields _type?: Type version?: VersionNumber diff --git a/specification/_global/msearch/types.ts b/specification/_global/msearch/types.ts index 1afe5f769b..05eb4808b6 100644 --- a/specification/_global/msearch/types.ts +++ b/specification/_global/msearch/types.ts @@ -18,13 +18,14 @@ */ import { PointInTimeReference } from '@global/search/_types/PointInTimeReference' -import { SuggestContainer } from '@global/search/_types/suggester' +import { Suggester } from '@global/search/_types/suggester' import { Dictionary } from '@spec_utils/Dictionary' import { AggregationContainer } from '@_types/aggregations/AggregationContainer' import { ExpandWildcards, Indices, SearchType } from '@_types/common' import { integer } from '@_types/Numeric' import { QueryContainer } from '@_types/query_dsl/abstractions' import { Response as SearchResponse } from '@global/search/SearchResponse' +import { TrackHits } from '@global/search/_types/hits' /** * Contains parameters used to limit or change the subsequent search body request. @@ -47,8 +48,8 @@ export class Body { from?: integer size?: integer pit?: PointInTimeReference - track_total_hits?: boolean | integer - suggest?: SuggestContainer | Dictionary + track_total_hits?: TrackHits + suggest?: Suggester } export class SearchResult extends SearchResponse { diff --git a/specification/_global/put_script/PutScriptRequest.ts b/specification/_global/put_script/PutScriptRequest.ts index 463cfec426..f1112a4ed2 100644 --- a/specification/_global/put_script/PutScriptRequest.ts +++ b/specification/_global/put_script/PutScriptRequest.ts @@ -37,6 +37,6 @@ export interface Request extends RequestBase { timeout?: Time } body: { - script?: StoredScript + script: StoredScript } } diff --git a/specification/_global/search/SearchRequest.ts b/specification/_global/search/SearchRequest.ts index fe75a6c455..756e587376 100644 --- a/specification/_global/search/SearchRequest.ts +++ b/specification/_global/search/SearchRequest.ts @@ -35,17 +35,18 @@ import { } from '@_types/common' import { RuntimeFields } from '@_types/mapping/RuntimeFields' import { double, integer, long } from '@_types/Numeric' -import { QueryContainer } from '@_types/query_dsl/abstractions' +import { FieldAndFormat, QueryContainer } from '@_types/query_dsl/abstractions' import { ScriptField } from '@_types/Scripting' import { SlicedScroll } from '@_types/SlicedScroll' -import { DateField, Time } from '@_types/Time' +import { Time } from '@_types/Time' import { FieldCollapse } from './_types/FieldCollapse' import { Highlight } from './_types/highlighting' import { PointInTimeReference } from './_types/PointInTimeReference' import { Rescore } from './_types/rescoring' import { Sort, SortResults } from './_types/sort' -import { DocValueField, SourceFilter } from './_types/SourceFilter' -import { SuggestContainer } from './_types/suggester' +import { GetSourceConfig, SourceConfig } from './_types/SourceFilter' +import { Suggester } from './_types/suggester' +import { TrackHits } from '@global/search/_types/hits' /** * @rest_spec_name search @@ -94,12 +95,12 @@ export interface Request extends RequestBase { suggest_text?: string terminate_after?: long timeout?: Time - track_total_hits?: boolean | integer + track_total_hits?: TrackHits track_scores?: boolean typed_keys?: boolean rest_total_hits_as_int?: boolean version?: boolean - _source?: boolean | Fields + _source?: GetSourceConfig _source_excludes?: Fields _source_includes?: Fields seq_no_primary_term?: boolean @@ -131,7 +132,7 @@ export interface Request extends RequestBase { * response does not include the total number of hits matching the query. * Defaults to 10,000 hits. */ - track_total_hits?: boolean | integer + track_total_hits?: TrackHits /** * Boosts the _score of documents from specified indices. */ @@ -140,7 +141,7 @@ export interface Request extends RequestBase { * Array of wildcard (*) patterns. The request returns doc values for field * names matching these patterns in the hits.fields property of the response. */ - docvalue_fields?: DocValueField | Array + docvalue_fields?: FieldAndFormat[] /** * Minimum _score for matching documents. Documents with a lower _score are * not included in the search results. @@ -172,13 +173,13 @@ export interface Request extends RequestBase { * Indicates which source fields are returned for matching documents. These * fields are returned in the hits._source property of the search response. */ - _source?: boolean | Fields | SourceFilter + _source?: SourceConfig /** * Array of wildcard (*) patterns. The request returns values for field names * matching these patterns in the hits.fields property of the response. */ - fields?: Array - suggest?: SuggestContainer | Dictionary + fields?: Array + suggest?: Suggester /** * Maximum number of documents to collect for each shard. If a query reaches this * limit, Elasticsearch terminates the query early. Elasticsearch collects documents diff --git a/specification/_global/search/_types/SourceFilter.ts b/specification/_global/search/_types/SourceFilter.ts index 4669e80ef4..45646333fa 100644 --- a/specification/_global/search/_types/SourceFilter.ts +++ b/specification/_global/search/_types/SourceFilter.ts @@ -20,14 +20,21 @@ import { Field, Fields } from '@_types/common' +/** + * @shortcut_property includes + */ export class SourceFilter { + /** @aliases exclude */ excludes?: Fields + /** @aliases include */ includes?: Fields - exclude?: Fields - include?: Fields } -export class DocValueField { - field: Field - format?: string -} +/** + * Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered. + * @codegen_names fetch, filter + */ +export type SourceConfig = boolean | SourceFilter + +/** @codegen_names fetch, fields */ +export type GetSourceConfig = boolean | Fields diff --git a/specification/_global/search/_types/highlighting.ts b/specification/_global/search/_types/highlighting.ts index 50cc4655cb..f4ce59a500 100644 --- a/specification/_global/search/_types/highlighting.ts +++ b/specification/_global/search/_types/highlighting.ts @@ -71,8 +71,12 @@ export enum HighlighterTagsSchema { styled = 0 } -export enum HighlighterType { +/** @codegen_names builtin, custom */ +export type HighlighterType = BuiltinHighlighterType | string + +export enum BuiltinHighlighterType { plain = 0, + /** @codegen_name fast_vector */ fvh = 1, unified = 2 } @@ -99,5 +103,5 @@ export class HighlightField { pre_tags?: string[] require_field_match?: boolean tags_schema?: HighlighterTagsSchema - type?: HighlighterType | string + type?: HighlighterType } diff --git a/specification/_global/search/_types/hits.ts b/specification/_global/search/_types/hits.ts index 026be89a31..b00361cfdc 100644 --- a/specification/_global/search/_types/hits.ts +++ b/specification/_global/search/_types/hits.ts @@ -35,7 +35,8 @@ import { ScriptField } from '@_types/Scripting' import { FieldCollapse } from './FieldCollapse' import { Highlight } from './highlighting' import { Sort, SortResults } from './sort' -import { SourceFilter } from './SourceFilter' +import { SourceConfig } from './SourceFilter' +import { FieldAndFormat } from '@_types/query_dsl/abstractions' export class Hit { _index: IndexName @@ -80,15 +81,8 @@ export class HitMetadata { _version: VersionNumber } -export class InnerHitsMetadata { - total: TotalHits | long - hits: Hit>[] - - max_score?: double -} - export class InnerHitsResult { - hits: InnerHitsMetadata + hits: HitsMetadata } export class NestedIdentity { @@ -122,16 +116,19 @@ export class InnerHits { seq_no_primary_term?: boolean fields?: Fields sort?: Sort - _source?: boolean | SourceFilter + _source?: SourceConfig stored_field?: Fields /** @server_default false */ track_scores?: boolean version?: boolean } -/** @shortcut_property field */ -export class FieldAndFormat { - field: Field - format?: string - include_unmapped?: boolean -} +/** + * Number of hits matching the query to count accurately. If true, the exact + * number of hits is returned at the cost of some performance. If false, the + * response does not include the total number of hits matching the query. + * Defaults to 10,000 hits. + * + * @codegen_names enabled, count + */ +export type TrackHits = boolean | integer diff --git a/specification/_global/search/_types/sort.ts b/specification/_global/search/_types/sort.ts index 65139b46f2..2394aff99f 100644 --- a/specification/_global/search/_types/sort.ts +++ b/specification/_global/search/_types/sort.ts @@ -17,42 +17,41 @@ * under the License. */ -import { AdditionalProperties, AdditionalProperty } from '@spec_utils/behaviors' +import { AdditionalProperty } from '@spec_utils/behaviors' import { Missing } from '@_types/aggregations/AggregationContainer' import { Field } from '@_types/common' -import { DistanceUnit, GeoDistanceType } from '@_types/Geo' +import { DistanceUnit, GeoDistanceType, GeoLocation } from '@_types/Geo' import { FieldType } from '@_types/mapping/Property' import { double, integer, long } from '@_types/Numeric' import { QueryContainer } from '@_types/query_dsl/abstractions' -import { GeoLocation } from '@_types/query_dsl/geo' import { Script } from '@_types/Scripting' export class NestedSortValue { filter?: QueryContainer max_children?: integer + nested?: NestedSortValue path: Field - // nested: NestedSortValue } -// export type NestedSort = Dictionary - -export enum NumericType { +export enum FieldSortNumericType { long = 0, double = 1, date = 2, date_nanos = 3 } +/** @shortcut_property order */ export class FieldSort { missing?: Missing mode?: SortMode nested?: NestedSortValue order?: SortOrder unmapped_type?: FieldType + numeric_type?: FieldSortNumericType + format?: string } export class ScoreSort { - mode?: SortMode order?: SortOrder } export class GeoDistanceSort @@ -60,6 +59,7 @@ export class GeoDistanceSort { mode?: SortMode distance_type?: GeoDistanceType + ignore_unmapped?: boolean order?: SortOrder unit?: DistanceUnit } @@ -67,33 +67,37 @@ export class GeoDistanceSort export class ScriptSort { order?: SortOrder script: Script - type?: string + type?: ScriptSortType + mode?: SortMode + nested?: NestedSortValue } -export class SortContainer - implements AdditionalProperties -{ +export enum ScriptSortType { + string, + number +} + +/** + * @doc_url https://www.elastic.co/guide/en/elasticsearch/reference/current/sort-search-results.html + * @variants container + */ +export class SortOptions implements AdditionalProperty { _score?: ScoreSort _doc?: ScoreSort _geo_distance?: GeoDistanceSort _script?: ScriptSort } -export type SortCombinations = Field | SortContainer | SortOrder +/** + * @codegen_names field, options + */ +// Field is a shortcut for {"":{}}. Default order is asc except for "_score" where it's desc +export type SortCombinations = Field | SortOptions export type Sort = SortCombinations | SortCombinations[] export type SortResults = Array -/* -sort?: -| string -| Dictionary -| Array< - SingleKeyDictionary> - > -*/ - export enum SortMode { min = 0, max = 1, @@ -104,12 +108,5 @@ export enum SortMode { export enum SortOrder { asc = 0, - desc = 1, - /** @codegen_name Document */ - _doc = 2 -} - -export enum SortSpecialField { - _score = 0, - _doc = 1 + desc = 1 } diff --git a/specification/_global/search/_types/suggester.ts b/specification/_global/search/_types/suggester.ts index 4d6d611596..170ed1872e 100644 --- a/specification/_global/search/_types/suggester.ts +++ b/specification/_global/search/_types/suggester.ts @@ -28,9 +28,9 @@ import { SuggestMode, Type } from '@_types/common' -import { Distance } from '@_types/Geo' +import { GeoHash, GeoHashPrecision, GeoLocation } from '@_types/Geo' import { double, float, integer, long } from '@_types/Numeric' -import { GeoLocation } from '@_types/query_dsl/geo' +import { AdditionalProperties } from '@spec_utils/behaviors' export class Suggest { length: integer @@ -39,10 +39,15 @@ export class Suggest { text: string } +export class Suggester implements AdditionalProperties { + /** Global suggest text, to avoid repetition when the same text is used in several suggesters */ + text?: string +} + /** * @variants container */ -export class SuggestContainer { +export class FieldSuggester { completion?: CompletionSuggester phrase?: PhraseSuggester prefix?: string @@ -57,6 +62,7 @@ export class SuggesterBase { size?: integer } +/** @codegen_names completion, phrase, term */ export type SuggestOption = | CompletionSuggestOption | PhraseSuggestOption @@ -90,10 +96,7 @@ export class TermSuggestOption { // completion suggester export class CompletionSuggester extends SuggesterBase { - contexts?: Dictionary< - string, - string | string[] | GeoLocation | SuggestContextQuery[] - > + contexts?: Dictionary fuzzy?: SuggestFuzziness prefix?: string regex?: string @@ -111,17 +114,19 @@ export class SuggestFuzziness { // context suggester /** - * Text that we want similar documents for or a lookup to a document's field for the text. + * Text or location that we want similar documents for or a lookup to a document's field for the text. * @doc_url https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html#_document_input_parameters * + * @codegen_names category, location */ export type Context = string | GeoLocation -export class SuggestContextQuery { +/** @shortcut_property context */ +export class CompletionContext { boost?: double context: Context - neighbours?: Distance[] | integer[] - precision?: Distance | integer + neighbours?: GeoHashPrecision[] + precision?: GeoHashPrecision prefix?: boolean } diff --git a/specification/_global/update/UpdateRequest.ts b/specification/_global/update/UpdateRequest.ts index c0fa4a5615..b52718ffa5 100644 --- a/specification/_global/update/UpdateRequest.ts +++ b/specification/_global/update/UpdateRequest.ts @@ -17,7 +17,10 @@ * under the License. */ -import { SourceFilter } from '@global/search/_types/SourceFilter' +import { + GetSourceConfig, + SourceConfig +} from '@global/search/_types/SourceFilter' import { RequestBase } from '@_types/Base' import { Fields, @@ -98,7 +101,7 @@ export interface Request extends RequestBase { * list of the fields you want to retrieve. * @server_default true */ - _source?: boolean | Fields + _source?: GetSourceConfig /** * Specify the source fields you want to exclude. */ @@ -139,7 +142,7 @@ export interface Request extends RequestBase { * list of the fields you want to retrieve. * @server_default true */ - _source?: boolean | SourceFilter + _source?: SourceConfig /** * If the document does not already exist, the contents of 'upsert' are inserted as a * new document. If the document exists, the 'script' is executed. diff --git a/specification/_global/update_by_query/UpdateByQueryRequest.ts b/specification/_global/update_by_query/UpdateByQueryRequest.ts index f3bbf25c60..203178d3cc 100644 --- a/specification/_global/update_by_query/UpdateByQueryRequest.ts +++ b/specification/_global/update_by_query/UpdateByQueryRequest.ts @@ -34,6 +34,7 @@ import { QueryContainer } from '@_types/query_dsl/abstractions' import { Script } from '@_types/Scripting' import { SlicedScroll } from '@_types/SlicedScroll' import { Time } from '@_types/Time' +import { GetSourceConfig } from '@global/search/_types/SourceFilter' /** * @rest_spec_name update_by_query @@ -69,7 +70,7 @@ export interface Request extends RequestBase { size?: long slices?: long sort?: string[] - _source?: boolean | Fields + _source?: GetSourceConfig _source_excludes?: Fields _source_includes?: Fields stats?: string[] diff --git a/specification/_types/Geo.ts b/specification/_types/Geo.ts index 118af57df6..4ae000cd34 100644 --- a/specification/_types/Geo.ts +++ b/specification/_types/Geo.ts @@ -72,7 +72,12 @@ export enum GeoShapeRelation { } export type GeoTilePrecision = number -export type GeoHashPrecision = number + +/** + * A precision that can be expressed as a geohash length between 1 and 12, or a distance measure like "1km", "10m". + * @codegen_names geohash_length, distance + */ +export type GeoHashPrecision = number | string export type GeoHash = string /** A map tile reference, represented as `{zoom}/{x}/{y}` */ @@ -82,3 +87,64 @@ export class LatLon { lat: double lon: double } + +/** + * A latitude/longitude as a 2 dimensional point. It can be represented in various ways: + * - as a `{lat, long}` object + * - as a geo hash value + * - as a `[lon, lat]` array + * - as a string in `", "` or WKT point formats + * + * @codegen_names latlon, geohash, coords, text + */ +// ES: GeoUtils.parseGeoPoint() +export type GeoLocation = + | LatLonGeoLocation + | GeoHashLocation + | double[] + | string + +export class LatLonGeoLocation { + lat: double + lon: double +} + +export class GeoHashLocation { + geohash: GeoHash +} + +/** + * A geo bounding box. It can be represented in various ways: + * - as 4 top/bottom/left/right coordinates + * - as 2 top_left / bottom_right points + * - as 2 top_right / bottom_left points + * - as a WKT bounding box + * + * @codegen_names coords, tlbr, trbl, wkt + */ +export type GeoBounds = + | CoordsGeoBounds + | TopLeftBottomRightGeoBounds + | TopRightBottomLeftGeoBounds + | WktGeoBounds + +export class WktGeoBounds { + wkt: string +} + +export class CoordsGeoBounds { + top: double + bottom: double + left: double + right: double +} + +export class TopLeftBottomRightGeoBounds { + top_left: GeoLocation + bottom_right: GeoLocation +} + +export class TopRightBottomLeftGeoBounds { + top_right: GeoLocation + bottom_left: GeoLocation +} diff --git a/specification/_types/Scripting.ts b/specification/_types/Scripting.ts index 9899e0e71e..d6102d68ff 100644 --- a/specification/_types/Scripting.ts +++ b/specification/_types/Scripting.ts @@ -21,8 +21,13 @@ import { Dictionary } from '@spec_utils/Dictionary' import { UserDefinedValue } from '@spec_utils/UserDefinedValue' import { Id } from './common' -/** @doc_url https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html */ -export enum ScriptLanguage { +/** + * @doc_url https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html + * @codegen_names builtin, custom + */ +export type ScriptLanguage = BuiltinScriptLanguage | string + +export enum BuiltinScriptLanguage { painless = 0, expression = 1, mustache = 2, @@ -30,25 +35,28 @@ export enum ScriptLanguage { } export class StoredScript { - lang?: ScriptLanguage | string + lang: ScriptLanguage + options?: Dictionary source: string } export class ScriptBase { - lang?: ScriptLanguage | string params?: Dictionary } +/** @shortcut_property source */ export class InlineScript extends ScriptBase { + lang?: ScriptLanguage + options?: Dictionary source: string } -export class IndexedScript extends ScriptBase { +export class StoredScriptId extends ScriptBase { id: Id } -// 'string' is a shortcut for InlineScript.source -export type Script = InlineScript | IndexedScript | string +/** @codegen_names inline, stored */ +export type Script = InlineScript | StoredScriptId export class ScriptField { script: Script diff --git a/specification/_types/Time.ts b/specification/_types/Time.ts index 8a36485f48..2b5826a88c 100644 --- a/specification/_types/Time.ts +++ b/specification/_types/Time.ts @@ -17,7 +17,6 @@ * under the License. */ -import { Field } from './common' import { integer, long } from './Numeric' export class DateMathTimeParsed { @@ -25,13 +24,6 @@ export class DateMathTimeParsed { interval: DateMathTimeUnit } -/** A reference to a date field with formatting instructions on how to return the date */ -export class DateField { - field: Field - format?: string - include_unmapped?: boolean -} - export type DateString = string export type Timestamp = string export type TimeSpan = string @@ -69,10 +61,10 @@ export enum DateMathTimeUnit { /** * Whenever durations need to be specified, e.g. for a timeout parameter, the duration must specify the unit, like 2d for 2 days. - * @doc_url https://github.com/elastic/elasticsearch/blob/master/libs/core/src/main/java/org/elasticsearch/common/unit/TimeValue.java - * https://github.com/elastic/elasticsearch/blob/master/libs/core/src/main/java/org/elasticsearch/common/unit/TimeValue.java - * Only support 0 and -1 but we have no way to encode these as constants at the moment + * @doc_url https://github.com/elastic/elasticsearch/blob/master/libs/core/src/main/java/org/elasticsearch/core/TimeValue.java + * @codegen_names time, offset */ +//FIXME: need to distinguish durations (has to be a string), offsets (can be a string or number) export type Time = string | integer export enum TimeUnit { diff --git a/specification/_types/aggregations/Aggregate.ts b/specification/_types/aggregations/Aggregate.ts index 8669547bfe..aabf5b3f20 100644 --- a/specification/_types/aggregations/Aggregate.ts +++ b/specification/_types/aggregations/Aggregate.ts @@ -21,10 +21,9 @@ import { HitsMetadata } from '@global/search/_types/hits' import { AdditionalProperties, AdditionalProperty } from '@spec_utils/behaviors' import { Dictionary } from '@spec_utils/Dictionary' import { UserDefinedValue } from '@spec_utils/UserDefinedValue' -import { AggregateName, Field, ScalarValue } from '@_types/common' -import { GeoHash, GeoLine, GeoTile, LatLon } from '@_types/Geo' +import { AggregateName, Field, FieldValue } from '@_types/common' +import { GeoBounds, GeoHash, GeoLine, GeoLocation, GeoTile } from '@_types/Geo' import { double, integer, long } from '@_types/Numeric' -import { GeoLocation } from '@_types/query_dsl/geo' import { DateMathTime, EpochMillis } from '@_types/Time' import { Void } from '@spec_utils/VoidValue' @@ -131,9 +130,12 @@ export class CardinalityAggregate extends AggregateBase { // ES: AbstractInternalHDRPercentiles, AbstractInternalTDigestPercentiles, InternalPercentilesBucket export class PercentilesAggregateBase extends AggregateBase { - values: KeyedPercentiles | Array + values: Percentiles } +/** @codegen_names keyed, array */ +type Percentiles = KeyedPercentiles | Array + // In keyed form, percentiles are represented as an object with 1 or 2 properties for each key: // : double | null - always present (null means there were no values for this percentile) // _as_string? string - present if a format was provided @@ -287,11 +289,6 @@ export class GeoBoundsAggregate extends AggregateBase { bounds: GeoBounds } -export class GeoBounds { - bottom_right: LatLon - top_left: LatLon -} - /** @variant name=geo_centroid */ export class GeoCentroidAggregate extends AggregateBase { count: long @@ -303,11 +300,13 @@ export class GeoCentroidAggregate extends AggregateBase { /** * Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for * the different buckets, the result is a dictionary. + * + * @codegen_names keyed, array */ // Note: not all aggregations support keys in their configuration, meaning they will never return the dictionary // variant. However we use this union for all aggregates to future-proof the spec if some key-less aggregations finally // add support for keys. -type Buckets = Dictionary | Array +export type Buckets = Dictionary | Array export class MultiBucketAggregateBase extends AggregateBase { buckets: Buckets @@ -601,14 +600,14 @@ export class InferenceAggregate extends AggregateBase implements AdditionalProperties { - value?: ScalarValue + value?: FieldValue feature_importance?: InferenceFeatureImportance[] top_classes?: InferenceTopClassEntry[] warning?: string } export class InferenceTopClassEntry { - class_name: ScalarValue + class_name: FieldValue class_probability: double class_score: double } @@ -668,8 +667,8 @@ export class TopMetricsBucket extends MultiBucketBase { export class TopMetrics { // Always contains a single element since `top_metrics` only accepts a single sort field - sort: Array - metrics: Dictionary + sort: Array + metrics: Dictionary } /** @variant name=t_test */ @@ -727,6 +726,6 @@ export class ParentAggregateBucket extends MultiBucketBase {} /** @variant name=geo_line */ export class GeoLineAggregate extends AggregateBase { - type: 'Feature' + type: string // should be "Feature" geometry: GeoLine } diff --git a/specification/_types/aggregations/bucket.ts b/specification/_types/aggregations/bucket.ts index c5362e20a2..8394cc1c90 100644 --- a/specification/_types/aggregations/bucket.ts +++ b/specification/_types/aggregations/bucket.ts @@ -25,20 +25,17 @@ import { GeoDistanceType, DistanceUnit, GeoHashPrecision, - GeoTilePrecision + GeoTilePrecision, + GeoLocation, + GeoBounds } from '@_types/Geo' import { integer, float, long, double } from '@_types/Numeric' import { QueryContainer } from '@_types/query_dsl/abstractions' -import { GeoLocation, BoundingBox } from '@_types/query_dsl/geo' import { Script } from '@_types/Scripting' import { DateString, Time, DateMath } from '@_types/Time' -import { GeoBounds } from './Aggregate' +import { Buckets } from './Aggregate' import { Aggregation } from './Aggregation' -import { - AggregationContainer, - Missing, - MissingOrder -} from './AggregationContainer' +import { Missing, MissingOrder } from './AggregationContainer' /** * Base type for bucket aggregations. These aggregations also accept sub-aggregations. @@ -90,13 +87,13 @@ export class CompositeAggregationSource { } export class DateHistogramAggregation extends BucketAggregationBase { - calendar_interval?: DateInterval | Time - extended_bounds?: ExtendedBounds - hard_bounds?: ExtendedBounds + calendar_interval?: CalendarInterval // CalendarInterval is too restrictive here + extended_bounds?: ExtendedBounds + hard_bounds?: ExtendedBounds field?: Field - fixed_interval?: DateInterval | Time + fixed_interval?: Time // CalendarInterval is too restrictive here format?: string - interval?: DateInterval | Time + interval?: Time min_doc_count?: integer missing?: DateString offset?: Time @@ -107,15 +104,23 @@ export class DateHistogramAggregation extends BucketAggregationBase { keyed?: boolean } -export enum DateInterval { - second = 0, - minute = 1, - hour = 2, - day = 3, - week = 4, - month = 5, - quarter = 6, - year = 7 +export enum CalendarInterval { + /** @aliases 1s */ + second, + /** @aliases 1m */ + minute, + /** @aliases 1h */ + hour, + /** @aliases 1d */ + day, + /** @aliases 1w */ + week, + /** @aliases 1M */ + month, + /** @aliases 1q */ + quarter, + /** @aliases 1Y */ + year } export class DateRangeAggregation extends BucketAggregationBase { @@ -127,13 +132,19 @@ export class DateRangeAggregation extends BucketAggregationBase { keyed?: boolean } +/** + * A date range limit, represented either as a DateMath expression or a number expressed + * according to the target field's precision. + * + * @codegen_names expr, value + */ +// ES: DateRangeAggregationBuilder.innerBuild() +export type FieldDateMath = DateMath | double + export class DateRangeExpression { - from?: DateMath | float - from_as_string?: string - to_as_string?: string + from?: FieldDateMath key?: string - to?: DateMath | float - doc_count?: long + to?: FieldDateMath } export class DiversifiedSamplerAggregation extends BucketAggregationBase { @@ -151,7 +162,7 @@ export enum SamplerAggregationExecutionHint { } export class FiltersAggregation extends BucketAggregationBase { - filters?: Dictionary | QueryContainer[] + filters?: Buckets other_bucket?: boolean other_bucket_key?: string keyed?: boolean @@ -160,13 +171,13 @@ export class FiltersAggregation extends BucketAggregationBase { export class GeoDistanceAggregation extends BucketAggregationBase { distance_type?: GeoDistanceType field?: Field - origin?: GeoLocation | string + origin?: GeoLocation ranges?: AggregationRange[] unit?: DistanceUnit } export class GeoHashGridAggregation extends BucketAggregationBase { - bounds?: BoundingBox + bounds?: GeoBounds field?: Field precision?: GeoHashPrecision shard_size?: integer @@ -254,9 +265,9 @@ export class AggregationRange { } export class RareTermsAggregation extends BucketAggregationBase { - exclude?: string | string[] + exclude?: TermsExclude field?: Field - include?: string | string[] | TermsInclude + include?: TermsInclude max_doc_count?: long missing?: Missing precision?: double @@ -294,7 +305,7 @@ export class ScriptedHeuristic { export class SignificantTermsAggregation extends BucketAggregationBase { background_filter?: QueryContainer chi_square?: ChiSquareHeuristic - exclude?: string | string[] + exclude?: TermsExclude execution_hint?: TermsAggregationExecutionHint field?: Field gnd?: GoogleNormalizedDistanceHeuristic @@ -311,7 +322,7 @@ export class SignificantTermsAggregation extends BucketAggregationBase { export class SignificantTextAggregation extends BucketAggregationBase { background_filter?: QueryContainer chi_square?: ChiSquareHeuristic - exclude?: string | string[] + exclude?: TermsExclude execution_hint?: TermsAggregationExecutionHint field?: Field filter_duplicate_text?: boolean @@ -329,10 +340,10 @@ export class SignificantTextAggregation extends BucketAggregationBase { export class TermsAggregation extends BucketAggregationBase { collect_mode?: TermsAggregationCollectMode - exclude?: string | string[] + exclude?: TermsExclude execution_hint?: TermsAggregationExecutionHint field?: Field - include?: string | string[] | TermsInclude + include?: TermsInclude min_doc_count?: integer missing?: Missing missing_order?: MissingOrder @@ -346,9 +357,8 @@ export class TermsAggregation extends BucketAggregationBase { } export type TermsAggregationOrder = - | SortOrder - | Dictionary - | Dictionary[] + | Dictionary + | Dictionary[] export enum TermsAggregationCollectMode { depth_first = 0, @@ -362,7 +372,13 @@ export enum TermsAggregationExecutionHint { global_ordinals_low_cardinality = 3 } -export class TermsInclude { +/** @codegen_names regexp, terms, partition */ +export type TermsInclude = string | string[] | TermsPartition + +/** @codegen_names regexp, terms */ +export type TermsExclude = string | string[] + +export class TermsPartition { num_partitions: long partition: long } diff --git a/specification/_types/aggregations/metric.ts b/specification/_types/aggregations/metric.ts index 4dcbff40c9..2aedf9b7b2 100644 --- a/specification/_types/aggregations/metric.ts +++ b/specification/_types/aggregations/metric.ts @@ -19,17 +19,17 @@ import { Highlight } from '@global/search/_types/highlighting' import { SortOrder, Sort } from '@global/search/_types/sort' -import { SourceFilter } from '@global/search/_types/SourceFilter' +import { SourceConfig } from '@global/search/_types/SourceFilter' import { Dictionary } from '@spec_utils/Dictionary' import { UserDefinedValue } from '@spec_utils/UserDefinedValue' import { Field, Fields } from '@_types/common' import { double, integer, long } from '@_types/Numeric' import { QueryContainer } from '@_types/query_dsl/abstractions' -import { GeoLocation } from '@_types/query_dsl/geo' import { Script, ScriptField } from '@_types/Scripting' import { Aggregation } from './Aggregation' import { Missing } from './AggregationContainer' -import { DateInterval } from './bucket' +import { CalendarInterval } from './bucket' +import { GeoLocation } from '@_types/Geo' export class MetricAggregationBase { field?: Field @@ -116,7 +116,7 @@ export class TDigest { } export class RateAggregation extends FormatMetricAggregationBase { - unit?: DateInterval + unit?: CalendarInterval mode?: RateMode } @@ -167,7 +167,7 @@ export class TopHitsAggregation extends MetricAggregationBase { script_fields?: Dictionary size?: integer sort?: Sort - _source?: boolean | SourceFilter | Fields + _source?: SourceConfig stored_fields?: Fields track_scores?: boolean version?: boolean diff --git a/specification/_types/aggregations/pipeline.ts b/specification/_types/aggregations/pipeline.ts index 98637e28cf..05744e62ed 100644 --- a/specification/_types/aggregations/pipeline.ts +++ b/specification/_types/aggregations/pipeline.ts @@ -19,20 +19,25 @@ import { Sort } from '@global/search/_types/sort' import { Dictionary } from '@spec_utils/Dictionary' -import { Name, Field } from '@_types/common' +import { Name, Field, EmptyObject } from '@_types/common' import { integer, double, float } from '@_types/Numeric' import { Script } from '@_types/Scripting' import { Aggregation } from './Aggregation' export class PipelineAggregationBase extends Aggregation { - // TODO: `buckets_path` chanegs based on the aggregation, - // this property should be moved in the aggregations - // that are extending this baseclass - buckets_path?: string | string[] | Dictionary + buckets_path?: BucketsPath format?: string gap_policy?: GapPolicy } +/** + * Buckets path can be expressed in different ways, and an aggregation may accept some or all of these + * forms depending on its type. Please refer to each aggregation's documentation to know what buckets + * path forms they accept. + * @codegen_names single, array, dict + */ +export type BucketsPath = string | string[] | Dictionary + export enum GapPolicy { skip = 0, insert_zeros = 1 @@ -107,26 +112,44 @@ export class MaxBucketAggregation extends PipelineAggregationBase {} export class MinBucketAggregation extends PipelineAggregationBase {} -export class MovingAverageAggregation extends PipelineAggregationBase { +/** @variants internal tag=model */ +export type MovingAverageAggregation = + | LinearMovingAverageAggregation + | SimpleMovingAverageAggregation + | EwmaMovingAverageAggregation + | HoltMovingAverageAggregation + | HoltWintersMovingAverageAggregation + +export class MovingAverageAggregationBase extends PipelineAggregationBase { minimize?: boolean - model?: MovingAverageModel - settings: MovingAverageSettings predict?: integer window?: integer } -export enum MovingAverageModel { - linear, - simple, - ewma, - holt, - holt_winters +export class LinearMovingAverageAggregation extends MovingAverageAggregationBase { + model: 'linear' + settings: EmptyObject +} + +export class SimpleMovingAverageAggregation extends MovingAverageAggregationBase { + model: 'simple' + settings: EmptyObject } -export type MovingAverageSettings = - | EwmaModelSettings - | HoltLinearModelSettings - | HoltWintersModelSettings +export class EwmaMovingAverageAggregation extends MovingAverageAggregationBase { + model: 'ewma' + settings: EwmaModelSettings +} + +export class HoltMovingAverageAggregation extends MovingAverageAggregationBase { + model: 'holt' + settings: HoltLinearModelSettings +} + +export class HoltWintersMovingAverageAggregation extends MovingAverageAggregationBase { + model: 'holt_winters' + settings: HoltWintersModelSettings +} export class EwmaModelSettings { alpha?: float diff --git a/specification/_types/analysis/char_filters.ts b/specification/_types/analysis/char_filters.ts index b1b39befe9..c6d8ee6f09 100644 --- a/specification/_types/analysis/char_filters.ts +++ b/specification/_types/analysis/char_filters.ts @@ -25,8 +25,12 @@ export class CharFilterBase { version?: VersionString } +/** @codegen_names name, definition */ +// ES: NameOrDefinition, used everywhere charfilter, tokenfilter or tokenizer is used +export type CharFilter = string | CharFilterDefinition + /** @variants internal tag='type' */ -export type CharFilter = +export type CharFilterDefinition = | HtmlStripCharFilter | MappingCharFilter | PatternReplaceCharFilter diff --git a/specification/_types/analysis/token_filters.ts b/specification/_types/analysis/token_filters.ts index d92f196e98..6df795b246 100644 --- a/specification/_types/analysis/token_filters.ts +++ b/specification/_types/analysis/token_filters.ts @@ -337,8 +337,12 @@ export class UppercaseTokenFilter extends TokenFilterBase { type: 'uppercase' } +/** @codegen_names name, definition */ +// ES: NameOrDefinition, used everywhere charfilter, tokenfilter or tokenizer is used +export type TokenFilter = string | TokenFilterDefinition + /** @variants internal tag='type' */ -export type TokenFilter = +export type TokenFilterDefinition = | AsciiFoldingTokenFilter | CommonGramsTokenFilter | ConditionTokenFilter diff --git a/specification/_types/analysis/tokenizers.ts b/specification/_types/analysis/tokenizers.ts index 18e43ca566..f9b8d24a40 100644 --- a/specification/_types/analysis/tokenizers.ts +++ b/specification/_types/analysis/tokenizers.ts @@ -21,6 +21,7 @@ import { VersionString } from '@_types/common' import { integer } from '@_types/Numeric' import { IcuTokenizer } from './icu-plugin' import { KuromojiTokenizer } from './kuromoji-plugin' +import { TokenFilterDefinition } from '@_types/analysis/token_filters' export class TokenizerBase { version?: VersionString @@ -115,8 +116,12 @@ export class WhitespaceTokenizer extends TokenizerBase { max_token_length?: integer } +/** @codegen_names name, definition */ +// ES: NameOrDefinition, used everywhere charfilter, tokenfilter or tokenizer is used +export type Tokenizer = string | TokenizerDefinition + /** @variants internal tag='type' */ -export type Tokenizer = +export type TokenizerDefinition = | CharGroupTokenizer | EdgeNGramTokenizer | KeywordTokenizer diff --git a/specification/_types/common.ts b/specification/_types/common.ts index 5deae17f79..1a17dbbcd8 100644 --- a/specification/_types/common.ts +++ b/specification/_types/common.ts @@ -22,8 +22,12 @@ import { UserDefinedValue } from '@spec_utils/UserDefinedValue' import { double, integer, long } from './Numeric' import { AdditionalProperties } from '@spec_utils/behaviors' -/** A single value */ -export type ScalarValue = long | double | string | boolean +/** + * A field value. + * @codegen_names long, double, string, boolean + */ +// FIXME: representation of geopoints and ip addresses? +export type FieldValue = long | double | string | boolean export class UrlParameter {} @@ -111,6 +115,7 @@ export type MultiTermQueryRewrite = string export type Field = string export type Fields = Field | Field[] +/** @codegen_names count, option */ export type WaitForActiveShards = integer | WaitForActiveShardOptions /** @@ -137,12 +142,6 @@ export class EmptyObject {} */ export type MinimumShouldMatch = integer | string -export enum ShapeRelation { - intersects = 0, - disjoint = 1, - within = 2 -} - /** * Byte size units. These units use powers of 1024, so 1 kB means 1024 bytes. * @@ -183,7 +182,7 @@ export class ElasticsearchUrlFormatter {} /** * Type of index that wildcard expressions can match. */ -export enum ExpandWildcardOptions { +export enum ExpandWildcard { /** Match any data stream or index, including hidden ones. */ all = 0, /** Match open, non-hidden indices. Also matches any non-hidden data stream. */ @@ -196,16 +195,7 @@ export enum ExpandWildcardOptions { none = 4 } -export type ExpandWildcards = - | ExpandWildcardOptions - | Array - | string - -export enum GroupBy { - nodes = 0, - parents = 1, - none = 2 -} +export type ExpandWildcards = ExpandWildcard | ExpandWildcard[] /** * Health status of the cluster, based on the state of its primary and replica shards. @@ -238,9 +228,11 @@ export enum OpType { create = 1 } -export type Refresh = boolean | RefreshOptions -export enum RefreshOptions { - wait_for = 1 +// Note: ES also accepts plain booleans for true and false. The TS generator implements this leniency rule. +export enum Refresh { + true, + false, + wait_for } export enum SearchType { @@ -250,15 +242,6 @@ export enum SearchType { dfs_query_then_fetch = 1 } -export enum Size { - Raw = 0, - k = 1, - m = 2, - g = 3, - t = 4, - p = 5 -} - export enum SuggestMode { missing = 0, popular = 1, diff --git a/specification/_types/mapping/Property.ts b/specification/_types/mapping/Property.ts index 8e7d42e26b..694f22932a 100644 --- a/specification/_types/mapping/Property.ts +++ b/specification/_types/mapping/Property.ts @@ -45,7 +45,7 @@ export class PropertyBase { name?: PropertyName properties?: Dictionary ignore_above?: integer - dynamic?: boolean | DynamicMapping + dynamic?: DynamicMapping fields?: Dictionary } diff --git a/specification/_types/mapping/TypeMapping.ts b/specification/_types/mapping/TypeMapping.ts index 87ad53b53e..f5682c3a27 100644 --- a/specification/_types/mapping/TypeMapping.ts +++ b/specification/_types/mapping/TypeMapping.ts @@ -34,7 +34,7 @@ import { RuntimeField } from './RuntimeFields' export class TypeMapping { all_field?: AllField date_detection?: boolean - dynamic?: boolean | DynamicMapping + dynamic?: DynamicMapping dynamic_date_formats?: string[] dynamic_templates?: | Dictionary diff --git a/specification/_types/mapping/dynamic-template.ts b/specification/_types/mapping/dynamic-template.ts index ae67e23ac2..3cc1bbced3 100644 --- a/specification/_types/mapping/dynamic-template.ts +++ b/specification/_types/mapping/dynamic-template.ts @@ -35,8 +35,8 @@ export enum MatchType { } export enum DynamicMapping { - strict = 0, - runtime = 1, - true = 2, - false = 3 + strict, + runtime, + true, + false } diff --git a/specification/_types/mapping/geo.ts b/specification/_types/mapping/geo.ts index fc6e776986..93e3c870e5 100644 --- a/specification/_types/mapping/geo.ts +++ b/specification/_types/mapping/geo.ts @@ -17,8 +17,8 @@ * under the License. */ -import { GeoLocation } from '@_types/query_dsl/geo' import { DocValuesPropertyBase } from './core' +import { GeoLocation } from '@_types/Geo' export class GeoPointProperty extends DocValuesPropertyBase { ignore_malformed?: boolean diff --git a/specification/_types/query_dsl/Operator.ts b/specification/_types/query_dsl/Operator.ts index d6201cba3b..751f3351ba 100644 --- a/specification/_types/query_dsl/Operator.ts +++ b/specification/_types/query_dsl/Operator.ts @@ -20,6 +20,8 @@ // Note: corresponding server enum is uppercase, but parsing is case-insensitive. Tests only use lower-case identifiers // so we only keep those. export enum Operator { - and = 0, - or = 1 + /** @aliases AND */ + and, + /** @aliases OR */ + or } diff --git a/specification/_types/query_dsl/abstractions.ts b/specification/_types/query_dsl/abstractions.ts index 8f886ef29a..4c594e86c4 100644 --- a/specification/_types/query_dsl/abstractions.ts +++ b/specification/_types/query_dsl/abstractions.ts @@ -25,7 +25,7 @@ import { MinimumShouldMatch, Routing } from '@_types/common' -import { float, long } from '@_types/Numeric' +import { float } from '@_types/Numeric' import { BoolQuery, BoostingQuery, @@ -200,3 +200,19 @@ export enum CombinedFieldsZeroTerms { none, all } + +/** + * A reference to a field with formatting instructions on how to return the value + * @shortcut_property field + */ +export class FieldAndFormat { + /** + * Wildcard pattern. The request returns values for field names matching this pattern. + */ + field: Field + /** + * Format in which the values are returned. + */ + format?: string + include_unmapped?: boolean +} diff --git a/specification/_types/query_dsl/compound.ts b/specification/_types/query_dsl/compound.ts index f0db4d47f7..5bb85a72a9 100644 --- a/specification/_types/query_dsl/compound.ts +++ b/specification/_types/query_dsl/compound.ts @@ -19,12 +19,11 @@ import { AdditionalProperties, AdditionalProperty } from '@spec_utils/behaviors' import { Field, MinimumShouldMatch } from '@_types/common' -import { Distance } from '@_types/Geo' +import { Distance, GeoLocation } from '@_types/Geo' import { double, float, long } from '@_types/Numeric' import { Script } from '@_types/Scripting' import { DateMath, Time } from '@_types/Time' import { QueryBase, QueryContainer } from './abstractions' -import { GeoLocation } from './geo' export class BoolQuery extends QueryBase { filter?: QueryContainer | QueryContainer[] @@ -105,6 +104,8 @@ export class GeoDecayFunction extends DecayFunctionBase implements AdditionalProperty> {} +/** @codegen_names date, numeric, geo */ +// Note: deserialization depends on value types export type DecayFunction = | DateDecayFunction | NumericDecayFunction diff --git a/specification/_types/query_dsl/fulltext.ts b/specification/_types/query_dsl/fulltext.ts index 7189d9fa1e..3cd87126d7 100644 --- a/specification/_types/query_dsl/fulltext.ts +++ b/specification/_types/query_dsl/fulltext.ts @@ -268,7 +268,14 @@ export class QueryStringQuery extends QueryBase { type?: TextQueryType } -export enum SimpleQueryStringFlags { +/** + * Query flags can be either a single flag or a combination of flags, e.g. `OR|AND|PREFIX` + * @doc_url https://www.elastic.co/guide/en/elasticsearch/reference/7.15/query-dsl-simple-query-string-query.html#supported-flags + * @codegen_names single, multiple + */ +export type SimpleQueryStringFlags = SimpleQueryStringFlag | string + +export enum SimpleQueryStringFlag { NONE = 1, AND = 2, OR = 4, @@ -293,7 +300,7 @@ export class SimpleQueryStringQuery extends QueryBase { /** @server_default 'or' */ default_operator?: Operator fields?: Field[] - flags?: SimpleQueryStringFlags | string + flags?: SimpleQueryStringFlags fuzzy_max_expansions?: integer fuzzy_prefix_length?: integer fuzzy_transpositions?: boolean diff --git a/specification/_types/query_dsl/geo.ts b/specification/_types/query_dsl/geo.ts index 6ad345367c..c981e2c085 100644 --- a/specification/_types/query_dsl/geo.ts +++ b/specification/_types/query_dsl/geo.ts @@ -17,40 +17,21 @@ * under the License. */ -import { AdditionalProperties, AdditionalProperty } from '@spec_utils/behaviors' +import { AdditionalProperty } from '@spec_utils/behaviors' import { Distance, + GeoBounds, GeoDistanceType, + GeoLocation, GeoShape, - GeoShapeRelation, - LatLon + GeoShapeRelation } from '@_types/Geo' -import { double } from '@_types/Numeric' import { FieldLookup, QueryBase } from './abstractions' import { Field } from '@_types/common' -import { UserDefinedValue } from '@spec_utils/UserDefinedValue' - -/** - * A geo bounding box. The various coordinates can be mixed. When set, `wkt` takes precedence over all other fields. - */ -export class BoundingBox { - bottom_right?: GeoLocation - top_left?: GeoLocation - - top_right?: GeoLocation - bottom_left?: GeoLocation - - top?: double - left?: double - right?: double - bottom?: double - - wkt?: string -} export class GeoBoundingBoxQuery extends QueryBase - implements AdditionalProperty + implements AdditionalProperty { /** @deprecated 7.14.0 */ type?: GeoExecution @@ -123,28 +104,6 @@ export enum TokenType { Comma = 4 } -// TODO -- is duplicate with LatLon -export class TwoDimensionalPoint { - lat: double - lon: double -} - -export class ThreeDimensionalPoint { - lat: double - lon: double - z?: double -} - -/** - * Represents a Latitude/Longitude as a 2 dimensional point - */ -export type GeoLocation = string | double[] | TwoDimensionalPoint - -/** - * Represents a Latitude/Longitude and optional Z value as a 2 or 3 dimensional point - */ -export type GeoCoordinate = string | double[] | ThreeDimensionalPoint - export enum GeoValidationMethod { coerce = 0, ignore_malformed = 1, diff --git a/specification/_types/query_dsl/specialized.ts b/specification/_types/query_dsl/specialized.ts index 31e74ff5eb..839801b0c7 100644 --- a/specification/_types/query_dsl/specialized.ts +++ b/specification/_types/query_dsl/specialized.ts @@ -27,17 +27,15 @@ import { IndexName, MinimumShouldMatch, Routing, - ShapeRelation, Type, VersionNumber, VersionType } from '@_types/common' -import { Distance, GeoShape } from '@_types/Geo' +import { Distance, GeoLocation, GeoShape, GeoShapeRelation } from '@_types/Geo' import { double, float, integer, long } from '@_types/Numeric' import { Script } from '@_types/Scripting' import { DateMath, Time } from '@_types/Time' import { FieldLookup, QueryBase, QueryContainer } from './abstractions' -import { GeoCoordinate } from './geo' import { AdditionalProperty } from '@spec_utils/behaviors' export class DistanceFeatureQueryBase extends QueryBase { @@ -47,7 +45,7 @@ export class DistanceFeatureQueryBase extends QueryBase { } export class GeoDistanceFeatureQuery extends DistanceFeatureQueryBase< - GeoCoordinate, + GeoLocation, Distance > {} @@ -56,6 +54,8 @@ export class DateDistanceFeatureQuery extends DistanceFeatureQueryBase< Time > {} +/** @codegen_names geo, date */ +// Note: deserialization depends on value types export type DistanceFeatureQuery = | GeoDistanceFeatureQuery | DateDistanceFeatureQuery @@ -105,7 +105,7 @@ export class LikeDocument { /** * Text that we want similar documents for or a lookup to a document's field for the text. * @doc_url https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html#_document_input_parameters - * + * @codegen_names text, document */ export type Like = string | LikeDocument @@ -177,11 +177,13 @@ export class ScriptScoreQuery extends QueryBase { // holding also the query base fields (boost and _name) export class ShapeQuery extends QueryBase - implements AdditionalProperty {} + implements AdditionalProperty +{ + ignore_unmapped?: boolean +} export class ShapeFieldQuery { - ignore_unmapped?: boolean indexed_shape?: FieldLookup - relation?: ShapeRelation + relation?: GeoShapeRelation shape?: GeoShape } diff --git a/specification/_types/query_dsl/term.ts b/specification/_types/query_dsl/term.ts index 1cbb843e91..a8a41a37cc 100644 --- a/specification/_types/query_dsl/term.ts +++ b/specification/_types/query_dsl/term.ts @@ -24,7 +24,8 @@ import { Ids, IndexName, MultiTermQueryRewrite, - Routing + Routing, + FieldValue } from '@_types/common' import { double, float, integer, long } from '@_types/Numeric' import { Script } from '@_types/Scripting' @@ -88,6 +89,8 @@ export class NumberRangeQuery extends RangeQueryBase { to?: double } +/** @codegen_names date, number */ +// Note: deserialization depends on value types export type RangeQuery = DateRangeQuery | NumberRangeQuery export enum RangeRelation { @@ -112,14 +115,19 @@ export class RegexpQuery extends QueryBase { /** @shortcut_property value */ export class TermQuery extends QueryBase { - value: string | float | boolean + value: FieldValue /** @since 7.10.0 */ case_insensitive?: boolean } export class TermsQuery extends QueryBase - implements AdditionalProperty {} + implements AdditionalProperty {} + +/** + * @codegen_names value, lookup + */ +export type TermsQueryField = FieldValue[] | TermsLookup export class TermsLookup { index: IndexName diff --git a/specification/async_search/submit/AsyncSearchSubmitRequest.ts b/specification/async_search/submit/AsyncSearchSubmitRequest.ts index 880417b2e5..4c6e4aeca9 100644 --- a/specification/async_search/submit/AsyncSearchSubmitRequest.ts +++ b/specification/async_search/submit/AsyncSearchSubmitRequest.ts @@ -34,17 +34,21 @@ import { } from '@_types/common' import { RuntimeFields } from '@_types/mapping/RuntimeFields' import { double, integer, long } from '@_types/Numeric' -import { QueryContainer } from '@_types/query_dsl/abstractions' +import { FieldAndFormat, QueryContainer } from '@_types/query_dsl/abstractions' import { ScriptField } from '@_types/Scripting' import { SlicedScroll } from '@_types/SlicedScroll' -import { DateField, Time } from '@_types/Time' +import { Time } from '@_types/Time' import { FieldCollapse } from '@global/search/_types/FieldCollapse' import { Highlight } from '@global/search/_types/highlighting' import { PointInTimeReference } from '@global/search/_types/PointInTimeReference' import { Rescore } from '@global/search/_types/rescoring' import { Sort, SortResults } from '@global/search/_types/sort' -import { DocValueField, SourceFilter } from '@global/search/_types/SourceFilter' -import { SuggestContainer } from '@global/search/_types/suggester' +import { + GetSourceConfig, + SourceConfig +} from '@global/search/_types/SourceFilter' +import { Suggester } from '@global/search/_types/suggester' +import { TrackHits } from '@global/search/_types/hits' /** * @rest_spec_name async_search.submit @@ -99,12 +103,12 @@ export interface Request extends RequestBase { suggest_text?: string terminate_after?: long timeout?: Time - track_total_hits?: boolean | integer + track_total_hits?: TrackHits track_scores?: boolean typed_keys?: boolean rest_total_hits_as_int?: boolean version?: boolean - _source?: boolean | Fields + _source?: GetSourceConfig _source_excludes?: Fields _source_includes?: Fields seq_no_primary_term?: boolean @@ -136,7 +140,7 @@ export interface Request extends RequestBase { * response does not include the total number of hits matching the query. * Defaults to 10,000 hits. */ - track_total_hits?: boolean | integer + track_total_hits?: TrackHits /** * Boosts the _score of documents from specified indices. */ @@ -145,7 +149,7 @@ export interface Request extends RequestBase { * Array of wildcard (*) patterns. The request returns doc values for field * names matching these patterns in the hits.fields property of the response. */ - docvalue_fields?: DocValueField | Array + docvalue_fields?: FieldAndFormat[] /** * Minimum _score for matching documents. Documents with a lower _score are * not included in the search results. @@ -177,13 +181,13 @@ export interface Request extends RequestBase { * Indicates which source fields are returned for matching documents. These * fields are returned in the hits._source property of the search response. */ - _source?: boolean | Fields | SourceFilter + _source?: SourceConfig /** * Array of wildcard (*) patterns. The request returns values for field names * matching these patterns in the hits.fields property of the response. */ - fields?: Array - suggest?: SuggestContainer | Dictionary + fields?: Array + suggest?: Suggester /** * Maximum number of documents to collect for each shard. If a query reaches this * limit, Elasticsearch terminates the query early. Elasticsearch collects documents diff --git a/specification/cat/thread_pool/CatThreadPoolRequest.ts b/specification/cat/thread_pool/CatThreadPoolRequest.ts index bd5d4027c9..99fa54b3fc 100644 --- a/specification/cat/thread_pool/CatThreadPoolRequest.ts +++ b/specification/cat/thread_pool/CatThreadPoolRequest.ts @@ -18,7 +18,8 @@ */ import { CatRequestBase } from '@cat/_types/CatBase' -import { Names, Size } from '@_types/common' +import { Names } from '@_types/common' +import { ThreadPoolSize } from '@cat/thread_pool/types' /** * @rest_spec_name cat.thread_pool @@ -30,6 +31,6 @@ export interface Request extends CatRequestBase { thread_pool_patterns?: Names } query_parameters: { - size?: Size | boolean + size?: ThreadPoolSize } } diff --git a/specification/cat/thread_pool/types.ts b/specification/cat/thread_pool/types.ts index b8968f3281..a88bcb555d 100644 --- a/specification/cat/thread_pool/types.ts +++ b/specification/cat/thread_pool/types.ts @@ -121,3 +121,11 @@ export class ThreadPoolRecord { */ 'keep_alive'?: string } + +export enum ThreadPoolSize { + k = 1, + m = 2, + g = 3, + t = 4, + p = 5 +} diff --git a/specification/eql/search/EqlSearchRequest.ts b/specification/eql/search/EqlSearchRequest.ts index 725dc6ee5f..3661694b6f 100644 --- a/specification/eql/search/EqlSearchRequest.ts +++ b/specification/eql/search/EqlSearchRequest.ts @@ -20,9 +20,9 @@ import { RequestBase } from '@_types/Base' import { ExpandWildcards, Field, IndexName } from '@_types/common' import { float, uint } from '@_types/Numeric' -import { QueryContainer } from '@_types/query_dsl/abstractions' +import { FieldAndFormat, QueryContainer } from '@_types/query_dsl/abstractions' import { Time } from '@_types/Time' -import { ResultPosition, SearchFieldFormatted } from './types' +import { ResultPosition } from './types' /** * @rest_spec_name eql.search @@ -99,11 +99,11 @@ export interface Request extends RequestBase { * For basic queries, the maximum number of matching events to return. Defaults to 10 * @doc_url https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-syntax.html#eql-basic-syntax */ - size?: uint | float + size?: uint // doc says "integer of float" but it's really an int /** * Array of wildcard (*) patterns. The response returns values for field names matching these patterns in the fields property of each hit. */ - fields?: Array + fields?: FieldAndFormat /** * @server_default tail */ diff --git a/specification/eql/search/types.ts b/specification/eql/search/types.ts index 6920330130..1a22b2c358 100644 --- a/specification/eql/search/types.ts +++ b/specification/eql/search/types.ts @@ -17,19 +17,6 @@ * under the License. */ -import { Field } from '@_types/common' - -export class SearchFieldFormatted { - /** - * Wildcard pattern. The request returns values for field names matching this pattern. - */ - field: Field - /** - * Format in which the values are returned. - */ - format?: string -} - /** * Set of matching events or sequences to return. */ diff --git a/specification/ilm/_types/Phase.ts b/specification/ilm/_types/Phase.ts index a9fdeb1caa..24d181a582 100644 --- a/specification/ilm/_types/Phase.ts +++ b/specification/ilm/_types/Phase.ts @@ -20,11 +20,11 @@ import { Dictionary } from '@spec_utils/Dictionary' import { integer } from '@_types/Numeric' import { Time } from '@_types/Time' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' export class Phase { - actions?: Dictionary | string[] + actions?: Actions min_age?: Time - configurations?: Dictionary> } export class Phases { @@ -34,4 +34,6 @@ export class Phases { warm?: Phase } -export class Action {} +// TODO. This is a variants container. +// See https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-index-lifecycle.html#ilm-phase-actions +export type Actions = UserDefinedValue diff --git a/specification/indices/_types/IndexState.ts b/specification/indices/_types/IndexState.ts index 99f97151b0..874ceea5fb 100644 --- a/specification/indices/_types/IndexState.ts +++ b/specification/indices/_types/IndexState.ts @@ -26,10 +26,6 @@ import { IndexSettings } from './IndexSettings' export class IndexState { aliases?: Dictionary mappings?: TypeMapping - settings?: IndexSettings | IndexStatePrefixedSettings + settings?: IndexSettings data_stream?: DataStreamName } - -export class IndexStatePrefixedSettings { - index: IndexSettings -} diff --git a/specification/indices/analyze/IndicesAnalyzeRequest.ts b/specification/indices/analyze/IndicesAnalyzeRequest.ts index 00cef48327..f88dd6b344 100644 --- a/specification/indices/analyze/IndicesAnalyzeRequest.ts +++ b/specification/indices/analyze/IndicesAnalyzeRequest.ts @@ -36,12 +36,12 @@ export interface Request extends RequestBase { body: { analyzer?: string attributes?: string[] - char_filter?: Array + char_filter?: Array explain?: boolean field?: Field - filter?: Array + filter?: Array normalizer?: string text?: TextToAnalyze - tokenizer?: string | Tokenizer + tokenizer?: Tokenizer } } diff --git a/specification/indices/put_mapping/IndicesPutMappingRequest.ts b/specification/indices/put_mapping/IndicesPutMappingRequest.ts index cef8d258d0..81605b69f7 100644 --- a/specification/indices/put_mapping/IndicesPutMappingRequest.ts +++ b/specification/indices/put_mapping/IndicesPutMappingRequest.ts @@ -61,7 +61,7 @@ export interface Request extends RequestBase { /** * Controls whether new fields are added dynamically. */ - dynamic?: boolean | DynamicMapping + dynamic?: DynamicMapping /** * If date detection is enabled then new string fields are checked * against 'dynamic_date_formats' and if the value matches then diff --git a/specification/indices/rollover/IndicesRolloverRequest.ts b/specification/indices/rollover/IndicesRolloverRequest.ts index 6ddf8e5d17..d6b98c7e21 100644 --- a/specification/indices/rollover/IndicesRolloverRequest.ts +++ b/specification/indices/rollover/IndicesRolloverRequest.ts @@ -24,7 +24,7 @@ import { RequestBase } from '@_types/Base' import { IndexAlias, IndexName, WaitForActiveShards } from '@_types/common' import { TypeMapping } from '@_types/mapping/TypeMapping' import { Time } from '@_types/Time' -import { RolloverConditions } from './types' +import { IndexRolloverMapping, RolloverConditions } from './types' /** * @rest_spec_name indices.rollover @@ -46,7 +46,8 @@ export interface Request extends RequestBase { body: { aliases?: Dictionary conditions?: RolloverConditions - mappings?: Dictionary | TypeMapping + // Mappings is a dictionary if include_type_name is true, which is deprecated in 7.0 and removed in 8.0 + mappings?: IndexRolloverMapping settings?: Dictionary } } diff --git a/specification/indices/rollover/types.ts b/specification/indices/rollover/types.ts index 34b01a6e94..753626edde 100644 --- a/specification/indices/rollover/types.ts +++ b/specification/indices/rollover/types.ts @@ -20,6 +20,8 @@ import { ByteSize } from '@_types/common' import { long } from '@_types/Numeric' import { Time } from '@_types/Time' +import { TypeMapping } from '@_types/mapping/TypeMapping' +import { Dictionary } from '@spec_utils/Dictionary' export class RolloverConditions { max_age?: Time @@ -27,3 +29,8 @@ export class RolloverConditions { max_size?: string max_primary_shard_size?: ByteSize } + +/** + * @codegen_names single, by_type + */ +export type IndexRolloverMapping = TypeMapping | Dictionary diff --git a/specification/ingest/_types/Processors.ts b/specification/ingest/_types/Processors.ts index 9b1a96bb89..b046b0cffd 100644 --- a/specification/ingest/_types/Processors.ts +++ b/specification/ingest/_types/Processors.ts @@ -160,26 +160,14 @@ export class CsvProcessor extends ProcessorBase { trim: boolean } -export enum DateRounding { - /** @codegen_name Second */ - s = 0, - /** @codegen_name Minute */ - m = 1, - /** @codegen_name Hour */ - h = 2, - /** @codegen_name Day */ - d = 3, - /** @codegen_name Week */ - w = 4, - /** @codegen_name Month */ - M = 5, - /** @codegen_name Year */ - y = 6 -} - export class DateIndexNameProcessor extends ProcessorBase { date_formats: string[] - date_rounding: string | DateRounding + /** + * How to round the date when formatting the date into the index name. Valid values are: + * `y` (year), `M` (month), `w` (week), `d` (day), `h` (hour), `m` (minute) and `s` (second). + * Supports template snippets. + */ + date_rounding: string field: Field index_name_format: string index_name_prefix: string diff --git a/specification/ml/_types/Analysis.ts b/specification/ml/_types/Analysis.ts index 87d8b6a31a..c7b7643da1 100644 --- a/specification/ml/_types/Analysis.ts +++ b/specification/ml/_types/Analysis.ts @@ -22,7 +22,7 @@ import { long } from '@_types/Numeric' import { Time, TimeSpan } from '@_types/Time' import { Detector } from './Detector' import { CharFilter } from '@_types/analysis/char_filters' -import { Tokenizer } from '@_types/analysis/tokenizers' +import { Tokenizer, TokenizerDefinition } from '@_types/analysis/tokenizers' import { TokenFilter } from '@_types/analysis/token_filters' import { OverloadOf } from '@spec_utils/behaviors' @@ -35,7 +35,7 @@ export class AnalysisConfig { /** * If `categorization_field_name` is specified, you can also define the analyzer that is used to interpret the categorization field. This property cannot be used at the same time as `categorization_filters`. The categorization analyzer specifies how the `categorization_field` is interpreted by the categorization process. The `categorization_analyzer` field can be specified either as a string or as an object. If it is a string it must refer to a built-in analyzer or one added by another plugin. */ - categorization_analyzer?: CategorizationAnalyzer | string + categorization_analyzer?: CategorizationAnalyzer /** * If this property is specified, the values of the specified field will be categorized. The resulting categories must be used in a detector by setting `by_field_name`, `over_field_name`, or `partition_field_name` to the keyword `mlcategory`. */ @@ -77,7 +77,7 @@ export class AnalysisConfig { export class AnalysisConfigRead implements OverloadOf { bucket_span: TimeSpan - categorization_analyzer?: CategorizationAnalyzer | string + categorization_analyzer?: CategorizationAnalyzer categorization_field_name?: Field categorization_filters?: string[] detectors: Detector[] @@ -120,17 +120,20 @@ export class AnalysisMemoryLimit { model_memory_limit: string } -export class CategorizationAnalyzer { - char_filter?: Array +/** @codegen_names name, definition */ +export type CategorizationAnalyzer = string | CategorizationAnalyzerDefinition + +export class CategorizationAnalyzerDefinition { /** * One or more character filters. In addition to the built-in character filters, other plugins can provide more character filters. If this property is not specified, no character filters are applied prior to categorization. If you are customizing some other aspect of the analyzer and you need to achieve the equivalent of `categorization_filters` (which are not permitted when some other aspect of the analyzer is customized), add them here as pattern replace character filters. */ - filter?: Array + char_filter?: Array /** * One or more token filters. In addition to the built-in token filters, other plugins can provide more token filters. If this property is not specified, no token filters are applied prior to categorization. */ - tokenizer?: string | Tokenizer + filter?: Array /** * The name or definition of the tokenizer to use after character filters are applied. This property is compulsory if `categorization_analyzer` is specified as an object. Machine learning provides a tokenizer called `ml_standard` that tokenizes in a way that has been determined to produce good categorization results on a variety of log file formats for logs in English. If you want to use that tokenizer but change the character or token filters, specify "tokenizer": "ml_standard" in your `categorization_analyzer`. Additionally, the `ml_classic` tokenizer is available, which tokenizes in the same way as the non-customizable tokenizer in old versions of the product (before 6.2). `ml_classic` was the default categorization tokenizer in versions 6.2 to 7.13, so if you need categorization identical to the default for jobs created in these versions, specify "tokenizer": "ml_classic" in your `categorization_analyzer`. */ + tokenizer?: Tokenizer } diff --git a/specification/ml/_types/DataframeAnalytics.ts b/specification/ml/_types/DataframeAnalytics.ts index b15914b242..de0d4853fe 100644 --- a/specification/ml/_types/DataframeAnalytics.ts +++ b/specification/ml/_types/DataframeAnalytics.ts @@ -234,10 +234,8 @@ export class DataframeAnalysisClassification extends DataframeAnalysis { num_top_classes?: integer } -export type DataframeAnalysisAnalyzedFields = - | string[] - | DataframeAnalysisAnalyzedFieldsIncludeExclude -export class DataframeAnalysisAnalyzedFieldsIncludeExclude { +/** @shortcut_property includes */ +export class DataframeAnalysisAnalyzedFields { /** An array of strings that defines the fields that will be excluded from the analysis. You do not need to add fields with unsupported data types to excludes, these fields are excluded from the analysis automatically. */ includes: string[] /** An array of strings that defines the fields that will be included in the analysis. */ diff --git a/specification/ml/_types/Settings.ts b/specification/ml/_types/Settings.ts index 63b5216e5d..fb6e91c259 100644 --- a/specification/ml/_types/Settings.ts +++ b/specification/ml/_types/Settings.ts @@ -17,11 +17,11 @@ * under the License. */ -import { Dictionary } from '@spec_utils/Dictionary' -import { UrlConfig } from '@xpack/usage/types' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' -export class CustomSettings { - custom_urls?: UrlConfig[] - created_by?: string - job_tags?: Dictionary -} +/** + * Custom metadata about the job + */ +// Can be anything, see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html +// Some settings are illustrated in https://www.elastic.co/guide/en/machine-learning/7.15/ml-configuring-url.html +export type CustomSettings = UserDefinedValue diff --git a/specification/nodes/info/types.ts b/specification/nodes/info/types.ts index 68f723dba3..cfd6964223 100644 --- a/specification/nodes/info/types.ts +++ b/specification/nodes/info/types.ts @@ -172,12 +172,13 @@ export class NodeInfoClient { } export class NodeInfoSettingsHttp { - type: string | NodeInfoSettingsHttpType + type: NodeInfoSettingsHttpType 'type.default'?: string // TODO this clashes with NodeInfoSettingsHttpType compression?: boolean | string port?: integer | string } +/** @shortcut_property default */ export class NodeInfoSettingsHttpType { default: string } @@ -187,11 +188,12 @@ export class NodeInfoBootstrap { } export class NodeInfoSettingsTransport { - type: string | NodeInfoSettingsTransportType + type: NodeInfoSettingsTransportType 'type.default'?: string // TODO this clashes with NodeInfoSettingsTransportType features?: NodeInfoSettingsTransportFeatures } +/** @shortcut_property default */ export class NodeInfoSettingsTransportType { default: string } diff --git a/specification/nodes/reload_secure_settings/ReloadSecureSettingsResponse.ts b/specification/nodes/reload_secure_settings/ReloadSecureSettingsResponse.ts index 67d95b3eb4..7b147cec40 100644 --- a/specification/nodes/reload_secure_settings/ReloadSecureSettingsResponse.ts +++ b/specification/nodes/reload_secure_settings/ReloadSecureSettingsResponse.ts @@ -21,11 +21,11 @@ import { Stats } from '@nodes/_types/Stats' import { NodesResponseBase } from '@nodes/_types/NodesResponseBase' import { Dictionary } from '@spec_utils/Dictionary' import { Name } from '@_types/common' -import { NodeReloadException } from './types' +import { NodeReloadResult } from './types' export class Response extends NodesResponseBase { body: { cluster_name: Name - nodes: Dictionary + nodes: Dictionary } } diff --git a/specification/nodes/reload_secure_settings/types.ts b/specification/nodes/reload_secure_settings/types.ts index e3370db675..e5b912b08d 100644 --- a/specification/nodes/reload_secure_settings/types.ts +++ b/specification/nodes/reload_secure_settings/types.ts @@ -18,14 +18,13 @@ */ import { Name } from '@_types/common' +import { ErrorCause } from '@_types/Errors' +import { Stats } from '@nodes/_types/Stats' -export class NodeReloadException { +export class NodeReloadError { name: Name - reload_exception?: NodeReloadExceptionCausedBy + reload_exception?: ErrorCause } -export class NodeReloadExceptionCausedBy { - type: string - reason: string - caused_by?: NodeReloadExceptionCausedBy -} +/** @codegen_names stats, error */ +export type NodeReloadResult = Stats | NodeReloadError diff --git a/specification/security/_types/Privileges.ts b/specification/security/_types/Privileges.ts index 8af61da41e..c2cd61457c 100644 --- a/specification/security/_types/Privileges.ts +++ b/specification/security/_types/Privileges.ts @@ -91,7 +91,7 @@ export class IndicesPrivileges { /** * A search query that defines the documents the owners of the role have read access to. A document within the specified indices must match this query for it to be accessible by the owners of the role. */ - query?: string | QueryContainer + query?: string | string[] /** * Set to `true` if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the `names` list, Elasticsearch checks privileges against these indices regardless of the value set for `allow_restricted_indices`. * @server_default false diff --git a/specification/security/_types/RoleMapping.ts b/specification/security/_types/RoleMapping.ts index 2e76bda6d0..494a1bfe74 100644 --- a/specification/security/_types/RoleMapping.ts +++ b/specification/security/_types/RoleMapping.ts @@ -21,6 +21,7 @@ import { RoleTemplate } from '@security/get_role/types' import { Metadata } from '@_types/common' import { RoleMappingRule } from './RoleMappingRule' +// ES: ExpressionRoleMapping export class RoleMapping { enabled: boolean metadata: Metadata diff --git a/specification/security/get_role/types.ts b/specification/security/get_role/types.ts index 2de447d958..b40a9dcc84 100644 --- a/specification/security/get_role/types.ts +++ b/specification/security/get_role/types.ts @@ -22,6 +22,7 @@ import { ApplicationPrivileges } from '@security/_types/Privileges' import { Metadata } from '@_types/common' +import { Script } from '@_types/Scripting' export class Role { cluster: string[] @@ -42,30 +43,8 @@ export enum TemplateFormat { json = 1 } -export class InlineRoleTemplate { - template: InlineRoleTemplateSource +// ES: TemplateRoleName +export class RoleTemplate { format?: TemplateFormat + template: Script } - -export class InlineRoleTemplateSource { - source: string -} - -export class StoredRoleTemplate { - template: StoredRoleTemplateId - format?: TemplateFormat -} - -export class StoredRoleTemplateId { - id: string -} - -export class InvalidRoleTemplate { - template: string - format?: TemplateFormat -} - -export type RoleTemplate = - | InlineRoleTemplate - | StoredRoleTemplate - | InvalidRoleTemplate diff --git a/specification/sql/translate/TranslateSqlResponse.ts b/specification/sql/translate/TranslateSqlResponse.ts index b0c5223340..1f48184a6b 100644 --- a/specification/sql/translate/TranslateSqlResponse.ts +++ b/specification/sql/translate/TranslateSqlResponse.ts @@ -18,7 +18,7 @@ */ import { Sort } from '@global/search/_types/sort' -import { SourceFilter } from '@global/search/_types/SourceFilter' +import { SourceConfig } from '@global/search/_types/SourceFilter' import { Dictionary } from '@spec_utils/Dictionary' import { Field, Fields } from '@_types/common' import { long } from '@_types/Numeric' @@ -26,7 +26,7 @@ import { long } from '@_types/Numeric' export class Response { body: { size: long - _source: boolean | Fields | SourceFilter + _source: SourceConfig fields: Array> sort: Sort } diff --git a/specification/tasks/_types/GroupBy.ts b/specification/tasks/_types/GroupBy.ts new file mode 100644 index 0000000000..c05ce54ee3 --- /dev/null +++ b/specification/tasks/_types/GroupBy.ts @@ -0,0 +1,24 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export enum GroupBy { + nodes = 0, + parents = 1, + none = 2 +} diff --git a/specification/tasks/list/ListTasksRequest.ts b/specification/tasks/list/ListTasksRequest.ts index 8ed5e0885e..488e3ad0ef 100644 --- a/specification/tasks/list/ListTasksRequest.ts +++ b/specification/tasks/list/ListTasksRequest.ts @@ -18,8 +18,9 @@ */ import { RequestBase } from '@_types/Base' -import { GroupBy, Id } from '@_types/common' +import { Id } from '@_types/common' import { Time } from '@_types/Time' +import { GroupBy } from '@tasks/_types/GroupBy' /** * @rest_spec_name tasks.list diff --git a/specification/tasks/list/ListTasksResponse.ts b/specification/tasks/list/ListTasksResponse.ts index 740de064d6..a1e773982e 100644 --- a/specification/tasks/list/ListTasksResponse.ts +++ b/specification/tasks/list/ListTasksResponse.ts @@ -26,6 +26,6 @@ export class Response { body: { node_failures?: ErrorCause[] nodes?: Dictionary - tasks?: Dictionary | Array + tasks?: Dictionary } } diff --git a/specification/watcher/_types/Schedule.ts b/specification/watcher/_types/Schedule.ts index 84b69563d6..59f87630db 100644 --- a/specification/watcher/_types/Schedule.ts +++ b/specification/watcher/_types/Schedule.ts @@ -31,7 +31,7 @@ export type CronExpression = string //export class CronExpression extends ScheduleBase {} export class DailySchedule { - at: string[] | TimeOfDay + at: TimeOfDay[] } export enum Day { @@ -55,10 +55,15 @@ export class Interval { } export enum IntervalUnit { + /** @codegen_name second */ s = 0, + /** @codegen_name minute */ m = 1, + /** @codegen_name hour */ h = 2, + /** @codegen_name day */ d = 3, + /** @codegen_name week */ w = 4 } @@ -91,11 +96,14 @@ export class ScheduleContainer { } export class ScheduleTriggerEvent { - scheduled_time: DateString | string - triggered_time?: DateString | string + scheduled_time: DateString + triggered_time?: DateString } -export class TimeOfDay { +/** @codegen_names text, hour_minute */ +export type TimeOfDay = string | HourAndMinute + +export class HourAndMinute { hour: integer[] minute: integer[] } diff --git a/specification/xpack/usage/types.ts b/specification/xpack/usage/types.ts index c60f0d9322..69064c1909 100644 --- a/specification/xpack/usage/types.ts +++ b/specification/xpack/usage/types.ts @@ -23,6 +23,7 @@ import { Dictionary, SingleKeyDictionary } from '@spec_utils/Dictionary' import { ByteSize, EmptyObject, Field, Name } from '@_types/common' import { Job, JobStatistics } from '@ml/_types/Job' import { integer, long, uint, ulong } from '@_types/Numeric' +import { AdditionalProperties } from '@spec_utils/behaviors' export class Base { available: boolean @@ -38,17 +39,6 @@ export class FeatureToggle { enabled: boolean } -export class BaseUrlConfig { - url_name: string - url_value: string -} - -export class KibanaUrlConfig extends BaseUrlConfig { - time_range?: string -} - -export type UrlConfig = BaseUrlConfig | KibanaUrlConfig - export class AlertingExecution { actions: Dictionary } @@ -331,16 +321,19 @@ export class AllJobs { forecasts: Dictionary } +// The 'jobs' entry in MachineLearning can either contain a dictionary of +// individual jobs or a single summary entry under the key '_all'. +// The layout of the summary varies from that of the individual job, +// and is specified in the 'AllJobs' class (defined above). +export class Jobs implements AdditionalProperties { + _all?: AllJobs +} + export class MachineLearning extends Base { datafeeds: Dictionary // TODO: xPack marks the entire Job definition as optional // while the MlJob has many required properties. - - // Assumption: the 'jobs' entry can either contain a dictionary of - // individual jobs or a single summary entry under the key '_all'. - // The layout of the summary varies from that of the individual job, - // and is specified in the 'AllJobs' class (defined above). - jobs: Dictionary | SingleKeyDictionary + jobs: Jobs node_count: integer data_frame_analytics_jobs: MlDataFrameAnalyticsJobs inference: MlInference diff --git a/typescript-generator/index.ts b/typescript-generator/index.ts index cefc9bc254..72c78bd8b9 100644 --- a/typescript-generator/index.ts +++ b/typescript-generator/index.ts @@ -418,7 +418,10 @@ function buildEnum (type: M.Enum): string { } }, new Array()) - return `export type ${createName(type.name)} = ${names.map(m => `'${m}'`).join(' | ')}\n` + // Also allow plain boolean values if the enum contains 'true' and 'false' + const boolean = (names.includes('true') && names.includes('false')) ? 'boolean | ' : '' + + return `export type ${createName(type.name)} = ${boolean}${names.map(m => `'${m}'`).join(' | ')}\n` } function buildTypeAlias (type: M.TypeAlias): string {