diff --git a/app/graphql/types/data_type_type.rb b/app/graphql/types/data_type_type.rb index e725b414..d04b9949 100644 --- a/app/graphql/types/data_type_type.rb +++ b/app/graphql/types/data_type_type.rb @@ -7,6 +7,7 @@ class DataTypeType < Types::BaseObject authorize :read_datatype field :aliases, [Types::TranslationType], null: true, description: 'Name of the function' + field :definition_source, String, null: true, description: 'The source that defines this datatype' field :display_messages, [Types::TranslationType], null: true, description: 'Display message of the function' field :generic_keys, [String], null: false, description: 'The generic keys of the datatype' @@ -18,6 +19,7 @@ class DataTypeType < Types::BaseObject field :runtime, Types::RuntimeType, null: true, description: 'The runtime where this datatype belongs to' field :type, String, null: false, description: 'The type of the datatype' + field :version, String, null: false, description: 'The version of the datatype' field :linked_data_types, Types::DataTypeType.connection_type, null: false, diff --git a/app/graphql/types/flow_type_setting_type.rb b/app/graphql/types/flow_type_setting_type.rb index 2bb3c5e9..a0d2704d 100644 --- a/app/graphql/types/flow_type_setting_type.rb +++ b/app/graphql/types/flow_type_setting_type.rb @@ -6,6 +6,7 @@ class FlowTypeSettingType < Types::BaseObject authorize :read_flow_type_setting + field :default_value, GraphQL::Types::JSON, null: true, description: 'Default value of the flow type setting' field :descriptions, [Types::TranslationType], null: false, description: 'Descriptions of the flow type setting' field :flow_type, Types::FlowTypeType, null: true, description: 'Flow type of the flow type setting' diff --git a/app/graphql/types/flow_type_type.rb b/app/graphql/types/flow_type_type.rb index 0cc18403..de610396 100644 --- a/app/graphql/types/flow_type_type.rb +++ b/app/graphql/types/flow_type_type.rb @@ -11,6 +11,8 @@ class FlowTypeType < Types::BaseObject description: 'Descriptions of the flow type' field :display_messages, [Types::TranslationType], null: true, description: 'Display message of the function' + field :documentations, [Types::TranslationType], null: true, + description: 'Documentations of the flow type' field :editable, Boolean, null: false, description: 'Editable status of the flow type' field :flow_type_settings, [Types::FlowTypeSettingType], null: false, description: 'Flow type settings of the flow type' @@ -20,6 +22,13 @@ class FlowTypeType < Types::BaseObject description: 'Runtime of the flow type' field :signature, String, null: false, description: 'Signature of the flow type' + # rubocop:disable GraphQL/ExtractType + field :display_icon, String, null: true, description: 'Display icon of the flow type' + # rubocop:enable GraphQL/ExtractType + + field :definition_source, String, null: true, description: 'The source that defines this flow type' + field :version, String, null: false, description: 'Version of the flow type' + field :linked_data_types, Types::DataTypeType.connection_type, null: false, description: 'The data types that are referenced in this flow type' diff --git a/app/graphql/types/function_definition_type.rb b/app/graphql/types/function_definition_type.rb index 5b446490..cbc7883a 100644 --- a/app/graphql/types/function_definition_type.rb +++ b/app/graphql/types/function_definition_type.rb @@ -33,6 +33,11 @@ class FunctionDefinitionType < Types::BaseObject field :throws_error, Boolean, null: false, description: 'Indicates if the function can throw an error' + # rubocop:disable GraphQL/ExtractType + field :display_icon, String, + null: true, description: 'Display icon of the function' + # rubocop:enable GraphQL/ExtractType + field :linked_data_types, Types::DataTypeType.connection_type, null: false, description: 'All data types referenced within this function definition' @@ -52,6 +57,10 @@ def throws_error object.runtime_function_definition&.throws_error end + def display_icon + object.runtime_function_definition&.display_icon + end + def linked_data_types return [] unless object.runtime_function_definition diff --git a/app/graphql/types/parameter_definition_type.rb b/app/graphql/types/parameter_definition_type.rb index 41544618..d0207094 100644 --- a/app/graphql/types/parameter_definition_type.rb +++ b/app/graphql/types/parameter_definition_type.rb @@ -18,6 +18,9 @@ class ParameterDefinitionType < Types::BaseObject field :runtime_parameter_definition, Types::RuntimeParameterDefinitionType, null: true, description: 'Runtime parameter definition' + field :default_value, GraphQL::Types::JSON, + null: true, description: 'Default value of the parameter' + id_field ParameterDefinition timestamps diff --git a/app/graphql/types/runtime_function_definition_type.rb b/app/graphql/types/runtime_function_definition_type.rb index 1b960c99..f2a4fefa 100644 --- a/app/graphql/types/runtime_function_definition_type.rb +++ b/app/graphql/types/runtime_function_definition_type.rb @@ -26,6 +26,34 @@ class RuntimeFunctionDefinitionType < Types::BaseObject null: false, description: 'Signature of the runtime function definition' + field :throws_error, Boolean, + null: false, + description: 'Indicates if the function can throw an error' + + field :display_icon, String, + null: true, + description: 'Display icon of the runtime function definition' + + field :version, String, + null: false, + description: 'Version of the runtime function definition' + + field :definition_source, String, + null: true, + description: 'The source that defines this definition' + + field :aliases, [Types::TranslationType], null: true, description: 'Aliases' + field :deprecation_messages, [Types::TranslationType], null: true, + description: 'Deprecation messages' + field :descriptions, [Types::TranslationType], null: true, + description: 'Descriptions of the runtime function definition' + # rubocop:disable GraphQL/ExtractType + field :display_messages, [Types::TranslationType], null: true, description: 'Display messages' + # rubocop:enable GraphQL/ExtractType + field :documentations, [Types::TranslationType], null: true, + description: 'Documentations of the runtime function definition' + field :names, [Types::TranslationType], null: true, description: 'Names of the runtime function definition' + field :linked_data_types, Types::DataTypeType.connection_type, null: false, description: 'The data types that are referenced in this runtime function definition' diff --git a/app/graphql/types/runtime_parameter_definition_type.rb b/app/graphql/types/runtime_parameter_definition_type.rb index bd7f6eb8..d49445af 100644 --- a/app/graphql/types/runtime_parameter_definition_type.rb +++ b/app/graphql/types/runtime_parameter_definition_type.rb @@ -11,6 +11,16 @@ class RuntimeParameterDefinitionType < Types::BaseObject description: 'Identifier of the runtime parameter definition', method: :runtime_name + field :default_value, GraphQL::Types::JSON, + null: true, + description: 'Default value of the runtime parameter definition' + + field :descriptions, [Types::TranslationType], null: true, + description: 'Descriptions of the runtime parameter definition' + field :documentations, [Types::TranslationType], null: true, + description: 'Documentations of the runtime parameter definition' + field :names, [Types::TranslationType], null: true, description: 'Names of the runtime parameter definition' + id_field RuntimeParameterDefinition timestamps end diff --git a/app/models/data_type.rb b/app/models/data_type.rb index 91cf0629..c68481bd 100644 --- a/app/models/data_type.rb +++ b/app/models/data_type.rb @@ -16,6 +16,7 @@ class DataType < ApplicationRecord has_many :aliases, -> { by_purpose(:alias) }, class_name: 'Translation', as: :owner, inverse_of: :owner validates :type, presence: true, length: { maximum: 2000 } + validates :definition_source, length: { maximum: 50 } validate :validate_version @@ -41,7 +42,8 @@ def to_grpc generic_keys: generic_keys, type: type, linked_data_type_identifiers: referenced_data_types.map(&:identifier), - version: version + version: version, + definition_source: definition_source ) end end diff --git a/app/models/flow_type.rb b/app/models/flow_type.rb index 05eeb310..bcc692e9 100644 --- a/app/models/flow_type.rb +++ b/app/models/flow_type.rb @@ -11,6 +11,8 @@ class FlowType < ApplicationRecord validates :identifier, presence: true, uniqueness: { scope: :runtime_id } validates :editable, inclusion: { in: [true, false] } validates :signature, presence: true, length: { maximum: 500 } + validates :definition_source, length: { maximum: 50 } + validates :display_icon, length: { maximum: 100 } has_many :names, -> { by_purpose(:name) }, class_name: 'Translation', as: :owner, inverse_of: :owner has_many :descriptions, -> { by_purpose(:description) }, class_name: 'Translation', as: :owner, inverse_of: :owner diff --git a/app/models/node_function.rb b/app/models/node_function.rb index 6c275494..1fbd6df6 100644 --- a/app/models/node_function.rb +++ b/app/models/node_function.rb @@ -39,7 +39,8 @@ def to_grpc database_id: id, runtime_function_id: function_definition.runtime_function_definition.runtime_name, parameters: ordered_parameters.map(&:to_grpc), - next_node_id: next_node&.id + next_node_id: next_node&.id, + definition_source: function_definition.runtime_function_definition.definition_source ) end diff --git a/app/models/runtime_function_definition.rb b/app/models/runtime_function_definition.rb index e2d860eb..25a818df 100644 --- a/app/models/runtime_function_definition.rb +++ b/app/models/runtime_function_definition.rb @@ -25,6 +25,8 @@ class RuntimeFunctionDefinition < ApplicationRecord uniqueness: { case_sensitive: false, scope: :runtime_id } validates :signature, presence: true, length: { maximum: 500 } + validates :definition_source, length: { maximum: 50 } + validates :display_icon, length: { maximum: 100 } validate :validate_version @@ -53,7 +55,9 @@ def to_grpc display_message: display_messages.map(&:to_grpc), alias: aliases.map(&:to_grpc), linked_data_type_identifiers: referenced_data_types.map(&:identifier), - version: version + version: version, + definition_source: definition_source, + display_icon: display_icon ) end end diff --git a/app/services/runtimes/grpc/data_types/update_service.rb b/app/services/runtimes/grpc/data_types/update_service.rb index df66d387..ddc7f01b 100644 --- a/app/services/runtimes/grpc/data_types/update_service.rb +++ b/app/services/runtimes/grpc/data_types/update_service.rb @@ -71,6 +71,7 @@ def update_datatype(data_type, t) db_object.display_messages = update_translations(data_type.display_message, db_object.display_messages) db_object.generic_keys = data_type.generic_keys.to_a db_object.version = data_type.version + db_object.definition_source = data_type.definition_source link_data_types(db_object, data_type.linked_data_type_identifiers, t) db_object.save db_object diff --git a/app/services/runtimes/grpc/flow_types/update_service.rb b/app/services/runtimes/grpc/flow_types/update_service.rb index 1cb5125f..fa520c65 100644 --- a/app/services/runtimes/grpc/flow_types/update_service.rb +++ b/app/services/runtimes/grpc/flow_types/update_service.rb @@ -58,6 +58,8 @@ def update_flowtype(flow_type, t) db_object.display_messages = update_translations(flow_type.display_message, db_object.display_messages) db_object.aliases = update_translations(flow_type.alias, db_object.aliases) db_object.version = flow_type.version + db_object.definition_source = flow_type.definition_source + db_object.display_icon = flow_type.display_icon db_object.flow_type_settings = update_settings(flow_type.settings, db_object, t) link_data_types(db_object, flow_type.linked_data_type_identifiers, t) db_object.save diff --git a/app/services/runtimes/grpc/runtime_function_definitions/update_service.rb b/app/services/runtimes/grpc/runtime_function_definitions/update_service.rb index 8b28a0a5..c236e9a7 100644 --- a/app/services/runtimes/grpc/runtime_function_definitions/update_service.rb +++ b/app/services/runtimes/grpc/runtime_function_definitions/update_service.rb @@ -55,6 +55,8 @@ def update_runtime_function_definition(runtime_function_definition, t) db_object.signature = runtime_function_definition.signature db_object.throws_error = runtime_function_definition.throws_error db_object.version = runtime_function_definition.version + db_object.definition_source = runtime_function_definition.definition_source + db_object.display_icon = runtime_function_definition.display_icon db_object.names = update_translations(runtime_function_definition.name, db_object.names) db_object.descriptions = update_translations(runtime_function_definition.description, db_object.descriptions) db_object.documentations = update_translations(runtime_function_definition.documentation, diff --git a/db/migrate/20260403191634_update_flow_and_flow_type_to_tucana0066.rb b/db/migrate/20260403191634_update_flow_and_flow_type_to_tucana0066.rb index 8ebbd4e0..4774e50f 100644 --- a/db/migrate/20260403191634_update_flow_and_flow_type_to_tucana0066.rb +++ b/db/migrate/20260403191634_update_flow_and_flow_type_to_tucana0066.rb @@ -4,13 +4,11 @@ class UpdateFlowAndFlowTypeToTucana0066 < Code0::ZeroTrack::Database::Migration[ def change remove_column :flow_types, :input_type, :text, limit: 2000 remove_column :flow_types, :return_type, :text, limit: 2000 - add_column :flow_types, :signature, :text, null: false, default: '' - add_check_constraint :flow_types, 'char_length(signature) <= 500' + add_column :flow_types, :signature, :text, null: false, default: '', limit: 500 remove_column :flows, :input_type, :text, limit: 2000 remove_column :flows, :return_type, :text, limit: 2000 - add_column :flows, :signature, :text, null: false, default: '' - add_check_constraint :flows, 'char_length(signature) <= 500' + add_column :flows, :signature, :text, null: false, default: '', limit: 500 remove_column :flow_type_settings, :type, :text, null: false, limit: 2000 diff --git a/db/migrate/20260405161500_add_definition_source_and_display_icon.rb b/db/migrate/20260405161500_add_definition_source_and_display_icon.rb new file mode 100644 index 00000000..6a9cb50b --- /dev/null +++ b/db/migrate/20260405161500_add_definition_source_and_display_icon.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddDefinitionSourceAndDisplayIcon < Code0::ZeroTrack::Database::Migration[1.0] + def change + add_column :runtime_function_definitions, :definition_source, :text, limit: 50 + add_column :runtime_function_definitions, :display_icon, :text, limit: 100 + + add_column :data_types, :definition_source, :text, limit: 50 + + add_column :flow_types, :definition_source, :text, limit: 50 + add_column :flow_types, :display_icon, :text, limit: 100 + end +end diff --git a/db/schema_migrations/20260405161500 b/db/schema_migrations/20260405161500 new file mode 100644 index 00000000..c3e534ce --- /dev/null +++ b/db/schema_migrations/20260405161500 @@ -0,0 +1 @@ +3ff259a273ef1870a93522ef10c71fea404d4dd3bb144ddd3e9e9cc53f4fedbb \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index a4116f35..4d0d5765 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -166,8 +166,10 @@ CREATE TABLE data_types ( generic_keys text[] DEFAULT '{}'::text[] NOT NULL, version text NOT NULL, type text NOT NULL, + definition_source text, CONSTRAINT check_01ca31b7b9 CHECK ((char_length(type) <= 2000)), - CONSTRAINT check_3a7198812e CHECK ((char_length(identifier) <= 50)) + CONSTRAINT check_3a7198812e CHECK ((char_length(identifier) <= 50)), + CONSTRAINT check_a133157a46 CHECK ((char_length(definition_source) <= 50)) ); CREATE SEQUENCE data_types_id_seq @@ -260,7 +262,11 @@ CREATE TABLE flow_types ( updated_at timestamp with time zone NOT NULL, version text NOT NULL, signature text DEFAULT ''::text NOT NULL, - CONSTRAINT chk_rails_7fce2d945c CHECK ((char_length(signature) <= 500)) + definition_source text, + display_icon text, + CONSTRAINT check_3311b57eb7 CHECK ((char_length(definition_source) <= 50)), + CONSTRAINT check_3f33e69ae0 CHECK ((char_length(display_icon) <= 100)), + CONSTRAINT check_dfcfd661f1 CHECK ((char_length(signature) <= 500)) ); CREATE SEQUENCE flow_types_id_seq @@ -283,7 +289,7 @@ CREATE TABLE flows ( validation_status integer DEFAULT 0 NOT NULL, disabled_reason integer, signature text DEFAULT ''::text NOT NULL, - CONSTRAINT chk_rails_8058ebff6e CHECK ((char_length(signature) <= 500)) + CONSTRAINT check_8c731c24ec CHECK ((char_length(signature) <= 500)) ); CREATE SEQUENCE flows_id_seq @@ -703,7 +709,11 @@ CREATE TABLE runtime_function_definitions ( updated_at timestamp with time zone NOT NULL, version text NOT NULL, signature text NOT NULL, + definition_source text, + display_icon text, + CONSTRAINT check_4cf530fb6a CHECK ((char_length(definition_source) <= 50)), CONSTRAINT check_86da361565 CHECK ((char_length(signature) <= 500)), + CONSTRAINT check_ef62cf61e5 CHECK ((char_length(display_icon) <= 100)), CONSTRAINT check_fe8fff4f27 CHECK ((char_length(runtime_name) <= 50)) ); diff --git a/docs/graphql/object/datatype.md b/docs/graphql/object/datatype.md index 520ec456..01f8e8dd 100644 --- a/docs/graphql/object/datatype.md +++ b/docs/graphql/object/datatype.md @@ -10,6 +10,7 @@ Represents a DataType |------|------|-------------| | `aliases` | [`[Translation!]`](../object/translation.md) | Name of the function | | `createdAt` | [`Time!`](../scalar/time.md) | Time when this DataType was created | +| `definitionSource` | [`String`](../scalar/string.md) | The source that defines this datatype | | `displayMessages` | [`[Translation!]`](../object/translation.md) | Display message of the function | | `genericKeys` | [`[String!]!`](../scalar/string.md) | The generic keys of the datatype | | `id` | [`DataTypeID!`](../scalar/datatypeid.md) | Global ID of this DataType | @@ -20,4 +21,5 @@ Represents a DataType | `runtime` | [`Runtime`](../object/runtime.md) | The runtime where this datatype belongs to | | `type` | [`String!`](../scalar/string.md) | The type of the datatype | | `updatedAt` | [`Time!`](../scalar/time.md) | Time when this DataType was last updated | +| `version` | [`String!`](../scalar/string.md) | The version of the datatype | diff --git a/docs/graphql/object/flowtype.md b/docs/graphql/object/flowtype.md index 8af51844..b5f4c393 100644 --- a/docs/graphql/object/flowtype.md +++ b/docs/graphql/object/flowtype.md @@ -10,8 +10,11 @@ Represents a flow type |------|------|-------------| | `aliases` | [`[Translation!]`](../object/translation.md) | Name of the function | | `createdAt` | [`Time!`](../scalar/time.md) | Time when this FlowType was created | +| `definitionSource` | [`String`](../scalar/string.md) | The source that defines this flow type | | `descriptions` | [`[Translation!]`](../object/translation.md) | Descriptions of the flow type | +| `displayIcon` | [`String`](../scalar/string.md) | Display icon of the flow type | | `displayMessages` | [`[Translation!]`](../object/translation.md) | Display message of the function | +| `documentations` | [`[Translation!]`](../object/translation.md) | Documentations of the flow type | | `editable` | [`Boolean!`](../scalar/boolean.md) | Editable status of the flow type | | `flowTypeSettings` | [`[FlowTypeSetting!]!`](../object/flowtypesetting.md) | Flow type settings of the flow type | | `id` | [`FlowTypeID!`](../scalar/flowtypeid.md) | Global ID of this FlowType | @@ -21,4 +24,5 @@ Represents a flow type | `runtime` | [`Runtime!`](../object/runtime.md) | Runtime of the flow type | | `signature` | [`String!`](../scalar/string.md) | Signature of the flow type | | `updatedAt` | [`Time!`](../scalar/time.md) | Time when this FlowType was last updated | +| `version` | [`String!`](../scalar/string.md) | Version of the flow type | diff --git a/docs/graphql/object/flowtypesetting.md b/docs/graphql/object/flowtypesetting.md index ecb7ffaf..82e0d55f 100644 --- a/docs/graphql/object/flowtypesetting.md +++ b/docs/graphql/object/flowtypesetting.md @@ -9,6 +9,7 @@ Represents a flow type setting | Name | Type | Description | |------|------|-------------| | `createdAt` | [`Time!`](../scalar/time.md) | Time when this FlowTypeSetting was created | +| `defaultValue` | [`JSON`](../scalar/json.md) | Default value of the flow type setting | | `descriptions` | [`[Translation!]!`](../object/translation.md) | Descriptions of the flow type setting | | `flowType` | [`FlowType`](../object/flowtype.md) | Flow type of the flow type setting | | `id` | [`FlowTypeSettingID!`](../scalar/flowtypesettingid.md) | Global ID of this FlowTypeSetting | diff --git a/docs/graphql/object/functiondefinition.md b/docs/graphql/object/functiondefinition.md index 4fb7c32c..40535ae4 100644 --- a/docs/graphql/object/functiondefinition.md +++ b/docs/graphql/object/functiondefinition.md @@ -12,6 +12,7 @@ Represents a function definition | `createdAt` | [`Time!`](../scalar/time.md) | Time when this FunctionDefinition was created | | `deprecationMessages` | [`[Translation!]`](../object/translation.md) | Deprecation message of the function | | `descriptions` | [`[Translation!]`](../object/translation.md) | Description of the function | +| `displayIcon` | [`String`](../scalar/string.md) | Display icon of the function | | `displayMessages` | [`[Translation!]`](../object/translation.md) | Display message of the function | | `documentations` | [`[Translation!]`](../object/translation.md) | Documentation of the function | | `id` | [`FunctionDefinitionID!`](../scalar/functiondefinitionid.md) | Global ID of this FunctionDefinition | diff --git a/docs/graphql/object/parameterdefinition.md b/docs/graphql/object/parameterdefinition.md index d7f229ff..53d7d929 100644 --- a/docs/graphql/object/parameterdefinition.md +++ b/docs/graphql/object/parameterdefinition.md @@ -9,6 +9,7 @@ Represents a parameter definition | Name | Type | Description | |------|------|-------------| | `createdAt` | [`Time!`](../scalar/time.md) | Time when this ParameterDefinition was created | +| `defaultValue` | [`JSON`](../scalar/json.md) | Default value of the parameter | | `descriptions` | [`[Translation!]`](../object/translation.md) | Description of the parameter | | `documentations` | [`[Translation!]`](../object/translation.md) | Documentation of the parameter | | `id` | [`ParameterDefinitionID!`](../scalar/parameterdefinitionid.md) | Global ID of this ParameterDefinition | diff --git a/docs/graphql/object/runtimefunctiondefinition.md b/docs/graphql/object/runtimefunctiondefinition.md index 19e40ca5..5d168ec2 100644 --- a/docs/graphql/object/runtimefunctiondefinition.md +++ b/docs/graphql/object/runtimefunctiondefinition.md @@ -8,13 +8,23 @@ Represents a runtime function definition | Name | Type | Description | |------|------|-------------| +| `aliases` | [`[Translation!]`](../object/translation.md) | Aliases | | `createdAt` | [`Time!`](../scalar/time.md) | Time when this RuntimeFunctionDefinition was created | +| `definitionSource` | [`String`](../scalar/string.md) | The source that defines this definition | +| `deprecationMessages` | [`[Translation!]`](../object/translation.md) | Deprecation messages | +| `descriptions` | [`[Translation!]`](../object/translation.md) | Descriptions of the runtime function definition | +| `displayIcon` | [`String`](../scalar/string.md) | Display icon of the runtime function definition | +| `displayMessages` | [`[Translation!]`](../object/translation.md) | Display messages | +| `documentations` | [`[Translation!]`](../object/translation.md) | Documentations of the runtime function definition | | `functionDefinitions` | [`FunctionDefinitionConnection`](../object/functiondefinitionconnection.md) | Function definitions of the runtime function definition | | `id` | [`RuntimeFunctionDefinitionID!`](../scalar/runtimefunctiondefinitionid.md) | Global ID of this RuntimeFunctionDefinition | | `identifier` | [`String!`](../scalar/string.md) | Identifier of the runtime function definition | | `linkedDataTypes` | [`DataTypeConnection!`](../object/datatypeconnection.md) | The data types that are referenced in this runtime function definition | +| `names` | [`[Translation!]`](../object/translation.md) | Names of the runtime function definition | | `runtime` | [`Runtime!`](../object/runtime.md) | The runtime this runtime function definition belongs to | | `runtimeParameterDefinitions` | [`RuntimeParameterDefinitionConnection`](../object/runtimeparameterdefinitionconnection.md) | Parameter definitions of the runtime function definition | | `signature` | [`String!`](../scalar/string.md) | Signature of the runtime function definition | +| `throwsError` | [`Boolean!`](../scalar/boolean.md) | Indicates if the function can throw an error | | `updatedAt` | [`Time!`](../scalar/time.md) | Time when this RuntimeFunctionDefinition was last updated | +| `version` | [`String!`](../scalar/string.md) | Version of the runtime function definition | diff --git a/docs/graphql/object/runtimeparameterdefinition.md b/docs/graphql/object/runtimeparameterdefinition.md index 8fb321d4..103f08d4 100644 --- a/docs/graphql/object/runtimeparameterdefinition.md +++ b/docs/graphql/object/runtimeparameterdefinition.md @@ -9,7 +9,11 @@ Represents a runtime parameter definition | Name | Type | Description | |------|------|-------------| | `createdAt` | [`Time!`](../scalar/time.md) | Time when this RuntimeParameterDefinition was created | +| `defaultValue` | [`JSON`](../scalar/json.md) | Default value of the runtime parameter definition | +| `descriptions` | [`[Translation!]`](../object/translation.md) | Descriptions of the runtime parameter definition | +| `documentations` | [`[Translation!]`](../object/translation.md) | Documentations of the runtime parameter definition | | `id` | [`RuntimeParameterDefinitionID!`](../scalar/runtimeparameterdefinitionid.md) | Global ID of this RuntimeParameterDefinition | | `identifier` | [`String!`](../scalar/string.md) | Identifier of the runtime parameter definition | +| `names` | [`[Translation!]`](../object/translation.md) | Names of the runtime parameter definition | | `updatedAt` | [`Time!`](../scalar/time.md) | Time when this RuntimeParameterDefinition was last updated | diff --git a/spec/factories/data_types.rb b/spec/factories/data_types.rb index 94f09afc..aa5af069 100644 --- a/spec/factories/data_types.rb +++ b/spec/factories/data_types.rb @@ -8,5 +8,6 @@ identifier { generate(:data_type_name) } type { 'string' } version { '0.0.0' } + definition_source { 'sagittarius' } end end diff --git a/spec/factories/flow_types.rb b/spec/factories/flow_types.rb index ce41f5fa..ea9d3f02 100644 --- a/spec/factories/flow_types.rb +++ b/spec/factories/flow_types.rb @@ -9,5 +9,7 @@ signature { '(): undefined' } editable { false } version { '0.0.0' } + definition_source { 'sagittarius' } + display_icon { nil } end end diff --git a/spec/factories/runtime_function_definitions.rb b/spec/factories/runtime_function_definitions.rb index 540ddec7..1d9ba7b2 100644 --- a/spec/factories/runtime_function_definitions.rb +++ b/spec/factories/runtime_function_definitions.rb @@ -9,5 +9,7 @@ parameters { [] } signature { '(): undefined' } version { '0.0.0' } + definition_source { 'sagittarius' } + display_icon { nil } end end diff --git a/spec/graphql/types/data_type_type_spec.rb b/spec/graphql/types/data_type_type_spec.rb index 4839fbaa..816beb4c 100644 --- a/spec/graphql/types/data_type_type_spec.rb +++ b/spec/graphql/types/data_type_type_spec.rb @@ -7,6 +7,8 @@ %w[ identifier type + version + definitionSource id rules name diff --git a/spec/graphql/types/flow_type_setting_spec.rb b/spec/graphql/types/flow_type_setting_spec.rb index 9c6c4530..f6a44eb6 100644 --- a/spec/graphql/types/flow_type_setting_spec.rb +++ b/spec/graphql/types/flow_type_setting_spec.rb @@ -7,6 +7,7 @@ %w[ identifier unique + defaultValue flow_type names descriptions diff --git a/spec/graphql/types/flow_type_type_spec.rb b/spec/graphql/types/flow_type_type_spec.rb index 40a815b3..2f5d60f3 100644 --- a/spec/graphql/types/flow_type_type_spec.rb +++ b/spec/graphql/types/flow_type_type_spec.rb @@ -8,11 +8,15 @@ identifier editable signature + displayIcon + version + definitionSource flow_type_settings names display_messages aliases descriptions + documentations runtime linked_data_types id diff --git a/spec/graphql/types/function_definition_type_spec.rb b/spec/graphql/types/function_definition_type_spec.rb index c3f95690..31473ba8 100644 --- a/spec/graphql/types/function_definition_type_spec.rb +++ b/spec/graphql/types/function_definition_type_spec.rb @@ -17,6 +17,7 @@ runtimeFunctionDefinition signature throwsError + displayIcon linkedDataTypes createdAt updatedAt diff --git a/spec/graphql/types/parameter_definition_type_spec.rb b/spec/graphql/types/parameter_definition_type_spec.rb index 11f9fb7b..7a784ed2 100644 --- a/spec/graphql/types/parameter_definition_type_spec.rb +++ b/spec/graphql/types/parameter_definition_type_spec.rb @@ -11,6 +11,7 @@ names documentations runtimeParameterDefinition + defaultValue createdAt updatedAt ] diff --git a/spec/graphql/types/runtime_function_definition_type_spec.rb b/spec/graphql/types/runtime_function_definition_type_spec.rb index 12d0afd2..1480d031 100644 --- a/spec/graphql/types/runtime_function_definition_type_spec.rb +++ b/spec/graphql/types/runtime_function_definition_type_spec.rb @@ -11,6 +11,16 @@ runtimeParameterDefinitions runtime signature + throwsError + displayIcon + version + definitionSource + names + descriptions + documentations + deprecationMessages + displayMessages + aliases linkedDataTypes createdAt updatedAt diff --git a/spec/graphql/types/runtime_parameter_definition_type_spec.rb b/spec/graphql/types/runtime_parameter_definition_type_spec.rb index a5f835a1..089c5c13 100644 --- a/spec/graphql/types/runtime_parameter_definition_type_spec.rb +++ b/spec/graphql/types/runtime_parameter_definition_type_spec.rb @@ -7,6 +7,10 @@ %w[ id identifier + defaultValue + names + descriptions + documentations createdAt updatedAt ] diff --git a/spec/models/data_type_spec.rb b/spec/models/data_type_spec.rb index e859f3ac..054294ee 100644 --- a/spec/models/data_type_spec.rb +++ b/spec/models/data_type_spec.rb @@ -21,6 +21,7 @@ describe 'validations' do it { is_expected.to validate_presence_of(:type) } it { is_expected.to validate_length_of(:type).is_at_most(2000) } + it { is_expected.to validate_length_of(:definition_source).is_at_most(50) } describe '#validate_version' do it 'adds an error if version is blank' do @@ -63,7 +64,8 @@ rules: [rule.to_grpc.to_h], type: data_type.type, linked_data_type_identifiers: [ref_data_type.identifier], - version: data_type.version + version: data_type.version, + definition_source: 'sagittarius' ) end end diff --git a/spec/models/flow_spec.rb b/spec/models/flow_spec.rb index 51809667..8b0b0fa0 100644 --- a/spec/models/flow_spec.rb +++ b/spec/models/flow_spec.rb @@ -116,6 +116,7 @@ }, } ], + definition_source: 'sagittarius', } ], starting_node_id: starting_node.id, diff --git a/spec/models/flow_type_spec.rb b/spec/models/flow_type_spec.rb index 9f2b2bfb..c6b51282 100644 --- a/spec/models/flow_type_spec.rb +++ b/spec/models/flow_type_spec.rb @@ -29,6 +29,9 @@ it { is_expected.to validate_presence_of(:signature) } it { is_expected.to validate_length_of(:signature).is_at_most(500) } + it { is_expected.to validate_length_of(:definition_source).is_at_most(50) } + it { is_expected.to validate_length_of(:display_icon).is_at_most(100) } + describe '#validate_version' do it 'adds an error if version is blank' do flow_type.version = '' diff --git a/spec/models/runtime_function_definition_spec.rb b/spec/models/runtime_function_definition_spec.rb index fc8c5d31..36ae3f73 100644 --- a/spec/models/runtime_function_definition_spec.rb +++ b/spec/models/runtime_function_definition_spec.rb @@ -15,6 +15,9 @@ it { is_expected.to validate_presence_of(:signature) } it { is_expected.to validate_length_of(:signature).is_at_most(500) } + it { is_expected.to validate_length_of(:definition_source).is_at_most(50) } + it { is_expected.to validate_length_of(:display_icon).is_at_most(100) } + describe '#validate_version' do it 'adds an error if version is blank' do function.version = '' @@ -93,7 +96,8 @@ display_message: [display.to_grpc.to_h], alias: [alias_t.to_grpc.to_h], linked_data_type_identifiers: [data_type.identifier], - version: function.version + version: function.version, + definition_source: 'sagittarius' ) end end diff --git a/spec/requests/grpc/sagittarius/data_type_service_spec.rb b/spec/requests/grpc/sagittarius/data_type_service_spec.rb index cfc80e6b..37e6f133 100644 --- a/spec/requests/grpc/sagittarius/data_type_service_spec.rb +++ b/spec/requests/grpc/sagittarius/data_type_service_spec.rb @@ -27,6 +27,7 @@ ], linked_data_type_identifiers: [], version: '0.0.0', + definition_source: 'taurus', } ] end @@ -45,6 +46,7 @@ expect(data_type.runtime).to eq(runtime) expect(data_type.type).to eq('number') expect(data_type.identifier).to eq('positive_number') + expect(data_type.definition_source).to eq('taurus') expect(data_type.names.count).to eq(1) expect(data_type.names.first.code).to eq('de_DE') expect(data_type.names.first.content).to eq('Positive Zahl') diff --git a/spec/requests/grpc/sagittarius/flow_type_service_spec.rb b/spec/requests/grpc/sagittarius/flow_type_service_spec.rb index dc651112..a69d3b20 100644 --- a/spec/requests/grpc/sagittarius/flow_type_service_spec.rb +++ b/spec/requests/grpc/sagittarius/flow_type_service_spec.rb @@ -56,6 +56,8 @@ ], editable: false, version: '0.0.0', + definition_source: 'draco-rest', + display_icon: 'rest-icon', } ] end @@ -72,6 +74,8 @@ expect(flow_type.signature).to eq('(input: REST_ADAPTER_INPUT): HTTP_RESPONSE') expect(flow_type.editable).to be false expect(flow_type.version).to eq('0.0.0') + expect(flow_type.definition_source).to eq('draco-rest') + expect(flow_type.display_icon).to eq('rest-icon') expect(flow_type.referenced_data_types).to contain_exactly(rest_adapter_input_data_type, http_response_data_type) diff --git a/spec/requests/grpc/sagittarius/runtime_function_definition_service_spec.rb b/spec/requests/grpc/sagittarius/runtime_function_definition_service_spec.rb index ec0ab83b..79a284a6 100644 --- a/spec/requests/grpc/sagittarius/runtime_function_definition_service_spec.rb +++ b/spec/requests/grpc/sagittarius/runtime_function_definition_service_spec.rb @@ -65,6 +65,8 @@ } ], version: '0.0.0', + definition_source: 'taurus', + display_icon: 'filter-icon', } ] end @@ -87,6 +89,8 @@ expect(function.display_messages.first.content).to eq('Filter elements in ${list} matching ${predicate}') expect(function.throws_error).to be(false) expect(function.version).to eq('0.0.0') + expect(function.definition_source).to eq('taurus') + expect(function.display_icon).to eq('filter-icon') expect(function.referenced_data_types).to contain_exactly(list_data_type, predicate_data_type) expect(function.parameters.count).to eq(2)