@burdenoff/cli-sdk 2026.825.2 → 2026.1021.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-IZXPWPKX.js +32 -0
- package/dist/chunk-NLEVVDXR.js +1 -0
- package/dist/core/index.cjs +7 -7
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{module-DxCuik6L.d.cts → module-DOIiVaXQ.d.cts} +4 -1
- package/dist/{module-DxCuik6L.d.ts → module-DOIiVaXQ.d.ts} +4 -1
- package/dist/modules/adaptercloud/index.cjs +2 -2
- package/dist/modules/adaptercloud/index.d.cts +1 -1
- package/dist/modules/adaptercloud/index.d.ts +1 -1
- package/dist/modules/adaptercloud/index.js +1 -1
- package/dist/modules/artistrybase/index.cjs +6 -6
- package/dist/modules/artistrybase/index.d.cts +1 -1
- package/dist/modules/artistrybase/index.d.ts +1 -1
- package/dist/modules/artistrybase/index.js +1 -1
- package/dist/modules/assethandler/index.cjs +2 -2
- package/dist/modules/assethandler/index.d.cts +1 -1
- package/dist/modules/assethandler/index.d.ts +1 -1
- package/dist/modules/assethandler/index.js +1 -1
- package/dist/modules/atheletebridge/index.cjs +4 -4
- package/dist/modules/atheletebridge/index.d.cts +1 -1
- package/dist/modules/atheletebridge/index.d.ts +1 -1
- package/dist/modules/atheletebridge/index.js +1 -1
- package/dist/modules/auth/index.cjs +34 -34
- package/dist/modules/auth/index.d.cts +1 -1
- package/dist/modules/auth/index.d.ts +1 -1
- package/dist/modules/auth/index.js +30 -30
- package/dist/modules/billing/index.cjs +3 -3
- package/dist/modules/billing/index.d.cts +1 -1
- package/dist/modules/billing/index.d.ts +1 -1
- package/dist/modules/billing/index.js +1 -1
- package/dist/modules/brainyrich/index.cjs +4 -4
- package/dist/modules/brainyrich/index.d.cts +1 -1
- package/dist/modules/brainyrich/index.d.ts +1 -1
- package/dist/modules/brainyrich/index.js +1 -1
- package/dist/modules/buildmyiq/index.cjs +3 -3
- package/dist/modules/buildmyiq/index.d.cts +1 -1
- package/dist/modules/buildmyiq/index.d.ts +1 -1
- package/dist/modules/buildmyiq/index.js +1 -1
- package/dist/modules/channels/index.cjs +7 -7
- package/dist/modules/channels/index.d.cts +1 -1
- package/dist/modules/channels/index.d.ts +1 -1
- package/dist/modules/channels/index.js +1 -1
- package/dist/modules/collabkin/index.cjs +11 -11
- package/dist/modules/collabkin/index.d.cts +1 -1
- package/dist/modules/collabkin/index.d.ts +1 -1
- package/dist/modules/collabkin/index.js +1 -1
- package/dist/modules/comradecircle/index.cjs +5 -5
- package/dist/modules/comradecircle/index.d.cts +1 -1
- package/dist/modules/comradecircle/index.d.ts +1 -1
- package/dist/modules/comradecircle/index.js +1 -1
- package/dist/modules/conversations/index.cjs +8 -8
- package/dist/modules/conversations/index.d.cts +1 -1
- package/dist/modules/conversations/index.d.ts +1 -1
- package/dist/modules/conversations/index.js +1 -1
- package/dist/modules/coolandlovely/index.cjs +4 -4
- package/dist/modules/coolandlovely/index.d.cts +1 -1
- package/dist/modules/coolandlovely/index.d.ts +1 -1
- package/dist/modules/coolandlovely/index.js +1 -1
- package/dist/modules/cosmicintersection/index.cjs +4 -4
- package/dist/modules/cosmicintersection/index.d.cts +1 -1
- package/dist/modules/cosmicintersection/index.d.ts +1 -1
- package/dist/modules/cosmicintersection/index.js +1 -1
- package/dist/modules/crewfoundry/index.cjs +4 -4
- package/dist/modules/crewfoundry/index.d.cts +1 -1
- package/dist/modules/crewfoundry/index.d.ts +1 -1
- package/dist/modules/crewfoundry/index.js +1 -1
- package/dist/modules/devportal/index.cjs +5 -5
- package/dist/modules/devportal/index.d.cts +1 -1
- package/dist/modules/devportal/index.d.ts +1 -1
- package/dist/modules/devportal/index.js +1 -1
- package/dist/modules/ecoimpacthub/index.cjs +2 -2
- package/dist/modules/ecoimpacthub/index.d.cts +1 -1
- package/dist/modules/ecoimpacthub/index.d.ts +1 -1
- package/dist/modules/ecoimpacthub/index.js +1 -1
- package/dist/modules/eventfullymanaged/index.cjs +21 -21
- package/dist/modules/eventfullymanaged/index.d.cts +1 -1
- package/dist/modules/eventfullymanaged/index.d.ts +1 -1
- package/dist/modules/eventfullymanaged/index.js +1 -1
- package/dist/modules/export/index.cjs +3 -3
- package/dist/modules/export/index.d.cts +1 -1
- package/dist/modules/export/index.d.ts +1 -1
- package/dist/modules/export/index.js +1 -1
- package/dist/modules/files/index.cjs +9 -9
- package/dist/modules/files/index.d.cts +1 -1
- package/dist/modules/files/index.d.ts +1 -1
- package/dist/modules/files/index.js +1 -1
- package/dist/modules/fluidgrids/index.cjs +401 -0
- package/dist/modules/fluidgrids/index.d.cts +7 -0
- package/dist/modules/fluidgrids/index.d.ts +7 -0
- package/dist/modules/fluidgrids/index.js +401 -0
- package/dist/modules/ggnomad/index.cjs +5 -5
- package/dist/modules/ggnomad/index.d.cts +1 -1
- package/dist/modules/ggnomad/index.d.ts +1 -1
- package/dist/modules/ggnomad/index.js +1 -1
- package/dist/modules/govcitizenhub/index.cjs +4 -4
- package/dist/modules/govcitizenhub/index.d.cts +1 -1
- package/dist/modules/govcitizenhub/index.d.ts +1 -1
- package/dist/modules/govcitizenhub/index.js +1 -1
- package/dist/modules/groups/index.cjs +4 -4
- package/dist/modules/groups/index.d.cts +1 -1
- package/dist/modules/groups/index.d.ts +1 -1
- package/dist/modules/groups/index.js +1 -1
- package/dist/modules/headshotmarketing/index.cjs +1 -1
- package/dist/modules/headshotmarketing/index.d.cts +1 -1
- package/dist/modules/headshotmarketing/index.d.ts +1 -1
- package/dist/modules/headshotmarketing/index.js +1 -1
- package/dist/modules/health/index.d.cts +1 -1
- package/dist/modules/health/index.d.ts +1 -1
- package/dist/modules/hookmovies/index.cjs +7 -7
- package/dist/modules/hookmovies/index.d.cts +1 -1
- package/dist/modules/hookmovies/index.d.ts +1 -1
- package/dist/modules/hookmovies/index.js +1 -1
- package/dist/modules/housingvista/index.cjs +7 -7
- package/dist/modules/housingvista/index.d.cts +1 -1
- package/dist/modules/housingvista/index.d.ts +1 -1
- package/dist/modules/housingvista/index.js +1 -1
- package/dist/modules/integrations/index.cjs +5 -5
- package/dist/modules/integrations/index.d.cts +1 -1
- package/dist/modules/integrations/index.d.ts +1 -1
- package/dist/modules/integrations/index.js +1 -1
- package/dist/modules/intelwatchtower/index.cjs +4 -4
- package/dist/modules/intelwatchtower/index.d.cts +1 -1
- package/dist/modules/intelwatchtower/index.d.ts +1 -1
- package/dist/modules/intelwatchtower/index.js +1 -1
- package/dist/modules/kadaikodi/index.cjs +2 -2
- package/dist/modules/kadaikodi/index.d.cts +1 -1
- package/dist/modules/kadaikodi/index.d.ts +1 -1
- package/dist/modules/kadaikodi/index.js +1 -1
- package/dist/modules/labsofscience/index.cjs +4 -4
- package/dist/modules/labsofscience/index.d.cts +1 -1
- package/dist/modules/labsofscience/index.d.ts +1 -1
- package/dist/modules/labsofscience/index.js +1 -1
- package/dist/modules/manufacturedops/index.cjs +6 -6
- package/dist/modules/manufacturedops/index.d.cts +1 -1
- package/dist/modules/manufacturedops/index.d.ts +1 -1
- package/dist/modules/manufacturedops/index.js +1 -1
- package/dist/modules/movethewheels/index.cjs +1 -1
- package/dist/modules/movethewheels/index.d.cts +1 -1
- package/dist/modules/movethewheels/index.d.ts +1 -1
- package/dist/modules/movethewheels/index.js +1 -1
- package/dist/modules/mybodyshield/index.cjs +6 -6
- package/dist/modules/mybodyshield/index.d.cts +1 -1
- package/dist/modules/mybodyshield/index.d.ts +1 -1
- package/dist/modules/mybodyshield/index.js +1 -1
- package/dist/modules/notifications/index.cjs +5 -5
- package/dist/modules/notifications/index.d.cts +1 -1
- package/dist/modules/notifications/index.d.ts +1 -1
- package/dist/modules/notifications/index.js +1 -1
- package/dist/modules/organizations/index.d.cts +1 -1
- package/dist/modules/organizations/index.d.ts +1 -1
- package/dist/modules/organizations/index.js +1 -1
- package/dist/modules/planmagnet/index.cjs +204 -225
- package/dist/modules/planmagnet/index.d.cts +1 -1
- package/dist/modules/planmagnet/index.d.ts +1 -1
- package/dist/modules/planmagnet/index.js +173 -194
- package/dist/modules/products/index.cjs +4 -4
- package/dist/modules/products/index.d.cts +1 -1
- package/dist/modules/products/index.d.ts +1 -1
- package/dist/modules/products/index.js +1 -1
- package/dist/modules/proserviceworld/index.cjs +2 -2
- package/dist/modules/proserviceworld/index.d.cts +1 -1
- package/dist/modules/proserviceworld/index.d.ts +1 -1
- package/dist/modules/proserviceworld/index.js +1 -1
- package/dist/modules/rbac/index.cjs +2 -2
- package/dist/modules/rbac/index.d.cts +1 -1
- package/dist/modules/rbac/index.d.ts +1 -1
- package/dist/modules/rbac/index.js +1 -1
- package/dist/modules/sandbox/index.cjs +4 -4
- package/dist/modules/sandbox/index.d.cts +1 -1
- package/dist/modules/sandbox/index.d.ts +1 -1
- package/dist/modules/sandbox/index.js +1 -1
- package/dist/modules/scheduler/index.cjs +5 -5
- package/dist/modules/scheduler/index.d.cts +1 -1
- package/dist/modules/scheduler/index.d.ts +1 -1
- package/dist/modules/scheduler/index.js +1 -1
- package/dist/modules/security/index.cjs +7 -7
- package/dist/modules/security/index.d.cts +1 -1
- package/dist/modules/security/index.d.ts +1 -1
- package/dist/modules/security/index.js +1 -1
- package/dist/modules/semanticfed/index.cjs +7 -7
- package/dist/modules/semanticfed/index.d.cts +1 -1
- package/dist/modules/semanticfed/index.d.ts +1 -1
- package/dist/modules/semanticfed/index.js +1 -1
- package/dist/modules/store/index.cjs +7 -7
- package/dist/modules/store/index.d.cts +1 -1
- package/dist/modules/store/index.d.ts +1 -1
- package/dist/modules/store/index.js +1 -1
- package/dist/modules/subscriberbot/index.cjs +2 -2
- package/dist/modules/subscriberbot/index.d.cts +1 -1
- package/dist/modules/subscriberbot/index.d.ts +1 -1
- package/dist/modules/subscriberbot/index.js +1 -1
- package/dist/modules/support/index.cjs +2 -2
- package/dist/modules/support/index.d.cts +1 -1
- package/dist/modules/support/index.d.ts +1 -1
- package/dist/modules/support/index.js +1 -1
- package/dist/modules/tags/index.cjs +2 -2
- package/dist/modules/tags/index.d.cts +1 -1
- package/dist/modules/tags/index.d.ts +1 -1
- package/dist/modules/tags/index.js +1 -1
- package/dist/modules/technospam/index.cjs +4 -4
- package/dist/modules/technospam/index.d.cts +1 -1
- package/dist/modules/technospam/index.d.ts +1 -1
- package/dist/modules/technospam/index.js +1 -1
- package/dist/modules/theculturepost/index.cjs +3 -3
- package/dist/modules/theculturepost/index.d.cts +1 -1
- package/dist/modules/theculturepost/index.d.ts +1 -1
- package/dist/modules/theculturepost/index.js +1 -1
- package/dist/modules/theglobalfuel/index.cjs +3 -3
- package/dist/modules/theglobalfuel/index.d.cts +1 -1
- package/dist/modules/theglobalfuel/index.d.ts +1 -1
- package/dist/modules/theglobalfuel/index.js +1 -1
- package/dist/modules/timecampus/index.cjs +7 -7
- package/dist/modules/timecampus/index.d.cts +1 -1
- package/dist/modules/timecampus/index.d.ts +1 -1
- package/dist/modules/timecampus/index.js +1 -1
- package/dist/modules/tours/index.cjs +2 -2
- package/dist/modules/tours/index.d.cts +1 -1
- package/dist/modules/tours/index.d.ts +1 -1
- package/dist/modules/tours/index.js +1 -1
- package/dist/modules/vibecontrols/index.cjs +1 -1
- package/dist/modules/vibecontrols/index.d.cts +1 -1
- package/dist/modules/vibecontrols/index.d.ts +1 -1
- package/dist/modules/vibecontrols/index.js +1 -1
- package/dist/modules/workspaces/index.cjs +15 -15
- package/dist/modules/workspaces/index.d.cts +1 -1
- package/dist/modules/workspaces/index.d.ts +1 -1
- package/dist/modules/workspaces/index.js +11 -11
- package/package.json +1 -1
- package/dist/chunk-TCBALVP4.js +0 -32
- package/dist/chunk-WXDQ3S5J.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,b,h as h$1,p,n,o,g,i as i$1,k,s}from'../../chunk-
|
|
1
|
+
import {a,b,h as h$1,p,n,o,g,i as i$1,k,s}from'../../chunk-NLEVVDXR.js';import {o as o$1}from'../../chunk-IZXPWPKX.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 {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var fs=require('fs'),path=require('path'),crypto=require('crypto');var u=class extends Error{exitCode;hint;constructor(r,a){super(r),this.name="CliUserError",this.exitCode=a?.exitCode??1,this.hint=a?.hint;}},m=class extends u{constructor(r,a){super(r,{exitCode:2,hint:a?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var fs=require('fs'),path=require('path'),crypto=require('crypto');var u=class extends Error{exitCode;hint;constructor(r,a){super(r),this.name="CliUserError",this.exitCode=a?.exitCode??1,this.hint=a?.hint;}},m=class extends u{constructor(r,a){super(r,{exitCode:2,hint:a?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},f=class extends Error{cause;constructor(r,a){super(r),this.name="CliInternalError",this.cause=a;}};var k=null;function E(n){k=n;}function w(){if(!k)throw new f("vibecontrols module helpers used before setHelpersContext was called");return k}function H(){let n=w();if(!n.auth.isAuthenticated())throw new m("Authentication required.",{hint:`Run \`${n.productName} auth login\` to authenticate.`})}async function l(n,r){return H(),w().gql.workspace.request(n,r)}function p(n){let r=n instanceof Error?n.message:String(n);throw new u(r)}function d(n,r,a){w().output.formatAndOutput(n,r,a);}function h(n){w().output.printSuccess(n);}function x(n){w().output.printInfo(n);}function y(n,r){return w().output.truncate(n,r)}var v=`
|
|
2
2
|
query BrowseFolderRoot($pagination: PaginationInput) {
|
|
3
3
|
getFilesInFolder(pagination: $pagination) {
|
|
4
4
|
files { id name size mimeType extension createdAt }
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
total hasMore
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
`,
|
|
18
|
+
`,O=`
|
|
19
19
|
mutation InitiateUpload($input: InitiateUploadInput!) {
|
|
20
20
|
initiateUpload(input: $input) {
|
|
21
21
|
session { id fileName fileSize s3Bucket s3Key }
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
multipartUploadId
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
`,
|
|
27
|
+
`,S=`
|
|
28
28
|
mutation CompleteUpload($input: CompleteUploadInput!) {
|
|
29
29
|
completeUpload(input: $input) {
|
|
30
30
|
file { id name size s3Bucket s3Key downloadUrl }
|
|
31
31
|
fileId
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
`,
|
|
34
|
+
`,R=`
|
|
35
35
|
mutation CreateShare($input: FileCreateShareInput!) {
|
|
36
36
|
createShare(input: $input) {
|
|
37
37
|
id token shareType accessLevel expiresAt requiresPassword
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
id revokedAt revokedBy
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
`,
|
|
47
|
+
`,D=`
|
|
48
48
|
query GetFile($id: ID!) {
|
|
49
49
|
getFile(id: $id) {
|
|
50
50
|
id name description workspaceId folderId
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
tags
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
`,
|
|
58
|
+
`,L=`
|
|
59
59
|
query GetFileDownloadUrl($id: ID!, $expiresIn: Int) {
|
|
60
60
|
getFileDownloadUrl(id: $id, expiresIn: $expiresIn)
|
|
61
61
|
}
|
|
62
|
-
`;function
|
|
63
|
-
${i.getFilesInFolder.total} files`);return}let
|
|
64
|
-
${
|
|
62
|
+
`;function F(n){let r=n.command("files").description("Workspace file management");r.command("browse").description("Browse a folder (defaults to root)").argument("[folderId]").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,e)=>{try{let o={limit:e.limit,offset:0};if(t){let i=await l(A,{folderId:t,pagination:o});if(e.format){d(e,{folder:i.getFolder,files:i.getFilesInFolder.files});return}i.getFolder&&x(`Folder: ${i.getFolder.name}`);for(let c of i.getFilesInFolder.files){let C=c.size?`${c.size}b`:"-";console.log(` \u{1F4C4} ${y(c.id,12)} ${c.name} ${C} ${c.mimeType??"-"}`);}console.log(`
|
|
63
|
+
${i.getFilesInFolder.total} files`);return}let g=await l(v,{pagination:o});if(e.format){d(e,{files:g.getFilesInFolder.files});return}for(let i of g.getFilesInFolder.files){let c=i.size?`${i.size}b`:"-";console.log(` \u{1F4C4} ${y(i.id,12)} ${i.name} ${c} ${i.mimeType??"-"}`);}console.log(`
|
|
64
|
+
${g.getFilesInFolder.total} files`);}catch(o){p(o);}}),r.command("upload").description("Upload a local file (initiates a multipart session)").argument("<path>","Local file path").option("--folder <folderId>","Target folder id").option("--visibility <v>","PRIVATE|WORKSPACE|PUBLIC","WORKSPACE").option("-f, --format <format>").action(async(t,e)=>{try{let o=fs.statSync(t),g=path.basename(t),i=path.extname(t).slice(1)||void 0,c=fs.readFileSync(t),C=crypto.createHash("sha256").update(c).digest("hex"),P={fileName:g,fileSize:o.size,mimeType:"application/octet-stream",extension:i,folderId:e.folder,sha256Hash:C,visibility:(e.visibility??"WORKSPACE").toUpperCase()},I=await l(O,{input:P});x("Upload session created. PUT the local bytes to the returned URL(s)."),d(e,I.initiateUpload),x(`After uploading, complete with: vibecontrols files upload-complete --session ${I.initiateUpload.session.id}`);}catch(o){p(o);}}),r.command("upload-complete").description("Complete an in-flight upload session").requiredOption("--session <id>","Session id from `files upload`").option("--folder <folderId>").option("--description <s>").option("-f, --format <format>").action(async t=>{try{let e=await l(S,{input:{sessionId:t.session,folderId:t.folder,description:t.description}});h(`Upload complete: ${e.completeUpload.fileId}`),d(t,e.completeUpload.file);}catch(e){p(e);}}),r.command("get").description("Get a file by id").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await l(D,{id:t});if(!o.getFile)throw new u(`File ${t} not found`);d(e,o.getFile);}catch(o){p(o);}}),r.command("download").description("Get a pre-signed download URL for a file").argument("<id>").option("--expires <seconds>","URL expiry in seconds",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,e)=>{try{let o=await l(L,{id:t,expiresIn:e.expires});if(e.format){d(e,{url:o.getFileDownloadUrl});return}h("Download URL:"),console.log(o.getFileDownloadUrl);}catch(o){p(o);}});let a=r.command("share").description("Manage file shares");a.command("create").description("Create a share link for a file").argument("<fileId>").option("--access <a>","VIEW|DOWNLOAD","DOWNLOAD").option("--expires <iso>","Expiry timestamp").option("--password <p>").option("--max-downloads <n>","",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,e)=>{try{let o={fileId:t,shareType:"PUBLIC_LINK",accessLevel:(e.access??"DOWNLOAD").toUpperCase(),expiresAt:e.expires,password:e.password,maxDownloads:e.maxDownloads},g=await l(R,{input:o});h("Share created"),d(e,g.createShare);}catch(o){p(o);}}),a.command("revoke").description("Revoke a share by id").argument("<shareId>").action(async t=>{try{await l($,{id:t}),h("Share revoked");}catch(e){p(e);}});}var ee={id:"files",version:"1.0.0",displayName:"Files",dependsOn:["auth","workspaces"],register(n,r){E(r),F(n);}},gt=ee;module.exports=gt;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,b,h as h$1,k,p,g,i}from'../../chunk-
|
|
1
|
+
import {a,b,h as h$1,k,p,g,i}from'../../chunk-NLEVVDXR.js';import {o}from'../../chunk-IZXPWPKX.js';import {statSync,readFileSync}from'fs';import {basename,extname}from'path';import {createHash}from'crypto';var h=`
|
|
2
2
|
query BrowseFolderRoot($pagination: PaginationInput) {
|
|
3
3
|
getFilesInFolder(pagination: $pagination) {
|
|
4
4
|
files { id name size mimeType extension createdAt }
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var fs=require('fs'),readline=require('readline'),stream=require('stream');var u=class extends Error{exitCode;hint;constructor(n,e){super(n),this.name="CliUserError",this.exitCode=e?.exitCode??1,this.hint=e?.hint;}},v=class extends u{constructor(n,e){super(n,{exitCode:2,hint:e?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},T=class extends Error{cause;constructor(n,e){super(n),this.name="CliInternalError",this.cause=e;}};var N=null;function X(i){N=i;}function S(){if(!N)throw new T("vibecontrols module helpers used before setHelpersContext was called");return N}function Et(){let i=S();if(!i.auth.isAuthenticated())throw new v("Authentication required.",{hint:`Run \`${i.productName} auth login\` to authenticate.`})}async function a(i,n){return Et(),S().gql.workspace.request(i,n)}function c(i,n,e){S().output.formatAndOutput(i,n,e);}function l(i){S().output.printSuccess(i);}function k(i){return S().output.formatDate(i)}function w(i,n){return S().output.truncate(i,n)}function F(i,n){return S().output.confirm(i,n)}var b=`
|
|
2
|
+
id workflowKey name description version status category tags icon isActive
|
|
3
|
+
totalVersions projectId createdAt updatedAt
|
|
4
|
+
`,Z=`
|
|
5
|
+
query FluidgridsListWorkflows($input: ListWorkflowDefinitionsInput!) {
|
|
6
|
+
workflowDefinitions(input: $input) {
|
|
7
|
+
items { ${b} }
|
|
8
|
+
total
|
|
9
|
+
hasMore
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
`,D=`
|
|
13
|
+
query FluidgridsGetWorkflow($id: ID, $workflowKey: String, $version: String) {
|
|
14
|
+
workflowDefinition(id: $id, workflowKey: $workflowKey, version: $version) {
|
|
15
|
+
${b}
|
|
16
|
+
alias
|
|
17
|
+
definitionJson
|
|
18
|
+
context
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`,ee=`
|
|
22
|
+
query FluidgridsWorkflowVersions($workflowKey: String!) {
|
|
23
|
+
workflowVersions(workflowKey: $workflowKey) { ${b} }
|
|
24
|
+
}
|
|
25
|
+
`,te=`
|
|
26
|
+
mutation FluidgridsCreateWorkflow($input: CreateWorkflowDefinitionInput!) {
|
|
27
|
+
createWorkflowDefinition(input: $input) { ${b} }
|
|
28
|
+
}
|
|
29
|
+
`,oe=`
|
|
30
|
+
mutation FluidgridsUpdateWorkflow($id: ID!, $input: UpdateWorkflowDefinitionInput!) {
|
|
31
|
+
updateWorkflowDefinition(id: $id, input: $input) { ${b} }
|
|
32
|
+
}
|
|
33
|
+
`,ne=`
|
|
34
|
+
mutation FluidgridsDeleteWorkflow($workflowKey: String!, $version: String) {
|
|
35
|
+
deleteWorkflowDefinition(workflowKey: $workflowKey, version: $version)
|
|
36
|
+
}
|
|
37
|
+
`,re=`
|
|
38
|
+
mutation FluidgridsTriggerWorkflow($input: TriggerWorkflowInput!) {
|
|
39
|
+
triggerWorkflow(input: $input) {
|
|
40
|
+
runId
|
|
41
|
+
status
|
|
42
|
+
workflowKey
|
|
43
|
+
version
|
|
44
|
+
triggerNodeId
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
`,ie=`
|
|
48
|
+
mutation FluidgridsPublishWorkflow($id: ID!) {
|
|
49
|
+
publishWorkflow(id: $id) { ${b} }
|
|
50
|
+
}
|
|
51
|
+
`,se=`
|
|
52
|
+
mutation FluidgridsActivateWorkflow($id: ID!) {
|
|
53
|
+
activateWorkflowDefinition(id: $id) { ${b} }
|
|
54
|
+
}
|
|
55
|
+
`,ae=`
|
|
56
|
+
mutation FluidgridsDeactivateWorkflow($id: ID!) {
|
|
57
|
+
deactivateWorkflowDefinition(id: $id) { ${b} }
|
|
58
|
+
}
|
|
59
|
+
`,ue=`
|
|
60
|
+
mutation FluidgridsDuplicateWorkflow(
|
|
61
|
+
$workflowKey: String!
|
|
62
|
+
$version: String!
|
|
63
|
+
$input: DuplicateWorkflowInput!
|
|
64
|
+
) {
|
|
65
|
+
duplicateWorkflow(workflowKey: $workflowKey, version: $version, input: $input) {
|
|
66
|
+
success
|
|
67
|
+
message
|
|
68
|
+
workflow { ${b} }
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
`,de=`
|
|
72
|
+
mutation FluidgridsArchiveWorkflow($id: ID!) {
|
|
73
|
+
archiveWorkflow(id: $id) { ${b} }
|
|
74
|
+
}
|
|
75
|
+
`,ce=`
|
|
76
|
+
mutation FluidgridsImportWorkflowTemplate($input: ImportWorkflowTemplateInput!) {
|
|
77
|
+
importWorkflowTemplate(input: $input) {
|
|
78
|
+
success
|
|
79
|
+
message
|
|
80
|
+
workflow { ${b} }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`,le=`
|
|
84
|
+
id workflowId workflowKey version status mode startedAt completedAt duration
|
|
85
|
+
triggeredById triggerNodeId errorMessage errorType progress totalNodes
|
|
86
|
+
completedNodes failedNodes skippedNodes createdAt
|
|
87
|
+
`,_=`
|
|
88
|
+
query FluidgridsListRuns($input: ListWorkflowRunsInput!) {
|
|
89
|
+
workflowRuns(input: $input) {
|
|
90
|
+
items { ${le} }
|
|
91
|
+
total
|
|
92
|
+
hasMore
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
`,pe=`
|
|
96
|
+
query FluidgridsGetRun($id: ID!) {
|
|
97
|
+
workflowRun(id: $id) {
|
|
98
|
+
${le}
|
|
99
|
+
triggerData
|
|
100
|
+
nodeStates {
|
|
101
|
+
id nodeId nodeType nodeVersion status error errorType attemptCount
|
|
102
|
+
startTime endTime duration output
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
`,fe=`
|
|
107
|
+
query FluidgridsRunLogs(
|
|
108
|
+
$runId: ID!
|
|
109
|
+
$nodeId: String
|
|
110
|
+
$minLevel: RunLogLevel
|
|
111
|
+
$limit: Int
|
|
112
|
+
$after: String
|
|
113
|
+
$search: String
|
|
114
|
+
$includeChildRuns: Boolean
|
|
115
|
+
) {
|
|
116
|
+
workflowRunLogs(
|
|
117
|
+
runId: $runId
|
|
118
|
+
nodeId: $nodeId
|
|
119
|
+
minLevel: $minLevel
|
|
120
|
+
limit: $limit
|
|
121
|
+
after: $after
|
|
122
|
+
search: $search
|
|
123
|
+
includeChildRuns: $includeChildRuns
|
|
124
|
+
) {
|
|
125
|
+
lines {
|
|
126
|
+
id runId nodeId nodeStateId level message timestamp data attempt phase
|
|
127
|
+
stream truncated
|
|
128
|
+
}
|
|
129
|
+
hasMore
|
|
130
|
+
nextCursor
|
|
131
|
+
limitReached
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
`,P="id status completedAt errorMessage",me=`
|
|
135
|
+
mutation FluidgridsCancelRun($id: ID!) {
|
|
136
|
+
cancelWorkflowRun(id: $id) { ${P} }
|
|
137
|
+
}
|
|
138
|
+
`,ge=`
|
|
139
|
+
mutation FluidgridsPauseRun($id: ID!) {
|
|
140
|
+
pauseWorkflowRun(id: $id) { ${P} }
|
|
141
|
+
}
|
|
142
|
+
`,we=`
|
|
143
|
+
mutation FluidgridsResumeRun($id: ID!, $payload: JSON) {
|
|
144
|
+
resumeWorkflowRun(id: $id, payload: $payload) {
|
|
145
|
+
success
|
|
146
|
+
message
|
|
147
|
+
resumedFromNodeId
|
|
148
|
+
run { ${P} }
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
`,ye=`
|
|
152
|
+
mutation FluidgridsRetryNode($id: ID!, $nodeId: String!) {
|
|
153
|
+
retryNode(id: $id, nodeId: $nodeId) {
|
|
154
|
+
id nodeId nodeType status error attemptCount
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
`,ke=`
|
|
158
|
+
id nodeType nodeVersion name description category icon logo keywords kind author
|
|
159
|
+
publishType status isLatest endpointUrl operations supportsAdapterMode
|
|
160
|
+
adapterOutputType docsUrl createdAt updatedAt
|
|
161
|
+
`,he=`
|
|
162
|
+
query FluidgridsListNodes(
|
|
163
|
+
$nodeType: String
|
|
164
|
+
$publishType: PublishType
|
|
165
|
+
$status: NodeConfigStatus
|
|
166
|
+
$pagination: WorkflowPaginationInput
|
|
167
|
+
) {
|
|
168
|
+
nodeEndpointConfigs(
|
|
169
|
+
nodeType: $nodeType
|
|
170
|
+
publishType: $publishType
|
|
171
|
+
status: $status
|
|
172
|
+
pagination: $pagination
|
|
173
|
+
) {
|
|
174
|
+
configs { ${ke} }
|
|
175
|
+
pagination { total limit offset hasMore }
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
`,Ee=`
|
|
179
|
+
query FluidgridsGetNode($nodeType: String!, $nodeVersion: String!) {
|
|
180
|
+
nodeEndpointConfig(nodeType: $nodeType, nodeVersion: $nodeVersion) {
|
|
181
|
+
${ke}
|
|
182
|
+
healthCheckUrl
|
|
183
|
+
nodeAdapters
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
`,j=`
|
|
187
|
+
id name description status providerId credentialSource externalAccountId
|
|
188
|
+
externalAccountName externalAccountEmail grantedScopes lastUsedAt lastHealthCheck
|
|
189
|
+
errorMessage createdAt updatedAt
|
|
190
|
+
`,be=`
|
|
191
|
+
query FluidgridsListCredentials(
|
|
192
|
+
$filter: ConnectionFilterInput
|
|
193
|
+
$pagination: IntegrationsPaginationInput
|
|
194
|
+
) {
|
|
195
|
+
getConnections(filter: $filter, pagination: $pagination) {
|
|
196
|
+
items {
|
|
197
|
+
${j}
|
|
198
|
+
provider { id key name category authType icon }
|
|
199
|
+
}
|
|
200
|
+
total
|
|
201
|
+
hasMore
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
`,Ce=`
|
|
205
|
+
query FluidgridsGetCredential($id: ID!) {
|
|
206
|
+
getConnection(id: $id) {
|
|
207
|
+
${j}
|
|
208
|
+
config
|
|
209
|
+
metadata
|
|
210
|
+
workspaceId
|
|
211
|
+
provider {
|
|
212
|
+
id key name description category authType configSchema availableScopes
|
|
213
|
+
defaultScopes icon docsUrl
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
`,Ie=`
|
|
218
|
+
query FluidgridsListCredentialTypes(
|
|
219
|
+
$filter: ProviderFilterInput
|
|
220
|
+
$pagination: IntegrationsPaginationInput
|
|
221
|
+
) {
|
|
222
|
+
getProviders(filter: $filter, pagination: $pagination) {
|
|
223
|
+
items {
|
|
224
|
+
id key name description category authType configSchema availableScopes
|
|
225
|
+
defaultScopes icon docsUrl isBuiltIn isEnabled connectionCount
|
|
226
|
+
}
|
|
227
|
+
total
|
|
228
|
+
hasMore
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
`,Te=`
|
|
232
|
+
mutation FluidgridsCreateCredential($input: CreateConnectionInput!) {
|
|
233
|
+
createConnection(input: $input) {
|
|
234
|
+
${j}
|
|
235
|
+
provider { id key name authType }
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
`,Se=`
|
|
239
|
+
id name status grantedScopes externalAccountName errorMessage updatedAt
|
|
240
|
+
`,Oe=`
|
|
241
|
+
mutation FluidgridsAuthenticateCredentialApiKey($input: ApiKeyAuthInput!) {
|
|
242
|
+
authenticateWithApiKey(input: $input) { ${Se} }
|
|
243
|
+
}
|
|
244
|
+
`,Re=`
|
|
245
|
+
mutation FluidgridsAuthenticateCredentialBasic($input: BasicAuthInput!) {
|
|
246
|
+
authenticateWithBasicAuth(input: $input) { ${Se} }
|
|
247
|
+
}
|
|
248
|
+
`,ve=`
|
|
249
|
+
mutation FluidgridsUpdateCredential($id: ID!, $input: UpdateConnectionInput!) {
|
|
250
|
+
updateConnection(id: $id, input: $input) {
|
|
251
|
+
id name description status config updatedAt
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
`,xe=`
|
|
255
|
+
mutation FluidgridsDeleteCredential($id: ID!, $deleteVaultSecret: Boolean) {
|
|
256
|
+
deleteConnection(id: $id, deleteVaultSecret: $deleteVaultSecret)
|
|
257
|
+
}
|
|
258
|
+
`,Ae=`
|
|
259
|
+
mutation FluidgridsTestCredential($connectionId: ID!) {
|
|
260
|
+
testConnection(connectionId: $connectionId) { success message latencyMs }
|
|
261
|
+
}
|
|
262
|
+
`,A=`
|
|
263
|
+
id name description workflowKey triggerNodeId eventSource eventType status isActive
|
|
264
|
+
webhookUrl webhookToken validationMethod signatureHeader apiKeyHeader payloadMapping
|
|
265
|
+
config tags totalTriggers successfulTriggers failedTriggers lastTriggeredAt
|
|
266
|
+
projectId createdAt updatedAt
|
|
267
|
+
`,$e=`
|
|
268
|
+
query FluidgridsListWebhooks($status: EventStatus, $workflowKey: String) {
|
|
269
|
+
eventRegistrations(status: $status, workflowKey: $workflowKey) { ${A} }
|
|
270
|
+
}
|
|
271
|
+
`,De=`
|
|
272
|
+
query FluidgridsGetWebhook($id: ID!) {
|
|
273
|
+
eventRegistration(id: $id) { ${A} }
|
|
274
|
+
}
|
|
275
|
+
`,We=`
|
|
276
|
+
mutation FluidgridsCreateWebhook($input: CreateEventRegistrationInput!) {
|
|
277
|
+
createEventRegistration(input: $input) { ${A} }
|
|
278
|
+
}
|
|
279
|
+
`,Le=`
|
|
280
|
+
mutation FluidgridsUpdateWebhook($id: ID!, $input: UpdateEventRegistrationInput!) {
|
|
281
|
+
updateEventRegistration(id: $id, input: $input) { ${A} }
|
|
282
|
+
}
|
|
283
|
+
`,Ne=`
|
|
284
|
+
mutation FluidgridsDeleteWebhook($id: ID!) {
|
|
285
|
+
deleteEventRegistration(id: $id)
|
|
286
|
+
}
|
|
287
|
+
`,Fe=`
|
|
288
|
+
mutation FluidgridsToggleWebhook($id: ID!, $isActive: Boolean!) {
|
|
289
|
+
toggleEventRegistration(id: $id, isActive: $isActive) { ${A} }
|
|
290
|
+
}
|
|
291
|
+
`,W=`
|
|
292
|
+
id name workflowKey version schedule enabled nextRun lastRun config createdAt updatedAt
|
|
293
|
+
`,_e=`
|
|
294
|
+
query FluidgridsListScheduledJobs(
|
|
295
|
+
$enabled: Boolean
|
|
296
|
+
$workflowKey: String
|
|
297
|
+
$pagination: WorkflowPaginationInput
|
|
298
|
+
) {
|
|
299
|
+
workflowScheduledJobs(enabled: $enabled, workflowKey: $workflowKey, pagination: $pagination) {
|
|
300
|
+
jobs { ${W} }
|
|
301
|
+
pagination { total limit offset hasMore }
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
`,Pe=`
|
|
305
|
+
query FluidgridsGetScheduledJob($jobId: ID!) {
|
|
306
|
+
workflowScheduledJob(jobId: $jobId) {
|
|
307
|
+
${W}
|
|
308
|
+
workspaceId
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
`,je=`
|
|
312
|
+
mutation FluidgridsCreateScheduledJob($input: ScheduledJobInput!) {
|
|
313
|
+
createWorkflowScheduledJob(input: $input) {
|
|
314
|
+
success
|
|
315
|
+
message
|
|
316
|
+
job { ${W} }
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
`,U=`
|
|
320
|
+
mutation FluidgridsUpdateScheduledJob($jobId: ID!, $input: WorkflowUpdateScheduledJobInput!) {
|
|
321
|
+
updateWorkflowScheduledJob(jobId: $jobId, input: $input) {
|
|
322
|
+
success
|
|
323
|
+
message
|
|
324
|
+
job { ${W} }
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
`,Ue=`
|
|
328
|
+
mutation FluidgridsDeleteScheduledJob($jobId: ID!) {
|
|
329
|
+
deleteWorkflowScheduledJob(jobId: $jobId) { success message }
|
|
330
|
+
}
|
|
331
|
+
`,Ke=`
|
|
332
|
+
query FluidgridsDashboardSummary($projectId: String) {
|
|
333
|
+
dashboardSummary(projectId: $projectId) {
|
|
334
|
+
userId
|
|
335
|
+
username
|
|
336
|
+
workflowsCount
|
|
337
|
+
activeWorkflowsCount
|
|
338
|
+
archivedWorkflowsCount
|
|
339
|
+
runsCountTotal
|
|
340
|
+
runsCompletedCount
|
|
341
|
+
runsFailedCount
|
|
342
|
+
runsCancelledCount
|
|
343
|
+
runsPendingCount
|
|
344
|
+
runsRunningCount
|
|
345
|
+
runsWaitingCount
|
|
346
|
+
runsCompletedLast24h
|
|
347
|
+
runsFailedLast24h
|
|
348
|
+
runsCompletedLast7d
|
|
349
|
+
runsFailedLast7d
|
|
350
|
+
runsCompletedLast30d
|
|
351
|
+
runsFailedLast30d
|
|
352
|
+
totalNodesExecutedCount
|
|
353
|
+
workflowSuccessRate
|
|
354
|
+
avgWorkflowExecutionTimeSeconds
|
|
355
|
+
avgNodeExecutionTimeSeconds
|
|
356
|
+
timeSavedEstimateHours
|
|
357
|
+
recentRuns { id workflowKey version status startedAt completedAt duration }
|
|
358
|
+
recentWorkflows { workflowKey name version updatedAt }
|
|
359
|
+
nodeUsageStats { nodeType totalExecutions successCount failureCount avgExecutionTime }
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
`,qe=`
|
|
363
|
+
query FluidgridsUsageMetrics($input: UsageQueryInput!) {
|
|
364
|
+
usageMetrics(input: $input) {
|
|
365
|
+
period
|
|
366
|
+
workflowMetrics {
|
|
367
|
+
totalRuns successfulRuns failedRuns cancelledRuns totalDurationSeconds
|
|
368
|
+
averageDurationSeconds minDurationSeconds maxDurationSeconds medianDurationSeconds
|
|
369
|
+
}
|
|
370
|
+
nodeMetrics {
|
|
371
|
+
totalNodes successfulNodes failedNodes skippedNodes totalDurationSeconds
|
|
372
|
+
averageDurationSeconds nodeTypeBreakdown
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
`,Ge="query results entityCounts totalResults metadata",Je=`
|
|
377
|
+
query FluidgridsSearch($input: SearchRequestInput!) {
|
|
378
|
+
search(input: $input) { ${Ge} }
|
|
379
|
+
}
|
|
380
|
+
`,Me=`
|
|
381
|
+
query FluidgridsSearchByEntityType(
|
|
382
|
+
$entityType: String!
|
|
383
|
+
$query: String!
|
|
384
|
+
$filters: SearchFilterInput
|
|
385
|
+
$limit: Int
|
|
386
|
+
$offset: Int
|
|
387
|
+
) {
|
|
388
|
+
searchByEntityType(
|
|
389
|
+
entityType: $entityType
|
|
390
|
+
query: $query
|
|
391
|
+
filters: $filters
|
|
392
|
+
limit: $limit
|
|
393
|
+
offset: $offset
|
|
394
|
+
) { ${Ge} }
|
|
395
|
+
}
|
|
396
|
+
`,Ve=`
|
|
397
|
+
query FluidgridsSystemConfig {
|
|
398
|
+
systemConfig { version revision environment deploymentType hostname hostIp }
|
|
399
|
+
}
|
|
400
|
+
`;function p(i,n){if(!/^\d+$/.test(i))throw new u(`Invalid value '${i}' for ${n}: expected a non-negative integer.`);let e=Number(i);if(!Number.isSafeInteger(e))throw new u(`Invalid value '${i}' for ${n}: expected a non-negative integer.`);return e}function y(i,n,e){if(i===void 0)return;let t=e.find(o=>o===i);if(t===void 0)throw new u(`Invalid value '${i}' for ${n}. Allowed: ${e.join(", ")}`);return t}function x(i,n){let e;try{e=JSON.parse(i);}catch{throw new u(`${n} must be valid JSON.`)}if(!Ct(e))throw new u(`${n} must be a JSON object.`);return e}function h(i){let n;try{n=fs.readFileSync(i,"utf8");}catch(e){let t=e instanceof Error?e.message:String(e);throw new u(`Cannot read ${i}: ${t}`)}return x(n,i)}function R(i,n){if(i!==void 0){if(!i.trim())throw new u(`${n} cannot be empty.`);return i}}function E(i,n,e){if(i==null)throw new u(`${n} ${e} not found (NOT_FOUND)`);return i}function Ct(i){return i!==null&&typeof i=="object"&&!Array.isArray(i)}function Be(i,n=[]){return [...n,i]}async function I(i,n){if(!await F(i,n))throw new u("Aborted: nothing was changed.")}var K=["DRAFT","ACTIVE","ARCHIVED","DEPRECATED"],q=["PENDING","RUNNING","WAITING","COMPLETED","FAILED","CANCELLED","TERMINATED"],He=["COMPLETED","FAILED","CANCELLED","TERMINATED"],G=["DEBUG","INFO","WARN","ERROR"],J=["BUILTIN","CUSTOM","STORE"],M=["AVAILABLE","DEPRECATED","DISABLED"],V=["ACTIVE","PAUSED","DISABLED","ARCHIVED"],B=["ACTIVE","INACTIVE","PENDING_AUTH","ERROR","EXPIRED","REVOKED"],H=["workflow","run","node","event"];function Ye(i){return {headers:["ID","Key","Name","Version","Status","Active","Updated"],rows:i.map(n=>[w(n.id,12),n.workflowKey,w(n.name,32),n.version,n.status,n.isActive?"yes":"no",k(n.updatedAt)])}}function ze(i){let n=i.command("workflows").description("FluidGrids workflow definitions");n.command("list").description("List workflow definitions").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-s, --status <status>",`Filter by status (${K.join("|")})`).option("--category <category>","Filter by category").option("--tag <tag>","Filter by tag (repeatable)",Be).option("--latest-only","Only the latest version of each workflow key").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let o={limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")},r=y(t.status,"--status",K);r&&(o.status=r),t.category&&(o.category=t.category),t.tag?.length&&(o.tags=t.tag),t.latestOnly&&(o.latestOnly=true);let s=await a(Z,{input:o});c(t,s.workflowDefinitions.items,Ye(s.workflowDefinitions.items));}),n.command("get").description("Get a workflow definition by ID, or by key with --key").argument("[id]","Workflow definition ID").option("--key <workflowKey>","Look up by workflow key instead of ID").option("--wf-version <version>","Version to fetch with --key").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o)=>{if(!t&&!o.key)throw new u("Pass a workflow ID or --key <workflowKey>.");if(t&&o.key)throw new u("Pass either a workflow ID or --key, not both.");let r=await a(D,t?{id:t}:{workflowKey:o.key,version:o.wfVersion});c(o,E(r.workflowDefinition,"Workflow",t??o.key??""));}),n.command("versions").description("List every stored version of a workflow key").argument("<workflowKey>","Workflow key").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o)=>{let r=await a(ee,{workflowKey:t});c(o,r.workflowVersions,Ye(r.workflowVersions));}),n.command("create").description("Create a workflow definition from a CreateWorkflowDefinitionInput JSON file").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o)=>{let r=h(t),s=await a(te,{input:r});l(`Workflow created: ${s.createWorkflowDefinition.workflowKey}`),c(o,s.createWorkflowDefinition);}),n.command("update").description("Update a workflow definition from an UpdateWorkflowDefinitionInput JSON file").argument("<id>","Workflow definition ID").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o,r)=>{let s=h(o),d=await a(oe,{id:t,input:s});l("Workflow updated"),c(r,d.updateWorkflowDefinition);}),n.command("delete").description("Delete a workflow (every version, or one with --wf-version)").argument("<workflowKey>","Workflow key").option("--wf-version <version>","Delete only this version").option("--force","Skip the confirmation prompt").action(async(t,o)=>{let r=o.wfVersion?`${t}@${o.wfVersion}`:`${t} (all versions)`;if(await I(`Delete workflow ${r}?`,o.force),!(await a(ne,{workflowKey:t,version:o.wfVersion})).deleteWorkflowDefinition)throw new u(`Workflow ${r} was not deleted.`);l(`Workflow ${r} deleted`);}),n.command("trigger").description("Trigger a workflow run").argument("<workflowKey>","Workflow key").requiredOption("--wf-version <version>","Workflow version").requiredOption("--trigger-node <id>","Trigger node ID").option("-i, --input <json>","Trigger data as a JSON object").option("--stop-at-node <id>","Stop the run after this node").option("--test","Run in TEST mode instead of PRODUCTION").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o)=>{let r={workflowKey:t,version:R(o.wfVersion,"--wf-version"),triggerNodeId:R(o.triggerNode,"--trigger-node")};o.input!==void 0&&(r.triggerData=x(o.input,"--input")),o.stopAtNode&&(r.stopAtNodeId=o.stopAtNode),o.test&&(r.mode="TEST");let s=await a(re,{input:r});c(o,s.triggerWorkflow);}),n.command("duplicate").description("Duplicate a workflow version under a new key").argument("<workflowKey>","Source workflow key").argument("<version>","Source version").requiredOption("--new-key <key>","Workflow key for the copy").option("--new-version <version>","Version for the copy").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o,r)=>{let s={newWorkflowKey:R(r.newKey,"--new-key")};r.newVersion&&(s.newVersion=r.newVersion);let d=await a(ue,{workflowKey:t,version:o,input:s});if(!d.duplicateWorkflow.success)throw new u(d.duplicateWorkflow.message??"Duplicate failed.");c(r,d.duplicateWorkflow.workflow??d.duplicateWorkflow);});let e=[["publish","Publish a workflow definition version",ie,"publishWorkflow"],["activate","Make a workflow definition version the active one",se,"activateWorkflowDefinition"],["deactivate","Deactivate a workflow definition version",ae,"deactivateWorkflowDefinition"],["archive","Archive a workflow definition version",de,"archiveWorkflow"]];for(let[t,o,r,s]of e)n.command(t).description(o).argument("<id>","Workflow definition ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(d,m)=>{let g=(await a(r,{id:d}))[s];if(!g)throw new u(`Workflow ${d}: ${t} returned no result.`);l(`Workflow ${g.workflowKey}@${g.version}: ${g.status}`),c(m,g);});n.command("import").description("Import a workflow from a store template (ImportWorkflowTemplateInput JSON)").argument("<file>","Path to the template input JSON").option("--name <name>","Override the workflow name").option("--description <text>","Override the description").option("--icon <icon>","Override the icon").option("--category <category>","Override the category").option("--project-id <id>","Scope to a project").option("--source-template-id <id>","Source template ID (lineage)").option("--context <json>","Context metadata as a JSON object").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o)=>{let r={...h(t)},s=R(o.name,"--name"),d=R(o.projectId,"--project-id"),m=R(o.sourceTemplateId,"--source-template-id");s!==void 0&&(r.name=s),o.description!==void 0&&(r.description=o.description),o.icon!==void 0&&(r.icon=o.icon),o.category!==void 0&&(r.category=o.category),d!==void 0&&(r.projectId=d),m!==void 0&&(r.sourceTemplateId=m),o.context!==void 0&&(r.context=x(o.context,"--context"));let C=await a(ce,{input:r});if(!C.importWorkflowTemplate.success)throw new u(C.importWorkflowTemplate.message??"Import failed.");l("Workflow imported"),c(o,C.importWorkflowTemplate.workflow??C.importWorkflowTemplate);});}var It=100;function Qe(i){return {headers:["ID","Workflow","Version","Status","Progress","Started","Completed"],rows:i.map(n=>[w(n.id,12),n.workflowKey,n.version,n.status,`${Math.round(n.progress)}%`,k(n.startedAt),k(n.completedAt)])}}async function L(i){let n=await a(pe,{id:i});return E(n.workflowRun,"Run",i)}function Tt(i){return He.some(n=>n===i.toUpperCase())}async function St(i,n,e,t,o){if(t===0)return [];let r=[],s=new Set,d=0,m=0;for(;r.length<t;){let g=(await a(_,{input:{workflowKey:n,status:e,limit:It,offset:d}})).workflowRuns;if(g.items.length===0){if(g.hasMore)throw new u("Run listing returned an empty page before the end.");break}for(let $ of g.items)if(!($.workflowId!==i||s.has($.id))){if(s.add($.id),m<o){m++;continue}if(r.push($),r.length===t)break}if(d+=g.items.length,!g.hasMore)break}return r}function Ot(i,n,e){let t=e.filter(d=>d.nodeId===n);if(t.length===0)throw new u(`Node ${n} not found in run ${i} (NOT_FOUND)`);let o=t.filter(d=>["FAILED","TIMEOUT"].includes(d.status.toUpperCase()));if(o.length===0)throw new u(`Node ${n} is not failed in run ${i} (INVALID_STATE)`);let[r,...s]=o;if(!r||s.length>0)throw new u(`Node ${n} is ambiguous in run ${i}; retry a specific node state.`);return r}function Rt(i){return new Promise(n=>setTimeout(n,i))}function Xe(i){let n=i.command("runs").description("FluidGrids workflow runs");n.command("list").description("List workflow runs").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-s, --status <status>",`Filter by status (${q.join("|")})`).option("--workflow-key <key>","Filter by workflow key").option("--workflow-id <id>","Filter by exact workflow definition ID (scans all pages)").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t=p(e.limit,"--limit"),o=p(e.offset,"--offset"),r=y(e.status,"--status",q);if(e.workflowId&&e.workflowKey)throw new u("Use either --workflow-id or --workflow-key, not both.");if(e.workflowId){let m=await a(D,{id:e.workflowId}),C=E(m.workflowDefinition,"Workflow",e.workflowId),g=await St(e.workflowId,C.workflowKey,r,t,o);c(e,g,Qe(g));return}let s={limit:t,offset:o};r&&(s.status=r),e.workflowKey&&(s.workflowKey=e.workflowKey);let d=await a(_,{input:s});c(e,d.workflowRuns.items,Qe(d.workflowRuns.items));}),n.command("get").description("Get a run (with node states)").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{c(t,await L(e));}),n.command("cancel").description("Cancel a run").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await a(me,{id:e});l(`Run ${e}: ${o.cancelWorkflowRun.status}`),c(t,o.cancelWorkflowRun);}),n.command("pause").description("Pause a run").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await a(ge,{id:e});l(`Run ${e}: ${o.pauseWorkflowRun.status}`),c(t,o.pauseWorkflowRun);}),n.command("resume").description("Resume a paused or waiting run").argument("<id>","Run ID").option("--payload <json>","JSON object delivered to the waiting node").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=t.payload===void 0?void 0:x(t.payload,"--payload"),r=await a(we,{id:e,payload:o});if(!r.resumeWorkflowRun.success)throw new u(r.resumeWorkflowRun.message);c(t,r.resumeWorkflowRun);}),n.command("wait").description("Poll a run until it reaches a terminal status").argument("<id>","Run ID").option("--timeout <ms>","Give up after this many milliseconds","300000").option("--poll-interval <ms>","Delay between polls in milliseconds","1000").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=p(t.timeout,"--timeout"),r=p(t.pollInterval,"--poll-interval"),s=Date.now(),d=await L(e);for(;!Tt(d.status);){if(Date.now()-s>o)throw new u(`Timed out waiting for run ${e} (last status ${d.status}).`);await Rt(r),d=await L(e);}c(t,d);}),n.command("logs").description("Get run logs (one cursor page)").argument("<id>","Run ID").option("--level <level>",`Minimum level (${G.join("|")})`).option("--node-id <id>","Only this graph node").option("--search <text>","Only lines containing this text").option("--include-child-runs","Include sub-workflow runs").option("--limit <n>","Page size, 1 to 1000").option("--after <cursor>","Continue after a nextCursor from an earlier page").option("--page-info","Print the whole page (lines + cursor) instead of only lines").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=y(t.level,"--level",G),r=t.limit===void 0?void 0:p(t.limit,"--limit");if(r!==void 0&&(r<1||r>1e3))throw new u(`Invalid value '${t.limit}' for --limit: expected 1 to 1000.`);if(t.after!==void 0&&!t.after.trim())throw new u("--after cursor cannot be empty.");let d=(await a(fe,{runId:e,nodeId:t.nodeId,minLevel:o,limit:r,after:t.after,search:t.search,includeChildRuns:t.includeChildRuns})).workflowRunLogs;if(t.pageInfo){c(t,d);return}c(t,d.lines,{headers:["Time","Level","Node","Message"],rows:d.lines.map(m=>[k(m.timestamp),m.level,m.nodeId??"-",w(m.message,100)])});}),n.command("retry-node").description("Retry one failed node of a run (run ID + graph node ID)").argument("<runId>","Run ID").argument("<nodeId>","Graph node ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t,o)=>{let r=await L(e),s=Ot(e,t,r.nodeStates??[]),d=await a(ye,{id:s.id,nodeId:t});l(`Node ${t} retry: ${d.retryNode.status}`),c(o,d.retryNode);});}function Ze(i){let n=i.command("nodes").description("FluidGrids node catalogue");n.command("list").description("List node endpoint configurations").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-t, --node-type <type>","Filter by node type").option("--publish-type <type>",`Filter by publish type (${J.join("|")})`).option("--status <status>",`Filter by status (${M.join("|")})`).option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let o=(await a(he,{nodeType:e.nodeType,publishType:y(e.publishType,"--publish-type",J),status:y(e.status,"--status",M),pagination:{limit:p(e.limit,"--limit"),offset:p(e.offset,"--offset")}})).nodeEndpointConfigs.configs;c(e,o,{headers:["Type","Version","Name","Category","Publish","Status","Latest"],rows:o.map(r=>[r.nodeType,r.nodeVersion,r.name,r.category??"-",r.publishType,r.status,r.isLatest?"yes":"no"])});}),n.command("get").description("Get a node endpoint configuration by type and version").argument("<nodeType>","Node type").argument("<nodeVersion>","Node version").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t,o)=>{let r=await a(Ee,{nodeType:e,nodeVersion:t});c(o,E(r.nodeEndpointConfig,"Node",`${e}@${t}`));});}var At=/^[A-Za-z_][A-Za-z0-9_]*$/;async function $t(i,n=process.stdin,e=process.stderr){if(!n.isTTY)throw new u("A terminal is required to prompt for a secret.");let t=new stream.Writable({write(r,s,d){d();}}),o=readline.createInterface({input:n,output:t,terminal:true});e.write(`${i}: `);try{return await new Promise(r=>{o.question("",r);})}finally{o.close(),e.write(`
|
|
401
|
+
`);}}async function et(i,n,e,t=process.env,o=$t){if(i!==void 0){if(!At.test(i))throw new u(`Invalid environment variable name for ${e}.`);let s=t[i];if(!s?.trim())throw new u(`The environment variable selected by ${e} is empty or unset.`);return s}if(!process.stdin.isTTY)throw new u(`An interactive terminal or ${e} is required to supply ${n}.`);let r=await o(n);if(!r.trim())throw new u(`${n} cannot be empty.`);return r}async function tt(i,n,e){try{let o=(await a(i,{input:e}))[n];if(o===void 0)throw new Error("empty response");return o}catch{throw new u("Connection authentication failed; verify the connection and secret.")}}function ot(i){let n=i.command("credentials").description("FluidGrids credentials (integration connections)");n.command("list").description("List credentials").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-p, --provider-id <id>","Filter by provider ID").option("-s, --status <status>",`Filter by status (${B.join("|")})`).option("--search <text>","Filter by name").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t={};e.providerId&&(t.providerId=e.providerId);let o=y(e.status,"--status",B);o&&(t.status=o),e.search&&(t.search=e.search);let s=(await a(be,{filter:Object.keys(t).length>0?t:void 0,pagination:{limit:p(e.limit,"--limit"),offset:p(e.offset,"--offset")}})).getConnections.items;c(e,s,{headers:["ID","Name","Provider","Status","Last used"],rows:s.map(d=>[w(d.id,12),d.name,d.provider?.key??d.providerId,d.status,k(d.lastUsedAt)])});}),n.command("get").description("Get a credential").argument("<id>","Credential (connection) ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await a(Ce,{id:e});c(t,E(o.getConnection,"Credential",e));}),n.command("types").description("List the credential types (integration providers) you can create").option("-l, --limit <n>","Page size","50").option("-o, --offset <n>","Offset","0").option("--search <text>","Filter by name").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t=await a(Ie,{filter:e.search?{search:e.search}:void 0,pagination:{limit:p(e.limit,"--limit"),offset:p(e.offset,"--offset")}}),o=t.getProviders.items;c(e,t.getProviders,{headers:["ID","Key","Name","Category","Auth","Enabled"],rows:o.map(r=>[w(r.id,12),r.key,r.name,r.category,r.authType,r.isEnabled?"yes":"no"])});}),n.command("create").description("Create a credential shell from a CreateConnectionInput JSON file (no secrets; attach one with auth-api-key / auth-basic)").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=h(e),r=await a(Te,{input:o});l(`Credential created: ${r.createConnection.id}`),c(t,r.createConnection);}),n.command("update").description("Update a credential (name, description, config) from a JSON file").argument("<id>","Credential (connection) ID").argument("<file>","Path to the UpdateConnectionInput JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t,o)=>{let r=h(t),s=await a(ve,{id:e,input:r});l("Credential updated"),c(o,s.updateConnection);}),n.command("delete").description("Delete a credential (the vault secret is kept unless --delete-vault-secret)").argument("<id>","Credential (connection) ID").option("--delete-vault-secret","Also delete the backing vault secret").option("--force","Skip the confirmation prompt").action(async(e,t)=>{if(await I(`Delete credential ${e}?`,t.force),!(await a(xe,{id:e,deleteVaultSecret:t.deleteVaultSecret?true:void 0})).deleteConnection)throw new u(`Credential ${e} was not deleted.`);l(`Credential ${e} deleted`);}),n.command("test").description("Test a credential against its provider").argument("<id>","Credential (connection) ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await a(Ae,{connectionId:e});c(t,o.testConnection);}),n.command("auth-api-key").description("Attach a provider API key to a credential (hidden prompt or named env var)").argument("<id>","Credential (connection) ID").option("--api-key-env <name>","Read the API key from this environment variable").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await et(t.apiKeyEnv,"API key","--api-key-env"),r=await tt(Oe,"authenticateWithApiKey",{connectionId:e,apiKey:o});l(`Credential ${e}: ${r.status}`),c(t,r);}),n.command("auth-basic").description("Attach provider basic-auth credentials (hidden prompt or named env var)").argument("<id>","Credential (connection) ID").argument("<username>","Provider username").option("--password-env <name>","Read the password from this environment variable").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t,o)=>{if(!t.trim())throw new u("Provider username cannot be empty.");let r=await et(o.passwordEnv,"Password","--password-env"),s=await tt(Re,"authenticateWithBasicAuth",{connectionId:e,username:t,password:r});l(`Credential ${e}: ${s.status}`),c(o,s);});}function nt(i){let n=i.command("webhooks").description("FluidGrids inbound webhooks (event registrations)");n.command("list").description("List webhooks").option("--workflow-key <key>","Filter by workflow key").option("-s, --status <status>",`Filter by status (${V.join("|")})`).option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t=await a($e,{status:y(e.status,"--status",V),workflowKey:e.workflowKey});c(e,t.eventRegistrations,{headers:["ID","Name","Workflow","Trigger node","Status","Triggers","Last"],rows:t.eventRegistrations.map(o=>[w(o.id,12),o.name??"-",o.workflowKey,o.triggerNodeId,o.isActive?o.status:`${o.status} (inactive)`,String(o.totalTriggers),k(o.lastTriggeredAt)])});}),n.command("get").description("Get a webhook").argument("<id>","Event registration ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await a(De,{id:e});c(t,E(o.eventRegistration,"Webhook",e));}),n.command("create").description("Create a webhook from a CreateEventRegistrationInput JSON file").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=h(e),r=await a(We,{input:o});l(`Webhook created: ${r.createEventRegistration.id}`),c(t,r.createEventRegistration);}),n.command("update").description("Update a webhook from an UpdateEventRegistrationInput JSON file").argument("<id>","Event registration ID").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t,o)=>{let r=h(t),s=await a(Le,{id:e,input:r});l("Webhook updated"),c(o,s.updateEventRegistration);}),n.command("delete").description("Delete a webhook").argument("<id>","Event registration ID").option("--force","Skip the confirmation prompt").action(async(e,t)=>{if(await I(`Delete webhook ${e}?`,t.force),!(await a(Ne,{id:e})).deleteEventRegistration)throw new u(`Webhook ${e} was not deleted.`);l(`Webhook ${e} deleted`);});for(let[e,t]of [["activate",true],["deactivate",false]])n.command(e).description(`${t?"Activate":"Deactivate"} a webhook`).argument("<id>","Event registration ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(o,r)=>{let s=await a(Fe,{id:o,isActive:t});l(`Webhook ${o} ${t?"activated":"deactivated"}`),c(r,s.toggleEventRegistration);});}function Y(i){if(!i.success)throw new u(i.message||"Scheduled job update failed.");return i}function rt(i){let n=i.command("scheduled-jobs").description("FluidGrids scheduled workflow runs (cron)");n.command("list").description("List scheduled jobs").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("--workflow-key <key>","Filter by workflow key").option("--enabled","Only enabled jobs").option("--disabled","Only disabled jobs").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{if(e.enabled&&e.disabled)throw new u("Use either --enabled or --disabled, not both.");let o=(await a(_e,{enabled:e.enabled?true:e.disabled?false:void 0,workflowKey:e.workflowKey,pagination:{limit:p(e.limit,"--limit"),offset:p(e.offset,"--offset")}})).workflowScheduledJobs.jobs;c(e,o,{headers:["ID","Name","Workflow","Version","Schedule","Enabled","Next run"],rows:o.map(r=>[w(r.id,12),r.name,r.workflowKey,r.version,r.schedule,r.enabled?"yes":"no",k(r.nextRun)])});}),n.command("get").description("Get a scheduled job").argument("<jobId>","Scheduled job ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await a(Pe,{jobId:e});c(t,E(o.workflowScheduledJob,"Scheduled job",e));}),n.command("create").description("Create a scheduled job from a ScheduledJobInput JSON file").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=h(e),r=await a(je,{input:o}),s=Y(r.createWorkflowScheduledJob);l(s.message||"Scheduled job created"),c(t,s.job??s);}),n.command("update").description("Update a scheduled job from a WorkflowUpdateScheduledJobInput JSON file").argument("<jobId>","Scheduled job ID").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t,o)=>{let r=h(t),s=await a(U,{jobId:e,input:r}),d=Y(s.updateWorkflowScheduledJob);l(d.message||"Scheduled job updated"),c(o,d.job??d);}),n.command("delete").description("Delete a scheduled job").argument("<jobId>","Scheduled job ID").option("--force","Skip the confirmation prompt").action(async(e,t)=>{await I(`Delete scheduled job ${e}?`,t.force);let o=await a(Ue,{jobId:e});if(!o.deleteWorkflowScheduledJob.success)throw new u(o.deleteWorkflowScheduledJob.message||"Delete failed.");l(`Scheduled job ${e} deleted`);});for(let[e,t]of [["pause",false],["resume",true]])n.command(e).description(`${t?"Resume":"Pause"} a scheduled job`).argument("<jobId>","Scheduled job ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(o,r)=>{let s=await a(U,{jobId:o,input:{enabled:t}}),d=Y(s.updateWorkflowScheduledJob);l(`Scheduled job ${o} ${t?"resumed":"paused"}`),c(r,d.job??d);});}function it(i,n){if(Number.isNaN(Date.parse(i)))throw new u(`Invalid value '${i}' for ${n}: expected an ISO 8601 date.`);return i}function st(i){let n=i.command("dashboard").description("FluidGrids dashboard metrics");n.command("summary").description("Workflow, run and node counters (incl. 24h / 7d / 30d windows)").option("-p, --project <id>","Scope to a project").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t=await a(Ke,{projectId:e.project});c(e,t.dashboardSummary);}),n.command("usage").description("Workflow and node execution metrics for a date range").requiredOption("--start <date>","Range start (ISO 8601)").requiredOption("--end <date>","Range end (ISO 8601)").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t=it(e.start,"--start"),o=it(e.end,"--end");if(Date.parse(t)>Date.parse(o))throw new u("--start must not be after --end.");let r=await a(qe,{input:{startDate:t,endDate:o}});c(e,r.usageMetrics);});}function at(i){i.command("search").description("Search FluidGrids workflows, runs, nodes").command("query").description("Search across FluidGrids entities").argument("<query>","Search text").option("-t, --type <type>",`Restrict to one entity type (${H.join("|")})`).option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{if(!e.trim())throw new u("Search text cannot be empty.");let o=y(t.type,"--type",H),r=p(t.limit,"--limit"),s=p(t.offset,"--offset"),d=o?(await a(Me,{entityType:o,query:e,limit:r,offset:s})).searchByEntityType:(await a(Je,{input:{query:e,limit:r,offset:s}})).search;c(t,d);});}function ut(i){i.command("admin").description("FluidGrids administration").command("system-info").description("Deployment information (version, revision, environment) of the workflow service").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t=await a(Ve);c(e,t.systemConfig);});}var Dt={id:"fluidgrids",version:"1.0.0",displayName:"FluidGrids",dependsOn:["auth","workspaces"],register(i,n){X(n),ze(i),Xe(i),Ze(i),ot(i),nt(i),rt(i),st(i),at(i),ut(i);}},$n=Dt;module.exports=$n;
|