@burdenoff/cli-sdk 2026.1021.2 → 2026.1031.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modules/auth/index.cjs +43 -21
- package/dist/modules/auth/index.js +48 -26
- package/dist/modules/channels/index.cjs +12 -13
- package/dist/modules/channels/index.js +11 -12
- package/dist/modules/conversations/index.cjs +1 -1
- package/dist/modules/conversations/index.js +4 -4
- package/dist/modules/groups/index.cjs +16 -15
- package/dist/modules/groups/index.js +15 -14
- package/dist/modules/products/index.cjs +1 -1
- package/dist/modules/products/index.js +4 -4
- package/dist/modules/rbac/index.cjs +8 -19
- package/dist/modules/rbac/index.js +6 -17
- package/dist/modules/workspaces/index.cjs +8 -8
- package/dist/modules/workspaces/index.js +12 -12
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var l=class extends Error{exitCode;hint;constructor(o,
|
|
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 h=null;function I(r){h=r;}function p(){if(!h)throw new g("vibecontrols module helpers used before setHelpersContext was called");return h}async function a(r,o){return p().gql.global.request(r,o)}function c(r){let o=r instanceof Error?r.message:String(r);throw new l(o)}function u(r,o,d){p().output.formatAndOutput(r,o,d);}function f(r){p().output.printSuccess(r);}function C(r){p().output.printWarning(r);}function w(r){return p().output.formatStatus(r)}function T(r){return p().output.formatDate(r)}function y(r,o){return p().output.truncate(r,o)}function b(){return p()}var v=`
|
|
2
2
|
query GetChannels($filter: ChannelFilterInput, $pagination: ChannelPaginationInput) {
|
|
3
3
|
getChannels(filter: $filter, pagination: $pagination) {
|
|
4
4
|
items { id name platform adapterType status connectionHealth priority createdAt }
|
|
@@ -12,59 +12,58 @@
|
|
|
12
12
|
connection { id authType isActive isHealthy }
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
`,
|
|
15
|
+
`,O=`
|
|
16
16
|
mutation CreateChannel($input: CreateChannelInput!) {
|
|
17
17
|
createChannel(input: $input) {
|
|
18
18
|
id name platform adapterType status
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
`,
|
|
21
|
+
`,S=`
|
|
22
22
|
mutation DeleteChannel($id: ID!) {
|
|
23
23
|
deleteChannel(id: $id)
|
|
24
24
|
}
|
|
25
|
-
`,
|
|
25
|
+
`,N=`
|
|
26
26
|
mutation SendChannelMessage($input: SendMessageInput!) {
|
|
27
27
|
sendMessage(input: $input) {
|
|
28
|
-
success messageId
|
|
29
|
-
error { code message retryable }
|
|
28
|
+
success messageId attemptId willRetry nextRetryAt error
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
|
-
|
|
31
|
+
`,$=`
|
|
33
32
|
query GetChannelDeliveryAttempts($channelId: ID!, $cursor: String, $limit: Int) {
|
|
34
33
|
getChannelDeliveryAttempts(channelId: $channelId, cursor: $cursor, limit: $limit) {
|
|
35
34
|
items { id channelId status sentAt retryCount errorMessage }
|
|
36
35
|
total hasMore
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
|
-
|
|
38
|
+
`,D=`
|
|
40
39
|
query ListChannelUsers($channelId: ID!, $pagination: ChannelPaginationInput) {
|
|
41
40
|
listUserPlatformConnectionsByChannel(channelId: $channelId, pagination: $pagination) {
|
|
42
41
|
items { id externalUserId externalDisplayName platform dmAllowed presenceStatus }
|
|
43
42
|
total hasMore
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
|
-
`,
|
|
45
|
+
`,L=`
|
|
47
46
|
query GetChannelWebhookEvents($channelId: ID!, $cursor: String, $limit: Int) {
|
|
48
47
|
getChannelWebhookEvents(channelId: $channelId, cursor: $cursor, limit: $limit) {
|
|
49
48
|
items { id eventType status createdAt }
|
|
50
49
|
total hasMore
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
|
-
`,
|
|
52
|
+
`,R=`
|
|
54
53
|
query GetConnectionsByOrg($organizationId: ID!, $pagination: ChannelPaginationInput) {
|
|
55
54
|
getConnectionsByOrganization(organizationId: $organizationId, pagination: $pagination) {
|
|
56
55
|
items { id channelId authType tokenExpiresAt isActive isHealthy }
|
|
57
56
|
total hasMore
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
|
-
`,
|
|
59
|
+
`,_=`
|
|
61
60
|
mutation CreateChannelConnection($input: CreateConnectionInput!) {
|
|
62
61
|
createConnection(input: $input) {
|
|
63
62
|
id channelId authType isActive
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
|
-
`,
|
|
65
|
+
`,P=`
|
|
67
66
|
mutation DeleteChannelConnection($id: ID!) {
|
|
68
67
|
deleteConnection(id: $id)
|
|
69
68
|
}
|
|
70
|
-
`;function
|
|
69
|
+
`;function q(r){let o=r.command("channels").description("Multi-platform message channels (email/SMS/Slack/etc.)");o.command("list").description("List channels").option("--platform <p>").option("--status <s>").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t={};e.platform&&(t.platform=e.platform.toUpperCase()),e.status&&(t.status=e.status.toUpperCase());let n=await a(v,{filter:Object.keys(t).length?t:void 0,pagination:{limit:e.limit,offset:0}});u(e,n.getChannels.items,{headers:["ID","Name","Platform","Status","Priority"],rows:n.getChannels.items.map(i=>[y(i.id,12),i.name,i.platform,w(i.status),String(i.priority??"-")])});}catch(t){c(t);}}),o.command("get").description("Get a channel").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await a(A,{id:e});if(!n.getChannel)throw new l(`Channel ${e} not found`);u(t,n.getChannel);}catch(n){c(n);}}),o.command("create").description("Create a channel").requiredOption("--name <s>").requiredOption("--platform <p>","EMAIL|SMS|SLACK|TEAMS|DISCORD|WHATSAPP|WEBHOOK").option("--organization <id>","Organization id (defaults to current actor org)").option("--adapter <t>").option("-f, --format <format>").action(async e=>{try{let t=e.organization??b().auth.read()?.organizationId;if(!t)throw new l("No organization context. Pass --organization <id> or set auth.organizationId.");let n={name:e.name,platform:e.platform.toUpperCase(),organizationId:t,adapterType:e.adapter?e.adapter.toUpperCase():void 0},i=await a(O,{input:n});f("Channel created"),u(e,i.createChannel);}catch(t){c(t);}}),o.command("delete").description("Delete a channel").argument("<id>").action(async e=>{try{await a(S,{id:e}),f("Channel deleted");}catch(t){c(t);}}),o.command("send").description("Send a message via a channel").argument("<channelId>").requiredOption("--content <s>").option("--recipient <id>","External recipient id (e.g. email)").option("--subject <s>").option("-f, --format <format>").action(async(e,t)=>{try{let n={channelId:e,content:t.content,recipientId:t.recipient,subject:t.subject},i=await a(N,{input:n});i.sendMessage.success?f(`Sent: ${i.sendMessage.messageId??"(no id)"}`):i.sendMessage.willRetry?C(`Delivery failed, will retry: ${i.sendMessage.error??"unknown error"}`):C(`Delivery failed: ${i.sendMessage.error??"unknown error"}`),u(t,i.sendMessage);}catch(n){c(n);}}),o.command("deliveries").description("Recent delivery attempts for a channel").argument("<channelId>").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async(e,t)=>{try{let n=await a($,{channelId:e,limit:t.limit});u(t,n.getChannelDeliveryAttempts.items);}catch(n){c(n);}}),o.command("users").description("Users connected to this channel").argument("<channelId>").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async(e,t)=>{try{let n=await a(D,{channelId:e,pagination:{limit:t.limit,offset:0}});u(t,n.listUserPlatformConnectionsByChannel.items);}catch(n){c(n);}}),o.command("webhooks").description("Channel webhook events").command("list").description("List webhook events for a channel").argument("<channelId>").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async(e,t)=>{try{let n=await a(L,{channelId:e,limit:t.limit});u(t,n.getChannelWebhookEvents.items,{headers:["ID","Event","Status","When"],rows:n.getChannelWebhookEvents.items.map(i=>[y(i.id,12),i.eventType,w(i.status),T(i.createdAt)])});}catch(n){c(n);}});let m=o.command("connections").description("Channel connections (OAuth/API keys)");m.command("list").description("List connections for an organization").requiredOption("--organization <id>").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async e=>{try{let t=await a(R,{organizationId:e.organization,pagination:{limit:e.limit,offset:0}});u(e,t.getConnectionsByOrganization.items);}catch(t){c(t);}}),m.command("create").description("Create a channel connection").requiredOption("--channel <id>").requiredOption("--auth-type <t>","OAUTH|API_KEY|WEBHOOK").option("-f, --format <format>").action(async e=>{try{let t={channelId:e.channel,authType:e.authType.toUpperCase()},n=await a(_,{input:t});f("Connection created"),u(e,n.createConnection);}catch(t){c(t);}}),m.command("delete").description("Delete a connection").argument("<id>").action(async e=>{try{await a(P,{id:e}),f("Connection deleted");}catch(t){c(t);}});}var J={id:"channels",version:"1.0.0",displayName:"Channels",dependsOn:["auth"],register(r,o){I(o),q(r);}},st=J;module.exports=st;
|
|
@@ -1,42 +1,41 @@
|
|
|
1
|
-
import {a,c,h,p,n,g,s,i,o as o$1}from'../../chunk-SQSFZFQZ.js';import {o}from'../../chunk-UAFYTYK6.js';var
|
|
1
|
+
import {a,c,h,p,n,g,s,i,l,o as o$1}from'../../chunk-SQSFZFQZ.js';import {o}from'../../chunk-UAFYTYK6.js';var I=`
|
|
2
2
|
query GetChannels($filter: ChannelFilterInput, $pagination: ChannelPaginationInput) {
|
|
3
3
|
getChannels(filter: $filter, pagination: $pagination) {
|
|
4
4
|
items { id name platform adapterType status connectionHealth priority createdAt }
|
|
5
5
|
total hasMore
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
`,
|
|
8
|
+
`,N=`
|
|
9
9
|
query GetChannel($id: ID!) {
|
|
10
10
|
getChannel(id: $id) {
|
|
11
11
|
id name platform adapterType status channelType
|
|
12
12
|
connection { id authType isActive isHealthy }
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
`,
|
|
15
|
+
`,A=`
|
|
16
16
|
mutation CreateChannel($input: CreateChannelInput!) {
|
|
17
17
|
createChannel(input: $input) {
|
|
18
18
|
id name platform adapterType status
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
`,
|
|
21
|
+
`,T=`
|
|
22
22
|
mutation DeleteChannel($id: ID!) {
|
|
23
23
|
deleteChannel(id: $id)
|
|
24
24
|
}
|
|
25
|
-
`,
|
|
25
|
+
`,_=`
|
|
26
26
|
mutation SendChannelMessage($input: SendMessageInput!) {
|
|
27
27
|
sendMessage(input: $input) {
|
|
28
|
-
success messageId
|
|
29
|
-
error { code message retryable }
|
|
28
|
+
success messageId attemptId willRetry nextRetryAt error
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
|
-
`,
|
|
31
|
+
`,S=`
|
|
33
32
|
query GetChannelDeliveryAttempts($channelId: ID!, $cursor: String, $limit: Int) {
|
|
34
33
|
getChannelDeliveryAttempts(channelId: $channelId, cursor: $cursor, limit: $limit) {
|
|
35
34
|
items { id channelId status sentAt retryCount errorMessage }
|
|
36
35
|
total hasMore
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
|
-
|
|
38
|
+
`,$=`
|
|
40
39
|
query ListChannelUsers($channelId: ID!, $pagination: ChannelPaginationInput) {
|
|
41
40
|
listUserPlatformConnectionsByChannel(channelId: $channelId, pagination: $pagination) {
|
|
42
41
|
items { id externalUserId externalDisplayName platform dmAllowed presenceStatus }
|
|
@@ -50,7 +49,7 @@ import {a,c,h,p,n,g,s,i,o as o$1}from'../../chunk-SQSFZFQZ.js';import {o}from'..
|
|
|
50
49
|
total hasMore
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
|
-
|
|
52
|
+
`,w=`
|
|
54
53
|
query GetConnectionsByOrg($organizationId: ID!, $pagination: ChannelPaginationInput) {
|
|
55
54
|
getConnectionsByOrganization(organizationId: $organizationId, pagination: $pagination) {
|
|
56
55
|
items { id channelId authType tokenExpiresAt isActive isHealthy }
|
|
@@ -63,8 +62,8 @@ import {a,c,h,p,n,g,s,i,o as o$1}from'../../chunk-SQSFZFQZ.js';import {o}from'..
|
|
|
63
62
|
id channelId authType isActive
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
|
-
`,
|
|
65
|
+
`,D=`
|
|
67
66
|
mutation DeleteChannelConnection($id: ID!) {
|
|
68
67
|
deleteConnection(id: $id)
|
|
69
68
|
}
|
|
70
|
-
`;function H(
|
|
69
|
+
`;function H(l$1){let r=l$1.command("channels").description("Multi-platform message channels (email/SMS/Slack/etc.)");r.command("list").description("List channels").option("--platform <p>").option("--status <s>").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let n$1={};t.platform&&(n$1.platform=t.platform.toUpperCase()),t.status&&(n$1.status=t.status.toUpperCase());let e=await c(I,{filter:Object.keys(n$1).length?n$1:void 0,pagination:{limit:t.limit,offset:0}});h(t,e.getChannels.items,{headers:["ID","Name","Platform","Status","Priority"],rows:e.getChannels.items.map(a=>[p(a.id,12),a.name,a.platform,n(a.status),String(a.priority??"-")])});}catch(n){g(n);}}),r.command("get").description("Get a channel").argument("<id>").option("-f, --format <format>").action(async(t,n)=>{try{let e=await c(N,{id:t});if(!e.getChannel)throw new o(`Channel ${t} not found`);h(n,e.getChannel);}catch(e){g(e);}}),r.command("create").description("Create a channel").requiredOption("--name <s>").requiredOption("--platform <p>","EMAIL|SMS|SLACK|TEAMS|DISCORD|WHATSAPP|WEBHOOK").option("--organization <id>","Organization id (defaults to current actor org)").option("--adapter <t>").option("-f, --format <format>").action(async t=>{try{let n=t.organization??s().auth.read()?.organizationId;if(!n)throw new o("No organization context. Pass --organization <id> or set auth.organizationId.");let e={name:t.name,platform:t.platform.toUpperCase(),organizationId:n,adapterType:t.adapter?t.adapter.toUpperCase():void 0},a=await c(A,{input:e});i("Channel created"),h(t,a.createChannel);}catch(n){g(n);}}),r.command("delete").description("Delete a channel").argument("<id>").action(async t=>{try{await c(T,{id:t}),i("Channel deleted");}catch(n){g(n);}}),r.command("send").description("Send a message via a channel").argument("<channelId>").requiredOption("--content <s>").option("--recipient <id>","External recipient id (e.g. email)").option("--subject <s>").option("-f, --format <format>").action(async(t,n)=>{try{let e={channelId:t,content:n.content,recipientId:n.recipient,subject:n.subject},a=await c(_,{input:e});a.sendMessage.success?i(`Sent: ${a.sendMessage.messageId??"(no id)"}`):a.sendMessage.willRetry?l(`Delivery failed, will retry: ${a.sendMessage.error??"unknown error"}`):l(`Delivery failed: ${a.sendMessage.error??"unknown error"}`),h(n,a.sendMessage);}catch(e){g(e);}}),r.command("deliveries").description("Recent delivery attempts for a channel").argument("<channelId>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,n)=>{try{let e=await c(S,{channelId:t,limit:n.limit});h(n,e.getChannelDeliveryAttempts.items);}catch(e){g(e);}}),r.command("users").description("Users connected to this channel").argument("<channelId>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,n)=>{try{let e=await c($,{channelId:t,pagination:{limit:n.limit,offset:0}});h(n,e.listUserPlatformConnectionsByChannel.items);}catch(e){g(e);}}),r.command("webhooks").description("Channel webhook events").command("list").description("List webhook events for a channel").argument("<channelId>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,n$1)=>{try{let e=await c(O,{channelId:t,limit:n$1.limit});h(n$1,e.getChannelWebhookEvents.items,{headers:["ID","Event","Status","When"],rows:e.getChannelWebhookEvents.items.map(a=>[p(a.id,12),a.eventType,n(a.status),o$1(a.createdAt)])});}catch(e){g(e);}});let m=r.command("connections").description("Channel connections (OAuth/API keys)");m.command("list").description("List connections for an organization").requiredOption("--organization <id>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async t=>{try{let n=await c(w,{organizationId:t.organization,pagination:{limit:t.limit,offset:0}});h(t,n.getConnectionsByOrganization.items);}catch(n){g(n);}}),m.command("create").description("Create a channel connection").requiredOption("--channel <id>").requiredOption("--auth-type <t>","OAUTH|API_KEY|WEBHOOK").option("-f, --format <format>").action(async t=>{try{let n={channelId:t.channel,authType:t.authType.toUpperCase()},e=await c(L,{input:n});i("Connection created"),h(t,e.createConnection);}catch(n){g(n);}}),m.command("delete").description("Delete a connection").argument("<id>").action(async t=>{try{await c(D,{id:t}),i("Connection deleted");}catch(n){g(n);}});}var M={id:"channels",version:"1.0.0",displayName:"Channels",dependsOn:["auth"],register(l,r){a(r),H(l);}},U=M;export{U as default};
|
|
@@ -8,7 +8,7 @@ import {a,b as b$1,h as h$1,p,o,g,s,i}from'../../chunk-SQSFZFQZ.js';import {o as
|
|
|
8
8
|
`,R=`
|
|
9
9
|
query GetConversation($id: ID!) {
|
|
10
10
|
conversation(id: $id) {
|
|
11
|
-
id title type description
|
|
11
|
+
id title type description avatar settings
|
|
12
12
|
createdAt updatedAt
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -77,13 +77,13 @@ import {a,b as b$1,h as h$1,p,o,g,s,i}from'../../chunk-SQSFZFQZ.js';import {o as
|
|
|
77
77
|
mutation DeleteDraft($conversationId: ID!) {
|
|
78
78
|
deleteDraft(conversationId: $conversationId) { success conversationId }
|
|
79
79
|
}
|
|
80
|
-
`,
|
|
80
|
+
`,V=`
|
|
81
81
|
mutation AddReaction($messageId: ID!, $emoji: String!) {
|
|
82
82
|
addReaction(messageId: $messageId, emoji: $emoji) {
|
|
83
83
|
id messageId userId emoji createdAt
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
`,
|
|
86
|
+
`,U=`
|
|
87
87
|
mutation RemoveReaction($messageId: ID!, $emoji: String!) {
|
|
88
88
|
removeReaction(messageId: $messageId, emoji: $emoji) { success messageId emoji }
|
|
89
89
|
}
|
|
@@ -152,4 +152,4 @@ import {a,b as b$1,h as h$1,p,o,g,s,i}from'../../chunk-SQSFZFQZ.js';import {o as
|
|
|
152
152
|
conversation { id title type }
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
`;function Q(d){let o$2=d.command("conversations").description("Conversation management");o$2.command("list").description("List conversations").option("--type <t>","Filter by type (DIRECT|GROUP|CHANNEL)").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>").action(async n=>{try{let t={};n.type&&(t.type=n.type.toUpperCase());let i=(await b$1(l,{filter:Object.keys(t).length?t:void 0,first:n.limit})).conversations.edges.map(p=>p.node);h$1(n,i,{headers:["ID","Title","Type","Unread","Created"],rows:i.map(p$1=>[p(p$1.id,12),p$1.title??"-",p$1.type??"-",String(p$1.unreadCount??0),o(p$1.createdAt)])});}catch(t){g(t);}}),o$2.command("get").description("Get a conversation").argument("<id>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(R,{id:n});if(!e.conversation)throw new o$1(`Conversation ${n} not found`);h$1(t,e.conversation);}catch(e){g(e);}}),o$2.command("create").description("Create a conversation").requiredOption("--title <s>").requiredOption("--participants <ids>","Comma-separated participant userIds (required by schema)").option("--description <s>").option("--type <t>","DIRECT|GROUP|CHANNEL","GROUP").option("-f, --format <format>").action(async n=>{try{let t=s().auth.read();if(!t?.workspaceId)throw new o$1("No workspace set. Run: vibecontrols workspace set <id>");let e={title:n.title,description:n.description,type:(n.type??"GROUP").toUpperCase(),participantIds:n.participants.split(","),workspaceId:t.workspaceId},i$1=await b$1(N,{input:e});i("Conversation created"),h$1(n,i$1.createConversation.conversation);}catch(t){g(t);}}),o$2.command("update").description("Update a conversation").argument("<id>").option("--title <s>").option("--description <s>").option("-f, --format <format>").action(async(n,t)=>{try{let e={id:n};if(t.title&&(e.title=t.title),t.description!==void 0&&(e.description=t.description),Object.keys(e).length===1)throw new o$1("No updates specified");let i$1=await b$1(T,{input:e});i("Conversation updated"),h$1(t,i$1.updateConversation.conversation);}catch(e){g(e);}}),o$2.command("delete").description("Delete a conversation").argument("<id>").action(async n=>{try{await b$1(y,{id:n}),i("Conversation deleted");}catch(t){g(t);}}),o$2.command("send").description("Send a message to a conversation").argument("<conversationId>").requiredOption("--content <text>").option("--parent <messageId>","Reply parent").option("-f, --format <format>").action(async(n,t)=>{try{let e={conversationId:n,content:{text:t.content},type:"TEXT",parentMessageId:t.parent},i$1=await b$1(O,{input:e});i("Message sent"),h$1(t,i$1.sendMessage.message);}catch(e){g(e);}}),Z(o$2),tt(o$2),et(o$2),nt(o$2),ot(o$2),it(o$2);}function Z(d){let o$1=d.command("messages").description("Message operations");o$1.command("edit").description("Edit a message").argument("<id>").requiredOption("--content <text>").option("--reason <s>").option("-f, --format <format>").action(async(n,t)=>{try{let e={id:n,content:{text:t.content}};t.reason&&(e.reason=t.reason);let i$1=await b$1(S,{input:e});i("Message edited"),h$1(t,i$1.editMessage);}catch(e){g(e);}}),o$1.command("delete").description("Delete a message").argument("<id>").option("--hard","Hard delete (default: soft)").action(async(n,t)=>{try{await b$1($,{id:n,hard:t.hard??!1}),i("Message deleted");}catch(e){g(e);}}),o$1.command("forward").description("Forward a message to another conversation").argument("<messageId>").requiredOption("--to <targetConversationId>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(D,{messageId:n,targetConversationId:t.to});i("Message forwarded"),h$1(t,e.forwardMessage.message);}catch(e){g(e);}}),o$1.command("pin").description("Pin a message").argument("<messageId>").action(async n=>{try{await b$1(M,{messageId:n}),i("Message pinned");}catch(t){g(t);}}),o$1.command("unpin").description("Unpin a message").argument("<messageId>").action(async n=>{try{await b$1(_,{messageId:n}),i("Message unpinned");}catch(t){g(t);}}),o$1.command("search").description("Search messages").requiredOption("--query <s>").option("--conversation <id>","Restrict to a conversation").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>").action(async n=>{try{let e=(await b$1(h,{query:n.query,conversationId:n.conversation,first:n.limit})).searchMessages.edges.map(i=>i.node);h$1(n,e,{headers:["ID","Conversation","Author","Created"],rows:e.map(i=>[p(i.id,12),p(i.conversationId??"-",12),p(i.authorId??"-",12),o(i.createdAt)])});}catch(t){g(t);}});}function tt(d){let o=d.command("drafts").description("Draft message operations");o.command("get").description("Get the actor\u2019s draft for a conversation").argument("<conversationId>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(x,{conversationId:n});if(!e.draft){i("No draft saved");return}h$1(t,e.draft);}catch(e){g(e);}}),o.command("save").description("Save (upsert) a draft for a conversation").argument("<conversationId>").requiredOption("--content <text>").option("--parent <messageId>").option("-f, --format <format>").action(async(n,t)=>{try{let e={conversationId:n,content:{text:t.content}};t.parent&&(e.parentMessageId=t.parent);let i$1=await b$1(w,{input:e});i("Draft saved"),h$1(t,i$1.saveDraft);}catch(e){g(e);}}),o.command("delete").description("Delete the actor\u2019s draft for a conversation").argument("<conversationId>").action(async n=>{try{await b$1(P,{conversationId:n}),i("Draft deleted");}catch(t){g(t);}});}function et(d){let o=d.command("reactions").description("Reaction operations");o.command("add").description("Add an emoji reaction to a message").argument("<messageId>").requiredOption("--emoji <e>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(
|
|
155
|
+
`;function Q(d){let o$2=d.command("conversations").description("Conversation management");o$2.command("list").description("List conversations").option("--type <t>","Filter by type (DIRECT|GROUP|CHANNEL)").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>").action(async n=>{try{let t={};n.type&&(t.type=n.type.toUpperCase());let i=(await b$1(l,{filter:Object.keys(t).length?t:void 0,first:n.limit})).conversations.edges.map(p=>p.node);h$1(n,i,{headers:["ID","Title","Type","Unread","Created"],rows:i.map(p$1=>[p(p$1.id,12),p$1.title??"-",p$1.type??"-",String(p$1.unreadCount??0),o(p$1.createdAt)])});}catch(t){g(t);}}),o$2.command("get").description("Get a conversation").argument("<id>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(R,{id:n});if(!e.conversation)throw new o$1(`Conversation ${n} not found`);h$1(t,e.conversation);}catch(e){g(e);}}),o$2.command("create").description("Create a conversation").requiredOption("--title <s>").requiredOption("--participants <ids>","Comma-separated participant userIds (required by schema)").option("--description <s>").option("--type <t>","DIRECT|GROUP|CHANNEL","GROUP").option("-f, --format <format>").action(async n=>{try{let t=s().auth.read();if(!t?.workspaceId)throw new o$1("No workspace set. Run: vibecontrols workspace set <id>");let e={title:n.title,description:n.description,type:(n.type??"GROUP").toUpperCase(),participantIds:n.participants.split(","),workspaceId:t.workspaceId},i$1=await b$1(N,{input:e});i("Conversation created"),h$1(n,i$1.createConversation.conversation);}catch(t){g(t);}}),o$2.command("update").description("Update a conversation").argument("<id>").option("--title <s>").option("--description <s>").option("-f, --format <format>").action(async(n,t)=>{try{let e={id:n};if(t.title&&(e.title=t.title),t.description!==void 0&&(e.description=t.description),Object.keys(e).length===1)throw new o$1("No updates specified");let i$1=await b$1(T,{input:e});i("Conversation updated"),h$1(t,i$1.updateConversation.conversation);}catch(e){g(e);}}),o$2.command("delete").description("Delete a conversation").argument("<id>").action(async n=>{try{await b$1(y,{id:n}),i("Conversation deleted");}catch(t){g(t);}}),o$2.command("send").description("Send a message to a conversation").argument("<conversationId>").requiredOption("--content <text>").option("--parent <messageId>","Reply parent").option("-f, --format <format>").action(async(n,t)=>{try{let e={conversationId:n,content:{text:t.content},type:"TEXT",parentMessageId:t.parent},i$1=await b$1(O,{input:e});i("Message sent"),h$1(t,i$1.sendMessage.message);}catch(e){g(e);}}),Z(o$2),tt(o$2),et(o$2),nt(o$2),ot(o$2),it(o$2);}function Z(d){let o$1=d.command("messages").description("Message operations");o$1.command("edit").description("Edit a message").argument("<id>").requiredOption("--content <text>").option("--reason <s>").option("-f, --format <format>").action(async(n,t)=>{try{let e={id:n,content:{text:t.content}};t.reason&&(e.reason=t.reason);let i$1=await b$1(S,{input:e});i("Message edited"),h$1(t,i$1.editMessage);}catch(e){g(e);}}),o$1.command("delete").description("Delete a message").argument("<id>").option("--hard","Hard delete (default: soft)").action(async(n,t)=>{try{await b$1($,{id:n,hard:t.hard??!1}),i("Message deleted");}catch(e){g(e);}}),o$1.command("forward").description("Forward a message to another conversation").argument("<messageId>").requiredOption("--to <targetConversationId>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(D,{messageId:n,targetConversationId:t.to});i("Message forwarded"),h$1(t,e.forwardMessage.message);}catch(e){g(e);}}),o$1.command("pin").description("Pin a message").argument("<messageId>").action(async n=>{try{await b$1(M,{messageId:n}),i("Message pinned");}catch(t){g(t);}}),o$1.command("unpin").description("Unpin a message").argument("<messageId>").action(async n=>{try{await b$1(_,{messageId:n}),i("Message unpinned");}catch(t){g(t);}}),o$1.command("search").description("Search messages").requiredOption("--query <s>").option("--conversation <id>","Restrict to a conversation").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>").action(async n=>{try{let e=(await b$1(h,{query:n.query,conversationId:n.conversation,first:n.limit})).searchMessages.edges.map(i=>i.node);h$1(n,e,{headers:["ID","Conversation","Author","Created"],rows:e.map(i=>[p(i.id,12),p(i.conversationId??"-",12),p(i.authorId??"-",12),o(i.createdAt)])});}catch(t){g(t);}});}function tt(d){let o=d.command("drafts").description("Draft message operations");o.command("get").description("Get the actor\u2019s draft for a conversation").argument("<conversationId>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(x,{conversationId:n});if(!e.draft){i("No draft saved");return}h$1(t,e.draft);}catch(e){g(e);}}),o.command("save").description("Save (upsert) a draft for a conversation").argument("<conversationId>").requiredOption("--content <text>").option("--parent <messageId>").option("-f, --format <format>").action(async(n,t)=>{try{let e={conversationId:n,content:{text:t.content}};t.parent&&(e.parentMessageId=t.parent);let i$1=await b$1(w,{input:e});i("Draft saved"),h$1(t,i$1.saveDraft);}catch(e){g(e);}}),o.command("delete").description("Delete the actor\u2019s draft for a conversation").argument("<conversationId>").action(async n=>{try{await b$1(P,{conversationId:n}),i("Draft deleted");}catch(t){g(t);}});}function et(d){let o=d.command("reactions").description("Reaction operations");o.command("add").description("Add an emoji reaction to a message").argument("<messageId>").requiredOption("--emoji <e>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(V,{messageId:n,emoji:t.emoji});i("Reaction added"),h$1(t,e.addReaction);}catch(e){g(e);}}),o.command("remove").description("Remove an emoji reaction from a message").argument("<messageId>").requiredOption("--emoji <e>").action(async(n,t)=>{try{await b$1(U,{messageId:n,emoji:t.emoji}),i("Reaction removed");}catch(e){g(e);}});}function nt(d){let o=d.command("participants").description("Participant operations");o.command("add").description("Add a participant to a conversation").argument("<conversationId>").requiredOption("--user <userId>").option("--role <role>","ADMIN | MODERATOR | MEMBER | GUEST").option("-f, --format <format>").action(async(n,t)=>{try{let e={conversationId:n,userId:t.user};t.role&&(e.role=t.role.toUpperCase());let i$1=await b$1(k,{input:e});i("Participant added"),h$1(t,i$1.addParticipant);}catch(e){g(e);}}),o.command("remove").description("Remove a participant from a conversation").argument("<conversationId>").requiredOption("--user <userId>").option("--reason <s>").action(async(n,t)=>{try{let e={conversationId:n,userId:t.user};t.reason&&(e.reason=t.reason),await b$1(L,{input:e}),i("Participant removed");}catch(e){g(e);}}),o.command("role").description("Update a participant\u2019s role").argument("<conversationId>").requiredOption("--user <userId>").requiredOption("--role <role>","ADMIN | MODERATOR | MEMBER | GUEST").action(async(n,t)=>{try{await b$1(G,{input:{conversationId:n,userId:t.user,role:t.role.toUpperCase()}}),i("Participant role updated");}catch(e){g(e);}});}function ot(d){let o=(t,e,i$1,p)=>{d.command(t).description(e).argument("<id>").action(async I=>{try{await b$1(i$1,{id:I}),i(p);}catch(g$1){g(g$1);}});},n=(t,e,i$1,p)=>{d.command(t).description(e).argument("<conversationId>").action(async I=>{try{await b$1(i$1,{conversationId:I}),i(p);}catch(g$1){g(g$1);}});};o("archive","Archive a conversation",j,"Archived"),o("unarchive","Unarchive a conversation",b,"Unarchived"),d.command("mute").description("Mute a conversation").argument("<conversationId>").option("--until <iso>","ISO timestamp; omit for indefinite").action(async(t,e)=>{try{await b$1(F,{conversationId:t,until:e.until}),i("Muted");}catch(i){g(i);}}),n("unmute","Unmute a conversation",H,"Unmuted"),n("pin","Pin a conversation",K,"Pinned"),n("unpin","Unpin a conversation",J,"Unpinned"),d.command("read").description("Mark a conversation as read").argument("<conversationId>").option("--message <messageId>","Mark read up to this message (defaults to latest)").action(async(t,e)=>{try{await b$1(B,{conversationId:t,messageId:e.message}),i("Marked as read");}catch(i){g(i);}}),n("leave","Leave a conversation",q,"Left conversation");}function it(d){let o=d.command("invites").description("Invite link operations");o.command("create").description("Create an invite link for a conversation").argument("<conversationId>").option("--max-uses <n>","Maximum number of uses",n=>parseInt(n,10)).option("--expires-at <iso>","ISO expiry timestamp").option("-f, --format <format>").action(async(n,t)=>{try{let e={conversationId:n};t.maxUses!==void 0&&(e.maxUses=t.maxUses),t.expiresAt&&(e.expiresAt=t.expiresAt);let i$1=await b$1(W,{input:e});i("Invite link created"),h$1(t,i$1.createInviteLink);}catch(e){g(e);}}),o.command("join").description("Join a conversation via invite code").argument("<code>").action(async n=>{try{await b$1(z,{code:n}),i("Joined via invite link");}catch(t){g(t);}}),o.command("validate").description("Validate an invite code").argument("<code>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(X,{code:n});h$1(t,e.validateInviteLink);}catch(e){g(e);}});}var at={id:"conversations",version:"1.0.0",displayName:"Conversations",dependsOn:["auth","workspaces"],register(d,o){a(o),Q(d);}},ut=at;export{ut as default};
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var d=class extends Error{exitCode;hint;constructor(o,u){super(o),this.name="CliUserError",this.exitCode=u?.exitCode??1,this.hint=u?.hint;}},y=class extends d{constructor(o,u){super(o,{exitCode:2,hint:u?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},f=class extends Error{cause;constructor(o,u){super(o),this.name="CliInternalError",this.cause=u;}};var C=null;function k(n){C=n;}function g(){if(!C)throw new f("vibecontrols module helpers used before setHelpersContext was called");return C}function Y(){let n=g();if(!n.auth.isAuthenticated())throw new y("Authentication required.",{hint:`Run \`${n.productName} auth login\` to authenticate.`})}async function c(n,o){return Y(),g().gql.workspace.request(n,o)}function p(n){let o=n instanceof Error?n.message:String(n);throw new d(o)}function l(n,o,u){g().output.formatAndOutput(n,o,u);}function m(n){g().output.printSuccess(n);}function I(n){g().output.printWarning(n);}function w(n){return g().output.formatStatus(n)}function T(n){return g().output.formatDate(n)}function h(n,o){return g().output.truncate(n,o)}var E=`
|
|
2
2
|
query ListGroups($filter: GroupFilter, $first: Int, $after: String, $sort: GroupSort) {
|
|
3
3
|
groups(filter: $filter, first: $first, after: $after, sort: $sort) {
|
|
4
4
|
edges { node { id name groupType visibility status memberCount createdAt } }
|
|
5
5
|
pageInfo { hasNextPage endCursor }
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
`,
|
|
8
|
+
`,v=`
|
|
9
9
|
query GetGroup($id: ID!) {
|
|
10
10
|
group(id: $id) {
|
|
11
11
|
id name description groupType visibility status scope membershipType memberCount createdAt updatedAt
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
14
|
+
`,A=`
|
|
15
15
|
mutation CreateGroup($input: CreateGroupInput!) {
|
|
16
16
|
createGroup(input: $input) {
|
|
17
17
|
id name groupType visibility status
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
`,
|
|
20
|
+
`,O=`
|
|
21
21
|
mutation UpdateGroup($id: ID!, $input: UpdateGroupInput!) {
|
|
22
22
|
updateGroup(id: $id, input: $input) {
|
|
23
23
|
id name description visibility status updatedAt
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,R=`
|
|
27
27
|
mutation DeleteGroup($id: ID!) {
|
|
28
28
|
deleteGroup(id: $id)
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
30
|
+
`,S=`
|
|
31
31
|
mutation ArchiveGroup($id: ID!) {
|
|
32
32
|
archiveGroup(id: $id) { id status }
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
`,$=`
|
|
35
35
|
query ListGroupMembers($groupId: ID!, $first: Int, $after: String) {
|
|
36
36
|
groupMembers(groupId: $groupId, first: $first, after: $after) {
|
|
37
37
|
edges { node { id entityId entityType role invitationStatus joinedAt } }
|
|
@@ -42,26 +42,27 @@
|
|
|
42
42
|
mutation AddGroupMembers($groupId: ID!, $members: [AddMemberInput!]!) {
|
|
43
43
|
addGroupMembers(groupId: $groupId, members: $members) {
|
|
44
44
|
added { id entityId entityType role invitationStatus }
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
successCount
|
|
46
|
+
failedCount
|
|
47
|
+
failed { entityId entityType error }
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
|
-
|
|
50
|
+
`,P=`
|
|
50
51
|
mutation RemoveGroupMembers($groupId: ID!, $membershipIds: [ID!]!) {
|
|
51
52
|
removeGroupMembers(groupId: $groupId, membershipIds: $membershipIds) {
|
|
52
53
|
removed
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
`,
|
|
56
|
+
`,D=`
|
|
56
57
|
query GroupAuditLogs($groupId: ID!, $first: Int, $after: String) {
|
|
57
58
|
groupAuditLogs(groupId: $groupId, first: $first, after: $after) {
|
|
58
|
-
id
|
|
59
|
+
id eventType actorId actorType description createdAt
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
|
-
`,
|
|
62
|
-
query EntityGroups($entityId: ID!, $entityType:
|
|
62
|
+
`,L=`
|
|
63
|
+
query EntityGroups($entityId: ID!, $entityType: String!, $first: Int) {
|
|
63
64
|
entityGroups(entityId: $entityId, entityType: $entityType, first: $first) {
|
|
64
65
|
edges { node { id name groupType visibility memberCount } }
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
|
-
`;function
|
|
68
|
+
`;function _(n){let o=n.command("groups").description("Group management");o.command("list").description("List groups").option("--type <t>","Filter by groupType").option("--status <s>","Filter by status").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t={};e.type&&(t.groupType=e.type.toUpperCase()),e.status&&(t.status=e.status.toUpperCase());let a=(await c(E,{filter:Object.keys(t).length?t:void 0,first:e.limit})).groups.edges.map(i=>i.node);l(e,a,{headers:["ID","Name","Type","Visibility","Status","Members"],rows:a.map(i=>[h(i.id,12),i.name,i.groupType??"-",i.visibility??"-",w(i.status),String(i.memberCount??0)])});}catch(t){p(t);}}),o.command("get").description("Get a group by id").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let r=await c(v,{id:e});if(!r.group)throw new d(`Group ${e} not found`);l(t,r.group);}catch(r){p(r);}}),o.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 e=>{try{let t={name:e.name,description:e.description,groupType:(e.type??"TEAM").toUpperCase(),visibility:(e.visibility??"PRIVATE").toUpperCase(),scope:(e.scope??"WORKSPACE").toUpperCase(),membershipType:(e.membership??"STATIC").toUpperCase()},r=await c(A,{input:t});m(`Group created: ${r.createGroup.name}`),l(e,r.createGroup);}catch(t){p(t);}}),o.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(e,t)=>{try{let r={};if(t.name&&(r.name=t.name),t.description!==void 0&&(r.description=t.description),t.visibility&&(r.visibility=t.visibility.toUpperCase()),t.status&&(r.status=t.status.toUpperCase()),!Object.keys(r).length)throw new d("No updates specified");let a=await c(O,{id:e,input:r});m("Group updated"),l(t,a.updateGroup);}catch(r){p(r);}}),o.command("delete").description("Delete a group (use --archive for soft delete)").argument("<id>").option("--archive","Archive instead of hard delete",false).action(async(e,t)=>{try{t.archive?(await c(S,{id:e}),m("Group archived")):(await c(R,{id:e}),m("Group deleted"));}catch(r){p(r);}});let u=o.command("members").description("Group membership");u.command("list").description("List members of a group").argument("<groupId>").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async(e,t)=>{try{let a=(await c($,{groupId:e,first:t.limit})).groupMembers.edges.map(i=>i.node);l(t,a,{headers:["MembershipID","Entity","Type","Role","Status","Joined"],rows:a.map(i=>[h(i.id,12),h(i.entityId,12),i.entityType??"-",i.role??"-",w(i.invitationStatus),T(i.joinedAt)])});}catch(r){p(r);}}),u.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 e=>{try{let t={entityId:e.entity,entityType:(e.entityType??"USER").toUpperCase(),role:(e.role??"MEMBER").toUpperCase()},a=(await c(G,{groupId:e.group,members:[t]})).addGroupMembers;m(`Added ${a.successCount} member(s)`);for(let i of a.failed)I(`Could not add ${i.entityType} ${i.entityId}: ${i.error}`);l(e,a.added);}catch(t){p(t);}}),u.command("remove").description("Remove members by membership id").requiredOption("--group <id>").requiredOption("--membership <ids>","Comma-separated membership ids").action(async e=>{try{let t=e.membership.split(",").filter(Boolean);await c(P,{groupId:e.group,membershipIds:t}),m(`Removed ${t.length} membership(s)`);}catch(t){p(t);}}),o.command("hierarchy").description("Show entity-group hierarchy for a user/entity").argument("<entityId>").option("--type <t>","USER|GROUP","USER").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async(e,t)=>{try{let r=await c(L,{entityId:e,entityType:(t.type??"USER").toUpperCase(),first:t.limit});l(t,r.entityGroups.edges.map(a=>a.node));}catch(r){p(r);}}),o.command("activity").description("Audit log for a group").argument("<groupId>").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async(e,t)=>{try{let r=await c(D,{groupId:e,first:t.limit});l(t,r.groupAuditLogs);}catch(r){p(r);}});}var J={id:"groups",version:"1.0.0",displayName:"Groups",dependsOn:["auth","workspaces"],register(n,o){k(o),_(n);}},st=J;module.exports=st;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {a,b,h as h$1,p,n,g,i,o as o$1}from'../../chunk-SQSFZFQZ.js';import {o}from'../../chunk-UAFYTYK6.js';var
|
|
1
|
+
import {a,b,h as h$1,p,n,g,i,o as o$1,l}from'../../chunk-SQSFZFQZ.js';import {o}from'../../chunk-UAFYTYK6.js';var E=`
|
|
2
2
|
query ListGroups($filter: GroupFilter, $first: Int, $after: String, $sort: GroupSort) {
|
|
3
3
|
groups(filter: $filter, first: $first, after: $after, sort: $sort) {
|
|
4
4
|
edges { node { id name groupType visibility status memberCount createdAt } }
|
|
5
5
|
pageInfo { hasNextPage endCursor }
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
`,
|
|
8
|
+
`,R=`
|
|
9
9
|
query GetGroup($id: ID!) {
|
|
10
10
|
group(id: $id) {
|
|
11
11
|
id name description groupType visibility status scope membershipType memberCount createdAt updatedAt
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
14
|
+
`,T=`
|
|
15
15
|
mutation CreateGroup($input: CreateGroupInput!) {
|
|
16
16
|
createGroup(input: $input) {
|
|
17
17
|
id name groupType visibility status
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
`,
|
|
20
|
+
`,C=`
|
|
21
21
|
mutation UpdateGroup($id: ID!, $input: UpdateGroupInput!) {
|
|
22
22
|
updateGroup(id: $id, input: $input) {
|
|
23
23
|
id name description visibility status updatedAt
|
|
@@ -31,37 +31,38 @@ import {a,b,h as h$1,p,n,g,i,o as o$1}from'../../chunk-SQSFZFQZ.js';import {o}fr
|
|
|
31
31
|
mutation ArchiveGroup($id: ID!) {
|
|
32
32
|
archiveGroup(id: $id) { id status }
|
|
33
33
|
}
|
|
34
|
-
`,
|
|
34
|
+
`,h=`
|
|
35
35
|
query ListGroupMembers($groupId: ID!, $first: Int, $after: String) {
|
|
36
36
|
groupMembers(groupId: $groupId, first: $first, after: $after) {
|
|
37
37
|
edges { node { id entityId entityType role invitationStatus joinedAt } }
|
|
38
38
|
pageInfo { hasNextPage endCursor }
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
`,
|
|
41
|
+
`,O=`
|
|
42
42
|
mutation AddGroupMembers($groupId: ID!, $members: [AddMemberInput!]!) {
|
|
43
43
|
addGroupMembers(groupId: $groupId, members: $members) {
|
|
44
44
|
added { id entityId entityType role invitationStatus }
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
successCount
|
|
46
|
+
failedCount
|
|
47
|
+
failed { entityId entityType error }
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
|
-
|
|
50
|
+
`,$=`
|
|
50
51
|
mutation RemoveGroupMembers($groupId: ID!, $membershipIds: [ID!]!) {
|
|
51
52
|
removeGroupMembers(groupId: $groupId, membershipIds: $membershipIds) {
|
|
52
53
|
removed
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
+
`,M=`
|
|
56
57
|
query GroupAuditLogs($groupId: ID!, $first: Int, $after: String) {
|
|
57
58
|
groupAuditLogs(groupId: $groupId, first: $first, after: $after) {
|
|
58
|
-
id
|
|
59
|
+
id eventType actorId actorType description createdAt
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
|
-
`,
|
|
62
|
-
query EntityGroups($entityId: ID!, $entityType:
|
|
62
|
+
`,P=`
|
|
63
|
+
query EntityGroups($entityId: ID!, $entityType: String!, $first: Int) {
|
|
63
64
|
entityGroups(entityId: $entityId, entityType: $entityType, first: $first) {
|
|
64
65
|
edges { node { id name groupType visibility memberCount } }
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
|
-
`;function
|
|
68
|
+
`;function S(u){let p$1=u.command("groups").description("Group management");p$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 o=(await b(E,{filter:Object.keys(e).length?e:void 0,first:t.limit})).groups.edges.map(i=>i.node);h$1(t,o,{headers:["ID","Name","Type","Visibility","Status","Members"],rows:o.map(i=>[p(i.id,12),i.name,i.groupType??"-",i.visibility??"-",n(i.status),String(i.memberCount??0)])});}catch(e){g(e);}}),p$1.command("get").description("Get a group by id").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let r=await b(R,{id:t});if(!r.group)throw new o(`Group ${t} not found`);h$1(e,r.group);}catch(r){g(r);}}),p$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(T,{input:e});i(`Group created: ${r.createGroup.name}`),h$1(t,r.createGroup);}catch(e){g(e);}}),p$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("No updates specified");let o$1=await b(C,{id:t,input:r});i("Group updated"),h$1(e,o$1.updateGroup);}catch(r){g(r);}}),p$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}),i("Group archived")):(await b(A,{id:t}),i("Group deleted"));}catch(r){g(r);}});let c=p$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 o=(await b(h,{groupId:t,first:e.limit})).groupMembers.edges.map(i=>i.node);h$1(e,o,{headers:["MembershipID","Entity","Type","Role","Status","Joined"],rows:o.map(i=>[p(i.id,12),p(i.entityId,12),i.entityType??"-",i.role??"-",n(i.invitationStatus),o$1(i.joinedAt)])});}catch(r){g(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()},o=(await b(O,{groupId:t.group,members:[e]})).addGroupMembers;i(`Added ${o.successCount} member(s)`);for(let i of o.failed)l(`Could not add ${i.entityType} ${i.entityId}: ${i.error}`);h$1(t,o.added);}catch(e){g(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($,{groupId:t.group,membershipIds:e}),i(`Removed ${e.length} membership(s)`);}catch(e){g(e);}}),p$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(P,{entityId:t,entityType:(e.type??"USER").toUpperCase(),first:e.limit});h$1(e,r.entityGroups.edges.map(o=>o.node));}catch(r){g(r);}}),p$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(M,{groupId:t,first:e.limit});h$1(e,r.groupAuditLogs);}catch(r){g(r);}});}var _={id:"groups",version:"1.0.0",displayName:"Groups",dependsOn:["auth","workspaces"],register(u,p){a(p),S(u);}},q=_;export{q as default};
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
deleteKeyboardShortcut(id: $id)
|
|
51
51
|
}
|
|
52
52
|
`,D=`
|
|
53
|
-
query ListContentPages($productId:
|
|
53
|
+
query ListContentPages($productId: String, $filter: ContentPageFilterInput, $limit: Int) {
|
|
54
54
|
contentPages(productId: $productId, filter: $filter, limit: $limit) {
|
|
55
55
|
items { id slug title visibility isPublished }
|
|
56
56
|
}
|
|
@@ -50,7 +50,7 @@ import {a,c,h as h$1,p,n,g,i}from'../../chunk-SQSFZFQZ.js';import {o}from'../../
|
|
|
50
50
|
deleteKeyboardShortcut(id: $id)
|
|
51
51
|
}
|
|
52
52
|
`,S=`
|
|
53
|
-
query ListContentPages($productId:
|
|
53
|
+
query ListContentPages($productId: String, $filter: ContentPageFilterInput, $limit: Int) {
|
|
54
54
|
contentPages(productId: $productId, filter: $filter, limit: $limit) {
|
|
55
55
|
items { id slug title visibility isPublished }
|
|
56
56
|
}
|
|
@@ -77,13 +77,13 @@ import {a,c,h as h$1,p,n,g,i}from'../../chunk-SQSFZFQZ.js';import {o}from'../../
|
|
|
77
77
|
items { id key name flagType status defaultValue category productId }
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
`,
|
|
80
|
+
`,v=`
|
|
81
81
|
mutation CreateFeatureFlag($input: CreateFeatureFlagInput!) {
|
|
82
82
|
createFeatureFlag(input: $input) {
|
|
83
83
|
id key name flagType status
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
`,
|
|
86
|
+
`,D=`
|
|
87
87
|
mutation UpdateFeatureFlag($id: ID!, $input: UpdateFeatureFlagInput!) {
|
|
88
88
|
updateFeatureFlag(id: $id, input: $input) {
|
|
89
89
|
id key status defaultValue
|
|
@@ -99,4 +99,4 @@ import {a,c,h as h$1,p,n,g,i}from'../../chunk-SQSFZFQZ.js';import {o}from'../../
|
|
|
99
99
|
evaluations { key flagType value variant reason }
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
`;function N(m){let d=m.command("products").description("Platform products, shortcuts, content-pages, feature-flags");d.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 i=await c(b,{filter:Object.keys(e).length?e:void 0,limit:t.limit,offset:0});h$1(t,i.platformProducts.items,{headers:["ID","Name","Slug","Status"],rows:i.platformProducts.items.map(a=>[p(a.id,12),a.name,a.slug??"-",n(a.status)])});}catch(e){g(e);}}),d.command("get").description("Get a product").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let i=await c(h,{id:t});if(!i.platformProduct)throw new o(`Product ${t} not found`);h$1(e,i.platformProduct);}catch(i){g(i);}}),d.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},i$1=await c(T,{input:e});i(`Product created: ${i$1.createPlatformProduct.name}`),h$1(t,i$1.createPlatformProduct);}catch(e){g(e);}}),d.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 i$1={};if(e.name&&(i$1.name=e.name),e.description!==void 0&&(i$1.description=e.description),e.status&&(i$1.status=e.status.toUpperCase()),!Object.keys(i$1).length)throw new o("No updates specified");let a=await c(C,{id:t,input:i$1});i("Product updated"),h$1(e,a.updatePlatformProduct);}catch(i){g(i);}}),d.command("delete").description("Delete a product").argument("<id>").action(async t=>{try{await c(F,{id:t}),i("Product deleted");}catch(e){g(e);}});let l=d.command("shortcuts").description("Keyboard shortcuts");l.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 i=await c(U,{filter:Object.keys(e).length?e:void 0,limit:t.limit});h$1(t,i.keyboardShortcuts.items,{headers:["ID","Label","Key","Category","Event","Enabled"],rows:i.keyboardShortcuts.items.map(a=>[p(a.id,12),a.label,a.shortcutKey,a.category??"-",a.eventName??"-",String(!!a.isEnabled)])});}catch(e){g(e);}}),l.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},i$1=await c(w,{input:e});i("Shortcut created"),h$1(t,i$1.createKeyboardShortcut);}catch(e){g(e);}}),l.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 i$1={};if(e.label&&(i$1.label=e.label),e.key&&(i$1.shortcutKey=e.key),e.enabled!==void 0&&(i$1.isEnabled=e.enabled==="true"),!Object.keys(i$1).length)throw new o("No updates specified");let a=await c(R,{id:t,input:i$1});i("Shortcut updated"),h$1(e,a.updateKeyboardShortcut);}catch(i){g(i);}}),l.command("delete").description("Delete a shortcut").argument("<id>").action(async t=>{try{await c(I,{id:t}),i("Shortcut deleted");}catch(e){g(e);}});let g$1=d.command("content-pages").description("Content pages (legal, marketing)");g$1.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 i=await c(S,{productId:t.product,filter:Object.keys(e).length?e:void 0,limit:t.limit});h$1(t,i.contentPages.items,{headers:["ID","Slug","Title","Visibility","Published"],rows:i.contentPages.items.map(a=>[p(a.id,12),a.slug,p(a.title,40),a.visibility??"-",String(!!a.isPublished)])});}catch(e){g(e);}}),g$1.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},i$1=await c(O,{input:e});i("Content page created"),h$1(t,i$1.createContentPage);}catch(e){g(e);}}),g$1.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 i$1={};if(e.title&&(i$1.title=e.title),e.content!==void 0&&(i$1.content=e.content),e.visibility&&(i$1.visibility=e.visibility.toUpperCase()),e.published!==void 0&&(i$1.isPublished=e.published==="true"),!Object.keys(i$1).length)throw new o("No updates specified");let a=await c(A,{id:t,input:i$1});i("Content page updated"),h$1(e,a.updateContentPage);}catch(i){g(i);}}),g$1.command("delete").description("Delete a content page").argument("<id>").action(async t=>{try{await c(k,{id:t}),i("Content page deleted");}catch(e){g(e);}});let p$1=d.command("feature-flags").description("Feature flag administration (highest SRE/ops value)");p$1.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 i=await c($,{filter:Object.keys(e).length?e:void 0,limit:t.limit});h$1(t,i.featureFlags.items,{headers:["ID","Key","Type","Status","Default"],rows:i.featureFlags.items.map(a=>[p(a.id,12),a.key,a.flagType??"-",n(a.status),String(a.defaultValue)])});}catch(e){g(e);}}),p$1.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},i$1=await c(
|
|
102
|
+
`;function N(m){let d=m.command("products").description("Platform products, shortcuts, content-pages, feature-flags");d.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 i=await c(b,{filter:Object.keys(e).length?e:void 0,limit:t.limit,offset:0});h$1(t,i.platformProducts.items,{headers:["ID","Name","Slug","Status"],rows:i.platformProducts.items.map(a=>[p(a.id,12),a.name,a.slug??"-",n(a.status)])});}catch(e){g(e);}}),d.command("get").description("Get a product").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let i=await c(h,{id:t});if(!i.platformProduct)throw new o(`Product ${t} not found`);h$1(e,i.platformProduct);}catch(i){g(i);}}),d.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},i$1=await c(T,{input:e});i(`Product created: ${i$1.createPlatformProduct.name}`),h$1(t,i$1.createPlatformProduct);}catch(e){g(e);}}),d.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 i$1={};if(e.name&&(i$1.name=e.name),e.description!==void 0&&(i$1.description=e.description),e.status&&(i$1.status=e.status.toUpperCase()),!Object.keys(i$1).length)throw new o("No updates specified");let a=await c(C,{id:t,input:i$1});i("Product updated"),h$1(e,a.updatePlatformProduct);}catch(i){g(i);}}),d.command("delete").description("Delete a product").argument("<id>").action(async t=>{try{await c(F,{id:t}),i("Product deleted");}catch(e){g(e);}});let l=d.command("shortcuts").description("Keyboard shortcuts");l.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 i=await c(U,{filter:Object.keys(e).length?e:void 0,limit:t.limit});h$1(t,i.keyboardShortcuts.items,{headers:["ID","Label","Key","Category","Event","Enabled"],rows:i.keyboardShortcuts.items.map(a=>[p(a.id,12),a.label,a.shortcutKey,a.category??"-",a.eventName??"-",String(!!a.isEnabled)])});}catch(e){g(e);}}),l.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},i$1=await c(w,{input:e});i("Shortcut created"),h$1(t,i$1.createKeyboardShortcut);}catch(e){g(e);}}),l.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 i$1={};if(e.label&&(i$1.label=e.label),e.key&&(i$1.shortcutKey=e.key),e.enabled!==void 0&&(i$1.isEnabled=e.enabled==="true"),!Object.keys(i$1).length)throw new o("No updates specified");let a=await c(R,{id:t,input:i$1});i("Shortcut updated"),h$1(e,a.updateKeyboardShortcut);}catch(i){g(i);}}),l.command("delete").description("Delete a shortcut").argument("<id>").action(async t=>{try{await c(I,{id:t}),i("Shortcut deleted");}catch(e){g(e);}});let g$1=d.command("content-pages").description("Content pages (legal, marketing)");g$1.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 i=await c(S,{productId:t.product,filter:Object.keys(e).length?e:void 0,limit:t.limit});h$1(t,i.contentPages.items,{headers:["ID","Slug","Title","Visibility","Published"],rows:i.contentPages.items.map(a=>[p(a.id,12),a.slug,p(a.title,40),a.visibility??"-",String(!!a.isPublished)])});}catch(e){g(e);}}),g$1.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},i$1=await c(O,{input:e});i("Content page created"),h$1(t,i$1.createContentPage);}catch(e){g(e);}}),g$1.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 i$1={};if(e.title&&(i$1.title=e.title),e.content!==void 0&&(i$1.content=e.content),e.visibility&&(i$1.visibility=e.visibility.toUpperCase()),e.published!==void 0&&(i$1.isPublished=e.published==="true"),!Object.keys(i$1).length)throw new o("No updates specified");let a=await c(A,{id:t,input:i$1});i("Content page updated"),h$1(e,a.updateContentPage);}catch(i){g(i);}}),g$1.command("delete").description("Delete a content page").argument("<id>").action(async t=>{try{await c(k,{id:t}),i("Content page deleted");}catch(e){g(e);}});let p$1=d.command("feature-flags").description("Feature flag administration (highest SRE/ops value)");p$1.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 i=await c($,{filter:Object.keys(e).length?e:void 0,limit:t.limit});h$1(t,i.featureFlags.items,{headers:["ID","Key","Type","Status","Default"],rows:i.featureFlags.items.map(a=>[p(a.id,12),a.key,a.flagType??"-",n(a.status),String(a.defaultValue)])});}catch(e){g(e);}}),p$1.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},i$1=await c(v,{input:e});i(`Feature flag created: ${i$1.createFeatureFlag.key}`),h$1(t,i$1.createFeatureFlag);}catch(e){g(e);}}),p$1.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 i$1={};if(e.name&&(i$1.name=e.name),e.default!==void 0&&(i$1.defaultValue=JSON.parse(e.default)),e.status&&(i$1.status=e.status.toUpperCase()),!Object.keys(i$1).length)throw new o("No updates specified");let a=await c(D,{id:t,input:i$1});i("Feature flag updated"),h$1(e,a.updateFeatureFlag);}catch(i){g(i);}}),p$1.command("delete").description("Delete a feature flag").argument("<id>").action(async t=>{try{await c(_,{id:t}),i("Feature flag deleted");}catch(e){g(e);}}),p$1.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(",")},i=await c(L,{input:e});h$1(t,i.evaluateFeatureFlags.evaluations);}catch(e){g(e);}});}var q={id:"products",version:"1.0.0",displayName:"Platform Products",dependsOn:["auth"],register(m,d){a(d),N(m);}},J=q;export{J as default};
|