@burdenoff/cli-sdk 2026.1124.1 → 2026.1202.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-BGNPGKJM.js +1 -0
- package/dist/{chunk-ASSY2L5R.js → chunk-E6F56R4K.js} +3 -3
- package/dist/chunk-N7EXKGE2.js +34 -0
- package/dist/core/index.cjs +9 -9
- 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 +9 -9
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{module-BNVKV_pI.d.ts → module-DWSAfs3k.d.cts} +20 -19
- package/dist/{module-BNVKV_pI.d.cts → module-DWSAfs3k.d.ts} +20 -19
- package/dist/modules/adaptercloud/index.cjs +38 -38
- package/dist/modules/adaptercloud/index.d.cts +1 -1
- package/dist/modules/adaptercloud/index.d.ts +1 -1
- package/dist/modules/adaptercloud/index.js +2 -2
- package/dist/modules/artistrybase/index.cjs +50 -50
- package/dist/modules/artistrybase/index.d.cts +1 -1
- package/dist/modules/artistrybase/index.d.ts +1 -1
- package/dist/modules/artistrybase/index.js +2 -2
- package/dist/modules/assethandler/index.cjs +32 -32
- package/dist/modules/assethandler/index.d.cts +1 -1
- package/dist/modules/assethandler/index.d.ts +1 -1
- package/dist/modules/assethandler/index.js +2 -2
- package/dist/modules/atheletebridge/index.cjs +34 -34
- package/dist/modules/atheletebridge/index.d.cts +1 -1
- package/dist/modules/atheletebridge/index.d.ts +1 -1
- package/dist/modules/atheletebridge/index.js +2 -2
- package/dist/modules/auth/index.cjs +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 +4 -4
- package/dist/modules/billing/index.cjs +18 -18
- package/dist/modules/billing/index.d.cts +1 -1
- package/dist/modules/billing/index.d.ts +1 -1
- package/dist/modules/billing/index.js +2 -2
- package/dist/modules/brainyrich/index.cjs +45 -45
- package/dist/modules/brainyrich/index.d.cts +1 -1
- package/dist/modules/brainyrich/index.d.ts +1 -1
- package/dist/modules/brainyrich/index.js +2 -2
- package/dist/modules/buildmyiq/index.cjs +32 -32
- package/dist/modules/buildmyiq/index.d.cts +1 -1
- package/dist/modules/buildmyiq/index.d.ts +1 -1
- package/dist/modules/buildmyiq/index.js +2 -2
- package/dist/modules/channels/index.cjs +12 -12
- package/dist/modules/channels/index.d.cts +1 -1
- package/dist/modules/channels/index.d.ts +1 -1
- package/dist/modules/channels/index.js +2 -2
- package/dist/modules/collabkin/index.cjs +34 -34
- package/dist/modules/collabkin/index.d.cts +1 -1
- package/dist/modules/collabkin/index.d.ts +1 -1
- package/dist/modules/collabkin/index.js +2 -2
- package/dist/modules/comradecircle/index.cjs +41 -41
- package/dist/modules/comradecircle/index.d.cts +1 -1
- package/dist/modules/comradecircle/index.d.ts +1 -1
- package/dist/modules/comradecircle/index.js +2 -2
- package/dist/modules/conversations/index.cjs +32 -32
- package/dist/modules/conversations/index.d.cts +1 -1
- package/dist/modules/conversations/index.d.ts +1 -1
- package/dist/modules/conversations/index.js +2 -2
- package/dist/modules/coolandlovely/index.cjs +41 -41
- package/dist/modules/coolandlovely/index.d.cts +1 -1
- package/dist/modules/coolandlovely/index.d.ts +1 -1
- package/dist/modules/coolandlovely/index.js +2 -2
- package/dist/modules/cosmicintersection/index.cjs +43 -43
- package/dist/modules/cosmicintersection/index.d.cts +1 -1
- package/dist/modules/cosmicintersection/index.d.ts +1 -1
- package/dist/modules/cosmicintersection/index.js +2 -2
- package/dist/modules/crewfoundry/index.cjs +70 -70
- package/dist/modules/crewfoundry/index.d.cts +1 -1
- package/dist/modules/crewfoundry/index.d.ts +1 -1
- package/dist/modules/crewfoundry/index.js +2 -2
- package/dist/modules/devportal/index.cjs +23 -23
- package/dist/modules/devportal/index.d.cts +1 -1
- package/dist/modules/devportal/index.d.ts +1 -1
- package/dist/modules/devportal/index.js +2 -2
- package/dist/modules/ecoimpacthub/index.cjs +41 -41
- package/dist/modules/ecoimpacthub/index.d.cts +1 -1
- package/dist/modules/ecoimpacthub/index.d.ts +1 -1
- package/dist/modules/ecoimpacthub/index.js +2 -2
- package/dist/modules/eventfullymanaged/index.cjs +92 -92
- package/dist/modules/eventfullymanaged/index.d.cts +1 -1
- package/dist/modules/eventfullymanaged/index.d.ts +1 -1
- package/dist/modules/eventfullymanaged/index.js +2 -2
- package/dist/modules/export/index.cjs +14 -14
- package/dist/modules/export/index.d.cts +1 -1
- package/dist/modules/export/index.d.ts +1 -1
- package/dist/modules/export/index.js +2 -2
- package/dist/modules/files/index.cjs +11 -11
- package/dist/modules/files/index.d.cts +1 -1
- package/dist/modules/files/index.d.ts +1 -1
- package/dist/modules/files/index.js +2 -2
- package/dist/modules/fluidgrids/index.cjs +29 -29
- package/dist/modules/fluidgrids/index.d.cts +1 -1
- package/dist/modules/fluidgrids/index.d.ts +1 -1
- package/dist/modules/fluidgrids/index.js +3 -3
- package/dist/modules/ggnomad/index.cjs +21 -21
- package/dist/modules/ggnomad/index.d.cts +1 -1
- package/dist/modules/ggnomad/index.d.ts +1 -1
- package/dist/modules/ggnomad/index.js +2 -2
- package/dist/modules/govcitizenhub/index.cjs +35 -35
- package/dist/modules/govcitizenhub/index.d.cts +1 -1
- package/dist/modules/govcitizenhub/index.d.ts +1 -1
- package/dist/modules/govcitizenhub/index.js +2 -2
- package/dist/modules/groups/index.cjs +12 -12
- package/dist/modules/groups/index.d.cts +1 -1
- package/dist/modules/groups/index.d.ts +1 -1
- package/dist/modules/groups/index.js +2 -2
- package/dist/modules/headshotmarketing/index.cjs +165 -165
- package/dist/modules/headshotmarketing/index.d.cts +1 -1
- package/dist/modules/headshotmarketing/index.d.ts +1 -1
- package/dist/modules/headshotmarketing/index.js +2 -2
- package/dist/modules/health/index.d.cts +1 -1
- package/dist/modules/health/index.d.ts +1 -1
- package/dist/modules/hookmovies/index.cjs +43 -43
- package/dist/modules/hookmovies/index.d.cts +1 -1
- package/dist/modules/hookmovies/index.d.ts +1 -1
- package/dist/modules/hookmovies/index.js +2 -2
- package/dist/modules/housingvista/index.cjs +24 -24
- package/dist/modules/housingvista/index.d.cts +1 -1
- package/dist/modules/housingvista/index.d.ts +1 -1
- package/dist/modules/housingvista/index.js +2 -2
- package/dist/modules/integrations/index.cjs +27 -27
- package/dist/modules/integrations/index.d.cts +1 -1
- package/dist/modules/integrations/index.d.ts +1 -1
- package/dist/modules/integrations/index.js +2 -2
- package/dist/modules/intelwatchtower/index.cjs +37 -37
- package/dist/modules/intelwatchtower/index.d.cts +1 -1
- package/dist/modules/intelwatchtower/index.d.ts +1 -1
- package/dist/modules/intelwatchtower/index.js +2 -2
- package/dist/modules/kadaikodi/index.cjs +26 -26
- package/dist/modules/kadaikodi/index.d.cts +1 -1
- package/dist/modules/kadaikodi/index.d.ts +1 -1
- package/dist/modules/kadaikodi/index.js +2 -2
- package/dist/modules/labsofscience/index.cjs +44 -44
- package/dist/modules/labsofscience/index.d.cts +1 -1
- package/dist/modules/labsofscience/index.d.ts +1 -1
- package/dist/modules/labsofscience/index.js +2 -2
- package/dist/modules/manufacturedops/index.cjs +36 -36
- package/dist/modules/manufacturedops/index.d.cts +1 -1
- package/dist/modules/manufacturedops/index.d.ts +1 -1
- package/dist/modules/manufacturedops/index.js +2 -2
- package/dist/modules/movethewheels/index.cjs +78 -78
- package/dist/modules/movethewheels/index.d.cts +1 -1
- package/dist/modules/movethewheels/index.d.ts +1 -1
- package/dist/modules/movethewheels/index.js +2 -2
- package/dist/modules/mybodyshield/index.cjs +36 -36
- package/dist/modules/mybodyshield/index.d.cts +1 -1
- package/dist/modules/mybodyshield/index.d.ts +1 -1
- package/dist/modules/mybodyshield/index.js +2 -2
- package/dist/modules/notifications/index.cjs +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.cjs +5 -5
- package/dist/modules/organizations/index.d.cts +1 -1
- package/dist/modules/organizations/index.d.ts +1 -1
- package/dist/modules/organizations/index.js +1 -1
- package/dist/modules/planmagnet/index.cjs +272 -272
- package/dist/modules/planmagnet/index.d.cts +1 -1
- package/dist/modules/planmagnet/index.d.ts +1 -1
- package/dist/modules/planmagnet/index.js +2 -2
- package/dist/modules/products/index.cjs +19 -19
- package/dist/modules/products/index.d.cts +1 -1
- package/dist/modules/products/index.d.ts +1 -1
- package/dist/modules/products/index.js +2 -2
- package/dist/modules/proserviceworld/index.cjs +24 -24
- package/dist/modules/proserviceworld/index.d.cts +1 -1
- package/dist/modules/proserviceworld/index.d.ts +1 -1
- package/dist/modules/proserviceworld/index.js +2 -2
- package/dist/modules/rbac/index.cjs +8 -8
- package/dist/modules/rbac/index.d.cts +1 -1
- package/dist/modules/rbac/index.d.ts +1 -1
- package/dist/modules/rbac/index.js +2 -2
- package/dist/modules/sandbox/index.cjs +39 -39
- 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 +25 -25
- package/dist/modules/scheduler/index.d.cts +1 -1
- package/dist/modules/scheduler/index.d.ts +1 -1
- package/dist/modules/scheduler/index.js +2 -2
- package/dist/modules/security/index.cjs +14 -14
- package/dist/modules/security/index.d.cts +1 -1
- package/dist/modules/security/index.d.ts +1 -1
- package/dist/modules/security/index.js +2 -2
- package/dist/modules/semanticfed/index.cjs +44 -44
- package/dist/modules/semanticfed/index.d.cts +1 -1
- package/dist/modules/semanticfed/index.d.ts +1 -1
- package/dist/modules/semanticfed/index.js +1 -1
- package/dist/modules/semanticfed-sql/index.cjs +4 -4
- package/dist/modules/semanticfed-sql/index.d.cts +1 -1
- package/dist/modules/semanticfed-sql/index.d.ts +1 -1
- package/dist/modules/semanticfed-sql/index.js +1 -1
- package/dist/modules/store/index.cjs +21 -21
- package/dist/modules/store/index.d.cts +1 -1
- package/dist/modules/store/index.d.ts +1 -1
- package/dist/modules/store/index.js +2 -2
- package/dist/modules/subscriberbot/index.cjs +41 -41
- package/dist/modules/subscriberbot/index.d.cts +1 -1
- package/dist/modules/subscriberbot/index.d.ts +1 -1
- package/dist/modules/subscriberbot/index.js +2 -2
- package/dist/modules/support/index.cjs +8 -8
- package/dist/modules/support/index.d.cts +1 -1
- package/dist/modules/support/index.d.ts +1 -1
- package/dist/modules/support/index.js +2 -2
- package/dist/modules/tags/index.cjs +10 -10
- package/dist/modules/tags/index.d.cts +1 -1
- package/dist/modules/tags/index.d.ts +1 -1
- package/dist/modules/tags/index.js +2 -2
- package/dist/modules/technospam/index.cjs +44 -44
- package/dist/modules/technospam/index.d.cts +1 -1
- package/dist/modules/technospam/index.d.ts +1 -1
- package/dist/modules/technospam/index.js +2 -2
- package/dist/modules/theculturepost/index.cjs +32 -32
- package/dist/modules/theculturepost/index.d.cts +1 -1
- package/dist/modules/theculturepost/index.d.ts +1 -1
- package/dist/modules/theculturepost/index.js +2 -2
- package/dist/modules/theglobalfuel/index.cjs +30 -30
- package/dist/modules/theglobalfuel/index.d.cts +1 -1
- package/dist/modules/theglobalfuel/index.d.ts +1 -1
- package/dist/modules/theglobalfuel/index.js +2 -2
- package/dist/modules/timecampus/index.cjs +69 -69
- package/dist/modules/timecampus/index.d.cts +1 -1
- package/dist/modules/timecampus/index.d.ts +1 -1
- package/dist/modules/timecampus/index.js +4 -4
- package/dist/modules/tours/index.cjs +4 -4
- package/dist/modules/tours/index.d.cts +1 -1
- package/dist/modules/tours/index.d.ts +1 -1
- package/dist/modules/tours/index.js +2 -2
- package/dist/modules/vibecontrols/index.cjs +460 -460
- package/dist/modules/vibecontrols/index.d.cts +1 -1
- package/dist/modules/vibecontrols/index.d.ts +1 -1
- package/dist/modules/vibecontrols/index.js +5 -5
- package/dist/modules/workspaces/index.cjs +16 -16
- package/dist/modules/workspaces/index.d.cts +1 -1
- package/dist/modules/workspaces/index.d.ts +1 -1
- package/dist/modules/workspaces/index.js +2 -2
- package/package.json +6 -1
- package/dist/chunk-3ZVMC2AF.js +0 -1
- package/dist/chunk-ZT6KOG7N.js +0 -34
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var d=class extends Error{exitCode;hint;constructor(o,e){super(o),this.name="CliUserError",this.exitCode=e?.exitCode??1,this.hint=e?.hint;}},
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var d=class extends Error{exitCode;hint;constructor(o,e){super(o),this.name="CliUserError",this.exitCode=e?.exitCode??1,this.hint=e?.hint;}},h=class extends d{constructor(o,e){super(o,{exitCode:2,hint:e?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},g=class extends Error{cause;constructor(o,e){super(o),this.name="CliInternalError",this.cause=e;}};function x(r){if(r instanceof h||r instanceof d)return r;let o=b(r)&&b(r.response)?r.response:void 0,e=o?.errors,t=Array.isArray(e)?e[0]:void 0,i=(b(t)&&b(t.extensions)?t.extensions:void 0)?.code,f=o?.status;return i==="UNAUTHENTICATED"||f===401?new h("Authentication required."):i==="FORBIDDEN"||f===403?new d("Permission denied."):i==="BAD_USER_INPUT"||i==="GRAPHQL_VALIDATION_FAILED"||f===400?new d("Invalid request. Check the command arguments."):i==="NOT_FOUND"||f===404?new d("Requested resource was not found."):i==="RATE_LIMITED"||i==="TOO_MANY_REQUESTS"||f===429?new d("Request limit reached. Try again later."):new g("The request could not be completed. Try again later.")}var k=class extends Error{response;constructor(o,e){super(o),this.name="GqlRequestError",this.response=e;}};function b(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}var R=null;function _(r){R=r;}function S(){if(!R)throw new g("vibecontrols module helpers used before setHelpersContext was called");return R}function Ve(){let r=S();if(!r.auth.isAuthenticated())throw new h("Authentication required.",{hint:`Run \`${r.productName} auth login\` to authenticate.`})}async function a(r,o){return Ve(),S().gql.workspace.request(r,o)}async function D(r,o){return S().gql.workspaceAuthOnly.request(r,o)}function s(r){throw r instanceof h||r instanceof d||r instanceof g?r:r instanceof k||r!==null&&typeof r=="object"&&"response"in r?x(r):new g("The command could not be completed. Try again later.")}function c(r,o,e){S().output.formatAndOutput(r,o,e);}function T(){return S().output}function u(r){S().output.printSuccess(r);}function m(r,o){return S().output.truncate(r,o)}var q=`
|
|
2
2
|
query SemConnector($id: ID!) {
|
|
3
3
|
semConnector(id: $id) {
|
|
4
4
|
id name kind description isActive capabilities
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
createdAt updatedAt workspaceId
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
`,$=`
|
|
10
10
|
query SemListConnectors($kind: SemConnectorKind, $pagination: PaginationInput) {
|
|
11
11
|
semListConnectors(kind: $kind, pagination: $pagination) {
|
|
12
12
|
items {
|
|
@@ -15,23 +15,23 @@
|
|
|
15
15
|
pageInfo { cursor hasMore }
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
`,
|
|
18
|
+
`,L=`
|
|
19
19
|
mutation SemCreateConnector($input: SemCreateConnectorInput!) {
|
|
20
20
|
semCreateConnector(input: $input) {
|
|
21
21
|
id name kind description isActive capabilities createdAt updatedAt workspaceId
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
`,
|
|
24
|
+
`,N=`
|
|
25
25
|
mutation SemUpdateConnector($id: ID!, $input: SemUpdateConnectorInput!) {
|
|
26
26
|
semUpdateConnector(id: $id, input: $input) {
|
|
27
27
|
id name kind description isActive capabilities updatedAt workspaceId
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
`,P=`
|
|
31
31
|
mutation SemArchiveConnector($id: ID!) {
|
|
32
32
|
semArchiveConnector(id: $id)
|
|
33
33
|
}
|
|
34
|
-
`,
|
|
34
|
+
`,U=`
|
|
35
35
|
query SemDataSource($id: ID!) {
|
|
36
36
|
semDataSource(id: $id) {
|
|
37
37
|
id connectorId name description endpoint pushdownEnabled secretRef
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
createdAt updatedAt workspaceId
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
`,
|
|
43
|
+
`,Q=`
|
|
44
44
|
query SemListDataSources(
|
|
45
45
|
$connectorId: ID
|
|
46
46
|
$status: SemDataSourceStatus
|
|
@@ -54,43 +54,43 @@
|
|
|
54
54
|
pageInfo { cursor hasMore }
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
`,
|
|
57
|
+
`,F=`
|
|
58
58
|
mutation SemCreateDataSource($input: SemCreateDataSourceInput!) {
|
|
59
59
|
semCreateDataSource(input: $input) {
|
|
60
60
|
id connectorId name description endpoint pushdownEnabled secretRef
|
|
61
61
|
status tags createdAt updatedAt workspaceId
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
`,
|
|
64
|
+
`,W=`
|
|
65
65
|
mutation SemUpdateDataSource($id: ID!, $input: SemUpdateDataSourceInput!) {
|
|
66
66
|
semUpdateDataSource(id: $id, input: $input) {
|
|
67
67
|
id connectorId name description endpoint pushdownEnabled secretRef
|
|
68
68
|
status tags updatedAt workspaceId
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
`,
|
|
71
|
+
`,G=`
|
|
72
72
|
mutation SemArchiveDataSource($id: ID!) {
|
|
73
73
|
semArchiveDataSource(id: $id)
|
|
74
74
|
}
|
|
75
|
-
`,
|
|
75
|
+
`,j=`
|
|
76
76
|
mutation SemTransitionDataSource($id: ID!, $status: SemDataSourceStatus!) {
|
|
77
77
|
semTransitionDataSource(id: $id, status: $status) {
|
|
78
78
|
id name status updatedAt workspaceId
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
`,
|
|
81
|
+
`,H=`
|
|
82
82
|
query SemListConnections($dataSourceId: ID!) {
|
|
83
83
|
semListConnections(dataSourceId: $dataSourceId) {
|
|
84
84
|
id dataSourceId health latencyMs message probedAt createdAt updatedAt workspaceId
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
`,
|
|
87
|
+
`,Y=`
|
|
88
88
|
mutation SemRecordConnection($input: SemRecordConnectionInput!) {
|
|
89
89
|
semRecordConnection(input: $input) {
|
|
90
90
|
id dataSourceId health latencyMs message probedAt createdAt updatedAt workspaceId
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
`,
|
|
93
|
+
`,V=`
|
|
94
94
|
query SemModel($id: ID!) {
|
|
95
95
|
semModel(id: $id) {
|
|
96
96
|
id name description status version tags publishedAt
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
createdAt updatedAt workspaceId
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
`,
|
|
102
|
+
`,B=`
|
|
103
103
|
query SemListModels($status: SemModelStatus, $pagination: PaginationInput) {
|
|
104
104
|
semListModels(status: $status, pagination: $pagination) {
|
|
105
105
|
items {
|
|
@@ -108,29 +108,29 @@
|
|
|
108
108
|
pageInfo { cursor hasMore }
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
`,
|
|
111
|
+
`,K=`
|
|
112
112
|
mutation SemCreateModel($input: SemCreateModelInput!) {
|
|
113
113
|
semCreateModel(input: $input) {
|
|
114
114
|
id name description status version tags createdAt updatedAt workspaceId
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
`,
|
|
117
|
+
`,J=`
|
|
118
118
|
mutation SemUpdateModel($id: ID!, $input: SemUpdateModelInput!) {
|
|
119
119
|
semUpdateModel(id: $id, input: $input) {
|
|
120
120
|
id name description status version tags updatedAt workspaceId
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
`,
|
|
123
|
+
`,z=`
|
|
124
124
|
mutation SemArchiveModel($id: ID!) {
|
|
125
125
|
semArchiveModel(id: $id)
|
|
126
126
|
}
|
|
127
|
-
`,
|
|
127
|
+
`,X=`
|
|
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
|
+
`,Z=`
|
|
134
134
|
query SemEntity($id: ID!) {
|
|
135
135
|
semEntity(id: $id) {
|
|
136
136
|
id modelId dataSourceId name kind physicalName primaryKey sqlDefinition description
|
|
@@ -139,60 +139,60 @@
|
|
|
139
139
|
createdAt updatedAt workspaceId
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
`,
|
|
142
|
+
`,ee=`
|
|
143
143
|
query SemListEntities($modelId: ID!) {
|
|
144
144
|
semListEntities(modelId: $modelId) {
|
|
145
145
|
id modelId dataSourceId name kind physicalName primaryKey sqlDefinition
|
|
146
146
|
description createdAt updatedAt workspaceId
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
`,
|
|
149
|
+
`,te=`
|
|
150
150
|
mutation SemCreateEntity($input: SemCreateEntityInput!) {
|
|
151
151
|
semCreateEntity(input: $input) {
|
|
152
152
|
id modelId dataSourceId name kind physicalName primaryKey sqlDefinition
|
|
153
153
|
description createdAt updatedAt workspaceId
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
`,
|
|
156
|
+
`,ne=`
|
|
157
157
|
mutation SemUpdateEntity($id: ID!, $input: SemUpdateEntityInput!) {
|
|
158
158
|
semUpdateEntity(id: $id, input: $input) {
|
|
159
159
|
id modelId dataSourceId name kind physicalName primaryKey sqlDefinition
|
|
160
160
|
description updatedAt workspaceId
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
`,
|
|
163
|
+
`,oe=`
|
|
164
164
|
mutation SemDeleteEntity($id: ID!) {
|
|
165
165
|
semDeleteEntity(id: $id)
|
|
166
166
|
}
|
|
167
|
-
`,
|
|
167
|
+
`,re=`
|
|
168
168
|
mutation SemCreateDimension($input: SemCreateDimensionInput!) {
|
|
169
169
|
semCreateDimension(input: $input) {
|
|
170
170
|
id entityId name dataType expression isPrimary description
|
|
171
171
|
createdAt updatedAt workspaceId
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
`,
|
|
174
|
+
`,ie=`
|
|
175
175
|
mutation SemCreateMetric($input: SemCreateMetricInput!) {
|
|
176
176
|
semCreateMetric(input: $input) {
|
|
177
177
|
id entityId name aggregation expression format description
|
|
178
178
|
createdAt updatedAt workspaceId
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
`,
|
|
181
|
+
`,se=`
|
|
182
182
|
query SemListRelationships($modelId: ID!) {
|
|
183
183
|
semListRelationships(modelId: $modelId) {
|
|
184
184
|
id modelId name kind fromEntityId fromField toEntityId toField description
|
|
185
185
|
createdAt updatedAt workspaceId
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
`,
|
|
188
|
+
`,ae=`
|
|
189
189
|
mutation SemCreateRelationship($input: SemCreateRelationshipInput!) {
|
|
190
190
|
semCreateRelationship(input: $input) {
|
|
191
191
|
id modelId name kind fromEntityId fromField toEntityId toField description
|
|
192
192
|
createdAt updatedAt workspaceId
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
`,
|
|
195
|
+
`,ce=`
|
|
196
196
|
query SemQuery($id: ID!) {
|
|
197
197
|
semQuery(id: $id) {
|
|
198
198
|
id modelId name description queryText parameters cacheable cacheTtlSeconds
|
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
createdAt updatedAt workspaceId
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
`,
|
|
204
|
+
`,de=`
|
|
205
205
|
query SemListQueries(
|
|
206
206
|
$modelId: ID
|
|
207
207
|
$status: SemQueryStatus
|
|
@@ -215,38 +215,38 @@
|
|
|
215
215
|
pageInfo { cursor hasMore }
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
`,
|
|
218
|
+
`,ue=`
|
|
219
219
|
mutation SemCreateQuery($input: SemCreateQueryInput!) {
|
|
220
220
|
semCreateQuery(input: $input) {
|
|
221
221
|
id modelId name description queryText parameters cacheable cacheTtlSeconds
|
|
222
222
|
status tags createdAt updatedAt workspaceId
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
`,
|
|
225
|
+
`,pe=`
|
|
226
226
|
mutation SemUpdateQuery($id: ID!, $input: SemUpdateQueryInput!) {
|
|
227
227
|
semUpdateQuery(id: $id, input: $input) {
|
|
228
228
|
id modelId name description queryText parameters cacheable cacheTtlSeconds
|
|
229
229
|
status tags updatedAt workspaceId
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
`,
|
|
232
|
+
`,me=`
|
|
233
233
|
mutation SemArchiveQuery($id: ID!) {
|
|
234
234
|
semArchiveQuery(id: $id)
|
|
235
235
|
}
|
|
236
|
-
`,
|
|
236
|
+
`,le=`
|
|
237
237
|
mutation SemPublishQuery($id: ID!) {
|
|
238
238
|
semPublishQuery(id: $id) {
|
|
239
239
|
id name status updatedAt workspaceId
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
`,
|
|
242
|
+
`,fe=`
|
|
243
243
|
mutation SemRunQuery($id: ID!) {
|
|
244
244
|
semRunQuery(id: $id) {
|
|
245
245
|
id queryId status startedAt finishedAt durationMs rowCount sourcesTouched
|
|
246
246
|
fromCache errorMessage createdAt updatedAt workspaceId
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
`,
|
|
249
|
+
`,ge=`
|
|
250
250
|
query SemListQueryRuns(
|
|
251
251
|
$queryId: ID!
|
|
252
252
|
$status: SemQueryRunStatus
|
|
@@ -260,31 +260,31 @@
|
|
|
260
260
|
pageInfo { cursor hasMore }
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
|
-
`,
|
|
263
|
+
`,ye=`
|
|
264
264
|
query SemListAccessPolicies($entityId: ID, $modelId: ID) {
|
|
265
265
|
semListAccessPolicies(entityId: $entityId, modelId: $modelId) {
|
|
266
266
|
id name description principal effect scope entityId modelId rule isActive
|
|
267
267
|
createdAt updatedAt workspaceId
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
`,
|
|
270
|
+
`,Ce=`
|
|
271
271
|
mutation SemCreateAccessPolicy($input: SemCreateAccessPolicyInput!) {
|
|
272
272
|
semCreateAccessPolicy(input: $input) {
|
|
273
273
|
id name description principal effect scope entityId modelId rule isActive
|
|
274
274
|
createdAt updatedAt workspaceId
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
-
`,
|
|
277
|
+
`,he=`
|
|
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
|
+
`,Ee=`
|
|
284
284
|
query SemHealth {
|
|
285
285
|
semHealth
|
|
286
286
|
}
|
|
287
|
-
`,
|
|
287
|
+
`,we=`
|
|
288
288
|
mutation SemExecuteSql($input: SemExecuteSqlInput!) {
|
|
289
289
|
semExecuteSql(input: $input) {
|
|
290
290
|
modelId
|
|
@@ -292,7 +292,7 @@
|
|
|
292
292
|
rows rowCount truncated durationMs sourcesTouched planSummary
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
`,
|
|
295
|
+
`,Se=`
|
|
296
296
|
query SemSqlCatalog($modelId: ID) {
|
|
297
297
|
semSqlCatalog(modelId: $modelId) {
|
|
298
298
|
modelId modelName
|
|
@@ -302,6 +302,6 @@
|
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
|
-
`;function g(r,o){try{return JSON.parse(o)}catch{throw new d(`--${r} must be valid JSON`)}}function l(r){let o=Number.parseInt(r,10);if(Number.isNaN(o))throw new d(`Expected an integer but got "${r}"`);return o}function C(r){return r.split(",").map(o=>o.trim()).filter(o=>o.length>0)}function h(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 Ee(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 a(M,{kind:e.kind?e.kind.toUpperCase():void 0,pagination:h(e)})).semListConnectors.items;c(e,n,{headers:["ID","Name","Kind","Active","Description"],rows:n.map(i=>[m(i.id,12),i.name,i.kind,i.isActive?"yes":"no",m(i.description??"",32)])});}catch(t){s(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 a(v,{id:e});if(!n.semConnector)throw new d(`Connector ${e} not found`);c(t,n.semConnector);}catch(n){s(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=g("capabilities",e.capabilities));let n=await a(_,{input:t});u(`Connector created: ${n.semCreateConnector.name}`),c(e,n.semCreateConnector);}catch(t){s(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=g("capabilities",t.capabilities)),t.active!==void 0&&(n.isActive=t.active),!Object.keys(n).length)throw new d("No updates specified");let i=await a(q,{id:e,input:n});u("Connector updated"),c(t,i.semUpdateConnector);}catch(n){s(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 a($,{id:e});if(!n.semArchiveConnector)throw new d(`Connector ${e} could not be archived`);u(`Connector ${e} archived`),c(t,{archived:n.semArchiveConnector});}catch(n){s(n);}});}function we(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 a(N,{connectorId:e.connector,status:e.status?e.status.toUpperCase():void 0,pagination:h(e)})).semListDataSources.items;c(e,n,{headers:["ID","Name","Connector","Status","Pushdown"],rows:n.map(i=>[m(i.id,12),i.name,m(i.connectorId,12),i.status,i.pushdownEnabled?"yes":"no"])});}catch(t){s(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 a(L,{id:e});if(!n.semDataSource)throw new d(`Data source ${e} not found`);c(t,n.semDataSource);}catch(n){s(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=g("endpoint",e.endpoint)),e.secretRef&&(t.secretRef=e.secretRef),e.pushdown!==void 0&&(t.pushdownEnabled=e.pushdown),e.tags&&(t.tags=C(e.tags));let n=await a(P,{input:t});u(`Data source created: ${n.semCreateDataSource.name}`),c(e,n.semCreateDataSource);}catch(t){s(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=g("endpoint",t.endpoint)),t.secretRef&&(n.secretRef=t.secretRef),t.pushdown!==void 0&&(n.pushdownEnabled=t.pushdown),t.tags&&(n.tags=C(t.tags)),!Object.keys(n).length)throw new d("No updates specified");let i=await a(U,{id:e,input:n});u("Data source updated"),c(t,i.semUpdateDataSource);}catch(n){s(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 a(Q,{id:e});if(!n.semArchiveDataSource)throw new d(`Data source ${e} could not be archived`);u(`Data source ${e} archived`),c(t,{archived:n.semArchiveDataSource});}catch(n){s(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 a(F,{id:e,status:t.status.toUpperCase()});u(`Data source status set to ${n.semTransitionDataSource.status}`),c(t,n.semTransitionDataSource);}catch(n){s(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 a(W,{dataSourceId:e});c(t,n.semListConnections,{headers:["ID","Health","Latency (ms)","Probed At","Message"],rows:n.semListConnections.map(i=>[m(i.id,12),i.health,i.latencyMs!=null?String(i.latencyMs):"-",i.probedAt,m(i.message??"",32)])});}catch(n){s(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 a(G,{input:t});u(`Connection recorded: ${n.semRecordConnection.health}`),c(e,n.semRecordConnection);}catch(t){s(t);}});}function Se(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 a(H,{status:e.status?e.status.toUpperCase():void 0,pagination:h(e)})).semListModels.items;c(e,n,{headers:["ID","Name","Status","Version","Description"],rows:n.map(i=>[m(i.id,12),i.name,i.status,String(i.version),m(i.description??"",32)])});}catch(t){s(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 a(j,{id:e});if(!n.semModel)throw new d(`Model ${e} not found`);c(t,n.semModel);}catch(n){s(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=C(e.tags));let n=await a(Y,{input:t});u(`Model created: ${n.semCreateModel.name}`),c(e,n.semCreateModel);}catch(t){s(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=C(t.tags)),!Object.keys(n).length)throw new d("No updates specified");let i=await a(V,{id:e,input:n});u("Model updated"),c(t,i.semUpdateModel);}catch(n){s(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 a(B,{id:e});if(!n.semArchiveModel)throw new d(`Model ${e} could not be archived`);u(`Model ${e} archived`),c(t,{archived:n.semArchiveModel});}catch(n){s(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 a(K,{id:e});u(`Model published (v${n.semPublishModel.version})`),c(t,n.semPublishModel);}catch(n){s(n);}});}function Ie(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 a(z,{modelId:e.model});c(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){s(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 a(J,{id:e});if(!n.semEntity)throw new d(`Entity ${e} not found`);c(t,n.semEntity);}catch(n){s(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 a(X,{input:t});u(`Entity created: ${n.semCreateEntity.name}`),c(e,n.semCreateEntity);}catch(t){s(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 d("No updates specified");let i=await a(Z,{id:e,input:n});u("Entity updated"),c(t,i.semUpdateEntity);}catch(n){s(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 a(ee,{id:e});if(!n.semDeleteEntity)throw new d(`Entity ${e} could not be deleted`);u(`Entity ${e} deleted`),c(t,{deleted:n.semDeleteEntity});}catch(n){s(n);}});}function ke(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 a(te,{input:t});u(`Dimension created: ${n.semCreateDimension.name}`),c(e,n.semCreateDimension);}catch(t){s(t);}});}function Ae(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 a(ne,{input:t});u(`Metric created: ${n.semCreateMetric.name}`),c(e,n.semCreateMetric);}catch(t){s(t);}});}function be(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 a(oe,{modelId:e.model});c(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){s(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 a(re,{input:t});u(`Relationship created: ${n.semCreateRelationship.name}`),c(e,n.semCreateRelationship);}catch(t){s(t);}});}function Te(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 a(se,{modelId:e.model,status:e.status?e.status.toUpperCase():void 0,pagination:h(e)})).semListQueries.items;c(e,n,{headers:["ID","Name","Status","Model","Cacheable"],rows:n.map(i=>[m(i.id,12),i.name,i.status,i.modelId?m(i.modelId,12):"-",i.cacheable?"yes":"no"])});}catch(t){s(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 a(ie,{id:e});if(!n.semQuery)throw new d(`Query ${e} not found`);c(t,n.semQuery);}catch(n){s(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=g("parameters",e.parameters)),e.tags&&(t.tags=C(e.tags));let n=await a(ae,{input:t});u(`Query created: ${n.semCreateQuery.name}`),c(e,n.semCreateQuery);}catch(t){s(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=g("parameters",t.parameters)),t.tags&&(n.tags=C(t.tags)),!Object.keys(n).length)throw new d("No updates specified");let i=await a(ce,{id:e,input:n});u("Query updated"),c(t,i.semUpdateQuery);}catch(n){s(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 a(de,{id:e});if(!n.semArchiveQuery)throw new d(`Query ${e} could not be archived`);u(`Query ${e} archived`),c(t,{archived:n.semArchiveQuery});}catch(n){s(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 a(ue,{id:e});u(`Query published: ${n.semPublishQuery.name}`),c(t,n.semPublishQuery);}catch(n){s(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 a(pe,{id:e});u(`Query run enqueued: ${n.semRunQuery.id} (${n.semRunQuery.status})`),c(t,n.semRunQuery);}catch(n){s(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 a(me,{queryId:e.query,status:e.status?e.status.toUpperCase():void 0,pagination:h(e)})).semListQueryRuns.items;c(e,n,{headers:["ID","Status","Rows","Duration (ms)","Cached"],rows:n.map(i=>[m(i.id,12),i.status,i.rowCount!=null?String(i.rowCount):"-",i.durationMs!=null?String(i.durationMs):"-",i.fromCache?"yes":"no"])});}catch(t){s(t);}});}function xe(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 a(le,{entityId:e.entity,modelId:e.model});c(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){s(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=g("rule",e.rule)),e.description&&(t.description=e.description);let n=await a(fe,{input:t});u(`Access policy created: ${n.semCreateAccessPolicy.name}`),c(e,n.semCreateAccessPolicy);}catch(t){s(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 a(ge,{id:e,isActive:t.active});u(`Access policy ${e} ${n.semSetAccessPolicyActive.isActive?"activated":"deactivated"}`),c(t,n.semSetAccessPolicyActive);}catch(n){s(n);}});}function Re(r){r.command("health").description("SemanticFed subgraph liveness/identity probe (public)").option("-f, --format <format>","Output format").action(async o=>{try{let e=await T(ye);u(e.semHealth),c(o,{health:e.semHealth});}catch(e){s(e);}});}var De=["table","json","csv","yaml"];function Oe(r){if(r===void 0)return;let o=r.toLowerCase();if(De.includes(o))return o;throw new d(`--format must be one of ${De.join(", ")} (got "${r}")`)}function He(r){return r==null?"NULL":typeof r=="object"?JSON.stringify(r):String(r)}function ve(r){if(r==null)return "";let o=typeof r=="object"?JSON.stringify(r):String(r);return /[",\r\n]/.test(o)?`"${o.replace(/"/g,'""')}"`:o}function Ye(r){let o=r.columns.map(t=>t.name),e=[o.map(ve).join(",")];for(let t of r.rows)e.push(o.map(n=>ve(t[n])).join(","));return `${e.join(`\r
|
|
305
|
+
`;function C(r,o){try{return JSON.parse(o)}catch{throw new d(`--${r} must be valid JSON`)}}function l(r){let o=Number.parseInt(r,10);if(Number.isNaN(o))throw new d(`Expected an integer but got "${r}"`);return o}function E(r){return r.split(",").map(o=>o.trim()).filter(o=>o.length>0)}function w(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 Ie(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 a($,{kind:e.kind?e.kind.toUpperCase():void 0,pagination:w(e)})).semListConnectors.items;c(e,n,{headers:["ID","Name","Kind","Active","Description"],rows:n.map(i=>[m(i.id,12),i.name,i.kind,i.isActive?"yes":"no",m(i.description??"",32)])});}catch(t){s(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 a(q,{id:e});if(!n.semConnector)throw new d(`Connector ${e} not found`);c(t,n.semConnector);}catch(n){s(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=C("capabilities",e.capabilities));let n=await a(L,{input:t});u(`Connector created: ${n.semCreateConnector.name}`),c(e,n.semCreateConnector);}catch(t){s(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=C("capabilities",t.capabilities)),t.active!==void 0&&(n.isActive=t.active),!Object.keys(n).length)throw new d("No updates specified");let i=await a(N,{id:e,input:n});u("Connector updated"),c(t,i.semUpdateConnector);}catch(n){s(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 a(P,{id:e});if(!n.semArchiveConnector)throw new d(`Connector ${e} could not be archived`);u(`Connector ${e} archived`),c(t,{archived:n.semArchiveConnector});}catch(n){s(n);}});}function ke(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 a(Q,{connectorId:e.connector,status:e.status?e.status.toUpperCase():void 0,pagination:w(e)})).semListDataSources.items;c(e,n,{headers:["ID","Name","Connector","Status","Pushdown"],rows:n.map(i=>[m(i.id,12),i.name,m(i.connectorId,12),i.status,i.pushdownEnabled?"yes":"no"])});}catch(t){s(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 a(U,{id:e});if(!n.semDataSource)throw new d(`Data source ${e} not found`);c(t,n.semDataSource);}catch(n){s(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=C("endpoint",e.endpoint)),e.secretRef&&(t.secretRef=e.secretRef),e.pushdown!==void 0&&(t.pushdownEnabled=e.pushdown),e.tags&&(t.tags=E(e.tags));let n=await a(F,{input:t});u(`Data source created: ${n.semCreateDataSource.name}`),c(e,n.semCreateDataSource);}catch(t){s(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=C("endpoint",t.endpoint)),t.secretRef&&(n.secretRef=t.secretRef),t.pushdown!==void 0&&(n.pushdownEnabled=t.pushdown),t.tags&&(n.tags=E(t.tags)),!Object.keys(n).length)throw new d("No updates specified");let i=await a(W,{id:e,input:n});u("Data source updated"),c(t,i.semUpdateDataSource);}catch(n){s(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 a(G,{id:e});if(!n.semArchiveDataSource)throw new d(`Data source ${e} could not be archived`);u(`Data source ${e} archived`),c(t,{archived:n.semArchiveDataSource});}catch(n){s(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 a(j,{id:e,status:t.status.toUpperCase()});u(`Data source status set to ${n.semTransitionDataSource.status}`),c(t,n.semTransitionDataSource);}catch(n){s(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 a(H,{dataSourceId:e});c(t,n.semListConnections,{headers:["ID","Health","Latency (ms)","Probed At","Message"],rows:n.semListConnections.map(i=>[m(i.id,12),i.health,i.latencyMs!=null?String(i.latencyMs):"-",i.probedAt,m(i.message??"",32)])});}catch(n){s(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 a(Y,{input:t});u(`Connection recorded: ${n.semRecordConnection.health}`),c(e,n.semRecordConnection);}catch(t){s(t);}});}function Ae(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 a(B,{status:e.status?e.status.toUpperCase():void 0,pagination:w(e)})).semListModels.items;c(e,n,{headers:["ID","Name","Status","Version","Description"],rows:n.map(i=>[m(i.id,12),i.name,i.status,String(i.version),m(i.description??"",32)])});}catch(t){s(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 a(V,{id:e});if(!n.semModel)throw new d(`Model ${e} not found`);c(t,n.semModel);}catch(n){s(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=E(e.tags));let n=await a(K,{input:t});u(`Model created: ${n.semCreateModel.name}`),c(e,n.semCreateModel);}catch(t){s(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=E(t.tags)),!Object.keys(n).length)throw new d("No updates specified");let i=await a(J,{id:e,input:n});u("Model updated"),c(t,i.semUpdateModel);}catch(n){s(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 a(z,{id:e});if(!n.semArchiveModel)throw new d(`Model ${e} could not be archived`);u(`Model ${e} archived`),c(t,{archived:n.semArchiveModel});}catch(n){s(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 a(X,{id:e});u(`Model published (v${n.semPublishModel.version})`),c(t,n.semPublishModel);}catch(n){s(n);}});}function be(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 a(ee,{modelId:e.model});c(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){s(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 a(Z,{id:e});if(!n.semEntity)throw new d(`Entity ${e} not found`);c(t,n.semEntity);}catch(n){s(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 a(te,{input:t});u(`Entity created: ${n.semCreateEntity.name}`),c(e,n.semCreateEntity);}catch(t){s(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 d("No updates specified");let i=await a(ne,{id:e,input:n});u("Entity updated"),c(t,i.semUpdateEntity);}catch(n){s(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 a(oe,{id:e});if(!n.semDeleteEntity)throw new d(`Entity ${e} could not be deleted`);u(`Entity ${e} deleted`),c(t,{deleted:n.semDeleteEntity});}catch(n){s(n);}});}function Te(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 a(re,{input:t});u(`Dimension created: ${n.semCreateDimension.name}`),c(e,n.semCreateDimension);}catch(t){s(t);}});}function xe(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 a(ie,{input:t});u(`Metric created: ${n.semCreateMetric.name}`),c(e,n.semCreateMetric);}catch(t){s(t);}});}function Re(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 a(se,{modelId:e.model});c(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){s(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 a(ae,{input:t});u(`Relationship created: ${n.semCreateRelationship.name}`),c(e,n.semCreateRelationship);}catch(t){s(t);}});}function De(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 a(de,{modelId:e.model,status:e.status?e.status.toUpperCase():void 0,pagination:w(e)})).semListQueries.items;c(e,n,{headers:["ID","Name","Status","Model","Cacheable"],rows:n.map(i=>[m(i.id,12),i.name,i.status,i.modelId?m(i.modelId,12):"-",i.cacheable?"yes":"no"])});}catch(t){s(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 a(ce,{id:e});if(!n.semQuery)throw new d(`Query ${e} not found`);c(t,n.semQuery);}catch(n){s(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=C("parameters",e.parameters)),e.tags&&(t.tags=E(e.tags));let n=await a(ue,{input:t});u(`Query created: ${n.semCreateQuery.name}`),c(e,n.semCreateQuery);}catch(t){s(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=C("parameters",t.parameters)),t.tags&&(n.tags=E(t.tags)),!Object.keys(n).length)throw new d("No updates specified");let i=await a(pe,{id:e,input:n});u("Query updated"),c(t,i.semUpdateQuery);}catch(n){s(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 a(me,{id:e});if(!n.semArchiveQuery)throw new d(`Query ${e} could not be archived`);u(`Query ${e} archived`),c(t,{archived:n.semArchiveQuery});}catch(n){s(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 a(le,{id:e});u(`Query published: ${n.semPublishQuery.name}`),c(t,n.semPublishQuery);}catch(n){s(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 a(fe,{id:e});u(`Query run enqueued: ${n.semRunQuery.id} (${n.semRunQuery.status})`),c(t,n.semRunQuery);}catch(n){s(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 a(ge,{queryId:e.query,status:e.status?e.status.toUpperCase():void 0,pagination:w(e)})).semListQueryRuns.items;c(e,n,{headers:["ID","Status","Rows","Duration (ms)","Cached"],rows:n.map(i=>[m(i.id,12),i.status,i.rowCount!=null?String(i.rowCount):"-",i.durationMs!=null?String(i.durationMs):"-",i.fromCache?"yes":"no"])});}catch(t){s(t);}});}function Oe(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 a(ye,{entityId:e.entity,modelId:e.model});c(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){s(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=C("rule",e.rule)),e.description&&(t.description=e.description);let n=await a(Ce,{input:t});u(`Access policy created: ${n.semCreateAccessPolicy.name}`),c(e,n.semCreateAccessPolicy);}catch(t){s(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 a(he,{id:e,isActive:t.active});u(`Access policy ${e} ${n.semSetAccessPolicyActive.isActive?"activated":"deactivated"}`),c(t,n.semSetAccessPolicyActive);}catch(n){s(n);}});}function ve(r){r.command("health").description("SemanticFed subgraph liveness/identity probe (public)").option("-f, --format <format>","Output format").action(async o=>{try{let e=await D(Ee);u(e.semHealth),c(o,{health:e.semHealth});}catch(e){s(e);}});}var Me=["table","json","csv","yaml"];function _e(r){if(r===void 0)return;let o=r.toLowerCase();if(Me.includes(o))return o;throw new d(`--format must be one of ${Me.join(", ")} (got "${r}")`)}function Be(r){return r==null?"NULL":typeof r=="object"?JSON.stringify(r):String(r)}function qe(r){if(r==null)return "";let o=typeof r=="object"?JSON.stringify(r):String(r);return /[",\r\n]/.test(o)?`"${o.replace(/"/g,'""')}"`:o}function Ke(r){let o=r.columns.map(t=>t.name),e=[o.map(qe).join(",")];for(let t of r.rows)e.push(o.map(n=>qe(t[n])).join(","));return `${e.join(`\r
|
|
306
306
|
`)}\r
|
|
307
|
-
`}function
|
|
307
|
+
`}function Je(r,o){if(!r||r.trim()==="")throw new d('A SQL statement is required, e.g. semanticfed sql "SELECT * FROM customers LIMIT 10"');let e={sql:r};if(o.model&&(e.modelId=o.model),o.maxRows!==void 0){if(o.maxRows<1)throw new d("--max-rows must be a positive integer");e.maxRows=o.maxRows;}if(o.timeout!==void 0){if(o.timeout<1)throw new d("--timeout must be a positive integer");e.timeoutMs=o.timeout;}return e}function ze(r,o){let e=T(),t=r??e.getFormat({});if(t==="csv"){if(!e.printRaw)throw new d("This output adapter cannot print CSV; use --format json or table");e.printRaw(Ke(o));}else if(t==="table"){let n=o.columns.map(f=>f.name);e.printTable(n,o.rows.map(f=>n.map(A=>Be(f[A]))));let i=o.columns.filter(f=>f.masked).map(f=>f.name);e.printInfo(`${o.rowCount} row${o.rowCount===1?"":"s"} in ${Math.round(o.durationMs)} ms`+(i.length?` (masked: ${i.join(", ")})`:""));}else e.formatAndOutput({format:t},o);o.truncated&&e.printWarning("Result truncated: more rows matched than were returned (raise --max-rows, max 10000, or add LIMIT/WHERE).");}function $e(r){r.command("sql").description("Run a read-only SQL SELECT against a semantic model (sql catalog: list tables)").argument("[statement]","One SELECT statement; tables are entities, columns their fields").option("--model <id>","Semantic model ID (optional when the workspace has one model)").option("--max-rows <n>","Maximum rows returned (server default 1000, max 10000)",l).option("--timeout <ms>","Execution time limit in ms (default 30000, 1000-60000)",l).option("-f, --format <format>","Output format: table|json|csv|yaml").action(async(e,t)=>{try{let n=_e(t.format),i=Je(e,t),f=await a(we,{input:i});ze(n,f.semExecuteSql);}catch(n){s(n);}}).command("catalog").description("List the tables and columns a semantic model exposes to SQL").option("--model <id>","Semantic model ID (optional when the workspace has one model)").option("-f, --format <format>","Output format: table|json|yaml").action(async(e,t)=>{try{let n=t.optsWithGlobals(),i=_e(n.format);if(i==="csv")throw new d("sql catalog supports --format table, json or yaml");let A=(await a(Se,{modelId:n.model||void 0})).semSqlCatalog;T().formatAndOutput({format:i},A,{headers:["Table","Column","Kind","Type","Primary","Aggregation"],rows:A.tables.flatMap(O=>O.columns.map(I=>[O.name,I.name,I.kind,I.dataType,I.isPrimary?"yes":"",I.aggregation??""]))});}catch(n){s(n);}});}var Xe={id:"semanticfed",version:"1.0.0",displayName:"SemanticFed",dependsOn:["auth","workspaces"],register(r,o){_(o);let e=r.command("semanticfed").description("SemanticFed data-federation & governed semantic layer");Ie(e),ke(e),Ae(e),be(e),Te(e),xe(e),Re(e),De(e),Oe(e),ve(e),$e(e);}},no=Xe;module.exports=no;
|