diff --git a/package.json b/package.json index 050b198..49ea078 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kevisual/cnb", - "version": "0.0.21", + "version": "0.0.22", "description": "", "main": "index.js", "scripts": { diff --git a/src/repo/index.ts b/src/repo/index.ts index 7e1687b..be713c5 100644 --- a/src/repo/index.ts +++ b/src/repo/index.ts @@ -22,10 +22,14 @@ export class Repo extends CNBCore { }; return this.post({ url, data: postData }); } - deleteRepo(name: string): Promise { - const url = `${this.hackURL}/${name}`; + deleteRepoCookie(repo: string): Promise { + const url = `${this.hackURL}/${repo}`; return this.delete({ url, useCookie: true }); } + deleteRepo(repo: string): Promise { + const url = `/${repo}`; + return this.delete({ url }); + } async createCommit(repo: string, data: CreateCommitData): Promise { const commitList = await this.getCommitList(repo, { page: 1, diff --git a/src/workspace/index.ts b/src/workspace/index.ts index 6ff0b86..8415dee 100644 --- a/src/workspace/index.ts +++ b/src/workspace/index.ts @@ -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; - jumpUrl: string; - remoteSsh: string; - ssh: string; - vscode: string; - 'vscode-insiders': string; - webide: string; - }> { + async getDetail(repo: string, sn: string): Promise> { 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; + jumpUrl: string; + remoteSsh: string; + ssh: string; + vscode: string; + 'vscode-insiders': string; + webide: string; +} export type ResultList = { hasMore: boolean; list: T[];