更新版本号至0.0.22,重构Repo类的deleteRepo方法并添加WorkspaceLinkDetail接口
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@kevisual/cnb",
|
"name": "@kevisual/cnb",
|
||||||
"version": "0.0.21",
|
"version": "0.0.22",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -22,10 +22,14 @@ export class Repo extends CNBCore {
|
|||||||
};
|
};
|
||||||
return this.post({ url, data: postData });
|
return this.post({ url, data: postData });
|
||||||
}
|
}
|
||||||
deleteRepo(name: string): Promise<any> {
|
deleteRepoCookie(repo: string): Promise<any> {
|
||||||
const url = `${this.hackURL}/${name}`;
|
const url = `${this.hackURL}/${repo}`;
|
||||||
return this.delete({ url, useCookie: true });
|
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> {
|
async createCommit(repo: string, data: CreateCommitData): Promise<any> {
|
||||||
const commitList = await this.getCommitList(repo, {
|
const commitList = await this.getCommitList(repo, {
|
||||||
page: 1,
|
page: 1,
|
||||||
|
|||||||
@@ -81,18 +81,7 @@ export class Workspace extends CNBCore {
|
|||||||
* @param repo 仓库路径,例如:groupname/reponame
|
* @param repo 仓库路径,例如:groupname/reponame
|
||||||
* @param sn 流水线构建号
|
* @param sn 流水线构建号
|
||||||
*/
|
*/
|
||||||
async getDetail(repo: string, sn: string): Promise<{
|
async getDetail(repo: string, sn: string): Promise<Result<WorkspaceLinkDetail>> {
|
||||||
codebuddy: string;
|
|
||||||
codebuddycn: string;
|
|
||||||
cursor: string;
|
|
||||||
jetbrains: Record<string, string>;
|
|
||||||
jumpUrl: string;
|
|
||||||
remoteSsh: string;
|
|
||||||
ssh: string;
|
|
||||||
vscode: string;
|
|
||||||
'vscode-insiders': string;
|
|
||||||
webide: string;
|
|
||||||
}> {
|
|
||||||
return this.get({ url: `/${repo}/-/workspace/detail/${sn}` });
|
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> = {
|
export type ResultList<T> = {
|
||||||
hasMore: boolean;
|
hasMore: boolean;
|
||||||
list: T[];
|
list: T[];
|
||||||
|
|||||||
Reference in New Issue
Block a user