更新版本号至0.0.22,重构Repo类的deleteRepo方法并添加WorkspaceLinkDetail接口

This commit is contained in:
2026-02-09 03:51:34 +08:00
parent a1339014a3
commit 13401d9aa0
3 changed files with 20 additions and 16 deletions

View File

@@ -22,10 +22,14 @@ export class Repo extends CNBCore {
};
return this.post({ url, data: postData });
}
deleteRepo(name: string): Promise<any> {
const url = `${this.hackURL}/${name}`;
deleteRepoCookie(repo: string): Promise<any> {
const url = `${this.hackURL}/${repo}`;
return this.delete({ url, useCookie: true });
}
deleteRepo(repo: string): Promise<any> {
const url = `/${repo}`;
return this.delete({ url });
}
async createCommit(repo: string, data: CreateCommitData): Promise<any> {
const commitList = await this.getCommitList(repo, {
page: 1,

View File

@@ -81,18 +81,7 @@ export class Workspace extends CNBCore {
* @param repo 仓库路径例如groupname/reponame
* @param sn 流水线构建号
*/
async getDetail(repo: string, sn: string): Promise<{
codebuddy: string;
codebuddycn: string;
cursor: string;
jetbrains: Record<string, string>;
jumpUrl: string;
remoteSsh: string;
ssh: string;
vscode: string;
'vscode-insiders': string;
webide: string;
}> {
async getDetail(repo: string, sn: string): Promise<Result<WorkspaceLinkDetail>> {
return this.get({ url: `/${repo}/-/workspace/detail/${sn}` });
}
/**
@@ -126,7 +115,18 @@ export class Workspace extends CNBCore {
}
}
export interface WorkspaceLinkDetail {
codebuddy: string;
codebuddycn: string;
cursor: string;
jetbrains: Record<string, string>;
jumpUrl: string;
remoteSsh: string;
ssh: string;
vscode: string;
'vscode-insiders': string;
webide: string;
}
export type ResultList<T> = {
hasMore: boolean;
list: T[];