From 63aac196bd6445b30a0a62336cbf0b27891a9500 Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Mon, 3 Feb 2025 12:28:55 +0100 Subject: [PATCH 1/4] Remove `UserDefinedValue` from `FieldValue` --- output/schema/schema.json | 156 ++++++++---------- output/typescript/types.ts | 6 +- specification/_types/common.ts | 3 +- .../esql/async_query/AsyncQueryRequest.ts | 3 +- specification/esql/query/QueryRequest.ts | 3 +- 5 files changed, 80 insertions(+), 91 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 1a0df1b9c3..b6c6b9f8cb 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -44998,7 +44998,7 @@ "name": "AggregateName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L148-L152", + "specLocation": "_types/common.ts#L147-L151", "type": { "kind": "instance_of", "type": { @@ -45207,7 +45207,7 @@ "name": "ByteSize", "namespace": "_types" }, - "specLocation": "_types/common.ts#L96-L97", + "specLocation": "_types/common.ts#L95-L96", "type": { "kind": "union_of", "items": [ @@ -45260,7 +45260,7 @@ "name": "Bytes", "namespace": "_types" }, - "specLocation": "_types/common.ts#L172-L184" + "specLocation": "_types/common.ts#L171-L183" }, { "kind": "type_alias", @@ -45268,7 +45268,7 @@ "name": "CategoryId", "namespace": "_types" }, - "specLocation": "_types/common.ts#L58-L58", + "specLocation": "_types/common.ts#L57-L57", "type": { "kind": "instance_of", "type": { @@ -45283,7 +45283,7 @@ "name": "ClusterAlias", "namespace": "_types" }, - "specLocation": "_types/common.ts#L78-L78", + "specLocation": "_types/common.ts#L77-L77", "type": { "kind": "instance_of", "type": { @@ -45403,7 +45403,7 @@ "name": "ClusterInfoTarget", "namespace": "_types" }, - "specLocation": "_types/common.ts#L384-L390" + "specLocation": "_types/common.ts#L383-L389" }, { "kind": "type_alias", @@ -45411,7 +45411,7 @@ "name": "ClusterInfoTargets", "namespace": "_types" }, - "specLocation": "_types/common.ts#L392-L392", + "specLocation": "_types/common.ts#L391-L391", "type": { "kind": "union_of", "items": [ @@ -45630,7 +45630,7 @@ "name": "Conflicts", "namespace": "_types" }, - "specLocation": "_types/common.ts#L186-L195" + "specLocation": "_types/common.ts#L185-L194" }, { "kind": "interface", @@ -45761,7 +45761,7 @@ "name": "DataStreamName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L92-L92", + "specLocation": "_types/common.ts#L91-L91", "type": { "kind": "instance_of", "type": { @@ -45776,7 +45776,7 @@ "name": "DataStreamNames", "namespace": "_types" }, - "specLocation": "_types/common.ts#L94-L94", + "specLocation": "_types/common.ts#L93-L93", "type": { "kind": "union_of", "items": [ @@ -46213,7 +46213,7 @@ "namespace": "_types" }, "properties": [], - "specLocation": "_types/common.ts#L163-L164" + "specLocation": "_types/common.ts#L162-L163" }, { "kind": "type_alias", @@ -46425,7 +46425,7 @@ "name": "ExpandWildcard", "namespace": "_types" }, - "specLocation": "_types/common.ts#L204-L218" + "specLocation": "_types/common.ts#L203-L217" }, { "kind": "type_alias", @@ -46433,7 +46433,7 @@ "name": "ExpandWildcards", "namespace": "_types" }, - "specLocation": "_types/common.ts#L220-L220", + "specLocation": "_types/common.ts#L219-L219", "type": { "kind": "union_of", "items": [ @@ -46464,7 +46464,7 @@ "name": "Field", "namespace": "_types" }, - "specLocation": "_types/common.ts#L141-L142", + "specLocation": "_types/common.ts#L140-L141", "type": { "kind": "instance_of", "type": { @@ -46654,15 +46654,14 @@ "double", "string", "boolean", - "null", - "any" + "null" ], "description": "A field value.", "name": { "name": "FieldValue", "namespace": "_types" }, - "specLocation": "_types/common.ts#L25-L37", + "specLocation": "_types/common.ts#L25-L36", "type": { "kind": "union_of", "items": [ @@ -46700,9 +46699,6 @@ "name": "null", "namespace": "_builtins" } - }, - { - "kind": "user_defined_value" } ] } @@ -46778,7 +46774,7 @@ "name": "Fields", "namespace": "_types" }, - "specLocation": "_types/common.ts#L143-L143", + "specLocation": "_types/common.ts#L142-L142", "type": { "kind": "union_of", "items": [ @@ -46873,7 +46869,7 @@ "name": "Fuzziness", "namespace": "_types" }, - "specLocation": "_types/common.ts#L136-L137", + "specLocation": "_types/common.ts#L135-L136", "type": { "kind": "union_of", "items": [ @@ -47480,7 +47476,7 @@ "name": "GrokPattern", "namespace": "_types" }, - "specLocation": "_types/common.ts#L87-L87", + "specLocation": "_types/common.ts#L86-L86", "type": { "kind": "instance_of", "type": { @@ -47518,7 +47514,7 @@ "name": "HealthStatus", "namespace": "_types" }, - "specLocation": "_types/common.ts#L222-L242" + "specLocation": "_types/common.ts#L221-L241" }, { "kind": "type_alias", @@ -47541,7 +47537,7 @@ "name": "HttpHeaders", "namespace": "_types" }, - "specLocation": "_types/common.ts#L161-L161", + "specLocation": "_types/common.ts#L160-L160", "type": { "kind": "dictionary_of", "key": { @@ -47614,7 +47610,7 @@ "name": "Id", "namespace": "_types" }, - "specLocation": "_types/common.ts#L61-L61", + "specLocation": "_types/common.ts#L60-L60", "type": { "kind": "instance_of", "type": { @@ -47629,7 +47625,7 @@ "name": "Ids", "namespace": "_types" }, - "specLocation": "_types/common.ts#L62-L62", + "specLocation": "_types/common.ts#L61-L61", "type": { "kind": "union_of", "items": [ @@ -47659,7 +47655,7 @@ "name": "IndexAlias", "namespace": "_types" }, - "specLocation": "_types/common.ts#L68-L68", + "specLocation": "_types/common.ts#L67-L67", "type": { "kind": "instance_of", "type": { @@ -47674,7 +47670,7 @@ "name": "IndexName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L66-L66", + "specLocation": "_types/common.ts#L65-L65", "type": { "kind": "instance_of", "type": { @@ -47689,7 +47685,7 @@ "name": "IndexPattern", "namespace": "_types" }, - "specLocation": "_types/common.ts#L69-L69", + "specLocation": "_types/common.ts#L68-L68", "type": { "kind": "instance_of", "type": { @@ -47704,7 +47700,7 @@ "name": "IndexPatterns", "namespace": "_types" }, - "specLocation": "_types/common.ts#L70-L70", + "specLocation": "_types/common.ts#L69-L69", "type": { "kind": "array_of", "value": { @@ -47935,7 +47931,7 @@ "name": "Indices", "namespace": "_types" }, - "specLocation": "_types/common.ts#L67-L67", + "specLocation": "_types/common.ts#L66-L66", "type": { "kind": "union_of", "items": [ @@ -48018,7 +48014,7 @@ } } ], - "specLocation": "_types/common.ts#L338-L365" + "specLocation": "_types/common.ts#L337-L364" }, { "kind": "interface", @@ -48161,7 +48157,7 @@ } } ], - "specLocation": "_types/common.ts#L323-L336" + "specLocation": "_types/common.ts#L322-L335" }, { "kind": "type_alias", @@ -48632,7 +48628,7 @@ "name": "Level", "namespace": "_types" }, - "specLocation": "_types/common.ts#L252-L256" + "specLocation": "_types/common.ts#L251-L255" }, { "kind": "enum", @@ -48887,7 +48883,7 @@ "name": "Metadata", "namespace": "_types" }, - "specLocation": "_types/common.ts#L99-L99", + "specLocation": "_types/common.ts#L98-L98", "type": { "kind": "dictionary_of", "key": { @@ -48909,7 +48905,7 @@ "name": "Metrics", "namespace": "_types" }, - "specLocation": "_types/common.ts#L76-L76", + "specLocation": "_types/common.ts#L75-L75", "type": { "kind": "union_of", "items": [ @@ -48942,7 +48938,7 @@ "name": "MinimumShouldMatch", "namespace": "_types" }, - "specLocation": "_types/common.ts#L166-L170", + "specLocation": "_types/common.ts#L165-L169", "type": { "kind": "union_of", "items": [ @@ -48971,7 +48967,7 @@ "name": "MultiTermQueryRewrite", "namespace": "_types" }, - "specLocation": "_types/common.ts#L138-L139", + "specLocation": "_types/common.ts#L137-L138", "type": { "kind": "instance_of", "type": { @@ -48986,7 +48982,7 @@ "name": "Name", "namespace": "_types" }, - "specLocation": "_types/common.ts#L80-L80", + "specLocation": "_types/common.ts#L79-L79", "type": { "kind": "instance_of", "type": { @@ -49001,7 +48997,7 @@ "name": "Names", "namespace": "_types" }, - "specLocation": "_types/common.ts#L81-L81", + "specLocation": "_types/common.ts#L80-L80", "type": { "kind": "union_of", "items": [ @@ -49031,7 +49027,7 @@ "name": "Namespace", "namespace": "_types" }, - "specLocation": "_types/common.ts#L83-L83", + "specLocation": "_types/common.ts#L82-L82", "type": { "kind": "instance_of", "type": { @@ -49181,7 +49177,7 @@ "name": "NodeId", "namespace": "_types" }, - "specLocation": "_types/common.ts#L63-L63", + "specLocation": "_types/common.ts#L62-L62", "type": { "kind": "instance_of", "type": { @@ -49196,7 +49192,7 @@ "name": "NodeIds", "namespace": "_types" }, - "specLocation": "_types/common.ts#L64-L64", + "specLocation": "_types/common.ts#L63-L63", "type": { "kind": "union_of", "items": [ @@ -49228,7 +49224,7 @@ "name": "NodeName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L89-L90", + "specLocation": "_types/common.ts#L88-L89", "type": { "kind": "instance_of", "type": { @@ -49564,7 +49560,7 @@ "name": "OpType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L258-L267" + "specLocation": "_types/common.ts#L257-L266" }, { "kind": "type_alias", @@ -49572,7 +49568,7 @@ "name": "Password", "namespace": "_types" }, - "specLocation": "_types/common.ts#L198-L198", + "specLocation": "_types/common.ts#L197-L197", "type": { "kind": "instance_of", "type": { @@ -49614,7 +49610,7 @@ "name": "PipelineName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L86-L86", + "specLocation": "_types/common.ts#L85-L85", "type": { "kind": "instance_of", "type": { @@ -49741,7 +49737,7 @@ "name": "PropertyName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L133-L133", + "specLocation": "_types/common.ts#L132-L132", "type": { "kind": "instance_of", "type": { @@ -50068,7 +50064,7 @@ "name": "Refresh", "namespace": "_types" }, - "specLocation": "_types/common.ts#L269-L276" + "specLocation": "_types/common.ts#L268-L275" }, { "kind": "interface", @@ -50170,7 +50166,7 @@ "name": "RelationName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L134-L134", + "specLocation": "_types/common.ts#L133-L133", "type": { "kind": "instance_of", "type": { @@ -50495,7 +50491,7 @@ "name": "Routing", "namespace": "_types" }, - "specLocation": "_types/common.ts#L72-L72", + "specLocation": "_types/common.ts#L71-L71", "type": { "kind": "instance_of", "type": { @@ -50621,7 +50617,7 @@ "name": "ScalarValue", "namespace": "_types" }, - "specLocation": "_types/common.ts#L39-L43", + "specLocation": "_types/common.ts#L38-L42", "type": { "kind": "union_of", "items": [ @@ -50984,7 +50980,7 @@ "name": "ScrollId", "namespace": "_types" }, - "specLocation": "_types/common.ts#L55-L55", + "specLocation": "_types/common.ts#L54-L54", "type": { "kind": "instance_of", "type": { @@ -50999,7 +50995,7 @@ "name": "ScrollIds", "namespace": "_types" }, - "specLocation": "_types/common.ts#L56-L56", + "specLocation": "_types/common.ts#L55-L55", "type": { "kind": "union_of", "items": [ @@ -51326,7 +51322,7 @@ "name": "SearchType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L278-L283" + "specLocation": "_types/common.ts#L277-L282" }, { "kind": "interface", @@ -51641,7 +51637,7 @@ "name": "SequenceNumber", "namespace": "_types" }, - "specLocation": "_types/common.ts#L131-L131", + "specLocation": "_types/common.ts#L130-L130", "type": { "kind": "instance_of", "type": { @@ -51656,7 +51652,7 @@ "name": "Service", "namespace": "_types" }, - "specLocation": "_types/common.ts#L84-L84", + "specLocation": "_types/common.ts#L83-L83", "type": { "kind": "instance_of", "type": { @@ -51876,7 +51872,7 @@ "name": "Slices", "namespace": "_types" }, - "specLocation": "_types/common.ts#L367-L372", + "specLocation": "_types/common.ts#L366-L371", "type": { "kind": "union_of", "items": [ @@ -51909,7 +51905,7 @@ "name": "SlicesCalculation", "namespace": "_types" }, - "specLocation": "_types/common.ts#L374-L382" + "specLocation": "_types/common.ts#L373-L381" }, { "kind": "type_alias", @@ -52372,7 +52368,7 @@ "name": "SuggestMode", "namespace": "_types" }, - "specLocation": "_types/common.ts#L285-L298" + "specLocation": "_types/common.ts#L284-L297" }, { "kind": "type_alias", @@ -52381,7 +52377,7 @@ "name": "SuggestionName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L154-L158", + "specLocation": "_types/common.ts#L153-L157", "type": { "kind": "instance_of", "type": { @@ -52450,7 +52446,7 @@ "name": "TaskId", "namespace": "_types" }, - "specLocation": "_types/common.ts#L135-L135", + "specLocation": "_types/common.ts#L134-L134", "type": { "kind": "union_of", "items": [ @@ -52602,7 +52598,7 @@ "name": "ThreadType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L300-L306" + "specLocation": "_types/common.ts#L299-L305" }, { "kind": "type_alias", @@ -52958,7 +52954,7 @@ "name": "Username", "namespace": "_types" }, - "specLocation": "_types/common.ts#L197-L197", + "specLocation": "_types/common.ts#L196-L196", "type": { "kind": "instance_of", "type": { @@ -52973,7 +52969,7 @@ "name": "Uuid", "namespace": "_types" }, - "specLocation": "_types/common.ts#L128-L128", + "specLocation": "_types/common.ts#L127-L127", "type": { "kind": "instance_of", "type": { @@ -52988,7 +52984,7 @@ "name": "VersionNumber", "namespace": "_types" }, - "specLocation": "_types/common.ts#L102-L102", + "specLocation": "_types/common.ts#L101-L101", "type": { "kind": "instance_of", "type": { @@ -53003,7 +52999,7 @@ "name": "VersionString", "namespace": "_types" }, - "specLocation": "_types/common.ts#L104-L104", + "specLocation": "_types/common.ts#L103-L103", "type": { "kind": "instance_of", "type": { @@ -53036,7 +53032,7 @@ "name": "VersionType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L106-L125" + "specLocation": "_types/common.ts#L105-L124" }, { "kind": "enum", @@ -53052,7 +53048,7 @@ "name": "WaitForActiveShardOptions", "namespace": "_types" }, - "specLocation": "_types/common.ts#L308-L312" + "specLocation": "_types/common.ts#L307-L311" }, { "kind": "type_alias", @@ -53064,7 +53060,7 @@ "name": "WaitForActiveShards", "namespace": "_types" }, - "specLocation": "_types/common.ts#L145-L146", + "specLocation": "_types/common.ts#L144-L145", "type": { "kind": "union_of", "items": [ @@ -53111,7 +53107,7 @@ "name": "WaitForEvents", "namespace": "_types" }, - "specLocation": "_types/common.ts#L314-L321" + "specLocation": "_types/common.ts#L313-L320" }, { "kind": "interface", @@ -122142,11 +122138,7 @@ "type": { "kind": "array_of", "value": { - "kind": "instance_of", - "type": { - "name": "FieldValue", - "namespace": "_types" - } + "kind": "user_defined_value" } } }, @@ -122300,7 +122292,7 @@ } } ], - "specLocation": "esql/async_query/AsyncQueryRequest.ts#L28-L118" + "specLocation": "esql/async_query/AsyncQueryRequest.ts#L29-L119" }, { "kind": "response", @@ -122586,11 +122578,7 @@ "type": { "kind": "array_of", "value": { - "kind": "instance_of", - "type": { - "name": "FieldValue", - "namespace": "_types" - } + "kind": "user_defined_value" } } }, @@ -122705,7 +122693,7 @@ } } ], - "specLocation": "esql/query/QueryRequest.ts#L27-L98" + "specLocation": "esql/query/QueryRequest.ts#L28-L99" }, { "kind": "response", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index c9453d8e8d..04015b28f3 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2354,7 +2354,7 @@ export interface FieldSort { export type FieldSortNumericType = 'long' | 'double' | 'date' | 'date_nanos' -export type FieldValue = long | double | string | boolean | null | any +export type FieldValue = long | double | string | boolean | null export interface FielddataStats { evictions?: long @@ -10544,7 +10544,7 @@ export interface EsqlAsyncQueryRequest extends RequestBase { columnar?: boolean filter?: QueryDslQueryContainer locale?: string - params?: FieldValue[] + params?: any[] profile?: boolean query: string tables?: Record> @@ -10583,7 +10583,7 @@ export interface EsqlQueryRequest extends RequestBase { columnar?: boolean filter?: QueryDslQueryContainer locale?: string - params?: FieldValue[] + params?: any[] profile?: boolean query: string tables?: Record> diff --git a/specification/_types/common.ts b/specification/_types/common.ts index 3f81a3adc4..ea76575546 100644 --- a/specification/_types/common.ts +++ b/specification/_types/common.ts @@ -24,7 +24,7 @@ import { double, integer, long } from './Numeric' /** * A field value. - * @codegen_names long, double, string, boolean, null, any + * @codegen_names long, double, string, boolean, null */ // Note: the ending `UserDefinedValue` includes all other union members, but we keep them explicit so that // code generators can provide direct access to scalar values, which are the most common use case. @@ -34,7 +34,6 @@ export type FieldValue = | string | boolean | null - | UserDefinedValue /** * A scalar value. diff --git a/specification/esql/async_query/AsyncQueryRequest.ts b/specification/esql/async_query/AsyncQueryRequest.ts index 0f2ed505ed..18b21c52f5 100644 --- a/specification/esql/async_query/AsyncQueryRequest.ts +++ b/specification/esql/async_query/AsyncQueryRequest.ts @@ -24,6 +24,7 @@ import { RequestBase } from '@_types/Base' import { FieldValue } from '@_types/common' import { QueryContainer } from '@_types/query_dsl/abstractions' import { Duration } from '@_types/Time' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' /** * Run an async ES|QL query. @@ -97,7 +98,7 @@ export interface Request extends RequestBase { * To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters. * @doc_id esql-query-params */ - params?: Array + params?: Array /** * If provided and `true` the response will include an extra `profile` object * with information on how the query was executed. This information is for human debugging diff --git a/specification/esql/query/QueryRequest.ts b/specification/esql/query/QueryRequest.ts index a9097b29b0..a3c4366397 100644 --- a/specification/esql/query/QueryRequest.ts +++ b/specification/esql/query/QueryRequest.ts @@ -23,6 +23,7 @@ import { Dictionary } from '@spec_utils/Dictionary' import { RequestBase } from '@_types/Base' import { FieldValue } from '@_types/common' import { QueryContainer } from '@_types/query_dsl/abstractions' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' /** * Run an ES|QL query. @@ -77,7 +78,7 @@ export interface Request extends RequestBase { * To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters. * @doc_id esql-query-params */ - params?: Array + params?: Array /** * If provided and `true` the response will include an extra `profile` object * with information on how the query was executed. This information is for human debugging From 3d24762a847ca380d383ecb4c7d31c7a9ed7af10 Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Mon, 10 Feb 2025 10:21:23 +0100 Subject: [PATCH 2/4] Make linter happy --- specification/_types/common.ts | 7 +------ specification/esql/async_query/AsyncQueryRequest.ts | 3 +-- specification/esql/query/QueryRequest.ts | 3 +-- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/specification/_types/common.ts b/specification/_types/common.ts index ea76575546..73847e459e 100644 --- a/specification/_types/common.ts +++ b/specification/_types/common.ts @@ -28,12 +28,7 @@ import { double, integer, long } from './Numeric' */ // Note: the ending `UserDefinedValue` includes all other union members, but we keep them explicit so that // code generators can provide direct access to scalar values, which are the most common use case. -export type FieldValue = - | long - | double - | string - | boolean - | null +export type FieldValue = long | double | string | boolean | null /** * A scalar value. diff --git a/specification/esql/async_query/AsyncQueryRequest.ts b/specification/esql/async_query/AsyncQueryRequest.ts index 18b21c52f5..aaee2bbb63 100644 --- a/specification/esql/async_query/AsyncQueryRequest.ts +++ b/specification/esql/async_query/AsyncQueryRequest.ts @@ -20,11 +20,10 @@ import { EsqlFormat } from '@esql/_types/QueryParameters' import { TableValuesContainer } from '@esql/_types/TableValuesContainer' import { Dictionary } from '@spec_utils/Dictionary' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' import { RequestBase } from '@_types/Base' -import { FieldValue } from '@_types/common' import { QueryContainer } from '@_types/query_dsl/abstractions' import { Duration } from '@_types/Time' -import { UserDefinedValue } from '@spec_utils/UserDefinedValue' /** * Run an async ES|QL query. diff --git a/specification/esql/query/QueryRequest.ts b/specification/esql/query/QueryRequest.ts index a3c4366397..fa5d8efa20 100644 --- a/specification/esql/query/QueryRequest.ts +++ b/specification/esql/query/QueryRequest.ts @@ -20,10 +20,9 @@ import { EsqlFormat } from '@esql/_types/QueryParameters' import { TableValuesContainer } from '@esql/_types/TableValuesContainer' import { Dictionary } from '@spec_utils/Dictionary' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' import { RequestBase } from '@_types/Base' -import { FieldValue } from '@_types/common' import { QueryContainer } from '@_types/query_dsl/abstractions' -import { UserDefinedValue } from '@spec_utils/UserDefinedValue' /** * Run an ES|QL query. From e36ca3ff6dd92464c0f37ead699e41854f77bd15 Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Mon, 10 Feb 2025 10:34:50 +0100 Subject: [PATCH 3/4] Revert ESQL related change as discussed --- output/schema/schema.json | 150 +++++++++--------- output/typescript/types.ts | 4 +- .../esql/async_query/AsyncQueryRequest.ts | 4 +- specification/esql/query/QueryRequest.ts | 4 +- 4 files changed, 85 insertions(+), 77 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index b6c6b9f8cb..86a2e0b56b 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -44998,7 +44998,7 @@ "name": "AggregateName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L147-L151", + "specLocation": "_types/common.ts#L142-L146", "type": { "kind": "instance_of", "type": { @@ -45207,7 +45207,7 @@ "name": "ByteSize", "namespace": "_types" }, - "specLocation": "_types/common.ts#L95-L96", + "specLocation": "_types/common.ts#L90-L91", "type": { "kind": "union_of", "items": [ @@ -45260,7 +45260,7 @@ "name": "Bytes", "namespace": "_types" }, - "specLocation": "_types/common.ts#L171-L183" + "specLocation": "_types/common.ts#L166-L178" }, { "kind": "type_alias", @@ -45268,7 +45268,7 @@ "name": "CategoryId", "namespace": "_types" }, - "specLocation": "_types/common.ts#L57-L57", + "specLocation": "_types/common.ts#L52-L52", "type": { "kind": "instance_of", "type": { @@ -45283,7 +45283,7 @@ "name": "ClusterAlias", "namespace": "_types" }, - "specLocation": "_types/common.ts#L77-L77", + "specLocation": "_types/common.ts#L72-L72", "type": { "kind": "instance_of", "type": { @@ -45403,7 +45403,7 @@ "name": "ClusterInfoTarget", "namespace": "_types" }, - "specLocation": "_types/common.ts#L383-L389" + "specLocation": "_types/common.ts#L378-L384" }, { "kind": "type_alias", @@ -45411,7 +45411,7 @@ "name": "ClusterInfoTargets", "namespace": "_types" }, - "specLocation": "_types/common.ts#L391-L391", + "specLocation": "_types/common.ts#L386-L386", "type": { "kind": "union_of", "items": [ @@ -45630,7 +45630,7 @@ "name": "Conflicts", "namespace": "_types" }, - "specLocation": "_types/common.ts#L185-L194" + "specLocation": "_types/common.ts#L180-L189" }, { "kind": "interface", @@ -45761,7 +45761,7 @@ "name": "DataStreamName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L91-L91", + "specLocation": "_types/common.ts#L86-L86", "type": { "kind": "instance_of", "type": { @@ -45776,7 +45776,7 @@ "name": "DataStreamNames", "namespace": "_types" }, - "specLocation": "_types/common.ts#L93-L93", + "specLocation": "_types/common.ts#L88-L88", "type": { "kind": "union_of", "items": [ @@ -46213,7 +46213,7 @@ "namespace": "_types" }, "properties": [], - "specLocation": "_types/common.ts#L162-L163" + "specLocation": "_types/common.ts#L157-L158" }, { "kind": "type_alias", @@ -46425,7 +46425,7 @@ "name": "ExpandWildcard", "namespace": "_types" }, - "specLocation": "_types/common.ts#L203-L217" + "specLocation": "_types/common.ts#L198-L212" }, { "kind": "type_alias", @@ -46433,7 +46433,7 @@ "name": "ExpandWildcards", "namespace": "_types" }, - "specLocation": "_types/common.ts#L219-L219", + "specLocation": "_types/common.ts#L214-L214", "type": { "kind": "union_of", "items": [ @@ -46464,7 +46464,7 @@ "name": "Field", "namespace": "_types" }, - "specLocation": "_types/common.ts#L140-L141", + "specLocation": "_types/common.ts#L135-L136", "type": { "kind": "instance_of", "type": { @@ -46661,7 +46661,7 @@ "name": "FieldValue", "namespace": "_types" }, - "specLocation": "_types/common.ts#L25-L36", + "specLocation": "_types/common.ts#L25-L31", "type": { "kind": "union_of", "items": [ @@ -46774,7 +46774,7 @@ "name": "Fields", "namespace": "_types" }, - "specLocation": "_types/common.ts#L142-L142", + "specLocation": "_types/common.ts#L137-L137", "type": { "kind": "union_of", "items": [ @@ -46869,7 +46869,7 @@ "name": "Fuzziness", "namespace": "_types" }, - "specLocation": "_types/common.ts#L135-L136", + "specLocation": "_types/common.ts#L130-L131", "type": { "kind": "union_of", "items": [ @@ -47476,7 +47476,7 @@ "name": "GrokPattern", "namespace": "_types" }, - "specLocation": "_types/common.ts#L86-L86", + "specLocation": "_types/common.ts#L81-L81", "type": { "kind": "instance_of", "type": { @@ -47514,7 +47514,7 @@ "name": "HealthStatus", "namespace": "_types" }, - "specLocation": "_types/common.ts#L221-L241" + "specLocation": "_types/common.ts#L216-L236" }, { "kind": "type_alias", @@ -47537,7 +47537,7 @@ "name": "HttpHeaders", "namespace": "_types" }, - "specLocation": "_types/common.ts#L160-L160", + "specLocation": "_types/common.ts#L155-L155", "type": { "kind": "dictionary_of", "key": { @@ -47610,7 +47610,7 @@ "name": "Id", "namespace": "_types" }, - "specLocation": "_types/common.ts#L60-L60", + "specLocation": "_types/common.ts#L55-L55", "type": { "kind": "instance_of", "type": { @@ -47625,7 +47625,7 @@ "name": "Ids", "namespace": "_types" }, - "specLocation": "_types/common.ts#L61-L61", + "specLocation": "_types/common.ts#L56-L56", "type": { "kind": "union_of", "items": [ @@ -47655,7 +47655,7 @@ "name": "IndexAlias", "namespace": "_types" }, - "specLocation": "_types/common.ts#L67-L67", + "specLocation": "_types/common.ts#L62-L62", "type": { "kind": "instance_of", "type": { @@ -47670,7 +47670,7 @@ "name": "IndexName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L65-L65", + "specLocation": "_types/common.ts#L60-L60", "type": { "kind": "instance_of", "type": { @@ -47685,7 +47685,7 @@ "name": "IndexPattern", "namespace": "_types" }, - "specLocation": "_types/common.ts#L68-L68", + "specLocation": "_types/common.ts#L63-L63", "type": { "kind": "instance_of", "type": { @@ -47700,7 +47700,7 @@ "name": "IndexPatterns", "namespace": "_types" }, - "specLocation": "_types/common.ts#L69-L69", + "specLocation": "_types/common.ts#L64-L64", "type": { "kind": "array_of", "value": { @@ -47931,7 +47931,7 @@ "name": "Indices", "namespace": "_types" }, - "specLocation": "_types/common.ts#L66-L66", + "specLocation": "_types/common.ts#L61-L61", "type": { "kind": "union_of", "items": [ @@ -48014,7 +48014,7 @@ } } ], - "specLocation": "_types/common.ts#L337-L364" + "specLocation": "_types/common.ts#L332-L359" }, { "kind": "interface", @@ -48157,7 +48157,7 @@ } } ], - "specLocation": "_types/common.ts#L322-L335" + "specLocation": "_types/common.ts#L317-L330" }, { "kind": "type_alias", @@ -48628,7 +48628,7 @@ "name": "Level", "namespace": "_types" }, - "specLocation": "_types/common.ts#L251-L255" + "specLocation": "_types/common.ts#L246-L250" }, { "kind": "enum", @@ -48883,7 +48883,7 @@ "name": "Metadata", "namespace": "_types" }, - "specLocation": "_types/common.ts#L98-L98", + "specLocation": "_types/common.ts#L93-L93", "type": { "kind": "dictionary_of", "key": { @@ -48905,7 +48905,7 @@ "name": "Metrics", "namespace": "_types" }, - "specLocation": "_types/common.ts#L75-L75", + "specLocation": "_types/common.ts#L70-L70", "type": { "kind": "union_of", "items": [ @@ -48938,7 +48938,7 @@ "name": "MinimumShouldMatch", "namespace": "_types" }, - "specLocation": "_types/common.ts#L165-L169", + "specLocation": "_types/common.ts#L160-L164", "type": { "kind": "union_of", "items": [ @@ -48967,7 +48967,7 @@ "name": "MultiTermQueryRewrite", "namespace": "_types" }, - "specLocation": "_types/common.ts#L137-L138", + "specLocation": "_types/common.ts#L132-L133", "type": { "kind": "instance_of", "type": { @@ -48982,7 +48982,7 @@ "name": "Name", "namespace": "_types" }, - "specLocation": "_types/common.ts#L79-L79", + "specLocation": "_types/common.ts#L74-L74", "type": { "kind": "instance_of", "type": { @@ -48997,7 +48997,7 @@ "name": "Names", "namespace": "_types" }, - "specLocation": "_types/common.ts#L80-L80", + "specLocation": "_types/common.ts#L75-L75", "type": { "kind": "union_of", "items": [ @@ -49027,7 +49027,7 @@ "name": "Namespace", "namespace": "_types" }, - "specLocation": "_types/common.ts#L82-L82", + "specLocation": "_types/common.ts#L77-L77", "type": { "kind": "instance_of", "type": { @@ -49177,7 +49177,7 @@ "name": "NodeId", "namespace": "_types" }, - "specLocation": "_types/common.ts#L62-L62", + "specLocation": "_types/common.ts#L57-L57", "type": { "kind": "instance_of", "type": { @@ -49192,7 +49192,7 @@ "name": "NodeIds", "namespace": "_types" }, - "specLocation": "_types/common.ts#L63-L63", + "specLocation": "_types/common.ts#L58-L58", "type": { "kind": "union_of", "items": [ @@ -49224,7 +49224,7 @@ "name": "NodeName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L88-L89", + "specLocation": "_types/common.ts#L83-L84", "type": { "kind": "instance_of", "type": { @@ -49560,7 +49560,7 @@ "name": "OpType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L257-L266" + "specLocation": "_types/common.ts#L252-L261" }, { "kind": "type_alias", @@ -49568,7 +49568,7 @@ "name": "Password", "namespace": "_types" }, - "specLocation": "_types/common.ts#L197-L197", + "specLocation": "_types/common.ts#L192-L192", "type": { "kind": "instance_of", "type": { @@ -49610,7 +49610,7 @@ "name": "PipelineName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L85-L85", + "specLocation": "_types/common.ts#L80-L80", "type": { "kind": "instance_of", "type": { @@ -49737,7 +49737,7 @@ "name": "PropertyName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L132-L132", + "specLocation": "_types/common.ts#L127-L127", "type": { "kind": "instance_of", "type": { @@ -50064,7 +50064,7 @@ "name": "Refresh", "namespace": "_types" }, - "specLocation": "_types/common.ts#L268-L275" + "specLocation": "_types/common.ts#L263-L270" }, { "kind": "interface", @@ -50166,7 +50166,7 @@ "name": "RelationName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L133-L133", + "specLocation": "_types/common.ts#L128-L128", "type": { "kind": "instance_of", "type": { @@ -50491,7 +50491,7 @@ "name": "Routing", "namespace": "_types" }, - "specLocation": "_types/common.ts#L71-L71", + "specLocation": "_types/common.ts#L66-L66", "type": { "kind": "instance_of", "type": { @@ -50617,7 +50617,7 @@ "name": "ScalarValue", "namespace": "_types" }, - "specLocation": "_types/common.ts#L38-L42", + "specLocation": "_types/common.ts#L33-L37", "type": { "kind": "union_of", "items": [ @@ -50980,7 +50980,7 @@ "name": "ScrollId", "namespace": "_types" }, - "specLocation": "_types/common.ts#L54-L54", + "specLocation": "_types/common.ts#L49-L49", "type": { "kind": "instance_of", "type": { @@ -50995,7 +50995,7 @@ "name": "ScrollIds", "namespace": "_types" }, - "specLocation": "_types/common.ts#L55-L55", + "specLocation": "_types/common.ts#L50-L50", "type": { "kind": "union_of", "items": [ @@ -51322,7 +51322,7 @@ "name": "SearchType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L277-L282" + "specLocation": "_types/common.ts#L272-L277" }, { "kind": "interface", @@ -51637,7 +51637,7 @@ "name": "SequenceNumber", "namespace": "_types" }, - "specLocation": "_types/common.ts#L130-L130", + "specLocation": "_types/common.ts#L125-L125", "type": { "kind": "instance_of", "type": { @@ -51652,7 +51652,7 @@ "name": "Service", "namespace": "_types" }, - "specLocation": "_types/common.ts#L83-L83", + "specLocation": "_types/common.ts#L78-L78", "type": { "kind": "instance_of", "type": { @@ -51872,7 +51872,7 @@ "name": "Slices", "namespace": "_types" }, - "specLocation": "_types/common.ts#L366-L371", + "specLocation": "_types/common.ts#L361-L366", "type": { "kind": "union_of", "items": [ @@ -51905,7 +51905,7 @@ "name": "SlicesCalculation", "namespace": "_types" }, - "specLocation": "_types/common.ts#L373-L381" + "specLocation": "_types/common.ts#L368-L376" }, { "kind": "type_alias", @@ -52368,7 +52368,7 @@ "name": "SuggestMode", "namespace": "_types" }, - "specLocation": "_types/common.ts#L284-L297" + "specLocation": "_types/common.ts#L279-L292" }, { "kind": "type_alias", @@ -52377,7 +52377,7 @@ "name": "SuggestionName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L153-L157", + "specLocation": "_types/common.ts#L148-L152", "type": { "kind": "instance_of", "type": { @@ -52446,7 +52446,7 @@ "name": "TaskId", "namespace": "_types" }, - "specLocation": "_types/common.ts#L134-L134", + "specLocation": "_types/common.ts#L129-L129", "type": { "kind": "union_of", "items": [ @@ -52598,7 +52598,7 @@ "name": "ThreadType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L299-L305" + "specLocation": "_types/common.ts#L294-L300" }, { "kind": "type_alias", @@ -52954,7 +52954,7 @@ "name": "Username", "namespace": "_types" }, - "specLocation": "_types/common.ts#L196-L196", + "specLocation": "_types/common.ts#L191-L191", "type": { "kind": "instance_of", "type": { @@ -52969,7 +52969,7 @@ "name": "Uuid", "namespace": "_types" }, - "specLocation": "_types/common.ts#L127-L127", + "specLocation": "_types/common.ts#L122-L122", "type": { "kind": "instance_of", "type": { @@ -52984,7 +52984,7 @@ "name": "VersionNumber", "namespace": "_types" }, - "specLocation": "_types/common.ts#L101-L101", + "specLocation": "_types/common.ts#L96-L96", "type": { "kind": "instance_of", "type": { @@ -52999,7 +52999,7 @@ "name": "VersionString", "namespace": "_types" }, - "specLocation": "_types/common.ts#L103-L103", + "specLocation": "_types/common.ts#L98-L98", "type": { "kind": "instance_of", "type": { @@ -53032,7 +53032,7 @@ "name": "VersionType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L105-L124" + "specLocation": "_types/common.ts#L100-L119" }, { "kind": "enum", @@ -53048,7 +53048,7 @@ "name": "WaitForActiveShardOptions", "namespace": "_types" }, - "specLocation": "_types/common.ts#L307-L311" + "specLocation": "_types/common.ts#L302-L306" }, { "kind": "type_alias", @@ -53060,7 +53060,7 @@ "name": "WaitForActiveShards", "namespace": "_types" }, - "specLocation": "_types/common.ts#L144-L145", + "specLocation": "_types/common.ts#L139-L140", "type": { "kind": "union_of", "items": [ @@ -53107,7 +53107,7 @@ "name": "WaitForEvents", "namespace": "_types" }, - "specLocation": "_types/common.ts#L313-L320" + "specLocation": "_types/common.ts#L308-L315" }, { "kind": "interface", @@ -122138,7 +122138,11 @@ "type": { "kind": "array_of", "value": { - "kind": "user_defined_value" + "kind": "instance_of", + "type": { + "name": "FieldValue", + "namespace": "_types" + } } } }, @@ -122292,7 +122296,7 @@ } } ], - "specLocation": "esql/async_query/AsyncQueryRequest.ts#L29-L119" + "specLocation": "esql/async_query/AsyncQueryRequest.ts#L28-L118" }, { "kind": "response", @@ -122578,7 +122582,11 @@ "type": { "kind": "array_of", "value": { - "kind": "user_defined_value" + "kind": "instance_of", + "type": { + "name": "FieldValue", + "namespace": "_types" + } } } }, @@ -122693,7 +122701,7 @@ } } ], - "specLocation": "esql/query/QueryRequest.ts#L28-L99" + "specLocation": "esql/query/QueryRequest.ts#L27-L98" }, { "kind": "response", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 04015b28f3..a4994841bb 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -10544,7 +10544,7 @@ export interface EsqlAsyncQueryRequest extends RequestBase { columnar?: boolean filter?: QueryDslQueryContainer locale?: string - params?: any[] + params?: FieldValue[] profile?: boolean query: string tables?: Record> @@ -10583,7 +10583,7 @@ export interface EsqlQueryRequest extends RequestBase { columnar?: boolean filter?: QueryDslQueryContainer locale?: string - params?: any[] + params?: FieldValue[] profile?: boolean query: string tables?: Record> diff --git a/specification/esql/async_query/AsyncQueryRequest.ts b/specification/esql/async_query/AsyncQueryRequest.ts index aaee2bbb63..0f2ed505ed 100644 --- a/specification/esql/async_query/AsyncQueryRequest.ts +++ b/specification/esql/async_query/AsyncQueryRequest.ts @@ -20,8 +20,8 @@ import { EsqlFormat } from '@esql/_types/QueryParameters' import { TableValuesContainer } from '@esql/_types/TableValuesContainer' import { Dictionary } from '@spec_utils/Dictionary' -import { UserDefinedValue } from '@spec_utils/UserDefinedValue' import { RequestBase } from '@_types/Base' +import { FieldValue } from '@_types/common' import { QueryContainer } from '@_types/query_dsl/abstractions' import { Duration } from '@_types/Time' @@ -97,7 +97,7 @@ export interface Request extends RequestBase { * To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters. * @doc_id esql-query-params */ - params?: Array + params?: Array /** * If provided and `true` the response will include an extra `profile` object * with information on how the query was executed. This information is for human debugging diff --git a/specification/esql/query/QueryRequest.ts b/specification/esql/query/QueryRequest.ts index fa5d8efa20..a9097b29b0 100644 --- a/specification/esql/query/QueryRequest.ts +++ b/specification/esql/query/QueryRequest.ts @@ -20,8 +20,8 @@ import { EsqlFormat } from '@esql/_types/QueryParameters' import { TableValuesContainer } from '@esql/_types/TableValuesContainer' import { Dictionary } from '@spec_utils/Dictionary' -import { UserDefinedValue } from '@spec_utils/UserDefinedValue' import { RequestBase } from '@_types/Base' +import { FieldValue } from '@_types/common' import { QueryContainer } from '@_types/query_dsl/abstractions' /** @@ -77,7 +77,7 @@ export interface Request extends RequestBase { * To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters. * @doc_id esql-query-params */ - params?: Array + params?: Array /** * If provided and `true` the response will include an extra `profile` object * with information on how the query was executed. This information is for human debugging From 1d379fcd48bbbc9e9234e7f898074751462cc52b Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Mon, 10 Feb 2025 10:38:10 +0100 Subject: [PATCH 4/4] Apply proposed `ignored_field_values` change --- output/schema/schema.json | 22 +++++++++------------ output/typescript/types.ts | 2 +- specification/_global/search/_types/hits.ts | 3 +-- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 86a2e0b56b..ca23fa4c87 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -38428,11 +38428,7 @@ "value": { "kind": "array_of", "value": { - "kind": "instance_of", - "type": { - "name": "FieldValue", - "namespace": "_types" - } + "kind": "user_defined_value" } } } @@ -38537,7 +38533,7 @@ } } ], - "specLocation": "_global/search/_types/hits.ts#L41-L66" + "specLocation": "_global/search/_types/hits.ts#L40-L65" }, { "kind": "interface", @@ -38623,7 +38619,7 @@ } } ], - "specLocation": "_global/search/_types/hits.ts#L68-L74" + "specLocation": "_global/search/_types/hits.ts#L67-L73" }, { "kind": "interface", @@ -38830,7 +38826,7 @@ } } ], - "specLocation": "_global/search/_types/hits.ts#L108-L142" + "specLocation": "_global/search/_types/hits.ts#L107-L141" }, { "kind": "interface", @@ -38856,7 +38852,7 @@ } } ], - "specLocation": "_global/search/_types/hits.ts#L86-L88" + "specLocation": "_global/search/_types/hits.ts#L85-L87" }, { "kind": "interface", @@ -39418,7 +39414,7 @@ } } ], - "specLocation": "_global/search/_types/hits.ts#L90-L94" + "specLocation": "_global/search/_types/hits.ts#L89-L93" }, { "kind": "interface", @@ -41328,7 +41324,7 @@ } } ], - "specLocation": "_global/search/_types/hits.ts#L96-L99" + "specLocation": "_global/search/_types/hits.ts#L95-L98" }, { "kind": "enum", @@ -41346,7 +41342,7 @@ "name": "TotalHitsRelation", "namespace": "_global.search._types" }, - "specLocation": "_global/search/_types/hits.ts#L101-L106" + "specLocation": "_global/search/_types/hits.ts#L100-L105" }, { "kind": "type_alias", @@ -41359,7 +41355,7 @@ "name": "TrackHits", "namespace": "_global.search._types" }, - "specLocation": "_global/search/_types/hits.ts#L144-L152", + "specLocation": "_global/search/_types/hits.ts#L143-L151", "type": { "kind": "union_of", "items": [ diff --git a/output/typescript/types.ts b/output/typescript/types.ts index a4994841bb..45a2123927 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -1539,7 +1539,7 @@ export interface SearchHit { matched_queries?: string[] | Record _nested?: SearchNestedIdentity _ignored?: string[] - ignored_field_values?: Record + ignored_field_values?: Record _shard?: string _node?: string _routing?: string diff --git a/specification/_global/search/_types/hits.ts b/specification/_global/search/_types/hits.ts index 2ab7993d8f..02cc0678cb 100644 --- a/specification/_global/search/_types/hits.ts +++ b/specification/_global/search/_types/hits.ts @@ -23,7 +23,6 @@ import { UserDefinedValue } from '@spec_utils/UserDefinedValue' import { Field, Fields, - FieldValue, Id, IndexName, Name, @@ -53,7 +52,7 @@ export class Hit { matched_queries?: string[] | Dictionary _nested?: NestedIdentity _ignored?: string[] - ignored_field_values?: Dictionary + ignored_field_values?: Dictionary _shard?: string _node?: string _routing?: string