update add openapi api

This commit is contained in:
xiongxiao
2026-01-16 13:03:57 +08:00
parent a8f2cb14a7
commit 7787337f13
32 changed files with 39023 additions and 43 deletions

View File

@@ -0,0 +1,300 @@
{
"swagger": "2.0",
"info": {
"title": "CNB OPENAPI",
"contact": {
"name": "Open API Support",
"url": "https://docs.cnb.cool/",
"email": "cnb@tencent.com"
},
"version": "1.0"
},
"paths": {
"/{slug}/-/outside-collaborators": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Members",
"Collaborators"
],
"summary": "获取指定仓库内的外部贡献者。List external contributors in specified repository.",
"operationId": "ListOutsideCollaborators",
"parameters": [
{
"type": "string",
"description": "slug",
"name": "slug",
"in": "path",
"required": true
},
{
"type": "integer",
"default": 1,
"description": "Pagination page number",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 10,
"description": "Pagination page size",
"name": "page_size",
"in": "query"
},
{
"enum": [
"Guest",
"Reporter",
"Developer",
"Master"
],
"type": "string",
"description": "Role",
"name": "role",
"in": "query"
},
{
"type": "string",
"default": "",
"description": "过滤成员。Filter by member.",
"name": "search",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.OutsideCollaboratorInRepo"
}
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-manage:r"
}
},
"/{slug}/-/outside-collaborators/{username}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Members",
"Collaborators"
],
"summary": "更新指定仓库的外部贡献者权限信息。 Update permission information for external contributors in specified repository.",
"operationId": "UpdateOutsideCollaborators",
"parameters": [
{
"type": "string",
"description": "slug",
"name": "slug",
"in": "path",
"required": true
},
{
"type": "string",
"description": "username",
"name": "username",
"in": "path",
"required": true
},
{
"enum": [
"Guest",
"Reporter",
"Developer"
],
"type": "string",
"description": "Role",
"name": "role",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-manage:rw"
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Members",
"Collaborators"
],
"summary": "删除指定仓库的外部贡献者。Removes external contributors from specified repository.",
"operationId": "DeleteOutsideCollaborators",
"parameters": [
{
"type": "string",
"description": "slug",
"name": "slug",
"in": "path",
"required": true
},
{
"type": "string",
"description": "username",
"name": "username",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-manage:rw"
}
}
},
"definitions": {
"dto.OutsideCollaboratorInRepo": {
"type": "object",
"properties": {
"access_level": {
"$ref": "#/definitions/constant.AccessRole"
},
"avatar": {
"type": "string"
},
"created_at": {
"type": "string"
},
"email": {
"type": "string"
},
"freeze": {
"type": "boolean"
},
"id": {
"type": "string"
},
"join_time": {
"type": "string"
},
"locked": {
"type": "boolean"
},
"nickname": {
"type": "string"
},
"type": {
"$ref": "#/definitions/constant.UserType"
},
"username": {
"type": "string"
},
"verified": {
"description": "认证类型",
"type": "integer"
},
"verified_expire_in": {
"description": "认证过期时间",
"type": "string"
}
}
},
"constant.AccessRole": {
"type": "string",
"enum": [
"Unknown",
"Guest",
"Reporter",
"Developer",
"Master",
"Owner"
],
"x-enum-comments": {
"Anonymous": "Anonymous 匿名",
"DEVELOPER": "DEVELOPER 开发",
"Guest": "Guest 访客",
"MASTER": "MASTER 管理",
"OWNER": "OWNER 负责人",
"REPORTER": "REPORTER 助手"
},
"x-enum-descriptions": [
"Anonymous 匿名",
"Guest 访客",
"REPORTER 助手",
"DEVELOPER 开发",
"MASTER 管理",
"OWNER 负责人"
],
"x-enum-varnames": [
"Anonymous",
"Guest",
"REPORTER",
"DEVELOPER",
"MASTER",
"OWNER"
]
},
"constant.UserType": {
"type": "integer",
"format": "int32",
"enum": [
0,
1,
2,
3,
4
],
"x-enum-comments": {
"IoaUser": "IoaUser ioa 用户",
"OauthUser": "OauthUser oauth 授权用户",
"RobotUser": "RobotUser 助手用户",
"TestUser": "TestUser 测试用户",
"WeChatUser": "WeChatUser 微信用户"
},
"x-enum-descriptions": [
"WeChatUser 微信用户",
"OauthUser oauth 授权用户",
"TestUser 测试用户",
"RobotUser 助手用户",
"IoaUser ioa 用户"
],
"x-enum-varnames": [
"WeChatUser",
"OauthUser",
"TestUser",
"RobotUser",
"IoaUser"
]
}
}
}