From 385fcb19b3e8daf984f630b9191b8aad30fd0cce Mon Sep 17 00:00:00 2001 From: Jacob Wejendorp Date: Wed, 26 Jun 2024 10:12:42 +0200 Subject: [PATCH] fix: support multiple icons for assets [CORE-3097] (#60) Allows using different icons for light and dark theme, and adds it to all assets. --- packages/go/model/model.go | 429 ++++++++++-------- .../abstracts/core/block-definition.json | 14 +- .../concepts/core/block-type-executable.json | 6 + .../concepts/core/block-type-operator.json | 6 + .../go/schemas/concepts/core/block-type.json | 6 + .../concepts/core/deployment-target.json | 12 + .../concepts/core/language-target.json | 6 + .../core/resource-type-extension.json | 6 + .../concepts/core/resource-type-internal.json | 6 + .../concepts/core/resource-type-operator.json | 6 + .../go/schemas/types/core/icon-value.json | 7 + .../schemas/entity/BlockDefinitionSpec.java | 2 + .../entity/BlockTypeExecutableSpec.java | 2 + .../schemas/entity/BlockTypeOperatorSpec.java | 2 + .../kapeta/schemas/entity/BlockTypeSpec.java | 2 + .../entity/DeploymentTargetOperator.java | 4 + .../schemas/entity/DeploymentTargetSpec.java | 2 + .../com/kapeta/schemas/entity/IconValue.java | 1 + .../schemas/entity/LanguageTargetSpec.java | 2 + .../entity/ResourceTypeExtensionSpec.java | 2 + .../entity/ResourceTypeInternalSpec.java | 2 + .../entity/ResourceTypeOperatorSpec.java | 2 + .../abstracts/core/block-definition.json | 6 + .../concepts/core/block-type-executable.json | 6 + .../concepts/core/block-type-operator.json | 6 + .../schemas/concepts/core/block-type.json | 6 + .../concepts/core/deployment-target.json | 12 + .../concepts/core/language-target.json | 6 + .../core/resource-type-extension.json | 6 + .../concepts/core/resource-type-internal.json | 6 + .../concepts/core/resource-type-operator.json | 6 + .../abstracts/core/block-definition.json | 6 + .../concepts/core/block-type-executable.json | 6 + .../concepts/core/block-type-operator.json | 6 + .../npm/schemas/concepts/core/block-type.json | 6 + .../concepts/core/deployment-target.json | 12 + .../concepts/core/language-target.json | 6 + .../core/resource-type-extension.json | 6 + .../concepts/core/resource-type-internal.json | 6 + .../concepts/core/resource-type-operator.json | 6 + packages/npm/src/types/index.ts | 39 +- 41 files changed, 472 insertions(+), 214 deletions(-) diff --git a/packages/go/model/model.go b/packages/go/model/model.go index a43dfc0..8b0db91 100644 --- a/packages/go/model/model.go +++ b/packages/go/model/model.go @@ -2,76 +2,78 @@ package model type BlockDefinition struct { Attachments []Attachment `json:"attachments,omitempty"` - Kind string `json:"kind"` - Metadata Metadata `json:"metadata"` - Spec BlockDefinitionSpec `json:"spec"` + Kind string `json:"kind"` + Metadata Metadata `json:"metadata"` + Spec BlockDefinitionSpec `json:"spec"` } // An attachment is a file that is associated with a definition. type Attachment struct { - Content AttachmentContent `json:"content"` // The content of the file. - ContentType *string `json:"contentType,omitempty"`// The MIME type of the file. - Filename string `json:"filename"` + Content AttachmentContent `json:"content"` // The content of the file. + ContentType *string `json:"contentType,omitempty"` // The MIME type of the file. + Filename string `json:"filename"` } // The content of the file. type AttachmentContent struct { Format AttachmentContentFormat `json:"format"` - Value string `json:"value"` + Value string `json:"value"` } type Metadata struct { Description *string `json:"description,omitempty"` - Name string `json:"name"` - Title *string `json:"title,omitempty"` - Visibility *string `json:"visibility,omitempty"` + Name string `json:"name"` + Title *string `json:"title,omitempty"` + Visibility *string `json:"visibility,omitempty"` } type BlockDefinitionSpec struct { - Configuration *EntityList `json:"configuration,omitempty"` - Consumers []ConsumerElement `json:"consumers,omitempty"` - Entities *EntityList `json:"entities,omitempty"` - Icon *IconValue `json:"icon,omitempty"` - Providers []ConsumerElement `json:"providers,omitempty"` - Target *LanguageTargetReference `json:"target,omitempty"` + Configuration *EntityList `json:"configuration,omitempty"` + Consumers []ConsumerElement `json:"consumers,omitempty"` + Entities *EntityList `json:"entities,omitempty"` + // Deprecated: use icons instead + Icon *IconValue `json:"icon,omitempty"` + Icons *[]IconValue `json:"icons,omitempty"` + Providers []ConsumerElement `json:"providers,omitempty"` + Target *LanguageTargetReference `json:"target,omitempty"` } type EntityList struct { Source *SourceCode `json:"source,omitempty"` - Types []Entity `json:"types,omitempty"` + Types []Entity `json:"types,omitempty"` } type SourceCode struct { - Type string `json:"type"` - Value string `json:"value"` + Type string `json:"type"` + Value string `json:"value"` Version *string `json:"version,omitempty"` } type Entity struct { Description *string `json:"description,omitempty"` - Name string `json:"name"` - Properties map[string]EntityProperty `json:"properties,omitempty"` - Type EntityType `json:"type"` - Values []string `json:"values,omitempty"` + Name string `json:"name"` + Properties map[string]EntityProperty `json:"properties,omitempty"` + Type EntityType `json:"type"` + Values []string `json:"values,omitempty"` } type EntityProperty struct { DefaultValue *string `json:"defaultValue,omitempty"` - Description *string `json:"description,omitempty"` - Format *string `json:"format,omitempty"` - Global *bool `json:"global,omitempty"` - Primary *bool `json:"primary,omitempty"` - Ref *string `json:"ref,omitempty"` - Required *bool `json:"required,omitempty"` - Secret *bool `json:"secret,omitempty"` - Sensitive *bool `json:"sensitive,omitempty"` - Type *string `json:"type,omitempty"` + Description *string `json:"description,omitempty"` + Format *string `json:"format,omitempty"` + Global *bool `json:"global,omitempty"` + Primary *bool `json:"primary,omitempty"` + Ref *string `json:"ref,omitempty"` + Required *bool `json:"required,omitempty"` + Secret *bool `json:"secret,omitempty"` + Sensitive *bool `json:"sensitive,omitempty"` + Type *string `json:"type,omitempty"` } type ConsumerElement struct { - Kind string `json:"kind"` + Kind string `json:"kind"` Metadata ResourceMetadata `json:"metadata"` - Spec map[string]interface{} `json:"spec"` + Spec map[string]interface{} `json:"spec"` } type ResourceMetadata struct { @@ -79,24 +81,24 @@ type ResourceMetadata struct { } type IconValue struct { - Type IconType `json:"type"` + Type IconType `json:"type"` Value string `json:"value"` } type LanguageTargetReference struct { - Kind string `json:"kind"` + Kind string `json:"kind"` Options map[string]interface{} `json:"options,omitempty"` } type Concept struct { - Kind string `json:"kind"` + Kind string `json:"kind"` Metadata Metadata `json:"metadata"` - Spec ConceptSpec `json:"spec"` + Spec ConceptSpec `json:"spec"` } type ConceptSpec struct { Dependencies []Dependency `json:"dependencies,omitempty"` - Schema map[string]interface{} `json:"schema"` + Schema map[string]interface{} `json:"schema"` } type Dependency struct { @@ -111,49 +113,51 @@ type Dependency struct { // They are also typically distributed as a downloadable artifact - like a setup file or a // package. type BlockTypeExecutable struct { - Kind string `json:"kind"` + Kind string `json:"kind"` Metadata Metadata `json:"metadata"` - Spec BlockTypeExecutableSpec `json:"spec"` + Spec BlockTypeExecutableSpec `json:"spec"` } type BlockTypeExecutableSpec struct { - Configuration *ConfigurationSchema `json:"configuration,omitempty"` - Dependencies []Dependency `json:"dependencies,omitempty"` - Icon *IconValue `json:"icon,omitempty"` - Schema map[string]interface{} `json:"schema"` - Versioning []Versioning `json:"versioning,omitempty"` + Configuration *ConfigurationSchema `json:"configuration,omitempty"` + Dependencies []Dependency `json:"dependencies,omitempty"` + // Deprecated: use icons instead + Icon *IconValue `json:"icon,omitempty"` + Icons *[]IconValue `json:"icons,omitempty"` + Schema map[string]interface{} `json:"schema"` + Versioning []Versioning `json:"versioning,omitempty"` } type ConfigurationSchema struct { DefaultValue map[string]interface{} `json:"defaultValue,omitempty"` - Schema map[string]interface{} `json:"schema"` - UISchema map[string]map[string]interface{} `json:"uiSchema,omitempty"` + Schema map[string]interface{} `json:"schema"` + UISchema map[string]map[string]interface{} `json:"uiSchema,omitempty"` } type Versioning struct { Increment VersioningIncrementType `json:"increment"` - On []VersioningChangeType `json:"on"` - Paths []string `json:"paths"` + On []VersioningChangeType `json:"on"` + Paths []string `json:"paths"` } type BlockTypeGroup struct { - Kind string `json:"kind"` + Kind string `json:"kind"` Metadata Metadata `json:"metadata"` - Spec BlockTypeGroupSpec `json:"spec"` + Spec BlockTypeGroupSpec `json:"spec"` } type BlockTypeGroupSpec struct { - Blocks []BlockInstance `json:"blocks"` + Blocks []BlockInstance `json:"blocks"` Configuration *EntityList `json:"configuration,omitempty"` - Connections []Connection `json:"connections"` + Connections []Connection `json:"connections"` } type BlockInstance struct { - Block AssetReference `json:"block"` + Block AssetReference `json:"block"` DefaultConfiguration map[string]interface{} `json:"defaultConfiguration,omitempty"` - Dimensions Dimensions `json:"dimensions"` - Id string `json:"id"` - Name string `json:"name"` + Dimensions Dimensions `json:"dimensions"` + Id string `json:"id"` + Name string `json:"name"` } type AssetReference struct { @@ -162,20 +166,20 @@ type AssetReference struct { type Dimensions struct { Height float64 `json:"height"` - Left float64 `json:"left"` - Top float64 `json:"top"` - Width float64 `json:"width"` + Left float64 `json:"left"` + Top float64 `json:"top"` + Width float64 `json:"width"` } type Connection struct { - Consumer Endpoint `json:"consumer"` + Consumer Endpoint `json:"consumer"` Mapping map[string]interface{} `json:"mapping,omitempty"` - Port *Port `json:"port,omitempty"` - Provider Endpoint `json:"provider"` + Port *Port `json:"port,omitempty"` + Provider Endpoint `json:"provider"` } type Endpoint struct { - BlockId string `json:"blockId"` + BlockId string `json:"blockId"` ResourceName string `json:"resourceName"` } @@ -191,34 +195,36 @@ type Port struct { // Message queues, for example, are a good example of something that could be an operator // block. type BlockTypeOperator struct { - Kind string `json:"kind"` + Kind string `json:"kind"` Metadata Metadata `json:"metadata"` - Spec BlockTypeOperatorSpec `json:"spec"` + Spec BlockTypeOperatorSpec `json:"spec"` } type BlockTypeOperatorSpec struct { - Configuration *ConfigurationSchema `json:"configuration,omitempty"` - Dependencies []Dependency `json:"dependencies,omitempty"` - Icon *IconValue `json:"icon,omitempty"` - Local LocalInstance `json:"local"` - Ports OperatorPorts `json:"ports"` // Ports that the operator will expose.; The primary port is the one that will be used to access the operator. - Schema map[string]interface{} `json:"schema"` - Type BlockOperatorType `json:"type"` // Determines the type of operator.; "logical" means the operator is a logical component and won't necessarily actually create; a service.; "instance" means the operator is an instance and will create a service and be connectable; to one or more operators. - Versioning []Versioning `json:"versioning,omitempty"` + Configuration *ConfigurationSchema `json:"configuration,omitempty"` + Dependencies []Dependency `json:"dependencies,omitempty"` + // Deprecated: use icons instead + Icon *IconValue `json:"icon,omitempty"` + Icons *[]IconValue `json:"icons,omitempty"` + Local LocalInstance `json:"local"` + Ports OperatorPorts `json:"ports"` // Ports that the operator will expose.; The primary port is the one that will be used to access the operator. + Schema map[string]interface{} `json:"schema"` + Type BlockOperatorType `json:"type"` // Determines the type of operator.; "logical" means the operator is a logical component and won't necessarily actually create; a service.; "instance" means the operator is an instance and will create a service and be connectable; to one or more operators. + Versioning []Versioning `json:"versioning,omitempty"` } type LocalInstance struct { Credentials map[string]interface{} `json:"credentials,omitempty"` - Env map[string]string `json:"env,omitempty"` - Health *LocalInstanceHealth `json:"health,omitempty"` - Image string `json:"image"` - Mounts map[string]string `json:"mounts,omitempty"` - Ports map[string]LocalInstancePort `json:"ports"` - Singleton *bool `json:"singleton,omitempty"` + Env map[string]string `json:"env,omitempty"` + Health *LocalInstanceHealth `json:"health,omitempty"` + Image string `json:"image"` + Mounts map[string]string `json:"mounts,omitempty"` + Ports map[string]LocalInstancePort `json:"ports"` + Singleton *bool `json:"singleton,omitempty"` } type LocalInstanceHealth struct { - Cmd string `json:"cmd"` + Cmd string `json:"cmd"` Interval *float64 `json:"interval,omitempty"` } @@ -238,79 +244,85 @@ type OperatorPorts struct { // The expected output of any such block is a docker image that can be deployed to a // kubernetes cluster. type BlockType struct { - Kind string `json:"kind"` + Kind string `json:"kind"` Metadata Metadata `json:"metadata"` - Spec BlockTypeSpec `json:"spec"` + Spec BlockTypeSpec `json:"spec"` } type BlockTypeSpec struct { - DefaultPort *Port `json:"defaultPort,omitempty"` - Dependencies []Dependency `json:"dependencies,omitempty"` - Icon *IconValue `json:"icon,omitempty"` - Schema map[string]interface{} `json:"schema"` - Versioning []Versioning `json:"versioning,omitempty"` + DefaultPort *Port `json:"defaultPort,omitempty"` + Dependencies []Dependency `json:"dependencies,omitempty"` + // Deprecated: use icons instead + Icon *IconValue `json:"icon,omitempty"` + Icons *[]IconValue `json:"icons,omitempty"` + Schema map[string]interface{} `json:"schema"` + Versioning []Versioning `json:"versioning,omitempty"` } type DeploymentTarget struct { - Kind string `json:"kind"` + Kind string `json:"kind"` Metadata Metadata `json:"metadata"` - Spec DeploymentTargetSpec `json:"spec"` + Spec DeploymentTargetSpec `json:"spec"` } type DeploymentTargetSpec struct { - Configuration *ConfigurationSchema `json:"configuration,omitempty"` - Icon *IconValue `json:"icon,omitempty"` - Operators map[string]DeploymentTargetOperator `json:"operators,omitempty"` - Service RemoteService `json:"service"` - Versioning []Versioning `json:"versioning,omitempty"` + Configuration *ConfigurationSchema `json:"configuration,omitempty"` + // Deprecated: use icons instead + Icon *IconValue `json:"icon,omitempty"` + Icons *[]IconValue `json:"icons,omitempty"` + Operators map[string]DeploymentTargetOperator `json:"operators,omitempty"` + Service RemoteService `json:"service"` + Versioning []Versioning `json:"versioning,omitempty"` } type DeploymentTargetOperator struct { - Color *ColorValue `json:"color,omitempty"` + Color *ColorValue `json:"color,omitempty"` Configuration *ConfigurationSchema `json:"configuration,omitempty"` - Description *string `json:"description,omitempty"` - Icon *IconValue `json:"icon,omitempty"` - Link *URLValue `json:"link,omitempty"` - Title string `json:"title"` + Description *string `json:"description,omitempty"` + // Deprecated: use icons instead + Icon *IconValue `json:"icon,omitempty"` + Icons *[]IconValue `json:"icons,omitempty"` + Link *URLValue `json:"link,omitempty"` + Title string `json:"title"` } type ColorValue struct { - Type ColorType `json:"type"` + Type ColorType `json:"type"` Value string `json:"value"` } type URLValue struct { - Type LinkType `json:"type"` + Type LinkType `json:"type"` Value string `json:"value"` } type RemoteService struct { APIVersion *string `json:"apiVersion,omitempty"` - URL *string `json:"url,omitempty"` + URL *string `json:"url,omitempty"` } type Deployment struct { - Kind string `json:"kind"` + Kind string `json:"kind"` Metadata DeploymentMetadata `json:"metadata"` - Spec DeploymentSpec `json:"spec"` + Spec DeploymentSpec `json:"spec"` } type DeploymentMetadata struct { - AssetId *string `json:"assetId,omitempty"` + AssetId *string `json:"assetId,omitempty"` Description *string `json:"description,omitempty"` - Name string `json:"name"` - Title *string `json:"title,omitempty"` - Visibility *string `json:"visibility,omitempty"` + Name string `json:"name"` + Title *string `json:"title,omitempty"` + Visibility *string `json:"visibility,omitempty"` } type DeploymentSpec struct { Configuration map[string]interface{} `json:"configuration,omitempty"` - Environment AssetReference `json:"environment"` - Insights InsightsSettings `json:"insights"` - Network []DeploymentNetworkConnection `json:"network"` - Plan AssetReference `json:"plan"` - Services []DeploymentServiceInstance `json:"services"` - Target DeploymentTargetReference `json:"target"` + Environment AssetReference `json:"environment"` + Insights InsightsSettings `json:"insights"` + Network []DeploymentNetworkConnection `json:"network"` + Plan AssetReference `json:"plan"` + Services []DeploymentServiceInstance `json:"services"` + Target DeploymentTargetReference `json:"target"` } type InsightsSettings struct { @@ -319,93 +331,95 @@ type InsightsSettings struct { type DeploymentNetworkConnection struct { Consumer DeploymentNetworkEndpoint `json:"consumer"` - Port Port `json:"port"` + Port Port `json:"port"` Provider DeploymentNetworkEndpoint `json:"provider"` - Type DeploymentNetworkConnectionType `json:"type"` + Type DeploymentNetworkConnectionType `json:"type"` } type DeploymentNetworkEndpoint struct { - Id string `json:"id"` + Id string `json:"id"` Resource *string `json:"resource,omitempty"` } type DeploymentServiceInstance struct { BlockDefinition *Kind `json:"blockDefinition,omitempty"` - Configuration map[string]interface{} `json:"configuration,omitempty"` - FallbackDNS string `json:"fallbackDNS"` - Id string `json:"id"` - Image *string `json:"image,omitempty"` - Kind string `json:"kind"` - Ref string `json:"ref"` - Title *string `json:"title,omitempty"` - Type DeploymentServiceInstanceType `json:"type"` + Configuration map[string]interface{} `json:"configuration,omitempty"` + FallbackDNS string `json:"fallbackDNS"` + Id string `json:"id"` + Image *string `json:"image,omitempty"` + Kind string `json:"kind"` + Ref string `json:"ref"` + Title *string `json:"title,omitempty"` + Type DeploymentServiceInstanceType `json:"type"` } type Kind struct { Attachments []Attachment `json:"attachments,omitempty"` - Kind string `json:"kind"` - Metadata Metadata `json:"metadata"` - Spec map[string]interface{} `json:"spec,omitempty"` + Kind string `json:"kind"` + Metadata Metadata `json:"metadata"` + Spec map[string]interface{} `json:"spec,omitempty"` } type DeploymentTargetReference struct { Image string `json:"image"` - Ref string `json:"ref"` + Ref string `json:"ref"` } type Environment struct { - Kind string `json:"kind"` + Kind string `json:"kind"` Metadata Metadata `json:"metadata"` - Spec EnvironmentSpec `json:"spec"` + Spec EnvironmentSpec `json:"spec"` } type EnvironmentSpec struct { - DeploymentTarget DeploymentTargetConfiguration `json:"deploymentTarget"` - Plan PlanConfiguration `json:"plan"` + DeploymentTarget DeploymentTargetConfiguration `json:"deploymentTarget"` + Plan PlanConfiguration `json:"plan"` Services []EnvironmentService `json:"services,omitempty"` } type DeploymentTargetConfiguration struct { Configuration map[string]interface{} `json:"configuration,omitempty"` - Ref string `json:"ref"` + Ref string `json:"ref"` } type PlanConfiguration struct { - Blocks []BlockInstanceConfiguration `json:"blocks"` + Blocks []BlockInstanceConfiguration `json:"blocks"` Configuration map[string]interface{} `json:"configuration,omitempty"` - Ref string `json:"ref"` + Ref string `json:"ref"` } type BlockInstanceConfiguration struct { Configuration map[string]interface{} `json:"configuration,omitempty"` - Id string `json:"id"` - Services []BlockServiceConfiguration `json:"services,omitempty"` + Id string `json:"id"` + Services []BlockServiceConfiguration `json:"services,omitempty"` } type BlockServiceConfiguration struct { ConsumerId string `json:"consumerId"` - Port Port `json:"port"` - ServiceId string `json:"serviceId"` + Port Port `json:"port"` + ServiceId string `json:"serviceId"` } type EnvironmentService struct { Configuration map[string]interface{} `json:"configuration,omitempty"` - Id string `json:"id"` - Kind string `json:"kind"` - Ref string `json:"ref"` - Title *string `json:"title,omitempty"` + Id string `json:"id"` + Kind string `json:"kind"` + Ref string `json:"ref"` + Title *string `json:"title,omitempty"` } type LanguageTarget struct { - Kind string `json:"kind"` - Metadata Metadata `json:"metadata"` + Kind string `json:"kind"` + Metadata Metadata `json:"metadata"` Spec *LanguageTargetSpec `json:"spec,omitempty"` } type LanguageTargetSpec struct { - Icon *IconValue `json:"icon,omitempty"` - Local LocalDevContainer `json:"local"` // if type is "docker" or empty - Local development container using a fixed docker image.; User code will be mounted into the container.; if type is "dockerfile" - Local development container using a Dockerfile. User code will; be built into the container. - Schema map[string]interface{} `json:"schema,omitempty"` + // Deprecated: use icons instead + Icon *IconValue `json:"icon,omitempty"` + Icons *[]IconValue `json:"icons,omitempty"` + Local LocalDevContainer `json:"local"` // if type is "docker" or empty - Local development container using a fixed docker image.; User code will be mounted into the container.; if type is "dockerfile" - Local development container using a Dockerfile. User code will; be built into the container. + Schema map[string]interface{} `json:"schema,omitempty"` Versioning []Versioning `json:"versioning,omitempty"` } @@ -414,17 +428,17 @@ type LanguageTargetSpec struct { // if type is "dockerfile" - Local development container using a Dockerfile. User code will // be built into the container. type LocalDevContainer struct { - Env []string `json:"Env,omitempty"` - Handlers *LocalDevContainerHandlers `json:"handlers,omitempty"` + Env []string `json:"Env,omitempty"` + Handlers *LocalDevContainerHandlers `json:"handlers,omitempty"` Healthcheck *string `json:"healthcheck,omitempty"` - HostConfig map[string]interface{} `json:"HostConfig,omitempty"` - Image *string `json:"image,omitempty"` - Labels map[string]interface{} `json:"Labels,omitempty"` - Options map[string]interface{} `json:"options,omitempty"` - Type *string `json:"type,omitempty"` - UserHome *string `json:"userHome,omitempty"` - WorkingDir *string `json:"workingDir,omitempty"` - File *string `json:"file,omitempty"` + HostConfig map[string]interface{} `json:"HostConfig,omitempty"` + Image *string `json:"image,omitempty"` + Labels map[string]interface{} `json:"Labels,omitempty"` + Options map[string]interface{} `json:"options,omitempty"` + Type *string `json:"type,omitempty"` + UserHome *string `json:"userHome,omitempty"` + WorkingDir *string `json:"workingDir,omitempty"` + File *string `json:"file,omitempty"` } type LocalDevContainerHandlers struct { @@ -432,85 +446,95 @@ type LocalDevContainerHandlers struct { } type Plan struct { - Kind string `json:"kind"` + Kind string `json:"kind"` Metadata Metadata `json:"metadata"` - Spec PlanSpec `json:"spec"` + Spec PlanSpec `json:"spec"` } type PlanSpec struct { - Blocks []BlockInstance `json:"blocks"` - Configuration *EntityList `json:"configuration,omitempty"` - Connections []Connection `json:"connections"` + Blocks []BlockInstance `json:"blocks"` + Configuration *EntityList `json:"configuration,omitempty"` + Connections []Connection `json:"connections"` DefaultConfiguration map[string]interface{} `json:"defaultConfiguration,omitempty"` } type ResourceTypeExtension struct { - Kind string `json:"kind"` + Kind string `json:"kind"` Metadata Metadata `json:"metadata"` - Spec ResourceTypeExtensionSpec `json:"spec"` + Spec ResourceTypeExtensionSpec `json:"spec"` } type ResourceTypeExtensionSpec struct { - Configuration *ConfigurationSchema `json:"configuration,omitempty"` - Icon *IconValue `json:"icon,omitempty"` - Ports []Port `json:"ports"` - Schema map[string]interface{} `json:"schema"` - Versioning []Versioning `json:"versioning,omitempty"` + Configuration *ConfigurationSchema `json:"configuration,omitempty"` + // Deprecated: use icons instead + Icon *IconValue `json:"icon,omitempty"` + Icons *[]IconValue `json:"icons,omitempty"` + Ports []Port `json:"ports"` + Schema map[string]interface{} `json:"schema"` + Versioning []Versioning `json:"versioning,omitempty"` } type ResourceTypeInternal struct { - Kind string `json:"kind"` + Kind string `json:"kind"` Metadata Metadata `json:"metadata"` - Spec ResourceTypeInternalSpec `json:"spec"` + Spec ResourceTypeInternalSpec `json:"spec"` } type ResourceTypeInternalSpec struct { - Configuration *ConfigurationSchema `json:"configuration,omitempty"` - Icon *IconValue `json:"icon,omitempty"` - Ports []Port `json:"ports"` - Schema map[string]interface{} `json:"schema,omitempty"` - Versioning []Versioning `json:"versioning,omitempty"` + Configuration *ConfigurationSchema `json:"configuration,omitempty"` + // Deprecated: use icons instead + Icon *IconValue `json:"icon,omitempty"` + Icons *[]IconValue `json:"icons,omitempty"` + Ports []Port `json:"ports"` + Schema map[string]interface{} `json:"schema,omitempty"` + Versioning []Versioning `json:"versioning,omitempty"` } type ResourceTypeOperator struct { - Kind string `json:"kind"` + Kind string `json:"kind"` Metadata Metadata `json:"metadata"` - Spec ResourceTypeOperatorSpec `json:"spec"` + Spec ResourceTypeOperatorSpec `json:"spec"` } type ResourceTypeOperatorSpec struct { - Color *ColorValue `json:"color,omitempty"` - Configuration *ConfigurationSchema `json:"configuration,omitempty"` - Icon *IconValue `json:"icon,omitempty"` - Local *LocalInstance `json:"local,omitempty"` - Ports []Port `json:"ports"` - Schema map[string]interface{} `json:"schema,omitempty"` - Versioning []Versioning `json:"versioning,omitempty"` + Color *ColorValue `json:"color,omitempty"` + Configuration *ConfigurationSchema `json:"configuration,omitempty"` + // Deprecated: use icons instead + Icon *IconValue `json:"icon,omitempty"` + Icons *[]IconValue `json:"icons,omitempty"` + Local *LocalInstance `json:"local,omitempty"` + Ports []Port `json:"ports"` + Schema map[string]interface{} `json:"schema,omitempty"` + Versioning []Versioning `json:"versioning,omitempty"` } type AttachmentContentFormat string + const ( AttachmentContentFormatURL AttachmentContentFormat = "url" - Base64 AttachmentContentFormat = "base64" - Base64Gzip AttachmentContentFormat = "base64-gzip" - Plain AttachmentContentFormat = "plain" + Base64 AttachmentContentFormat = "base64" + Base64Gzip AttachmentContentFormat = "base64-gzip" + Plain AttachmentContentFormat = "plain" ) type EntityType string + const ( - Dto EntityType = "dto" - Enum EntityType = "enum" - Model EntityType = "model" + Dto EntityType = "dto" + Enum EntityType = "enum" + Model EntityType = "model" Native EntityType = "native" ) type IconType string + const ( Fontawesome5 IconType = "fontawesome5" - PurpleURL IconType = "url" + PurpleURL IconType = "url" ) type VersioningIncrementType string + const ( Major VersioningIncrementType = "major" Minor VersioningIncrementType = "minor" @@ -518,6 +542,7 @@ const ( ) type VersioningChangeType string + const ( Create VersioningChangeType = "create" Delete VersioningChangeType = "delete" @@ -525,6 +550,7 @@ const ( ) type LocalInstancePortType string + const ( TCP LocalInstancePortType = "tcp" UDP LocalInstancePortType = "udp" @@ -536,29 +562,34 @@ const ( // "instance" means the operator is an instance and will create a service and be connectable // to one or more operators. type BlockOperatorType string + const ( Instance BlockOperatorType = "instance" - Logical BlockOperatorType = "logical" + Logical BlockOperatorType = "logical" ) type ColorType string + const ( Hex ColorType = "hex" ) type LinkType string + const ( FluffyURL LinkType = "url" ) type DeploymentNetworkConnectionType string + const ( DeploymentNetworkConnectionTypeService DeploymentNetworkConnectionType = "service" - Resource DeploymentNetworkConnectionType = "resource" + Resource DeploymentNetworkConnectionType = "resource" ) type DeploymentServiceInstanceType string + const ( DeploymentServiceInstanceTypeService DeploymentServiceInstanceType = "service" - Operator DeploymentServiceInstanceType = "operator" + Operator DeploymentServiceInstanceType = "operator" ) diff --git a/packages/go/schemas/abstracts/core/block-definition.json b/packages/go/schemas/abstracts/core/block-definition.json index 7ad7265..c24c24c 100644 --- a/packages/go/schemas/abstracts/core/block-definition.json +++ b/packages/go/schemas/abstracts/core/block-definition.json @@ -4,11 +4,7 @@ "title": "BlockDefinition", "type": "object", "additionalProperties": false, - "required": [ - "kind", - "metadata", - "spec" - ], + "required": ["kind", "metadata", "spec"], "properties": { "kind": { "type": "string" @@ -38,6 +34,12 @@ }, "icon": { "$ref": "/core/icon-value" + }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } } } }, @@ -48,4 +50,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/go/schemas/concepts/core/block-type-executable.json b/packages/go/schemas/concepts/core/block-type-executable.json index a891351..cb27f1e 100644 --- a/packages/go/schemas/concepts/core/block-type-executable.json +++ b/packages/go/schemas/concepts/core/block-type-executable.json @@ -30,6 +30,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "dependencies": { "$ref": "/core/dependencies" }, diff --git a/packages/go/schemas/concepts/core/block-type-operator.json b/packages/go/schemas/concepts/core/block-type-operator.json index 7135752..1ccfd2f 100644 --- a/packages/go/schemas/concepts/core/block-type-operator.json +++ b/packages/go/schemas/concepts/core/block-type-operator.json @@ -30,6 +30,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "dependencies": { "$ref": "/core/dependencies" }, diff --git a/packages/go/schemas/concepts/core/block-type.json b/packages/go/schemas/concepts/core/block-type.json index 40d0990..c779d3b 100644 --- a/packages/go/schemas/concepts/core/block-type.json +++ b/packages/go/schemas/concepts/core/block-type.json @@ -28,6 +28,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "dependencies": { "$ref": "/core/dependencies" }, diff --git a/packages/go/schemas/concepts/core/deployment-target.json b/packages/go/schemas/concepts/core/deployment-target.json index 1c761bb..c06cb51 100644 --- a/packages/go/schemas/concepts/core/deployment-target.json +++ b/packages/go/schemas/concepts/core/deployment-target.json @@ -27,6 +27,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "color": { "$ref": "/core/color-value" }, @@ -58,6 +64,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "service": { "$ref": "/core/remote-service" }, diff --git a/packages/go/schemas/concepts/core/language-target.json b/packages/go/schemas/concepts/core/language-target.json index 0914b1d..c36c64b 100644 --- a/packages/go/schemas/concepts/core/language-target.json +++ b/packages/go/schemas/concepts/core/language-target.json @@ -109,6 +109,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "local": { "title": "LocalDevContainer", "description": "if type is \"docker\" or empty - Local development container using a fixed docker image. User code will be mounted into the container.\nif type is \"dockerfile\" - Local development container using a Dockerfile. User code will be built into the container.", diff --git a/packages/go/schemas/concepts/core/resource-type-extension.json b/packages/go/schemas/concepts/core/resource-type-extension.json index c218f2b..a2cfcc3 100644 --- a/packages/go/schemas/concepts/core/resource-type-extension.json +++ b/packages/go/schemas/concepts/core/resource-type-extension.json @@ -31,6 +31,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "schema": { "$ref": "/core/schema" }, diff --git a/packages/go/schemas/concepts/core/resource-type-internal.json b/packages/go/schemas/concepts/core/resource-type-internal.json index 625b4c0..c0e0499 100644 --- a/packages/go/schemas/concepts/core/resource-type-internal.json +++ b/packages/go/schemas/concepts/core/resource-type-internal.json @@ -30,6 +30,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "configuration": { "$ref": "/core/configuration-schema" }, diff --git a/packages/go/schemas/concepts/core/resource-type-operator.json b/packages/go/schemas/concepts/core/resource-type-operator.json index cbbe0aa..8afaa5c 100644 --- a/packages/go/schemas/concepts/core/resource-type-operator.json +++ b/packages/go/schemas/concepts/core/resource-type-operator.json @@ -42,6 +42,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "ports": { "type": "array", "minItems": 1, diff --git a/packages/go/schemas/types/core/icon-value.json b/packages/go/schemas/types/core/icon-value.json index 5a33fab..20a9447 100644 --- a/packages/go/schemas/types/core/icon-value.json +++ b/packages/go/schemas/types/core/icon-value.json @@ -18,6 +18,13 @@ }, "value": { "type": "string" + }, + "theme": { + "type": "string", + "enum": [ + "light", + "dark" + ] } } } \ No newline at end of file diff --git a/packages/maven/src/main/java/com/kapeta/schemas/entity/BlockDefinitionSpec.java b/packages/maven/src/main/java/com/kapeta/schemas/entity/BlockDefinitionSpec.java index fb3ab21..3420370 100644 --- a/packages/maven/src/main/java/com/kapeta/schemas/entity/BlockDefinitionSpec.java +++ b/packages/maven/src/main/java/com/kapeta/schemas/entity/BlockDefinitionSpec.java @@ -7,7 +7,9 @@ public class BlockDefinitionSpec { private EntityList configuration; private List consumers; private EntityList entities; + @Deprecated private IconValue icon; + private List icons; private List providers; private LanguageTargetReference target; } diff --git a/packages/maven/src/main/java/com/kapeta/schemas/entity/BlockTypeExecutableSpec.java b/packages/maven/src/main/java/com/kapeta/schemas/entity/BlockTypeExecutableSpec.java index 1903857..544a12e 100644 --- a/packages/maven/src/main/java/com/kapeta/schemas/entity/BlockTypeExecutableSpec.java +++ b/packages/maven/src/main/java/com/kapeta/schemas/entity/BlockTypeExecutableSpec.java @@ -7,7 +7,9 @@ public class BlockTypeExecutableSpec { private ConfigurationSchema configuration; private List dependencies; + @Deprecated private IconValue icon; + private List icons; private Map schema; private List versioning; } diff --git a/packages/maven/src/main/java/com/kapeta/schemas/entity/BlockTypeOperatorSpec.java b/packages/maven/src/main/java/com/kapeta/schemas/entity/BlockTypeOperatorSpec.java index bbf8887..1cf77f2 100644 --- a/packages/maven/src/main/java/com/kapeta/schemas/entity/BlockTypeOperatorSpec.java +++ b/packages/maven/src/main/java/com/kapeta/schemas/entity/BlockTypeOperatorSpec.java @@ -7,7 +7,9 @@ public class BlockTypeOperatorSpec { private ConfigurationSchema configuration; private List dependencies; + @Deprecated private IconValue icon; + private List icons; private LocalInstance local; private OperatorPorts ports; private Map schema; diff --git a/packages/maven/src/main/java/com/kapeta/schemas/entity/BlockTypeSpec.java b/packages/maven/src/main/java/com/kapeta/schemas/entity/BlockTypeSpec.java index b7950d4..24c918b 100644 --- a/packages/maven/src/main/java/com/kapeta/schemas/entity/BlockTypeSpec.java +++ b/packages/maven/src/main/java/com/kapeta/schemas/entity/BlockTypeSpec.java @@ -7,7 +7,9 @@ public class BlockTypeSpec { private Port defaultPort; private List dependencies; + @Deprecated private IconValue icon; + private List icons; private Map schema; private List versioning; } diff --git a/packages/maven/src/main/java/com/kapeta/schemas/entity/DeploymentTargetOperator.java b/packages/maven/src/main/java/com/kapeta/schemas/entity/DeploymentTargetOperator.java index c6a2828..b7d6aae 100644 --- a/packages/maven/src/main/java/com/kapeta/schemas/entity/DeploymentTargetOperator.java +++ b/packages/maven/src/main/java/com/kapeta/schemas/entity/DeploymentTargetOperator.java @@ -1,11 +1,15 @@ package com.kapeta.schemas.entity; +import java.util.List; + @lombok.Data public class DeploymentTargetOperator { private ColorValue color; private ConfigurationSchema configuration; private String description; + @Deprecated private IconValue icon; + private List icons; private URLValue link; private String title; } diff --git a/packages/maven/src/main/java/com/kapeta/schemas/entity/DeploymentTargetSpec.java b/packages/maven/src/main/java/com/kapeta/schemas/entity/DeploymentTargetSpec.java index 805281e..a02a0f3 100644 --- a/packages/maven/src/main/java/com/kapeta/schemas/entity/DeploymentTargetSpec.java +++ b/packages/maven/src/main/java/com/kapeta/schemas/entity/DeploymentTargetSpec.java @@ -6,7 +6,9 @@ @lombok.Data public class DeploymentTargetSpec { private ConfigurationSchema configuration; + @Deprecated private IconValue icon; + private List icons; private Map operators; private RemoteService service; private List versioning; diff --git a/packages/maven/src/main/java/com/kapeta/schemas/entity/IconValue.java b/packages/maven/src/main/java/com/kapeta/schemas/entity/IconValue.java index 4fb777e..2be4a67 100644 --- a/packages/maven/src/main/java/com/kapeta/schemas/entity/IconValue.java +++ b/packages/maven/src/main/java/com/kapeta/schemas/entity/IconValue.java @@ -4,4 +4,5 @@ public class IconValue { private IconType type; private String value; + private String theme; } diff --git a/packages/maven/src/main/java/com/kapeta/schemas/entity/LanguageTargetSpec.java b/packages/maven/src/main/java/com/kapeta/schemas/entity/LanguageTargetSpec.java index a51faa6..41cdcd1 100644 --- a/packages/maven/src/main/java/com/kapeta/schemas/entity/LanguageTargetSpec.java +++ b/packages/maven/src/main/java/com/kapeta/schemas/entity/LanguageTargetSpec.java @@ -5,7 +5,9 @@ @lombok.Data public class LanguageTargetSpec { + @Deprecated private IconValue icon; + private List icons; private LocalDevContainer local; private Map schema; private List versioning; diff --git a/packages/maven/src/main/java/com/kapeta/schemas/entity/ResourceTypeExtensionSpec.java b/packages/maven/src/main/java/com/kapeta/schemas/entity/ResourceTypeExtensionSpec.java index 7519899..6a08b7c 100644 --- a/packages/maven/src/main/java/com/kapeta/schemas/entity/ResourceTypeExtensionSpec.java +++ b/packages/maven/src/main/java/com/kapeta/schemas/entity/ResourceTypeExtensionSpec.java @@ -6,7 +6,9 @@ @lombok.Data public class ResourceTypeExtensionSpec { private ConfigurationSchema configuration; + @Deprecated private IconValue icon; + private List icons; private List ports; private Map schema; private List versioning; diff --git a/packages/maven/src/main/java/com/kapeta/schemas/entity/ResourceTypeInternalSpec.java b/packages/maven/src/main/java/com/kapeta/schemas/entity/ResourceTypeInternalSpec.java index 3d7ec54..f9cb368 100644 --- a/packages/maven/src/main/java/com/kapeta/schemas/entity/ResourceTypeInternalSpec.java +++ b/packages/maven/src/main/java/com/kapeta/schemas/entity/ResourceTypeInternalSpec.java @@ -6,7 +6,9 @@ @lombok.Data public class ResourceTypeInternalSpec { private ConfigurationSchema configuration; + @Deprecated private IconValue icon; + private List icons; private List ports; private Map schema; private List versioning; diff --git a/packages/maven/src/main/java/com/kapeta/schemas/entity/ResourceTypeOperatorSpec.java b/packages/maven/src/main/java/com/kapeta/schemas/entity/ResourceTypeOperatorSpec.java index 7051853..75cc0db 100644 --- a/packages/maven/src/main/java/com/kapeta/schemas/entity/ResourceTypeOperatorSpec.java +++ b/packages/maven/src/main/java/com/kapeta/schemas/entity/ResourceTypeOperatorSpec.java @@ -7,7 +7,9 @@ public class ResourceTypeOperatorSpec { private ColorValue color; private ConfigurationSchema configuration; + @Deprecated private IconValue icon; + private List icons; private LocalInstance local; private List ports; private Map schema; diff --git a/packages/maven/src/main/resources/schemas/abstracts/core/block-definition.json b/packages/maven/src/main/resources/schemas/abstracts/core/block-definition.json index 7ad7265..7b3c91b 100644 --- a/packages/maven/src/main/resources/schemas/abstracts/core/block-definition.json +++ b/packages/maven/src/main/resources/schemas/abstracts/core/block-definition.json @@ -38,6 +38,12 @@ }, "icon": { "$ref": "/core/icon-value" + }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } } } }, diff --git a/packages/maven/src/main/resources/schemas/concepts/core/block-type-executable.json b/packages/maven/src/main/resources/schemas/concepts/core/block-type-executable.json index a891351..cb27f1e 100644 --- a/packages/maven/src/main/resources/schemas/concepts/core/block-type-executable.json +++ b/packages/maven/src/main/resources/schemas/concepts/core/block-type-executable.json @@ -30,6 +30,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "dependencies": { "$ref": "/core/dependencies" }, diff --git a/packages/maven/src/main/resources/schemas/concepts/core/block-type-operator.json b/packages/maven/src/main/resources/schemas/concepts/core/block-type-operator.json index 7135752..1ccfd2f 100644 --- a/packages/maven/src/main/resources/schemas/concepts/core/block-type-operator.json +++ b/packages/maven/src/main/resources/schemas/concepts/core/block-type-operator.json @@ -30,6 +30,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "dependencies": { "$ref": "/core/dependencies" }, diff --git a/packages/maven/src/main/resources/schemas/concepts/core/block-type.json b/packages/maven/src/main/resources/schemas/concepts/core/block-type.json index 40d0990..c779d3b 100644 --- a/packages/maven/src/main/resources/schemas/concepts/core/block-type.json +++ b/packages/maven/src/main/resources/schemas/concepts/core/block-type.json @@ -28,6 +28,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "dependencies": { "$ref": "/core/dependencies" }, diff --git a/packages/maven/src/main/resources/schemas/concepts/core/deployment-target.json b/packages/maven/src/main/resources/schemas/concepts/core/deployment-target.json index 1c761bb..c06cb51 100644 --- a/packages/maven/src/main/resources/schemas/concepts/core/deployment-target.json +++ b/packages/maven/src/main/resources/schemas/concepts/core/deployment-target.json @@ -27,6 +27,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "color": { "$ref": "/core/color-value" }, @@ -58,6 +64,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "service": { "$ref": "/core/remote-service" }, diff --git a/packages/maven/src/main/resources/schemas/concepts/core/language-target.json b/packages/maven/src/main/resources/schemas/concepts/core/language-target.json index 0914b1d..c36c64b 100644 --- a/packages/maven/src/main/resources/schemas/concepts/core/language-target.json +++ b/packages/maven/src/main/resources/schemas/concepts/core/language-target.json @@ -109,6 +109,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "local": { "title": "LocalDevContainer", "description": "if type is \"docker\" or empty - Local development container using a fixed docker image. User code will be mounted into the container.\nif type is \"dockerfile\" - Local development container using a Dockerfile. User code will be built into the container.", diff --git a/packages/maven/src/main/resources/schemas/concepts/core/resource-type-extension.json b/packages/maven/src/main/resources/schemas/concepts/core/resource-type-extension.json index c218f2b..a2cfcc3 100644 --- a/packages/maven/src/main/resources/schemas/concepts/core/resource-type-extension.json +++ b/packages/maven/src/main/resources/schemas/concepts/core/resource-type-extension.json @@ -31,6 +31,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "schema": { "$ref": "/core/schema" }, diff --git a/packages/maven/src/main/resources/schemas/concepts/core/resource-type-internal.json b/packages/maven/src/main/resources/schemas/concepts/core/resource-type-internal.json index 625b4c0..c0e0499 100644 --- a/packages/maven/src/main/resources/schemas/concepts/core/resource-type-internal.json +++ b/packages/maven/src/main/resources/schemas/concepts/core/resource-type-internal.json @@ -30,6 +30,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "configuration": { "$ref": "/core/configuration-schema" }, diff --git a/packages/maven/src/main/resources/schemas/concepts/core/resource-type-operator.json b/packages/maven/src/main/resources/schemas/concepts/core/resource-type-operator.json index cbbe0aa..8afaa5c 100644 --- a/packages/maven/src/main/resources/schemas/concepts/core/resource-type-operator.json +++ b/packages/maven/src/main/resources/schemas/concepts/core/resource-type-operator.json @@ -42,6 +42,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "ports": { "type": "array", "minItems": 1, diff --git a/packages/npm/schemas/abstracts/core/block-definition.json b/packages/npm/schemas/abstracts/core/block-definition.json index 7ad7265..7b3c91b 100644 --- a/packages/npm/schemas/abstracts/core/block-definition.json +++ b/packages/npm/schemas/abstracts/core/block-definition.json @@ -38,6 +38,12 @@ }, "icon": { "$ref": "/core/icon-value" + }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } } } }, diff --git a/packages/npm/schemas/concepts/core/block-type-executable.json b/packages/npm/schemas/concepts/core/block-type-executable.json index a891351..cb27f1e 100644 --- a/packages/npm/schemas/concepts/core/block-type-executable.json +++ b/packages/npm/schemas/concepts/core/block-type-executable.json @@ -30,6 +30,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "dependencies": { "$ref": "/core/dependencies" }, diff --git a/packages/npm/schemas/concepts/core/block-type-operator.json b/packages/npm/schemas/concepts/core/block-type-operator.json index 7135752..1ccfd2f 100644 --- a/packages/npm/schemas/concepts/core/block-type-operator.json +++ b/packages/npm/schemas/concepts/core/block-type-operator.json @@ -30,6 +30,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "dependencies": { "$ref": "/core/dependencies" }, diff --git a/packages/npm/schemas/concepts/core/block-type.json b/packages/npm/schemas/concepts/core/block-type.json index 40d0990..c779d3b 100644 --- a/packages/npm/schemas/concepts/core/block-type.json +++ b/packages/npm/schemas/concepts/core/block-type.json @@ -28,6 +28,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "dependencies": { "$ref": "/core/dependencies" }, diff --git a/packages/npm/schemas/concepts/core/deployment-target.json b/packages/npm/schemas/concepts/core/deployment-target.json index 1c761bb..c06cb51 100644 --- a/packages/npm/schemas/concepts/core/deployment-target.json +++ b/packages/npm/schemas/concepts/core/deployment-target.json @@ -27,6 +27,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "color": { "$ref": "/core/color-value" }, @@ -58,6 +64,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "service": { "$ref": "/core/remote-service" }, diff --git a/packages/npm/schemas/concepts/core/language-target.json b/packages/npm/schemas/concepts/core/language-target.json index 0914b1d..c36c64b 100644 --- a/packages/npm/schemas/concepts/core/language-target.json +++ b/packages/npm/schemas/concepts/core/language-target.json @@ -109,6 +109,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "local": { "title": "LocalDevContainer", "description": "if type is \"docker\" or empty - Local development container using a fixed docker image. User code will be mounted into the container.\nif type is \"dockerfile\" - Local development container using a Dockerfile. User code will be built into the container.", diff --git a/packages/npm/schemas/concepts/core/resource-type-extension.json b/packages/npm/schemas/concepts/core/resource-type-extension.json index c218f2b..a2cfcc3 100644 --- a/packages/npm/schemas/concepts/core/resource-type-extension.json +++ b/packages/npm/schemas/concepts/core/resource-type-extension.json @@ -31,6 +31,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "schema": { "$ref": "/core/schema" }, diff --git a/packages/npm/schemas/concepts/core/resource-type-internal.json b/packages/npm/schemas/concepts/core/resource-type-internal.json index 625b4c0..c0e0499 100644 --- a/packages/npm/schemas/concepts/core/resource-type-internal.json +++ b/packages/npm/schemas/concepts/core/resource-type-internal.json @@ -30,6 +30,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "configuration": { "$ref": "/core/configuration-schema" }, diff --git a/packages/npm/schemas/concepts/core/resource-type-operator.json b/packages/npm/schemas/concepts/core/resource-type-operator.json index cbbe0aa..8afaa5c 100644 --- a/packages/npm/schemas/concepts/core/resource-type-operator.json +++ b/packages/npm/schemas/concepts/core/resource-type-operator.json @@ -42,6 +42,12 @@ "icon": { "$ref": "/core/icon-value" }, + "icons": { + "type": "array", + "items": { + "$ref": "/core/icon-value" + } + }, "ports": { "type": "array", "minItems": 1, diff --git a/packages/npm/src/types/index.ts b/packages/npm/src/types/index.ts index 6de6eee..80c943a 100644 --- a/packages/npm/src/types/index.ts +++ b/packages/npm/src/types/index.ts @@ -47,7 +47,9 @@ export interface BlockDefinitionSpec { configuration?: EntityList; consumers?: Resource[]; entities?: EntityList; - icon?: IconValue; + /** @deprecated use icons instead */ + icon?: IconValue; + icons?: IconValue[]; providers?: Resource[]; target?: LanguageTargetReference; } @@ -110,6 +112,7 @@ export interface ResourceMetadata { export interface IconValue { type: IconType; value: string; + theme?: 'light' | 'dark'; } export enum IconType { @@ -159,7 +162,9 @@ export interface BlockTypeExecutable { export interface BlockTypeExecutableSpec { configuration?: ConfigurationSchema; dependencies?: Dependency[]; - icon?: IconValue; + /** @deprecated use icons instead */ + icon?: IconValue; + icons?: IconValue[]; schema: { [key: string]: any }; versioning?: Versioning[]; } @@ -264,7 +269,9 @@ export interface BlockTypeOperator { export interface BlockTypeOperatorSpec { configuration?: ConfigurationSchema; dependencies?: Dependency[]; - icon?: IconValue; + /** @deprecated use icons instead */ + icon?: IconValue; + icons?: IconValue[]; local: LocalInstance; /** * Ports that the operator will expose. @@ -347,7 +354,9 @@ export interface BlockType { export interface BlockTypeSpec { defaultPort?: Port; dependencies?: Dependency[]; - icon?: IconValue; + /** @deprecated use icons instead */ + icon?: IconValue; + icons?: IconValue[]; schema: { [key: string]: any }; versioning?: Versioning[]; [property: string]: any; @@ -362,7 +371,9 @@ export interface DeploymentTarget { export interface DeploymentTargetSpec { configuration?: ConfigurationSchema; - icon?: IconValue; + /** @deprecated use icons instead */ + icon?: IconValue; + icons?: IconValue[]; operators?: { [key: string]: DeploymentTargetOperator }; service: RemoteService; versioning?: Versioning[]; @@ -373,7 +384,9 @@ export interface DeploymentTargetOperator { color?: ColorValue; configuration?: ConfigurationSchema; description?: string; - icon?: IconValue; + /** @deprecated use icons instead */ + icon?: IconValue; + icons?: IconValue[]; link?: URLValue; title: string; [property: string]: any; @@ -545,7 +558,9 @@ export interface LanguageTarget { } export interface LanguageTargetSpec { + /** @deprecated use icons instead */ icon?: IconValue; + icons?: IconValue[]; /** * if type is "docker" or empty - Local development container using a fixed docker image. * User code will be mounted into the container. @@ -605,7 +620,9 @@ export interface ResourceTypeExtension { export interface ResourceTypeExtensionSpec { configuration?: ConfigurationSchema; - icon?: IconValue; + /** @deprecated use icons instead */ + icon?: IconValue; + icons?: IconValue[]; ports: Port[]; schema: { [key: string]: any }; versioning?: Versioning[]; @@ -621,7 +638,9 @@ export interface ResourceTypeInternal { export interface ResourceTypeInternalSpec { configuration?: ConfigurationSchema; - icon?: IconValue; + /** @deprecated use icons instead */ + icon?: IconValue; + icons?: IconValue[]; ports: Port[]; schema?: { [key: string]: any }; versioning?: Versioning[]; @@ -638,7 +657,9 @@ export interface ResourceTypeOperator { export interface ResourceTypeOperatorSpec { color?: ColorValue; configuration?: ConfigurationSchema; - icon?: IconValue; + /** @deprecated use icons instead */ + icon?: IconValue; + icons?: IconValue[]; local?: LocalInstance; ports: Port[]; schema?: { [key: string]: any };