@burdenoff/cli-sdk 2026.504.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.
- package/README.md +60 -0
- package/dist/chunk-KTKHJORN.js +1 -0
- package/dist/chunk-MRONTCXQ.js +879 -0
- package/dist/chunk-RNWXATAC.js +32 -0
- package/dist/core/index.cjs +32 -0
- package/dist/core/index.d.cts +57 -0
- package/dist/core/index.d.ts +57 -0
- package/dist/core/index.js +1 -0
- package/dist/index.cjs +32 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1 -0
- package/dist/module-Bv5zhYt2.d.cts +166 -0
- package/dist/module-Bv5zhYt2.d.ts +166 -0
- package/dist/modules/auth/index.cjs +183 -0
- package/dist/modules/auth/index.d.cts +7 -0
- package/dist/modules/auth/index.d.ts +7 -0
- package/dist/modules/auth/index.js +160 -0
- package/dist/modules/billing/index.cjs +105 -0
- package/dist/modules/billing/index.d.cts +7 -0
- package/dist/modules/billing/index.d.ts +7 -0
- package/dist/modules/billing/index.js +105 -0
- package/dist/modules/channels/index.cjs +70 -0
- package/dist/modules/channels/index.d.cts +7 -0
- package/dist/modules/channels/index.d.ts +7 -0
- package/dist/modules/channels/index.js +70 -0
- package/dist/modules/conversations/index.cjs +37 -0
- package/dist/modules/conversations/index.d.cts +7 -0
- package/dist/modules/conversations/index.d.ts +7 -0
- package/dist/modules/conversations/index.js +37 -0
- package/dist/modules/devportal/index.cjs +133 -0
- package/dist/modules/devportal/index.d.cts +7 -0
- package/dist/modules/devportal/index.d.ts +7 -0
- package/dist/modules/devportal/index.js +133 -0
- package/dist/modules/export/index.cjs +37 -0
- package/dist/modules/export/index.d.cts +7 -0
- package/dist/modules/export/index.d.ts +7 -0
- package/dist/modules/export/index.js +37 -0
- package/dist/modules/files/index.cjs +49 -0
- package/dist/modules/files/index.d.cts +7 -0
- package/dist/modules/files/index.d.ts +7 -0
- package/dist/modules/files/index.js +49 -0
- package/dist/modules/groups/index.cjs +67 -0
- package/dist/modules/groups/index.d.cts +7 -0
- package/dist/modules/groups/index.d.ts +7 -0
- package/dist/modules/groups/index.js +67 -0
- package/dist/modules/health/index.cjs +1 -0
- package/dist/modules/health/index.d.cts +7 -0
- package/dist/modules/health/index.d.ts +7 -0
- package/dist/modules/health/index.js +1 -0
- package/dist/modules/integrations/index.cjs +44 -0
- package/dist/modules/integrations/index.d.cts +7 -0
- package/dist/modules/integrations/index.d.ts +7 -0
- package/dist/modules/integrations/index.js +44 -0
- package/dist/modules/notifications/index.cjs +26 -0
- package/dist/modules/notifications/index.d.cts +7 -0
- package/dist/modules/notifications/index.d.ts +7 -0
- package/dist/modules/notifications/index.js +26 -0
- package/dist/modules/organizations/index.cjs +53 -0
- package/dist/modules/organizations/index.d.cts +7 -0
- package/dist/modules/organizations/index.d.ts +7 -0
- package/dist/modules/organizations/index.js +53 -0
- package/dist/modules/products/index.cjs +102 -0
- package/dist/modules/products/index.d.cts +7 -0
- package/dist/modules/products/index.d.ts +7 -0
- package/dist/modules/products/index.js +102 -0
- package/dist/modules/rbac/index.cjs +63 -0
- package/dist/modules/rbac/index.d.cts +7 -0
- package/dist/modules/rbac/index.d.ts +7 -0
- package/dist/modules/rbac/index.js +63 -0
- package/dist/modules/sandbox/index.cjs +33 -0
- package/dist/modules/sandbox/index.d.cts +7 -0
- package/dist/modules/sandbox/index.d.ts +7 -0
- package/dist/modules/sandbox/index.js +1 -0
- package/dist/modules/scheduler/index.cjs +32 -0
- package/dist/modules/scheduler/index.d.cts +7 -0
- package/dist/modules/scheduler/index.d.ts +7 -0
- package/dist/modules/scheduler/index.js +32 -0
- package/dist/modules/security/index.cjs +69 -0
- package/dist/modules/security/index.d.cts +7 -0
- package/dist/modules/security/index.d.ts +7 -0
- package/dist/modules/security/index.js +69 -0
- package/dist/modules/store/index.cjs +63 -0
- package/dist/modules/store/index.d.cts +7 -0
- package/dist/modules/store/index.d.ts +7 -0
- package/dist/modules/store/index.js +63 -0
- package/dist/modules/support/index.cjs +45 -0
- package/dist/modules/support/index.d.cts +7 -0
- package/dist/modules/support/index.d.ts +7 -0
- package/dist/modules/support/index.js +45 -0
- package/dist/modules/tags/index.cjs +54 -0
- package/dist/modules/tags/index.d.cts +7 -0
- package/dist/modules/tags/index.d.ts +7 -0
- package/dist/modules/tags/index.js +54 -0
- package/dist/modules/tours/index.cjs +48 -0
- package/dist/modules/tours/index.d.cts +7 -0
- package/dist/modules/tours/index.d.ts +7 -0
- package/dist/modules/tours/index.js +48 -0
- package/dist/modules/vibecontrols/index.cjs +844 -0
- package/dist/modules/vibecontrols/index.d.cts +7 -0
- package/dist/modules/vibecontrols/index.d.ts +7 -0
- package/dist/modules/vibecontrols/index.js +2 -0
- package/dist/modules/workspaces/index.cjs +90 -0
- package/dist/modules/workspaces/index.d.cts +7 -0
- package/dist/modules/workspaces/index.d.ts +7 -0
- package/dist/modules/workspaces/index.js +77 -0
- package/package.json +104 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {a,b,g,o,m,f,h as h$1,n}from'../../chunk-KTKHJORN.js';import {o as o$1}from'../../chunk-RNWXATAC.js';var l=`
|
|
2
|
+
query ListGroups($filter: GroupFilter, $first: Int, $after: String, $sort: GroupSort) {
|
|
3
|
+
groups(filter: $filter, first: $first, after: $after, sort: $sort) {
|
|
4
|
+
edges { node { id name groupType visibility status memberCount createdAt } }
|
|
5
|
+
pageInfo { hasNextPage endCursor }
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
`,E=`
|
|
9
|
+
query GetGroup($id: ID!) {
|
|
10
|
+
group(id: $id) {
|
|
11
|
+
id name description groupType visibility status scope membershipType memberCount createdAt updatedAt
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
`,R=`
|
|
15
|
+
mutation CreateGroup($input: CreateGroupInput!) {
|
|
16
|
+
createGroup(input: $input) {
|
|
17
|
+
id name groupType visibility status
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`,T=`
|
|
21
|
+
mutation UpdateGroup($id: ID!, $input: UpdateGroupInput!) {
|
|
22
|
+
updateGroup(id: $id, input: $input) {
|
|
23
|
+
id name description visibility status updatedAt
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`,A=`
|
|
27
|
+
mutation DeleteGroup($id: ID!) {
|
|
28
|
+
deleteGroup(id: $id)
|
|
29
|
+
}
|
|
30
|
+
`,U=`
|
|
31
|
+
mutation ArchiveGroup($id: ID!) {
|
|
32
|
+
archiveGroup(id: $id) { id status }
|
|
33
|
+
}
|
|
34
|
+
`,C=`
|
|
35
|
+
query ListGroupMembers($groupId: ID!, $first: Int, $after: String) {
|
|
36
|
+
groupMembers(groupId: $groupId, first: $first, after: $after) {
|
|
37
|
+
edges { node { id entityId entityType role invitationStatus joinedAt } }
|
|
38
|
+
pageInfo { hasNextPage endCursor }
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`,h=`
|
|
42
|
+
mutation AddGroupMembers($groupId: ID!, $members: [AddMemberInput!]!) {
|
|
43
|
+
addGroupMembers(groupId: $groupId, members: $members) {
|
|
44
|
+
added { id entityId entityType role invitationStatus }
|
|
45
|
+
skipped
|
|
46
|
+
failed
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
`,O=`
|
|
50
|
+
mutation RemoveGroupMembers($groupId: ID!, $membershipIds: [ID!]!) {
|
|
51
|
+
removeGroupMembers(groupId: $groupId, membershipIds: $membershipIds) {
|
|
52
|
+
removed
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
`,$=`
|
|
56
|
+
query GroupAuditLogs($groupId: ID!, $first: Int, $after: String) {
|
|
57
|
+
groupAuditLogs(groupId: $groupId, first: $first, after: $after) {
|
|
58
|
+
id action actorId summary createdAt
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`,M=`
|
|
62
|
+
query EntityGroups($entityId: ID!, $entityType: GroupEntityType!, $first: Int) {
|
|
63
|
+
entityGroups(entityId: $entityId, entityType: $entityType, first: $first) {
|
|
64
|
+
edges { node { id name groupType visibility memberCount } }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
`;function P(u){let n$1=u.command("groups").description("Group management");n$1.command("list").description("List groups").option("--type <t>","Filter by groupType").option("--status <s>","Filter by status").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let e={};t.type&&(e.groupType=t.type.toUpperCase()),t.status&&(e.status=t.status.toUpperCase());let p=(await b(l,{filter:Object.keys(e).length?e:void 0,first:t.limit})).groups.edges.map(i=>i.node);g(t,p,{headers:["ID","Name","Type","Visibility","Status","Members"],rows:p.map(i=>[o(i.id,12),i.name,i.groupType??"-",i.visibility??"-",m(i.status),String(i.memberCount??0)])});}catch(e){f(e);}}),n$1.command("get").description("Get a group by id").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let r=await b(E,{id:t});if(!r.group)throw new o$1(`Group ${t} not found`);g(e,r.group);}catch(r){f(r);}}),n$1.command("create").description("Create a group").requiredOption("--name <name>").option("--description <s>").option("--type <t>","AUDIENCE|BETA_PROGRAM|CHANNEL_GROUP|CUSTOM|DYNAMIC_AUDIENCE|FEATURE_FLAG_GROUP|PROJECT_GROUP|RESOURCE_COLLECTION|SECURITY_GROUP|TEAM","TEAM").option("--visibility <v>","PUBLIC|PRIVATE|HIDDEN","PRIVATE").option("--scope <s>","WORKSPACE|ORGANIZATION","WORKSPACE").option("--membership <m>","STATIC|DYNAMIC|HYBRID","STATIC").option("-f, --format <format>").action(async t=>{try{let e={name:t.name,description:t.description,groupType:(t.type??"TEAM").toUpperCase(),visibility:(t.visibility??"PRIVATE").toUpperCase(),scope:(t.scope??"WORKSPACE").toUpperCase(),membershipType:(t.membership??"STATIC").toUpperCase()},r=await b(R,{input:e});h$1(`Group created: ${r.createGroup.name}`),g(t,r.createGroup);}catch(e){f(e);}}),n$1.command("update").description("Update a group").argument("<id>").option("--name <s>").option("--description <s>").option("--visibility <v>").option("--status <s>").option("-f, --format <format>").action(async(t,e)=>{try{let r={};if(e.name&&(r.name=e.name),e.description!==void 0&&(r.description=e.description),e.visibility&&(r.visibility=e.visibility.toUpperCase()),e.status&&(r.status=e.status.toUpperCase()),!Object.keys(r).length)throw new o$1("No updates specified");let p=await b(T,{id:t,input:r});h$1("Group updated"),g(e,p.updateGroup);}catch(r){f(r);}}),n$1.command("delete").description("Delete a group (use --archive for soft delete)").argument("<id>").option("--archive","Archive instead of hard delete",false).action(async(t,e)=>{try{e.archive?(await b(U,{id:t}),h$1("Group archived")):(await b(A,{id:t}),h$1("Group deleted"));}catch(r){f(r);}});let c=n$1.command("members").description("Group membership");c.command("list").description("List members of a group").argument("<groupId>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,e)=>{try{let p=(await b(C,{groupId:t,first:e.limit})).groupMembers.edges.map(i=>i.node);g(e,p,{headers:["MembershipID","Entity","Type","Role","Status","Joined"],rows:p.map(i=>[o(i.id,12),o(i.entityId,12),i.entityType??"-",i.role??"-",m(i.invitationStatus),n(i.joinedAt)])});}catch(r){f(r);}}),c.command("add").description("Add a member to a group").requiredOption("--group <id>").requiredOption("--entity <id>").option("--entity-type <t>","USER|GROUP|BOT|INTEGRATION","USER").option("--role <r>","MEMBER|OWNER|ADMIN","MEMBER").option("-f, --format <format>").action(async t=>{try{let e={entityId:t.entity,entityType:(t.entityType??"USER").toUpperCase(),role:(t.role??"MEMBER").toUpperCase()},r=await b(h,{groupId:t.group,members:[e]});h$1(`Added ${r.addGroupMembers.added} member(s)`),g(t,r.addGroupMembers.memberships);}catch(e){f(e);}}),c.command("remove").description("Remove members by membership id").requiredOption("--group <id>").requiredOption("--membership <ids>","Comma-separated membership ids").action(async t=>{try{let e=t.membership.split(",").filter(Boolean);await b(O,{groupId:t.group,membershipIds:e}),h$1(`Removed ${e.length} membership(s)`);}catch(e){f(e);}}),n$1.command("hierarchy").description("Show entity-group hierarchy for a user/entity").argument("<entityId>").option("--type <t>","USER|GROUP","USER").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,e)=>{try{let r=await b(M,{entityId:t,entityType:(e.type??"USER").toUpperCase(),first:e.limit});g(e,r.entityGroups.edges.map(p=>p.node));}catch(r){f(r);}}),n$1.command("activity").description("Audit log for a group").argument("<groupId>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,e)=>{try{let r=await b($,{groupId:t,first:e.limit});g(e,r.groupAuditLogs);}catch(r){f(r);}});}var v={id:"groups",version:"1.0.0",displayName:"Groups",dependsOn:["auth","workspaces"],register(u,n){a(n),P(u);}},B=v;export{B as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var r={id:"health",version:"1.0.0",displayName:"Health",register(e,o){let n=e.command("health").description("CLI health checks");n.command("ping").description('Print "pong" to stdout (no backend call).').action(()=>{o.output.printSuccess("pong");}),n.command("context").description("Print SDK context: product name, env, config dir, endpoints.").option("-f, --format <format>","Output format (json, table, yaml)").action(i=>{let t=o.config.read();o.output.formatAndOutput(i,{productName:o.productName,productVersion:o.productVersion,env:o.env,configDir:o.config.dir(),workspaceEndpoint:t.workspaceEndpoint,globalEndpoint:t.globalEndpoint,authenticated:o.auth.isAuthenticated()},{headers:["Field","Value"],rows:[["productName",o.productName],["productVersion",o.productVersion],["env",o.env],["configDir",o.config.dir()],["workspaceEndpoint",t.workspaceEndpoint],["globalEndpoint",t.globalEndpoint],["authenticated",String(o.auth.isAuthenticated())]]});});}},d=r;module.exports=d;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r={id:"health",version:"1.0.0",displayName:"Health",register(e,o){let n=e.command("health").description("CLI health checks");n.command("ping").description('Print "pong" to stdout (no backend call).').action(()=>{o.output.printSuccess("pong");}),n.command("context").description("Print SDK context: product name, env, config dir, endpoints.").option("-f, --format <format>","Output format (json, table, yaml)").action(i=>{let t=o.config.read();o.output.formatAndOutput(i,{productName:o.productName,productVersion:o.productVersion,env:o.env,configDir:o.config.dir(),workspaceEndpoint:t.workspaceEndpoint,globalEndpoint:t.globalEndpoint,authenticated:o.auth.isAuthenticated()},{headers:["Field","Value"],rows:[["productName",o.productName],["productVersion",o.productVersion],["env",o.env],["configDir",o.config.dir()],["workspaceEndpoint",t.workspaceEndpoint],["globalEndpoint",t.globalEndpoint],["authenticated",String(o.auth.isAuthenticated())]]});});}},p=r;export{p as default};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var c=class extends Error{exitCode;hint;constructor(o,a){super(o),this.name="CliUserError",this.exitCode=a?.exitCode??1,this.hint=a?.hint;}},f=class extends c{constructor(o,a){super(o,{exitCode:2,hint:a?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},l=class extends Error{cause;constructor(o,a){super(o),this.name="CliInternalError",this.cause=a;}};var h=null;function y(n){h=n;}function d(){if(!h)throw new l("vibecontrols module helpers used before setHelpersContext was called");return h}function V(){let n=d();if(!n.auth.isAuthenticated())throw new f(`Authentication required. Run \`${n.productName} auth login\`.`)}async function u(n,o){return V(),d().gql.workspace.request(n,o)}function p(n){let o=n instanceof Error?n.message:String(n);throw new c(o)}function g(n,o,a){d().output.formatAndOutput(n,o,a);}function w(n){d().output.printSuccess(n);}function v(n){return d().output.formatStatus(n)}function I(n){return d().output.formatDate(n)}function C(n,o){return d().output.truncate(n,o)}var T=`
|
|
2
|
+
query GetProviders($filter: ProviderFilterInput, $pagination: IntegrationsPaginationInput) {
|
|
3
|
+
getProviders(filter: $filter, pagination: $pagination) {
|
|
4
|
+
items { id key name category authType isEnabled }
|
|
5
|
+
total hasMore
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
`,b=`
|
|
9
|
+
query GetProvider($id: ID!) {
|
|
10
|
+
getProvider(id: $id) {
|
|
11
|
+
id key name authType category connectionCount
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
`,E=`
|
|
15
|
+
query GetConnections($filter: ConnectionFilterInput, $pagination: IntegrationsPaginationInput) {
|
|
16
|
+
getConnections(filter: $filter, pagination: $pagination) {
|
|
17
|
+
items { id name providerId status grantedScopes }
|
|
18
|
+
total hasMore
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`,A=`
|
|
22
|
+
query GetConnection($id: ID!) {
|
|
23
|
+
getConnection(id: $id) {
|
|
24
|
+
id name providerId status externalAccountEmail credentialSource
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
`,S=`
|
|
28
|
+
mutation CreateConnection($input: CreateConnectionInput!) {
|
|
29
|
+
createConnection(input: $input) {
|
|
30
|
+
id name status providerId
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`,O=`
|
|
34
|
+
mutation DeleteConnection($id: ID!, $deleteVaultSecret: Boolean) {
|
|
35
|
+
deleteConnection(id: $id, deleteVaultSecret: $deleteVaultSecret)
|
|
36
|
+
}
|
|
37
|
+
`,R=`
|
|
38
|
+
query GetIntegrationLogs($filter: LogFilterInput, $pagination: IntegrationsPaginationInput) {
|
|
39
|
+
getIntegrationLogs(filter: $filter, pagination: $pagination) {
|
|
40
|
+
items { id action level message createdAt }
|
|
41
|
+
total hasMore
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
`;function $(n){let o=n.command("integrations").description("Integration providers, connections, and logs"),a=o.command("providers").description("Available providers");a.command("list").description("List integration providers").option("--category <c>").option("--enabled").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async e=>{try{let t={};e.category&&(t.category=e.category.toUpperCase()),e.enabled!==void 0&&(t.isEnabled=e.enabled);let r=await u(T,{filter:Object.keys(t).length?t:void 0,pagination:{limit:e.limit,offset:0}});g(e,r.getProviders.items,{headers:["ID","Key","Name","Category","Auth","Enabled"],rows:r.getProviders.items.map(i=>[C(i.id,12),i.key,i.name,i.category??"-",i.authType??"-",String(!!i.isEnabled)])});}catch(t){p(t);}}),a.command("get").description("Get a provider").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let r=await u(b,{id:e});if(!r.getProvider)throw new c(`Provider ${e} not found`);g(t,r.getProvider);}catch(r){p(r);}});let m=o.command("connections").description("Provider connections (OAuth + credential)");m.command("list").description("List connections").option("--provider <id>").option("--status <s>").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async e=>{try{let t={};e.provider&&(t.providerId=e.provider),e.status&&(t.status=e.status.toUpperCase());let r=await u(E,{filter:Object.keys(t).length?t:void 0,pagination:{limit:e.limit,offset:0}});g(e,r.getConnections.items,{headers:["ID","Name","Provider","Status"],rows:r.getConnections.items.map(i=>[C(i.id,12),i.name,C(i.providerId,12),v(i.status)])});}catch(t){p(t);}}),m.command("get").description("Get a connection").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let r=await u(A,{id:e});if(!r.getConnection)throw new c(`Connection ${e} not found`);g(t,r.getConnection);}catch(r){p(r);}}),m.command("add").description("Create a connection (provider id required; credentials stored in vault)").requiredOption("--name <name>").requiredOption("--provider <id>").option("--scopes <s>","Comma-separated scopes").option("-f, --format <format>").action(async e=>{try{let t={name:e.name,providerId:e.provider,grantedScopes:e.scopes?e.scopes.split(","):void 0},r=await u(S,{input:t});w("Connection created"),g(e,r.createConnection);}catch(t){p(t);}}),m.command("delete").description("Delete a connection").argument("<id>").option("--keep-secret","Keep vault secret",false).action(async(e,t)=>{try{await u(O,{id:e,deleteVaultSecret:!t.keepSecret}),w("Connection deleted");}catch(r){p(r);}}),o.command("logs").description("Integration audit logs").option("--connection <id>").option("--level <l>","INFO|WARN|ERROR").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async e=>{try{let t={};e.connection&&(t.connectionId=e.connection),e.level&&(t.level=e.level.toUpperCase());let r=await u(R,{filter:Object.keys(t).length?t:void 0,pagination:{limit:e.limit,offset:0}});g(e,r.getIntegrationLogs.items,{headers:["When","Action","Level","Message"],rows:r.getIntegrationLogs.items.map(i=>[I(i.createdAt),i.action,i.level,i.message])});}catch(t){p(t);}});}var z={id:"integrations",version:"1.0.0",displayName:"Integrations",dependsOn:["auth","workspaces"],register(n,o){y(o),$(n);}},tt=z;module.exports=tt;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {a,b,g,o,f,m,h as h$1,n}from'../../chunk-KTKHJORN.js';import {o as o$1}from'../../chunk-RNWXATAC.js';var y=`
|
|
2
|
+
query GetProviders($filter: ProviderFilterInput, $pagination: IntegrationsPaginationInput) {
|
|
3
|
+
getProviders(filter: $filter, pagination: $pagination) {
|
|
4
|
+
items { id key name category authType isEnabled }
|
|
5
|
+
total hasMore
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
`,E=`
|
|
9
|
+
query GetProvider($id: ID!) {
|
|
10
|
+
getProvider(id: $id) {
|
|
11
|
+
id key name authType category connectionCount
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
`,O=`
|
|
15
|
+
query GetConnections($filter: ConnectionFilterInput, $pagination: IntegrationsPaginationInput) {
|
|
16
|
+
getConnections(filter: $filter, pagination: $pagination) {
|
|
17
|
+
items { id name providerId status grantedScopes }
|
|
18
|
+
total hasMore
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`,N=`
|
|
22
|
+
query GetConnection($id: ID!) {
|
|
23
|
+
getConnection(id: $id) {
|
|
24
|
+
id name providerId status externalAccountEmail credentialSource
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
`,T=`
|
|
28
|
+
mutation CreateConnection($input: CreateConnectionInput!) {
|
|
29
|
+
createConnection(input: $input) {
|
|
30
|
+
id name status providerId
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`,h=`
|
|
34
|
+
mutation DeleteConnection($id: ID!, $deleteVaultSecret: Boolean) {
|
|
35
|
+
deleteConnection(id: $id, deleteVaultSecret: $deleteVaultSecret)
|
|
36
|
+
}
|
|
37
|
+
`,P=`
|
|
38
|
+
query GetIntegrationLogs($filter: LogFilterInput, $pagination: IntegrationsPaginationInput) {
|
|
39
|
+
getIntegrationLogs(filter: $filter, pagination: $pagination) {
|
|
40
|
+
items { id action level message createdAt }
|
|
41
|
+
total hasMore
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
`;function R(m$1){let s=m$1.command("integrations").description("Integration providers, connections, and logs"),l=s.command("providers").description("Available providers");l.command("list").description("List integration providers").option("--category <c>").option("--enabled").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async t=>{try{let e={};t.category&&(e.category=t.category.toUpperCase()),t.enabled!==void 0&&(e.isEnabled=t.enabled);let n=await b(y,{filter:Object.keys(e).length?e:void 0,pagination:{limit:t.limit,offset:0}});g(t,n.getProviders.items,{headers:["ID","Key","Name","Category","Auth","Enabled"],rows:n.getProviders.items.map(o$1=>[o(o$1.id,12),o$1.key,o$1.name,o$1.category??"-",o$1.authType??"-",String(!!o$1.isEnabled)])});}catch(e){f(e);}}),l.command("get").description("Get a provider").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await b(E,{id:t});if(!n.getProvider)throw new o$1(`Provider ${t} not found`);g(e,n.getProvider);}catch(n){f(n);}});let c=s.command("connections").description("Provider connections (OAuth + credential)");c.command("list").description("List connections").option("--provider <id>").option("--status <s>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async t=>{try{let e={};t.provider&&(e.providerId=t.provider),t.status&&(e.status=t.status.toUpperCase());let n=await b(O,{filter:Object.keys(e).length?e:void 0,pagination:{limit:t.limit,offset:0}});g(t,n.getConnections.items,{headers:["ID","Name","Provider","Status"],rows:n.getConnections.items.map(o$1=>[o(o$1.id,12),o$1.name,o(o$1.providerId,12),m(o$1.status)])});}catch(e){f(e);}}),c.command("get").description("Get a connection").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await b(N,{id:t});if(!n.getConnection)throw new o$1(`Connection ${t} not found`);g(e,n.getConnection);}catch(n){f(n);}}),c.command("add").description("Create a connection (provider id required; credentials stored in vault)").requiredOption("--name <name>").requiredOption("--provider <id>").option("--scopes <s>","Comma-separated scopes").option("-f, --format <format>").action(async t=>{try{let e={name:t.name,providerId:t.provider,grantedScopes:t.scopes?t.scopes.split(","):void 0},n=await b(T,{input:e});h$1("Connection created"),g(t,n.createConnection);}catch(e){f(e);}}),c.command("delete").description("Delete a connection").argument("<id>").option("--keep-secret","Keep vault secret",false).action(async(t,e)=>{try{await b(h,{id:t,deleteVaultSecret:!e.keepSecret}),h$1("Connection deleted");}catch(n){f(n);}}),s.command("logs").description("Integration audit logs").option("--connection <id>").option("--level <l>","INFO|WARN|ERROR").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async t=>{try{let e={};t.connection&&(e.connectionId=t.connection),t.level&&(e.level=t.level.toUpperCase());let n$1=await b(P,{filter:Object.keys(e).length?e:void 0,pagination:{limit:t.limit,offset:0}});g(t,n$1.getIntegrationLogs.items,{headers:["When","Action","Level","Message"],rows:n$1.getIntegrationLogs.items.map(o=>[n(o.createdAt),o.action,o.level,o.message])});}catch(e){f(e);}});}var $={id:"integrations",version:"1.0.0",displayName:"Integrations",dependsOn:["auth","workspaces"],register(m,s){a(s),R(m);}},A=$;export{A as default};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var u=class extends Error{exitCode;hint;constructor(n,i){super(n),this.name="CliUserError",this.exitCode=i?.exitCode??1,this.hint=i?.hint;}};var a=class extends Error{cause;constructor(n,i){super(n),this.name="CliInternalError",this.cause=i;}};var m=null;function b(e){m=e;}function c(){if(!m)throw new a("vibecontrols module helpers used before setHelpersContext was called");return m}async function d(e,n){return c().gql.global.request(e,n)}function f(e){let n=e instanceof Error?e.message:String(e);throw new u(n)}function h(e,n,i){c().output.formatAndOutput(e,n,i);}function C(e){c().output.printSuccess(e);}function T(e){return c().output.formatStatus(e)}function E(e){return c().output.formatDate(e)}function g(e,n){return c().output.truncate(e,n)}function w(){return c()}var A=`
|
|
2
|
+
query ListNotifications($filter: NotificationFilterInput, $limit: Int, $offset: Int) {
|
|
3
|
+
notifications(filter: $filter, limit: $limit, offset: $offset) {
|
|
4
|
+
items { id title message channel status isRead createdAt }
|
|
5
|
+
total
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
`,v=`
|
|
9
|
+
mutation MarkNotificationRead($id: ID!) {
|
|
10
|
+
markNotificationAsRead(id: $id) {
|
|
11
|
+
id isRead readAt
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
`,S=`
|
|
15
|
+
query NotificationPreferences($filter: NotificationPreferenceFilterInput, $limit: Int) {
|
|
16
|
+
notificationPreferences(filter: $filter, limit: $limit) {
|
|
17
|
+
items { id channel enabled frequency scope topicId userId }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`,O=`
|
|
21
|
+
mutation CreateNotificationPreference($input: CreateNotificationPreferenceInput!) {
|
|
22
|
+
createNotificationPreference(input: $input) {
|
|
23
|
+
id channel enabled frequency
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`;function R(e){let n=e.command("notifications").description("Notification inbox & preferences");n.command("list").description("List the current user's notifications").option("--unread","Only unread").option("--channel <c>","Filter by channel").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let r={};t.unread&&(r.isRead=!1),t.channel&&(r.channel=t.channel.toUpperCase());let l=await d(A,{filter:Object.keys(r).length?r:void 0,limit:t.limit,offset:0});h(t,l.notifications.items,{headers:["ID","Title","Channel","Status","Read","When"],rows:l.notifications.items.map(s=>[g(s.id,12),g(s.title??"-",40),s.channel??"-",T(s.status),String(!!s.isRead),E(s.createdAt)])});}catch(r){f(r);}}),n.command("read").description("Mark a notification as read").argument("<id>").action(async t=>{try{await d(v,{id:t}),C("Notification marked read");}catch(r){f(r);}});let i=n.command("preferences").description("Notification preferences");i.command("get").description("Show current user's notification preferences").option("--user <id>","Override user id").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async t=>{try{let r=w().auth.read(),l=t.user??r?.workspaceId??"",s=l?{userId:l}:{},k=await d(S,{filter:Object.keys(s).length?s:void 0,limit:t.limit});h(t,k.notificationPreferences.items,{headers:["ID","Channel","Enabled","Frequency","Scope"],rows:k.notificationPreferences.items.map(p=>[g(p.id,12),p.channel,String(p.enabled),p.frequency??"-",p.scope??"-"])});}catch(r){f(r);}}),i.command("set").description("Set a notification preference").requiredOption("--channel <c>","EMAIL|SMS|IN_APP|PUSH|WEBHOOK").requiredOption("--enabled <bool>","true or false").option("--frequency <f>","IMMEDIATE|HOURLY|DAILY|WEEKLY","IMMEDIATE").option("--scope <s>","GLOBAL|WORKSPACE|VIBE","GLOBAL").option("--topic <id>").option("--user <id>").action(async t=>{try{let r={channel:t.channel.toUpperCase(),enabled:t.enabled==="true",frequency:(t.frequency??"IMMEDIATE").toUpperCase(),scope:(t.scope??"GLOBAL").toUpperCase(),topicId:t.topic,userId:t.user??w().auth.read()?.workspaceId};await d(O,{input:r}),C("Preference saved");}catch(r){f(r);}});}var U={id:"notifications",version:"1.0.0",displayName:"Notifications",dependsOn:["auth"],register(e,n){b(n),R(e);}},Ze=U;module.exports=Ze;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {a,c,g,o,m,n,f,h as h$1,r}from'../../chunk-KTKHJORN.js';import'../../chunk-RNWXATAC.js';var h=`
|
|
2
|
+
query ListNotifications($filter: NotificationFilterInput, $limit: Int, $offset: Int) {
|
|
3
|
+
notifications(filter: $filter, limit: $limit, offset: $offset) {
|
|
4
|
+
items { id title message channel status isRead createdAt }
|
|
5
|
+
total
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
`,O=`
|
|
9
|
+
mutation MarkNotificationRead($id: ID!) {
|
|
10
|
+
markNotificationAsRead(id: $id) {
|
|
11
|
+
id isRead readAt
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
`,R=`
|
|
15
|
+
query NotificationPreferences($filter: NotificationPreferenceFilterInput, $limit: Int) {
|
|
16
|
+
notificationPreferences(filter: $filter, limit: $limit) {
|
|
17
|
+
items { id channel enabled frequency scope topicId userId }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`,A=`
|
|
21
|
+
mutation CreateNotificationPreference($input: CreateNotificationPreferenceInput!) {
|
|
22
|
+
createNotificationPreference(input: $input) {
|
|
23
|
+
id channel enabled frequency
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`;function y(f$1){let n$1=f$1.command("notifications").description("Notification inbox & preferences");n$1.command("list").description("List the current user's notifications").option("--unread","Only unread").option("--channel <c>","Filter by channel").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t={};e.unread&&(t.isRead=!1),e.channel&&(t.channel=e.channel.toUpperCase());let o$1=await c(h,{filter:Object.keys(t).length?t:void 0,limit:e.limit,offset:0});g(e,o$1.notifications.items,{headers:["ID","Title","Channel","Status","Read","When"],rows:o$1.notifications.items.map(i=>[o(i.id,12),o(i.title??"-",40),i.channel??"-",m(i.status),String(!!i.isRead),n(i.createdAt)])});}catch(t){f(t);}}),n$1.command("read").description("Mark a notification as read").argument("<id>").action(async e=>{try{await c(O,{id:e}),h$1("Notification marked read");}catch(t){f(t);}});let p=n$1.command("preferences").description("Notification preferences");p.command("get").description("Show current user's notification preferences").option("--user <id>","Override user id").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async e=>{try{let t=r().auth.read(),o$1=e.user??t?.workspaceId??"",i=o$1?{userId:o$1}:{},u=await c(R,{filter:Object.keys(i).length?i:void 0,limit:e.limit});g(e,u.notificationPreferences.items,{headers:["ID","Channel","Enabled","Frequency","Scope"],rows:u.notificationPreferences.items.map(r=>[o(r.id,12),r.channel,String(r.enabled),r.frequency??"-",r.scope??"-"])});}catch(t){f(t);}}),p.command("set").description("Set a notification preference").requiredOption("--channel <c>","EMAIL|SMS|IN_APP|PUSH|WEBHOOK").requiredOption("--enabled <bool>","true or false").option("--frequency <f>","IMMEDIATE|HOURLY|DAILY|WEEKLY","IMMEDIATE").option("--scope <s>","GLOBAL|WORKSPACE|VIBE","GLOBAL").option("--topic <id>").option("--user <id>").action(async e=>{try{let t={channel:e.channel.toUpperCase(),enabled:e.enabled==="true",frequency:(e.frequency??"IMMEDIATE").toUpperCase(),scope:(e.scope??"GLOBAL").toUpperCase(),topicId:e.topic,userId:e.user??r().auth.read()?.workspaceId};await c(A,{input:t}),h$1("Preference saved");}catch(t){f(t);}});}var P={id:"notifications",version:"1.0.0",displayName:"Notifications",dependsOn:["auth"],register(f,n){a(n),y(f);}},x=P;export{x as default};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var c=class extends Error{exitCode;hint;constructor(t,s){super(t),this.name="CliUserError",this.exitCode=s?.exitCode??1,this.hint=s?.hint;}};var a=class extends Error{cause;constructor(t,s){super(t),this.name="CliInternalError",this.cause=s;}};var g=null;function y(e){g=e;}function u(){if(!g)throw new a("vibecontrols module helpers used before setHelpersContext was called");return g}async function p(e,t){return u().gql.global.request(e,t)}function l(e){let t=e instanceof Error?e.message:String(e);throw new c(t)}function f(e,t,s){u().output.formatAndOutput(e,t,s);}function m(e){u().output.printSuccess(e);}function h(e){return u().output.formatStatus(e)}function w(e){return u().output.formatDate(e)}function d(e,t){return u().output.truncate(e,t)}var I=`
|
|
2
|
+
query MyOrganizations($limit: Int, $offset: Int) {
|
|
3
|
+
myOrganizations(limit: $limit, offset: $offset) {
|
|
4
|
+
items {
|
|
5
|
+
id
|
|
6
|
+
name
|
|
7
|
+
slug
|
|
8
|
+
tenantId
|
|
9
|
+
description
|
|
10
|
+
status
|
|
11
|
+
createdAt
|
|
12
|
+
updatedAt
|
|
13
|
+
}
|
|
14
|
+
total
|
|
15
|
+
hasMore
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`,b=`
|
|
19
|
+
query MyOrganizationInvites($status: InviteStatus, $limit: Int, $offset: Int) {
|
|
20
|
+
myOrganizationInvites(status: $status, limit: $limit, offset: $offset) {
|
|
21
|
+
items {
|
|
22
|
+
id
|
|
23
|
+
organizationId
|
|
24
|
+
email
|
|
25
|
+
role
|
|
26
|
+
status
|
|
27
|
+
expiresAt
|
|
28
|
+
message
|
|
29
|
+
createdAt
|
|
30
|
+
}
|
|
31
|
+
total
|
|
32
|
+
hasMore
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`,T=`
|
|
36
|
+
mutation AcceptOrganizationInvite($inviteId: ID!) {
|
|
37
|
+
acceptOrganizationInvite(inviteId: $inviteId) {
|
|
38
|
+
id
|
|
39
|
+
userId
|
|
40
|
+
organizationId
|
|
41
|
+
role
|
|
42
|
+
joinedAt
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
`,v=`
|
|
46
|
+
mutation RejectOrganizationInvite($inviteId: ID!) {
|
|
47
|
+
rejectOrganizationInvite(inviteId: $inviteId) {
|
|
48
|
+
id
|
|
49
|
+
status
|
|
50
|
+
respondedAt
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`;function A(e){let t=e.command("organizations").description("Organization membership & invites");t.command("list").description("List organizations the current user is a member of").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>","Output format").action(async n=>{try{let o=await p(I,{limit:n.limit,offset:0});f(n,o.myOrganizations.items,{headers:["ID","Name","Slug","TenantID","Status","Created"],rows:o.myOrganizations.items.map(i=>[d(i.id,12),i.name,i.slug,d(i.tenantId,12),h(i.status),w(i.createdAt)])});}catch(o){l(o);}});let s=t.command("invites").description("Manage org invites");s.command("list").description("List pending org invites for the current user").option("--status <s>","Filter by invite status","PENDING").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>","Output format").action(async n=>{try{let o=await p(b,{status:n.status?.toUpperCase(),limit:n.limit,offset:0});f(n,o.myOrganizationInvites.items,{headers:["InviteID","OrgID","Email","Role","Status","Expires"],rows:o.myOrganizationInvites.items.map(i=>[d(i.id,12),d(i.organizationId,12),i.email,i.role,h(i.status),w(i.expiresAt)])});}catch(o){l(o);}}),s.command("accept").description("Accept an organization invite").argument("<inviteId>").action(async n=>{try{await p(T,{inviteId:n}),m("Invite accepted");}catch(o){l(o);}}),s.command("decline").description("Decline an organization invite").argument("<inviteId>").action(async n=>{try{await p(v,{inviteId:n}),m("Invite declined");}catch(o){l(o);}});}var F={id:"organizations",version:"1.0.0",displayName:"Organizations",dependsOn:["auth"],register(e,t){y(t),A(e);}},Je=F;module.exports=Je;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {a,c,g,o,m,n,f as f$1,h}from'../../chunk-KTKHJORN.js';import'../../chunk-RNWXATAC.js';var f=`
|
|
2
|
+
query MyOrganizations($limit: Int, $offset: Int) {
|
|
3
|
+
myOrganizations(limit: $limit, offset: $offset) {
|
|
4
|
+
items {
|
|
5
|
+
id
|
|
6
|
+
name
|
|
7
|
+
slug
|
|
8
|
+
tenantId
|
|
9
|
+
description
|
|
10
|
+
status
|
|
11
|
+
createdAt
|
|
12
|
+
updatedAt
|
|
13
|
+
}
|
|
14
|
+
total
|
|
15
|
+
hasMore
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`,O=`
|
|
19
|
+
query MyOrganizationInvites($status: InviteStatus, $limit: Int, $offset: Int) {
|
|
20
|
+
myOrganizationInvites(status: $status, limit: $limit, offset: $offset) {
|
|
21
|
+
items {
|
|
22
|
+
id
|
|
23
|
+
organizationId
|
|
24
|
+
email
|
|
25
|
+
role
|
|
26
|
+
status
|
|
27
|
+
expiresAt
|
|
28
|
+
message
|
|
29
|
+
createdAt
|
|
30
|
+
}
|
|
31
|
+
total
|
|
32
|
+
hasMore
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`,z=`
|
|
36
|
+
mutation AcceptOrganizationInvite($inviteId: ID!) {
|
|
37
|
+
acceptOrganizationInvite(inviteId: $inviteId) {
|
|
38
|
+
id
|
|
39
|
+
userId
|
|
40
|
+
organizationId
|
|
41
|
+
role
|
|
42
|
+
joinedAt
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
`,v=`
|
|
46
|
+
mutation RejectOrganizationInvite($inviteId: ID!) {
|
|
47
|
+
rejectOrganizationInvite(inviteId: $inviteId) {
|
|
48
|
+
id
|
|
49
|
+
status
|
|
50
|
+
respondedAt
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`;function y(r){let s=r.command("organizations").description("Organization membership & invites");s.command("list").description("List organizations the current user is a member of").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>","Output format").action(async t=>{try{let i=await c(f,{limit:t.limit,offset:0});g(t,i.myOrganizations.items,{headers:["ID","Name","Slug","TenantID","Status","Created"],rows:i.myOrganizations.items.map(n$1=>[o(n$1.id,12),n$1.name,n$1.slug,o(n$1.tenantId,12),m(n$1.status),n(n$1.createdAt)])});}catch(i){f$1(i);}});let m$1=s.command("invites").description("Manage org invites");m$1.command("list").description("List pending org invites for the current user").option("--status <s>","Filter by invite status","PENDING").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>","Output format").action(async t=>{try{let i=await c(O,{status:t.status?.toUpperCase(),limit:t.limit,offset:0});g(t,i.myOrganizationInvites.items,{headers:["InviteID","OrgID","Email","Role","Status","Expires"],rows:i.myOrganizationInvites.items.map(n$1=>[o(n$1.id,12),o(n$1.organizationId,12),n$1.email,n$1.role,m(n$1.status),n(n$1.expiresAt)])});}catch(i){f$1(i);}}),m$1.command("accept").description("Accept an organization invite").argument("<inviteId>").action(async t=>{try{await c(z,{inviteId:t}),h("Invite accepted");}catch(i){f$1(i);}}),m$1.command("decline").description("Decline an organization invite").argument("<inviteId>").action(async t=>{try{await c(v,{inviteId:t}),h("Invite declined");}catch(i){f$1(i);}});}var C={id:"organizations",version:"1.0.0",displayName:"Organizations",dependsOn:["auth"],register(r,s){a(s),y(r);}},_=C;export{_ as default};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var l=class extends Error{exitCode;hint;constructor(o,d){super(o),this.name="CliUserError",this.exitCode=d?.exitCode??1,this.hint=d?.hint;}};var g=class extends Error{cause;constructor(o,d){super(o),this.name="CliInternalError",this.cause=d;}};var C=null;function x(i){C=i;}function y(){if(!C)throw new g("vibecontrols module helpers used before setHelpersContext was called");return C}async function s(i,o){return y().gql.global.request(i,o)}function a(i){let o=i instanceof Error?i.message:String(i);throw new l(o)}function u(i,o,d){y().output.formatAndOutput(i,o,d);}function p(i){y().output.printSuccess(i);}function w(i){return y().output.formatStatus(i)}function f(i,o){return y().output.truncate(i,o)}var E=`
|
|
2
|
+
query ListProducts($filter: PlatformProductFilterInput, $limit: Int, $offset: Int) {
|
|
3
|
+
platformProducts(filter: $filter, limit: $limit, offset: $offset) {
|
|
4
|
+
items { id name slug status logoUrl appUrl }
|
|
5
|
+
total
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
`,I=`
|
|
9
|
+
query GetProduct($id: ID!) {
|
|
10
|
+
platformProduct(id: $id) {
|
|
11
|
+
id name slug description status metadata logoUrl appUrl
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
`,v=`
|
|
15
|
+
mutation CreatePlatformProduct($input: CreatePlatformProductInput!) {
|
|
16
|
+
createPlatformProduct(input: $input) {
|
|
17
|
+
id name slug status
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`,A=`
|
|
21
|
+
mutation UpdatePlatformProduct($id: ID!, $input: UpdatePlatformProductInput!) {
|
|
22
|
+
updatePlatformProduct(id: $id, input: $input) {
|
|
23
|
+
id name status
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`,P=`
|
|
27
|
+
mutation DeletePlatformProduct($id: ID!) {
|
|
28
|
+
deletePlatformProduct(id: $id)
|
|
29
|
+
}
|
|
30
|
+
`,S=`
|
|
31
|
+
query ListShortcuts($filter: KeyboardShortcutFilterInput, $limit: Int) {
|
|
32
|
+
keyboardShortcuts(filter: $filter, limit: $limit) {
|
|
33
|
+
items { id label shortcutKey category eventName isEnabled productId }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`,O=`
|
|
37
|
+
mutation CreateKeyboardShortcut($input: CreateKeyboardShortcutInput!) {
|
|
38
|
+
createKeyboardShortcut(input: $input) {
|
|
39
|
+
id label shortcutKey isEnabled
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`,R=`
|
|
43
|
+
mutation UpdateKeyboardShortcut($id: ID!, $input: UpdateKeyboardShortcutInput!) {
|
|
44
|
+
updateKeyboardShortcut(id: $id, input: $input) {
|
|
45
|
+
id label shortcutKey isEnabled
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`,$=`
|
|
49
|
+
mutation DeleteKeyboardShortcut($id: ID!) {
|
|
50
|
+
deleteKeyboardShortcut(id: $id)
|
|
51
|
+
}
|
|
52
|
+
`,D=`
|
|
53
|
+
query ListContentPages($productId: ID!, $filter: ContentPageFilterInput, $limit: Int) {
|
|
54
|
+
contentPages(productId: $productId, filter: $filter, limit: $limit) {
|
|
55
|
+
items { id slug title visibility isPublished }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
`,F=`
|
|
59
|
+
mutation CreateContentPage($input: CreateContentPageInput!) {
|
|
60
|
+
createContentPage(input: $input) {
|
|
61
|
+
id slug title visibility
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
`,L=`
|
|
65
|
+
mutation UpdateContentPage($id: ID!, $input: UpdateContentPageInput!) {
|
|
66
|
+
updateContentPage(id: $id, input: $input) {
|
|
67
|
+
id slug title isPublished
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
`,U=`
|
|
71
|
+
mutation DeleteContentPage($id: ID!) {
|
|
72
|
+
deleteContentPage(id: $id)
|
|
73
|
+
}
|
|
74
|
+
`,_=`
|
|
75
|
+
query ListFeatureFlags($filter: FeatureFlagFilterInput, $limit: Int) {
|
|
76
|
+
featureFlags(filter: $filter, limit: $limit) {
|
|
77
|
+
items { id key name flagType status defaultValue category productId }
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
`,q=`
|
|
81
|
+
mutation CreateFeatureFlag($input: CreateFeatureFlagInput!) {
|
|
82
|
+
createFeatureFlag(input: $input) {
|
|
83
|
+
id key name flagType status
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
`,N=`
|
|
87
|
+
mutation UpdateFeatureFlag($id: ID!, $input: UpdateFeatureFlagInput!) {
|
|
88
|
+
updateFeatureFlag(id: $id, input: $input) {
|
|
89
|
+
id key status defaultValue
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
`,G=`
|
|
93
|
+
mutation DeleteFeatureFlag($id: ID!) {
|
|
94
|
+
deleteFeatureFlag(id: $id)
|
|
95
|
+
}
|
|
96
|
+
`,j=`
|
|
97
|
+
query EvaluateFeatureFlags($input: EvaluateFeatureFlagsInput!) {
|
|
98
|
+
evaluateFeatureFlags(input: $input) {
|
|
99
|
+
evaluations { key flagType value variant reason }
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
`;function W(i){let o=i.command("products").description("Platform products, shortcuts, content-pages, feature-flags");o.command("list").description("List platform products").option("--search <q>").option("--status <s>").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let e={};t.search&&(e.search=t.search),t.status&&(e.status=t.status.toUpperCase());let n=await s(E,{filter:Object.keys(e).length?e:void 0,limit:t.limit,offset:0});u(t,n.platformProducts.items,{headers:["ID","Name","Slug","Status"],rows:n.platformProducts.items.map(r=>[f(r.id,12),r.name,r.slug??"-",w(r.status)])});}catch(e){a(e);}}),o.command("get").description("Get a product").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await s(I,{id:t});if(!n.platformProduct)throw new l(`Product ${t} not found`);u(e,n.platformProduct);}catch(n){a(n);}}),o.command("create").description("Create a platform product").requiredOption("--name <s>").requiredOption("--slug <s>").option("--description <s>").option("--status <s>","DRAFT|ACTIVE|ARCHIVED","DRAFT").option("--app-url <url>").option("--logo-url <url>").option("-f, --format <format>").action(async t=>{try{let e={name:t.name,slug:t.slug,description:t.description,status:(t.status??"DRAFT").toUpperCase(),appUrl:t.appUrl,logoUrl:t.logoUrl},n=await s(v,{input:e});p(`Product created: ${n.createPlatformProduct.name}`),u(t,n.createPlatformProduct);}catch(e){a(e);}}),o.command("update").description("Update a product").argument("<id>").option("--name <s>").option("--description <s>").option("--status <s>").option("-f, --format <format>").action(async(t,e)=>{try{let n={};if(e.name&&(n.name=e.name),e.description!==void 0&&(n.description=e.description),e.status&&(n.status=e.status.toUpperCase()),!Object.keys(n).length)throw new l("No updates specified");let r=await s(A,{id:t,input:n});p("Product updated"),u(e,r.updatePlatformProduct);}catch(n){a(n);}}),o.command("delete").description("Delete a product").argument("<id>").action(async t=>{try{await s(P,{id:t}),p("Product deleted");}catch(e){a(e);}});let d=o.command("shortcuts").description("Keyboard shortcuts");d.command("list").description("List shortcuts").option("--product <id>").option("--category <c>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async t=>{try{let e={};t.product&&(e.productId=t.product),t.category&&(e.category=t.category);let n=await s(S,{filter:Object.keys(e).length?e:void 0,limit:t.limit});u(t,n.keyboardShortcuts.items,{headers:["ID","Label","Key","Category","Event","Enabled"],rows:n.keyboardShortcuts.items.map(r=>[f(r.id,12),r.label,r.shortcutKey,r.category??"-",r.eventName??"-",String(!!r.isEnabled)])});}catch(e){a(e);}}),d.command("create").description("Create a shortcut").requiredOption("--label <s>").requiredOption("--key <s>",'Shortcut key sequence (e.g. "g h")').requiredOption("--event <name>","Event emitted when shortcut fires").requiredOption("--product <id>","Owning product id").option("--category <c>","Navigation|Editing|...").option("--enabled").option("-f, --format <format>").action(async t=>{try{let e={label:t.label,shortcutKey:t.key,eventName:t.event,productId:t.product,category:t.category,isEnabled:t.enabled!==!1},n=await s(O,{input:e});p("Shortcut created"),u(t,n.createKeyboardShortcut);}catch(e){a(e);}}),d.command("update").description("Update a shortcut").argument("<id>").option("--label <s>").option("--key <s>").option("--enabled <bool>").option("-f, --format <format>").action(async(t,e)=>{try{let n={};if(e.label&&(n.label=e.label),e.key&&(n.shortcutKey=e.key),e.enabled!==void 0&&(n.isEnabled=e.enabled==="true"),!Object.keys(n).length)throw new l("No updates specified");let r=await s(R,{id:t,input:n});p("Shortcut updated"),u(e,r.updateKeyboardShortcut);}catch(n){a(n);}}),d.command("delete").description("Delete a shortcut").argument("<id>").action(async t=>{try{await s($,{id:t}),p("Shortcut deleted");}catch(e){a(e);}});let h=o.command("content-pages").description("Content pages (legal, marketing)");h.command("list").description("List content pages for a product").requiredOption("--product <id>").option("--published").option("--visibility <v>","PUBLIC|PRIVATE").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async t=>{try{let e={};t.published!==void 0&&(e.isPublished=t.published),t.visibility&&(e.visibility=t.visibility.toUpperCase());let n=await s(D,{productId:t.product,filter:Object.keys(e).length?e:void 0,limit:t.limit});u(t,n.contentPages.items,{headers:["ID","Slug","Title","Visibility","Published"],rows:n.contentPages.items.map(r=>[f(r.id,12),r.slug,f(r.title,40),r.visibility??"-",String(!!r.isPublished)])});}catch(e){a(e);}}),h.command("create").description("Create a content page").requiredOption("--product <id>").requiredOption("--slug <s>").requiredOption("--title <s>").requiredOption("--content <s>").option("--visibility <v>","PUBLIC|PRIVATE","PUBLIC").option("--published").option("-f, --format <format>").action(async t=>{try{let e={productId:t.product,slug:t.slug,title:t.title,content:t.content,visibility:(t.visibility??"PUBLIC").toUpperCase(),isPublished:!!t.published},n=await s(F,{input:e});p("Content page created"),u(t,n.createContentPage);}catch(e){a(e);}}),h.command("update").description("Update a content page").argument("<id>").option("--title <s>").option("--content <s>").option("--visibility <v>").option("--published <bool>").option("-f, --format <format>").action(async(t,e)=>{try{let n={};if(e.title&&(n.title=e.title),e.content!==void 0&&(n.content=e.content),e.visibility&&(n.visibility=e.visibility.toUpperCase()),e.published!==void 0&&(n.isPublished=e.published==="true"),!Object.keys(n).length)throw new l("No updates specified");let r=await s(L,{id:t,input:n});p("Content page updated"),u(e,r.updateContentPage);}catch(n){a(n);}}),h.command("delete").description("Delete a content page").argument("<id>").action(async t=>{try{await s(U,{id:t}),p("Content page deleted");}catch(e){a(e);}});let m=o.command("feature-flags").description("Feature flag administration (highest SRE/ops value)");m.command("list").description("List feature flags").option("--product <id>").option("--status <s>").option("--category <c>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async t=>{try{let e={};t.product&&(e.productId=t.product),t.status&&(e.status=t.status.toUpperCase()),t.category&&(e.category=t.category);let n=await s(_,{filter:Object.keys(e).length?e:void 0,limit:t.limit});u(t,n.featureFlags.items,{headers:["ID","Key","Type","Status","Default"],rows:n.featureFlags.items.map(r=>[f(r.id,12),r.key,r.flagType??"-",w(r.status),String(r.defaultValue)])});}catch(e){a(e);}}),m.command("create").description("Create a feature flag").requiredOption("--key <s>","Stable key (e.g. enable-beta-ui)").requiredOption("--name <s>","Human label").requiredOption("--product <id>","Owning product id").option("--type <t>","BOOLEAN|STRING|NUMBER|JSON","BOOLEAN").option("--default <s>","Default value (parsed as JSON)").option("--description <s>").option("--category <c>").option("--previewable").option("--tags <s>","Comma-separated tags").option("-f, --format <format>").action(async t=>{try{let e={key:t.key,name:t.name,productId:t.product,flagType:(t.type??"BOOLEAN").toUpperCase(),defaultValue:t.default?JSON.parse(t.default):!1,description:t.description,category:t.category,previewable:!!t.previewable,tags:t.tags?t.tags.split(","):void 0},n=await s(q,{input:e});p(`Feature flag created: ${n.createFeatureFlag.key}`),u(t,n.createFeatureFlag);}catch(e){a(e);}}),m.command("update").description("Update a feature flag").argument("<id>").option("--name <s>").option("--default <s>","Default value (parsed as JSON)").option("--status <s>","ACTIVE|ARCHIVED").option("-f, --format <format>").action(async(t,e)=>{try{let n={};if(e.name&&(n.name=e.name),e.default!==void 0&&(n.defaultValue=JSON.parse(e.default)),e.status&&(n.status=e.status.toUpperCase()),!Object.keys(n).length)throw new l("No updates specified");let r=await s(N,{id:t,input:n});p("Feature flag updated"),u(e,r.updateFeatureFlag);}catch(n){a(n);}}),m.command("delete").description("Delete a feature flag").argument("<id>").action(async t=>{try{await s(G,{id:t}),p("Feature flag deleted");}catch(e){a(e);}}),m.command("evaluate").description("Evaluate flags in a workspace context").requiredOption("--workspace <id>").requiredOption("--keys <s>","Comma-separated flag keys").option("-f, --format <format>").action(async t=>{try{let e={workspaceId:t.workspace,keys:t.keys.split(",")},n=await s(j,{input:e});u(t,n.evaluateFeatureFlags.evaluations);}catch(e){a(e);}});}var et={id:"products",version:"1.0.0",displayName:"Platform Products",dependsOn:["auth"],register(i,o){x(o),W(i);}},le=et;module.exports=le;
|