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

@@ -7,17 +7,21 @@ description: 创建一个基本的新的代码仓库,并自动添加必要的
该技能用于创建一个新的代码仓库,并自动添加必要的配置文件,如 `.cnb.yml`
## 调用工具链
## 应用的步骤
1. 执行`create-repo`工具,参数是/group/repo_name例如 `kevisual/my-new-repo`
2. 工具会自动创建一个新的代码仓库
3. 创建完成后,地址就是这个 /group/repo_name例如 `kevisual/my-new-repo`
4. 添加.cnb.yml配置文件调用create-repo-file工具
1. 执行`create-repo`工具,参数是`/group/repo_name`,例如 `kevisual/my-new-repo`
2. 调用`create-repo-file`工具, 添加`.cnb.yml`配置文件,其中仓库名称是第一步的仓库参数。
### .cnb.yml配置文件内容示例
新仓库名称为 REPO_NAME(为其中的group/repo_name的repo_name部分)
## 要求
1. 不要做任何多余的事情,只做相关的任务,不要额外的解释和说明。
2. 如果执行错误,只返回错误信息。
2. 确保`.cnb.yml`文件内容正确无误。
TO_REPO 为 kevisual/REPO_NAME
## 注意事项
### 1. `.cnb.yml配置文件内容示例`
TO_REPO 为 kevisual/repo_name
```yaml
# .cnb.yml

View File

@@ -27,48 +27,53 @@ app.route({
if (!name) {
ctx.throw(400, '缺少参数 name');
}
try {
const res = await cnb.repo.createRepo({
name,
visibility,
description,
});
ctx.forward(res);
const res = await cnb.repo.createRepo({
name,
visibility,
description,
});
ctx.forward(res);
} catch (error) {
ctx.code = 200
ctx.body = { content: 'JS仓库可能已存在' }
}
}).addTo(app);
app.route({
path: 'cnb',
key: 'create-repo-file',
description: '在代码仓库中创建文件, name, path, content, encoding',
description: '在代码仓库中创建文件, repoName, filePath, content, encoding',
middleware: ['auth'],
metadata: {
tags: ['opencode'],
...createSkill({
skill: 'create-repo-file',
title: '在代码仓库中创建文件',
summary: `在代码仓库中创建文件, encoding 可选,默认 raw`,
args: {
name: tool.schema.string().describe('代码仓库名称'),
path: tool.schema.string().describe('文件路径, 如 src/index.ts'),
content: tool.schema.string().describe('文内容'),
encoding: tool.schema.string().describe('编码方式, 默认为 raw').optional(),
repoName: tool.schema.string().describe('代码仓库名称, 如 my-user/my-repo'),
filePath: tool.schema.string().describe('文件路径, 如 src/index.ts'),
content: tool.schema.string().describe('文本的字符串的内容'),
encoding: tool.schema.string().describe('编码方式,如 raw').optional(),
},
summary: '在代码仓库中创建文件',
})
}
}).define(async (ctx) => {
const name = ctx.query?.name;
const path = ctx.query?.path;
const repoName = ctx.query?.repoName;
const filePath = ctx.query?.filePath;
const content = ctx.query?.content;
const encoding = ctx.query?.encoding ?? 'raw';
if (!name || !path || !content) {
ctx.throw(400, '缺少参数 name, path 或 content');
if (!repoName || !filePath || !content) {
ctx.throw(400, '缺少参数 repoName, filePath 或 content');
}
const res = await cnb.repo.createCommit(name, {
message: `添加文件 ${path} 通过 API `,
const res = await cnb.repo.createCommit(repoName, {
message: `添加文件 ${filePath} 通过 API `,
files: [
{ path, content, encoding },
{ path: filePath, content, encoding },
],
});
ctx.forward(res);

View File

@@ -0,0 +1,387 @@
{
"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": {
"/users/{username}/activities": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Activities"
],
"summary": "获取个人动态活跃详情汇总。Get user activities by date.",
"operationId": "GetUserActivitiesByDate",
"parameters": [
{
"type": "string",
"description": "UserName",
"name": "username",
"in": "path",
"required": true
},
{
"type": "string",
"description": "查询日期,格式 yyyyMM或者 yyyyMMdd",
"name": "date",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.ActivityDate"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \naccount-engage:r"
}
},
"/users/{username}/repo-activities/{activityType}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Activities"
],
"summary": "个人仓库动态详情列表。List of personal repository activity details.",
"operationId": "GetUserRepoActivityDetails",
"parameters": [
{
"type": "string",
"description": "UserName",
"name": "username",
"in": "path",
"required": true
},
{
"enum": [
"issue",
"pull_request",
"code_review"
],
"type": "string",
"description": "activity type",
"name": "activityType",
"in": "path",
"required": true
},
{
"type": "string",
"description": "仓库路径",
"name": "slug",
"in": "query",
"required": true
},
{
"type": "string",
"description": "查询日期,格式 yyyyMM或者 yyyyMMdd",
"name": "date",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "返回 []dto.ActivityPullRequestDetail|[]dto.ActivityIssueDetail",
"schema": {
"type": "array",
"items": {}
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \naccount-engage:r"
}
},
"/{repo}/-/top-activity-users": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Activities"
],
"summary": "获取仓库 top 活跃用户。List the top active users",
"operationId": "TopContributors",
"parameters": [
{
"type": "string",
"description": "repo",
"name": "repo",
"in": "path",
"required": true
},
{
"maximum": 10,
"minimum": 1,
"type": "integer",
"default": 5,
"description": "返回的用户个数",
"name": "top",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.UsersResult"
}
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-base-info:r"
}
}
},
"definitions": {
"dto.ActivityDate": {
"type": "object",
"properties": {
"code_review_count": {
"type": "integer"
},
"code_reviews": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.ActivityRepoDetail"
}
},
"commit_count": {
"type": "integer"
},
"commits": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.ActivityRepoDetail"
}
},
"group_count": {
"type": "integer"
},
"groups": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.ActivityJoinGroupDetail"
}
},
"issues": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.ActivityRepoDetail"
}
},
"issues_count": {
"type": "integer"
},
"private_score": {
"type": "integer"
},
"pull_request_count": {
"type": "integer"
},
"pull_requests": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.ActivityRepoDetail"
}
},
"repo_count": {
"type": "integer"
},
"repos": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.ActivityCreateRepoDetail"
}
}
}
},
"dto.UsersResult": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"appreciate_status": {
"description": "用户赞赏码状态0-无赞赏码1-有",
"type": "integer"
},
"avatar": {
"type": "string"
},
"bio": {
"type": "string"
},
"company": {
"type": "string"
},
"created_at": {
"type": "string"
},
"email": {
"type": "string"
},
"follow_count": {
"type": "integer"
},
"follow_mission_count": {
"type": "integer"
},
"follow_repo_count": {
"type": "integer"
},
"follower_count": {
"type": "integer"
},
"freeze": {
"type": "boolean"
},
"gender": {
"type": "integer"
},
"group_count": {
"type": "integer"
},
"id": {
"type": "string"
},
"is_following": {
"description": "查询人是否follow了此用户",
"type": "boolean"
},
"location": {
"type": "string"
},
"locked": {
"type": "boolean"
},
"mission_count": {
"type": "integer"
},
"nickname": {
"type": "string"
},
"public_mission_count": {
"type": "integer"
},
"public_registry_count": {
"type": "integer"
},
"public_repo_count": {
"type": "integer"
},
"readme_repo_path": {
"type": "string",
"readOnly": true
},
"registry_count": {
"type": "integer"
},
"repo_count": {
"type": "integer"
},
"reward_amount": {
"type": "integer"
},
"reward_count": {
"type": "integer"
},
"site": {
"type": "string"
},
"stars_count": {
"type": "integer"
},
"type": {
"$ref": "#/definitions/constant.UserType"
},
"username": {
"type": "string"
},
"verified": {
"description": "认证类型",
"type": "integer"
},
"verified_expire_in": {
"description": "认证过期时间",
"type": "string"
},
"wechat_mp": {
"type": "string"
},
"wechat_mp_qrcode": {
"type": "string"
}
}
},
"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"
]
}
}
}

200
docs/api-groups/ai/api.json Normal file
View File

@@ -0,0 +1,200 @@
{
"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": {
"/{repo}/-/ai/chat/completions": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"AI"
],
"summary": "AI 对话。调用者需有代码写权限CI 中使用 CNB_TOKEN 不检查写权限。AI chat completions. Requires caller to have repo write permission (except when using CNB_TOKEN in CI).",
"operationId": "AiChatCompletions",
"parameters": [
{
"type": "string",
"description": "仓库完整路径",
"name": "repo",
"in": "path",
"required": true
},
{
"description": "AI chat completions params. The params may differ by model.",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.AiChatCompletionsReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.AiChatCompletionsResult"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-code:r"
}
},
"/{repo}/-/build/ai/auto-pr": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"AI"
],
"summary": "根据传入的需求内容和需求标题借助 AI 自动编码并提 PR。Automatically code and create a PR with AI based on the input requirement content and title.",
"operationId": "AiAutoPr",
"parameters": [
{
"type": "string",
"description": "仓库完整路径",
"name": "repo",
"in": "path",
"required": true
},
{
"description": "AI auto PR params",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.AiAutoPrReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.AiAutoPrResult"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-code:rw"
}
}
},
"definitions": {
"dto.AiChatCompletionsReq": {
"type": "object",
"properties": {
"messages": {
"description": "对话内容",
"type": "array",
"items": {
"$ref": "#/definitions/dto.Message"
}
},
"model": {
"description": "模型名称",
"type": "string"
},
"stream": {
"description": "是否流式返回结果,部分模型可能不支持非流式",
"type": "boolean"
}
}
},
"dto.AiChatCompletionsResult": {
"type": "object",
"properties": {
"choices": {
"description": "选择",
"type": "array",
"items": {
"$ref": "#/definitions/dto.AiChatCompletionsChoice"
}
},
"created": {
"description": "创建时间",
"type": "integer"
},
"id": {
"description": "ID",
"type": "string"
},
"model": {
"description": "模型",
"type": "string"
},
"object": {
"description": "对象",
"type": "string"
}
}
},
"dto.AiAutoPrReq": {
"type": "object",
"properties": {
"body": {
"description": "需求内容",
"type": "string"
},
"branch": {
"description": "基于该分支编码并提交代码到随机分支,然后将随机分支提 PR 到该分支",
"type": "string"
},
"source": {
"description": "需求来源,默认为 issue其他来源的需求可写上会出现在代码提交日志的描述信息里",
"type": "string"
},
"title": {
"description": "需求标题",
"type": "string"
},
"url": {
"description": "需求来源 URL 地址",
"type": "string"
}
}
},
"dto.AiAutoPrResult": {
"type": "object",
"properties": {
"buildLogUrl": {
"description": "构建链接",
"type": "string"
},
"message": {
"description": "message",
"type": "string"
},
"sn": {
"description": "构建号",
"type": "string"
}
}
}
}
}

View File

@@ -0,0 +1,158 @@
{
"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": {
"/{repo}/-/assets/{assetID}": {
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "通过 asset 记录 id 删除一个 assetrelease和commit附件不能通过该接口删除\n访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-manage:rw",
"tags": [
"Assets"
],
"summary": "通过 asset 记录 id 删除一个 asset",
"operationId": "DeleteAsset",
"parameters": [
{
"type": "string",
"description": "repo",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "integer",
"format": "int64",
"description": "asset id",
"name": "assetID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
},
"422": {
"description": "release和commit附件不能通过该接口删除",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
}
}
},
"/{slug}/-/list-assets": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Assets"
],
"summary": "仓库的 asset 记录列表",
"operationId": "ListAssets",
"parameters": [
{
"type": "string",
"description": "slug",
"name": "slug",
"in": "path",
"required": true
},
{
"type": "integer",
"default": 1,
"description": "第几页从1开始",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 10,
"description": "每页多少条数据",
"name": "page_size",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.AssetRecords"
}
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-manage:r"
}
}
},
"definitions": {
"die.WebError": {
"type": "object",
"properties": {
"errcode": {
"type": "integer"
},
"errmsg": {
"type": "string"
},
"errparam": {
"type": "object",
"additionalProperties": {}
}
}
},
"dto.AssetRecords": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"origin_path": {
"description": "来源地址,例如 release 附件的来源地址是对应的 release 页面。issue和pr文件没有。",
"type": "string"
},
"path": {
"type": "string"
},
"record_type": {
"description": "资源类型slug_img和slug_file可调用DeleteAsset接口直接删除该资源repo_release和repo_commit则不行",
"allOf": [
{
"$ref": "#/definitions/dto.AssetRecordType"
}
]
},
"referer": {
"type": "string"
},
"size_in_byte": {
"type": "integer"
}
}
}
}
}

View File

@@ -0,0 +1,265 @@
{
"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": {
"/{repo}/-/badge/git/{sha}/{badge}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Badge"
],
"summary": "获取徽章 svg 或 JSON 数据。Get badge svg or JSON data.",
"operationId": "GetBadge",
"parameters": [
{
"type": "string",
"description": "仓库完整路径",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "latest 或 commit 8 位短 hash例如 89d48c07",
"name": "sha",
"in": "path",
"required": true
},
{
"type": "string",
"description": "徽章名,例如 pr 事件徽章名为ci/status/pull_request, 如需获取 JSON 数据,可加上 .json 后缀ci/status/pull_request.json",
"name": "badge",
"in": "path",
"required": true
},
{
"description": "GetBadge params",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.GetBadgeReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.GetBadgeResult"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-commit-status:r"
}
},
"/{repo}/-/badge/list": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Badge"
],
"summary": "获取徽章列表数据。List badge data",
"operationId": "ListBadge",
"parameters": [
{
"type": "string",
"description": "仓库完整路径",
"name": "repo",
"in": "path",
"required": true
},
{
"description": "ListBadge params",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.ListBadgeReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.ListBadgeResult"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-commit-status:r"
}
},
"/{repo}/-/badge/upload": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Badge"
],
"summary": "上传徽章数据。Upload badge data",
"operationId": "UploadBadge",
"parameters": [
{
"type": "string",
"description": "仓库完整路径",
"name": "repo",
"in": "path",
"required": true
},
{
"description": "UploadBadge params",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.UploadBadgeReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.UploadBadgeResult"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-commit-status:rw"
}
}
},
"definitions": {
"dto.GetBadgeReq": {
"type": "object",
"properties": {
"branch": {
"description": "分支名例如main。不传则为默认分支获取默认分支最新徽章。传了分支名则获取该分支最新提交记录对应的徽章。",
"type": "string"
}
}
},
"dto.GetBadgeResult": {
"type": "object",
"properties": {
"color": {
"description": "徽章颜色",
"type": "string"
},
"label": {
"description": "徽章左侧显示内容",
"type": "string"
},
"link": {
"description": "徽章链接",
"type": "string"
},
"links": {
"description": "徽章链接列表",
"type": "array",
"items": {
"type": "string"
}
},
"message": {
"description": "徽章右侧显示内容",
"type": "string"
}
}
},
"dto.ListBadgeReq": {
"type": "object"
},
"dto.ListBadgeResult": {
"type": "object",
"properties": {
"badges": {
"description": "徽章列表",
"type": "array",
"items": {
"$ref": "#/definitions/dto.Badge"
}
}
}
},
"dto.UploadBadgeReq": {
"type": "object",
"properties": {
"key": {
"description": "徽章 key。目前允许上传的 key 包括security/tca",
"type": "string"
},
"latest": {
"description": "是否上传 latest 徽章。默认为 false不上传 latest仅上传 commitid 对应的徽章true上传 latest 和 commitid 对应的徽章",
"type": "boolean"
},
"link": {
"description": "点击徽章右侧的跳转链接",
"type": "string"
},
"message": {
"description": "徽章右侧显示内容",
"type": "string"
},
"sha": {
"description": "commit id",
"type": "string"
},
"value": {
"description": "徽章数值,不传默认用 message 代替",
"type": "integer"
}
}
},
"dto.UploadBadgeResult": {
"type": "object",
"properties": {
"latest_url": {
"description": "latest 对应的徽章 url 地址。如果没有传 latest: true则该字段为空字符串",
"type": "string"
},
"url": {
"description": "commitid 对应的徽章 url 地址",
"type": "string"
}
}
}
}
}

View File

@@ -0,0 +1,630 @@
{
"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": {
"/{repo}/-/build/crontab/sync/{branch}": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Build"
],
"summary": "同步仓库分支下的定时任务。 Synchronize the content under the repository branch.",
"operationId": "BuildCrontabSync",
"parameters": [
{
"type": "string",
"description": "repo",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Branch",
"name": "branch",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.BuildCommonResult"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-cnb-trigger:rw"
}
},
"/{repo}/-/build/logs": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Build"
],
"summary": "查询流水线构建列表。List pipeline builds.",
"operationId": "GetBuildLogs",
"parameters": [
{
"type": "string",
"description": "Repo path",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Start date in \"YYYY-MM-DD\" format, e.g. \"2024-12-01\"",
"name": "createTime",
"in": "query"
},
{
"type": "string",
"description": "End date in \"YYYY-MM-DD\" format, e.g. \"2024-12-01\"",
"name": "endTime",
"in": "query"
},
{
"type": "string",
"description": "Event name, e.g. \"push\"",
"name": "event",
"in": "query"
},
{
"type": "integer",
"description": "Pagination page number, default(1)",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "Pagination page size, default(30), max(100)",
"name": "pagesize",
"in": "query"
},
{
"type": "string",
"description": "Commit ID, e.g. \"2221d4535ec0c921bcd0858627c5025a871dd2b5\"",
"name": "sha",
"in": "query"
},
{
"type": "string",
"description": "Build SN, e.g. \"cnb-1qa-1i3f5ecau",
"name": "sn",
"in": "query"
},
{
"type": "string",
"description": "Source branch name, e.g. \"dev\"",
"name": "sourceRef",
"in": "query"
},
{
"type": "string",
"description": "Build status: \"pending\", \"success\", \"error\", \"cancel\"",
"name": "status",
"in": "query"
},
{
"type": "string",
"description": "Target branch name, e.g. \"main\"",
"name": "targetRef",
"in": "query"
},
{
"type": "string",
"description": "User ID",
"name": "userId",
"in": "query"
},
{
"type": "string",
"description": "Username",
"name": "userName",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.BuildLogsResult"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-cnb-trigger:r"
}
},
"/{repo}/-/build/logs/stage/{sn}/{pipelineId}/{stageId}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Build"
],
"summary": "查询流水线Stage详情。Get pipeline build stage detail.",
"operationId": "GetBuildStage",
"parameters": [
{
"type": "string",
"description": "Repo path",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "SN",
"name": "sn",
"in": "path",
"required": true
},
{
"type": "string",
"description": "PipelineId",
"name": "pipelineId",
"in": "path",
"required": true
},
{
"type": "string",
"description": "stageId",
"name": "stageId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.BuildStageResult"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-cnb-trigger:r"
}
},
"/{repo}/-/build/logs/{sn}": {
"delete": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Build"
],
"summary": "删除流水线日志内容。Delete pipeline logs content.",
"operationId": "BuildLogsDelete",
"parameters": [
{
"type": "string",
"description": "Repo path",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Sn",
"name": "sn",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.BuildCommonResult"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-cnb-trigger:rw"
}
},
"/{repo}/-/build/runner/download/log/{pipelineId}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"Build"
],
"summary": "流水线runner日志下载。Pipeline runner log download.",
"operationId": "BuildRunnerDownloadLog",
"parameters": [
{
"type": "string",
"description": "Repo path",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "PipelineId",
"name": "pipelineId",
"in": "path",
"required": true
}
],
"responses": {
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-cnb-trigger:r"
}
},
"/{repo}/-/build/start": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Build"
],
"summary": "开始一个构建。Start a build.",
"operationId": "StartBuild",
"parameters": [
{
"type": "string",
"description": "repo",
"name": "repo",
"in": "path",
"required": true
},
{
"description": "Build params",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.StartBuildReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.BuildResult"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-cnb-trigger:rw"
}
},
"/{repo}/-/build/status/{sn}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Build"
],
"summary": "查询流水线构建状态。Get pipeline build status.",
"operationId": "GetBuildStatus",
"parameters": [
{
"type": "string",
"description": "Repo path",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "SN",
"name": "sn",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.BuildStatusResult"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-cnb-trigger:r"
}
},
"/{repo}/-/build/stop/{sn}": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Build"
],
"summary": "停止一个构建。 Stop a build.",
"operationId": "StopBuild",
"parameters": [
{
"type": "string",
"description": "repo",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "SN",
"name": "sn",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.BuildResult"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-cnb-trigger:rw"
}
}
},
"definitions": {
"dto.BuildCommonResult": {
"type": "object",
"properties": {
"code": {
"description": "返回码0 表示成功1 表示失败",
"type": "integer"
},
"message": {
"description": "描述",
"type": "string"
}
}
},
"dto.BuildLogsResult": {
"type": "object",
"properties": {
"data": {
"description": "构建数据列表",
"type": "array",
"items": {
"$ref": "#/definitions/dto.LogInfo"
}
},
"init": {
"description": "当前仓库是否已经有构建记录1 表示有构建记录0 表示没有构建记录",
"type": "boolean"
},
"timestamp": {
"description": "当前时间戳",
"type": "integer"
},
"total": {
"description": "总数",
"type": "integer"
}
}
},
"dto.BuildStageResult": {
"type": "object",
"properties": {
"content": {
"description": "stage 日志内容,数组格式,一个元素表示一行日志",
"type": "array",
"items": {
"type": "string"
}
},
"duration": {
"description": "stage 耗时单位ms",
"type": "integer"
},
"endTime": {
"description": "stage 结束时间",
"type": "integer"
},
"error": {
"description": "stage 错误信息",
"type": "string"
},
"id": {
"description": "stage id",
"type": "string"
},
"name": {
"description": "stage 名称",
"type": "string"
},
"startTime": {
"description": "stage 开始时间",
"type": "integer"
},
"status": {
"description": "stage 状态: \"pending\", \"start\", \"success\", \"error\", \"cancel\", \"skipped\"",
"type": "string"
}
}
},
"die.WebError": {
"type": "object",
"properties": {
"errcode": {
"type": "integer"
},
"errmsg": {
"type": "string"
},
"errparam": {
"type": "object",
"additionalProperties": {}
}
}
},
"dto.StartBuildReq": {
"type": "object",
"properties": {
"branch": {
"description": "触发分支,默认为主分支",
"type": "string"
},
"config": {
"description": "指定配置文件内容yaml 格式",
"type": "string"
},
"env": {
"description": "环境变量,对象格式",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"event": {
"description": "事件名,必须是 api_trigger 或以 api_trigger_ 开头,默认为 `api_trigger`",
"type": "string"
},
"sha": {
"description": "commit id ,优先级比 tag 高,默认为分支最新提交记录",
"type": "string"
},
"sync": {
"description": "是否等待构建正式触发为false时会立刻返回 sn 和 buildLogUrl",
"type": "string"
},
"tag": {
"description": "触发 tag优先级比 branch 高",
"type": "string"
}
}
},
"dto.BuildResult": {
"type": "object",
"properties": {
"buildLogUrl": {
"description": "构建链接",
"type": "string"
},
"message": {
"description": "构建信息",
"type": "string"
},
"sn": {
"description": "构建号",
"type": "string"
},
"success": {
"description": "构建是否触发成功,不代表构建结果",
"type": "boolean"
}
}
},
"dto.BuildStatusResult": {
"type": "object",
"properties": {
"jsonConfig": {
"description": "解析后的流水线JSON格式配置内容",
"type": "string"
},
"pipelinesStatus": {
"description": "流水线的状态",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/dto.PipelineStatus"
}
},
"rawConfig": {
"description": "流水线原始配置内容",
"type": "string"
},
"status": {
"description": "构建状态",
"type": "string"
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
{
"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}/-/charge/special-amount": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "查看根组织的特权额度,需要根组织的 master 以上权限才可以查看\n访问令牌调用此接口需包含以下权限。Required permissions for access token. \ngroup-resource:r",
"tags": [
"Charge"
],
"summary": "查看特权额度",
"operationId": "GetSpecialAmount",
"parameters": [
{
"type": "string",
"description": "group slug",
"name": "slug",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.SpecialAmount"
}
}
}
}
}
},
"definitions": {
"dto.SpecialAmount": {
"type": "object",
"properties": {
"compute_build_corehour": {
"description": "云原生构建cpu核时",
"type": "integer"
},
"compute_build_desc": {
"type": "string"
},
"compute_build_expire": {
"description": "过期时间时为 null 时永久有效",
"type": "string"
},
"compute_build_gpu_corehour": {
"description": "云原生构建gpu核时",
"type": "integer"
},
"compute_build_gpu_desc": {
"type": "string"
},
"compute_build_gpu_expire": {
"description": "过期时间时为 null 时永久有效",
"type": "string"
},
"compute_develop_corehour": {
"description": "云原生开发cpu核时",
"type": "integer"
},
"compute_develop_desc": {
"type": "string"
},
"compute_develop_expire": {
"description": "过期时间时为 null 时永久有效",
"type": "string"
},
"compute_develop_gpu_corehour": {
"description": "云原生开发gpu核时",
"type": "integer"
},
"compute_develop_gpu_desc": {
"type": "string"
},
"compute_develop_gpu_expire": {
"description": "过期时间时为 null 时永久有效",
"type": "string"
},
"storage_git_desc": {
"type": "string"
},
"storage_git_expire": {
"description": "过期时间时为 null 时永久有效",
"type": "string"
},
"storage_git_gib": {
"description": "git存储空间",
"type": "integer"
},
"storage_object_desc": {
"type": "string"
},
"storage_object_expire": {
"description": "过期时间时为 null 时永久有效",
"type": "string"
},
"storage_object_gib": {
"description": "对象存储空间",
"type": "integer"
}
}
}
}
}

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"
]
}
}
}

View File

@@ -0,0 +1,56 @@
{
"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": {
"/events/{repo}/-/{date}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Event"
],
"summary": "获取仓库动态预签名地址并返回内容。Get events pre-signed URL and return content.",
"operationId": "GetEvents",
"parameters": [
{
"type": "string",
"description": "repo path",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "动态日期,支持按天或小时为维度获取,格式为yy-mm-dd-h or yy-mm-dd, eg:2025-09-11-5",
"name": "date",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
}
},
"definitions": {}
}

View File

@@ -0,0 +1,147 @@
{
"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": {
"/users/{username}/followers": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Followers"
],
"summary": "获取指定用户的粉丝列表。Get the followers list of specified user.",
"operationId": "GetFollowersByUserID",
"parameters": [
{
"type": "string",
"description": "Username",
"name": "username",
"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"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.UserFollowResult"
}
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \naccount-engage:r"
}
},
"/users/{username}/following": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Followers"
],
"summary": "获取指定用户的关注人列表。Get the list of users that the specified user is following.",
"operationId": "GetFollowingByUserID",
"parameters": [
{
"type": "string",
"description": "Username",
"name": "username",
"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"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.UserFollowResult"
}
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \naccount-engage:r"
}
}
},
"definitions": {
"dto.UserFollowResult": {
"type": "object",
"properties": {
"freeze": {
"type": "boolean"
},
"is_following": {
"description": "查询人是否follow了此用户",
"type": "boolean"
},
"locked": {
"type": "boolean"
},
"nickname": {
"type": "string"
},
"username": {
"type": "string"
}
}
}
}
}

2402
docs/api-groups/git/api.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,744 @@
{
"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": {
"/{repo}/-/settings/branch-protections": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"GitSettings"
],
"summary": "查询仓库保护分支规则列表。List branch protection rules.",
"operationId": "ListBranchProtections",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/api.BranchProtection"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-manage:r"
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"GitSettings"
],
"summary": "新增仓库保护分支规则。Create branch protection rule.",
"operationId": "PostBranchProtection",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
},
{
"description": "Branch Protection Form",
"name": "branch_protection_form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.BranchProtection"
}
}
],
"responses": {
"201": {
"description": "Created"
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-manage:rw"
}
},
"/{repo}/-/settings/branch-protections/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"GitSettings"
],
"summary": "查询仓库保护分支规则。Get branch protection rule.",
"operationId": "GetBranchProtection",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "保护分支规则唯一标识符。",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/api.BranchProtection"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-manage:r"
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"GitSettings"
],
"summary": "删除仓库保护分支规则。 Delete branch protection rule.",
"operationId": "DeleteBranchProtection",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "保护分支规则唯一标识符。",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-manage:rw"
},
"patch": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"GitSettings"
],
"summary": "更新仓库保护分支规则。Update branch protection rule.",
"operationId": "PatchBranchProtection",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "保护分支规则唯一标识符。",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Branch Protection Form",
"name": "branch_protection_form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.BranchProtection"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-manage:rw"
}
},
"/{repo}/-/settings/cloud-native-build": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [],
"tags": [
"GitSettings"
],
"summary": "查询仓库云原生构建设置。List pipeline settings.",
"operationId": "GetPipelineSettings",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/api.PipelineSettings"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-manage:r"
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"GitSettings"
],
"summary": "更新仓库云原生构建设置。Update pipeline settings.",
"operationId": "PutPipelineSettings",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
},
{
"description": "Cloud Native Build Form",
"name": "pipeline_form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.PipelineSettings"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-manage:rw"
}
},
"/{repo}/-/settings/pull-request": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"GitSettings"
],
"summary": "查询仓库合并请求设置。List pull request settings.",
"operationId": "GetPullRequestSettings",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/api.PullRequestSettings"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-manage:r"
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"GitSettings"
],
"summary": "更新仓库合并请求设置。Set pull request settings.",
"operationId": "PutPullRequestSettings",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
},
{
"description": "Pull Request Form",
"name": "pull_request_form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.PullRequestSettings"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-manage:rw"
}
},
"/{repo}/-/settings/push-limit": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"GitSettings"
],
"summary": "查询仓库推送设置。List push limit settings.",
"operationId": "GetPushLimitSettings",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/api.PushLimitSettings"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-manage:r"
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"GitSettings"
],
"summary": "设置仓库推送设置。Set push limit settings.",
"operationId": "PutPushLimitSettings",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
},
{
"description": "Push Limit Form",
"name": "push_limit_form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.PushLimitSettings"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-manage:rw"
}
}
},
"definitions": {
"api.BranchProtection": {
"type": "object",
"properties": {
"allow_creation": {
"description": "是否允许所有人创建保护分支。",
"type": "boolean"
},
"allow_deletions": {
"description": "是否允许所有人删除保护分支。",
"type": "boolean"
},
"allow_force_pushes": {
"description": "是否允许所有人强制推送。",
"type": "boolean"
},
"allow_master_creation": {
"description": "是否仅允许仓库管理员及负责人创建保护分支。",
"type": "boolean"
},
"allow_master_deletions": {
"description": "是否仅允许仓库管理员及负责人删除保护分支。",
"type": "boolean"
},
"allow_master_force_pushes": {
"description": "是否仅允许仓库管理员及负责人强制推送。",
"type": "boolean"
},
"allow_master_manual_merge": {
"description": "是否允许仓库管理员及负责人手动合并到目标分支。",
"type": "boolean"
},
"allow_master_pushes": {
"description": "是否仅允许仓库管理员及负责人推送代码到保护分支中。",
"type": "boolean"
},
"allow_pushes": {
"description": "是否允许所有人推送代码到保护分支中。",
"type": "boolean"
},
"id": {
"description": "保护分支规则唯一标识符。",
"type": "string"
},
"required_approved_review_count": {
"description": "需要的代码评审者数量。格式:`评审者数量 ∈ [1,5]`",
"type": "integer"
},
"required_approved_review_ratio": {
"description": "需要的评审通过率。格式:`通过率 ∈ [1, 100]`",
"type": "integer"
},
"required_linear_history": {
"description": "是否仅允许线性提交。",
"type": "boolean"
},
"required_master_approve": {
"description": "是否需至少一个仓库管理员批准。",
"type": "boolean"
},
"required_must_auto_merge": {
"description": "是否仅允许自动合并。",
"type": "boolean"
},
"required_must_push_via_pull_request": {
"description": "是否必须通过合并请求推送代码到此规则匹配分支中。",
"type": "boolean"
},
"required_pull_request_reviews": {
"description": "保护分支的合并请求是否需要代码评审。",
"type": "boolean"
},
"required_status_checks": {
"description": "是否需要通过状态检查。",
"type": "boolean"
},
"rule": {
"description": "保护分支规则名称,支持通配符。",
"type": "string"
}
}
},
"die.WebError": {
"type": "object",
"properties": {
"errcode": {
"type": "integer"
},
"errmsg": {
"type": "string"
},
"errparam": {
"type": "object",
"additionalProperties": {}
}
}
},
"api.PipelineSettings": {
"type": "object",
"properties": {
"auto_trigger": {
"description": "是否允许仓库按照.cnb.yml配置自动触发云原生构建。",
"type": "boolean"
},
"forked_repo_auto_trigger": {
"description": "是否允许本仓Fork出来的仓库按照.cnb.yml配置自动触发云原生构建。",
"type": "boolean"
}
}
},
"api.PullRequestSettings": {
"type": "object",
"properties": {
"allow_merge_commit_merge": {
"description": "是否允许直接提交合并。",
"type": "boolean"
},
"allow_rebase_merge": {
"description": "是否允许变基合并。",
"type": "boolean"
},
"allow_squash_merge": {
"description": "是否允许压缩合并。",
"type": "boolean"
},
"master_auto_as_reviewer": {
"description": "是否允许自动添加仓库管理员为评审者。",
"type": "boolean"
},
"merge_commit_message_style": {
"description": "直接提交合并操作时默认生成的提交信息内容。可选值:`default`,`pull_request_title`,`pull_request_title_with_body`",
"type": "string"
},
"squash_commit_message_style": {
"description": "压缩合并操作时默认生成的提交信息内容。可选值:`default`,`pull_request_title`,`pull_request_title_with_body`",
"type": "string"
}
}
},
"api.PushLimitSettings": {
"type": "object",
"properties": {
"allow_single_push_number": {
"description": "允许单次推送最多允许更新分支和标签的个数数量。",
"type": "integer"
},
"check_single_push_number": {
"description": "是否开启单次更新分支和标签的个数限制。",
"type": "boolean"
},
"only_master_can_push_tag": {
"description": "是否仅允许负责人和管理员推送或删除标签、创建或删除版本。",
"type": "boolean"
},
"push_commit_must_be": {
"description": "推送提交到仓库,对提交作者和提交人进行检查。可选值:`any`,`registered`,`pusher`",
"type": "string"
}
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,348 @@
{
"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": {
"/{repo}/-/knowledge/base": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"KnowledgeBase"
],
"summary": "获取知识库信息",
"operationId": "GetKnowledgeBaseInfo",
"parameters": [
{
"type": "string",
"description": "repo",
"name": "repo",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.KnowledgeBaseInfoRes"
}
},
"404": {
"description": "Not Found"
},
"500": {
"description": "Internal Server Error"
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-code:r"
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"KnowledgeBase"
],
"summary": "删除知识库",
"operationId": "DeleteKnowledgeBase",
"parameters": [
{
"type": "string",
"description": "repo",
"name": "repo",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
},
"404": {
"description": "Not Found"
},
"500": {
"description": "Internal Server Error"
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-code:rw"
}
},
"/{repo}/-/knowledge/base/query": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"KnowledgeBase"
],
"summary": "查询知识库使用文档https://docs.cnb.cool/zh/ai/knowledge-base.html",
"operationId": "QueryKnowledgeBase",
"parameters": [
{
"type": "string",
"description": "repo",
"name": "repo",
"in": "path",
"required": true
},
{
"description": "查询内容",
"name": "query",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.QueryKnowledgeBaseReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.QueryKnowledgeBaseRes"
}
}
},
"400": {
"description": "Bad Request"
},
"500": {
"description": "Internal Server Error"
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-code:r"
}
},
"/{repo}/-/knowledge/embedding/models": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"KnowledgeBase"
],
"summary": "获取当前支持的 Embedding 模型列表",
"operationId": "GetModels",
"parameters": [
{
"type": "string",
"description": "repo",
"name": "repo",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.EmbeddingModel"
}
}
},
"400": {
"description": "Bad Request"
},
"500": {
"description": "Internal Server Error"
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-code:r"
}
}
},
"definitions": {
"dto.KnowledgeBaseInfoRes": {
"type": "object",
"properties": {
"embedding_model": {
"$ref": "#/definitions/dto.EmbeddingModels"
},
"exclude": {
"type": "string"
},
"id": {
"type": "string"
},
"include": {
"type": "string"
},
"issue_last_sync_time": {
"type": "string"
},
"issue_sync_enabled": {
"type": "boolean"
},
"last_commit_sha": {
"type": "string"
},
"metadata": {
"$ref": "#/definitions/dto.KnowledgeBaseMetadata"
},
"statistics": {
"$ref": "#/definitions/dto.DocumentStatistics"
}
}
},
"dto.QueryKnowledgeBaseReq": {
"type": "object",
"properties": {
"metadata_filtering_conditions": {
"description": "元数据过滤条件",
"allOf": [
{
"$ref": "#/definitions/dto.MetadataFilteringConditions"
}
]
},
"query": {
"description": "查询语句",
"type": "string"
},
"score_threshold": {
"description": "分数阈值",
"type": "number"
},
"top_k": {
"description": "返回结果的数量",
"type": "integer"
}
}
},
"dto.QueryKnowledgeBaseRes": {
"type": "object",
"properties": {
"chunk": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": true
},
"score": {
"type": "number"
}
}
},
"dto.EmbeddingModel": {
"type": "object",
"properties": {
"dimension": {
"type": "integer"
},
"name": {
"type": "string"
}
}
},
"dto.EmbeddingModels": {
"type": "object",
"properties": {
"dimension": {
"type": "integer"
},
"name": {
"type": "string"
}
}
},
"dto.KnowledgeBaseMetadata": {
"type": "object",
"properties": {
"issue": {
"$ref": "#/definitions/dto.IssueConfig"
},
"processing": {
"$ref": "#/definitions/dto.ProcessingConfig"
},
"version": {
"type": "string"
}
}
},
"dto.DocumentStatistics": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"size": {
"type": "integer"
}
}
},
"dto.IssueConfig": {
"type": "object",
"properties": {
"labels": {
"description": "逗号分隔的标签字符串,如 \"bug,feature\"",
"type": "string"
},
"state": {
"description": "\"open\", \"closed\"",
"type": "string"
}
}
},
"dto.ProcessingConfig": {
"type": "object",
"properties": {
"chunk_overlap": {
"type": "integer"
},
"chunk_size": {
"type": "integer"
},
"text_separator": {
"type": "string"
}
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,632 @@
{
"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": {
"/{mission}": {
"delete": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Missions"
],
"summary": "删除指定任务集。Delete the specified mission.",
"operationId": "DeleteMission",
"parameters": [
{
"type": "string",
"description": "mission path",
"name": "mission",
"in": "path",
"required": true
},
{
"type": "string",
"description": "微信身份验证票据首次请求不传会返回新票据。WeChat auth ticket, will return new ticket if not provided in first request.",
"name": "x-cnb-identity-ticket",
"in": "header"
}
],
"responses": {
"200": {
"description": "OK"
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nmission-delete:rw"
}
},
"/{mission}/-/mission/view": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Missions"
],
"summary": "查询任务集视图配置信息。Get mission view config.",
"operationId": "GetMissionViewConfig",
"parameters": [
{
"type": "string",
"description": "Mission slug",
"name": "mission",
"in": "path",
"required": true
},
{
"type": "string",
"description": "View ID",
"name": "id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.MissionViewConfig"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nmission-manage:r"
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Missions"
],
"summary": "设置任务集视图配置信息。Set mission view config.",
"operationId": "PostMissionViewConfig",
"parameters": [
{
"type": "string",
"description": "Mission slug",
"name": "mission",
"in": "path",
"required": true
},
{
"description": "Params",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.MissionViewConfig"
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nmission-manage:rw"
}
},
"/{mission}/-/mission/view-list": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Missions"
],
"summary": "获取任务集视图列表。Get view list of a mission.",
"operationId": "GetMissionViewList",
"parameters": [
{
"type": "string",
"description": "mission",
"name": "mission",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.MissionView"
}
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nmission-manage:r"
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Missions"
],
"summary": "添加、修改任务集视图。Update a mission view or add a new one.",
"operationId": "PutMissionViewList",
"parameters": [
{
"type": "string",
"description": "Mission slug",
"name": "mission",
"in": "path",
"required": true
},
{
"description": "Params",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.MissionView"
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nmission-manage:rw"
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Missions"
],
"summary": "排序任务集视图。Sort mission view list.",
"operationId": "PostMissionViewList",
"parameters": [
{
"type": "string",
"description": "Mission slug",
"name": "mission",
"in": "path",
"required": true
},
{
"description": "Params",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.MissionPostViewReq"
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nmission-manage:rw"
}
},
"/{mission}/-/settings/set_visibility": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Missions"
],
"summary": "改变任务集可见性。Update the visibility of a mission.",
"operationId": "SetMissionVisibility",
"parameters": [
{
"type": "string",
"description": "mission path",
"name": "mission",
"in": "path",
"required": true
},
{
"enum": [
"Private",
"Public"
],
"type": "string",
"description": "任务集可见性",
"name": "visibility",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nmission-manage:rw"
}
},
"/{slug}/-/missions": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Missions"
],
"summary": "查询组织下面用户有权限查看到的任务集。Query all missions that the user has permission to see under the specific organization.",
"operationId": "GetGroupSubMissions",
"parameters": [
{
"type": "string",
"description": "组织 slug",
"name": "slug",
"in": "path",
"required": true
},
{
"type": "integer",
"format": "int64",
"default": 1,
"description": "页码",
"name": "page",
"in": "query"
},
{
"type": "integer",
"format": "int64",
"default": 10,
"description": "每页数量",
"name": "page_size",
"in": "query"
},
{
"enum": [
"private",
"public"
],
"type": "string",
"description": "任务集类型",
"name": "filter_type",
"in": "query"
},
{
"enum": [
"created_at",
"name"
],
"type": "string",
"description": "排序类型默认created_at",
"name": "order_by",
"in": "query"
},
{
"type": "boolean",
"default": false,
"description": "排序顺序",
"name": "desc",
"in": "query"
},
{
"enum": [
"all",
"sub",
"grand"
],
"type": "string",
"description": "查全部/查询直接属于当前组织的仓库/查询子组织的仓库",
"name": "descendant",
"in": "query"
},
{
"type": "string",
"description": "搜索关键字",
"name": "search",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.Missions4User"
}
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \ngroup-resource:r"
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Missions"
],
"summary": "创建任务集。Create a mission.",
"operationId": "CreateMission",
"parameters": [
{
"type": "string",
"description": "Group slug",
"name": "slug",
"in": "path",
"required": true
},
{
"description": "mission information",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.CreateMissionReq"
}
}
],
"responses": {
"201": {
"description": "Created"
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \ngroup-resource:rw"
}
}
},
"definitions": {
"dto.MissionViewConfig": {
"type": "object",
"properties": {
"fields": {
"description": "字段配置",
"type": "array",
"items": {
"$ref": "#/definitions/dto.MissionViewFieldConfig"
}
},
"group": {
"description": "分组信息",
"allOf": [
{
"$ref": "#/definitions/dto.MissionViewGroup"
}
]
},
"id": {
"description": "视图唯一标识",
"type": "string"
},
"selectors": {
"description": "筛选条件",
"type": "array",
"items": {
"$ref": "#/definitions/dto.MissionViewSelector"
}
},
"sorts": {
"description": "排序条件",
"type": "array",
"items": {
"$ref": "#/definitions/dto.MissionViewSort"
}
},
"type": {
"description": "视图类型",
"allOf": [
{
"$ref": "#/definitions/dto.MissionViewType"
}
]
}
}
},
"dto.MissionView": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"type": {
"$ref": "#/definitions/dto.MissionViewType"
}
}
},
"dto.MissionPostViewReq": {
"type": "object",
"properties": {
"ids": {
"description": "视图唯一标识列表,按此顺序排序",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"dto.Missions4User": {
"type": "object",
"properties": {
"access": {
"allOf": [
{
"$ref": "#/definitions/constant.AccessRole"
}
],
"readOnly": true
},
"created_at": {
"type": "string"
},
"description": {
"type": "string"
},
"freeze": {
"type": "boolean",
"readOnly": true
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"path": {
"type": "string"
},
"pinned": {
"type": "boolean"
},
"pinned_time": {
"type": "string"
},
"star_time": {
"type": "string"
},
"stared": {
"type": "boolean"
},
"updated_at": {
"type": "string"
},
"visibility_level": {
"$ref": "#/definitions/constant.Visibility"
}
}
},
"dto.CreateMissionReq": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"name": {
"type": "string"
},
"repos": {
"type": "array",
"items": {
"type": "string"
}
},
"visibility": {
"type": "string",
"default": "public",
"enum": [
"public",
"private"
]
}
}
},
"dto.MissionViewType": {
"type": "string",
"enum": [
"table",
"board",
"gantt"
],
"x-enum-varnames": [
"MissionViewTypeTable",
"MissionViewTypeBoard",
"MissionViewTypeGantt"
]
},
"constant.Visibility": {
"type": "string",
"enum": [
"Private",
"Public",
"Secret"
],
"x-enum-comments": {
"VisibilityPrivate": "VisibilityPrivate 私有仓库 - 仓库的访问必须显式授予每个用户",
"VisibilityPublic": "VisibilityPublic 公共仓库 - 可以不经任何身份验证克隆该项目",
"VisibilitySecret": "VisibilitySecret 加密仓库 - 仓库特定角色身份才能读取解密"
},
"x-enum-descriptions": [
"VisibilityPrivate 私有仓库 - 仓库的访问必须显式授予每个用户",
"VisibilityPublic 公共仓库 - 可以不经任何身份验证克隆该项目",
"VisibilitySecret 加密仓库 - 仓库特定角色身份才能读取解密"
],
"x-enum-varnames": [
"VisibilityPrivate",
"VisibilityPublic",
"VisibilitySecret"
]
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,932 @@
{
"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": {
"/{repo}/-/releases": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Releases"
],
"summary": "查询 release 列表。List releases.",
"operationId": "ListReleases",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "integer",
"default": 1,
"description": "分页页码",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 30,
"description": "分页页大小",
"name": "page_size",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/api.Release"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-code:r"
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Releases"
],
"summary": "新增一个 release。Create a release.",
"operationId": "PostRelease",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
},
{
"description": "Post Release Form, attachment is optional",
"name": "create_release_form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/openapi.PostReleaseForm"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/api.Release"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-code:rw"
}
},
"/{repo}/-/releases/download/{tag}/{filename}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"Releases"
],
"summary": "发起一个获取 release 附件的请求, 302到有一定效期的下载地址。Get a request to fetch a release assets and returns 302 redirect to the assets URL with specific valid time.",
"operationId": "GetReleasesAsset",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "标签名称。示例:`v1.0.0`",
"name": "tag",
"in": "path",
"required": true
},
{
"type": "string",
"description": "文件名称。示例:`test.png`",
"name": "filename",
"in": "path",
"required": true
},
{
"type": "boolean",
"default": false,
"description": "是否可以下载true表示302的下载地址有效期12小时最多下载10次。",
"name": "share",
"in": "query"
}
],
"responses": {
"302": {
"description": "Found"
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-contents:r"
}
},
"/{repo}/-/releases/latest": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Releases"
],
"summary": "查询最新的 release。Query the latest release.",
"operationId": "GetLatestRelease",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/api.Release"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-code:r"
}
},
"/{repo}/-/releases/tags/{tag}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Releases"
],
"summary": "通过 tag 查询指定 release,包含附件信息。Get a release by tag, include assets information.",
"operationId": "GetReleaseByTag",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "标签名称。",
"name": "tag",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/api.Release"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-code:r"
}
},
"/{repo}/-/releases/{release_id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Releases"
],
"summary": "根据 id\t查询指定 release, 包含附件信息。Get a release by id, include assets information.",
"operationId": "GetReleaseByID",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "版本唯一标识符。",
"name": "release_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/api.Release"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-code:r"
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Releases"
],
"summary": "删除指定的 release。Delete a release.",
"operationId": "DeleteRelease",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "版本唯一标识符。",
"name": "release_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-code:rw"
},
"patch": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Releases"
],
"summary": "更新 release。Update a release.",
"operationId": "PatchRelease",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "版本唯一标识符。",
"name": "release_id",
"in": "path",
"required": true
},
{
"description": "patch release form",
"name": "patch_release_form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/openapi.PatchReleaseForm"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-code:rw"
}
},
"/{repo}/-/releases/{release_id}/asset-upload-confirmation/{upload_token}/{asset_path}": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Releases"
],
"summary": "确认 release 附件上传完成。Confirm release asset upload.",
"operationId": "PostReleaseAssetUploadConfirmation",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "版本唯一标识符。",
"name": "release_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "PostReleaseAssetUploadURL接口返回值verify_url字段提取的upload_token。",
"name": "upload_token",
"in": "path",
"required": true
},
{
"type": "string",
"description": "PostReleaseAssetUploadURL接口返回值verify_url字段提取的asset_path。",
"name": "asset_path",
"in": "path",
"required": true
},
{
"type": "integer",
"format": "int64",
"description": "附件保持的天数。0 表示永久,最大不能超过 180 天",
"name": "ttl",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK"
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-code:rw"
}
},
"/{repo}/-/releases/{release_id}/asset-upload-url": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Releases"
],
"summary": "新增一个 release 附件。Create a release asset.",
"operationId": "PostReleaseAssetUploadURL",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "版本唯一标识符。",
"name": "release_id",
"in": "path",
"required": true
},
{
"description": "Post Release Asset Upload URL Form",
"name": "create_release_asset_upload_url_form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/openapi.PostReleaseAssetUploadURLForm"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/openapi.ReleaseAssetUploadURL"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-code:rw"
}
},
"/{repo}/-/releases/{release_id}/assets/{asset_id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"Releases"
],
"summary": "查询指定的 release 附件 the specified release asset.",
"operationId": "GetReleaseAsset",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "版本唯一标识符。",
"name": "release_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "附件唯一标识符。",
"name": "asset_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/api.ReleaseAsset"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-code:r"
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"Releases"
],
"summary": "删除指定的 release 附件 the specified release asset.",
"operationId": "DeleteReleaseAsset",
"parameters": [
{
"type": "string",
"description": "不带.git后缀的仓库名称。格式`组织名称/仓库名称`",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "版本唯一标识符。",
"name": "release_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "附件唯一标识符。",
"name": "asset_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-code:rw"
}
}
},
"definitions": {
"api.Release": {
"type": "object",
"properties": {
"assets": {
"description": "附件列表。",
"type": "array",
"items": {
"$ref": "#/definitions/api.ReleaseAsset"
}
},
"author": {
"description": "作者信息。",
"allOf": [
{
"$ref": "#/definitions/git_woa_com_cnb_monorepo_git_internal_app_git_service_bff_api.UserInfo"
}
]
},
"body": {
"description": "版本描述。",
"type": "string"
},
"created_at": {
"description": "创建时间。",
"type": "string"
},
"draft": {
"description": "是否为草稿版本。",
"type": "boolean"
},
"id": {
"description": "版本唯一标识符。",
"type": "string"
},
"is_latest": {
"description": "是否为最新版本。",
"type": "boolean"
},
"name": {
"description": "版本标题。",
"type": "string"
},
"prerelease": {
"description": "是否为预发布版本。",
"type": "boolean"
},
"published_at": {
"description": "版本发布时间。",
"type": "string"
},
"tag_commitish": {
"description": "标签与提交标识符。",
"type": "string"
},
"tag_name": {
"description": "标签名称。",
"type": "string"
},
"updated_at": {
"description": "更新时间。",
"type": "string"
}
}
},
"die.WebError": {
"type": "object",
"properties": {
"errcode": {
"type": "integer"
},
"errmsg": {
"type": "string"
},
"errparam": {
"type": "object",
"additionalProperties": {}
}
}
},
"openapi.PostReleaseForm": {
"type": "object",
"properties": {
"body": {
"description": "版本描述。",
"type": "string"
},
"draft": {
"description": "是否为草稿版本。",
"type": "boolean"
},
"make_latest": {
"description": "是否设置为最新版本。可选值:`true`,`false`,`legacy`",
"type": "string"
},
"name": {
"description": "版本标题。",
"type": "string"
},
"prerelease": {
"description": "是否为预发布版本。",
"type": "boolean"
},
"tag_name": {
"description": "标签名称。",
"type": "string"
},
"target_commitish": {
"description": "目标提交哈希或分支名称。",
"type": "string"
}
}
},
"openapi.PatchReleaseForm": {
"type": "object",
"properties": {
"body": {
"description": "版本描述。",
"type": "string"
},
"draft": {
"description": "是否为草稿版本。",
"type": "boolean"
},
"make_latest": {
"description": "是否设置为最新版本。可选值:`true`,`false`,`legacy`",
"type": "string"
},
"name": {
"description": "版本标题。",
"type": "string"
},
"prerelease": {
"description": "是否为预发布版本。",
"type": "boolean"
}
}
},
"openapi.PostReleaseAssetUploadURLForm": {
"type": "object",
"properties": {
"asset_name": {
"description": "附件名称。",
"type": "string"
},
"overwrite": {
"description": "是否覆盖同名附件。",
"type": "boolean"
},
"size": {
"description": "附件大小,单位为字节。",
"type": "integer"
},
"ttl": {
"description": "附件存在时间,单位为天",
"type": "integer"
}
}
},
"openapi.ReleaseAssetUploadURL": {
"type": "object",
"properties": {
"expires_in_sec": {
"description": "URL过期时间单位为秒。",
"type": "integer"
},
"upload_url": {
"description": "附件上传URL。",
"type": "string"
},
"verify_url": {
"description": "附件上传确认验证URL。",
"type": "string"
}
}
},
"api.ReleaseAsset": {
"type": "object",
"properties": {
"brower_download_url": {
"description": "浏览器下载URL通过主域名用于用户直接访问。",
"type": "string"
},
"content_type": {
"description": "附件内容类型。",
"type": "string"
},
"created_at": {
"description": "创建时间。",
"type": "string"
},
"download_count": {
"description": "下载次数。",
"type": "integer"
},
"id": {
"description": "附件唯一标识符。",
"type": "string"
},
"name": {
"description": "附件名称。",
"type": "string"
},
"path": {
"description": "附件路径。",
"type": "string"
},
"size": {
"description": "附件大小(字节)。",
"type": "integer"
},
"updated_at": {
"description": "更新时间。",
"type": "string"
},
"uploader": {
"description": "附件上传者信息。",
"allOf": [
{
"$ref": "#/definitions/git_woa_com_cnb_monorepo_git_internal_app_git_service_bff_api.UserInfo"
}
]
},
"url": {
"description": "API下载URL通过API域名用于程序化下载。",
"type": "string"
}
}
}
}
}

View File

@@ -0,0 +1,134 @@
{
"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}/-/contributor/trend": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [],
"tags": [
"RepoContributor"
],
"summary": "查询仓库贡献者前 100 名的详细趋势数据。Query detailed trend data for top 100 contributors of the repository.",
"operationId": "GetRepoContributorTrend",
"parameters": [
{
"type": "string",
"description": "slug",
"name": "slug",
"in": "path",
"required": true
},
{
"type": "integer",
"default": 14,
"description": "limit, 0~100",
"name": "limit",
"in": "query"
},
{
"type": "boolean",
"default": false,
"description": "exclude_external_users, true|false",
"name": "exclude_external_users",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/web.RepoContribTrend"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-code:r"
}
}
},
"definitions": {
"web.RepoContribTrend": {
"type": "object",
"properties": {
"meta": {
"$ref": "#/definitions/web.Meta"
},
"repo_data": {
"type": "array",
"items": {
"$ref": "#/definitions/web.Week"
}
},
"user_total": {
"type": "integer"
},
"users_data": {
"type": "array",
"items": {
"$ref": "#/definitions/web.ContributorTrend"
}
},
"week_total": {
"type": "integer"
},
"with_line_counts": {
"description": "是否统计增删的行数, 默认总提交超过 10000 的仓库不统计",
"type": "boolean"
}
}
},
"die.WebError": {
"type": "object",
"properties": {
"errcode": {
"type": "integer"
},
"errmsg": {
"type": "string"
},
"errparam": {
"type": "object",
"additionalProperties": {}
}
}
},
"web.Meta": {
"type": "object",
"properties": {
"gen_branch": {
"type": "string"
},
"gen_hash": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
}
}
}

View File

@@ -0,0 +1,314 @@
{
"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": {
"/{repo}/-/labels": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"RepoLabels"
],
"summary": "查询仓库的标签列表。List repository labels.",
"operationId": "ListLabels",
"parameters": [
{
"type": "string",
"description": "repo",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "integer",
"default": 1,
"description": "pagination page number",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 30,
"description": "pagination page size",
"name": "page_size",
"in": "query"
},
{
"type": "string",
"description": "label search key",
"name": "keyword",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/api.Label"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:r"
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"RepoLabels"
],
"summary": "创建一个 标签。Create a label.",
"operationId": "PostLabel",
"parameters": [
{
"type": "string",
"description": "repo",
"name": "repo",
"in": "path",
"required": true
},
{
"description": "Post Label Form",
"name": "post_label_form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.PostLabelForm"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/api.Label"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:rw"
}
},
"/{repo}/-/labels/{name}": {
"delete": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"RepoLabels"
],
"summary": "删除指定的仓库标签。Delete the specified repository label.",
"operationId": "DeleteLabel",
"parameters": [
{
"type": "string",
"description": "repo",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "label name",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:rw"
},
"patch": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"RepoLabels"
],
"summary": "更新标签信息。Update label information.",
"operationId": "PatchLabel",
"parameters": [
{
"type": "string",
"description": "repo",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "label name",
"name": "name",
"in": "path",
"required": true
},
{
"description": "Patch Label Form",
"name": "patch_label_form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.PatchLabelForm"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/api.Label"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-notes:rw"
}
}
},
"definitions": {
"api.Label": {
"type": "object",
"properties": {
"color": {
"type": "string"
},
"description": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"die.WebError": {
"type": "object",
"properties": {
"errcode": {
"type": "integer"
},
"errmsg": {
"type": "string"
},
"errparam": {
"type": "object",
"additionalProperties": {}
}
}
},
"api.PostLabelForm": {
"type": "object",
"properties": {
"color": {
"description": "The hexadecimal color code for the label, without the leading `#`.",
"type": "string"
},
"description": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"api.PatchLabelForm": {
"type": "object",
"properties": {
"color": {
"description": "The hexadecimal color code for the label, without the leading `#`.",
"type": "string"
},
"description": {
"type": "string"
},
"new_name": {
"type": "string"
}
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,286 @@
{
"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": {
"/{repo}/-/security/overview": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Security"
],
"summary": "查询仓库安全模块概览数据。Query the security overview data of a repository",
"operationId": "GetRepoSecurityOverview",
"parameters": [
{
"type": "string",
"description": "仓库名称",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "类型多个类型用逗号分隔code_sensitive,code_vulnerability,code_issue为空默认查询所有类型",
"name": "types",
"in": "query"
},
{
"type": "string",
"description": "查询类型下开启或忽略的各风险类型概览数量,可选值open,ignore,all默认all",
"name": "tab",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.RepoSecurityOverview"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-security:r"
}
}
},
"definitions": {
"dto.RepoSecurityOverview": {
"type": "object",
"properties": {
"code_issue": {
"$ref": "#/definitions/dto.CodeIssueSummary"
},
"code_sensitive": {
"$ref": "#/definitions/dto.CodeSensitiveSummary"
},
"code_vulnerability": {
"$ref": "#/definitions/dto.CodeVulOverview"
},
"risk_cnt": {
"$ref": "#/definitions/dto.RepoSecurityRiskCnt"
}
}
},
"die.WebError": {
"type": "object",
"properties": {
"errcode": {
"type": "integer"
},
"errmsg": {
"type": "string"
},
"errparam": {
"type": "object",
"additionalProperties": {}
}
}
},
"dto.CodeIssueSummary": {
"type": "object",
"properties": {
"critical_count": {
"description": "严重风险问题数量",
"type": "integer"
},
"critical_ignore_count": {
"description": "严重风险问题忽略数量",
"type": "integer"
},
"enable": {
"description": "是否开启源码信息扫描",
"type": "boolean"
},
"high_count": {
"description": "高风险问题数量",
"type": "integer"
},
"high_ignore_count": {
"description": "高风险问题忽略数量",
"type": "integer"
},
"ignored": {
"description": "忽略的问题数量",
"type": "integer"
},
"low_count": {
"description": "低风险问题数量",
"type": "integer"
},
"low_ignore_count": {
"description": "低风险问题忽略数量",
"type": "integer"
},
"medium_count": {
"description": "中风险问题数量",
"type": "integer"
},
"medium_ignore_count": {
"description": "中风险问题忽略数量",
"type": "integer"
},
"open": {
"description": "开启中问题数量",
"type": "integer"
}
}
},
"dto.CodeSensitiveSummary": {
"type": "object",
"properties": {
"enable": {
"description": "是否开启代码敏感信息扫描",
"type": "boolean"
},
"high_count": {
"description": "高风险问题数量",
"type": "integer"
},
"high_ignore_count": {
"description": "高风险问题忽略数量",
"type": "integer"
},
"ignored": {
"description": "忽略问题数量",
"type": "integer"
},
"low_count": {
"description": "低风险问题数量",
"type": "integer"
},
"low_ignore_count": {
"description": "低风险问题忽略数量",
"type": "integer"
},
"medium_count": {
"description": "中风险问题数量",
"type": "integer"
},
"medium_ignore_count": {
"description": "中风险问题忽略数量",
"type": "integer"
},
"open": {
"description": "开启中问题数量",
"type": "integer"
}
}
},
"dto.CodeVulOverview": {
"type": "object",
"properties": {
"critical_vul_ignore_cnt": {
"description": "忽略的严重风险漏洞的数量",
"type": "integer"
},
"critical_vul_open_cnt": {
"description": "打开的严重风险级别漏洞的数量",
"type": "integer"
},
"enable": {
"description": "是否开启代码漏洞扫描",
"type": "boolean"
},
"high_vul_ignore_cnt": {
"description": "忽略的高风险级别漏洞的数量",
"type": "integer"
},
"high_vul_open_cnt": {
"description": "打开的高风险级别漏洞的数量",
"type": "integer"
},
"ignored": {
"description": "忽略问题数量",
"type": "integer"
},
"low_vul_ignore_cnt": {
"description": "忽略的低风险级别漏洞的数量",
"type": "integer"
},
"low_vul_open_cnt": {
"description": "打开的低风险级别漏洞的数量",
"type": "integer"
},
"medium_vul_ignore_cnt": {
"description": "忽略的中风险级别漏洞的数量",
"type": "integer"
},
"medium_vul_open_cnt": {
"description": "打开的中风险级别漏洞的数量",
"type": "integer"
},
"open": {
"description": "开启中问题数量",
"type": "integer"
}
}
},
"dto.RepoSecurityRiskCnt": {
"type": "object",
"properties": {
"code_issue_enable": {
"description": "是否开启源码扫描",
"type": "boolean"
},
"code_issue_risk_cnt": {
"description": "源码扫描风险数量 (严重+高风险)",
"type": "integer"
},
"code_sensitive_enable": {
"description": "是否开启代码敏感信息扫描",
"type": "boolean"
},
"code_sensitive_risk_cnt": {
"description": "敏感信息风险数量(高风险)",
"type": "integer"
},
"code_vulnerability_enable": {
"description": "是否开启代码漏洞扫描",
"type": "boolean"
},
"code_vulnerability_risk_cnt": {
"description": "代码漏洞风险数量(严重+高风险)",
"type": "integer"
},
"enable": {
"description": "是否开启安全模块",
"type": "boolean"
},
"total": {
"description": "总计数",
"type": "integer"
}
}
}
}
}

View File

@@ -0,0 +1,463 @@
{
"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": {
"/user/stared-repos": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Starring"
],
"summary": "获取当前用户 star 的仓库列表。List all stared repositories.",
"operationId": "GetUserAllStaredRepos",
"parameters": [
{
"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"
},
{
"type": "string",
"default": "",
"description": "Filter by repositories",
"name": "search",
"in": "query"
},
{
"type": "boolean",
"default": false,
"description": "排序顺序。Ordering.",
"name": "desc",
"in": "query"
},
{
"enum": [
"created_at",
"last_updated_at",
"stared_time",
"stars",
"forks"
],
"type": "string",
"default": "last_updated_at",
"description": "Order field",
"name": "order_by",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.Repos4User"
}
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \naccount-engage:r"
}
},
"/users/{username}/stared-repos": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Starring"
],
"summary": "获取指定用户的 star 仓库列表。Get the list of repositories starred by the specified user.",
"operationId": "GetUserStaredRepos",
"parameters": [
{
"type": "string",
"description": "UserName",
"name": "username",
"in": "path",
"required": true
},
{
"type": "string",
"default": "",
"description": "过滤仓库。Filter by repositories",
"name": "search",
"in": "query"
},
{
"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"
},
{
"type": "boolean",
"default": false,
"description": "Ordering",
"name": "desc",
"in": "query"
},
{
"enum": [
"created_at",
"last_updated_at",
"stars",
"forks"
],
"type": "string",
"default": "last_updated_at",
"description": "Order field",
"name": "order_by",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.Repos4User"
}
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \naccount-engage:r"
}
},
"/{slug}/-/stars": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Starring"
],
"summary": "获取指定仓库的star用户列表。Get the list of users who starred the specified repository.",
"operationId": "ListStarUsers",
"parameters": [
{
"type": "string",
"description": "slug",
"name": "slug",
"in": "path",
"required": true
},
{
"enum": [
"all",
"followed"
],
"type": "string",
"description": "Filter type",
"name": "filter_type",
"in": "query",
"required": true
},
{
"type": "integer",
"default": 1,
"description": "page",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 10,
"description": "page",
"name": "page_size",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.RepoStarUsers"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-basic-info:r"
}
}
},
"definitions": {
"dto.Repos4User": {
"type": "object",
"properties": {
"access": {
"allOf": [
{
"$ref": "#/definitions/constant.AccessRole"
}
],
"readOnly": true
},
"created_at": {
"type": "string"
},
"description": {
"type": "string"
},
"display_module": {
"$ref": "#/definitions/constant.RepoDisplayModule"
},
"flags": {
"$ref": "#/definitions/flags.Repo"
},
"fork_count": {
"type": "integer"
},
"forked_from_repo": {
"description": "预留",
"allOf": [
{
"$ref": "#/definitions/dto.Slugs"
}
]
},
"freeze": {
"type": "boolean",
"readOnly": true
},
"id": {
"type": "string"
},
"language": {
"description": "仓库程序语言,预留",
"type": "string"
},
"languages": {
"description": "仓库语言",
"allOf": [
{
"$ref": "#/definitions/dto.RepoLanguage"
}
]
},
"last_update_nickname": {
"description": "最新代码更新人姓名",
"type": "string"
},
"last_update_username": {
"description": "最新代码更新人账户名",
"type": "string"
},
"last_updated_at": {
"description": "最新代码更新时间",
"allOf": [
{
"$ref": "#/definitions/convert.NullTime"
}
]
},
"license": {
"type": "string"
},
"mark_count": {
"type": "integer"
},
"name": {
"type": "string"
},
"open_issue_count": {
"description": "开启的issue数",
"type": "integer"
},
"open_pull_request_count": {
"description": "开启的pull request数",
"type": "integer"
},
"path": {
"description": "完整仓库路径",
"type": "string"
},
"pinned": {
"type": "boolean"
},
"pinned_time": {
"type": "string"
},
"second_languages": {
"description": "第二语言",
"allOf": [
{
"$ref": "#/definitions/dto.RepoLanguage"
}
]
},
"site": {
"type": "string"
},
"star_count": {
"type": "integer"
},
"star_time": {
"type": "string"
},
"stared": {
"type": "boolean"
},
"status": {
"allOf": [
{
"$ref": "#/definitions/constant.RepoStatus"
}
],
"readOnly": true
},
"tags": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
}
},
"topics": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"visibility_level": {
"$ref": "#/definitions/constant.Visibility"
},
"web_url": {
"type": "string"
}
}
},
"dto.RepoStarUsers": {
"type": "object",
"properties": {
"my_follow_count": {
"type": "integer"
},
"total": {
"type": "integer"
},
"users": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.StarUser"
}
}
}
},
"constant.RepoDisplayModule": {
"type": "object",
"properties": {
"activity": {
"description": "仓库动态",
"type": "boolean"
},
"contributors": {
"description": "仓库贡献者",
"type": "boolean"
},
"release": {
"description": "仓库版本",
"type": "boolean"
}
}
},
"flags.Repo": {
"description": "仓库特性标记,内容为枚举的组合,英文逗号分割",
"type": "string",
"enum": [
"Unknown",
"KnowledgeBase"
],
"x-enum-comments": {
"KnowledgeBase": "KnowledgeBase 知识库",
"Unknown": "Unknown 未知"
},
"x-enum-descriptions": [
"Unknown 未知",
"KnowledgeBase 知识库"
],
"x-enum-varnames": [
"Unknown",
"KnowledgeBase"
]
},
"constant.Visibility": {
"type": "string",
"enum": [
"Private",
"Public",
"Secret"
],
"x-enum-comments": {
"VisibilityPrivate": "VisibilityPrivate 私有仓库 - 仓库的访问必须显式授予每个用户",
"VisibilityPublic": "VisibilityPublic 公共仓库 - 可以不经任何身份验证克隆该项目",
"VisibilitySecret": "VisibilitySecret 加密仓库 - 仓库特定角色身份才能读取解密"
},
"x-enum-descriptions": [
"VisibilityPrivate 私有仓库 - 仓库的访问必须显式授予每个用户",
"VisibilityPublic 公共仓库 - 可以不经任何身份验证克隆该项目",
"VisibilitySecret 加密仓库 - 仓库特定角色身份才能读取解密"
],
"x-enum-varnames": [
"VisibilityPrivate",
"VisibilityPublic",
"VisibilitySecret"
]
}
}
}

View File

@@ -0,0 +1,691 @@
{
"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": {
"/user": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Users"
],
"summary": "获取指定用户的详情信息。Get detailed information for a specified user.",
"operationId": "GetUserInfo",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.UsersResultForSelf"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \naccount-profile:r"
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Users"
],
"summary": "更新指定用户的详情信息。Updates the specified user's profile information.",
"operationId": "UpdateUserInfo",
"parameters": [
{
"description": "user info",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.UpdateUserInfoPayload"
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \naccount-profile:rw"
}
},
"/user/autocomplete_source": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Users"
],
"summary": "查询当前用户用户拥有指定权限的所有资源列表。List resources that the current user has specified permissions for.",
"operationId": "AutoCompleteSource",
"parameters": [
{
"enum": [
"Group",
"Repo"
],
"type": "string",
"default": "Group",
"description": "Source type",
"name": "source_type",
"in": "query"
},
{
"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"
},
{
"type": "string",
"default": "",
"description": "Filter by resources.",
"name": "search",
"in": "query"
},
{
"enum": [
"Reporter",
"Developer",
"Master",
"Owner"
],
"type": "string",
"default": "Owner",
"description": "最小仓库权限默认owner。Minima repository permissions",
"name": "access",
"in": "query"
},
{
"enum": [
"created_at",
"slug_path"
],
"type": "string",
"default": "created_at",
"description": "Order field",
"name": "order_by",
"in": "query"
},
{
"type": "boolean",
"default": false,
"description": "排序顺序。Ordering.",
"name": "desc",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \naccount-engage:r"
}
},
"/user/gpg-keys": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Users"
],
"summary": "获取用户 GPG keys 列表。List GPG Keys.",
"operationId": "ListGPGKeys",
"parameters": [
{
"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"
},
{
"type": "string",
"description": "gpg search key",
"name": "keyword",
"in": "query"
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/api.GPGPublicKey"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/die.WebError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/die.WebError"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \naccount-profile:r"
}
},
"/users/{username}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Users"
],
"summary": "获取指定用户的详情信息。Get detailed information for a specified user.",
"operationId": "GetUserInfoByName",
"parameters": [
{
"type": "string",
"description": "User Name",
"name": "username",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.UsersResult"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \naccount-profile:r"
}
}
},
"definitions": {
"dto.UsersResultForSelf": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"appearance": {
"type": "string"
},
"appreciate_status": {
"description": "用户赞赏码状态0-无赞赏码1-有",
"type": "integer"
},
"avatar": {
"type": "string"
},
"bio": {
"type": "string"
},
"company": {
"type": "string"
},
"created_at": {
"type": "string"
},
"editable": {
"$ref": "#/definitions/constant.UserEditable"
},
"email": {
"type": "string"
},
"follow_count": {
"type": "integer"
},
"follow_mission_count": {
"type": "integer"
},
"follow_repo_count": {
"type": "integer"
},
"follower_count": {
"type": "integer"
},
"freeze": {
"type": "boolean"
},
"gender": {
"type": "integer"
},
"group_count": {
"type": "integer"
},
"id": {
"type": "string"
},
"language": {
"type": "string"
},
"last_login_at": {
"type": "string"
},
"last_login_ip": {
"type": "string"
},
"location": {
"type": "string"
},
"locked": {
"type": "boolean"
},
"mission_count": {
"type": "integer"
},
"next_updated_name_at": {
"type": "string"
},
"nickname": {
"type": "string"
},
"public_mission_count": {
"type": "integer"
},
"public_registry_count": {
"type": "integer"
},
"public_repo_count": {
"type": "integer"
},
"readme_repo_path": {
"type": "string",
"readOnly": true
},
"registry_count": {
"type": "integer"
},
"repo_count": {
"type": "integer"
},
"reward_amount": {
"type": "integer"
},
"reward_count": {
"type": "integer"
},
"site": {
"type": "string"
},
"stars_count": {
"type": "integer"
},
"type": {
"$ref": "#/definitions/constant.UserType"
},
"updated_name_at": {
"type": "string"
},
"updated_nick_at": {
"type": "string"
},
"username": {
"type": "string"
},
"verified": {
"description": "认证类型",
"type": "integer"
},
"verified_expire_in": {
"description": "认证过期时间",
"type": "string"
},
"wechat_mp": {
"type": "string"
},
"wechat_mp_qrcode": {
"type": "string"
}
}
},
"dto.UpdateUserInfoPayload": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"bio": {
"type": "string"
},
"company": {
"type": "string"
},
"location": {
"type": "string"
},
"name": {
"type": "string"
},
"nickname": {
"type": "string"
},
"readme_repo_id": {
"type": "integer"
},
"readme_repo_path": {
"type": "string"
},
"site": {
"type": "string"
},
"wechat_mp": {
"type": "string"
},
"wechat_mp_qrcode": {
"type": "string"
}
}
},
"api.GPGPublicKey": {
"type": "object",
"properties": {
"created_at": {
"description": "主密钥添加时间",
"type": "string"
},
"emails": {
"description": "邮箱",
"type": "array",
"items": {
"$ref": "#/definitions/api.GPGEmail"
}
},
"expired_at": {
"description": "主密钥过期时间",
"type": "string"
},
"id": {
"description": "主密钥ID",
"type": "string"
},
"key_id": {
"description": "公钥 KeyID",
"type": "string"
},
"name": {
"description": "标题",
"type": "string"
},
"raw_key": {
"description": "PGP公钥文本",
"type": "string"
},
"subkeys": {
"description": "子密钥",
"type": "array",
"items": {
"$ref": "#/definitions/api.GPGSubkey"
}
}
}
},
"die.WebError": {
"type": "object",
"properties": {
"errcode": {
"type": "integer"
},
"errmsg": {
"type": "string"
},
"errparam": {
"type": "object",
"additionalProperties": {}
}
}
},
"dto.UsersResult": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"appreciate_status": {
"description": "用户赞赏码状态0-无赞赏码1-有",
"type": "integer"
},
"avatar": {
"type": "string"
},
"bio": {
"type": "string"
},
"company": {
"type": "string"
},
"created_at": {
"type": "string"
},
"email": {
"type": "string"
},
"follow_count": {
"type": "integer"
},
"follow_mission_count": {
"type": "integer"
},
"follow_repo_count": {
"type": "integer"
},
"follower_count": {
"type": "integer"
},
"freeze": {
"type": "boolean"
},
"gender": {
"type": "integer"
},
"group_count": {
"type": "integer"
},
"id": {
"type": "string"
},
"is_following": {
"description": "查询人是否follow了此用户",
"type": "boolean"
},
"location": {
"type": "string"
},
"locked": {
"type": "boolean"
},
"mission_count": {
"type": "integer"
},
"nickname": {
"type": "string"
},
"public_mission_count": {
"type": "integer"
},
"public_registry_count": {
"type": "integer"
},
"public_repo_count": {
"type": "integer"
},
"readme_repo_path": {
"type": "string",
"readOnly": true
},
"registry_count": {
"type": "integer"
},
"repo_count": {
"type": "integer"
},
"reward_amount": {
"type": "integer"
},
"reward_count": {
"type": "integer"
},
"site": {
"type": "string"
},
"stars_count": {
"type": "integer"
},
"type": {
"$ref": "#/definitions/constant.UserType"
},
"username": {
"type": "string"
},
"verified": {
"description": "认证类型",
"type": "integer"
},
"verified_expire_in": {
"description": "认证过期时间",
"type": "string"
},
"wechat_mp": {
"type": "string"
},
"wechat_mp_qrcode": {
"type": "string"
}
}
},
"constant.UserEditable": {
"type": "object",
"properties": {
"avatar": {
"description": "可修改账户头像",
"type": "boolean"
},
"email": {
"description": "可修改主邮箱",
"type": "boolean"
},
"logoff": {
"description": "是否允许注销账户",
"type": "boolean"
},
"nickname": {
"description": "可修改昵称",
"type": "boolean"
},
"sync-data": {
"description": "是否允许同步昵称和头像",
"type": "boolean"
},
"username": {
"description": "可修改账户名",
"type": "boolean"
}
}
},
"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"
]
}
}
}

View File

@@ -0,0 +1,427 @@
{
"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": {
"/workspace/delete": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Workspace"
],
"summary": "删除我的云原生开发环境。Delete my workspace.",
"operationId": "DeleteWorkspace",
"parameters": [
{
"description": "params",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.WorkspaceDeleteReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.WorkspaceDeleteResult"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \naccount-engage:rw"
}
},
"/workspace/list": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Workspace"
],
"summary": "获取我的云原生开发环境列表。List my workspaces.",
"operationId": "ListWorkspaces",
"parameters": [
{
"type": "string",
"description": "Git branch name, e.g. \"main\"",
"name": "branch",
"in": "query"
},
{
"type": "string",
"description": "查询结束时间。Query end time. format YYYY-MM-DD HH:mm:ssZZ, e.g. 2024-12-01 00:00:00+0800",
"name": "end",
"in": "query"
},
{
"type": "integer",
"description": "Pagination page number, default(1)",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "Pagination page size, default(20), max(100)",
"name": "pageSize",
"in": "query"
},
{
"type": "string",
"description": "Repository path, e.g. \"groupname/reponame\"",
"name": "slug",
"in": "query"
},
{
"type": "string",
"description": "查询开始时间。Query start time. format YYYY-MM-DD HH:mm:ssZZ, e.g. 2024-12-01 00:00:00+0800",
"name": "start",
"in": "query"
},
{
"type": "string",
"description": "开发环境状态running: 开发环境已启动closed开发环境已关闭。Workspace status: \"running\" for started, \"closed\" for stopped.",
"name": "status",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.WorkspaceListResult"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \naccount-engage:r"
}
},
"/workspace/stop": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Workspace"
],
"summary": "停止/关闭我的云原生开发环境。Stop/close my workspace.",
"operationId": "WorkspaceStop",
"parameters": [
{
"description": "params",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.WorkspaceStopReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.WorkspaceStopResult"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \naccount-engage:rw"
}
},
"/{repo}/-/workspace/detail/{sn}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Workspace"
],
"summary": "根据流水线sn查询云原生开发访问地址。Query cloud-native development access address by pipeline SN.",
"operationId": "GetWorkspaceDetail",
"parameters": [
{
"type": "string",
"description": "Repo path",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "SN",
"name": "sn",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.WorkspaceDetailResult"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-cnb-detail:r"
}
},
"/{repo}/-/workspace/start": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/vnd.cnb.api+json"
],
"tags": [
"Workspace"
],
"summary": "启动云原生开发环境已存在环境则直接打开否则重新创建开发环境。Start cloud-native dev. Opens existing env or creates a new one.",
"operationId": "StartWorkspace",
"parameters": [
{
"type": "string",
"description": "仓库完整路径",
"name": "repo",
"in": "path",
"required": true
},
{
"description": "StartWorkspace params",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.StartWorkspaceReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.StartWorkspaceResult"
}
}
},
"description": "访问令牌调用此接口需包含以下权限。Required permissions for access token. \nrepo-cnb-trigger:rw"
}
}
},
"definitions": {
"dto.WorkspaceDeleteReq": {
"type": "object",
"properties": {
"pipelineId": {
"description": "表示要删除的开发环境流水线 idsn 和 pipelineId 二选一,优先使用 pipelineId",
"type": "string"
},
"sn": {
"description": "表示要删除的开发环境流水线构建号sn 和 pipelineId 二选一,优先使用 pipelineId",
"type": "string"
}
}
},
"dto.WorkspaceDeleteResult": {
"type": "object",
"properties": {
"code": {
"description": "返回码0 表示成功1 表示失败",
"type": "integer"
},
"message": {
"description": "描述",
"type": "string"
}
}
},
"dto.WorkspaceListResult": {
"type": "object",
"properties": {
"hasMore": {
"description": "是否有更多数据",
"type": "boolean"
},
"list": {
"description": "云原生开发环境列表",
"type": "array",
"items": {
"$ref": "#/definitions/dto.WorkspaceInfo"
}
},
"pageInfo": {
"description": "分页信息",
"allOf": [
{
"$ref": "#/definitions/dto.WorkspacePageInfo"
}
]
},
"total": {
"description": "总数",
"type": "integer"
}
}
},
"dto.WorkspaceStopReq": {
"type": "object",
"properties": {
"pipelineId": {
"description": "表示要停止的开发环境的流水线 idsn 和 pipelineId 二选一,优先使用 pipelineId",
"type": "string"
},
"sn": {
"description": "表示要停止的开发环境流水线构建号sn 和 pipelineId 二选一,优先使用 pipelineId",
"type": "string"
}
}
},
"dto.WorkspaceStopResult": {
"type": "object",
"properties": {
"buildLogUrl": {
"description": "表示停止的开发环境流水线日志地址",
"type": "string"
},
"message": {
"description": "表示操作结果提示信息",
"type": "string"
},
"sn": {
"description": "表示停止的开发环境流水线构建号",
"type": "string"
}
}
},
"dto.WorkspaceDetailResult": {
"type": "object",
"properties": {
"codebuddy": {
"description": "CodeBuddy 国际版客户端 remote-ssh 访问 schema 地址",
"type": "string"
},
"codebuddycn": {
"description": "CodeBuddy 国内版客户端 remote-ssh 访问 schema 地址",
"type": "string"
},
"cursor": {
"description": "Cursor 客户端 remote-ssh 访问 schema 地址",
"type": "string"
},
"jetbrains": {
"description": "jetbrains 系列 ide 的 jetbrains gateway 访问 schema 地址,环境内有安装 JetBrains 系列 ide 才会有",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"jumpUrl": {
"description": "选择入口页面 url",
"type": "string"
},
"remoteSsh": {
"description": "remote-ssh 连接地址",
"type": "string"
},
"ssh": {
"description": "ssh 登录命令",
"type": "string"
},
"vscode": {
"description": "VSCode 客户端 remote-ssh 访问 schema 地址",
"type": "string"
},
"vscode-insiders": {
"description": "Vscode 预览版客户端 remote-ssh 访问 schema 地址",
"type": "string"
},
"webide": {
"description": "WebIDE 访问 url",
"type": "string"
}
}
},
"dto.StartWorkspaceReq": {
"type": "object",
"properties": {
"branch": {
"description": "分支名或 tag 名例如main 或 v1.0.0。",
"type": "string"
},
"ref": {
"description": "Git ref例如refs/heads/main 或 refs/tags/v1.0.0。不传 ref 时默认基于分支启动",
"type": "string"
}
}
},
"dto.StartWorkspaceResult": {
"type": "object",
"properties": {
"buildLogUrl": {
"description": "仅新创建开发环境时返回,表示创建开发环境的流水线日志地址",
"type": "string"
},
"message": {
"description": "仅新创建开发环境时返回,表示创建开发环境的提示信息",
"type": "string"
},
"sn": {
"description": "仅新创建开发环境时返回,表示创建开发环境的流水线 sn",
"type": "string"
},
"url": {
"description": "如果存在开发环境,则返回 WebIDE 访问 url如果不存在开发环境则返回启动云原生开发的 loading 页面 url 地址",
"type": "string"
}
}
}
}
}

19212
docs/openapi/swagger-2.0.json Normal file

File diff suppressed because it is too large Load Diff

105
docs/split.ts Normal file
View File

@@ -0,0 +1,105 @@
import * as fs from 'fs';
import * as path from 'path';
const swaggerPath = 'docs/openapi/swagger-2.0.json';
const outputDir = 'docs/api-groups';
// 读取 swagger JSON
const swagger = JSON.parse(fs.readFileSync(swaggerPath, 'utf8'));
// 收集所有 tag 及其对应的 API
const tagApis: Record<string, any> = {};
// 遍历所有路径和方法
for (const [apiPath, methods] of Object.entries(swagger.paths)) {
for (const [method, operation] of Object.entries(methods as Record<string, any>)) {
const tags = operation.tags || ['default'];
for (const tag of tags) {
if (!tagApis[tag]) {
tagApis[tag] = {};
}
if (!tagApis[tag][apiPath]) {
tagApis[tag][apiPath] = {};
}
tagApis[tag][apiPath][method] = operation;
}
}
}
// 收集每个 tag 需要的 definitions
function getUsedDefinitions(apis: Record<string, any>): Set<string> {
const usedDefs = new Set<string>();
const jsonStr = JSON.stringify(apis);
const refMatches = jsonStr.match(/#\/definitions\/[^"]+/g) || [];
for (const ref of refMatches) {
const defName = ref.replace('#/definitions/', '');
usedDefs.add(defName);
}
return usedDefs;
}
// 递归收集依赖的 definitions
function getAllRequiredDefinitions(startDefs: Set<string>, allDefs: Record<string, any>): Set<string> {
const result = new Set<string>(startDefs);
let added = true;
while (added) {
added = false;
for (const defName of Array.from(result)) {
const def = allDefs[defName];
if (def && def.properties) {
for (const prop of Object.values(def.properties) as any[]) {
if (prop.$ref) {
const refName = prop.$ref.replace('#/definitions/', '');
if (!result.has(refName)) {
result.add(refName);
added = true;
}
}
}
}
// 检查数组类型的 items
if (def && def.items && def.items.$ref) {
const refName = def.items.$ref.replace('#/definitions/', '');
if (!result.has(refName)) {
result.add(refName);
added = true;
}
}
}
}
return result;
}
// 为每个 tag 创建输出目录和文件
for (const [tag, apis] of Object.entries(tagApis)) {
const tagDir = path.join(outputDir, tag.toLowerCase());
if (!fs.existsSync(tagDir)) {
fs.mkdirSync(tagDir, { recursive: true });
}
// 收集使用的 definitions
const usedDefs = getUsedDefinitions(apis);
const allRequiredDefs = getAllRequiredDefinitions(usedDefs, swagger.definitions || {});
// 构建输出的 swagger 片段
const outputSwagger: any = {
swagger: swagger.swagger,
info: swagger.info,
paths: apis,
definitions: {}
};
// 只包含需要的 definitions
for (const defName of allRequiredDefs) {
if (swagger.definitions && swagger.definitions[defName]) {
outputSwagger.definitions[defName] = swagger.definitions[defName];
}
}
// 写入文件
const outputPath = path.join(tagDir, 'api.json');
fs.writeFileSync(outputPath, JSON.stringify(outputSwagger, null, 2));
console.log(`Created: ${outputPath}`);
}
console.log(`\nTotal tags processed: ${Object.keys(tagApis).length}`);

View File

@@ -19,7 +19,7 @@
"devDependencies": {
"@kevisual/context": "^0.0.4",
"@kevisual/types": "^0.0.11",
"@opencode-ai/plugin": "^1.1.21",
"@opencode-ai/plugin": "^1.1.23",
"@types/bun": "^1.3.6",
"@types/node": "^25.0.9",
"dotenv": "^17.2.3"
@@ -29,7 +29,7 @@
},
"dependencies": {
"@kevisual/query": "^0.0.35",
"@kevisual/router": "^0.0.54",
"@kevisual/router": "^0.0.55",
"@kevisual/use-config": "^1.0.28",
"es-toolkit": "^1.43.0",
"nanoid": "^5.1.6",

28
pnpm-lock.yaml generated
View File

@@ -12,8 +12,8 @@ importers:
specifier: ^0.0.35
version: 0.0.35
'@kevisual/router':
specifier: ^0.0.54
version: 0.0.54
specifier: ^0.0.55
version: 0.0.55
'@kevisual/use-config':
specifier: ^1.0.28
version: 1.0.28(dotenv@17.2.3)
@@ -34,8 +34,8 @@ importers:
specifier: ^0.0.11
version: 0.0.11
'@opencode-ai/plugin':
specifier: ^1.1.21
version: 1.1.21
specifier: ^1.1.23
version: 1.1.23
'@types/bun':
specifier: ^1.3.6
version: 1.3.6
@@ -57,8 +57,8 @@ packages:
'@kevisual/query@0.0.35':
resolution: {integrity: sha512-80dyy2LMCmEC72g+X4QWUKlZErhawQPgnGSBNR4yhrBcFgHIJQ14LR1Z+bS5S1I7db+1PDNpaxBTjIaoYoXunw==}
'@kevisual/router@0.0.54':
resolution: {integrity: sha512-/D349QnAkTI2GWF0Kt549VvU3WC3NRZc9JW/56rkSYpJqTfU1kAztW6NhOgJhxHyqQiXrwgBBpObG0dfHrI/PA==}
'@kevisual/router@0.0.55':
resolution: {integrity: sha512-DVhXbbUCfSWWXsp1id1HBrkGiMZ6nFUBD1/C5E7IpLE5B32w7sv2xjKUt98OriFl0uyuneMEIZuZsAQaKplQ5g==}
'@kevisual/types@0.0.11':
resolution: {integrity: sha512-idNLDTEKVdNXZHFQq8PTN62nflh94kvGtx+v8YDcMxt0Zo+HWVZTFElm+dMQxAs/vn4wo8F2r3VwzWNX/vcqwQ==}
@@ -68,11 +68,11 @@ packages:
peerDependencies:
dotenv: ^17
'@opencode-ai/plugin@1.1.21':
resolution: {integrity: sha512-oAWVlKG7LACGFYawfdHGMN6e+6lyN6F+zPVncFUB99BrTl/TjELE5gTZwU7MalGpjwfU77yslBOZm4BXVAYGvw==}
'@opencode-ai/plugin@1.1.23':
resolution: {integrity: sha512-O/iLSKOUuzD95UWhj9y/tEuycPEBv36de0suHXXqeYLWZLZ16DAUSKR+YG7rvRjJS0sbn4biVMw+k7XXk/oxiQ==}
'@opencode-ai/sdk@1.1.21':
resolution: {integrity: sha512-4M6lBjRPlPz99Rb5rS5ZqKrb0UDDxOT9VTG06JpNxvA7ynTd8C50ckc2NGzWtvjarmxfaAk1VeuBYN/cq2pIKQ==}
'@opencode-ai/sdk@1.1.23':
resolution: {integrity: sha512-YjN9ogzkLol92s+/iARXRop9/5oFIezUkvWVay12u1IM6A/WJs50DeKl3oL0x4a68P1a5tI5gD98dLnk2+AlsA==}
'@types/bun@1.3.6':
resolution: {integrity: sha512-uWCv6FO/8LcpREhenN1d1b6fcspAB+cefwD7uti8C8VffIv0Um08TKMn98FynpTiU38+y2dUO55T11NgDt8VAA==}
@@ -122,7 +122,7 @@ snapshots:
dependencies:
tslib: 2.8.1
'@kevisual/router@0.0.54': {}
'@kevisual/router@0.0.55': {}
'@kevisual/types@0.0.11': {}
@@ -131,12 +131,12 @@ snapshots:
'@kevisual/load': 0.0.6
dotenv: 17.2.3
'@opencode-ai/plugin@1.1.21':
'@opencode-ai/plugin@1.1.23':
dependencies:
'@opencode-ai/sdk': 1.1.21
'@opencode-ai/sdk': 1.1.23
zod: 4.1.8
'@opencode-ai/sdk@1.1.21': {}
'@opencode-ai/sdk@1.1.23': {}
'@types/bun@1.3.6':
dependencies: