From b868c55418807f52a1b45139d2f6d43c036edd55 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) (cherry picked from commit 604316c6502c2f6b5e49f0b1b218b560e10c6163) --- 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 6e5f885d27..6fddb888ea 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" @@ -85565,6 +85565,18 @@ "type": "object" } }, + "sql.query:SqlFormat": { + "type": "string", + "enum": [ + "csv", + "json", + "tsv", + "txt", + "yaml", + "cbor", + "smile" + ] + }, "ssl.certificates:CertificateInformation": { "type": "object", "properties": { @@ -88093,6 +88105,14 @@ "stopping" ] }, + "xpack.info:XPackCategory": { + "type": "string", + "enum": [ + "build", + "features", + "license" + ] + }, "xpack.info:BuildInformation": { "type": "object", "properties": { @@ -102088,7 +102108,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 9a4f3e5c19..ac89e4d4c1 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -54872,6 +54872,18 @@ "type": "object" } }, + "sql.query:SqlFormat": { + "type": "string", + "enum": [ + "csv", + "json", + "tsv", + "txt", + "yaml", + "cbor", + "smile" + ] + }, "synonyms._types:SynonymsUpdateResult": { "type": "object", "properties": { @@ -62157,7 +62169,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 442cc4606d..2fd399672c 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 bdbe479489..097096ea3e 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -200540,8 +200540,8 @@ "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "SqlFormat", + "namespace": "sql.query" } } } @@ -200639,6 +200639,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": [ @@ -212607,8 +212638,8 @@ "value": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "XPackCategory", + "namespace": "xpack.info" } } } @@ -212698,6 +212729,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 eaf9b4c0e8..7ce78b826a 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -19066,7 +19066,7 @@ export interface SqlGetAsyncStatusResponse { } export interface SqlQueryRequest extends RequestBase { - format?: string + format?: SqlQuerySqlFormat body?: { catalog?: string columnar?: boolean @@ -19096,6 +19096,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 @@ -20405,7 +20407,7 @@ export interface XpackInfoNativeCodeInformation { } export interface XpackInfoRequest extends RequestBase { - categories?: string[] + categories?: XpackInfoXPackCategory[] accept_enterprise?: boolean human?: boolean } @@ -20417,6 +20419,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 +}