@burdenoff/cli-sdk 2026.1108.1 → 2026.1109.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-N5KCAJXG.js → chunk-6HSWVWQW.js} +3 -3
- package/dist/chunk-MT2F54AC.js +34 -0
- package/dist/chunk-WTNQ5PEC.js +1 -0
- package/dist/core/index.cjs +8 -8
- 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 +8 -8
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{module-BwJmqefL.d.ts → module-CLaW1ycq.d.cts} +17 -1
- package/dist/{module-BwJmqefL.d.cts → module-CLaW1ycq.d.ts} +17 -1
- package/dist/modules/adaptercloud/index.cjs +8 -8
- package/dist/modules/adaptercloud/index.d.cts +1 -1
- package/dist/modules/adaptercloud/index.d.ts +1 -1
- package/dist/modules/adaptercloud/index.js +2 -2
- package/dist/modules/artistrybase/index.cjs +10 -10
- package/dist/modules/artistrybase/index.d.cts +1 -1
- package/dist/modules/artistrybase/index.d.ts +1 -1
- package/dist/modules/artistrybase/index.js +2 -2
- package/dist/modules/assethandler/index.cjs +6 -6
- package/dist/modules/assethandler/index.d.cts +1 -1
- package/dist/modules/assethandler/index.d.ts +1 -1
- package/dist/modules/assethandler/index.js +2 -2
- package/dist/modules/atheletebridge/index.cjs +8 -8
- package/dist/modules/atheletebridge/index.d.cts +1 -1
- package/dist/modules/atheletebridge/index.d.ts +1 -1
- package/dist/modules/atheletebridge/index.js +2 -2
- package/dist/modules/auth/index.cjs +5 -5
- package/dist/modules/auth/index.d.cts +1 -1
- package/dist/modules/auth/index.d.ts +1 -1
- package/dist/modules/auth/index.js +4 -4
- package/dist/modules/billing/index.cjs +5 -5
- package/dist/modules/billing/index.d.cts +1 -1
- package/dist/modules/billing/index.d.ts +1 -1
- package/dist/modules/billing/index.js +2 -2
- package/dist/modules/brainyrich/index.cjs +10 -10
- package/dist/modules/brainyrich/index.d.cts +1 -1
- package/dist/modules/brainyrich/index.d.ts +1 -1
- package/dist/modules/brainyrich/index.js +2 -2
- package/dist/modules/buildmyiq/index.cjs +6 -6
- package/dist/modules/buildmyiq/index.d.cts +1 -1
- package/dist/modules/buildmyiq/index.d.ts +1 -1
- package/dist/modules/buildmyiq/index.js +2 -2
- package/dist/modules/channels/index.cjs +11 -11
- package/dist/modules/channels/index.d.cts +1 -1
- package/dist/modules/channels/index.d.ts +1 -1
- package/dist/modules/channels/index.js +2 -2
- package/dist/modules/collabkin/index.cjs +7 -7
- package/dist/modules/collabkin/index.d.cts +1 -1
- package/dist/modules/collabkin/index.d.ts +1 -1
- package/dist/modules/collabkin/index.js +2 -2
- package/dist/modules/comradecircle/index.cjs +8 -8
- package/dist/modules/comradecircle/index.d.cts +1 -1
- package/dist/modules/comradecircle/index.d.ts +1 -1
- package/dist/modules/comradecircle/index.js +2 -2
- package/dist/modules/conversations/index.cjs +9 -9
- package/dist/modules/conversations/index.d.cts +1 -1
- package/dist/modules/conversations/index.d.ts +1 -1
- package/dist/modules/conversations/index.js +2 -2
- package/dist/modules/coolandlovely/index.cjs +7 -7
- package/dist/modules/coolandlovely/index.d.cts +1 -1
- package/dist/modules/coolandlovely/index.d.ts +1 -1
- package/dist/modules/coolandlovely/index.js +2 -2
- 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 +2 -2
- package/dist/modules/crewfoundry/index.cjs +19 -19
- package/dist/modules/crewfoundry/index.d.cts +1 -1
- package/dist/modules/crewfoundry/index.d.ts +1 -1
- package/dist/modules/crewfoundry/index.js +2 -2
- 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 +2 -2
- package/dist/modules/ecoimpacthub/index.cjs +7 -7
- package/dist/modules/ecoimpacthub/index.d.cts +1 -1
- package/dist/modules/ecoimpacthub/index.d.ts +1 -1
- package/dist/modules/ecoimpacthub/index.js +2 -2
- package/dist/modules/eventfullymanaged/index.cjs +24 -24
- package/dist/modules/eventfullymanaged/index.d.cts +1 -1
- package/dist/modules/eventfullymanaged/index.d.ts +1 -1
- package/dist/modules/eventfullymanaged/index.js +2 -2
- package/dist/modules/export/index.cjs +9 -9
- package/dist/modules/export/index.d.cts +1 -1
- package/dist/modules/export/index.d.ts +1 -1
- package/dist/modules/export/index.js +2 -2
- package/dist/modules/files/index.cjs +4 -4
- package/dist/modules/files/index.d.cts +1 -1
- package/dist/modules/files/index.d.ts +1 -1
- package/dist/modules/files/index.js +2 -2
- package/dist/modules/fluidgrids/index.cjs +8 -8
- package/dist/modules/fluidgrids/index.d.cts +1 -1
- package/dist/modules/fluidgrids/index.d.ts +1 -1
- package/dist/modules/fluidgrids/index.js +3 -3
- package/dist/modules/ggnomad/index.cjs +7 -7
- package/dist/modules/ggnomad/index.d.cts +1 -1
- package/dist/modules/ggnomad/index.d.ts +1 -1
- package/dist/modules/ggnomad/index.js +2 -2
- 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 +2 -2
- package/dist/modules/groups/index.cjs +8 -8
- package/dist/modules/groups/index.d.cts +1 -1
- package/dist/modules/groups/index.d.ts +1 -1
- package/dist/modules/groups/index.js +2 -2
- 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 +2 -2
- package/dist/modules/health/index.d.cts +1 -1
- package/dist/modules/health/index.d.ts +1 -1
- package/dist/modules/hookmovies/index.cjs +10 -10
- package/dist/modules/hookmovies/index.d.cts +1 -1
- package/dist/modules/hookmovies/index.d.ts +1 -1
- package/dist/modules/hookmovies/index.js +2 -2
- package/dist/modules/housingvista/index.cjs +8 -8
- package/dist/modules/housingvista/index.d.cts +1 -1
- package/dist/modules/housingvista/index.d.ts +1 -1
- package/dist/modules/housingvista/index.js +2 -2
- package/dist/modules/integrations/index.cjs +7 -7
- package/dist/modules/integrations/index.d.cts +1 -1
- package/dist/modules/integrations/index.d.ts +1 -1
- package/dist/modules/integrations/index.js +2 -2
- package/dist/modules/intelwatchtower/index.cjs +7 -7
- package/dist/modules/intelwatchtower/index.d.cts +1 -1
- package/dist/modules/intelwatchtower/index.d.ts +1 -1
- package/dist/modules/intelwatchtower/index.js +2 -2
- package/dist/modules/kadaikodi/index.cjs +6 -6
- package/dist/modules/kadaikodi/index.d.cts +1 -1
- package/dist/modules/kadaikodi/index.d.ts +1 -1
- package/dist/modules/kadaikodi/index.js +2 -2
- 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 +2 -2
- package/dist/modules/manufacturedops/index.cjs +3 -3
- package/dist/modules/manufacturedops/index.d.cts +1 -1
- package/dist/modules/manufacturedops/index.d.ts +1 -1
- package/dist/modules/manufacturedops/index.js +2 -2
- package/dist/modules/movethewheels/index.cjs +8 -8
- package/dist/modules/movethewheels/index.d.cts +1 -1
- package/dist/modules/movethewheels/index.d.ts +1 -1
- package/dist/modules/movethewheels/index.js +2 -2
- package/dist/modules/mybodyshield/index.cjs +5 -5
- package/dist/modules/mybodyshield/index.d.cts +1 -1
- package/dist/modules/mybodyshield/index.d.ts +1 -1
- package/dist/modules/mybodyshield/index.js +2 -2
- package/dist/modules/notifications/index.cjs +2 -2
- 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.cjs +5 -5
- 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 +17 -17
- package/dist/modules/planmagnet/index.d.cts +1 -1
- package/dist/modules/planmagnet/index.d.ts +1 -1
- package/dist/modules/planmagnet/index.js +2 -2
- package/dist/modules/products/index.cjs +5 -5
- package/dist/modules/products/index.d.cts +1 -1
- package/dist/modules/products/index.d.ts +1 -1
- package/dist/modules/products/index.js +2 -2
- package/dist/modules/proserviceworld/index.cjs +6 -6
- package/dist/modules/proserviceworld/index.d.cts +1 -1
- package/dist/modules/proserviceworld/index.d.ts +1 -1
- package/dist/modules/proserviceworld/index.js +2 -2
- package/dist/modules/rbac/index.cjs +4 -4
- package/dist/modules/rbac/index.d.cts +1 -1
- package/dist/modules/rbac/index.d.ts +1 -1
- package/dist/modules/rbac/index.js +2 -2
- package/dist/modules/sandbox/index.cjs +11 -11
- 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 +14 -14
- package/dist/modules/scheduler/index.d.cts +1 -1
- package/dist/modules/scheduler/index.d.ts +1 -1
- package/dist/modules/scheduler/index.js +2 -2
- package/dist/modules/security/index.cjs +9 -9
- package/dist/modules/security/index.d.cts +1 -1
- package/dist/modules/security/index.d.ts +1 -1
- package/dist/modules/security/index.js +2 -2
- package/dist/modules/semanticfed/index.cjs +8 -8
- 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/semanticfed-sql/index.cjs +4 -4
- package/dist/modules/semanticfed-sql/index.d.cts +1 -1
- package/dist/modules/semanticfed-sql/index.d.ts +1 -1
- package/dist/modules/semanticfed-sql/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 +2 -2
- package/dist/modules/subscriberbot/index.cjs +1 -1
- package/dist/modules/subscriberbot/index.d.cts +1 -1
- package/dist/modules/subscriberbot/index.d.ts +1 -1
- package/dist/modules/subscriberbot/index.js +2 -2
- 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 +2 -2
- package/dist/modules/tags/index.cjs +7 -7
- package/dist/modules/tags/index.d.cts +1 -1
- package/dist/modules/tags/index.d.ts +1 -1
- package/dist/modules/tags/index.js +2 -2
- 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 +2 -2
- package/dist/modules/theculturepost/index.cjs +10 -10
- package/dist/modules/theculturepost/index.d.cts +1 -1
- package/dist/modules/theculturepost/index.d.ts +1 -1
- package/dist/modules/theculturepost/index.js +2 -2
- package/dist/modules/theglobalfuel/index.cjs +7 -7
- package/dist/modules/theglobalfuel/index.d.cts +1 -1
- package/dist/modules/theglobalfuel/index.d.ts +1 -1
- package/dist/modules/theglobalfuel/index.js +2 -2
- package/dist/modules/timecampus/index.cjs +8 -8
- package/dist/modules/timecampus/index.d.cts +1 -1
- package/dist/modules/timecampus/index.d.ts +1 -1
- package/dist/modules/timecampus/index.js +2 -2
- package/dist/modules/tours/index.cjs +3 -3
- package/dist/modules/tours/index.d.cts +1 -1
- package/dist/modules/tours/index.d.ts +1 -1
- package/dist/modules/tours/index.js +2 -2
- package/dist/modules/vibecontrols/index.cjs +27 -27
- package/dist/modules/vibecontrols/index.d.cts +1 -1
- package/dist/modules/vibecontrols/index.d.ts +1 -1
- package/dist/modules/vibecontrols/index.js +5 -5
- package/dist/modules/workspaces/index.cjs +6 -6
- package/dist/modules/workspaces/index.d.cts +1 -1
- package/dist/modules/workspaces/index.d.ts +1 -1
- package/dist/modules/workspaces/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-2OISIPE6.js +0 -34
- package/dist/chunk-VL67DTWH.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,b,i,k as k$1,q as q$
|
|
1
|
+
import {a,b,i,k as k$1,q as q$2,r,s}from'../../chunk-WTNQ5PEC.js';import {q as q$1}from'../../chunk-MT2F54AC.js';import {readFileSync}from'fs';import {createInterface}from'readline';import {Writable}from'stream';var E=`
|
|
2
2
|
id workflowKey name description version status category tags icon isActive
|
|
3
3
|
totalVersions projectId createdAt updatedAt
|
|
4
4
|
`,q=`
|
|
@@ -397,5 +397,5 @@ import {a,b,i,k as k$1,q as q$1,r,s}from'../../chunk-VL67DTWH.js';import {o}from
|
|
|
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 o(`Invalid value '${r}' for ${i}: expected a non-negative integer.`);let t=Number(r);if(!Number.isSafeInteger(t))throw new o(`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 o(`Invalid value '${r}' for ${i}. Allowed: ${t.join(", ")}`);return e}function C(r,i){let t;try{t=JSON.parse(r);}catch{throw new o(`${i} must be valid JSON.`)}if(!re(t))throw new o(`${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 o(`Cannot read ${r}: ${e}`)}return C(i,r)}function T(r,i){if(r!==void 0){if(!r.trim())throw new o(`${i} cannot be empty.`);return r}}function h(r,i,t){if(r==null)throw new o(`${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 o("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$1(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$1)=>{if(!e&&!o$1.key)throw new o("Pass a workflow ID or --key <workflowKey>.");if(e&&o$1.key)throw new o("Pass either a workflow ID or --key, not both.");let n=await b(v,e?{id:e}:{workflowKey:o$1.key,version:o$1.wfVersion});i(o$1,h(n.workflowDefinition,"Workflow",e??o$1.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$1)=>{let n=o$1.wfVersion?`${e}@${o$1.wfVersion}`:`${e} (all versions)`;if(await I(`Delete workflow ${n}?`,o$1.force),!(await b(Q,{workflowKey:e,version:o$1.wfVersion})).deleteWorkflowDefinition)throw new o(`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$1,n)=>{let s={newWorkflowKey:T(n.newKey,"--new-key")};n.newVersion&&(s.newVersion=n.newVersion);let d=await b(nt,{workflowKey:e,version:o$1,input:s});if(!d.duplicateWorkflow.success)throw new o(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$1,n,s]of t)i$1.command(e).description(o$1).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 o(`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$1)=>{let n={...k(e)},s=T(o$1.name,"--name"),d=T(o$1.projectId,"--project-id"),f=T(o$1.sourceTemplateId,"--source-template-id");s!==void 0&&(n.name=s),o$1.description!==void 0&&(n.description=o$1.description),o$1.icon!==void 0&&(n.icon=o$1.icon),o$1.category!==void 0&&(n.category=o$1.category),d!==void 0&&(n.projectId=d),f!==void 0&&(n.sourceTemplateId=f),o$1.context!==void 0&&(n.context=C(o$1.context,"--context"));let S=await b(rt,{input:n});if(!S.importWorkflowTemplate.success)throw new o(S.importWorkflowTemplate.message??"Import failed.");k$1("Workflow imported"),i(o$1,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$1(i.startedAt),q$1(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$1){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 o("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$1){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 o(`Node ${i} not found in run ${r} (NOT_FOUND)`);let o$1=e.filter(d=>["FAILED","TIMEOUT"].includes(d.status.toUpperCase()));if(o$1.length===0)throw new o(`Node ${i} is not failed in run ${r} (INVALID_STATE)`);let[n,...s]=o$1;if(!n||s.length>0)throw new o(`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$1=p(t.offset,"--offset"),n=w(t.status,"--status",j);if(t.workflowId&&t.workflowKey)throw new o("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$1);i(t,m,Bt(m));return}let s={limit:e,offset:o$1};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$1=e.payload===void 0?void 0:C(e.payload,"--payload"),n=await b(ct,{id:t,payload:o$1});if(!n.resumeWorkflowRun.success)throw new o(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$1=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$1)throw new o(`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$1=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 o(`Invalid value '${e.limit}' for --limit: expected 1 to 1000.`);if(e.after!==void 0&&!e.after.trim())throw new o("--after cursor cannot be empty.");let d=(await b(dt,{runId:t,nodeId:e.nodeId,minLevel:o$1,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$1(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 o("A terminal is required to prompt for a secret.");let e=new Writable({write(n,s,d){d();}}),o$1=createInterface({input:i,output:e,terminal:true});t.write(`${r}: `);try{return await new Promise(n=>{o$1.question("",n);})}finally{o$1.close(),t.write(`
|
|
401
|
-
`);}}async function Yt(r,i,t,e=process.env,o$1=me){if(r!==void 0){if(!fe.test(r))throw new o(`Invalid environment variable name for ${t}.`);let s=e[r];if(!s?.trim())throw new o(`The environment variable selected by ${t} is empty or unset.`);return s}if(!process.stdin.isTTY)throw new o(`An interactive terminal or ${t} is required to supply ${i}.`);let n=await o$1(i);if(!n.trim())throw new o(`${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 o("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$1(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 o(`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$1)=>{if(!e.trim())throw new o("Provider username cannot be empty.");let n=await Yt(o$1.passwordEnv,"Password","--password-env"),s=await zt(bt,"authenticateWithBasicAuth",{connectionId:t,username:e,password:n});k$1(`Credential ${t}: ${s.status}`),i(o$1,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$1(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 o(`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 o(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 o("Use either --enabled or --disabled, not both.");let o$1=(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$1,{headers:["ID","Name","Workflow","Version","Schedule","Enabled","Next run"],rows:o$1.map(n=>[r(n.id,12),n.name,n.workflowKey,n.version,n.schedule,n.enabled?"yes":"no",q$1(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$1=await b(Lt,{jobId:t});if(!o$1.deleteWorkflowScheduledJob.success)throw new o(o$1.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 o(`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$1=te(t.end,"--end");if(Date.parse(e)>Date.parse(o$1))throw new o("--start must not be after --end.");let n=await b(xt,{input:{startDate:e,endDate:o$1}});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 o("Search text cannot be empty.");let o$1=w(e.type,"--type",V),n=p(e.limit,"--limit"),s=p(e.offset,"--offset"),d=o$1?(await b(Kt,{entityType:o$1,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 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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch');var commander=require('commander');var p=class extends Error{exitCode;hint;constructor(r,t){super(r),this.name="CliUserError",this.exitCode=t?.exitCode??1,this.hint=t?.hint;}},l=class extends p{constructor(r,t){super(r,{exitCode:2,hint:t?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},f=class extends Error{cause;constructor(r,t){super(r),this.name="CliInternalError",this.cause=t;}};var
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch');var commander=require('commander');var p=class extends Error{exitCode;hint;constructor(r,t){super(r),this.name="CliUserError",this.exitCode=t?.exitCode??1,this.hint=t?.hint;}},l=class extends p{constructor(r,t){super(r,{exitCode:2,hint:t?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},f=class extends Error{cause;constructor(r,t){super(r),this.name="CliInternalError",this.cause=t;}};var C=null;function x(o){C=o;}function y(){if(!C)throw new f("vibecontrols module helpers used before setHelpersContext was called");return C}function dt(){let o=y();if(!o.auth.isAuthenticated())throw new l("Authentication required.",{hint:`Run \`${o.productName} auth login\` to authenticate.`})}async function i(o,r){return dt(),y().gql.workspace.request(o,r)}function s(o){let r=o instanceof Error?o.message:String(o);throw new p(r)}function a(o,r,t){y().output.formatAndOutput(o,r,t);}function m(o){y().output.printSuccess(o);}function h(o){return y().output.formatDate(o)}function d(o,r){return y().output.truncate(o,r)}var I=`
|
|
2
2
|
query GgnomadGetProvider($id: ID!) {
|
|
3
3
|
ggnomadProvider(id: $id) {
|
|
4
4
|
id name type description status website contactEmail contactPhone
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
status providerId createdAt
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
`,
|
|
74
|
+
`,q=`
|
|
75
75
|
query GgnomadGetTour($id: ID!) {
|
|
76
76
|
ggnomadTour(id: $id) {
|
|
77
77
|
id name type description difficulty duration currency price images
|
|
@@ -79,14 +79,14 @@
|
|
|
79
79
|
rating reviewCount status createdAt updatedAt workspaceId
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
`,
|
|
82
|
+
`,N=`
|
|
83
83
|
query GgnomadListTours($pagination: PaginationInput) {
|
|
84
84
|
ggnomadTours(pagination: $pagination) {
|
|
85
85
|
id name type difficulty duration currency price maxGroupSize rating
|
|
86
86
|
reviewCount status providerId createdAt
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
`,
|
|
89
|
+
`,D=`
|
|
90
90
|
query GgnomadListTrips($pagination: PaginationInput) {
|
|
91
91
|
ggnomadTrips(pagination: $pagination) {
|
|
92
92
|
id name transportMode class carrier currency price passengers
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
returnDepartureAt returnArrivalAt status createdAt updatedAt workspaceId
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
`,
|
|
97
|
+
`,L=`
|
|
98
98
|
query GgnomadListBookings($pagination: PaginationInput) {
|
|
99
99
|
ggnomadBookings(pagination: $pagination) {
|
|
100
100
|
id referenceCode bookingType itemId itemName guestName guests
|
|
@@ -131,10 +131,10 @@
|
|
|
131
131
|
revenueByCategory topDestinations monthlyTrends
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
`,
|
|
134
|
+
`,M=`
|
|
135
135
|
query GgnomadOverviewStats {
|
|
136
136
|
ggnomadOverviewStats {
|
|
137
137
|
users listings bookings monthlyRevenue
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
`;function M(o,r){try{return JSON.parse(r)}catch{throw new p(`--${o} must be valid JSON`)}}function c(o){let r=Number.parseInt(o,10);if(Number.isNaN(r))throw new p(`Expected an integer but got "${o}"`);return r}function w(o){let r=Number.parseFloat(o);if(Number.isNaN(r))throw new p(`Expected a number but got "${o}"`);return r}function j(o){let r=o.command("providers").description("GGNomad providers");r.command("list").description("List providers").option("--limit <n>","Page size",c,20).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let n=await i(b,{pagination:{limit:t.limit,offset:t.offset}});a(t,n.ggnomadProviders,{headers:["ID","Name","Type","Status","Rating","Listings"],rows:n.ggnomadProviders.map(e=>[d(e.id,12),e.name,e.type,e.status,`${e.rating??0} (${e.reviewCount??0})`,String(e.listingCount??0)])});}catch(n){s(n);}}),r.command("get").description("Get a provider by id").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(t,n)=>{try{let e=await i(I,{id:t});if(!e.ggnomadProvider)throw new p(`Provider ${t} not found`);a(n,e.ggnomadProvider);}catch(e){s(e);}}),r.command("create").description("Create a provider").requiredOption("--name <name>","Provider name").addOption(new commander.Option("--type <t>","Provider type").choices(["HOTEL_OPERATOR","TOUR_OPERATOR","ACTIVITY_PROVIDER","TRANSPORT_PROVIDER","EVENT_ORGANIZER"]).makeOptionMandatory()).option("--description <s>","Description").option("--website <url>","Website URL").option("--contact-email <email>","Contact email").option("--contact-phone <phone>","Contact phone").option("-f, --format <format>","Output format").action(async t=>{try{let n={name:t.name,type:t.type};t.description&&(n.description=t.description),t.website&&(n.website=t.website),t.contactEmail&&(n.contactEmail=t.contactEmail),t.contactPhone&&(n.contactPhone=t.contactPhone);let e=await i(E,{input:n});m(`Provider created: ${e.createGgnomadProvider.name}`),a(t,e.createGgnomadProvider);}catch(n){s(n);}});}function z(o){let r=o.command("properties").description("GGNomad stay properties");r.command("list").description("List properties").option("--limit <n>","Page size",c,20).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let n=await i(A,{pagination:{limit:t.limit,offset:t.offset}});a(t,n.ggnomadProperties,{headers:["ID","Name","Type","Status","Price/Night","Guests","Rating"],rows:n.ggnomadProperties.map(e=>[d(e.id,12),e.name,e.type,e.status,`${e.pricePerNight??0} ${e.currency??""}`.trim(),String(e.maxGuests??0),`${e.rating??0} (${e.reviewCount??0})`])});}catch(n){s(n);}}),r.command("get").description("Get a property by id").argument("<id>","Property ID").option("-f, --format <format>","Output format").action(async(t,n)=>{try{let e=await i(O,{id:t});if(!e.ggnomadProperty)throw new p(`Property ${t} not found`);a(n,e.ggnomadProperty);}catch(e){s(e);}}),r.command("create").description("Create a property").requiredOption("--name <name>","Property name").requiredOption("--type <t>","Property type").requiredOption("--address <json>","Address JSON").requiredOption("--max-guests <n>","Maximum guests",c).requiredOption("--price-per-night <n>","Price per night",w).requiredOption("--amenities <csv>","Comma-separated amenities").requiredOption("--images <csv>","Comma-separated image URLs").option("--provider <id>","Provider ID").option("--description <s>","Description").option("--bedrooms <n>","Bedrooms",c).option("--bathrooms <n>","Bathrooms",c).option("--check-in-time <s>","Check-in time").option("--check-out-time <s>","Check-out time").option("--currency <c>","Currency code").option("-f, --format <format>","Output format").action(async t=>{try{let n={name:t.name,type:t.type,address:M("address",t.address),maxGuests:t.maxGuests,pricePerNight:t.pricePerNight,amenities:t.amenities.split(",").map(C=>C.trim()),images:t.images.split(",").map(C=>C.trim())};t.provider&&(n.providerId=t.provider),t.description&&(n.description=t.description),t.bedrooms!==void 0&&(n.bedrooms=t.bedrooms),t.bathrooms!==void 0&&(n.bathrooms=t.bathrooms),t.checkInTime&&(n.checkInTime=t.checkInTime),t.checkOutTime&&(n.checkOutTime=t.checkOutTime),t.currency&&(n.currency=t.currency);let e=await i(P,{input:n});m(`Property created: ${e.createGgnomadProperty.name}`),a(t,e.createGgnomadProperty);}catch(n){s(n);}});}function Y(o){let r=o.command("activities").description("GGNomad activities");r.command("list").description("List activities").option("--limit <n>","Page size",c,20).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let n=await i(S,{pagination:{limit:t.limit,offset:t.offset}});a(t,n.ggnomadActivities,{headers:["ID","Name","Category","Difficulty","Duration","Price","Status"],rows:n.ggnomadActivities.map(e=>[d(e.id,12),e.name,e.category,e.difficulty??"-",e.duration??"-",`${e.price??0} ${e.currency??""}`.trim(),e.status])});}catch(n){s(n);}}),r.command("get").description("Get an activity by id").argument("<id>","Activity ID").option("-f, --format <format>","Output format").action(async(t,n)=>{try{let e=await i(R,{id:t});if(!e.ggnomadActivity)throw new p(`Activity ${t} not found`);a(n,e.ggnomadActivity);}catch(e){s(e);}});}function H(o){let r=o.command("events").description("GGNomad events");r.command("list").description("List events").option("--limit <n>","Page size",c,20).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let n=await i($,{pagination:{limit:t.limit,offset:t.offset}});a(t,n.ggnomadEvents,{headers:["ID","Name","Category","Price","Starts","Status"],rows:n.ggnomadEvents.map(e=>[d(e.id,12),e.name,e.category,`${e.price??0} ${e.currency??""}`.trim(),h(e.startsAt),e.status])});}catch(n){s(n);}}),r.command("get").description("Get an event by id").argument("<id>","Event ID").option("-f, --format <format>","Output format").action(async(t,n)=>{try{let e=await i(G,{id:t});if(!e.ggnomadEvent)throw new p(`Event ${t} not found`);a(n,e.ggnomadEvent);}catch(e){s(e);}});}function K(o){let r=o.command("tours").description("GGNomad tours");r.command("list").description("List tours").option("--limit <n>","Page size",c,20).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let n=await i(D,{pagination:{limit:t.limit,offset:t.offset}});a(t,n.ggnomadTours,{headers:["ID","Name","Type","Difficulty","Duration","Price","Status"],rows:n.ggnomadTours.map(e=>[d(e.id,12),e.name,e.type,e.difficulty??"-",e.duration??"-",`${e.price??0} ${e.currency??""}`.trim(),e.status])});}catch(n){s(n);}}),r.command("get").description("Get a tour by id").argument("<id>","Tour ID").option("-f, --format <format>","Output format").action(async(t,n)=>{try{let e=await i(N,{id:t});if(!e.ggnomadTour)throw new p(`Tour ${t} not found`);a(n,e.ggnomadTour);}catch(e){s(e);}});}function J(o){o.command("trips").description("GGNomad transport trips").command("list").description("List trips").option("--limit <n>","Page size",c,20).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let n=await i(L,{pagination:{limit:t.limit,offset:t.offset}});a(t,n.ggnomadTrips,{headers:["ID","Name","Mode","Price","Departs","Eco","Status"],rows:n.ggnomadTrips.map(e=>[d(e.id,12),e.name,e.transportMode,`${e.price??0} ${e.currency??""}`.trim(),h(e.departureAt),e.ecoFriendly?"yes":"no",e.status])});}catch(n){s(n);}});}function Q(o){let r=o.command("bookings").description("GGNomad bookings");r.command("list").description("List bookings").option("--limit <n>","Page size",c,20).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let n=await i(q,{pagination:{limit:t.limit,offset:t.offset}});a(t,n.ggnomadBookings,{headers:["ID","Ref","Type","Item","Guest","Total","Status","Payment"],rows:n.ggnomadBookings.map(e=>[d(e.id,12),e.referenceCode,e.bookingType,d(e.itemName,20),d(e.guestName,16),`${e.totalPrice} ${e.currency??""}`.trim(),e.status,e.paymentStatus])});}catch(n){s(n);}}),r.command("create").description("Create a booking").requiredOption("--type <t>","Booking type: ACTIVITY|EVENT|PROPERTY|TOUR|TRIP").requiredOption("--item-id <id>","Item ID being booked").requiredOption("--item-name <name>","Item name").requiredOption("--guest-name <name>","Guest name").requiredOption("--guests <n>","Number of guests",c).requiredOption("--total-price <n>","Total price",w).option("--guest-email <email>","Guest email").option("--guest-phone <phone>","Guest phone").option("--currency <c>","Currency code").option("--check-in <iso>","Check-in (ISO date)").option("--check-out <iso>","Check-out (ISO date)").option("--event-date <iso>","Event date (ISO date)").option("--payment-method <m>","Payment method").option("--special-requests <s>","Special requests").option("-f, --format <format>","Output format").action(async t=>{try{let n={bookingType:t.type.toUpperCase(),itemId:t.itemId,itemName:t.itemName,guestName:t.guestName,guests:t.guests,totalPrice:t.totalPrice};t.guestEmail&&(n.guestEmail=t.guestEmail),t.guestPhone&&(n.guestPhone=t.guestPhone),t.currency&&(n.currency=t.currency),t.checkIn&&(n.checkIn=t.checkIn),t.checkOut&&(n.checkOut=t.checkOut),t.eventDate&&(n.eventDate=t.eventDate),t.paymentMethod&&(n.paymentMethod=t.paymentMethod),t.specialRequests&&(n.specialRequests=t.specialRequests);let e=await i(_,{input:n});m(`Booking created: ${e.createGgnomadBooking.referenceCode}`),a(t,e.createGgnomadBooking);}catch(n){s(n);}}),r.command("cancel").description("Cancel a booking").argument("<id>","Booking ID").option("--reason <s>","Cancellation reason").option("-f, --format <format>","Output format").action(async(t,n)=>{try{let e=await i(F,{id:t,reason:n.reason});m(`Booking cancelled: ${e.cancelGgnomadBooking.referenceCode}`),a(n,e.cancelGgnomadBooking);}catch(e){s(e);}});}function X(o){let r=o.command("favorites").description("GGNomad favorites");r.command("list").description("List favorites").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let n=await i(W,{pagination:{limit:t.limit,offset:t.offset}});a(t,n.ggnomadFavorites);}catch(n){s(n);}}),r.command("toggle").description("Toggle a favorite on a target").requiredOption("--target-id <id>","Target ID").requiredOption("--target-type <t>","Target type: ACTIVITY|EVENT|PROPERTY|TOUR|TRIP").option("-f, --format <format>","Output format").action(async t=>{try{let n={targetId:t.targetId,targetType:t.targetType.toUpperCase()},e=await i(B,{input:n});m(e.toggleGgnomadFavorite?"Added to favorites":"Removed from favorites"),a(t,{favorited:e.toggleGgnomadFavorite});}catch(n){s(n);}});}function Z(o){let r=o.command("analytics").description("GGNomad analytics & overview");r.command("summary").description("Platform analytics (users, bookings, revenue, conversion, trends)").option("-f, --format <format>","Output format").action(async t=>{try{let n=await i(V);a(t,n.ggnomadAnalytics);}catch(n){s(n);}}),r.command("overview").description("Overview stats (users, listings, bookings, monthly revenue)").option("-f, --format <format>","Output format").action(async t=>{try{let n=await i(U);a(t,n.ggnomadOverviewStats);}catch(n){s(n);}});}var gt={id:"ggnomad",version:"1.0.0",displayName:"GGNomad",dependsOn:["auth","workspaces"],register(o,r){x(r);let t=o.command("ggnomad").description("GGNomad travel & experiences marketplace");j(t),z(t),Y(t),H(t),K(t),J(t),Q(t),X(t),Z(t);}},cn=gt;module.exports=cn;
|
|
140
|
+
`;function U(o,r){try{return JSON.parse(r)}catch{throw new p(`--${o} must be valid JSON`)}}function c(o){let r=Number.parseInt(o,10);if(Number.isNaN(r))throw new p(`Expected an integer but got "${o}"`);return r}function w(o){let r=Number.parseFloat(o);if(Number.isNaN(r))throw new p(`Expected a number but got "${o}"`);return r}function j(o){let r=o.command("providers").description("GGNomad providers");r.command("list").description("List providers").option("--limit <n>","Page size",c,20).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let n=await i(b,{pagination:{limit:t.limit,offset:t.offset}});a(t,n.ggnomadProviders,{headers:["ID","Name","Type","Status","Rating","Listings"],rows:n.ggnomadProviders.map(e=>[d(e.id,12),e.name,e.type,e.status,`${e.rating??0} (${e.reviewCount??0})`,String(e.listingCount??0)])});}catch(n){s(n);}}),r.command("get").description("Get a provider by id").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(t,n)=>{try{let e=await i(I,{id:t});if(!e.ggnomadProvider)throw new p(`Provider ${t} not found`);a(n,e.ggnomadProvider);}catch(e){s(e);}}),r.command("create").description("Create a provider").requiredOption("--name <name>","Provider name").addOption(new commander.Option("--type <t>","Provider type").choices(["HOTEL_OPERATOR","TOUR_OPERATOR","ACTIVITY_PROVIDER","TRANSPORT_PROVIDER","EVENT_ORGANIZER"]).makeOptionMandatory()).option("--description <s>","Description").option("--website <url>","Website URL").option("--contact-email <email>","Contact email").option("--contact-phone <phone>","Contact phone").option("-f, --format <format>","Output format").action(async t=>{try{let n={name:t.name,type:t.type};t.description&&(n.description=t.description),t.website&&(n.website=t.website),t.contactEmail&&(n.contactEmail=t.contactEmail),t.contactPhone&&(n.contactPhone=t.contactPhone);let e=await i(E,{input:n});m(`Provider created: ${e.createGgnomadProvider.name}`),a(t,e.createGgnomadProvider);}catch(n){s(n);}});}function z(o){let r=o.command("properties").description("GGNomad stay properties");r.command("list").description("List properties").option("--limit <n>","Page size",c,20).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let n=await i(A,{pagination:{limit:t.limit,offset:t.offset}});a(t,n.ggnomadProperties,{headers:["ID","Name","Type","Status","Price/Night","Guests","Rating"],rows:n.ggnomadProperties.map(e=>[d(e.id,12),e.name,e.type,e.status,`${e.pricePerNight??0} ${e.currency??""}`.trim(),String(e.maxGuests??0),`${e.rating??0} (${e.reviewCount??0})`])});}catch(n){s(n);}}),r.command("get").description("Get a property by id").argument("<id>","Property ID").option("-f, --format <format>","Output format").action(async(t,n)=>{try{let e=await i(O,{id:t});if(!e.ggnomadProperty)throw new p(`Property ${t} not found`);a(n,e.ggnomadProperty);}catch(e){s(e);}}),r.command("create").description("Create a property").requiredOption("--name <name>","Property name").requiredOption("--type <t>","Property type").requiredOption("--address <json>","Address JSON").requiredOption("--max-guests <n>","Maximum guests",c).requiredOption("--price-per-night <n>","Price per night",w).requiredOption("--amenities <csv>","Comma-separated amenities").requiredOption("--images <csv>","Comma-separated image URLs").option("--provider <id>","Provider ID").option("--description <s>","Description").option("--bedrooms <n>","Bedrooms",c).option("--bathrooms <n>","Bathrooms",c).option("--check-in-time <s>","Check-in time").option("--check-out-time <s>","Check-out time").option("--currency <c>","Currency code").option("-f, --format <format>","Output format").action(async t=>{try{let n={name:t.name,type:t.type,address:U("address",t.address),maxGuests:t.maxGuests,pricePerNight:t.pricePerNight,amenities:t.amenities.split(",").map(k=>k.trim()),images:t.images.split(",").map(k=>k.trim())};t.provider&&(n.providerId=t.provider),t.description&&(n.description=t.description),t.bedrooms!==void 0&&(n.bedrooms=t.bedrooms),t.bathrooms!==void 0&&(n.bathrooms=t.bathrooms),t.checkInTime&&(n.checkInTime=t.checkInTime),t.checkOutTime&&(n.checkOutTime=t.checkOutTime),t.currency&&(n.currency=t.currency);let e=await i(P,{input:n});m(`Property created: ${e.createGgnomadProperty.name}`),a(t,e.createGgnomadProperty);}catch(n){s(n);}});}function Y(o){let r=o.command("activities").description("GGNomad activities");r.command("list").description("List activities").option("--limit <n>","Page size",c,20).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let n=await i(S,{pagination:{limit:t.limit,offset:t.offset}});a(t,n.ggnomadActivities,{headers:["ID","Name","Category","Difficulty","Duration","Price","Status"],rows:n.ggnomadActivities.map(e=>[d(e.id,12),e.name,e.category,e.difficulty??"-",e.duration??"-",`${e.price??0} ${e.currency??""}`.trim(),e.status])});}catch(n){s(n);}}),r.command("get").description("Get an activity by id").argument("<id>","Activity ID").option("-f, --format <format>","Output format").action(async(t,n)=>{try{let e=await i(R,{id:t});if(!e.ggnomadActivity)throw new p(`Activity ${t} not found`);a(n,e.ggnomadActivity);}catch(e){s(e);}});}function H(o){let r=o.command("events").description("GGNomad events");r.command("list").description("List events").option("--limit <n>","Page size",c,20).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let n=await i($,{pagination:{limit:t.limit,offset:t.offset}});a(t,n.ggnomadEvents,{headers:["ID","Name","Category","Price","Starts","Status"],rows:n.ggnomadEvents.map(e=>[d(e.id,12),e.name,e.category,`${e.price??0} ${e.currency??""}`.trim(),h(e.startsAt),e.status])});}catch(n){s(n);}}),r.command("get").description("Get an event by id").argument("<id>","Event ID").option("-f, --format <format>","Output format").action(async(t,n)=>{try{let e=await i(G,{id:t});if(!e.ggnomadEvent)throw new p(`Event ${t} not found`);a(n,e.ggnomadEvent);}catch(e){s(e);}});}function K(o){let r=o.command("tours").description("GGNomad tours");r.command("list").description("List tours").option("--limit <n>","Page size",c,20).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let n=await i(N,{pagination:{limit:t.limit,offset:t.offset}});a(t,n.ggnomadTours,{headers:["ID","Name","Type","Difficulty","Duration","Price","Status"],rows:n.ggnomadTours.map(e=>[d(e.id,12),e.name,e.type,e.difficulty??"-",e.duration??"-",`${e.price??0} ${e.currency??""}`.trim(),e.status])});}catch(n){s(n);}}),r.command("get").description("Get a tour by id").argument("<id>","Tour ID").option("-f, --format <format>","Output format").action(async(t,n)=>{try{let e=await i(q,{id:t});if(!e.ggnomadTour)throw new p(`Tour ${t} not found`);a(n,e.ggnomadTour);}catch(e){s(e);}});}function J(o){o.command("trips").description("GGNomad transport trips").command("list").description("List trips").option("--limit <n>","Page size",c,20).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let n=await i(D,{pagination:{limit:t.limit,offset:t.offset}});a(t,n.ggnomadTrips,{headers:["ID","Name","Mode","Price","Departs","Eco","Status"],rows:n.ggnomadTrips.map(e=>[d(e.id,12),e.name,e.transportMode,`${e.price??0} ${e.currency??""}`.trim(),h(e.departureAt),e.ecoFriendly?"yes":"no",e.status])});}catch(n){s(n);}});}function Q(o){let r=o.command("bookings").description("GGNomad bookings");r.command("list").description("List bookings").option("--limit <n>","Page size",c,20).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let n=await i(L,{pagination:{limit:t.limit,offset:t.offset}});a(t,n.ggnomadBookings,{headers:["ID","Ref","Type","Item","Guest","Total","Status","Payment"],rows:n.ggnomadBookings.map(e=>[d(e.id,12),e.referenceCode,e.bookingType,d(e.itemName,20),d(e.guestName,16),`${e.totalPrice} ${e.currency??""}`.trim(),e.status,e.paymentStatus])});}catch(n){s(n);}}),r.command("create").description("Create a booking").requiredOption("--type <t>","Booking type: ACTIVITY|EVENT|PROPERTY|TOUR|TRIP").requiredOption("--item-id <id>","Item ID being booked").requiredOption("--item-name <name>","Item name").requiredOption("--guest-name <name>","Guest name").requiredOption("--guests <n>","Number of guests",c).requiredOption("--total-price <n>","Total price",w).option("--guest-email <email>","Guest email").option("--guest-phone <phone>","Guest phone").option("--currency <c>","Currency code").option("--check-in <iso>","Check-in (ISO date)").option("--check-out <iso>","Check-out (ISO date)").option("--event-date <iso>","Event date (ISO date)").option("--payment-method <m>","Payment method").option("--special-requests <s>","Special requests").option("-f, --format <format>","Output format").action(async t=>{try{let n={bookingType:t.type.toUpperCase(),itemId:t.itemId,itemName:t.itemName,guestName:t.guestName,guests:t.guests,totalPrice:t.totalPrice};t.guestEmail&&(n.guestEmail=t.guestEmail),t.guestPhone&&(n.guestPhone=t.guestPhone),t.currency&&(n.currency=t.currency),t.checkIn&&(n.checkIn=t.checkIn),t.checkOut&&(n.checkOut=t.checkOut),t.eventDate&&(n.eventDate=t.eventDate),t.paymentMethod&&(n.paymentMethod=t.paymentMethod),t.specialRequests&&(n.specialRequests=t.specialRequests);let e=await i(_,{input:n});m(`Booking created: ${e.createGgnomadBooking.referenceCode}`),a(t,e.createGgnomadBooking);}catch(n){s(n);}}),r.command("cancel").description("Cancel a booking").argument("<id>","Booking ID").option("--reason <s>","Cancellation reason").option("-f, --format <format>","Output format").action(async(t,n)=>{try{let e=await i(F,{id:t,reason:n.reason});m(`Booking cancelled: ${e.cancelGgnomadBooking.referenceCode}`),a(n,e.cancelGgnomadBooking);}catch(e){s(e);}});}function X(o){let r=o.command("favorites").description("GGNomad favorites");r.command("list").description("List favorites").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let n=await i(W,{pagination:{limit:t.limit,offset:t.offset}});a(t,n.ggnomadFavorites);}catch(n){s(n);}}),r.command("toggle").description("Toggle a favorite on a target").requiredOption("--target-id <id>","Target ID").requiredOption("--target-type <t>","Target type: ACTIVITY|EVENT|PROPERTY|TOUR|TRIP").option("-f, --format <format>","Output format").action(async t=>{try{let n={targetId:t.targetId,targetType:t.targetType.toUpperCase()},e=await i(B,{input:n});m(e.toggleGgnomadFavorite?"Added to favorites":"Removed from favorites"),a(t,{favorited:e.toggleGgnomadFavorite});}catch(n){s(n);}});}function Z(o){let r=o.command("analytics").description("GGNomad analytics & overview");r.command("summary").description("Platform analytics (users, bookings, revenue, conversion, trends)").option("-f, --format <format>","Output format").action(async t=>{try{let n=await i(V);a(t,n.ggnomadAnalytics);}catch(n){s(n);}}),r.command("overview").description("Overview stats (users, listings, bookings, monthly revenue)").option("-f, --format <format>","Output format").action(async t=>{try{let n=await i(M);a(t,n.ggnomadOverviewStats);}catch(n){s(n);}});}var gt={id:"ggnomad",version:"1.0.0",displayName:"GGNomad",dependsOn:["auth","workspaces"],register(o,r){x(r);let t=o.command("ggnomad").description("GGNomad travel & experiences marketplace");j(t),z(t),Y(t),H(t),K(t),J(t),Q(t),X(t),Z(t);}},pn=gt;module.exports=pn;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,b as b$1,i,r,h as h$1,k as k$1,q as q$
|
|
1
|
+
import {a,b as b$1,i,r,h as h$1,k as k$1,q as q$2}from'../../chunk-WTNQ5PEC.js';import {q as q$1}from'../../chunk-MT2F54AC.js';import {Option}from'commander';var T=`
|
|
2
2
|
query GgnomadGetProvider($id: ID!) {
|
|
3
3
|
ggnomadProvider(id: $id) {
|
|
4
4
|
id name type description status website contactEmail contactPhone
|
|
@@ -137,4 +137,4 @@ import {a,b as b$1,i,r,h as h$1,k as k$1,q as q$1}from'../../chunk-VL67DTWH.js';
|
|
|
137
137
|
users listings bookings monthlyRevenue
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
`;function B(m,r){try{return JSON.parse(r)}catch{throw new o(`--${m} must be valid JSON`)}}function s(m){let r=Number.parseInt(m,10);if(Number.isNaN(r))throw new o(`Expected an integer but got "${m}"`);return r}function l(m){let r=Number.parseFloat(m);if(Number.isNaN(r))throw new o(`Expected a number but got "${m}"`);return r}function V(m){let r$1=m.command("providers").description("GGNomad providers");r$1.command("list").description("List providers").option("--limit <n>","Page size",s,20).option("--offset <n>","Offset",s,0).option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(P,{pagination:{limit:t.limit,offset:t.offset}});i(t,o.ggnomadProviders,{headers:["ID","Name","Type","Status","Rating","Listings"],rows:o.ggnomadProviders.map(e=>[r(e.id,12),e.name,e.type,e.status,`${e.rating??0} (${e.reviewCount??0})`,String(e.listingCount??0)])});}catch(o){h$1(o);}}),r$1.command("get").description("Get a provider by id").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(t,o$1)=>{try{let e=await b$1(T,{id:t});if(!e.ggnomadProvider)throw new o(`Provider ${t} not found`);i(o$1,e.ggnomadProvider);}catch(e){h$1(e);}}),r$1.command("create").description("Create a provider").requiredOption("--name <name>","Provider name").addOption(new Option("--type <t>","Provider type").choices(["HOTEL_OPERATOR","TOUR_OPERATOR","ACTIVITY_PROVIDER","TRANSPORT_PROVIDER","EVENT_ORGANIZER"]).makeOptionMandatory()).option("--description <s>","Description").option("--website <url>","Website URL").option("--contact-email <email>","Contact email").option("--contact-phone <phone>","Contact phone").option("-f, --format <format>","Output format").action(async t=>{try{let o={name:t.name,type:t.type};t.description&&(o.description=t.description),t.website&&(o.website=t.website),t.contactEmail&&(o.contactEmail=t.contactEmail),t.contactPhone&&(o.contactPhone=t.contactPhone);let e=await b$1(C,{input:o});k$1(`Provider created: ${e.createGgnomadProvider.name}`),i(t,e.createGgnomadProvider);}catch(o){h$1(o);}});}function F(m){let r$1=m.command("properties").description("GGNomad stay properties");r$1.command("list").description("List properties").option("--limit <n>","Page size",s,20).option("--offset <n>","Offset",s,0).option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(h,{pagination:{limit:t.limit,offset:t.offset}});i(t,o.ggnomadProperties,{headers:["ID","Name","Type","Status","Price/Night","Guests","Rating"],rows:o.ggnomadProperties.map(e=>[r(e.id,12),e.name,e.type,e.status,`${e.pricePerNight??0} ${e.currency??""}`.trim(),String(e.maxGuests??0),`${e.rating??0} (${e.reviewCount??0})`])});}catch(o){h$1(o);}}),r$1.command("get").description("Get a property by id").argument("<id>","Property ID").option("-f, --format <format>","Output format").action(async(t,o$1)=>{try{let e=await b$1(O,{id:t});if(!e.ggnomadProperty)throw new o(`Property ${t} not found`);i(o$1,e.ggnomadProperty);}catch(e){h$1(e);}}),r$1.command("create").description("Create a property").requiredOption("--name <name>","Property name").requiredOption("--type <t>","Property type").requiredOption("--address <json>","Address JSON").requiredOption("--max-guests <n>","Maximum guests",s).requiredOption("--price-per-night <n>","Price per night",l).requiredOption("--amenities <csv>","Comma-separated amenities").requiredOption("--images <csv>","Comma-separated image URLs").option("--provider <id>","Provider ID").option("--description <s>","Description").option("--bedrooms <n>","Bedrooms",s).option("--bathrooms <n>","Bathrooms",s).option("--check-in-time <s>","Check-in time").option("--check-out-time <s>","Check-out time").option("--currency <c>","Currency code").option("-f, --format <format>","Output format").action(async t=>{try{let o={name:t.name,type:t.type,address:B("address",t.address),maxGuests:t.maxGuests,pricePerNight:t.pricePerNight,amenities:t.amenities.split(",").map(v=>v.trim()),images:t.images.split(",").map(v=>v.trim())};t.provider&&(o.providerId=t.provider),t.description&&(o.description=t.description),t.bedrooms!==void 0&&(o.bedrooms=t.bedrooms),t.bathrooms!==void 0&&(o.bathrooms=t.bathrooms),t.checkInTime&&(o.checkInTime=t.checkInTime),t.checkOutTime&&(o.checkOutTime=t.checkOutTime),t.currency&&(o.currency=t.currency);let e=await b$1(w,{input:o});k$1(`Property created: ${e.createGgnomadProperty.name}`),i(t,e.createGgnomadProperty);}catch(o){h$1(o);}});}function U(m){let r$1=m.command("activities").description("GGNomad activities");r$1.command("list").description("List activities").option("--limit <n>","Page size",s,20).option("--offset <n>","Offset",s,0).option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(k,{pagination:{limit:t.limit,offset:t.offset}});i(t,o.ggnomadActivities,{headers:["ID","Name","Category","Difficulty","Duration","Price","Status"],rows:o.ggnomadActivities.map(e=>[r(e.id,12),e.name,e.category,e.difficulty??"-",e.duration??"-",`${e.price??0} ${e.currency??""}`.trim(),e.status])});}catch(o){h$1(o);}}),r$1.command("get").description("Get an activity by id").argument("<id>","Activity ID").option("-f, --format <format>","Output format").action(async(t,o$1)=>{try{let e=await b$1(E,{id:t});if(!e.ggnomadActivity)throw new o(`Activity ${t} not found`);i(o$1,e.ggnomadActivity);}catch(e){h$1(e);}});}function M(m){let r$1=m.command("events").description("GGNomad events");r$1.command("list").description("List events").option("--limit <n>","Page size",s,20).option("--offset <n>","Offset",s,0).option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(R,{pagination:{limit:t.limit,offset:t.offset}});i(t,o.ggnomadEvents,{headers:["ID","Name","Category","Price","Starts","Status"],rows:o.ggnomadEvents.map(e=>[r(e.id,12),e.name,e.category,`${e.price??0} ${e.currency??""}`.trim(),q$1(e.startsAt),e.status])});}catch(o){h$1(o);}}),r$1.command("get").description("Get an event by id").argument("<id>","Event ID").option("-f, --format <format>","Output format").action(async(t,o$1)=>{try{let e=await b$1(G,{id:t});if(!e.ggnomadEvent)throw new o(`Event ${t} not found`);i(o$1,e.ggnomadEvent);}catch(e){h$1(e);}});}function W(m){let r$1=m.command("tours").description("GGNomad tours");r$1.command("list").description("List tours").option("--limit <n>","Page size",s,20).option("--offset <n>","Offset",s,0).option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(b,{pagination:{limit:t.limit,offset:t.offset}});i(t,o.ggnomadTours,{headers:["ID","Name","Type","Difficulty","Duration","Price","Status"],rows:o.ggnomadTours.map(e=>[r(e.id,12),e.name,e.type,e.difficulty??"-",e.duration??"-",`${e.price??0} ${e.currency??""}`.trim(),e.status])});}catch(o){h$1(o);}}),r$1.command("get").description("Get a tour by id").argument("<id>","Tour ID").option("-f, --format <format>","Output format").action(async(t,o$1)=>{try{let e=await b$1(A,{id:t});if(!e.ggnomadTour)throw new o(`Tour ${t} not found`);i(o$1,e.ggnomadTour);}catch(e){h$1(e);}});}function Y(m){m.command("trips").description("GGNomad transport trips").command("list").description("List trips").option("--limit <n>","Page size",s,20).option("--offset <n>","Offset",s,0).option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(S,{pagination:{limit:t.limit,offset:t.offset}});i(t,o.ggnomadTrips,{headers:["ID","Name","Mode","Price","Departs","Eco","Status"],rows:o.ggnomadTrips.map(e=>[r(e.id,12),e.name,e.transportMode,`${e.price??0} ${e.currency??""}`.trim(),q$1(e.departureAt),e.ecoFriendly?"yes":"no",e.status])});}catch(o){h$1(o);}});}function z(m){let r$1=m.command("bookings").description("GGNomad bookings");r$1.command("list").description("List bookings").option("--limit <n>","Page size",s,20).option("--offset <n>","Offset",s,0).option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(N,{pagination:{limit:t.limit,offset:t.offset}});i(t,o.ggnomadBookings,{headers:["ID","Ref","Type","Item","Guest","Total","Status","Payment"],rows:o.ggnomadBookings.map(e=>[r(e.id,12),e.referenceCode,e.bookingType,r(e.itemName,20),r(e.guestName,16),`${e.totalPrice} ${e.currency??""}`.trim(),e.status,e.paymentStatus])});}catch(o){h$1(o);}}),r$1.command("create").description("Create a booking").requiredOption("--type <t>","Booking type: ACTIVITY|EVENT|PROPERTY|TOUR|TRIP").requiredOption("--item-id <id>","Item ID being booked").requiredOption("--item-name <name>","Item name").requiredOption("--guest-name <name>","Guest name").requiredOption("--guests <n>","Number of guests",s).requiredOption("--total-price <n>","Total price",l).option("--guest-email <email>","Guest email").option("--guest-phone <phone>","Guest phone").option("--currency <c>","Currency code").option("--check-in <iso>","Check-in (ISO date)").option("--check-out <iso>","Check-out (ISO date)").option("--event-date <iso>","Event date (ISO date)").option("--payment-method <m>","Payment method").option("--special-requests <s>","Special requests").option("-f, --format <format>","Output format").action(async t=>{try{let o={bookingType:t.type.toUpperCase(),itemId:t.itemId,itemName:t.itemName,guestName:t.guestName,guests:t.guests,totalPrice:t.totalPrice};t.guestEmail&&(o.guestEmail=t.guestEmail),t.guestPhone&&(o.guestPhone=t.guestPhone),t.currency&&(o.currency=t.currency),t.checkIn&&(o.checkIn=t.checkIn),t.checkOut&&(o.checkOut=t.checkOut),t.eventDate&&(o.eventDate=t.eventDate),t.paymentMethod&&(o.paymentMethod=t.paymentMethod),t.specialRequests&&(o.specialRequests=t.specialRequests);let e=await b$1(x,{input:o});k$1(`Booking created: ${e.createGgnomadBooking.referenceCode}`),i(t,e.createGgnomadBooking);}catch(o){h$1(o);}}),r$1.command("cancel").description("Cancel a booking").argument("<id>","Booking ID").option("--reason <s>","Cancellation reason").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await b$1($,{id:t,reason:o.reason});k$1(`Booking cancelled: ${e.cancelGgnomadBooking.referenceCode}`),i(o,e.cancelGgnomadBooking);}catch(e){h$1(e);}});}function K(m){let r=m.command("favorites").description("GGNomad favorites");r.command("list").description("List favorites").option("--limit <n>","Page size",s,50).option("--offset <n>","Offset",s,0).option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(D,{pagination:{limit:t.limit,offset:t.offset}});i(t,o.ggnomadFavorites);}catch(o){h$1(o);}}),r.command("toggle").description("Toggle a favorite on a target").requiredOption("--target-id <id>","Target ID").requiredOption("--target-type <t>","Target type: ACTIVITY|EVENT|PROPERTY|TOUR|TRIP").option("-f, --format <format>","Output format").action(async t=>{try{let o={targetId:t.targetId,targetType:t.targetType.toUpperCase()},e=await b$1(L,{input:o});k$1(e.toggleGgnomadFavorite?"Added to favorites":"Removed from favorites"),i(t,{favorited:e.toggleGgnomadFavorite});}catch(o){h$1(o);}});}function J(m){let r=m.command("analytics").description("GGNomad analytics & overview");r.command("summary").description("Platform analytics (users, bookings, revenue, conversion, trends)").option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(_);i(t,o.ggnomadAnalytics);}catch(o){h$1(o);}}),r.command("overview").description("Overview stats (users, listings, bookings, monthly revenue)").option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(q);i(t,o.ggnomadOverviewStats);}catch(o){h$1(o);}});}var H={id:"ggnomad",version:"1.0.0",displayName:"GGNomad",dependsOn:["auth","workspaces"],register(m,r){a(r);let t=m.command("ggnomad").description("GGNomad travel & experiences marketplace");V(t),F(t),U(t),M(t),W(t),Y(t),z(t),K(t),J(t);}},Ft=H;export{Ft as default};
|
|
140
|
+
`;function B(m,r){try{return JSON.parse(r)}catch{throw new q$1(`--${m} must be valid JSON`)}}function s(m){let r=Number.parseInt(m,10);if(Number.isNaN(r))throw new q$1(`Expected an integer but got "${m}"`);return r}function l(m){let r=Number.parseFloat(m);if(Number.isNaN(r))throw new q$1(`Expected a number but got "${m}"`);return r}function V(m){let r$1=m.command("providers").description("GGNomad providers");r$1.command("list").description("List providers").option("--limit <n>","Page size",s,20).option("--offset <n>","Offset",s,0).option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(P,{pagination:{limit:t.limit,offset:t.offset}});i(t,o.ggnomadProviders,{headers:["ID","Name","Type","Status","Rating","Listings"],rows:o.ggnomadProviders.map(e=>[r(e.id,12),e.name,e.type,e.status,`${e.rating??0} (${e.reviewCount??0})`,String(e.listingCount??0)])});}catch(o){h$1(o);}}),r$1.command("get").description("Get a provider by id").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await b$1(T,{id:t});if(!e.ggnomadProvider)throw new q$1(`Provider ${t} not found`);i(o,e.ggnomadProvider);}catch(e){h$1(e);}}),r$1.command("create").description("Create a provider").requiredOption("--name <name>","Provider name").addOption(new Option("--type <t>","Provider type").choices(["HOTEL_OPERATOR","TOUR_OPERATOR","ACTIVITY_PROVIDER","TRANSPORT_PROVIDER","EVENT_ORGANIZER"]).makeOptionMandatory()).option("--description <s>","Description").option("--website <url>","Website URL").option("--contact-email <email>","Contact email").option("--contact-phone <phone>","Contact phone").option("-f, --format <format>","Output format").action(async t=>{try{let o={name:t.name,type:t.type};t.description&&(o.description=t.description),t.website&&(o.website=t.website),t.contactEmail&&(o.contactEmail=t.contactEmail),t.contactPhone&&(o.contactPhone=t.contactPhone);let e=await b$1(C,{input:o});k$1(`Provider created: ${e.createGgnomadProvider.name}`),i(t,e.createGgnomadProvider);}catch(o){h$1(o);}});}function F(m){let r$1=m.command("properties").description("GGNomad stay properties");r$1.command("list").description("List properties").option("--limit <n>","Page size",s,20).option("--offset <n>","Offset",s,0).option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(h,{pagination:{limit:t.limit,offset:t.offset}});i(t,o.ggnomadProperties,{headers:["ID","Name","Type","Status","Price/Night","Guests","Rating"],rows:o.ggnomadProperties.map(e=>[r(e.id,12),e.name,e.type,e.status,`${e.pricePerNight??0} ${e.currency??""}`.trim(),String(e.maxGuests??0),`${e.rating??0} (${e.reviewCount??0})`])});}catch(o){h$1(o);}}),r$1.command("get").description("Get a property by id").argument("<id>","Property ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await b$1(O,{id:t});if(!e.ggnomadProperty)throw new q$1(`Property ${t} not found`);i(o,e.ggnomadProperty);}catch(e){h$1(e);}}),r$1.command("create").description("Create a property").requiredOption("--name <name>","Property name").requiredOption("--type <t>","Property type").requiredOption("--address <json>","Address JSON").requiredOption("--max-guests <n>","Maximum guests",s).requiredOption("--price-per-night <n>","Price per night",l).requiredOption("--amenities <csv>","Comma-separated amenities").requiredOption("--images <csv>","Comma-separated image URLs").option("--provider <id>","Provider ID").option("--description <s>","Description").option("--bedrooms <n>","Bedrooms",s).option("--bathrooms <n>","Bathrooms",s).option("--check-in-time <s>","Check-in time").option("--check-out-time <s>","Check-out time").option("--currency <c>","Currency code").option("-f, --format <format>","Output format").action(async t=>{try{let o={name:t.name,type:t.type,address:B("address",t.address),maxGuests:t.maxGuests,pricePerNight:t.pricePerNight,amenities:t.amenities.split(",").map(v=>v.trim()),images:t.images.split(",").map(v=>v.trim())};t.provider&&(o.providerId=t.provider),t.description&&(o.description=t.description),t.bedrooms!==void 0&&(o.bedrooms=t.bedrooms),t.bathrooms!==void 0&&(o.bathrooms=t.bathrooms),t.checkInTime&&(o.checkInTime=t.checkInTime),t.checkOutTime&&(o.checkOutTime=t.checkOutTime),t.currency&&(o.currency=t.currency);let e=await b$1(w,{input:o});k$1(`Property created: ${e.createGgnomadProperty.name}`),i(t,e.createGgnomadProperty);}catch(o){h$1(o);}});}function U(m){let r$1=m.command("activities").description("GGNomad activities");r$1.command("list").description("List activities").option("--limit <n>","Page size",s,20).option("--offset <n>","Offset",s,0).option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(k,{pagination:{limit:t.limit,offset:t.offset}});i(t,o.ggnomadActivities,{headers:["ID","Name","Category","Difficulty","Duration","Price","Status"],rows:o.ggnomadActivities.map(e=>[r(e.id,12),e.name,e.category,e.difficulty??"-",e.duration??"-",`${e.price??0} ${e.currency??""}`.trim(),e.status])});}catch(o){h$1(o);}}),r$1.command("get").description("Get an activity by id").argument("<id>","Activity ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await b$1(E,{id:t});if(!e.ggnomadActivity)throw new q$1(`Activity ${t} not found`);i(o,e.ggnomadActivity);}catch(e){h$1(e);}});}function M(m){let r$1=m.command("events").description("GGNomad events");r$1.command("list").description("List events").option("--limit <n>","Page size",s,20).option("--offset <n>","Offset",s,0).option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(R,{pagination:{limit:t.limit,offset:t.offset}});i(t,o.ggnomadEvents,{headers:["ID","Name","Category","Price","Starts","Status"],rows:o.ggnomadEvents.map(e=>[r(e.id,12),e.name,e.category,`${e.price??0} ${e.currency??""}`.trim(),q$2(e.startsAt),e.status])});}catch(o){h$1(o);}}),r$1.command("get").description("Get an event by id").argument("<id>","Event ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await b$1(G,{id:t});if(!e.ggnomadEvent)throw new q$1(`Event ${t} not found`);i(o,e.ggnomadEvent);}catch(e){h$1(e);}});}function W(m){let r$1=m.command("tours").description("GGNomad tours");r$1.command("list").description("List tours").option("--limit <n>","Page size",s,20).option("--offset <n>","Offset",s,0).option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(b,{pagination:{limit:t.limit,offset:t.offset}});i(t,o.ggnomadTours,{headers:["ID","Name","Type","Difficulty","Duration","Price","Status"],rows:o.ggnomadTours.map(e=>[r(e.id,12),e.name,e.type,e.difficulty??"-",e.duration??"-",`${e.price??0} ${e.currency??""}`.trim(),e.status])});}catch(o){h$1(o);}}),r$1.command("get").description("Get a tour by id").argument("<id>","Tour ID").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await b$1(A,{id:t});if(!e.ggnomadTour)throw new q$1(`Tour ${t} not found`);i(o,e.ggnomadTour);}catch(e){h$1(e);}});}function Y(m){m.command("trips").description("GGNomad transport trips").command("list").description("List trips").option("--limit <n>","Page size",s,20).option("--offset <n>","Offset",s,0).option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(S,{pagination:{limit:t.limit,offset:t.offset}});i(t,o.ggnomadTrips,{headers:["ID","Name","Mode","Price","Departs","Eco","Status"],rows:o.ggnomadTrips.map(e=>[r(e.id,12),e.name,e.transportMode,`${e.price??0} ${e.currency??""}`.trim(),q$2(e.departureAt),e.ecoFriendly?"yes":"no",e.status])});}catch(o){h$1(o);}});}function z(m){let r$1=m.command("bookings").description("GGNomad bookings");r$1.command("list").description("List bookings").option("--limit <n>","Page size",s,20).option("--offset <n>","Offset",s,0).option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(N,{pagination:{limit:t.limit,offset:t.offset}});i(t,o.ggnomadBookings,{headers:["ID","Ref","Type","Item","Guest","Total","Status","Payment"],rows:o.ggnomadBookings.map(e=>[r(e.id,12),e.referenceCode,e.bookingType,r(e.itemName,20),r(e.guestName,16),`${e.totalPrice} ${e.currency??""}`.trim(),e.status,e.paymentStatus])});}catch(o){h$1(o);}}),r$1.command("create").description("Create a booking").requiredOption("--type <t>","Booking type: ACTIVITY|EVENT|PROPERTY|TOUR|TRIP").requiredOption("--item-id <id>","Item ID being booked").requiredOption("--item-name <name>","Item name").requiredOption("--guest-name <name>","Guest name").requiredOption("--guests <n>","Number of guests",s).requiredOption("--total-price <n>","Total price",l).option("--guest-email <email>","Guest email").option("--guest-phone <phone>","Guest phone").option("--currency <c>","Currency code").option("--check-in <iso>","Check-in (ISO date)").option("--check-out <iso>","Check-out (ISO date)").option("--event-date <iso>","Event date (ISO date)").option("--payment-method <m>","Payment method").option("--special-requests <s>","Special requests").option("-f, --format <format>","Output format").action(async t=>{try{let o={bookingType:t.type.toUpperCase(),itemId:t.itemId,itemName:t.itemName,guestName:t.guestName,guests:t.guests,totalPrice:t.totalPrice};t.guestEmail&&(o.guestEmail=t.guestEmail),t.guestPhone&&(o.guestPhone=t.guestPhone),t.currency&&(o.currency=t.currency),t.checkIn&&(o.checkIn=t.checkIn),t.checkOut&&(o.checkOut=t.checkOut),t.eventDate&&(o.eventDate=t.eventDate),t.paymentMethod&&(o.paymentMethod=t.paymentMethod),t.specialRequests&&(o.specialRequests=t.specialRequests);let e=await b$1(x,{input:o});k$1(`Booking created: ${e.createGgnomadBooking.referenceCode}`),i(t,e.createGgnomadBooking);}catch(o){h$1(o);}}),r$1.command("cancel").description("Cancel a booking").argument("<id>","Booking ID").option("--reason <s>","Cancellation reason").option("-f, --format <format>","Output format").action(async(t,o)=>{try{let e=await b$1($,{id:t,reason:o.reason});k$1(`Booking cancelled: ${e.cancelGgnomadBooking.referenceCode}`),i(o,e.cancelGgnomadBooking);}catch(e){h$1(e);}});}function K(m){let r=m.command("favorites").description("GGNomad favorites");r.command("list").description("List favorites").option("--limit <n>","Page size",s,50).option("--offset <n>","Offset",s,0).option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(D,{pagination:{limit:t.limit,offset:t.offset}});i(t,o.ggnomadFavorites);}catch(o){h$1(o);}}),r.command("toggle").description("Toggle a favorite on a target").requiredOption("--target-id <id>","Target ID").requiredOption("--target-type <t>","Target type: ACTIVITY|EVENT|PROPERTY|TOUR|TRIP").option("-f, --format <format>","Output format").action(async t=>{try{let o={targetId:t.targetId,targetType:t.targetType.toUpperCase()},e=await b$1(L,{input:o});k$1(e.toggleGgnomadFavorite?"Added to favorites":"Removed from favorites"),i(t,{favorited:e.toggleGgnomadFavorite});}catch(o){h$1(o);}});}function J(m){let r=m.command("analytics").description("GGNomad analytics & overview");r.command("summary").description("Platform analytics (users, bookings, revenue, conversion, trends)").option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(_);i(t,o.ggnomadAnalytics);}catch(o){h$1(o);}}),r.command("overview").description("Overview stats (users, listings, bookings, monthly revenue)").option("-f, --format <format>","Output format").action(async t=>{try{let o=await b$1(q);i(t,o.ggnomadOverviewStats);}catch(o){h$1(o);}});}var H={id:"ggnomad",version:"1.0.0",displayName:"GGNomad",dependsOn:["auth","workspaces"],register(m,r){a(r);let t=m.command("ggnomad").description("GGNomad travel & experiences marketplace");V(t),F(t),U(t),M(t),W(t),Y(t),z(t),K(t),J(t);}},Ft=H;export{Ft as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var u=class extends Error{exitCode;hint;constructor(i,t){super(i),this.name="CliUserError",this.exitCode=t?.exitCode??1,this.hint=t?.hint;}},C=class extends u{constructor(i,t){super(i,{exitCode:2,hint:t?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},I=class extends Error{cause;constructor(i,t){super(i),this.name="CliInternalError",this.cause=t;}};var E=null;function x(r){E=r;}function A(){if(!E)throw new I("vibecontrols module helpers used before setHelpersContext was called");return E}function xt(){let r=A();if(!r.auth.isAuthenticated())throw new C("Authentication required.",{hint:`Run \`${r.productName} auth login\` to authenticate.`})}async function a(r,i){return xt(),A().gql.workspace.request(r,i)}async function h(r,i){return A().gql.workspaceAuthOnly.request(r,i)}function o(r){let i=r instanceof Error?r.message:String(r);throw new u(i)}function s(r,i,t){A().output.formatAndOutput(r,i,t);}function c(r){A().output.printSuccess(r);}function w(r){return A().output.formatDate(r)}function d(r,i){return A().output.truncate(r,i)}var k=`
|
|
2
2
|
query GovGetAgency($id: ID!) {
|
|
3
3
|
govAgency(id: $id) {
|
|
4
4
|
id name code description jurisdiction contactEmail contactPhone
|
|
@@ -263,13 +263,13 @@
|
|
|
263
263
|
lineItems createdAt
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
`,
|
|
266
|
+
`,rt=`
|
|
267
267
|
mutation GovMarkPaymentPaid($id: ID!, $providerRef: String) {
|
|
268
268
|
govMarkPaymentPaid(id: $id, providerRef: $providerRef) {
|
|
269
269
|
id amount currency status providerRef receiptNumber paidAt updatedAt
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
`,
|
|
272
|
+
`,ot=`
|
|
273
273
|
mutation GovRefundPayment($id: ID!) {
|
|
274
274
|
govRefundPayment(id: $id) {
|
|
275
275
|
id amount currency status refundedAt updatedAt
|
|
@@ -279,4 +279,4 @@
|
|
|
279
279
|
query GovHealth {
|
|
280
280
|
govHealth
|
|
281
281
|
}
|
|
282
|
-
`;function f(o,i){try{return JSON.parse(i)}catch{throw new p(`--${o} must be valid JSON`)}}function g(o){let i=Number.parseInt(o,10);if(Number.isNaN(i))throw new p(`Expected an integer but got "${o}"`);return i}function y(o){let i=Number.parseFloat(o);if(Number.isNaN(i))throw new p(`Expected a number but got "${o}"`);return i}function m(o){return o.split(",").map(i=>i.trim()).filter(i=>i.length>0)}function at(o){let i=o.command("agencies").description("GovCitizenHub agencies");i.command("list").description("List agencies").option("--active <bool>","Filter by active state (true|false)",t=>t==="true").option("--limit <n>","Page size",g,50).option("--offset <n>","Offset",g,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(R,{isActive:t.active,pagination:{limit:t.limit,offset:t.offset}});s(t,e.govListAgencies.items,{headers:["ID","Name","Code","Jurisdiction","Active"],rows:e.govListAgencies.items.map(n=>[d(n.id,12),n.name,n.code??"-",n.jurisdiction??"-",n.isActive?"yes":"no"])});}catch(e){r(e);}}),i.command("get").description("Get an agency by id").argument("<id>","Agency ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(b,{id:t});if(!n.govAgency)throw new p(`Agency ${t} not found`);s(e,n.govAgency);}catch(n){r(n);}}),i.command("create").description("Create an agency").requiredOption("--name <name>","Agency name").option("--code <code>","Agency code").option("--description <s>","Description").option("--jurisdiction <s>","Jurisdiction").option("--contact-email <email>","Contact email").option("--contact-phone <phone>","Contact phone").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name};t.code&&(e.code=t.code),t.description&&(e.description=t.description),t.jurisdiction&&(e.jurisdiction=t.jurisdiction),t.contactEmail&&(e.contactEmail=t.contactEmail),t.contactPhone&&(e.contactPhone=t.contactPhone),t.tags&&(e.tags=m(t.tags));let n=await a(S,{input:e});c(`Agency created: ${n.govCreateAgency.name}`),s(t,n.govCreateAgency);}catch(e){r(e);}}),i.command("update").description("Update an agency").argument("<id>","Agency ID").option("--name <name>","Agency name").option("--code <code>","Agency code").option("--description <s>","Description").option("--jurisdiction <s>","Jurisdiction").option("--contact-email <email>","Contact email").option("--contact-phone <phone>","Contact phone").option("--active <bool>","Active state (true|false)",t=>t==="true").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.name&&(n.name=e.name),e.code&&(n.code=e.code),e.description!==void 0&&(n.description=e.description),e.jurisdiction&&(n.jurisdiction=e.jurisdiction),e.contactEmail&&(n.contactEmail=e.contactEmail),e.contactPhone&&(n.contactPhone=e.contactPhone),e.active!==void 0&&(n.isActive=e.active),e.tags&&(n.tags=m(e.tags)),!Object.keys(n).length)throw new p("No updates specified");let v=await a(D,{id:t,input:n});c("Agency updated"),s(e,v.govUpdateAgency);}catch(n){r(n);}}),i.command("archive").description("Archive (soft-delete) an agency").argument("<id>","Agency ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(P,{id:t});c(n.govArchiveAgency?"Agency archived":"Agency not archived"),s(e,{archived:n.govArchiveAgency});}catch(n){r(n);}});}function ct(o){let i=o.command("services").description("GovCitizenHub services");i.command("list").description("List services").option("--agency <id>","Filter by agency ID").option("--category <c>","Filter by service category").option("--status <s>","Filter by service status").option("--limit <n>","Page size",g,50).option("--offset <n>","Offset",g,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a($,{agencyId:t.agency,category:t.category?t.category.toUpperCase():void 0,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});s(t,e.govListServices.items,{headers:["ID","Name","Category","Status","Fee","SLA"],rows:e.govListServices.items.map(n=>[d(n.id,12),n.name,n.category,n.status,`${n.feeType} ${n.feeAmount}`,n.slaDays!=null?String(n.slaDays):"-"])});}catch(e){r(e);}}),i.command("get").description("Get a service by id").argument("<id>","Service ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(O,{id:t});if(!n.govService)throw new p(`Service ${t} not found`);s(e,n.govService);}catch(n){r(n);}}),i.command("create").description("Create a service").requiredOption("--agency <id>","Agency ID").requiredOption("--name <name>","Service name").requiredOption("--slug <slug>","URL slug").option("--category <c>","Service category","OTHER").option("--summary <s>","Summary").option("--eligibility <s>","Eligibility criteria").option("--fee-type <t>","FREE|FIXED|VARIABLE","FREE").option("--fee-amount <n>","Fee amount",y).option("--currency <c>","Currency code").option("--required-documents <csv>","Comma-separated required documents").option("--form-schema <json>","Form schema JSON").option("--sla-days <n>","SLA in days",g).option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={agencyId:t.agency,name:t.name,slug:t.slug,category:(t.category??"OTHER").toUpperCase(),feeType:(t.feeType??"FREE").toUpperCase()};t.summary&&(e.summary=t.summary),t.eligibility&&(e.eligibility=t.eligibility),t.feeAmount!==void 0&&(e.feeAmount=t.feeAmount),t.currency&&(e.currency=t.currency),t.requiredDocuments&&(e.requiredDocuments=m(t.requiredDocuments)),t.formSchema&&(e.formSchema=f("form-schema",t.formSchema)),t.slaDays!==void 0&&(e.slaDays=t.slaDays),t.tags&&(e.tags=m(t.tags));let n=await a(G,{input:e});c(`Service created: ${n.govCreateService.name}`),s(t,n.govCreateService);}catch(e){r(e);}}),i.command("update").description("Update a service").argument("<id>","Service ID").option("--name <name>","Service name").option("--category <c>","Service category").option("--summary <s>","Summary").option("--eligibility <s>","Eligibility criteria").option("--fee-type <t>","FREE|FIXED|VARIABLE").option("--fee-amount <n>","Fee amount",y).option("--currency <c>","Currency code").option("--required-documents <csv>","Comma-separated required documents").option("--form-schema <json>","Form schema JSON").option("--sla-days <n>","SLA in days",g).option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.name&&(n.name=e.name),e.category&&(n.category=e.category.toUpperCase()),e.summary!==void 0&&(n.summary=e.summary),e.eligibility!==void 0&&(n.eligibility=e.eligibility),e.feeType&&(n.feeType=e.feeType.toUpperCase()),e.feeAmount!==void 0&&(n.feeAmount=e.feeAmount),e.currency&&(n.currency=e.currency),e.requiredDocuments&&(n.requiredDocuments=m(e.requiredDocuments)),e.formSchema&&(n.formSchema=f("form-schema",e.formSchema)),e.slaDays!==void 0&&(n.slaDays=e.slaDays),e.tags&&(n.tags=m(e.tags)),!Object.keys(n).length)throw new p("No updates specified");let v=await a(N,{id:t,input:n});c("Service updated"),s(e,v.govUpdateService);}catch(n){r(n);}}),i.command("transition").description("Advance a service through its publication lifecycle").argument("<id>","Service ID").requiredOption("--status <s>","DRAFT|PUBLISHED|SUSPENDED|RETIRED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(L,{id:t,status:e.status.toUpperCase()});c(`Service status set to ${n.govTransitionService.status}`),s(e,n.govTransitionService);}catch(n){r(n);}});}function pt(o){let i=o.command("applications").description("GovCitizenHub applications");i.command("list").description("List applications").option("--citizen <id>","Filter by citizen ID").option("--service <id>","Filter by service ID").option("--assigned-to <id>","Filter by assignee ID").option("--status <s>","Filter by application status").option("--limit <n>","Page size",g,50).option("--offset <n>","Offset",g,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(_,{citizenId:t.citizen,serviceId:t.service,assignedToId:t.assignedTo,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});s(t,e.govListApplications.items,{headers:["ID","Reference","Citizen","Status","Priority","Submitted"],rows:e.govListApplications.items.map(n=>[d(n.id,12),n.reference,d(n.citizenId,12),n.status,n.priority,w(n.submittedAt)])});}catch(e){r(e);}}),i.command("get").description("Get an application by id").argument("<id>","Application ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(q,{id:t});if(!n.govApplication)throw new p(`Application ${t} not found`);s(e,n.govApplication);}catch(n){r(n);}}),i.command("create").description("Create an application").requiredOption("--service <id>","Service ID").option("--reference <ref>","Application reference").option("--priority <p>","LOW|NORMAL|HIGH|URGENT","NORMAL").option("--form-data <json>","Form data JSON").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={serviceId:t.service,priority:(t.priority??"NORMAL").toUpperCase()};t.reference&&(e.reference=t.reference),t.formData&&(e.formData=f("form-data",t.formData)),t.tags&&(e.tags=m(t.tags));let n=await a(U,{input:e});c(`Application created: ${n.govCreateApplication.reference}`),s(t,n.govCreateApplication);}catch(e){r(e);}}),i.command("update").description("Update an application").argument("<id>","Application ID").option("--assigned-to <id>","Assignee ID").option("--priority <p>","LOW|NORMAL|HIGH|URGENT").option("--form-data <json>","Form data JSON").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.assignedTo&&(n.assignedToId=e.assignedTo),e.priority&&(n.priority=e.priority.toUpperCase()),e.formData&&(n.formData=f("form-data",e.formData)),e.tags&&(n.tags=m(e.tags)),!Object.keys(n).length)throw new p("No updates specified");let v=await a(F,{id:t,input:n});c("Application updated"),s(e,v.govUpdateApplication);}catch(n){r(n);}}),i.command("submit").description("Submit a draft application").argument("<id>","Application ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(M,{id:t});c(`Application submitted: ${n.govSubmitApplication.reference}`),s(e,n.govSubmitApplication);}catch(n){r(n);}}),i.command("transition").description("Advance an application through its review lifecycle").argument("<id>","Application ID").requiredOption("--status <s>","DRAFT|SUBMITTED|IN_REVIEW|INFO_REQUESTED|APPROVED|REJECTED|WITHDRAWN").option("--reason <s>","Transition reason").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(j,{id:t,status:e.status.toUpperCase(),reason:e.reason});c(`Application status set to ${n.govTransitionApplication.status}`),s(e,n.govTransitionApplication);}catch(n){r(n);}}),i.command("add-note").description("Add a case note to an application").requiredOption("--application <id>","Application ID").requiredOption("--body <text>","Note body").option("--type <t>","INTERNAL|CITIZEN_MESSAGE|INFO_REQUEST|DECISION","INTERNAL").option("-f, --format <format>","Output format").action(async t=>{try{let e={applicationId:t.application,body:t.body,type:(t.type??"INTERNAL").toUpperCase()},n=await a(V,{input:e});c("Case note added"),s(t,n.govAddCaseNote);}catch(e){r(e);}}),i.command("add-document").description("Attach a document to an application").requiredOption("--application <id>","Application ID").requiredOption("--name <name>","Document name").option("--file <id>","File ID (wspace-files-svc)").option("--requirement <s>","Requirement this document satisfies").option("-f, --format <format>","Output format").action(async t=>{try{let e={applicationId:t.application,name:t.name};t.file&&(e.fileId=t.file),t.requirement&&(e.requirement=t.requirement);let n=await a(W,{input:e});c(`Document added: ${n.govAddDocument.name}`),s(t,n.govAddDocument);}catch(e){r(e);}});}function ut(o){o.command("documents").description("GovCitizenHub application documents").command("review").description("Review (accept/reject) an application document").argument("<id>","Document ID").requiredOption("--status <s>","PENDING|ACCEPTED|REJECTED").option("--rejection-reason <s>","Reason when rejecting").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(H,{id:t,status:e.status.toUpperCase(),rejectionReason:e.rejectionReason});c(`Document ${n.govReviewDocument.status.toLowerCase()}`),s(e,n.govReviewDocument);}catch(n){r(n);}});}function dt(o){let i=o.command("grievances").description("GovCitizenHub grievances");i.command("list").description("List grievances").option("--agency <id>","Filter by agency ID").option("--reporter <id>","Filter by reporter ID").option("--status <s>","Filter by grievance status").option("--limit <n>","Page size",g,50).option("--offset <n>","Offset",g,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(Y,{agencyId:t.agency,reporterId:t.reporter,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});s(t,e.govListGrievances.items,{headers:["ID","Title","Category","Status","Priority","Location"],rows:e.govListGrievances.items.map(n=>[d(n.id,12),n.title,n.category,n.status,n.priority,d(n.location??"-",24)])});}catch(e){r(e);}}),i.command("get").description("Get a grievance by id").argument("<id>","Grievance ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(z,{id:t});if(!n.govGrievance)throw new p(`Grievance ${t} not found`);s(e,n.govGrievance);}catch(n){r(n);}}),i.command("report").description("Report a new grievance").requiredOption("--title <t>","Title").requiredOption("--description <s>","Description").option("--category <c>","Service category","GRIEVANCES").option("--agency <id>","Agency ID").option("--location <s>","Location description").option("--latitude <n>","Latitude",y).option("--longitude <n>","Longitude",y).option("--photo-file-ids <csv>","Comma-separated photo file IDs").option("--priority <p>","LOW|NORMAL|HIGH|URGENT","NORMAL").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={title:t.title,description:t.description,category:(t.category??"GRIEVANCES").toUpperCase(),priority:(t.priority??"NORMAL").toUpperCase()};t.agency&&(e.agencyId=t.agency),t.location&&(e.location=t.location),t.latitude!==void 0&&(e.latitude=t.latitude),t.longitude!==void 0&&(e.longitude=t.longitude),t.photoFileIds&&(e.photoFileIds=m(t.photoFileIds)),t.tags&&(e.tags=m(t.tags));let n=await a(J,{input:e});c(`Grievance reported: ${n.govReportGrievance.title}`),s(t,n.govReportGrievance);}catch(e){r(e);}}),i.command("update").description("Update a grievance").argument("<id>","Grievance ID").option("--agency <id>","Agency ID").option("--assigned-to <id>","Assignee ID").option("--location <s>","Location description").option("--priority <p>","LOW|NORMAL|HIGH|URGENT").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.agency&&(n.agencyId=e.agency),e.assignedTo&&(n.assignedToId=e.assignedTo),e.location!==void 0&&(n.location=e.location),e.priority&&(n.priority=e.priority.toUpperCase()),e.tags&&(n.tags=m(e.tags)),!Object.keys(n).length)throw new p("No updates specified");let v=await a(B,{id:t,input:n});c("Grievance updated"),s(e,v.govUpdateGrievance);}catch(n){r(n);}}),i.command("transition").description("Advance a grievance through its resolution lifecycle").argument("<id>","Grievance ID").requiredOption("--status <s>","OPEN|ACKNOWLEDGED|IN_PROGRESS|RESOLVED|REJECTED|CLOSED").option("--resolution <s>","Resolution note").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(K,{id:t,status:e.status.toUpperCase(),resolution:e.resolution});c(`Grievance status set to ${n.govTransitionGrievance.status}`),s(e,n.govTransitionGrievance);}catch(n){r(n);}});}function gt(o){let i=o.command("permits").description("GovCitizenHub permits");i.command("list").description("List permits").option("--holder <id>","Filter by holder ID").option("--service <id>","Filter by service ID").option("--status <s>","Filter by permit status").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(Q,{holderId:t.holder,serviceId:t.service,status:t.status?t.status.toUpperCase():void 0});s(t,e.govListPermits.items,{headers:["ID","Title","Holder","Status","Code","Expires"],rows:e.govListPermits.items.map(n=>[d(n.id,12),n.title,d(n.holderId,12),n.status,n.verificationCode,w(n.expiresAt)])});}catch(e){r(e);}}),i.command("issue").description("Issue a permit").requiredOption("--holder <id>","Holder user ID").requiredOption("--service <id>","Service ID").requiredOption("--title <t>","Permit title").requiredOption("--verification-code <code>","Printed verification code").option("--application <id>","Originating application ID").option("--expires-at <iso>","Expiry (ISO date)").option("--file <id>","File ID for the generated permit PDF").option("-f, --format <format>","Output format").action(async t=>{try{let e={holderId:t.holder,serviceId:t.service,title:t.title,verificationCode:t.verificationCode};t.application&&(e.applicationId=t.application),t.expiresAt&&(e.expiresAt=t.expiresAt),t.file&&(e.fileId=t.file);let n=await a(X,{input:e});c(`Permit issued: ${n.govIssuePermit.title}`),s(t,n.govIssuePermit);}catch(e){r(e);}}),i.command("revoke").description("Revoke a permit").argument("<id>","Permit ID").option("--reason <s>","Revocation reason").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(Z,{id:t,reason:e.reason});c("Permit revoked"),s(e,n.govRevokePermit);}catch(n){r(n);}}),i.command("verify").description("Verify a permit by its printed code (public)").argument("<code>","Verification code").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await h(tt,{verificationCode:t});if(!n.govVerifyPermit)throw new p(`No permit found for code ${t}`);c(`Valid permit: ${n.govVerifyPermit.title} (${n.govVerifyPermit.status})`),s(e,n.govVerifyPermit);}catch(n){r(n);}});}function mt(o){let i=o.command("payments").description("GovCitizenHub payments");i.command("list").description("List payments").option("--application <id>","Filter by application ID").option("--payer <id>","Filter by payer ID").option("--status <s>","Filter by payment status").option("--limit <n>","Page size",g,50).option("--offset <n>","Offset",g,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(nt,{applicationId:t.application,payerId:t.payer,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});s(t,e.govListPayments.items,{headers:["ID","Payer","Amount","Currency","Status","Receipt"],rows:e.govListPayments.items.map(n=>[d(n.id,12),d(n.payerId,12),String(n.amount),n.currency,n.status,n.receiptNumber??"-"])});}catch(e){r(e);}}),i.command("get").description("Get a payment by id").argument("<id>","Payment ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(et,{id:t});if(!n.govPayment)throw new p(`Payment ${t} not found`);s(e,n.govPayment);}catch(n){r(n);}}),i.command("create").description("Create a payment").requiredOption("--amount <n>","Amount",y).option("--application <id>","Application ID").option("--currency <c>","Currency code").option("--provider-ref <ref>","Payment provider reference").option("--line-items <json>","Line items JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={amount:t.amount};t.application&&(e.applicationId=t.application),t.currency&&(e.currency=t.currency),t.providerRef&&(e.providerRef=t.providerRef),t.lineItems&&(e.lineItems=f("line-items",t.lineItems));let n=await a(it,{input:e});c(`Payment created: ${n.govCreatePayment.amount} ${n.govCreatePayment.currency}`),s(t,n.govCreatePayment);}catch(e){r(e);}}),i.command("mark-paid").description("Mark a payment as paid").argument("<id>","Payment ID").option("--provider-ref <ref>","Payment provider reference").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(ot,{id:t,providerRef:e.providerRef});c(`Payment marked paid (${n.govMarkPaymentPaid.status})`),s(e,n.govMarkPaymentPaid);}catch(n){r(n);}}),i.command("refund").description("Refund a payment").argument("<id>","Payment ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(rt,{id:t});c(`Payment refunded (${n.govRefundPayment.status})`),s(e,n.govRefundPayment);}catch(n){r(n);}});}function lt(o){o.command("health").description("GovCitizenHub service health check (public)").option("-f, --format <format>","Output format").action(async i=>{try{let t=await h(st);c(t.govHealth),s(i,{health:t.govHealth});}catch(t){r(t);}});}var bt={id:"govcitizenhub",version:"1.0.0",displayName:"GovCitizenHub",dependsOn:["auth","workspaces"],register(o,i){k(i);let t=o.command("govcitizenhub").description("GovCitizenHub citizen-government services");at(t),ct(t),pt(t),ut(t),dt(t),gt(t),mt(t),lt(t);}},yn=bt;module.exports=yn;
|
|
282
|
+
`;function f(r,i){try{return JSON.parse(i)}catch{throw new u(`--${r} must be valid JSON`)}}function g(r){let i=Number.parseInt(r,10);if(Number.isNaN(i))throw new u(`Expected an integer but got "${r}"`);return i}function y(r){let i=Number.parseFloat(r);if(Number.isNaN(i))throw new u(`Expected a number but got "${r}"`);return i}function m(r){return r.split(",").map(i=>i.trim()).filter(i=>i.length>0)}function at(r){let i=r.command("agencies").description("GovCitizenHub agencies");i.command("list").description("List agencies").option("--active <bool>","Filter by active state (true|false)",t=>t==="true").option("--limit <n>","Page size",g,50).option("--offset <n>","Offset",g,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(R,{isActive:t.active,pagination:{limit:t.limit,offset:t.offset}});s(t,e.govListAgencies.items,{headers:["ID","Name","Code","Jurisdiction","Active"],rows:e.govListAgencies.items.map(n=>[d(n.id,12),n.name,n.code??"-",n.jurisdiction??"-",n.isActive?"yes":"no"])});}catch(e){o(e);}}),i.command("get").description("Get an agency by id").argument("<id>","Agency ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(k,{id:t});if(!n.govAgency)throw new u(`Agency ${t} not found`);s(e,n.govAgency);}catch(n){o(n);}}),i.command("create").description("Create an agency").requiredOption("--name <name>","Agency name").option("--code <code>","Agency code").option("--description <s>","Description").option("--jurisdiction <s>","Jurisdiction").option("--contact-email <email>","Contact email").option("--contact-phone <phone>","Contact phone").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name};t.code&&(e.code=t.code),t.description&&(e.description=t.description),t.jurisdiction&&(e.jurisdiction=t.jurisdiction),t.contactEmail&&(e.contactEmail=t.contactEmail),t.contactPhone&&(e.contactPhone=t.contactPhone),t.tags&&(e.tags=m(t.tags));let n=await a(S,{input:e});c(`Agency created: ${n.govCreateAgency.name}`),s(t,n.govCreateAgency);}catch(e){o(e);}}),i.command("update").description("Update an agency").argument("<id>","Agency ID").option("--name <name>","Agency name").option("--code <code>","Agency code").option("--description <s>","Description").option("--jurisdiction <s>","Jurisdiction").option("--contact-email <email>","Contact email").option("--contact-phone <phone>","Contact phone").option("--active <bool>","Active state (true|false)",t=>t==="true").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.name&&(n.name=e.name),e.code&&(n.code=e.code),e.description!==void 0&&(n.description=e.description),e.jurisdiction&&(n.jurisdiction=e.jurisdiction),e.contactEmail&&(n.contactEmail=e.contactEmail),e.contactPhone&&(n.contactPhone=e.contactPhone),e.active!==void 0&&(n.isActive=e.active),e.tags&&(n.tags=m(e.tags)),!Object.keys(n).length)throw new u("No updates specified");let v=await a(D,{id:t,input:n});c("Agency updated"),s(e,v.govUpdateAgency);}catch(n){o(n);}}),i.command("archive").description("Archive (soft-delete) an agency").argument("<id>","Agency ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(P,{id:t});c(n.govArchiveAgency?"Agency archived":"Agency not archived"),s(e,{archived:n.govArchiveAgency});}catch(n){o(n);}});}function ct(r){let i=r.command("services").description("GovCitizenHub services");i.command("list").description("List services").option("--agency <id>","Filter by agency ID").option("--category <c>","Filter by service category").option("--status <s>","Filter by service status").option("--limit <n>","Page size",g,50).option("--offset <n>","Offset",g,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a($,{agencyId:t.agency,category:t.category?t.category.toUpperCase():void 0,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});s(t,e.govListServices.items,{headers:["ID","Name","Category","Status","Fee","SLA"],rows:e.govListServices.items.map(n=>[d(n.id,12),n.name,n.category,n.status,`${n.feeType} ${n.feeAmount}`,n.slaDays!=null?String(n.slaDays):"-"])});}catch(e){o(e);}}),i.command("get").description("Get a service by id").argument("<id>","Service ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(O,{id:t});if(!n.govService)throw new u(`Service ${t} not found`);s(e,n.govService);}catch(n){o(n);}}),i.command("create").description("Create a service").requiredOption("--agency <id>","Agency ID").requiredOption("--name <name>","Service name").requiredOption("--slug <slug>","URL slug").option("--category <c>","Service category","OTHER").option("--summary <s>","Summary").option("--eligibility <s>","Eligibility criteria").option("--fee-type <t>","FREE|FIXED|VARIABLE","FREE").option("--fee-amount <n>","Fee amount",y).option("--currency <c>","Currency code").option("--required-documents <csv>","Comma-separated required documents").option("--form-schema <json>","Form schema JSON").option("--sla-days <n>","SLA in days",g).option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={agencyId:t.agency,name:t.name,slug:t.slug,category:(t.category??"OTHER").toUpperCase(),feeType:(t.feeType??"FREE").toUpperCase()};t.summary&&(e.summary=t.summary),t.eligibility&&(e.eligibility=t.eligibility),t.feeAmount!==void 0&&(e.feeAmount=t.feeAmount),t.currency&&(e.currency=t.currency),t.requiredDocuments&&(e.requiredDocuments=m(t.requiredDocuments)),t.formSchema&&(e.formSchema=f("form-schema",t.formSchema)),t.slaDays!==void 0&&(e.slaDays=t.slaDays),t.tags&&(e.tags=m(t.tags));let n=await a(G,{input:e});c(`Service created: ${n.govCreateService.name}`),s(t,n.govCreateService);}catch(e){o(e);}}),i.command("update").description("Update a service").argument("<id>","Service ID").option("--name <name>","Service name").option("--category <c>","Service category").option("--summary <s>","Summary").option("--eligibility <s>","Eligibility criteria").option("--fee-type <t>","FREE|FIXED|VARIABLE").option("--fee-amount <n>","Fee amount",y).option("--currency <c>","Currency code").option("--required-documents <csv>","Comma-separated required documents").option("--form-schema <json>","Form schema JSON").option("--sla-days <n>","SLA in days",g).option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.name&&(n.name=e.name),e.category&&(n.category=e.category.toUpperCase()),e.summary!==void 0&&(n.summary=e.summary),e.eligibility!==void 0&&(n.eligibility=e.eligibility),e.feeType&&(n.feeType=e.feeType.toUpperCase()),e.feeAmount!==void 0&&(n.feeAmount=e.feeAmount),e.currency&&(n.currency=e.currency),e.requiredDocuments&&(n.requiredDocuments=m(e.requiredDocuments)),e.formSchema&&(n.formSchema=f("form-schema",e.formSchema)),e.slaDays!==void 0&&(n.slaDays=e.slaDays),e.tags&&(n.tags=m(e.tags)),!Object.keys(n).length)throw new u("No updates specified");let v=await a(N,{id:t,input:n});c("Service updated"),s(e,v.govUpdateService);}catch(n){o(n);}}),i.command("transition").description("Advance a service through its publication lifecycle").argument("<id>","Service ID").requiredOption("--status <s>","DRAFT|PUBLISHED|SUSPENDED|RETIRED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(L,{id:t,status:e.status.toUpperCase()});c(`Service status set to ${n.govTransitionService.status}`),s(e,n.govTransitionService);}catch(n){o(n);}});}function ut(r){let i=r.command("applications").description("GovCitizenHub applications");i.command("list").description("List applications").option("--citizen <id>","Filter by citizen ID").option("--service <id>","Filter by service ID").option("--assigned-to <id>","Filter by assignee ID").option("--status <s>","Filter by application status").option("--limit <n>","Page size",g,50).option("--offset <n>","Offset",g,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(_,{citizenId:t.citizen,serviceId:t.service,assignedToId:t.assignedTo,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});s(t,e.govListApplications.items,{headers:["ID","Reference","Citizen","Status","Priority","Submitted"],rows:e.govListApplications.items.map(n=>[d(n.id,12),n.reference,d(n.citizenId,12),n.status,n.priority,w(n.submittedAt)])});}catch(e){o(e);}}),i.command("get").description("Get an application by id").argument("<id>","Application ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(q,{id:t});if(!n.govApplication)throw new u(`Application ${t} not found`);s(e,n.govApplication);}catch(n){o(n);}}),i.command("create").description("Create an application").requiredOption("--service <id>","Service ID").option("--reference <ref>","Application reference").option("--priority <p>","LOW|NORMAL|HIGH|URGENT","NORMAL").option("--form-data <json>","Form data JSON").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={serviceId:t.service,priority:(t.priority??"NORMAL").toUpperCase()};t.reference&&(e.reference=t.reference),t.formData&&(e.formData=f("form-data",t.formData)),t.tags&&(e.tags=m(t.tags));let n=await a(U,{input:e});c(`Application created: ${n.govCreateApplication.reference}`),s(t,n.govCreateApplication);}catch(e){o(e);}}),i.command("update").description("Update an application").argument("<id>","Application ID").option("--assigned-to <id>","Assignee ID").option("--priority <p>","LOW|NORMAL|HIGH|URGENT").option("--form-data <json>","Form data JSON").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.assignedTo&&(n.assignedToId=e.assignedTo),e.priority&&(n.priority=e.priority.toUpperCase()),e.formData&&(n.formData=f("form-data",e.formData)),e.tags&&(n.tags=m(e.tags)),!Object.keys(n).length)throw new u("No updates specified");let v=await a(F,{id:t,input:n});c("Application updated"),s(e,v.govUpdateApplication);}catch(n){o(n);}}),i.command("submit").description("Submit a draft application").argument("<id>","Application ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(M,{id:t});c(`Application submitted: ${n.govSubmitApplication.reference}`),s(e,n.govSubmitApplication);}catch(n){o(n);}}),i.command("transition").description("Advance an application through its review lifecycle").argument("<id>","Application ID").requiredOption("--status <s>","DRAFT|SUBMITTED|IN_REVIEW|INFO_REQUESTED|APPROVED|REJECTED|WITHDRAWN").option("--reason <s>","Transition reason").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(j,{id:t,status:e.status.toUpperCase(),reason:e.reason});c(`Application status set to ${n.govTransitionApplication.status}`),s(e,n.govTransitionApplication);}catch(n){o(n);}}),i.command("add-note").description("Add a case note to an application").requiredOption("--application <id>","Application ID").requiredOption("--body <text>","Note body").option("--type <t>","INTERNAL|CITIZEN_MESSAGE|INFO_REQUEST|DECISION","INTERNAL").option("-f, --format <format>","Output format").action(async t=>{try{let e={applicationId:t.application,body:t.body,type:(t.type??"INTERNAL").toUpperCase()},n=await a(V,{input:e});c("Case note added"),s(t,n.govAddCaseNote);}catch(e){o(e);}}),i.command("add-document").description("Attach a document to an application").requiredOption("--application <id>","Application ID").requiredOption("--name <name>","Document name").option("--file <id>","File ID (wspace-files-svc)").option("--requirement <s>","Requirement this document satisfies").option("-f, --format <format>","Output format").action(async t=>{try{let e={applicationId:t.application,name:t.name};t.file&&(e.fileId=t.file),t.requirement&&(e.requirement=t.requirement);let n=await a(W,{input:e});c(`Document added: ${n.govAddDocument.name}`),s(t,n.govAddDocument);}catch(e){o(e);}});}function pt(r){r.command("documents").description("GovCitizenHub application documents").command("review").description("Review (accept/reject) an application document").argument("<id>","Document ID").requiredOption("--status <s>","PENDING|ACCEPTED|REJECTED").option("--rejection-reason <s>","Reason when rejecting").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(H,{id:t,status:e.status.toUpperCase(),rejectionReason:e.rejectionReason});c(`Document ${n.govReviewDocument.status.toLowerCase()}`),s(e,n.govReviewDocument);}catch(n){o(n);}});}function dt(r){let i=r.command("grievances").description("GovCitizenHub grievances");i.command("list").description("List grievances").option("--agency <id>","Filter by agency ID").option("--reporter <id>","Filter by reporter ID").option("--status <s>","Filter by grievance status").option("--limit <n>","Page size",g,50).option("--offset <n>","Offset",g,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(Y,{agencyId:t.agency,reporterId:t.reporter,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});s(t,e.govListGrievances.items,{headers:["ID","Title","Category","Status","Priority","Location"],rows:e.govListGrievances.items.map(n=>[d(n.id,12),n.title,n.category,n.status,n.priority,d(n.location??"-",24)])});}catch(e){o(e);}}),i.command("get").description("Get a grievance by id").argument("<id>","Grievance ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(z,{id:t});if(!n.govGrievance)throw new u(`Grievance ${t} not found`);s(e,n.govGrievance);}catch(n){o(n);}}),i.command("report").description("Report a new grievance").requiredOption("--title <t>","Title").requiredOption("--description <s>","Description").option("--category <c>","Service category","GRIEVANCES").option("--agency <id>","Agency ID").option("--location <s>","Location description").option("--latitude <n>","Latitude",y).option("--longitude <n>","Longitude",y).option("--photo-file-ids <csv>","Comma-separated photo file IDs").option("--priority <p>","LOW|NORMAL|HIGH|URGENT","NORMAL").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={title:t.title,description:t.description,category:(t.category??"GRIEVANCES").toUpperCase(),priority:(t.priority??"NORMAL").toUpperCase()};t.agency&&(e.agencyId=t.agency),t.location&&(e.location=t.location),t.latitude!==void 0&&(e.latitude=t.latitude),t.longitude!==void 0&&(e.longitude=t.longitude),t.photoFileIds&&(e.photoFileIds=m(t.photoFileIds)),t.tags&&(e.tags=m(t.tags));let n=await a(J,{input:e});c(`Grievance reported: ${n.govReportGrievance.title}`),s(t,n.govReportGrievance);}catch(e){o(e);}}),i.command("update").description("Update a grievance").argument("<id>","Grievance ID").option("--agency <id>","Agency ID").option("--assigned-to <id>","Assignee ID").option("--location <s>","Location description").option("--priority <p>","LOW|NORMAL|HIGH|URGENT").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.agency&&(n.agencyId=e.agency),e.assignedTo&&(n.assignedToId=e.assignedTo),e.location!==void 0&&(n.location=e.location),e.priority&&(n.priority=e.priority.toUpperCase()),e.tags&&(n.tags=m(e.tags)),!Object.keys(n).length)throw new u("No updates specified");let v=await a(B,{id:t,input:n});c("Grievance updated"),s(e,v.govUpdateGrievance);}catch(n){o(n);}}),i.command("transition").description("Advance a grievance through its resolution lifecycle").argument("<id>","Grievance ID").requiredOption("--status <s>","OPEN|ACKNOWLEDGED|IN_PROGRESS|RESOLVED|REJECTED|CLOSED").option("--resolution <s>","Resolution note").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(K,{id:t,status:e.status.toUpperCase(),resolution:e.resolution});c(`Grievance status set to ${n.govTransitionGrievance.status}`),s(e,n.govTransitionGrievance);}catch(n){o(n);}});}function gt(r){let i=r.command("permits").description("GovCitizenHub permits");i.command("list").description("List permits").option("--holder <id>","Filter by holder ID").option("--service <id>","Filter by service ID").option("--status <s>","Filter by permit status").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(Q,{holderId:t.holder,serviceId:t.service,status:t.status?t.status.toUpperCase():void 0});s(t,e.govListPermits.items,{headers:["ID","Title","Holder","Status","Code","Expires"],rows:e.govListPermits.items.map(n=>[d(n.id,12),n.title,d(n.holderId,12),n.status,n.verificationCode,w(n.expiresAt)])});}catch(e){o(e);}}),i.command("issue").description("Issue a permit").requiredOption("--holder <id>","Holder user ID").requiredOption("--service <id>","Service ID").requiredOption("--title <t>","Permit title").requiredOption("--verification-code <code>","Printed verification code").option("--application <id>","Originating application ID").option("--expires-at <iso>","Expiry (ISO date)").option("--file <id>","File ID for the generated permit PDF").option("-f, --format <format>","Output format").action(async t=>{try{let e={holderId:t.holder,serviceId:t.service,title:t.title,verificationCode:t.verificationCode};t.application&&(e.applicationId=t.application),t.expiresAt&&(e.expiresAt=t.expiresAt),t.file&&(e.fileId=t.file);let n=await a(X,{input:e});c(`Permit issued: ${n.govIssuePermit.title}`),s(t,n.govIssuePermit);}catch(e){o(e);}}),i.command("revoke").description("Revoke a permit").argument("<id>","Permit ID").option("--reason <s>","Revocation reason").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(Z,{id:t,reason:e.reason});c("Permit revoked"),s(e,n.govRevokePermit);}catch(n){o(n);}}),i.command("verify").description("Verify a permit by its printed code (public)").argument("<code>","Verification code").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await h(tt,{verificationCode:t});if(!n.govVerifyPermit)throw new u(`No permit found for code ${t}`);c(`Valid permit: ${n.govVerifyPermit.title} (${n.govVerifyPermit.status})`),s(e,n.govVerifyPermit);}catch(n){o(n);}});}function mt(r){let i=r.command("payments").description("GovCitizenHub payments");i.command("list").description("List payments").option("--application <id>","Filter by application ID").option("--payer <id>","Filter by payer ID").option("--status <s>","Filter by payment status").option("--limit <n>","Page size",g,50).option("--offset <n>","Offset",g,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(nt,{applicationId:t.application,payerId:t.payer,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});s(t,e.govListPayments.items,{headers:["ID","Payer","Amount","Currency","Status","Receipt"],rows:e.govListPayments.items.map(n=>[d(n.id,12),d(n.payerId,12),String(n.amount),n.currency,n.status,n.receiptNumber??"-"])});}catch(e){o(e);}}),i.command("get").description("Get a payment by id").argument("<id>","Payment ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(et,{id:t});if(!n.govPayment)throw new u(`Payment ${t} not found`);s(e,n.govPayment);}catch(n){o(n);}}),i.command("create").description("Create a payment").requiredOption("--amount <n>","Amount",y).option("--application <id>","Application ID").option("--currency <c>","Currency code").option("--provider-ref <ref>","Payment provider reference").option("--line-items <json>","Line items JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={amount:t.amount};t.application&&(e.applicationId=t.application),t.currency&&(e.currency=t.currency),t.providerRef&&(e.providerRef=t.providerRef),t.lineItems&&(e.lineItems=f("line-items",t.lineItems));let n=await a(it,{input:e});c(`Payment created: ${n.govCreatePayment.amount} ${n.govCreatePayment.currency}`),s(t,n.govCreatePayment);}catch(e){o(e);}}),i.command("mark-paid").description("Mark a payment as paid").argument("<id>","Payment ID").option("--provider-ref <ref>","Payment provider reference").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(rt,{id:t,providerRef:e.providerRef});c(`Payment marked paid (${n.govMarkPaymentPaid.status})`),s(e,n.govMarkPaymentPaid);}catch(n){o(n);}}),i.command("refund").description("Refund a payment").argument("<id>","Payment ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(ot,{id:t});c(`Payment refunded (${n.govRefundPayment.status})`),s(e,n.govRefundPayment);}catch(n){o(n);}});}function lt(r){r.command("health").description("GovCitizenHub service health check (public)").option("-f, --format <format>","Output format").action(async i=>{try{let t=await h(st);c(t.govHealth),s(i,{health:t.govHealth});}catch(t){o(t);}});}var kt={id:"govcitizenhub",version:"1.0.0",displayName:"GovCitizenHub",dependsOn:["auth","workspaces"],register(r,i){x(i);let t=r.command("govcitizenhub").description("GovCitizenHub citizen-government services");at(t),ct(t),ut(t),pt(t),dt(t),gt(t),mt(t),lt(t);}},In=kt;module.exports=In;
|