@burdenoff/cli-sdk 2026.525.1 → 2026.525.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/chunk-REBBLQFS.js +1551 -0
- package/dist/modules/auth/index.cjs +34 -34
- package/dist/modules/auth/index.js +1 -1
- package/dist/modules/conversations/index.cjs +125 -7
- package/dist/modules/conversations/index.js +124 -6
- package/dist/modules/export/index.cjs +63 -5
- package/dist/modules/export/index.js +63 -5
- package/dist/modules/integrations/index.cjs +92 -8
- package/dist/modules/integrations/index.js +92 -8
- package/dist/modules/sandbox/index.cjs +154 -13
- package/dist/modules/sandbox/index.js +1 -1
- package/dist/modules/scheduler/index.cjs +116 -6
- package/dist/modules/scheduler/index.js +116 -6
- package/dist/modules/vibecontrols/index.cjs +871 -336
- package/dist/modules/vibecontrols/index.js +6 -2
- package/package.json +1 -1
- package/dist/chunk-MRONTCXQ.js +0 -879
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {a,b,g,o,n,f,r,h}from'../../chunk-KTKHJORN.js';import {o as o$1}from'../../chunk-RNWXATAC.js';var
|
|
1
|
+
import {a,b as b$1,g,o,n,f,r,h as h$1}from'../../chunk-KTKHJORN.js';import {o as o$1}from'../../chunk-RNWXATAC.js';var l=`
|
|
2
2
|
query ListConversations($filter: ConversationFilter, $first: Int, $after: String) {
|
|
3
3
|
conversations(filter: $filter, first: $first, after: $after) {
|
|
4
4
|
edges { node { id title type description createdAt updatedAt unreadCount } }
|
|
5
5
|
pageInfo { hasNextPage endCursor }
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
`,
|
|
8
|
+
`,R=`
|
|
9
9
|
query GetConversation($id: ID!) {
|
|
10
10
|
conversation(id: $id) {
|
|
11
11
|
id title type description avatarUrl settings
|
|
@@ -18,20 +18,138 @@ import {a,b,g,o,n,f,r,h}from'../../chunk-KTKHJORN.js';import {o as o$1}from'../.
|
|
|
18
18
|
conversation { id title type }
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
`,
|
|
21
|
+
`,y=`
|
|
22
22
|
mutation DeleteConversation($id: ID!) {
|
|
23
23
|
deleteConversation(id: $id) { success }
|
|
24
24
|
}
|
|
25
|
-
`,
|
|
25
|
+
`,T=`
|
|
26
26
|
mutation UpdateConversation($input: UpdateConversationInput!) {
|
|
27
27
|
updateConversation(input: $input) {
|
|
28
28
|
conversation { id title description }
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
`,
|
|
31
|
+
`,O=`
|
|
32
32
|
mutation SendMessage($input: SendMessageInput!) {
|
|
33
33
|
sendMessage(input: $input) {
|
|
34
34
|
message { id content type createdAt }
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
`;
|
|
37
|
+
`;var S=`
|
|
38
|
+
mutation EditMessage($input: EditMessageInput!) {
|
|
39
|
+
editMessage(input: $input) { id content isEdited editedAt }
|
|
40
|
+
}
|
|
41
|
+
`,$=`
|
|
42
|
+
mutation DeleteMessage($id: ID!, $hard: Boolean) {
|
|
43
|
+
deleteMessage(id: $id, hard: $hard) { success messageId }
|
|
44
|
+
}
|
|
45
|
+
`,D=`
|
|
46
|
+
mutation ForwardMessage($messageId: ID!, $targetConversationId: ID!) {
|
|
47
|
+
forwardMessage(messageId: $messageId, targetConversationId: $targetConversationId) {
|
|
48
|
+
success message { id conversationId content createdAt }
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
`,M=`
|
|
52
|
+
mutation PinMessage($messageId: ID!) {
|
|
53
|
+
pinMessage(messageId: $messageId) { id isPinned pinnedAt }
|
|
54
|
+
}
|
|
55
|
+
`,_=`
|
|
56
|
+
mutation UnpinMessage($messageId: ID!) {
|
|
57
|
+
unpinMessage(messageId: $messageId) { id isPinned }
|
|
58
|
+
}
|
|
59
|
+
`,h=`
|
|
60
|
+
query SearchMessages($query: String!, $conversationId: ID, $first: Int) {
|
|
61
|
+
searchMessages(query: $query, conversationId: $conversationId, first: $first) {
|
|
62
|
+
edges { node { id conversationId authorId content type createdAt } }
|
|
63
|
+
totalCount
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
`,x=`
|
|
67
|
+
query Draft($conversationId: ID!) {
|
|
68
|
+
draft(conversationId: $conversationId) {
|
|
69
|
+
id conversationId content parentMessageId createdAt updatedAt
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`,w=`
|
|
73
|
+
mutation SaveDraft($input: SaveDraftInput!) {
|
|
74
|
+
saveDraft(input: $input) { id conversationId content updatedAt }
|
|
75
|
+
}
|
|
76
|
+
`,P=`
|
|
77
|
+
mutation DeleteDraft($conversationId: ID!) {
|
|
78
|
+
deleteDraft(conversationId: $conversationId) { success conversationId }
|
|
79
|
+
}
|
|
80
|
+
`,U=`
|
|
81
|
+
mutation AddReaction($messageId: ID!, $emoji: String!) {
|
|
82
|
+
addReaction(messageId: $messageId, emoji: $emoji) {
|
|
83
|
+
id messageId userId emoji createdAt
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
`,V=`
|
|
87
|
+
mutation RemoveReaction($messageId: ID!, $emoji: String!) {
|
|
88
|
+
removeReaction(messageId: $messageId, emoji: $emoji) { success messageId emoji }
|
|
89
|
+
}
|
|
90
|
+
`,k=`
|
|
91
|
+
mutation AddParticipant($input: AddParticipantInput!) {
|
|
92
|
+
addParticipant(input: $input) { id conversationId userId createdAt }
|
|
93
|
+
}
|
|
94
|
+
`,L=`
|
|
95
|
+
mutation RemoveParticipant($input: RemoveParticipantInput!) {
|
|
96
|
+
removeParticipant(input: $input) { success conversationId userId }
|
|
97
|
+
}
|
|
98
|
+
`,G=`
|
|
99
|
+
mutation UpdateParticipantRole($input: UpdateParticipantRoleInput!) {
|
|
100
|
+
updateParticipantRole(input: $input) { id conversationId userId }
|
|
101
|
+
}
|
|
102
|
+
`,q=`
|
|
103
|
+
mutation LeaveConversation($conversationId: ID!) {
|
|
104
|
+
leaveConversation(conversationId: $conversationId) { success conversationId }
|
|
105
|
+
}
|
|
106
|
+
`,j=`
|
|
107
|
+
mutation ArchiveConversation($id: ID!) {
|
|
108
|
+
archiveConversation(id: $id) { id state }
|
|
109
|
+
}
|
|
110
|
+
`,b=`
|
|
111
|
+
mutation UnarchiveConversation($id: ID!) {
|
|
112
|
+
unarchiveConversation(id: $id) { id state }
|
|
113
|
+
}
|
|
114
|
+
`,F=`
|
|
115
|
+
mutation MuteConversation($conversationId: ID!, $until: DateTime) {
|
|
116
|
+
muteConversation(conversationId: $conversationId, until: $until) {
|
|
117
|
+
id conversationId userId
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
`,H=`
|
|
121
|
+
mutation UnmuteConversation($conversationId: ID!) {
|
|
122
|
+
unmuteConversation(conversationId: $conversationId) { id conversationId userId }
|
|
123
|
+
}
|
|
124
|
+
`,K=`
|
|
125
|
+
mutation PinConversation($conversationId: ID!) {
|
|
126
|
+
pinConversation(conversationId: $conversationId) { id conversationId userId }
|
|
127
|
+
}
|
|
128
|
+
`,J=`
|
|
129
|
+
mutation UnpinConversation($conversationId: ID!) {
|
|
130
|
+
unpinConversation(conversationId: $conversationId) { id conversationId userId }
|
|
131
|
+
}
|
|
132
|
+
`,B=`
|
|
133
|
+
mutation MarkConversationAsRead($conversationId: ID!, $messageId: ID) {
|
|
134
|
+
markConversationAsRead(conversationId: $conversationId, messageId: $messageId) {
|
|
135
|
+
id conversationId userId
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
`,W=`
|
|
139
|
+
mutation CreateInviteLink($input: CreateInviteLinkInput!) {
|
|
140
|
+
createInviteLink(input: $input) {
|
|
141
|
+
code url currentUses maxUses expiresAt createdAt
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
`,z=`
|
|
145
|
+
mutation JoinViaInviteLink($code: String!) {
|
|
146
|
+
joinViaInviteLink(code: $code) { id conversationId userId createdAt }
|
|
147
|
+
}
|
|
148
|
+
`,X=`
|
|
149
|
+
query ValidateInviteLink($code: String!) {
|
|
150
|
+
validateInviteLink(code: $code) {
|
|
151
|
+
valid usesRemaining expiresAt
|
|
152
|
+
conversation { id title type }
|
|
153
|
+
}
|
|
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$1=>{try{let t={};n$1.type&&(t.type=n$1.type.toUpperCase());let i=(await b$1(l,{filter:Object.keys(t).length?t:void 0,first:n$1.limit})).conversations.edges.map(p=>p.node);g(n$1,i,{headers:["ID","Title","Type","Unread","Created"],rows:i.map(p=>[o(p.id,12),p.title??"-",p.type??"-",String(p.unreadCount??0),n(p.createdAt)])});}catch(t){f(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`);g(t,e.conversation);}catch(e){f(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=r().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=await b$1(N,{input:e});h$1("Conversation created"),g(n,i.createConversation.conversation);}catch(t){f(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=await b$1(T,{input:e});h$1("Conversation updated"),g(t,i.updateConversation.conversation);}catch(e){f(e);}}),o$2.command("delete").description("Delete a conversation").argument("<id>").action(async n=>{try{await b$1(y,{id:n}),h$1("Conversation deleted");}catch(t){f(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=await b$1(O,{input:e});h$1("Message sent"),g(t,i.sendMessage.message);}catch(e){f(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=await b$1(S,{input:e});h$1("Message edited"),g(t,i.editMessage);}catch(e){f(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}),h$1("Message deleted");}catch(e){f(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});h$1("Message forwarded"),g(t,e.forwardMessage.message);}catch(e){f(e);}}),o$1.command("pin").description("Pin a message").argument("<messageId>").action(async n=>{try{await b$1(M,{messageId:n}),h$1("Message pinned");}catch(t){f(t);}}),o$1.command("unpin").description("Unpin a message").argument("<messageId>").action(async n=>{try{await b$1(_,{messageId:n}),h$1("Message unpinned");}catch(t){f(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$1=>{try{let e=(await b$1(h,{query:n$1.query,conversationId:n$1.conversation,first:n$1.limit})).searchMessages.edges.map(i=>i.node);g(n$1,e,{headers:["ID","Conversation","Author","Created"],rows:e.map(i=>[o(i.id,12),o(i.conversationId??"-",12),o(i.authorId??"-",12),n(i.createdAt)])});}catch(t){f(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){h$1("No draft saved");return}g(t,e.draft);}catch(e){f(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=await b$1(w,{input:e});h$1("Draft saved"),g(t,i.saveDraft);}catch(e){f(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}),h$1("Draft deleted");}catch(t){f(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(U,{messageId:n,emoji:t.emoji});h$1("Reaction added"),g(t,e.addReaction);}catch(e){f(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(V,{messageId:n,emoji:t.emoji}),h$1("Reaction removed");}catch(e){f(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=await b$1(k,{input:e});h$1("Participant added"),g(t,i.addParticipant);}catch(e){f(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}),h$1("Participant removed");}catch(e){f(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()}}),h$1("Participant role updated");}catch(e){f(e);}});}function ot(d){let o=(t,e,i,p)=>{d.command(t).description(e).argument("<id>").action(async I=>{try{await b$1(i,{id:I}),h$1(p);}catch(g){f(g);}});},n=(t,e,i,p)=>{d.command(t).description(e).argument("<conversationId>").action(async I=>{try{await b$1(i,{conversationId:I}),h$1(p);}catch(g){f(g);}});};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}),h$1("Muted");}catch(i){f(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}),h$1("Marked as read");}catch(i){f(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=await b$1(W,{input:e});h$1("Invite link created"),g(t,i.createInviteLink);}catch(e){f(e);}}),o.command("join").description("Join a conversation via invite code").argument("<code>").action(async n=>{try{await b$1(z,{code:n}),h$1("Joined via invite link");}catch(t){f(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});g(t,e.validateInviteLink);}catch(e){f(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,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var promises=require('fs/promises');var s=class extends Error{exitCode;hint;constructor(r,
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var promises=require('fs/promises');var s=class extends Error{exitCode;hint;constructor(r,a){super(r),this.name="CliUserError",this.exitCode=a?.exitCode??1,this.hint=a?.hint;}},E=class extends s{constructor(r,a){super(r,{exitCode:2,hint:a?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},x=class extends Error{cause;constructor(r,a){super(r),this.name="CliInternalError",this.cause=a;}};var y=null;function k(o){y=o;}function f(){if(!y)throw new x("vibecontrols module helpers used before setHelpersContext was called");return y}function tt(){let o=f();if(!o.auth.isAuthenticated())throw new E(`Authentication required. Run \`${o.productName} auth login\`.`)}async function c(o,r){return tt(),f().gql.workspace.request(o,r)}function p(o){let r=o instanceof Error?o.message:String(o);throw new s(r)}function g(o,r,a){f().output.formatAndOutput(o,r,a);}function m(o){f().output.printSuccess(o);}function I(o){f().output.printInfo(o);}function A(o){return f().output.formatStatus(o)}function v(o){return f().output.formatDate(o)}function $(o,r){return f().output.truncate(o,r)}function O(){return f()}var S=`
|
|
2
2
|
query ListExportJobs($context: ContextInput!, $filter: ExportJobFilterInput, $pagination: ExportPaginationInput) {
|
|
3
3
|
listExportJobs(context: $context, filter: $filter, pagination: $pagination) {
|
|
4
4
|
edges { node {
|
|
@@ -8,20 +8,20 @@
|
|
|
8
8
|
pageInfo { totalCount hasNextPage }
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`,T=`
|
|
12
12
|
query GetExportJob($context: ContextInput, $id: ID!) {
|
|
13
13
|
getExportJob(context: $context, id: $id) {
|
|
14
14
|
id name status progress
|
|
15
15
|
downloadUrl downloadExpiresAt totalSizeBytes
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
`,
|
|
18
|
+
`,P=`
|
|
19
19
|
mutation CreateExportJob($context: ContextInput!, $input: CreateExportJobInput!) {
|
|
20
20
|
createExportJob(context: $context, input: $input) {
|
|
21
21
|
id status progress entityTypes
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
`,
|
|
24
|
+
`,R=`
|
|
25
25
|
query ListExportTemplates($context: ContextInput!, $pagination: ExportPaginationInput) {
|
|
26
26
|
listExportTemplates(context: $context, pagination: $pagination) {
|
|
27
27
|
edges { node { id name entityTypes format includeMedia includeMetadata } }
|
|
@@ -34,4 +34,62 @@
|
|
|
34
34
|
id name entityTypes format
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
`,_=`
|
|
38
|
+
mutation CancelExportJob($context: ContextInput, $id: ID!) {
|
|
39
|
+
cancelExportJob(context: $context, id: $id) {
|
|
40
|
+
id status progress
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
`,L=`
|
|
44
|
+
mutation DeleteExportJob($context: ContextInput, $id: ID!) {
|
|
45
|
+
deleteExportJob(context: $context, id: $id)
|
|
46
|
+
}
|
|
47
|
+
`,N=`
|
|
48
|
+
mutation RetryExportJob($context: ContextInput, $id: ID!) {
|
|
49
|
+
retryExportJob(context: $context, id: $id) {
|
|
50
|
+
id status progress
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`,q=`
|
|
54
|
+
mutation CreateExportTemplate($context: ContextInput, $input: CreateExportTemplateInput!) {
|
|
55
|
+
createExportTemplate(context: $context, input: $input) {
|
|
56
|
+
id name entityTypes format includeMedia includeMetadata
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
`,M=`
|
|
60
|
+
mutation UpdateExportTemplate(
|
|
61
|
+
$context: ContextInput
|
|
62
|
+
$id: ID!
|
|
63
|
+
$input: UpdateExportTemplateInput!
|
|
64
|
+
) {
|
|
65
|
+
updateExportTemplate(context: $context, id: $id, input: $input) {
|
|
66
|
+
id name entityTypes format includeMedia includeMetadata isDefault
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
`,J=`
|
|
70
|
+
mutation DeleteExportTemplate($context: ContextInput, $id: ID!) {
|
|
71
|
+
deleteExportTemplate(context: $context, id: $id)
|
|
72
|
+
}
|
|
73
|
+
`,j=`
|
|
74
|
+
query GetAvailableExportEntities(
|
|
75
|
+
$context: ContextInput!
|
|
76
|
+
$pagination: ExportPaginationInput
|
|
77
|
+
) {
|
|
78
|
+
getAvailableExportEntities(context: $context, pagination: $pagination) {
|
|
79
|
+
edges {
|
|
80
|
+
node {
|
|
81
|
+
entityType displayName description enabled
|
|
82
|
+
supportsDateRange supportsMediaExport estimatedSize
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
pageInfo { totalCount }
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
`,G=`
|
|
89
|
+
query GetExportPart($context: ContextInput, $id: ID!) {
|
|
90
|
+
getExportPart(context: $context, id: $id) {
|
|
91
|
+
id jobId partNumber fileName fileId sizeBytes checksum
|
|
92
|
+
downloadUrl downloadExpiresAt
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
`;function d(){let o=O().auth.read();if(!o?.workspaceId)throw new s("No workspace set. Run: vibecontrols workspace set <id>");return {workspaceId:o.workspaceId}}function F(o){let r=o.command("export").description("Workspace data export jobs"),a=r.command("jobs").description("Export job lifecycle");a.command("list").description("List export jobs").option("--status <s>").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let e={};t.status&&(e.status=t.status.toUpperCase());let i=(await c(S,{context:d(),filter:Object.keys(e).length?e:void 0,pagination:{first:t.limit}})).listExportJobs.edges.map(l=>l.node);g(t,i,{headers:["ID","Name","Status","Progress","Started"],rows:i.map(l=>[$(l.id,12),l.name??"-",A(l.status),`${l.processedEntities??0}/${l.totalEntities??"-"}`,v(l.startedAt)])});}catch(e){p(e);}}),a.command("get").description("Get an export job").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await c(T,{context:d(),id:t});if(!n.getExportJob)throw new s(`Export job ${t} not found`);g(e,n.getExportJob);}catch(n){p(n);}}),a.command("create").description("Create an export job").requiredOption("--name <s>").requiredOption("--types <t>","Comma-separated entity types").option("--format <fmt>","JSON|CSV|ZIP","JSON").option("--include-media","Include media files",false).option("--include-metadata","Include metadata",true).option("--from <iso>","Date range start").option("--to <iso>","Date range end").option("-f, --format-output <format>").action(async t=>{try{let e={name:t.name,entityTypes:t.types.split(","),format:(t.format??"JSON").toUpperCase(),includeMedia:!!t.includeMedia,includeMetadata:t.includeMetadata!==!1,dateRangeStart:t.from,dateRangeEnd:t.to},n=await c(P,{context:d(),input:e});m(`Export job created: ${n.createExportJob.id}`),g({format:t.formatOutput},n.createExportJob);}catch(e){p(e);}}),a.command("cancel").description("Cancel a running export job").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await c(_,{context:d(),id:t});m(`Export job cancelled: ${n.cancelExportJob.id}`),g(e,n.cancelExportJob);}catch(n){p(n);}}),a.command("delete").description("Delete an export job").argument("<id>").action(async t=>{try{if(!(await c(L,{context:d(),id:t})).deleteExportJob)throw new s(`Failed to delete export job ${t}`);m(`Export job deleted: ${t}`);}catch(e){p(e);}}),a.command("retry").description("Retry a failed export job").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await c(N,{context:d(),id:t});m(`Export job retry queued: ${n.retryExportJob.id}`),g(e,n.retryExportJob);}catch(n){p(n);}}),r.command("entities").description("List entity types available for export").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let n=(await c(j,{context:d(),pagination:{first:t.limit}})).getAvailableExportEntities.edges.map(i=>i.node);g(t,n,{headers:["Type","Display","Enabled","DateRange","Media","Size"],rows:n.map(i=>[i.entityType,i.displayName,i.enabled?"yes":"no",i.supportsDateRange?"yes":"no",i.supportsMediaExport?"yes":"no",i.estimatedSize??"-"])});}catch(e){p(e);}}),r.command("part").description("Get an export part by id").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await c(G,{context:d(),id:t});if(!n.getExportPart)throw new s(`Export part ${t} not found`);g(e,n.getExportPart);}catch(n){p(n);}}),r.command("download").description("Download a completed export job to a local path").argument("<jobId>").requiredOption("--to <path>","Local file path to write").action(async(t,e)=>{try{let n=await c(T,{context:d(),id:t});if(!n.getExportJob)throw new s(`Export job ${t} not found`);let i=n.getExportJob.downloadUrl;if(!i)throw new s(`Job ${t} has no downloadUrl yet (status=${n.getExportJob.status??"UNKNOWN"}).`);I(`Downloading from ${i}`);let l=await fetch(i);if(!l.ok)throw new s(`Download failed: ${l.status} ${l.statusText}`);let C=Buffer.from(await l.arrayBuffer());await promises.writeFile(e.to,C),m(`Saved ${C.length} bytes to ${e.to}`);}catch(n){p(n);}});let w=r.command("templates").description("Export templates");w.command("list").description("List export templates").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let e=await c(R,{context:d(),pagination:{first:t.limit}});g(t,e.listExportTemplates.edges.map(n=>n.node));}catch(e){p(e);}}),w.command("get").description("Get an export template").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await c(D,{context:d(),id:t});if(!n.getExportTemplate)throw new s(`Template ${t} not found`);g(e,n.getExportTemplate);}catch(n){p(n);}}),w.command("create").description("Create an export template").requiredOption("--name <s>").requiredOption("--types <t>","Comma-separated entity types").option("--description <s>").option("--format <fmt>","JSON|CSV","JSON").option("--include-media","Include media files",false).option("--include-metadata","Include metadata",true).option("-f, --format-output <format>").action(async t=>{try{let e={name:t.name,entityTypes:t.types.split(","),format:(t.format??"JSON").toUpperCase(),includeMedia:!!t.includeMedia,includeMetadata:t.includeMetadata!==!1};t.description&&(e.description=t.description);let n=await c(q,{context:d(),input:e});m(`Template created: ${n.createExportTemplate.id}`),g({format:t.formatOutput},n.createExportTemplate);}catch(e){p(e);}}),w.command("update").description("Update an export template").argument("<id>").option("--name <s>").option("--description <s>").option("--types <t>","Comma-separated entity types").option("--format <fmt>","JSON|CSV").option("--include-media <bool>","true|false").option("--include-metadata <bool>","true|false").option("--default <bool>","Set isDefault: true|false").option("-f, --format-output <format>").action(async(t,e)=>{try{let n={};e.name&&(n.name=e.name),e.description&&(n.description=e.description),e.types&&(n.entityTypes=e.types.split(",")),e.format&&(n.format=e.format.toUpperCase()),e.includeMedia!==void 0&&(n.includeMedia=e.includeMedia==="true"),e.includeMetadata!==void 0&&(n.includeMetadata=e.includeMetadata==="true"),e.default!==void 0&&(n.isDefault=e.default==="true");let i=await c(M,{context:d(),id:t,input:n});m(`Template updated: ${i.updateExportTemplate.id}`),g({format:e.formatOutput},i.updateExportTemplate);}catch(n){p(n);}}),w.command("delete").description("Delete an export template").argument("<id>").action(async t=>{try{if(!(await c(J,{context:d(),id:t})).deleteExportTemplate)throw new s(`Failed to delete template ${t}`);m(`Template deleted: ${t}`);}catch(e){p(e);}});}var ot={id:"export",version:"1.0.0",displayName:"Export",dependsOn:["auth","workspaces"],register(o,r){k(r),F(o);}},fe=ot;module.exports=fe;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,b,g,o,m
|
|
1
|
+
import {a,b,g,o,m,n,f,h as h$1,j,r}from'../../chunk-KTKHJORN.js';import {o as o$1}from'../../chunk-RNWXATAC.js';import {writeFile}from'fs/promises';var J=`
|
|
2
2
|
query ListExportJobs($context: ContextInput!, $filter: ExportJobFilterInput, $pagination: ExportPaginationInput) {
|
|
3
3
|
listExportJobs(context: $context, filter: $filter, pagination: $pagination) {
|
|
4
4
|
edges { node {
|
|
@@ -8,7 +8,7 @@ import {a,b,g,o,m as m$1,n,f,h as h$1,j,r}from'../../chunk-KTKHJORN.js';import {
|
|
|
8
8
|
pageInfo { totalCount hasNextPage }
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`,E=`
|
|
12
12
|
query GetExportJob($context: ContextInput, $id: ID!) {
|
|
13
13
|
getExportJob(context: $context, id: $id) {
|
|
14
14
|
id name status progress
|
|
@@ -21,17 +21,75 @@ import {a,b,g,o,m as m$1,n,f,h as h$1,j,r}from'../../chunk-KTKHJORN.js';import {
|
|
|
21
21
|
id status progress entityTypes
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
`,
|
|
24
|
+
`,P=`
|
|
25
25
|
query ListExportTemplates($context: ContextInput!, $pagination: ExportPaginationInput) {
|
|
26
26
|
listExportTemplates(context: $context, pagination: $pagination) {
|
|
27
27
|
edges { node { id name entityTypes format includeMedia includeMetadata } }
|
|
28
28
|
pageInfo { totalCount }
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
`,
|
|
31
|
+
`,_=`
|
|
32
32
|
query GetExportTemplate($context: ContextInput, $id: ID!) {
|
|
33
33
|
getExportTemplate(context: $context, id: $id) {
|
|
34
34
|
id name entityTypes format
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
`,R=`
|
|
38
|
+
mutation CancelExportJob($context: ContextInput, $id: ID!) {
|
|
39
|
+
cancelExportJob(context: $context, id: $id) {
|
|
40
|
+
id status progress
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
`,A=`
|
|
44
|
+
mutation DeleteExportJob($context: ContextInput, $id: ID!) {
|
|
45
|
+
deleteExportJob(context: $context, id: $id)
|
|
46
|
+
}
|
|
47
|
+
`,M=`
|
|
48
|
+
mutation RetryExportJob($context: ContextInput, $id: ID!) {
|
|
49
|
+
retryExportJob(context: $context, id: $id) {
|
|
50
|
+
id status progress
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`,N=`
|
|
54
|
+
mutation CreateExportTemplate($context: ContextInput, $input: CreateExportTemplateInput!) {
|
|
55
|
+
createExportTemplate(context: $context, input: $input) {
|
|
56
|
+
id name entityTypes format includeMedia includeMetadata
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
`,h=`
|
|
60
|
+
mutation UpdateExportTemplate(
|
|
61
|
+
$context: ContextInput
|
|
62
|
+
$id: ID!
|
|
63
|
+
$input: UpdateExportTemplateInput!
|
|
64
|
+
) {
|
|
65
|
+
updateExportTemplate(context: $context, id: $id, input: $input) {
|
|
66
|
+
id name entityTypes format includeMedia includeMetadata isDefault
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
`,D=`
|
|
70
|
+
mutation DeleteExportTemplate($context: ContextInput, $id: ID!) {
|
|
71
|
+
deleteExportTemplate(context: $context, id: $id)
|
|
72
|
+
}
|
|
73
|
+
`,L=`
|
|
74
|
+
query GetAvailableExportEntities(
|
|
75
|
+
$context: ContextInput!
|
|
76
|
+
$pagination: ExportPaginationInput
|
|
77
|
+
) {
|
|
78
|
+
getAvailableExportEntities(context: $context, pagination: $pagination) {
|
|
79
|
+
edges {
|
|
80
|
+
node {
|
|
81
|
+
entityType displayName description enabled
|
|
82
|
+
supportsDateRange supportsMediaExport estimatedSize
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
pageInfo { totalCount }
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
`,S=`
|
|
89
|
+
query GetExportPart($context: ContextInput, $id: ID!) {
|
|
90
|
+
getExportPart(context: $context, id: $id) {
|
|
91
|
+
id jobId partNumber fileName fileId sizeBytes checksum
|
|
92
|
+
downloadUrl downloadExpiresAt
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
`;function i(){let l=r().auth.read();if(!l?.workspaceId)throw new o$1("No workspace set. Run: vibecontrols workspace set <id>");return {workspaceId:l.workspaceId}}function X(l){let m$1=l.command("export").description("Workspace data export jobs"),u=m$1.command("jobs").description("Export job lifecycle");u.command("list").description("List export jobs").option("--status <s>").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let e={};t.status&&(e.status=t.status.toUpperCase());let n$1=(await b(J,{context:i(),filter:Object.keys(e).length?e:void 0,pagination:{first:t.limit}})).listExportJobs.edges.map(p=>p.node);g(t,n$1,{headers:["ID","Name","Status","Progress","Started"],rows:n$1.map(p=>[o(p.id,12),p.name??"-",m(p.status),`${p.processedEntities??0}/${p.totalEntities??"-"}`,n(p.startedAt)])});}catch(e){f(e);}}),u.command("get").description("Get an export job").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await b(E,{context:i(),id:t});if(!o.getExportJob)throw new o$1(`Export job ${t} not found`);g(e,o.getExportJob);}catch(o){f(o);}}),u.command("create").description("Create an export job").requiredOption("--name <s>").requiredOption("--types <t>","Comma-separated entity types").option("--format <fmt>","JSON|CSV|ZIP","JSON").option("--include-media","Include media files",false).option("--include-metadata","Include metadata",true).option("--from <iso>","Date range start").option("--to <iso>","Date range end").option("-f, --format-output <format>").action(async t=>{try{let e={name:t.name,entityTypes:t.types.split(","),format:(t.format??"JSON").toUpperCase(),includeMedia:!!t.includeMedia,includeMetadata:t.includeMetadata!==!1,dateRangeStart:t.from,dateRangeEnd:t.to},o=await b(O,{context:i(),input:e});h$1(`Export job created: ${o.createExportJob.id}`),g({format:t.formatOutput},o.createExportJob);}catch(e){f(e);}}),u.command("cancel").description("Cancel a running export job").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await b(R,{context:i(),id:t});h$1(`Export job cancelled: ${o.cancelExportJob.id}`),g(e,o.cancelExportJob);}catch(o){f(o);}}),u.command("delete").description("Delete an export job").argument("<id>").action(async t=>{try{if(!(await b(A,{context:i(),id:t})).deleteExportJob)throw new o$1(`Failed to delete export job ${t}`);h$1(`Export job deleted: ${t}`);}catch(e){f(e);}}),u.command("retry").description("Retry a failed export job").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await b(M,{context:i(),id:t});h$1(`Export job retry queued: ${o.retryExportJob.id}`),g(e,o.retryExportJob);}catch(o){f(o);}}),m$1.command("entities").description("List entity types available for export").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let o=(await b(L,{context:i(),pagination:{first:t.limit}})).getAvailableExportEntities.edges.map(n=>n.node);g(t,o,{headers:["Type","Display","Enabled","DateRange","Media","Size"],rows:o.map(n=>[n.entityType,n.displayName,n.enabled?"yes":"no",n.supportsDateRange?"yes":"no",n.supportsMediaExport?"yes":"no",n.estimatedSize??"-"])});}catch(e){f(e);}}),m$1.command("part").description("Get an export part by id").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await b(S,{context:i(),id:t});if(!o.getExportPart)throw new o$1(`Export part ${t} not found`);g(e,o.getExportPart);}catch(o){f(o);}}),m$1.command("download").description("Download a completed export job to a local path").argument("<jobId>").requiredOption("--to <path>","Local file path to write").action(async(t,e)=>{try{let o=await b(E,{context:i(),id:t});if(!o.getExportJob)throw new o$1(`Export job ${t} not found`);let n=o.getExportJob.downloadUrl;if(!n)throw new o$1(`Job ${t} has no downloadUrl yet (status=${o.getExportJob.status??"UNKNOWN"}).`);j(`Downloading from ${n}`);let p=await fetch(n);if(!p.ok)throw new o$1(`Download failed: ${p.status} ${p.statusText}`);let f=Buffer.from(await p.arrayBuffer());await writeFile(e.to,f),h$1(`Saved ${f.length} bytes to ${e.to}`);}catch(o){f(o);}});let x=m$1.command("templates").description("Export templates");x.command("list").description("List export templates").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let e=await b(P,{context:i(),pagination:{first:t.limit}});g(t,e.listExportTemplates.edges.map(o=>o.node));}catch(e){f(e);}}),x.command("get").description("Get an export template").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await b(_,{context:i(),id:t});if(!o.getExportTemplate)throw new o$1(`Template ${t} not found`);g(e,o.getExportTemplate);}catch(o){f(o);}}),x.command("create").description("Create an export template").requiredOption("--name <s>").requiredOption("--types <t>","Comma-separated entity types").option("--description <s>").option("--format <fmt>","JSON|CSV","JSON").option("--include-media","Include media files",false).option("--include-metadata","Include metadata",true).option("-f, --format-output <format>").action(async t=>{try{let e={name:t.name,entityTypes:t.types.split(","),format:(t.format??"JSON").toUpperCase(),includeMedia:!!t.includeMedia,includeMetadata:t.includeMetadata!==!1};t.description&&(e.description=t.description);let o=await b(N,{context:i(),input:e});h$1(`Template created: ${o.createExportTemplate.id}`),g({format:t.formatOutput},o.createExportTemplate);}catch(e){f(e);}}),x.command("update").description("Update an export template").argument("<id>").option("--name <s>").option("--description <s>").option("--types <t>","Comma-separated entity types").option("--format <fmt>","JSON|CSV").option("--include-media <bool>","true|false").option("--include-metadata <bool>","true|false").option("--default <bool>","Set isDefault: true|false").option("-f, --format-output <format>").action(async(t,e)=>{try{let o={};e.name&&(o.name=e.name),e.description&&(o.description=e.description),e.types&&(o.entityTypes=e.types.split(",")),e.format&&(o.format=e.format.toUpperCase()),e.includeMedia!==void 0&&(o.includeMedia=e.includeMedia==="true"),e.includeMetadata!==void 0&&(o.includeMetadata=e.includeMetadata==="true"),e.default!==void 0&&(o.isDefault=e.default==="true");let n=await b(h,{context:i(),id:t,input:o});h$1(`Template updated: ${n.updateExportTemplate.id}`),g({format:e.formatOutput},n.updateExportTemplate);}catch(o){f(o);}}),x.command("delete").description("Delete an export template").argument("<id>").action(async t=>{try{if(!(await b(D,{context:i(),id:t})).deleteExportTemplate)throw new o$1(`Failed to delete template ${t}`);h$1(`Template deleted: ${t}`);}catch(e){f(e);}});}var U={id:"export",version:"1.0.0",displayName:"Export",dependsOn:["auth","workspaces"],register(l,m){a(m),X(l);}},W=U;export{W as default};
|
|
@@ -1,44 +1,128 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var g=class extends Error{exitCode;hint;constructor(a,u){super(a),this.name="CliUserError",this.exitCode=u?.exitCode??1,this.hint=u?.hint;}},C=class extends g{constructor(a,u){super(a,{exitCode:2,hint:u?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},f=class extends Error{cause;constructor(a,u){super(a),this.name="CliInternalError",this.cause=u;}};var w=null;function E(o){w=o;}function m(){if(!w)throw new f("vibecontrols module helpers used before setHelpersContext was called");return w}function dt(){let o=m();if(!o.auth.isAuthenticated())throw new C(`Authentication required. Run \`${o.productName} auth login\`.`)}async function r(o,a){return dt(),m().gql.workspace.request(o,a)}function i(o){let a=o instanceof Error?o.message:String(o);throw new g(a)}function s(o,a,u){m().output.formatAndOutput(o,a,u);}function d(o){m().output.printSuccess(o);}function x(o){return m().output.formatStatus(o)}function v(o){return m().output.formatDate(o)}function y(o,a){return m().output.truncate(o,a)}var A=`
|
|
2
2
|
query GetProviders($filter: ProviderFilterInput, $pagination: IntegrationsPaginationInput) {
|
|
3
3
|
getProviders(filter: $filter, pagination: $pagination) {
|
|
4
4
|
items { id key name category authType isEnabled }
|
|
5
5
|
total hasMore
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
`,
|
|
8
|
+
`,O=`
|
|
9
9
|
query GetProvider($id: ID!) {
|
|
10
10
|
getProvider(id: $id) {
|
|
11
11
|
id key name authType category connectionCount
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
14
|
+
`,b=`
|
|
15
15
|
query GetConnections($filter: ConnectionFilterInput, $pagination: IntegrationsPaginationInput) {
|
|
16
16
|
getConnections(filter: $filter, pagination: $pagination) {
|
|
17
17
|
items { id name providerId status grantedScopes }
|
|
18
18
|
total hasMore
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
`,
|
|
21
|
+
`,N=`
|
|
22
22
|
query GetConnection($id: ID!) {
|
|
23
23
|
getConnection(id: $id) {
|
|
24
24
|
id name providerId status externalAccountEmail credentialSource
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
`,
|
|
27
|
+
`,R=`
|
|
28
28
|
mutation CreateConnection($input: CreateConnectionInput!) {
|
|
29
29
|
createConnection(input: $input) {
|
|
30
30
|
id name status providerId
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
`,$=`
|
|
34
34
|
mutation DeleteConnection($id: ID!, $deleteVaultSecret: Boolean) {
|
|
35
35
|
deleteConnection(id: $id, deleteVaultSecret: $deleteVaultSecret)
|
|
36
36
|
}
|
|
37
|
-
`,
|
|
37
|
+
`,S=`
|
|
38
38
|
query GetIntegrationLogs($filter: LogFilterInput, $pagination: IntegrationsPaginationInput) {
|
|
39
39
|
getIntegrationLogs(filter: $filter, pagination: $pagination) {
|
|
40
40
|
items { id action level message createdAt }
|
|
41
41
|
total hasMore
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
`,P=`
|
|
45
|
+
mutation UpdateConnection($id: ID!, $input: UpdateConnectionInput!) {
|
|
46
|
+
updateConnection(id: $id, input: $input) { id name status }
|
|
47
|
+
}
|
|
48
|
+
`,_=`
|
|
49
|
+
mutation RevokeConnection($connectionId: ID!) {
|
|
50
|
+
revokeConnection(connectionId: $connectionId) { id name status }
|
|
51
|
+
}
|
|
52
|
+
`,D=`
|
|
53
|
+
mutation TestConnection($connectionId: ID!) {
|
|
54
|
+
testConnection(connectionId: $connectionId) { success message latencyMs }
|
|
55
|
+
}
|
|
56
|
+
`,q=`
|
|
57
|
+
mutation LinkIntegrationToChannel($channelId: String!, $connectionId: ID!, $organizationId: String!) {
|
|
58
|
+
linkIntegrationToChannel(channelId: $channelId, connectionId: $connectionId, organizationId: $organizationId) {
|
|
59
|
+
id name status channelId organizationId
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
`,L=`
|
|
63
|
+
mutation RefreshConnectionToken($connectionId: ID!) {
|
|
64
|
+
refreshConnectionToken(connectionId: $connectionId) { id status }
|
|
65
|
+
}
|
|
66
|
+
`,G=`
|
|
67
|
+
mutation AuthenticateWithApiKey($input: ApiKeyAuthInput!) {
|
|
68
|
+
authenticateWithApiKey(input: $input) { id name status }
|
|
69
|
+
}
|
|
70
|
+
`,U=`
|
|
71
|
+
mutation AuthenticateWithBasicAuth($input: BasicAuthInput!) {
|
|
72
|
+
authenticateWithBasicAuth(input: $input) { id name status }
|
|
73
|
+
}
|
|
74
|
+
`,W=`
|
|
75
|
+
mutation AuthenticateWithBearerToken($input: BearerTokenAuthInput!) {
|
|
76
|
+
authenticateWithBearerToken(input: $input) { id name status }
|
|
77
|
+
}
|
|
78
|
+
`,B=`
|
|
79
|
+
mutation InitiateOAuth($input: InitiateOAuthInput!) {
|
|
80
|
+
initiateOAuth(input: $input) { redirectUrl state }
|
|
81
|
+
}
|
|
82
|
+
`,F=`
|
|
83
|
+
mutation CompleteOAuth($input: CompleteOAuthInput!) {
|
|
84
|
+
completeOAuth(input: $input) { id name status }
|
|
85
|
+
}
|
|
86
|
+
`,j=`
|
|
87
|
+
query GetProviderByKey($key: String!) {
|
|
88
|
+
getProviderByKey(key: $key) { id key name authType category connectionCount isEnabled }
|
|
89
|
+
}
|
|
90
|
+
`,M=`
|
|
91
|
+
query GetProviderCatalog($pagination: IntegrationsPaginationInput) {
|
|
92
|
+
getProviderCatalog(pagination: $pagination) {
|
|
93
|
+
items { id key name category authType isEnabled }
|
|
94
|
+
total hasMore
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
`,V=`
|
|
98
|
+
query GetConnectionsByProvider($providerId: ID!, $pagination: IntegrationsPaginationInput) {
|
|
99
|
+
getConnectionsByProvider(providerId: $providerId, pagination: $pagination) {
|
|
100
|
+
items { id name providerId status grantedScopes }
|
|
101
|
+
total hasMore
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
`,K=`
|
|
105
|
+
mutation EnableProvider($id: ID!) {
|
|
106
|
+
enableProvider(id: $id) { id key name isEnabled }
|
|
107
|
+
}
|
|
108
|
+
`,z=`
|
|
109
|
+
mutation DisableProvider($id: ID!) {
|
|
110
|
+
disableProvider(id: $id) { id key name isEnabled }
|
|
111
|
+
}
|
|
112
|
+
`,H=`
|
|
113
|
+
mutation TagConnection($input: TagConnectionInput!) {
|
|
114
|
+
tagConnection(input: $input) { id entityId tagId source }
|
|
115
|
+
}
|
|
116
|
+
`,Y=`
|
|
117
|
+
mutation UntagConnection($input: UntagConnectionInput!) {
|
|
118
|
+
untagConnection(input: $input)
|
|
119
|
+
}
|
|
120
|
+
`,J=`
|
|
121
|
+
mutation ReplaceConnectionTags($input: ReplaceConnectionTagsInput!) {
|
|
122
|
+
replaceConnectionTags(input: $input) { id entityId tagId source }
|
|
123
|
+
}
|
|
124
|
+
`,Q=`
|
|
125
|
+
query GetConnectionTags($input: GetConnectionTagsInput!) {
|
|
126
|
+
getConnectionTags(input: $input) { id entityId tagId source assignedAt }
|
|
127
|
+
}
|
|
128
|
+
`;function X(o){let a=o.command("integrations").description("Integration providers, connections, and logs"),u=a.command("providers").description("Available providers");u.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 r(A,{filter:Object.keys(e).length?e:void 0,pagination:{limit:t.limit,offset:0}});s(t,n.getProviders.items,{headers:["ID","Key","Name","Category","Auth","Enabled"],rows:n.getProviders.items.map(c=>[y(c.id,12),c.key,c.name,c.category??"-",c.authType??"-",String(!!c.isEnabled)])});}catch(e){i(e);}}),u.command("get").description("Get a provider").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await r(O,{id:t});if(!n.getProvider)throw new g(`Provider ${t} not found`);s(e,n.getProvider);}catch(n){i(n);}});let l=a.command("connections").description("Provider connections (OAuth + credential)");l.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 r(b,{filter:Object.keys(e).length?e:void 0,pagination:{limit:t.limit,offset:0}});s(t,n.getConnections.items,{headers:["ID","Name","Provider","Status"],rows:n.getConnections.items.map(c=>[y(c.id,12),c.name,y(c.providerId,12),x(c.status)])});}catch(e){i(e);}}),l.command("get").description("Get a connection").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await r(N,{id:t});if(!n.getConnection)throw new g(`Connection ${t} not found`);s(e,n.getConnection);}catch(n){i(n);}}),l.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 r(R,{input:e});d("Connection created"),s(t,n.createConnection);}catch(e){i(e);}}),l.command("delete").description("Delete a connection").argument("<id>").option("--keep-secret","Keep vault secret",false).action(async(t,e)=>{try{await r($,{id:t,deleteVaultSecret:!e.keepSecret}),d("Connection deleted");}catch(n){i(n);}}),l.command("update").description("Update a connection (name / description / config JSON)").argument("<id>").option("--name <name>").option("--description <desc>").option("--config <json>","Config JSON string").option("-f, --format <format>").action(async(t,e)=>{try{let n={};if(e.name!==void 0&&(n.name=e.name),e.description!==void 0&&(n.description=e.description),e.config!==void 0&&(n.config=JSON.parse(e.config)),Object.keys(n).length===0)throw new g("Provide at least one of --name, --description, --config");let c=await r(P,{id:t,input:n});d("Connection updated"),s(e,c.updateConnection);}catch(n){i(n);}}),l.command("revoke").description("Revoke a connection (soft delete; tokens invalidated)").argument("<connectionId>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await r(_,{connectionId:t});d("Connection revoked"),s(e,n.revokeConnection);}catch(n){i(n);}}),l.command("test").description("Test a connection (health/auth probe)").argument("<connectionId>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await r(D,{connectionId:t});s(e,n.testConnection);}catch(n){i(n);}}),l.command("link").description("Link a connection to a channel for DM/notification routing").requiredOption("--channel <channelId>").requiredOption("--connection <id>").requiredOption("--organization <id>").option("-f, --format <format>").action(async t=>{try{let e=await r(q,{channelId:t.channel,connectionId:t.connection,organizationId:t.organization});d("Linked"),s(t,e.linkIntegrationToChannel);}catch(e){i(e);}}),l.command("refresh-token").description("Force a connection token refresh (OAuth refresh_grant)").argument("<connectionId>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await r(L,{connectionId:t});d("Token refreshed"),s(e,n.refreshConnectionToken);}catch(n){i(n);}});let h=a.command("auth").description("Per-connection auth flows");h.command("api-key").description("Authenticate a connection with an API key").requiredOption("--connection <id>").requiredOption("--api-key <key>").option("-f, --format <format>").action(async t=>{try{let e=await r(G,{input:{connectionId:t.connection,apiKey:t.apiKey}});d("Authenticated"),s(t,e.authenticateWithApiKey);}catch(e){i(e);}}),h.command("basic").description("Authenticate a connection with Basic Auth").requiredOption("--connection <id>").requiredOption("--username <u>").requiredOption("--password <p>").option("-f, --format <format>").action(async t=>{try{let e=await r(U,{input:{connectionId:t.connection,username:t.username,password:t.password}});d("Authenticated"),s(t,e.authenticateWithBasicAuth);}catch(e){i(e);}}),h.command("bearer").description("Authenticate a connection with a Bearer token").requiredOption("--connection <id>").requiredOption("--token <t>").option("-f, --format <format>").action(async t=>{try{let e=await r(W,{input:{connectionId:t.connection,token:t.token}});d("Authenticated"),s(t,e.authenticateWithBearerToken);}catch(e){i(e);}}),h.command("oauth-start").description("Initiate an OAuth flow; prints redirect URL + state").requiredOption("--connection <id>").requiredOption("--redirect-uri <uri>").option("--scopes <s>","Comma-separated scopes").option("-f, --format <format>").action(async t=>{try{let e={connectionId:t.connection,redirectUri:t.redirectUri};t.scopes&&(e.scopes=t.scopes.split(","));let n=await r(B,{input:e});s(t,n.initiateOAuth);}catch(e){i(e);}}),h.command("oauth-complete").description("Complete an OAuth flow with the authorization code + state").requiredOption("--connection <id>").requiredOption("--code <c>").requiredOption("--redirect-uri <uri>").requiredOption("--state <s>").option("-f, --format <format>").action(async t=>{try{let e=await r(F,{input:{connectionId:t.connection,code:t.code,redirectUri:t.redirectUri,state:t.state}});d("OAuth complete"),s(t,e.completeOAuth);}catch(e){i(e);}});let I=l.command("tags").description("Connection tag assignments");I.command("add").description("Tag a connection").requiredOption("--entity <id>").requiredOption("--tag <tagId>").option("--source <s>").option("-f, --format <format>").action(async t=>{try{let e={entityId:t.entity,tagId:t.tag};t.source&&(e.source=t.source);let n=await r(H,{input:e});d("Tagged"),s(t,n.tagConnection);}catch(e){i(e);}}),I.command("remove").description("Remove a tag from a connection").requiredOption("--entity <id>").requiredOption("--tag <tagId>").action(async t=>{try{await r(Y,{input:{entityId:t.entity,tagId:t.tag}}),d("Tag removed");}catch(e){i(e);}}),I.command("replace").description("Replace all tags on a connection").requiredOption("--entity <id>").requiredOption("--tags <ids>","Comma-separated tag IDs").option("-f, --format <format>").action(async t=>{try{let e=await r(J,{input:{entityId:t.entity,tagIds:t.tags.split(",")}});d("Tags replaced"),s(t,e.replaceConnectionTags);}catch(e){i(e);}}),I.command("list").description("List tags on a connection").requiredOption("--entity <id>").option("-f, --format <format>").action(async t=>{try{let e=await r(Q,{input:{entityId:t.entity}});s(t,e.getConnectionTags);}catch(e){i(e);}}),u.command("get-by-key").description("Get a provider by key (e.g. github, slack)").argument("<key>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await r(j,{key:t});if(!n.getProviderByKey)throw new g(`Provider ${t} not found`);s(e,n.getProviderByKey);}catch(n){i(n);}}),u.command("catalog").description("Browseable provider catalog").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async t=>{try{let e=await r(M,{pagination:{limit:t.limit,offset:0}});s(t,e.getProviderCatalog.items,{headers:["ID","Key","Name","Category","Auth","Enabled"],rows:e.getProviderCatalog.items.map(n=>[y(n.id,12),n.key,n.name,n.category??"-",n.authType??"-",String(!!n.isEnabled)])});}catch(e){i(e);}}),u.command("connections").description("Connections for a given provider").argument("<providerId>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,e)=>{try{let n=await r(V,{providerId:t,pagination:{limit:e.limit,offset:0}});s(e,n.getConnectionsByProvider.items);}catch(n){i(n);}}),u.command("enable").description("Enable a provider").argument("<id>").action(async t=>{try{await r(K,{id:t}),d("Provider enabled");}catch(e){i(e);}}),u.command("disable").description("Disable a provider").argument("<id>").action(async t=>{try{await r(z,{id:t}),d("Provider disabled");}catch(e){i(e);}}),a.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=await r(S,{filter:Object.keys(e).length?e:void 0,pagination:{limit:t.limit,offset:0}});s(t,n.getIntegrationLogs.items,{headers:["When","Action","Level","Message"],rows:n.getIntegrationLogs.items.map(c=>[v(c.createdAt),c.action,c.level,c.message])});}catch(e){i(e);}});}var gt={id:"integrations",version:"1.0.0",displayName:"Integrations",dependsOn:["auth","workspaces"],register(o,a){E(a),X(o);}},ke=gt;module.exports=ke;
|