Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/types/packages')
-rw-r--r--app/graphql/types/packages/helm/dependency_type.rb2
-rw-r--r--app/graphql/types/packages/helm/metadata_type.rb8
-rw-r--r--app/graphql/types/packages/package_base_type.rb1
-rw-r--r--app/graphql/types/packages/package_type.rb1
-rw-r--r--app/graphql/types/packages/protection/rule_access_level_enum.rb17
-rw-r--r--app/graphql/types/packages/protection/rule_package_type_enum.rb17
-rw-r--r--app/graphql/types/packages/protection/rule_type.rb33
7 files changed, 74 insertions, 5 deletions
diff --git a/app/graphql/types/packages/helm/dependency_type.rb b/app/graphql/types/packages/helm/dependency_type.rb
index 72a47d0af51..6ba14145fb5 100644
--- a/app/graphql/types/packages/helm/dependency_type.rb
+++ b/app/graphql/types/packages/helm/dependency_type.rb
@@ -12,7 +12,7 @@ module Types
field :alias, GraphQL::Types::String, null: true, description: 'Alias of the dependency.', resolver_method: :resolve_alias
field :condition, GraphQL::Types::String, null: true, description: 'Condition 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 :import_values, [GraphQL::Types::JSON], null: true, description: 'Import-values of the dependency.', hash_key: :'import-values' # rubocop:disable Graphql/JSONType
field :name, GraphQL::Types::String, null: true, description: 'Name of the dependency.'
field :repository, GraphQL::Types::String, null: true, description: 'Repository of the dependency.'
field :tags, [GraphQL::Types::String], null: true, description: 'Tags of the dependency.'
diff --git a/app/graphql/types/packages/helm/metadata_type.rb b/app/graphql/types/packages/helm/metadata_type.rb
index ccc5a3029cd..77062a48bc3 100644
--- a/app/graphql/types/packages/helm/metadata_type.rb
+++ b/app/graphql/types/packages/helm/metadata_type.rb
@@ -10,8 +10,8 @@ module Types
# Need to be synced with app/validators/json_schemas/helm_metadata.json
field :annotations, GraphQL::Types::JSON, null: true, description: 'Annotations for the chart.' # rubocop:disable Graphql/JSONType
- field :api_version, GraphQL::Types::String, null: false, description: 'API version of the chart.', hash_key: "apiVersion"
- field :app_version, GraphQL::Types::String, null: true, description: 'App version of the chart.', hash_key: "appVersion"
+ field :api_version, GraphQL::Types::String, null: false, description: 'API version of the chart.', hash_key: :apiVersion
+ field :app_version, GraphQL::Types::String, null: true, description: 'App version of the chart.', hash_key: :appVersion
field :condition, GraphQL::Types::String, null: true, description: 'Condition for the chart.'
field :dependencies, [Types::Packages::Helm::DependencyType], null: true, description: 'Dependencies of the chart.'
field :deprecated, GraphQL::Types::Boolean, null: true, description: 'Indicates if the chart is deprecated.'
@@ -19,12 +19,12 @@ module Types
field :home, GraphQL::Types::String, null: true, description: 'URL of the home page.'
field :icon, GraphQL::Types::String, null: true, description: 'URL to an SVG or PNG image for the chart.'
field :keywords, [GraphQL::Types::String], null: true, description: 'Keywords for the chart.'
- field :kube_version, GraphQL::Types::String, null: true, description: 'Kubernetes versions for the chart.', hash_key: "kubeVersion"
+ field :kube_version, GraphQL::Types::String, null: true, description: 'Kubernetes versions for the chart.', hash_key: :kubeVersion
field :maintainers, [Types::Packages::Helm::MaintainerType], null: true, description: 'Maintainers of the chart.'
field :name, GraphQL::Types::String, null: false, description: 'Name of the chart.'
field :sources, [GraphQL::Types::String], null: true, description: 'URLs of the source code for the chart.'
field :tags, GraphQL::Types::String, null: true, description: 'Tags for the chart.'
- field :type, GraphQL::Types::String, null: true, description: 'Type of the chart.', hash_key: "appVersion"
+ field :type, GraphQL::Types::String, null: true, description: 'Type of the chart.', hash_key: :appVersion
field :version, GraphQL::Types::String, null: false, description: 'Version of the chart.'
end
end
diff --git a/app/graphql/types/packages/package_base_type.rb b/app/graphql/types/packages/package_base_type.rb
index cc41169bcda..aa580d48709 100644
--- a/app/graphql/types/packages/package_base_type.rb
+++ b/app/graphql/types/packages/package_base_type.rb
@@ -23,6 +23,7 @@ module Types
field :package_type, Types::Packages::PackageTypeEnum, null: false, description: 'Package type.'
field :project, Types::ProjectType, null: false, description: 'Project where the package is stored.'
field :status, Types::Packages::PackageStatusEnum, null: false, description: 'Package status.'
+ field :status_message, GraphQL::Types::String, null: true, description: 'Status message.'
field :tags, Types::Packages::PackageTagType.connection_type, null: true, description: 'Package tags.'
field :updated_at, Types::TimeType, null: false, description: 'Date of most recent update.'
field :version, GraphQL::Types::String, null: true, description: 'Version string.'
diff --git a/app/graphql/types/packages/package_type.rb b/app/graphql/types/packages/package_type.rb
index f6586670c72..4c5b16cc41e 100644
--- a/app/graphql/types/packages/package_type.rb
+++ b/app/graphql/types/packages/package_type.rb
@@ -10,6 +10,7 @@ module Types
field :pipelines,
resolver: Resolvers::PackagePipelinesResolver,
+ connection_extension: Gitlab::Graphql::Extensions::ExternallyPaginatedArrayExtension,
description: <<-DESC
Pipelines that built the package. Max page size #{Resolvers::PackagePipelinesResolver::MAX_PAGE_SIZE}.
DESC
diff --git a/app/graphql/types/packages/protection/rule_access_level_enum.rb b/app/graphql/types/packages/protection/rule_access_level_enum.rb
new file mode 100644
index 00000000000..098a3e48100
--- /dev/null
+++ b/app/graphql/types/packages/protection/rule_access_level_enum.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module Types
+ module Packages
+ module Protection
+ class RuleAccessLevelEnum < BaseEnum
+ graphql_name 'PackagesProtectionRuleAccessLevel'
+ description 'Access level of a package protection rule resource'
+
+ ::Packages::Protection::Rule.push_protected_up_to_access_levels.each_key do |access_level_key|
+ value access_level_key.upcase, value: access_level_key.to_s,
+ description: "#{access_level_key.capitalize} access."
+ end
+ end
+ end
+ end
+end
diff --git a/app/graphql/types/packages/protection/rule_package_type_enum.rb b/app/graphql/types/packages/protection/rule_package_type_enum.rb
new file mode 100644
index 00000000000..28e9df76adc
--- /dev/null
+++ b/app/graphql/types/packages/protection/rule_package_type_enum.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module Types
+ module Packages
+ module Protection
+ class RulePackageTypeEnum < BaseEnum
+ graphql_name 'PackagesProtectionRulePackageType'
+ description 'Package type of a package protection rule resource'
+
+ ::Packages::Protection::Rule.package_types.each_key do |package_type|
+ value package_type.upcase, value: package_type,
+ description: "Packages of the #{package_type} format"
+ end
+ end
+ end
+ end
+end
diff --git a/app/graphql/types/packages/protection/rule_type.rb b/app/graphql/types/packages/protection/rule_type.rb
new file mode 100644
index 00000000000..1e969d39ce2
--- /dev/null
+++ b/app/graphql/types/packages/protection/rule_type.rb
@@ -0,0 +1,33 @@
+# frozen_string_literal: true
+
+module Types
+ module Packages
+ module Protection
+ class RuleType < ::Types::BaseObject
+ graphql_name 'PackagesProtectionRule'
+ description 'A packages protection rule designed to protect packages ' \
+ 'from being pushed by users with a certain access level.'
+
+ authorize :admin_package
+
+ field :package_name_pattern,
+ GraphQL::Types::String,
+ null: false,
+ description:
+ 'Package name protected by the protection rule. For example `@my-scope/my-package-*`. ' \
+ 'Wildcard character `*` allowed.'
+
+ field :package_type,
+ Types::Packages::Protection::RulePackageTypeEnum,
+ null: false,
+ description: 'Package type protected by the protection rule. For example `NPM`.'
+
+ field :push_protected_up_to_access_level,
+ Types::Packages::Protection::RuleAccessLevelEnum,
+ null: false,
+ description:
+ 'Max GitLab access level unable to push a package. For example `DEVELOPER`, `MAINTAINER`, `OWNER`.'
+ end
+ end
+ end
+end