diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /app/graphql/types/packages/package_details_type.rb | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'app/graphql/types/packages/package_details_type.rb')
-rw-r--r-- | app/graphql/types/packages/package_details_type.rb | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/app/graphql/types/packages/package_details_type.rb b/app/graphql/types/packages/package_details_type.rb index 5ac80860fe2..1d2cf9649d8 100644 --- a/app/graphql/types/packages/package_details_type.rb +++ b/app/graphql/types/packages/package_details_type.rb @@ -3,6 +3,8 @@ module Types module Packages class PackageDetailsType < PackageType + include ::PackagesHelper + graphql_name 'PackageDetailsType' description 'Represents a package details in the Package Registry. Note that this type is in beta and susceptible to changes' authorize :read_package @@ -21,9 +23,58 @@ module Types description: 'Pipelines that built the package.', deprecated: { reason: 'Due to scalability concerns, this field is going to be removed', milestone: '14.6' } + field :composer_config_repository_url, GraphQL::Types::String, null: true, description: 'Url of the Composer setup endpoint.' + field :composer_url, GraphQL::Types::String, null: true, description: 'Url of the Composer endpoint.' + field :conan_url, GraphQL::Types::String, null: true, description: 'Url of the Conan project endpoint.' + field :maven_url, GraphQL::Types::String, null: true, description: 'Url of the Maven project endpoint.' + field :npm_url, GraphQL::Types::String, null: true, description: 'Url of the NPM project endpoint.' + field :nuget_url, GraphQL::Types::String, null: true, description: 'Url of the Nuget project endpoint.' + field :pypi_setup_url, GraphQL::Types::String, null: true, description: 'Url of the PyPi project setup endpoint.' + field :pypi_url, GraphQL::Types::String, null: true, description: 'Url of the PyPi project endpoint.' + def versions object.versions end + + def package_files + if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml) + object.installable_package_files + else + object.package_files + end + end + + def composer_config_repository_url + composer_config_repository_name(object.project.group&.id) + end + + def composer_url + composer_registry_url(object.project.group&.id) + end + + def conan_url + package_registry_project_url(object.project.id, :conan) + end + + def maven_url + package_registry_project_url(object.project.id, :maven) + end + + def npm_url + package_registry_project_url(object.project.id, :npm) + end + + def nuget_url + nuget_package_registry_url(object.project.id) + end + + def pypi_setup_url + package_registry_project_url(object.project.id, :pypi) + end + + def pypi_url + pypi_registry_url(object.project.id) + end end end end |