@kevisual/cnb 0.0.13 → 0.0.15
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/keep.js +2850 -4
- package/dist/opencode.js +3230 -302
- package/dist/routes.d.ts +12 -3
- package/dist/routes.js +3229 -301
- package/package.json +7 -6
- package/src/cnb-core.ts +8 -0
- package/src/git/index.ts +676 -0
- package/src/index.ts +12 -10
- package/src/repo/index.ts +2 -2
- package/src/user/index.ts +4 -4
- package/src/workspace/index.ts +3 -3
package/src/repo/index.ts
CHANGED
|
@@ -23,7 +23,7 @@ export class Repo extends CNBCore {
|
|
|
23
23
|
return this.post({ url, data: postData });
|
|
24
24
|
}
|
|
25
25
|
deleteRepo(name: string): Promise<any> {
|
|
26
|
-
const url =
|
|
26
|
+
const url = `${this.hackURL}/${name}`;
|
|
27
27
|
return this.delete({ url, useCookie: true });
|
|
28
28
|
}
|
|
29
29
|
async createCommit(repo: string, data: CreateCommitData): Promise<any> {
|
|
@@ -38,7 +38,7 @@ export class Repo extends CNBCore {
|
|
|
38
38
|
if (!data.parent_commit_sha && preCommitSha) {
|
|
39
39
|
data.parent_commit_sha = preCommitSha;
|
|
40
40
|
}
|
|
41
|
-
const url =
|
|
41
|
+
const url = `${this.hackURL}/${repo}/-/git/commits`;
|
|
42
42
|
const postData: CreateCommitData = {
|
|
43
43
|
...data,
|
|
44
44
|
base_branch: data.base_branch || 'refs/heads/main',
|
package/src/user/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ export class User extends CNBCore {
|
|
|
10
10
|
* @returns
|
|
11
11
|
*/
|
|
12
12
|
getCurrentUser(): Promise<Result<UserInfo>> {
|
|
13
|
-
const url =
|
|
13
|
+
const url = `${this.hackURL}/user`;
|
|
14
14
|
return this.get({
|
|
15
15
|
url,
|
|
16
16
|
useCookie: true,
|
|
@@ -26,7 +26,7 @@ export class User extends CNBCore {
|
|
|
26
26
|
}
|
|
27
27
|
createAccessToken(data?: { description?: string, scope?: string }): Promise<AccessTokenResponse> {
|
|
28
28
|
const scope = data?.scope || 'mission-manage:rw,mission-delete:rw,group-delete:rw,group-manage:rw,group-resource:rw,account-engage:rw,account-email:r,account-profile:rw,registry-delete:rw,registry-manage:rw,registry-package-delete:rw,registry-package:rw,repo-security:r,repo-delete:rw,repo-manage:rw,repo-basic-info:r,repo-cnb-detail:rw,repo-cnb-history:r,repo-cnb-trigger:rw,repo-commit-status:rw,repo-contents:rw,repo-notes:rw,repo-issue:rw,repo-pr:rw,repo-code:rw'
|
|
29
|
-
const url =
|
|
29
|
+
const url = `${this.hackURL}/user/personal_access_tokens`
|
|
30
30
|
return this.post({
|
|
31
31
|
url,
|
|
32
32
|
useCookie: true,
|
|
@@ -37,7 +37,7 @@ export class User extends CNBCore {
|
|
|
37
37
|
})
|
|
38
38
|
}
|
|
39
39
|
getAccessTokens(params?: { page?: number, page_size?: number }): Promise<AccessTokenResponse[]> {
|
|
40
|
-
const url =
|
|
40
|
+
const url = `${this.hackURL}/user/personal_access_tokens`
|
|
41
41
|
return this.get({
|
|
42
42
|
url,
|
|
43
43
|
useCookie: true,
|
|
@@ -49,7 +49,7 @@ export class User extends CNBCore {
|
|
|
49
49
|
})
|
|
50
50
|
}
|
|
51
51
|
deleteAccessToken(tokenId: string): Promise<any> {
|
|
52
|
-
const url =
|
|
52
|
+
const url = `${this.hackURL}/user/personal_access_tokens/${tokenId}`
|
|
53
53
|
return this.delete({
|
|
54
54
|
url,
|
|
55
55
|
useCookie: true,
|
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
|
* 删除我的云原生开发环境
|