Compare commits
17 Commits
b4e5e5dce7
...
c0ca1c819e
| Author | SHA1 | Date | |
|---|---|---|---|
| c0ca1c819e | |||
|
|
7787337f13 | ||
|
|
a8f2cb14a7 | ||
|
|
f10f588ea5 | ||
|
|
d85f42d38b | ||
|
|
fc7a75b154 | ||
|
|
65da3f8c60 | ||
| 33d1c2b5ec | |||
|
|
285cdddb43 | ||
|
|
881fa3318a | ||
|
|
d86f4dc48f | ||
|
|
cedf3236b0 | ||
|
|
1d7a51f76c | ||
|
|
e5504284a1 | ||
|
|
a77e178431 | ||
|
|
e5a1d0d9e8 | ||
| f0af9a8621 |
1
.cnb.yml
1
.cnb.yml
@@ -21,6 +21,7 @@ $:
|
||||
# stages:
|
||||
# - name: pnpm install
|
||||
# script: pnpm install
|
||||
stages: !reference [.dev_tempalte, stages]
|
||||
|
||||
.common_sync_to_gitea: &common_sync_to_gitea
|
||||
- <<: *common_env
|
||||
|
||||
5
.cnb/scripts/init-cube.sh
Normal file
5
.cnb/scripts/init-cube.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
echo "${KUBECONFIG_DATA}" | base64 -d > ~/.kube/config
|
||||
chmod 600 ~/.kube/config
|
||||
|
||||
# 把 kube 配置转为 base64 编码输出,方便后续使用
|
||||
# cat ~/.kube/config | base64 -w 0
|
||||
@@ -1,3 +1,4 @@
|
||||
# 同步代码到gitea模板
|
||||
.common_sync_to_gitea_template: &common_sync_to_gitea_template
|
||||
services:
|
||||
- docker
|
||||
@@ -21,6 +22,7 @@
|
||||
sync_mode: rebase
|
||||
branch: main
|
||||
|
||||
# 同步gitea代码到当前仓库
|
||||
.common_sync_from_gitea_template: &common_sync_from_gitea_template
|
||||
services:
|
||||
- docker
|
||||
@@ -38,7 +40,6 @@
|
||||
script: git pull gitea main
|
||||
- name: '提交到原本的origin'
|
||||
script: git push origin main
|
||||
|
||||
# main:
|
||||
# web_trigger_sync_to_gitea:
|
||||
# - <<: *common_sync_to_gitea_template
|
||||
@@ -48,3 +49,107 @@
|
||||
# - <<: *common_sync_to_gitea_template
|
||||
# api_trigger_sync_from_gitea:
|
||||
# - <<: *common_sync_from_gitea_template
|
||||
|
||||
# kubectl 部署模版
|
||||
.kubectl_deploy_template: &kubectl_deploy_template
|
||||
services:
|
||||
- docker
|
||||
docker:
|
||||
image: docker.cnb.cool/kevisual/dev-env:latest
|
||||
imports:
|
||||
- https://cnb.cool/kevisual/env/-/blob/main/.env.development
|
||||
stages:
|
||||
- name: '部署k8s模块'
|
||||
script: |
|
||||
echo "${KUBECONFIG_DATA}" | base64 -d > ~/.kube/config
|
||||
chmod 600 ~/.kube/config
|
||||
|
||||
# 如果设置了 KUBE_CONTEXT,则切换上下文
|
||||
if [ -n "${KUBE_CONTEXT}" ]; then
|
||||
kubectl config use-context "${KUBE_CONTEXT}"
|
||||
fi
|
||||
export NAMESPACE=${KUBE_NAMESPACE:-default}
|
||||
kubectl rollout restart deployment/${KUBE_DEPLOYMENT} -n ${NAMESPACE}
|
||||
|
||||
# 打包并发布镜像
|
||||
.build_images_app_template: &build_images_app_template
|
||||
services:
|
||||
- docker
|
||||
docker:
|
||||
image: docker.cnb.cool/kevisual/dev-env:latest
|
||||
stages:
|
||||
- name: 检查环境是否需要打包
|
||||
script:
|
||||
- |
|
||||
if [ -f "package.json" ]; then
|
||||
echo "📦 开始前端构建流程"
|
||||
pnpm install
|
||||
pnpm run build || echo "⚠️ 构建失败或无 build script"
|
||||
else
|
||||
echo "🔍 非前端项目,跳过打包"
|
||||
fi
|
||||
- name: Docker build
|
||||
script: docker build -t ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:latest .
|
||||
- name: Docker push
|
||||
script: docker push ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:latest
|
||||
|
||||
|
||||
# 开发环境模版
|
||||
.dev_tempalte: &dev_tempalte
|
||||
services:
|
||||
- vscode
|
||||
docker:
|
||||
image: docker.cnb.cool/kevisual/dev-env:latest
|
||||
stages:
|
||||
- name: 软链 .env.development 文件到工作目录(仓库根目录)
|
||||
script: |
|
||||
if [ -e "/root/.cnb/.env.development" ]; then
|
||||
ln -sf /root/.cnb/.env.development ./.env
|
||||
else
|
||||
echo "文件不存在"
|
||||
fi
|
||||
printenv > ~/.env
|
||||
init_stages:
|
||||
- name: '安装依赖'
|
||||
script: |
|
||||
pnpm install
|
||||
if [ -e "/root/.cnb/.env" ]; then
|
||||
ln -sf /root/.cnb/.env ./.env
|
||||
else
|
||||
echo "文件不存在"
|
||||
fi
|
||||
|
||||
# 结束状态模版
|
||||
.end_state_template: &end_state_template
|
||||
endStages:
|
||||
- name: '结束'
|
||||
script: echo "流水线执行完毕,当前状态:${CNB_PIPELINE_STATUS}"
|
||||
|
||||
|
||||
# 预览模板
|
||||
.preview_template: &preview_template
|
||||
services:
|
||||
- name: vscode
|
||||
options:
|
||||
# 启用预览模式
|
||||
onlyPreview: true
|
||||
# 启动业务端口的命令,端口必须启动在 8686
|
||||
launch: node index.js
|
||||
# 保活时间,单位毫秒,不设置默认 10 分钟没有心跳(检测不到开发环境内的 http 连接)即关闭开发环境
|
||||
keepAliveTimeout: 3600000
|
||||
# 是否守护进程模式,默认为 false,非守护进程模式
|
||||
# true:以守护进程模式启动,即 launch 启动预览业务服务时,会直接运行在后台
|
||||
# false:非守护进程模式启动,执行 launch 启动预览业务服务时,可以看到日志,且需要等待 launch 启动完成并主动退出,才会继续执行后续流程
|
||||
# 推荐设置为 false,由用户自己实现业务启动成功后退出进程并后台运行,这样可以看到业务启动日志,方便定位问题
|
||||
daemon: true
|
||||
- docker
|
||||
|
||||
# 构建知识库模版
|
||||
.knowledge_template: &knowledge_template
|
||||
stages:
|
||||
- name: 搭建知识库
|
||||
image: cnbcool/knowledge-base
|
||||
settings:
|
||||
include:
|
||||
- "docs/**.md"
|
||||
- "blogs/**.md"
|
||||
@@ -4,8 +4,8 @@ branch:
|
||||
- reg: "^main"
|
||||
buttons:
|
||||
- name: 同步代码到gitea
|
||||
desc: 同步代码到gitea
|
||||
description: 同步代码到gitea
|
||||
event: web_trigger_sync_to_gitea
|
||||
- name: 同步gitea代码到当前仓库
|
||||
desc: 同步gitea代码到当前仓库
|
||||
description: 同步gitea代码到当前仓库
|
||||
event: web_trigger_sync_from_gitea
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
.env
|
||||
.env.local
|
||||
node_modules
|
||||
.pnpm-store
|
||||
72
.opencode/skills/create-repo/SKILL.md
Normal file
72
.opencode/skills/create-repo/SKILL.md
Normal file
@@ -0,0 +1,72 @@
|
||||
---
|
||||
name: create-new-repo
|
||||
description: 创建一个基本的新的代码仓库,并自动添加必要的配置文件。
|
||||
---
|
||||
|
||||
# 创建新的代码仓库
|
||||
该技能用于创建一个新的代码仓库,并自动添加必要的配置文件,如 `.cnb.yml`
|
||||
|
||||
|
||||
## 应用的步骤
|
||||
|
||||
1. 执行`create-repo`工具,参数是`/group/repo_name`,例如 `kevisual/my-new-repo`
|
||||
2. 调用`create-repo-file`工具, 添加`.cnb.yml`配置文件,其中仓库名称是第一步的仓库参数。
|
||||
|
||||
## 要求
|
||||
1. 不要做任何多余的事情,只做相关的任务,不要额外的解释和说明。
|
||||
2. 如果执行错误,只返回错误信息。
|
||||
2. 确保`.cnb.yml`文件内容正确无误。
|
||||
|
||||
|
||||
## 注意事项
|
||||
### 1. `.cnb.yml配置文件内容示例`
|
||||
|
||||
TO_REPO 为 kevisual/repo_name
|
||||
|
||||
```yaml
|
||||
# .cnb.yml
|
||||
include:
|
||||
- https://cnb.cool/kevisual/cnb/-/blob/main/.cnb/template.yml
|
||||
|
||||
.common_env: &common_env
|
||||
env:
|
||||
TO_REPO: kevisual/cnb
|
||||
TO_URL: git.xiongxiao.me
|
||||
imports:
|
||||
- https://cnb.cool/kevisual/env/-/blob/main/.env.development
|
||||
|
||||
$:
|
||||
vscode:
|
||||
- docker:
|
||||
image: docker.cnb.cool/kevisual/dev-env:latest
|
||||
services:
|
||||
- vscode
|
||||
- docker
|
||||
imports: !reference [.common_env, imports]
|
||||
# 开发环境启动后会执行的任务
|
||||
# stages:
|
||||
# - name: pnpm install
|
||||
# script: pnpm install
|
||||
stages: !reference [.dev_tempalte, stages]
|
||||
|
||||
.common_sync_to_gitea: &common_sync_to_gitea
|
||||
- <<: *common_env
|
||||
services: !reference [.common_sync_to_gitea_template, services]
|
||||
stages: !reference [.common_sync_to_gitea_template, stages]
|
||||
|
||||
.common_sync_from_gitea: &common_sync_from_gitea
|
||||
- <<: *common_env
|
||||
services: !reference [.common_sync_from_gitea_template, services]
|
||||
stages: !reference [.common_sync_from_gitea_template, stages]
|
||||
|
||||
main:
|
||||
web_trigger_sync_to_gitea:
|
||||
- <<: *common_sync_to_gitea
|
||||
web_trigger_sync_from_gitea:
|
||||
- <<: *common_sync_from_gitea
|
||||
api_trigger_sync_to_gitea:
|
||||
- <<: *common_sync_to_gitea
|
||||
api_trigger_sync_from_gitea:
|
||||
- <<: *common_sync_from_gitea
|
||||
|
||||
```
|
||||
10
agent/app.ts
10
agent/app.ts
@@ -1,14 +1,18 @@
|
||||
import { QueryRouterServer as App } from '@kevisual/router'
|
||||
import { useContextKey } from '@kevisual/context'
|
||||
import { useConfig } from '@kevisual/use-config'
|
||||
import { useConfig, useKey } from '@kevisual/use-config'
|
||||
import { CNB } from '../src/index.ts';
|
||||
import { nanoid } from 'nanoid';
|
||||
|
||||
export const config = useConfig()
|
||||
export const cnb = useContextKey<CNB>('cnb', () => {
|
||||
return new CNB({ token: config.CNB_TOKEN, cookie: config.CNB_COOKIE, group: config.CNB_GROUP });
|
||||
const token = useKey('CNB_API_KEY') as string
|
||||
const cookie = useKey('CNB_COOKIE') as string
|
||||
return new CNB({ token: token, cookie: cookie });
|
||||
})
|
||||
export const appId = nanoid();
|
||||
export const app = useContextKey<App>('app', () => {
|
||||
return new App()
|
||||
return new App({
|
||||
appId
|
||||
})
|
||||
})
|
||||
@@ -1,35 +1,86 @@
|
||||
import { tool } from "@opencode-ai/plugin/tool"
|
||||
import { type Plugin } from "@opencode-ai/plugin"
|
||||
import { app, cnb, appId } from './index.ts';
|
||||
import { } from 'es-toolkit'
|
||||
import { Skill } from "@kevisual/router";
|
||||
|
||||
const routes = app.routes.filter(r => {
|
||||
const metadata = r.metadata as Skill
|
||||
if (metadata && metadata.tags && metadata.tags.includes('opencode')) {
|
||||
return !!metadata.skill
|
||||
}
|
||||
return false
|
||||
})
|
||||
|
||||
// opencode run "请使用 cnb-login-verify 工具验证登录信信息,检查cookie"
|
||||
export const CnbPlugin: Plugin = async ({ project, client, $, directory, worktree }) => {
|
||||
return {
|
||||
'tool': {
|
||||
"cnb-login-verify": {
|
||||
name: "CNB 登录验证信息",
|
||||
description: "验证 CNB 登录信息是否有效",
|
||||
args: {
|
||||
checkToken: tool.schema.boolean().describe("是否检查 Token 的有效性").default(true),
|
||||
checkCookie: tool.schema.boolean().describe("是否检查 Cookie 的有效性").default(false),
|
||||
},
|
||||
async execute(args) {
|
||||
const res = await app.run({
|
||||
path: 'cnb',
|
||||
key: 'user-check',
|
||||
payload: {
|
||||
...args
|
||||
...routes.reduce((acc, route) => {
|
||||
const metadata = route.metadata as Skill
|
||||
acc[metadata.skill!] = {
|
||||
name: metadata.title || metadata.skill,
|
||||
description: metadata.summary || '',
|
||||
args: metadata.args || {},
|
||||
async execute(args: Record<string, any>) {
|
||||
console.log(`Executing skill ${metadata.skill} with args:`, args);
|
||||
await client.app.log({
|
||||
body: {
|
||||
service: 'cnb',
|
||||
level: 'info',
|
||||
message: `Executing skill ${metadata.skill} with args: ${JSON.stringify(args)}`
|
||||
}
|
||||
});
|
||||
const res = await app.run({
|
||||
path: route.path,
|
||||
key: route.key,
|
||||
payload: args
|
||||
}, { appId });
|
||||
if (res.code === 200) {
|
||||
if (res.data?.content) {
|
||||
return res.data.content;
|
||||
}
|
||||
const str = JSON.stringify(res.data || res, null, 2);
|
||||
if (str.length > 5000) {
|
||||
return str.slice(0, 5000) + '... (truncated)';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}, { appId });
|
||||
if (res.code === 200) {
|
||||
return res.data?.output;
|
||||
return `Error: ${res?.message || '无法获取结果'}`;
|
||||
}
|
||||
return '无法获取登录状态,请检查配置。';
|
||||
},
|
||||
},
|
||||
}
|
||||
return acc;
|
||||
}, {} as Record<string, any>)
|
||||
},
|
||||
'tool.execute.before': async (opts) => {
|
||||
// console.log('CnbPlugin: tool.execute.before', opts.tool);
|
||||
// delete toolSkills['cnb-login-verify']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const demo = {
|
||||
'tool': {
|
||||
"cnb-login-verify": {
|
||||
name: "CNB 登录验证信息",
|
||||
description: "验证 CNB 登录信息是否有效",
|
||||
args: {
|
||||
checkToken: tool.schema.boolean().describe("是否检查 Token 的有效性").default(true),
|
||||
checkCookie: tool.schema.boolean().describe("是否检查 Cookie 的有效性").default(false),
|
||||
},
|
||||
async execute(args) {
|
||||
const res = await app.run({
|
||||
path: 'cnb',
|
||||
key: 'user-check',
|
||||
payload: {
|
||||
...args
|
||||
}
|
||||
}, { appId });
|
||||
if (res.code === 200) {
|
||||
return res.data?.output;
|
||||
}
|
||||
return '无法获取登录状态,请检查配置。';
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,17 @@
|
||||
import { app, appId } from '@/agent/app.ts';
|
||||
import { app, appId } from '../app.ts';
|
||||
import './user/check.ts'
|
||||
|
||||
import './repo/index.ts'
|
||||
import './workspace/index.ts'
|
||||
import { isEqual } from 'es-toolkit'
|
||||
/**
|
||||
* 验证上下文中的 App ID 是否与指定的 App ID 匹配
|
||||
* @param {any} ctx - 上下文对象,可能包含 appId 属性
|
||||
* @param {string} appId - 需要验证的目标 App ID
|
||||
* @returns {boolean} 如果 ctx 中包含 appId 且匹配则返回 true,否则返回 false
|
||||
* @throws {Error} 如果 ctx 中包含 appId 但不匹配,则抛出 403 错误
|
||||
*/
|
||||
const checkAppId = (ctx: any, appId: string) => {
|
||||
const _appId = ctx?.appId;
|
||||
const _appId = ctx?.app?.appId;
|
||||
if (_appId) {
|
||||
if (_appId !== appId) {
|
||||
ctx.throw(403, 'Invalid App ID');
|
||||
|
||||
@@ -1,53 +1,108 @@
|
||||
import { app, cnb } from '@/agent/app.ts';
|
||||
|
||||
import { app, cnb } from '../../app.ts';
|
||||
import { createSkill, Skill } from '@kevisual/router'
|
||||
import { tool } from "@opencode-ai/plugin/tool"
|
||||
app.route({
|
||||
path: 'cnb',
|
||||
key: 'repo-create',
|
||||
key: 'create-repo',
|
||||
description: '创建代码仓库, 参数name, visibility, description',
|
||||
middleware: ['auth'],
|
||||
metadata: {
|
||||
tags: ['opencode']
|
||||
tags: ['opencode'],
|
||||
...createSkill({
|
||||
skill: 'create-repo',
|
||||
title: '创建代码仓库',
|
||||
args: {
|
||||
name: tool.schema.string().describe('代码仓库名称, 如 my-user/my-repo'),
|
||||
visibility: tool.schema.string().describe('代码仓库可见性, public 或 private').default('public'),
|
||||
description: tool.schema.string().describe('代码仓库描述'),
|
||||
},
|
||||
summary: '创建一个新的代码仓库',
|
||||
})
|
||||
}
|
||||
}).define(async (ctx) => {
|
||||
const name = ctx.query?.name;
|
||||
const visibility = ctx.query?.visibility ?? 'private';
|
||||
const visibility = ctx.query?.visibility ?? 'public';
|
||||
const description = ctx.query?.description ?? '';
|
||||
|
||||
if (!name) {
|
||||
ctx.throw(400, '缺少参数 name');
|
||||
}
|
||||
try {
|
||||
|
||||
const res = await cnb.repo.createRepo(cnb.group, {
|
||||
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: 'repo-create-file',
|
||||
description: '在代码仓库中创建文件, 参数repoName, path, content, encoding',
|
||||
key: 'create-repo-file',
|
||||
description: '在代码仓库中创建文件, repoName, filePath, content, encoding',
|
||||
middleware: ['auth'],
|
||||
metadata: {
|
||||
tags: ['opencode']
|
||||
tags: ['opencode'],
|
||||
...createSkill({
|
||||
skill: 'create-repo-file',
|
||||
title: '在代码仓库中创建文件',
|
||||
summary: `在代码仓库中创建文件, encoding 可选,默认 raw`,
|
||||
args: {
|
||||
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(),
|
||||
},
|
||||
})
|
||||
}
|
||||
}).define(async (ctx) => {
|
||||
const repoName = ctx.query?.repoName;
|
||||
const path = ctx.query?.path;
|
||||
const filePath = ctx.query?.filePath;
|
||||
const content = ctx.query?.content;
|
||||
const encoding = ctx.query?.encoding ?? 'raw';
|
||||
|
||||
if (!repoName || !path || !content) {
|
||||
ctx.throw(400, '缺少参数 repoName, path 或 content');
|
||||
if (!repoName || !filePath || !content) {
|
||||
ctx.throw(400, '缺少参数 repoName, filePath 或 content');
|
||||
}
|
||||
|
||||
const res = await cnb.repo.createCommit(repoName, {
|
||||
message: `添加文件 ${path} 通过 API `,
|
||||
message: `添加文件 ${filePath} 通过 API `,
|
||||
files: [
|
||||
{ path, content, encoding },
|
||||
{ path: filePath, content, encoding },
|
||||
],
|
||||
});
|
||||
ctx.forward(res);
|
||||
}).addTo(app);
|
||||
|
||||
|
||||
app.route({
|
||||
path: 'cnb',
|
||||
key: 'delete-repo',
|
||||
description: '删除代码仓库, 参数name',
|
||||
middleware: ['auth'],
|
||||
metadata: {
|
||||
tags: ['opencode'],
|
||||
...createSkill({
|
||||
skill: 'delete-repo',
|
||||
title: '删除代码仓库',
|
||||
args: {
|
||||
name: tool.schema.string().describe('代码仓库名称'),
|
||||
},
|
||||
summary: '删除一个代码仓库',
|
||||
})
|
||||
}
|
||||
}).define(async (ctx) => {
|
||||
const name = ctx.query?.name;
|
||||
|
||||
if (!name) {
|
||||
ctx.throw(400, '缺少参数 name');
|
||||
}
|
||||
|
||||
const res = await cnb.repo.deleteRepo(name);
|
||||
ctx.forward(res);
|
||||
}).addTo(app);
|
||||
@@ -1,4 +1,6 @@
|
||||
import { app, cnb } from '@/agent/app.ts';
|
||||
import { createSkill } from '@kevisual/router';
|
||||
import { app, cnb } from '../../app.ts';
|
||||
import { tool } from '@opencode-ai/plugin/tool';
|
||||
|
||||
|
||||
app.route({
|
||||
@@ -7,27 +9,36 @@ app.route({
|
||||
description: '检查用户登录状态,参数checkToken,default true; checkCookie, default false',
|
||||
middleware: ['auth'],
|
||||
metadata: {
|
||||
tags: ['opencode']
|
||||
tags: ['opencode'],
|
||||
...createSkill({
|
||||
skill: 'cnb-login-verify',
|
||||
title: 'CNB 登录验证信息',
|
||||
summary: '验证 CNB 登录信息是否有效',
|
||||
args: {
|
||||
checkToken: tool.schema.boolean().describe('是否检查 Token 的有效性').default(true),
|
||||
checkCookie: tool.schema.boolean().describe('是否检查 Cookie 的有效性').default(false),
|
||||
},
|
||||
})
|
||||
}
|
||||
}).define(async (ctx) => {
|
||||
const checkToken = ctx.query?.checkToken ?? true;
|
||||
const checkCookie = ctx.query?.checkCookie ?? false;
|
||||
let output = '';
|
||||
let content = '';
|
||||
if (checkToken) {
|
||||
const res = await cnb.user.getUser();
|
||||
if (res?.code !== 200) {
|
||||
output += `Token 无效,请检查 CNB_TOKEN 配置。\n`;
|
||||
content += `Token 无效,请检查 CNB_TOKEN 配置。\n`;
|
||||
} else {
|
||||
output += `Token 有效,Token用户昵称:${res.data?.nickname}\n`;
|
||||
content += `Token 有效,Token用户昵称:${res.data?.nickname}\n`;
|
||||
}
|
||||
}
|
||||
if (checkCookie) {
|
||||
const res = await cnb.user.getCurrentUser();
|
||||
if (res?.code !== 200) {
|
||||
output += `Cookie 无效,请检查 CNB_COOKIE 配置。\n`;
|
||||
content += `Cookie 无效,请检查 CNB_COOKIE 配置。\n`;
|
||||
} else {
|
||||
output += `Cookie 有效,当前Cookie用户:${res.data?.nickname}\n`;
|
||||
content += `Cookie 有效,当前Cookie用户:${res.data?.nickname}\n`;
|
||||
}
|
||||
}
|
||||
ctx.body = { output };
|
||||
ctx.body = { content };
|
||||
}).addTo(app);
|
||||
@@ -1,4 +1,4 @@
|
||||
import { app, cnb } from '@/agent/app.ts';
|
||||
import { app, cnb } from '../../app.ts';
|
||||
|
||||
app.route({
|
||||
path: 'cnb',
|
||||
|
||||
2
bun-test/.gitignore
vendored
2
bun-test/.gitignore
vendored
@@ -1,2 +0,0 @@
|
||||
node_modules
|
||||
dist
|
||||
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"name": "bun-test",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"packageManager": "pnpm@10.25.0",
|
||||
"devDependencies": {
|
||||
"@types/bun": "^1.3.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@rollup/plugin-node-resolve": "^16.0.3",
|
||||
"esbuild": "^0.27.2",
|
||||
"lodash-es": "^4.17.22",
|
||||
"rollup": "^4.54.0"
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
// rollup.config.ts
|
||||
import type { Plugin, RollupOptions } from 'rollup';
|
||||
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
||||
|
||||
const cdnRewritePlugin: Plugin = {
|
||||
name: 'rewrite-lodash-to-cdn',
|
||||
resolveId(id) {
|
||||
if (id === 'lodash-es') {
|
||||
return 'https://esm.sh/lodash-es@5';
|
||||
}
|
||||
if (id.startsWith('lodash-es/')) {
|
||||
const [, sub] = id.split('/', 2);
|
||||
return `https://esm.sh/lodash-es@5/${sub}`;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
};
|
||||
|
||||
const config: RollupOptions = {
|
||||
input: 'src/index.ts',
|
||||
output: {
|
||||
dir: 'dist',
|
||||
format: 'esm',
|
||||
},
|
||||
plugins: [cdnRewritePlugin, nodeResolve({ browser: true })],
|
||||
external(id) {
|
||||
return id.startsWith('https://');
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -1,3 +0,0 @@
|
||||
import { debounce } from 'lodash-es';
|
||||
|
||||
export const debounceFn = debounce;
|
||||
14
create-repo-test.ts
Normal file
14
create-repo-test.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { CNB } from './src/index.ts';
|
||||
|
||||
const cnb = new CNB({
|
||||
token: 'cIDfLOOIr1Trt15cdnwfndupEZG',
|
||||
cookie: ''
|
||||
});
|
||||
|
||||
const res = await cnb.repo.createRepo('kevisual', {
|
||||
name: 'exam-kevisual',
|
||||
description: 'exam repository for kevisual',
|
||||
visibility: 'public'
|
||||
});
|
||||
|
||||
console.log('Result:', JSON.stringify(res, null, 2));
|
||||
387
docs/api-groups/activities/api.json
Normal file
387
docs/api-groups/activities/api.json
Normal 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
200
docs/api-groups/ai/api.json
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
158
docs/api-groups/assets/api.json
Normal file
158
docs/api-groups/assets/api.json
Normal 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 删除一个 asset,release和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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
265
docs/api-groups/badge/api.json
Normal file
265
docs/api-groups/badge/api.json
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
630
docs/api-groups/build/api.json
Normal file
630
docs/api-groups/build/api.json
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
119
docs/api-groups/charge/api.json
Normal file
119
docs/api-groups/charge/api.json
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
300
docs/api-groups/collaborators/api.json
Normal file
300
docs/api-groups/collaborators/api.json
Normal 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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
56
docs/api-groups/event/api.json
Normal file
56
docs/api-groups/event/api.json
Normal 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": {}
|
||||
}
|
||||
147
docs/api-groups/followers/api.json
Normal file
147
docs/api-groups/followers/api.json
Normal 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
2402
docs/api-groups/git/api.json
Normal file
File diff suppressed because it is too large
Load Diff
744
docs/api-groups/gitsettings/api.json
Normal file
744
docs/api-groups/gitsettings/api.json
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1830
docs/api-groups/issues/api.json
Normal file
1830
docs/api-groups/issues/api.json
Normal file
File diff suppressed because it is too large
Load Diff
348
docs/api-groups/knowledgebase/api.json
Normal file
348
docs/api-groups/knowledgebase/api.json
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1417
docs/api-groups/members/api.json
Normal file
1417
docs/api-groups/members/api.json
Normal file
File diff suppressed because it is too large
Load Diff
632
docs/api-groups/missions/api.json
Normal file
632
docs/api-groups/missions/api.json
Normal 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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
1095
docs/api-groups/organizations/api.json
Normal file
1095
docs/api-groups/organizations/api.json
Normal file
File diff suppressed because it is too large
Load Diff
2549
docs/api-groups/pulls/api.json
Normal file
2549
docs/api-groups/pulls/api.json
Normal file
File diff suppressed because it is too large
Load Diff
1825
docs/api-groups/registries/api.json
Normal file
1825
docs/api-groups/registries/api.json
Normal file
File diff suppressed because it is too large
Load Diff
932
docs/api-groups/releases/api.json
Normal file
932
docs/api-groups/releases/api.json
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
134
docs/api-groups/repocontributor/api.json
Normal file
134
docs/api-groups/repocontributor/api.json
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
314
docs/api-groups/repolabels/api.json
Normal file
314
docs/api-groups/repolabels/api.json
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1303
docs/api-groups/repositories/api.json
Normal file
1303
docs/api-groups/repositories/api.json
Normal file
File diff suppressed because it is too large
Load Diff
286
docs/api-groups/security/api.json
Normal file
286
docs/api-groups/security/api.json
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
463
docs/api-groups/starring/api.json
Normal file
463
docs/api-groups/starring/api.json
Normal 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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
691
docs/api-groups/users/api.json
Normal file
691
docs/api-groups/users/api.json
Normal 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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
427
docs/api-groups/workspace/api.json
Normal file
427
docs/api-groups/workspace/api.json
Normal 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": "表示要删除的开发环境流水线 id,sn 和 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": "表示要停止的开发环境的流水线 id,sn 和 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
19212
docs/openapi/swagger-2.0.json
Normal file
File diff suppressed because it is too large
Load Diff
10
docs/skill/split/SKILL.md
Normal file
10
docs/skill/split/SKILL.md
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
name: split-cnb-openapi
|
||||
description: 拆分 OpenAPI 文档
|
||||
---
|
||||
|
||||
使用 bun 执行 docs/split.ts 脚本,拆分 OpenAPI 文档为多个小文件。
|
||||
|
||||
```bash
|
||||
bun docs/split.ts
|
||||
```
|
||||
105
docs/split.ts
Normal file
105
docs/split.ts
Normal 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}`);
|
||||
@@ -1,47 +0,0 @@
|
||||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Read(*)",
|
||||
"Write(*)",
|
||||
"Edit(*)",
|
||||
"Glob(*)",
|
||||
"Grep(*)",
|
||||
"Bash(node:*)",
|
||||
"Bash(npm:*)",
|
||||
"Bash(npx:*)",
|
||||
"Bash(pnpm:*)",
|
||||
"Bash(deno:*)",
|
||||
"Bash(bun:*)",
|
||||
"Bash(kubectl:*)",
|
||||
"Bash(git:*)",
|
||||
"Bash(git:*:*)",
|
||||
"Bash(python:*)",
|
||||
"Bash(pip:*)",
|
||||
"Bash(mkdir:*)",
|
||||
"Bash(rm:*)",
|
||||
"Bash(cp:*)",
|
||||
"Bash(mv:*)",
|
||||
"Bash(ls:*)",
|
||||
"Bash(cat:*)",
|
||||
"Bash(rm:*)",
|
||||
"Bash(du:*)",
|
||||
"Bash(df:*)",
|
||||
"Bash(pwd:*)",
|
||||
"Bash(whoami:*)",
|
||||
"Bash(test:*)",
|
||||
"Bash(echo:*)",
|
||||
"Bash(timeout:*:*)",
|
||||
"Bash(touch:*)",
|
||||
"Bash(file:*)",
|
||||
"Bash(type:*)",
|
||||
"Bash(ev:*)",
|
||||
"Bash(opencode:*)"
|
||||
],
|
||||
"deny": [],
|
||||
"ask": [
|
||||
"Bash(rm:-rf)",
|
||||
"Bash(rm:-R)",
|
||||
"Bash(rm:-r)"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,19 @@
|
||||
"baseURL": "https://api.minimaxi.com/anthropic/v1",
|
||||
"apiKey": "{env:MINIMAX_API_KEY}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"custom-doubao": {
|
||||
"npm": "@ai-sdk/openai-compatible",
|
||||
"name": "国内火山AI",
|
||||
"models": {
|
||||
"ark-code-latest": {
|
||||
"name": "ark-code-latest"
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"baseURL": "https://ark.cn-beijing.volces.com/api/coding/v3",
|
||||
"apiKey": "{env:DOUBAO_API_KEY}"
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
15
package.json
15
package.json
@@ -18,10 +18,10 @@
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"@kevisual/context": "^0.0.4",
|
||||
"@kevisual/types": "^0.0.10",
|
||||
"@opencode-ai/plugin": "^1.1.13",
|
||||
"@types/bun": "^1.3.5",
|
||||
"@types/node": "^25.0.6",
|
||||
"@kevisual/types": "^0.0.11",
|
||||
"@opencode-ai/plugin": "^1.1.23",
|
||||
"@types/bun": "^1.3.6",
|
||||
"@types/node": "^25.0.9",
|
||||
"dotenv": "^17.2.3"
|
||||
},
|
||||
"publishConfig": {
|
||||
@@ -29,9 +29,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@kevisual/query": "^0.0.35",
|
||||
"@kevisual/router": "^0.0.52",
|
||||
"@kevisual/use-config": "^1.0.24",
|
||||
"@kevisual/router": "^0.0.55",
|
||||
"@kevisual/use-config": "^1.0.28",
|
||||
"es-toolkit": "^1.43.0",
|
||||
"nanoid": "^5.1.6"
|
||||
"nanoid": "^5.1.6",
|
||||
"zod": "^4.3.5"
|
||||
}
|
||||
}
|
||||
431
pnpm-lock.yaml
generated
431
pnpm-lock.yaml
generated
@@ -12,33 +12,36 @@ importers:
|
||||
specifier: ^0.0.35
|
||||
version: 0.0.35
|
||||
'@kevisual/router':
|
||||
specifier: ^0.0.52
|
||||
version: 0.0.52
|
||||
specifier: ^0.0.55
|
||||
version: 0.0.55
|
||||
'@kevisual/use-config':
|
||||
specifier: ^1.0.24
|
||||
version: 1.0.24(dotenv@17.2.3)
|
||||
specifier: ^1.0.28
|
||||
version: 1.0.28(dotenv@17.2.3)
|
||||
es-toolkit:
|
||||
specifier: ^1.43.0
|
||||
version: 1.43.0
|
||||
nanoid:
|
||||
specifier: ^5.1.6
|
||||
version: 5.1.6
|
||||
zod:
|
||||
specifier: ^4.3.5
|
||||
version: 4.3.5
|
||||
devDependencies:
|
||||
'@kevisual/context':
|
||||
specifier: ^0.0.4
|
||||
version: 0.0.4
|
||||
'@kevisual/types':
|
||||
specifier: ^0.0.10
|
||||
version: 0.0.10
|
||||
specifier: ^0.0.11
|
||||
version: 0.0.11
|
||||
'@opencode-ai/plugin':
|
||||
specifier: ^1.1.13
|
||||
version: 1.1.13
|
||||
specifier: ^1.1.23
|
||||
version: 1.1.23
|
||||
'@types/bun':
|
||||
specifier: ^1.3.5
|
||||
version: 1.3.5
|
||||
specifier: ^1.3.6
|
||||
version: 1.3.6
|
||||
'@types/node':
|
||||
specifier: ^25.0.6
|
||||
version: 25.0.6
|
||||
specifier: ^25.0.9
|
||||
version: 25.0.9
|
||||
dotenv:
|
||||
specifier: ^17.2.3
|
||||
version: 17.2.3
|
||||
@@ -54,202 +57,59 @@ packages:
|
||||
'@kevisual/query@0.0.35':
|
||||
resolution: {integrity: sha512-80dyy2LMCmEC72g+X4QWUKlZErhawQPgnGSBNR4yhrBcFgHIJQ14LR1Z+bS5S1I7db+1PDNpaxBTjIaoYoXunw==}
|
||||
|
||||
'@kevisual/router@0.0.52':
|
||||
resolution: {integrity: sha512-Qiv3P1XjzD813Tm79S+atrDb2eickGCI9tuy/aCu512LcoYYJqZhwwkeT4ES0DinnA13Ckqd43QWBR6UmuYkHQ==}
|
||||
'@kevisual/router@0.0.55':
|
||||
resolution: {integrity: sha512-DVhXbbUCfSWWXsp1id1HBrkGiMZ6nFUBD1/C5E7IpLE5B32w7sv2xjKUt98OriFl0uyuneMEIZuZsAQaKplQ5g==}
|
||||
|
||||
'@kevisual/types@0.0.10':
|
||||
resolution: {integrity: sha512-Q73uzzjk9UidumnmCvOpgzqDDvQxsblz22bIFuoiioUFJWwaparx8bpd8ArRyFojicYL1YJoFDzDZ9j9NN8grA==}
|
||||
'@kevisual/types@0.0.11':
|
||||
resolution: {integrity: sha512-idNLDTEKVdNXZHFQq8PTN62nflh94kvGtx+v8YDcMxt0Zo+HWVZTFElm+dMQxAs/vn4wo8F2r3VwzWNX/vcqwQ==}
|
||||
|
||||
'@kevisual/use-config@1.0.24':
|
||||
resolution: {integrity: sha512-R/NcK7JtJuFuT+kKGpK89EM9oCyQzy+bIoL+hPnzdQv2TuoFULgS+CoxxYBfAjX2kCjELoNFuo9nceWSNcHNMw==}
|
||||
'@kevisual/use-config@1.0.28':
|
||||
resolution: {integrity: sha512-ngF+LDbjxpXWrZNmnShIKF/jPpAa+ezV+DcgoZIIzHlRnIjE+rr9sLkN/B7WJbiH9C/j1tQXOILY8ujBqILrow==}
|
||||
peerDependencies:
|
||||
dotenv: ^17
|
||||
|
||||
'@noble/hashes@1.4.0':
|
||||
resolution: {integrity: sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==}
|
||||
engines: {node: '>= 16'}
|
||||
'@opencode-ai/plugin@1.1.23':
|
||||
resolution: {integrity: sha512-O/iLSKOUuzD95UWhj9y/tEuycPEBv36de0suHXXqeYLWZLZ16DAUSKR+YG7rvRjJS0sbn4biVMw+k7XXk/oxiQ==}
|
||||
|
||||
'@opencode-ai/plugin@1.1.13':
|
||||
resolution: {integrity: sha512-JcAsVR58EcbrHus9P8zWrhcZPw9BZbP7YYer/hk/mfpBQLLxxBQcBimnRlcRmzhw4fA0sRnwmDBRf45GdANeHQ==}
|
||||
'@opencode-ai/sdk@1.1.23':
|
||||
resolution: {integrity: sha512-YjN9ogzkLol92s+/iARXRop9/5oFIezUkvWVay12u1IM6A/WJs50DeKl3oL0x4a68P1a5tI5gD98dLnk2+AlsA==}
|
||||
|
||||
'@opencode-ai/sdk@1.1.13':
|
||||
resolution: {integrity: sha512-tZ/mTAHds201ebEWBcpMiqf+MG2Hl1eDpJAcuUo2VZqmWcksdSenhnWNaqU3e/3T5oMuLiAkxXzUi3zQCQONuQ==}
|
||||
'@types/bun@1.3.6':
|
||||
resolution: {integrity: sha512-uWCv6FO/8LcpREhenN1d1b6fcspAB+cefwD7uti8C8VffIv0Um08TKMn98FynpTiU38+y2dUO55T11NgDt8VAA==}
|
||||
|
||||
'@peculiar/asn1-cms@2.6.0':
|
||||
resolution: {integrity: sha512-2uZqP+ggSncESeUF/9Su8rWqGclEfEiz1SyU02WX5fUONFfkjzS2Z/F1Li0ofSmf4JqYXIOdCAZqIXAIBAT1OA==}
|
||||
'@types/node@25.0.9':
|
||||
resolution: {integrity: sha512-/rpCXHlCWeqClNBwUhDcusJxXYDjZTyE8v5oTO7WbL8eij2nKhUeU89/6xgjU7N4/Vh3He0BtyhJdQbDyhiXAw==}
|
||||
|
||||
'@peculiar/asn1-csr@2.6.0':
|
||||
resolution: {integrity: sha512-BeWIu5VpTIhfRysfEp73SGbwjjoLL/JWXhJ/9mo4vXnz3tRGm+NGm3KNcRzQ9VMVqwYS2RHlolz21svzRXIHPQ==}
|
||||
|
||||
'@peculiar/asn1-ecc@2.6.0':
|
||||
resolution: {integrity: sha512-FF3LMGq6SfAOwUG2sKpPXblibn6XnEIKa+SryvUl5Pik+WR9rmRA3OCiwz8R3lVXnYnyRkSZsSLdml8H3UiOcw==}
|
||||
|
||||
'@peculiar/asn1-pfx@2.6.0':
|
||||
resolution: {integrity: sha512-rtUvtf+tyKGgokHHmZzeUojRZJYPxoD/jaN1+VAB4kKR7tXrnDCA/RAWXAIhMJJC+7W27IIRGe9djvxKgsldCQ==}
|
||||
|
||||
'@peculiar/asn1-pkcs8@2.6.0':
|
||||
resolution: {integrity: sha512-KyQ4D8G/NrS7Fw3XCJrngxmjwO/3htnA0lL9gDICvEQ+GJ+EPFqldcJQTwPIdvx98Tua+WjkdKHSC0/Km7T+lA==}
|
||||
|
||||
'@peculiar/asn1-pkcs9@2.6.0':
|
||||
resolution: {integrity: sha512-b78OQ6OciW0aqZxdzliXGYHASeCvvw5caqidbpQRYW2mBtXIX2WhofNXTEe7NyxTb0P6J62kAAWLwn0HuMF1Fw==}
|
||||
|
||||
'@peculiar/asn1-rsa@2.6.0':
|
||||
resolution: {integrity: sha512-Nu4C19tsrTsCp9fDrH+sdcOKoVfdfoQQ7S3VqjJU6vedR7tY3RLkQ5oguOIB3zFW33USDUuYZnPEQYySlgha4w==}
|
||||
|
||||
'@peculiar/asn1-schema@2.6.0':
|
||||
resolution: {integrity: sha512-xNLYLBFTBKkCzEZIw842BxytQQATQv+lDTCEMZ8C196iJcJJMBUZxrhSTxLaohMyKK8QlzRNTRkUmanucnDSqg==}
|
||||
|
||||
'@peculiar/asn1-x509-attr@2.6.0':
|
||||
resolution: {integrity: sha512-MuIAXFX3/dc8gmoZBkwJWxUWOSvG4MMDntXhrOZpJVMkYX+MYc/rUAU2uJOved9iJEoiUx7//3D8oG83a78UJA==}
|
||||
|
||||
'@peculiar/asn1-x509@2.6.0':
|
||||
resolution: {integrity: sha512-uzYbPEpoQiBoTq0/+jZtpM6Gq6zADBx+JNFP3yqRgziWBxQ/Dt/HcuvRfm9zJTPdRcBqPNdaRHTVwpyiq6iNMA==}
|
||||
|
||||
'@peculiar/x509@1.14.2':
|
||||
resolution: {integrity: sha512-r2w1Hg6pODDs0zfAKHkSS5HLkOLSeburtcgwvlLLWWCixw+MmW3U6kD5ddyvc2Y2YdbGuVwCF2S2ASoU1cFAag==}
|
||||
engines: {node: '>=22.0.0'}
|
||||
|
||||
'@types/bun@1.3.5':
|
||||
resolution: {integrity: sha512-RnygCqNrd3srIPEWBd5LFeUYG7plCoH2Yw9WaZGyNmdTEei+gWaHqydbaIRkIkcbXwhBT94q78QljxN0Sk838w==}
|
||||
|
||||
'@types/node@25.0.6':
|
||||
resolution: {integrity: sha512-NNu0sjyNxpoiW3YuVFfNz7mxSQ+S4X2G28uqg2s+CzoqoQjLPsWSbsFFyztIAqt2vb8kfEAsJNepMGPTxFDx3Q==}
|
||||
|
||||
asn1js@3.0.7:
|
||||
resolution: {integrity: sha512-uLvq6KJu04qoQM6gvBfKFjlh6Gl0vOKQuR5cJMDHQkmwfMOQeN3F3SHCv9SNYSL+CRoHvOGFfllDlVz03GQjvQ==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
|
||||
bun-types@1.3.5:
|
||||
resolution: {integrity: sha512-inmAYe2PFLs0SUbFOWSVD24sg1jFlMPxOjOSSCYqUgn4Hsc3rDc7dFvfVYjFPNHtov6kgUeulV4SxbuIV/stPw==}
|
||||
|
||||
bytestreamjs@2.0.1:
|
||||
resolution: {integrity: sha512-U1Z/ob71V/bXfVABvNr/Kumf5VyeQRBEm6Txb0PQ6S7V5GpBM3w4Cbqz/xPDicR5tN0uvDifng8C+5qECeGwyQ==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
|
||||
debug@4.4.3:
|
||||
resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==}
|
||||
engines: {node: '>=6.0'}
|
||||
peerDependencies:
|
||||
supports-color: '*'
|
||||
peerDependenciesMeta:
|
||||
supports-color:
|
||||
optional: true
|
||||
|
||||
depd@2.0.0:
|
||||
resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==}
|
||||
engines: {node: '>= 0.8'}
|
||||
bun-types@1.3.6:
|
||||
resolution: {integrity: sha512-OlFwHcnNV99r//9v5IIOgQ9Uk37gZqrNMCcqEaExdkVq3Avwqok1bJFmvGMCkCE0FqzdY8VMOZpfpR3lwI+CsQ==}
|
||||
|
||||
dotenv@17.2.3:
|
||||
resolution: {integrity: sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
ee-first@1.1.1:
|
||||
resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==}
|
||||
|
||||
encodeurl@2.0.0:
|
||||
resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==}
|
||||
engines: {node: '>= 0.8'}
|
||||
|
||||
es-toolkit@1.43.0:
|
||||
resolution: {integrity: sha512-SKCT8AsWvYzBBuUqMk4NPwFlSdqLpJwmy6AP322ERn8W2YLIB6JBXnwMI2Qsh2gfphT3q7EKAxKb23cvFHFwKA==}
|
||||
|
||||
escape-html@1.0.3:
|
||||
resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==}
|
||||
|
||||
etag@1.8.1:
|
||||
resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==}
|
||||
engines: {node: '>= 0.6'}
|
||||
|
||||
eventemitter3@5.0.1:
|
||||
resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==}
|
||||
|
||||
fresh@2.0.0:
|
||||
resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==}
|
||||
engines: {node: '>= 0.8'}
|
||||
|
||||
http-errors@2.0.1:
|
||||
resolution: {integrity: sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==}
|
||||
engines: {node: '>= 0.8'}
|
||||
|
||||
inherits@2.0.4:
|
||||
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
|
||||
|
||||
mime-db@1.54.0:
|
||||
resolution: {integrity: sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==}
|
||||
engines: {node: '>= 0.6'}
|
||||
|
||||
mime-types@3.0.2:
|
||||
resolution: {integrity: sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
ms@2.1.3:
|
||||
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
|
||||
|
||||
nanoid@5.1.6:
|
||||
resolution: {integrity: sha512-c7+7RQ+dMB5dPwwCp4ee1/iV/q2P6aK1mTZcfr1BTuVlyW9hJYiMPybJCcnBlQtuSmTIWNeazm/zqNoZSSElBg==}
|
||||
engines: {node: ^18 || >=20}
|
||||
hasBin: true
|
||||
|
||||
on-finished@2.4.1:
|
||||
resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==}
|
||||
engines: {node: '>= 0.8'}
|
||||
|
||||
path-to-regexp@8.3.0:
|
||||
resolution: {integrity: sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==}
|
||||
|
||||
pkijs@3.3.3:
|
||||
resolution: {integrity: sha512-+KD8hJtqQMYoTuL1bbGOqxb4z+nZkTAwVdNtWwe8Tc2xNbEmdJYIYoc6Qt0uF55e6YW6KuTHw1DjQ18gMhzepw==}
|
||||
engines: {node: '>=16.0.0'}
|
||||
|
||||
pvtsutils@1.3.6:
|
||||
resolution: {integrity: sha512-PLgQXQ6H2FWCaeRak8vvk1GW462lMxB5s3Jm673N82zI4vqtVUPuZdffdZbPDFRoU8kAhItWFtPCWiPpp4/EDg==}
|
||||
|
||||
pvutils@1.1.5:
|
||||
resolution: {integrity: sha512-KTqnxsgGiQ6ZAzZCVlJH5eOjSnvlyEgx1m8bkRJfOhmGRqfo5KLvmAlACQkrjEtOQ4B7wF9TdSLIs9O90MX9xA==}
|
||||
engines: {node: '>=16.0.0'}
|
||||
|
||||
range-parser@1.2.1:
|
||||
resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==}
|
||||
engines: {node: '>= 0.6'}
|
||||
|
||||
reflect-metadata@0.2.2:
|
||||
resolution: {integrity: sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==}
|
||||
|
||||
selfsigned@5.4.0:
|
||||
resolution: {integrity: sha512-Yn8qZOOJv+NhcGY19iC+ngW6hlUCNpvWEkrKllXNhmkLgR9fcErm8EqZ/wev7/tiwjKC9qj17Fa/PtBNzb6q8g==}
|
||||
engines: {node: '>=15.6.0'}
|
||||
|
||||
send@1.2.1:
|
||||
resolution: {integrity: sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
setprototypeof@1.2.0:
|
||||
resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==}
|
||||
|
||||
statuses@2.0.2:
|
||||
resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==}
|
||||
engines: {node: '>= 0.8'}
|
||||
|
||||
toidentifier@1.0.1:
|
||||
resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==}
|
||||
engines: {node: '>=0.6'}
|
||||
|
||||
tslib@1.14.1:
|
||||
resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
|
||||
|
||||
tslib@2.8.1:
|
||||
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
|
||||
|
||||
tsyringe@4.10.0:
|
||||
resolution: {integrity: sha512-axr3IdNuVIxnaK5XGEUFTu3YmAQ6lllgrvqfEoR16g/HGnYY/6We4oWENtAnzK6/LpJ2ur9PAb80RBt7/U4ugw==}
|
||||
engines: {node: '>= 6.0.0'}
|
||||
|
||||
undici-types@7.16.0:
|
||||
resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==}
|
||||
|
||||
zod@4.1.8:
|
||||
resolution: {integrity: sha512-5R1P+WwQqmmMIEACyzSvo4JXHY5WiAFHRMg+zBZKgKS+Q1viRa0C1hmUKtHltoIFKtIdki3pRxkmpP74jnNYHQ==}
|
||||
|
||||
zod@4.3.5:
|
||||
resolution: {integrity: sha512-k7Nwx6vuWx1IJ9Bjuf4Zt1PEllcwe7cls3VNzm4CQ1/hgtFUK2bRNG3rvnpPUhFjmqJKAKtjV576KnUkHocg/g==}
|
||||
|
||||
snapshots:
|
||||
|
||||
'@kevisual/context@0.0.4': {}
|
||||
@@ -262,243 +122,46 @@ snapshots:
|
||||
dependencies:
|
||||
tslib: 2.8.1
|
||||
|
||||
'@kevisual/router@0.0.52':
|
||||
dependencies:
|
||||
eventemitter3: 5.0.1
|
||||
path-to-regexp: 8.3.0
|
||||
selfsigned: 5.4.0
|
||||
send: 1.2.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
'@kevisual/router@0.0.55': {}
|
||||
|
||||
'@kevisual/types@0.0.10': {}
|
||||
'@kevisual/types@0.0.11': {}
|
||||
|
||||
'@kevisual/use-config@1.0.24(dotenv@17.2.3)':
|
||||
'@kevisual/use-config@1.0.28(dotenv@17.2.3)':
|
||||
dependencies:
|
||||
'@kevisual/load': 0.0.6
|
||||
dotenv: 17.2.3
|
||||
|
||||
'@noble/hashes@1.4.0': {}
|
||||
|
||||
'@opencode-ai/plugin@1.1.13':
|
||||
'@opencode-ai/plugin@1.1.23':
|
||||
dependencies:
|
||||
'@opencode-ai/sdk': 1.1.13
|
||||
'@opencode-ai/sdk': 1.1.23
|
||||
zod: 4.1.8
|
||||
|
||||
'@opencode-ai/sdk@1.1.13': {}
|
||||
'@opencode-ai/sdk@1.1.23': {}
|
||||
|
||||
'@peculiar/asn1-cms@2.6.0':
|
||||
'@types/bun@1.3.6':
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.6.0
|
||||
'@peculiar/asn1-x509': 2.6.0
|
||||
'@peculiar/asn1-x509-attr': 2.6.0
|
||||
asn1js: 3.0.7
|
||||
tslib: 2.8.1
|
||||
bun-types: 1.3.6
|
||||
|
||||
'@peculiar/asn1-csr@2.6.0':
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.6.0
|
||||
'@peculiar/asn1-x509': 2.6.0
|
||||
asn1js: 3.0.7
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-ecc@2.6.0':
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.6.0
|
||||
'@peculiar/asn1-x509': 2.6.0
|
||||
asn1js: 3.0.7
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-pfx@2.6.0':
|
||||
dependencies:
|
||||
'@peculiar/asn1-cms': 2.6.0
|
||||
'@peculiar/asn1-pkcs8': 2.6.0
|
||||
'@peculiar/asn1-rsa': 2.6.0
|
||||
'@peculiar/asn1-schema': 2.6.0
|
||||
asn1js: 3.0.7
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-pkcs8@2.6.0':
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.6.0
|
||||
'@peculiar/asn1-x509': 2.6.0
|
||||
asn1js: 3.0.7
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-pkcs9@2.6.0':
|
||||
dependencies:
|
||||
'@peculiar/asn1-cms': 2.6.0
|
||||
'@peculiar/asn1-pfx': 2.6.0
|
||||
'@peculiar/asn1-pkcs8': 2.6.0
|
||||
'@peculiar/asn1-schema': 2.6.0
|
||||
'@peculiar/asn1-x509': 2.6.0
|
||||
'@peculiar/asn1-x509-attr': 2.6.0
|
||||
asn1js: 3.0.7
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-rsa@2.6.0':
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.6.0
|
||||
'@peculiar/asn1-x509': 2.6.0
|
||||
asn1js: 3.0.7
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-schema@2.6.0':
|
||||
dependencies:
|
||||
asn1js: 3.0.7
|
||||
pvtsutils: 1.3.6
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-x509-attr@2.6.0':
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.6.0
|
||||
'@peculiar/asn1-x509': 2.6.0
|
||||
asn1js: 3.0.7
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-x509@2.6.0':
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.6.0
|
||||
asn1js: 3.0.7
|
||||
pvtsutils: 1.3.6
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/x509@1.14.2':
|
||||
dependencies:
|
||||
'@peculiar/asn1-cms': 2.6.0
|
||||
'@peculiar/asn1-csr': 2.6.0
|
||||
'@peculiar/asn1-ecc': 2.6.0
|
||||
'@peculiar/asn1-pkcs9': 2.6.0
|
||||
'@peculiar/asn1-rsa': 2.6.0
|
||||
'@peculiar/asn1-schema': 2.6.0
|
||||
'@peculiar/asn1-x509': 2.6.0
|
||||
pvtsutils: 1.3.6
|
||||
reflect-metadata: 0.2.2
|
||||
tslib: 2.8.1
|
||||
tsyringe: 4.10.0
|
||||
|
||||
'@types/bun@1.3.5':
|
||||
dependencies:
|
||||
bun-types: 1.3.5
|
||||
|
||||
'@types/node@25.0.6':
|
||||
'@types/node@25.0.9':
|
||||
dependencies:
|
||||
undici-types: 7.16.0
|
||||
|
||||
asn1js@3.0.7:
|
||||
bun-types@1.3.6:
|
||||
dependencies:
|
||||
pvtsutils: 1.3.6
|
||||
pvutils: 1.1.5
|
||||
tslib: 2.8.1
|
||||
|
||||
bun-types@1.3.5:
|
||||
dependencies:
|
||||
'@types/node': 25.0.6
|
||||
|
||||
bytestreamjs@2.0.1: {}
|
||||
|
||||
debug@4.4.3:
|
||||
dependencies:
|
||||
ms: 2.1.3
|
||||
|
||||
depd@2.0.0: {}
|
||||
'@types/node': 25.0.9
|
||||
|
||||
dotenv@17.2.3: {}
|
||||
|
||||
ee-first@1.1.1: {}
|
||||
|
||||
encodeurl@2.0.0: {}
|
||||
|
||||
es-toolkit@1.43.0: {}
|
||||
|
||||
escape-html@1.0.3: {}
|
||||
|
||||
etag@1.8.1: {}
|
||||
|
||||
eventemitter3@5.0.1: {}
|
||||
|
||||
fresh@2.0.0: {}
|
||||
|
||||
http-errors@2.0.1:
|
||||
dependencies:
|
||||
depd: 2.0.0
|
||||
inherits: 2.0.4
|
||||
setprototypeof: 1.2.0
|
||||
statuses: 2.0.2
|
||||
toidentifier: 1.0.1
|
||||
|
||||
inherits@2.0.4: {}
|
||||
|
||||
mime-db@1.54.0: {}
|
||||
|
||||
mime-types@3.0.2:
|
||||
dependencies:
|
||||
mime-db: 1.54.0
|
||||
|
||||
ms@2.1.3: {}
|
||||
|
||||
nanoid@5.1.6: {}
|
||||
|
||||
on-finished@2.4.1:
|
||||
dependencies:
|
||||
ee-first: 1.1.1
|
||||
|
||||
path-to-regexp@8.3.0: {}
|
||||
|
||||
pkijs@3.3.3:
|
||||
dependencies:
|
||||
'@noble/hashes': 1.4.0
|
||||
asn1js: 3.0.7
|
||||
bytestreamjs: 2.0.1
|
||||
pvtsutils: 1.3.6
|
||||
pvutils: 1.1.5
|
||||
tslib: 2.8.1
|
||||
|
||||
pvtsutils@1.3.6:
|
||||
dependencies:
|
||||
tslib: 2.8.1
|
||||
|
||||
pvutils@1.1.5: {}
|
||||
|
||||
range-parser@1.2.1: {}
|
||||
|
||||
reflect-metadata@0.2.2: {}
|
||||
|
||||
selfsigned@5.4.0:
|
||||
dependencies:
|
||||
'@peculiar/x509': 1.14.2
|
||||
pkijs: 3.3.3
|
||||
|
||||
send@1.2.1:
|
||||
dependencies:
|
||||
debug: 4.4.3
|
||||
encodeurl: 2.0.0
|
||||
escape-html: 1.0.3
|
||||
etag: 1.8.1
|
||||
fresh: 2.0.0
|
||||
http-errors: 2.0.1
|
||||
mime-types: 3.0.2
|
||||
ms: 2.1.3
|
||||
on-finished: 2.4.1
|
||||
range-parser: 1.2.1
|
||||
statuses: 2.0.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
setprototypeof@1.2.0: {}
|
||||
|
||||
statuses@2.0.2: {}
|
||||
|
||||
toidentifier@1.0.1: {}
|
||||
|
||||
tslib@1.14.1: {}
|
||||
|
||||
tslib@2.8.1: {}
|
||||
|
||||
tsyringe@4.10.0:
|
||||
dependencies:
|
||||
tslib: 1.14.1
|
||||
|
||||
undici-types@7.16.0: {}
|
||||
|
||||
zod@4.1.8: {}
|
||||
|
||||
zod@4.3.5: {}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
name: create-new-repo
|
||||
description: 创建一个新的代码仓库,并自动添加必要的配置文件。
|
||||
---
|
||||
|
||||
# 创建新的代码仓库
|
||||
该技能用于创建一个新的代码仓库,并自动添加必要的配置文件,如 `.cnb.yml` 和 `opencode.json`。
|
||||
|
||||
## 调用工具链
|
||||
|
||||
1. 执行`create-repo`工具
|
||||
2. 判断是否需要立刻需要云开发打开
|
||||
3. 如果需要,执行`open-cloud-editor`工具
|
||||
4. 返回创建的仓库信息和云开发环境信息(如果适用)
|
||||
@@ -69,12 +69,12 @@ export class CNBCore {
|
||||
headers: _headers,
|
||||
body: _body,
|
||||
});
|
||||
const res = (data: any, message?: string) => {
|
||||
const res = (data: any, message?: string, code?: number) => {
|
||||
if (useOrigin) {
|
||||
return data;
|
||||
}
|
||||
return {
|
||||
code: 200,
|
||||
code: code ?? 200,
|
||||
message: message || 'success',
|
||||
data,
|
||||
};
|
||||
@@ -83,7 +83,7 @@ export class CNBCore {
|
||||
const errorText = await response.text();
|
||||
if (useOrigin)
|
||||
throw new Error(`Request failed with status ${response.status}: ${errorText}`);
|
||||
return res(null, `Request failed with status ${response.status}: ${errorText}`);
|
||||
return res(null, `Request failed with status ${response.status}: ${errorText}`, response.status);
|
||||
}
|
||||
|
||||
const contentType = response.headers.get('Content-Type');
|
||||
|
||||
47
src/common/cnb-env.ts
Normal file
47
src/common/cnb-env.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
/**
|
||||
* CNB 环境变量配置
|
||||
* 该模块定义了 CNB (Cloud Native Build) 平台提供的所有环境变量
|
||||
* 用于获取当前构建环境、仓库信息、运行器配置等元数据
|
||||
*/
|
||||
import { useKey } from "@kevisual/use-config"
|
||||
|
||||
export const CNB_ENV = {
|
||||
// 仓库相关配置
|
||||
/** 仓库的 HTTPS 地址,如 "https://cnb.cool/kevisual/cnb" */
|
||||
CNB_REPO_URL_HTTPS: useKey('CNB_REPO_URL_HTTPS'),
|
||||
|
||||
// 构建相关配置
|
||||
/** 流水线 ID,唯一标识一次构建流水线,如 "cnb-108-1jer5qekq-001" */
|
||||
CNB_PIPELINE_ID: useKey('CNB_PIPELINE_ID'),
|
||||
/** 构建 ID,与流水线 ID 相关联,如 "cnb-108-1jer5qekq" */
|
||||
CNB_BUILD_ID: useKey('CNB_BUILD_ID'),
|
||||
/** 构建开始时间,ISO 8601 格式,如 "2026-01-13T07:58:41.825Z" */
|
||||
CNB_BUILD_START_TIME: useKey('CNB_BUILD_START_TIME'),
|
||||
/** 构建日志 Web 界面 URL,用于在浏览器中查看构建日志 */
|
||||
CNB_BUILD_WEB_URL: useKey('CNB_BUILD_WEB_URL'),
|
||||
/** 触发构建的事件类型,如 "vscode" 表示由 VS Code 触发 */
|
||||
CNB_EVENT: useKey('CNB_EVENT'),
|
||||
/** 当前构建对应的 Git 提交哈希值 */
|
||||
CNB_COMMIT: useKey('CNB_COMMIT'),
|
||||
|
||||
// VS Code 相关配置
|
||||
/** VS Code Web 界面的访问 URL,用于在浏览器中打开 VS Code */
|
||||
CNB_VSCODE_WEB_URL: useKey('CNB_VSCODE_WEB_URL'),
|
||||
/** VS Code 代理 URI,用于端口转发,{{port}} 会被替换为实际端口号, 例如: "https://1wnts22gq3-{{port}}.cnb.run"*/
|
||||
CNB_VSCODE_PROXY_URI: useKey('CNB_VSCODE_PROXY_URI'),
|
||||
|
||||
// 仓库标识配置
|
||||
/** 仓库标识符,格式为 "组名/仓库名",如 "kevisual/cnb" */
|
||||
CNB_REPO_SLUG: useKey('CNB_REPO_SLUG'),
|
||||
/** 组名/命名空间标识符,如 "kevisual" */
|
||||
CNB_GROUP_SLUG: useKey('CNB_GROUP_SLUG'),
|
||||
|
||||
// 运行器资源配置
|
||||
/** 运行器分配的 CPU 核心数,单位为核, 例如: "8"*/
|
||||
CNB_CPUS: useKey('CNB_CPUS'),
|
||||
/** 运行器分配的内存大小,单位为 GB, 例如: "16"*/
|
||||
CNB_MEMORY: useKey('CNB_MEMORY'),
|
||||
/** 运行器的 IP 地址,用于网络连接和调试 */
|
||||
CNB_RUNNER_IP: useKey('CNB_RUNNER_IP'),
|
||||
}
|
||||
11
src/index.ts
11
src/index.ts
@@ -1,5 +1,5 @@
|
||||
import { CNBCore, CNBCoreOptions } from "./cnb-core.ts";
|
||||
import { Workspace } from "./workspace.ts";
|
||||
import { Workspace } from "./workspace/index.ts";
|
||||
import { KnowledgeBase } from "./knowledge/index.ts";
|
||||
import { Repo } from "./repo/index.ts";
|
||||
import { User } from "./user/index.ts";
|
||||
@@ -9,7 +9,6 @@ import { Mission } from "./mission/index.ts";
|
||||
import { AiBase } from "./ai/index.ts";
|
||||
|
||||
type CNBOptions = CNBCoreOptions<{
|
||||
group?: string;
|
||||
}>;
|
||||
|
||||
export class CNB extends CNBCore {
|
||||
@@ -21,7 +20,6 @@ export class CNB extends CNBCore {
|
||||
issue!: Issue;
|
||||
mission!: Mission;
|
||||
ai!: AiBase;
|
||||
group!: string;
|
||||
constructor(options: CNBOptions) {
|
||||
super({ token: options.token, cookie: options.cookie, cnb: options.cnb });
|
||||
this.init(options);
|
||||
@@ -31,7 +29,6 @@ export class CNB extends CNBCore {
|
||||
const cookie = this.cookie;
|
||||
const options = { token, cookie };
|
||||
this.workspace = new Workspace(options.token);
|
||||
const group = cnbOptions?.group || '';
|
||||
this.knowledgeBase = new KnowledgeBase({ token: options.token, cookie: options.cookie });
|
||||
this.repo = new Repo({ token: options.token, cookie: options.cookie });
|
||||
this.user = new User({ token: options.token, cookie: options.cookie });
|
||||
@@ -39,10 +36,6 @@ export class CNB extends CNBCore {
|
||||
this.issue = new Issue({ token: options.token, cookie: options.cookie });
|
||||
this.mission = new Mission({ token: options.token, cookie: options.cookie });
|
||||
this.ai = new AiBase({ token: options.token, cookie: options.cookie });
|
||||
this.group = group;
|
||||
}
|
||||
setGroup(group: string) {
|
||||
this.group = group;
|
||||
}
|
||||
setToken(token: string) {
|
||||
this.token = token;
|
||||
@@ -64,7 +57,7 @@ export class CNB extends CNBCore {
|
||||
}
|
||||
}
|
||||
|
||||
export * from './workspace.ts'
|
||||
export * from './workspace/index.ts'
|
||||
export * from './cnb-core.ts'
|
||||
export * from './knowledge/index.ts'
|
||||
export * from './repo/index.ts'
|
||||
|
||||
@@ -6,27 +6,32 @@ export class Repo extends CNBCore {
|
||||
}
|
||||
/**
|
||||
* 创建代码仓库
|
||||
* @param group e.g. my-group
|
||||
* @param data
|
||||
* @returns
|
||||
*/
|
||||
createRepo(group: string, data: CreateRepoData): Promise<any> {
|
||||
createRepo(data: CreateRepoData): Promise<any> {
|
||||
const name = data.name;
|
||||
const [group, repo] = name.includes('/') ? name.split('/') : ['', name];
|
||||
const url = `/${group}/-/repos`;
|
||||
let postData: CreateRepoData = {
|
||||
...data,
|
||||
description: data.description || '',
|
||||
name: data.name,
|
||||
name: repo,
|
||||
license: data.license || 'Unlicense',
|
||||
visibility: data.visibility || 'private',
|
||||
};
|
||||
return this.post({ url, data: postData });
|
||||
}
|
||||
deleteRepo(name: string): Promise<any> {
|
||||
const url = `https://cnb.cool/${name}`;
|
||||
return this.delete({ url, useCookie: true });
|
||||
}
|
||||
async createCommit(repo: string, data: CreateCommitData): Promise<any> {
|
||||
const commitList = await this.getCommitList(repo, {
|
||||
page: 1,
|
||||
page_size: 1,
|
||||
}, { useOrigin: true }).catch((err) => {
|
||||
console.error("Error fetching commit list:", err);
|
||||
// console.error("Error fetching commit list:", err);
|
||||
return []
|
||||
});
|
||||
const preCommitSha = commitList.length > 0 ? commitList[0].sha : undefined;
|
||||
@@ -46,7 +51,14 @@ export class Repo extends CNBCore {
|
||||
delete postData.parent_commit_sha;
|
||||
delete postData.base_branch;
|
||||
}
|
||||
return this.post({ url, data: postData, useCookie: true, });
|
||||
return this.post({
|
||||
url,
|
||||
data: postData,
|
||||
useCookie: true,
|
||||
headers: {
|
||||
'Accept': 'application/vnd.cnb.web+json',
|
||||
}
|
||||
});
|
||||
}
|
||||
createBlobs(repo: string, data: { content: string, encoding?: 'utf-8' | 'base64' }): Promise<any> {
|
||||
const url = `/${repo}/-/git/blobs`;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
import { Result } from "@kevisual/query/query";
|
||||
import { CNBCore } from "./cnb-core.ts";
|
||||
import { CNBCore } from "../cnb-core.ts";
|
||||
|
||||
/**
|
||||
* 工作空间列表查询参数
|
||||
37
test/agent.ts
Normal file
37
test/agent.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { app, showMore } from './common.ts';
|
||||
|
||||
// const res = await app.run({
|
||||
// path: 'cnb',
|
||||
// key: 'create-repo',
|
||||
// payload: {
|
||||
// name: 'kevisual/exam',
|
||||
// description: 'kevisual 创建的代码仓库',
|
||||
// visibility: 'public',
|
||||
// }
|
||||
// })
|
||||
|
||||
// console.log(showMore(res));
|
||||
|
||||
|
||||
// const res2 = await app.run({
|
||||
// path: 'cnb',
|
||||
// key: 'create-repo-file',
|
||||
// payload: {
|
||||
// name: 'kevisual/exam',
|
||||
// path: 'README.md',
|
||||
// content: '# Example Skill\nThis is an example skill created via API.',
|
||||
// encoding: 'raw',
|
||||
// },
|
||||
// })
|
||||
|
||||
// console.log(showMore(res2));
|
||||
|
||||
// const deleteRes = await app.run({
|
||||
// path: 'cnb',
|
||||
// key: 'delete-repo',
|
||||
// payload: {
|
||||
// name: 'kevisual/exam',
|
||||
// },
|
||||
// })
|
||||
|
||||
// console.log(showMore(deleteRes));
|
||||
@@ -15,4 +15,4 @@ const main = async () => {
|
||||
console.log("build", build);
|
||||
}
|
||||
|
||||
main()
|
||||
// main()
|
||||
@@ -1,16 +1,21 @@
|
||||
import { CNB } from "../src";
|
||||
import dotenv from "dotenv";
|
||||
import util from 'node:util';
|
||||
dotenv.config();
|
||||
export const token = process.env.CNB_TOKEN || "";
|
||||
export const cookie = process.env.CNB_COOKIE || "";
|
||||
import { useConfig, useKey } from "@kevisual/use-config";
|
||||
const config = useConfig()
|
||||
export const token = useKey("CNB_TOKEN") as string || '';
|
||||
export const cookie = useKey("CNB_COOKIE") as string || '';
|
||||
console.log('token', token)
|
||||
import { app } from '../agent/index.ts'
|
||||
|
||||
export { app }
|
||||
export const cnb = new CNB({ token, cookie });
|
||||
export const showMore = (obj: any) => {
|
||||
return util.inspect(obj, { showHidden: false, depth: null, colors: true });
|
||||
}
|
||||
// const worksaceList = await cnb.workspace.list({ status: 'running' });
|
||||
|
||||
// console.log("worksaceList", worksaceList);
|
||||
// console.log("worksaceList", showMore(worksaceList));
|
||||
|
||||
// const sn = 'cnb-o18-1jbklfuoh'
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { Repo } from "../src/repo";
|
||||
|
||||
import { app } from '../agent/index.ts'
|
||||
import { token, showMore, cookie } from "./common.ts";
|
||||
import util from 'node:util';
|
||||
|
||||
const repo = new Repo({ token: token, cookie: cookie });
|
||||
|
||||
export { app }
|
||||
// const res = await repo.createRepo({
|
||||
// name: "test-cnb-2",
|
||||
// description: "This is my new repository",
|
||||
|
||||
Reference in New Issue
Block a user