@kevisual/cnb 0.0.14 → 0.0.16
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 +21 -19
- package/dist/routes.d.ts +1 -1
- package/dist/routes.js +21 -19
- package/package.json +1 -1
- package/src/ai/index.ts +1 -1
- package/src/build/index.ts +1 -1
- package/src/git/index.ts +1 -1
- package/src/index.ts +12 -10
- package/src/issue/index.ts +1 -1
- package/src/knowledge/index.ts +1 -1
- package/src/mission/index.ts +1 -1
- package/src/repo/index.ts +1 -1
- package/src/user/index.ts +1 -1
- package/src/workspace/index.ts +3 -3
package/dist/opencode.js
CHANGED
|
@@ -22629,8 +22629,8 @@ class CNBCore {
|
|
|
22629
22629
|
|
|
22630
22630
|
// src/workspace/index.ts
|
|
22631
22631
|
class Workspace extends CNBCore {
|
|
22632
|
-
constructor(
|
|
22633
|
-
super(
|
|
22632
|
+
constructor(options) {
|
|
22633
|
+
super(options);
|
|
22634
22634
|
}
|
|
22635
22635
|
async deleteWorkspace(params) {
|
|
22636
22636
|
const data = {};
|
|
@@ -22675,7 +22675,7 @@ class Workspace extends CNBCore {
|
|
|
22675
22675
|
// src/knowledge/index.ts
|
|
22676
22676
|
class KnowledgeBase extends CNBCore {
|
|
22677
22677
|
constructor(options) {
|
|
22678
|
-
super(
|
|
22678
|
+
super(options);
|
|
22679
22679
|
}
|
|
22680
22680
|
queryKnowledgeBase(repo, data) {
|
|
22681
22681
|
const url2 = `/${repo}/-/knowledge/base/query`;
|
|
@@ -22701,7 +22701,7 @@ class KnowledgeBase extends CNBCore {
|
|
|
22701
22701
|
// src/repo/index.ts
|
|
22702
22702
|
class Repo extends CNBCore {
|
|
22703
22703
|
constructor(options) {
|
|
22704
|
-
super(
|
|
22704
|
+
super(options);
|
|
22705
22705
|
}
|
|
22706
22706
|
createRepo(data) {
|
|
22707
22707
|
const name = data.name;
|
|
@@ -22788,7 +22788,7 @@ class Repo extends CNBCore {
|
|
|
22788
22788
|
// src/user/index.ts
|
|
22789
22789
|
class User extends CNBCore {
|
|
22790
22790
|
constructor(options) {
|
|
22791
|
-
super(
|
|
22791
|
+
super(options);
|
|
22792
22792
|
}
|
|
22793
22793
|
getCurrentUser() {
|
|
22794
22794
|
const url2 = `${this.hackURL}/user`;
|
|
@@ -22837,7 +22837,7 @@ class User extends CNBCore {
|
|
|
22837
22837
|
// src/build/index.ts
|
|
22838
22838
|
class Build extends CNBCore {
|
|
22839
22839
|
constructor(options) {
|
|
22840
|
-
super(
|
|
22840
|
+
super(options);
|
|
22841
22841
|
}
|
|
22842
22842
|
startBuild(repo, data) {
|
|
22843
22843
|
const url2 = `/${repo}/-/build/start`;
|
|
@@ -22852,7 +22852,7 @@ class Build extends CNBCore {
|
|
|
22852
22852
|
// src/issue/index.ts
|
|
22853
22853
|
class Issue extends CNBCore {
|
|
22854
22854
|
constructor(options) {
|
|
22855
|
-
super(
|
|
22855
|
+
super(options);
|
|
22856
22856
|
}
|
|
22857
22857
|
createIssue(repo, data) {
|
|
22858
22858
|
const url2 = `/${repo}/-/issues`;
|
|
@@ -22905,7 +22905,7 @@ class Issue extends CNBCore {
|
|
|
22905
22905
|
// src/mission/index.ts
|
|
22906
22906
|
class Mission extends CNBCore {
|
|
22907
22907
|
constructor(options) {
|
|
22908
|
-
super(
|
|
22908
|
+
super(options);
|
|
22909
22909
|
}
|
|
22910
22910
|
getMissions(group, params) {
|
|
22911
22911
|
const url2 = `/${group}/-/missions`;
|
|
@@ -22970,7 +22970,7 @@ class Mission extends CNBCore {
|
|
|
22970
22970
|
class AiBase extends CNBCore {
|
|
22971
22971
|
group;
|
|
22972
22972
|
constructor(options) {
|
|
22973
|
-
super(
|
|
22973
|
+
super(options);
|
|
22974
22974
|
}
|
|
22975
22975
|
autoPr(repo, data) {
|
|
22976
22976
|
const url2 = `/${repo}/-/build/ai/auto-pr`;
|
|
@@ -22994,21 +22994,23 @@ class CNB extends CNBCore {
|
|
|
22994
22994
|
mission;
|
|
22995
22995
|
ai;
|
|
22996
22996
|
constructor(options) {
|
|
22997
|
-
super({ token: options.token, cookie: options.cookie, cnb: options.cnb });
|
|
22997
|
+
super({ ...options, token: options.token, cookie: options.cookie, cnb: options.cnb });
|
|
22998
22998
|
this.init(options);
|
|
22999
22999
|
}
|
|
23000
23000
|
init(cnbOptions) {
|
|
23001
23001
|
const token = this.token;
|
|
23002
23002
|
const cookie = this.cookie;
|
|
23003
|
-
const
|
|
23004
|
-
|
|
23005
|
-
|
|
23006
|
-
this.
|
|
23007
|
-
this.
|
|
23008
|
-
this.
|
|
23009
|
-
this.
|
|
23010
|
-
this.
|
|
23011
|
-
this.
|
|
23003
|
+
const cors = cnbOptions?.cors || {};
|
|
23004
|
+
const cnb = cnbOptions?.cnb;
|
|
23005
|
+
const options = { token, cookie, cors, cnb };
|
|
23006
|
+
this.workspace = new Workspace(options);
|
|
23007
|
+
this.knowledgeBase = new KnowledgeBase(options);
|
|
23008
|
+
this.repo = new Repo(options);
|
|
23009
|
+
this.user = new User(options);
|
|
23010
|
+
this.build = new Build(options);
|
|
23011
|
+
this.issue = new Issue(options);
|
|
23012
|
+
this.mission = new Mission(options);
|
|
23013
|
+
this.ai = new AiBase(options);
|
|
23012
23014
|
}
|
|
23013
23015
|
setToken(token) {
|
|
23014
23016
|
this.token = token;
|
package/dist/routes.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ interface ListParams {
|
|
|
84
84
|
* https://api.cnb.cool/#/operations/GetWorkspaceDetail
|
|
85
85
|
*/
|
|
86
86
|
declare class Workspace extends CNBCore {
|
|
87
|
-
constructor(
|
|
87
|
+
constructor(options: CNBCoreOptions);
|
|
88
88
|
/**
|
|
89
89
|
* 删除我的云原生开发环境
|
|
90
90
|
* @param params 删除参数,pipelineId 和 sn 二选一,优先使用 pipelineId
|
package/dist/routes.js
CHANGED
|
@@ -22629,8 +22629,8 @@ class CNBCore {
|
|
|
22629
22629
|
|
|
22630
22630
|
// src/workspace/index.ts
|
|
22631
22631
|
class Workspace extends CNBCore {
|
|
22632
|
-
constructor(
|
|
22633
|
-
super(
|
|
22632
|
+
constructor(options) {
|
|
22633
|
+
super(options);
|
|
22634
22634
|
}
|
|
22635
22635
|
async deleteWorkspace(params) {
|
|
22636
22636
|
const data = {};
|
|
@@ -22675,7 +22675,7 @@ class Workspace extends CNBCore {
|
|
|
22675
22675
|
// src/knowledge/index.ts
|
|
22676
22676
|
class KnowledgeBase extends CNBCore {
|
|
22677
22677
|
constructor(options) {
|
|
22678
|
-
super(
|
|
22678
|
+
super(options);
|
|
22679
22679
|
}
|
|
22680
22680
|
queryKnowledgeBase(repo, data) {
|
|
22681
22681
|
const url2 = `/${repo}/-/knowledge/base/query`;
|
|
@@ -22701,7 +22701,7 @@ class KnowledgeBase extends CNBCore {
|
|
|
22701
22701
|
// src/repo/index.ts
|
|
22702
22702
|
class Repo extends CNBCore {
|
|
22703
22703
|
constructor(options) {
|
|
22704
|
-
super(
|
|
22704
|
+
super(options);
|
|
22705
22705
|
}
|
|
22706
22706
|
createRepo(data) {
|
|
22707
22707
|
const name = data.name;
|
|
@@ -22788,7 +22788,7 @@ class Repo extends CNBCore {
|
|
|
22788
22788
|
// src/user/index.ts
|
|
22789
22789
|
class User extends CNBCore {
|
|
22790
22790
|
constructor(options) {
|
|
22791
|
-
super(
|
|
22791
|
+
super(options);
|
|
22792
22792
|
}
|
|
22793
22793
|
getCurrentUser() {
|
|
22794
22794
|
const url2 = `${this.hackURL}/user`;
|
|
@@ -22837,7 +22837,7 @@ class User extends CNBCore {
|
|
|
22837
22837
|
// src/build/index.ts
|
|
22838
22838
|
class Build extends CNBCore {
|
|
22839
22839
|
constructor(options) {
|
|
22840
|
-
super(
|
|
22840
|
+
super(options);
|
|
22841
22841
|
}
|
|
22842
22842
|
startBuild(repo, data) {
|
|
22843
22843
|
const url2 = `/${repo}/-/build/start`;
|
|
@@ -22852,7 +22852,7 @@ class Build extends CNBCore {
|
|
|
22852
22852
|
// src/issue/index.ts
|
|
22853
22853
|
class Issue extends CNBCore {
|
|
22854
22854
|
constructor(options) {
|
|
22855
|
-
super(
|
|
22855
|
+
super(options);
|
|
22856
22856
|
}
|
|
22857
22857
|
createIssue(repo, data) {
|
|
22858
22858
|
const url2 = `/${repo}/-/issues`;
|
|
@@ -22905,7 +22905,7 @@ class Issue extends CNBCore {
|
|
|
22905
22905
|
// src/mission/index.ts
|
|
22906
22906
|
class Mission extends CNBCore {
|
|
22907
22907
|
constructor(options) {
|
|
22908
|
-
super(
|
|
22908
|
+
super(options);
|
|
22909
22909
|
}
|
|
22910
22910
|
getMissions(group, params) {
|
|
22911
22911
|
const url2 = `/${group}/-/missions`;
|
|
@@ -22970,7 +22970,7 @@ class Mission extends CNBCore {
|
|
|
22970
22970
|
class AiBase extends CNBCore {
|
|
22971
22971
|
group;
|
|
22972
22972
|
constructor(options) {
|
|
22973
|
-
super(
|
|
22973
|
+
super(options);
|
|
22974
22974
|
}
|
|
22975
22975
|
autoPr(repo, data) {
|
|
22976
22976
|
const url2 = `/${repo}/-/build/ai/auto-pr`;
|
|
@@ -22994,21 +22994,23 @@ class CNB extends CNBCore {
|
|
|
22994
22994
|
mission;
|
|
22995
22995
|
ai;
|
|
22996
22996
|
constructor(options) {
|
|
22997
|
-
super({ token: options.token, cookie: options.cookie, cnb: options.cnb });
|
|
22997
|
+
super({ ...options, token: options.token, cookie: options.cookie, cnb: options.cnb });
|
|
22998
22998
|
this.init(options);
|
|
22999
22999
|
}
|
|
23000
23000
|
init(cnbOptions) {
|
|
23001
23001
|
const token = this.token;
|
|
23002
23002
|
const cookie = this.cookie;
|
|
23003
|
-
const
|
|
23004
|
-
|
|
23005
|
-
|
|
23006
|
-
this.
|
|
23007
|
-
this.
|
|
23008
|
-
this.
|
|
23009
|
-
this.
|
|
23010
|
-
this.
|
|
23011
|
-
this.
|
|
23003
|
+
const cors = cnbOptions?.cors || {};
|
|
23004
|
+
const cnb = cnbOptions?.cnb;
|
|
23005
|
+
const options = { token, cookie, cors, cnb };
|
|
23006
|
+
this.workspace = new Workspace(options);
|
|
23007
|
+
this.knowledgeBase = new KnowledgeBase(options);
|
|
23008
|
+
this.repo = new Repo(options);
|
|
23009
|
+
this.user = new User(options);
|
|
23010
|
+
this.build = new Build(options);
|
|
23011
|
+
this.issue = new Issue(options);
|
|
23012
|
+
this.mission = new Mission(options);
|
|
23013
|
+
this.ai = new AiBase(options);
|
|
23012
23014
|
}
|
|
23013
23015
|
setToken(token) {
|
|
23014
23016
|
this.token = token;
|
package/package.json
CHANGED
package/src/ai/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { CNBCore, CNBCoreOptions, RequestOptions, Result } from "../cnb-core.ts"
|
|
|
3
3
|
class AiBase extends CNBCore {
|
|
4
4
|
group: string;
|
|
5
5
|
constructor(options: CNBCoreOptions) {
|
|
6
|
-
super(
|
|
6
|
+
super(options);
|
|
7
7
|
}
|
|
8
8
|
autoPr(repo: string, data: { body: string, branch?: string, title: string }): Promise<Result<any>> {
|
|
9
9
|
const url = `/${repo}/-/build/ai/auto-pr`;
|
package/src/build/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { CNBCore, CNBCoreOptions, RequestOptions, Result } from "../cnb-core.ts"
|
|
|
3
3
|
|
|
4
4
|
export class Build extends CNBCore {
|
|
5
5
|
constructor(options: CNBCoreOptions ) {
|
|
6
|
-
super(
|
|
6
|
+
super(options);
|
|
7
7
|
}
|
|
8
8
|
startBuild(repo: string, data: StartBuildData): Promise<any> {
|
|
9
9
|
const url = `/${repo}/-/build/start`;
|
package/src/git/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -21,21 +21,23 @@ export class CNB extends CNBCore {
|
|
|
21
21
|
mission!: Mission;
|
|
22
22
|
ai!: AiBase;
|
|
23
23
|
constructor(options: CNBOptions) {
|
|
24
|
-
super({ token: options.token, cookie: options.cookie, cnb: options.cnb });
|
|
24
|
+
super({ ...options, token: options.token, cookie: options.cookie, cnb: options.cnb });
|
|
25
25
|
this.init(options);
|
|
26
26
|
}
|
|
27
27
|
init(cnbOptions?: CNBOptions) {
|
|
28
28
|
const token = this.token;
|
|
29
29
|
const cookie = this.cookie;
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
this.
|
|
30
|
+
const cors = cnbOptions?.cors || {}
|
|
31
|
+
const cnb = cnbOptions?.cnb
|
|
32
|
+
const options = { token, cookie, cors, cnb };
|
|
33
|
+
this.workspace = new Workspace(options);
|
|
34
|
+
this.knowledgeBase = new KnowledgeBase(options);
|
|
35
|
+
this.repo = new Repo(options);
|
|
36
|
+
this.user = new User(options);
|
|
37
|
+
this.build = new Build(options);
|
|
38
|
+
this.issue = new Issue(options);
|
|
39
|
+
this.mission = new Mission(options);
|
|
40
|
+
this.ai = new AiBase(options);
|
|
39
41
|
}
|
|
40
42
|
setToken(token: string) {
|
|
41
43
|
this.token = token;
|
package/src/issue/index.ts
CHANGED
|
@@ -38,7 +38,7 @@ export type IssueItem = {
|
|
|
38
38
|
};
|
|
39
39
|
export class Issue extends CNBCore {
|
|
40
40
|
constructor(options: CNBCoreOptions) {
|
|
41
|
-
super(
|
|
41
|
+
super(options);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
createIssue(repo: string, data: Partial<IssueItem>): Promise<any> {
|
package/src/knowledge/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { CNBCore, CNBCoreOptions, Result } from "../cnb-core.ts";
|
|
|
2
2
|
|
|
3
3
|
export class KnowledgeBase extends CNBCore {
|
|
4
4
|
constructor(options: CNBCoreOptions) {
|
|
5
|
-
super(
|
|
5
|
+
super(options);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
queryKnowledgeBase(repo: string, data: {
|
package/src/mission/index.ts
CHANGED
package/src/repo/index.ts
CHANGED
package/src/user/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { CNBCore, CNBCoreOptions } from "../cnb-core.ts";
|
|
|
2
2
|
import { Result } from "@kevisual/query";
|
|
3
3
|
export class User extends CNBCore {
|
|
4
4
|
constructor(options: CNBCoreOptions<{}>) {
|
|
5
|
-
super(
|
|
5
|
+
super(options);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
/**
|
package/src/workspace/index.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { Result } from "@kevisual/query/query";
|
|
9
|
-
import { CNBCore } from "../cnb-core.ts";
|
|
9
|
+
import { CNBCore, CNBCoreOptions } from "../cnb-core.ts";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* 工作空间列表查询参数
|
|
@@ -33,8 +33,8 @@ export interface ListParams {
|
|
|
33
33
|
* https://api.cnb.cool/#/operations/GetWorkspaceDetail
|
|
34
34
|
*/
|
|
35
35
|
export class Workspace extends CNBCore {
|
|
36
|
-
constructor(
|
|
37
|
-
super(
|
|
36
|
+
constructor(options: CNBCoreOptions) {
|
|
37
|
+
super(options);
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* 删除我的云原生开发环境
|