@burdenoff/cli-sdk 2026.522.1 → 2026.525.1
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var fs=require('fs'),path=require('path'),crypto=require('crypto');var u=class extends Error{exitCode;hint;constructor(
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var fs=require('fs'),path=require('path'),crypto=require('crypto');var u=class extends Error{exitCode;hint;constructor(r,a){super(r),this.name="CliUserError",this.exitCode=a?.exitCode??1,this.hint=a?.hint;}},m=class extends u{constructor(r,a){super(r,{exitCode:2,hint:a?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},g=class extends Error{cause;constructor(r,a){super(r),this.name="CliInternalError",this.cause=a;}};var C=null;function E(n){C=n;}function w(){if(!C)throw new g("vibecontrols module helpers used before setHelpersContext was called");return C}function H(){let n=w();if(!n.auth.isAuthenticated())throw new m(`Authentication required. Run \`${n.productName} auth login\`.`)}async function l(n,r){return H(),w().gql.workspace.request(n,r)}function p(n){let r=n instanceof Error?n.message:String(n);throw new u(r)}function d(n,r,a){w().output.formatAndOutput(n,r,a);}function h(n){w().output.printSuccess(n);}function x(n){w().output.printInfo(n);}function y(n,r){return w().output.truncate(n,r)}var v=`
|
|
2
2
|
query BrowseFolderRoot($pagination: PaginationInput) {
|
|
3
3
|
getFilesInFolder(pagination: $pagination) {
|
|
4
4
|
files { id name size mimeType extension createdAt }
|
|
@@ -31,19 +31,34 @@
|
|
|
31
31
|
fileId
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
`,$=`
|
|
35
35
|
mutation CreateShare($input: FileCreateShareInput!) {
|
|
36
36
|
createShare(input: $input) {
|
|
37
37
|
id token shareType accessLevel expiresAt requiresPassword
|
|
38
38
|
downloadCount maxDownloads createdAt
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
`,D=`
|
|
42
42
|
mutation RevokeShare($id: ID!) {
|
|
43
43
|
revokeShare(id: $id) {
|
|
44
44
|
id revokedAt revokedBy
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
`,R=`
|
|
48
|
+
query GetFile($id: ID!) {
|
|
49
|
+
getFile(id: $id) {
|
|
50
|
+
id name description workspaceId folderId
|
|
51
|
+
mimeType extension size s3Key s3Bucket
|
|
52
|
+
downloadUrl status visibility
|
|
53
|
+
starred downloadCount viewCount sha256Hash
|
|
54
|
+
uploadedById createdAt updatedAt
|
|
55
|
+
tags
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
`,F=`
|
|
59
|
+
query GetFileDownloadUrl($id: ID!, $expiresIn: Int) {
|
|
60
|
+
getFileDownloadUrl(id: $id, expiresIn: $expiresIn)
|
|
61
|
+
}
|
|
62
|
+
`;function L(n){let r=n.command("files").description("Workspace file management");r.command("browse").description("Browse a folder (defaults to root)").argument("[folderId]").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,e)=>{try{let o={limit:e.limit,offset:0};if(t){let i=await l(A,{folderId:t,pagination:o});if(e.format){d(e,{folder:i.getFolder,files:i.getFilesInFolder.files});return}i.getFolder&&x(`Folder: ${i.getFolder.name}`);for(let c of i.getFilesInFolder.files){let k=c.size?`${c.size}b`:"-";console.log(` \u{1F4C4} ${y(c.id,12)} ${c.name} ${k} ${c.mimeType??"-"}`);}console.log(`
|
|
63
|
+
${i.getFilesInFolder.total} files`);return}let f=await l(v,{pagination:o});if(e.format){d(e,{files:f.getFilesInFolder.files});return}for(let i of f.getFilesInFolder.files){let c=i.size?`${i.size}b`:"-";console.log(` \u{1F4C4} ${y(i.id,12)} ${i.name} ${c} ${i.mimeType??"-"}`);}console.log(`
|
|
64
|
+
${f.getFilesInFolder.total} files`);}catch(o){p(o);}}),r.command("upload").description("Upload a local file (initiates a multipart session)").argument("<path>","Local file path").option("--folder <folderId>","Target folder id").option("--visibility <v>","PRIVATE|WORKSPACE|PUBLIC","WORKSPACE").option("-f, --format <format>").action(async(t,e)=>{try{let o=fs.statSync(t),f=path.basename(t),i=path.extname(t).slice(1)||void 0,c=fs.readFileSync(t),k=crypto.createHash("sha256").update(c).digest("hex"),q={fileName:f,fileSize:o.size,mimeType:"application/octet-stream",extension:i,folderId:e.folder,sha256Hash:k,visibility:(e.visibility??"WORKSPACE").toUpperCase()},I=await l(S,{input:q});x("Upload session created. PUT the local bytes to the returned URL(s)."),d(e,I.initiateUpload),x(`After uploading, complete with: vibecontrols files upload-complete --session ${I.initiateUpload.session.id}`);}catch(o){p(o);}}),r.command("upload-complete").description("Complete an in-flight upload session").requiredOption("--session <id>","Session id from `files upload`").option("--folder <folderId>").option("--description <s>").option("-f, --format <format>").action(async t=>{try{let e=await l(O,{input:{sessionId:t.session,folderId:t.folder,description:t.description}});h(`Upload complete: ${e.completeUpload.fileId}`),d(t,e.completeUpload.file);}catch(e){p(e);}}),r.command("get").description("Get a file by id").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await l(R,{id:t});if(!o.getFile)throw new u(`File ${t} not found`);d(e,o.getFile);}catch(o){p(o);}}),r.command("download").description("Get a pre-signed download URL for a file").argument("<id>").option("--expires <seconds>","URL expiry in seconds",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,e)=>{try{let o=await l(F,{id:t,expiresIn:e.expires});if(e.format){d(e,{url:o.getFileDownloadUrl});return}h("Download URL:"),console.log(o.getFileDownloadUrl);}catch(o){p(o);}});let a=r.command("share").description("Manage file shares");a.command("create").description("Create a share link for a file").argument("<fileId>").option("--access <a>","VIEW|DOWNLOAD","DOWNLOAD").option("--expires <iso>","Expiry timestamp").option("--password <p>").option("--max-downloads <n>","",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,e)=>{try{let o={fileId:t,shareType:"PUBLIC_LINK",accessLevel:(e.access??"DOWNLOAD").toUpperCase(),expiresAt:e.expires,password:e.password,maxDownloads:e.maxDownloads},f=await l($,{input:o});h("Share created"),d(e,f.createShare);}catch(o){p(o);}}),a.command("revoke").description("Revoke a share by id").argument("<shareId>").action(async t=>{try{await l(D,{id:t}),h("Share revoked");}catch(e){p(e);}});}var ee={id:"files",version:"1.0.0",displayName:"Files",dependsOn:["auth","workspaces"],register(n,r){E(r),L(n);}},ft=ee;module.exports=ft;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {a,b,g,j,o,f,h}from'../../chunk-KTKHJORN.js';import'../../chunk-RNWXATAC.js';import {statSync,readFileSync}from'fs';import {basename,extname}from'path';import {createHash}from'crypto';var
|
|
1
|
+
import {a,b,g,j,o,f,h as h$1}from'../../chunk-KTKHJORN.js';import {o as o$1}from'../../chunk-RNWXATAC.js';import {statSync,readFileSync}from'fs';import {basename,extname}from'path';import {createHash}from'crypto';var h=`
|
|
2
2
|
query BrowseFolderRoot($pagination: PaginationInput) {
|
|
3
3
|
getFilesInFolder(pagination: $pagination) {
|
|
4
4
|
files { id name size mimeType extension createdAt }
|
|
5
5
|
total hasMore
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
`,
|
|
8
|
+
`,x=`
|
|
9
9
|
query BrowseFolderById($folderId: ID!, $pagination: PaginationInput) {
|
|
10
10
|
getFolder(id: $folderId) {
|
|
11
11
|
id name path
|
|
@@ -15,7 +15,7 @@ import {a,b,g,j,o,f,h}from'../../chunk-KTKHJORN.js';import'../../chunk-RNWXATAC.
|
|
|
15
15
|
total hasMore
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
`,
|
|
18
|
+
`,E=`
|
|
19
19
|
mutation InitiateUpload($input: InitiateUploadInput!) {
|
|
20
20
|
initiateUpload(input: $input) {
|
|
21
21
|
session { id fileName fileSize s3Bucket s3Key }
|
|
@@ -24,26 +24,41 @@ import {a,b,g,j,o,f,h}from'../../chunk-KTKHJORN.js';import'../../chunk-RNWXATAC.
|
|
|
24
24
|
multipartUploadId
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
`,
|
|
27
|
+
`,R=`
|
|
28
28
|
mutation CompleteUpload($input: CompleteUploadInput!) {
|
|
29
29
|
completeUpload(input: $input) {
|
|
30
30
|
file { id name size s3Bucket s3Key downloadUrl }
|
|
31
31
|
fileId
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
`,$=`
|
|
35
35
|
mutation CreateShare($input: FileCreateShareInput!) {
|
|
36
36
|
createShare(input: $input) {
|
|
37
37
|
id token shareType accessLevel expiresAt requiresPassword
|
|
38
38
|
downloadCount maxDownloads createdAt
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
`,
|
|
41
|
+
`,O=`
|
|
42
42
|
mutation RevokeShare($id: ID!) {
|
|
43
43
|
revokeShare(id: $id) {
|
|
44
44
|
id revokedAt revokedBy
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
`,C=`
|
|
48
|
+
query GetFile($id: ID!) {
|
|
49
|
+
getFile(id: $id) {
|
|
50
|
+
id name description workspaceId folderId
|
|
51
|
+
mimeType extension size s3Key s3Bucket
|
|
52
|
+
downloadUrl status visibility
|
|
53
|
+
starred downloadCount viewCount sha256Hash
|
|
54
|
+
uploadedById createdAt updatedAt
|
|
55
|
+
tags
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
`,A=`
|
|
59
|
+
query GetFileDownloadUrl($id: ID!, $expiresIn: Int) {
|
|
60
|
+
getFileDownloadUrl(id: $id, expiresIn: $expiresIn)
|
|
61
|
+
}
|
|
62
|
+
`;function D(c){let s=c.command("files").description("Workspace file management");s.command("browse").description("Browse a folder (defaults to root)").argument("[folderId]").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,e)=>{try{let o$1={limit:e.limit,offset:0};if(t){let i=await b(x,{folderId:t,pagination:o$1});if(e.format){g(e,{folder:i.getFolder,files:i.getFilesInFolder.files});return}i.getFolder&&j(`Folder: ${i.getFolder.name}`);for(let n of i.getFilesInFolder.files){let f=n.size?`${n.size}b`:"-";console.log(` \u{1F4C4} ${o(n.id,12)} ${n.name} ${f} ${n.mimeType??"-"}`);}console.log(`
|
|
63
|
+
${i.getFilesInFolder.total} files`);return}let d=await b(h,{pagination:o$1});if(e.format){g(e,{files:d.getFilesInFolder.files});return}for(let i of d.getFilesInFolder.files){let n=i.size?`${i.size}b`:"-";console.log(` \u{1F4C4} ${o(i.id,12)} ${i.name} ${n} ${i.mimeType??"-"}`);}console.log(`
|
|
64
|
+
${d.getFilesInFolder.total} files`);}catch(o){f(o);}}),s.command("upload").description("Upload a local file (initiates a multipart session)").argument("<path>","Local file path").option("--folder <folderId>","Target folder id").option("--visibility <v>","PRIVATE|WORKSPACE|PUBLIC","WORKSPACE").option("-f, --format <format>").action(async(t,e)=>{try{let o=statSync(t),d=basename(t),i=extname(t).slice(1)||void 0,n=readFileSync(t),f=createHash("sha256").update(n).digest("hex"),L={fileName:d,fileSize:o.size,mimeType:"application/octet-stream",extension:i,folderId:e.folder,sha256Hash:f,visibility:(e.visibility??"WORKSPACE").toUpperCase()},I=await b(E,{input:L});j("Upload session created. PUT the local bytes to the returned URL(s)."),g(e,I.initiateUpload),j(`After uploading, complete with: vibecontrols files upload-complete --session ${I.initiateUpload.session.id}`);}catch(o){f(o);}}),s.command("upload-complete").description("Complete an in-flight upload session").requiredOption("--session <id>","Session id from `files upload`").option("--folder <folderId>").option("--description <s>").option("-f, --format <format>").action(async t=>{try{let e=await b(R,{input:{sessionId:t.session,folderId:t.folder,description:t.description}});h$1(`Upload complete: ${e.completeUpload.fileId}`),g(t,e.completeUpload.file);}catch(e){f(e);}}),s.command("get").description("Get a file by id").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await b(C,{id:t});if(!o.getFile)throw new o$1(`File ${t} not found`);g(e,o.getFile);}catch(o){f(o);}}),s.command("download").description("Get a pre-signed download URL for a file").argument("<id>").option("--expires <seconds>","URL expiry in seconds",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,e)=>{try{let o=await b(A,{id:t,expiresIn:e.expires});if(e.format){g(e,{url:o.getFileDownloadUrl});return}h$1("Download URL:"),console.log(o.getFileDownloadUrl);}catch(o){f(o);}});let u=s.command("share").description("Manage file shares");u.command("create").description("Create a share link for a file").argument("<fileId>").option("--access <a>","VIEW|DOWNLOAD","DOWNLOAD").option("--expires <iso>","Expiry timestamp").option("--password <p>").option("--max-downloads <n>","",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,e)=>{try{let o={fileId:t,shareType:"PUBLIC_LINK",accessLevel:(e.access??"DOWNLOAD").toUpperCase(),expiresAt:e.expires,password:e.password,maxDownloads:e.maxDownloads},d=await b($,{input:o});h$1("Share created"),g(e,d.createShare);}catch(o){f(o);}}),u.command("revoke").description("Revoke a share by id").argument("<shareId>").action(async t=>{try{await b(O,{id:t}),h$1("Share revoked");}catch(e){f(e);}});}var B={id:"files",version:"1.0.0",displayName:"Files",dependsOn:["auth","workspaces"],register(c,s){a(s),D(c);}},V=B;export{V as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var l=class extends Error{exitCode;hint;constructor(n,a){super(n),this.name="CliUserError",this.exitCode=a?.exitCode??1,this.hint=a?.hint;}},w=class extends l{constructor(n,a){super(n,{exitCode:2,hint:a?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},f=class extends Error{cause;constructor(n,a){super(n),this.name="CliInternalError",this.cause=a;}};var x=null;function E(r){x=r;}function d(){if(!x)throw new f("vibecontrols module helpers used before setHelpersContext was called");return x}function X(){let r=d();if(!r.auth.isAuthenticated())throw new w(`Authentication required. Run \`${r.productName} auth login\`.`)}async function v(r,n){return X(),d().gql.workspace.request(r,n)}async function R(r,n){return d().gql.global.request(r,n)}function p(r){let n=r instanceof Error?r.message:String(r);throw new l(n)}function m(r,n,a){d().output.formatAndOutput(r,n,a);}function k(r){d().output.printSuccess(r);}function A(r){return d().output.formatStatus(r)}function h(r,n){return d().output.truncate(r,n)}function S(){return d()}var O=`
|
|
2
2
|
query ListRoles($filter: RoleFilterInput, $pagination: PaginationInput, $scopeId: String!) {
|
|
3
3
|
roles(filter: $filter, pagination: $pagination, scopeId: $scopeId) {
|
|
4
4
|
id
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
`,
|
|
16
|
+
`,L=`
|
|
17
17
|
query GetRole($id: ID!) {
|
|
18
18
|
role(id: $id) {
|
|
19
19
|
id
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
`,
|
|
31
|
+
`,P=`
|
|
32
32
|
mutation CreateRole($input: CreateRoleInput!) {
|
|
33
33
|
createRole(input: $input) {
|
|
34
34
|
id
|
|
@@ -46,11 +46,35 @@
|
|
|
46
46
|
priority
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
`,
|
|
49
|
+
`,D=`
|
|
50
50
|
mutation DeleteRole($id: ID!, $reassignToRoleId: ID) {
|
|
51
51
|
deleteRole(id: $id, reassignToRoleId: $reassignToRoleId)
|
|
52
52
|
}
|
|
53
|
-
`,
|
|
53
|
+
`,q=`
|
|
54
|
+
query PolicyReferences($filter: PolicyReferenceFilterInput, $pagination: PaginationInput) {
|
|
55
|
+
policyReferences(filter: $filter, pagination: $pagination) {
|
|
56
|
+
id
|
|
57
|
+
name
|
|
58
|
+
description
|
|
59
|
+
opaPackage
|
|
60
|
+
resourceType
|
|
61
|
+
action
|
|
62
|
+
isActive
|
|
63
|
+
priority
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
`,_=`
|
|
67
|
+
mutation AttachPolicyToRole($roleId: ID!, $policyId: ID!) {
|
|
68
|
+
attachPolicyToRole(roleId: $roleId, policyId: $policyId) {
|
|
69
|
+
id
|
|
70
|
+
name
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
`,N=`
|
|
74
|
+
mutation DetachPolicyFromRole($roleId: ID!, $policyId: ID!) {
|
|
75
|
+
detachPolicyFromRole(roleId: $roleId, policyId: $policyId)
|
|
76
|
+
}
|
|
77
|
+
`,F=`
|
|
54
78
|
query CheckPermission($input: PermissionCheckInput!) {
|
|
55
79
|
checkPermission(input: $input) {
|
|
56
80
|
allowed
|
|
@@ -60,4 +84,4 @@
|
|
|
60
84
|
overrideType
|
|
61
85
|
}
|
|
62
86
|
}
|
|
63
|
-
`;function
|
|
87
|
+
`;function u(r,n,a){return r==="workspace"?v(n,a):R(n,a)}function I(r){let n=S().auth.read();if(r==="workspace"){if(!n?.workspaceId)throw new l("No workspace set. Run `vibecontrols workspace set <id>` or pass --scope <workspaceId>.");return n.workspaceId}if(!n?.organizationId)throw new l("No organization context. Run `auth login` to bind a tenant or pass --scope <tenantId>.");return n.organizationId}function j(r){let n=r.command("rbac").description("Role-based access control"),a=n.command("roles").description("Manage roles");a.command("list").description("List roles").option("--layer <layer>","workspace or global","workspace").option("--scope <scopeId>","Override scope id (workspace or tenant)").option("--include-system","Include system roles",false).option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>","Output format").action(async e=>{try{let t=e.layer==="global"?"global":"workspace",i=e.scope??I(t),o={};e.includeSystem&&(o.includeSystem=!0);let s=await u(t,O,{filter:Object.keys(o).length?o:void 0,pagination:{limit:e.limit,offset:0},scopeId:i});m(e,s.roles,{headers:["ID","Name","Scope","Priority","System"],rows:s.roles.map(g=>[h(g.id,12),g.name,h(g.scopeId,12),String(g.priority),String(g.isSystem)])});}catch(t){p(t);}}),a.command("get").description("Get role by id").argument("<id>").option("--layer <layer>","workspace or global","workspace").option("-f, --format <format>").action(async(e,t)=>{try{let i=t.layer==="global"?"global":"workspace",o=await u(i,L,{id:e});if(!o.role)throw new l(`Role ${e} not found`);m(t,o.role);}catch(i){p(i);}}),a.command("create").description("Create a role").requiredOption("--name <name>","Role name").option("--description <text>").option("--parent <id>","Parent role id").option("--priority <n>","Priority",e=>parseInt(e,10)).option("--layer <layer>","workspace or global","workspace").option("--scope <scopeId>","Override scope id").option("--scope-type <type>","wspace|entity (global only)").option("-f, --format <format>").action(async e=>{try{let t=e.layer==="global"?"global":"workspace",i=e.scope??I(t),o={name:e.name,description:e.description,parentId:e.parent,priority:e.priority,scopeId:i};t==="global"&&e.scopeType&&(o.scopeType=e.scopeType);let s=await u(t,P,{input:o});k(`Role created: ${s.createRole.name}`),m(e,s.createRole);}catch(t){p(t);}}),a.command("update").description("Update a role").argument("<id>").option("--name <name>").option("--description <text>").option("--priority <n>","",e=>parseInt(e,10)).option("--parent <id>").option("--layer <layer>","workspace or global","workspace").option("-f, --format <format>").action(async(e,t)=>{try{let i=t.layer==="global"?"global":"workspace",o={};if(t.name&&(o.name=t.name),t.description!==void 0&&(o.description=t.description),t.priority!==void 0&&(o.priority=t.priority),t.parent&&(o.parentId=t.parent),!Object.keys(o).length)throw new l("No updates specified");let s=await u(i,$,{id:e,input:o});k("Role updated"),m(t,s.updateRole);}catch(i){p(i);}}),a.command("delete").description("Delete a role").argument("<id>").option("--reassign <roleId>","Reassign actors to this role").option("--layer <layer>","workspace or global","workspace").action(async(e,t)=>{try{let i=t.layer==="global"?"global":"workspace";await u(i,D,{id:e,reassignToRoleId:t.reassign}),k("Role deleted");}catch(i){p(i);}});let C=n.command("policies").description("Manage policy references");C.command("list").description("List policy references").option("--layer <layer>","workspace or global","workspace").option("--resource-type <s>","Filter by resource type").option("--action <s>","Filter by action").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async e=>{try{let t=e.layer==="global"?"global":"workspace",i={};e.resourceType&&(i.resourceType=e.resourceType),e.action&&(i.action=e.action);let o=await u(t,q,{filter:Object.keys(i).length?i:void 0,pagination:{limit:e.limit,offset:0}});m(e,o.policyReferences,{headers:["ID","Name","Resource","Action","Active","Priority"],rows:o.policyReferences.map(s=>[h(s.id,12),s.name,s.resourceType??"-",s.action??"-",String(s.isActive),String(s.priority??"-")])});}catch(t){p(t);}}),C.command("attach").description("Attach a policy to a role").requiredOption("--role <roleId>").requiredOption("--policy <policyId>").option("--layer <layer>","workspace or global","workspace").action(async e=>{try{let t=e.layer==="global"?"global":"workspace";await u(t,_,{roleId:e.role,policyId:e.policy}),k("Policy attached");}catch(t){p(t);}}),C.command("detach").description("Detach a policy from a role").requiredOption("--role <roleId>").requiredOption("--policy <policyId>").option("--layer <layer>","workspace or global","workspace").action(async e=>{try{let t=e.layer==="global"?"global":"workspace";await u(t,N,{roleId:e.role,policyId:e.policy}),k("Policy detached");}catch(t){p(t);}}),n.command("check").description("Check whether an actor has permission for an action on a resource").argument("<actorId>","Actor id (user/app/service/super_admin)").argument("<action>","Action like read/write/delete").argument("<resourceType>","Resource type like project/task").option("--actor-type <type>","USER|BOT|GROUP|INTEGRATION|DELEGATED_AGENT","USER").option("--resource-id <id>","Specific resource id (optional)").option("--scope <scopeId>","Scope id (workspaceId or tenantId)").option("--layer <layer>","workspace or global","workspace").option("-f, --format <format>").action(async(e,t,i,o)=>{try{let s=o.layer==="global"?"global":"workspace",g=o.scope??I(s),G={actorId:e,actorType:(o.actorType??"USER").toUpperCase(),action:t,resourceType:i,resourceId:o.resourceId,scopeId:g},y=await u(s,F,{input:G});m(o,y.checkPermission,{headers:["Allowed","Decision","Role","Level","Override"],rows:[[A(y.checkPermission.allowed?"ACTIVE":"ERROR"),y.checkPermission.decisionPath,y.checkPermission.roleName??"-",y.checkPermission.roleLevel??"-",y.checkPermission.overrideType??"-"]]});}catch(s){p(s);}});}var ee={id:"rbac",version:"1.0.0",displayName:"RBAC",dependsOn:["auth"],register(r,n){E(n),j(r);}},pt=ee;module.exports=pt;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,g,o,f
|
|
1
|
+
import {a,g,o,f as f$1,h,m,r,b,c}from'../../chunk-KTKHJORN.js';import {o as o$1}from'../../chunk-RNWXATAC.js';var L=`
|
|
2
2
|
query ListRoles($filter: RoleFilterInput, $pagination: PaginationInput, $scopeId: String!) {
|
|
3
3
|
roles(filter: $filter, pagination: $pagination, scopeId: $scopeId) {
|
|
4
4
|
id
|
|
@@ -13,7 +13,7 @@ import {a,g,o,f,h,m as m$1,r,b,c}from'../../chunk-KTKHJORN.js';import {o as o$1}
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
`,
|
|
16
|
+
`,P=`
|
|
17
17
|
query GetRole($id: ID!) {
|
|
18
18
|
role(id: $id) {
|
|
19
19
|
id
|
|
@@ -37,7 +37,7 @@ import {a,g,o,f,h,m as m$1,r,b,c}from'../../chunk-KTKHJORN.js';import {o as o$1}
|
|
|
37
37
|
scopeId
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
`,
|
|
40
|
+
`,O=`
|
|
41
41
|
mutation UpdateRole($id: ID!, $input: UpdateRoleInput!) {
|
|
42
42
|
updateRole(id: $id, input: $input) {
|
|
43
43
|
id
|
|
@@ -46,11 +46,35 @@ import {a,g,o,f,h,m as m$1,r,b,c}from'../../chunk-KTKHJORN.js';import {o as o$1}
|
|
|
46
46
|
priority
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
`,
|
|
49
|
+
`,S=`
|
|
50
50
|
mutation DeleteRole($id: ID!, $reassignToRoleId: ID) {
|
|
51
51
|
deleteRole(id: $id, reassignToRoleId: $reassignToRoleId)
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
`,$=`
|
|
54
|
+
query PolicyReferences($filter: PolicyReferenceFilterInput, $pagination: PaginationInput) {
|
|
55
|
+
policyReferences(filter: $filter, pagination: $pagination) {
|
|
56
|
+
id
|
|
57
|
+
name
|
|
58
|
+
description
|
|
59
|
+
opaPackage
|
|
60
|
+
resourceType
|
|
61
|
+
action
|
|
62
|
+
isActive
|
|
63
|
+
priority
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
`,A=`
|
|
67
|
+
mutation AttachPolicyToRole($roleId: ID!, $policyId: ID!) {
|
|
68
|
+
attachPolicyToRole(roleId: $roleId, policyId: $policyId) {
|
|
69
|
+
id
|
|
70
|
+
name
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
`,x=`
|
|
74
|
+
mutation DetachPolicyFromRole($roleId: ID!, $policyId: ID!) {
|
|
75
|
+
detachPolicyFromRole(roleId: $roleId, policyId: $policyId)
|
|
76
|
+
}
|
|
77
|
+
`,D=`
|
|
54
78
|
query CheckPermission($input: PermissionCheckInput!) {
|
|
55
79
|
checkPermission(input: $input) {
|
|
56
80
|
allowed
|
|
@@ -60,4 +84,4 @@ import {a,g,o,f,h,m as m$1,r,b,c}from'../../chunk-KTKHJORN.js';import {o as o$1}
|
|
|
60
84
|
overrideType
|
|
61
85
|
}
|
|
62
86
|
}
|
|
63
|
-
`;function
|
|
87
|
+
`;function s(p,n,c$1){return p==="workspace"?b(n,c$1):c(n,c$1)}function f(p){let n=r().auth.read();if(p==="workspace"){if(!n?.workspaceId)throw new o$1("No workspace set. Run `vibecontrols workspace set <id>` or pass --scope <workspaceId>.");return n.workspaceId}if(!n?.organizationId)throw new o$1("No organization context. Run `auth login` to bind a tenant or pass --scope <tenantId>.");return n.organizationId}function _(p){let n=p.command("rbac").description("Role-based access control"),c=n.command("roles").description("Manage roles");c.command("list").description("List roles").option("--layer <layer>","workspace or global","workspace").option("--scope <scopeId>","Override scope id (workspace or tenant)").option("--include-system","Include system roles",false).option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>","Output format").action(async e=>{try{let o$1=e.layer==="global"?"global":"workspace",t=e.scope??f(o$1),r={};e.includeSystem&&(r.includeSystem=!0);let i=await s(o$1,L,{filter:Object.keys(r).length?r:void 0,pagination:{limit:e.limit,offset:0},scopeId:t});g(e,i.roles,{headers:["ID","Name","Scope","Priority","System"],rows:i.roles.map(l=>[o(l.id,12),l.name,o(l.scopeId,12),String(l.priority),String(l.isSystem)])});}catch(o){f$1(o);}}),c.command("get").description("Get role by id").argument("<id>").option("--layer <layer>","workspace or global","workspace").option("-f, --format <format>").action(async(e,o)=>{try{let t=o.layer==="global"?"global":"workspace",r=await s(t,P,{id:e});if(!r.role)throw new o$1(`Role ${e} not found`);g(o,r.role);}catch(t){f$1(t);}}),c.command("create").description("Create a role").requiredOption("--name <name>","Role name").option("--description <text>").option("--parent <id>","Parent role id").option("--priority <n>","Priority",e=>parseInt(e,10)).option("--layer <layer>","workspace or global","workspace").option("--scope <scopeId>","Override scope id").option("--scope-type <type>","wspace|entity (global only)").option("-f, --format <format>").action(async e=>{try{let o=e.layer==="global"?"global":"workspace",t=e.scope??f(o),r={name:e.name,description:e.description,parentId:e.parent,priority:e.priority,scopeId:t};o==="global"&&e.scopeType&&(r.scopeType=e.scopeType);let i=await s(o,C,{input:r});h(`Role created: ${i.createRole.name}`),g(e,i.createRole);}catch(o){f$1(o);}}),c.command("update").description("Update a role").argument("<id>").option("--name <name>").option("--description <text>").option("--priority <n>","",e=>parseInt(e,10)).option("--parent <id>").option("--layer <layer>","workspace or global","workspace").option("-f, --format <format>").action(async(e,o)=>{try{let t=o.layer==="global"?"global":"workspace",r={};if(o.name&&(r.name=o.name),o.description!==void 0&&(r.description=o.description),o.priority!==void 0&&(r.priority=o.priority),o.parent&&(r.parentId=o.parent),!Object.keys(r).length)throw new o$1("No updates specified");let i=await s(t,O,{id:e,input:r});h("Role updated"),g(o,i.updateRole);}catch(t){f$1(t);}}),c.command("delete").description("Delete a role").argument("<id>").option("--reassign <roleId>","Reassign actors to this role").option("--layer <layer>","workspace or global","workspace").action(async(e,o)=>{try{let t=o.layer==="global"?"global":"workspace";await s(t,S,{id:e,reassignToRoleId:o.reassign}),h("Role deleted");}catch(t){f$1(t);}});let I=n.command("policies").description("Manage policy references");I.command("list").description("List policy references").option("--layer <layer>","workspace or global","workspace").option("--resource-type <s>","Filter by resource type").option("--action <s>","Filter by action").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async e=>{try{let o$1=e.layer==="global"?"global":"workspace",t={};e.resourceType&&(t.resourceType=e.resourceType),e.action&&(t.action=e.action);let r=await s(o$1,$,{filter:Object.keys(t).length?t:void 0,pagination:{limit:e.limit,offset:0}});g(e,r.policyReferences,{headers:["ID","Name","Resource","Action","Active","Priority"],rows:r.policyReferences.map(i=>[o(i.id,12),i.name,i.resourceType??"-",i.action??"-",String(i.isActive),String(i.priority??"-")])});}catch(o){f$1(o);}}),I.command("attach").description("Attach a policy to a role").requiredOption("--role <roleId>").requiredOption("--policy <policyId>").option("--layer <layer>","workspace or global","workspace").action(async e=>{try{let o=e.layer==="global"?"global":"workspace";await s(o,A,{roleId:e.role,policyId:e.policy}),h("Policy attached");}catch(o){f$1(o);}}),I.command("detach").description("Detach a policy from a role").requiredOption("--role <roleId>").requiredOption("--policy <policyId>").option("--layer <layer>","workspace or global","workspace").action(async e=>{try{let o=e.layer==="global"?"global":"workspace";await s(o,x,{roleId:e.role,policyId:e.policy}),h("Policy detached");}catch(o){f$1(o);}}),n.command("check").description("Check whether an actor has permission for an action on a resource").argument("<actorId>","Actor id (user/app/service/super_admin)").argument("<action>","Action like read/write/delete").argument("<resourceType>","Resource type like project/task").option("--actor-type <type>","USER|BOT|GROUP|INTEGRATION|DELEGATED_AGENT","USER").option("--resource-id <id>","Specific resource id (optional)").option("--scope <scopeId>","Scope id (workspaceId or tenantId)").option("--layer <layer>","workspace or global","workspace").option("-f, --format <format>").action(async(e,o,t,r)=>{try{let i=r.layer==="global"?"global":"workspace",l=r.scope??f(i),v={actorId:e,actorType:(r.actorType??"USER").toUpperCase(),action:o,resourceType:t,resourceId:r.resourceId,scopeId:l},y=await s(i,D,{input:v});g(r,y.checkPermission,{headers:["Allowed","Decision","Role","Level","Override"],rows:[[m(y.checkPermission.allowed?"ACTIVE":"ERROR"),y.checkPermission.decisionPath,y.checkPermission.roleName??"-",y.checkPermission.roleLevel??"-",y.checkPermission.overrideType??"-"]]});}catch(i){f$1(i);}});}var U={id:"rbac",version:"1.0.0",displayName:"RBAC",dependsOn:["auth"],register(p,n){a(n),_(p);}},Y=U;export{Y as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var c=class extends Error{exitCode;hint;constructor(o,
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var c=class extends Error{exitCode;hint;constructor(o,s){super(o),this.name="CliUserError",this.exitCode=s?.exitCode??1,this.hint=s?.hint;}},w=class extends c{constructor(o,s){super(o,{exitCode:2,hint:s?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},f=class extends Error{cause;constructor(o,s){super(o),this.name="CliInternalError",this.cause=s;}};var k=null;function v(r){k=r;}function g(){if(!k)throw new f("vibecontrols module helpers used before setHelpersContext was called");return k}function ee(){let r=g();if(!r.auth.isAuthenticated())throw new w(`Authentication required. Run \`${r.productName} auth login\`.`)}async function u(r,o){return ee(),g().gql.workspace.request(r,o)}function p(r){let o=r instanceof Error?r.message:String(r);throw new c(o)}function l(r,o,s){g().output.formatAndOutput(r,o,s);}function d(r){g().output.printSuccess(r);}function y(r){return g().output.formatStatus(r)}function C(r){return g().output.formatDate(r)}function x(r,o){return g().output.truncate(r,o)}function S(){return g()}var A=`
|
|
2
2
|
query GetVaults($filter: VaultFilterInput, $pagination: SecurityPaginationInput) {
|
|
3
3
|
getVaults(filter: $filter, pagination: $pagination) {
|
|
4
4
|
items { id name description scope status createdAt }
|
|
@@ -11,28 +11,34 @@
|
|
|
11
11
|
id name description scope scopeId status lockAfterMinutes createdAt updatedAt
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
14
|
+
`,b=`
|
|
15
15
|
mutation CreateVault($input: CreateVaultInput!) {
|
|
16
16
|
createVault(input: $input) {
|
|
17
17
|
id name scope scopeId status
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
`,R=`
|
|
21
|
+
mutation UpdateVault($id: ID!, $input: UpdateVaultInput!) {
|
|
22
|
+
updateVault(id: $id, input: $input) {
|
|
23
|
+
id name scope scopeId status
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`,$=`
|
|
21
27
|
mutation DeleteVault($id: ID!) {
|
|
22
28
|
deleteVault(id: $id)
|
|
23
29
|
}
|
|
24
|
-
|
|
30
|
+
`,O=`
|
|
25
31
|
mutation ArchiveVault($id: ID!) {
|
|
26
32
|
archiveVault(id: $id) { id status }
|
|
27
33
|
}
|
|
28
|
-
`,
|
|
34
|
+
`,D=`
|
|
29
35
|
query GetSecrets($vaultId: ID!, $filter: SecretFilterInput, $pagination: SecurityPaginationInput) {
|
|
30
36
|
getSecrets(vaultId: $vaultId, filter: $filter, pagination: $pagination) {
|
|
31
37
|
items { id key name description type status isEphemeral createdAt }
|
|
32
38
|
total hasMore
|
|
33
39
|
}
|
|
34
40
|
}
|
|
35
|
-
`,
|
|
41
|
+
`,L=`
|
|
36
42
|
query GetSecret($id: ID!) {
|
|
37
43
|
getSecret(id: $id) {
|
|
38
44
|
id key name description type status isEphemeral expiresAt createdAt updatedAt
|
|
@@ -44,7 +50,7 @@
|
|
|
44
50
|
id key value
|
|
45
51
|
}
|
|
46
52
|
}
|
|
47
|
-
`,
|
|
53
|
+
`,V=`
|
|
48
54
|
mutation CreateSecret($input: CreateSecretInput!) {
|
|
49
55
|
createSecret(input: $input) {
|
|
50
56
|
id key name type status
|
|
@@ -56,14 +62,14 @@
|
|
|
56
62
|
id key name status updatedAt
|
|
57
63
|
}
|
|
58
64
|
}
|
|
59
|
-
`,
|
|
65
|
+
`,_=`
|
|
60
66
|
mutation DeleteSecret($id: ID!) {
|
|
61
67
|
deleteSecret(id: $id)
|
|
62
68
|
}
|
|
63
|
-
`,
|
|
69
|
+
`,N=`
|
|
64
70
|
mutation RotateSecret($id: ID!, $newValue: String!) {
|
|
65
71
|
rotateSecret(id: $id, newValue: $newValue) {
|
|
66
72
|
id key updatedAt
|
|
67
73
|
}
|
|
68
74
|
}
|
|
69
|
-
`;function
|
|
75
|
+
`;function h(){let r=S().auth.read();if(!r?.workspaceId)throw new c("No workspace set. Run: vibecontrols workspace set <id>");return {workspaceId:r.workspaceId}}async function U(){if(process.stdin.isTTY)throw new c('Pipe the secret value via stdin (e.g. `echo -n "value" | vibecontrols security secrets set ...`).');let r=[];for await(let o of process.stdin)r.push(Buffer.isBuffer(o)?o:Buffer.from(o));return Buffer.concat(r).toString("utf8")}function G(r){let o=r.command("security").description("Security: vaults & secrets"),s=o.command("vaults").description("Vault management");s.command("list").description("List vaults").option("--scope <s>","WORKSPACE|GLOBAL|VIBE").option("--status <s>").option("--search <q>").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t={context:h()};e.scope&&(t.scope=e.scope.toUpperCase()),e.status&&(t.status=e.status.toUpperCase()),e.search&&(t.search=e.search);let n=await u(A,{filter:t,pagination:{limit:e.limit,offset:0}});l(e,n.getVaults.items,{headers:["ID","Name","Scope","Status","Created"],rows:n.getVaults.items.map(i=>[x(i.id,12),i.name,i.scope??"-",y(i.status),C(i.createdAt)])});}catch(t){p(t);}}),s.command("get").description("Get a vault").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await u(I,{id:e});if(!n.getVault)throw new c(`Vault ${e} not found`);l(t,n.getVault);}catch(n){p(n);}}),s.command("create").description("Create a vault").requiredOption("--name <name>").option("--description <s>").option("--scope <s>","WORKSPACE|GLOBAL|VIBE","WORKSPACE").option("--scope-id <id>","Scope id (defaults to current workspace)").option("--lock-after <minutes>","Auto-lock after N minutes",e=>parseInt(e,10)).option("-f, --format <format>").action(async e=>{try{let t=h(),n={context:t,name:e.name,description:e.description,scope:(e.scope??"WORKSPACE").toUpperCase(),scopeId:e.scopeId??t.workspaceId,lockAfterMinutes:e.lockAfter},i=await u(b,{input:n});d(`Vault created: ${i.createVault.name}`),l(e,i.createVault);}catch(t){p(t);}}),s.command("update").description("Update a vault").argument("<id>").option("--name <s>").option("--description <s>").option("--lock-after <minutes>","Auto-lock after N minutes",e=>parseInt(e,10)).option("-f, --format <format>").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),t.lockAfter!==void 0&&(n.lockAfterMinutes=t.lockAfter),!Object.keys(n).length)throw new c("No updates specified");let i=await u(R,{id:e,input:n});d("Vault updated"),l(t,i.updateVault);}catch(n){p(n);}}),s.command("delete").description("Delete a vault").argument("<id>").option("--archive","Archive instead of hard delete",false).action(async(e,t)=>{try{t.archive?(await u(O,{id:e}),d("Vault archived")):(await u($,{id:e}),d("Vault deleted"));}catch(n){p(n);}});let m=o.command("secrets").description("Secret management");m.command("list").description("List secrets in a vault").requiredOption("--vault <id>").option("--type <t>","Filter by secret type").option("--search <q>").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async e=>{try{let t={context:h()};e.type&&(t.type=e.type.toUpperCase()),e.search&&(t.search=e.search);let n=await u(D,{vaultId:e.vault,filter:t,pagination:{limit:e.limit,offset:0}});l(e,n.getSecrets.items,{headers:["ID","Key","Name","Type","Status","Created"],rows:n.getSecrets.items.map(i=>[x(i.id,12),i.key,i.name,i.type??"-",y(i.status),C(i.createdAt)])});}catch(t){p(t);}}),m.command("get").description("Get secret metadata (does NOT decrypt)").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await u(L,{id:e});if(!n.getSecret)throw new c(`Secret ${e} not found`);l(t,n.getSecret);}catch(n){p(n);}}),m.command("show").description("Decrypt and print a secret value (audited)").argument("<id>").action(async e=>{try{let t=await u(q,{id:e});process.stdout.write(t.decryptSecret.value);}catch(t){p(t);}}),m.command("set").description("Create a secret. Reads the value from stdin.").requiredOption("--vault <id>").requiredOption("--key <key>","Secret key (unique within vault)").requiredOption("--name <name>").option("--description <s>").option("--type <t>","API_KEY|PASSWORD|CERTIFICATE|TOKEN|OTHER","OTHER").option("--ephemeral","Mark as ephemeral").option("--expires <iso>").option("-f, --format <format>").action(async e=>{try{let t=await U(),n={context:h(),vaultId:e.vault,key:e.key,name:e.name,description:e.description,type:(e.type??"OTHER").toUpperCase(),isEphemeral:!!e.ephemeral,expiresAt:e.expires,value:t},i=await u(V,{input:n});d(`Secret created: ${i.createSecret.key}`),l(e,i.createSecret);}catch(t){p(t);}}),m.command("update").description("Update a secret. Pass --value via stdin to rotate.").argument("<id>").option("--name <s>").option("--description <s>").option("--rotate","Rotate value (reads new value from stdin)").option("--status <s>").option("-f, --format <format>").action(async(e,t)=>{try{if(t.rotate){let F=await U(),W=await u(N,{id:e,newValue:F});d("Secret rotated"),l(t,W.rotateSecret);return}let n={context:h()};if(t.name&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),t.status&&(n.status=t.status.toUpperCase()),Object.keys(n).length===1)throw new c("No updates specified (use --rotate to change value)");let i=await u(P,{id:e,input:n});d("Secret updated"),l(t,i.updateSecret);}catch(n){p(n);}}),m.command("delete").description("Delete a secret").argument("<id>").action(async e=>{try{await u(_,{id:e}),d("Secret deleted");}catch(t){p(t);}});}var ne={id:"security",version:"1.0.0",displayName:"Security",dependsOn:["auth","workspaces"],register(r,o){v(o),G(r);}},dt=ne;module.exports=dt;
|
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
import {a,b
|
|
1
|
+
import {a,b,g,o,m,n,f,h,r}from'../../chunk-KTKHJORN.js';import {o as o$1}from'../../chunk-RNWXATAC.js';var T=`
|
|
2
2
|
query GetVaults($filter: VaultFilterInput, $pagination: SecurityPaginationInput) {
|
|
3
3
|
getVaults(filter: $filter, pagination: $pagination) {
|
|
4
4
|
items { id name description scope status createdAt }
|
|
5
5
|
total hasMore
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
`,
|
|
8
|
+
`,A=`
|
|
9
9
|
query GetVault($id: ID!) {
|
|
10
10
|
getVault(id: $id) {
|
|
11
11
|
id name description scope scopeId status lockAfterMinutes createdAt updatedAt
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
14
|
+
`,C=`
|
|
15
15
|
mutation CreateVault($input: CreateVaultInput!) {
|
|
16
16
|
createVault(input: $input) {
|
|
17
17
|
id name scope scopeId status
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
`,
|
|
20
|
+
`,V=`
|
|
21
|
+
mutation UpdateVault($id: ID!, $input: UpdateVaultInput!) {
|
|
22
|
+
updateVault(id: $id, input: $input) {
|
|
23
|
+
id name scope scopeId status
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`,R=`
|
|
21
27
|
mutation DeleteVault($id: ID!) {
|
|
22
28
|
deleteVault(id: $id)
|
|
23
29
|
}
|
|
24
|
-
`,
|
|
30
|
+
`,I=`
|
|
25
31
|
mutation ArchiveVault($id: ID!) {
|
|
26
32
|
archiveVault(id: $id) { id status }
|
|
27
33
|
}
|
|
28
|
-
`,
|
|
34
|
+
`,k=`
|
|
29
35
|
query GetSecrets($vaultId: ID!, $filter: SecretFilterInput, $pagination: SecurityPaginationInput) {
|
|
30
36
|
getSecrets(vaultId: $vaultId, filter: $filter, pagination: $pagination) {
|
|
31
37
|
items { id key name description type status isEphemeral createdAt }
|
|
@@ -38,25 +44,25 @@ import {a,b as b$1,g,o,m as m$1,n,f,h,r}from'../../chunk-KTKHJORN.js';import {o
|
|
|
38
44
|
id key name description type status isEphemeral expiresAt createdAt updatedAt
|
|
39
45
|
}
|
|
40
46
|
}
|
|
41
|
-
|
|
47
|
+
`,$=`
|
|
42
48
|
query DecryptSecret($id: ID!) {
|
|
43
49
|
decryptSecret(id: $id) {
|
|
44
50
|
id key value
|
|
45
51
|
}
|
|
46
52
|
}
|
|
47
|
-
|
|
53
|
+
`,x=`
|
|
48
54
|
mutation CreateSecret($input: CreateSecretInput!) {
|
|
49
55
|
createSecret(input: $input) {
|
|
50
56
|
id key name type status
|
|
51
57
|
}
|
|
52
58
|
}
|
|
53
|
-
`,
|
|
59
|
+
`,D=`
|
|
54
60
|
mutation UpdateSecret($id: ID!, $input: UpdateSecretInput!) {
|
|
55
61
|
updateSecret(id: $id, input: $input) {
|
|
56
62
|
id key name status updatedAt
|
|
57
63
|
}
|
|
58
64
|
}
|
|
59
|
-
`,
|
|
65
|
+
`,U=`
|
|
60
66
|
mutation DeleteSecret($id: ID!) {
|
|
61
67
|
deleteSecret(id: $id)
|
|
62
68
|
}
|
|
@@ -66,4 +72,4 @@ import {a,b as b$1,g,o,m as m$1,n,f,h,r}from'../../chunk-KTKHJORN.js';import {o
|
|
|
66
72
|
id key updatedAt
|
|
67
73
|
}
|
|
68
74
|
}
|
|
69
|
-
`;function
|
|
75
|
+
`;function l(){let o=r().auth.read();if(!o?.workspaceId)throw new o$1("No workspace set. Run: vibecontrols workspace set <id>");return {workspaceId:o.workspaceId}}async function L(){if(process.stdin.isTTY)throw new o$1('Pipe the secret value via stdin (e.g. `echo -n "value" | vibecontrols security secrets set ...`).');let o=[];for await(let p of process.stdin)o.push(Buffer.isBuffer(p)?p:Buffer.from(p));return Buffer.concat(o).toString("utf8")}function O(o$2){let p=o$2.command("security").description("Security: vaults & secrets"),m$1=p.command("vaults").description("Vault management");m$1.command("list").description("List vaults").option("--scope <s>","WORKSPACE|GLOBAL|VIBE").option("--status <s>").option("--search <q>").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let e={context:l()};t.scope&&(e.scope=t.scope.toUpperCase()),t.status&&(e.status=t.status.toUpperCase()),t.search&&(e.search=t.search);let a=await b(T,{filter:e,pagination:{limit:t.limit,offset:0}});g(t,a.getVaults.items,{headers:["ID","Name","Scope","Status","Created"],rows:a.getVaults.items.map(r=>[o(r.id,12),r.name,r.scope??"-",m(r.status),n(r.createdAt)])});}catch(e){f(e);}}),m$1.command("get").description("Get a vault").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let a=await b(A,{id:t});if(!a.getVault)throw new o$1(`Vault ${t} not found`);g(e,a.getVault);}catch(a){f(a);}}),m$1.command("create").description("Create a vault").requiredOption("--name <name>").option("--description <s>").option("--scope <s>","WORKSPACE|GLOBAL|VIBE","WORKSPACE").option("--scope-id <id>","Scope id (defaults to current workspace)").option("--lock-after <minutes>","Auto-lock after N minutes",t=>parseInt(t,10)).option("-f, --format <format>").action(async t=>{try{let e=l(),a={context:e,name:t.name,description:t.description,scope:(t.scope??"WORKSPACE").toUpperCase(),scopeId:t.scopeId??e.workspaceId,lockAfterMinutes:t.lockAfter},r=await b(C,{input:a});h(`Vault created: ${r.createVault.name}`),g(t,r.createVault);}catch(e){f(e);}}),m$1.command("update").description("Update a vault").argument("<id>").option("--name <s>").option("--description <s>").option("--lock-after <minutes>","Auto-lock after N minutes",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,e)=>{try{let a={};if(e.name&&(a.name=e.name),e.description!==void 0&&(a.description=e.description),e.lockAfter!==void 0&&(a.lockAfterMinutes=e.lockAfter),!Object.keys(a).length)throw new o$1("No updates specified");let r=await b(V,{id:t,input:a});h("Vault updated"),g(e,r.updateVault);}catch(a){f(a);}}),m$1.command("delete").description("Delete a vault").argument("<id>").option("--archive","Archive instead of hard delete",false).action(async(t,e)=>{try{e.archive?(await b(I,{id:t}),h("Vault archived")):(await b(R,{id:t}),h("Vault deleted"));}catch(a){f(a);}});let u=p.command("secrets").description("Secret management");u.command("list").description("List secrets in a vault").requiredOption("--vault <id>").option("--type <t>","Filter by secret type").option("--search <q>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async t=>{try{let e={context:l()};t.type&&(e.type=t.type.toUpperCase()),t.search&&(e.search=t.search);let a=await b(k,{vaultId:t.vault,filter:e,pagination:{limit:t.limit,offset:0}});g(t,a.getSecrets.items,{headers:["ID","Key","Name","Type","Status","Created"],rows:a.getSecrets.items.map(r=>[o(r.id,12),r.key,r.name,r.type??"-",m(r.status),n(r.createdAt)])});}catch(e){f(e);}}),u.command("get").description("Get secret metadata (does NOT decrypt)").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let a=await b(v,{id:t});if(!a.getSecret)throw new o$1(`Secret ${t} not found`);g(e,a.getSecret);}catch(a){f(a);}}),u.command("show").description("Decrypt and print a secret value (audited)").argument("<id>").action(async t=>{try{let e=await b($,{id:t});process.stdout.write(e.decryptSecret.value);}catch(e){f(e);}}),u.command("set").description("Create a secret. Reads the value from stdin.").requiredOption("--vault <id>").requiredOption("--key <key>","Secret key (unique within vault)").requiredOption("--name <name>").option("--description <s>").option("--type <t>","API_KEY|PASSWORD|CERTIFICATE|TOKEN|OTHER","OTHER").option("--ephemeral","Mark as ephemeral").option("--expires <iso>").option("-f, --format <format>").action(async t=>{try{let e=await L(),a={context:l(),vaultId:t.vault,key:t.key,name:t.name,description:t.description,type:(t.type??"OTHER").toUpperCase(),isEphemeral:!!t.ephemeral,expiresAt:t.expires,value:e},r=await b(x,{input:a});h(`Secret created: ${r.createSecret.key}`),g(t,r.createSecret);}catch(e){f(e);}}),u.command("update").description("Update a secret. Pass --value via stdin to rotate.").argument("<id>").option("--name <s>").option("--description <s>").option("--rotate","Rotate value (reads new value from stdin)").option("--status <s>").option("-f, --format <format>").action(async(t,e)=>{try{if(e.rotate){let P=await L(),b$1=await b(_,{id:t,newValue:P});h("Secret rotated"),g(e,b$1.rotateSecret);return}let a={context:l()};if(e.name&&(a.name=e.name),e.description!==void 0&&(a.description=e.description),e.status&&(a.status=e.status.toUpperCase()),Object.keys(a).length===1)throw new o$1("No updates specified (use --rotate to change value)");let r=await b(D,{id:t,input:a});h("Secret updated"),g(e,r.updateSecret);}catch(a){f(a);}}),u.command("delete").description("Delete a secret").argument("<id>").action(async t=>{try{await b(U,{id:t}),h("Secret deleted");}catch(e){f(e);}});}var q={id:"security",version:"1.0.0",displayName:"Security",dependsOn:["auth","workspaces"],register(o,p){a(p),O(o);}},j=q;export{j as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/cli-sdk",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.525.1",
|
|
4
4
|
"description": "Modular CLI SDK shared across all Burdenoff product CLIs (vibecontrols, botlit, fluidgrids, bigconsole, healthybowl, devportal, workspaces). Each module exports CliModule contract; product CLIs become thin shells that pick which modules to mount.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"homepage": "https://github.com/algoshred/cli-sdk#readme",
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "restricted",
|
|
71
|
-
"registry": "https://
|
|
71
|
+
"registry": "https://registry.npmjs.org/"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"cross-fetch": "^4.1.0"
|