Skip to content

Commit

Permalink
[8.x] [Console] Update Elasticsearch specification metamodel (#193239) (
Browse files Browse the repository at this point in the history
#193405)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Console] Update Elasticsearch specification metamodel
(#193239)](#193239)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Quentin
Pradet","email":"quentin.pradet@elastic.co"},"sourceCommit":{"committedDate":"2024-09-19T10:31:13Z","message":"[Console]
Update Elasticsearch specification metamodel (#193239)\n\n##
Summary\r\n\r\nAs mentioned in
#163335, the\r\nElasticsearch
specification metamodel is copied into Kibana, not\r\nimported. I don't
know how to fix the original issue, so this pull\r\nrequest only updates
the file, one year later.\r\n\r\n### Checklist\r\n\r\n- [x] I checked
that `node scripts/generate_console_definitions.js\r\n--source
../elasticsearch-specification/ --emptyDest` still
works.\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"f6cff85c8d0ae4b32fbced558e831465d844e2ee","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Console","Team:Kibana
Management","release_note:skip","v9.0.0","backport:prev-minor","v8.16.0"],"title":"[Console]
Update Elasticsearch specification
metamodel","number":193239,"url":"https://github.com/elastic/kibana/pull/193239","mergeCommit":{"message":"[Console]
Update Elasticsearch specification metamodel (#193239)\n\n##
Summary\r\n\r\nAs mentioned in
#163335, the\r\nElasticsearch
specification metamodel is copied into Kibana, not\r\nimported. I don't
know how to fix the original issue, so this pull\r\nrequest only updates
the file, one year later.\r\n\r\n### Checklist\r\n\r\n- [x] I checked
that `node scripts/generate_console_definitions.js\r\n--source
../elasticsearch-specification/ --emptyDest` still
works.\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"f6cff85c8d0ae4b32fbced558e831465d844e2ee"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193239","number":193239,"mergeCommit":{"message":"[Console]
Update Elasticsearch specification metamodel (#193239)\n\n##
Summary\r\n\r\nAs mentioned in
#163335, the\r\nElasticsearch
specification metamodel is copied into Kibana, not\r\nimported. I don't
know how to fix the original issue, so this pull\r\nrequest only updates
the file, one year later.\r\n\r\n### Checklist\r\n\r\n- [x] I checked
that `node scripts/generate_console_definitions.js\r\n--source
../elasticsearch-specification/ --emptyDest` still
works.\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"f6cff85c8d0ae4b32fbced558e831465d844e2ee"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
  • Loading branch information
kibanamachine and pquentin authored Sep 19, 2024
1 parent ef37576 commit 398a758
Showing 1 changed file with 32 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export interface DictionaryOf {
}

/**
* A user defined value. To be used when bubbling a generic parameter up to the top-level interface is
* A user defined value. To be used when bubbling a generic parameter up to the top-level class is
* inconvenient or impossible (e.g. for lists of user-defined values of possibly different types).
*
* Clients will allow providing a serializer/deserializer when reading/writing properties of this type,
Expand Down Expand Up @@ -139,7 +139,7 @@ export interface Property {
codegenName?: string;
/** An optional set of aliases for `name` */
aliases?: string[];
/** If the enclosing interface is a variants container, is this a property of the container and not a variant? */
/** If the enclosing class is a variants container, is this a property of the container and not a variant? */
containerProperty?: boolean;
/** If this property has a quirk that needs special attention, give a short explanation about it */
esQuirk?: string;
Expand Down Expand Up @@ -181,7 +181,7 @@ export interface BaseType {
specLocation: string;
}

export type Variants = ExternalTag | InternalTag | Container;
export type Variants = ExternalTag | InternalTag | Container | Untagged;

export interface VariantBase {
/**
Expand All @@ -208,6 +208,11 @@ export interface Container extends VariantBase {
kind: 'container';
}

export interface Untagged extends VariantBase {
kind: 'untagged';
untypedVariant: TypeName;
}

/**
* Inherits clause (aka extends or implements) for an interface or request
*/
Expand All @@ -216,6 +221,12 @@ export interface Inherits {
generics?: ValueOf[];
}

export interface Behavior {
type: TypeName;
generics?: ValueOf[];
meta?: Record<string, string>;
}

/**
* An interface type
*/
Expand All @@ -232,7 +243,7 @@ export interface Interface extends BaseType {
/**
* Behaviors directly implemented by this interface
*/
behaviors?: Inherits[];
behaviors?: Behavior[];

/**
* Behaviors attached to this interface, coming from the interface itself (see `behaviors`)
Expand Down Expand Up @@ -271,12 +282,12 @@ export interface Request extends BaseType {
// We can also pull path parameter descriptions on body properties they replace

/**
* Body type. Most often a list of properties (that can extend those of the inherited interface, see above), except for a
* Body type. Most often a list of properties (that can extend those of the inherited class, see above), except for a
* few specific cases that use other types such as bulk (array) or create (generic parameter). Or NoBody for requests
* that don't have a body.
*/
body: Body;
behaviors?: Inherits[];
behaviors?: Behavior[];
attachedBehaviors?: string[];
}

Expand All @@ -287,7 +298,7 @@ export interface Response extends BaseType {
kind: 'response';
generics?: TypeName[];
body: Body;
behaviors?: Inherits[];
behaviors?: Behavior[];
attachedBehaviors?: string[];
exceptions?: ResponseException[];
}
Expand Down Expand Up @@ -335,6 +346,7 @@ export interface EnumMember {
description?: string;
deprecation?: Deprecation;
since?: string;
availability?: Availabilities;
}

/**
Expand All @@ -358,8 +370,11 @@ export interface TypeAlias extends BaseType {
type: ValueOf;
/** generic parameters: either concrete types or open parameters from the enclosing type */
generics?: TypeName[];
/** Only applicable to `union_of` aliases: identify typed_key unions (external) and variant inventories (internal) */
variants?: InternalTag | ExternalTag;
/**
* Only applicable to `union_of` aliases: identify typed_key unions (external), variant inventories (internal)
* and untagged variants
*/
variants?: InternalTag | ExternalTag | Untagged;
}

// ------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -438,6 +453,14 @@ export interface UrlTemplate {
}

export interface Model {
_info?: {
title: string;
license: {
name: string;
url: string;
};
};

types: TypeDefinition[];
endpoints: Endpoint[];
}

0 comments on commit 398a758

Please sign in to comment.