更新版本号至0.0.22,重构Repo类的deleteRepo方法并添加WorkspaceLinkDetail接口
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@kevisual/cnb",
|
||||
"version": "0.0.21",
|
||||
"version": "0.0.22",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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[];
|
||||
|
||||
Reference in New Issue
Block a user