@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,11 +1,11 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var l=class extends Error{exitCode;hint;constructor(c,s){super(c),this.name="CliUserError",this.exitCode=s?.exitCode??1,this.hint=s?.hint;}},m=class extends l{constructor(c,s){super(c,{exitCode:2,hint:s?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},f=class extends Error{cause;constructor(c,s){super(c),this.name="CliInternalError",this.cause=s;}};var x=null;function v(
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var l=class extends Error{exitCode;hint;constructor(c,s){super(c),this.name="CliUserError",this.exitCode=s?.exitCode??1,this.hint=s?.hint;}},m=class extends l{constructor(c,s){super(c,{exitCode:2,hint:s?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},f=class extends Error{cause;constructor(c,s){super(c),this.name="CliInternalError",this.cause=s;}};var x=null;function v(r){x=r;}function g(){if(!x)throw new f("vibecontrols module helpers used before setHelpersContext was called");return x}function le(){let r=g();if(!r.auth.isAuthenticated())throw new m("Authentication required.",{hint:`Run \`${r.productName} auth login\` to authenticate.`})}async function o(r,c){return le(),g().gql.workspace.request(r,c)}function i(r){let c=r instanceof Error?r.message:String(r);throw new l(c)}function d(r,c,s){g().output.formatAndOutput(r,c,s);}function u(r){g().output.printSuccess(r);}function T(r){return g().output.formatStatus(r)}function E(r){return g().output.formatDate(r)}function C(r,c){return g().output.truncate(r,c)}function D(){return g()}var O=`
|
|
2
2
|
query ListScheduledJobs($workspaceId: ID!, $filter: JobFilterInput, $pagination: SchedulerPaginationInput) {
|
|
3
3
|
scheduledJobs(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {
|
|
4
4
|
jobs { id name status scheduleType nextExecutionAt createdAt }
|
|
5
5
|
total nextCursor
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
`,
|
|
8
|
+
`,A=`
|
|
9
9
|
query GetScheduledJob($id: ID!) {
|
|
10
10
|
scheduledJob(id: $id) {
|
|
11
11
|
id name status scheduleType cronExpression executorType
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
mutation DeleteScheduledJob($id: ID!) {
|
|
23
23
|
deleteScheduledJob(id: $id)
|
|
24
24
|
}
|
|
25
|
-
`,
|
|
25
|
+
`,R=`
|
|
26
26
|
query JobExecutions($jobId: ID!, $pagination: SchedulerPaginationInput) {
|
|
27
27
|
jobExecutions(jobId: $jobId, pagination: $pagination) {
|
|
28
28
|
executions { id status startedAt completedAt duration errorMessage success }
|
|
29
29
|
total nextCursor
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
`,
|
|
32
|
+
`,_=`
|
|
33
33
|
mutation PauseScheduledJob($id: ID!) {
|
|
34
34
|
pauseScheduledJob(id: $id) { id name status }
|
|
35
35
|
}
|
|
@@ -139,4 +139,4 @@
|
|
|
139
139
|
query GetScheduledJobTags($input: GetScheduledJobTagsInput!) {
|
|
140
140
|
getScheduledJobTags(input: $input) { id entityId tagId source }
|
|
141
141
|
}
|
|
142
|
-
`;function w(){let
|
|
142
|
+
`;function w(){let r=D().auth.read();if(!r?.workspaceId)throw new l("No workspace set. Run: vibecontrols workspace set <id>");return r.workspaceId}function Z(r){let c=r.command("scheduler").description("Scheduled jobs & executions"),s=c.command("jobs").description("Manage scheduled jobs");s.command("list").description("List scheduled jobs").option("--status <s>").option("--type <t>","CRON|INTERVAL|ONCE").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t={};e.status&&(t.status=e.status.toUpperCase()),e.type&&(t.scheduleType=e.type.toUpperCase());let n=await o(O,{workspaceId:w(),filter:Object.keys(t).length?t:void 0,pagination:{first:e.limit}});d(e,n.scheduledJobs.jobs,{headers:["ID","Name","Status","Type","NextRun","Created"],rows:n.scheduledJobs.jobs.map(a=>[C(a.id,12),a.name,T(a.status),a.scheduleType??"-",E(a.nextExecutionAt),E(a.createdAt)])});}catch(t){i(t);}}),s.command("get").description("Get a scheduled job").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await o(A,{id:e});if(!n.scheduledJob)throw new l(`Job ${e} not found`);d(t,n.scheduledJob);}catch(n){i(n);}}),s.command("create").description("Create a scheduled job").requiredOption("--name <name>").requiredOption("--type <t>","CRON|FIXED_INTERVAL|ONE_TIME|RRULE|WINDOWED").option("--cron <expr>","Cron expression (for CRON)").option("--interval-seconds <n>","",e=>parseInt(e,10)).option("--executor <e>","WEBHOOK|GRAPHQL|INTERNAL_API|NATS_TOPIC","WEBHOOK").option("--executor-config <json>","Executor config JSON","{}").option("-f, --format <format>").action(async e=>{try{let t={INTERVAL:"FIXED_INTERVAL",ONCE:"ONE_TIME"},n=e.type.toUpperCase(),a={name:e.name,scheduleType:t[n]??n,cronExpression:e.cron,intervalSeconds:e.intervalSeconds,executorType:(e.executor??"WEBHOOK").toUpperCase(),executorConfig:JSON.parse(e.executorConfig??"{}")},I=await o($,{workspaceId:w(),input:a});u(`Job created: ${I.createScheduledJob.name}`),d(e,I.createScheduledJob);}catch(t){i(t);}}),s.command("delete").description("Delete a scheduled job").argument("<id>").action(async e=>{try{await o(L,{id:e}),u("Job deleted");}catch(t){i(t);}});let ee=c.command("executions").description("Job execution history");s.command("pause").description("Pause a scheduled job").argument("<id>").action(async e=>{try{await o(_,{id:e}),u("Job paused");}catch(t){i(t);}}),s.command("resume").description("Resume a paused scheduled job").argument("<id>").action(async e=>{try{await o(P,{id:e}),u("Job resumed");}catch(t){i(t);}}),s.command("activate").description("Activate a draft or disabled schedule").argument("<id>").action(async e=>{try{await o(N,{id:e}),u("Schedule activated");}catch(t){i(t);}}),s.command("archive").description("Archive a scheduled job").argument("<id>").action(async e=>{try{await o(J,{id:e}),u("Schedule archived");}catch(t){i(t);}}),s.command("disable").description("Disable a schedule (with optional reason)").argument("<id>").option("--reason <r>").action(async(e,t)=>{try{await o(U,{id:e,reason:t.reason??null}),u("Schedule disabled");}catch(n){i(n);}}),s.command("clone").description("Clone a schedule (optionally to another workspace; overrides JSON)").argument("<sourceId>").option("--workspace <id>").option("--overrides <json>","Overrides JSON for CreateScheduledJobInput").option("-f, --format <format>").action(async(e,t)=>{try{let n=await o(q,{sourceId:e,newWorkspaceId:t.workspace??null,overrides:t.overrides?JSON.parse(t.overrides):null});u(`Cloned: ${n.cloneSchedule.id}`),d(t,n.cloneSchedule);}catch(n){i(n);}}),s.command("execute-now").description("Execute a scheduled job immediately").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await o(H,{id:e});u("Execution dispatched"),d(t,n.executeJobNow);}catch(n){i(n);}}),s.command("preview").description("Preview upcoming execution times without creating a job").requiredOption("--type <t>","CRON|FIXED_INTERVAL|ONE_TIME|RRULE|WINDOWED").option("--cron <expr>").option("--rrule <r>").option("--interval <n>","",e=>parseInt(e,10)).option("--interval-unit <u>","SECONDS|MINUTES|HOURS|DAYS").option("--count <n>","",e=>parseInt(e,10),5).option("--start <iso>").option("--end <iso>").option("--timezone <tz>").option("-f, --format <format>").action(async e=>{try{let t=await o(j,{scheduleType:e.type.toUpperCase(),cronExpression:e.cron??null,rrule:e.rrule??null,interval:e.interval??null,intervalUnit:e.intervalUnit??null,count:e.count??null,startDate:e.start??null,endDate:e.end??null,timezone:e.timezone??null});d(e,t.previewSchedule);}catch(t){i(t);}});let y=s.command("tags").description("Scheduled-job tag assignments");y.command("add").description("Tag a scheduled job").requiredOption("--entity <id>").requiredOption("--tag <tagId>").option("--source <s>").action(async e=>{try{let t={entityId:e.entity,tagId:e.tag};e.source&&(t.source=e.source),await o(K,{input:t}),u("Tagged");}catch(t){i(t);}}),y.command("remove").description("Remove a tag from a scheduled job").requiredOption("--entity <id>").requiredOption("--tag <tagId>").action(async e=>{try{await o(Y,{input:{entityId:e.entity,tagId:e.tag}}),u("Tag removed");}catch(t){i(t);}}),y.command("replace").description("Replace all tags on a scheduled job").requiredOption("--entity <id>").requiredOption("--tags <ids>","Comma-separated tag IDs").option("-f, --format <format>").action(async e=>{try{let t=await o(X,{input:{entityId:e.entity,tagIds:e.tags.split(",")}});u("Tags replaced"),d(e,t.replaceScheduledJobTags);}catch(t){i(t);}}),y.command("list").description("List tags on a scheduled job").requiredOption("--entity <id>").option("-f, --format <format>").action(async e=>{try{let t=await o(Q,{input:{entityId:e.entity}});d(e,t.getScheduledJobTags);}catch(t){i(t);}});let h=c.command("templates").description("Schedule templates");h.command("list").description("List schedule templates in the active workspace").option("--category <c>").option("--public","Only public templates").option("-f, --format <format>").action(async e=>{try{let t={};e.category&&(t.category=e.category),e.public!==void 0&&(t.isPublic=e.public);let n=await o(W,{workspaceId:w(),filter:Object.keys(t).length?t:void 0,pagination:{first:100}});d(e,n.scheduleTemplates.templates);}catch(t){i(t);}}),h.command("get").description("Get a schedule template").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await o(G,{id:e});if(!n.scheduleTemplate)throw new l(`Template ${e} not found`);d(t,n.scheduleTemplate);}catch(n){i(n);}}),h.command("create").description("Create a schedule template").requiredOption("--name <name>").requiredOption("--type <t>","CRON|FIXED_INTERVAL|ONE_TIME|RRULE|WINDOWED").requiredOption("--executor <e>","WEBHOOK|INTERNAL_API|NATS_TOPIC|GRAPHQL").requiredOption("--schedule-config <json>").requiredOption("--executor-config <json>").option("--description <d>").option("--category <c>").option("--public","Make template public").option("-f, --format <format>").action(async e=>{try{let t={name:e.name,scheduleType:e.type.toUpperCase(),executorType:e.executor.toUpperCase(),scheduleConfig:JSON.parse(e.scheduleConfig),executorConfig:JSON.parse(e.executorConfig)};e.description&&(t.description=e.description),e.category&&(t.category=e.category),e.public!==void 0&&(t.isPublic=e.public);let n=await o(M,{workspaceId:w(),input:t});u("Template created"),d(e,n.createScheduleTemplate);}catch(t){i(t);}}),h.command("update").description("Update a schedule template").argument("<id>").option("--name <name>").option("--description <d>").option("--category <c>").option("--public","Toggle public").option("-f, --format <format>").action(async(e,t)=>{try{let n={};if(t.name!==void 0&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),t.category!==void 0&&(n.category=t.category),t.public!==void 0&&(n.isPublic=t.public),Object.keys(n).length===0)throw new l("Provide at least one field to update");let a=await o(B,{id:e,input:n});u("Template updated"),d(t,a.updateScheduleTemplate);}catch(n){i(n);}}),h.command("delete").description("Delete a schedule template").argument("<id>").action(async e=>{try{await o(F,{id:e}),u("Template deleted");}catch(t){i(t);}});let b=c.command("versions").description("Schedule version history");b.command("list").description("List version history for a schedule").argument("<scheduleId>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await o(V,{scheduleId:e});d(t,n.scheduleVersionHistory,{headers:["ID","Version","ChangedBy","Reason","CreatedAt"],rows:n.scheduleVersionHistory.map(a=>[C(a.id,12),String(a.version),a.changedBy,a.changeReason??"-",E(a.createdAt)])});}catch(n){i(n);}}),b.command("restore").description("Restore a schedule to a prior version").requiredOption("--schedule <id>").requiredOption("--version <id>").option("-f, --format <format>").action(async e=>{try{let t=await o(z,{scheduleId:e.schedule,versionId:e.version});u("Version restored"),d(e,t.restoreScheduleVersion);}catch(t){i(t);}}),ee.command("list").description("List executions for a job").argument("<jobId>").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async(e,t)=>{try{let n=await o(R,{jobId:e,pagination:{first:t.limit}});d(t,n.jobExecutions.executions,{headers:["ID","Status","Started","Duration","Success"],rows:n.jobExecutions.executions.map(a=>[C(a.id,12),T(a.status),E(a.startedAt),String(a.duration??"-"),String(!!a.success)])});}catch(n){i(n);}});}var fe={id:"scheduler",version:"1.0.0",displayName:"Scheduler",dependsOn:["auth","workspaces"],register(r,c){v(c),Z(r);}},It=fe;module.exports=It;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,b,h as h$1,p,n,o,g,i,s}from'../../chunk-
|
|
1
|
+
import {a,b,h as h$1,p,n,o,g,i,s}from'../../chunk-NLEVVDXR.js';import {o as o$1}from'../../chunk-IZXPWPKX.js';var C=`
|
|
2
2
|
query ListScheduledJobs($workspaceId: ID!, $filter: JobFilterInput, $pagination: SchedulerPaginationInput) {
|
|
3
3
|
scheduledJobs(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {
|
|
4
4
|
jobs { id name status scheduleType nextExecutionAt createdAt }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var c=class extends Error{exitCode;hint;constructor(o,s){super(o),this.name="CliUserError",this.exitCode=s?.exitCode??1,this.hint=s?.hint;}},
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var c=class extends Error{exitCode;hint;constructor(o,s){super(o),this.name="CliUserError",this.exitCode=s?.exitCode??1,this.hint=s?.hint;}},h=class extends c{constructor(o,s){super(o,{exitCode:2,hint:s?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},f=class extends Error{cause;constructor(o,s){super(o),this.name="CliInternalError",this.cause=s;}};var k=null;function v(r){k=r;}function g(){if(!k)throw new f("vibecontrols module helpers used before setHelpersContext was called");return k}function ee(){let r=g();if(!r.auth.isAuthenticated())throw new h("Authentication required.",{hint:`Run \`${r.productName} auth login\` to authenticate.`})}async function u(r,o){return ee(),g().gql.workspace.request(r,o)}function p(r){let o=r instanceof Error?r.message:String(r);throw new c(o)}function d(r,o,s){g().output.formatAndOutput(r,o,s);}function l(r){g().output.printSuccess(r);}function C(r){return g().output.formatStatus(r)}function y(r){return g().output.formatDate(r)}function x(r,o){return g().output.truncate(r,o)}function I(){return g()}var S=`
|
|
2
2
|
query GetVaults($filter: VaultFilterInput, $pagination: SecurityPaginationInput) {
|
|
3
3
|
getVaults(filter: $filter, pagination: $pagination) {
|
|
4
4
|
items { id name description scope status createdAt }
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
id name scope scopeId status
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
`,
|
|
20
|
+
`,O=`
|
|
21
21
|
mutation UpdateVault($id: ID!, $input: UpdateVaultInput!) {
|
|
22
22
|
updateVault(id: $id, input: $input) {
|
|
23
23
|
id name scope scopeId status
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
`,R=`
|
|
27
27
|
mutation DeleteVault($id: ID!) {
|
|
28
28
|
deleteVault(id: $id)
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
`,$=`
|
|
31
31
|
mutation ArchiveVault($id: ID!) {
|
|
32
32
|
archiveVault(id: $id) { id status }
|
|
33
33
|
}
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
total hasMore
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
`,
|
|
41
|
+
`,P=`
|
|
42
42
|
query GetSecret($id: ID!) {
|
|
43
43
|
getSecret(id: $id) {
|
|
44
44
|
id key name description type status isEphemeral expiresAt createdAt updatedAt
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
`,
|
|
47
|
+
`,L=`
|
|
48
48
|
query DecryptSecret($id: ID!) {
|
|
49
49
|
decryptSecret(id: $id) {
|
|
50
50
|
id key value
|
|
@@ -72,4 +72,4 @@
|
|
|
72
72
|
id key updatedAt
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
`;function
|
|
75
|
+
`;function w(){let r=I().auth.read();if(!r?.workspaceId)throw new c("No workspace set. Run: vibecontrols workspace set <id>");return {workspaceId:r.workspaceId}}async function U(){if(process.stdin.isTTY)throw new c('Pipe the secret value via stdin (e.g. `echo -n "value" | vibecontrols security secrets set ...`).');let r=[];for await(let o of process.stdin)r.push(Buffer.isBuffer(o)?o:Buffer.from(o));return Buffer.concat(r).toString("utf8")}function G(r){let o=r.command("security").description("Security: vaults & secrets"),s=o.command("vaults").description("Vault management");s.command("list").description("List vaults").option("--scope <s>","WORKSPACE|GLOBAL|VIBE").option("--status <s>").option("--search <q>").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t={context:w()};e.scope&&(t.scope=e.scope.toUpperCase()),e.status&&(t.status=e.status.toUpperCase()),e.search&&(t.search=e.search);let n=await u(S,{filter:t,pagination:{limit:e.limit,offset:0}});d(e,n.getVaults.items,{headers:["ID","Name","Scope","Status","Created"],rows:n.getVaults.items.map(i=>[x(i.id,12),i.name,i.scope??"-",C(i.status),y(i.createdAt)])});}catch(t){p(t);}}),s.command("get").description("Get a vault").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await u(b,{id:e});if(!n.getVault)throw new c(`Vault ${e} not found`);d(t,n.getVault);}catch(n){p(n);}}),s.command("create").description("Create a vault").requiredOption("--name <name>").option("--description <s>").option("--scope <s>","WORKSPACE|GLOBAL|VIBE","WORKSPACE").option("--scope-id <id>","Scope id (defaults to current workspace)").option("--lock-after <minutes>","Auto-lock after N minutes",e=>parseInt(e,10)).option("-f, --format <format>").action(async e=>{try{let t=w(),n={context:t,name:e.name,description:e.description,scope:(e.scope??"WORKSPACE").toUpperCase(),scopeId:e.scopeId??t.workspaceId,lockAfterMinutes:e.lockAfter},i=await u(A,{input:n});l(`Vault created: ${i.createVault.name}`),d(e,i.createVault);}catch(t){p(t);}}),s.command("update").description("Update a vault").argument("<id>").option("--name <s>").option("--description <s>").option("--lock-after <minutes>","Auto-lock after N minutes",e=>parseInt(e,10)).option("-f, --format <format>").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),t.lockAfter!==void 0&&(n.lockAfterMinutes=t.lockAfter),!Object.keys(n).length)throw new c("No updates specified");let i=await u(O,{id:e,input:n});l("Vault updated"),d(t,i.updateVault);}catch(n){p(n);}}),s.command("delete").description("Delete a vault").argument("<id>").option("--archive","Archive instead of hard delete",false).action(async(e,t)=>{try{t.archive?(await u($,{id:e}),l("Vault archived")):(await u(R,{id:e}),l("Vault deleted"));}catch(n){p(n);}});let m=o.command("secrets").description("Secret management");m.command("list").description("List secrets in a vault").requiredOption("--vault <id>").option("--type <t>","Filter by secret type").option("--search <q>").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async e=>{try{let t={context:w()};e.type&&(t.type=e.type.toUpperCase()),e.search&&(t.search=e.search);let n=await u(D,{vaultId:e.vault,filter:t,pagination:{limit:e.limit,offset:0}});d(e,n.getSecrets.items,{headers:["ID","Key","Name","Type","Status","Created"],rows:n.getSecrets.items.map(i=>[x(i.id,12),i.key,i.name,i.type??"-",C(i.status),y(i.createdAt)])});}catch(t){p(t);}}),m.command("get").description("Get secret metadata (does NOT decrypt)").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await u(P,{id:e});if(!n.getSecret)throw new c(`Secret ${e} not found`);d(t,n.getSecret);}catch(n){p(n);}}),m.command("show").description("Decrypt and print a secret value (audited)").argument("<id>").action(async e=>{try{let t=await u(L,{id:e});process.stdout.write(t.decryptSecret.value);}catch(t){p(t);}}),m.command("set").description("Create a secret. Reads the value from stdin.").requiredOption("--vault <id>").requiredOption("--key <key>","Secret key (unique within vault)").requiredOption("--name <name>").option("--description <s>").option("--type <t>","API_KEY|PASSWORD|CERTIFICATE|TOKEN|OTHER","OTHER").option("--ephemeral","Mark as ephemeral").option("--expires <iso>").option("-f, --format <format>").action(async e=>{try{let t=await U(),n={context:w(),vaultId:e.vault,key:e.key,name:e.name,description:e.description,type:(e.type??"OTHER").toUpperCase(),isEphemeral:!!e.ephemeral,expiresAt:e.expires,value:t},i=await u(q,{input:n});l(`Secret created: ${i.createSecret.key}`),d(e,i.createSecret);}catch(t){p(t);}}),m.command("update").description("Update a secret. Pass --value via stdin to rotate.").argument("<id>").option("--name <s>").option("--description <s>").option("--rotate","Rotate value (reads new value from stdin)").option("--status <s>").option("-f, --format <format>").action(async(e,t)=>{try{if(t.rotate){let W=await U(),F=await u(N,{id:e,newValue:W});l("Secret rotated"),d(t,F.rotateSecret);return}let n={context:w()};if(t.name&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),t.status&&(n.status=t.status.toUpperCase()),Object.keys(n).length===1)throw new c("No updates specified (use --rotate to change value)");let i=await u(V,{id:e,input:n});l("Secret updated"),d(t,i.updateSecret);}catch(n){p(n);}}),m.command("delete").description("Delete a secret").argument("<id>").action(async e=>{try{await u(_,{id:e}),l("Secret deleted");}catch(t){p(t);}});}var ne={id:"security",version:"1.0.0",displayName:"Security",dependsOn:["auth","workspaces"],register(r,o){v(o),G(r);}},lt=ne;module.exports=lt;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,b,h,p,n,o,g,i,s}from'../../chunk-
|
|
1
|
+
import {a,b,h,p,n,o,g,i,s}from'../../chunk-NLEVVDXR.js';import {o as o$1}from'../../chunk-IZXPWPKX.js';var T=`
|
|
2
2
|
query GetVaults($filter: VaultFilterInput, $pagination: SecurityPaginationInput) {
|
|
3
3
|
getVaults(filter: $filter, pagination: $pagination) {
|
|
4
4
|
items { id name description scope status createdAt }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var u=class extends Error{exitCode;hint;constructor(o,e){super(o),this.name="CliUserError",this.exitCode=e?.exitCode??1,this.hint=e?.hint;}},E=class extends u{constructor(o,e){super(o,{exitCode:2,hint:e?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},h=class extends Error{cause;constructor(o,e){super(o),this.name="CliInternalError",this.cause=e;}};var S=null;function T(r){S=r;}function I(){if(!S)throw new h("vibecontrols module helpers used before setHelpersContext was called");return S}function _e(){let r=I();if(!r.auth.isAuthenticated())throw new E("Authentication required.",{hint:`Run \`${r.productName} auth login\` to authenticate.`})}async function c(r,o){return _e(),I().gql.workspace.request(r,o)}async function w(r,o){return I().gql.workspaceAuthOnly.request(r,o)}function i(r){let o=r instanceof Error?r.message:String(r);throw new u(o)}function s(r,o,e){I().output.formatAndOutput(r,o,e);}function d(r){I().output.printSuccess(r);}function m(r,o){return I().output.truncate(r,o)}var b=`
|
|
2
2
|
query SemConnector($id: ID!) {
|
|
3
3
|
semConnector(id: $id) {
|
|
4
4
|
id name kind description isActive capabilities
|
|
@@ -120,17 +120,17 @@
|
|
|
120
120
|
id name description status version tags updatedAt workspaceId
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
`,
|
|
123
|
+
`,G=`
|
|
124
124
|
mutation SemArchiveModel($id: ID!) {
|
|
125
125
|
semArchiveModel(id: $id)
|
|
126
126
|
}
|
|
127
|
-
`,
|
|
127
|
+
`,H=`
|
|
128
128
|
mutation SemPublishModel($id: ID!) {
|
|
129
129
|
semPublishModel(id: $id) {
|
|
130
130
|
id name status version publishedAt updatedAt workspaceId
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
`,
|
|
133
|
+
`,j=`
|
|
134
134
|
query SemEntity($id: ID!) {
|
|
135
135
|
semEntity(id: $id) {
|
|
136
136
|
id modelId dataSourceId name kind physicalName primaryKey sqlDefinition description
|
|
@@ -274,14 +274,14 @@
|
|
|
274
274
|
createdAt updatedAt workspaceId
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
-
`,
|
|
277
|
+
`,ue=`
|
|
278
278
|
mutation SemSetAccessPolicyActive($id: ID!, $isActive: Boolean!) {
|
|
279
279
|
semSetAccessPolicyActive(id: $id, isActive: $isActive) {
|
|
280
280
|
id name isActive updatedAt workspaceId
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
|
-
`,
|
|
283
|
+
`,pe=`
|
|
284
284
|
query SemHealth {
|
|
285
285
|
semHealth
|
|
286
286
|
}
|
|
287
|
-
`;function f(r,o){try{return JSON.parse(o)}catch{throw new p(`--${r} must be valid JSON`)}}function l(r){let o=Number.parseInt(r,10);if(Number.isNaN(o))throw new p(`Expected an integer but got "${r}"`);return o}function y(r){return r.split(",").map(o=>o.trim()).filter(o=>o.length>0)}function C(r){let o={};return r.limit!==void 0&&(o.limit=r.limit),r.offset!==void 0&&(o.offset=r.offset),r.cursor&&(o.cursor=r.cursor),Object.keys(o).length?o:void 0}function me(r){let o=r.command("connectors").description("SemanticFed connectors (database/warehouse/API drivers)");o.command("list").description("List connectors").option("--kind <k>","Filter by connector kind (e.g. POSTGRES, BIGQUERY)").option("--limit <n>","Page size",l,50).option("--offset <n>","Offset",l,0).option("--cursor <c>","Opaque pagination cursor").option("-f, --format <format>","Output format").action(async e=>{try{let n=(await c(D,{kind:e.kind?e.kind.toUpperCase():void 0,pagination:C(e)})).semListConnectors.items;s(e,n,{headers:["ID","Name","Kind","Active","Description"],rows:n.map(a=>[m(a.id,12),a.name,a.kind,a.isActive?"yes":"no",m(a.description??"",32)])});}catch(t){i(t);}}),o.command("get").description("Get a connector by id").argument("<id>","Connector ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(b,{id:e});if(!n.semConnector)throw new p(`Connector ${e} not found`);s(t,n.semConnector);}catch(n){i(n);}}),o.command("create").description("Create a connector").requiredOption("--name <name>","Connector name").option("--kind <k>","Connector kind (e.g. POSTGRES, BIGQUERY)","POSTGRES").option("--description <s>","Description").option("--capabilities <json>","Capabilities JSON").option("-f, --format <format>","Output format").action(async e=>{try{let t={name:e.name,kind:(e.kind??"POSTGRES").toUpperCase()};e.description&&(t.description=e.description),e.capabilities&&(t.capabilities=f("capabilities",e.capabilities));let n=await c(O,{input:t});d(`Connector created: ${n.semCreateConnector.name}`),s(e,n.semCreateConnector);}catch(t){i(t);}}),o.command("update").description("Update a connector").argument("<id>","Connector ID").option("--name <name>","Connector name").option("--kind <k>","Connector kind").option("--description <s>","Description").option("--capabilities <json>","Capabilities JSON").option("--active <bool>","true|false",e=>e==="true").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.kind&&(n.kind=t.kind.toUpperCase()),t.description!==void 0&&(n.description=t.description),t.capabilities&&(n.capabilities=f("capabilities",t.capabilities)),t.active!==void 0&&(n.isActive=t.active),!Object.keys(n).length)throw new p("No updates specified");let a=await c(R,{id:e,input:n});d("Connector updated"),s(t,a.semUpdateConnector);}catch(n){i(n);}}),o.command("archive").description("Archive a connector").argument("<id>","Connector ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(x,{id:e});if(!n.semArchiveConnector)throw new p(`Connector ${e} could not be archived`);d(`Connector ${e} archived`),s(t,{archived:n.semArchiveConnector});}catch(n){i(n);}});}function le(r){let o=r.command("data-sources").description("SemanticFed data sources (federated query targets)");o.command("list").description("List data sources").option("--connector <id>","Filter by connector ID").option("--status <s>","Filter by data source status").option("--limit <n>","Page size",l,50).option("--offset <n>","Offset",l,0).option("--cursor <c>","Opaque pagination cursor").option("-f, --format <format>","Output format").action(async e=>{try{let n=(await c(M,{connectorId:e.connector,status:e.status?e.status.toUpperCase():void 0,pagination:C(e)})).semListDataSources.items;s(e,n,{headers:["ID","Name","Connector","Status","Pushdown"],rows:n.map(a=>[m(a.id,12),a.name,m(a.connectorId,12),a.status,a.pushdownEnabled?"yes":"no"])});}catch(t){i(t);}}),o.command("get").description("Get a data source by id").argument("<id>","Data source ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(v,{id:e});if(!n.semDataSource)throw new p(`Data source ${e} not found`);s(t,n.semDataSource);}catch(n){i(n);}}),o.command("create").description("Create a data source").requiredOption("--connector <id>","Connector ID").requiredOption("--name <name>","Data source name").option("--description <s>","Description").option("--endpoint <json>","Endpoint JSON (host/db/url/\u2026)").option("--secret-ref <ref>","Secret reference (Key Vault key)").option("--pushdown <bool>","Enable predicate pushdown true|false",e=>e==="true").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async e=>{try{let t={connectorId:e.connector,name:e.name};e.description&&(t.description=e.description),e.endpoint&&(t.endpoint=f("endpoint",e.endpoint)),e.secretRef&&(t.secretRef=e.secretRef),e.pushdown!==void 0&&(t.pushdownEnabled=e.pushdown),e.tags&&(t.tags=y(e.tags));let n=await c(_,{input:t});d(`Data source created: ${n.semCreateDataSource.name}`),s(e,n.semCreateDataSource);}catch(t){i(t);}}),o.command("update").description("Update a data source").argument("<id>","Data source ID").option("--name <name>","Data source name").option("--description <s>","Description").option("--endpoint <json>","Endpoint JSON").option("--secret-ref <ref>","Secret reference").option("--pushdown <bool>","Enable predicate pushdown true|false",e=>e==="true").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),t.endpoint&&(n.endpoint=f("endpoint",t.endpoint)),t.secretRef&&(n.secretRef=t.secretRef),t.pushdown!==void 0&&(n.pushdownEnabled=t.pushdown),t.tags&&(n.tags=y(t.tags)),!Object.keys(n).length)throw new p("No updates specified");let a=await c($,{id:e,input:n});d("Data source updated"),s(t,a.semUpdateDataSource);}catch(n){i(n);}}),o.command("archive").description("Archive a data source").argument("<id>","Data source ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(L,{id:e});if(!n.semArchiveDataSource)throw new p(`Data source ${e} could not be archived`);d(`Data source ${e} archived`),s(t,{archived:n.semArchiveDataSource});}catch(n){i(n);}}),o.command("transition").description("Move a data source through its connectivity lifecycle").argument("<id>","Data source ID").requiredOption("--status <s>","DRAFT|CONNECTED|DEGRADED|DISCONNECTED|DISABLED").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(N,{id:e,status:t.status.toUpperCase()});d(`Data source status set to ${n.semTransitionDataSource.status}`),s(t,n.semTransitionDataSource);}catch(n){i(n);}}),o.command("connections").description("List connection health probes for a data source").argument("<dataSourceId>","Data source ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(q,{dataSourceId:e});s(t,n.semListConnections,{headers:["ID","Health","Latency (ms)","Probed At","Message"],rows:n.semListConnections.map(a=>[m(a.id,12),a.health,a.latencyMs!=null?String(a.latencyMs):"-",a.probedAt,m(a.message??"",32)])});}catch(n){i(n);}}),o.command("record-connection").description("Record a connection health probe for a data source").requiredOption("--data-source <id>","Data source ID").requiredOption("--health <h>","HEALTHY|DEGRADED|UNREACHABLE|UNKNOWN").option("--latency-ms <n>","Latency in milliseconds",l).option("--message <s>","Probe message").option("-f, --format <format>","Output format").action(async e=>{try{let t={dataSourceId:e.dataSource,health:e.health.toUpperCase()};e.latencyMs!==void 0&&(t.latencyMs=e.latencyMs),e.message&&(t.message=e.message);let n=await c(P,{input:t});d(`Connection recorded: ${n.semRecordConnection.health}`),s(e,n.semRecordConnection);}catch(t){i(t);}});}function fe(r){let o=r.command("models").description("SemanticFed semantic models (versioned entity/metric graphs)");o.command("list").description("List semantic models").option("--status <s>","Filter by model status (DRAFT|PUBLISHED|DEPRECATED|ARCHIVED)").option("--limit <n>","Page size",l,50).option("--offset <n>","Offset",l,0).option("--cursor <c>","Opaque pagination cursor").option("-f, --format <format>","Output format").action(async e=>{try{let n=(await c(Q,{status:e.status?e.status.toUpperCase():void 0,pagination:C(e)})).semListModels.items;s(e,n,{headers:["ID","Name","Status","Version","Description"],rows:n.map(a=>[m(a.id,12),a.name,a.status,String(a.version),m(a.description??"",32)])});}catch(t){i(t);}}),o.command("get").description("Get a semantic model by id").argument("<id>","Model ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(U,{id:e});if(!n.semModel)throw new p(`Model ${e} not found`);s(t,n.semModel);}catch(n){i(n);}}),o.command("create").description("Create a semantic model").requiredOption("--name <name>","Model name").option("--description <s>","Description").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async e=>{try{let t={name:e.name};e.description&&(t.description=e.description),e.tags&&(t.tags=y(e.tags));let n=await c(F,{input:t});d(`Model created: ${n.semCreateModel.name}`),s(e,n.semCreateModel);}catch(t){i(t);}}),o.command("update").description("Update a semantic model").argument("<id>","Model ID").option("--name <name>","Model name").option("--description <s>","Description").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),t.tags&&(n.tags=y(t.tags)),!Object.keys(n).length)throw new p("No updates specified");let a=await c(W,{id:e,input:n});d("Model updated"),s(t,a.semUpdateModel);}catch(n){i(n);}}),o.command("archive").description("Archive a semantic model").argument("<id>","Model ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(H,{id:e});if(!n.semArchiveModel)throw new p(`Model ${e} could not be archived`);d(`Model ${e} archived`),s(t,{archived:n.semArchiveModel});}catch(n){i(n);}}),o.command("publish").description("Publish a draft model (bumps version, flips status to PUBLISHED)").argument("<id>","Model ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(j,{id:e});d(`Model published (v${n.semPublishModel.version})`),s(t,n.semPublishModel);}catch(n){i(n);}});}function ge(r){let o=r.command("entities").description("SemanticFed entities (tables/views/derived datasets in a model)");o.command("list").description("List entities in a model").requiredOption("--model <id>","Model ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await c(Y,{modelId:e.model});s(e,t.semListEntities,{headers:["ID","Name","Kind","Physical Name","Primary Key"],rows:t.semListEntities.map(n=>[m(n.id,12),n.name,n.kind,n.physicalName??"-",n.primaryKey??"-"])});}catch(t){i(t);}}),o.command("get").description("Get an entity by id").argument("<id>","Entity ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(G,{id:e});if(!n.semEntity)throw new p(`Entity ${e} not found`);s(t,n.semEntity);}catch(n){i(n);}}),o.command("create").description("Create an entity").requiredOption("--model <id>","Model ID").requiredOption("--name <name>","Entity name").option("--kind <k>","TABLE|VIEW|DERIVED|EXTERNAL","TABLE").option("--data-source <id>","Backing data source ID").option("--physical-name <n>","Physical (DB) name").option("--primary-key <k>","Primary key column").option("--sql-definition <sql>","SQL definition (for derived entities)").option("--description <s>","Description").option("-f, --format <format>","Output format").action(async e=>{try{let t={modelId:e.model,name:e.name,kind:(e.kind??"TABLE").toUpperCase()};e.dataSource&&(t.dataSourceId=e.dataSource),e.physicalName&&(t.physicalName=e.physicalName),e.primaryKey&&(t.primaryKey=e.primaryKey),e.sqlDefinition&&(t.sqlDefinition=e.sqlDefinition),e.description&&(t.description=e.description);let n=await c(V,{input:t});d(`Entity created: ${n.semCreateEntity.name}`),s(e,n.semCreateEntity);}catch(t){i(t);}}),o.command("update").description("Update an entity").argument("<id>","Entity ID").option("--name <name>","Entity name").option("--kind <k>","TABLE|VIEW|DERIVED|EXTERNAL").option("--data-source <id>","Backing data source ID").option("--physical-name <n>","Physical (DB) name").option("--primary-key <k>","Primary key column").option("--sql-definition <sql>","SQL definition").option("--description <s>","Description").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.kind&&(n.kind=t.kind.toUpperCase()),t.dataSource&&(n.dataSourceId=t.dataSource),t.physicalName&&(n.physicalName=t.physicalName),t.primaryKey&&(n.primaryKey=t.primaryKey),t.sqlDefinition&&(n.sqlDefinition=t.sqlDefinition),t.description!==void 0&&(n.description=t.description),!Object.keys(n).length)throw new p("No updates specified");let a=await c(B,{id:e,input:n});d("Entity updated"),s(t,a.semUpdateEntity);}catch(n){i(n);}}),o.command("delete").description("Delete an entity").argument("<id>","Entity ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(K,{id:e});if(!n.semDeleteEntity)throw new p(`Entity ${e} could not be deleted`);d(`Entity ${e} deleted`),s(t,{deleted:n.semDeleteEntity});}catch(n){i(n);}});}function ye(r){r.command("dimensions").description("SemanticFed dimensions (queryable attributes on an entity)").command("create").description("Create a dimension").requiredOption("--entity <id>","Entity ID").requiredOption("--name <name>","Dimension name").option("--data-type <t>","STRING|INTEGER|DECIMAL|BOOLEAN|DATE|TIMESTAMP|JSON|GEO","STRING").option("--expression <e>","SQL expression").option("--primary","Mark as primary dimension").option("--description <s>","Description").option("-f, --format <format>","Output format").action(async e=>{try{let t={entityId:e.entity,name:e.name,dataType:(e.dataType??"STRING").toUpperCase()};e.expression&&(t.expression=e.expression),e.primary&&(t.isPrimary=!0),e.description&&(t.description=e.description);let n=await c(J,{input:t});d(`Dimension created: ${n.semCreateDimension.name}`),s(e,n.semCreateDimension);}catch(t){i(t);}});}function Ce(r){r.command("metrics").description("SemanticFed metrics (aggregated measures on an entity)").command("create").description("Create a metric").requiredOption("--entity <id>","Entity ID").requiredOption("--name <name>","Metric name").option("--aggregation <a>","SUM|AVG|MIN|MAX|COUNT|COUNT_DISTINCT|MEDIAN|CUSTOM","SUM").option("--expression <e>","SQL expression").option("--format-spec <f>","Display format (e.g. currency, percent)").option("--description <s>","Description").option("-f, --format <format>","Output format").action(async e=>{try{let t={entityId:e.entity,name:e.name,aggregation:(e.aggregation??"SUM").toUpperCase()};e.expression&&(t.expression=e.expression),e.formatSpec&&(t.format=e.formatSpec),e.description&&(t.description=e.description);let n=await c(z,{input:t});d(`Metric created: ${n.semCreateMetric.name}`),s(e,n.semCreateMetric);}catch(t){i(t);}});}function he(r){let o=r.command("relationships").description("SemanticFed relationships (joins between entities in a model)");o.command("list").description("List relationships in a model").requiredOption("--model <id>","Model ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await c(X,{modelId:e.model});s(e,t.semListRelationships,{headers:["ID","Name","Kind","From","To"],rows:t.semListRelationships.map(n=>[m(n.id,12),n.name,n.kind,`${m(n.fromEntityId,8)}.${n.fromField}`,`${m(n.toEntityId,8)}.${n.toField}`])});}catch(t){i(t);}}),o.command("create").description("Create a relationship").requiredOption("--model <id>","Model ID").requiredOption("--name <name>","Relationship name").requiredOption("--from-entity <id>","From entity ID").requiredOption("--from-field <f>","From field").requiredOption("--to-entity <id>","To entity ID").requiredOption("--to-field <f>","To field").option("--kind <k>","ONE_TO_ONE|ONE_TO_MANY|MANY_TO_ONE|MANY_TO_MANY","MANY_TO_ONE").option("--description <s>","Description").option("-f, --format <format>","Output format").action(async e=>{try{let t={modelId:e.model,name:e.name,fromEntityId:e.fromEntity,fromField:e.fromField,toEntityId:e.toEntity,toField:e.toField,kind:(e.kind??"MANY_TO_ONE").toUpperCase()};e.description&&(t.description=e.description);let n=await c(Z,{input:t});d(`Relationship created: ${n.semCreateRelationship.name}`),s(e,n.semCreateRelationship);}catch(t){i(t);}});}function Ee(r){let o=r.command("queries").description("SemanticFed saved federated queries & run history");o.command("list").description("List saved queries").option("--model <id>","Filter by model ID").option("--status <s>","Filter by query status (DRAFT|PUBLISHED|ARCHIVED)").option("--limit <n>","Page size",l,50).option("--offset <n>","Offset",l,0).option("--cursor <c>","Opaque pagination cursor").option("-f, --format <format>","Output format").action(async e=>{try{let n=(await c(te,{modelId:e.model,status:e.status?e.status.toUpperCase():void 0,pagination:C(e)})).semListQueries.items;s(e,n,{headers:["ID","Name","Status","Model","Cacheable"],rows:n.map(a=>[m(a.id,12),a.name,a.status,a.modelId?m(a.modelId,12):"-",a.cacheable?"yes":"no"])});}catch(t){i(t);}}),o.command("get").description("Get a saved query by id").argument("<id>","Query ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(ee,{id:e});if(!n.semQuery)throw new p(`Query ${e} not found`);s(t,n.semQuery);}catch(n){i(n);}}),o.command("create").description("Create a saved query").requiredOption("--name <name>","Query name").requiredOption("--query-text <sql>","Federated query text").option("--model <id>","Associated model ID").option("--description <s>","Description").option("--cacheable <bool>","true|false",e=>e==="true").option("--cache-ttl <n>","Cache TTL seconds",l).option("--parameters <json>","Parameters JSON").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async e=>{try{let t={name:e.name,queryText:e.queryText};e.model&&(t.modelId=e.model),e.description&&(t.description=e.description),e.cacheable!==void 0&&(t.cacheable=e.cacheable),e.cacheTtl!==void 0&&(t.cacheTtlSeconds=e.cacheTtl),e.parameters&&(t.parameters=f("parameters",e.parameters)),e.tags&&(t.tags=y(e.tags));let n=await c(ne,{input:t});d(`Query created: ${n.semCreateQuery.name}`),s(e,n.semCreateQuery);}catch(t){i(t);}}),o.command("update").description("Update a saved query").argument("<id>","Query ID").option("--name <name>","Query name").option("--query-text <sql>","Federated query text").option("--model <id>","Associated model ID").option("--description <s>","Description").option("--cacheable <bool>","true|false",e=>e==="true").option("--cache-ttl <n>","Cache TTL seconds",l).option("--parameters <json>","Parameters JSON").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.queryText&&(n.queryText=t.queryText),t.model&&(n.modelId=t.model),t.description!==void 0&&(n.description=t.description),t.cacheable!==void 0&&(n.cacheable=t.cacheable),t.cacheTtl!==void 0&&(n.cacheTtlSeconds=t.cacheTtl),t.parameters&&(n.parameters=f("parameters",t.parameters)),t.tags&&(n.tags=y(t.tags)),!Object.keys(n).length)throw new p("No updates specified");let a=await c(oe,{id:e,input:n});d("Query updated"),s(t,a.semUpdateQuery);}catch(n){i(n);}}),o.command("archive").description("Archive a saved query").argument("<id>","Query ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(re,{id:e});if(!n.semArchiveQuery)throw new p(`Query ${e} could not be archived`);d(`Query ${e} archived`),s(t,{archived:n.semArchiveQuery});}catch(n){i(n);}}),o.command("publish").description("Publish a draft query").argument("<id>","Query ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(ie,{id:e});d(`Query published: ${n.semPublishQuery.name}`),s(t,n.semPublishQuery);}catch(n){i(n);}}),o.command("run").description("Enqueue a federated execution of a saved query").argument("<id>","Query ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(se,{id:e});d(`Query run enqueued: ${n.semRunQuery.id} (${n.semRunQuery.status})`),s(t,n.semRunQuery);}catch(n){i(n);}}),o.command("runs").description("List run history for a saved query").requiredOption("--query <id>","Query ID").option("--status <s>","Filter by run status").option("--limit <n>","Page size",l,50).option("--offset <n>","Offset",l,0).option("--cursor <c>","Opaque pagination cursor").option("-f, --format <format>","Output format").action(async e=>{try{let n=(await c(ae,{queryId:e.query,status:e.status?e.status.toUpperCase():void 0,pagination:C(e)})).semListQueryRuns.items;s(e,n,{headers:["ID","Status","Rows","Duration (ms)","Cached"],rows:n.map(a=>[m(a.id,12),a.status,a.rowCount!=null?String(a.rowCount):"-",a.durationMs!=null?String(a.durationMs):"-",a.fromCache?"yes":"no"])});}catch(t){i(t);}});}function Ie(r){let o=r.command("access-policies").description("SemanticFed access policies (row/column/entity governance)");o.command("list").description("List access policies").option("--entity <id>","Filter by entity ID").option("--model <id>","Filter by model ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await c(ce,{entityId:e.entity,modelId:e.model});s(e,t.semListAccessPolicies,{headers:["ID","Name","Principal","Effect","Scope","Active"],rows:t.semListAccessPolicies.map(n=>[m(n.id,12),n.name,n.principal,n.effect,n.scope,n.isActive?"yes":"no"])});}catch(t){i(t);}}),o.command("create").description("Create an access policy").requiredOption("--name <name>","Policy name").requiredOption("--principal <p>","Principal (user/role/group expression)").option("--effect <e>","ALLOW|DENY","ALLOW").option("--scope <s>","ROW|COLUMN|ENTITY","ROW").option("--entity <id>","Scoped entity ID").option("--model <id>","Scoped model ID").option("--rule <json>","Rule JSON (predicate / column list)").option("--description <s>","Description").option("-f, --format <format>","Output format").action(async e=>{try{let t={name:e.name,principal:e.principal,effect:(e.effect??"ALLOW").toUpperCase(),scope:(e.scope??"ROW").toUpperCase()};e.entity&&(t.entityId=e.entity),e.model&&(t.modelId=e.model),e.rule&&(t.rule=f("rule",e.rule)),e.description&&(t.description=e.description);let n=await c(de,{input:t});d(`Access policy created: ${n.semCreateAccessPolicy.name}`),s(e,n.semCreateAccessPolicy);}catch(t){i(t);}}),o.command("set-active").description("Activate or deactivate an access policy").argument("<id>","Policy ID").requiredOption("--active <bool>","true|false",e=>e==="true").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(pe,{id:e,isActive:t.active});d(`Access policy ${e} ${n.semSetAccessPolicyActive.isActive?"activated":"deactivated"}`),s(t,n.semSetAccessPolicyActive);}catch(n){i(n);}});}function Se(r){r.command("health").description("SemanticFed subgraph liveness/identity probe (public)").option("-f, --format <format>","Output format").action(async o=>{try{let e=await w(ue);d(e.semHealth),s(o,{health:e.semHealth});}catch(e){i(e);}});}var $e={id:"semanticfed",version:"1.0.0",displayName:"SemanticFed",dependsOn:["auth","workspaces"],register(r,o){T(o);let e=r.command("semanticfed").description("SemanticFed data-federation & governed semantic layer");me(e),le(e),fe(e),ge(e),ye(e),Ce(e),he(e),Ee(e),Ie(e),Se(e);}},Mn=$e;module.exports=Mn;
|
|
287
|
+
`;function f(r,o){try{return JSON.parse(o)}catch{throw new u(`--${r} must be valid JSON`)}}function l(r){let o=Number.parseInt(r,10);if(Number.isNaN(o))throw new u(`Expected an integer but got "${r}"`);return o}function y(r){return r.split(",").map(o=>o.trim()).filter(o=>o.length>0)}function C(r){let o={};return r.limit!==void 0&&(o.limit=r.limit),r.offset!==void 0&&(o.offset=r.offset),r.cursor&&(o.cursor=r.cursor),Object.keys(o).length?o:void 0}function me(r){let o=r.command("connectors").description("SemanticFed connectors (database/warehouse/API drivers)");o.command("list").description("List connectors").option("--kind <k>","Filter by connector kind (e.g. POSTGRES, BIGQUERY)").option("--limit <n>","Page size",l,50).option("--offset <n>","Offset",l,0).option("--cursor <c>","Opaque pagination cursor").option("-f, --format <format>","Output format").action(async e=>{try{let n=(await c(D,{kind:e.kind?e.kind.toUpperCase():void 0,pagination:C(e)})).semListConnectors.items;s(e,n,{headers:["ID","Name","Kind","Active","Description"],rows:n.map(a=>[m(a.id,12),a.name,a.kind,a.isActive?"yes":"no",m(a.description??"",32)])});}catch(t){i(t);}}),o.command("get").description("Get a connector by id").argument("<id>","Connector ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(b,{id:e});if(!n.semConnector)throw new u(`Connector ${e} not found`);s(t,n.semConnector);}catch(n){i(n);}}),o.command("create").description("Create a connector").requiredOption("--name <name>","Connector name").option("--kind <k>","Connector kind (e.g. POSTGRES, BIGQUERY)","POSTGRES").option("--description <s>","Description").option("--capabilities <json>","Capabilities JSON").option("-f, --format <format>","Output format").action(async e=>{try{let t={name:e.name,kind:(e.kind??"POSTGRES").toUpperCase()};e.description&&(t.description=e.description),e.capabilities&&(t.capabilities=f("capabilities",e.capabilities));let n=await c(O,{input:t});d(`Connector created: ${n.semCreateConnector.name}`),s(e,n.semCreateConnector);}catch(t){i(t);}}),o.command("update").description("Update a connector").argument("<id>","Connector ID").option("--name <name>","Connector name").option("--kind <k>","Connector kind").option("--description <s>","Description").option("--capabilities <json>","Capabilities JSON").option("--active <bool>","true|false",e=>e==="true").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.kind&&(n.kind=t.kind.toUpperCase()),t.description!==void 0&&(n.description=t.description),t.capabilities&&(n.capabilities=f("capabilities",t.capabilities)),t.active!==void 0&&(n.isActive=t.active),!Object.keys(n).length)throw new u("No updates specified");let a=await c(R,{id:e,input:n});d("Connector updated"),s(t,a.semUpdateConnector);}catch(n){i(n);}}),o.command("archive").description("Archive a connector").argument("<id>","Connector ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(x,{id:e});if(!n.semArchiveConnector)throw new u(`Connector ${e} could not be archived`);d(`Connector ${e} archived`),s(t,{archived:n.semArchiveConnector});}catch(n){i(n);}});}function le(r){let o=r.command("data-sources").description("SemanticFed data sources (federated query targets)");o.command("list").description("List data sources").option("--connector <id>","Filter by connector ID").option("--status <s>","Filter by data source status").option("--limit <n>","Page size",l,50).option("--offset <n>","Offset",l,0).option("--cursor <c>","Opaque pagination cursor").option("-f, --format <format>","Output format").action(async e=>{try{let n=(await c(M,{connectorId:e.connector,status:e.status?e.status.toUpperCase():void 0,pagination:C(e)})).semListDataSources.items;s(e,n,{headers:["ID","Name","Connector","Status","Pushdown"],rows:n.map(a=>[m(a.id,12),a.name,m(a.connectorId,12),a.status,a.pushdownEnabled?"yes":"no"])});}catch(t){i(t);}}),o.command("get").description("Get a data source by id").argument("<id>","Data source ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(v,{id:e});if(!n.semDataSource)throw new u(`Data source ${e} not found`);s(t,n.semDataSource);}catch(n){i(n);}}),o.command("create").description("Create a data source").requiredOption("--connector <id>","Connector ID").requiredOption("--name <name>","Data source name").option("--description <s>","Description").option("--endpoint <json>","Endpoint JSON (host/db/url/\u2026)").option("--secret-ref <ref>","Secret reference (Key Vault key)").option("--pushdown <bool>","Enable predicate pushdown true|false",e=>e==="true").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async e=>{try{let t={connectorId:e.connector,name:e.name};e.description&&(t.description=e.description),e.endpoint&&(t.endpoint=f("endpoint",e.endpoint)),e.secretRef&&(t.secretRef=e.secretRef),e.pushdown!==void 0&&(t.pushdownEnabled=e.pushdown),e.tags&&(t.tags=y(e.tags));let n=await c(_,{input:t});d(`Data source created: ${n.semCreateDataSource.name}`),s(e,n.semCreateDataSource);}catch(t){i(t);}}),o.command("update").description("Update a data source").argument("<id>","Data source ID").option("--name <name>","Data source name").option("--description <s>","Description").option("--endpoint <json>","Endpoint JSON").option("--secret-ref <ref>","Secret reference").option("--pushdown <bool>","Enable predicate pushdown true|false",e=>e==="true").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),t.endpoint&&(n.endpoint=f("endpoint",t.endpoint)),t.secretRef&&(n.secretRef=t.secretRef),t.pushdown!==void 0&&(n.pushdownEnabled=t.pushdown),t.tags&&(n.tags=y(t.tags)),!Object.keys(n).length)throw new u("No updates specified");let a=await c($,{id:e,input:n});d("Data source updated"),s(t,a.semUpdateDataSource);}catch(n){i(n);}}),o.command("archive").description("Archive a data source").argument("<id>","Data source ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(L,{id:e});if(!n.semArchiveDataSource)throw new u(`Data source ${e} could not be archived`);d(`Data source ${e} archived`),s(t,{archived:n.semArchiveDataSource});}catch(n){i(n);}}),o.command("transition").description("Move a data source through its connectivity lifecycle").argument("<id>","Data source ID").requiredOption("--status <s>","DRAFT|CONNECTED|DEGRADED|DISCONNECTED|DISABLED").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(N,{id:e,status:t.status.toUpperCase()});d(`Data source status set to ${n.semTransitionDataSource.status}`),s(t,n.semTransitionDataSource);}catch(n){i(n);}}),o.command("connections").description("List connection health probes for a data source").argument("<dataSourceId>","Data source ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(q,{dataSourceId:e});s(t,n.semListConnections,{headers:["ID","Health","Latency (ms)","Probed At","Message"],rows:n.semListConnections.map(a=>[m(a.id,12),a.health,a.latencyMs!=null?String(a.latencyMs):"-",a.probedAt,m(a.message??"",32)])});}catch(n){i(n);}}),o.command("record-connection").description("Record a connection health probe for a data source").requiredOption("--data-source <id>","Data source ID").requiredOption("--health <h>","HEALTHY|DEGRADED|UNREACHABLE|UNKNOWN").option("--latency-ms <n>","Latency in milliseconds",l).option("--message <s>","Probe message").option("-f, --format <format>","Output format").action(async e=>{try{let t={dataSourceId:e.dataSource,health:e.health.toUpperCase()};e.latencyMs!==void 0&&(t.latencyMs=e.latencyMs),e.message&&(t.message=e.message);let n=await c(P,{input:t});d(`Connection recorded: ${n.semRecordConnection.health}`),s(e,n.semRecordConnection);}catch(t){i(t);}});}function fe(r){let o=r.command("models").description("SemanticFed semantic models (versioned entity/metric graphs)");o.command("list").description("List semantic models").option("--status <s>","Filter by model status (DRAFT|PUBLISHED|DEPRECATED|ARCHIVED)").option("--limit <n>","Page size",l,50).option("--offset <n>","Offset",l,0).option("--cursor <c>","Opaque pagination cursor").option("-f, --format <format>","Output format").action(async e=>{try{let n=(await c(Q,{status:e.status?e.status.toUpperCase():void 0,pagination:C(e)})).semListModels.items;s(e,n,{headers:["ID","Name","Status","Version","Description"],rows:n.map(a=>[m(a.id,12),a.name,a.status,String(a.version),m(a.description??"",32)])});}catch(t){i(t);}}),o.command("get").description("Get a semantic model by id").argument("<id>","Model ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(U,{id:e});if(!n.semModel)throw new u(`Model ${e} not found`);s(t,n.semModel);}catch(n){i(n);}}),o.command("create").description("Create a semantic model").requiredOption("--name <name>","Model name").option("--description <s>","Description").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async e=>{try{let t={name:e.name};e.description&&(t.description=e.description),e.tags&&(t.tags=y(e.tags));let n=await c(F,{input:t});d(`Model created: ${n.semCreateModel.name}`),s(e,n.semCreateModel);}catch(t){i(t);}}),o.command("update").description("Update a semantic model").argument("<id>","Model ID").option("--name <name>","Model name").option("--description <s>","Description").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),t.tags&&(n.tags=y(t.tags)),!Object.keys(n).length)throw new u("No updates specified");let a=await c(W,{id:e,input:n});d("Model updated"),s(t,a.semUpdateModel);}catch(n){i(n);}}),o.command("archive").description("Archive a semantic model").argument("<id>","Model ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(G,{id:e});if(!n.semArchiveModel)throw new u(`Model ${e} could not be archived`);d(`Model ${e} archived`),s(t,{archived:n.semArchiveModel});}catch(n){i(n);}}),o.command("publish").description("Publish a draft model (bumps version, flips status to PUBLISHED)").argument("<id>","Model ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(H,{id:e});d(`Model published (v${n.semPublishModel.version})`),s(t,n.semPublishModel);}catch(n){i(n);}});}function ge(r){let o=r.command("entities").description("SemanticFed entities (tables/views/derived datasets in a model)");o.command("list").description("List entities in a model").requiredOption("--model <id>","Model ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await c(Y,{modelId:e.model});s(e,t.semListEntities,{headers:["ID","Name","Kind","Physical Name","Primary Key"],rows:t.semListEntities.map(n=>[m(n.id,12),n.name,n.kind,n.physicalName??"-",n.primaryKey??"-"])});}catch(t){i(t);}}),o.command("get").description("Get an entity by id").argument("<id>","Entity ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(j,{id:e});if(!n.semEntity)throw new u(`Entity ${e} not found`);s(t,n.semEntity);}catch(n){i(n);}}),o.command("create").description("Create an entity").requiredOption("--model <id>","Model ID").requiredOption("--name <name>","Entity name").option("--kind <k>","TABLE|VIEW|DERIVED|EXTERNAL","TABLE").option("--data-source <id>","Backing data source ID").option("--physical-name <n>","Physical (DB) name").option("--primary-key <k>","Primary key column").option("--sql-definition <sql>","SQL definition (for derived entities)").option("--description <s>","Description").option("-f, --format <format>","Output format").action(async e=>{try{let t={modelId:e.model,name:e.name,kind:(e.kind??"TABLE").toUpperCase()};e.dataSource&&(t.dataSourceId=e.dataSource),e.physicalName&&(t.physicalName=e.physicalName),e.primaryKey&&(t.primaryKey=e.primaryKey),e.sqlDefinition&&(t.sqlDefinition=e.sqlDefinition),e.description&&(t.description=e.description);let n=await c(V,{input:t});d(`Entity created: ${n.semCreateEntity.name}`),s(e,n.semCreateEntity);}catch(t){i(t);}}),o.command("update").description("Update an entity").argument("<id>","Entity ID").option("--name <name>","Entity name").option("--kind <k>","TABLE|VIEW|DERIVED|EXTERNAL").option("--data-source <id>","Backing data source ID").option("--physical-name <n>","Physical (DB) name").option("--primary-key <k>","Primary key column").option("--sql-definition <sql>","SQL definition").option("--description <s>","Description").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.kind&&(n.kind=t.kind.toUpperCase()),t.dataSource&&(n.dataSourceId=t.dataSource),t.physicalName&&(n.physicalName=t.physicalName),t.primaryKey&&(n.primaryKey=t.primaryKey),t.sqlDefinition&&(n.sqlDefinition=t.sqlDefinition),t.description!==void 0&&(n.description=t.description),!Object.keys(n).length)throw new u("No updates specified");let a=await c(B,{id:e,input:n});d("Entity updated"),s(t,a.semUpdateEntity);}catch(n){i(n);}}),o.command("delete").description("Delete an entity").argument("<id>","Entity ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(K,{id:e});if(!n.semDeleteEntity)throw new u(`Entity ${e} could not be deleted`);d(`Entity ${e} deleted`),s(t,{deleted:n.semDeleteEntity});}catch(n){i(n);}});}function ye(r){r.command("dimensions").description("SemanticFed dimensions (queryable attributes on an entity)").command("create").description("Create a dimension").requiredOption("--entity <id>","Entity ID").requiredOption("--name <name>","Dimension name").option("--data-type <t>","STRING|INTEGER|DECIMAL|BOOLEAN|DATE|TIMESTAMP|JSON|GEO","STRING").option("--expression <e>","SQL expression").option("--primary","Mark as primary dimension").option("--description <s>","Description").option("-f, --format <format>","Output format").action(async e=>{try{let t={entityId:e.entity,name:e.name,dataType:(e.dataType??"STRING").toUpperCase()};e.expression&&(t.expression=e.expression),e.primary&&(t.isPrimary=!0),e.description&&(t.description=e.description);let n=await c(J,{input:t});d(`Dimension created: ${n.semCreateDimension.name}`),s(e,n.semCreateDimension);}catch(t){i(t);}});}function Ce(r){r.command("metrics").description("SemanticFed metrics (aggregated measures on an entity)").command("create").description("Create a metric").requiredOption("--entity <id>","Entity ID").requiredOption("--name <name>","Metric name").option("--aggregation <a>","SUM|AVG|MIN|MAX|COUNT|COUNT_DISTINCT|MEDIAN|CUSTOM","SUM").option("--expression <e>","SQL expression").option("--format-spec <f>","Display format (e.g. currency, percent)").option("--description <s>","Description").option("-f, --format <format>","Output format").action(async e=>{try{let t={entityId:e.entity,name:e.name,aggregation:(e.aggregation??"SUM").toUpperCase()};e.expression&&(t.expression=e.expression),e.formatSpec&&(t.format=e.formatSpec),e.description&&(t.description=e.description);let n=await c(z,{input:t});d(`Metric created: ${n.semCreateMetric.name}`),s(e,n.semCreateMetric);}catch(t){i(t);}});}function he(r){let o=r.command("relationships").description("SemanticFed relationships (joins between entities in a model)");o.command("list").description("List relationships in a model").requiredOption("--model <id>","Model ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await c(X,{modelId:e.model});s(e,t.semListRelationships,{headers:["ID","Name","Kind","From","To"],rows:t.semListRelationships.map(n=>[m(n.id,12),n.name,n.kind,`${m(n.fromEntityId,8)}.${n.fromField}`,`${m(n.toEntityId,8)}.${n.toField}`])});}catch(t){i(t);}}),o.command("create").description("Create a relationship").requiredOption("--model <id>","Model ID").requiredOption("--name <name>","Relationship name").requiredOption("--from-entity <id>","From entity ID").requiredOption("--from-field <f>","From field").requiredOption("--to-entity <id>","To entity ID").requiredOption("--to-field <f>","To field").option("--kind <k>","ONE_TO_ONE|ONE_TO_MANY|MANY_TO_ONE|MANY_TO_MANY","MANY_TO_ONE").option("--description <s>","Description").option("-f, --format <format>","Output format").action(async e=>{try{let t={modelId:e.model,name:e.name,fromEntityId:e.fromEntity,fromField:e.fromField,toEntityId:e.toEntity,toField:e.toField,kind:(e.kind??"MANY_TO_ONE").toUpperCase()};e.description&&(t.description=e.description);let n=await c(Z,{input:t});d(`Relationship created: ${n.semCreateRelationship.name}`),s(e,n.semCreateRelationship);}catch(t){i(t);}});}function Ee(r){let o=r.command("queries").description("SemanticFed saved federated queries & run history");o.command("list").description("List saved queries").option("--model <id>","Filter by model ID").option("--status <s>","Filter by query status (DRAFT|PUBLISHED|ARCHIVED)").option("--limit <n>","Page size",l,50).option("--offset <n>","Offset",l,0).option("--cursor <c>","Opaque pagination cursor").option("-f, --format <format>","Output format").action(async e=>{try{let n=(await c(te,{modelId:e.model,status:e.status?e.status.toUpperCase():void 0,pagination:C(e)})).semListQueries.items;s(e,n,{headers:["ID","Name","Status","Model","Cacheable"],rows:n.map(a=>[m(a.id,12),a.name,a.status,a.modelId?m(a.modelId,12):"-",a.cacheable?"yes":"no"])});}catch(t){i(t);}}),o.command("get").description("Get a saved query by id").argument("<id>","Query ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(ee,{id:e});if(!n.semQuery)throw new u(`Query ${e} not found`);s(t,n.semQuery);}catch(n){i(n);}}),o.command("create").description("Create a saved query").requiredOption("--name <name>","Query name").requiredOption("--query-text <sql>","Federated query text").option("--model <id>","Associated model ID").option("--description <s>","Description").option("--cacheable <bool>","true|false",e=>e==="true").option("--cache-ttl <n>","Cache TTL seconds",l).option("--parameters <json>","Parameters JSON").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async e=>{try{let t={name:e.name,queryText:e.queryText};e.model&&(t.modelId=e.model),e.description&&(t.description=e.description),e.cacheable!==void 0&&(t.cacheable=e.cacheable),e.cacheTtl!==void 0&&(t.cacheTtlSeconds=e.cacheTtl),e.parameters&&(t.parameters=f("parameters",e.parameters)),e.tags&&(t.tags=y(e.tags));let n=await c(ne,{input:t});d(`Query created: ${n.semCreateQuery.name}`),s(e,n.semCreateQuery);}catch(t){i(t);}}),o.command("update").description("Update a saved query").argument("<id>","Query ID").option("--name <name>","Query name").option("--query-text <sql>","Federated query text").option("--model <id>","Associated model ID").option("--description <s>","Description").option("--cacheable <bool>","true|false",e=>e==="true").option("--cache-ttl <n>","Cache TTL seconds",l).option("--parameters <json>","Parameters JSON").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.queryText&&(n.queryText=t.queryText),t.model&&(n.modelId=t.model),t.description!==void 0&&(n.description=t.description),t.cacheable!==void 0&&(n.cacheable=t.cacheable),t.cacheTtl!==void 0&&(n.cacheTtlSeconds=t.cacheTtl),t.parameters&&(n.parameters=f("parameters",t.parameters)),t.tags&&(n.tags=y(t.tags)),!Object.keys(n).length)throw new u("No updates specified");let a=await c(oe,{id:e,input:n});d("Query updated"),s(t,a.semUpdateQuery);}catch(n){i(n);}}),o.command("archive").description("Archive a saved query").argument("<id>","Query ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(re,{id:e});if(!n.semArchiveQuery)throw new u(`Query ${e} could not be archived`);d(`Query ${e} archived`),s(t,{archived:n.semArchiveQuery});}catch(n){i(n);}}),o.command("publish").description("Publish a draft query").argument("<id>","Query ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(ie,{id:e});d(`Query published: ${n.semPublishQuery.name}`),s(t,n.semPublishQuery);}catch(n){i(n);}}),o.command("run").description("Enqueue a federated execution of a saved query").argument("<id>","Query ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(se,{id:e});d(`Query run enqueued: ${n.semRunQuery.id} (${n.semRunQuery.status})`),s(t,n.semRunQuery);}catch(n){i(n);}}),o.command("runs").description("List run history for a saved query").requiredOption("--query <id>","Query ID").option("--status <s>","Filter by run status").option("--limit <n>","Page size",l,50).option("--offset <n>","Offset",l,0).option("--cursor <c>","Opaque pagination cursor").option("-f, --format <format>","Output format").action(async e=>{try{let n=(await c(ae,{queryId:e.query,status:e.status?e.status.toUpperCase():void 0,pagination:C(e)})).semListQueryRuns.items;s(e,n,{headers:["ID","Status","Rows","Duration (ms)","Cached"],rows:n.map(a=>[m(a.id,12),a.status,a.rowCount!=null?String(a.rowCount):"-",a.durationMs!=null?String(a.durationMs):"-",a.fromCache?"yes":"no"])});}catch(t){i(t);}});}function Ie(r){let o=r.command("access-policies").description("SemanticFed access policies (row/column/entity governance)");o.command("list").description("List access policies").option("--entity <id>","Filter by entity ID").option("--model <id>","Filter by model ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await c(ce,{entityId:e.entity,modelId:e.model});s(e,t.semListAccessPolicies,{headers:["ID","Name","Principal","Effect","Scope","Active"],rows:t.semListAccessPolicies.map(n=>[m(n.id,12),n.name,n.principal,n.effect,n.scope,n.isActive?"yes":"no"])});}catch(t){i(t);}}),o.command("create").description("Create an access policy").requiredOption("--name <name>","Policy name").requiredOption("--principal <p>","Principal (user/role/group expression)").option("--effect <e>","ALLOW|DENY","ALLOW").option("--scope <s>","ROW|COLUMN|ENTITY","ROW").option("--entity <id>","Scoped entity ID").option("--model <id>","Scoped model ID").option("--rule <json>","Rule JSON (predicate / column list)").option("--description <s>","Description").option("-f, --format <format>","Output format").action(async e=>{try{let t={name:e.name,principal:e.principal,effect:(e.effect??"ALLOW").toUpperCase(),scope:(e.scope??"ROW").toUpperCase()};e.entity&&(t.entityId=e.entity),e.model&&(t.modelId=e.model),e.rule&&(t.rule=f("rule",e.rule)),e.description&&(t.description=e.description);let n=await c(de,{input:t});d(`Access policy created: ${n.semCreateAccessPolicy.name}`),s(e,n.semCreateAccessPolicy);}catch(t){i(t);}}),o.command("set-active").description("Activate or deactivate an access policy").argument("<id>","Policy ID").requiredOption("--active <bool>","true|false",e=>e==="true").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await c(ue,{id:e,isActive:t.active});d(`Access policy ${e} ${n.semSetAccessPolicyActive.isActive?"activated":"deactivated"}`),s(t,n.semSetAccessPolicyActive);}catch(n){i(n);}});}function Se(r){r.command("health").description("SemanticFed subgraph liveness/identity probe (public)").option("-f, --format <format>","Output format").action(async o=>{try{let e=await w(pe);d(e.semHealth),s(o,{health:e.semHealth});}catch(e){i(e);}});}var $e={id:"semanticfed",version:"1.0.0",displayName:"SemanticFed",dependsOn:["auth","workspaces"],register(r,o){T(o);let e=r.command("semanticfed").description("SemanticFed data-federation & governed semantic layer");me(e),le(e),fe(e),ge(e),ye(e),Ce(e),he(e),Ee(e),Ie(e),Se(e);}},Mn=$e;module.exports=Mn;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,b as b$1,h as h$1,p,g as g$1,i,d}from'../../chunk-
|
|
1
|
+
import {a,b as b$1,h as h$1,p,g as g$1,i,d}from'../../chunk-NLEVVDXR.js';import {o}from'../../chunk-IZXPWPKX.js';var h=`
|
|
2
2
|
query SemConnector($id: ID!) {
|
|
3
3
|
semConnector(id: $id) {
|
|
4
4
|
id name kind description isActive capabilities
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var p=class extends Error{exitCode;hint;constructor(o,s){super(o),this.name="CliUserError",this.exitCode=s?.exitCode??1,this.hint=s?.hint;}};var l=class extends Error{cause;constructor(o,s){super(o),this.name="CliInternalError",this.cause=s;}};var h=null;function v(r){h=r;}function g(){if(!h)throw new l("vibecontrols module helpers used before setHelpersContext was called");return h}async function a(r,o){return g().gql.global.request(r,o)}function c(r){let o=r instanceof Error?r.message:String(r);throw new p(o)}function u(r,o,s){g().output.formatAndOutput(r,o,s);}function C(r){g().output.printSuccess(r);}function y(r){return g().output.formatStatus(r)}function w(r){return g().output.formatDate(r)}function f(r,o){return g().output.truncate(r,o)}var A=Y();function Y(){return `
|
|
2
2
|
query SearchStore($input: BrowseStoreInput!) {
|
|
3
3
|
browseStore(input: $input) {
|
|
4
4
|
products { id name description price currency type status }
|
|
5
5
|
totalCount hasMore
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
`}var
|
|
8
|
+
`}var O=`
|
|
9
9
|
query MyCart {
|
|
10
10
|
myCart {
|
|
11
11
|
id currency subtotal total itemCount isEmpty
|
|
12
12
|
items { id productId quantity }
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
`,
|
|
15
|
+
`,S=`
|
|
16
16
|
mutation AddToCart($input: AddToCartInput!) {
|
|
17
17
|
addToCart(input: $input) {
|
|
18
18
|
id itemCount subtotal items { productId quantity }
|
|
@@ -36,21 +36,21 @@
|
|
|
36
36
|
id status total currency createdAt
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
`,
|
|
39
|
+
`,P=`
|
|
40
40
|
query GetOrder($id: ID!) {
|
|
41
41
|
getOrder(id: $id) {
|
|
42
42
|
id status total currency paidAt billingAccountId
|
|
43
43
|
lineItems { productId quantity unitPrice }
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
`,
|
|
46
|
+
`,q=`
|
|
47
47
|
query GetInstalledProducts {
|
|
48
48
|
myStoreAppInstallations {
|
|
49
49
|
items { id productId workspaceId status version installedAt }
|
|
50
50
|
total hasMore
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
`,
|
|
53
|
+
`,L=`
|
|
54
54
|
mutation UninstallProduct($installationId: ID!) {
|
|
55
55
|
uninstallProduct(installationId: $installationId) { success }
|
|
56
56
|
}
|
|
@@ -60,4 +60,4 @@
|
|
|
60
60
|
id status validFrom expiresAt
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
`;function N(r){let o=r.command("store").description("Store: marketplace, cart, orders, installed apps");o.command("search").description("Search the store").argument("<query>").option("--type <t>").option("--category <c>").option("--limit <n>","Page size",e=>parseInt(e,10),20).option("-f, --format <format>").action(async(e,t)=>{try{let n={search:e};t.type&&(n.productType=t.type.toUpperCase()),t.category&&(n.categories=[t.category]);let
|
|
63
|
+
`;function N(r){let o=r.command("store").description("Store: marketplace, cart, orders, installed apps");o.command("search").description("Search the store").argument("<query>").option("--type <t>").option("--category <c>").option("--limit <n>","Page size",e=>parseInt(e,10),20).option("-f, --format <format>").action(async(e,t)=>{try{let n={search:e};t.type&&(n.productType=t.type.toUpperCase()),t.category&&(n.categories=[t.category]);let d={filter:n,pagination:{limit:t.limit,offset:0},sortBy:"RELEVANCE"},I=await a(A,{input:d});u(t,I.browseStore.products,{headers:["ID","Name","Type","Price"],rows:I.browseStore.products.map(m=>[f(m.id,12),m.name,m.type??"-",`${m.price??"-"} ${m.currency??""}`.trim()])});}catch(n){c(n);}});let s=o.command("cart").description("Shopping cart");s.command("list").description("Show current cart").option("-f, --format <format>").action(async e=>{try{let t=await a(O);u(e,t.myCart);}catch(t){c(t);}}),s.command("add").description("Add a product to the cart").requiredOption("--product <id>").option("--quantity <n>","",e=>parseInt(e,10),1).option("--variant <id>").option("-f, --format <format>").action(async e=>{try{let t={productId:e.product,quantity:e.quantity,variantId:e.variant},n=await a(S,{input:t});C("Added to cart"),u(e,n.addToCart);}catch(t){c(t);}}),s.command("remove").description("Remove an item from the cart").requiredOption("--cart <id>").requiredOption("--item <id>").action(async e=>{try{await a(R,{cartId:e.cart,itemId:e.item}),C("Item removed from cart");}catch(t){c(t);}}),s.command("checkout").description("Check out the cart").argument("<cartId>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await a(D,{cartId:e});n.checkoutCart.success&&C("Checkout complete"),u(t,n.checkoutCart);}catch(n){c(n);}});let k=o.command("orders").description("Orders");k.command("list").description("List orders").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t=await a($,{limit:e.limit,offset:0});u(e,t.myOrders,{headers:["ID","Status","Total","Currency","Created"],rows:t.myOrders.map(n=>[f(n.id,12),y(n.status),String(n.total??"-"),n.currency??"-",w(n.createdAt)])});}catch(t){c(t);}}),k.command("get").description("Get an order").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await a(P,{id:e});if(!n.getOrder)throw new p(`Order ${e} not found`);u(t,n.getOrder);}catch(n){c(n);}});let x=o.command("installed").description("Installed products");x.command("list").description("List the current user's installed store apps").option("-f, --format <format>").action(async e=>{try{let n=(await a(q)).myStoreAppInstallations.items;u(e,n,{headers:["InstallationID","ProductID","Workspace","Status","Version","Installed"],rows:n.map(d=>[f(d.id,12),f(d.productId,12),f(d.workspaceId,12),y(d.status),d.version??"-",w(d.installedAt)])});}catch(t){c(t);}}),x.command("uninstall").description("Uninstall a product by installation id").argument("<installationId>").action(async e=>{try{await a(L,{installationId:e}),C("Product uninstalled");}catch(t){c(t);}}),o.command("licenses").description("Licenses").command("list").description("List licenses for an entitlement").requiredOption("--entitlement <id>").option("-f, --format <format>").action(async e=>{try{let t=await a(_,{entitlementId:e.entitlement});u(e,t.getLicenses);}catch(t){c(t);}});}var Q={id:"store",version:"1.0.0",displayName:"Store",dependsOn:["auth"],register(r,o){v(o),N(r);}},ce=Q;module.exports=ce;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,c,h as h$1,p,g,i,n,o}from'../../chunk-
|
|
1
|
+
import {a,c,h as h$1,p,g,i,n,o}from'../../chunk-NLEVVDXR.js';import {o as o$1}from'../../chunk-IZXPWPKX.js';var E=x();function x(){return `
|
|
2
2
|
query SearchStore($input: BrowseStoreInput!) {
|
|
3
3
|
browseStore(input: $input) {
|
|
4
4
|
products { id name description price currency type status }
|