diff --git a/compiler-rs/clients_schema/src/lib.rs b/compiler-rs/clients_schema/src/lib.rs index 4ec7dd66d9..caba0d491f 100644 --- a/compiler-rs/clients_schema/src/lib.rs +++ b/compiler-rs/clients_schema/src/lib.rs @@ -380,6 +380,7 @@ pub enum ServerDefault { pub enum Variants { ExternalTag(ExternalTag), InternalTag(InternalTag), + Untagged(Untagged), Container(Container), } @@ -404,6 +405,13 @@ pub struct InternalTag { pub default_tag: Option, } +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Untagged { + #[serde(default)] + pub non_exhaustive: bool, +} + #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Container { @@ -799,6 +807,7 @@ impl TypeAlias { pub enum TypeAliasVariants { ExternalTag(ExternalTag), InternalTag(InternalTag), + Untagged(Untagged), } //------------------------------------------------------------------------------------------------------------ diff --git a/compiler-rs/clients_schema_to_openapi/src/main.rs b/compiler-rs/clients_schema_to_openapi/src/main.rs index 8601c79e75..4fe74a7589 100644 --- a/compiler-rs/clients_schema_to_openapi/src/main.rs +++ b/compiler-rs/clients_schema_to_openapi/src/main.rs @@ -16,6 +16,7 @@ // under the License. use std::path::{Path, PathBuf}; +use anyhow::bail; use clap::{Parser, ValueEnum}; use clients_schema::{Availabilities, Visibility}; @@ -71,7 +72,10 @@ impl Cli { std::fs::read_to_string(self.schema)? }; - let mut model: clients_schema::IndexedModel = serde_json::from_str(&json)?; + let mut model: clients_schema::IndexedModel = match serde_json::from_str(&json) { + Ok(indexed_model) => indexed_model, + Err(e) => bail!("cannot parse schema json: {}", e) + }; if let Some(flavor) = self.flavor { if flavor != SchemaFlavor::All { diff --git a/compiler-rs/clients_schema_to_openapi/src/schemas.rs b/compiler-rs/clients_schema_to_openapi/src/schemas.rs index 52176f6b2d..7c5a9d09a9 100644 --- a/compiler-rs/clients_schema_to_openapi/src/schemas.rs +++ b/compiler-rs/clients_schema_to_openapi/src/schemas.rs @@ -395,6 +395,8 @@ impl<'a> TypesAndComponents<'a> { extensions: Default::default(), }); } + Some(TypeAliasVariants::Untagged(_tag)) => { + } }; Ok(schema) diff --git a/compiler-rs/compiler-wasm-lib/pkg/compiler_wasm_lib_bg.wasm b/compiler-rs/compiler-wasm-lib/pkg/compiler_wasm_lib_bg.wasm index 46850b9063..a10562ae74 100644 Binary files a/compiler-rs/compiler-wasm-lib/pkg/compiler_wasm_lib_bg.wasm and b/compiler-rs/compiler-wasm-lib/pkg/compiler_wasm_lib_bg.wasm differ diff --git a/compiler-rs/openapi_to_clients_schema/src/types.rs b/compiler-rs/openapi_to_clients_schema/src/types.rs index 89b5ea7615..47425510de 100644 --- a/compiler-rs/openapi_to_clients_schema/src/types.rs +++ b/compiler-rs/openapi_to_clients_schema/src/types.rs @@ -323,7 +323,7 @@ fn generate_schema_kind_one_of( let mut variants: Option = None; // TODO: do we want to allow untagged unions (those that are disambiguated by inspecting property names)? - + if let Some(discriminator) = discriminator { variants = Some(TypeAliasVariants::InternalTag(InternalTag { default_tag: None, diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 2d0dc2c7b5..5a08264e42 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -35108,14 +35108,14 @@ "_types.query_dsl:DateDecayFunction": { "allOf": [ { - "$ref": "#/components/schemas/_types.query_dsl:DecayFunctionBase" + "$ref": "#/components/schemas/_types.query_dsl:DecayFunctionBaseDateMathDuration" }, { "type": "object" } ] }, - "_types.query_dsl:DecayFunctionBase": { + "_types.query_dsl:DecayFunctionBaseDateMathDuration": { "type": "object", "properties": { "multi_value_mode": { @@ -35135,23 +35135,39 @@ "_types.query_dsl:NumericDecayFunction": { "allOf": [ { - "$ref": "#/components/schemas/_types.query_dsl:DecayFunctionBase" + "$ref": "#/components/schemas/_types.query_dsl:DecayFunctionBasedoubledouble" }, { "type": "object" } ] }, + "_types.query_dsl:DecayFunctionBasedoubledouble": { + "type": "object", + "properties": { + "multi_value_mode": { + "$ref": "#/components/schemas/_types.query_dsl:MultiValueMode" + } + } + }, "_types.query_dsl:GeoDecayFunction": { "allOf": [ { - "$ref": "#/components/schemas/_types.query_dsl:DecayFunctionBase" + "$ref": "#/components/schemas/_types.query_dsl:DecayFunctionBaseGeoLocationDistance" }, { "type": "object" } ] }, + "_types.query_dsl:DecayFunctionBaseGeoLocationDistance": { + "type": "object", + "properties": { + "multi_value_mode": { + "$ref": "#/components/schemas/_types.query_dsl:MultiValueMode" + } + } + }, "_types.query_dsl:FieldValueFactorScoreFunction": { "type": "object", "properties": { @@ -37699,18 +37715,31 @@ "$ref": "#/components/schemas/_types.query_dsl:NumberRangeQuery" }, { - "$ref": "#/components/schemas/_types.query_dsl:TermsRangeQuery" + "$ref": "#/components/schemas/_types.query_dsl:TermRangeQuery" } ] }, "_types.query_dsl:DateRangeQuery": { "allOf": [ { - "$ref": "#/components/schemas/_types.query_dsl:RangeQueryBase" + "$ref": "#/components/schemas/_types.query_dsl:RangeQueryBaseDateMath" + }, + { + "type": "object" + } + ] + }, + "_types.query_dsl:RangeQueryBaseDateMath": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.query_dsl:QueryBase" }, { "type": "object", "properties": { + "relation": { + "$ref": "#/components/schemas/_types.query_dsl:RangeRelation" + }, "gt": { "$ref": "#/components/schemas/_types:DateMath" }, @@ -37755,43 +37784,41 @@ } ] }, + "_types.query_dsl:RangeRelation": { + "type": "string", + "enum": [ + "within", + "contains", + "intersects" + ] + }, "_types:DateFormat": { "externalDocs": { "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html" }, "type": "string" }, - "_types.query_dsl:RangeQueryBase": { + "_types.query_dsl:NumberRangeQuery": { "allOf": [ { - "$ref": "#/components/schemas/_types.query_dsl:QueryBase" + "$ref": "#/components/schemas/_types.query_dsl:RangeQueryBasedouble" }, { - "type": "object", - "properties": { - "relation": { - "$ref": "#/components/schemas/_types.query_dsl:RangeRelation" - } - } + "type": "object" } ] }, - "_types.query_dsl:RangeRelation": { - "type": "string", - "enum": [ - "within", - "contains", - "intersects" - ] - }, - "_types.query_dsl:NumberRangeQuery": { + "_types.query_dsl:RangeQueryBasedouble": { "allOf": [ { - "$ref": "#/components/schemas/_types.query_dsl:RangeQueryBase" + "$ref": "#/components/schemas/_types.query_dsl:QueryBase" }, { "type": "object", "properties": { + "relation": { + "$ref": "#/components/schemas/_types.query_dsl:RangeRelation" + }, "gt": { "description": "Greater than.", "type": "number" @@ -37829,19 +37856,38 @@ "type": "string" } ] + }, + "format": { + "$ref": "#/components/schemas/_types:DateFormat" + }, + "time_zone": { + "$ref": "#/components/schemas/_types:TimeZone" } } } ] }, - "_types.query_dsl:TermsRangeQuery": { + "_types.query_dsl:TermRangeQuery": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.query_dsl:RangeQueryBasestring" + }, + { + "type": "object" + } + ] + }, + "_types.query_dsl:RangeQueryBasestring": { "allOf": [ { - "$ref": "#/components/schemas/_types.query_dsl:RangeQueryBase" + "$ref": "#/components/schemas/_types.query_dsl:QueryBase" }, { "type": "object", "properties": { + "relation": { + "$ref": "#/components/schemas/_types.query_dsl:RangeRelation" + }, "gt": { "description": "Greater than.", "type": "string" @@ -37879,6 +37925,12 @@ "type": "string" } ] + }, + "format": { + "$ref": "#/components/schemas/_types:DateFormat" + }, + "time_zone": { + "$ref": "#/components/schemas/_types:TimeZone" } } } diff --git a/output/schema/schema.json b/output/schema/schema.json index ea00453bb3..a41371c67a 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -74591,47 +74591,23 @@ "attachedBehaviors": [ "AdditionalProperty" ], - "behaviors": [ - { - "generics": [ - { - "kind": "instance_of", - "type": { - "name": "Field", - "namespace": "_types" - } - }, - { - "generics": [ - { - "kind": "instance_of", - "type": { - "name": "DateMath", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Duration", - "namespace": "_types" - } - } - ], - "kind": "instance_of", - "type": { - "name": "DecayPlacement", - "namespace": "_types.query_dsl" - } + "inherits": { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "DateMath", + "namespace": "_types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" } - ], - "type": { - "name": "AdditionalProperty", - "namespace": "_spec_utils" } - } - ], - "inherits": { + ], "type": { "name": "DecayFunctionBase", "namespace": "_types.query_dsl" @@ -74643,7 +74619,7 @@ "namespace": "_types.query_dsl" }, "properties": [], - "specLocation": "_types/query_dsl/compound.ts#L186-L188" + "specLocation": "_types/query_dsl/compound.ts#L186-L186" }, { "inherits": { @@ -74678,6 +74654,15 @@ }, { "inherits": { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "DateMath", + "namespace": "_types" + } + } + ], "type": { "name": "RangeQueryBase", "namespace": "_types.query_dsl" @@ -74688,127 +74673,8 @@ "name": "DateRangeQuery", "namespace": "_types.query_dsl" }, - "properties": [ - { - "description": "Greater than.", - "name": "gt", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "DateMath", - "namespace": "_types" - } - } - }, - { - "description": "Greater than or equal to.", - "name": "gte", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "DateMath", - "namespace": "_types" - } - } - }, - { - "description": "Less than.", - "name": "lt", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "DateMath", - "namespace": "_types" - } - } - }, - { - "description": "Less than or equal to.", - "name": "lte", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "DateMath", - "namespace": "_types" - } - } - }, - { - "name": "from", - "required": false, - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "DateMath", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "null", - "namespace": "_builtins" - } - } - ], - "kind": "union_of" - } - }, - { - "name": "to", - "required": false, - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "DateMath", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "null", - "namespace": "_builtins" - } - } - ], - "kind": "union_of" - } - }, - { - "description": "Date format used to convert `date` values in the query.", - "name": "format", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "DateFormat", - "namespace": "_types" - } - } - }, - { - "description": "Coordinated Universal Time (UTC) offset or IANA time zone used to convert `date` values in the query to UTC.", - "name": "time_zone", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TimeZone", - "namespace": "_types" - } - } - } - ], - "specLocation": "_types/query_dsl/term.ts#L116-L143" + "properties": [], + "specLocation": "_types/query_dsl/term.ts#L142-L142" }, { "codegenNames": [ @@ -74821,7 +74687,7 @@ "name": "DecayFunction", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/compound.ts#L194-L199", + "specLocation": "_types/query_dsl/compound.ts#L193-L201", "type": { "items": [ { @@ -74847,9 +74713,65 @@ } ], "kind": "union_of" + }, + "variants": { + "kind": "untagged" } }, { + "attachedBehaviors": [ + "AdditionalProperty" + ], + "behaviors": [ + { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "Field", + "namespace": "_types" + } + }, + { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "TOrigin", + "namespace": "_types.query_dsl" + } + }, + { + "kind": "instance_of", + "type": { + "name": "TScale", + "namespace": "_types.query_dsl" + } + } + ], + "kind": "instance_of", + "type": { + "name": "DecayPlacement", + "namespace": "_types.query_dsl" + } + } + ], + "type": { + "name": "AdditionalProperty", + "namespace": "_spec_utils" + } + } + ], + "generics": [ + { + "name": "TOrigin", + "namespace": "_types.query_dsl" + }, + { + "name": "TScale", + "namespace": "_types.query_dsl" + } + ], "kind": "interface", "name": { "name": "DecayFunctionBase", @@ -74870,7 +74792,7 @@ } } ], - "specLocation": "_types/query_dsl/compound.ts#L174-L180" + "specLocation": "_types/query_dsl/compound.ts#L174-L182" }, { "generics": [ @@ -74996,7 +74918,7 @@ "name": "DistanceFeatureQuery", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/specialized.ts#L72-L76", + "specLocation": "_types/query_dsl/specialized.ts#L72-L79", "type": { "items": [ { @@ -75015,6 +74937,9 @@ } ], "kind": "union_of" + }, + "variants": { + "kind": "untagged" } }, { @@ -75260,7 +75185,7 @@ "name": "FieldValueFactorModifier", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/compound.ts#L298-L341" + "specLocation": "_types/query_dsl/compound.ts#L300-L343" }, { "kind": "interface", @@ -75353,7 +75278,7 @@ "name": "FunctionBoostMode", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/compound.ts#L270-L296" + "specLocation": "_types/query_dsl/compound.ts#L272-L298" }, { "esQuirk": "this container is valid without a variant. Despite being documented as a function, 'weight'\nis actually a container property that can be combined with a function. Comment in the ES code\n(SearchModule#registerScoreFunctions) says: Weight doesn't have its own parser, so every function\nsupports it out of the box. Can be a single function too when not associated to any other function,\nwhich is why it needs to be registered manually here.", @@ -75460,7 +75385,7 @@ } } ], - "specLocation": "_types/query_dsl/compound.ts#L201-L241", + "specLocation": "_types/query_dsl/compound.ts#L203-L243", "variants": { "kind": "container" } @@ -75497,7 +75422,7 @@ "name": "FunctionScoreMode", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/compound.ts#L243-L268" + "specLocation": "_types/query_dsl/compound.ts#L245-L270" }, { "inherits": { @@ -75796,47 +75721,23 @@ "attachedBehaviors": [ "AdditionalProperty" ], - "behaviors": [ - { - "generics": [ - { - "kind": "instance_of", - "type": { - "name": "Field", - "namespace": "_types" - } - }, - { - "generics": [ - { - "kind": "instance_of", - "type": { - "name": "GeoLocation", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "Distance", - "namespace": "_types" - } - } - ], - "kind": "instance_of", - "type": { - "name": "DecayPlacement", - "namespace": "_types.query_dsl" - } + "inherits": { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "GeoLocation", + "namespace": "_types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "Distance", + "namespace": "_types" } - ], - "type": { - "name": "AdditionalProperty", - "namespace": "_spec_utils" } - } - ], - "inherits": { + ], "type": { "name": "DecayFunctionBase", "namespace": "_types.query_dsl" @@ -75848,7 +75749,7 @@ "namespace": "_types.query_dsl" }, "properties": [], - "specLocation": "_types/query_dsl/compound.ts#L190-L192" + "specLocation": "_types/query_dsl/compound.ts#L188-L191" }, { "inherits": { @@ -77101,7 +77002,7 @@ "name": "Like", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/specialized.ts#L186-L191", + "specLocation": "_types/query_dsl/specialized.ts#L189-L194", "type": { "items": [ { @@ -77233,7 +77134,7 @@ } } ], - "specLocation": "_types/query_dsl/specialized.ts#L162-L184" + "specLocation": "_types/query_dsl/specialized.ts#L165-L187" }, { "inherits": { @@ -78036,7 +77937,7 @@ } } ], - "specLocation": "_types/query_dsl/specialized.ts#L78-L160" + "specLocation": "_types/query_dsl/specialized.ts#L81-L163" }, { "inherits": { @@ -78303,7 +78204,7 @@ "name": "MultiValueMode", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/compound.ts#L343-L360" + "specLocation": "_types/query_dsl/compound.ts#L345-L362" }, { "inherits": { @@ -78387,6 +78288,15 @@ }, { "inherits": { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + } + ], "type": { "name": "RangeQueryBase", "namespace": "_types.query_dsl" @@ -78397,149 +78307,30 @@ "name": "NumberRangeQuery", "namespace": "_types.query_dsl" }, - "properties": [ - { - "description": "Greater than.", - "name": "gt", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - }, - { - "description": "Greater than or equal to.", - "name": "gte", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - }, - { - "description": "Less than.", - "name": "lt", - "required": false, - "type": { + "properties": [], + "specLocation": "_types/query_dsl/term.ts#L144-L144" + }, + { + "attachedBehaviors": [ + "AdditionalProperty" + ], + "inherits": { + "generics": [ + { "kind": "instance_of", "type": { "name": "double", "namespace": "_types" } - } - }, - { - "description": "Less than or equal to.", - "name": "lte", - "required": false, - "type": { + }, + { "kind": "instance_of", "type": { "name": "double", "namespace": "_types" } } - }, - { - "name": "from", - "required": false, - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "null", - "namespace": "_builtins" - } - } - ], - "kind": "union_of" - } - }, - { - "name": "to", - "required": false, - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "null", - "namespace": "_builtins" - } - } - ], - "kind": "union_of" - } - } - ], - "specLocation": "_types/query_dsl/term.ts#L145-L164" - }, - { - "attachedBehaviors": [ - "AdditionalProperty" - ], - "behaviors": [ - { - "generics": [ - { - "kind": "instance_of", - "type": { - "name": "Field", - "namespace": "_types" - } - }, - { - "generics": [ - { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - }, - { - "kind": "instance_of", - "type": { - "name": "double", - "namespace": "_types" - } - } - ], - "kind": "instance_of", - "type": { - "name": "DecayPlacement", - "namespace": "_types.query_dsl" - } - } - ], - "type": { - "name": "AdditionalProperty", - "namespace": "_spec_utils" - } - } - ], - "inherits": { + ], "type": { "name": "DecayFunctionBase", "namespace": "_types.query_dsl" @@ -78551,7 +78342,7 @@ "namespace": "_types.query_dsl" }, "properties": [], - "specLocation": "_types/query_dsl/compound.ts#L182-L184" + "specLocation": "_types/query_dsl/compound.ts#L184-L184" }, { "kind": "enum", @@ -78745,7 +78536,7 @@ } } ], - "specLocation": "_types/query_dsl/specialized.ts#L193-L230" + "specLocation": "_types/query_dsl/specialized.ts#L196-L233" }, { "kind": "interface", @@ -78779,7 +78570,7 @@ } } ], - "specLocation": "_types/query_dsl/specialized.ts#L253-L262" + "specLocation": "_types/query_dsl/specialized.ts#L256-L265" }, { "inherits": { @@ -78838,7 +78629,7 @@ } } ], - "specLocation": "_types/query_dsl/specialized.ts#L232-L251", + "specLocation": "_types/query_dsl/specialized.ts#L235-L254", "variants": { "kind": "container" } @@ -80350,14 +80141,14 @@ "codegenNames": [ "date", "number", - "terms" + "term" ], "kind": "type_alias", "name": { "name": "RangeQuery", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/term.ts#L187-L189", + "specLocation": "_types/query_dsl/term.ts#L148-L153", "type": { "items": [ { @@ -80377,15 +80168,24 @@ { "kind": "instance_of", "type": { - "name": "TermsRangeQuery", + "name": "TermRangeQuery", "namespace": "_types.query_dsl" } } ], "kind": "union_of" + }, + "variants": { + "kind": "untagged" } }, { + "generics": [ + { + "name": "T", + "namespace": "_types.query_dsl" + } + ], "inherits": { "type": { "name": "QueryBase", @@ -80410,9 +80210,127 @@ "namespace": "_types.query_dsl" } } + }, + { + "description": "Greater than.", + "name": "gt", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "T", + "namespace": "_types.query_dsl" + } + } + }, + { + "description": "Greater than or equal to.", + "name": "gte", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "T", + "namespace": "_types.query_dsl" + } + } + }, + { + "description": "Less than.", + "name": "lt", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "T", + "namespace": "_types.query_dsl" + } + } + }, + { + "description": "Less than or equal to.", + "name": "lte", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "T", + "namespace": "_types.query_dsl" + } + } + }, + { + "name": "from", + "required": false, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "T", + "namespace": "_types.query_dsl" + } + }, + { + "kind": "instance_of", + "type": { + "name": "null", + "namespace": "_builtins" + } + } + ], + "kind": "union_of" + } + }, + { + "name": "to", + "required": false, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "T", + "namespace": "_types.query_dsl" + } + }, + { + "kind": "instance_of", + "type": { + "name": "null", + "namespace": "_builtins" + } + } + ], + "kind": "union_of" + } + }, + { + "description": "Date format used to convert `date` values in the query.", + "name": "format", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "DateFormat", + "namespace": "_types" + } + } + }, + { + "description": "Coordinated Universal Time (UTC) offset or IANA time zone used to convert `date` values in the query to UTC.", + "name": "time_zone", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "TimeZone", + "namespace": "_types" + } + } } ], - "specLocation": "_types/query_dsl/term.ts#L108-L114" + "specLocation": "_types/query_dsl/term.ts#L108-L140" }, { "kind": "enum", @@ -80434,7 +80352,7 @@ "name": "RangeRelation", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/term.ts#L191-L204" + "specLocation": "_types/query_dsl/term.ts#L155-L168" }, { "kind": "interface", @@ -80443,7 +80361,7 @@ "namespace": "_types.query_dsl" }, "properties": [], - "specLocation": "_types/query_dsl/specialized.ts#L264-L264" + "specLocation": "_types/query_dsl/specialized.ts#L267-L267" }, { "inherits": { @@ -80458,7 +80376,7 @@ "namespace": "_types.query_dsl" }, "properties": [], - "specLocation": "_types/query_dsl/specialized.ts#L266-L266" + "specLocation": "_types/query_dsl/specialized.ts#L269-L269" }, { "inherits": { @@ -80486,7 +80404,7 @@ } } ], - "specLocation": "_types/query_dsl/specialized.ts#L268-L273" + "specLocation": "_types/query_dsl/specialized.ts#L271-L276" }, { "inherits": { @@ -80514,7 +80432,7 @@ } } ], - "specLocation": "_types/query_dsl/specialized.ts#L275-L280" + "specLocation": "_types/query_dsl/specialized.ts#L278-L283" }, { "inherits": { @@ -80554,7 +80472,7 @@ } } ], - "specLocation": "_types/query_dsl/specialized.ts#L282-L291" + "specLocation": "_types/query_dsl/specialized.ts#L285-L294" }, { "inherits": { @@ -80630,7 +80548,7 @@ } } ], - "specLocation": "_types/query_dsl/specialized.ts#L293-L316" + "specLocation": "_types/query_dsl/specialized.ts#L296-L319" }, { "inherits": { @@ -80722,7 +80640,7 @@ } ], "shortcutProperty": "value", - "specLocation": "_types/query_dsl/term.ts#L206-L236" + "specLocation": "_types/query_dsl/term.ts#L170-L200" }, { "inherits": { @@ -80767,7 +80685,7 @@ } } ], - "specLocation": "_types/query_dsl/specialized.ts#L369-L373" + "specLocation": "_types/query_dsl/specialized.ts#L372-L376" }, { "inherits": { @@ -80795,7 +80713,7 @@ } } ], - "specLocation": "_types/query_dsl/specialized.ts#L318-L324" + "specLocation": "_types/query_dsl/specialized.ts#L321-L327" }, { "kind": "interface", @@ -80869,7 +80787,7 @@ } } ], - "specLocation": "_types/query_dsl/specialized.ts#L326-L340" + "specLocation": "_types/query_dsl/specialized.ts#L329-L343" }, { "kind": "interface", @@ -80915,7 +80833,7 @@ } } ], - "specLocation": "_types/query_dsl/specialized.ts#L354-L367" + "specLocation": "_types/query_dsl/specialized.ts#L357-L370" }, { "attachedBehaviors": [ @@ -80970,7 +80888,7 @@ } } ], - "specLocation": "_types/query_dsl/specialized.ts#L344-L352" + "specLocation": "_types/query_dsl/specialized.ts#L347-L355" }, { "kind": "enum", @@ -81843,7 +81761,31 @@ } ], "shortcutProperty": "value", - "specLocation": "_types/query_dsl/term.ts#L238-L252" + "specLocation": "_types/query_dsl/term.ts#L202-L216" + }, + { + "inherits": { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + ], + "type": { + "name": "RangeQueryBase", + "namespace": "_types.query_dsl" + } + }, + "kind": "interface", + "name": { + "name": "TermRangeQuery", + "namespace": "_types.query_dsl" + }, + "properties": [], + "specLocation": "_types/query_dsl/term.ts#L146-L146" }, { "kind": "interface", @@ -81897,7 +81839,7 @@ } } ], - "specLocation": "_types/query_dsl/term.ts#L263-L268" + "specLocation": "_types/query_dsl/term.ts#L227-L232" }, { "attachedBehaviors": [ @@ -81939,7 +81881,7 @@ "namespace": "_types.query_dsl" }, "properties": [], - "specLocation": "_types/query_dsl/term.ts#L254-L256" + "specLocation": "_types/query_dsl/term.ts#L218-L220" }, { "codegenNames": [ @@ -81951,7 +81893,7 @@ "name": "TermsQueryField", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/term.ts#L258-L261", + "specLocation": "_types/query_dsl/term.ts#L222-L225", "type": { "items": [ { @@ -81975,116 +81917,6 @@ "kind": "union_of" } }, - { - "inherits": { - "type": { - "name": "RangeQueryBase", - "namespace": "_types.query_dsl" - } - }, - "kind": "interface", - "name": { - "name": "TermsRangeQuery", - "namespace": "_types.query_dsl" - }, - "properties": [ - { - "description": "Greater than.", - "name": "gt", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "description": "Greater than or equal to.", - "name": "gte", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "description": "Less than.", - "name": "lt", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "description": "Less than or equal to.", - "name": "lte", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "name": "from", - "required": false, - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - }, - { - "kind": "instance_of", - "type": { - "name": "null", - "namespace": "_builtins" - } - } - ], - "kind": "union_of" - } - }, - { - "name": "to", - "required": false, - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - }, - { - "kind": "instance_of", - "type": { - "name": "null", - "namespace": "_builtins" - } - } - ], - "kind": "union_of" - } - } - ], - "specLocation": "_types/query_dsl/term.ts#L166-L185" - }, { "inherits": { "type": { @@ -82138,7 +81970,7 @@ } } ], - "specLocation": "_types/query_dsl/term.ts#L270-L283" + "specLocation": "_types/query_dsl/term.ts#L234-L247" }, { "inherits": { @@ -82311,7 +82143,7 @@ } } ], - "specLocation": "_types/query_dsl/term.ts#L285-L287" + "specLocation": "_types/query_dsl/term.ts#L249-L251" }, { "inherits": { @@ -82436,7 +82268,7 @@ } ], "shortcutProperty": "value", - "specLocation": "_types/query_dsl/term.ts#L289-L306" + "specLocation": "_types/query_dsl/term.ts#L253-L270" }, { "inherits": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 6f8ab6dd05..7afbfb827f 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -5485,28 +5485,20 @@ export interface QueryDslConstantScoreQuery extends QueryDslQueryBase { filter: QueryDslQueryContainer } -export interface QueryDslDateDecayFunctionKeys extends QueryDslDecayFunctionBase { +export interface QueryDslDateDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslDateDecayFunction = QueryDslDateDecayFunctionKeys - & { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } + & { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export interface QueryDslDateDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } -export interface QueryDslDateRangeQuery extends QueryDslRangeQueryBase { - gt?: DateMath - gte?: DateMath - lt?: DateMath - lte?: DateMath - from?: DateMath | null - to?: DateMath | null - format?: DateFormat - time_zone?: TimeZone +export interface QueryDslDateRangeQuery extends QueryDslRangeQueryBase { } export type QueryDslDecayFunction = QueryDslDateDecayFunction | QueryDslNumericDecayFunction | QueryDslGeoDecayFunction -export interface QueryDslDecayFunctionBase { +export interface QueryDslDecayFunctionBase { multi_value_mode?: QueryDslMultiValueMode } @@ -5597,10 +5589,10 @@ export interface QueryDslGeoBoundingBoxQueryKeys extends QueryDslQueryBase { export type QueryDslGeoBoundingBoxQuery = QueryDslGeoBoundingBoxQueryKeys & { [property: string]: GeoBounds | QueryDslGeoExecution | QueryDslGeoValidationMethod | boolean | float | string } -export interface QueryDslGeoDecayFunctionKeys extends QueryDslDecayFunctionBase { +export interface QueryDslGeoDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslGeoDecayFunction = QueryDslGeoDecayFunctionKeys - & { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } + & { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export interface QueryDslGeoDistanceFeatureQuery extends QueryDslDistanceFeatureQueryBase { } @@ -5848,19 +5840,13 @@ export interface QueryDslNestedQuery extends QueryDslQueryBase { score_mode?: QueryDslChildScoreMode } -export interface QueryDslNumberRangeQuery extends QueryDslRangeQueryBase { - gt?: double - gte?: double - lt?: double - lte?: double - from?: double | null - to?: double | null +export interface QueryDslNumberRangeQuery extends QueryDslRangeQueryBase { } -export interface QueryDslNumericDecayFunctionKeys extends QueryDslDecayFunctionBase { +export interface QueryDslNumericDecayFunctionKeys extends QueryDslDecayFunctionBase { } export type QueryDslNumericDecayFunction = QueryDslNumericDecayFunctionKeys - & { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } + & { [property: string]: QueryDslDecayPlacement | QueryDslMultiValueMode } export type QueryDslOperator = 'and' | 'AND' | 'or' | 'OR' @@ -5998,10 +5984,18 @@ export interface QueryDslRandomScoreFunction { seed?: long | string } -export type QueryDslRangeQuery = QueryDslDateRangeQuery | QueryDslNumberRangeQuery | QueryDslTermsRangeQuery +export type QueryDslRangeQuery = QueryDslDateRangeQuery | QueryDslNumberRangeQuery | QueryDslTermRangeQuery -export interface QueryDslRangeQueryBase extends QueryDslQueryBase { +export interface QueryDslRangeQueryBase extends QueryDslQueryBase { relation?: QueryDslRangeRelation + gt?: T + gte?: T + lt?: T + lte?: T + from?: T | null + to?: T | null + format?: DateFormat + time_zone?: TimeZone } export type QueryDslRangeRelation = 'within' | 'contains' | 'intersects' @@ -6161,6 +6155,9 @@ export interface QueryDslTermQuery extends QueryDslQueryBase { case_insensitive?: boolean } +export interface QueryDslTermRangeQuery extends QueryDslRangeQueryBase { +} + export interface QueryDslTermsLookup { index: IndexName id: Id @@ -6175,15 +6172,6 @@ export type QueryDslTermsQuery = QueryDslTermsQueryKeys export type QueryDslTermsQueryField = FieldValue[] | QueryDslTermsLookup -export interface QueryDslTermsRangeQuery extends QueryDslRangeQueryBase { - gt?: string - gte?: string - lt?: string - lte?: string - from?: string | null - to?: string | null -} - export interface QueryDslTermsSetQuery extends QueryDslQueryBase { minimum_should_match_field?: Field minimum_should_match_script?: Script