Package Registry GraphQL API
This issue is dedicated to collect all the necessary work to implement the Package Registry GraphQL API
There is a need for 3 different endpoints
:notebook: All the values are written in `snake_case` but they will need to be implemented in `pascalCase`
## Work to be done
- [x] Project level endpoint returns all the needed data
- [x] Group level endpoint returns all the needed data
- [x] Search for list endpoint
- [-] Sorting for list endpoint
- [x] Sorting for basic fields
- [x] Sorting by project name in group query
- [x] Composer details query
- [x] Conan details query
- [x] Maven details query
- [x] Nuget details query
- [x] NPM details query
- [x] PiPy details query
- [x] Generic Packages details query
- [ ] Ruby Gems details query
- [ ] Terraform details query
- [ ] Debian details query
- [x] Delete Package
- [x] Delete package file
## Project and Group level package list query
We already have a `project` level endpoint and a `group` level one
Both endpoint should support:
- Search by name
- Sort by
- Pagination
Both endpoint should return:
- id
- created_at
- name
- packag_type
- updated_at
- version
- tags
- id
- name
- created_at
- updated_at
We should also add a `total_packages` attribute to the `project` and `group` queries
### Remaining work
- add `tags` attribute to `project` and `group` Packages queries
- add Search
- add Sort
- verify if we can use 'normal' pagination and not cursor based one
- add `total_packages` attribute to `project` and `group` queries
## Package details query
We should have a `namespace` agnostic endpoint that given an `id` of a package returns its details, we should return:
- id
- created_at
- name
- package_files
- created_at
- download_path
- file_name
- size
- package_type
- project_id
- tags (this is npm specific, we should check if is worth to be moved to his own npm metadatum)
- id
- name
- created_at
- updated_at
- updated_at
- version
- dependency_links
- name
- version_pattern
- target_framework
- versions (see [rest api docs](https://docs.gitlab.com/ee/api/packages.html#get-a-project-package))
- pipelines (a list of all the pipelines attached to the package)
- created_at
- id
- sha
- ref
- git_commit_message
- user
- avatar_url
- name
- project
- name
- web_url
- pipeline_url
- commit_url
This is a 1:1 carbon copy of what our controllers are returning, but we should be able to recycle already existing graphqlTypes, for example for `user` and `project` for a complete overview please check the pakcage presenter folder:
https://gitlab.com/gitlab-org/gitlab/-/tree/a1f81a8843521f501d528a489ca19ffcfdb89c0e/app/presenters/packages
Plus we should have the `metadatum` of each package type:
### Composer
- target_sha
- composer_json
- name
- type
- license
- version
### Conan
- id
- created_at
- updated_at
- package_username
- package_channel
- package_name (currently this is returned outside the `metadatum`, but it should be inside)
### Maven
- id
- created_at
- updated_at
- app_group
- app_name
- app_version
- path
### Nuget
- license_url
- project_url
- icon_url
## Delete mutation
We also need a mutation that takes in input a package_id and deletes it, ~~we should keep in mind that this action can be ran both from the list and the details page, we may want to consider if to return an updated 'page' for the list.~~
epic