From 604316c6502c2f6b5e49f0b1b218b560e10c6163 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 23 Sep 2024 11:43:15 +0400 Subject: [PATCH] Apply two improvements from Kibana Console (#2907) --- output/openapi/elasticsearch-openapi.json | 24 +++++++- .../elasticsearch-serverless-openapi.json | 14 ++++- output/schema/schema-serverless.json | 54 ++++++++++++++++- output/schema/schema.json | 58 +++++++++++++++++-- output/typescript/types.ts | 8 ++- specification/sql/query/QuerySqlRequest.ts | 12 +++- specification/xpack/info/XPackInfoRequest.ts | 8 ++- 7 files changed, 165 insertions(+), 13 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 87f8cf279f..8c6c15eb49 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -37517,7 +37517,7 @@ "schema": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/xpack.info:XPackCategory" } }, "style": "form" @@ -85577,6 +85577,18 @@ "type": "object" } }, + "sql.query:SqlFormat": { + "type": "string", + "enum": [ + "csv", + "json", + "tsv", + "txt", + "yaml", + "cbor", + "smile" + ] + }, "ssl.certificates:CertificateInformation": { "type": "object", "properties": { @@ -88105,6 +88117,14 @@ "stopping" ] }, + "xpack.info:XPackCategory": { + "type": "string", + "enum": [ + "build", + "features", + "license" + ] + }, "xpack.info:BuildInformation": { "type": "object", "properties": { @@ -102100,7 +102120,7 @@ "description": "Format for the response.", "deprecated": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/sql.query:SqlFormat" }, "style": "form" }, diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 959f604a10..ee70c1b85a 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -54884,6 +54884,18 @@ "type": "object" } }, + "sql.query:SqlFormat": { + "type": "string", + "enum": [ + "csv", + "json", + "tsv", + "txt", + "yaml", + "cbor", + "smile" + ] + }, "synonyms._types:SynonymsUpdateResult": { "type": "object", "properties": { @@ -62169,7 +62181,7 @@ "description": "Format for the response.", "deprecated": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/sql.query:SqlFormat" }, "style": "form" }, diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 140f4b94f6..d7c01c9f0e 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -40703,8 +40703,8 @@ "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "SqlFormat", + "namespace": "sql.query" } } } @@ -102951,6 +102951,37 @@ } } }, + { + "kind": "enum", + "members": [ + { + "name": "csv" + }, + { + "name": "json" + }, + { + "name": "tsv" + }, + { + "name": "txt" + }, + { + "name": "yaml" + }, + { + "name": "cbor" + }, + { + "name": "smile" + } + ], + "name": { + "name": "SqlFormat", + "namespace": "sql.query" + }, + "specLocation": "sql/query/QuerySqlRequest.ts#L124-L132" + }, { "kind": "type_alias", "name": { @@ -104031,6 +104062,25 @@ }, "specLocation": "watcher/stats/types.ts#L26-L31" }, + { + "kind": "enum", + "members": [ + { + "name": "build" + }, + { + "name": "features" + }, + { + "name": "license" + } + ], + "name": { + "name": "XPackCategory", + "namespace": "xpack.info" + }, + "specLocation": "xpack/info/XPackInfoRequest.ts#L44-L48" + }, { "attachedBehaviors": [ "CommonQueryParameters" diff --git a/output/schema/schema.json b/output/schema/schema.json index 3439050504..1d7b6bbe69 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -200578,8 +200578,8 @@ "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "SqlFormat", + "namespace": "sql.query" } } } @@ -200677,6 +200677,37 @@ }, "specLocation": "sql/query/QuerySqlResponse.ts#L23-L60" }, + { + "kind": "enum", + "members": [ + { + "name": "csv" + }, + { + "name": "json" + }, + { + "name": "tsv" + }, + { + "name": "txt" + }, + { + "name": "yaml" + }, + { + "name": "cbor" + }, + { + "name": "smile" + } + ], + "name": { + "name": "SqlFormat", + "namespace": "sql.query" + }, + "specLocation": "sql/query/QuerySqlRequest.ts#L124-L132" + }, { "kind": "request", "attachedBehaviors": [ @@ -212645,8 +212676,8 @@ "value": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "XPackCategory", + "namespace": "xpack.info" } } } @@ -212736,6 +212767,25 @@ }, "specLocation": "xpack/info/XPackInfoResponse.ts#L22-L29" }, + { + "kind": "enum", + "members": [ + { + "name": "build" + }, + { + "name": "features" + }, + { + "name": "license" + } + ], + "name": { + "name": "XPackCategory", + "namespace": "xpack.info" + }, + "specLocation": "xpack/info/XPackInfoRequest.ts#L44-L48" + }, { "kind": "interface", "inherits": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index bf8164b3e1..5e764c286a 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -19069,7 +19069,7 @@ export interface SqlGetAsyncStatusResponse { } export interface SqlQueryRequest extends RequestBase { - format?: string + format?: SqlQuerySqlFormat body?: { catalog?: string columnar?: boolean @@ -19099,6 +19099,8 @@ export interface SqlQueryResponse { rows: SqlRow[] } +export type SqlQuerySqlFormat = 'csv' | 'json' | 'tsv' | 'txt' | 'yaml' | 'cbor' | 'smile' + export interface SqlTranslateRequest extends RequestBase { body?: { fetch_size?: integer @@ -20408,7 +20410,7 @@ export interface XpackInfoNativeCodeInformation { } export interface XpackInfoRequest extends RequestBase { - categories?: string[] + categories?: XpackInfoXPackCategory[] accept_enterprise?: boolean human?: boolean } @@ -20420,6 +20422,8 @@ export interface XpackInfoResponse { tagline: string } +export type XpackInfoXPackCategory = 'build' | 'features' | 'license' + export interface XpackUsageAnalytics extends XpackUsageBase { stats: XpackUsageAnalyticsStatistics } diff --git a/specification/sql/query/QuerySqlRequest.ts b/specification/sql/query/QuerySqlRequest.ts index 200fe0c8e4..3c07272135 100644 --- a/specification/sql/query/QuerySqlRequest.ts +++ b/specification/sql/query/QuerySqlRequest.ts @@ -36,7 +36,7 @@ export interface Request extends RequestBase { * Format for the response. * @doc_id sql-rest-format */ - format?: string + format?: SqlFormat } body: { /** @@ -120,3 +120,13 @@ export interface Request extends RequestBase { index_using_frozen?: boolean } } + +export enum SqlFormat { + csv, + json, + tsv, + txt, + yaml, + cbor, + smile +} diff --git a/specification/xpack/info/XPackInfoRequest.ts b/specification/xpack/info/XPackInfoRequest.ts index 26ee1d0670..1261113b5b 100644 --- a/specification/xpack/info/XPackInfoRequest.ts +++ b/specification/xpack/info/XPackInfoRequest.ts @@ -31,7 +31,7 @@ export interface Request extends RequestBase { /** * A comma-separated list of the information categories to include in the response. For example, `build,license,features`. */ - categories?: string[] + categories?: XPackCategory[] accept_enterprise?: boolean /** * Defines whether additional human-readable information is included in the response. In particular, it adds descriptions and a tag line. @@ -40,3 +40,9 @@ export interface Request extends RequestBase { human?: boolean } } + +export enum XPackCategory { + build, + features, + license +}