Skip to content

Commit

Permalink
[Console] Update Elasticsearch specification metamodel (elastic#193239)
Browse files Browse the repository at this point in the history
## Summary

As mentioned in elastic#163335, the
Elasticsearch specification metamodel is copied into Kibana, not
imported. I don't know how to fix the original issue, so this pull
request only updates the file, one year later.

### Checklist

- [x] I checked that `node scripts/generate_console_definitions.js
--source ../elasticsearch-specification/ --emptyDest` still works.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
pquentin and elasticmachine authored Sep 19, 2024
1 parent 28aa274 commit f6cff85
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 f6cff85

Please sign in to comment.