@surfaces-ui/components 0.0.0-stage → 0.3.0

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.
Files changed (270) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +4 -0
  3. package/README.md +51 -2
  4. package/dist/appComponents.d.ts +86 -0
  5. package/dist/appComponents.js +555 -0
  6. package/dist/appComponents.js.map +1 -0
  7. package/dist/chart/BulletGraph.d.ts +44 -0
  8. package/dist/chart/BulletGraph.js +41 -0
  9. package/dist/chart/BulletGraph.js.map +1 -0
  10. package/dist/chart/Chart.d.ts +178 -0
  11. package/dist/chart/Chart.js +285 -0
  12. package/dist/chart/Chart.js.map +1 -0
  13. package/dist/chart/Sparkline.d.ts +35 -0
  14. package/dist/chart/Sparkline.js +38 -0
  15. package/dist/chart/Sparkline.js.map +1 -0
  16. package/dist/chart/advice.d.ts +32 -0
  17. package/dist/chart/advice.js +48 -0
  18. package/dist/chart/advice.js.map +1 -0
  19. package/dist/chart/option.d.ts +90 -0
  20. package/dist/chart/option.js +252 -0
  21. package/dist/chart/option.js.map +1 -0
  22. package/dist/chart/wheel.d.ts +12 -0
  23. package/dist/chart/wheel.js +21 -0
  24. package/dist/chart/wheel.js.map +1 -0
  25. package/dist/controls/Combobox.d.ts +39 -0
  26. package/dist/controls/Combobox.js +75 -0
  27. package/dist/controls/Combobox.js.map +1 -0
  28. package/dist/controls/ConfirmDialog.d.ts +35 -0
  29. package/dist/controls/ConfirmDialog.js +84 -0
  30. package/dist/controls/ConfirmDialog.js.map +1 -0
  31. package/dist/controls/ItemControls.d.ts +115 -0
  32. package/dist/controls/ItemControls.js +109 -0
  33. package/dist/controls/ItemControls.js.map +1 -0
  34. package/dist/controls/Popover.d.ts +31 -0
  35. package/dist/controls/Popover.js +114 -0
  36. package/dist/controls/Popover.js.map +1 -0
  37. package/dist/controls/ResizeHandle.d.ts +48 -0
  38. package/dist/controls/ResizeHandle.js +91 -0
  39. package/dist/controls/ResizeHandle.js.map +1 -0
  40. package/dist/controls/SegmentedControl.d.ts +27 -0
  41. package/dist/controls/SegmentedControl.js +17 -0
  42. package/dist/controls/SegmentedControl.js.map +1 -0
  43. package/dist/controls/StatusBadge.d.ts +17 -0
  44. package/dist/controls/StatusBadge.js +10 -0
  45. package/dist/controls/StatusBadge.js.map +1 -0
  46. package/dist/controls/context.d.ts +17 -0
  47. package/dist/controls/context.js +2 -0
  48. package/dist/controls/context.js.map +1 -0
  49. package/dist/controls/placement.d.ts +43 -0
  50. package/dist/controls/placement.js +19 -0
  51. package/dist/controls/placement.js.map +1 -0
  52. package/dist/controls/resize.d.ts +23 -0
  53. package/dist/controls/resize.js +49 -0
  54. package/dist/controls/resize.js.map +1 -0
  55. package/dist/data/DataNotes.d.ts +13 -0
  56. package/dist/data/DataNotes.js +18 -0
  57. package/dist/data/DataNotes.js.map +1 -0
  58. package/dist/data/DataSourceProvider.d.ts +11 -0
  59. package/dist/data/DataSourceProvider.js +21 -0
  60. package/dist/data/DataSourceProvider.js.map +1 -0
  61. package/dist/data/export.d.ts +33 -0
  62. package/dist/data/export.js +77 -0
  63. package/dist/data/export.js.map +1 -0
  64. package/dist/data/format.d.ts +44 -0
  65. package/dist/data/format.js +127 -0
  66. package/dist/data/format.js.map +1 -0
  67. package/dist/data/messages.d.ts +13 -0
  68. package/dist/data/messages.js +2 -0
  69. package/dist/data/messages.js.map +1 -0
  70. package/dist/data/useRowWindow.d.ts +70 -0
  71. package/dist/data/useRowWindow.js +175 -0
  72. package/dist/data/useRowWindow.js.map +1 -0
  73. package/dist/discovery/AskData.d.ts +22 -0
  74. package/dist/discovery/AskData.js +49 -0
  75. package/dist/discovery/AskData.js.map +1 -0
  76. package/dist/discovery/ContextBuilder.d.ts +49 -0
  77. package/dist/discovery/ContextBuilder.js +167 -0
  78. package/dist/discovery/ContextBuilder.js.map +1 -0
  79. package/dist/discovery/DataSearch.d.ts +27 -0
  80. package/dist/discovery/DataSearch.js +73 -0
  81. package/dist/discovery/DataSearch.js.map +1 -0
  82. package/dist/discovery/ObjectDetail.d.ts +38 -0
  83. package/dist/discovery/ObjectDetail.js +129 -0
  84. package/dist/discovery/ObjectDetail.js.map +1 -0
  85. package/dist/discovery/RelationshipGraph.d.ts +19 -0
  86. package/dist/discovery/RelationshipGraph.js +64 -0
  87. package/dist/discovery/RelationshipGraph.js.map +1 -0
  88. package/dist/discovery/shared.d.ts +38 -0
  89. package/dist/discovery/shared.js +64 -0
  90. package/dist/discovery/shared.js.map +1 -0
  91. package/dist/editor/SqlEditor.d.ts +41 -0
  92. package/dist/editor/SqlEditor.js +181 -0
  93. package/dist/editor/SqlEditor.js.map +1 -0
  94. package/dist/explore/Explorer.d.ts +110 -0
  95. package/dist/explore/Explorer.js +471 -0
  96. package/dist/explore/Explorer.js.map +1 -0
  97. package/dist/explore/ModelLineage.d.ts +22 -0
  98. package/dist/explore/ModelLineage.js +70 -0
  99. package/dist/explore/ModelLineage.js.map +1 -0
  100. package/dist/explore/ReportBuilder.d.ts +39 -0
  101. package/dist/explore/ReportBuilder.js +98 -0
  102. package/dist/explore/ReportBuilder.js.map +1 -0
  103. package/dist/explore/SemanticModelEditor.d.ts +60 -0
  104. package/dist/explore/SemanticModelEditor.js +220 -0
  105. package/dist/explore/SemanticModelEditor.js.map +1 -0
  106. package/dist/explore/SemanticRows.d.ts +42 -0
  107. package/dist/explore/SemanticRows.js +121 -0
  108. package/dist/explore/SemanticRows.js.map +1 -0
  109. package/dist/explore/SemanticsProvider.d.ts +31 -0
  110. package/dist/explore/SemanticsProvider.js +72 -0
  111. package/dist/explore/SemanticsProvider.js.map +1 -0
  112. package/dist/explore/model.d.ts +151 -0
  113. package/dist/explore/model.js +344 -0
  114. package/dist/explore/model.js.map +1 -0
  115. package/dist/explore/report.d.ts +60 -0
  116. package/dist/explore/report.js +92 -0
  117. package/dist/explore/report.js.map +1 -0
  118. package/dist/explore/semantic-proposal.d.ts +44 -0
  119. package/dist/explore/semantic-proposal.js +67 -0
  120. package/dist/explore/semantic-proposal.js.map +1 -0
  121. package/dist/explore/semantic.d.ts +44 -0
  122. package/dist/explore/semantic.js +154 -0
  123. package/dist/explore/semantic.js.map +1 -0
  124. package/dist/files/FileBrowser.d.ts +42 -0
  125. package/dist/files/FileBrowser.js +314 -0
  126. package/dist/files/FileBrowser.js.map +1 -0
  127. package/dist/files/files.d.ts +65 -0
  128. package/dist/files/files.js +165 -0
  129. package/dist/files/files.js.map +1 -0
  130. package/dist/filter/FilterBar.d.ts +49 -0
  131. package/dist/filter/FilterBar.js +153 -0
  132. package/dist/filter/FilterBar.js.map +1 -0
  133. package/dist/filter/QueryFilters.d.ts +25 -0
  134. package/dist/filter/QueryFilters.js +58 -0
  135. package/dist/filter/QueryFilters.js.map +1 -0
  136. package/dist/form/Form.d.ts +76 -0
  137. package/dist/form/Form.js +131 -0
  138. package/dist/form/Form.js.map +1 -0
  139. package/dist/graph/NodeGraph.d.ts +30 -0
  140. package/dist/graph/NodeGraph.js +89 -0
  141. package/dist/graph/NodeGraph.js.map +1 -0
  142. package/dist/graph/model.d.ts +68 -0
  143. package/dist/graph/model.js +122 -0
  144. package/dist/graph/model.js.map +1 -0
  145. package/dist/grid/DataGrid.d.ts +98 -0
  146. package/dist/grid/DataGrid.js +400 -0
  147. package/dist/grid/DataGrid.js.map +1 -0
  148. package/dist/index.d.ts +85 -0
  149. package/dist/index.js +87 -0
  150. package/dist/index.js.map +1 -0
  151. package/dist/locale/SurfacesText.d.ts +17 -0
  152. package/dist/locale/SurfacesText.js +17 -0
  153. package/dist/locale/SurfacesText.js.map +1 -0
  154. package/dist/locale/locale.d.ts +305 -0
  155. package/dist/locale/locale.js +359 -0
  156. package/dist/locale/locale.js.map +1 -0
  157. package/dist/menu/ContextMenu.d.ts +31 -0
  158. package/dist/menu/ContextMenu.js +95 -0
  159. package/dist/menu/ContextMenu.js.map +1 -0
  160. package/dist/metric/Metric.d.ts +33 -0
  161. package/dist/metric/Metric.js +64 -0
  162. package/dist/metric/Metric.js.map +1 -0
  163. package/dist/metric/useMeasure.d.ts +25 -0
  164. package/dist/metric/useMeasure.js +44 -0
  165. package/dist/metric/useMeasure.js.map +1 -0
  166. package/dist/model/ModelDiagram.d.ts +142 -0
  167. package/dist/model/ModelDiagram.js +700 -0
  168. package/dist/model/ModelDiagram.js.map +1 -0
  169. package/dist/panzoom/usePanZoom.d.ts +117 -0
  170. package/dist/panzoom/usePanZoom.js +313 -0
  171. package/dist/panzoom/usePanZoom.js.map +1 -0
  172. package/dist/pipeline/DatasetReview.d.ts +48 -0
  173. package/dist/pipeline/DatasetReview.js +157 -0
  174. package/dist/pipeline/DatasetReview.js.map +1 -0
  175. package/dist/pipeline/IngestWizard.d.ts +51 -0
  176. package/dist/pipeline/IngestWizard.js +79 -0
  177. package/dist/pipeline/IngestWizard.js.map +1 -0
  178. package/dist/pipeline/Pipeline.d.ts +171 -0
  179. package/dist/pipeline/Pipeline.js +203 -0
  180. package/dist/pipeline/Pipeline.js.map +1 -0
  181. package/dist/pipeline/PipelineView.d.ts +63 -0
  182. package/dist/pipeline/PipelineView.js +239 -0
  183. package/dist/pipeline/PipelineView.js.map +1 -0
  184. package/dist/pivot/PivotTable.d.ts +94 -0
  185. package/dist/pivot/PivotTable.js +176 -0
  186. package/dist/pivot/PivotTable.js.map +1 -0
  187. package/dist/plan/QueryPlan.d.ts +29 -0
  188. package/dist/plan/QueryPlan.js +79 -0
  189. package/dist/plan/QueryPlan.js.map +1 -0
  190. package/dist/result/QueryResult.d.ts +51 -0
  191. package/dist/result/QueryResult.js +256 -0
  192. package/dist/result/QueryResult.js.map +1 -0
  193. package/dist/review/ActionReceipt.d.ts +52 -0
  194. package/dist/review/ActionReceipt.js +32 -0
  195. package/dist/review/ActionReceipt.js.map +1 -0
  196. package/dist/review/PiiReview.d.ts +37 -0
  197. package/dist/review/PiiReview.js +29 -0
  198. package/dist/review/PiiReview.js.map +1 -0
  199. package/dist/review/PlanReview.d.ts +42 -0
  200. package/dist/review/PlanReview.js +37 -0
  201. package/dist/review/PlanReview.js.map +1 -0
  202. package/dist/review/StepFlow.d.ts +25 -0
  203. package/dist/review/StepFlow.js +21 -0
  204. package/dist/review/StepFlow.js.map +1 -0
  205. package/dist/review/pii.d.ts +21 -0
  206. package/dist/review/pii.js +67 -0
  207. package/dist/review/pii.js.map +1 -0
  208. package/dist/rows/RowList.d.ts +41 -0
  209. package/dist/rows/RowList.js +72 -0
  210. package/dist/rows/RowList.js.map +1 -0
  211. package/dist/schema/ObjectBrowser.d.ts +78 -0
  212. package/dist/schema/ObjectBrowser.js +467 -0
  213. package/dist/schema/ObjectBrowser.js.map +1 -0
  214. package/dist/schema/ObjectInfo.d.ts +25 -0
  215. package/dist/schema/ObjectInfo.js +69 -0
  216. package/dist/schema/ObjectInfo.js.map +1 -0
  217. package/dist/schema/SchemaExplorer.d.ts +32 -0
  218. package/dist/schema/SchemaExplorer.js +175 -0
  219. package/dist/schema/SchemaExplorer.js.map +1 -0
  220. package/dist/schema/refs.d.ts +32 -0
  221. package/dist/schema/refs.js +65 -0
  222. package/dist/schema/refs.js.map +1 -0
  223. package/dist/site/Site.d.ts +191 -0
  224. package/dist/site/Site.js +138 -0
  225. package/dist/site/Site.js.map +1 -0
  226. package/dist/source/ConnectionBuilder.d.ts +54 -0
  227. package/dist/source/ConnectionBuilder.js +115 -0
  228. package/dist/source/ConnectionBuilder.js.map +1 -0
  229. package/dist/source/SourceList.d.ts +17 -0
  230. package/dist/source/SourceList.js +71 -0
  231. package/dist/source/SourceList.js.map +1 -0
  232. package/dist/styles.css +9930 -0
  233. package/dist/styles.layer.css +9934 -0
  234. package/dist/table/DataTable.d.ts +72 -0
  235. package/dist/table/DataTable.js +68 -0
  236. package/dist/table/DataTable.js.map +1 -0
  237. package/dist/table/Pagination.d.ts +20 -0
  238. package/dist/table/Pagination.js +16 -0
  239. package/dist/table/Pagination.js.map +1 -0
  240. package/dist/table/SelectionBar.d.ts +43 -0
  241. package/dist/table/SelectionBar.js +18 -0
  242. package/dist/table/SelectionBar.js.map +1 -0
  243. package/dist/text/Markdown.d.ts +71 -0
  244. package/dist/text/Markdown.js +187 -0
  245. package/dist/text/Markdown.js.map +1 -0
  246. package/dist/text/highlight.d.ts +23 -0
  247. package/dist/text/highlight.js +196 -0
  248. package/dist/text/highlight.js.map +1 -0
  249. package/dist/theme/ThemePicker.d.ts +16 -0
  250. package/dist/theme/ThemePicker.js +50 -0
  251. package/dist/theme/ThemePicker.js.map +1 -0
  252. package/dist/theme/ThemeProvider.d.ts +52 -0
  253. package/dist/theme/ThemeProvider.js +111 -0
  254. package/dist/theme/ThemeProvider.js.map +1 -0
  255. package/dist/workspace/NavBar.d.ts +23 -0
  256. package/dist/workspace/NavBar.js +171 -0
  257. package/dist/workspace/NavBar.js.map +1 -0
  258. package/dist/workspace/SideNav.d.ts +61 -0
  259. package/dist/workspace/SideNav.js +149 -0
  260. package/dist/workspace/SideNav.js.map +1 -0
  261. package/dist/workspace/Workspace.d.ts +53 -0
  262. package/dist/workspace/Workspace.js +243 -0
  263. package/dist/workspace/Workspace.js.map +1 -0
  264. package/dist/workspace/icons.d.ts +34 -0
  265. package/dist/workspace/icons.js +37 -0
  266. package/dist/workspace/icons.js.map +1 -0
  267. package/dist/workspace/layout.d.ts +74 -0
  268. package/dist/workspace/layout.js +276 -0
  269. package/dist/workspace/layout.js.map +1 -0
  270. package/package.json +85 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatasetReview.js","sourceRoot":"","sources":["../../src/pipeline/DatasetReview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAkB,SAAS,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAc,SAAS,EAAE,aAAa,EAAgB,WAAW,EAAqC,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC7J,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,M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AE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC,IAAI,CAAC,YAChH,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,GAClC,EACT,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,WAAW,EAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC,KAAK,CAAC,uBAEpF,IACF,CACV,EAEA,CAAC,OAAO,IAAI,MAAM,IAAI,YAAG,SAAS,EAAC,uBAAuB,kFAAsE,IACzH,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { create } from \"@bufbuild/protobuf\";\nimport { type Pipelines, checkName, pipelineDigest } from \"@surfaces-ui/data\";\nimport { type Check, CheckKind, CheckSeverity, type Dataset, DatasetKind, type Pipeline, type PipelineDraft, PipelineDraftSchema } from \"@surfaces-ui/proto\";\nimport { useEffect, useId, useMemo, useState } from \"react\";\nimport { ItemControls, standardControls } from \"../controls/ItemControls.js\";\nimport type { ContextNote } from \"../controls/context.js\";\nimport { messageOf } from \"../data/useRowWindow.js\";\nimport { CodeBlock } from \"../text/Markdown.js\";\nimport { useOptionalPipelines } from \"./PipelineView.js\";\n\nexport interface DatasetDecision {\n approved: boolean;\n /** The version saved, when approved and saved. */\n version?: number;\n /** The digest of the pipeline as approved. */\n digest?: string;\n approvedBy?: string;\n note?: string;\n}\n\nexport interface DatasetReviewProps {\n /** The whole pipeline as it would be with the change: what `propose_dataset` returns. */\n pipeline: PipelineDraft;\n /** The dataset under review. */\n dataset: string;\n /** The saved version the proposal was made against. A save made against an older one is refused. */\n expectedVersion: number;\n /** The digest the proposer computed. The one checked is worked out again from what is shown here. */\n digest?: string;\n proposedBy?: string;\n /** Who is reviewing, when the host knows; the person can change it. */\n approver?: string;\n /** Saves on approval. Defaults to the one in context; with none, or one whose pipelines are fixed, approval only reports. */\n pipelines?: Pipelines;\n /** Called once the person decides, after a save when there was one. */\n onDecide?(decision: DatasetDecision): void;\n /** What the person changed, for the agent's next turn. */\n onContext?(note: ContextNote): void;\n className?: string;\n}\n\nconst KIND_TEXT: Record<number, string> = {\n [CheckKind.UNIQUE]: \"never repeats\",\n [CheckKind.NOT_NULL]: \"is never empty\",\n [CheckKind.RELATIONSHIPS]: \"is found in\",\n [CheckKind.ACCEPTED_VALUES]: \"is one of\",\n [CheckKind.ROW_COUNT]: \"row count\",\n};\n\n/** A check in words: \"region is one of EU, US\". */\nexport function checkText(check: Pick<Check, \"kind\" | \"columns\" | \"toTable\" | \"toColumn\" | \"values\" | \"minRows\" | \"maxRows\"> & { description?: string }): string {\n const columns = check.columns.join(\", \");\n if (check.kind === CheckKind.UNSPECIFIED && check.description) return check.description;\n switch (check.kind) {\n case CheckKind.RELATIONSHIPS:\n return `${columns} is found in ${check.toTable}.${check.toColumn}`;\n case CheckKind.ACCEPTED_VALUES:\n return `${columns} is one of ${check.values.join(\", \")}`;\n case CheckKind.ROW_COUNT:\n return check.minRows !== undefined && check.maxRows !== undefined\n ? `between ${check.minRows} and ${check.maxRows} rows`\n : check.minRows !== undefined\n ? `at least ${check.minRows} rows`\n : check.maxRows !== undefined\n ? `at most ${check.maxRows} rows`\n : \"row count\";\n default:\n return `${columns} ${KIND_TEXT[check.kind] ?? \"\"}`.trim();\n }\n}\n\n/** What differs between the saved dataset and the proposed one, in words. */\nexport function datasetChanges(before: Dataset | undefined, after: Dataset): string[] {\n if (!before) return [\"New dataset\"];\n const out: string[] = [];\n const same = (a: unknown, b: unknown) => JSON.stringify(a) === JSON.stringify(b);\n if (before.sql.trim() !== after.sql.trim()) out.push(\"Query\");\n if (before.grain !== after.grain) out.push(\"Grain\");\n if (!same(before.primaryKey, after.primaryKey)) out.push(\"Key\");\n if (!same(before.inputs, after.inputs)) out.push(\"What it reads\");\n if (!same(before.columns.map((c) => [c.name, c.type, c.description]), after.columns.map((c) => [c.name, c.type, c.description]))) out.push(\"Columns\");\n const checks = (d: Dataset) => d.checks.filter((c) => !c.implied).map((c) => [c.kind, c.columns, c.toTable, c.toColumn, c.values, String(c.minRows), String(c.maxRows), c.severity]);\n if (!same(checks(before), checks(after))) out.push(\"Checks\");\n if (before.description !== after.description) out.push(\"Description\");\n if (before.kind !== after.kind || before.layer !== after.layer) out.push(\"Kind\");\n return out;\n}\n\n/**\n * A proposed or changed pipeline dataset for a person to approve: its query,\n * what it reads, what one row is, its key, columns and checks, and what\n * changes from the saved version. The person can change the grain, the\n * descriptions and the checks, then approve or reject. Approving saves the\n * pipeline through the backend with the digest of exactly what is shown and\n * the version it was proposed against, so a stale or altered proposal is\n * refused; it builds nothing. Rejecting only reports.\n */\nexport function DatasetReview(props: DatasetReviewProps) {\n const pipelines = useOptionalPipelines(props.pipelines);\n const id = useId();\n const [draft, setDraft] = useState<PipelineDraft>(() => create(PipelineDraftSchema, props.pipeline));\n const [saved, setSaved] = useState<Pipeline | undefined>();\n const [approver, setApprover] = useState(props.approver ?? \"\");\n const [note, setNote] = useState(\"\");\n const [digest, setDigest] = useState<string | undefined>();\n const [outcome, setOutcome] = useState<{ text: string; error?: boolean } | undefined>();\n const [busy, setBusy] = useState(false);\n const [decided, setDecided] = useState(false);\n\n useEffect(() => setDraft(create(PipelineDraftSchema, props.pipeline)), [props.pipeline]);\n useEffect(() => {\n let live = true;\n void pipelineDigest(draft).then((d) => live && setDigest(d));\n return () => {\n live = false;\n };\n }, [draft]);\n useEffect(() => {\n if (!pipelines || props.expectedVersion === 0) return;\n let live = true;\n pipelines.getPipeline({ id: draft.id }).then(\n ({ pipeline }) => live && setSaved(pipeline),\n () => undefined,\n );\n return () => {\n live = false;\n };\n }, [pipelines, draft.id, props.expectedVersion]);\n\n const index = draft.datasets.findIndex((d) => d.name.toLowerCase() === props.dataset.toLowerCase());\n const dataset = draft.datasets[index];\n const before = saved?.datasets.find((d) => d.kind !== DatasetKind.SOURCE && d.name.toLowerCase() === props.dataset.toLowerCase());\n const changes = useMemo(() => (dataset ? datasetChanges(before, dataset) : []), [before, dataset]);\n const edited = digest !== undefined && props.digest !== undefined && digest !== props.digest;\n const canSave = !!pipelines?.savePipeline;\n\n if (!dataset) {\n return (\n <p className=\"sf-surface-notice\" role=\"note\">\n The proposal has no dataset called {props.dataset}.\n </p>\n );\n }\n const name = dataset.name;\n const change = (next: Partial<Dataset>, summary: string) => {\n setDraft((current) => create(PipelineDraftSchema, { ...current, datasets: current.datasets.map((d, i) => (i === index ? { ...d, ...next } : d)) }));\n props.onContext?.({ kind: \"field.changed\", summary, subject: { pipeline: draft.id, dataset: name } });\n };\n const ownChecks = dataset.checks.filter((c) => !c.implied);\n\n const decide = async (approved: boolean) => {\n if (!approved) {\n setDecided(true);\n setOutcome({ text: \"Rejected. Nothing was saved.\" });\n props.onDecide?.({ approved: false, ...(note ? { note } : {}) });\n return;\n }\n const by = approver.trim();\n if (!by) {\n setOutcome({ text: \"Say who is approving it.\", error: true });\n return;\n }\n const shown = await pipelineDigest(draft);\n if (!canSave) {\n setDecided(true);\n setOutcome({ text: \"Approved. This page cannot save pipelines, so the approval was passed on.\" });\n props.onDecide?.({ approved: true, digest: shown, approvedBy: by, ...(note ? { note } : {}) });\n return;\n }\n setBusy(true);\n try {\n const { pipeline } = await pipelines!.savePipeline!({ pipeline: draft, expectedVersion: props.expectedVersion, approvedBy: by, approvalDigest: shown, note });\n setDecided(true);\n setOutcome({ text: `Saved as version ${pipeline?.version}. Nothing has been built yet; run the pipeline to build it.` });\n props.onDecide?.({ approved: true, version: pipeline?.version, digest: shown, approvedBy: by, ...(note ? { note } : {}) });\n } catch (error) {\n setOutcome({ text: messageOf(error), error: true });\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <section className={[\"sf-plan-review\", \"sf-dataset-review\", props.className].filter(Boolean).join(\" \")} aria-labelledby={`${id}-title`}>\n <header>\n <p className=\"sf-plan-review-title\" id={`${id}-title`}>\n {before ? \"Change\" : \"Add\"} {name} in {draft.name || draft.id}\n </p>\n <p className=\"sf-plan-review-summary\">\n {[dataset.description, dataset.kind === DatasetKind.VIEW ? \"Built as a view\" : \"Built as a table\", dataset.layer ? `${dataset.layer} layer` : undefined, `on ${draft.sourceId}`].filter(Boolean).join(\" · \")}\n </p>\n {props.proposedBy && <p className=\"sf-plan-review-by\">Proposed by {props.proposedBy}. Nothing is saved until you approve, and nothing is built until the pipeline runs.</p>}\n <p className=\"sf-dataset-review-changes\">\n {changes.map((c) => (\n <span key={c} className=\"sf-schema-tag\">\n {c === \"New dataset\" ? c : `${c} changed`}\n </span>\n ))}\n </p>\n </header>\n\n <div className=\"sf-dataset-review-body\">\n <h4 className=\"sf-dataset-review-heading\">Query</h4>\n <CodeBlock code={dataset.sql} language=\"sql\" />\n {before && before.sql.trim() !== dataset.sql.trim() && (\n <details className=\"sf-plan-review-sql\">\n <summary>The saved query</summary>\n <CodeBlock code={before.sql} language=\"sql\" />\n </details>\n )}\n <p className=\"sf-plan-review-detail\">\n {dataset.inputs.length > 0 ? `Reads ${dataset.inputs.join(\", \")}.` : \"What it reads is worked out from the query when it is saved.\"}\n </p>\n\n <label className=\"sf-dataset-review-field\">\n <span>Grain: what one row is</span>\n <input className=\"sf-input\" value={dataset.grain} disabled={decided} onChange={(event) => change({ grain: event.target.value }, `Changed the grain of ${name} to \"${event.target.value}\"`)} />\n </label>\n <p className=\"sf-plan-review-detail\">\n {dataset.primaryKey.length > 0\n ? `Key: ${dataset.primaryKey.join(\", \")}. After every build it is checked that no two rows share it and that it is never empty.`\n : \"No key, so nothing checks that rows do not repeat.\"}\n </p>\n\n {dataset.columns.length > 0 && (\n <>\n <h4 className=\"sf-dataset-review-heading\">Columns</h4>\n <table className=\"sf-dataset-review-columns\">\n <thead>\n <tr>\n <th scope=\"col\">Column</th>\n <th scope=\"col\">Type</th>\n <th scope=\"col\">Description</th>\n </tr>\n </thead>\n <tbody>\n {dataset.columns.map((column, i) => (\n <tr key={column.name}>\n <th scope=\"row\">{column.name}</th>\n <td>{column.type}</td>\n <td>\n <input\n className=\"sf-input\"\n aria-label={`Description of ${column.name}`}\n value={column.description}\n disabled={decided}\n onChange={(event) =>\n change({ columns: dataset.columns.map((c, j) => (j === i ? { ...c, description: event.target.value } : c)) }, `Described ${name}.${column.name}`)\n }\n />\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </>\n )}\n\n <h4 className=\"sf-dataset-review-heading\">Checks after each build</h4>\n {ownChecks.length === 0 ? (\n <p className=\"sf-plan-review-detail\">No checks beyond the key.</p>\n ) : (\n <ul className=\"sf-dataset-review-checks\">\n {ownChecks.map((check) => {\n const label = checkName(check);\n const warn = check.severity === CheckSeverity.WARN;\n return (\n <li key={label} className=\"sf-controls-host\" data-controls=\"corner\">\n <span className=\"sf-dataset-review-check\">\n <code>{label}</code> {checkText(check)}\n </span>\n <label className=\"sf-dataset-review-severity\">\n <input\n type=\"checkbox\"\n checked={!warn}\n disabled={decided}\n onChange={() =>\n change(\n { checks: dataset.checks.map((c) => (c === check ? { ...c, severity: warn ? CheckSeverity.FAIL : CheckSeverity.WARN } : c)) },\n warn ? `${label} now stops what reads ${name}` : `${label} now only warns`,\n )\n }\n />\n Stops what reads it when it fails\n </label>\n {!decided && (\n <ItemControls label={`Check ${label}`} controls={standardControls(`the check ${label}`, { remove: () => change({ checks: dataset.checks.filter((c) => c !== check) }, `Removed the check ${label} from ${name}`) })} />\n )}\n </li>\n );\n })}\n </ul>\n )}\n </div>\n\n {outcome && (\n <p className=\"sf-plan-review-outcome\" role={outcome.error ? \"alert\" : \"status\"}>\n {outcome.text}\n </p>\n )}\n {!decided && (\n <footer className=\"sf-plan-review-actions\">\n <label className=\"sf-plan-review-note\">\n Approved by\n <input className=\"sf-input\" value={approver} onChange={(event) => setApprover(event.target.value)} autoComplete=\"name\" />\n </label>\n <label className=\"sf-plan-review-note\">\n Note (optional)\n <input className=\"sf-input\" value={note} onChange={(event) => setNote(event.target.value)} />\n </label>\n <button type=\"button\" className=\"sf-button\" data-variant=\"primary\" disabled={busy} onClick={() => void decide(true)}>\n {canSave ? \"Approve and save\" : \"Approve\"}\n </button>\n <button type=\"button\" className=\"sf-button\" disabled={busy} onClick={() => void decide(false)}>\n Reject\n </button>\n </footer>\n )}\n {/* Below the buttons, so the fields do not move when it appears. */}\n {!decided && edited && <p className=\"sf-plan-review-detail\">You changed the proposal; what you approve is what is shown here.</p>}\n </section>\n );\n}\n"]}
@@ -0,0 +1,51 @@
1
+ import type { Pipelines } from "@surfaces-ui/data";
2
+ export interface IngestColumn {
3
+ /** The column as it is in the files. */
4
+ source: string;
5
+ sourceType: string;
6
+ /** Whether to load it. */
7
+ include: boolean;
8
+ /** Its name in the table. */
9
+ target: string;
10
+ /** Its type in the table. Empty keeps the type found in the files. */
11
+ targetType: string;
12
+ }
13
+ export interface IngestDraft {
14
+ format: "parquet" | "delta" | "iceberg" | "csv" | "json";
15
+ /** A file, glob or table root the source may read. */
16
+ location: string;
17
+ /** Name for the files as a table of the source. */
18
+ rawTable: string;
19
+ /** Name for the cleaned table a pipeline builds. Empty leaves the pipeline step out. */
20
+ targetTable: string;
21
+ columns: IngestColumn[];
22
+ }
23
+ export declare const emptyIngestDraft: IngestDraft;
24
+ export interface IngestPlan {
25
+ /** A `tables` entry for the source in surfaces.config.ts. */
26
+ table: string;
27
+ /** A pipeline dataset that selects, renames and retypes the columns. Empty when no target table is named. */
28
+ dataset: string;
29
+ problems: string[];
30
+ }
31
+ /**
32
+ * Turns a mapping into what a server needs: a table entry for the files and
33
+ * a pipeline dataset that shapes them. It writes configuration for a person
34
+ * to review and add; it loads nothing.
35
+ */
36
+ export declare function ingestPlan(draft: IngestDraft): IngestPlan;
37
+ export interface IngestWizardProps {
38
+ /** The source whose engine will read the files. */
39
+ sourceId: string;
40
+ value: IngestDraft;
41
+ onChange(draft: IngestDraft): void;
42
+ pipelines?: Pipelines;
43
+ className?: string;
44
+ }
45
+ /**
46
+ * Brings new files in, in three steps: say where they are, look at what the
47
+ * engine finds there, and choose which columns to keep, what to call them
48
+ * and what type they should be. The result is configuration to review, not
49
+ * a load: adding it to the server is a person's decision.
50
+ */
51
+ export declare function IngestWizard({ sourceId, value, onChange, className, ...props }: IngestWizardProps): import("react").JSX.Element;
@@ -0,0 +1,79 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { TableFormat } from "@surfaces-ui/proto";
3
+ import { useState } from "react";
4
+ import { messageOf } from "../data/useRowWindow.js";
5
+ import { CodeBlock } from "../text/Markdown.js";
6
+ import { usePipelines } from "./PipelineView.js";
7
+ import { numberFormat } from "../locale/locale.js";
8
+ export const emptyIngestDraft = { format: "parquet", location: "", rawTable: "", targetTable: "", columns: [] };
9
+ const FORMAT = {
10
+ parquet: TableFormat.PARQUET,
11
+ delta: TableFormat.DELTA,
12
+ iceberg: TableFormat.ICEBERG,
13
+ csv: TableFormat.CSV,
14
+ json: TableFormat.JSON,
15
+ };
16
+ const TYPES = ["", "VARCHAR", "BIGINT", "INTEGER", "DOUBLE", "DECIMAL(18,2)", "BOOLEAN", "DATE", "TIMESTAMP"];
17
+ const NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
18
+ const quote = (name) => (NAME.test(name) ? name : `"${name.replace(/"/g, '""')}"`);
19
+ /**
20
+ * Turns a mapping into what a server needs: a table entry for the files and
21
+ * a pipeline dataset that shapes them. It writes configuration for a person
22
+ * to review and add; it loads nothing.
23
+ */
24
+ export function ingestPlan(draft) {
25
+ const problems = [];
26
+ const included = draft.columns.filter((c) => c.include);
27
+ if (!draft.location.trim())
28
+ problems.push("Say where the files are.");
29
+ if (!NAME.test(draft.rawTable))
30
+ problems.push("Name the table using letters, digits and underscores.");
31
+ if (draft.targetTable && !NAME.test(draft.targetTable))
32
+ problems.push("The cleaned table's name uses letters, digits and underscores.");
33
+ if (draft.targetTable && draft.targetTable.toLowerCase() === draft.rawTable.toLowerCase())
34
+ problems.push("The cleaned table needs a different name from the raw one.");
35
+ if (draft.columns.length > 0 && included.length === 0)
36
+ problems.push("Keep at least one column.");
37
+ const targets = included.map((c) => c.target.trim().toLowerCase());
38
+ if (included.some((c) => !NAME.test(c.target.trim())))
39
+ problems.push("Column names use letters, digits and underscores.");
40
+ else if (new Set(targets).size !== targets.length)
41
+ problems.push("Two columns have the same name.");
42
+ const table = `{ name: ${JSON.stringify(draft.rawTable)}, format: ${JSON.stringify(draft.format)}, path: ${JSON.stringify(draft.location.trim())} },`;
43
+ const select = included
44
+ .map((c) => {
45
+ const value = c.targetType ? `CAST(${quote(c.source)} AS ${c.targetType})` : quote(c.source);
46
+ return c.target.trim() === c.source && !c.targetType ? ` ${value}` : ` ${value} AS ${quote(c.target.trim())}`;
47
+ })
48
+ .join(",\n");
49
+ const dataset = draft.targetTable
50
+ ? `{\n name: ${JSON.stringify(draft.targetTable)},\n layer: "silver",\n sql: ${JSON.stringify(`SELECT\n${select}\nFROM ${quote(draft.rawTable)}`)},\n},`
51
+ : "";
52
+ return { table, dataset, problems };
53
+ }
54
+ /**
55
+ * Brings new files in, in three steps: say where they are, look at what the
56
+ * engine finds there, and choose which columns to keep, what to call them
57
+ * and what type they should be. The result is configuration to review, not
58
+ * a load: adding it to the server is a person's decision.
59
+ */
60
+ export function IngestWizard({ sourceId, value, onChange, className, ...props }) {
61
+ const pipelines = usePipelines(props.pipelines);
62
+ const [state, setState] = useState({ loading: false });
63
+ const plan = ingestPlan(value);
64
+ const set = (change) => onChange({ ...value, ...change });
65
+ const setColumn = (index, change) => set({ columns: value.columns.map((c, i) => (i === index ? { ...c, ...change } : c)) });
66
+ const inspect = async () => {
67
+ setState({ loading: true });
68
+ try {
69
+ const found = await pipelines.inspectFiles({ sourceId, format: FORMAT[value.format], location: value.location });
70
+ set({ columns: found.columns.map((c) => ({ source: c.name, sourceType: c.nativeType, include: true, target: c.name.toLowerCase().replace(/\W+/g, "_"), targetType: "" })) });
71
+ setState({ loading: false, rows: found.rowCount === undefined ? undefined : Number(found.rowCount) });
72
+ }
73
+ catch (error) {
74
+ setState({ loading: false, error: messageOf(error) });
75
+ }
76
+ };
77
+ return (_jsxs("div", { className: ["sf-connect sf-ingest", className].filter(Boolean).join(" "), children: [_jsxs("fieldset", { className: "sf-connect-group", children: [_jsx("legend", { children: "1. Where the files are" }), _jsxs("label", { children: [_jsx("span", { children: "Format" }), _jsxs("select", { className: "sf-input", value: value.format, onChange: (e) => set({ format: e.target.value, columns: [] }), children: [_jsx("option", { value: "parquet", children: "Parquet" }), _jsx("option", { value: "delta", children: "Delta Lake" }), _jsx("option", { value: "iceberg", children: "Iceberg" }), _jsx("option", { value: "csv", children: "CSV" }), _jsx("option", { value: "json", children: "JSON" })] })] }), _jsxs("label", { className: "sf-connect-path", children: [_jsx("span", { children: "Location" }), _jsx("input", { className: "sf-input", value: value.location, placeholder: "s3://acme-lake/landing/orders/*.parquet", onChange: (e) => set({ location: e.target.value, columns: [] }) })] }), _jsx("button", { type: "button", className: "sf-button", "data-variant": "primary", disabled: state.loading || !value.location.trim(), onClick: () => void inspect(), children: state.loading ? "Looking…" : "Look at the files" }), _jsx("p", { className: "sf-connect-note", children: "The server reads only the schema. The location must be one this source is allowed to reach." }), state.error && (_jsx("p", { className: "sf-search-error", role: "alert", children: state.error }))] }), value.columns.length > 0 && (_jsxs(_Fragment, { children: [_jsxs("fieldset", { className: "sf-connect-group sf-connect-tables", children: [_jsx("legend", { children: "2. Columns to keep" }), _jsxs("p", { className: "sf-connect-note", role: "status", children: ["Found ", value.columns.length, " columns", state.rows === undefined ? "" : ` and ${numberFormat().format(state.rows)} rows`, "."] }), _jsx("div", { className: "sf-object-table", tabIndex: 0, role: "region", "aria-label": "Columns found", children: _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", children: "Keep" }), _jsx("th", { scope: "col", children: "In the files" }), _jsx("th", { scope: "col", children: "Type found" }), _jsx("th", { scope: "col", children: "Name in the table" }), _jsx("th", { scope: "col", children: "Type in the table" })] }) }), _jsx("tbody", { children: value.columns.map((column, index) => (_jsxs("tr", { children: [_jsx("td", { children: _jsx("input", { type: "checkbox", checked: column.include, "aria-label": `Keep ${column.source}`, onChange: (e) => setColumn(index, { include: e.target.checked }) }) }), _jsx("th", { scope: "row", children: column.source }), _jsx("td", { className: "sf-object-type", children: column.sourceType.toLowerCase() }), _jsx("td", { children: _jsx("input", { className: "sf-input", value: column.target, disabled: !column.include, "aria-label": `Name for ${column.source}`, onChange: (e) => setColumn(index, { target: e.target.value }) }) }), _jsx("td", { children: _jsx("select", { className: "sf-input", value: column.targetType, disabled: !column.include, "aria-label": `Type for ${column.source}`, onChange: (e) => setColumn(index, { targetType: e.target.value }), children: TYPES.map((type) => (_jsx("option", { value: type, children: type ? type.toLowerCase() : "as found" }, type))) }) })] }, column.source))) })] }) })] }), _jsxs("fieldset", { className: "sf-connect-group", children: [_jsx("legend", { children: "3. What to call it" }), _jsxs("label", { children: [_jsx("span", { children: "Table for the files as they are" }), _jsx("input", { className: "sf-input", value: value.rawTable, placeholder: "orders_landing", onChange: (e) => set({ rawTable: e.target.value }) })] }), _jsxs("label", { children: [_jsx("span", { children: "Cleaned table (optional)" }), _jsx("input", { className: "sf-input", value: value.targetTable, placeholder: "orders_clean", onChange: (e) => set({ targetTable: e.target.value }) })] })] }), _jsx("section", { className: "sf-connect-plan", "aria-label": "What to add", "aria-live": "polite", children: plan.problems.length > 0 ? (_jsx("ul", { className: "sf-connect-problems", children: plan.problems.map((problem) => (_jsx("li", { children: problem }, problem))) })) : (_jsxs(_Fragment, { children: [_jsx("p", { className: "sf-object-label", children: "Add this to the source's tables in surfaces.config.ts" }), _jsx(CodeBlock, { code: plan.table, language: "ts" }), plan.dataset && (_jsxs(_Fragment, { children: [_jsx("p", { className: "sf-object-label", children: "Add this dataset to a pipeline to build the cleaned table" }), _jsx(CodeBlock, { code: plan.dataset, language: "ts" })] })), _jsx("p", { className: "sf-connect-note", children: "Nothing has been loaded. Restart the server after adding these, then run the pipeline." })] })) })] }))] }));
78
+ }
79
+ //# sourceMappingURL=IngestWizard.js.map
@@ -0,0 +1 @@
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,EAAC,IAAI,GAAG,EAC5C,IAAI,CAAC,OAAO,IAAI,CACf,8BACE,YAAG,SAAS,EAAC,iBAAiB,0EAA8D,EAC5F,KAAC,SAAS,IAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAC,IAAI,GAAG,IAC9C,CACJ,EACD,YAAG,SAAS,EAAC,iBAAiB,uGAA2F,IACxH,CACJ,GACO,IACT,CACJ,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { Pipelines } from \"@surfaces-ui/data\";\nimport { TableFormat } from \"@surfaces-ui/proto\";\nimport { useState } from \"react\";\nimport { messageOf } from \"../data/useRowWindow.js\";\nimport { CodeBlock } from \"../text/Markdown.js\";\nimport { usePipelines } from \"./PipelineView.js\";\nimport { numberFormat } from \"../locale/locale.js\";\n\nexport interface IngestColumn {\n /** The column as it is in the files. */\n source: string;\n sourceType: string;\n /** Whether to load it. */\n include: boolean;\n /** Its name in the table. */\n target: string;\n /** Its type in the table. Empty keeps the type found in the files. */\n targetType: string;\n}\n\nexport interface IngestDraft {\n format: \"parquet\" | \"delta\" | \"iceberg\" | \"csv\" | \"json\";\n /** A file, glob or table root the source may read. */\n location: string;\n /** Name for the files as a table of the source. */\n rawTable: string;\n /** Name for the cleaned table a pipeline builds. Empty leaves the pipeline step out. */\n targetTable: string;\n columns: IngestColumn[];\n}\n\nexport const emptyIngestDraft: IngestDraft = { format: \"parquet\", location: \"\", rawTable: \"\", targetTable: \"\", columns: [] };\n\nconst FORMAT: Record<IngestDraft[\"format\"], TableFormat> = {\n parquet: TableFormat.PARQUET,\n delta: TableFormat.DELTA,\n iceberg: TableFormat.ICEBERG,\n csv: TableFormat.CSV,\n json: TableFormat.JSON,\n};\nconst TYPES = [\"\", \"VARCHAR\", \"BIGINT\", \"INTEGER\", \"DOUBLE\", \"DECIMAL(18,2)\", \"BOOLEAN\", \"DATE\", \"TIMESTAMP\"];\nconst NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;\nconst quote = (name: string) => (NAME.test(name) ? name : `\"${name.replace(/\"/g, '\"\"')}\"`);\n\nexport interface IngestPlan {\n /** A `tables` entry for the source in surfaces.config.ts. */\n table: string;\n /** A pipeline dataset that selects, renames and retypes the columns. Empty when no target table is named. */\n dataset: string;\n problems: string[];\n}\n\n/**\n * Turns a mapping into what a server needs: a table entry for the files and\n * a pipeline dataset that shapes them. It writes configuration for a person\n * to review and add; it loads nothing.\n */\nexport function ingestPlan(draft: IngestDraft): IngestPlan {\n const problems: string[] = [];\n const included = draft.columns.filter((c) => c.include);\n if (!draft.location.trim()) problems.push(\"Say where the files are.\");\n if (!NAME.test(draft.rawTable)) problems.push(\"Name the table using letters, digits and underscores.\");\n if (draft.targetTable && !NAME.test(draft.targetTable)) problems.push(\"The cleaned table's name uses letters, digits and underscores.\");\n if (draft.targetTable && draft.targetTable.toLowerCase() === draft.rawTable.toLowerCase()) problems.push(\"The cleaned table needs a different name from the raw one.\");\n if (draft.columns.length > 0 && included.length === 0) problems.push(\"Keep at least one column.\");\n const targets = included.map((c) => c.target.trim().toLowerCase());\n if (included.some((c) => !NAME.test(c.target.trim()))) problems.push(\"Column names use letters, digits and underscores.\");\n else if (new Set(targets).size !== targets.length) problems.push(\"Two columns have the same name.\");\n\n const table = `{ name: ${JSON.stringify(draft.rawTable)}, format: ${JSON.stringify(draft.format)}, path: ${JSON.stringify(draft.location.trim())} },`;\n const select = included\n .map((c) => {\n const value = c.targetType ? `CAST(${quote(c.source)} AS ${c.targetType})` : quote(c.source);\n return c.target.trim() === c.source && !c.targetType ? ` ${value}` : ` ${value} AS ${quote(c.target.trim())}`;\n })\n .join(\",\\n\");\n const dataset = draft.targetTable\n ? `{\\n name: ${JSON.stringify(draft.targetTable)},\\n layer: \"silver\",\\n sql: ${JSON.stringify(`SELECT\\n${select}\\nFROM ${quote(draft.rawTable)}`)},\\n},`\n : \"\";\n return { table, dataset, problems };\n}\n\nexport interface IngestWizardProps {\n /** The source whose engine will read the files. */\n sourceId: string;\n value: IngestDraft;\n onChange(draft: IngestDraft): void;\n pipelines?: Pipelines;\n className?: string;\n}\n\n/**\n * Brings new files in, in three steps: say where they are, look at what the\n * engine finds there, and choose which columns to keep, what to call them\n * and what type they should be. The result is configuration to review, not\n * a load: adding it to the server is a person's decision.\n */\nexport function IngestWizard({ sourceId, value, onChange, className, ...props }: IngestWizardProps) {\n const pipelines = usePipelines(props.pipelines);\n const [state, setState] = useState<{ loading: boolean; error?: string; rows?: number }>({ loading: false });\n const plan = ingestPlan(value);\n const set = (change: Partial<IngestDraft>) => onChange({ ...value, ...change });\n const setColumn = (index: number, change: Partial<IngestColumn>) => set({ columns: value.columns.map((c, i) => (i === index ? { ...c, ...change } : c)) });\n\n const inspect = async () => {\n setState({ loading: true });\n try {\n const found = await pipelines.inspectFiles({ sourceId, format: FORMAT[value.format], location: value.location });\n set({ columns: found.columns.map((c) => ({ source: c.name, sourceType: c.nativeType, include: true, target: c.name.toLowerCase().replace(/\\W+/g, \"_\"), targetType: \"\" })) });\n setState({ loading: false, rows: found.rowCount === undefined ? undefined : Number(found.rowCount) });\n } catch (error) {\n setState({ loading: false, error: messageOf(error) });\n }\n };\n\n return (\n <div className={[\"sf-connect sf-ingest\", className].filter(Boolean).join(\" \")}>\n <fieldset className=\"sf-connect-group\">\n <legend>1. Where the files are</legend>\n <label>\n <span>Format</span>\n <select className=\"sf-input\" value={value.format} onChange={(e) => set({ format: e.target.value as IngestDraft[\"format\"], columns: [] })}>\n <option value=\"parquet\">Parquet</option>\n <option value=\"delta\">Delta Lake</option>\n <option value=\"iceberg\">Iceberg</option>\n <option value=\"csv\">CSV</option>\n <option value=\"json\">JSON</option>\n </select>\n </label>\n <label className=\"sf-connect-path\">\n <span>Location</span>\n <input className=\"sf-input\" value={value.location} placeholder=\"s3://acme-lake/landing/orders/*.parquet\" onChange={(e) => set({ location: e.target.value, columns: [] })} />\n </label>\n <button type=\"button\" className=\"sf-button\" data-variant=\"primary\" disabled={state.loading || !value.location.trim()} onClick={() => void inspect()}>\n {state.loading ? \"Looking…\" : \"Look at the files\"}\n </button>\n <p className=\"sf-connect-note\">The server reads only the schema. The location must be one this source is allowed to reach.</p>\n {state.error && (\n <p className=\"sf-search-error\" role=\"alert\">\n {state.error}\n </p>\n )}\n </fieldset>\n\n {value.columns.length > 0 && (\n <>\n <fieldset className=\"sf-connect-group sf-connect-tables\">\n <legend>2. Columns to keep</legend>\n <p className=\"sf-connect-note\" role=\"status\">\n Found {value.columns.length} columns{state.rows === undefined ? \"\" : ` and ${numberFormat().format(state.rows)} rows`}.\n </p>\n <div className=\"sf-object-table\" tabIndex={0} role=\"region\" aria-label=\"Columns found\">\n <table>\n <thead>\n <tr>\n <th scope=\"col\">Keep</th>\n <th scope=\"col\">In the files</th>\n <th scope=\"col\">Type found</th>\n <th scope=\"col\">Name in the table</th>\n <th scope=\"col\">Type in the table</th>\n </tr>\n </thead>\n <tbody>\n {value.columns.map((column, index) => (\n <tr key={column.source}>\n <td>\n <input type=\"checkbox\" checked={column.include} aria-label={`Keep ${column.source}`} onChange={(e) => setColumn(index, { include: e.target.checked })} />\n </td>\n <th scope=\"row\">{column.source}</th>\n <td className=\"sf-object-type\">{column.sourceType.toLowerCase()}</td>\n <td>\n <input className=\"sf-input\" value={column.target} disabled={!column.include} aria-label={`Name for ${column.source}`} onChange={(e) => setColumn(index, { target: e.target.value })} />\n </td>\n <td>\n <select className=\"sf-input\" value={column.targetType} disabled={!column.include} aria-label={`Type for ${column.source}`} onChange={(e) => setColumn(index, { targetType: e.target.value })}>\n {TYPES.map((type) => (\n <option key={type} value={type}>\n {type ? type.toLowerCase() : \"as found\"}\n </option>\n ))}\n </select>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </fieldset>\n\n <fieldset className=\"sf-connect-group\">\n <legend>3. What to call it</legend>\n <label>\n <span>Table for the files as they are</span>\n <input className=\"sf-input\" value={value.rawTable} placeholder=\"orders_landing\" onChange={(e) => set({ rawTable: e.target.value })} />\n </label>\n <label>\n <span>Cleaned table (optional)</span>\n <input className=\"sf-input\" value={value.targetTable} placeholder=\"orders_clean\" onChange={(e) => set({ targetTable: e.target.value })} />\n </label>\n </fieldset>\n\n <section className=\"sf-connect-plan\" aria-label=\"What to add\" aria-live=\"polite\">\n {plan.problems.length > 0 ? (\n <ul className=\"sf-connect-problems\">\n {plan.problems.map((problem) => (\n <li key={problem}>{problem}</li>\n ))}\n </ul>\n ) : (\n <>\n <p className=\"sf-object-label\">Add this to the source&apos;s tables in surfaces.config.ts</p>\n <CodeBlock code={plan.table} language=\"ts\" />\n {plan.dataset && (\n <>\n <p className=\"sf-object-label\">Add this dataset to a pipeline to build the cleaned table</p>\n <CodeBlock code={plan.dataset} language=\"ts\" />\n </>\n )}\n <p className=\"sf-connect-note\">Nothing has been loaded. Restart the server after adding these, then run the pipeline.</p>\n </>\n )}\n </section>\n </>\n )}\n </div>\n );\n}\n"]}
@@ -0,0 +1,171 @@
1
+ export type PipelineNodeKind = "source" | "table" | "view" | "streamingTable" | "materializedView" | "temporaryView" | "sink";
2
+ export type PipelineStatus = "idle" | "starting" | "running" | "completed" | "failed" | "cancelled" | "skipped";
3
+ /** A dataset, source or sink in a pipeline. */
4
+ export interface PipelineNode {
5
+ id: string;
6
+ name: string;
7
+ kind: PipelineNodeKind;
8
+ status?: PipelineStatus;
9
+ /** Medallion layer, when the pipeline uses one. */
10
+ layer?: "bronze" | "silver" | "gold";
11
+ rowsWritten?: number;
12
+ /** Records that failed a data quality expectation in the latest run. */
13
+ expectationsFailed?: number;
14
+ /** Checks over the whole dataset (unique, not empty, found in, one of, row count) that failed in the latest run. */
15
+ checksFailed?: number;
16
+ /** Checks of severity warn that found rows. */
17
+ checksWarned?: number;
18
+ }
19
+ /** A flow: data moving from one node to another. */
20
+ export interface PipelineEdge {
21
+ from: string;
22
+ to: string;
23
+ flowName?: string;
24
+ mode?: "streaming" | "batch";
25
+ }
26
+ export interface PipelineLayout {
27
+ positions: Record<string, {
28
+ x: number;
29
+ y: number;
30
+ column: number;
31
+ }>;
32
+ width: number;
33
+ height: number;
34
+ }
35
+ /**
36
+ * Places nodes in columns from left to right: a node sits one column after
37
+ * the furthest thing that feeds it. The graph itself comes from the engine;
38
+ * this only decides where to draw it. A cycle (which a valid pipeline cannot
39
+ * have) does not hang it.
40
+ */
41
+ export declare function layoutPipeline(nodes: PipelineNode[], edges: PipelineEdge[]): PipelineLayout;
42
+ /** Everything upstream and downstream of a node, including the node. */
43
+ export declare function lineageOf(id: string, edges: PipelineEdge[]): Set<string>;
44
+ export interface PipelineGraphProps {
45
+ nodes: PipelineNode[];
46
+ edges: PipelineEdge[];
47
+ /** The selected node. Its upstream and downstream are highlighted. */
48
+ selected?: string;
49
+ onSelect?(node: PipelineNode): void;
50
+ /** Largest height of the canvas in px; a smaller pipeline takes less. Defaults to 360. */
51
+ height?: number;
52
+ /** Accessible name. Defaults to "Pipeline". */
53
+ label?: string;
54
+ className?: string;
55
+ }
56
+ /**
57
+ * A pipeline as a graph: sources, tables, views and sinks from left to
58
+ * right, joined by the flows between them, each with its latest status.
59
+ * Selecting a node highlights what feeds it and what it feeds. Dashed lines
60
+ * are streaming flows.
61
+ */
62
+ export declare function PipelineGraph(props: PipelineGraphProps): import("react").JSX.Element;
63
+ /** One run (update) of a pipeline. */
64
+ export interface PipelineRun {
65
+ id: string;
66
+ state: PipelineStatus;
67
+ /** ISO 8601. */
68
+ startTime: string;
69
+ endTime?: string;
70
+ /** What started it, e.g. "schedule" or "manual". */
71
+ trigger?: string;
72
+ /** "default" processes new data; "refresh" recomputes; "fullRefresh" clears data and checkpoints first. */
73
+ refreshKind?: "default" | "refresh" | "fullRefresh";
74
+ datasets?: string[];
75
+ errorMessage?: string;
76
+ }
77
+ /** A duration in words, e.g. "1 min 5 s". */
78
+ export declare function durationText(ms: number): string;
79
+ export interface RunHistoryProps {
80
+ runs: PipelineRun[];
81
+ selected?: string;
82
+ onSelect?(run: PipelineRun): void;
83
+ className?: string;
84
+ }
85
+ /** The runs of a pipeline, newest first: how each ended, how long it took, what it refreshed and why it failed. */
86
+ export declare function RunHistory({ runs, selected, onSelect, className }: RunHistoryProps): import("react").JSX.Element;
87
+ /** One data quality rule and how the latest run did against it. */
88
+ export interface Expectation {
89
+ name: string;
90
+ dataset: string;
91
+ /** The rule, e.g. `amount >= 0`. */
92
+ constraint: string;
93
+ /** What happens to a failing record: kept with a warning, dropped, or the run fails. */
94
+ action: "warn" | "drop" | "fail";
95
+ passedRecords: number;
96
+ failedRecords: number;
97
+ }
98
+ export interface ExpectationsPanelProps {
99
+ expectations: Expectation[];
100
+ /** Called to look at the records that failed a rule, typically by opening a query. */
101
+ onOpenFailing?(expectation: Expectation): void;
102
+ className?: string;
103
+ }
104
+ /** Data quality rules for a pipeline, worst first, with how many records passed and failed. The engine does the checking. */
105
+ export declare function ExpectationsPanel({ expectations, onOpenFailing, className }: ExpectationsPanelProps): import("react").JSX.Element;
106
+ /** One check over a built dataset and how the latest run did against it. */
107
+ export interface CheckOutcome {
108
+ name: string;
109
+ /** The check in words: "order_id never repeats". */
110
+ description: string;
111
+ /** Whether a failure stops what reads the dataset, or only warns. */
112
+ severity: "fail" | "warn";
113
+ /** Rows that break it (for a row count, 1 when it is out of bounds). Absent when the dataset has not been built since the check was added. */
114
+ failedRecords?: number;
115
+ /** What the engine reported, in a sentence. */
116
+ summary?: string;
117
+ /** Whether it was added for the dataset's key. */
118
+ fromKey?: boolean;
119
+ /** False when there is no query for the rows that break it, so none is offered. */
120
+ canOpenFailing?: boolean;
121
+ }
122
+ export interface ChecksPanelProps {
123
+ checks: CheckOutcome[];
124
+ /** Called to look at what breaks a check. Nothing runs unless the host runs it. */
125
+ onOpenFailing?(check: CheckOutcome): void;
126
+ className?: string;
127
+ }
128
+ /** A dataset's checks, failures first, with what the engine counted. Counts only: no row is read here. */
129
+ export declare function ChecksPanel({ checks, onOpenFailing, className }: ChecksPanelProps): import("react").JSX.Element;
130
+ /** One difference between the schema that arrived and the one expected. */
131
+ export interface SchemaChange {
132
+ column: string;
133
+ change: "added" | "removed" | "typeChanged";
134
+ before?: string;
135
+ after?: string;
136
+ }
137
+ export interface SchemaDiffProps {
138
+ changes: SchemaChange[];
139
+ /** Records whose unexpected fields were set aside instead of being loaded. */
140
+ rescuedCount?: number;
141
+ /** How the pipeline treats new columns, e.g. "addNewColumns", "rescue", "failOnNewColumns". */
142
+ mode?: string;
143
+ className?: string;
144
+ }
145
+ /** How incoming data differs from the table it is loaded into: new, missing and retyped columns. */
146
+ export declare function SchemaDiff({ changes, rescuedCount, mode, className }: SchemaDiffProps): import("react").JSX.Element;
147
+ /** One progress report from a streaming query. Field names follow Spark's StreamingQueryProgress. */
148
+ export interface StreamProgress {
149
+ /** ISO 8601. */
150
+ timestamp: string;
151
+ numInputRows: number;
152
+ inputRowsPerSecond: number;
153
+ processedRowsPerSecond: number;
154
+ /** Time the whole micro-batch took (durationMs.triggerExecution). */
155
+ batchDurationMs: number;
156
+ /** Rows held in state (stateOperators.numRowsTotal), when the query keeps state. */
157
+ stateRows?: number;
158
+ }
159
+ /** Points for a sparkline over a 100 by 28 box. */
160
+ export declare function sparkline(values: number[]): string;
161
+ export interface StreamMetricsProps {
162
+ /** Progress reports, oldest first. The numbers are plotted as reported; nothing is derived here. */
163
+ progress: StreamProgress[];
164
+ className?: string;
165
+ }
166
+ /**
167
+ * How a streaming query is keeping up: input and processing rates, batch
168
+ * size and duration, and state size, each with its latest value and recent
169
+ * trend. A processing rate below the input rate means it is falling behind.
170
+ */
171
+ export declare function StreamMetrics({ progress, className }: StreamMetricsProps): import("react").JSX.Element;