@burdenoff/microfe-semanticfed 2026.1109.15 → 2026.1109.16
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/README.md +33 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/semanticfed/components/AskQuestionPanel.js +6 -6
- package/dist/semanticfed/components/AskQuestionPanel.js.map +1 -1
- package/dist/semanticfed/components/NlAssistSettings.js +4 -4
- package/dist/semanticfed/components/NlAssistSettings.js.map +1 -1
- package/dist/semanticfed/components/OnboardingChecklist.js +2 -2
- package/dist/semanticfed/components/OnboardingChecklist.js.map +1 -1
- package/dist/semanticfed/components/SavedQueryRunsPanel.js +12 -12
- package/dist/semanticfed/components/SavedQueryRunsPanel.js.map +1 -1
- package/dist/semanticfed/components/TableHeaders.d.ts +1 -1
- package/dist/semanticfed/components/TableHeaders.js +3 -3
- package/dist/semanticfed/components/TableHeaders.js.map +1 -1
- package/dist/semanticfed/components/lineage/LineageDetails.d.ts +1 -0
- package/dist/semanticfed/components/lineage/LineageDetails.js +15 -11
- package/dist/semanticfed/components/lineage/LineageDetails.js.map +1 -1
- package/dist/semanticfed/components/lineage/LineageLanes.js +25 -25
- package/dist/semanticfed/components/lineage/LineageLanes.js.map +1 -1
- package/dist/semanticfed/components/lineage/LineageWarnings.js +1 -1
- package/dist/semanticfed/components/lineage/LineageWarnings.js.map +1 -1
- package/dist/semanticfed/components/lineage/lineageModel.d.ts +5 -1
- package/dist/semanticfed/components/lineage/lineageModel.js +11 -5
- package/dist/semanticfed/components/lineage/lineageModel.js.map +1 -1
- package/dist/semanticfed/components/queryConsole/QueryHistoryCard.js +1 -1
- package/dist/semanticfed/components/queryConsole/QueryHistoryCard.js.map +1 -1
- package/dist/semanticfed/components/queryConsole/SchemaBrowser.js +3 -3
- package/dist/semanticfed/components/queryConsole/SchemaBrowser.js.map +1 -1
- package/dist/semanticfed/components/queryConsole/SqlEditorCard.js +1 -1
- package/dist/semanticfed/components/queryConsole/SqlEditorCard.js.map +1 -1
- package/dist/semanticfed/components/queryConsole/SqlResultCard.js +1 -1
- package/dist/semanticfed/components/queryConsole/SqlResultCard.js.map +1 -1
- package/dist/semanticfed/hooks/useLineage.d.ts +2 -1
- package/dist/semanticfed/hooks/useLineage.js +24 -23
- package/dist/semanticfed/hooks/useLineage.js.map +1 -1
- package/dist/semanticfed/hooks/useSqlConsole.d.ts +2 -1
- package/dist/semanticfed/hooks/useSqlConsole.js +28 -27
- package/dist/semanticfed/hooks/useSqlConsole.js.map +1 -1
- package/dist/semanticfed/pages/AgentsPage.js +8 -8
- package/dist/semanticfed/pages/AgentsPage.js.map +1 -1
- package/dist/semanticfed/pages/AuditPage.js +4 -4
- package/dist/semanticfed/pages/AuditPage.js.map +1 -1
- package/dist/semanticfed/pages/CollaborationPage.js +1 -1
- package/dist/semanticfed/pages/CollaborationPage.js.map +1 -1
- package/dist/semanticfed/pages/ConfigurationPage.js +7 -7
- package/dist/semanticfed/pages/ConfigurationPage.js.map +1 -1
- package/dist/semanticfed/pages/DashboardPage.js +1 -1
- package/dist/semanticfed/pages/DashboardPage.js.map +1 -1
- package/dist/semanticfed/pages/HelpPage.js +1 -1
- package/dist/semanticfed/pages/HelpPage.js.map +1 -1
- package/dist/semanticfed/pages/KnowledgeGraphPage.js +107 -107
- package/dist/semanticfed/pages/KnowledgeGraphPage.js.map +1 -1
- package/dist/semanticfed/pages/LineagePage.js +59 -57
- package/dist/semanticfed/pages/LineagePage.js.map +1 -1
- package/dist/semanticfed/pages/MonitoringPage.js +76 -76
- package/dist/semanticfed/pages/MonitoringPage.js.map +1 -1
- package/dist/semanticfed/pages/OntologyPage.js +41 -41
- package/dist/semanticfed/pages/OntologyPage.js.map +1 -1
- package/dist/semanticfed/pages/PerformancePage.js +2 -2
- package/dist/semanticfed/pages/PerformancePage.js.map +1 -1
- package/dist/semanticfed/pages/PoliciesPage.js +10 -10
- package/dist/semanticfed/pages/PoliciesPage.js.map +1 -1
- package/dist/semanticfed/pages/ProtocolPage.js +42 -39
- package/dist/semanticfed/pages/ProtocolPage.js.map +1 -1
- package/dist/semanticfed/pages/QueryConsolePage.js +37 -37
- package/dist/semanticfed/pages/QueryConsolePage.js.map +1 -1
- package/dist/semanticfed/pages/RegistryPage.js +84 -84
- package/dist/semanticfed/pages/RegistryPage.js.map +1 -1
- package/dist/semanticfed/pages/TechStackPage.js +1 -1
- package/dist/semanticfed/pages/TechStackPage.js.map +1 -1
- package/dist/semanticfed/pages/TopologyPage.js +1 -1
- package/dist/semanticfed/pages/TopologyPage.js.map +1 -1
- package/dist/semanticfed/pages/VisualizationPage.js +7 -7
- package/dist/semanticfed/pages/VisualizationPage.js.map +1 -1
- package/dist/semanticfed/translations/english.js +514 -0
- package/dist/semanticfed/translations/english.js.map +1 -0
- package/dist/semanticfed/translations/english.json.d.ts +513 -0
- package/dist/semanticfed/utils/requestErrorI18n.d.ts +3 -0
- package/dist/semanticfed/utils/requestErrorI18n.js +15 -0
- package/dist/semanticfed/utils/requestErrorI18n.js.map +1 -0
- package/package.json +9 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineageModel.js","names":["KIND_ICON","Plug","Database","Table2","Boxes","Ruler","Hash","Columns3","Layers","FileCode2","KIND_LABEL","LANES","EDGE_LABEL","DIRECTIONS","DEPTH_OPTIONS","kindLabel","tx","kind","traceLocally","reached","rootId","models","graph","n","walk","frontier","hops","depth","next","edge","from","to","forward","direction","formatObservedAt","value","date"],"sources":["../../../../src/semanticfed/components/lineage/lineageModel.ts"],"sourcesContent":["/**\n * Static presentation data and pure graph helpers of the Lineage page\n * (BOFF-4279): node kinds, lanes, edge labels and the local traversal used\n * for nodes the lineage API cannot start from.\n */\nimport {\n Boxes,\n Columns3,\n Database,\n FileCode2,\n Hash,\n Layers,\n Plug,\n Ruler,\n Table2,\n} from 'lucide-react';\nimport type { LucideIcon } from 'lucide-react';\n\nimport type {\n SemLineageDirection,\n SemLineageEdge,\n SemLineageGraph,\n SemLineageNodeKind,\n} from '../../hooks/useLineage';\n\nexport type LineageTx = (\n key: string,\n fallback: string,\n params?: Record<string, string | number>\n) => string;\n\nexport const KIND_ICON: Record<SemLineageNodeKind, LucideIcon> = {\n CONNECTOR: Plug,\n DATA_SOURCE: Database,\n TABLE: Table2,\n ENTITY: Boxes,\n DIMENSION: Ruler,\n METRIC: Hash,\n COLUMN: Columns3,\n MODEL: Layers,\n QUERY: FileCode2,\n};\n\nexport const KIND_LABEL: Record<SemLineageNodeKind, string> = {\n CONNECTOR: 'Connector',\n DATA_SOURCE: 'Data source',\n TABLE: 'Table',\n ENTITY: 'Entity',\n DIMENSION: 'Dimension',\n METRIC: 'Metric',\n COLUMN: 'Column',\n MODEL: 'Model',\n QUERY: 'Query',\n};\n\nexport interface Lane {\n id: string;\n label: string;\n kinds: SemLineageNodeKind[];\n}\n\n/** Lanes in the direction data flows. */\nexport const LANES: Lane[] = [\n { id: 'sources', label: 'Sources', kinds: ['CONNECTOR', 'DATA_SOURCE'] },\n { id: 'tables', label: 'Tables', kinds: ['TABLE'] },\n { id: 'entities', label: 'Entities', kinds: ['ENTITY'] },\n { id: 'fields', label: 'Fields', kinds: ['DIMENSION', 'METRIC', 'COLUMN'] },\n { id: 'models', label: 'Models', kinds: ['MODEL'] },\n { id: 'queries', label: 'Queries', kinds: ['QUERY'] },\n];\n\nexport const EDGE_LABEL: Record<SemLineageEdge['kind'], string> = {\n PROVIDES: 'provides',\n HOSTS: 'hosts',\n MAPS_TO: 'maps to',\n DEFINES: 'defines',\n MEMBER_OF: 'member of',\n JOINS: 'joins',\n SERVES: 'serves',\n READ_BY: 'read by',\n EXECUTED_ON: 'executed on',\n};\n\nexport const DIRECTIONS: SemLineageDirection[] = ['UPSTREAM', 'BOTH', 'DOWNSTREAM'];\nexport const DEPTH_OPTIONS = [1, 2, 3, 5, 10] as const;\n\n/** The translated name of a node kind. */\nexport function kindLabel(tx: LineageTx, kind: SemLineageNodeKind): string {\n return tx(`semanticfed.lineage.kinds.${kind}`, KIND_LABEL[kind]);\n}\n\n/**\n * Upstream / downstream reach of a node over a graph that is already loaded,\n * for node kinds the API cannot start from. Mirrors the service's traversal:\n * JOINS edges are context, not data flow, so they are never followed, and a\n * model reached along the way is included but not expanded (otherwise one\n * entity would pull in every other entity and query of its model).\n */\nexport function traceLocally(\n graph: SemLineageGraph,\n rootId: string,\n direction: SemLineageDirection,\n depth: number | null\n): Set<string> {\n const reached = new Set<string>([rootId]);\n const models = new Set(graph.nodes.filter((n) => n.kind === 'MODEL').map((n) => n.id));\n const walk = (forward: boolean) => {\n let frontier = new Set([rootId]);\n let hops = 0;\n while (frontier.size > 0 && (depth === null || hops < depth)) {\n const next = new Set<string>();\n for (const edge of graph.edges) {\n if (edge.kind === 'JOINS') continue;\n const [from, to] = forward ? [edge.from, edge.to] : [edge.to, edge.from];\n if (from !== rootId && models.has(from)) continue;\n if (frontier.has(from) && !reached.has(to)) {\n reached.add(to);\n next.add(to);\n }\n }\n frontier = next;\n hops += 1;\n }\n };\n if (direction !== 'DOWNSTREAM') walk(false);\n if (direction !== 'UPSTREAM') walk(true);\n return reached;\n}\n\nexport function formatObservedAt(value: string | null): string | null {\n if (!value) return null;\n const date = new Date(value);\n return Number.isNaN(date.getTime()) ? null : date.toLocaleString();\n}\n"],"mappings":";;AA+BA,IAAaA,IAAoD;CAC/D,WAAWC;CACX,aAAaC;CACb,OAAOC;CACP,QAAQC;CACR,WAAWC;CACX,QAAQC;CACR,QAAQC;CACR,OAAOC;CACP,OAAOC;AACT,GAEaC,IAAiD;CAC5D,WAAW;CACX,aAAa;CACb,OAAO;CACP,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,QAAQ;CACR,OAAO;CACP,OAAO;AACT,GASaC,IAAgB;CAC3B;EAAE,IAAI;EAAW,OAAO;EAAW,OAAO,CAAC,aAAa,aAAa;CAAE;CACvE;EAAE,IAAI;EAAU,OAAO;EAAU,OAAO,CAAC,OAAO;CAAE;CAClD;EAAE,IAAI;EAAY,OAAO;EAAY,OAAO,CAAC,QAAQ;CAAE;CACvD;EAAE,IAAI;EAAU,OAAO;EAAU,OAAO;GAAC;GAAa;GAAU;EAAQ;CAAE;CAC1E;EAAE,IAAI;EAAU,OAAO;EAAU,OAAO,CAAC,OAAO;CAAE;CAClD;EAAE,IAAI;EAAW,OAAO;EAAW,OAAO,CAAC,OAAO;CAAE;AACtD,GAEaC,IAAqD;CAChE,UAAU;CACV,OAAO;CACP,SAAS;CACT,SAAS;CACT,WAAW;CACX,OAAO;CACP,QAAQ;CACR,SAAS;CACT,aAAa;AACf,GAEaC,IAAoC;CAAC;CAAY;CAAQ;AAAY,GACrEC,IAAgB;CAAC;CAAG;CAAG;CAAG;CAAG;AAAE;AAG5C,SAAgBC,EAAU,GAAe,GAAkC;CACzE,OAAOC,EAAG,6BAA6BC,KAAQP,EAAWO,EAAK;AACjE;
|
|
1
|
+
{"version":3,"file":"lineageModel.js","names":["KIND_ICON","Plug","Database","Table2","Boxes","Ruler","Hash","Columns3","Layers","FileCode2","KIND_LABEL","LANES","EDGE_LABEL","DIRECTIONS","DEPTH_OPTIONS","kindLabel","tx","kind","laneLabel","lane","edgeLabel","traceLocally","reached","rootId","models","graph","n","walk","frontier","hops","depth","next","edge","from","to","forward","direction","formatObservedAt","value","date","locale"],"sources":["../../../../src/semanticfed/components/lineage/lineageModel.ts"],"sourcesContent":["/**\n * Static presentation data and pure graph helpers of the Lineage page\n * (BOFF-4279): node kinds, lanes, edge labels and the local traversal used\n * for nodes the lineage API cannot start from.\n */\nimport {\n Boxes,\n Columns3,\n Database,\n FileCode2,\n Hash,\n Layers,\n Plug,\n Ruler,\n Table2,\n} from 'lucide-react';\nimport type { LucideIcon } from 'lucide-react';\n\nimport type {\n SemLineageDirection,\n SemLineageEdge,\n SemLineageGraph,\n SemLineageNodeKind,\n} from '../../hooks/useLineage';\n\nexport type LineageTx = (\n key: string,\n fallback: string,\n params?: Record<string, string | number>\n) => string;\n\nexport const KIND_ICON: Record<SemLineageNodeKind, LucideIcon> = {\n CONNECTOR: Plug,\n DATA_SOURCE: Database,\n TABLE: Table2,\n ENTITY: Boxes,\n DIMENSION: Ruler,\n METRIC: Hash,\n COLUMN: Columns3,\n MODEL: Layers,\n QUERY: FileCode2,\n};\n\nexport const KIND_LABEL: Record<SemLineageNodeKind, string> = {\n CONNECTOR: 'Connector',\n DATA_SOURCE: 'Data source',\n TABLE: 'Table',\n ENTITY: 'Entity',\n DIMENSION: 'Dimension',\n METRIC: 'Metric',\n COLUMN: 'Column',\n MODEL: 'Model',\n QUERY: 'Query',\n};\n\nexport interface Lane {\n id: string;\n label: string;\n kinds: SemLineageNodeKind[];\n}\n\n/** Lanes in the direction data flows. */\nexport const LANES: Lane[] = [\n { id: 'sources', label: 'Sources', kinds: ['CONNECTOR', 'DATA_SOURCE'] },\n { id: 'tables', label: 'Tables', kinds: ['TABLE'] },\n { id: 'entities', label: 'Entities', kinds: ['ENTITY'] },\n { id: 'fields', label: 'Fields', kinds: ['DIMENSION', 'METRIC', 'COLUMN'] },\n { id: 'models', label: 'Models', kinds: ['MODEL'] },\n { id: 'queries', label: 'Queries', kinds: ['QUERY'] },\n];\n\nexport const EDGE_LABEL: Record<SemLineageEdge['kind'], string> = {\n PROVIDES: 'provides',\n HOSTS: 'hosts',\n MAPS_TO: 'maps to',\n DEFINES: 'defines',\n MEMBER_OF: 'member of',\n JOINS: 'joins',\n SERVES: 'serves',\n READ_BY: 'read by',\n EXECUTED_ON: 'executed on',\n};\n\nexport const DIRECTIONS: SemLineageDirection[] = ['UPSTREAM', 'BOTH', 'DOWNSTREAM'];\nexport const DEPTH_OPTIONS = [1, 2, 3, 5, 10] as const;\n\n/** The translated name of a node kind. */\nexport function kindLabel(tx: LineageTx, kind: SemLineageNodeKind): string {\n return tx(`semanticfed.lineage.kinds.${kind}`, KIND_LABEL[kind]);\n}\n\n/** The translated heading of a presentation lane. */\nexport function laneLabel(tx: LineageTx, lane: Lane): string {\n return tx(`semanticfed.lineage.lanes.${lane.id}`, lane.label);\n}\n\n/** The translated relation between two lineage nodes. */\nexport function edgeLabel(tx: LineageTx, kind: SemLineageEdge['kind']): string {\n return tx(`semanticfed.lineage.edges.${kind}`, EDGE_LABEL[kind]);\n}\n\n/**\n * Upstream / downstream reach of a node over a graph that is already loaded,\n * for node kinds the API cannot start from. Mirrors the service's traversal:\n * JOINS edges are context, not data flow, so they are never followed, and a\n * model reached along the way is included but not expanded (otherwise one\n * entity would pull in every other entity and query of its model).\n */\nexport function traceLocally(\n graph: SemLineageGraph,\n rootId: string,\n direction: SemLineageDirection,\n depth: number | null\n): Set<string> {\n const reached = new Set<string>([rootId]);\n const models = new Set(graph.nodes.filter((n) => n.kind === 'MODEL').map((n) => n.id));\n const walk = (forward: boolean) => {\n let frontier = new Set([rootId]);\n let hops = 0;\n while (frontier.size > 0 && (depth === null || hops < depth)) {\n const next = new Set<string>();\n for (const edge of graph.edges) {\n if (edge.kind === 'JOINS') continue;\n const [from, to] = forward ? [edge.from, edge.to] : [edge.to, edge.from];\n if (from !== rootId && models.has(from)) continue;\n if (frontier.has(from) && !reached.has(to)) {\n reached.add(to);\n next.add(to);\n }\n }\n frontier = next;\n hops += 1;\n }\n };\n if (direction !== 'DOWNSTREAM') walk(false);\n if (direction !== 'UPSTREAM') walk(true);\n return reached;\n}\n\nexport function formatObservedAt(value: string | null, locale?: string): string | null {\n if (!value) return null;\n const date = new Date(value);\n return Number.isNaN(date.getTime()) ? null : date.toLocaleString(locale);\n}\n"],"mappings":";;AA+BA,IAAaA,IAAoD;CAC/D,WAAWC;CACX,aAAaC;CACb,OAAOC;CACP,QAAQC;CACR,WAAWC;CACX,QAAQC;CACR,QAAQC;CACR,OAAOC;CACP,OAAOC;AACT,GAEaC,IAAiD;CAC5D,WAAW;CACX,aAAa;CACb,OAAO;CACP,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,QAAQ;CACR,OAAO;CACP,OAAO;AACT,GASaC,IAAgB;CAC3B;EAAE,IAAI;EAAW,OAAO;EAAW,OAAO,CAAC,aAAa,aAAa;CAAE;CACvE;EAAE,IAAI;EAAU,OAAO;EAAU,OAAO,CAAC,OAAO;CAAE;CAClD;EAAE,IAAI;EAAY,OAAO;EAAY,OAAO,CAAC,QAAQ;CAAE;CACvD;EAAE,IAAI;EAAU,OAAO;EAAU,OAAO;GAAC;GAAa;GAAU;EAAQ;CAAE;CAC1E;EAAE,IAAI;EAAU,OAAO;EAAU,OAAO,CAAC,OAAO;CAAE;CAClD;EAAE,IAAI;EAAW,OAAO;EAAW,OAAO,CAAC,OAAO;CAAE;AACtD,GAEaC,IAAqD;CAChE,UAAU;CACV,OAAO;CACP,SAAS;CACT,SAAS;CACT,WAAW;CACX,OAAO;CACP,QAAQ;CACR,SAAS;CACT,aAAa;AACf,GAEaC,IAAoC;CAAC;CAAY;CAAQ;AAAY,GACrEC,IAAgB;CAAC;CAAG;CAAG;CAAG;CAAG;AAAE;AAG5C,SAAgBC,EAAU,GAAe,GAAkC;CACzE,OAAOC,EAAG,6BAA6BC,KAAQP,EAAWO,EAAK;AACjE;AAGA,SAAgBC,EAAU,GAAe,GAAoB;CAC3D,OAAOF,EAAG,6BAA6BG,EAAK,MAAMA,EAAK,KAAK;AAC9D;AAGA,SAAgBC,EAAU,GAAe,GAAsC;CAC7E,OAAOJ,EAAG,6BAA6BC,KAAQL,EAAWK,EAAK;AACjE;AASA,SAAgBI,EACd,GACA,GACA,GACA,GACa;CACb,IAAMC,oBAAU,IAAI,IAAY,CAACC,CAAM,CAAC,GAClCC,IAAS,IAAI,IAAIC,EAAM,MAAM,QAAQ,MAAMC,EAAE,SAAS,OAAO,CAAC,CAAC,KAAK,MAAMA,EAAE,EAAE,CAAC,GAC/EC,KAAQ,MAAqB;EACjC,IAAIC,oBAAW,IAAI,IAAI,CAACL,CAAM,CAAC,GAC3BM,IAAO;EACX,OAAOD,EAAS,OAAO,MAAME,MAAU,QAAQD,IAAOC,KAAQ;GAC5D,IAAMC,oBAAO,IAAI,IAAY;GAC7B,KAAK,IAAMC,KAAQP,EAAM,OAAO;IAC9B,IAAIO,EAAK,SAAS,SAAS;IAC3B,IAAM,CAACC,GAAMC,KAAMC,IAAU,CAACH,EAAK,MAAMA,EAAK,EAAE,IAAI,CAACA,EAAK,IAAIA,EAAK,IAAI;IACvE,AAAIC,MAASV,KAAUC,EAAO,IAAIS,CAAI,KAClCL,EAAS,IAAIK,CAAI,KAAK,CAACX,EAAQ,IAAIY,CAAE,MACvCZ,EAAQ,IAAIY,CAAE,GACdH,EAAK,IAAIG,CAAE;GAEf;GAEA,AADA,IAAWH,GACX,KAAQ;EACV;CACF;CAGA,OAFIK,MAAc,gBAAcT,EAAK,EAAK,GACtCS,MAAc,cAAYT,EAAK,EAAI,GAChCL;AACT;AAEA,SAAgBe,EAAiB,GAAsB,GAAgC;CACrF,IAAI,CAACC,GAAO,OAAO;CACnB,IAAMC,IAAO,IAAI,KAAKD,CAAK;CAC3B,OAAO,OAAO,MAAMC,EAAK,QAAQ,CAAC,IAAI,OAAOA,EAAK,eAAeC,CAAM;AACzE"}
|
|
@@ -5,7 +5,7 @@ import { Card as o, CardContent as s, CardHeader as c, CardTitle as l } from "@b
|
|
|
5
5
|
function u({ entry: t, onSelect: o, tr: s }) {
|
|
6
6
|
return /* @__PURE__ */ a("button", {
|
|
7
7
|
type: "button",
|
|
8
|
-
className: "flex w-full items-start gap-3 rounded border p-3 text-
|
|
8
|
+
className: "flex w-full items-start gap-3 rounded border p-3 text-start hover:bg-muted",
|
|
9
9
|
onClick: () => o(t.sql),
|
|
10
10
|
children: [t.ok ? /* @__PURE__ */ i(e, { className: "mt-0.5 h-4 w-4 shrink-0 text-primary" }) : /* @__PURE__ */ i(n, { className: "mt-0.5 h-4 w-4 shrink-0 text-destructive" }), /* @__PURE__ */ a("div", {
|
|
11
11
|
className: "min-w-0 flex-1",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryHistoryCard.js","names":["_Fragment","HistoryItem","onSelect","entry","CheckCircle2","XCircle","Fragment","tr","QueryHistoryCard","Card","CardHeader","CardTitle","Clock","CardContent","history"],"sources":["../../../../src/semanticfed/components/queryConsole/QueryHistoryCard.tsx"],"sourcesContent":["import { Card, CardContent, CardHeader, CardTitle } from '@burdenoff/fe-libs/ui';\nimport { CheckCircle2, Clock, XCircle } from 'lucide-react';\n\nimport type { useTr } from '../../hooks/useTr';\nimport type { HistoryEntry } from './consoleHistory';\n\ntype Tr = ReturnType<typeof useTr>;\n\nfunction HistoryItem({\n entry,\n onSelect,\n tr,\n}: {\n entry: HistoryEntry;\n onSelect: (sql: string) => void;\n tr: Tr;\n}) {\n return (\n <button\n type=\"button\"\n className=\"flex w-full items-start gap-3 rounded border p-3 text-
|
|
1
|
+
{"version":3,"file":"QueryHistoryCard.js","names":["_Fragment","HistoryItem","onSelect","entry","CheckCircle2","XCircle","Fragment","tr","QueryHistoryCard","Card","CardHeader","CardTitle","Clock","CardContent","history"],"sources":["../../../../src/semanticfed/components/queryConsole/QueryHistoryCard.tsx"],"sourcesContent":["import { Card, CardContent, CardHeader, CardTitle } from '@burdenoff/fe-libs/ui';\nimport { CheckCircle2, Clock, XCircle } from 'lucide-react';\n\nimport type { useTr } from '../../hooks/useTr';\nimport type { HistoryEntry } from './consoleHistory';\n\ntype Tr = ReturnType<typeof useTr>;\n\nfunction HistoryItem({\n entry,\n onSelect,\n tr,\n}: {\n entry: HistoryEntry;\n onSelect: (sql: string) => void;\n tr: Tr;\n}) {\n return (\n <button\n type=\"button\"\n className=\"flex w-full items-start gap-3 rounded border p-3 text-start hover:bg-muted\"\n onClick={() => onSelect(entry.sql)}\n >\n {entry.ok ? (\n <CheckCircle2 className=\"mt-0.5 h-4 w-4 shrink-0 text-primary\" />\n ) : (\n <XCircle className=\"mt-0.5 h-4 w-4 shrink-0 text-destructive\" />\n )}\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate font-mono text-xs\">{entry.sql}</p>\n <div className=\"mt-1 flex flex-wrap items-center gap-3 text-xs text-muted-foreground\">\n <span>{entry.modelName}</span>\n {entry.ok ? (\n <>\n <span>\n {tr('semanticfed.queryConsole.history.results', '{count} results', {\n count: entry.rowCount.toLocaleString(),\n })}\n </span>\n <span>{entry.durationMs}ms</span>\n </>\n ) : (\n <span className=\"truncate\">{entry.message}</span>\n )}\n <span>{entry.executedAt}</span>\n </div>\n </div>\n </button>\n );\n}\n\n/** Statements run in this session; selecting one loads it into the editor. */\nexport function QueryHistoryCard({\n history,\n onSelect,\n tr,\n}: {\n history: HistoryEntry[];\n onSelect: (sql: string) => void;\n tr: Tr;\n}) {\n return (\n <Card>\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2 text-base\">\n <Clock className=\"h-4 w-4\" />\n {tr('semanticfed.queryConsole.history.title', 'Query History')}\n </CardTitle>\n </CardHeader>\n <CardContent>\n {history.length === 0 ? (\n <p className=\"text-xs text-muted-foreground\">\n {tr(\n 'semanticfed.queryConsole.history.empty',\n 'Statements you run in this session appear here.'\n )}\n </p>\n ) : (\n <div className=\"space-y-2\">\n {history.map((entry) => (\n <HistoryItem key={entry.id} entry={entry} onSelect={onSelect} tr={tr} />\n ))}\n </div>\n )}\n </CardContent>\n </Card>\n );\n}\n"],"mappings":";;;;AAQA,SAASC,EAAY,EACnB,UACA,aACA,SAKC;CACD,OACE,kBAAC,UAAD;EACE,MAAK;EACL,WAAU;EACV,eAAeC,EAASC,EAAM,GAAG;EAHnC,UAAA,CAKGA,EAAM,KACL,kBAACC,GAAD,EAAc,WAAU,uCAAwC,CAAA,IAEhE,kBAACC,GAAD,EAAS,WAAU,2CAA4C,CAAA,GAEjE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,KAAD;IAAG,WAAU;IAA8B,UAAAF,EAAM;GAAO,CAAA,GACxD,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,kBAAC,QAAD,EAAA,UAAOA,EAAM,UAAgB,CAAA;KAC5BA,EAAM,KACL,kBAAAH,GAAA,EAAA,UAAA,CACE,kBAAC,QAAD,EAAA,UACGO,EAAG,4CAA4C,mBAAmB,EACjE,OAAOJ,EAAM,SAAS,eAAe,EACvC,CAAC,EACG,CAAA,GACN,kBAAC,QAAD,EAAA,UAAA,CAAOA,EAAM,YAAW,IAAQ,EAAA,CAAA,CAChC,EAAA,CAAA,IAEF,kBAAC,QAAD;MAAM,WAAU;MAAY,UAAAA,EAAM;KAAc,CAAA;KAElD,kBAAC,QAAD,EAAA,UAAOA,EAAM,WAAiB,CAAA;IAC3B;GACF,CAAA,CAAA;EACC,CAAA,CAAA;;AAEZ;AAGA,SAAgBK,EAAiB,EAC/B,YACA,aACA,SAKC;CACD,OACE,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD,EAAA,UACE,kBAACC,GAAD;EAAW,WAAU;EAArB,UAAA,CACE,kBAACC,GAAD,EAAO,WAAU,UAAW,CAAA,GAC3BL,EAAG,0CAA0C,eAAe,CACpD;CACD,CAAA,EAAA,CAAA,GACZ,kBAACM,GAAD,EAAA,UACGC,EAAQ,WAAW,IAClB,kBAAC,KAAD;EAAG,WAAU;EACV,UAAAP,EACC,0CACA,iDACF;CACC,CAAA,IAEH,kBAAC,OAAD;EAAK,WAAU;EACZ,UAAAO,EAAQ,KAAK,MACZ,kBAACb,GAAD;GAAmC;GAAiB;GAAc;EAAK,GAArDE,EAAM,EAA+C,CACxE;CACE,CAAA,EAEI,CAAA,CACT,EAAA,CAAA;AAEV"}
|
|
@@ -14,7 +14,7 @@ function l({ table: e, open: t, onInsert: n, tr: a }) {
|
|
|
14
14
|
className: "mt-2 space-y-1",
|
|
15
15
|
children: [e.columns.map((e) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ i("button", {
|
|
16
16
|
type: "button",
|
|
17
|
-
className: "flex w-full items-center justify-between gap-2 rounded px-1 text-
|
|
17
|
+
className: "flex w-full items-center justify-between gap-2 rounded px-1 text-start font-mono text-xs hover:bg-muted",
|
|
18
18
|
onClick: () => n(e.name),
|
|
19
19
|
title: e.description ?? void 0,
|
|
20
20
|
children: [/* @__PURE__ */ r("span", {
|
|
@@ -63,12 +63,12 @@ function u({ models: u, catalog: d, modelId: f, onModelChange: p, onInsert: m, t
|
|
|
63
63
|
}),
|
|
64
64
|
u.isError && /* @__PURE__ */ r("p", {
|
|
65
65
|
className: "text-xs text-destructive",
|
|
66
|
-
children: e(u.error)
|
|
66
|
+
children: e(u.error, h)
|
|
67
67
|
}),
|
|
68
68
|
d.isLoading && /* @__PURE__ */ r(t, { className: "h-4 w-4 animate-spin text-muted-foreground" }),
|
|
69
69
|
d.isError && /* @__PURE__ */ r("p", {
|
|
70
70
|
className: "text-xs text-destructive",
|
|
71
|
-
children: e(d.error)
|
|
71
|
+
children: e(d.error, h)
|
|
72
72
|
}),
|
|
73
73
|
/* @__PURE__ */ r("div", {
|
|
74
74
|
className: "max-h-96 space-y-2 overflow-y-auto",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaBrowser.js","names":["CatalogTable","table","onInsert","column","tr","SchemaBrowser","tables","catalog","Card","CardHeader","CardTitle","Table2","CardContent","modelId","onModelChange","models","m","sqlErrorMessage","Loader2"],"sources":["../../../../src/semanticfed/components/queryConsole/SchemaBrowser.tsx"],"sourcesContent":["import { Card, CardContent, CardHeader, CardTitle } from '@burdenoff/fe-libs/ui';\nimport { Loader2, Table2 } from 'lucide-react';\n\nimport {\n type SemSqlCatalogTable,\n sqlErrorMessage,\n useSemSqlCatalog,\n useSemSqlModels,\n} from '../../hooks/useSqlConsole';\nimport type { useTr } from '../../hooks/useTr';\n\ntype Tr = ReturnType<typeof useTr>;\n\nfunction CatalogTable({\n table,\n open,\n onInsert,\n tr,\n}: {\n table: SemSqlCatalogTable;\n open: boolean;\n onInsert: (text: string) => void;\n tr: Tr;\n}) {\n return (\n <details className=\"rounded border p-2\" open={open}>\n <summary className=\"cursor-pointer truncate font-mono text-xs font-medium\">\n {table.name}\n </summary>\n <ul className=\"mt-2 space-y-1\">\n {table.columns.map((column) => (\n <li key={column.name}>\n <button\n type=\"button\"\n className=\"flex w-full items-center justify-between gap-2 rounded px-1 text-
|
|
1
|
+
{"version":3,"file":"SchemaBrowser.js","names":["CatalogTable","table","onInsert","column","tr","SchemaBrowser","tables","catalog","Card","CardHeader","CardTitle","Table2","CardContent","modelId","onModelChange","models","m","sqlErrorMessage","Loader2"],"sources":["../../../../src/semanticfed/components/queryConsole/SchemaBrowser.tsx"],"sourcesContent":["import { Card, CardContent, CardHeader, CardTitle } from '@burdenoff/fe-libs/ui';\nimport { Loader2, Table2 } from 'lucide-react';\n\nimport {\n type SemSqlCatalogTable,\n sqlErrorMessage,\n useSemSqlCatalog,\n useSemSqlModels,\n} from '../../hooks/useSqlConsole';\nimport type { useTr } from '../../hooks/useTr';\n\ntype Tr = ReturnType<typeof useTr>;\n\nfunction CatalogTable({\n table,\n open,\n onInsert,\n tr,\n}: {\n table: SemSqlCatalogTable;\n open: boolean;\n onInsert: (text: string) => void;\n tr: Tr;\n}) {\n return (\n <details className=\"rounded border p-2\" open={open}>\n <summary className=\"cursor-pointer truncate font-mono text-xs font-medium\">\n {table.name}\n </summary>\n <ul className=\"mt-2 space-y-1\">\n {table.columns.map((column) => (\n <li key={column.name}>\n <button\n type=\"button\"\n className=\"flex w-full items-center justify-between gap-2 rounded px-1 text-start font-mono text-xs hover:bg-muted\"\n onClick={() => onInsert(column.name)}\n title={column.description ?? undefined}\n >\n <span className=\"truncate\">{column.name}</span>\n <span className=\"shrink-0 text-[10px] text-muted-foreground\">\n {column.kind === 'METRIC' ? (column.aggregation ?? 'METRIC') : column.dataType}\n </span>\n </button>\n </li>\n ))}\n {table.columns.length === 0 && (\n <li className=\"text-xs text-muted-foreground\">\n {tr('semanticfed.queryConsole.schema.noColumns', 'No dimensions or metrics registered')}\n </li>\n )}\n </ul>\n </details>\n );\n}\n\n/** Model picker and the SQL catalog of the chosen model; a column click inserts its name. */\nexport function SchemaBrowser({\n models,\n catalog,\n modelId,\n onModelChange,\n onInsert,\n tr,\n}: {\n models: ReturnType<typeof useSemSqlModels>;\n catalog: ReturnType<typeof useSemSqlCatalog>;\n modelId: string | null;\n onModelChange: (modelId: string | null) => void;\n onInsert: (text: string) => void;\n tr: Tr;\n}) {\n const tables = catalog.data?.tables ?? [];\n return (\n <Card className=\"min-w-0\">\n <CardHeader className=\"pb-3\">\n <CardTitle className=\"flex items-center gap-2 text-base\">\n <Table2 className=\"h-4 w-4\" />\n {tr('semanticfed.queryConsole.schema.title', 'Tables')}\n </CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n <label\n className=\"block text-xs font-medium text-muted-foreground\"\n htmlFor=\"sql-console-model\"\n >\n {tr('semanticfed.queryConsole.schema.model', 'Semantic model')}\n </label>\n <select\n id=\"sql-console-model\"\n data-testid=\"sql-console-model\"\n className=\"w-full rounded border bg-background p-2 text-sm\"\n value={modelId ?? ''}\n onChange={(e) => onModelChange(e.target.value || null)}\n disabled={!models.data || models.data.length === 0}\n >\n {(models.data ?? []).map((m) => (\n <option key={m.id} value={m.id}>\n {m.name}\n </option>\n ))}\n </select>\n {models.isError && (\n <p className=\"text-xs text-destructive\">{sqlErrorMessage(models.error, tr)}</p>\n )}\n {catalog.isLoading && <Loader2 className=\"h-4 w-4 animate-spin text-muted-foreground\" />}\n {catalog.isError && (\n <p className=\"text-xs text-destructive\">{sqlErrorMessage(catalog.error, tr)}</p>\n )}\n <div className=\"max-h-96 space-y-2 overflow-y-auto\" data-testid=\"sql-console-tables\">\n {tables.map((table) => (\n <CatalogTable\n key={table.name}\n table={table}\n open={tables.length === 1}\n onInsert={onInsert}\n tr={tr}\n />\n ))}\n </div>\n </CardContent>\n </Card>\n );\n}\n"],"mappings":";;;;;AAaA,SAASA,EAAa,EACpB,UACA,SACA,aACA,SAMC;CACD,OACE,kBAAC,WAAD;EAAS,WAAU;EAA2B;EAA9C,UAAA,CACE,kBAAC,WAAD;GAAS,WAAU;GAChB,UAAAC,EAAM;EACA,CAAA,GACT,kBAAC,MAAD;GAAI,WAAU;GAAd,UAAA,CACGA,EAAM,QAAQ,KAAK,MAClB,kBAAC,MAAD,EAAA,UACE,kBAAC,UAAD;IACE,MAAK;IACL,WAAU;IACV,eAAeC,EAASC,EAAO,IAAI;IACnC,OAAOA,EAAO,eAAe,KAAA;IAJ/B,UAAA,CAME,kBAAC,QAAD;KAAM,WAAU;KAAY,UAAAA,EAAO;IAAW,CAAA,GAC9C,kBAAC,QAAD;KAAM,WAAU;KACb,UAAAA,EAAO,SAAS,WAAYA,EAAO,eAAe,WAAYA,EAAO;IAClE,CAAA,CACA;GACN,CAAA,EAAA,GAZKA,EAAO,IAYZ,CACL,GACAF,EAAM,QAAQ,WAAW,KACxB,kBAAC,MAAD;IAAI,WAAU;IACX,UAAAG,EAAG,6CAA6C,qCAAqC;GACpF,CAAA,CAEJ;EACG,CAAA,CAAA;;AAEb;AAGA,SAAgBC,EAAc,EAC5B,WACA,YACA,YACA,kBACA,aACA,SAQC;CACD,IAAMC,IAASC,EAAQ,MAAM,UAAU,CAAC;CACxC,OACE,kBAACC,GAAD;EAAM,WAAU;EAAhB,UAAA,CACE,kBAACC,GAAD;GAAY,WAAU;GACpB,UAAA,kBAACC,GAAD;IAAW,WAAU;IAArB,UAAA,CACE,kBAACC,GAAD,EAAQ,WAAU,UAAW,CAAA,GAC5BP,EAAG,yCAAyC,QAAQ,CAC5C;;EACD,CAAA,GACZ,kBAACQ,GAAD;GAAa,WAAU;GAAvB,UAAA;IACE,kBAAC,SAAD;KACE,WAAU;KACV,SAAQ;KAEP,UAAAR,EAAG,yCAAyC,gBAAgB;IACxD,CAAA;IACP,kBAAC,UAAD;KACE,IAAG;KACH,eAAY;KACZ,WAAU;KACV,OAAOS,KAAW;KAClB,WAAW,MAAMC,EAAc,EAAE,OAAO,SAAS,IAAI;KACrD,UAAU,CAACC,EAAO,QAAQA,EAAO,KAAK,WAAW;KAE/C,WAAAA,EAAO,QAAQ,CAAC,EAAA,CAAG,KAAK,MACxB,kBAAC,UAAD;MAAmB,OAAOC,EAAE;MACzB,UAAAA,EAAE;KACG,GAFKA,EAAE,EAEP,CACT;IACK,CAAA;IACPD,EAAO,WACN,kBAAC,KAAD;KAAG,WAAU;KAA4B,UAAAE,EAAgBF,EAAO,OAAOX,CAAE;IAAK,CAAA;IAE/EG,EAAQ,aAAa,kBAACW,GAAD,EAAS,WAAU,6CAA8C,CAAA;IACtFX,EAAQ,WACP,kBAAC,KAAD;KAAG,WAAU;KAA4B,UAAAU,EAAgBV,EAAQ,OAAOH,CAAE;IAAK,CAAA;IAEjF,kBAAC,OAAD;KAAK,WAAU;KAAqC,eAAY;KAC7D,UAAAE,EAAO,KAAK,MACX,kBAACN,GAAD;MAES;MACP,MAAMM,EAAO,WAAW;MACd;MACN;KACL,GALML,EAAM,IAKZ,CACF;IACE,CAAA;GACM;EACT,CAAA,CAAA;;AAEV"}
|
|
@@ -38,7 +38,7 @@ function u({ sql: u, onSqlChange: d, maxRows: f, onMaxRowsChange: p, canRun: m,
|
|
|
38
38
|
onClick: g,
|
|
39
39
|
disabled: !m || h,
|
|
40
40
|
"data-testid": "sql-console-run",
|
|
41
|
-
children: [h ? /* @__PURE__ */ n(e, { className: "
|
|
41
|
+
children: [h ? /* @__PURE__ */ n(e, { className: "me-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ n(t, { className: "me-2 h-4 w-4" }), _("semanticfed.queryConsole.actions.execute", "Execute")]
|
|
42
42
|
})
|
|
43
43
|
]
|
|
44
44
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SqlEditorCard.js","names":["ROW_LIMIT_OPTIONS","SqlEditorCard","Card","CardHeader","CardTitle","tr","maxRows","onMaxRowsChange","n","Button","onRun","canRun","running","Loader2","Play","CardContent","sql","onSqlChange"],"sources":["../../../../src/semanticfed/components/queryConsole/SqlEditorCard.tsx"],"sourcesContent":["import { Button, Card, CardContent, CardHeader, CardTitle } from '@burdenoff/fe-libs/ui';\nimport { Loader2, Play } from 'lucide-react';\n\nimport type { useTr } from '../../hooks/useTr';\n\ntype Tr = ReturnType<typeof useTr>;\n\n/** Row caps offered in the console (the endpoint allows up to 10,000). */\nconst ROW_LIMIT_OPTIONS = [100, 1000, 10000] as const;\n\n/** The SQL editor with its row cap and Execute button (Ctrl/Cmd + Enter runs it too). */\nexport function SqlEditorCard({\n sql,\n onSqlChange,\n maxRows,\n onMaxRowsChange,\n canRun,\n running,\n onRun,\n tr,\n}: {\n sql: string;\n onSqlChange: (sql: string) => void;\n maxRows: number;\n onMaxRowsChange: (maxRows: number) => void;\n canRun: boolean;\n running: boolean;\n onRun: () => void;\n tr: Tr;\n}) {\n return (\n <Card>\n <CardHeader className=\"pb-3\">\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <CardTitle className=\"text-base\">\n {tr('semanticfed.queryConsole.editor.title', 'Query Editor')}\n </CardTitle>\n <div className=\"flex items-center gap-2\">\n <label className=\"sr-only\" htmlFor=\"sql-console-max-rows\">\n {tr('semanticfed.queryConsole.editor.maxRowsLabel', 'Maximum rows')}\n </label>\n <select\n id=\"sql-console-max-rows\"\n className=\"rounded border bg-background p-1 text-xs\"\n value={maxRows}\n onChange={(e) => onMaxRowsChange(Number(e.target.value))}\n >\n {ROW_LIMIT_OPTIONS.map((n) => (\n <option key={n} value={n}>\n {tr('semanticfed.queryConsole.editor.maxRowsOption', 'Max {count} rows', {\n count: n.toLocaleString(),\n })}\n </option>\n ))}\n </select>\n <Button\n size=\"sm\"\n onClick={onRun}\n disabled={!canRun || running}\n data-testid=\"sql-console-run\"\n >\n {running ? (\n <Loader2 className=\"
|
|
1
|
+
{"version":3,"file":"SqlEditorCard.js","names":["ROW_LIMIT_OPTIONS","SqlEditorCard","Card","CardHeader","CardTitle","tr","maxRows","onMaxRowsChange","n","Button","onRun","canRun","running","Loader2","Play","CardContent","sql","onSqlChange"],"sources":["../../../../src/semanticfed/components/queryConsole/SqlEditorCard.tsx"],"sourcesContent":["import { Button, Card, CardContent, CardHeader, CardTitle } from '@burdenoff/fe-libs/ui';\nimport { Loader2, Play } from 'lucide-react';\n\nimport type { useTr } from '../../hooks/useTr';\n\ntype Tr = ReturnType<typeof useTr>;\n\n/** Row caps offered in the console (the endpoint allows up to 10,000). */\nconst ROW_LIMIT_OPTIONS = [100, 1000, 10000] as const;\n\n/** The SQL editor with its row cap and Execute button (Ctrl/Cmd + Enter runs it too). */\nexport function SqlEditorCard({\n sql,\n onSqlChange,\n maxRows,\n onMaxRowsChange,\n canRun,\n running,\n onRun,\n tr,\n}: {\n sql: string;\n onSqlChange: (sql: string) => void;\n maxRows: number;\n onMaxRowsChange: (maxRows: number) => void;\n canRun: boolean;\n running: boolean;\n onRun: () => void;\n tr: Tr;\n}) {\n return (\n <Card>\n <CardHeader className=\"pb-3\">\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <CardTitle className=\"text-base\">\n {tr('semanticfed.queryConsole.editor.title', 'Query Editor')}\n </CardTitle>\n <div className=\"flex items-center gap-2\">\n <label className=\"sr-only\" htmlFor=\"sql-console-max-rows\">\n {tr('semanticfed.queryConsole.editor.maxRowsLabel', 'Maximum rows')}\n </label>\n <select\n id=\"sql-console-max-rows\"\n className=\"rounded border bg-background p-1 text-xs\"\n value={maxRows}\n onChange={(e) => onMaxRowsChange(Number(e.target.value))}\n >\n {ROW_LIMIT_OPTIONS.map((n) => (\n <option key={n} value={n}>\n {tr('semanticfed.queryConsole.editor.maxRowsOption', 'Max {count} rows', {\n count: n.toLocaleString(),\n })}\n </option>\n ))}\n </select>\n <Button\n size=\"sm\"\n onClick={onRun}\n disabled={!canRun || running}\n data-testid=\"sql-console-run\"\n >\n {running ? (\n <Loader2 className=\"me-2 h-4 w-4 animate-spin\" />\n ) : (\n <Play className=\"me-2 h-4 w-4\" />\n )}\n {tr('semanticfed.queryConsole.actions.execute', 'Execute')}\n </Button>\n </div>\n </div>\n </CardHeader>\n <CardContent>\n <textarea\n aria-label={tr('semanticfed.queryConsole.editor.ariaLabel', 'SQL statement')}\n data-testid=\"sql-console-editor\"\n 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\"\n rows={8}\n value={sql}\n onChange={(e) => onSqlChange(e.target.value)}\n onKeyDown={(e) => {\n if ((e.metaKey || e.ctrlKey) && e.key === 'Enter') {\n e.preventDefault();\n onRun();\n }\n }}\n spellCheck={false}\n placeholder=\"SELECT region, SUM(revenue) FROM orders GROUP BY region\"\n />\n <div className=\"mt-2 flex flex-wrap items-center gap-4 text-xs text-muted-foreground\">\n <span>{tr('semanticfed.queryConsole.editor.shortcut', 'Ctrl/Cmd + Enter to run')}</span>\n <span>{tr('semanticfed.queryConsole.editor.timeout', 'Timeout: 30s')}</span>\n <span>\n {tr(\n 'semanticfed.queryConsole.editor.supported',\n 'SELECT, JOIN … ON, WHERE … AND, GROUP BY, ORDER BY, LIMIT/OFFSET'\n )}\n </span>\n </div>\n </CardContent>\n </Card>\n );\n}\n"],"mappings":";;;;AAQA,IAAMA,IAAoB;CAAC;CAAK;CAAM;AAAK;AAG3C,SAAgBC,EAAc,EAC5B,QACA,gBACA,YACA,oBACA,WACA,YACA,UACA,SAUC;CACD,OACE,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD;EAAY,WAAU;EACpB,UAAA,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAACC,GAAD;IAAW,WAAU;IAClB,UAAAC,EAAG,yCAAyC,cAAc;GAClD,CAAA,GACX,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,kBAAC,SAAD;MAAO,WAAU;MAAU,SAAQ;MAChC,UAAAA,EAAG,gDAAgD,cAAc;KAC7D,CAAA;KACP,kBAAC,UAAD;MACE,IAAG;MACH,WAAU;MACV,OAAOC;MACP,WAAW,MAAMC,EAAgB,OAAO,EAAE,OAAO,KAAK,CAAC;MAEtD,UAAAP,EAAkB,KAAK,MACtB,kBAAC,UAAD;OAAgB,OAAOQ;OACpB,UAAAH,EAAG,iDAAiD,oBAAoB,EACvE,OAAOG,EAAE,eAAe,EAC1B,CAAC;MACK,GAJKA,CAIL,CACT;KACK,CAAA;KACR,kBAACC,GAAD;MACE,MAAK;MACL,SAASC;MACT,UAAU,CAACC,KAAUC;MACrB,eAAY;MAJd,UAAA,CAMGA,IACC,kBAACC,GAAD,EAAS,WAAU,4BAA6B,CAAA,IAEhD,kBAACC,GAAD,EAAM,WAAU,eAAgB,CAAA,GAEjCT,EAAG,4CAA4C,SAAS,CACnD;;IACL;GACF,CAAA,CAAA;;CACK,CAAA,GACZ,kBAACU,GAAD,EAAA,UAAA,CACE,kBAAC,YAAD;EACE,cAAYV,EAAG,6CAA6C,eAAe;EAC3E,eAAY;EACZ,WAAU;EACV,MAAM;EACN,OAAOW;EACP,WAAW,MAAMC,EAAY,EAAE,OAAO,KAAK;EAC3C,YAAY,MAAM;GAChB,CAAK,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,YACxC,EAAE,eAAe,GACjBP,EAAM;EAEV;EACA,YAAY;EACZ,aAAY;CACb,CAAA,GACD,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,kBAAC,QAAD,EAAA,UAAOL,EAAG,4CAA4C,yBAAyB,EAAQ,CAAA;GACvF,kBAAC,QAAD,EAAA,UAAOA,EAAG,2CAA2C,cAAc,EAAQ,CAAA;GAC3E,kBAAC,QAAD,EAAA,UACGA,EACC,6CACA,kEACF,EACI,CAAA;EACH;CACM,CAAA,CAAA,EAAA,CAAA,CACT,EAAA,CAAA;AAEV"}
|
|
@@ -35,7 +35,7 @@ function u({ result: u, tr: d }) {
|
|
|
35
35
|
}), /* @__PURE__ */ i(c, { children: /* @__PURE__ */ i("div", {
|
|
36
36
|
className: "max-h-[28rem] overflow-auto rounded border",
|
|
37
37
|
children: /* @__PURE__ */ a("table", {
|
|
38
|
-
className: "w-max min-w-full max-w-none table-auto text-
|
|
38
|
+
className: "w-max min-w-full max-w-none table-auto text-start text-xs",
|
|
39
39
|
children: [/* @__PURE__ */ i("thead", {
|
|
40
40
|
className: "sticky top-0 bg-muted",
|
|
41
41
|
children: /* @__PURE__ */ i("tr", { children: u.columns.map((e) => /* @__PURE__ */ a("th", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SqlResultCard.js","names":["SqlResultCard","Card","CardHeader","CheckCircle2","tr","result","Badge","AlertTriangle","CardContent","column","EyeOff","formatCell","row","index"],"sources":["../../../../src/semanticfed/components/queryConsole/SqlResultCard.tsx"],"sourcesContent":["import { Badge, Card, CardContent, CardHeader } from '@burdenoff/fe-libs/ui';\nimport { AlertTriangle, CheckCircle2, EyeOff } from 'lucide-react';\n\nimport type { SemSqlResult } from '../../hooks/useSqlConsole';\nimport type { useTr } from '../../hooks/useTr';\nimport { formatCell } from '../../utils/format';\n\ntype Tr = ReturnType<typeof useTr>;\n\n/**\n * The rows of the last statement or answered question. A result is an\n * immutable snapshot that is replaced as a whole, and its rows have no\n * identity of their own (two rows may be identical), so a row is keyed by\n * its position in the snapshot.\n */\nexport function SqlResultCard({ result, tr }: { result: SemSqlResult; tr: Tr }) {\n return (\n <Card data-testid=\"sql-console-result\">\n <CardHeader className=\"pb-3\">\n <div className=\"flex flex-wrap items-center gap-3 text-sm\">\n <CheckCircle2 className=\"h-4 w-4 text-primary\" />\n <span className=\"font-medium\" data-testid=\"sql-console-row-count\">\n {tr('semanticfed.queryConsole.result.rows', '{count} rows', {\n count: result.rowCount.toLocaleString(),\n })}\n </span>\n <span className=\"text-muted-foreground\">{Math.round(result.durationMs)}ms</span>\n <span className=\"text-muted-foreground\">\n {tr('semanticfed.queryConsole.result.sources', '{count} sources', {\n count: result.sourcesTouched,\n })}\n </span>\n {result.truncated && (\n <Badge variant=\"outline\" className=\"gap-1\">\n <AlertTriangle className=\"h-3 w-3\" />\n {tr('semanticfed.queryConsole.result.truncated', 'Truncated — more rows matched')}\n </Badge>\n )}\n </div>\n </CardHeader>\n <CardContent>\n <div className=\"max-h-[28rem] overflow-auto rounded border\">\n {/* The shell's base styles give tables a fixed layout capped at 100% width,\n which lets long values spill into the next column. Size the grid to its\n content instead and let the wrapper scroll sideways. */}\n <table className=\"w-max min-w-full max-w-none table-auto text-
|
|
1
|
+
{"version":3,"file":"SqlResultCard.js","names":["SqlResultCard","Card","CardHeader","CheckCircle2","tr","result","Badge","AlertTriangle","CardContent","column","EyeOff","formatCell","row","index"],"sources":["../../../../src/semanticfed/components/queryConsole/SqlResultCard.tsx"],"sourcesContent":["import { Badge, Card, CardContent, CardHeader } from '@burdenoff/fe-libs/ui';\nimport { AlertTriangle, CheckCircle2, EyeOff } from 'lucide-react';\n\nimport type { SemSqlResult } from '../../hooks/useSqlConsole';\nimport type { useTr } from '../../hooks/useTr';\nimport { formatCell } from '../../utils/format';\n\ntype Tr = ReturnType<typeof useTr>;\n\n/**\n * The rows of the last statement or answered question. A result is an\n * immutable snapshot that is replaced as a whole, and its rows have no\n * identity of their own (two rows may be identical), so a row is keyed by\n * its position in the snapshot.\n */\nexport function SqlResultCard({ result, tr }: { result: SemSqlResult; tr: Tr }) {\n return (\n <Card data-testid=\"sql-console-result\">\n <CardHeader className=\"pb-3\">\n <div className=\"flex flex-wrap items-center gap-3 text-sm\">\n <CheckCircle2 className=\"h-4 w-4 text-primary\" />\n <span className=\"font-medium\" data-testid=\"sql-console-row-count\">\n {tr('semanticfed.queryConsole.result.rows', '{count} rows', {\n count: result.rowCount.toLocaleString(),\n })}\n </span>\n <span className=\"text-muted-foreground\">{Math.round(result.durationMs)}ms</span>\n <span className=\"text-muted-foreground\">\n {tr('semanticfed.queryConsole.result.sources', '{count} sources', {\n count: result.sourcesTouched,\n })}\n </span>\n {result.truncated && (\n <Badge variant=\"outline\" className=\"gap-1\">\n <AlertTriangle className=\"h-3 w-3\" />\n {tr('semanticfed.queryConsole.result.truncated', 'Truncated — more rows matched')}\n </Badge>\n )}\n </div>\n </CardHeader>\n <CardContent>\n <div className=\"max-h-[28rem] overflow-auto rounded border\">\n {/* The shell's base styles give tables a fixed layout capped at 100% width,\n which lets long values spill into the next column. Size the grid to its\n content instead and let the wrapper scroll sideways. */}\n <table className=\"w-max min-w-full max-w-none table-auto text-start text-xs\">\n <thead className=\"sticky top-0 bg-muted\">\n <tr>\n {result.columns.map((column) => (\n <th key={column.name} className=\"whitespace-nowrap px-3 py-2 font-medium\">\n <span className=\"inline-flex items-center gap-1\">\n {column.name}\n {column.masked && (\n <EyeOff\n className=\"h-3 w-3 text-muted-foreground\"\n aria-label={tr(\n 'semanticfed.queryConsole.result.masked',\n 'Masked by policy ({mask})',\n { mask: column.mask ?? '' }\n )}\n />\n )}\n </span>\n <span className=\"block text-[10px] font-normal text-muted-foreground\">\n {column.aggregation ?? column.dataType}\n </span>\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {result.rows.map((row, index) => (\n <tr key={index} className=\"border-t\">\n {result.columns.map((column) => (\n <td key={column.name} className=\"whitespace-nowrap px-3 py-1.5 font-mono\">\n {formatCell(row[column.name])}\n </td>\n ))}\n </tr>\n ))}\n {result.rows.length === 0 && (\n <tr>\n <td\n colSpan={result.columns.length}\n className=\"px-3 py-4 text-center text-muted-foreground\"\n >\n {tr('semanticfed.queryConsole.result.empty', 'No rows matched')}\n </td>\n </tr>\n )}\n </tbody>\n </table>\n </div>\n </CardContent>\n </Card>\n );\n}\n"],"mappings":";;;;;AAeA,SAAgBA,EAAc,EAAE,WAAQ,SAAwC;CAC9E,OACE,kBAACC,GAAD;EAAM,eAAY;EAAlB,UAAA,CACE,kBAACC,GAAD;GAAY,WAAU;GACpB,UAAA,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,kBAACC,GAAD,EAAc,WAAU,uBAAwB,CAAA;KAChD,kBAAC,QAAD;MAAM,WAAU;MAAc,eAAY;MACvC,UAAAC,EAAG,wCAAwC,gBAAgB,EAC1D,OAAOC,EAAO,SAAS,eAAe,EACxC,CAAC;KACG,CAAA;KACN,kBAAC,QAAD;MAAM,WAAU;MAAhB,UAAA,CAAyC,KAAK,MAAMA,EAAO,UAAU,GAAE,IAAQ;;KAC/E,kBAAC,QAAD;MAAM,WAAU;MACb,UAAAD,EAAG,2CAA2C,mBAAmB,EAChE,OAAOC,EAAO,eAChB,CAAC;KACG,CAAA;KACLA,EAAO,aACN,kBAACC,GAAD;MAAO,SAAQ;MAAU,WAAU;MAAnC,UAAA,CACE,kBAACC,GAAD,EAAe,WAAU,UAAW,CAAA,GACnCH,EAAG,6CAA6C,+BAA+B,CAC3E;;IAEN;;EACK,CAAA,GACZ,kBAACI,GAAD,EAAA,UACE,kBAAC,OAAD;GAAK,WAAU;GAIb,UAAA,kBAAC,SAAD;IAAO,WAAU;IAAjB,UAAA,CACE,kBAAC,SAAD;KAAO,WAAU;KACf,UAAA,kBAAC,MAAD,EAAA,UACGH,EAAO,QAAQ,KAAK,MACnB,kBAAC,MAAD;MAAsB,WAAU;MAAhC,UAAA,CACE,kBAAC,QAAD;OAAM,WAAU;OAAhB,UAAA,CACGI,EAAO,MACPA,EAAO,UACN,kBAACC,GAAD;QACE,WAAU;QACV,cAAYN,EACV,0CACA,6BACA,EAAE,MAAMK,EAAO,QAAQ,GAAG,CAC5B;OACD,CAAA,CAEC;MACN,CAAA,GAAA,kBAAC,QAAD;OAAM,WAAU;OACb,UAAAA,EAAO,eAAeA,EAAO;MAC1B,CAAA,CACJ;KAjBK,GAAAA,EAAO,IAiBZ,CACL,EACC,CAAA;IACC,CAAA,GACP,kBAAC,SAAD,EAAA,UAAA,CACGJ,EAAO,KAAK,KAAK,GAAK,MACrB,kBAAC,MAAD;KAAgB,WAAU;KACvB,UAAAA,EAAO,QAAQ,KAAK,MACnB,kBAAC,MAAD;MAAsB,WAAU;MAC7B,UAAAM,EAAWC,EAAIH,EAAO,KAAK;KAC1B,GAFKA,EAAO,IAEZ,CACL;IACC,GANKI,CAML,CACL,GACAR,EAAO,KAAK,WAAW,KACtB,kBAAC,MAAD,EAAA,UACE,kBAAC,MAAD;KACE,SAASA,EAAO,QAAQ;KACxB,WAAU;KAET,UAAAD,EAAG,yCAAyC,iBAAiB;IAC5D,CAAA,EACF,CAAA,CAED,EAAA,CAAA,CACF;;EACJ,CAAA,EACM,CAAA,CACT;;AAEV"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ErrorTranslator } from '../utils/requestErrorI18n';
|
|
1
2
|
export type SemLineageNodeKind = 'CONNECTOR' | 'DATA_SOURCE' | 'TABLE' | 'ENTITY' | 'DIMENSION' | 'METRIC' | 'COLUMN' | 'MODEL' | 'QUERY';
|
|
2
3
|
export type SemLineageRootKind = Exclude<SemLineageNodeKind, 'TABLE' | 'COLUMN'>;
|
|
3
4
|
export type SemLineageEdgeKind = 'PROVIDES' | 'HOSTS' | 'MAPS_TO' | 'DEFINES' | 'MEMBER_OF' | 'JOINS' | 'SERVES' | 'READ_BY' | 'EXECUTED_ON';
|
|
@@ -42,4 +43,4 @@ export declare function useSemWorkspaceLineage(): import('@tanstack/react-query'
|
|
|
42
43
|
/** The upstream / downstream lineage of one record; idle until a root is chosen. */
|
|
43
44
|
export declare function useSemRecordLineage(root: SemLineageRoot | null, direction: SemLineageDirection, depth: number | null): import('@tanstack/react-query').UseQueryResult<SemLineageGraph, Error>;
|
|
44
45
|
/** The text to show for a failed lineage request, preferring the service's own explanation. */
|
|
45
|
-
export declare function lineageErrorMessage(error: unknown): string;
|
|
46
|
+
export declare function lineageErrorMessage(error: unknown, tr?: ErrorTranslator): string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { translateRequestError as e } from "../utils/requestErrorI18n.js";
|
|
2
|
+
import { SemRequestError as t, semRequest as n } from "../api/semanticfedGraphql.js";
|
|
3
|
+
import { useSemanticFed as r } from "../providers/SemanticFedProvider.js";
|
|
4
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
4
5
|
// src/semanticfed/hooks/useLineage.ts
|
|
5
|
-
var
|
|
6
|
+
var a = [
|
|
6
7
|
"CONNECTOR",
|
|
7
8
|
"DATA_SOURCE",
|
|
8
9
|
"ENTITY",
|
|
@@ -11,29 +12,29 @@ var i = [
|
|
|
11
12
|
"MODEL",
|
|
12
13
|
"QUERY"
|
|
13
14
|
];
|
|
14
|
-
function
|
|
15
|
-
return !e.refId || !
|
|
15
|
+
function o(e) {
|
|
16
|
+
return !e.refId || !a.includes(e.kind) ? null : {
|
|
16
17
|
kind: e.kind,
|
|
17
18
|
id: e.refId
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
|
-
var
|
|
21
|
-
function
|
|
22
|
-
let { apiGatewayUrl: e, workspaceId:
|
|
23
|
-
return
|
|
21
|
+
var s = "query SemLineage(\n $rootKind: SemLineageRootKind\n $rootId: ID\n $direction: SemLineageDirection\n $depth: Int\n) {\n semLineage(rootKind: $rootKind, rootId: $rootId, direction: $direction, depth: $depth) {\n rootId\n direction\n truncated\n nodes {\n id\n kind\n refId\n label\n detail\n status\n parentId\n }\n edges {\n id\n kind\n from\n to\n detail\n observedAt\n }\n warnings {\n nodeId\n message\n }\n }\n}";
|
|
22
|
+
function c() {
|
|
23
|
+
let { apiGatewayUrl: e, workspaceId: t } = r();
|
|
24
|
+
return i({
|
|
24
25
|
queryKey: [
|
|
25
26
|
"semanticfed",
|
|
26
27
|
"lineage",
|
|
27
|
-
|
|
28
|
+
t ?? "no-workspace",
|
|
28
29
|
"workspace"
|
|
29
30
|
],
|
|
30
|
-
enabled: !!
|
|
31
|
-
queryFn: async () => (await
|
|
31
|
+
enabled: !!t,
|
|
32
|
+
queryFn: async () => (await n(s, {}, e)).semLineage
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
let { apiGatewayUrl:
|
|
36
|
-
return
|
|
35
|
+
function l(e, t, a) {
|
|
36
|
+
let { apiGatewayUrl: o, workspaceId: c } = r();
|
|
37
|
+
return i({
|
|
37
38
|
queryKey: [
|
|
38
39
|
"semanticfed",
|
|
39
40
|
"lineage",
|
|
@@ -41,21 +42,21 @@ function c(e, i, a) {
|
|
|
41
42
|
"record",
|
|
42
43
|
e?.kind ?? null,
|
|
43
44
|
e?.id ?? null,
|
|
44
|
-
|
|
45
|
+
t,
|
|
45
46
|
a
|
|
46
47
|
],
|
|
47
48
|
enabled: !!(c && e),
|
|
48
|
-
queryFn: async () => (await
|
|
49
|
+
queryFn: async () => (await n(s, {
|
|
49
50
|
rootKind: e?.kind,
|
|
50
51
|
rootId: e?.id,
|
|
51
|
-
direction:
|
|
52
|
+
direction: t,
|
|
52
53
|
depth: a
|
|
53
|
-
},
|
|
54
|
+
}, o)).semLineage
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
-
return
|
|
57
|
+
function u(n, r) {
|
|
58
|
+
return n instanceof t && n.detail && n.code !== "INTERNAL_SERVER_ERROR" ? e(n.detail, r) : e(n instanceof Error ? n.message : String(n), r);
|
|
58
59
|
}
|
|
59
|
-
export {
|
|
60
|
+
export { u as lineageErrorMessage, o as lineageRootFor, l as useSemRecordLineage, c as useSemWorkspaceLineage };
|
|
60
61
|
|
|
61
62
|
//# sourceMappingURL=useLineage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLineage.js","names":["ROOT_KINDS","lineageRootFor","node","LINEAGE_QUERY","useSemWorkspaceLineage","useSemanticFed","useQuery","workspaceId","semRequest","apiGatewayUrl","useSemRecordLineage","root","direction","depth","lineageErrorMessage","error","SemRequestError"],"sources":["../../../src/semanticfed/hooks/useLineage.ts"],"sourcesContent":["/**\n * Lineage hooks, wired to the `wspace-semanticfed-svc` lineage API\n * (BOFF-4279). `semLineage` computes end-to-end lineage on read from the\n * semantic layer: connector → data source → physical table → entity →\n * dimension / metric → saved query, plus model membership and the data\n * sources each query's latest successful run actually read.\n */\nimport { useQuery } from '@tanstack/react-query';\n\nimport { SemRequestError, semRequest } from '../api/semanticfedGraphql';\nimport { useSemanticFed } from '../providers/SemanticFedProvider';\n\nexport type SemLineageNodeKind =\n | 'CONNECTOR'\n | 'DATA_SOURCE'\n | 'TABLE'\n | 'ENTITY'\n | 'DIMENSION'\n | 'METRIC'\n | 'COLUMN'\n | 'MODEL'\n | 'QUERY';\n\nexport type SemLineageRootKind = Exclude<SemLineageNodeKind, 'TABLE' | 'COLUMN'>;\n\nexport type SemLineageEdgeKind =\n | 'PROVIDES'\n | 'HOSTS'\n | 'MAPS_TO'\n | 'DEFINES'\n | 'MEMBER_OF'\n | 'JOINS'\n | 'SERVES'\n | 'READ_BY'\n | 'EXECUTED_ON';\n\nexport type SemLineageDirection = 'UPSTREAM' | 'DOWNSTREAM' | 'BOTH';\n\nexport interface SemLineageNode {\n id: string;\n kind: SemLineageNodeKind;\n refId: string | null;\n label: string;\n detail: string | null;\n status: string | null;\n parentId: string | null;\n}\n\nexport interface SemLineageEdge {\n id: string;\n kind: SemLineageEdgeKind;\n from: string;\n to: string;\n detail: string | null;\n observedAt: string | null;\n}\n\nexport interface SemLineageWarning {\n nodeId: string | null;\n message: string;\n}\n\nexport interface SemLineageGraph {\n rootId: string | null;\n direction: SemLineageDirection;\n nodes: SemLineageNode[];\n edges: SemLineageEdge[];\n warnings: SemLineageWarning[];\n truncated: boolean;\n}\n\nexport interface SemLineageRoot {\n kind: SemLineageRootKind;\n id: string;\n}\n\nconst ROOT_KINDS: readonly SemLineageNodeKind[] = [\n 'CONNECTOR',\n 'DATA_SOURCE',\n 'ENTITY',\n 'DIMENSION',\n 'METRIC',\n 'MODEL',\n 'QUERY',\n];\n\n/** The traversal root for a node, or null for node kinds the API cannot start from. */\nexport function lineageRootFor(node: SemLineageNode): SemLineageRoot | null {\n if (!node.refId || !ROOT_KINDS.includes(node.kind)) return null;\n return { kind: node.kind as SemLineageRootKind, id: node.refId };\n}\n\nconst LINEAGE_QUERY = `query SemLineage(\n $rootKind: SemLineageRootKind\n $rootId: ID\n $direction: SemLineageDirection\n $depth: Int\n) {\n semLineage(rootKind: $rootKind, rootId: $rootId, direction: $direction, depth: $depth) {\n rootId\n direction\n truncated\n nodes {\n id\n kind\n refId\n label\n detail\n status\n parentId\n }\n edges {\n id\n kind\n from\n to\n detail\n observedAt\n }\n warnings {\n nodeId\n message\n }\n }\n}`;\n\n/** The whole-workspace lineage graph. */\nexport function useSemWorkspaceLineage() {\n const { apiGatewayUrl, workspaceId } = useSemanticFed();\n return useQuery({\n queryKey: ['semanticfed', 'lineage', workspaceId ?? 'no-workspace', 'workspace'] as const,\n enabled: Boolean(workspaceId),\n queryFn: async () => {\n const data = await semRequest<{ semLineage: SemLineageGraph }>(\n LINEAGE_QUERY,\n {},\n apiGatewayUrl\n );\n return data.semLineage;\n },\n });\n}\n\n/** The upstream / downstream lineage of one record; idle until a root is chosen. */\nexport function useSemRecordLineage(\n root: SemLineageRoot | null,\n direction: SemLineageDirection,\n depth: number | null\n) {\n const { apiGatewayUrl, workspaceId } = useSemanticFed();\n return useQuery({\n queryKey: [\n 'semanticfed',\n 'lineage',\n workspaceId ?? 'no-workspace',\n 'record',\n root?.kind ?? null,\n root?.id ?? null,\n direction,\n depth,\n ] as const,\n enabled: Boolean(workspaceId && root),\n queryFn: async () => {\n const data = await semRequest<{ semLineage: SemLineageGraph }>(\n LINEAGE_QUERY,\n { rootKind: root?.kind, rootId: root?.id, direction, depth },\n apiGatewayUrl\n );\n return data.semLineage;\n },\n });\n}\n\n/** The text to show for a failed lineage request, preferring the service's own explanation. */\nexport function lineageErrorMessage(error: unknown): string {\n if (error instanceof SemRequestError && error.detail && error.code !== 'INTERNAL_SERVER_ERROR') {\n return error.detail;\n }\n return error instanceof Error ? error.message : String(error);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLineage.js","names":["ROOT_KINDS","lineageRootFor","node","LINEAGE_QUERY","useSemWorkspaceLineage","useSemanticFed","useQuery","workspaceId","semRequest","apiGatewayUrl","useSemRecordLineage","root","direction","depth","lineageErrorMessage","error","SemRequestError","translateRequestError","tr"],"sources":["../../../src/semanticfed/hooks/useLineage.ts"],"sourcesContent":["import { translateRequestError, type ErrorTranslator } from '../utils/requestErrorI18n';\n/**\n * Lineage hooks, wired to the `wspace-semanticfed-svc` lineage API\n * (BOFF-4279). `semLineage` computes end-to-end lineage on read from the\n * semantic layer: connector → data source → physical table → entity →\n * dimension / metric → saved query, plus model membership and the data\n * sources each query's latest successful run actually read.\n */\nimport { useQuery } from '@tanstack/react-query';\n\nimport { SemRequestError, semRequest } from '../api/semanticfedGraphql';\nimport { useSemanticFed } from '../providers/SemanticFedProvider';\n\nexport type SemLineageNodeKind =\n | 'CONNECTOR'\n | 'DATA_SOURCE'\n | 'TABLE'\n | 'ENTITY'\n | 'DIMENSION'\n | 'METRIC'\n | 'COLUMN'\n | 'MODEL'\n | 'QUERY';\n\nexport type SemLineageRootKind = Exclude<SemLineageNodeKind, 'TABLE' | 'COLUMN'>;\n\nexport type SemLineageEdgeKind =\n | 'PROVIDES'\n | 'HOSTS'\n | 'MAPS_TO'\n | 'DEFINES'\n | 'MEMBER_OF'\n | 'JOINS'\n | 'SERVES'\n | 'READ_BY'\n | 'EXECUTED_ON';\n\nexport type SemLineageDirection = 'UPSTREAM' | 'DOWNSTREAM' | 'BOTH';\n\nexport interface SemLineageNode {\n id: string;\n kind: SemLineageNodeKind;\n refId: string | null;\n label: string;\n detail: string | null;\n status: string | null;\n parentId: string | null;\n}\n\nexport interface SemLineageEdge {\n id: string;\n kind: SemLineageEdgeKind;\n from: string;\n to: string;\n detail: string | null;\n observedAt: string | null;\n}\n\nexport interface SemLineageWarning {\n nodeId: string | null;\n message: string;\n}\n\nexport interface SemLineageGraph {\n rootId: string | null;\n direction: SemLineageDirection;\n nodes: SemLineageNode[];\n edges: SemLineageEdge[];\n warnings: SemLineageWarning[];\n truncated: boolean;\n}\n\nexport interface SemLineageRoot {\n kind: SemLineageRootKind;\n id: string;\n}\n\nconst ROOT_KINDS: readonly SemLineageNodeKind[] = [\n 'CONNECTOR',\n 'DATA_SOURCE',\n 'ENTITY',\n 'DIMENSION',\n 'METRIC',\n 'MODEL',\n 'QUERY',\n];\n\n/** The traversal root for a node, or null for node kinds the API cannot start from. */\nexport function lineageRootFor(node: SemLineageNode): SemLineageRoot | null {\n if (!node.refId || !ROOT_KINDS.includes(node.kind)) return null;\n return { kind: node.kind as SemLineageRootKind, id: node.refId };\n}\n\nconst LINEAGE_QUERY = `query SemLineage(\n $rootKind: SemLineageRootKind\n $rootId: ID\n $direction: SemLineageDirection\n $depth: Int\n) {\n semLineage(rootKind: $rootKind, rootId: $rootId, direction: $direction, depth: $depth) {\n rootId\n direction\n truncated\n nodes {\n id\n kind\n refId\n label\n detail\n status\n parentId\n }\n edges {\n id\n kind\n from\n to\n detail\n observedAt\n }\n warnings {\n nodeId\n message\n }\n }\n}`;\n\n/** The whole-workspace lineage graph. */\nexport function useSemWorkspaceLineage() {\n const { apiGatewayUrl, workspaceId } = useSemanticFed();\n return useQuery({\n queryKey: ['semanticfed', 'lineage', workspaceId ?? 'no-workspace', 'workspace'] as const,\n enabled: Boolean(workspaceId),\n queryFn: async () => {\n const data = await semRequest<{ semLineage: SemLineageGraph }>(\n LINEAGE_QUERY,\n {},\n apiGatewayUrl\n );\n return data.semLineage;\n },\n });\n}\n\n/** The upstream / downstream lineage of one record; idle until a root is chosen. */\nexport function useSemRecordLineage(\n root: SemLineageRoot | null,\n direction: SemLineageDirection,\n depth: number | null\n) {\n const { apiGatewayUrl, workspaceId } = useSemanticFed();\n return useQuery({\n queryKey: [\n 'semanticfed',\n 'lineage',\n workspaceId ?? 'no-workspace',\n 'record',\n root?.kind ?? null,\n root?.id ?? null,\n direction,\n depth,\n ] as const,\n enabled: Boolean(workspaceId && root),\n queryFn: async () => {\n const data = await semRequest<{ semLineage: SemLineageGraph }>(\n LINEAGE_QUERY,\n { rootKind: root?.kind, rootId: root?.id, direction, depth },\n apiGatewayUrl\n );\n return data.semLineage;\n },\n });\n}\n\n/** The text to show for a failed lineage request, preferring the service's own explanation. */\nexport function lineageErrorMessage(error: unknown, tr?: ErrorTranslator): string {\n if (error instanceof SemRequestError && error.detail && error.code !== 'INTERNAL_SERVER_ERROR') {\n return translateRequestError(error.detail, tr);\n }\n return translateRequestError(error instanceof Error ? error.message : String(error), tr);\n}\n"],"mappings":";;;;;AA6EA,IAAMA,IAA4C;CAChD;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,SAAgBC,EAAe,GAA6C;CAE1E,OADI,CAACC,EAAK,SAAS,CAACF,EAAW,SAASE,EAAK,IAAI,IAAU,OACpD;EAAE,MAAMA,EAAK;EAA4B,IAAIA,EAAK;CAAM;AACjE;AAEA,IAAMC,IAAgB;AAmCtB,SAAgBC,IAAyB;CACvC,IAAM,EAAE,kBAAe,mBAAgBC,EAAe;CACtD,OAAOC,EAAS;EACd,UAAU;GAAC;GAAe;GAAWC,KAAe;GAAgB;EAAW;EAC/E,SAAS,EAAQA;EACjB,SAAS,aAMA,MALYC,EACjBL,GACA,CAAC,GACDM,CACF,EAAA,CACY;CAEhB,CAAC;AACH;AAGA,SAAgBC,EACd,GACA,GACA,GACA;CACA,IAAM,EAAE,kBAAe,mBAAgBL,EAAe;CACtD,OAAOC,EAAS;EACd,UAAU;GACR;GACA;GACAC,KAAe;GACf;GACAI,GAAM,QAAQ;GACdA,GAAM,MAAM;GACZC;GACAC;EACF;EACA,SAAS,GAAQN,KAAeI;EAChC,SAAS,aAMA,MALYH,EACjBL,GACA;GAAE,UAAUQ,GAAM;GAAM,QAAQA,GAAM;GAAI;GAAW;EAAM,GAC3DF,CACF,EAAA,CACY;CAEhB,CAAC;AACH;AAGA,SAAgBK,EAAoB,GAAgB,GAA8B;CAIhF,OAHIC,aAAiBC,KAAmBD,EAAM,UAAUA,EAAM,SAAS,0BAC9DE,EAAsBF,EAAM,QAAQG,CAAE,IAExCD,EAAsBF,aAAiB,QAAQA,EAAM,UAAU,OAAOA,CAAK,GAAGG,CAAE;AACzF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ErrorTranslator } from '../utils/requestErrorI18n';
|
|
1
2
|
export type SemSqlDataType = 'STRING' | 'INTEGER' | 'DECIMAL' | 'BOOLEAN' | 'DATE' | 'TIMESTAMP' | 'JSON' | 'GEO' | 'UNKNOWN';
|
|
2
3
|
export interface SemModelSummary {
|
|
3
4
|
id: string;
|
|
@@ -55,4 +56,4 @@ export declare function useSemExecuteSql(): import('@tanstack/react-query').UseM
|
|
|
55
56
|
* errors, so the service's own explanation (syntax position, unknown column,
|
|
56
57
|
* policy denial) is preferred whenever the service sent one.
|
|
57
58
|
*/
|
|
58
|
-
export declare function sqlErrorMessage(error: unknown): string;
|
|
59
|
+
export declare function sqlErrorMessage(error: unknown, tr?: ErrorTranslator): string;
|
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { translateRequestError as e } from "../utils/requestErrorI18n.js";
|
|
2
|
+
import { useSemRequest as t } from "./useSemRequest.js";
|
|
3
|
+
import { useClientAnalytics as n } from "./useClientAnalytics.js";
|
|
4
|
+
import { SemRequestError as r } from "../api/semanticfedGraphql.js";
|
|
5
|
+
import { useSemanticFed as i } from "../providers/SemanticFedProvider.js";
|
|
6
|
+
import { useMutation as a, useQuery as o } from "@tanstack/react-query";
|
|
6
7
|
// src/semanticfed/hooks/useSqlConsole.ts
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
let { workspaceId:
|
|
10
|
-
return
|
|
8
|
+
var s = "query SemSqlConsoleModels($pagination: PaginationInput) {\n semListModels(pagination: $pagination) {\n items {\n id\n name\n status\n }\n }\n}", c = "query SemSqlCatalog($modelId: ID) {\n semSqlCatalog(modelId: $modelId) {\n modelId\n modelName\n tables {\n name\n kind\n description\n primaryKey\n columns {\n name\n kind\n dataType\n aggregation\n description\n isPrimary\n }\n }\n }\n}", l = "mutation SemExecuteSql($input: SemExecuteSqlInput!) {\n semExecuteSql(input: $input) {\n modelId\n columns {\n name\n entity\n field\n aggregation\n dataType\n masked\n mask\n }\n rows\n rowCount\n truncated\n durationMs\n sourcesTouched\n }\n}", u = 100;
|
|
9
|
+
function d() {
|
|
10
|
+
let { workspaceId: e } = i(), { request: n, ready: r } = t();
|
|
11
|
+
return o({
|
|
11
12
|
queryKey: [
|
|
12
13
|
"semanticfed",
|
|
13
14
|
"sql",
|
|
14
15
|
"models",
|
|
15
|
-
|
|
16
|
+
e ?? "no-workspace"
|
|
16
17
|
],
|
|
17
|
-
enabled:
|
|
18
|
-
queryFn: async ({ signal: e }) => (await n(
|
|
18
|
+
enabled: r && !!e,
|
|
19
|
+
queryFn: async ({ signal: e }) => (await n(s, { pagination: { limit: u } }, e)).semListModels.items
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
-
let { workspaceId: n } =
|
|
23
|
-
return
|
|
22
|
+
function f(e) {
|
|
23
|
+
let { workspaceId: n } = i(), { request: r, ready: a } = t();
|
|
24
|
+
return o({
|
|
24
25
|
queryKey: [
|
|
25
26
|
"semanticfed",
|
|
26
27
|
"sql",
|
|
27
28
|
"catalog",
|
|
28
29
|
n ?? "no-workspace",
|
|
29
|
-
|
|
30
|
+
e
|
|
30
31
|
],
|
|
31
|
-
enabled:
|
|
32
|
-
queryFn: async ({ signal:
|
|
32
|
+
enabled: a && !!(n && e),
|
|
33
|
+
queryFn: async ({ signal: t }) => (await r(c, { modelId: e }, t)).semSqlCatalog
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
-
let { request:
|
|
37
|
-
return
|
|
36
|
+
function p() {
|
|
37
|
+
let { request: e } = t(), r = n();
|
|
38
|
+
return a({
|
|
38
39
|
retry: !1,
|
|
39
|
-
mutationFn: async (
|
|
40
|
+
mutationFn: async (t) => {
|
|
40
41
|
try {
|
|
41
|
-
let
|
|
42
|
-
return r.sqlExecuted(
|
|
42
|
+
let n = await e(l, { input: t });
|
|
43
|
+
return r.sqlExecuted(n.semExecuteSql.rowCount, n.semExecuteSql.truncated), n.semExecuteSql;
|
|
43
44
|
} catch (e) {
|
|
44
45
|
throw r.sqlFailed(e), e;
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
});
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
-
return
|
|
50
|
+
function m(t, n) {
|
|
51
|
+
return t instanceof r && t.detail && t.code !== "INTERNAL_SERVER_ERROR" ? e(t.detail, n) : e(t instanceof Error ? t.message : String(t), n);
|
|
51
52
|
}
|
|
52
|
-
export {
|
|
53
|
+
export { m as sqlErrorMessage, p as useSemExecuteSql, f as useSemSqlCatalog, d as useSemSqlModels };
|
|
53
54
|
|
|
54
55
|
//# sourceMappingURL=useSqlConsole.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSqlConsole.js","names":["LIST_MODELS_QUERY","SQL_CATALOG_QUERY","EXECUTE_SQL_MUTATION","MODEL_PICKER_LIMIT","useSemSqlModels","useSemanticFed","useSemRequest","useQuery","workspaceId","ready","request","signal","useSemSqlCatalog","modelId","useSemExecuteSql","analytics","useClientAnalytics","useMutation","data","error","sqlErrorMessage","SemRequestError"],"sources":["../../../src/semanticfed/hooks/useSqlConsole.ts"],"sourcesContent":["import { useSemRequest } from './useSemRequest';\nimport { useClientAnalytics } from './useClientAnalytics';\n/**\n * SQL console hooks, wired to the real `wspace-semanticfed-svc` SQL endpoint\n * (BOFF-4271): `semListModels` to pick a semantic model, `semSqlCatalog` for\n * the table/column browser and `semExecuteSql` to run a read-only SELECT\n * through the federated query engine with the caller's access policies.\n */\nimport { useMutation, useQuery } from '@tanstack/react-query';\n\nimport { SemRequestError } from '../api/semanticfedGraphql';\nimport { useSemanticFed } from '../providers/SemanticFedProvider';\n\nexport type SemSqlDataType =\n 'STRING' | 'INTEGER' | 'DECIMAL' | 'BOOLEAN' | 'DATE' | 'TIMESTAMP' | 'JSON' | 'GEO' | 'UNKNOWN';\n\nexport interface SemModelSummary {\n id: string;\n name: string;\n status: string;\n}\n\nexport interface SemSqlCatalogColumn {\n name: string;\n kind: 'DIMENSION' | 'METRIC';\n dataType: SemSqlDataType;\n aggregation: string | null;\n description: string | null;\n isPrimary: boolean;\n}\n\nexport interface SemSqlCatalogTable {\n name: string;\n kind: string;\n description: string | null;\n primaryKey: string | null;\n columns: SemSqlCatalogColumn[];\n}\n\nexport interface SemSqlCatalog {\n modelId: string;\n modelName: string;\n tables: SemSqlCatalogTable[];\n}\n\nexport interface SemSqlResultColumn {\n name: string;\n entity: string;\n field: string;\n aggregation: string | null;\n dataType: SemSqlDataType;\n masked: boolean;\n mask: string | null;\n}\n\nexport interface SemSqlResult {\n modelId: string;\n columns: SemSqlResultColumn[];\n rows: Array<Record<string, unknown>>;\n rowCount: number;\n truncated: boolean;\n durationMs: number;\n sourcesTouched: number;\n}\n\nexport interface SemExecuteSqlInput {\n sql: string;\n modelId: string;\n maxRows?: number;\n}\n\nconst LIST_MODELS_QUERY = `query SemSqlConsoleModels($pagination: PaginationInput) {\n semListModels(pagination: $pagination) {\n items {\n id\n name\n status\n }\n }\n}`;\n\nconst SQL_CATALOG_QUERY = `query SemSqlCatalog($modelId: ID) {\n semSqlCatalog(modelId: $modelId) {\n modelId\n modelName\n tables {\n name\n kind\n description\n primaryKey\n columns {\n name\n kind\n dataType\n aggregation\n description\n isPrimary\n }\n }\n }\n}`;\n\nconst EXECUTE_SQL_MUTATION = `mutation SemExecuteSql($input: SemExecuteSqlInput!) {\n semExecuteSql(input: $input) {\n modelId\n columns {\n name\n entity\n field\n aggregation\n dataType\n masked\n mask\n }\n rows\n rowCount\n truncated\n durationMs\n sourcesTouched\n }\n}`;\n\n/** Largest model list the console offers (the picker is not paginated). */\nconst MODEL_PICKER_LIMIT = 100;\n\nexport function useSemSqlModels() {\n const { workspaceId } = useSemanticFed();\n const { request, ready } = useSemRequest();\n return useQuery({\n queryKey: ['semanticfed', 'sql', 'models', workspaceId ?? 'no-workspace'] as const,\n enabled: ready && Boolean(workspaceId),\n queryFn: async ({ signal }) => {\n const data = await request<{ semListModels: { items: SemModelSummary[] } }>(\n LIST_MODELS_QUERY,\n { pagination: { limit: MODEL_PICKER_LIMIT } },\n signal\n );\n return data.semListModels.items;\n },\n });\n}\n\nexport function useSemSqlCatalog(modelId: string | null) {\n const { workspaceId } = useSemanticFed();\n const { request, ready } = useSemRequest();\n return useQuery({\n queryKey: ['semanticfed', 'sql', 'catalog', workspaceId ?? 'no-workspace', modelId] as const,\n enabled: ready && Boolean(workspaceId && modelId),\n queryFn: async ({ signal }) => {\n const data = await request<{ semSqlCatalog: SemSqlCatalog }>(\n SQL_CATALOG_QUERY,\n { modelId },\n signal\n );\n return data.semSqlCatalog;\n },\n });\n}\n\nexport function useSemExecuteSql() {\n const { request } = useSemRequest();\n const analytics = useClientAnalytics();\n return useMutation({\n retry: false,\n mutationFn: async (input: SemExecuteSqlInput) => {\n try {\n const data = await request<{ semExecuteSql: SemSqlResult }>(EXECUTE_SQL_MUTATION, {\n input,\n });\n analytics.sqlExecuted(data.semExecuteSql.rowCount, data.semExecuteSql.truncated);\n return data.semExecuteSql;\n } catch (error: unknown) {\n analytics.sqlFailed(error);\n throw error;\n }\n },\n });\n}\n\n/**\n * The text to show for a failed SQL statement. The gateway generalises client\n * errors, so the service's own explanation (syntax position, unknown column,\n * policy denial) is preferred whenever the service sent one.\n */\nexport function sqlErrorMessage(error: unknown): string {\n if (error instanceof SemRequestError && error.detail && error.code !== 'INTERNAL_SERVER_ERROR') {\n return error.detail;\n }\n return error instanceof Error ? error.message : String(error);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSqlConsole.js","names":["LIST_MODELS_QUERY","SQL_CATALOG_QUERY","EXECUTE_SQL_MUTATION","MODEL_PICKER_LIMIT","useSemSqlModels","useSemanticFed","useSemRequest","useQuery","workspaceId","ready","request","signal","useSemSqlCatalog","modelId","useSemExecuteSql","analytics","useClientAnalytics","useMutation","data","error","sqlErrorMessage","SemRequestError","translateRequestError","tr"],"sources":["../../../src/semanticfed/hooks/useSqlConsole.ts"],"sourcesContent":["import { translateRequestError, type ErrorTranslator } from '../utils/requestErrorI18n';\nimport { useSemRequest } from './useSemRequest';\nimport { useClientAnalytics } from './useClientAnalytics';\n/**\n * SQL console hooks, wired to the real `wspace-semanticfed-svc` SQL endpoint\n * (BOFF-4271): `semListModels` to pick a semantic model, `semSqlCatalog` for\n * the table/column browser and `semExecuteSql` to run a read-only SELECT\n * through the federated query engine with the caller's access policies.\n */\nimport { useMutation, useQuery } from '@tanstack/react-query';\n\nimport { SemRequestError } from '../api/semanticfedGraphql';\nimport { useSemanticFed } from '../providers/SemanticFedProvider';\n\nexport type SemSqlDataType =\n 'STRING' | 'INTEGER' | 'DECIMAL' | 'BOOLEAN' | 'DATE' | 'TIMESTAMP' | 'JSON' | 'GEO' | 'UNKNOWN';\n\nexport interface SemModelSummary {\n id: string;\n name: string;\n status: string;\n}\n\nexport interface SemSqlCatalogColumn {\n name: string;\n kind: 'DIMENSION' | 'METRIC';\n dataType: SemSqlDataType;\n aggregation: string | null;\n description: string | null;\n isPrimary: boolean;\n}\n\nexport interface SemSqlCatalogTable {\n name: string;\n kind: string;\n description: string | null;\n primaryKey: string | null;\n columns: SemSqlCatalogColumn[];\n}\n\nexport interface SemSqlCatalog {\n modelId: string;\n modelName: string;\n tables: SemSqlCatalogTable[];\n}\n\nexport interface SemSqlResultColumn {\n name: string;\n entity: string;\n field: string;\n aggregation: string | null;\n dataType: SemSqlDataType;\n masked: boolean;\n mask: string | null;\n}\n\nexport interface SemSqlResult {\n modelId: string;\n columns: SemSqlResultColumn[];\n rows: Array<Record<string, unknown>>;\n rowCount: number;\n truncated: boolean;\n durationMs: number;\n sourcesTouched: number;\n}\n\nexport interface SemExecuteSqlInput {\n sql: string;\n modelId: string;\n maxRows?: number;\n}\n\nconst LIST_MODELS_QUERY = `query SemSqlConsoleModels($pagination: PaginationInput) {\n semListModels(pagination: $pagination) {\n items {\n id\n name\n status\n }\n }\n}`;\n\nconst SQL_CATALOG_QUERY = `query SemSqlCatalog($modelId: ID) {\n semSqlCatalog(modelId: $modelId) {\n modelId\n modelName\n tables {\n name\n kind\n description\n primaryKey\n columns {\n name\n kind\n dataType\n aggregation\n description\n isPrimary\n }\n }\n }\n}`;\n\nconst EXECUTE_SQL_MUTATION = `mutation SemExecuteSql($input: SemExecuteSqlInput!) {\n semExecuteSql(input: $input) {\n modelId\n columns {\n name\n entity\n field\n aggregation\n dataType\n masked\n mask\n }\n rows\n rowCount\n truncated\n durationMs\n sourcesTouched\n }\n}`;\n\n/** Largest model list the console offers (the picker is not paginated). */\nconst MODEL_PICKER_LIMIT = 100;\n\nexport function useSemSqlModels() {\n const { workspaceId } = useSemanticFed();\n const { request, ready } = useSemRequest();\n return useQuery({\n queryKey: ['semanticfed', 'sql', 'models', workspaceId ?? 'no-workspace'] as const,\n enabled: ready && Boolean(workspaceId),\n queryFn: async ({ signal }) => {\n const data = await request<{ semListModels: { items: SemModelSummary[] } }>(\n LIST_MODELS_QUERY,\n { pagination: { limit: MODEL_PICKER_LIMIT } },\n signal\n );\n return data.semListModels.items;\n },\n });\n}\n\nexport function useSemSqlCatalog(modelId: string | null) {\n const { workspaceId } = useSemanticFed();\n const { request, ready } = useSemRequest();\n return useQuery({\n queryKey: ['semanticfed', 'sql', 'catalog', workspaceId ?? 'no-workspace', modelId] as const,\n enabled: ready && Boolean(workspaceId && modelId),\n queryFn: async ({ signal }) => {\n const data = await request<{ semSqlCatalog: SemSqlCatalog }>(\n SQL_CATALOG_QUERY,\n { modelId },\n signal\n );\n return data.semSqlCatalog;\n },\n });\n}\n\nexport function useSemExecuteSql() {\n const { request } = useSemRequest();\n const analytics = useClientAnalytics();\n return useMutation({\n retry: false,\n mutationFn: async (input: SemExecuteSqlInput) => {\n try {\n const data = await request<{ semExecuteSql: SemSqlResult }>(EXECUTE_SQL_MUTATION, {\n input,\n });\n analytics.sqlExecuted(data.semExecuteSql.rowCount, data.semExecuteSql.truncated);\n return data.semExecuteSql;\n } catch (error: unknown) {\n analytics.sqlFailed(error);\n throw error;\n }\n },\n });\n}\n\n/**\n * The text to show for a failed SQL statement. The gateway generalises client\n * errors, so the service's own explanation (syntax position, unknown column,\n * policy denial) is preferred whenever the service sent one.\n */\nexport function sqlErrorMessage(error: unknown, tr?: ErrorTranslator): string {\n if (error instanceof SemRequestError && error.detail && error.code !== 'INTERNAL_SERVER_ERROR') {\n return translateRequestError(error.detail, tr);\n }\n return translateRequestError(error instanceof Error ? error.message : String(error), tr);\n}\n"],"mappings":";;;;;;;AAwEA,IAAMA,IAAoB,yKAUpBC,IAAoB,wUAqBpBC,IAAuB,qTAqBvBC,IAAqB;AAE3B,SAAgBC,IAAkB;CAChC,IAAM,EAAE,mBAAgBC,EAAe,GACjC,EAAE,YAAS,aAAUC,EAAc;CACzC,OAAOC,EAAS;EACd,UAAU;GAAC;GAAe;GAAO;GAAUC,KAAe;EAAc;EACxE,SAASC,KAAS,EAAQD;EAC1B,SAAS,OAAO,EAAE,iBAMT,MALYE,EACjBV,GACA,EAAE,YAAY,EAAE,OAAOG,EAAmB,EAAE,GAC5CQ,CACF,EAAA,CACY,cAAc;CAE9B,CAAC;AACH;AAEA,SAAgBC,EAAiB,GAAwB;CACvD,IAAM,EAAE,mBAAgBP,EAAe,GACjC,EAAE,YAAS,aAAUC,EAAc;CACzC,OAAOC,EAAS;EACd,UAAU;GAAC;GAAe;GAAO;GAAWC,KAAe;GAAgBK;EAAO;EAClF,SAASJ,KAAS,GAAQD,KAAeK;EACzC,SAAS,OAAO,EAAE,iBAMT,MALYH,EACjBT,GACA,EAAE,WAAQ,GACVU,CACF,EAAA,CACY;CAEhB,CAAC;AACH;AAEA,SAAgBG,IAAmB;CACjC,IAAM,EAAE,eAAYR,EAAc,GAC5BS,IAAYC,EAAmB;CACrC,OAAOC,EAAY;EACjB,OAAO;EACP,YAAY,OAAO,MAA8B;GAC/C,IAAI;IACF,IAAMC,IAAO,MAAMR,EAAyCR,GAAsB,EAChF,SACF,CAAC;IAED,OADAa,EAAU,YAAYG,EAAK,cAAc,UAAUA,EAAK,cAAc,SAAS,GACxEA,EAAK;GACd,SAASC,GAAgB;IAEvB,MADAJ,EAAU,UAAUI,CAAK,GACnBA;GACR;EACF;CACF,CAAC;AACH;AAOA,SAAgBC,EAAgB,GAAgB,GAA8B;CAI5E,OAHID,aAAiBE,KAAmBF,EAAM,UAAUA,EAAM,SAAS,0BAC9DG,EAAsBH,EAAM,QAAQI,CAAE,IAExCD,EAAsBH,aAAiB,QAAQA,EAAM,UAAU,OAAOA,CAAK,GAAGI,CAAE;AACzF"}
|
|
@@ -41,7 +41,7 @@ function x() {
|
|
|
41
41
|
className: "space-y-6 p-6",
|
|
42
42
|
children: [
|
|
43
43
|
/* @__PURE__ */ p("div", {
|
|
44
|
-
className: "flex items-
|
|
44
|
+
className: "flex flex-wrap items-start justify-between gap-3",
|
|
45
45
|
children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h1", {
|
|
46
46
|
className: "text-2xl font-semibold",
|
|
47
47
|
children: i("semanticfed.agents.title", "Semantic Agents")
|
|
@@ -49,19 +49,19 @@ function x() {
|
|
|
49
49
|
className: "text-sm text-muted-foreground",
|
|
50
50
|
children: i("semanticfed.agents.description", "Autonomous agents for ontology discovery, schema mapping, reasoning, and data ingestion.")
|
|
51
51
|
})] }), /* @__PURE__ */ p("div", {
|
|
52
|
-
className: "flex gap-2",
|
|
52
|
+
className: "flex max-w-full flex-wrap gap-2",
|
|
53
53
|
children: [/* @__PURE__ */ p(h, {
|
|
54
54
|
variant: "outline",
|
|
55
55
|
size: "sm",
|
|
56
56
|
children: [
|
|
57
|
-
/* @__PURE__ */ f(l, { className: "
|
|
57
|
+
/* @__PURE__ */ f(l, { className: "me-2 h-4 w-4" }),
|
|
58
58
|
" ",
|
|
59
59
|
i("semanticfed.agents.actions.restartAll", "Restart All")
|
|
60
60
|
]
|
|
61
61
|
}), /* @__PURE__ */ p(h, {
|
|
62
62
|
size: "sm",
|
|
63
63
|
children: [
|
|
64
|
-
/* @__PURE__ */ f(c, { className: "
|
|
64
|
+
/* @__PURE__ */ f(c, { className: "me-2 h-4 w-4" }),
|
|
65
65
|
" ",
|
|
66
66
|
i("semanticfed.agents.actions.deployAgent", "Deploy Agent")
|
|
67
67
|
]
|
|
@@ -97,7 +97,7 @@ function x() {
|
|
|
97
97
|
/* @__PURE__ */ p(g, { children: [/* @__PURE__ */ f(v, {
|
|
98
98
|
className: "pb-3",
|
|
99
99
|
children: /* @__PURE__ */ p("div", {
|
|
100
|
-
className: "flex items-
|
|
100
|
+
className: "flex flex-wrap items-start justify-between gap-3",
|
|
101
101
|
children: [/* @__PURE__ */ f(y, {
|
|
102
102
|
className: "text-base",
|
|
103
103
|
children: i("semanticfed.agents.table.title", "Agent Registry")
|
|
@@ -180,18 +180,18 @@ function x() {
|
|
|
180
180
|
})
|
|
181
181
|
}),
|
|
182
182
|
/* @__PURE__ */ f("td", {
|
|
183
|
-
className: "p-3 text-
|
|
183
|
+
className: "p-3 text-end font-mono",
|
|
184
184
|
children: e.tasksCompleted.toLocaleString()
|
|
185
185
|
}),
|
|
186
186
|
/* @__PURE__ */ f("td", {
|
|
187
|
-
className: "p-3 text-
|
|
187
|
+
className: "p-3 text-end",
|
|
188
188
|
children: /* @__PURE__ */ p("span", {
|
|
189
189
|
className: e.accuracy >= 95 ? "text-status-success-text" : e.accuracy >= 90 ? "text-status-warning-text" : "text-status-error-text",
|
|
190
190
|
children: [e.accuracy, "%"]
|
|
191
191
|
})
|
|
192
192
|
}),
|
|
193
193
|
/* @__PURE__ */ f("td", {
|
|
194
|
-
className: "p-3 text-
|
|
194
|
+
className: "p-3 text-end text-muted-foreground",
|
|
195
195
|
children: e.lastRunAt
|
|
196
196
|
})
|
|
197
197
|
]
|