@burdenoff/microfe-semanticfed 2026.1031.2 → 2026.1031.4
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/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +1716 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/dist/semanticfed/SemanticFedRoutes.js +24 -20
- package/dist/semanticfed/SemanticFedRoutes.js.map +1 -1
- package/dist/semanticfed/api/quotaRefusal.js +2 -1
- package/dist/semanticfed/api/quotaRefusal.js.map +1 -1
- package/dist/semanticfed/api/semanticfedGraphql.js +20 -11
- package/dist/semanticfed/api/semanticfedGraphql.js.map +1 -1
- package/dist/semanticfed/hooks/useLineage.js +62 -0
- package/dist/semanticfed/hooks/useLineage.js.map +1 -0
- package/dist/semanticfed/hooks/useSqlConsole.js +23 -20
- package/dist/semanticfed/hooks/useSqlConsole.js.map +1 -1
- package/dist/semanticfed/pages/LineagePage.js +441 -0
- package/dist/semanticfed/pages/LineagePage.js.map +1 -0
- package/dist/semanticfed/pages/QueryConsolePage.js +148 -148
- package/dist/semanticfed/pages/QueryConsolePage.js.map +1 -1
- package/dist/semanticfed/utils/cn.js +10 -0
- package/dist/semanticfed/utils/cn.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { translateWithFallback as e } from "../utils/i18n.js";
|
|
2
|
-
import {
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { AlertTriangle as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { useI18n as
|
|
7
|
-
import { Badge as
|
|
2
|
+
import { sqlErrorMessage as t, useSemExecuteSql as n, useSemSqlCatalog as r, useSemSqlModels as i } from "../hooks/useSqlConsole.js";
|
|
3
|
+
import { useMemo as a, useState as o } from "react";
|
|
4
|
+
import { AlertTriangle as s, CheckCircle2 as c, Clock as l, Database as u, EyeOff as d, Loader2 as f, Play as p, Plug as m, Table2 as h, Terminal as g, XCircle as _ } from "lucide-react";
|
|
5
|
+
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
6
|
+
import { useI18n as x } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
7
|
+
import { Badge as S, Button as C, Card as w, CardContent as T, CardHeader as E, CardTitle as D } from "@burdenoff/fe-libs/ui";
|
|
8
8
|
//#region src/semanticfed/pages/QueryConsolePage.tsx
|
|
9
|
-
var
|
|
9
|
+
var O = [
|
|
10
10
|
100,
|
|
11
11
|
1e3,
|
|
12
12
|
1e4
|
|
13
|
-
],
|
|
14
|
-
function
|
|
13
|
+
], k = 10;
|
|
14
|
+
function A(e) {
|
|
15
15
|
if (!e) return "";
|
|
16
16
|
let t = e.columns.find((e) => e.kind === "DIMENSION"), n = e.columns.find((e) => e.kind === "METRIC"), r = (e) => /^[A-Za-z_][A-Za-z0-9_]*$/.test(e) ? e : `"${e.replace(/"/g, "\"\"")}"`, i = r(e.name);
|
|
17
17
|
if (t && n) {
|
|
@@ -26,316 +26,316 @@ function k(e) {
|
|
|
26
26
|
}
|
|
27
27
|
return `SELECT *\nFROM ${i}\nLIMIT 100;`;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function j(e) {
|
|
30
30
|
return e == null ? "NULL" : typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
let { t:
|
|
34
|
-
if (!
|
|
35
|
-
|
|
36
|
-
let e =
|
|
32
|
+
function M() {
|
|
33
|
+
let { t: M } = x(), N = (t, n, r) => e(M, t, n, r), P = i(), [F, I] = o(null), L = F ?? P.data?.[0]?.id ?? null, R = r(L), z = n(), [B, V] = o(null), H = B ?? A(R.data?.tables[0]), U = (e) => V(e), [W, G] = o(1e3), [K, q] = o(null), [J, Y] = o(null), [X, Z] = o([]), Q = a(() => P.data?.find((e) => e.id === L)?.name ?? "", [P.data, L]), $ = async () => {
|
|
34
|
+
if (!L || H.trim() === "" || z.isPending) return;
|
|
35
|
+
Y(null);
|
|
36
|
+
let e = H, n = {
|
|
37
37
|
id: Date.now(),
|
|
38
38
|
sql: e,
|
|
39
|
-
modelName:
|
|
39
|
+
modelName: Q,
|
|
40
40
|
executedAt: (/* @__PURE__ */ new Date()).toLocaleTimeString()
|
|
41
41
|
};
|
|
42
42
|
try {
|
|
43
|
-
let
|
|
43
|
+
let t = await z.mutateAsync({
|
|
44
44
|
sql: e,
|
|
45
|
-
modelId:
|
|
46
|
-
maxRows:
|
|
45
|
+
modelId: L,
|
|
46
|
+
maxRows: W
|
|
47
47
|
});
|
|
48
|
-
|
|
49
|
-
...
|
|
48
|
+
q(t), Z((e) => [{
|
|
49
|
+
...n,
|
|
50
50
|
ok: !0,
|
|
51
|
-
rowCount:
|
|
52
|
-
durationMs: Math.round(
|
|
51
|
+
rowCount: t.rowCount,
|
|
52
|
+
durationMs: Math.round(t.durationMs),
|
|
53
53
|
message: null
|
|
54
|
-
}, ...e].slice(0,
|
|
54
|
+
}, ...e].slice(0, k));
|
|
55
55
|
} catch (e) {
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
...
|
|
56
|
+
let r = t(e);
|
|
57
|
+
q(null), Y(r), Z((e) => [{
|
|
58
|
+
...n,
|
|
59
59
|
ok: !1,
|
|
60
60
|
rowCount: 0,
|
|
61
61
|
durationMs: 0,
|
|
62
|
-
message:
|
|
63
|
-
}, ...e].slice(0,
|
|
62
|
+
message: r
|
|
63
|
+
}, ...e].slice(0, k));
|
|
64
64
|
}
|
|
65
|
-
},
|
|
66
|
-
return /* @__PURE__ */
|
|
65
|
+
}, ee = (e) => U(H.trim() === "" ? e : `${H}${e}`), te = P.isSuccess && P.data.length === 0;
|
|
66
|
+
return /* @__PURE__ */ b("div", {
|
|
67
67
|
className: "space-y-6 p-6",
|
|
68
68
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ b("div", {
|
|
70
70
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
71
71
|
"data-tour": "semanticfed-query-console-header",
|
|
72
|
-
children: [/* @__PURE__ */
|
|
72
|
+
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h1", {
|
|
73
73
|
className: "text-2xl font-semibold",
|
|
74
|
-
children:
|
|
75
|
-
}), /* @__PURE__ */
|
|
74
|
+
children: N("semanticfed.queryConsole.title", "Query Console")
|
|
75
|
+
}), /* @__PURE__ */ y("p", {
|
|
76
76
|
className: "text-sm text-muted-foreground",
|
|
77
|
-
children:
|
|
78
|
-
})] }), /* @__PURE__ */
|
|
77
|
+
children: N("semanticfed.queryConsole.sqlDescription", "Run read-only SQL against a semantic model. Every statement is federated across its data sources with your access policies applied.")
|
|
78
|
+
})] }), /* @__PURE__ */ b("div", {
|
|
79
79
|
className: "flex gap-2",
|
|
80
|
-
children: [/* @__PURE__ */
|
|
80
|
+
children: [/* @__PURE__ */ b(S, {
|
|
81
81
|
variant: "outline",
|
|
82
82
|
className: "gap-1",
|
|
83
|
-
children: [/* @__PURE__ */
|
|
84
|
-
}), /* @__PURE__ */
|
|
83
|
+
children: [/* @__PURE__ */ y(g, { className: "h-3 w-3" }), " SQL SELECT"]
|
|
84
|
+
}), /* @__PURE__ */ b(S, {
|
|
85
85
|
variant: "outline",
|
|
86
86
|
className: "gap-1",
|
|
87
|
-
children: [/* @__PURE__ */
|
|
87
|
+
children: [/* @__PURE__ */ y(m, { className: "h-3 w-3" }), N("semanticfed.queryConsole.badges.httpApi", "HTTP SQL API")]
|
|
88
88
|
})]
|
|
89
89
|
})]
|
|
90
90
|
}),
|
|
91
|
-
|
|
91
|
+
te && /* @__PURE__ */ y(w, { children: /* @__PURE__ */ b(T, {
|
|
92
92
|
className: "flex items-center gap-3 p-6 text-sm text-muted-foreground",
|
|
93
|
-
children: [/* @__PURE__ */
|
|
93
|
+
children: [/* @__PURE__ */ y(u, { className: "h-5 w-5" }), N("semanticfed.queryConsole.noModels", "No semantic model yet. Create a model with entities, dimensions and metrics, then query it here with SQL.")]
|
|
94
94
|
}) }),
|
|
95
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ b("div", {
|
|
96
96
|
className: "grid gap-4 lg:grid-cols-[18rem_minmax(0,1fr)]",
|
|
97
|
-
children: [/* @__PURE__ */
|
|
97
|
+
children: [/* @__PURE__ */ b(w, {
|
|
98
98
|
className: "min-w-0",
|
|
99
|
-
children: [/* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ y(E, {
|
|
100
100
|
className: "pb-3",
|
|
101
|
-
children: /* @__PURE__ */
|
|
101
|
+
children: /* @__PURE__ */ b(D, {
|
|
102
102
|
className: "flex items-center gap-2 text-base",
|
|
103
|
-
children: [/* @__PURE__ */
|
|
103
|
+
children: [/* @__PURE__ */ y(h, { className: "h-4 w-4" }), N("semanticfed.queryConsole.schema.title", "Tables")]
|
|
104
104
|
})
|
|
105
|
-
}), /* @__PURE__ */
|
|
105
|
+
}), /* @__PURE__ */ b(T, {
|
|
106
106
|
className: "space-y-3",
|
|
107
107
|
children: [
|
|
108
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ y("label", {
|
|
109
109
|
className: "block text-xs font-medium text-muted-foreground",
|
|
110
110
|
htmlFor: "sql-console-model",
|
|
111
|
-
children:
|
|
111
|
+
children: N("semanticfed.queryConsole.schema.model", "Semantic model")
|
|
112
112
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ y("select", {
|
|
114
114
|
id: "sql-console-model",
|
|
115
115
|
"data-testid": "sql-console-model",
|
|
116
116
|
className: "w-full rounded border bg-background p-2 text-sm",
|
|
117
|
-
value:
|
|
117
|
+
value: L ?? "",
|
|
118
118
|
onChange: (e) => {
|
|
119
|
-
|
|
119
|
+
I(e.target.value || null), V(null), q(null), Y(null);
|
|
120
120
|
},
|
|
121
|
-
disabled: !
|
|
122
|
-
children: (
|
|
121
|
+
disabled: !P.data || P.data.length === 0,
|
|
122
|
+
children: (P.data ?? []).map((e) => /* @__PURE__ */ y("option", {
|
|
123
123
|
value: e.id,
|
|
124
124
|
children: e.name
|
|
125
125
|
}, e.id))
|
|
126
126
|
}),
|
|
127
|
-
|
|
127
|
+
P.isError && /* @__PURE__ */ y("p", {
|
|
128
128
|
className: "text-xs text-destructive",
|
|
129
|
-
children:
|
|
129
|
+
children: t(P.error)
|
|
130
130
|
}),
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
R.isLoading && /* @__PURE__ */ y(f, { className: "h-4 w-4 animate-spin text-muted-foreground" }),
|
|
132
|
+
R.isError && /* @__PURE__ */ y("p", {
|
|
133
133
|
className: "text-xs text-destructive",
|
|
134
|
-
children:
|
|
134
|
+
children: t(R.error)
|
|
135
135
|
}),
|
|
136
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ y("div", {
|
|
137
137
|
className: "max-h-96 space-y-2 overflow-y-auto",
|
|
138
138
|
"data-testid": "sql-console-tables",
|
|
139
|
-
children: (
|
|
139
|
+
children: (R.data?.tables ?? []).map((e) => /* @__PURE__ */ b("details", {
|
|
140
140
|
className: "rounded border p-2",
|
|
141
|
-
open:
|
|
142
|
-
children: [/* @__PURE__ */
|
|
141
|
+
open: R.data?.tables.length === 1,
|
|
142
|
+
children: [/* @__PURE__ */ y("summary", {
|
|
143
143
|
className: "cursor-pointer truncate font-mono text-xs font-medium",
|
|
144
144
|
children: e.name
|
|
145
|
-
}), /* @__PURE__ */
|
|
145
|
+
}), /* @__PURE__ */ b("ul", {
|
|
146
146
|
className: "mt-2 space-y-1",
|
|
147
|
-
children: [e.columns.map((e) => /* @__PURE__ */
|
|
147
|
+
children: [e.columns.map((e) => /* @__PURE__ */ y("li", { children: /* @__PURE__ */ b("button", {
|
|
148
148
|
type: "button",
|
|
149
149
|
className: "flex w-full items-center justify-between gap-2 rounded px-1 text-left font-mono text-xs hover:bg-muted",
|
|
150
|
-
onClick: () =>
|
|
150
|
+
onClick: () => ee(e.name),
|
|
151
151
|
title: e.description ?? void 0,
|
|
152
|
-
children: [/* @__PURE__ */
|
|
152
|
+
children: [/* @__PURE__ */ y("span", {
|
|
153
153
|
className: "truncate",
|
|
154
154
|
children: e.name
|
|
155
|
-
}), /* @__PURE__ */
|
|
155
|
+
}), /* @__PURE__ */ y("span", {
|
|
156
156
|
className: "shrink-0 text-[10px] text-muted-foreground",
|
|
157
157
|
children: e.kind === "METRIC" ? e.aggregation ?? "METRIC" : e.dataType
|
|
158
158
|
})]
|
|
159
|
-
}) }, e.name)), e.columns.length === 0 && /* @__PURE__ */
|
|
159
|
+
}) }, e.name)), e.columns.length === 0 && /* @__PURE__ */ y("li", {
|
|
160
160
|
className: "text-xs text-muted-foreground",
|
|
161
|
-
children:
|
|
161
|
+
children: N("semanticfed.queryConsole.schema.noColumns", "No dimensions or metrics registered")
|
|
162
162
|
})]
|
|
163
163
|
})]
|
|
164
164
|
}, e.name))
|
|
165
165
|
})
|
|
166
166
|
]
|
|
167
167
|
})]
|
|
168
|
-
}), /* @__PURE__ */
|
|
168
|
+
}), /* @__PURE__ */ b("div", {
|
|
169
169
|
className: "min-w-0 space-y-4",
|
|
170
170
|
children: [
|
|
171
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ b(w, { children: [/* @__PURE__ */ y(E, {
|
|
172
172
|
className: "pb-3",
|
|
173
|
-
children: /* @__PURE__ */
|
|
173
|
+
children: /* @__PURE__ */ b("div", {
|
|
174
174
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
175
|
-
children: [/* @__PURE__ */
|
|
175
|
+
children: [/* @__PURE__ */ y(D, {
|
|
176
176
|
className: "text-base",
|
|
177
|
-
children:
|
|
178
|
-
}), /* @__PURE__ */
|
|
177
|
+
children: N("semanticfed.queryConsole.editor.title", "Query Editor")
|
|
178
|
+
}), /* @__PURE__ */ b("div", {
|
|
179
179
|
className: "flex items-center gap-2",
|
|
180
180
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ y("label", {
|
|
182
182
|
className: "sr-only",
|
|
183
183
|
htmlFor: "sql-console-max-rows",
|
|
184
|
-
children:
|
|
184
|
+
children: N("semanticfed.queryConsole.editor.maxRowsLabel", "Maximum rows")
|
|
185
185
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ y("select", {
|
|
187
187
|
id: "sql-console-max-rows",
|
|
188
188
|
className: "rounded border bg-background p-1 text-xs",
|
|
189
|
-
value:
|
|
190
|
-
onChange: (e) =>
|
|
191
|
-
children:
|
|
189
|
+
value: W,
|
|
190
|
+
onChange: (e) => G(Number(e.target.value)),
|
|
191
|
+
children: O.map((e) => /* @__PURE__ */ y("option", {
|
|
192
192
|
value: e,
|
|
193
|
-
children:
|
|
193
|
+
children: N("semanticfed.queryConsole.editor.maxRowsOption", "Max {count} rows", { count: e.toLocaleString() })
|
|
194
194
|
}, e))
|
|
195
195
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ b(C, {
|
|
197
197
|
size: "sm",
|
|
198
|
-
onClick: () => void
|
|
199
|
-
disabled: !
|
|
198
|
+
onClick: () => void $(),
|
|
199
|
+
disabled: !L || H.trim() === "" || z.isPending,
|
|
200
200
|
"data-testid": "sql-console-run",
|
|
201
|
-
children: [
|
|
201
|
+
children: [z.isPending ? /* @__PURE__ */ y(f, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ y(p, { className: "mr-2 h-4 w-4" }), N("semanticfed.queryConsole.actions.execute", "Execute")]
|
|
202
202
|
})
|
|
203
203
|
]
|
|
204
204
|
})]
|
|
205
205
|
})
|
|
206
|
-
}), /* @__PURE__ */
|
|
207
|
-
"aria-label":
|
|
206
|
+
}), /* @__PURE__ */ b(T, { children: [/* @__PURE__ */ y("textarea", {
|
|
207
|
+
"aria-label": N("semanticfed.queryConsole.editor.ariaLabel", "SQL statement"),
|
|
208
208
|
"data-testid": "sql-console-editor",
|
|
209
209
|
className: "w-full rounded border bg-muted/30 p-4 font-mono text-sm leading-relaxed focus:outline-none focus:ring-2 focus:ring-primary",
|
|
210
210
|
rows: 8,
|
|
211
|
-
value:
|
|
212
|
-
onChange: (e) =>
|
|
211
|
+
value: H,
|
|
212
|
+
onChange: (e) => U(e.target.value),
|
|
213
213
|
onKeyDown: (e) => {
|
|
214
|
-
(e.metaKey || e.ctrlKey) && e.key === "Enter" && (e.preventDefault(),
|
|
214
|
+
(e.metaKey || e.ctrlKey) && e.key === "Enter" && (e.preventDefault(), $());
|
|
215
215
|
},
|
|
216
216
|
spellCheck: !1,
|
|
217
217
|
placeholder: "SELECT region, SUM(revenue) FROM orders GROUP BY region"
|
|
218
|
-
}), /* @__PURE__ */
|
|
218
|
+
}), /* @__PURE__ */ b("div", {
|
|
219
219
|
className: "mt-2 flex flex-wrap items-center gap-4 text-xs text-muted-foreground",
|
|
220
220
|
children: [
|
|
221
|
-
/* @__PURE__ */
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ y("span", { children: N("semanticfed.queryConsole.editor.shortcut", "Ctrl/Cmd + Enter to run") }),
|
|
222
|
+
/* @__PURE__ */ y("span", { children: N("semanticfed.queryConsole.editor.timeout", "Timeout: 30s") }),
|
|
223
|
+
/* @__PURE__ */ y("span", { children: N("semanticfed.queryConsole.editor.supported", "SELECT, JOIN … ON, WHERE … AND, GROUP BY, ORDER BY, LIMIT/OFFSET") })
|
|
224
224
|
]
|
|
225
225
|
})] })] }),
|
|
226
|
-
|
|
226
|
+
J && /* @__PURE__ */ y(w, {
|
|
227
227
|
"data-testid": "sql-console-error",
|
|
228
|
-
children: /* @__PURE__ */
|
|
228
|
+
children: /* @__PURE__ */ b(T, {
|
|
229
229
|
className: "flex items-start gap-3 p-4 text-sm text-destructive",
|
|
230
|
-
children: [/* @__PURE__ */
|
|
230
|
+
children: [/* @__PURE__ */ y(_, { className: "mt-0.5 h-4 w-4 shrink-0" }), /* @__PURE__ */ y("span", {
|
|
231
231
|
className: "break-words",
|
|
232
|
-
children:
|
|
232
|
+
children: J
|
|
233
233
|
})]
|
|
234
234
|
})
|
|
235
235
|
}),
|
|
236
|
-
|
|
236
|
+
K && /* @__PURE__ */ b(w, {
|
|
237
237
|
"data-testid": "sql-console-result",
|
|
238
|
-
children: [/* @__PURE__ */
|
|
238
|
+
children: [/* @__PURE__ */ y(E, {
|
|
239
239
|
className: "pb-3",
|
|
240
|
-
children: /* @__PURE__ */
|
|
240
|
+
children: /* @__PURE__ */ b("div", {
|
|
241
241
|
className: "flex flex-wrap items-center gap-3 text-sm",
|
|
242
242
|
children: [
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ y(c, { className: "h-4 w-4 text-primary" }),
|
|
244
|
+
/* @__PURE__ */ y("span", {
|
|
245
245
|
className: "font-medium",
|
|
246
246
|
"data-testid": "sql-console-row-count",
|
|
247
|
-
children:
|
|
247
|
+
children: N("semanticfed.queryConsole.result.rows", "{count} rows", { count: K.rowCount.toLocaleString() })
|
|
248
248
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ b("span", {
|
|
250
250
|
className: "text-muted-foreground",
|
|
251
|
-
children: [Math.round(
|
|
251
|
+
children: [Math.round(K.durationMs), "ms"]
|
|
252
252
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ y("span", {
|
|
254
254
|
className: "text-muted-foreground",
|
|
255
|
-
children:
|
|
255
|
+
children: N("semanticfed.queryConsole.result.sources", "{count} sources", { count: K.sourcesTouched })
|
|
256
256
|
}),
|
|
257
|
-
|
|
257
|
+
K.truncated && /* @__PURE__ */ b(S, {
|
|
258
258
|
variant: "outline",
|
|
259
259
|
className: "gap-1",
|
|
260
|
-
children: [/* @__PURE__ */
|
|
260
|
+
children: [/* @__PURE__ */ y(s, { className: "h-3 w-3" }), N("semanticfed.queryConsole.result.truncated", "Truncated — more rows matched")]
|
|
261
261
|
})
|
|
262
262
|
]
|
|
263
263
|
})
|
|
264
|
-
}), /* @__PURE__ */
|
|
264
|
+
}), /* @__PURE__ */ y(T, { children: /* @__PURE__ */ y("div", {
|
|
265
265
|
className: "max-h-[28rem] overflow-auto rounded border",
|
|
266
|
-
children: /* @__PURE__ */
|
|
266
|
+
children: /* @__PURE__ */ b("table", {
|
|
267
267
|
className: "w-full text-left text-xs",
|
|
268
|
-
children: [/* @__PURE__ */
|
|
268
|
+
children: [/* @__PURE__ */ y("thead", {
|
|
269
269
|
className: "sticky top-0 bg-muted",
|
|
270
|
-
children: /* @__PURE__ */
|
|
270
|
+
children: /* @__PURE__ */ y("tr", { children: K.columns.map((e) => /* @__PURE__ */ b("th", {
|
|
271
271
|
className: "whitespace-nowrap px-3 py-2 font-medium",
|
|
272
|
-
children: [/* @__PURE__ */
|
|
272
|
+
children: [/* @__PURE__ */ b("span", {
|
|
273
273
|
className: "inline-flex items-center gap-1",
|
|
274
|
-
children: [e.name, e.masked && /* @__PURE__ */
|
|
274
|
+
children: [e.name, e.masked && /* @__PURE__ */ y(d, {
|
|
275
275
|
className: "h-3 w-3 text-muted-foreground",
|
|
276
|
-
"aria-label":
|
|
276
|
+
"aria-label": N("semanticfed.queryConsole.result.masked", "Masked by policy ({mask})", { mask: e.mask ?? "" })
|
|
277
277
|
})]
|
|
278
|
-
}), /* @__PURE__ */
|
|
278
|
+
}), /* @__PURE__ */ y("span", {
|
|
279
279
|
className: "block text-[10px] font-normal text-muted-foreground",
|
|
280
280
|
children: e.aggregation ?? e.dataType
|
|
281
281
|
})]
|
|
282
282
|
}, e.name)) })
|
|
283
|
-
}), /* @__PURE__ */
|
|
283
|
+
}), /* @__PURE__ */ b("tbody", { children: [K.rows.map((e, t) => /* @__PURE__ */ y("tr", {
|
|
284
284
|
className: "border-t",
|
|
285
|
-
children:
|
|
285
|
+
children: K.columns.map((t) => /* @__PURE__ */ y("td", {
|
|
286
286
|
className: "whitespace-nowrap px-3 py-1.5 font-mono",
|
|
287
|
-
children:
|
|
287
|
+
children: j(e[t.name])
|
|
288
288
|
}, t.name))
|
|
289
|
-
}, t)),
|
|
290
|
-
colSpan:
|
|
289
|
+
}, t)), K.rows.length === 0 && /* @__PURE__ */ y("tr", { children: /* @__PURE__ */ y("td", {
|
|
290
|
+
colSpan: K.columns.length,
|
|
291
291
|
className: "px-3 py-4 text-center text-muted-foreground",
|
|
292
|
-
children:
|
|
292
|
+
children: N("semanticfed.queryConsole.result.empty", "No rows matched")
|
|
293
293
|
}) })] })]
|
|
294
294
|
})
|
|
295
295
|
}) })]
|
|
296
296
|
}),
|
|
297
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ b(w, { children: [/* @__PURE__ */ y(E, { children: /* @__PURE__ */ b(D, {
|
|
298
298
|
className: "flex items-center gap-2 text-base",
|
|
299
|
-
children: [/* @__PURE__ */
|
|
300
|
-
}) }), /* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ y(l, { className: "h-4 w-4" }), N("semanticfed.queryConsole.history.title", "Query History")]
|
|
300
|
+
}) }), /* @__PURE__ */ y(T, { children: X.length === 0 ? /* @__PURE__ */ y("p", {
|
|
301
301
|
className: "text-xs text-muted-foreground",
|
|
302
|
-
children:
|
|
303
|
-
}) : /* @__PURE__ */
|
|
302
|
+
children: N("semanticfed.queryConsole.history.empty", "Statements you run in this session appear here.")
|
|
303
|
+
}) : /* @__PURE__ */ y("div", {
|
|
304
304
|
className: "space-y-2",
|
|
305
|
-
children:
|
|
305
|
+
children: X.map((e) => /* @__PURE__ */ b("button", {
|
|
306
306
|
type: "button",
|
|
307
307
|
className: "flex w-full items-start gap-3 rounded border p-3 text-left hover:bg-muted",
|
|
308
|
-
onClick: () =>
|
|
309
|
-
children: [e.ok ? /* @__PURE__ */
|
|
308
|
+
onClick: () => U(e.sql),
|
|
309
|
+
children: [e.ok ? /* @__PURE__ */ y(c, { className: "mt-0.5 h-4 w-4 shrink-0 text-primary" }) : /* @__PURE__ */ y(_, { className: "mt-0.5 h-4 w-4 shrink-0 text-destructive" }), /* @__PURE__ */ b("div", {
|
|
310
310
|
className: "min-w-0 flex-1",
|
|
311
|
-
children: [/* @__PURE__ */
|
|
311
|
+
children: [/* @__PURE__ */ y("p", {
|
|
312
312
|
className: "truncate font-mono text-xs",
|
|
313
313
|
children: e.sql
|
|
314
|
-
}), /* @__PURE__ */
|
|
314
|
+
}), /* @__PURE__ */ b("div", {
|
|
315
315
|
className: "mt-1 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",
|
|
316
316
|
children: [
|
|
317
|
-
/* @__PURE__ */
|
|
318
|
-
e.ok ? /* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ y("span", { children: e.modelName }),
|
|
318
|
+
e.ok ? /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("span", { children: N("semanticfed.queryConsole.history.results", "{count} results", { count: e.rowCount.toLocaleString() }) }), /* @__PURE__ */ b("span", { children: [e.durationMs, "ms"] })] }) : /* @__PURE__ */ y("span", {
|
|
319
319
|
className: "truncate",
|
|
320
320
|
children: e.message
|
|
321
321
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ y("span", { children: e.executedAt })
|
|
323
323
|
]
|
|
324
324
|
})]
|
|
325
325
|
})]
|
|
326
326
|
}, e.id))
|
|
327
327
|
}) })] }),
|
|
328
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ b(w, { children: [/* @__PURE__ */ y(E, {
|
|
329
329
|
className: "pb-2",
|
|
330
|
-
children: /* @__PURE__ */
|
|
330
|
+
children: /* @__PURE__ */ b(D, {
|
|
331
331
|
className: "flex items-center gap-2 text-base",
|
|
332
|
-
children: [/* @__PURE__ */
|
|
332
|
+
children: [/* @__PURE__ */ y(m, { className: "h-4 w-4" }), N("semanticfed.queryConsole.connect.title", "Connect BI tools and notebooks")]
|
|
333
333
|
})
|
|
334
|
-
}), /* @__PURE__ */
|
|
334
|
+
}), /* @__PURE__ */ b(T, {
|
|
335
335
|
className: "space-y-2 text-xs text-muted-foreground",
|
|
336
|
-
children: [/* @__PURE__ */
|
|
336
|
+
children: [/* @__PURE__ */ y("p", { children: N("semanticfed.queryConsole.connect.body", "The same SQL runs over HTTPS: POST the semExecuteSql operation to the workspace API with a workspace token. Power BI (Web connector), Tableau (Web Data Connector), Python/pandas, Jupyter and reverse-ETL HTTP sources can all call it; see the SQL endpoint guide in the SemanticFed docs.") }), /* @__PURE__ */ y("pre", {
|
|
337
337
|
className: "overflow-x-auto rounded bg-muted p-3 font-mono text-[11px] text-foreground",
|
|
338
|
-
children: `mutation { semExecuteSql(input: { modelId: "${
|
|
338
|
+
children: `mutation { semExecuteSql(input: { modelId: "${L ?? "<model-id>"}", sql: "SELECT ..." }) { columns { name dataType } rows truncated } }`
|
|
339
339
|
})]
|
|
340
340
|
})] })
|
|
341
341
|
]
|
|
@@ -345,6 +345,6 @@ function j() {
|
|
|
345
345
|
});
|
|
346
346
|
}
|
|
347
347
|
//#endregion
|
|
348
|
-
export {
|
|
348
|
+
export { M as QueryConsolePage };
|
|
349
349
|
|
|
350
350
|
//# sourceMappingURL=QueryConsolePage.js.map
|