@burdenoff/cli-sdk 2026.1123.2 → 2026.1124.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.
|
@@ -374,18 +374,18 @@
|
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
`,Ge="query results entityCounts totalResults metadata",Me=`
|
|
377
|
-
query FluidgridsSearch($input:
|
|
378
|
-
search(input: $input) { ${Ge} }
|
|
377
|
+
query FluidgridsSearch($input: WorkflowSearchRequestInput!) {
|
|
378
|
+
search: workflowSearch(input: $input) { ${Ge} }
|
|
379
379
|
}
|
|
380
380
|
`,Je=`
|
|
381
381
|
query FluidgridsSearchByEntityType(
|
|
382
382
|
$entityType: String!
|
|
383
383
|
$query: String!
|
|
384
|
-
$filters:
|
|
384
|
+
$filters: WorkflowSearchFilterInput
|
|
385
385
|
$limit: Int
|
|
386
386
|
$offset: Int
|
|
387
387
|
) {
|
|
388
|
-
searchByEntityType(
|
|
388
|
+
searchByEntityType: workflowSearchByEntityType(
|
|
389
389
|
entityType: $entityType
|
|
390
390
|
query: $query
|
|
391
391
|
filters: $filters
|
|
@@ -175,7 +175,7 @@ import {a,b,i,k as k$1,q as q$2,r,s}from'../../chunk-3ZVMC2AF.js';import {q as q
|
|
|
175
175
|
pagination { total limit offset hasMore }
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
`,
|
|
178
|
+
`,wt=`
|
|
179
179
|
query FluidgridsGetNode($nodeType: String!, $nodeVersion: String!) {
|
|
180
180
|
nodeEndpointConfig(nodeType: $nodeType, nodeVersion: $nodeVersion) {
|
|
181
181
|
${ft}
|
|
@@ -187,7 +187,7 @@ import {a,b,i,k as k$1,q as q$2,r,s}from'../../chunk-3ZVMC2AF.js';import {q as q
|
|
|
187
187
|
id name description status providerId credentialSource externalAccountId
|
|
188
188
|
externalAccountName externalAccountEmail grantedScopes lastUsedAt lastHealthCheck
|
|
189
189
|
errorMessage createdAt updatedAt
|
|
190
|
-
`,
|
|
190
|
+
`,gt=`
|
|
191
191
|
query FluidgridsListCredentials(
|
|
192
192
|
$filter: ConnectionFilterInput
|
|
193
193
|
$pagination: IntegrationsPaginationInput
|
|
@@ -374,18 +374,18 @@ import {a,b,i,k as k$1,q as q$2,r,s}from'../../chunk-3ZVMC2AF.js';import {q as q
|
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
`,Ut="query results entityCounts totalResults metadata",jt=`
|
|
377
|
-
query FluidgridsSearch($input:
|
|
378
|
-
search(input: $input) { ${Ut} }
|
|
377
|
+
query FluidgridsSearch($input: WorkflowSearchRequestInput!) {
|
|
378
|
+
search: workflowSearch(input: $input) { ${Ut} }
|
|
379
379
|
}
|
|
380
380
|
`,Kt=`
|
|
381
381
|
query FluidgridsSearchByEntityType(
|
|
382
382
|
$entityType: String!
|
|
383
383
|
$query: String!
|
|
384
|
-
$filters:
|
|
384
|
+
$filters: WorkflowSearchFilterInput
|
|
385
385
|
$limit: Int
|
|
386
386
|
$offset: Int
|
|
387
387
|
) {
|
|
388
|
-
searchByEntityType(
|
|
388
|
+
searchByEntityType: workflowSearchByEntityType(
|
|
389
389
|
entityType: $entityType
|
|
390
390
|
query: $query
|
|
391
391
|
filters: $filters
|
|
@@ -397,5 +397,5 @@ import {a,b,i,k as k$1,q as q$2,r,s}from'../../chunk-3ZVMC2AF.js';import {q as q
|
|
|
397
397
|
query FluidgridsSystemConfig {
|
|
398
398
|
systemConfig { version revision environment deploymentType hostname hostIp }
|
|
399
399
|
}
|
|
400
|
-
`;function p(r,i){if(!/^\d+$/.test(r))throw new q$1(`Invalid value '${r}' for ${i}: expected a non-negative integer.`);let t=Number(r);if(!Number.isSafeInteger(t))throw new q$1(`Invalid value '${r}' for ${i}: expected a non-negative integer.`);return t}function w(r,i,t){if(r===void 0)return;let e=t.find(o=>o===r);if(e===void 0)throw new q$1(`Invalid value '${r}' for ${i}. Allowed: ${t.join(", ")}`);return e}function C(r,i){let t;try{t=JSON.parse(r);}catch{throw new q$1(`${i} must be valid JSON.`)}if(!re(t))throw new q$1(`${i} must be a JSON object.`);return t}function k(r){let i;try{i=readFileSync(r,"utf8");}catch(t){let e=t instanceof Error?t.message:String(t);throw new q$1(`Cannot read ${r}: ${e}`)}return C(i,r)}function T(r,i){if(r!==void 0){if(!r.trim())throw new q$1(`${i} cannot be empty.`);return r}}function h(r,i,t){if(r==null)throw new q$1(`${i} ${t} not found (NOT_FOUND)`);return r}function re(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function Jt(r,i=[]){return [...i,r]}async function I(r,i){if(!await s(r,i))throw new q$1("Aborted: nothing was changed.")}var U=["DRAFT","ACTIVE","ARCHIVED","DEPRECATED"],j=["PENDING","RUNNING","WAITING","COMPLETED","FAILED","CANCELLED","TERMINATED"],Mt=["COMPLETED","FAILED","CANCELLED","TERMINATED"],K=["DEBUG","INFO","WARN","ERROR"],P=["BUILTIN","CUSTOM","STORE"],J=["AVAILABLE","DEPRECATED","DISABLED"],M=["ACTIVE","PAUSED","DISABLED","ARCHIVED"],G=["ACTIVE","INACTIVE","PENDING_AUTH","ERROR","EXPIRED","REVOKED"],V=["workflow","run","node","event"];function Gt(r$1){return {headers:["ID","Key","Name","Version","Status","Active","Updated"],rows:r$1.map(i=>[r(i.id,12),i.workflowKey,r(i.name,32),i.version,i.status,i.isActive?"yes":"no",q$2(i.updatedAt)])}}function Vt(r){let i$1=r.command("workflows").description("FluidGrids workflow definitions");i$1.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 (${U.join("|")})`).option("--category <category>","Filter by category").option("--tag <tag>","Filter by tag (repeatable)",Jt).option("--latest-only","Only the latest version of each workflow key").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let o={limit:p(e.limit,"--limit"),offset:p(e.offset,"--offset")},n=w(e.status,"--status",U);n&&(o.status=n),e.category&&(o.category=e.category),e.tag?.length&&(o.tags=e.tag),e.latestOnly&&(o.latestOnly=true);let s=await b(q,{input:o});i(e,s.workflowDefinitions.items,Gt(s.workflowDefinitions.items));}),i$1.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(e,o)=>{if(!e&&!o.key)throw new q$1("Pass a workflow ID or --key <workflowKey>.");if(e&&o.key)throw new q$1("Pass either a workflow ID or --key, not both.");let n=await b(v,e?{id:e}:{workflowKey:o.key,version:o.wfVersion});i(o,h(n.workflowDefinition,"Workflow",e??o.key??""));}),i$1.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(e,o)=>{let n=await b(Y,{workflowKey:e});i(o,n.workflowVersions,Gt(n.workflowVersions));}),i$1.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(e,o)=>{let n=k(e),s=await b(z,{input:n});k$1(`Workflow created: ${s.createWorkflowDefinition.workflowKey}`),i(o,s.createWorkflowDefinition);}),i$1.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(e,o,n)=>{let s=k(o),d=await b(Z,{id:e,input:s});k$1("Workflow updated"),i(n,d.updateWorkflowDefinition);}),i$1.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(e,o)=>{let n=o.wfVersion?`${e}@${o.wfVersion}`:`${e} (all versions)`;if(await I(`Delete workflow ${n}?`,o.force),!(await b(Q,{workflowKey:e,version:o.wfVersion})).deleteWorkflowDefinition)throw new q$1(`Workflow ${n} was not deleted.`);k$1(`Workflow ${n} deleted`);}),i$1.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(e,o)=>{let n={workflowKey:e,version:T(o.wfVersion,"--wf-version"),triggerNodeId:T(o.triggerNode,"--trigger-node")};o.input!==void 0&&(n.triggerData=C(o.input,"--input")),o.stopAtNode&&(n.stopAtNodeId=o.stopAtNode),o.test&&(n.mode="TEST");let s=await b(X,{input:n});i(o,s.triggerWorkflow);}),i$1.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(e,o,n)=>{let s={newWorkflowKey:T(n.newKey,"--new-key")};n.newVersion&&(s.newVersion=n.newVersion);let d=await b(nt,{workflowKey:e,version:o,input:s});if(!d.duplicateWorkflow.success)throw new q$1(d.duplicateWorkflow.message??"Duplicate failed.");i(n,d.duplicateWorkflow.workflow??d.duplicateWorkflow);});let t=[["publish","Publish a workflow definition version",tt,"publishWorkflow"],["activate","Make a workflow definition version the active one",et,"activateWorkflowDefinition"],["deactivate","Deactivate a workflow definition version",ot,"deactivateWorkflowDefinition"],["archive","Archive a workflow definition version",it,"archiveWorkflow"]];for(let[e,o,n,s]of t)i$1.command(e).description(o).argument("<id>","Workflow definition ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(d,f)=>{let m=(await b(n,{id:d}))[s];if(!m)throw new q$1(`Workflow ${d}: ${e} returned no result.`);k$1(`Workflow ${m.workflowKey}@${m.version}: ${m.status}`),i(f,m);});i$1.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(e,o)=>{let n={...k(e)},s=T(o.name,"--name"),d=T(o.projectId,"--project-id"),f=T(o.sourceTemplateId,"--source-template-id");s!==void 0&&(n.name=s),o.description!==void 0&&(n.description=o.description),o.icon!==void 0&&(n.icon=o.icon),o.category!==void 0&&(n.category=o.category),d!==void 0&&(n.projectId=d),f!==void 0&&(n.sourceTemplateId=f),o.context!==void 0&&(n.context=C(o.context,"--context"));let S=await b(rt,{input:n});if(!S.importWorkflowTemplate.success)throw new q$1(S.importWorkflowTemplate.message??"Import failed.");k$1("Workflow imported"),i(o,S.importWorkflowTemplate.workflow??S.importWorkflowTemplate);});}var se=100;function Bt(r$1){return {headers:["ID","Workflow","Version","Status","Progress","Started","Completed"],rows:r$1.map(i=>[r(i.id,12),i.workflowKey,i.version,i.status,`${Math.round(i.progress)}%`,q$2(i.startedAt),q$2(i.completedAt)])}}async function A(r){let i=await b(at,{id:r});return h(i.workflowRun,"Run",r)}function ae(r){return Mt.some(i=>i===r.toUpperCase())}async function de(r,i,t,e,o){if(e===0)return [];let n=[],s=new Set,d=0,f=0;for(;n.length<e;){let m=(await b(F,{input:{workflowKey:i,status:t,limit:se,offset:d}})).workflowRuns;if(m.items.length===0){if(m.hasMore)throw new q$1("Run listing returned an empty page before the end.");break}for(let D of m.items)if(!(D.workflowId!==r||s.has(D.id))){if(s.add(D.id),f<o){f++;continue}if(n.push(D),n.length===e)break}if(d+=m.items.length,!m.hasMore)break}return n}function le(r,i,t){let e=t.filter(d=>d.nodeId===i);if(e.length===0)throw new q$1(`Node ${i} not found in run ${r} (NOT_FOUND)`);let o=e.filter(d=>["FAILED","TIMEOUT"].includes(d.status.toUpperCase()));if(o.length===0)throw new q$1(`Node ${i} is not failed in run ${r} (INVALID_STATE)`);let[n,...s]=o;if(!n||s.length>0)throw new q$1(`Node ${i} is ambiguous in run ${r}; retry a specific node state.`);return n}function ue(r){return new Promise(i=>setTimeout(i,r))}function Ht(r$1){let i$1=r$1.command("runs").description("FluidGrids workflow runs");i$1.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 (${j.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 t=>{let e=p(t.limit,"--limit"),o=p(t.offset,"--offset"),n=w(t.status,"--status",j);if(t.workflowId&&t.workflowKey)throw new q$1("Use either --workflow-id or --workflow-key, not both.");if(t.workflowId){let f=await b(v,{id:t.workflowId}),S=h(f.workflowDefinition,"Workflow",t.workflowId),m=await de(t.workflowId,S.workflowKey,n,e,o);i(t,m,Bt(m));return}let s={limit:e,offset:o};n&&(s.status=n),t.workflowKey&&(s.workflowKey=t.workflowKey);let d=await b(F,{input:s});i(t,d.workflowRuns.items,Bt(d.workflowRuns.items));}),i$1.command("get").description("Get a run (with node states)").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{i(e,await A(t));}),i$1.command("cancel").description("Cancel a run").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(lt,{id:t});k$1(`Run ${t}: ${o.cancelWorkflowRun.status}`),i(e,o.cancelWorkflowRun);}),i$1.command("pause").description("Pause a run").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(ut,{id:t});k$1(`Run ${t}: ${o.pauseWorkflowRun.status}`),i(e,o.pauseWorkflowRun);}),i$1.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(t,e)=>{let o=e.payload===void 0?void 0:C(e.payload,"--payload"),n=await b(ct,{id:t,payload:o});if(!n.resumeWorkflowRun.success)throw new q$1(n.resumeWorkflowRun.message);i(e,n.resumeWorkflowRun);}),i$1.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(t,e)=>{let o=p(e.timeout,"--timeout"),n=p(e.pollInterval,"--poll-interval"),s=Date.now(),d=await A(t);for(;!ae(d.status);){if(Date.now()-s>o)throw new q$1(`Timed out waiting for run ${t} (last status ${d.status}).`);await ue(n),d=await A(t);}i(e,d);}),i$1.command("logs").description("Get run logs (one cursor page)").argument("<id>","Run ID").option("--level <level>",`Minimum level (${K.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(t,e)=>{let o=w(e.level,"--level",K),n=e.limit===void 0?void 0:p(e.limit,"--limit");if(n!==void 0&&(n<1||n>1e3))throw new q$1(`Invalid value '${e.limit}' for --limit: expected 1 to 1000.`);if(e.after!==void 0&&!e.after.trim())throw new q$1("--after cursor cannot be empty.");let d=(await b(dt,{runId:t,nodeId:e.nodeId,minLevel:o,limit:n,after:e.after,search:e.search,includeChildRuns:e.includeChildRuns})).workflowRunLogs;if(e.pageInfo){i(e,d);return}i(e,d.lines,{headers:["Time","Level","Node","Message"],rows:d.lines.map(f=>[q$2(f.timestamp),f.level,f.nodeId??"-",r(f.message,100)])});}),i$1.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(t,e,o)=>{let n=await A(t),s=le(t,e,n.nodeStates??[]),d=await b(pt,{id:s.id,nodeId:e});k$1(`Node ${e} retry: ${d.retryNode.status}`),i(o,d.retryNode);});}function qt(r){let i$1=r.command("nodes").description("FluidGrids node catalogue");i$1.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 (${P.join("|")})`).option("--status <status>",`Filter by status (${J.join("|")})`).option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let o=(await b(mt,{nodeType:t.nodeType,publishType:w(t.publishType,"--publish-type",P),status:w(t.status,"--status",J),pagination:{limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")}})).nodeEndpointConfigs.configs;i(t,o,{headers:["Type","Version","Name","Category","Publish","Status","Latest"],rows:o.map(n=>[n.nodeType,n.nodeVersion,n.name,n.category??"-",n.publishType,n.status,n.isLatest?"yes":"no"])});}),i$1.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(t,e,o)=>{let n=await b(gt,{nodeType:t,nodeVersion:e});i(o,h(n.nodeEndpointConfig,"Node",`${t}@${e}`));});}var fe=/^[A-Za-z_][A-Za-z0-9_]*$/;async function me(r,i=process.stdin,t=process.stderr){if(!i.isTTY)throw new q$1("A terminal is required to prompt for a secret.");let e=new Writable({write(n,s,d){d();}}),o=createInterface({input:i,output:e,terminal:true});t.write(`${r}: `);try{return await new Promise(n=>{o.question("",n);})}finally{o.close(),t.write(`
|
|
401
|
-
`);}}async function Yt(r,i,t,e=process.env,o=me){if(r!==void 0){if(!fe.test(r))throw new q$1(`Invalid environment variable name for ${t}.`);let s=e[r];if(!s?.trim())throw new q$1(`The environment variable selected by ${t} is empty or unset.`);return s}if(!process.stdin.isTTY)throw new q$1(`An interactive terminal or ${t} is required to supply ${i}.`);let n=await o(i);if(!n.trim())throw new q$1(`${i} cannot be empty.`);return n}async function zt(r,i,t){try{let o=(await b(r,{input:t}))[i];if(o===void 0)throw new Error("empty response");return o}catch{throw new q$1("Connection authentication failed; verify the connection and secret.")}}function Zt(r$1){let i$1=r$1.command("credentials").description("FluidGrids credentials (integration connections)");i$1.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 (${G.join("|")})`).option("--search <text>","Filter by name").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let e={};t.providerId&&(e.providerId=t.providerId);let o=w(t.status,"--status",G);o&&(e.status=o),t.search&&(e.search=t.search);let s=(await b(wt,{filter:Object.keys(e).length>0?e:void 0,pagination:{limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")}})).getConnections.items;i(t,s,{headers:["ID","Name","Provider","Status","Last used"],rows:s.map(d=>[r(d.id,12),d.name,d.provider?.key??d.providerId,d.status,q$2(d.lastUsedAt)])});}),i$1.command("get").description("Get a credential").argument("<id>","Credential (connection) ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(yt,{id:t});i(e,h(o.getConnection,"Credential",t));}),i$1.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 t=>{let e=await b(kt,{filter:t.search?{search:t.search}:void 0,pagination:{limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")}}),o=e.getProviders.items;i(t,e.getProviders,{headers:["ID","Key","Name","Category","Auth","Enabled"],rows:o.map(n=>[r(n.id,12),n.key,n.name,n.category,n.authType,n.isEnabled?"yes":"no"])});}),i$1.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(t,e)=>{let o=k(t),n=await b(ht,{input:o});k$1(`Credential created: ${n.createConnection.id}`),i(e,n.createConnection);}),i$1.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(t,e,o)=>{let n=k(e),s=await b(St,{id:t,input:n});k$1("Credential updated"),i(o,s.updateConnection);}),i$1.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(t,e)=>{if(await I(`Delete credential ${t}?`,e.force),!(await b(It,{id:t,deleteVaultSecret:e.deleteVaultSecret?true:void 0})).deleteConnection)throw new q$1(`Credential ${t} was not deleted.`);k$1(`Credential ${t} deleted`);}),i$1.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(t,e)=>{let o=await b(Ot,{connectionId:t});i(e,o.testConnection);}),i$1.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(t,e)=>{let o=await Yt(e.apiKeyEnv,"API key","--api-key-env"),n=await zt(Rt,"authenticateWithApiKey",{connectionId:t,apiKey:o});k$1(`Credential ${t}: ${n.status}`),i(e,n);}),i$1.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(t,e,o)=>{if(!e.trim())throw new q$1("Provider username cannot be empty.");let n=await Yt(o.passwordEnv,"Password","--password-env"),s=await zt(bt,"authenticateWithBasicAuth",{connectionId:t,username:e,password:n});k$1(`Credential ${t}: ${s.status}`),i(o,s);});}function Qt(r$1){let i$1=r$1.command("webhooks").description("FluidGrids inbound webhooks (event registrations)");i$1.command("list").description("List webhooks").option("--workflow-key <key>","Filter by workflow key").option("-s, --status <status>",`Filter by status (${M.join("|")})`).option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let e=await b(Tt,{status:w(t.status,"--status",M),workflowKey:t.workflowKey});i(t,e.eventRegistrations,{headers:["ID","Name","Workflow","Trigger node","Status","Triggers","Last"],rows:e.eventRegistrations.map(o=>[r(o.id,12),o.name??"-",o.workflowKey,o.triggerNodeId,o.isActive?o.status:`${o.status} (inactive)`,String(o.totalTriggers),q$2(o.lastTriggeredAt)])});}),i$1.command("get").description("Get a webhook").argument("<id>","Event registration ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(Ct,{id:t});i(e,h(o.eventRegistration,"Webhook",t));}),i$1.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(t,e)=>{let o=k(t),n=await b($t,{input:o});k$1(`Webhook created: ${n.createEventRegistration.id}`),i(e,n.createEventRegistration);}),i$1.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(t,e,o)=>{let n=k(e),s=await b(Dt,{id:t,input:n});k$1("Webhook updated"),i(o,s.updateEventRegistration);}),i$1.command("delete").description("Delete a webhook").argument("<id>","Event registration ID").option("--force","Skip the confirmation prompt").action(async(t,e)=>{if(await I(`Delete webhook ${t}?`,e.force),!(await b(vt,{id:t})).deleteEventRegistration)throw new q$1(`Webhook ${t} was not deleted.`);k$1(`Webhook ${t} deleted`);});for(let[t,e]of [["activate",true],["deactivate",false]])i$1.command(t).description(`${e?"Activate":"Deactivate"} a webhook`).argument("<id>","Event registration ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(o,n)=>{let s=await b(Wt,{id:o,isActive:e});k$1(`Webhook ${o} ${e?"activated":"deactivated"}`),i(n,s.toggleEventRegistration);});}function B(r){if(!r.success)throw new q$1(r.message||"Scheduled job update failed.");return r}function Xt(r$1){let i$1=r$1.command("scheduled-jobs").description("FluidGrids scheduled workflow runs (cron)");i$1.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 t=>{if(t.enabled&&t.disabled)throw new q$1("Use either --enabled or --disabled, not both.");let o=(await b(At,{enabled:t.enabled?true:t.disabled?false:void 0,workflowKey:t.workflowKey,pagination:{limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")}})).workflowScheduledJobs.jobs;i(t,o,{headers:["ID","Name","Workflow","Version","Schedule","Enabled","Next run"],rows:o.map(n=>[r(n.id,12),n.name,n.workflowKey,n.version,n.schedule,n.enabled?"yes":"no",q$2(n.nextRun)])});}),i$1.command("get").description("Get a scheduled job").argument("<jobId>","Scheduled job ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(Nt,{jobId:t});i(e,h(o.workflowScheduledJob,"Scheduled job",t));}),i$1.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(t,e)=>{let o=k(t),n=await b(Ft,{input:o}),s=B(n.createWorkflowScheduledJob);k$1(s.message||"Scheduled job created"),i(e,s.job??s);}),i$1.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(t,e,o)=>{let n=k(e),s=await b(x,{jobId:t,input:n}),d=B(s.updateWorkflowScheduledJob);k$1(d.message||"Scheduled job updated"),i(o,d.job??d);}),i$1.command("delete").description("Delete a scheduled job").argument("<jobId>","Scheduled job ID").option("--force","Skip the confirmation prompt").action(async(t,e)=>{await I(`Delete scheduled job ${t}?`,e.force);let o=await b(Lt,{jobId:t});if(!o.deleteWorkflowScheduledJob.success)throw new q$1(o.deleteWorkflowScheduledJob.message||"Delete failed.");k$1(`Scheduled job ${t} deleted`);});for(let[t,e]of [["pause",false],["resume",true]])i$1.command(t).description(`${e?"Resume":"Pause"} a scheduled job`).argument("<jobId>","Scheduled job ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(o,n)=>{let s=await b(x,{jobId:o,input:{enabled:e}}),d=B(s.updateWorkflowScheduledJob);k$1(`Scheduled job ${o} ${e?"resumed":"paused"}`),i(n,d.job??d);});}function te(r,i){if(Number.isNaN(Date.parse(r)))throw new q$1(`Invalid value '${r}' for ${i}: expected an ISO 8601 date.`);return r}function ee(r){let i$1=r.command("dashboard").description("FluidGrids dashboard metrics");i$1.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 t=>{let e=await b(_t,{projectId:t.project});i(t,e.dashboardSummary);}),i$1.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 t=>{let e=te(t.start,"--start"),o=te(t.end,"--end");if(Date.parse(e)>Date.parse(o))throw new q$1("--start must not be after --end.");let n=await b(xt,{input:{startDate:e,endDate:o}});i(t,n.usageMetrics);});}function oe(r){r.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 (${V.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(t,e)=>{if(!t.trim())throw new q$1("Search text cannot be empty.");let o=w(e.type,"--type",V),n=p(e.limit,"--limit"),s=p(e.offset,"--offset"),d=o?(await b(Kt,{entityType:o,query:t,limit:n,offset:s})).searchByEntityType:(await b(jt,{input:{query:t,limit:n,offset:s}})).search;i(e,d);});}function ne(r){r.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 t=>{let e=await b(Pt);i(t,e.systemConfig);});}var ge={id:"fluidgrids",version:"1.0.0",displayName:"FluidGrids",dependsOn:["auth","workspaces"],register(r,i){a(i),Vt(r),Ht(r),qt(r),Zt(r),Qt(r),Xt(r),ee(r),oe(r),ne(r);}},uo=ge;export{uo as default};
|
|
400
|
+
`;function p(r,i){if(!/^\d+$/.test(r))throw new q$1(`Invalid value '${r}' for ${i}: expected a non-negative integer.`);let t=Number(r);if(!Number.isSafeInteger(t))throw new q$1(`Invalid value '${r}' for ${i}: expected a non-negative integer.`);return t}function g(r,i,t){if(r===void 0)return;let e=t.find(o=>o===r);if(e===void 0)throw new q$1(`Invalid value '${r}' for ${i}. Allowed: ${t.join(", ")}`);return e}function C(r,i){let t;try{t=JSON.parse(r);}catch{throw new q$1(`${i} must be valid JSON.`)}if(!re(t))throw new q$1(`${i} must be a JSON object.`);return t}function k(r){let i;try{i=readFileSync(r,"utf8");}catch(t){let e=t instanceof Error?t.message:String(t);throw new q$1(`Cannot read ${r}: ${e}`)}return C(i,r)}function T(r,i){if(r!==void 0){if(!r.trim())throw new q$1(`${i} cannot be empty.`);return r}}function h(r,i,t){if(r==null)throw new q$1(`${i} ${t} not found (NOT_FOUND)`);return r}function re(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function Jt(r,i=[]){return [...i,r]}async function I(r,i){if(!await s(r,i))throw new q$1("Aborted: nothing was changed.")}var U=["DRAFT","ACTIVE","ARCHIVED","DEPRECATED"],j=["PENDING","RUNNING","WAITING","COMPLETED","FAILED","CANCELLED","TERMINATED"],Mt=["COMPLETED","FAILED","CANCELLED","TERMINATED"],K=["DEBUG","INFO","WARN","ERROR"],P=["BUILTIN","CUSTOM","STORE"],J=["AVAILABLE","DEPRECATED","DISABLED"],M=["ACTIVE","PAUSED","DISABLED","ARCHIVED"],G=["ACTIVE","INACTIVE","PENDING_AUTH","ERROR","EXPIRED","REVOKED"],V=["workflow","run","node","event"];function Gt(r$1){return {headers:["ID","Key","Name","Version","Status","Active","Updated"],rows:r$1.map(i=>[r(i.id,12),i.workflowKey,r(i.name,32),i.version,i.status,i.isActive?"yes":"no",q$2(i.updatedAt)])}}function Vt(r){let i$1=r.command("workflows").description("FluidGrids workflow definitions");i$1.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 (${U.join("|")})`).option("--category <category>","Filter by category").option("--tag <tag>","Filter by tag (repeatable)",Jt).option("--latest-only","Only the latest version of each workflow key").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let o={limit:p(e.limit,"--limit"),offset:p(e.offset,"--offset")},n=g(e.status,"--status",U);n&&(o.status=n),e.category&&(o.category=e.category),e.tag?.length&&(o.tags=e.tag),e.latestOnly&&(o.latestOnly=true);let s=await b(q,{input:o});i(e,s.workflowDefinitions.items,Gt(s.workflowDefinitions.items));}),i$1.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(e,o)=>{if(!e&&!o.key)throw new q$1("Pass a workflow ID or --key <workflowKey>.");if(e&&o.key)throw new q$1("Pass either a workflow ID or --key, not both.");let n=await b(v,e?{id:e}:{workflowKey:o.key,version:o.wfVersion});i(o,h(n.workflowDefinition,"Workflow",e??o.key??""));}),i$1.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(e,o)=>{let n=await b(Y,{workflowKey:e});i(o,n.workflowVersions,Gt(n.workflowVersions));}),i$1.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(e,o)=>{let n=k(e),s=await b(z,{input:n});k$1(`Workflow created: ${s.createWorkflowDefinition.workflowKey}`),i(o,s.createWorkflowDefinition);}),i$1.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(e,o,n)=>{let s=k(o),d=await b(Z,{id:e,input:s});k$1("Workflow updated"),i(n,d.updateWorkflowDefinition);}),i$1.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(e,o)=>{let n=o.wfVersion?`${e}@${o.wfVersion}`:`${e} (all versions)`;if(await I(`Delete workflow ${n}?`,o.force),!(await b(Q,{workflowKey:e,version:o.wfVersion})).deleteWorkflowDefinition)throw new q$1(`Workflow ${n} was not deleted.`);k$1(`Workflow ${n} deleted`);}),i$1.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(e,o)=>{let n={workflowKey:e,version:T(o.wfVersion,"--wf-version"),triggerNodeId:T(o.triggerNode,"--trigger-node")};o.input!==void 0&&(n.triggerData=C(o.input,"--input")),o.stopAtNode&&(n.stopAtNodeId=o.stopAtNode),o.test&&(n.mode="TEST");let s=await b(X,{input:n});i(o,s.triggerWorkflow);}),i$1.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(e,o,n)=>{let s={newWorkflowKey:T(n.newKey,"--new-key")};n.newVersion&&(s.newVersion=n.newVersion);let d=await b(nt,{workflowKey:e,version:o,input:s});if(!d.duplicateWorkflow.success)throw new q$1(d.duplicateWorkflow.message??"Duplicate failed.");i(n,d.duplicateWorkflow.workflow??d.duplicateWorkflow);});let t=[["publish","Publish a workflow definition version",tt,"publishWorkflow"],["activate","Make a workflow definition version the active one",et,"activateWorkflowDefinition"],["deactivate","Deactivate a workflow definition version",ot,"deactivateWorkflowDefinition"],["archive","Archive a workflow definition version",it,"archiveWorkflow"]];for(let[e,o,n,s]of t)i$1.command(e).description(o).argument("<id>","Workflow definition ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(d,f)=>{let m=(await b(n,{id:d}))[s];if(!m)throw new q$1(`Workflow ${d}: ${e} returned no result.`);k$1(`Workflow ${m.workflowKey}@${m.version}: ${m.status}`),i(f,m);});i$1.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(e,o)=>{let n={...k(e)},s=T(o.name,"--name"),d=T(o.projectId,"--project-id"),f=T(o.sourceTemplateId,"--source-template-id");s!==void 0&&(n.name=s),o.description!==void 0&&(n.description=o.description),o.icon!==void 0&&(n.icon=o.icon),o.category!==void 0&&(n.category=o.category),d!==void 0&&(n.projectId=d),f!==void 0&&(n.sourceTemplateId=f),o.context!==void 0&&(n.context=C(o.context,"--context"));let S=await b(rt,{input:n});if(!S.importWorkflowTemplate.success)throw new q$1(S.importWorkflowTemplate.message??"Import failed.");k$1("Workflow imported"),i(o,S.importWorkflowTemplate.workflow??S.importWorkflowTemplate);});}var se=100;function Bt(r$1){return {headers:["ID","Workflow","Version","Status","Progress","Started","Completed"],rows:r$1.map(i=>[r(i.id,12),i.workflowKey,i.version,i.status,`${Math.round(i.progress)}%`,q$2(i.startedAt),q$2(i.completedAt)])}}async function A(r){let i=await b(at,{id:r});return h(i.workflowRun,"Run",r)}function ae(r){return Mt.some(i=>i===r.toUpperCase())}async function de(r,i,t,e,o){if(e===0)return [];let n=[],s=new Set,d=0,f=0;for(;n.length<e;){let m=(await b(F,{input:{workflowKey:i,status:t,limit:se,offset:d}})).workflowRuns;if(m.items.length===0){if(m.hasMore)throw new q$1("Run listing returned an empty page before the end.");break}for(let D of m.items)if(!(D.workflowId!==r||s.has(D.id))){if(s.add(D.id),f<o){f++;continue}if(n.push(D),n.length===e)break}if(d+=m.items.length,!m.hasMore)break}return n}function le(r,i,t){let e=t.filter(d=>d.nodeId===i);if(e.length===0)throw new q$1(`Node ${i} not found in run ${r} (NOT_FOUND)`);let o=e.filter(d=>["FAILED","TIMEOUT"].includes(d.status.toUpperCase()));if(o.length===0)throw new q$1(`Node ${i} is not failed in run ${r} (INVALID_STATE)`);let[n,...s]=o;if(!n||s.length>0)throw new q$1(`Node ${i} is ambiguous in run ${r}; retry a specific node state.`);return n}function ue(r){return new Promise(i=>setTimeout(i,r))}function Ht(r$1){let i$1=r$1.command("runs").description("FluidGrids workflow runs");i$1.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 (${j.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 t=>{let e=p(t.limit,"--limit"),o=p(t.offset,"--offset"),n=g(t.status,"--status",j);if(t.workflowId&&t.workflowKey)throw new q$1("Use either --workflow-id or --workflow-key, not both.");if(t.workflowId){let f=await b(v,{id:t.workflowId}),S=h(f.workflowDefinition,"Workflow",t.workflowId),m=await de(t.workflowId,S.workflowKey,n,e,o);i(t,m,Bt(m));return}let s={limit:e,offset:o};n&&(s.status=n),t.workflowKey&&(s.workflowKey=t.workflowKey);let d=await b(F,{input:s});i(t,d.workflowRuns.items,Bt(d.workflowRuns.items));}),i$1.command("get").description("Get a run (with node states)").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{i(e,await A(t));}),i$1.command("cancel").description("Cancel a run").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(lt,{id:t});k$1(`Run ${t}: ${o.cancelWorkflowRun.status}`),i(e,o.cancelWorkflowRun);}),i$1.command("pause").description("Pause a run").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(ut,{id:t});k$1(`Run ${t}: ${o.pauseWorkflowRun.status}`),i(e,o.pauseWorkflowRun);}),i$1.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(t,e)=>{let o=e.payload===void 0?void 0:C(e.payload,"--payload"),n=await b(ct,{id:t,payload:o});if(!n.resumeWorkflowRun.success)throw new q$1(n.resumeWorkflowRun.message);i(e,n.resumeWorkflowRun);}),i$1.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(t,e)=>{let o=p(e.timeout,"--timeout"),n=p(e.pollInterval,"--poll-interval"),s=Date.now(),d=await A(t);for(;!ae(d.status);){if(Date.now()-s>o)throw new q$1(`Timed out waiting for run ${t} (last status ${d.status}).`);await ue(n),d=await A(t);}i(e,d);}),i$1.command("logs").description("Get run logs (one cursor page)").argument("<id>","Run ID").option("--level <level>",`Minimum level (${K.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(t,e)=>{let o=g(e.level,"--level",K),n=e.limit===void 0?void 0:p(e.limit,"--limit");if(n!==void 0&&(n<1||n>1e3))throw new q$1(`Invalid value '${e.limit}' for --limit: expected 1 to 1000.`);if(e.after!==void 0&&!e.after.trim())throw new q$1("--after cursor cannot be empty.");let d=(await b(dt,{runId:t,nodeId:e.nodeId,minLevel:o,limit:n,after:e.after,search:e.search,includeChildRuns:e.includeChildRuns})).workflowRunLogs;if(e.pageInfo){i(e,d);return}i(e,d.lines,{headers:["Time","Level","Node","Message"],rows:d.lines.map(f=>[q$2(f.timestamp),f.level,f.nodeId??"-",r(f.message,100)])});}),i$1.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(t,e,o)=>{let n=await A(t),s=le(t,e,n.nodeStates??[]),d=await b(pt,{id:s.id,nodeId:e});k$1(`Node ${e} retry: ${d.retryNode.status}`),i(o,d.retryNode);});}function qt(r){let i$1=r.command("nodes").description("FluidGrids node catalogue");i$1.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 (${P.join("|")})`).option("--status <status>",`Filter by status (${J.join("|")})`).option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let o=(await b(mt,{nodeType:t.nodeType,publishType:g(t.publishType,"--publish-type",P),status:g(t.status,"--status",J),pagination:{limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")}})).nodeEndpointConfigs.configs;i(t,o,{headers:["Type","Version","Name","Category","Publish","Status","Latest"],rows:o.map(n=>[n.nodeType,n.nodeVersion,n.name,n.category??"-",n.publishType,n.status,n.isLatest?"yes":"no"])});}),i$1.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(t,e,o)=>{let n=await b(wt,{nodeType:t,nodeVersion:e});i(o,h(n.nodeEndpointConfig,"Node",`${t}@${e}`));});}var fe=/^[A-Za-z_][A-Za-z0-9_]*$/;async function me(r,i=process.stdin,t=process.stderr){if(!i.isTTY)throw new q$1("A terminal is required to prompt for a secret.");let e=new Writable({write(n,s,d){d();}}),o=createInterface({input:i,output:e,terminal:true});t.write(`${r}: `);try{return await new Promise(n=>{o.question("",n);})}finally{o.close(),t.write(`
|
|
401
|
+
`);}}async function Yt(r,i,t,e=process.env,o=me){if(r!==void 0){if(!fe.test(r))throw new q$1(`Invalid environment variable name for ${t}.`);let s=e[r];if(!s?.trim())throw new q$1(`The environment variable selected by ${t} is empty or unset.`);return s}if(!process.stdin.isTTY)throw new q$1(`An interactive terminal or ${t} is required to supply ${i}.`);let n=await o(i);if(!n.trim())throw new q$1(`${i} cannot be empty.`);return n}async function zt(r,i,t){try{let o=(await b(r,{input:t}))[i];if(o===void 0)throw new Error("empty response");return o}catch{throw new q$1("Connection authentication failed; verify the connection and secret.")}}function Zt(r$1){let i$1=r$1.command("credentials").description("FluidGrids credentials (integration connections)");i$1.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 (${G.join("|")})`).option("--search <text>","Filter by name").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let e={};t.providerId&&(e.providerId=t.providerId);let o=g(t.status,"--status",G);o&&(e.status=o),t.search&&(e.search=t.search);let s=(await b(gt,{filter:Object.keys(e).length>0?e:void 0,pagination:{limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")}})).getConnections.items;i(t,s,{headers:["ID","Name","Provider","Status","Last used"],rows:s.map(d=>[r(d.id,12),d.name,d.provider?.key??d.providerId,d.status,q$2(d.lastUsedAt)])});}),i$1.command("get").description("Get a credential").argument("<id>","Credential (connection) ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(yt,{id:t});i(e,h(o.getConnection,"Credential",t));}),i$1.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 t=>{let e=await b(kt,{filter:t.search?{search:t.search}:void 0,pagination:{limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")}}),o=e.getProviders.items;i(t,e.getProviders,{headers:["ID","Key","Name","Category","Auth","Enabled"],rows:o.map(n=>[r(n.id,12),n.key,n.name,n.category,n.authType,n.isEnabled?"yes":"no"])});}),i$1.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(t,e)=>{let o=k(t),n=await b(ht,{input:o});k$1(`Credential created: ${n.createConnection.id}`),i(e,n.createConnection);}),i$1.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(t,e,o)=>{let n=k(e),s=await b(St,{id:t,input:n});k$1("Credential updated"),i(o,s.updateConnection);}),i$1.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(t,e)=>{if(await I(`Delete credential ${t}?`,e.force),!(await b(It,{id:t,deleteVaultSecret:e.deleteVaultSecret?true:void 0})).deleteConnection)throw new q$1(`Credential ${t} was not deleted.`);k$1(`Credential ${t} deleted`);}),i$1.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(t,e)=>{let o=await b(Ot,{connectionId:t});i(e,o.testConnection);}),i$1.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(t,e)=>{let o=await Yt(e.apiKeyEnv,"API key","--api-key-env"),n=await zt(Rt,"authenticateWithApiKey",{connectionId:t,apiKey:o});k$1(`Credential ${t}: ${n.status}`),i(e,n);}),i$1.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(t,e,o)=>{if(!e.trim())throw new q$1("Provider username cannot be empty.");let n=await Yt(o.passwordEnv,"Password","--password-env"),s=await zt(bt,"authenticateWithBasicAuth",{connectionId:t,username:e,password:n});k$1(`Credential ${t}: ${s.status}`),i(o,s);});}function Qt(r$1){let i$1=r$1.command("webhooks").description("FluidGrids inbound webhooks (event registrations)");i$1.command("list").description("List webhooks").option("--workflow-key <key>","Filter by workflow key").option("-s, --status <status>",`Filter by status (${M.join("|")})`).option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let e=await b(Tt,{status:g(t.status,"--status",M),workflowKey:t.workflowKey});i(t,e.eventRegistrations,{headers:["ID","Name","Workflow","Trigger node","Status","Triggers","Last"],rows:e.eventRegistrations.map(o=>[r(o.id,12),o.name??"-",o.workflowKey,o.triggerNodeId,o.isActive?o.status:`${o.status} (inactive)`,String(o.totalTriggers),q$2(o.lastTriggeredAt)])});}),i$1.command("get").description("Get a webhook").argument("<id>","Event registration ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(Ct,{id:t});i(e,h(o.eventRegistration,"Webhook",t));}),i$1.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(t,e)=>{let o=k(t),n=await b($t,{input:o});k$1(`Webhook created: ${n.createEventRegistration.id}`),i(e,n.createEventRegistration);}),i$1.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(t,e,o)=>{let n=k(e),s=await b(Dt,{id:t,input:n});k$1("Webhook updated"),i(o,s.updateEventRegistration);}),i$1.command("delete").description("Delete a webhook").argument("<id>","Event registration ID").option("--force","Skip the confirmation prompt").action(async(t,e)=>{if(await I(`Delete webhook ${t}?`,e.force),!(await b(vt,{id:t})).deleteEventRegistration)throw new q$1(`Webhook ${t} was not deleted.`);k$1(`Webhook ${t} deleted`);});for(let[t,e]of [["activate",true],["deactivate",false]])i$1.command(t).description(`${e?"Activate":"Deactivate"} a webhook`).argument("<id>","Event registration ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(o,n)=>{let s=await b(Wt,{id:o,isActive:e});k$1(`Webhook ${o} ${e?"activated":"deactivated"}`),i(n,s.toggleEventRegistration);});}function B(r){if(!r.success)throw new q$1(r.message||"Scheduled job update failed.");return r}function Xt(r$1){let i$1=r$1.command("scheduled-jobs").description("FluidGrids scheduled workflow runs (cron)");i$1.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 t=>{if(t.enabled&&t.disabled)throw new q$1("Use either --enabled or --disabled, not both.");let o=(await b(At,{enabled:t.enabled?true:t.disabled?false:void 0,workflowKey:t.workflowKey,pagination:{limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")}})).workflowScheduledJobs.jobs;i(t,o,{headers:["ID","Name","Workflow","Version","Schedule","Enabled","Next run"],rows:o.map(n=>[r(n.id,12),n.name,n.workflowKey,n.version,n.schedule,n.enabled?"yes":"no",q$2(n.nextRun)])});}),i$1.command("get").description("Get a scheduled job").argument("<jobId>","Scheduled job ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(Nt,{jobId:t});i(e,h(o.workflowScheduledJob,"Scheduled job",t));}),i$1.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(t,e)=>{let o=k(t),n=await b(Ft,{input:o}),s=B(n.createWorkflowScheduledJob);k$1(s.message||"Scheduled job created"),i(e,s.job??s);}),i$1.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(t,e,o)=>{let n=k(e),s=await b(x,{jobId:t,input:n}),d=B(s.updateWorkflowScheduledJob);k$1(d.message||"Scheduled job updated"),i(o,d.job??d);}),i$1.command("delete").description("Delete a scheduled job").argument("<jobId>","Scheduled job ID").option("--force","Skip the confirmation prompt").action(async(t,e)=>{await I(`Delete scheduled job ${t}?`,e.force);let o=await b(Lt,{jobId:t});if(!o.deleteWorkflowScheduledJob.success)throw new q$1(o.deleteWorkflowScheduledJob.message||"Delete failed.");k$1(`Scheduled job ${t} deleted`);});for(let[t,e]of [["pause",false],["resume",true]])i$1.command(t).description(`${e?"Resume":"Pause"} a scheduled job`).argument("<jobId>","Scheduled job ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(o,n)=>{let s=await b(x,{jobId:o,input:{enabled:e}}),d=B(s.updateWorkflowScheduledJob);k$1(`Scheduled job ${o} ${e?"resumed":"paused"}`),i(n,d.job??d);});}function te(r,i){if(Number.isNaN(Date.parse(r)))throw new q$1(`Invalid value '${r}' for ${i}: expected an ISO 8601 date.`);return r}function ee(r){let i$1=r.command("dashboard").description("FluidGrids dashboard metrics");i$1.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 t=>{let e=await b(_t,{projectId:t.project});i(t,e.dashboardSummary);}),i$1.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 t=>{let e=te(t.start,"--start"),o=te(t.end,"--end");if(Date.parse(e)>Date.parse(o))throw new q$1("--start must not be after --end.");let n=await b(xt,{input:{startDate:e,endDate:o}});i(t,n.usageMetrics);});}function oe(r){r.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 (${V.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(t,e)=>{if(!t.trim())throw new q$1("Search text cannot be empty.");let o=g(e.type,"--type",V),n=p(e.limit,"--limit"),s=p(e.offset,"--offset"),d=o?(await b(Kt,{entityType:o,query:t,limit:n,offset:s})).searchByEntityType:(await b(jt,{input:{query:t,limit:n,offset:s}})).search;i(e,d);});}function ne(r){r.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 t=>{let e=await b(Pt);i(t,e.systemConfig);});}var we={id:"fluidgrids",version:"1.0.0",displayName:"FluidGrids",dependsOn:["auth","workspaces"],register(r,i){a(i),Vt(r),Ht(r),qt(r),Zt(r),Qt(r),Xt(r),ee(r),oe(r),ne(r);}},uo=we;export{uo as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/cli-sdk",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.1124.1",
|
|
4
4
|
"description": "Modular CLI SDK shared across all Burdenoff product CLIs (vibecontrols, botlit, fluidgrids, bigconsole, healthybowl, devportal, workspaces). Each module exports CliModule contract; product CLIs become thin shells that pick which modules to mount.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|