@kevisual/cnb 0.0.20 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/opencode.js CHANGED
@@ -21444,7 +21444,7 @@ class InitEnv {
21444
21444
  }
21445
21445
  InitEnv.init();
21446
21446
 
21447
- // node_modules/.pnpm/@kevisual+use-config@1.0.30_dotenv@17.2.4/node_modules/@kevisual/use-config/dist/app.js
21447
+ // node_modules/.pnpm/@kevisual+use-config@1.0.30_dotenv@17.2.3/node_modules/@kevisual/use-config/dist/app.js
21448
21448
  import { createRequire as createRequire2 } from "node:module";
21449
21449
  import fs from "node:fs";
21450
21450
  import path from "node:path";
@@ -22567,7 +22567,6 @@ class CNBCore {
22567
22567
  }
22568
22568
  delete _headers.Authorization;
22569
22569
  }
22570
- console.log("Request URL:", url2, data, _headers);
22571
22570
  const response = await fetch(url2 || "", {
22572
22571
  method,
22573
22572
  headers: _headers,
@@ -22602,7 +22601,6 @@ class CNBCore {
22602
22601
  if (url2 && url2.startsWith("http")) {
22603
22602
  return url2;
22604
22603
  }
22605
- console.log("url", url2, this.baseURL);
22606
22604
  if (url2.startsWith("/")) {
22607
22605
  return this.baseURL + url2;
22608
22606
  }
@@ -22678,6 +22676,8 @@ class Workspace extends CNBCore {
22678
22676
  const data = {};
22679
22677
  if (params.branch) {
22680
22678
  data.branch = params.branch;
22679
+ } else {
22680
+ data.branch = "main";
22681
22681
  }
22682
22682
  if (params.ref) {
22683
22683
  data.ref = params.ref;
@@ -22730,10 +22730,14 @@ class Repo extends CNBCore {
22730
22730
  };
22731
22731
  return this.post({ url: url2, data: postData });
22732
22732
  }
22733
- deleteRepo(name) {
22734
- const url2 = `${this.hackURL}/${name}`;
22733
+ deleteRepoCookie(repo) {
22734
+ const url2 = `${this.hackURL}/${repo}`;
22735
22735
  return this.delete({ url: url2, useCookie: true });
22736
22736
  }
22737
+ deleteRepo(repo) {
22738
+ const url2 = `/${repo}`;
22739
+ return this.delete({ url: url2 });
22740
+ }
22737
22741
  async createCommit(repo, data) {
22738
22742
  const commitList = await this.getCommitList(repo, {
22739
22743
  page: 1,
@@ -36595,7 +36599,7 @@ config3(en_default());
36595
36599
  // node_modules/.pnpm/zod@4.3.6/node_modules/zod/index.js
36596
36600
  var zod_default = exports_external;
36597
36601
 
36598
- // node_modules/.pnpm/@opencode-ai+plugin@1.1.53/node_modules/@opencode-ai/plugin/dist/tool.js
36602
+ // node_modules/.pnpm/@opencode-ai+plugin@1.1.51/node_modules/@opencode-ai/plugin/dist/tool.js
36599
36603
  function tool2(input) {
36600
36604
  return input;
36601
36605
  }
package/dist/routes.d.ts CHANGED
@@ -116,18 +116,7 @@ declare class Workspace extends CNBCore {
116
116
  * @param repo 仓库路径,例如:groupname/reponame
117
117
  * @param sn 流水线构建号
118
118
  */
119
- getDetail(repo: string, sn: string): Promise<{
120
- codebuddy: string;
121
- codebuddycn: string;
122
- cursor: string;
123
- jetbrains: Record<string, string>;
124
- jumpUrl: string;
125
- remoteSsh: string;
126
- ssh: string;
127
- vscode: string;
128
- 'vscode-insiders': string;
129
- webide: string;
130
- }>;
119
+ getDetail(repo: string, sn: string): Promise<Result$1<WorkspaceLinkDetail>>;
131
120
  /**
132
121
  * 启动云原生开发环境,已存在环境则直接打开,否则重新创建开发环境
133
122
  * @param repo 仓库路径,例如:groupname/reponame
@@ -148,6 +137,18 @@ declare class Workspace extends CNBCore {
148
137
  url: string;
149
138
  }>>;
150
139
  }
140
+ interface WorkspaceLinkDetail {
141
+ codebuddy: string;
142
+ codebuddycn: string;
143
+ cursor: string;
144
+ jetbrains: Record<string, string>;
145
+ jumpUrl: string;
146
+ remoteSsh: string;
147
+ ssh: string;
148
+ vscode: string;
149
+ 'vscode-insiders': string;
150
+ webide: string;
151
+ }
151
152
  /**
152
153
  * 工作空间信息接口
153
154
  */
@@ -265,7 +266,8 @@ declare class Repo extends CNBCore {
265
266
  * @returns
266
267
  */
267
268
  createRepo(data: CreateRepoData): Promise<any>;
268
- deleteRepo(name: string): Promise<any>;
269
+ deleteRepoCookie(repo: string): Promise<any>;
270
+ deleteRepo(repo: string): Promise<any>;
269
271
  createCommit(repo: string, data: CreateCommitData): Promise<any>;
270
272
  createBlobs(repo: string, data: {
271
273
  content: string;
package/dist/routes.js CHANGED
@@ -21444,7 +21444,7 @@ class InitEnv {
21444
21444
  }
21445
21445
  InitEnv.init();
21446
21446
 
21447
- // node_modules/.pnpm/@kevisual+use-config@1.0.30_dotenv@17.2.4/node_modules/@kevisual/use-config/dist/app.js
21447
+ // node_modules/.pnpm/@kevisual+use-config@1.0.30_dotenv@17.2.3/node_modules/@kevisual/use-config/dist/app.js
21448
21448
  import { createRequire as createRequire2 } from "node:module";
21449
21449
  import fs from "node:fs";
21450
21450
  import path from "node:path";
@@ -22567,7 +22567,6 @@ class CNBCore {
22567
22567
  }
22568
22568
  delete _headers.Authorization;
22569
22569
  }
22570
- console.log("Request URL:", url2, data, _headers);
22571
22570
  const response = await fetch(url2 || "", {
22572
22571
  method,
22573
22572
  headers: _headers,
@@ -22602,7 +22601,6 @@ class CNBCore {
22602
22601
  if (url2 && url2.startsWith("http")) {
22603
22602
  return url2;
22604
22603
  }
22605
- console.log("url", url2, this.baseURL);
22606
22604
  if (url2.startsWith("/")) {
22607
22605
  return this.baseURL + url2;
22608
22606
  }
@@ -22678,6 +22676,8 @@ class Workspace extends CNBCore {
22678
22676
  const data = {};
22679
22677
  if (params.branch) {
22680
22678
  data.branch = params.branch;
22679
+ } else {
22680
+ data.branch = "main";
22681
22681
  }
22682
22682
  if (params.ref) {
22683
22683
  data.ref = params.ref;
@@ -22730,10 +22730,14 @@ class Repo extends CNBCore {
22730
22730
  };
22731
22731
  return this.post({ url: url2, data: postData });
22732
22732
  }
22733
- deleteRepo(name) {
22734
- const url2 = `${this.hackURL}/${name}`;
22733
+ deleteRepoCookie(repo) {
22734
+ const url2 = `${this.hackURL}/${repo}`;
22735
22735
  return this.delete({ url: url2, useCookie: true });
22736
22736
  }
22737
+ deleteRepo(repo) {
22738
+ const url2 = `/${repo}`;
22739
+ return this.delete({ url: url2 });
22740
+ }
22737
22741
  async createCommit(repo, data) {
22738
22742
  const commitList = await this.getCommitList(repo, {
22739
22743
  page: 1,
@@ -36595,7 +36599,7 @@ config3(en_default());
36595
36599
  // node_modules/.pnpm/zod@4.3.6/node_modules/zod/index.js
36596
36600
  var zod_default = exports_external;
36597
36601
 
36598
- // node_modules/.pnpm/@opencode-ai+plugin@1.1.53/node_modules/@opencode-ai/plugin/dist/tool.js
36602
+ // node_modules/.pnpm/@opencode-ai+plugin@1.1.51/node_modules/@opencode-ai/plugin/dist/tool.js
36599
36603
  function tool2(input) {
36600
36604
  return input;
36601
36605
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevisual/cnb",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/cnb-core.ts CHANGED
@@ -79,7 +79,7 @@ export class CNBCore {
79
79
  }
80
80
  delete _headers.Authorization;
81
81
  }
82
- console.log('Request URL:', url, data, _headers);
82
+ // console.log('Request URL:', url, data, _headers);
83
83
  const response = await fetch(url || '', {
84
84
  method,
85
85
  headers: _headers,
@@ -115,7 +115,7 @@ export class CNBCore {
115
115
  if (url && url.startsWith('http')) {
116
116
  return url;
117
117
  }
118
- console.log('url', url, this.baseURL)
118
+ // console.log('url', url, this.baseURL)
119
119
  if (url.startsWith('/')) {
120
120
  return this.baseURL + url;
121
121
  }
package/src/repo/index.ts CHANGED
@@ -22,10 +22,14 @@ export class Repo extends CNBCore {
22
22
  };
23
23
  return this.post({ url, data: postData });
24
24
  }
25
- deleteRepo(name: string): Promise<any> {
26
- const url = `${this.hackURL}/${name}`;
25
+ deleteRepoCookie(repo: string): Promise<any> {
26
+ const url = `${this.hackURL}/${repo}`;
27
27
  return this.delete({ url, useCookie: true });
28
28
  }
29
+ deleteRepo(repo: string): Promise<any> {
30
+ const url = `/${repo}`;
31
+ return this.delete({ url });
32
+ }
29
33
  async createCommit(repo: string, data: CreateCommitData): Promise<any> {
30
34
  const commitList = await this.getCommitList(repo, {
31
35
  page: 1,
@@ -81,18 +81,7 @@ export class Workspace extends CNBCore {
81
81
  * @param repo 仓库路径,例如:groupname/reponame
82
82
  * @param sn 流水线构建号
83
83
  */
84
- async getDetail(repo: string, sn: string): Promise<{
85
- codebuddy: string;
86
- codebuddycn: string;
87
- cursor: string;
88
- jetbrains: Record<string, string>;
89
- jumpUrl: string;
90
- remoteSsh: string;
91
- ssh: string;
92
- vscode: string;
93
- 'vscode-insiders': string;
94
- webide: string;
95
- }> {
84
+ async getDetail(repo: string, sn: string): Promise<Result<WorkspaceLinkDetail>> {
96
85
  return this.get({ url: `/${repo}/-/workspace/detail/${sn}` });
97
86
  }
98
87
  /**
@@ -115,6 +104,8 @@ export class Workspace extends CNBCore {
115
104
 
116
105
  if (params.branch) {
117
106
  data.branch = params.branch;
107
+ } else {
108
+ data.branch = 'main'
118
109
  }
119
110
  if (params.ref) {
120
111
  data.ref = params.ref;
@@ -124,7 +115,18 @@ export class Workspace extends CNBCore {
124
115
  }
125
116
 
126
117
  }
127
-
118
+ export interface WorkspaceLinkDetail {
119
+ codebuddy: string;
120
+ codebuddycn: string;
121
+ cursor: string;
122
+ jetbrains: Record<string, string>;
123
+ jumpUrl: string;
124
+ remoteSsh: string;
125
+ ssh: string;
126
+ vscode: string;
127
+ 'vscode-insiders': string;
128
+ webide: string;
129
+ }
128
130
  export type ResultList<T> = {
129
131
  hasMore: boolean;
130
132
  list: T[];