diff options
Diffstat (limited to 'app/graphql/types/packages/helm')
-rw-r--r-- | app/graphql/types/packages/helm/dependency_type.rb | 28 | ||||
-rw-r--r-- | app/graphql/types/packages/helm/file_metadatum_type.rb | 19 | ||||
-rw-r--r-- | app/graphql/types/packages/helm/maintainer_type.rb | 18 | ||||
-rw-r--r-- | app/graphql/types/packages/helm/metadata_type.rb | 32 |
4 files changed, 97 insertions, 0 deletions
diff --git a/app/graphql/types/packages/helm/dependency_type.rb b/app/graphql/types/packages/helm/dependency_type.rb new file mode 100644 index 00000000000..35598c2b1d7 --- /dev/null +++ b/app/graphql/types/packages/helm/dependency_type.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Types + module Packages + module Helm + # rubocop: disable Graphql/AuthorizeTypes + class DependencyType < BaseObject + graphql_name 'PackageHelmDependencyType' + description 'Represents a Helm dependency' + + # Need to be synced with app/validators/json_schemas/helm_metadata.json#dependencies + field :name, GraphQL::Types::String, null: true, description: 'Name of the dependency.' + field :version, GraphQL::Types::String, null: true, description: 'Version of the dependency.' + field :repository, GraphQL::Types::String, null: true, description: 'Repository of the dependency.' + field :condition, GraphQL::Types::String, null: true, description: 'Condition of the dependency.' + field :tags, [GraphQL::Types::String], null: true, description: 'Tags of the dependency.' + field :enabled, GraphQL::Types::Boolean, null: true, description: 'Indicates the dependency is enabled.' + field :import_values, [GraphQL::Types::JSON], null: true, description: 'Import-values of the dependency.', hash_key: "import-values" # rubocop:disable Graphql/JSONType + field :alias, GraphQL::Types::String, null: true, description: 'Alias of the dependency.', resolver_method: :resolve_alias + + # field :alias` conflicts with a built-in method + def resolve_alias + object['alias'] + end + end + end + end +end diff --git a/app/graphql/types/packages/helm/file_metadatum_type.rb b/app/graphql/types/packages/helm/file_metadatum_type.rb new file mode 100644 index 00000000000..734ed52df40 --- /dev/null +++ b/app/graphql/types/packages/helm/file_metadatum_type.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Types + module Packages + module Helm + class FileMetadatumType < BaseObject + graphql_name 'HelmFileMetadata' + description 'Helm file metadata' + + implements Types::Packages::FileMetadataType + + authorize :read_package + + field :channel, GraphQL::Types::String, null: false, description: 'Channel of the Helm chart.' + field :metadata, Types::Packages::Helm::MetadataType, null: false, description: 'Metadata of the Helm chart.' + end + end + end +end diff --git a/app/graphql/types/packages/helm/maintainer_type.rb b/app/graphql/types/packages/helm/maintainer_type.rb new file mode 100644 index 00000000000..6d25a26c46b --- /dev/null +++ b/app/graphql/types/packages/helm/maintainer_type.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Types + module Packages + module Helm + # rubocop: disable Graphql/AuthorizeTypes + class MaintainerType < BaseObject + graphql_name 'PackageHelmMaintainerType' + description 'Represents a Helm maintainer' + + # Need to be synced with app/validators/json_schemas/helm_metadata.json#maintainers + field :name, GraphQL::Types::String, null: true, description: 'Name of the maintainer.' + field :email, GraphQL::Types::String, null: true, description: 'Email of the maintainer.' + field :url, GraphQL::Types::String, null: true, description: 'URL of the maintainer.' + end + end + end +end diff --git a/app/graphql/types/packages/helm/metadata_type.rb b/app/graphql/types/packages/helm/metadata_type.rb new file mode 100644 index 00000000000..eeb3e8087a8 --- /dev/null +++ b/app/graphql/types/packages/helm/metadata_type.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Types + module Packages + module Helm + # rubocop: disable Graphql/AuthorizeTypes + class MetadataType < BaseObject + graphql_name 'PackageHelmMetadataType' + description 'Represents the contents of a Helm Chart.yml file' + + # Need to be synced with app/validators/json_schemas/helm_metadata.json + field :name, GraphQL::Types::String, null: false, description: 'Name of the chart.' + field :home, GraphQL::Types::String, null: true, description: 'URL of the home page.' + field :sources, [GraphQL::Types::String], null: true, description: 'URLs of the source code for the chart.' + field :version, GraphQL::Types::String, null: false, description: 'Version of the chart.' + field :description, GraphQL::Types::String, null: true, description: 'Description of the chart.' + field :keywords, [GraphQL::Types::String], null: true, description: 'Keywords for the chart.' + field :maintainers, [Types::Packages::Helm::MaintainerType], null: true, description: 'Maintainers of the chart.' + field :icon, GraphQL::Types::String, null: true, description: 'URL to an SVG or PNG image for the chart.' + field :api_version, GraphQL::Types::String, null: false, description: 'API version of the chart.', hash_key: "apiVersion" + field :condition, GraphQL::Types::String, null: true, description: 'Condition for the chart.' + field :tags, GraphQL::Types::String, null: true, description: 'Tags for the chart.' + field :app_version, GraphQL::Types::String, null: true, description: 'App version of the chart.', hash_key: "appVersion" + field :deprecated, GraphQL::Types::Boolean, null: true, description: 'Indicates if the chart is deprecated.' + field :annotations, GraphQL::Types::JSON, null: true, description: 'Annotations for the chart.' # rubocop:disable Graphql/JSONType + field :kube_version, GraphQL::Types::String, null: true, description: 'Kubernetes versions for the chart.', hash_key: "kubeVersion" + field :dependencies, [Types::Packages::Helm::DependencyType], null: true, description: 'Dependencies of the chart.' + field :type, GraphQL::Types::String, null: true, description: 'Type of the chart.', hash_key: "appVersion" + end + end + end +end |