@burdenoff/cli-sdk 2026.928.1 → 2026.1021.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-IZXPWPKX.js +32 -0
- package/dist/chunk-NLEVVDXR.js +1 -0
- package/dist/core/index.cjs +7 -7
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{module-DxCuik6L.d.cts → module-DOIiVaXQ.d.cts} +4 -1
- package/dist/{module-DxCuik6L.d.ts → module-DOIiVaXQ.d.ts} +4 -1
- package/dist/modules/adaptercloud/index.cjs +2 -2
- package/dist/modules/adaptercloud/index.d.cts +1 -1
- package/dist/modules/adaptercloud/index.d.ts +1 -1
- package/dist/modules/adaptercloud/index.js +1 -1
- package/dist/modules/artistrybase/index.cjs +6 -6
- package/dist/modules/artistrybase/index.d.cts +1 -1
- package/dist/modules/artistrybase/index.d.ts +1 -1
- package/dist/modules/artistrybase/index.js +1 -1
- package/dist/modules/assethandler/index.cjs +2 -2
- package/dist/modules/assethandler/index.d.cts +1 -1
- package/dist/modules/assethandler/index.d.ts +1 -1
- package/dist/modules/assethandler/index.js +1 -1
- package/dist/modules/atheletebridge/index.cjs +4 -4
- package/dist/modules/atheletebridge/index.d.cts +1 -1
- package/dist/modules/atheletebridge/index.d.ts +1 -1
- package/dist/modules/atheletebridge/index.js +1 -1
- package/dist/modules/auth/index.cjs +34 -34
- package/dist/modules/auth/index.d.cts +1 -1
- package/dist/modules/auth/index.d.ts +1 -1
- package/dist/modules/auth/index.js +30 -30
- package/dist/modules/billing/index.cjs +3 -3
- package/dist/modules/billing/index.d.cts +1 -1
- package/dist/modules/billing/index.d.ts +1 -1
- package/dist/modules/billing/index.js +1 -1
- package/dist/modules/brainyrich/index.cjs +4 -4
- package/dist/modules/brainyrich/index.d.cts +1 -1
- package/dist/modules/brainyrich/index.d.ts +1 -1
- package/dist/modules/brainyrich/index.js +1 -1
- package/dist/modules/buildmyiq/index.cjs +3 -3
- package/dist/modules/buildmyiq/index.d.cts +1 -1
- package/dist/modules/buildmyiq/index.d.ts +1 -1
- package/dist/modules/buildmyiq/index.js +1 -1
- package/dist/modules/channels/index.cjs +7 -7
- package/dist/modules/channels/index.d.cts +1 -1
- package/dist/modules/channels/index.d.ts +1 -1
- package/dist/modules/channels/index.js +1 -1
- package/dist/modules/collabkin/index.cjs +11 -11
- package/dist/modules/collabkin/index.d.cts +1 -1
- package/dist/modules/collabkin/index.d.ts +1 -1
- package/dist/modules/collabkin/index.js +1 -1
- package/dist/modules/comradecircle/index.cjs +5 -5
- package/dist/modules/comradecircle/index.d.cts +1 -1
- package/dist/modules/comradecircle/index.d.ts +1 -1
- package/dist/modules/comradecircle/index.js +1 -1
- package/dist/modules/conversations/index.cjs +8 -8
- package/dist/modules/conversations/index.d.cts +1 -1
- package/dist/modules/conversations/index.d.ts +1 -1
- package/dist/modules/conversations/index.js +1 -1
- package/dist/modules/coolandlovely/index.cjs +4 -4
- package/dist/modules/coolandlovely/index.d.cts +1 -1
- package/dist/modules/coolandlovely/index.d.ts +1 -1
- package/dist/modules/coolandlovely/index.js +1 -1
- package/dist/modules/cosmicintersection/index.cjs +4 -4
- package/dist/modules/cosmicintersection/index.d.cts +1 -1
- package/dist/modules/cosmicintersection/index.d.ts +1 -1
- package/dist/modules/cosmicintersection/index.js +1 -1
- package/dist/modules/crewfoundry/index.cjs +4 -4
- package/dist/modules/crewfoundry/index.d.cts +1 -1
- package/dist/modules/crewfoundry/index.d.ts +1 -1
- package/dist/modules/crewfoundry/index.js +1 -1
- package/dist/modules/devportal/index.cjs +5 -5
- package/dist/modules/devportal/index.d.cts +1 -1
- package/dist/modules/devportal/index.d.ts +1 -1
- package/dist/modules/devportal/index.js +1 -1
- package/dist/modules/ecoimpacthub/index.cjs +2 -2
- package/dist/modules/ecoimpacthub/index.d.cts +1 -1
- package/dist/modules/ecoimpacthub/index.d.ts +1 -1
- package/dist/modules/ecoimpacthub/index.js +1 -1
- package/dist/modules/eventfullymanaged/index.cjs +21 -21
- package/dist/modules/eventfullymanaged/index.d.cts +1 -1
- package/dist/modules/eventfullymanaged/index.d.ts +1 -1
- package/dist/modules/eventfullymanaged/index.js +1 -1
- package/dist/modules/export/index.cjs +3 -3
- package/dist/modules/export/index.d.cts +1 -1
- package/dist/modules/export/index.d.ts +1 -1
- package/dist/modules/export/index.js +1 -1
- package/dist/modules/files/index.cjs +9 -9
- package/dist/modules/files/index.d.cts +1 -1
- package/dist/modules/files/index.d.ts +1 -1
- package/dist/modules/files/index.js +1 -1
- package/dist/modules/fluidgrids/index.cjs +401 -0
- package/dist/modules/fluidgrids/index.d.cts +7 -0
- package/dist/modules/fluidgrids/index.d.ts +7 -0
- package/dist/modules/fluidgrids/index.js +401 -0
- package/dist/modules/ggnomad/index.cjs +5 -5
- package/dist/modules/ggnomad/index.d.cts +1 -1
- package/dist/modules/ggnomad/index.d.ts +1 -1
- package/dist/modules/ggnomad/index.js +1 -1
- package/dist/modules/govcitizenhub/index.cjs +4 -4
- package/dist/modules/govcitizenhub/index.d.cts +1 -1
- package/dist/modules/govcitizenhub/index.d.ts +1 -1
- package/dist/modules/govcitizenhub/index.js +1 -1
- package/dist/modules/groups/index.cjs +4 -4
- package/dist/modules/groups/index.d.cts +1 -1
- package/dist/modules/groups/index.d.ts +1 -1
- package/dist/modules/groups/index.js +1 -1
- package/dist/modules/headshotmarketing/index.cjs +1 -1
- package/dist/modules/headshotmarketing/index.d.cts +1 -1
- package/dist/modules/headshotmarketing/index.d.ts +1 -1
- package/dist/modules/headshotmarketing/index.js +1 -1
- package/dist/modules/health/index.d.cts +1 -1
- package/dist/modules/health/index.d.ts +1 -1
- package/dist/modules/hookmovies/index.cjs +7 -7
- package/dist/modules/hookmovies/index.d.cts +1 -1
- package/dist/modules/hookmovies/index.d.ts +1 -1
- package/dist/modules/hookmovies/index.js +1 -1
- package/dist/modules/housingvista/index.cjs +7 -7
- package/dist/modules/housingvista/index.d.cts +1 -1
- package/dist/modules/housingvista/index.d.ts +1 -1
- package/dist/modules/housingvista/index.js +1 -1
- package/dist/modules/integrations/index.cjs +5 -5
- package/dist/modules/integrations/index.d.cts +1 -1
- package/dist/modules/integrations/index.d.ts +1 -1
- package/dist/modules/integrations/index.js +1 -1
- package/dist/modules/intelwatchtower/index.cjs +4 -4
- package/dist/modules/intelwatchtower/index.d.cts +1 -1
- package/dist/modules/intelwatchtower/index.d.ts +1 -1
- package/dist/modules/intelwatchtower/index.js +1 -1
- package/dist/modules/kadaikodi/index.cjs +2 -2
- package/dist/modules/kadaikodi/index.d.cts +1 -1
- package/dist/modules/kadaikodi/index.d.ts +1 -1
- package/dist/modules/kadaikodi/index.js +1 -1
- package/dist/modules/labsofscience/index.cjs +4 -4
- package/dist/modules/labsofscience/index.d.cts +1 -1
- package/dist/modules/labsofscience/index.d.ts +1 -1
- package/dist/modules/labsofscience/index.js +1 -1
- package/dist/modules/manufacturedops/index.cjs +6 -6
- package/dist/modules/manufacturedops/index.d.cts +1 -1
- package/dist/modules/manufacturedops/index.d.ts +1 -1
- package/dist/modules/manufacturedops/index.js +1 -1
- package/dist/modules/movethewheels/index.cjs +1 -1
- package/dist/modules/movethewheels/index.d.cts +1 -1
- package/dist/modules/movethewheels/index.d.ts +1 -1
- package/dist/modules/movethewheels/index.js +1 -1
- package/dist/modules/mybodyshield/index.cjs +6 -6
- package/dist/modules/mybodyshield/index.d.cts +1 -1
- package/dist/modules/mybodyshield/index.d.ts +1 -1
- package/dist/modules/mybodyshield/index.js +1 -1
- package/dist/modules/notifications/index.cjs +5 -5
- package/dist/modules/notifications/index.d.cts +1 -1
- package/dist/modules/notifications/index.d.ts +1 -1
- package/dist/modules/notifications/index.js +1 -1
- package/dist/modules/organizations/index.d.cts +1 -1
- package/dist/modules/organizations/index.d.ts +1 -1
- package/dist/modules/organizations/index.js +1 -1
- package/dist/modules/planmagnet/index.cjs +23 -23
- package/dist/modules/planmagnet/index.d.cts +1 -1
- package/dist/modules/planmagnet/index.d.ts +1 -1
- package/dist/modules/planmagnet/index.js +1 -1
- package/dist/modules/products/index.cjs +4 -4
- package/dist/modules/products/index.d.cts +1 -1
- package/dist/modules/products/index.d.ts +1 -1
- package/dist/modules/products/index.js +1 -1
- package/dist/modules/proserviceworld/index.cjs +2 -2
- package/dist/modules/proserviceworld/index.d.cts +1 -1
- package/dist/modules/proserviceworld/index.d.ts +1 -1
- package/dist/modules/proserviceworld/index.js +1 -1
- package/dist/modules/rbac/index.cjs +2 -2
- package/dist/modules/rbac/index.d.cts +1 -1
- package/dist/modules/rbac/index.d.ts +1 -1
- package/dist/modules/rbac/index.js +1 -1
- package/dist/modules/sandbox/index.cjs +4 -4
- package/dist/modules/sandbox/index.d.cts +1 -1
- package/dist/modules/sandbox/index.d.ts +1 -1
- package/dist/modules/sandbox/index.js +1 -1
- package/dist/modules/scheduler/index.cjs +5 -5
- package/dist/modules/scheduler/index.d.cts +1 -1
- package/dist/modules/scheduler/index.d.ts +1 -1
- package/dist/modules/scheduler/index.js +1 -1
- package/dist/modules/security/index.cjs +7 -7
- package/dist/modules/security/index.d.cts +1 -1
- package/dist/modules/security/index.d.ts +1 -1
- package/dist/modules/security/index.js +1 -1
- package/dist/modules/semanticfed/index.cjs +7 -7
- package/dist/modules/semanticfed/index.d.cts +1 -1
- package/dist/modules/semanticfed/index.d.ts +1 -1
- package/dist/modules/semanticfed/index.js +1 -1
- package/dist/modules/store/index.cjs +7 -7
- package/dist/modules/store/index.d.cts +1 -1
- package/dist/modules/store/index.d.ts +1 -1
- package/dist/modules/store/index.js +1 -1
- package/dist/modules/subscriberbot/index.cjs +2 -2
- package/dist/modules/subscriberbot/index.d.cts +1 -1
- package/dist/modules/subscriberbot/index.d.ts +1 -1
- package/dist/modules/subscriberbot/index.js +1 -1
- package/dist/modules/support/index.cjs +2 -2
- package/dist/modules/support/index.d.cts +1 -1
- package/dist/modules/support/index.d.ts +1 -1
- package/dist/modules/support/index.js +1 -1
- package/dist/modules/tags/index.cjs +2 -2
- package/dist/modules/tags/index.d.cts +1 -1
- package/dist/modules/tags/index.d.ts +1 -1
- package/dist/modules/tags/index.js +1 -1
- package/dist/modules/technospam/index.cjs +4 -4
- package/dist/modules/technospam/index.d.cts +1 -1
- package/dist/modules/technospam/index.d.ts +1 -1
- package/dist/modules/technospam/index.js +1 -1
- package/dist/modules/theculturepost/index.cjs +3 -3
- package/dist/modules/theculturepost/index.d.cts +1 -1
- package/dist/modules/theculturepost/index.d.ts +1 -1
- package/dist/modules/theculturepost/index.js +1 -1
- package/dist/modules/theglobalfuel/index.cjs +3 -3
- package/dist/modules/theglobalfuel/index.d.cts +1 -1
- package/dist/modules/theglobalfuel/index.d.ts +1 -1
- package/dist/modules/theglobalfuel/index.js +1 -1
- package/dist/modules/timecampus/index.cjs +7 -7
- package/dist/modules/timecampus/index.d.cts +1 -1
- package/dist/modules/timecampus/index.d.ts +1 -1
- package/dist/modules/timecampus/index.js +1 -1
- package/dist/modules/tours/index.cjs +2 -2
- package/dist/modules/tours/index.d.cts +1 -1
- package/dist/modules/tours/index.d.ts +1 -1
- package/dist/modules/tours/index.js +1 -1
- package/dist/modules/vibecontrols/index.cjs +1 -1
- package/dist/modules/vibecontrols/index.d.cts +1 -1
- package/dist/modules/vibecontrols/index.d.ts +1 -1
- package/dist/modules/vibecontrols/index.js +1 -1
- package/dist/modules/workspaces/index.cjs +15 -15
- package/dist/modules/workspaces/index.d.cts +1 -1
- package/dist/modules/workspaces/index.d.ts +1 -1
- package/dist/modules/workspaces/index.js +11 -11
- package/package.json +1 -1
- package/dist/chunk-TCBALVP4.js +0 -32
- package/dist/chunk-WXDQ3S5J.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var l=class extends Error{exitCode;hint;constructor(r,t){super(r),this.name="CliUserError",this.exitCode=t?.exitCode??1,this.hint=t?.hint;}},I=class extends l{constructor(r,t){super(r,{exitCode:2,hint:t?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},C=class extends Error{cause;constructor(r,t){super(r),this.name="CliInternalError",this.cause=t;}};var h=null;function A(o){h=o;}function y(){if(!h)throw new C("vibecontrols module helpers used before setHelpersContext was called");return h}function $t(){let o=y();if(!o.auth.isAuthenticated())throw new I(
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var l=class extends Error{exitCode;hint;constructor(r,t){super(r),this.name="CliUserError",this.exitCode=t?.exitCode??1,this.hint=t?.hint;}},I=class extends l{constructor(r,t){super(r,{exitCode:2,hint:t?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},C=class extends Error{cause;constructor(r,t){super(r),this.name="CliInternalError",this.cause=t;}};var h=null;function A(o){h=o;}function y(){if(!h)throw new C("vibecontrols module helpers used before setHelpersContext was called");return h}function $t(){let o=y();if(!o.auth.isAuthenticated())throw new I("Authentication required.",{hint:`Run \`${o.productName} auth login\` to authenticate.`})}async function a(o,r){return $t(),y().gql.workspace.request(o,r)}async function O(o,r){return y().gql.workspaceAuthOnly.request(o,r)}function i(o){let r=o instanceof Error?o.message:String(o);throw new l(r)}function s(o,r,t){y().output.formatAndOutput(o,r,t);}function c(o){y().output.printSuccess(o);}function E(o){return y().output.formatDate(o)}function d(o,r){return y().output.truncate(o,r)}var R=`
|
|
2
2
|
query EcoSite($id: ID!) {
|
|
3
3
|
ecoSite(id: $id) {
|
|
4
4
|
id name code description type status country region latitude longitude
|
|
@@ -302,4 +302,4 @@
|
|
|
302
302
|
query EcoHealth {
|
|
303
303
|
ecoHealth
|
|
304
304
|
}
|
|
305
|
-
`;function m(o){let r=Number.parseInt(o,10);if(Number.isNaN(r))throw new l(`Expected an integer but got "${o}"`);return r}function u(o){let r=Number.parseFloat(o);if(Number.isNaN(r))throw new l(`Expected a number but got "${o}"`);return r}function g(o){let r={};return o.limit!==void 0&&(r.limit=o.limit),o.offset!==void 0&&(r.offset=o.offset),Object.keys(r).length?r:void 0}function mt(o){let r=o.command("sites").description("EcoImpactHub monitored sites");r.command("list").description("List sites").option("--status <s>","ACTIVE|ARCHIVED|MONITORING_PAUSED").option("--type <t>","FACILITY|FOREST|WETLAND|...").option("--limit <n>","Page size",m,50).option("--offset <n>","Offset",m,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(w,{status:t.status?t.status.toUpperCase():void 0,type:t.type?t.type.toUpperCase():void 0,pagination:g(t)});s(t,e.ecoListSites.items,{headers:["ID","Name","Type","Status","Country","Hectares"],rows:e.ecoListSites.items.map(n=>[d(n.id,12),n.name,n.type,n.status,n.country??"-",n.areaHectares!=null?String(n.areaHectares):"-"])});}catch(e){i(e);}}),r.command("get").description("Get a site by id").argument("<id>","Site ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(R,{id:t});if(!n.ecoSite)throw new l(`Site ${t} not found`);s(e,n.ecoSite);}catch(n){i(n);}}),r.command("create").description("Create a site").requiredOption("--name <name>","Site name").option("--code <code>","Site code").option("--description <s>","Description").option("--type <t>","Site type","FACILITY").option("--status <s>","Site status","ACTIVE").option("--country <c>","Country").option("--region <r>","Region").option("--latitude <n>","Latitude",u).option("--longitude <n>","Longitude",u).option("--area-hectares <n>","Area (hectares)",u).option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,type:(t.type??"FACILITY").toUpperCase(),status:(t.status??"ACTIVE").toUpperCase()};t.code&&(e.code=t.code),t.description&&(e.description=t.description),t.country&&(e.country=t.country),t.region&&(e.region=t.region),t.latitude!==void 0&&(e.latitude=t.latitude),t.longitude!==void 0&&(e.longitude=t.longitude),t.areaHectares!==void 0&&(e.areaHectares=t.areaHectares);let n=await a(v,{input:e});c(`Site created: ${n.ecoCreateSite.name}`),s(t,n.ecoCreateSite);}catch(e){i(e);}}),r.command("update").description("Update a site").argument("<id>","Site ID").option("--name <name>","Site name").option("--code <code>","Site code").option("--description <s>","Description").option("--type <t>","Site type").option("--status <s>","Site status").option("--country <c>","Country").option("--region <r>","Region").option("--latitude <n>","Latitude",u).option("--longitude <n>","Longitude",u).option("--area-hectares <n>","Area (hectares)",u).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.type&&(n.type=e.type.toUpperCase()),e.status&&(n.status=e.status.toUpperCase()),e.country&&(n.country=e.country),e.region&&(n.region=e.region),e.latitude!==void 0&&(n.latitude=e.latitude),e.longitude!==void 0&&(n.longitude=e.longitude),e.areaHectares!==void 0&&(n.areaHectares=e.areaHectares),!Object.keys(n).length)throw new l("No updates specified");let S=await a(k,{id:t,input:n});c("Site updated"),s(e,S.ecoUpdateSite);}catch(n){i(n);}}),r.command("archive").description("Archive a site").argument("<id>","Site ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(_,{id:t});c(n.ecoArchiveSite?"Site archived":"Site not archived"),s(e,{archived:n.ecoArchiveSite});}catch(n){i(n);}});}function lt(o){let r=o.command("sensors").description("EcoImpactHub site sensors");r.command("list").description("List sensors").option("--site <id>","Filter by site ID").option("--kind <k>","WATER_QUALITY|AIR_QUALITY|SOIL|...").option("--status <s>","ONLINE|OFFLINE|DEGRADED|MAINTENANCE|RETIRED").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(x,{siteId:t.site,kind:t.kind?t.kind.toUpperCase():void 0,status:t.status?t.status.toUpperCase():void 0});s(t,e.ecoListSensors,{headers:["ID","Name","Kind","Status","Unit","Last Reading"],rows:e.ecoListSensors.map(n=>[d(n.id,12),n.name,n.kind,n.status,n.unit??"-",E(n.lastReadingAt)])});}catch(e){i(e);}}),r.command("create").description("Create a sensor").requiredOption("--site <id>","Site ID").requiredOption("--name <name>","Sensor name").option("--kind <k>","Sensor kind","MANUAL").option("--status <s>","Sensor status","ONLINE").option("--unit <u>","Measurement unit").option("--hardware-id <id>","Hardware ID").option("--installed-at <iso>","Install date (ISO)").option("-f, --format <format>","Output format").action(async t=>{try{let e={siteId:t.site,name:t.name,kind:(t.kind??"MANUAL").toUpperCase(),status:(t.status??"ONLINE").toUpperCase()};t.unit&&(e.unit=t.unit),t.hardwareId&&(e.hardwareId=t.hardwareId),t.installedAt&&(e.installedAt=t.installedAt);let n=await a(D,{input:e});c(`Sensor created: ${n.ecoCreateSensor.name}`),s(t,n.ecoCreateSensor);}catch(e){i(e);}}),r.command("set-status").description("Update a sensor's operational status").argument("<id>","Sensor ID").requiredOption("--status <s>","ONLINE|OFFLINE|DEGRADED|MAINTENANCE|RETIRED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(L,{id:t,status:e.status.toUpperCase()});c(`Sensor status set to ${n.ecoSetSensorStatus.status}`),s(e,n.ecoSetSensorStatus);}catch(n){i(n);}});}function gt(o){let r=o.command("thresholds").description("EcoImpactHub alert thresholds");r.command("list").description("List alert thresholds").option("--site <id>","Filter by site ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a($,{siteId:t.site});s(t,e.ecoListThresholds,{headers:["ID","Parameter","Unit","Direction","Severity","Active"],rows:e.ecoListThresholds.map(n=>[d(n.id,12),n.parameter,n.unit,n.direction,n.severity,n.isActive?"yes":"no"])});}catch(e){i(e);}}),r.command("create").description("Create an alert threshold").requiredOption("--site <id>","Site ID").requiredOption("--parameter <p>","Measured parameter").requiredOption("--unit <u>","Unit").option("--direction <d>","ABOVE|BELOW|OUTSIDE_RANGE","ABOVE").option("--severity <s>","INFO|WARNING|CRITICAL","WARNING").option("--min-value <n>","Minimum value",u).option("--max-value <n>","Maximum value",u).option("--limit-value <n>","Limit value",u).option("-f, --format <format>","Output format").action(async t=>{try{let e={siteId:t.site,parameter:t.parameter,unit:t.unit,direction:(t.direction??"ABOVE").toUpperCase(),severity:(t.severity??"WARNING").toUpperCase()};t.minValue!==void 0&&(e.minValue=t.minValue),t.maxValue!==void 0&&(e.maxValue=t.maxValue),t.limitValue!==void 0&&(e.limitValue=t.limitValue);let n=await a(P,{input:e});c(`Threshold created for ${n.ecoCreateThreshold.parameter}`),s(t,n.ecoCreateThreshold);}catch(e){i(e);}}),r.command("set-active").description("Activate or deactivate a threshold").argument("<id>","Threshold ID").requiredOption("--active <bool>","true|false",t=>t==="true").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(N,{id:t,isActive:e.active});c(n.ecoSetThresholdActive.isActive?"Threshold activated":"Threshold disabled"),s(e,n.ecoSetThresholdActive);}catch(n){i(n);}});}function ft(o){let r=o.command("measurements").description("EcoImpactHub sensor measurements");r.command("list").description("List measurements").option("--site <id>","Filter by site ID").option("--sensor <id>","Filter by sensor ID").option("--parameter <p>","Filter by parameter").option("--breaches-only","Only threshold breaches").option("--limit <n>","Page size",m,50).option("--offset <n>","Offset",m,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(H,{siteId:t.site,sensorId:t.sensor,parameter:t.parameter,breachesOnly:t.breachesOnly?!0:void 0,pagination:g(t)});s(t,e.ecoListMeasurements.items,{headers:["ID","Parameter","Value","Unit","Source","Breach","Recorded"],rows:e.ecoListMeasurements.items.map(n=>[d(n.id,12),n.parameter,String(n.value),n.unit,n.source,n.isBreach?"yes":"no",E(n.recordedAt)])});}catch(e){i(e);}}),r.command("record").description("Record a measurement").requiredOption("--site <id>","Site ID").requiredOption("--parameter <p>","Measured parameter").requiredOption("--value <n>","Measured value",u).requiredOption("--unit <u>","Unit").requiredOption("--recorded-at <iso>","Recorded-at timestamp (ISO)").option("--sensor <id>","Sensor ID").option("--source <s>","SENSOR|MANUAL|IMPORT|SATELLITE|CALCULATED","SENSOR").option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async t=>{try{let e={siteId:t.site,parameter:t.parameter,value:t.value,unit:t.unit,recordedAt:t.recordedAt,source:(t.source??"SENSOR").toUpperCase()};t.sensor&&(e.sensorId=t.sensor),t.notes&&(e.notes=t.notes);let n=await a(q,{input:e});c(n.ecoRecordMeasurement.isBreach?"Measurement recorded (threshold breach!)":"Measurement recorded"),s(t,n.ecoRecordMeasurement);}catch(e){i(e);}});}function Et(o){let r=o.command("species").description("EcoImpactHub tracked species");r.command("list").description("List species").option("--taxon-group <g>","MAMMAL|BIRD|REPTILE|...").option("--conservation-status <s>","LEAST_CONCERN|ENDANGERED|...").option("--priority-only","Only priority species").option("--limit <n>","Page size",m,50).option("--offset <n>","Offset",m,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(M,{taxonGroup:t.taxonGroup?t.taxonGroup.toUpperCase():void 0,conservationStatus:t.conservationStatus?t.conservationStatus.toUpperCase():void 0,priorityOnly:t.priorityOnly?!0:void 0,pagination:g(t)});s(t,e.ecoListSpecies.items,{headers:["ID","Common Name","Scientific","Taxon","Status","Priority"],rows:e.ecoListSpecies.items.map(n=>[d(n.id,12),n.commonName,n.scientificName??"-",n.taxonGroup,n.conservationStatus,n.isPriority?"yes":"no"])});}catch(e){i(e);}}),r.command("get").description("Get a species by id").argument("<id>","Species ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(U,{id:t});if(!n.ecoSpecies)throw new l(`Species ${t} not found`);s(e,n.ecoSpecies);}catch(n){i(n);}}),r.command("create").description("Create a species record").requiredOption("--common-name <name>","Common name").option("--scientific-name <name>","Scientific name").option("--taxon-group <g>","Taxon group","OTHER").option("--conservation-status <s>","Conservation status","NOT_EVALUATED").option("--priority","Mark as priority species").option("--description <s>","Description").option("-f, --format <format>","Output format").action(async t=>{try{let e={commonName:t.commonName,taxonGroup:(t.taxonGroup??"OTHER").toUpperCase(),conservationStatus:(t.conservationStatus??"NOT_EVALUATED").toUpperCase(),isPriority:t.priority??!1};t.scientificName&&(e.scientificName=t.scientificName),t.description&&(e.description=t.description);let n=await a(V,{input:e});c(`Species created: ${n.ecoCreateSpecies.commonName}`),s(t,n.ecoCreateSpecies);}catch(e){i(e);}}),r.command("update").description("Update a species record").argument("<id>","Species ID").option("--common-name <name>","Common name").option("--scientific-name <name>","Scientific name").option("--taxon-group <g>","Taxon group").option("--conservation-status <s>","Conservation status").option("--priority <bool>","true|false",t=>t==="true").option("--description <s>","Description").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.commonName&&(n.commonName=e.commonName),e.scientificName&&(n.scientificName=e.scientificName),e.taxonGroup&&(n.taxonGroup=e.taxonGroup.toUpperCase()),e.conservationStatus&&(n.conservationStatus=e.conservationStatus.toUpperCase()),e.priority!==void 0&&(n.isPriority=e.priority),e.description!==void 0&&(n.description=e.description),!Object.keys(n).length)throw new l("No updates specified");let S=await a(F,{id:t,input:n});c("Species updated"),s(e,S.ecoUpdateSpecies);}catch(n){i(n);}}),r.command("archive").description("Archive a species record").argument("<id>","Species ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(G,{id:t});c(n.ecoArchiveSpecies?"Species archived":"Species not archived"),s(e,{archived:n.ecoArchiveSpecies});}catch(n){i(n);}});}function Ct(o){let r=o.command("observations").description("EcoImpactHub species observations");r.command("list").description("List observations").option("--species <id>","Filter by species ID").option("--site <id>","Filter by site ID").option("--limit <n>","Page size",m,50).option("--offset <n>","Offset",m,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(j,{speciesId:t.species,siteId:t.site,pagination:g(t)});s(t,e.ecoListObservations.items,{headers:["ID","Species","Site","Method","Count","Observed"],rows:e.ecoListObservations.items.map(n=>[d(n.id,12),d(n.speciesId,12),n.siteId?d(n.siteId,12):"-",n.method,String(n.count),E(n.observedAt)])});}catch(e){i(e);}}),r.command("record").description("Record a species observation").requiredOption("--species <id>","Species ID").requiredOption("--observed-at <iso>","Observed-at timestamp (ISO)").option("--site <id>","Site ID").option("--method <m>","DIRECT_SIGHTING|CAMERA_TRAP|ACOUSTIC|...","DIRECT_SIGHTING").option("--count <n>","Individual count",m).option("--latitude <n>","Latitude",u).option("--longitude <n>","Longitude",u).option("--evidence-file <id>","Evidence file ID").option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async t=>{try{let e={speciesId:t.species,observedAt:t.observedAt,method:(t.method??"DIRECT_SIGHTING").toUpperCase()};t.site&&(e.siteId=t.site),t.count!==void 0&&(e.count=t.count),t.latitude!==void 0&&(e.latitude=t.latitude),t.longitude!==void 0&&(e.longitude=t.longitude),t.evidenceFile&&(e.evidenceFileId=t.evidenceFile),t.notes&&(e.notes=t.notes);let n=await a(W,{input:e});c("Observation recorded"),s(t,n.ecoRecordObservation);}catch(e){i(e);}});}function yt(o){let r=o.command("habitat").description("EcoImpactHub habitat projects & restoration activities");r.command("list").description("List habitat projects").option("--status <s>","PLANNED|IN_PROGRESS|MONITORING|...").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(Y,{status:t.status?t.status.toUpperCase():void 0});s(t,e.ecoListHabitatProjects,{headers:["ID","Name","Status","Target Ha","Budget","Currency"],rows:e.ecoListHabitatProjects.map(n=>[d(n.id,12),n.name,n.status,n.targetHectares!=null?String(n.targetHectares):"-",n.budgetAmount!=null?String(n.budgetAmount):"-",n.currency??"-"])});}catch(e){i(e);}}),r.command("get").description("Get a habitat project by id").argument("<id>","Project ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(B,{id:t});if(!n.ecoHabitatProject)throw new l(`Habitat project ${t} not found`);s(e,n.ecoHabitatProject);}catch(n){i(n);}}),r.command("create").description("Create a habitat project").requiredOption("--name <name>","Project name").option("--description <s>","Description").option("--site <id>","Site ID").option("--manager <id>","Manager user ID").option("--target-hectares <n>","Target hectares",u).option("--budget-amount <n>","Budget amount",u).option("--currency <c>","Currency code").option("--start-date <iso>","Start date (ISO)").option("--end-date <iso>","End date (ISO)").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name};t.description&&(e.description=t.description),t.site&&(e.siteId=t.site),t.manager&&(e.managerId=t.manager),t.targetHectares!==void 0&&(e.targetHectares=t.targetHectares),t.budgetAmount!==void 0&&(e.budgetAmount=t.budgetAmount),t.currency&&(e.currency=t.currency),t.startDate&&(e.startDate=t.startDate),t.endDate&&(e.endDate=t.endDate);let n=await a(K,{input:e});c(`Habitat project created: ${n.ecoCreateHabitatProject.name}`),s(t,n.ecoCreateHabitatProject);}catch(e){i(e);}}),r.command("transition").description("Advance a habitat project through its lifecycle").argument("<id>","Project ID").requiredOption("--status <s>","PLANNED|IN_PROGRESS|MONITORING|COMPLETED|ON_HOLD|CANCELLED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(z,{id:t,status:e.status.toUpperCase()});c(`Project status set to ${n.ecoTransitionHabitatProject.status}`),s(e,n.ecoTransitionHabitatProject);}catch(n){i(n);}}),r.command("log-activity").description("Log a restoration activity against a project").requiredOption("--project <id>","Project ID").requiredOption("--summary <s>","Activity summary").requiredOption("--performed-at <iso>","Performed-at timestamp (ISO)").option("--type <t>","PLANTING|INVASIVE_REMOVAL|REWILDING|...","PLANTING").option("--details <s>","Details").option("--quantity <n>","Quantity",u).option("--unit <u>","Unit").option("-f, --format <format>","Output format").action(async t=>{try{let e={projectId:t.project,summary:t.summary,performedAt:t.performedAt,type:(t.type??"PLANTING").toUpperCase()};t.details&&(e.details=t.details),t.quantity!==void 0&&(e.quantity=t.quantity),t.unit&&(e.unit=t.unit);let n=await a(J,{input:e});c("Restoration activity logged"),s(t,n.ecoLogRestorationActivity);}catch(e){i(e);}});}function It(o){let r=o.command("carbon").description("EcoImpactHub carbon ledger & emission factors");r.command("list").description("List carbon ledger entries").option("--scope <s>","SCOPE_1|SCOPE_2|SCOPE_3").option("--site <id>","Filter by site ID").option("--status <s>","DRAFT|RECORDED|VERIFIED|ADJUSTED").option("--limit <n>","Page size",m,50).option("--offset <n>","Offset",m,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(Q,{scope:t.scope?t.scope.toUpperCase():void 0,siteId:t.site,status:t.status?t.status.toUpperCase():void 0,pagination:g(t)});s(t,e.ecoListCarbonEntries.items,{headers:["ID","Category","Scope","Activity","CO2e kg","Status"],rows:e.ecoListCarbonEntries.items.map(n=>[d(n.id,12),n.category,n.scope,`${n.activityValue} ${n.activityUnit}`,String(n.co2eKg),n.status])});}catch(e){i(e);}}),r.command("total").description("Total CO2e (kg) recorded in the workspace").option("--scope <s>","SCOPE_1|SCOPE_2|SCOPE_3").option("--site <id>","Filter by site ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(X,{scope:t.scope?t.scope.toUpperCase():void 0,siteId:t.site});c(`Total CO2e: ${e.ecoCarbonTotalKg} kg`),s(t,{totalCo2eKg:e.ecoCarbonTotalKg});}catch(e){i(e);}}),r.command("record").description("Record a carbon ledger entry").requiredOption("--category <c>","Category").requiredOption("--activity-value <n>","Activity value",u).requiredOption("--activity-unit <u>","Activity unit").requiredOption("--period-start <iso>","Period start (ISO)").option("--scope <s>","SCOPE_1|SCOPE_2|SCOPE_3","SCOPE_1").option("--factor <id>","Emission factor ID").option("--site <id>","Site ID").option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async t=>{try{let e={category:t.category,activityValue:t.activityValue,activityUnit:t.activityUnit,periodStart:t.periodStart,scope:(t.scope??"SCOPE_1").toUpperCase()};t.factor&&(e.factorId=t.factor),t.site&&(e.siteId=t.site),t.notes&&(e.notes=t.notes);let n=await a(Z,{input:e});c(`Carbon entry recorded: ${n.ecoRecordCarbonEntry.co2eKg} kg CO2e`),s(t,n.ecoRecordCarbonEntry);}catch(e){i(e);}}),r.command("verify").description("Verify a carbon ledger entry").argument("<id>","Carbon entry ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(tt,{id:t});c(`Carbon entry ${n.ecoVerifyCarbonEntry.status}`),s(e,n.ecoVerifyCarbonEntry);}catch(n){i(n);}}),r.command("list-factors").description("List emission factors").option("--scope <s>","SCOPE_1|SCOPE_2|SCOPE_3").option("--active-only","Only active factors").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(et,{scope:t.scope?t.scope.toUpperCase():void 0,activeOnly:t.activeOnly?!0:void 0});s(t,e.ecoListEmissionFactors,{headers:["ID","Name","Scope","Unit","kgCO2e","Year","Active"],rows:e.ecoListEmissionFactors.map(n=>[d(n.id,12),n.name,n.scope,n.activityUnit,String(n.factorKgco2e),n.validYear!=null?String(n.validYear):"-",n.isActive?"yes":"no"])});}catch(e){i(e);}}),r.command("create-factor").description("Create an emission factor").requiredOption("--name <name>","Factor name").requiredOption("--activity-unit <u>","Activity unit").requiredOption("--factor-kgco2e <n>","kg CO2e per unit",u).option("--scope <s>","SCOPE_1|SCOPE_2|SCOPE_3","SCOPE_1").option("--source <s>","Source").option("--valid-year <n>","Valid year",m).option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,activityUnit:t.activityUnit,factorKgco2e:t.factorKgco2e,scope:(t.scope??"SCOPE_1").toUpperCase()};t.source&&(e.source=t.source),t.validYear!==void 0&&(e.validYear=t.validYear);let n=await a(nt,{input:e});c(`Emission factor created: ${n.ecoCreateEmissionFactor.name}`),s(t,n.ecoCreateEmissionFactor);}catch(e){i(e);}});}function St(o){let r=o.command("targets").description("EcoImpactHub reduction targets");r.command("list").description("List reduction targets").option("--status <s>","PROPOSED|ACTIVE|ACHIEVED|MISSED|RETIRED").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(rt,{status:t.status?t.status.toUpperCase():void 0});s(t,e.ecoListReductionTargets,{headers:["ID","Name","Metric","Baseline","Target","Status"],rows:e.ecoListReductionTargets.map(n=>[d(n.id,12),n.name,n.metric,`${n.baselineValue} (${n.baselineYear})`,`${n.targetValue} (${n.targetYear})`,n.status])});}catch(e){i(e);}}),r.command("create").description("Create a reduction target").requiredOption("--name <name>","Target name").requiredOption("--metric <m>","Metric").requiredOption("--unit <u>","Unit").requiredOption("--baseline-value <n>","Baseline value",u).requiredOption("--baseline-year <n>","Baseline year",m).requiredOption("--target-value <n>","Target value",u).requiredOption("--target-year <n>","Target year",m).option("--description <s>","Description").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,metric:t.metric,unit:t.unit,baselineValue:t.baselineValue,baselineYear:t.baselineYear,targetValue:t.targetValue,targetYear:t.targetYear};t.description&&(e.description=t.description);let n=await a(ot,{input:e});c(`Reduction target created: ${n.ecoCreateReductionTarget.name}`),s(t,n.ecoCreateReductionTarget);}catch(e){i(e);}}),r.command("set-status").description("Update a reduction target status").argument("<id>","Target ID").requiredOption("--status <s>","PROPOSED|ACTIVE|ACHIEVED|MISSED|RETIRED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(it,{id:t,status:e.status.toUpperCase()});c(`Target status set to ${n.ecoSetReductionTargetStatus.status}`),s(e,n.ecoSetReductionTargetStatus);}catch(n){i(n);}});}function ht(o){let r=o.command("reports").description("EcoImpactHub sustainability reports");r.command("list").description("List reports").option("--status <s>","DRAFT|IN_REVIEW|PUBLISHED|ARCHIVED").option("--limit <n>","Page size",m,50).option("--offset <n>","Offset",m,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(at,{status:t.status?t.status.toUpperCase():void 0,pagination:g(t)});s(t,e.ecoListReports.items,{headers:["ID","Title","Framework","Status","Period End","Published"],rows:e.ecoListReports.items.map(n=>[d(n.id,12),n.title,n.framework,n.status,E(n.periodEnd),E(n.publishedAt)])});}catch(e){i(e);}}),r.command("get").description("Get a report by id").argument("<id>","Report ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(st,{id:t});if(!n.ecoReport)throw new l(`Report ${t} not found`);s(e,n.ecoReport);}catch(n){i(n);}}),r.command("create").description("Create a sustainability report").requiredOption("--title <t>","Report title").requiredOption("--period-start <iso>","Period start (ISO)").requiredOption("--period-end <iso>","Period end (ISO)").option("--framework <f>","GHG_PROTOCOL|GRI|SASB|TCFD|CDP|CUSTOM","GHG_PROTOCOL").option("--summary <s>","Summary").option("-f, --format <format>","Output format").action(async t=>{try{let e={title:t.title,periodStart:t.periodStart,periodEnd:t.periodEnd,framework:(t.framework??"GHG_PROTOCOL").toUpperCase()};t.summary&&(e.summary=t.summary);let n=await a(ct,{input:e});c(`Report created: ${n.ecoCreateReport.title}`),s(t,n.ecoCreateReport);}catch(e){i(e);}}),r.command("add-line-item").description("Add a line item to a report").requiredOption("--report <id>","Report ID").requiredOption("--label <l>","Line item label").requiredOption("--value <n>","Value",u).requiredOption("--unit <u>","Unit").option("--category <c>","Category").option("--carbon-entry <id>","Linked carbon entry ID").option("-f, --format <format>","Output format").action(async t=>{try{let e={reportId:t.report,label:t.label,value:t.value,unit:t.unit};t.category&&(e.category=t.category),t.carbonEntry&&(e.carbonEntryId=t.carbonEntry);let n=await a(ut,{input:e});c("Line item added"),s(t,n.ecoAddReportLineItem);}catch(e){i(e);}}),r.command("publish").description("Publish a report").argument("<id>","Report ID").option("--file <id>","Published artifact file ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(pt,{id:t,fileId:e.file});c(`Report published: ${n.ecoPublishReport.title}`),s(e,n.ecoPublishReport);}catch(n){i(n);}});}function bt(o){o.command("health").description("EcoImpactHub service health check (public)").option("-f, --format <format>","Output format").action(async r=>{try{let t=await b(dt);c(t.ecoHealth),s(r,{health:t.ecoHealth});}catch(t){i(t);}});}var Pt={id:"ecoimpacthub",version:"1.0.0",displayName:"EcoImpactHub",dependsOn:["auth","workspaces"],register(o,r){A(r);let t=o.command("ecoimpacthub").description("EcoImpactHub environmental-impact & sustainability monitoring");mt(t),lt(t),gt(t),ft(t),Et(t),Ct(t),yt(t),It(t),St(t),ht(t),bt(t);}},Nn=Pt;module.exports=Nn;
|
|
305
|
+
`;function m(o){let r=Number.parseInt(o,10);if(Number.isNaN(r))throw new l(`Expected an integer but got "${o}"`);return r}function u(o){let r=Number.parseFloat(o);if(Number.isNaN(r))throw new l(`Expected a number but got "${o}"`);return r}function g(o){let r={};return o.limit!==void 0&&(r.limit=o.limit),o.offset!==void 0&&(r.offset=o.offset),Object.keys(r).length?r:void 0}function mt(o){let r=o.command("sites").description("EcoImpactHub monitored sites");r.command("list").description("List sites").option("--status <s>","ACTIVE|ARCHIVED|MONITORING_PAUSED").option("--type <t>","FACILITY|FOREST|WETLAND|...").option("--limit <n>","Page size",m,50).option("--offset <n>","Offset",m,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(w,{status:t.status?t.status.toUpperCase():void 0,type:t.type?t.type.toUpperCase():void 0,pagination:g(t)});s(t,e.ecoListSites.items,{headers:["ID","Name","Type","Status","Country","Hectares"],rows:e.ecoListSites.items.map(n=>[d(n.id,12),n.name,n.type,n.status,n.country??"-",n.areaHectares!=null?String(n.areaHectares):"-"])});}catch(e){i(e);}}),r.command("get").description("Get a site by id").argument("<id>","Site ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(R,{id:t});if(!n.ecoSite)throw new l(`Site ${t} not found`);s(e,n.ecoSite);}catch(n){i(n);}}),r.command("create").description("Create a site").requiredOption("--name <name>","Site name").option("--code <code>","Site code").option("--description <s>","Description").option("--type <t>","Site type","FACILITY").option("--status <s>","Site status","ACTIVE").option("--country <c>","Country").option("--region <r>","Region").option("--latitude <n>","Latitude",u).option("--longitude <n>","Longitude",u).option("--area-hectares <n>","Area (hectares)",u).option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,type:(t.type??"FACILITY").toUpperCase(),status:(t.status??"ACTIVE").toUpperCase()};t.code&&(e.code=t.code),t.description&&(e.description=t.description),t.country&&(e.country=t.country),t.region&&(e.region=t.region),t.latitude!==void 0&&(e.latitude=t.latitude),t.longitude!==void 0&&(e.longitude=t.longitude),t.areaHectares!==void 0&&(e.areaHectares=t.areaHectares);let n=await a(v,{input:e});c(`Site created: ${n.ecoCreateSite.name}`),s(t,n.ecoCreateSite);}catch(e){i(e);}}),r.command("update").description("Update a site").argument("<id>","Site ID").option("--name <name>","Site name").option("--code <code>","Site code").option("--description <s>","Description").option("--type <t>","Site type").option("--status <s>","Site status").option("--country <c>","Country").option("--region <r>","Region").option("--latitude <n>","Latitude",u).option("--longitude <n>","Longitude",u).option("--area-hectares <n>","Area (hectares)",u).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.type&&(n.type=e.type.toUpperCase()),e.status&&(n.status=e.status.toUpperCase()),e.country&&(n.country=e.country),e.region&&(n.region=e.region),e.latitude!==void 0&&(n.latitude=e.latitude),e.longitude!==void 0&&(n.longitude=e.longitude),e.areaHectares!==void 0&&(n.areaHectares=e.areaHectares),!Object.keys(n).length)throw new l("No updates specified");let S=await a(k,{id:t,input:n});c("Site updated"),s(e,S.ecoUpdateSite);}catch(n){i(n);}}),r.command("archive").description("Archive a site").argument("<id>","Site ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(_,{id:t});c(n.ecoArchiveSite?"Site archived":"Site not archived"),s(e,{archived:n.ecoArchiveSite});}catch(n){i(n);}});}function lt(o){let r=o.command("sensors").description("EcoImpactHub site sensors");r.command("list").description("List sensors").option("--site <id>","Filter by site ID").option("--kind <k>","WATER_QUALITY|AIR_QUALITY|SOIL|...").option("--status <s>","ONLINE|OFFLINE|DEGRADED|MAINTENANCE|RETIRED").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(x,{siteId:t.site,kind:t.kind?t.kind.toUpperCase():void 0,status:t.status?t.status.toUpperCase():void 0});s(t,e.ecoListSensors,{headers:["ID","Name","Kind","Status","Unit","Last Reading"],rows:e.ecoListSensors.map(n=>[d(n.id,12),n.name,n.kind,n.status,n.unit??"-",E(n.lastReadingAt)])});}catch(e){i(e);}}),r.command("create").description("Create a sensor").requiredOption("--site <id>","Site ID").requiredOption("--name <name>","Sensor name").option("--kind <k>","Sensor kind","MANUAL").option("--status <s>","Sensor status","ONLINE").option("--unit <u>","Measurement unit").option("--hardware-id <id>","Hardware ID").option("--installed-at <iso>","Install date (ISO)").option("-f, --format <format>","Output format").action(async t=>{try{let e={siteId:t.site,name:t.name,kind:(t.kind??"MANUAL").toUpperCase(),status:(t.status??"ONLINE").toUpperCase()};t.unit&&(e.unit=t.unit),t.hardwareId&&(e.hardwareId=t.hardwareId),t.installedAt&&(e.installedAt=t.installedAt);let n=await a(D,{input:e});c(`Sensor created: ${n.ecoCreateSensor.name}`),s(t,n.ecoCreateSensor);}catch(e){i(e);}}),r.command("set-status").description("Update a sensor's operational status").argument("<id>","Sensor ID").requiredOption("--status <s>","ONLINE|OFFLINE|DEGRADED|MAINTENANCE|RETIRED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(L,{id:t,status:e.status.toUpperCase()});c(`Sensor status set to ${n.ecoSetSensorStatus.status}`),s(e,n.ecoSetSensorStatus);}catch(n){i(n);}});}function gt(o){let r=o.command("thresholds").description("EcoImpactHub alert thresholds");r.command("list").description("List alert thresholds").option("--site <id>","Filter by site ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a($,{siteId:t.site});s(t,e.ecoListThresholds,{headers:["ID","Parameter","Unit","Direction","Severity","Active"],rows:e.ecoListThresholds.map(n=>[d(n.id,12),n.parameter,n.unit,n.direction,n.severity,n.isActive?"yes":"no"])});}catch(e){i(e);}}),r.command("create").description("Create an alert threshold").requiredOption("--site <id>","Site ID").requiredOption("--parameter <p>","Measured parameter").requiredOption("--unit <u>","Unit").option("--direction <d>","ABOVE|BELOW|OUTSIDE_RANGE","ABOVE").option("--severity <s>","INFO|WARNING|CRITICAL","WARNING").option("--min-value <n>","Minimum value",u).option("--max-value <n>","Maximum value",u).option("--limit-value <n>","Limit value",u).option("-f, --format <format>","Output format").action(async t=>{try{let e={siteId:t.site,parameter:t.parameter,unit:t.unit,direction:(t.direction??"ABOVE").toUpperCase(),severity:(t.severity??"WARNING").toUpperCase()};t.minValue!==void 0&&(e.minValue=t.minValue),t.maxValue!==void 0&&(e.maxValue=t.maxValue),t.limitValue!==void 0&&(e.limitValue=t.limitValue);let n=await a(P,{input:e});c(`Threshold created for ${n.ecoCreateThreshold.parameter}`),s(t,n.ecoCreateThreshold);}catch(e){i(e);}}),r.command("set-active").description("Activate or deactivate a threshold").argument("<id>","Threshold ID").requiredOption("--active <bool>","true|false",t=>t==="true").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(N,{id:t,isActive:e.active});c(n.ecoSetThresholdActive.isActive?"Threshold activated":"Threshold disabled"),s(e,n.ecoSetThresholdActive);}catch(n){i(n);}});}function ft(o){let r=o.command("measurements").description("EcoImpactHub sensor measurements");r.command("list").description("List measurements").option("--site <id>","Filter by site ID").option("--sensor <id>","Filter by sensor ID").option("--parameter <p>","Filter by parameter").option("--breaches-only","Only threshold breaches").option("--limit <n>","Page size",m,50).option("--offset <n>","Offset",m,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(H,{siteId:t.site,sensorId:t.sensor,parameter:t.parameter,breachesOnly:t.breachesOnly?!0:void 0,pagination:g(t)});s(t,e.ecoListMeasurements.items,{headers:["ID","Parameter","Value","Unit","Source","Breach","Recorded"],rows:e.ecoListMeasurements.items.map(n=>[d(n.id,12),n.parameter,String(n.value),n.unit,n.source,n.isBreach?"yes":"no",E(n.recordedAt)])});}catch(e){i(e);}}),r.command("record").description("Record a measurement").requiredOption("--site <id>","Site ID").requiredOption("--parameter <p>","Measured parameter").requiredOption("--value <n>","Measured value",u).requiredOption("--unit <u>","Unit").requiredOption("--recorded-at <iso>","Recorded-at timestamp (ISO)").option("--sensor <id>","Sensor ID").option("--source <s>","SENSOR|MANUAL|IMPORT|SATELLITE|CALCULATED","SENSOR").option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async t=>{try{let e={siteId:t.site,parameter:t.parameter,value:t.value,unit:t.unit,recordedAt:t.recordedAt,source:(t.source??"SENSOR").toUpperCase()};t.sensor&&(e.sensorId=t.sensor),t.notes&&(e.notes=t.notes);let n=await a(q,{input:e});c(n.ecoRecordMeasurement.isBreach?"Measurement recorded (threshold breach!)":"Measurement recorded"),s(t,n.ecoRecordMeasurement);}catch(e){i(e);}});}function Et(o){let r=o.command("species").description("EcoImpactHub tracked species");r.command("list").description("List species").option("--taxon-group <g>","MAMMAL|BIRD|REPTILE|...").option("--conservation-status <s>","LEAST_CONCERN|ENDANGERED|...").option("--priority-only","Only priority species").option("--limit <n>","Page size",m,50).option("--offset <n>","Offset",m,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(M,{taxonGroup:t.taxonGroup?t.taxonGroup.toUpperCase():void 0,conservationStatus:t.conservationStatus?t.conservationStatus.toUpperCase():void 0,priorityOnly:t.priorityOnly?!0:void 0,pagination:g(t)});s(t,e.ecoListSpecies.items,{headers:["ID","Common Name","Scientific","Taxon","Status","Priority"],rows:e.ecoListSpecies.items.map(n=>[d(n.id,12),n.commonName,n.scientificName??"-",n.taxonGroup,n.conservationStatus,n.isPriority?"yes":"no"])});}catch(e){i(e);}}),r.command("get").description("Get a species by id").argument("<id>","Species ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(U,{id:t});if(!n.ecoSpecies)throw new l(`Species ${t} not found`);s(e,n.ecoSpecies);}catch(n){i(n);}}),r.command("create").description("Create a species record").requiredOption("--common-name <name>","Common name").option("--scientific-name <name>","Scientific name").option("--taxon-group <g>","Taxon group","OTHER").option("--conservation-status <s>","Conservation status","NOT_EVALUATED").option("--priority","Mark as priority species").option("--description <s>","Description").option("-f, --format <format>","Output format").action(async t=>{try{let e={commonName:t.commonName,taxonGroup:(t.taxonGroup??"OTHER").toUpperCase(),conservationStatus:(t.conservationStatus??"NOT_EVALUATED").toUpperCase(),isPriority:t.priority??!1};t.scientificName&&(e.scientificName=t.scientificName),t.description&&(e.description=t.description);let n=await a(V,{input:e});c(`Species created: ${n.ecoCreateSpecies.commonName}`),s(t,n.ecoCreateSpecies);}catch(e){i(e);}}),r.command("update").description("Update a species record").argument("<id>","Species ID").option("--common-name <name>","Common name").option("--scientific-name <name>","Scientific name").option("--taxon-group <g>","Taxon group").option("--conservation-status <s>","Conservation status").option("--priority <bool>","true|false",t=>t==="true").option("--description <s>","Description").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.commonName&&(n.commonName=e.commonName),e.scientificName&&(n.scientificName=e.scientificName),e.taxonGroup&&(n.taxonGroup=e.taxonGroup.toUpperCase()),e.conservationStatus&&(n.conservationStatus=e.conservationStatus.toUpperCase()),e.priority!==void 0&&(n.isPriority=e.priority),e.description!==void 0&&(n.description=e.description),!Object.keys(n).length)throw new l("No updates specified");let S=await a(F,{id:t,input:n});c("Species updated"),s(e,S.ecoUpdateSpecies);}catch(n){i(n);}}),r.command("archive").description("Archive a species record").argument("<id>","Species ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(G,{id:t});c(n.ecoArchiveSpecies?"Species archived":"Species not archived"),s(e,{archived:n.ecoArchiveSpecies});}catch(n){i(n);}});}function Ct(o){let r=o.command("observations").description("EcoImpactHub species observations");r.command("list").description("List observations").option("--species <id>","Filter by species ID").option("--site <id>","Filter by site ID").option("--limit <n>","Page size",m,50).option("--offset <n>","Offset",m,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(j,{speciesId:t.species,siteId:t.site,pagination:g(t)});s(t,e.ecoListObservations.items,{headers:["ID","Species","Site","Method","Count","Observed"],rows:e.ecoListObservations.items.map(n=>[d(n.id,12),d(n.speciesId,12),n.siteId?d(n.siteId,12):"-",n.method,String(n.count),E(n.observedAt)])});}catch(e){i(e);}}),r.command("record").description("Record a species observation").requiredOption("--species <id>","Species ID").requiredOption("--observed-at <iso>","Observed-at timestamp (ISO)").option("--site <id>","Site ID").option("--method <m>","DIRECT_SIGHTING|CAMERA_TRAP|ACOUSTIC|...","DIRECT_SIGHTING").option("--count <n>","Individual count",m).option("--latitude <n>","Latitude",u).option("--longitude <n>","Longitude",u).option("--evidence-file <id>","Evidence file ID").option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async t=>{try{let e={speciesId:t.species,observedAt:t.observedAt,method:(t.method??"DIRECT_SIGHTING").toUpperCase()};t.site&&(e.siteId=t.site),t.count!==void 0&&(e.count=t.count),t.latitude!==void 0&&(e.latitude=t.latitude),t.longitude!==void 0&&(e.longitude=t.longitude),t.evidenceFile&&(e.evidenceFileId=t.evidenceFile),t.notes&&(e.notes=t.notes);let n=await a(W,{input:e});c("Observation recorded"),s(t,n.ecoRecordObservation);}catch(e){i(e);}});}function yt(o){let r=o.command("habitat").description("EcoImpactHub habitat projects & restoration activities");r.command("list").description("List habitat projects").option("--status <s>","PLANNED|IN_PROGRESS|MONITORING|...").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(Y,{status:t.status?t.status.toUpperCase():void 0});s(t,e.ecoListHabitatProjects,{headers:["ID","Name","Status","Target Ha","Budget","Currency"],rows:e.ecoListHabitatProjects.map(n=>[d(n.id,12),n.name,n.status,n.targetHectares!=null?String(n.targetHectares):"-",n.budgetAmount!=null?String(n.budgetAmount):"-",n.currency??"-"])});}catch(e){i(e);}}),r.command("get").description("Get a habitat project by id").argument("<id>","Project ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(B,{id:t});if(!n.ecoHabitatProject)throw new l(`Habitat project ${t} not found`);s(e,n.ecoHabitatProject);}catch(n){i(n);}}),r.command("create").description("Create a habitat project").requiredOption("--name <name>","Project name").option("--description <s>","Description").option("--site <id>","Site ID").option("--manager <id>","Manager user ID").option("--target-hectares <n>","Target hectares",u).option("--budget-amount <n>","Budget amount",u).option("--currency <c>","Currency code").option("--start-date <iso>","Start date (ISO)").option("--end-date <iso>","End date (ISO)").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name};t.description&&(e.description=t.description),t.site&&(e.siteId=t.site),t.manager&&(e.managerId=t.manager),t.targetHectares!==void 0&&(e.targetHectares=t.targetHectares),t.budgetAmount!==void 0&&(e.budgetAmount=t.budgetAmount),t.currency&&(e.currency=t.currency),t.startDate&&(e.startDate=t.startDate),t.endDate&&(e.endDate=t.endDate);let n=await a(K,{input:e});c(`Habitat project created: ${n.ecoCreateHabitatProject.name}`),s(t,n.ecoCreateHabitatProject);}catch(e){i(e);}}),r.command("transition").description("Advance a habitat project through its lifecycle").argument("<id>","Project ID").requiredOption("--status <s>","PLANNED|IN_PROGRESS|MONITORING|COMPLETED|ON_HOLD|CANCELLED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(z,{id:t,status:e.status.toUpperCase()});c(`Project status set to ${n.ecoTransitionHabitatProject.status}`),s(e,n.ecoTransitionHabitatProject);}catch(n){i(n);}}),r.command("log-activity").description("Log a restoration activity against a project").requiredOption("--project <id>","Project ID").requiredOption("--summary <s>","Activity summary").requiredOption("--performed-at <iso>","Performed-at timestamp (ISO)").option("--type <t>","PLANTING|INVASIVE_REMOVAL|REWILDING|...","PLANTING").option("--details <s>","Details").option("--quantity <n>","Quantity",u).option("--unit <u>","Unit").option("-f, --format <format>","Output format").action(async t=>{try{let e={projectId:t.project,summary:t.summary,performedAt:t.performedAt,type:(t.type??"PLANTING").toUpperCase()};t.details&&(e.details=t.details),t.quantity!==void 0&&(e.quantity=t.quantity),t.unit&&(e.unit=t.unit);let n=await a(J,{input:e});c("Restoration activity logged"),s(t,n.ecoLogRestorationActivity);}catch(e){i(e);}});}function It(o){let r=o.command("carbon").description("EcoImpactHub carbon ledger & emission factors");r.command("list").description("List carbon ledger entries").option("--scope <s>","SCOPE_1|SCOPE_2|SCOPE_3").option("--site <id>","Filter by site ID").option("--status <s>","DRAFT|RECORDED|VERIFIED|ADJUSTED").option("--limit <n>","Page size",m,50).option("--offset <n>","Offset",m,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(Q,{scope:t.scope?t.scope.toUpperCase():void 0,siteId:t.site,status:t.status?t.status.toUpperCase():void 0,pagination:g(t)});s(t,e.ecoListCarbonEntries.items,{headers:["ID","Category","Scope","Activity","CO2e kg","Status"],rows:e.ecoListCarbonEntries.items.map(n=>[d(n.id,12),n.category,n.scope,`${n.activityValue} ${n.activityUnit}`,String(n.co2eKg),n.status])});}catch(e){i(e);}}),r.command("total").description("Total CO2e (kg) recorded in the workspace").option("--scope <s>","SCOPE_1|SCOPE_2|SCOPE_3").option("--site <id>","Filter by site ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(X,{scope:t.scope?t.scope.toUpperCase():void 0,siteId:t.site});c(`Total CO2e: ${e.ecoCarbonTotalKg} kg`),s(t,{totalCo2eKg:e.ecoCarbonTotalKg});}catch(e){i(e);}}),r.command("record").description("Record a carbon ledger entry").requiredOption("--category <c>","Category").requiredOption("--activity-value <n>","Activity value",u).requiredOption("--activity-unit <u>","Activity unit").requiredOption("--period-start <iso>","Period start (ISO)").option("--scope <s>","SCOPE_1|SCOPE_2|SCOPE_3","SCOPE_1").option("--factor <id>","Emission factor ID").option("--site <id>","Site ID").option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async t=>{try{let e={category:t.category,activityValue:t.activityValue,activityUnit:t.activityUnit,periodStart:t.periodStart,scope:(t.scope??"SCOPE_1").toUpperCase()};t.factor&&(e.factorId=t.factor),t.site&&(e.siteId=t.site),t.notes&&(e.notes=t.notes);let n=await a(Z,{input:e});c(`Carbon entry recorded: ${n.ecoRecordCarbonEntry.co2eKg} kg CO2e`),s(t,n.ecoRecordCarbonEntry);}catch(e){i(e);}}),r.command("verify").description("Verify a carbon ledger entry").argument("<id>","Carbon entry ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(tt,{id:t});c(`Carbon entry ${n.ecoVerifyCarbonEntry.status}`),s(e,n.ecoVerifyCarbonEntry);}catch(n){i(n);}}),r.command("list-factors").description("List emission factors").option("--scope <s>","SCOPE_1|SCOPE_2|SCOPE_3").option("--active-only","Only active factors").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(et,{scope:t.scope?t.scope.toUpperCase():void 0,activeOnly:t.activeOnly?!0:void 0});s(t,e.ecoListEmissionFactors,{headers:["ID","Name","Scope","Unit","kgCO2e","Year","Active"],rows:e.ecoListEmissionFactors.map(n=>[d(n.id,12),n.name,n.scope,n.activityUnit,String(n.factorKgco2e),n.validYear!=null?String(n.validYear):"-",n.isActive?"yes":"no"])});}catch(e){i(e);}}),r.command("create-factor").description("Create an emission factor").requiredOption("--name <name>","Factor name").requiredOption("--activity-unit <u>","Activity unit").requiredOption("--factor-kgco2e <n>","kg CO2e per unit",u).option("--scope <s>","SCOPE_1|SCOPE_2|SCOPE_3","SCOPE_1").option("--source <s>","Source").option("--valid-year <n>","Valid year",m).option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,activityUnit:t.activityUnit,factorKgco2e:t.factorKgco2e,scope:(t.scope??"SCOPE_1").toUpperCase()};t.source&&(e.source=t.source),t.validYear!==void 0&&(e.validYear=t.validYear);let n=await a(nt,{input:e});c(`Emission factor created: ${n.ecoCreateEmissionFactor.name}`),s(t,n.ecoCreateEmissionFactor);}catch(e){i(e);}});}function St(o){let r=o.command("targets").description("EcoImpactHub reduction targets");r.command("list").description("List reduction targets").option("--status <s>","PROPOSED|ACTIVE|ACHIEVED|MISSED|RETIRED").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(rt,{status:t.status?t.status.toUpperCase():void 0});s(t,e.ecoListReductionTargets,{headers:["ID","Name","Metric","Baseline","Target","Status"],rows:e.ecoListReductionTargets.map(n=>[d(n.id,12),n.name,n.metric,`${n.baselineValue} (${n.baselineYear})`,`${n.targetValue} (${n.targetYear})`,n.status])});}catch(e){i(e);}}),r.command("create").description("Create a reduction target").requiredOption("--name <name>","Target name").requiredOption("--metric <m>","Metric").requiredOption("--unit <u>","Unit").requiredOption("--baseline-value <n>","Baseline value",u).requiredOption("--baseline-year <n>","Baseline year",m).requiredOption("--target-value <n>","Target value",u).requiredOption("--target-year <n>","Target year",m).option("--description <s>","Description").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,metric:t.metric,unit:t.unit,baselineValue:t.baselineValue,baselineYear:t.baselineYear,targetValue:t.targetValue,targetYear:t.targetYear};t.description&&(e.description=t.description);let n=await a(ot,{input:e});c(`Reduction target created: ${n.ecoCreateReductionTarget.name}`),s(t,n.ecoCreateReductionTarget);}catch(e){i(e);}}),r.command("set-status").description("Update a reduction target status").argument("<id>","Target ID").requiredOption("--status <s>","PROPOSED|ACTIVE|ACHIEVED|MISSED|RETIRED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(it,{id:t,status:e.status.toUpperCase()});c(`Target status set to ${n.ecoSetReductionTargetStatus.status}`),s(e,n.ecoSetReductionTargetStatus);}catch(n){i(n);}});}function ht(o){let r=o.command("reports").description("EcoImpactHub sustainability reports");r.command("list").description("List reports").option("--status <s>","DRAFT|IN_REVIEW|PUBLISHED|ARCHIVED").option("--limit <n>","Page size",m,50).option("--offset <n>","Offset",m,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(at,{status:t.status?t.status.toUpperCase():void 0,pagination:g(t)});s(t,e.ecoListReports.items,{headers:["ID","Title","Framework","Status","Period End","Published"],rows:e.ecoListReports.items.map(n=>[d(n.id,12),n.title,n.framework,n.status,E(n.periodEnd),E(n.publishedAt)])});}catch(e){i(e);}}),r.command("get").description("Get a report by id").argument("<id>","Report ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(st,{id:t});if(!n.ecoReport)throw new l(`Report ${t} not found`);s(e,n.ecoReport);}catch(n){i(n);}}),r.command("create").description("Create a sustainability report").requiredOption("--title <t>","Report title").requiredOption("--period-start <iso>","Period start (ISO)").requiredOption("--period-end <iso>","Period end (ISO)").option("--framework <f>","GHG_PROTOCOL|GRI|SASB|TCFD|CDP|CUSTOM","GHG_PROTOCOL").option("--summary <s>","Summary").option("-f, --format <format>","Output format").action(async t=>{try{let e={title:t.title,periodStart:t.periodStart,periodEnd:t.periodEnd,framework:(t.framework??"GHG_PROTOCOL").toUpperCase()};t.summary&&(e.summary=t.summary);let n=await a(ct,{input:e});c(`Report created: ${n.ecoCreateReport.title}`),s(t,n.ecoCreateReport);}catch(e){i(e);}}),r.command("add-line-item").description("Add a line item to a report").requiredOption("--report <id>","Report ID").requiredOption("--label <l>","Line item label").requiredOption("--value <n>","Value",u).requiredOption("--unit <u>","Unit").option("--category <c>","Category").option("--carbon-entry <id>","Linked carbon entry ID").option("-f, --format <format>","Output format").action(async t=>{try{let e={reportId:t.report,label:t.label,value:t.value,unit:t.unit};t.category&&(e.category=t.category),t.carbonEntry&&(e.carbonEntryId=t.carbonEntry);let n=await a(ut,{input:e});c("Line item added"),s(t,n.ecoAddReportLineItem);}catch(e){i(e);}}),r.command("publish").description("Publish a report").argument("<id>","Report ID").option("--file <id>","Published artifact file ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(pt,{id:t,fileId:e.file});c(`Report published: ${n.ecoPublishReport.title}`),s(e,n.ecoPublishReport);}catch(n){i(n);}});}function Ot(o){o.command("health").description("EcoImpactHub service health check (public)").option("-f, --format <format>","Output format").action(async r=>{try{let t=await O(dt);c(t.ecoHealth),s(r,{health:t.ecoHealth});}catch(t){i(t);}});}var Pt={id:"ecoimpacthub",version:"1.0.0",displayName:"EcoImpactHub",dependsOn:["auth","workspaces"],register(o,r){A(r);let t=o.command("ecoimpacthub").description("EcoImpactHub environmental-impact & sustainability monitoring");mt(t),lt(t),gt(t),ft(t),Et(t),Ct(t),yt(t),It(t),St(t),ht(t),Ot(t);}},Nn=Pt;module.exports=Nn;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,b as b$1,h as h$1,p as p$1,g,i,o as o$1,d as d$1}from'../../chunk-
|
|
1
|
+
import {a,b as b$1,h as h$1,p as p$1,g,i,o as o$1,d as d$1}from'../../chunk-NLEVVDXR.js';import {o}from'../../chunk-IZXPWPKX.js';var O=`
|
|
2
2
|
query EcoSite($id: ID!) {
|
|
3
3
|
ecoSite(id: $id) {
|
|
4
4
|
id name code description type status country region latitude longitude
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var m=class extends Error{exitCode;hint;constructor(n,e){super(n),this.name="CliUserError",this.exitCode=e?.exitCode??1,this.hint=e?.hint;}},y=class extends m{constructor(n,e){super(n,{exitCode:2,hint:e?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},f=class extends Error{cause;constructor(n,e){super(n),this.name="CliInternalError",this.cause=e;}};var h=null;function L(t){h=t;}function v(){if(!h)throw new f("vibecontrols module helpers used before setHelpersContext was called");return h}function re(){let t=v();if(!t.auth.isAuthenticated())throw new y(
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var m=class extends Error{exitCode;hint;constructor(n,e){super(n),this.name="CliUserError",this.exitCode=e?.exitCode??1,this.hint=e?.hint;}},y=class extends m{constructor(n,e){super(n,{exitCode:2,hint:e?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},f=class extends Error{cause;constructor(n,e){super(n),this.name="CliInternalError",this.cause=e;}};var h=null;function L(t){h=t;}function v(){if(!h)throw new f("vibecontrols module helpers used before setHelpersContext was called");return h}function re(){let t=v();if(!t.auth.isAuthenticated())throw new y("Authentication required.",{hint:`Run \`${t.productName} auth login\` to authenticate.`})}async function r(t,n){return re(),v().gql.workspace.request(t,n)}function a(t){let n=t instanceof Error?t.message:String(t);throw new m(n)}function s(t,n,e){v().output.formatAndOutput(t,n,e);}function c(t){v().output.printSuccess(t);}function E(t){return v().output.formatDate(t)}function p(t,n){return v().output.truncate(t,n)}var I=`
|
|
2
2
|
id name description type status visibility timezone startAt endAt capacity
|
|
3
3
|
metadata createdAt updatedAt workspaceId
|
|
4
4
|
`,N=`
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
query EventfullymanagedEvent($id: ID!) {
|
|
13
13
|
eventfullyManagedEvent(id: $id) { ${I} }
|
|
14
14
|
}
|
|
15
|
-
`,
|
|
15
|
+
`,_=`
|
|
16
16
|
mutation EventfullymanagedCreateEvent($input: EventfullyManagedEventInput!) {
|
|
17
17
|
eventfullyManagedCreateEvent(input: $input) { ${I} }
|
|
18
18
|
}
|
|
19
|
-
`,
|
|
19
|
+
`,q=`
|
|
20
20
|
mutation EventfullymanagedUpdateEvent($id: ID!, $input: EventfullyManagedEventInput!) {
|
|
21
21
|
eventfullyManagedUpdateEvent(id: $id, input: $input) { ${I} }
|
|
22
22
|
}
|
|
@@ -50,27 +50,27 @@
|
|
|
50
50
|
mutation EventfullymanagedDeleteVenue($id: ID!) {
|
|
51
51
|
eventfullyManagedDeleteVenue(id: $id)
|
|
52
52
|
}
|
|
53
|
-
`,
|
|
53
|
+
`,w=`
|
|
54
54
|
id eventId name level logoUrl website contactName contactEmail contactPhone
|
|
55
55
|
metrics metadata createdAt updatedAt workspaceId
|
|
56
56
|
`,z=`
|
|
57
57
|
query EventfullymanagedSponsors($eventId: ID, $limit: Int, $offset: Int, $search: String, $workspaceId: ID) {
|
|
58
58
|
eventfullyManagedSponsors(eventId: $eventId, limit: $limit, offset: $offset, search: $search, workspaceId: $workspaceId) {
|
|
59
59
|
total
|
|
60
|
-
items { ${
|
|
60
|
+
items { ${w} }
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
`,G=`
|
|
64
64
|
query EventfullymanagedSponsor($id: ID!) {
|
|
65
|
-
eventfullyManagedSponsor(id: $id) { ${
|
|
65
|
+
eventfullyManagedSponsor(id: $id) { ${w} }
|
|
66
66
|
}
|
|
67
67
|
`,H=`
|
|
68
68
|
mutation EventfullymanagedCreateSponsor($input: EventfullyManagedSponsorInput!) {
|
|
69
|
-
eventfullyManagedCreateSponsor(input: $input) { ${
|
|
69
|
+
eventfullyManagedCreateSponsor(input: $input) { ${w} }
|
|
70
70
|
}
|
|
71
71
|
`,B=`
|
|
72
72
|
mutation EventfullymanagedUpdateSponsor($id: ID!, $input: EventfullyManagedSponsorInput!) {
|
|
73
|
-
eventfullyManagedUpdateSponsor(id: $id, input: $input) { ${
|
|
73
|
+
eventfullyManagedUpdateSponsor(id: $id, input: $input) { ${w} }
|
|
74
74
|
}
|
|
75
75
|
`,K=`
|
|
76
76
|
mutation EventfullymanagedDeleteSponsor($id: ID!) {
|
|
@@ -134,41 +134,41 @@
|
|
|
134
134
|
mutation EventfullymanagedDeleteTicketType($id: ID!) {
|
|
135
135
|
eventfullyManagedDeleteTicketType(id: $id)
|
|
136
136
|
}
|
|
137
|
-
`,
|
|
137
|
+
`,O=`
|
|
138
138
|
id eventId attendeeId ticketTypeId quantity status totalAmount currency
|
|
139
139
|
registeredAt checkedInAt metadata createdAt updatedAt workspaceId
|
|
140
140
|
`,at=`
|
|
141
141
|
query EventfullymanagedRegistrations($eventId: ID, $limit: Int, $offset: Int, $workspaceId: ID) {
|
|
142
142
|
eventfullyManagedRegistrations(eventId: $eventId, limit: $limit, offset: $offset, workspaceId: $workspaceId) {
|
|
143
143
|
total
|
|
144
|
-
items { ${
|
|
144
|
+
items { ${O} }
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
`,st=`
|
|
148
148
|
mutation EventfullymanagedCreateRegistration($input: EventfullyManagedRegistrationInput!) {
|
|
149
|
-
eventfullyManagedCreateRegistration(input: $input) { ${
|
|
149
|
+
eventfullyManagedCreateRegistration(input: $input) { ${O} }
|
|
150
150
|
}
|
|
151
151
|
`,dt=`
|
|
152
152
|
mutation EventfullymanagedUpdateRegistration($id: ID!, $input: EventfullyManagedRegistrationInput!) {
|
|
153
|
-
eventfullyManagedUpdateRegistration(id: $id, input: $input) { ${
|
|
153
|
+
eventfullyManagedUpdateRegistration(id: $id, input: $input) { ${O} }
|
|
154
154
|
}
|
|
155
|
-
`,
|
|
155
|
+
`,A=`
|
|
156
156
|
id fullName title organization bio email phone avatarUrl socialLinks
|
|
157
157
|
createdAt updatedAt workspaceId
|
|
158
158
|
`,ct=`
|
|
159
159
|
query EventfullymanagedSpeakers($limit: Int, $offset: Int, $workspaceId: ID) {
|
|
160
160
|
eventfullyManagedSpeakers(limit: $limit, offset: $offset, workspaceId: $workspaceId) {
|
|
161
161
|
total
|
|
162
|
-
items { ${
|
|
162
|
+
items { ${A} }
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
`,
|
|
165
|
+
`,ut=`
|
|
166
166
|
mutation EventfullymanagedCreateSpeaker($input: EventfullyManagedSpeakerInput!) {
|
|
167
|
-
eventfullyManagedCreateSpeaker(input: $input) { ${
|
|
167
|
+
eventfullyManagedCreateSpeaker(input: $input) { ${A} }
|
|
168
168
|
}
|
|
169
|
-
`,
|
|
169
|
+
`,pt=`
|
|
170
170
|
mutation EventfullymanagedUpdateSpeaker($id: ID!, $input: EventfullyManagedSpeakerInput!) {
|
|
171
|
-
eventfullyManagedUpdateSpeaker(id: $id, input: $input) { ${
|
|
171
|
+
eventfullyManagedUpdateSpeaker(id: $id, input: $input) { ${A} }
|
|
172
172
|
}
|
|
173
173
|
`,D=`
|
|
174
174
|
id eventId name boothCode category contactName contactEmail status metadata
|
|
@@ -224,11 +224,11 @@
|
|
|
224
224
|
items { ${$} }
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
`,
|
|
227
|
+
`,wt=`
|
|
228
228
|
mutation EventfullymanagedCreatePromoCode($input: EventfullyManagedPromoCodeInput!) {
|
|
229
229
|
eventfullyManagedCreatePromoCode(input: $input) { ${$} }
|
|
230
230
|
}
|
|
231
|
-
`,
|
|
231
|
+
`,Ct=`
|
|
232
232
|
mutation EventfullymanagedUpdatePromoCode($id: ID!, $input: EventfullyManagedPromoCodeInput!) {
|
|
233
233
|
eventfullyManagedUpdatePromoCode(id: $id, input: $input) { ${$} }
|
|
234
234
|
}
|
|
@@ -244,4 +244,4 @@
|
|
|
244
244
|
latestEvents { id name status type startAt endAt }
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
`;function l(t,n){try{return JSON.parse(n)}catch{throw new m(`--${t} must be valid JSON`)}}function d(t){let n=Number.parseInt(t,10);if(Number.isNaN(n))throw new m(`Expected an integer but got "${t}"`);return n}function w(t){return t.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function Tt(t){let n={name:t.name,type:t.type,timezone:t.timezone,startAt:t.startAt,endAt:t.endAt};return t.status&&(n.status=t.status),t.visibility&&(n.visibility=t.visibility),t.capacity!==void 0&&(n.capacity=t.capacity),t.description&&(n.description=t.description),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function bt(t){let n=t.command("events").description("Eventfullymanaged events");n.command("list").description("List events").option("--search <q>","Free-text search").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(N,{search:e.search,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedEvents.items,{headers:["ID","Name","Type","Status","Start","End"],rows:i.eventfullyManagedEvents.items.map(o=>[u(o.id,12),o.name,o.type,o.status,E(o.startAt),E(o.endAt)])});}catch(i){a(i);}}),n.command("get").description("Get an event by id").argument("<id>","Event ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(P,{id:e});if(!o.eventfullyManagedEvent)throw new m(`Event ${e} not found`);s(i,o.eventfullyManagedEvent);}catch(o){a(o);}}),n.command("create").description("Create an event").requiredOption("--name <name>","Event name").requiredOption("--type <t>","Event type (e.g. conference, webinar)").requiredOption("--timezone <tz>","IANA timezone (e.g. Asia/Kolkata)").requiredOption("--start-at <iso>","Start (ISO datetime)").requiredOption("--end-at <iso>","End (ISO datetime)").option("--status <s>","Event status").option("--visibility <v>","Visibility (e.g. public, private)").option("--capacity <n>","Capacity",d).option("--description <s>","Description").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(q,{input:Tt(e)});c(`Event created: ${i.eventfullyManagedCreateEvent.name}`),s(e,i.eventfullyManagedCreateEvent);}catch(i){a(i);}}),n.command("update").description("Update an event (the subgraph input requires the core fields)").argument("<id>","Event ID").requiredOption("--name <name>","Event name").requiredOption("--type <t>","Event type").requiredOption("--timezone <tz>","IANA timezone").requiredOption("--start-at <iso>","Start (ISO datetime)").requiredOption("--end-at <iso>","End (ISO datetime)").option("--status <s>","Event status").option("--visibility <v>","Visibility").option("--capacity <n>","Capacity",d).option("--description <s>","Description").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(_,{id:e,input:Tt(i)});c("Event updated"),s(i,o.eventfullyManagedUpdateEvent);}catch(o){a(o);}}),n.command("remove").description("Delete an event").argument("<id>","Event ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(U,{id:e});c(o.eventfullyManagedDeleteEvent?"Event deleted":"Event not deleted"),s(i,{deleted:o.eventfullyManagedDeleteEvent});}catch(o){a(o);}});}function At(t){let n={name:t.name};return t.description&&(n.description=t.description),t.status&&(n.status=t.status),t.capacity!==void 0&&(n.capacity=t.capacity),t.addressLine1&&(n.addressLine1=t.addressLine1),t.city&&(n.city=t.city),t.state&&(n.state=t.state),t.country&&(n.country=t.country),t.postalCode&&(n.postalCode=t.postalCode),t.amenities&&(n.amenities=w(t.amenities)),t.openingHours&&(n.openingHours=l("opening-hours",t.openingHours)),t.pricing&&(n.pricing=l("pricing",t.pricing)),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function Ot(t){let n=t.command("venues").description("Eventfullymanaged venues");n.command("list").description("List venues").option("--search <q>","Free-text search").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(V,{search:e.search,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedVenues.items,{headers:["ID","Name","Status","City","Country","Capacity"],rows:i.eventfullyManagedVenues.items.map(o=>[u(o.id,12),o.name,o.status,o.city??"-",o.country??"-",o.capacity!=null?String(o.capacity):"-"])});}catch(i){a(i);}}),n.command("get").description("Get a venue by id").argument("<id>","Venue ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(F,{id:e});if(!o.eventfullyManagedVenue)throw new m(`Venue ${e} not found`);s(i,o.eventfullyManagedVenue);}catch(o){a(o);}}),n.command("create").description("Create a venue").requiredOption("--name <name>","Venue name").option("--description <s>","Description").option("--status <s>","Venue status").option("--capacity <n>","Capacity",d).option("--address <s>","Address line 1").option("--city <s>","City").option("--state <s>","State").option("--country <s>","Country").option("--postal-code <s>","Postal code").option("--amenities <csv>","Comma-separated amenities").option("--opening-hours <json>","Opening hours JSON").option("--pricing <json>","Pricing JSON").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(j,{input:At({...e,addressLine1:e.address})});c(`Venue created: ${i.eventfullyManagedCreateVenue.name}`),s(e,i.eventfullyManagedCreateVenue);}catch(i){a(i);}}),n.command("update").description("Update a venue").argument("<id>","Venue ID").requiredOption("--name <name>","Venue name").option("--description <s>","Description").option("--status <s>","Venue status").option("--capacity <n>","Capacity",d).option("--address <s>","Address line 1").option("--city <s>","City").option("--state <s>","State").option("--country <s>","Country").option("--postal-code <s>","Postal code").option("--amenities <csv>","Comma-separated amenities").option("--opening-hours <json>","Opening hours JSON").option("--pricing <json>","Pricing JSON").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(W,{id:e,input:At({...i,addressLine1:i.address})});c("Venue updated"),s(i,o.eventfullyManagedUpdateVenue);}catch(o){a(o);}}),n.command("remove").description("Delete a venue").argument("<id>","Venue ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(J,{id:e});c(o.eventfullyManagedDeleteVenue?"Venue deleted":"Venue not deleted"),s(i,{deleted:o.eventfullyManagedDeleteVenue});}catch(o){a(o);}});}function Dt(t){let n={eventId:t.event,name:t.name,level:t.level};return t.logoUrl&&(n.logoUrl=t.logoUrl),t.website&&(n.website=t.website),t.contactName&&(n.contactName=t.contactName),t.contactEmail&&(n.contactEmail=t.contactEmail),t.contactPhone&&(n.contactPhone=t.contactPhone),t.metrics&&(n.metrics=l("metrics",t.metrics)),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function xt(t){let n=t.command("sponsors").description("Eventfullymanaged sponsors");n.command("list").description("List sponsors").option("--event <id>","Filter by event ID").option("--search <q>","Free-text search").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(z,{eventId:e.event,search:e.search,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedSponsors.items,{headers:["ID","Name","Level","Event","Website"],rows:i.eventfullyManagedSponsors.items.map(o=>[u(o.id,12),o.name,o.level,u(o.eventId,12),o.website??"-"])});}catch(i){a(i);}}),n.command("get").description("Get a sponsor by id").argument("<id>","Sponsor ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(G,{id:e});if(!o.eventfullyManagedSponsor)throw new m(`Sponsor ${e} not found`);s(i,o.eventfullyManagedSponsor);}catch(o){a(o);}}),n.command("create").description("Create a sponsor").requiredOption("--event <id>","Event ID").requiredOption("--name <name>","Sponsor name").requiredOption("--level <l>","Sponsorship level (e.g. gold, silver)").option("--logo-url <url>","Logo URL").option("--website <url>","Website").option("--contact-name <s>","Contact name").option("--contact-email <s>","Contact email").option("--contact-phone <s>","Contact phone").option("--metrics <json>","Metrics JSON").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(H,{input:Dt(e)});c(`Sponsor created: ${i.eventfullyManagedCreateSponsor.name}`),s(e,i.eventfullyManagedCreateSponsor);}catch(i){a(i);}}),n.command("update").description("Update a sponsor").argument("<id>","Sponsor ID").requiredOption("--event <id>","Event ID").requiredOption("--name <name>","Sponsor name").requiredOption("--level <l>","Sponsorship level").option("--logo-url <url>","Logo URL").option("--website <url>","Website").option("--contact-name <s>","Contact name").option("--contact-email <s>","Contact email").option("--contact-phone <s>","Contact phone").option("--metrics <json>","Metrics JSON").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(B,{id:e,input:Dt(i)});c("Sponsor updated"),s(i,o.eventfullyManagedUpdateSponsor);}catch(o){a(o);}}),n.command("remove").description("Delete a sponsor").argument("<id>","Sponsor ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(K,{id:e});c(o.eventfullyManagedDeleteSponsor?"Sponsor deleted":"Sponsor not deleted"),s(i,{deleted:o.eventfullyManagedDeleteSponsor});}catch(o){a(o);}});}function $t(t){let n={eventId:t.event,fullName:t.fullName,email:t.email};return t.phone&&(n.phone=t.phone),t.company&&(n.company=t.company),t.role&&(n.role=t.role),t.tags&&(n.tags=w(t.tags)),t.profile&&(n.profile=l("profile",t.profile)),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function Mt(t){let n=t.command("attendees").description("Eventfullymanaged attendees");n.command("list").description("List attendees").option("--event <id>","Filter by event ID").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(Y,{eventId:e.event,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedAttendees.items,{headers:["ID","Name","Email","Company","Role"],rows:i.eventfullyManagedAttendees.items.map(o=>[u(o.id,12),o.fullName,o.email,o.company??"-",o.role??"-"])});}catch(i){a(i);}}),n.command("create").description("Create an attendee").requiredOption("--event <id>","Event ID").requiredOption("--full-name <name>","Full name").requiredOption("--email <email>","Email").option("--phone <s>","Phone").option("--company <s>","Company").option("--role <s>","Role").option("--tags <csv>","Comma-separated tags").option("--profile <json>","Profile JSON").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(X,{input:$t(e)});c(`Attendee created: ${i.eventfullyManagedCreateAttendee.fullName}`),s(e,i.eventfullyManagedCreateAttendee);}catch(i){a(i);}}),n.command("update").description("Update an attendee").argument("<id>","Attendee ID").requiredOption("--event <id>","Event ID").requiredOption("--full-name <name>","Full name").requiredOption("--email <email>","Email").option("--phone <s>","Phone").option("--company <s>","Company").option("--role <s>","Role").option("--tags <csv>","Comma-separated tags").option("--profile <json>","Profile JSON").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(Q,{id:e,input:$t(i)});c("Attendee updated"),s(i,o.eventfullyManagedUpdateAttendee);}catch(o){a(o);}});}function Rt(t){let n={eventId:t.event,title:t.title,sessionType:t.sessionType,startsAt:t.startsAt,endsAt:t.endsAt};return t.description&&(n.description=t.description),t.status&&(n.status=t.status),t.track&&(n.track=t.track),t.capacity!==void 0&&(n.capacity=t.capacity),t.venue&&(n.venueId=t.venue),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function Lt(t){let n=t.command("sessions").description("Eventfullymanaged event sessions");n.command("list").description("List event sessions").option("--event <id>","Filter by event ID").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,100).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(Z,{eventId:e.event,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedEventSessions.items,{headers:["ID","Title","Type","Status","Track","Starts"],rows:i.eventfullyManagedEventSessions.items.map(o=>[u(o.id,12),o.title,o.sessionType,o.status,o.track??"-",E(o.startsAt)])});}catch(i){a(i);}}),n.command("create").description("Create an event session").requiredOption("--event <id>","Event ID").requiredOption("--title <title>","Session title").requiredOption("--session-type <t>","Session type (e.g. talk, workshop)").requiredOption("--starts-at <iso>","Start (ISO datetime)").requiredOption("--ends-at <iso>","End (ISO datetime)").option("--description <s>","Description").option("--status <s>","Status").option("--track <s>","Track").option("--capacity <n>","Capacity",d).option("--venue <id>","Venue ID").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(tt,{input:Rt(e)});c(`Session created: ${i.eventfullyManagedCreateEventSession.title}`),s(e,i.eventfullyManagedCreateEventSession);}catch(i){a(i);}}),n.command("update").description("Update an event session").argument("<id>","Session ID").requiredOption("--event <id>","Event ID").requiredOption("--title <title>","Session title").requiredOption("--session-type <t>","Session type").requiredOption("--starts-at <iso>","Start (ISO datetime)").requiredOption("--ends-at <iso>","End (ISO datetime)").option("--description <s>","Description").option("--status <s>","Status").option("--track <s>","Track").option("--capacity <n>","Capacity",d).option("--venue <id>","Venue ID").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(et,{id:e,input:Rt(i)});c("Session updated"),s(i,o.eventfullyManagedUpdateEventSession);}catch(o){a(o);}});}function Nt(t){let n={eventId:t.event,name:t.name,price:t.price};return t.currency&&(n.currency=t.currency),t.description&&(n.description=t.description),t.capacity!==void 0&&(n.capacity=t.capacity),t.soldCount!==void 0&&(n.soldCount=t.soldCount),t.active!==void 0&&(n.isActive=t.active),t.salesStartAt&&(n.salesStartAt=t.salesStartAt),t.salesEndAt&&(n.salesEndAt=t.salesEndAt),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function Pt(t){let n=t.command("tickets").description("Eventfullymanaged ticket types");n.command("list").description("List ticket types").option("--event <id>","Filter by event ID").option("--search <q>","Free-text search").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(nt,{eventId:e.event,search:e.search,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedTicketTypes.items,{headers:["ID","Name","Price","Currency","Active","Sold"],rows:i.eventfullyManagedTicketTypes.items.map(o=>[u(o.id,12),o.name,o.price,o.currency,o.isActive?"yes":"no",String(o.soldCount)])});}catch(i){a(i);}}),n.command("create").description("Create a ticket type").requiredOption("--event <id>","Event ID").requiredOption("--name <name>","Ticket type name").requiredOption("--price <amount>","Price (decimal string)").option("--currency <c>","Currency code").option("--description <s>","Description").option("--capacity <n>","Capacity",d).option("--sold-count <n>","Sold count",d).option("--active <bool>","true|false",e=>e==="true").option("--sales-start-at <iso>","Sales start (ISO datetime)").option("--sales-end-at <iso>","Sales end (ISO datetime)").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(ot,{input:Nt(e)});c(`Ticket type created: ${i.eventfullyManagedCreateTicketType.name}`),s(e,i.eventfullyManagedCreateTicketType);}catch(i){a(i);}}),n.command("update").description("Update a ticket type").argument("<id>","Ticket type ID").requiredOption("--event <id>","Event ID").requiredOption("--name <name>","Ticket type name").requiredOption("--price <amount>","Price (decimal string)").option("--currency <c>","Currency code").option("--description <s>","Description").option("--capacity <n>","Capacity",d).option("--sold-count <n>","Sold count",d).option("--active <bool>","true|false",e=>e==="true").option("--sales-start-at <iso>","Sales start (ISO datetime)").option("--sales-end-at <iso>","Sales end (ISO datetime)").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(it,{id:e,input:Nt(i)});c("Ticket type updated"),s(i,o.eventfullyManagedUpdateTicketType);}catch(o){a(o);}}),n.command("remove").description("Delete a ticket type").argument("<id>","Ticket type ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(rt,{id:e});c(o.eventfullyManagedDeleteTicketType?"Ticket type deleted":"Ticket type not deleted"),s(i,{deleted:o.eventfullyManagedDeleteTicketType});}catch(o){a(o);}});}function qt(t){let n={eventId:t.event};return t.attendee&&(n.attendeeId=t.attendee),t.ticketType&&(n.ticketTypeId=t.ticketType),t.quantity!==void 0&&(n.quantity=t.quantity),t.status&&(n.status=t.status),t.totalAmount&&(n.totalAmount=t.totalAmount),t.currency&&(n.currency=t.currency),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function _t(t){let n=t.command("registrations").description("Eventfullymanaged registrations");n.command("list").description("List registrations").option("--event <id>","Filter by event ID").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(at,{eventId:e.event,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedRegistrations.items,{headers:["ID","Event","Attendee","Status","Qty","Total"],rows:i.eventfullyManagedRegistrations.items.map(o=>[u(o.id,12),u(o.eventId,12),o.attendeeId?u(o.attendeeId,12):"-",o.status,String(o.quantity),o.totalAmount??"-"])});}catch(i){a(i);}}),n.command("create").description("Create a registration").requiredOption("--event <id>","Event ID").option("--attendee <id>","Attendee ID").option("--ticket-type <id>","Ticket type ID").option("--quantity <n>","Quantity",d).option("--status <s>","Status").option("--total-amount <amount>","Total amount (decimal string)").option("--currency <c>","Currency code").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(st,{input:qt(e)});c(`Registration created: ${i.eventfullyManagedCreateRegistration.id}`),s(e,i.eventfullyManagedCreateRegistration);}catch(i){a(i);}}),n.command("update").description("Update a registration").argument("<id>","Registration ID").requiredOption("--event <id>","Event ID").option("--attendee <id>","Attendee ID").option("--ticket-type <id>","Ticket type ID").option("--quantity <n>","Quantity",d).option("--status <s>","Status").option("--total-amount <amount>","Total amount (decimal string)").option("--currency <c>","Currency code").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(dt,{id:e,input:qt(i)});c("Registration updated"),s(i,o.eventfullyManagedUpdateRegistration);}catch(o){a(o);}});}function Ut(t){let n={fullName:t.fullName};return t.title&&(n.title=t.title),t.organization&&(n.organization=t.organization),t.bio&&(n.bio=t.bio),t.email&&(n.email=t.email),t.phone&&(n.phone=t.phone),t.avatarUrl&&(n.avatarUrl=t.avatarUrl),t.socialLinks&&(n.socialLinks=l("social-links",t.socialLinks)),n}function Vt(t){let n=t.command("speakers").description("Eventfullymanaged speakers");n.command("list").description("List speakers").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,100).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(ct,{workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedSpeakers.items,{headers:["ID","Name","Title","Organization","Email"],rows:i.eventfullyManagedSpeakers.items.map(o=>[u(o.id,12),o.fullName,o.title??"-",o.organization??"-",o.email??"-"])});}catch(i){a(i);}}),n.command("create").description("Create a speaker").requiredOption("--full-name <name>","Full name").option("--title <s>","Title").option("--organization <s>","Organization").option("--bio <s>","Bio").option("--email <s>","Email").option("--phone <s>","Phone").option("--avatar-url <url>","Avatar URL").option("--social-links <json>","Social links JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(pt,{input:Ut(e)});c(`Speaker created: ${i.eventfullyManagedCreateSpeaker.fullName}`),s(e,i.eventfullyManagedCreateSpeaker);}catch(i){a(i);}}),n.command("update").description("Update a speaker").argument("<id>","Speaker ID").requiredOption("--full-name <name>","Full name").option("--title <s>","Title").option("--organization <s>","Organization").option("--bio <s>","Bio").option("--email <s>","Email").option("--phone <s>","Phone").option("--avatar-url <url>","Avatar URL").option("--social-links <json>","Social links JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(ut,{id:e,input:Ut(i)});c("Speaker updated"),s(i,o.eventfullyManagedUpdateSpeaker);}catch(o){a(o);}});}function Ft(t){let n={eventId:t.event,name:t.name};return t.boothCode&&(n.boothCode=t.boothCode),t.category&&(n.category=t.category),t.contactName&&(n.contactName=t.contactName),t.contactEmail&&(n.contactEmail=t.contactEmail),t.status&&(n.status=t.status),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function jt(t){let n=t.command("exhibitors").description("Eventfullymanaged exhibitors");n.command("list").description("List exhibitors").option("--event <id>","Filter by event ID").option("--search <q>","Free-text search").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(lt,{eventId:e.event,search:e.search,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedExhibitors.items,{headers:["ID","Name","Status","Booth","Category"],rows:i.eventfullyManagedExhibitors.items.map(o=>[u(o.id,12),o.name,o.status,o.boothCode??"-",o.category??"-"])});}catch(i){a(i);}}),n.command("create").description("Create an exhibitor").requiredOption("--event <id>","Event ID").requiredOption("--name <name>","Exhibitor name").option("--booth-code <s>","Booth code").option("--category <s>","Category").option("--contact-name <s>","Contact name").option("--contact-email <s>","Contact email").option("--status <s>","Status").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(mt,{input:Ft(e)});c(`Exhibitor created: ${i.eventfullyManagedCreateExhibitor.name}`),s(e,i.eventfullyManagedCreateExhibitor);}catch(i){a(i);}}),n.command("update").description("Update an exhibitor").argument("<id>","Exhibitor ID").requiredOption("--event <id>","Event ID").requiredOption("--name <name>","Exhibitor name").option("--booth-code <s>","Booth code").option("--category <s>","Category").option("--contact-name <s>","Contact name").option("--contact-email <s>","Contact email").option("--status <s>","Status").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(gt,{id:e,input:Ft(i)});c("Exhibitor updated"),s(i,o.eventfullyManagedUpdateExhibitor);}catch(o){a(o);}}),n.command("remove").description("Delete an exhibitor").argument("<id>","Exhibitor ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(ft,{id:e});c(o.eventfullyManagedDeleteExhibitor?"Exhibitor deleted":"Exhibitor not deleted"),s(i,{deleted:o.eventfullyManagedDeleteExhibitor});}catch(o){a(o);}});}function Wt(t){let n={eventId:t.event,attendeeName:t.attendeeName,attendeeEmail:t.attendeeEmail};return t.exhibitor&&(n.exhibitorId=t.exhibitor),t.sponsor&&(n.sponsorId=t.sponsor),t.status&&(n.status=t.status),t.score!==void 0&&(n.score=t.score),t.notes&&(n.notes=t.notes),t.capturedAt&&(n.capturedAt=t.capturedAt),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function Jt(t){let n=t.command("leads").description("Eventfullymanaged exhibitor leads");n.command("list").description("List leads").option("--event <id>","Filter by event ID").option("--search <q>","Free-text search").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(yt,{eventId:e.event,search:e.search,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedLeads.items,{headers:["ID","Name","Email","Status","Score"],rows:i.eventfullyManagedLeads.items.map(o=>[u(o.id,12),o.attendeeName,o.attendeeEmail,o.status,o.score!=null?String(o.score):"-"])});}catch(i){a(i);}}),n.command("create").description("Create a lead").requiredOption("--event <id>","Event ID").requiredOption("--attendee-name <name>","Attendee name").requiredOption("--attendee-email <email>","Attendee email").option("--exhibitor <id>","Exhibitor ID").option("--sponsor <id>","Sponsor ID").option("--status <s>","Status").option("--score <n>","Score",d).option("--notes <s>","Notes").option("--captured-at <iso>","Captured at (ISO datetime)").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(vt,{input:Wt(e)});c(`Lead created: ${i.eventfullyManagedCreateLead.attendeeName}`),s(e,i.eventfullyManagedCreateLead);}catch(i){a(i);}}),n.command("update").description("Update a lead").argument("<id>","Lead ID").requiredOption("--event <id>","Event ID").requiredOption("--attendee-name <name>","Attendee name").requiredOption("--attendee-email <email>","Attendee email").option("--exhibitor <id>","Exhibitor ID").option("--sponsor <id>","Sponsor ID").option("--status <s>","Status").option("--score <n>","Score",d).option("--notes <s>","Notes").option("--captured-at <iso>","Captured at (ISO datetime)").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(Et,{id:e,input:Wt(i)});c("Lead updated"),s(i,o.eventfullyManagedUpdateLead);}catch(o){a(o);}}),n.command("remove").description("Delete a lead").argument("<id>","Lead ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(It,{id:e});c(o.eventfullyManagedDeleteLead?"Lead deleted":"Lead not deleted"),s(i,{deleted:o.eventfullyManagedDeleteLead});}catch(o){a(o);}});}function zt(t){let n={eventId:t.event,code:t.code,discountType:t.discountType,discountValue:t.discountValue};return t.description&&(n.description=t.description),t.maxUses!==void 0&&(n.maxUses=t.maxUses),t.usedCount!==void 0&&(n.usedCount=t.usedCount),t.active!==void 0&&(n.isActive=t.active),t.startsAt&&(n.startsAt=t.startsAt),t.endsAt&&(n.endsAt=t.endsAt),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function Gt(t){let n=t.command("promo-codes").description("Eventfullymanaged promo codes");n.command("list").description("List promo codes").option("--event <id>","Filter by event ID").option("--search <q>","Free-text search").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(kt,{eventId:e.event,search:e.search,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedPromoCodes.items,{headers:["ID","Code","Type","Value","Active","Used"],rows:i.eventfullyManagedPromoCodes.items.map(o=>[u(o.id,12),o.code,o.discountType,o.discountValue,o.isActive?"yes":"no",String(o.usedCount)])});}catch(i){a(i);}}),n.command("create").description("Create a promo code").requiredOption("--event <id>","Event ID").requiredOption("--code <code>","Promo code").requiredOption("--discount-type <t>","Discount type (e.g. percentage, fixed)").requiredOption("--discount-value <v>","Discount value (string)").option("--description <s>","Description").option("--max-uses <n>","Max uses",d).option("--used-count <n>","Used count",d).option("--active <bool>","true|false",e=>e==="true").option("--starts-at <iso>","Starts at (ISO datetime)").option("--ends-at <iso>","Ends at (ISO datetime)").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(Ct,{input:zt(e)});c(`Promo code created: ${i.eventfullyManagedCreatePromoCode.code}`),s(e,i.eventfullyManagedCreatePromoCode);}catch(i){a(i);}}),n.command("update").description("Update a promo code").argument("<id>","Promo code ID").requiredOption("--event <id>","Event ID").requiredOption("--code <code>","Promo code").requiredOption("--discount-type <t>","Discount type").requiredOption("--discount-value <v>","Discount value (string)").option("--description <s>","Description").option("--max-uses <n>","Max uses",d).option("--used-count <n>","Used count",d).option("--active <bool>","true|false",e=>e==="true").option("--starts-at <iso>","Starts at (ISO datetime)").option("--ends-at <iso>","Ends at (ISO datetime)").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(wt,{id:e,input:zt(i)});c("Promo code updated"),s(i,o.eventfullyManagedUpdatePromoCode);}catch(o){a(o);}}),n.command("remove").description("Delete a promo code").argument("<id>","Promo code ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(ht,{id:e});c(o.eventfullyManagedDeletePromoCode?"Promo code deleted":"Promo code not deleted"),s(i,{deleted:o.eventfullyManagedDeletePromoCode});}catch(o){a(o);}});}function Ht(t){t.command("analytics").description("Eventfullymanaged analytics & dashboard").command("dashboard").description("Dashboard summary (event/attendee/registration/sponsor/venue counts + latest events)").option("--workspace <id>","Filter by workspace ID").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(St,{workspaceId:e.workspace});s(e,i.eventfullyManagedDashboardSummary);}catch(i){a(i);}});}var ae={id:"eventfullymanaged",version:"1.0.0",displayName:"Eventfullymanaged",dependsOn:["auth","workspaces"],register(t,n){L(n);let e=t.command("eventfullymanaged").description("Eventfullymanaged event-management platform");bt(e),Ot(e),xt(e),Mt(e),Lt(e),Pt(e),_t(e),Vt(e),jt(e),Jt(e),Gt(e),Ht(e);}},mo=ae;module.exports=mo;
|
|
247
|
+
`;function l(t,n){try{return JSON.parse(n)}catch{throw new m(`--${t} must be valid JSON`)}}function d(t){let n=Number.parseInt(t,10);if(Number.isNaN(n))throw new m(`Expected an integer but got "${t}"`);return n}function C(t){return t.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function Tt(t){let n={name:t.name,type:t.type,timezone:t.timezone,startAt:t.startAt,endAt:t.endAt};return t.status&&(n.status=t.status),t.visibility&&(n.visibility=t.visibility),t.capacity!==void 0&&(n.capacity=t.capacity),t.description&&(n.description=t.description),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function bt(t){let n=t.command("events").description("Eventfullymanaged events");n.command("list").description("List events").option("--search <q>","Free-text search").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(N,{search:e.search,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedEvents.items,{headers:["ID","Name","Type","Status","Start","End"],rows:i.eventfullyManagedEvents.items.map(o=>[p(o.id,12),o.name,o.type,o.status,E(o.startAt),E(o.endAt)])});}catch(i){a(i);}}),n.command("get").description("Get an event by id").argument("<id>","Event ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(P,{id:e});if(!o.eventfullyManagedEvent)throw new m(`Event ${e} not found`);s(i,o.eventfullyManagedEvent);}catch(o){a(o);}}),n.command("create").description("Create an event").requiredOption("--name <name>","Event name").requiredOption("--type <t>","Event type (e.g. conference, webinar)").requiredOption("--timezone <tz>","IANA timezone (e.g. Asia/Kolkata)").requiredOption("--start-at <iso>","Start (ISO datetime)").requiredOption("--end-at <iso>","End (ISO datetime)").option("--status <s>","Event status").option("--visibility <v>","Visibility (e.g. public, private)").option("--capacity <n>","Capacity",d).option("--description <s>","Description").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(_,{input:Tt(e)});c(`Event created: ${i.eventfullyManagedCreateEvent.name}`),s(e,i.eventfullyManagedCreateEvent);}catch(i){a(i);}}),n.command("update").description("Update an event (the subgraph input requires the core fields)").argument("<id>","Event ID").requiredOption("--name <name>","Event name").requiredOption("--type <t>","Event type").requiredOption("--timezone <tz>","IANA timezone").requiredOption("--start-at <iso>","Start (ISO datetime)").requiredOption("--end-at <iso>","End (ISO datetime)").option("--status <s>","Event status").option("--visibility <v>","Visibility").option("--capacity <n>","Capacity",d).option("--description <s>","Description").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(q,{id:e,input:Tt(i)});c("Event updated"),s(i,o.eventfullyManagedUpdateEvent);}catch(o){a(o);}}),n.command("remove").description("Delete an event").argument("<id>","Event ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(U,{id:e});c(o.eventfullyManagedDeleteEvent?"Event deleted":"Event not deleted"),s(i,{deleted:o.eventfullyManagedDeleteEvent});}catch(o){a(o);}});}function Ot(t){let n={name:t.name};return t.description&&(n.description=t.description),t.status&&(n.status=t.status),t.capacity!==void 0&&(n.capacity=t.capacity),t.addressLine1&&(n.addressLine1=t.addressLine1),t.city&&(n.city=t.city),t.state&&(n.state=t.state),t.country&&(n.country=t.country),t.postalCode&&(n.postalCode=t.postalCode),t.amenities&&(n.amenities=C(t.amenities)),t.openingHours&&(n.openingHours=l("opening-hours",t.openingHours)),t.pricing&&(n.pricing=l("pricing",t.pricing)),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function At(t){let n=t.command("venues").description("Eventfullymanaged venues");n.command("list").description("List venues").option("--search <q>","Free-text search").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(V,{search:e.search,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedVenues.items,{headers:["ID","Name","Status","City","Country","Capacity"],rows:i.eventfullyManagedVenues.items.map(o=>[p(o.id,12),o.name,o.status,o.city??"-",o.country??"-",o.capacity!=null?String(o.capacity):"-"])});}catch(i){a(i);}}),n.command("get").description("Get a venue by id").argument("<id>","Venue ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(F,{id:e});if(!o.eventfullyManagedVenue)throw new m(`Venue ${e} not found`);s(i,o.eventfullyManagedVenue);}catch(o){a(o);}}),n.command("create").description("Create a venue").requiredOption("--name <name>","Venue name").option("--description <s>","Description").option("--status <s>","Venue status").option("--capacity <n>","Capacity",d).option("--address <s>","Address line 1").option("--city <s>","City").option("--state <s>","State").option("--country <s>","Country").option("--postal-code <s>","Postal code").option("--amenities <csv>","Comma-separated amenities").option("--opening-hours <json>","Opening hours JSON").option("--pricing <json>","Pricing JSON").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(j,{input:Ot({...e,addressLine1:e.address})});c(`Venue created: ${i.eventfullyManagedCreateVenue.name}`),s(e,i.eventfullyManagedCreateVenue);}catch(i){a(i);}}),n.command("update").description("Update a venue").argument("<id>","Venue ID").requiredOption("--name <name>","Venue name").option("--description <s>","Description").option("--status <s>","Venue status").option("--capacity <n>","Capacity",d).option("--address <s>","Address line 1").option("--city <s>","City").option("--state <s>","State").option("--country <s>","Country").option("--postal-code <s>","Postal code").option("--amenities <csv>","Comma-separated amenities").option("--opening-hours <json>","Opening hours JSON").option("--pricing <json>","Pricing JSON").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(W,{id:e,input:Ot({...i,addressLine1:i.address})});c("Venue updated"),s(i,o.eventfullyManagedUpdateVenue);}catch(o){a(o);}}),n.command("remove").description("Delete a venue").argument("<id>","Venue ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(J,{id:e});c(o.eventfullyManagedDeleteVenue?"Venue deleted":"Venue not deleted"),s(i,{deleted:o.eventfullyManagedDeleteVenue});}catch(o){a(o);}});}function Dt(t){let n={eventId:t.event,name:t.name,level:t.level};return t.logoUrl&&(n.logoUrl=t.logoUrl),t.website&&(n.website=t.website),t.contactName&&(n.contactName=t.contactName),t.contactEmail&&(n.contactEmail=t.contactEmail),t.contactPhone&&(n.contactPhone=t.contactPhone),t.metrics&&(n.metrics=l("metrics",t.metrics)),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function xt(t){let n=t.command("sponsors").description("Eventfullymanaged sponsors");n.command("list").description("List sponsors").option("--event <id>","Filter by event ID").option("--search <q>","Free-text search").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(z,{eventId:e.event,search:e.search,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedSponsors.items,{headers:["ID","Name","Level","Event","Website"],rows:i.eventfullyManagedSponsors.items.map(o=>[p(o.id,12),o.name,o.level,p(o.eventId,12),o.website??"-"])});}catch(i){a(i);}}),n.command("get").description("Get a sponsor by id").argument("<id>","Sponsor ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(G,{id:e});if(!o.eventfullyManagedSponsor)throw new m(`Sponsor ${e} not found`);s(i,o.eventfullyManagedSponsor);}catch(o){a(o);}}),n.command("create").description("Create a sponsor").requiredOption("--event <id>","Event ID").requiredOption("--name <name>","Sponsor name").requiredOption("--level <l>","Sponsorship level (e.g. gold, silver)").option("--logo-url <url>","Logo URL").option("--website <url>","Website").option("--contact-name <s>","Contact name").option("--contact-email <s>","Contact email").option("--contact-phone <s>","Contact phone").option("--metrics <json>","Metrics JSON").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(H,{input:Dt(e)});c(`Sponsor created: ${i.eventfullyManagedCreateSponsor.name}`),s(e,i.eventfullyManagedCreateSponsor);}catch(i){a(i);}}),n.command("update").description("Update a sponsor").argument("<id>","Sponsor ID").requiredOption("--event <id>","Event ID").requiredOption("--name <name>","Sponsor name").requiredOption("--level <l>","Sponsorship level").option("--logo-url <url>","Logo URL").option("--website <url>","Website").option("--contact-name <s>","Contact name").option("--contact-email <s>","Contact email").option("--contact-phone <s>","Contact phone").option("--metrics <json>","Metrics JSON").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(B,{id:e,input:Dt(i)});c("Sponsor updated"),s(i,o.eventfullyManagedUpdateSponsor);}catch(o){a(o);}}),n.command("remove").description("Delete a sponsor").argument("<id>","Sponsor ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(K,{id:e});c(o.eventfullyManagedDeleteSponsor?"Sponsor deleted":"Sponsor not deleted"),s(i,{deleted:o.eventfullyManagedDeleteSponsor});}catch(o){a(o);}});}function $t(t){let n={eventId:t.event,fullName:t.fullName,email:t.email};return t.phone&&(n.phone=t.phone),t.company&&(n.company=t.company),t.role&&(n.role=t.role),t.tags&&(n.tags=C(t.tags)),t.profile&&(n.profile=l("profile",t.profile)),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function Mt(t){let n=t.command("attendees").description("Eventfullymanaged attendees");n.command("list").description("List attendees").option("--event <id>","Filter by event ID").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(Y,{eventId:e.event,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedAttendees.items,{headers:["ID","Name","Email","Company","Role"],rows:i.eventfullyManagedAttendees.items.map(o=>[p(o.id,12),o.fullName,o.email,o.company??"-",o.role??"-"])});}catch(i){a(i);}}),n.command("create").description("Create an attendee").requiredOption("--event <id>","Event ID").requiredOption("--full-name <name>","Full name").requiredOption("--email <email>","Email").option("--phone <s>","Phone").option("--company <s>","Company").option("--role <s>","Role").option("--tags <csv>","Comma-separated tags").option("--profile <json>","Profile JSON").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(X,{input:$t(e)});c(`Attendee created: ${i.eventfullyManagedCreateAttendee.fullName}`),s(e,i.eventfullyManagedCreateAttendee);}catch(i){a(i);}}),n.command("update").description("Update an attendee").argument("<id>","Attendee ID").requiredOption("--event <id>","Event ID").requiredOption("--full-name <name>","Full name").requiredOption("--email <email>","Email").option("--phone <s>","Phone").option("--company <s>","Company").option("--role <s>","Role").option("--tags <csv>","Comma-separated tags").option("--profile <json>","Profile JSON").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(Q,{id:e,input:$t(i)});c("Attendee updated"),s(i,o.eventfullyManagedUpdateAttendee);}catch(o){a(o);}});}function Rt(t){let n={eventId:t.event,title:t.title,sessionType:t.sessionType,startsAt:t.startsAt,endsAt:t.endsAt};return t.description&&(n.description=t.description),t.status&&(n.status=t.status),t.track&&(n.track=t.track),t.capacity!==void 0&&(n.capacity=t.capacity),t.venue&&(n.venueId=t.venue),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function Lt(t){let n=t.command("sessions").description("Eventfullymanaged event sessions");n.command("list").description("List event sessions").option("--event <id>","Filter by event ID").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,100).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(Z,{eventId:e.event,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedEventSessions.items,{headers:["ID","Title","Type","Status","Track","Starts"],rows:i.eventfullyManagedEventSessions.items.map(o=>[p(o.id,12),o.title,o.sessionType,o.status,o.track??"-",E(o.startsAt)])});}catch(i){a(i);}}),n.command("create").description("Create an event session").requiredOption("--event <id>","Event ID").requiredOption("--title <title>","Session title").requiredOption("--session-type <t>","Session type (e.g. talk, workshop)").requiredOption("--starts-at <iso>","Start (ISO datetime)").requiredOption("--ends-at <iso>","End (ISO datetime)").option("--description <s>","Description").option("--status <s>","Status").option("--track <s>","Track").option("--capacity <n>","Capacity",d).option("--venue <id>","Venue ID").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(tt,{input:Rt(e)});c(`Session created: ${i.eventfullyManagedCreateEventSession.title}`),s(e,i.eventfullyManagedCreateEventSession);}catch(i){a(i);}}),n.command("update").description("Update an event session").argument("<id>","Session ID").requiredOption("--event <id>","Event ID").requiredOption("--title <title>","Session title").requiredOption("--session-type <t>","Session type").requiredOption("--starts-at <iso>","Start (ISO datetime)").requiredOption("--ends-at <iso>","End (ISO datetime)").option("--description <s>","Description").option("--status <s>","Status").option("--track <s>","Track").option("--capacity <n>","Capacity",d).option("--venue <id>","Venue ID").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(et,{id:e,input:Rt(i)});c("Session updated"),s(i,o.eventfullyManagedUpdateEventSession);}catch(o){a(o);}});}function Nt(t){let n={eventId:t.event,name:t.name,price:t.price};return t.currency&&(n.currency=t.currency),t.description&&(n.description=t.description),t.capacity!==void 0&&(n.capacity=t.capacity),t.soldCount!==void 0&&(n.soldCount=t.soldCount),t.active!==void 0&&(n.isActive=t.active),t.salesStartAt&&(n.salesStartAt=t.salesStartAt),t.salesEndAt&&(n.salesEndAt=t.salesEndAt),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function Pt(t){let n=t.command("tickets").description("Eventfullymanaged ticket types");n.command("list").description("List ticket types").option("--event <id>","Filter by event ID").option("--search <q>","Free-text search").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(nt,{eventId:e.event,search:e.search,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedTicketTypes.items,{headers:["ID","Name","Price","Currency","Active","Sold"],rows:i.eventfullyManagedTicketTypes.items.map(o=>[p(o.id,12),o.name,o.price,o.currency,o.isActive?"yes":"no",String(o.soldCount)])});}catch(i){a(i);}}),n.command("create").description("Create a ticket type").requiredOption("--event <id>","Event ID").requiredOption("--name <name>","Ticket type name").requiredOption("--price <amount>","Price (decimal string)").option("--currency <c>","Currency code").option("--description <s>","Description").option("--capacity <n>","Capacity",d).option("--sold-count <n>","Sold count",d).option("--active <bool>","true|false",e=>e==="true").option("--sales-start-at <iso>","Sales start (ISO datetime)").option("--sales-end-at <iso>","Sales end (ISO datetime)").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(ot,{input:Nt(e)});c(`Ticket type created: ${i.eventfullyManagedCreateTicketType.name}`),s(e,i.eventfullyManagedCreateTicketType);}catch(i){a(i);}}),n.command("update").description("Update a ticket type").argument("<id>","Ticket type ID").requiredOption("--event <id>","Event ID").requiredOption("--name <name>","Ticket type name").requiredOption("--price <amount>","Price (decimal string)").option("--currency <c>","Currency code").option("--description <s>","Description").option("--capacity <n>","Capacity",d).option("--sold-count <n>","Sold count",d).option("--active <bool>","true|false",e=>e==="true").option("--sales-start-at <iso>","Sales start (ISO datetime)").option("--sales-end-at <iso>","Sales end (ISO datetime)").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(it,{id:e,input:Nt(i)});c("Ticket type updated"),s(i,o.eventfullyManagedUpdateTicketType);}catch(o){a(o);}}),n.command("remove").description("Delete a ticket type").argument("<id>","Ticket type ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(rt,{id:e});c(o.eventfullyManagedDeleteTicketType?"Ticket type deleted":"Ticket type not deleted"),s(i,{deleted:o.eventfullyManagedDeleteTicketType});}catch(o){a(o);}});}function _t(t){let n={eventId:t.event};return t.attendee&&(n.attendeeId=t.attendee),t.ticketType&&(n.ticketTypeId=t.ticketType),t.quantity!==void 0&&(n.quantity=t.quantity),t.status&&(n.status=t.status),t.totalAmount&&(n.totalAmount=t.totalAmount),t.currency&&(n.currency=t.currency),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function qt(t){let n=t.command("registrations").description("Eventfullymanaged registrations");n.command("list").description("List registrations").option("--event <id>","Filter by event ID").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(at,{eventId:e.event,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedRegistrations.items,{headers:["ID","Event","Attendee","Status","Qty","Total"],rows:i.eventfullyManagedRegistrations.items.map(o=>[p(o.id,12),p(o.eventId,12),o.attendeeId?p(o.attendeeId,12):"-",o.status,String(o.quantity),o.totalAmount??"-"])});}catch(i){a(i);}}),n.command("create").description("Create a registration").requiredOption("--event <id>","Event ID").option("--attendee <id>","Attendee ID").option("--ticket-type <id>","Ticket type ID").option("--quantity <n>","Quantity",d).option("--status <s>","Status").option("--total-amount <amount>","Total amount (decimal string)").option("--currency <c>","Currency code").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(st,{input:_t(e)});c(`Registration created: ${i.eventfullyManagedCreateRegistration.id}`),s(e,i.eventfullyManagedCreateRegistration);}catch(i){a(i);}}),n.command("update").description("Update a registration").argument("<id>","Registration ID").requiredOption("--event <id>","Event ID").option("--attendee <id>","Attendee ID").option("--ticket-type <id>","Ticket type ID").option("--quantity <n>","Quantity",d).option("--status <s>","Status").option("--total-amount <amount>","Total amount (decimal string)").option("--currency <c>","Currency code").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(dt,{id:e,input:_t(i)});c("Registration updated"),s(i,o.eventfullyManagedUpdateRegistration);}catch(o){a(o);}});}function Ut(t){let n={fullName:t.fullName};return t.title&&(n.title=t.title),t.organization&&(n.organization=t.organization),t.bio&&(n.bio=t.bio),t.email&&(n.email=t.email),t.phone&&(n.phone=t.phone),t.avatarUrl&&(n.avatarUrl=t.avatarUrl),t.socialLinks&&(n.socialLinks=l("social-links",t.socialLinks)),n}function Vt(t){let n=t.command("speakers").description("Eventfullymanaged speakers");n.command("list").description("List speakers").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,100).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(ct,{workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedSpeakers.items,{headers:["ID","Name","Title","Organization","Email"],rows:i.eventfullyManagedSpeakers.items.map(o=>[p(o.id,12),o.fullName,o.title??"-",o.organization??"-",o.email??"-"])});}catch(i){a(i);}}),n.command("create").description("Create a speaker").requiredOption("--full-name <name>","Full name").option("--title <s>","Title").option("--organization <s>","Organization").option("--bio <s>","Bio").option("--email <s>","Email").option("--phone <s>","Phone").option("--avatar-url <url>","Avatar URL").option("--social-links <json>","Social links JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(ut,{input:Ut(e)});c(`Speaker created: ${i.eventfullyManagedCreateSpeaker.fullName}`),s(e,i.eventfullyManagedCreateSpeaker);}catch(i){a(i);}}),n.command("update").description("Update a speaker").argument("<id>","Speaker ID").requiredOption("--full-name <name>","Full name").option("--title <s>","Title").option("--organization <s>","Organization").option("--bio <s>","Bio").option("--email <s>","Email").option("--phone <s>","Phone").option("--avatar-url <url>","Avatar URL").option("--social-links <json>","Social links JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(pt,{id:e,input:Ut(i)});c("Speaker updated"),s(i,o.eventfullyManagedUpdateSpeaker);}catch(o){a(o);}});}function Ft(t){let n={eventId:t.event,name:t.name};return t.boothCode&&(n.boothCode=t.boothCode),t.category&&(n.category=t.category),t.contactName&&(n.contactName=t.contactName),t.contactEmail&&(n.contactEmail=t.contactEmail),t.status&&(n.status=t.status),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function jt(t){let n=t.command("exhibitors").description("Eventfullymanaged exhibitors");n.command("list").description("List exhibitors").option("--event <id>","Filter by event ID").option("--search <q>","Free-text search").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(lt,{eventId:e.event,search:e.search,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedExhibitors.items,{headers:["ID","Name","Status","Booth","Category"],rows:i.eventfullyManagedExhibitors.items.map(o=>[p(o.id,12),o.name,o.status,o.boothCode??"-",o.category??"-"])});}catch(i){a(i);}}),n.command("create").description("Create an exhibitor").requiredOption("--event <id>","Event ID").requiredOption("--name <name>","Exhibitor name").option("--booth-code <s>","Booth code").option("--category <s>","Category").option("--contact-name <s>","Contact name").option("--contact-email <s>","Contact email").option("--status <s>","Status").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(mt,{input:Ft(e)});c(`Exhibitor created: ${i.eventfullyManagedCreateExhibitor.name}`),s(e,i.eventfullyManagedCreateExhibitor);}catch(i){a(i);}}),n.command("update").description("Update an exhibitor").argument("<id>","Exhibitor ID").requiredOption("--event <id>","Event ID").requiredOption("--name <name>","Exhibitor name").option("--booth-code <s>","Booth code").option("--category <s>","Category").option("--contact-name <s>","Contact name").option("--contact-email <s>","Contact email").option("--status <s>","Status").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(gt,{id:e,input:Ft(i)});c("Exhibitor updated"),s(i,o.eventfullyManagedUpdateExhibitor);}catch(o){a(o);}}),n.command("remove").description("Delete an exhibitor").argument("<id>","Exhibitor ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(ft,{id:e});c(o.eventfullyManagedDeleteExhibitor?"Exhibitor deleted":"Exhibitor not deleted"),s(i,{deleted:o.eventfullyManagedDeleteExhibitor});}catch(o){a(o);}});}function Wt(t){let n={eventId:t.event,attendeeName:t.attendeeName,attendeeEmail:t.attendeeEmail};return t.exhibitor&&(n.exhibitorId=t.exhibitor),t.sponsor&&(n.sponsorId=t.sponsor),t.status&&(n.status=t.status),t.score!==void 0&&(n.score=t.score),t.notes&&(n.notes=t.notes),t.capturedAt&&(n.capturedAt=t.capturedAt),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function Jt(t){let n=t.command("leads").description("Eventfullymanaged exhibitor leads");n.command("list").description("List leads").option("--event <id>","Filter by event ID").option("--search <q>","Free-text search").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(yt,{eventId:e.event,search:e.search,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedLeads.items,{headers:["ID","Name","Email","Status","Score"],rows:i.eventfullyManagedLeads.items.map(o=>[p(o.id,12),o.attendeeName,o.attendeeEmail,o.status,o.score!=null?String(o.score):"-"])});}catch(i){a(i);}}),n.command("create").description("Create a lead").requiredOption("--event <id>","Event ID").requiredOption("--attendee-name <name>","Attendee name").requiredOption("--attendee-email <email>","Attendee email").option("--exhibitor <id>","Exhibitor ID").option("--sponsor <id>","Sponsor ID").option("--status <s>","Status").option("--score <n>","Score",d).option("--notes <s>","Notes").option("--captured-at <iso>","Captured at (ISO datetime)").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(vt,{input:Wt(e)});c(`Lead created: ${i.eventfullyManagedCreateLead.attendeeName}`),s(e,i.eventfullyManagedCreateLead);}catch(i){a(i);}}),n.command("update").description("Update a lead").argument("<id>","Lead ID").requiredOption("--event <id>","Event ID").requiredOption("--attendee-name <name>","Attendee name").requiredOption("--attendee-email <email>","Attendee email").option("--exhibitor <id>","Exhibitor ID").option("--sponsor <id>","Sponsor ID").option("--status <s>","Status").option("--score <n>","Score",d).option("--notes <s>","Notes").option("--captured-at <iso>","Captured at (ISO datetime)").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(Et,{id:e,input:Wt(i)});c("Lead updated"),s(i,o.eventfullyManagedUpdateLead);}catch(o){a(o);}}),n.command("remove").description("Delete a lead").argument("<id>","Lead ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(It,{id:e});c(o.eventfullyManagedDeleteLead?"Lead deleted":"Lead not deleted"),s(i,{deleted:o.eventfullyManagedDeleteLead});}catch(o){a(o);}});}function zt(t){let n={eventId:t.event,code:t.code,discountType:t.discountType,discountValue:t.discountValue};return t.description&&(n.description=t.description),t.maxUses!==void 0&&(n.maxUses=t.maxUses),t.usedCount!==void 0&&(n.usedCount=t.usedCount),t.active!==void 0&&(n.isActive=t.active),t.startsAt&&(n.startsAt=t.startsAt),t.endsAt&&(n.endsAt=t.endsAt),t.metadata&&(n.metadata=l("metadata",t.metadata)),n}function Gt(t){let n=t.command("promo-codes").description("Eventfullymanaged promo codes");n.command("list").description("List promo codes").option("--event <id>","Filter by event ID").option("--search <q>","Free-text search").option("--workspace <id>","Filter by workspace ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(kt,{eventId:e.event,search:e.search,workspaceId:e.workspace,limit:e.limit,offset:e.offset});s(e,i.eventfullyManagedPromoCodes.items,{headers:["ID","Code","Type","Value","Active","Used"],rows:i.eventfullyManagedPromoCodes.items.map(o=>[p(o.id,12),o.code,o.discountType,o.discountValue,o.isActive?"yes":"no",String(o.usedCount)])});}catch(i){a(i);}}),n.command("create").description("Create a promo code").requiredOption("--event <id>","Event ID").requiredOption("--code <code>","Promo code").requiredOption("--discount-type <t>","Discount type (e.g. percentage, fixed)").requiredOption("--discount-value <v>","Discount value (string)").option("--description <s>","Description").option("--max-uses <n>","Max uses",d).option("--used-count <n>","Used count",d).option("--active <bool>","true|false",e=>e==="true").option("--starts-at <iso>","Starts at (ISO datetime)").option("--ends-at <iso>","Ends at (ISO datetime)").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(wt,{input:zt(e)});c(`Promo code created: ${i.eventfullyManagedCreatePromoCode.code}`),s(e,i.eventfullyManagedCreatePromoCode);}catch(i){a(i);}}),n.command("update").description("Update a promo code").argument("<id>","Promo code ID").requiredOption("--event <id>","Event ID").requiredOption("--code <code>","Promo code").requiredOption("--discount-type <t>","Discount type").requiredOption("--discount-value <v>","Discount value (string)").option("--description <s>","Description").option("--max-uses <n>","Max uses",d).option("--used-count <n>","Used count",d).option("--active <bool>","true|false",e=>e==="true").option("--starts-at <iso>","Starts at (ISO datetime)").option("--ends-at <iso>","Ends at (ISO datetime)").option("--metadata <json>","Metadata JSON").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(Ct,{id:e,input:zt(i)});c("Promo code updated"),s(i,o.eventfullyManagedUpdatePromoCode);}catch(o){a(o);}}),n.command("remove").description("Delete a promo code").argument("<id>","Promo code ID").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let o=await r(ht,{id:e});c(o.eventfullyManagedDeletePromoCode?"Promo code deleted":"Promo code not deleted"),s(i,{deleted:o.eventfullyManagedDeletePromoCode});}catch(o){a(o);}});}function Ht(t){t.command("analytics").description("Eventfullymanaged analytics & dashboard").command("dashboard").description("Dashboard summary (event/attendee/registration/sponsor/venue counts + latest events)").option("--workspace <id>","Filter by workspace ID").option("-f, --format <format>","Output format").action(async e=>{try{let i=await r(St,{workspaceId:e.workspace});s(e,i.eventfullyManagedDashboardSummary);}catch(i){a(i);}});}var ae={id:"eventfullymanaged",version:"1.0.0",displayName:"Eventfullymanaged",dependsOn:["auth","workspaces"],register(t,n){L(n);let e=t.command("eventfullymanaged").description("Eventfullymanaged event-management platform");bt(e),At(e),xt(e),Mt(e),Lt(e),Pt(e),qt(e),Vt(e),jt(e),Jt(e),Gt(e),Ht(e);}},mo=ae;module.exports=mo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,b,h as h$1,p,o,g,i}from'../../chunk-
|
|
1
|
+
import {a,b,h as h$1,p,o,g,i}from'../../chunk-NLEVVDXR.js';import {o as o$1}from'../../chunk-IZXPWPKX.js';var v=`
|
|
2
2
|
id name description type status visibility timezone startAt endAt capacity
|
|
3
3
|
metadata createdAt updatedAt workspaceId
|
|
4
4
|
`,$=`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var promises=require('fs/promises');var s=class extends Error{exitCode;hint;constructor(r,a){super(r),this.name="CliUserError",this.exitCode=a?.exitCode??1,this.hint=a?.hint;}},E=class extends s{constructor(r,a){super(r,{exitCode:2,hint:a?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},x=class extends Error{cause;constructor(r,a){super(r),this.name="CliInternalError",this.cause=a;}};var y=null;function k(o){y=o;}function f(){if(!y)throw new x("vibecontrols module helpers used before setHelpersContext was called");return y}function tt(){let o=f();if(!o.auth.isAuthenticated())throw new E(
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var promises=require('fs/promises');var s=class extends Error{exitCode;hint;constructor(r,a){super(r),this.name="CliUserError",this.exitCode=a?.exitCode??1,this.hint=a?.hint;}},E=class extends s{constructor(r,a){super(r,{exitCode:2,hint:a?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},x=class extends Error{cause;constructor(r,a){super(r),this.name="CliInternalError",this.cause=a;}};var y=null;function k(o){y=o;}function f(){if(!y)throw new x("vibecontrols module helpers used before setHelpersContext was called");return y}function tt(){let o=f();if(!o.auth.isAuthenticated())throw new E("Authentication required.",{hint:`Run \`${o.productName} auth login\` to authenticate.`})}async function c(o,r){return tt(),f().gql.workspace.request(o,r)}function p(o){let r=o instanceof Error?o.message:String(o);throw new s(r)}function g(o,r,a){f().output.formatAndOutput(o,r,a);}function m(o){f().output.printSuccess(o);}function I(o){f().output.printInfo(o);}function v(o){return f().output.formatStatus(o)}function A(o){return f().output.formatDate(o)}function O(o,r){return f().output.truncate(o,r)}function $(){return f()}var P=`
|
|
2
2
|
query ListExportJobs($context: ContextInput!, $filter: ExportJobFilterInput, $pagination: ExportPaginationInput) {
|
|
3
3
|
listExportJobs(context: $context, filter: $filter, pagination: $pagination) {
|
|
4
4
|
edges { node {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
downloadUrl downloadExpiresAt totalSizeBytes
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
`,
|
|
18
|
+
`,S=`
|
|
19
19
|
mutation CreateExportJob($context: ContextInput!, $input: CreateExportJobInput!) {
|
|
20
20
|
createExportJob(context: $context, input: $input) {
|
|
21
21
|
id status progress entityTypes
|
|
@@ -92,4 +92,4 @@
|
|
|
92
92
|
downloadUrl downloadExpiresAt
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
`;function d(){let o
|
|
95
|
+
`;function d(){let o=$().auth.read();if(!o?.workspaceId)throw new s("No workspace set. Run: vibecontrols workspace set <id>");return {workspaceId:o.workspaceId}}function F(o){let r=o.command("export").description("Workspace data export jobs"),a=r.command("jobs").description("Export job lifecycle");a.command("list").description("List export jobs").option("--status <s>").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let e={};t.status&&(e.status=t.status.toUpperCase());let i=(await c(P,{context:d(),filter:Object.keys(e).length?e:void 0,pagination:{first:t.limit}})).listExportJobs.edges.map(l=>l.node);g(t,i,{headers:["ID","Name","Status","Progress","Started"],rows:i.map(l=>[O(l.id,12),l.name??"-",v(l.status),`${l.processedEntities??0}/${l.totalEntities??"-"}`,A(l.startedAt)])});}catch(e){p(e);}}),a.command("get").description("Get an export job").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await c(T,{context:d(),id:t});if(!n.getExportJob)throw new s(`Export job ${t} not found`);g(e,n.getExportJob);}catch(n){p(n);}}),a.command("create").description("Create an export job").requiredOption("--name <s>").requiredOption("--types <t>","Comma-separated entity types").option("--format <fmt>","JSON|CSV|ZIP","JSON").option("--include-media","Include media files",false).option("--include-metadata","Include metadata",true).option("--from <iso>","Date range start").option("--to <iso>","Date range end").option("-f, --format-output <format>").action(async t=>{try{let e={name:t.name,entityTypes:t.types.split(","),format:(t.format??"JSON").toUpperCase(),includeMedia:!!t.includeMedia,includeMetadata:t.includeMetadata!==!1,dateRangeStart:t.from,dateRangeEnd:t.to},n=await c(S,{context:d(),input:e});m(`Export job created: ${n.createExportJob.id}`),g({format:t.formatOutput},n.createExportJob);}catch(e){p(e);}}),a.command("cancel").description("Cancel a running export job").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await c(_,{context:d(),id:t});m(`Export job cancelled: ${n.cancelExportJob.id}`),g(e,n.cancelExportJob);}catch(n){p(n);}}),a.command("delete").description("Delete an export job").argument("<id>").action(async t=>{try{if(!(await c(L,{context:d(),id:t})).deleteExportJob)throw new s(`Failed to delete export job ${t}`);m(`Export job deleted: ${t}`);}catch(e){p(e);}}),a.command("retry").description("Retry a failed export job").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await c(N,{context:d(),id:t});m(`Export job retry queued: ${n.retryExportJob.id}`),g(e,n.retryExportJob);}catch(n){p(n);}}),r.command("entities").description("List entity types available for export").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let n=(await c(j,{context:d(),pagination:{first:t.limit}})).getAvailableExportEntities.edges.map(i=>i.node);g(t,n,{headers:["Type","Display","Enabled","DateRange","Media","Size"],rows:n.map(i=>[i.entityType,i.displayName,i.enabled?"yes":"no",i.supportsDateRange?"yes":"no",i.supportsMediaExport?"yes":"no",i.estimatedSize??"-"])});}catch(e){p(e);}}),r.command("part").description("Get an export part by id").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await c(G,{context:d(),id:t});if(!n.getExportPart)throw new s(`Export part ${t} not found`);g(e,n.getExportPart);}catch(n){p(n);}}),r.command("download").description("Download a completed export job to a local path").argument("<jobId>").requiredOption("--to <path>","Local file path to write").action(async(t,e)=>{try{let n=await c(T,{context:d(),id:t});if(!n.getExportJob)throw new s(`Export job ${t} not found`);let i=n.getExportJob.downloadUrl;if(!i)throw new s(`Job ${t} has no downloadUrl yet (status=${n.getExportJob.status??"UNKNOWN"}).`);I(`Downloading from ${i}`);let l=await fetch(i);if(!l.ok)throw new s(`Download failed: ${l.status} ${l.statusText}`);let h=Buffer.from(await l.arrayBuffer());await promises.writeFile(e.to,h),m(`Saved ${h.length} bytes to ${e.to}`);}catch(n){p(n);}});let w=r.command("templates").description("Export templates");w.command("list").description("List export templates").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let e=await c(R,{context:d(),pagination:{first:t.limit}});g(t,e.listExportTemplates.edges.map(n=>n.node));}catch(e){p(e);}}),w.command("get").description("Get an export template").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await c(D,{context:d(),id:t});if(!n.getExportTemplate)throw new s(`Template ${t} not found`);g(e,n.getExportTemplate);}catch(n){p(n);}}),w.command("create").description("Create an export template").requiredOption("--name <s>").requiredOption("--types <t>","Comma-separated entity types").option("--description <s>").option("--format <fmt>","JSON|CSV","JSON").option("--include-media","Include media files",false).option("--include-metadata","Include metadata",true).option("-f, --format-output <format>").action(async t=>{try{let e={name:t.name,entityTypes:t.types.split(","),format:(t.format??"JSON").toUpperCase(),includeMedia:!!t.includeMedia,includeMetadata:t.includeMetadata!==!1};t.description&&(e.description=t.description);let n=await c(q,{context:d(),input:e});m(`Template created: ${n.createExportTemplate.id}`),g({format:t.formatOutput},n.createExportTemplate);}catch(e){p(e);}}),w.command("update").description("Update an export template").argument("<id>").option("--name <s>").option("--description <s>").option("--types <t>","Comma-separated entity types").option("--format <fmt>","JSON|CSV").option("--include-media <bool>","true|false").option("--include-metadata <bool>","true|false").option("--default <bool>","Set isDefault: true|false").option("-f, --format-output <format>").action(async(t,e)=>{try{let n={};e.name&&(n.name=e.name),e.description&&(n.description=e.description),e.types&&(n.entityTypes=e.types.split(",")),e.format&&(n.format=e.format.toUpperCase()),e.includeMedia!==void 0&&(n.includeMedia=e.includeMedia==="true"),e.includeMetadata!==void 0&&(n.includeMetadata=e.includeMetadata==="true"),e.default!==void 0&&(n.isDefault=e.default==="true");let i=await c(M,{context:d(),id:t,input:n});m(`Template updated: ${i.updateExportTemplate.id}`),g({format:e.formatOutput},i.updateExportTemplate);}catch(n){p(n);}}),w.command("delete").description("Delete an export template").argument("<id>").action(async t=>{try{if(!(await c(J,{context:d(),id:t})).deleteExportTemplate)throw new s(`Failed to delete template ${t}`);m(`Template deleted: ${t}`);}catch(e){p(e);}});}var ot={id:"export",version:"1.0.0",displayName:"Export",dependsOn:["auth","workspaces"],register(o,r){k(r),F(o);}},fe=ot;module.exports=fe;
|