Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion schemas/constructs/core.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "../core.json",
"$id": "https://schemas.meshery.io/core.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Reusable core schema elements",
"definitions": {
Expand Down
2 changes: 1 addition & 1 deletion schemas/constructs/v1alpha1/capability/capability.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "https://schemas.meshery.io/capability.json",
"$id": "https://schemas.meshery.io/v1alpha1/capability/capability.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Meshery manages entities in accordance with their specific capabilities. This field explicitly identifies those capabilities largely by what actions a given component supports; e.g. metric-scrape, sub-interface, and so on. This field is extensible. Entities may define a broad array of capabilities, which are in-turn dynamically interpretted by Meshery for full lifecycle management.",
"additionalProperties": false,
Expand Down
2 changes: 1 addition & 1 deletion schemas/constructs/v1alpha3/relationship.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "https://schemas.meshery.io/relationship.json",
"$id": "https://schemas.meshery.io/v1alpha3/relationship.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Relationships define the nature of interaction between interconnected components in Meshery. The combination of relationship properties kind, type, and subtype characterize various genealogical relations among and between components. Relationships have selectors, selector sets, metadata, and optional parameters. Learn more at https://docs.meshery.io/concepts/logical/relationships.",
"required": [
Expand Down
2 changes: 1 addition & 1 deletion schemas/constructs/v1beta1/category/category.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "https://schemas.meshery.io/category.json",
"$id": "https://schemas.meshery.io/v1beta1/category/category.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "Category of the model.",
Expand Down
2 changes: 1 addition & 1 deletion schemas/constructs/v1beta1/component/component.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "https://schemas.meshery.io/component.json",
"$id": "https://schemas.meshery.io/v1beta1/component/component.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Components are reusable building blocks for depicting capabilities defined within models. Learn more at https://docs.meshery.io/concepts/components",
"additionalProperties": false,
Expand Down
2 changes: 1 addition & 1 deletion schemas/constructs/v1beta1/connection.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "https://schemas.meshery.io/component.json",
"$id": "https://schemas.meshery.io/v1beta1/connection.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Meshery Connections are managed and unmanaged resources that either through discovery or manual entry are tracked by Meshery. Learn more at https://docs.meshery.io/concepts/logical/connections",
"additionalProperties": false,
Expand Down
2 changes: 1 addition & 1 deletion schemas/constructs/v1beta1/model/model.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "https://schemas.meshery.io/model.json",
"$id": "https://schemas.meshery.io/v1beta1/model/model.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Meshery Models serve as a portable unit of packaging to define managed entities, their relationships, and capabilities.",
"additionalProperties": false,
Expand Down
2 changes: 1 addition & 1 deletion schemas/constructs/v1beta1/subcategory/subcategory.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "https://schemas.meshery.io/category.json",
"$id": "https://schemas.meshery.io/v1beta1/subcategory/subcategory.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "string",
"title": "SubCategory",
Expand Down
26 changes: 13 additions & 13 deletions typescript/constructs/core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,40 @@
/**
* A string starting with an alphanumeric character. Spaces and hyphens allowed.
*
* This interface was referenced by `CoreJson`'s JSON-Schema
* This interface was referenced by `HttpsSchemasMesheryIoCoreJson`'s JSON-Schema
* via the `definition` "inputString".
Comment on lines +11 to 12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider aliasing HttpsSchemasMesheryIoCoreJson to something shorter, as it's used repeatedly. The same applies to other interfaces in this file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gemini-code-assist, will you suggest how to create an alias?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a couple of ways to create an alias in TypeScript. One common approach is to use a type alias. Here's how you could apply that to HttpsSchemasMesheryIoCoreJson:

type CoreJson = HttpsSchemasMesheryIoCoreJson;

You would place this line at the top of the core.d.ts file. Then, you can use CoreJson throughout the file as a shorthand for HttpsSchemasMesheryIoCoreJson. This improves readability, especially when the type is used repeatedly.

Another approach, if HttpsSchemasMesheryIoCoreJson is an interface, you could use interface extension:

interface CoreJson extends HttpsSchemasMesheryIoCoreJson {}

However, this approach is less about creating a simple alias and more about creating a new interface that inherits from the original. For the purpose of shortening the name, a type alias is generally more appropriate.

Suggested change
* This interface was referenced by `HttpsSchemasMesheryIoCoreJson`'s JSON-Schema
* via the `definition` "inputString".
type CoreJson = HttpsSchemasMesheryIoCoreJson;

*/
export type InputString = string;
/**
* API version of the object
*
* This interface was referenced by `CoreJson`'s JSON-Schema
* This interface was referenced by `HttpsSchemasMesheryIoCoreJson`'s JSON-Schema
* via the `definition` "versionString".
*/
export type VersionString = string;
/**
* A valid semantic version string between 5 and 256 characters. The pattern allows for a major.minor.patch version followed by an optional pre-release tag like '-alpha' or '-beta.2' and an optional build metadata tag like '+build.1.
*
* This interface was referenced by `CoreJson`'s JSON-Schema
* This interface was referenced by `HttpsSchemasMesheryIoCoreJson`'s JSON-Schema
* via the `definition` "semverString".
*/
export type SemverString = string;
/**
* A Universally Unique Identifier used to uniquely identify entites in Meshery. The UUID core defintion is used across different schemas.
*
* This interface was referenced by `CoreJson`'s JSON-Schema
* This interface was referenced by `HttpsSchemasMesheryIoCoreJson`'s JSON-Schema
* via the `definition` "uuid".
*/
export type Uuid = string;
/**
* This interface was referenced by `CoreJson`'s JSON-Schema
* This interface was referenced by `HttpsSchemasMesheryIoCoreJson`'s JSON-Schema
* via the `definition` "time".
*/
export type Time = string;
/**
* The shape of the node’s body. Note that each shape fits within the specified width and height, and so you may have to adjust width and height if you desire an equilateral shape (i.e. width !== height for several equilateral shapes)
*
* This interface was referenced by `CoreJson`'s JSON-Schema
* This interface was referenced by `HttpsSchemasMesheryIoCoreJson`'s JSON-Schema
* via the `definition` "shape".
*/
export type Shape =
Expand Down Expand Up @@ -74,7 +74,7 @@ export type Shape =
/**
* Visualization styles for a relationship
*
* This interface was referenced by `CoreJson`'s JSON-Schema
* This interface was referenced by `HttpsSchemasMesheryIoCoreJson`'s JSON-Schema
* via the `definition` "edgeStyles".
*/
export type EdgeStyles = Styles & {
Expand Down Expand Up @@ -167,7 +167,7 @@ export type EdgeStyles = Styles & {
/**
* Visualization styles for a component
*
* This interface was referenced by `CoreJson`'s JSON-Schema
* This interface was referenced by `HttpsSchemasMesheryIoCoreJson`'s JSON-Schema
* via the `definition` "componentStyles".
*/
export type ComponentStyles = Styles & {
Expand Down Expand Up @@ -368,14 +368,14 @@ export type ComponentStyles = Styles & {
[k: string]: unknown;
};
/**
* This interface was referenced by `CoreJson`'s JSON-Schema
* This interface was referenced by `HttpsSchemasMesheryIoCoreJson`'s JSON-Schema
* via the `definition` "relationshipStyles".
*/
export type RelationshipStyles = EdgeStyles | Styles1;
/**
* An resolved alias is an component that acts as an ref/pointer to a field in another component, resolvedAlias are aware of there immediate parents and completely resolved parents also
*
* This interface was referenced by `CoreJson`'s JSON-Schema
* This interface was referenced by `HttpsSchemasMesheryIoCoreJson`'s JSON-Schema
* via the `definition` "ResolvedAlias".
*/
export type ResolvedAlias = NonResolvedAlias & {
Expand All @@ -387,13 +387,13 @@ export type ResolvedAlias = NonResolvedAlias & {
/**
* Reusable core schema elements
*/
export interface CoreJson {
export interface HttpsSchemasMesheryIoCoreJson {
[k: string]: unknown;
}
/**
* Common styles for all entities
*
* This interface was referenced by `CoreJson`'s JSON-Schema
* This interface was referenced by `HttpsSchemasMesheryIoCoreJson`'s JSON-Schema
* via the `definition` "styles".
*/
export interface Styles {
Expand Down Expand Up @@ -540,7 +540,7 @@ export interface Styles1 {
/**
* An alias is an component that acts as an ref/pointer to a field in another component, nonResolvedAlias are not aware of there immediate parents
*
* This interface was referenced by `CoreJson`'s JSON-Schema
* This interface was referenced by `HttpsSchemasMesheryIoCoreJson`'s JSON-Schema
* via the `definition` "NonResolvedAlias".
*/
export interface NonResolvedAlias {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const schema = {
"components": {
"schemas": {
"Capability": {
"$id": "https://schemas.meshery.io/capability.json",
"$id": "https://schemas.meshery.io/v1alpha1/capability/capability.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Meshery manages entities in accordance with their specific capabilities. This field explicitly identifies those capabilities largely by what actions a given component supports; e.g. metric-scrape, sub-interface, and so on. This field is extensible. Entities may define a broad array of capabilities, which are in-turn dynamically interpretted by Meshery for full lifecycle management.",
"additionalProperties": false,
Expand Down
2 changes: 1 addition & 1 deletion typescript/constructs/v1alpha1/capability/capability.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* Meshery manages entities in accordance with their specific capabilities. This field explicitly identifies those capabilities largely by what actions a given component supports; e.g. metric-scrape, sub-interface, and so on. This field is extensible. Entities may define a broad array of capabilities, which are in-turn dynamically interpretted by Meshery for full lifecycle management.
*/
export interface HttpsSchemasMesheryIoCapabilityJson {
export interface HttpsSchemasMesheryIoV1Alpha1CapabilityCapabilityJson {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider aliasing HttpsSchemasMesheryIoV1Alpha1CapabilityCapabilityJson to something shorter, as it's used repeatedly. The same applies to other interfaces in this file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To Gemini's point, is this interface name auto-generated (something out of our direct control) or something that we might easily shorten, e.g. v1Alpha1Capability?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the interface name is auto-generated from the JSON schema file name. Shortening it to V1Alpha1Capability would improve readability without losing clarity. This change would need to be reflected wherever the interface is used.

Suggested change
export interface HttpsSchemasMesheryIoV1Alpha1CapabilityCapabilityJson {
export interface V1Alpha1Capability {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, wow, it can even respond to the messages 😮

Right all typescript in this pr is auto generated.


To the point that it would be nice to have this autogeneration in ci, so that pr will not have this load.
I do not even know if this typescript is related to current changes in schema, or somebody just forgot to run

make generate-types on their pr

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, right, it is related.

The name is generated from $id
$id was "https://schemas.meshery.io/v1alpha1/capability.json"

and now $id is "https://schemas.meshery.io/v1alpha1/capability/capability.json"

wondering if it means some updates will be required on frontend 🤔 ?
@leecalcote @aabidsofi19

/**
* Specifies the version of the schema to which the capability definition conforms.
*/
Expand Down
36 changes: 18 additions & 18 deletions typescript/constructs/v1alpha2/relationship.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export type SubCategory =
| "Video Conferencing";
export type From = {
kind?: string;
model?: HttpsSchemasMesheryIoModelJson1;
model?: HttpsSchemasMesheryIoV1Beta1ModelModelJson1;
/**
* A valid semantic version string between 5 and 256 characters. The pattern allows for a major.minor.patch version followed by an optional pre-release tag like '-alpha' or '-beta.2' and an optional build metadata tag like '+build.1.
*/
Expand All @@ -82,7 +82,7 @@ export type From = {
}[];
export type To = {
kind?: string;
model?: HttpsSchemasMesheryIoModelJson2;
model?: HttpsSchemasMesheryIoV1Beta1ModelModelJson2;
/**
* A valid semantic version string between 5 and 256 characters. The pattern allows for a major.minor.patch version followed by an optional pre-release tag like '-alpha' or '-beta.2' and an optional build metadata tag like '+build.1.
*/
Expand Down Expand Up @@ -144,7 +144,7 @@ export interface HttpsSchemasMesheryIoRelationshipJson {
description?: string;
[k: string]: unknown;
};
model: HttpsSchemasMesheryIoModelJson;
model: HttpsSchemasMesheryIoV1Beta1ModelModelJson;
/**
* Selectors are organized as an array, with each item containing a distinct set of selectors that share a common functionality. This structure allows for flexibility in defining relationships, even when different components are involved.
*/
Expand All @@ -170,7 +170,7 @@ export interface HttpsSchemasMesheryIoRelationshipJson {
/**
* Model of the Relationship.
*/
export interface HttpsSchemasMesheryIoModelJson {
export interface HttpsSchemasMesheryIoV1Beta1ModelModelJson {
/**
* Uniquely identifies the entity (i.e. component) as defined in a declaration (i.e. design).
*/
Expand Down Expand Up @@ -203,7 +203,7 @@ export interface HttpsSchemasMesheryIoModelJson {
* - ignored: model is unavailable for use for all users of this Meshery Server.
*/
status: "ignored" | "enabled" | "duplicate";
registrant: HttpsSchemasMesheryIoComponentJson;
registrant: HttpsSchemasMesheryIoV1Beta1ConnectionJson;
/**
* ID of the registrant.
*/
Expand All @@ -212,7 +212,7 @@ export interface HttpsSchemasMesheryIoModelJson {
* ID of the category.
*/
categoryId: string;
category: HttpsSchemasMesheryIoCategoryJson;
category: HttpsSchemasMesheryIoV1Beta1CategoryCategoryJson;
subCategory: SubCategory;
/**
* Metadata containing additional information associated with the model.
Expand All @@ -221,7 +221,7 @@ export interface HttpsSchemasMesheryIoModelJson {
/**
* Capabilities associated with the model
*/
capabilities?: HttpsSchemasMesheryIoCapabilityJson[];
capabilities?: HttpsSchemasMesheryIoV1Alpha1CapabilityCapabilityJson[];
/**
* Indicates whether the model and its entities should be treated as deployable entities or as logical representations.
*/
Expand Down Expand Up @@ -293,7 +293,7 @@ export interface HttpsSchemasMesheryIoModelJson {
/**
* Meshery Connections are managed and unmanaged resources that either through discovery or manual entry are tracked by Meshery. Learn more at https://docs.meshery.io/concepts/logical/connections
*/
export interface HttpsSchemasMesheryIoComponentJson {
export interface HttpsSchemasMesheryIoV1Beta1ConnectionJson {
/**
* ID
*/
Expand Down Expand Up @@ -344,7 +344,7 @@ export interface HttpsSchemasMesheryIoComponentJson {
/**
* Category of the model.
*/
export interface HttpsSchemasMesheryIoCategoryJson {
export interface HttpsSchemasMesheryIoV1Beta1CategoryCategoryJson {
/**
* A Universally Unique Identifier used to uniquely identify entites in Meshery. The UUID core defintion is used across different schemas.
*/
Expand Down Expand Up @@ -376,7 +376,7 @@ export interface HttpsSchemasMesheryIoCategoryJson {
/**
* Meshery manages entities in accordance with their specific capabilities. This field explicitly identifies those capabilities largely by what actions a given component supports; e.g. metric-scrape, sub-interface, and so on. This field is extensible. Entities may define a broad array of capabilities, which are in-turn dynamically interpretted by Meshery for full lifecycle management.
*/
export interface HttpsSchemasMesheryIoCapabilityJson {
export interface HttpsSchemasMesheryIoV1Alpha1CapabilityCapabilityJson {
/**
* Specifies the version of the schema to which the capability definition conforms.
*/
Expand Down Expand Up @@ -437,7 +437,7 @@ export interface Model {
/**
* Model of the component. Learn more at https://docs.meshery.io/concepts/models
*/
export interface HttpsSchemasMesheryIoModelJson1 {
export interface HttpsSchemasMesheryIoV1Beta1ModelModelJson1 {
/**
* Uniquely identifies the entity (i.e. component) as defined in a declaration (i.e. design).
*/
Expand Down Expand Up @@ -470,7 +470,7 @@ export interface HttpsSchemasMesheryIoModelJson1 {
* - ignored: model is unavailable for use for all users of this Meshery Server.
*/
status: "ignored" | "enabled" | "duplicate";
registrant: HttpsSchemasMesheryIoComponentJson;
registrant: HttpsSchemasMesheryIoV1Beta1ConnectionJson;
/**
* ID of the registrant.
*/
Expand All @@ -479,7 +479,7 @@ export interface HttpsSchemasMesheryIoModelJson1 {
* ID of the category.
*/
categoryId: string;
category: HttpsSchemasMesheryIoCategoryJson;
category: HttpsSchemasMesheryIoV1Beta1CategoryCategoryJson;
subCategory: SubCategory;
/**
* Metadata containing additional information associated with the model.
Expand All @@ -488,7 +488,7 @@ export interface HttpsSchemasMesheryIoModelJson1 {
/**
* Capabilities associated with the model
*/
capabilities?: HttpsSchemasMesheryIoCapabilityJson[];
capabilities?: HttpsSchemasMesheryIoV1Alpha1CapabilityCapabilityJson[];
/**
* Indicates whether the model and its entities should be treated as deployable entities or as logical representations.
*/
Expand Down Expand Up @@ -560,7 +560,7 @@ export interface HttpsSchemasMesheryIoModelJson1 {
/**
* Model of the component. Learn more at https://docs.meshery.io/concepts/models
*/
export interface HttpsSchemasMesheryIoModelJson2 {
export interface HttpsSchemasMesheryIoV1Beta1ModelModelJson2 {
/**
* Uniquely identifies the entity (i.e. component) as defined in a declaration (i.e. design).
*/
Expand Down Expand Up @@ -593,7 +593,7 @@ export interface HttpsSchemasMesheryIoModelJson2 {
* - ignored: model is unavailable for use for all users of this Meshery Server.
*/
status: "ignored" | "enabled" | "duplicate";
registrant: HttpsSchemasMesheryIoComponentJson;
registrant: HttpsSchemasMesheryIoV1Beta1ConnectionJson;
/**
* ID of the registrant.
*/
Expand All @@ -602,7 +602,7 @@ export interface HttpsSchemasMesheryIoModelJson2 {
* ID of the category.
*/
categoryId: string;
category: HttpsSchemasMesheryIoCategoryJson;
category: HttpsSchemasMesheryIoV1Beta1CategoryCategoryJson;
subCategory: SubCategory;
/**
* Metadata containing additional information associated with the model.
Expand All @@ -611,7 +611,7 @@ export interface HttpsSchemasMesheryIoModelJson2 {
/**
* Capabilities associated with the model
*/
capabilities?: HttpsSchemasMesheryIoCapabilityJson[];
capabilities?: HttpsSchemasMesheryIoV1Alpha1CapabilityCapabilityJson[];
/**
* Indicates whether the model and its entities should be treated as deployable entities or as logical representations.
*/
Expand Down
2 changes: 1 addition & 1 deletion typescript/constructs/v1alpha3/relationship.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* Relationships define the nature of interaction between interconnected components in Meshery. The combination of relationship properties kind, type, and subtype characterize various genealogical relations among and between components. Relationships have selectors, selector sets, metadata, and optional parameters. Learn more at https://docs.meshery.io/concepts/logical/relationships.
*/
export interface HttpsSchemasMesheryIoRelationshipJson {
export interface HttpsSchemasMesheryIoV1Alpha3RelationshipJson {
/**
* Uniquely identifies the entity (i.e. component) as defined in a declaration (i.e. design).
*/
Expand Down
Loading