From b23616d2610fe64bda254217b7019d8434ca8644 Mon Sep 17 00:00:00 2001 From: Laura Trotta <153528055+l-trotta@users.noreply.github.com> Date: Wed, 24 Apr 2024 18:53:07 +0200 Subject: [PATCH 1/5] codegen name for esql version (#2524) --- output/schema/schema.json | 3 ++- specification/esql/_types/Version.ts | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index f2e80338f9..b6933611f2 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -111953,6 +111953,7 @@ "kind": "enum", "members": [ { + "codegenName": "V2024_04_01", "description": "Run against the first version of ES|QL.", "name": "2024.04.01" } @@ -111961,7 +111962,7 @@ "name": "Version", "namespace": "esql._types" }, - "specLocation": "esql/_types/Version.ts#L23-L31" + "specLocation": "esql/_types/Version.ts#L20-L29" }, { "attachedBehaviors": [ diff --git a/specification/esql/_types/Version.ts b/specification/esql/_types/Version.ts index 22fe3280be..17002fe488 100644 --- a/specification/esql/_types/Version.ts +++ b/specification/esql/_types/Version.ts @@ -17,15 +17,13 @@ * under the License. */ -import { integer } from '@_types/Numeric' -import { Duration } from '@_types/Time' - /** * The version of the ES|QL language in which the "query" field was written. */ export enum Version { /** * Run against the first version of ES|QL. + * @codegen_name V2024_04_01 */ '2024.04.01' } From 650fd1162649856150ef90a6a3a4085c197abafb Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Fri, 26 Apr 2024 11:18:52 +0200 Subject: [PATCH 2/5] Add `TermsRangeQuery` (#2529) --- specification/_types/query_dsl/term.ts | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/specification/_types/query_dsl/term.ts b/specification/_types/query_dsl/term.ts index 6ebd7c0064..d828eed53d 100644 --- a/specification/_types/query_dsl/term.ts +++ b/specification/_types/query_dsl/term.ts @@ -163,9 +163,30 @@ export class NumberRangeQuery extends RangeQueryBase { to?: double | null } -/** @codegen_names date, number */ +export class TermsRangeQuery extends RangeQueryBase { + /** + * Greater than. + */ + gt?: string + /** + * Greater than or equal to. + */ + gte?: string + /** + * Less than. + */ + lt?: string + /** + * Less than or equal to. + */ + lte?: string + from?: string | null + to?: string | null +} + +/** @codegen_names date, number, terms */ // Note: deserialization depends on value types -export type RangeQuery = DateRangeQuery | NumberRangeQuery +export type RangeQuery = DateRangeQuery | NumberRangeQuery | TermsRangeQuery export enum RangeRelation { /** From 1e21ace2facb4fc95701bcffc92905ef8aa8d6ae Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Fri, 26 Apr 2024 09:19:30 +0000 Subject: [PATCH 3/5] Update specification output --- .../elasticsearch-serverless-openapi.json | 53 +++++++ output/schema/schema.json | 140 ++++++++++++++++-- output/typescript/types.ts | 11 +- 3 files changed, 192 insertions(+), 12 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index eabf8d7680..b9e1cba874 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -37299,6 +37299,9 @@ }, { "$ref": "#/components/schemas/_types.query_dsl:NumberRangeQuery" + }, + { + "$ref": "#/components/schemas/_types.query_dsl:TermsRangeQuery" } ] }, @@ -37433,6 +37436,56 @@ } ] }, + "_types.query_dsl:TermsRangeQuery": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.query_dsl:RangeQueryBase" + }, + { + "type": "object", + "properties": { + "gt": { + "description": "Greater than.", + "type": "string" + }, + "gte": { + "description": "Greater than or equal to.", + "type": "string" + }, + "lt": { + "description": "Less than.", + "type": "string" + }, + "lte": { + "description": "Less than or equal to.", + "type": "string" + }, + "from": { + "oneOf": [ + { + "type": "string" + }, + { + "nullable": true, + "type": "string" + } + ] + }, + "to": { + "oneOf": [ + { + "type": "string" + }, + { + "nullable": true, + "type": "string" + } + ] + } + } + } + ] + }, "_types.query_dsl:RankFeatureQuery": { "allOf": [ { diff --git a/output/schema/schema.json b/output/schema/schema.json index b6933611f2..a33fd64666 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -79552,14 +79552,15 @@ { "codegenNames": [ "date", - "number" + "number", + "terms" ], "kind": "type_alias", "name": { "name": "RangeQuery", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/term.ts#L166-L168", + "specLocation": "_types/query_dsl/term.ts#L187-L189", "type": { "items": [ { @@ -79575,6 +79576,13 @@ "name": "NumberRangeQuery", "namespace": "_types.query_dsl" } + }, + { + "kind": "instance_of", + "type": { + "name": "TermsRangeQuery", + "namespace": "_types.query_dsl" + } } ], "kind": "union_of" @@ -79629,7 +79637,7 @@ "name": "RangeRelation", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/term.ts#L170-L183" + "specLocation": "_types/query_dsl/term.ts#L191-L204" }, { "kind": "interface", @@ -79917,7 +79925,7 @@ } ], "shortcutProperty": "value", - "specLocation": "_types/query_dsl/term.ts#L185-L215" + "specLocation": "_types/query_dsl/term.ts#L206-L236" }, { "inherits": { @@ -81038,7 +81046,7 @@ } ], "shortcutProperty": "value", - "specLocation": "_types/query_dsl/term.ts#L217-L231" + "specLocation": "_types/query_dsl/term.ts#L238-L252" }, { "kind": "interface", @@ -81092,7 +81100,7 @@ } } ], - "specLocation": "_types/query_dsl/term.ts#L242-L247" + "specLocation": "_types/query_dsl/term.ts#L263-L268" }, { "attachedBehaviors": [ @@ -81134,7 +81142,7 @@ "namespace": "_types.query_dsl" }, "properties": [], - "specLocation": "_types/query_dsl/term.ts#L233-L235" + "specLocation": "_types/query_dsl/term.ts#L254-L256" }, { "codegenNames": [ @@ -81146,7 +81154,7 @@ "name": "TermsQueryField", "namespace": "_types.query_dsl" }, - "specLocation": "_types/query_dsl/term.ts#L237-L240", + "specLocation": "_types/query_dsl/term.ts#L258-L261", "type": { "items": [ { @@ -81170,6 +81178,116 @@ "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": { @@ -81223,7 +81341,7 @@ } } ], - "specLocation": "_types/query_dsl/term.ts#L249-L262" + "specLocation": "_types/query_dsl/term.ts#L270-L283" }, { "inherits": { @@ -81396,7 +81514,7 @@ } } ], - "specLocation": "_types/query_dsl/term.ts#L264-L266" + "specLocation": "_types/query_dsl/term.ts#L285-L287" }, { "inherits": { @@ -81521,7 +81639,7 @@ } ], "shortcutProperty": "value", - "specLocation": "_types/query_dsl/term.ts#L268-L285" + "specLocation": "_types/query_dsl/term.ts#L289-L306" }, { "inherits": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index ab5516f4ed..b15508f039 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -5939,7 +5939,7 @@ export interface QueryDslRandomScoreFunction { seed?: long | string } -export type QueryDslRangeQuery = QueryDslDateRangeQuery | QueryDslNumberRangeQuery +export type QueryDslRangeQuery = QueryDslDateRangeQuery | QueryDslNumberRangeQuery | QueryDslTermsRangeQuery export interface QueryDslRangeQueryBase extends QueryDslQueryBase { relation?: QueryDslRangeRelation @@ -6116,6 +6116,15 @@ export type QueryDslTermsQuery = QueryDslTermsQueryKeys export type QueryDslTermsQueryField = FieldValue[] | QueryDslTermsLookup +export interface QueryDslTermsRangeQuery extends QueryDslRangeQueryBase { + gt?: string + gte?: string + lt?: string + lte?: string + from?: string | null + to?: string | null +} + export interface QueryDslTermsSetQuery extends QueryDslQueryBase { minimum_should_match_field?: Field minimum_should_match_script?: Script From 5502270bd1129c87b25e8e3601e25a58f4370587 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Fri, 26 Apr 2024 10:00:14 -0700 Subject: [PATCH 4/5] Fix broken link (#2532) --- output/schema/schema.json | 2 +- specification/_doc_ids/table.csv | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index a33fd64666..d4866ff603 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -3485,7 +3485,7 @@ }, "description": "Lists all connector sync jobs.", "docId": "connector-sync-job-list", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{list}/list-connector-sync-jobs-api.html", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/list-connector-sync-jobs-api.html", "name": "connector.sync_job_list", "request": { "name": "Request", diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index d38b1efc78..dc1d7d19a9 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -82,7 +82,7 @@ connector-sync-job-cancel,https://www.elastic.co/guide/en/elasticsearch/referenc connector-sync-job-delete,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/delete-connector-sync-job-api.html connector-sync-job-get,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/get-connector-sync-job-api.html connector-sync-job-post,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/create-connector-sync-job-api.html -connector-sync-job-list,https://www.elastic.co/guide/en/elasticsearch/reference/{list}/list-connector-sync-jobs-api.html +connector-sync-job-list,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/list-connector-sync-jobs-api.html connector-checkin,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/check-in-connector-api.html connector-delete,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/delete-connector-api.html connector-get,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/get-connector-api.html From 6b6e16ee9f23d0c7610e9a1f609da4eb2a6ac4df Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Fri, 26 Apr 2024 17:00:51 +0000 Subject: [PATCH 5/5] Update specification output --- output/openapi/elasticsearch-serverless-openapi.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index b9e1cba874..eef6bd2dea 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -2398,7 +2398,7 @@ "summary": "Lists all connector sync jobs.", "description": "Lists all connector sync jobs.", "externalDocs": { - "url": "https://www.elastic.co/guide/en/elasticsearch/reference/{list}/list-connector-sync-jobs-api.html" + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/list-connector-sync-jobs-api.html" }, "operationId": "connector-sync-job-list", "parameters": [