@kevisual/cnb 0.0.13 → 0.0.14
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 +3216 -290
- package/dist/routes.d.ts +11 -2
- package/dist/routes.js +3215 -289
- package/package.json +7 -6
- package/src/cnb-core.ts +8 -0
- package/src/git/index.ts +676 -0
- package/src/repo/index.ts +2 -2
- package/src/user/index.ts +4 -4
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,
|