feat(api): list all packages for site administrators (#38968)

Add `GET /admin/packages` so site administrators can review packages
across every owner without querying each owner separately.

It returns the same package version representation as `GET
/packages/{owner}` and supports `page`, `limit`, `type`, and `q`
filters.

---
Assisted by Codet(DeepSeek)

---------

Signed-off-by: bircni <bircni@icloud.com>
Signed-off-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: bircni <bircni@icloud.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Lunny Xiao
2026-08-22 09:29:25 +02:00
committed by GitHub
co-authored by bircni wxiaoguang
parent 2d6fea5bdf
commit f7072b0305
5 changed files with 277 additions and 0 deletions
+75
View File
@@ -11685,6 +11685,81 @@
]
}
},
"/admin/packages": {
"get": {
"operationId": "adminListPackages",
"parameters": [
{
"description": "page number of results to return (1-based)",
"in": "query",
"name": "page",
"schema": {
"type": "integer"
}
},
{
"description": "page size of results",
"in": "query",
"name": "limit",
"schema": {
"type": "integer"
}
},
{
"description": "package type filter",
"in": "query",
"name": "type",
"schema": {
"enum": [
"alpine",
"cargo",
"chef",
"composer",
"conan",
"conda",
"container",
"cran",
"debian",
"generic",
"go",
"helm",
"maven",
"npm",
"nuget",
"pub",
"pypi",
"rpm",
"rubygems",
"swift",
"terraform",
"vagrant"
],
"type": "string"
}
},
{
"description": "name filter",
"in": "query",
"name": "q",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"$ref": "#/components/responses/PackageList"
},
"403": {
"$ref": "#/components/responses/forbidden"
}
},
"summary": "List all packages",
"tags": [
"admin"
]
}
},
"/admin/unadopted": {
"get": {
"operationId": "adminUnadoptedList",