@malloy-publisher/sdk 0.0.382-dev → 0.2.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.
- package/README.md +115 -95
- package/TREE_SHAKING.md +16 -11
- package/bunfig.toml +7 -0
- package/dist/ServerProvider-CTopDUWW.cjs.js +1 -0
- package/dist/ServerProvider-DUFPY6Rv.es.js +4072 -0
- package/dist/client/api.d.ts +3718 -1507
- package/dist/client/configuration.d.ts +1 -1
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.es.js +85 -59
- package/dist/components/Connections/EditConnectionDialog.d.ts +2 -1
- package/dist/components/Connections/common.d.ts +8 -2
- package/dist/components/Dashboard/Dashboard.d.ts +49 -0
- package/dist/components/Dashboard/DashboardTile.d.ts +48 -0
- package/dist/components/Dashboard/index.d.ts +2 -0
- package/dist/components/DataAppViewer/DataAppViewer.d.ts +23 -0
- package/dist/components/DataAppViewer/index.d.ts +1 -0
- package/dist/components/Environment/Environment.d.ts +6 -0
- package/dist/components/Environment/index.d.ts +2 -0
- package/dist/components/Home/AddEnvironmentDialog.d.ts +1 -0
- package/dist/components/Home/DeleteEnvironmentDialog.d.ts +5 -0
- package/dist/components/Home/EditEnvironmentDialog.d.ts +7 -0
- package/dist/components/Home/Home.d.ts +2 -2
- package/dist/components/Materializations/CreateEnvMaterializationDialog.d.ts +14 -0
- package/dist/components/Materializations/CreateMaterializationDialog.d.ts +10 -0
- package/dist/components/Materializations/DeleteMaterializationDialog.d.ts +7 -0
- package/dist/components/Materializations/EnvironmentMaterializations.d.ts +7 -0
- package/dist/components/Materializations/ManifestView.d.ts +13 -0
- package/dist/components/Materializations/MaterializationDetailDialog.d.ts +9 -0
- package/dist/components/Materializations/MaterializationRunsList.d.ts +15 -0
- package/dist/components/Materializations/Materializations.d.ts +7 -0
- package/dist/components/Materializations/ScheduleCard.d.ts +20 -0
- package/dist/components/Materializations/SectionLabel.d.ts +10 -0
- package/dist/components/Materializations/SetScheduleDialog.d.ts +11 -0
- package/dist/components/Materializations/TriggerChip.d.ts +10 -0
- package/dist/components/Materializations/cron.d.ts +23 -0
- package/dist/components/Materializations/index.d.ts +2 -0
- package/dist/components/Materializations/utils.d.ts +46 -0
- package/dist/components/Notebook/Notebook.d.ts +47 -4
- package/dist/components/Notebook/NotebookCell.d.ts +37 -1
- package/dist/components/Notebook/runPlan.d.ts +29 -0
- package/dist/components/Notebook/types.d.ts +10 -0
- package/dist/components/Package/ContentTypeIcon.d.ts +31 -0
- package/dist/components/Package/Package.d.ts +1 -4
- package/dist/components/RenderedResult/RenderedResult.d.ts +7 -1
- package/dist/components/RenderedResult/ResultContainer.d.ts +5 -1
- package/dist/components/RenderedResult/renderLogs.d.ts +6 -0
- package/dist/components/ResultsDialog.d.ts +6 -1
- package/dist/components/ServerProvider.d.ts +28 -4
- package/dist/components/click_helper.d.ts +10 -1
- package/dist/components/drill/index.d.ts +3 -0
- package/dist/components/drill/markDrillableCells.d.ts +55 -0
- package/dist/components/drill/resolveDrill.d.ts +139 -0
- package/dist/components/drill/useDrill.d.ts +63 -0
- package/dist/components/given/GivenInput.d.ts +52 -0
- package/dist/components/given/GivensPanel.d.ts +47 -0
- package/dist/components/given/filterValue.d.ts +97 -0
- package/dist/components/given/index.d.ts +2 -0
- package/dist/components/given/paramCodec.d.ts +60 -0
- package/dist/components/given/utils.d.ts +17 -0
- package/dist/components/highlighter.d.ts +6 -1
- package/dist/components/index.d.ts +7 -2
- package/dist/components/styles.d.ts +47 -0
- package/dist/constants/docLinks.d.ts +12 -0
- package/dist/{core-YNpOLuB1.cjs.js → core-hLahnv0W.cjs.js} +1 -1
- package/dist/{core-CjeTkq8O.es.js → core-lb28vQkR.es.js} +1 -1
- package/dist/github-dark-BKL9xNgN.cjs.js +1 -0
- package/dist/github-dark-DenFmJkN.es.js +4 -0
- package/dist/hooks/givenValue.d.ts +10 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/useDimensionFiltersFromSpec.d.ts +3 -3
- package/dist/hooks/useDimensionFiltersQuery.d.ts +3 -3
- package/dist/hooks/useDimensionalFilterRangeData.d.ts +4 -4
- package/dist/hooks/useGivensState.d.ts +64 -0
- package/dist/hooks/useModelGivens.d.ts +10 -0
- package/dist/hooks/useSuggestOptions.d.ts +78 -0
- package/dist/index-DvEanVgc.cjs.js +339 -0
- package/dist/{index-DRDu9kIV.es.js → index-txw04ZbN.es.js} +40531 -27964
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.es.js +79 -48
- package/dist/malloy-explorer.css +12 -1
- package/dist/sdk.css +1 -1
- package/dist/theme/ThemeContext.d.ts +45 -0
- package/dist/theme/buildMalloyExplicitTheme.d.ts +34 -0
- package/dist/theme/buildTableCssVars.d.ts +25 -0
- package/dist/theme/buildVegaThemeOverride.d.ts +16 -0
- package/dist/theme/defaults.d.ts +7 -0
- package/dist/theme/index.d.ts +8 -0
- package/dist/theme/keys.d.ts +20 -0
- package/dist/theme/readChartAnnotations.d.ts +23 -0
- package/dist/theme/resolveTheme.d.ts +22 -0
- package/dist/theme/types.d.ts +70 -0
- package/dist/utils/dataAppEmbed.d.ts +44 -0
- package/dist/utils/formatting.d.ts +1 -1
- package/dist/utils/malloyString.d.ts +7 -0
- package/dist/utils/parsing.d.ts +2 -2
- package/dist/utils/queryClient.d.ts +5 -0
- package/package.json +19 -8
- package/src/client-entry.ts +3 -0
- package/src/components/AnalyzePackageButton.tsx +9 -3
- package/src/components/ApiErrorDisplay.tsx +3 -0
- package/src/components/Connections/AddConnectionDialog.tsx +30 -2
- package/src/components/Connections/DeleteConnectionDialog.tsx +14 -3
- package/src/components/Connections/EditConnectionDialog.tsx +33 -4
- package/src/components/Connections/common.ts +64 -1
- package/src/components/DOMElement/DOMElement.tsx +3 -0
- package/src/components/DOMElement/index.ts +3 -0
- package/src/components/Dashboard/Dashboard.tsx +398 -0
- package/src/components/Dashboard/DashboardTile.tsx +153 -0
- package/src/components/Dashboard/index.ts +5 -0
- package/src/components/DataAppViewer/DataAppViewer.tsx +214 -0
- package/src/components/DataAppViewer/index.ts +4 -0
- package/src/components/{Project → Environment}/About.tsx +11 -4
- package/src/components/Environment/AddPackageDialog.tsx +202 -0
- package/src/components/{Project → Environment}/ConnectionExplorer.tsx +17 -14
- package/src/components/Environment/Connections.tsx +391 -0
- package/src/components/{Project → Environment}/DeletePackageDialog.tsx +8 -4
- package/src/components/{Project → Environment}/EditPackageDialog.tsx +21 -13
- package/src/components/Environment/Environment.tsx +89 -0
- package/src/components/Environment/Packages.tsx +206 -0
- package/src/components/Environment/index.ts +5 -0
- package/src/components/Home/{AddProjectDialog.tsx → AddEnvironmentDialog.tsx} +25 -19
- package/src/components/Home/{DeleteProjectDialog.tsx → DeleteEnvironmentDialog.tsx} +20 -15
- package/src/components/Home/{EditProjectDialog.tsx → EditEnvironmentDialog.tsx} +35 -28
- package/src/components/Home/Home.tsx +386 -408
- package/src/components/Home/index.ts +3 -0
- package/src/components/Loading.tsx +3 -0
- package/src/components/Materializations/CreateEnvMaterializationDialog.tsx +179 -0
- package/src/components/Materializations/CreateMaterializationDialog.tsx +112 -0
- package/src/components/Materializations/DeleteMaterializationDialog.tsx +109 -0
- package/src/components/Materializations/EnvironmentMaterializations.tsx +267 -0
- package/src/components/Materializations/ManifestView.tsx +87 -0
- package/src/components/Materializations/MaterializationDetailDialog.tsx +259 -0
- package/src/components/Materializations/MaterializationRunsList.tsx +256 -0
- package/src/components/Materializations/Materializations.tsx +355 -0
- package/src/components/Materializations/ScheduleCard.tsx +231 -0
- package/src/components/Materializations/SectionLabel.tsx +30 -0
- package/src/components/Materializations/SetScheduleDialog.tsx +162 -0
- package/src/components/Materializations/TriggerChip.tsx +44 -0
- package/src/components/Materializations/cron.ts +124 -0
- package/src/components/Materializations/index.ts +5 -0
- package/src/components/Materializations/utils.ts +145 -0
- package/src/components/Model/Model.tsx +44 -2
- package/src/components/Model/ModelCell.tsx +14 -5
- package/src/components/Model/ModelExplorer.tsx +3 -0
- package/src/components/Model/ModelExplorerDialog.tsx +4 -1
- package/src/components/Model/SourcesExplorer.tsx +9 -6
- package/src/components/Model/index.ts +3 -0
- package/src/components/Model/useModelData.ts +6 -3
- package/src/components/Notebook/Notebook.tsx +475 -339
- package/src/components/Notebook/NotebookCell.tsx +264 -25
- package/src/components/Notebook/index.ts +3 -0
- package/src/components/Notebook/runPlan.spec.ts +155 -0
- package/src/components/Notebook/runPlan.ts +67 -0
- package/src/components/Notebook/types.ts +14 -0
- package/src/components/Package/ContentTypeIcon.spec.ts +91 -0
- package/src/components/Package/ContentTypeIcon.tsx +177 -0
- package/src/components/Package/FileTreeView.tsx +3 -0
- package/src/components/Package/Models.tsx +7 -4
- package/src/components/Package/Package.tsx +666 -59
- package/src/components/Package/index.ts +3 -0
- package/src/components/QueryResult/QueryResult.tsx +17 -8
- package/src/components/QueryResult/index.ts +3 -0
- package/src/components/RenderedResult/RenderedResult.tsx +685 -67
- package/src/components/RenderedResult/ResultContainer.tsx +71 -2
- package/src/components/RenderedResult/index.ts +3 -0
- package/src/components/RenderedResult/renderLogs.spec.ts +58 -0
- package/src/components/RenderedResult/renderLogs.ts +43 -0
- package/src/components/ResultsDialog.tsx +13 -1
- package/src/components/ServerProvider.tsx +175 -51
- package/src/components/Workbook/BrowserWorkbookStorage.ts +3 -0
- package/src/components/Workbook/EditableMalloyCell.tsx +3 -0
- package/src/components/Workbook/ModelPicker.tsx +7 -4
- package/src/components/Workbook/MutableCell.tsx +10 -5
- package/src/components/Workbook/Workbook.tsx +8 -5
- package/src/components/Workbook/WorkbookList.tsx +3 -0
- package/src/components/Workbook/WorkbookManager.ts +3 -0
- package/src/components/Workbook/WorkbookStorage.ts +3 -0
- package/src/components/Workbook/WorkbookStorageProvider.tsx +3 -0
- package/src/components/Workbook/index.ts +3 -0
- package/src/components/click_helper.ts +17 -1
- package/src/components/drill/index.ts +28 -0
- package/src/components/drill/markDrillableCells.dom.spec.ts +313 -0
- package/src/components/drill/markDrillableCells.spec.ts +109 -0
- package/src/components/drill/markDrillableCells.ts +314 -0
- package/src/components/drill/resolveDrill.spec.ts +449 -0
- package/src/components/drill/resolveDrill.ts +375 -0
- package/src/components/drill/useDrill.tsx +203 -0
- package/src/components/filter/DimensionFilter.tsx +3 -0
- package/src/components/filter/index.ts +3 -0
- package/src/components/filter/utils.ts +16 -5
- package/src/components/given/GivenInput.spec.tsx +689 -0
- package/src/components/given/GivenInput.tsx +801 -0
- package/src/components/given/GivensPanel.spec.tsx +175 -0
- package/src/components/given/GivensPanel.tsx +195 -0
- package/src/components/given/filterValue.spec.ts +364 -0
- package/src/components/given/filterValue.ts +207 -0
- package/src/components/given/index.ts +9 -0
- package/src/components/given/paramCodec.spec.ts +857 -0
- package/src/components/given/paramCodec.ts +483 -0
- package/src/components/given/utils.spec.ts +60 -0
- package/src/components/given/utils.ts +79 -0
- package/src/components/highlighter.ts +22 -5
- package/src/components/index.ts +10 -2
- package/src/components/styles.ts +82 -33
- package/src/constants/docLinks.spec.ts +54 -0
- package/src/constants/docLinks.ts +46 -0
- package/src/hooks/givenValue.ts +13 -0
- package/src/hooks/index.ts +13 -0
- package/src/hooks/useDimensionFilters.ts +4 -7
- package/src/hooks/useDimensionFiltersFromSpec.ts +8 -5
- package/src/hooks/useDimensionFiltersQuery.ts +10 -13
- package/src/hooks/useDimensionalFilterRangeData.ts +11 -14
- package/src/hooks/useGivensState.spec.ts +449 -0
- package/src/hooks/useGivensState.ts +340 -0
- package/src/hooks/useModelGivens.ts +29 -0
- package/src/hooks/useQueryWithApiError.ts +3 -0
- package/src/hooks/useRawQueryData.ts +6 -3
- package/src/hooks/useSuggestOptions.spec.ts +112 -0
- package/src/hooks/useSuggestOptions.ts +263 -0
- package/src/index.ts +10 -1
- package/src/react-app-env.d.ts +3 -0
- package/src/theme/ThemeContext.tsx +86 -0
- package/src/theme/buildMalloyExplicitTheme.ts +61 -0
- package/src/theme/buildTableCssVars.spec.ts +67 -0
- package/src/theme/buildTableCssVars.ts +67 -0
- package/src/theme/buildVegaThemeOverride.spec.ts +56 -0
- package/src/theme/buildVegaThemeOverride.ts +47 -0
- package/src/theme/defaults.ts +78 -0
- package/src/theme/index.ts +11 -0
- package/src/theme/keys.ts +32 -0
- package/src/theme/readChartAnnotations.spec.ts +58 -0
- package/src/theme/readChartAnnotations.ts +69 -0
- package/src/theme/resolveTheme.spec.ts +160 -0
- package/src/theme/resolveTheme.ts +121 -0
- package/src/theme/types.ts +79 -0
- package/src/utils/dataAppEmbed.spec.ts +63 -0
- package/src/utils/dataAppEmbed.ts +84 -0
- package/src/utils/formatting.spec.ts +25 -21
- package/src/utils/formatting.ts +11 -7
- package/src/utils/malloyString.spec.ts +24 -0
- package/src/utils/malloyString.ts +12 -0
- package/src/utils/parsing.spec.ts +26 -19
- package/src/utils/parsing.ts +11 -6
- package/src/utils/queryClient.ts +17 -0
- package/test/README.md +141 -0
- package/test/setup.ts +29 -0
- package/tsconfig.json +12 -1
- package/tsconfig.spec.json +22 -0
- package/vite.config.ts +3 -0
- package/dist/ServerProvider-lOQXDlqB.cjs.js +0 -1
- package/dist/ServerProvider-on-8FH5Z.es.js +0 -3060
- package/dist/components/Home/AddProjectDialog.d.ts +0 -1
- package/dist/components/Home/DeleteProjectDialog.d.ts +0 -5
- package/dist/components/Home/EditProjectDialog.d.ts +0 -7
- package/dist/components/Package/Config.d.ts +0 -5
- package/dist/components/Package/Databases.d.ts +0 -5
- package/dist/components/Package/Notebooks.d.ts +0 -6
- package/dist/components/Project/Project.d.ts +0 -6
- package/dist/components/Project/index.d.ts +0 -2
- package/dist/index-BOLBP6_i.cjs.js +0 -233
- package/src/components/Package/Config.tsx +0 -97
- package/src/components/Package/Connections.tsx +0 -373
- package/src/components/Package/Databases.tsx +0 -228
- package/src/components/Package/Notebooks.tsx +0 -77
- package/src/components/Project/AddPackageDialog.tsx +0 -159
- package/src/components/Project/Packages.tsx +0 -191
- package/src/components/Project/Project.tsx +0 -52
- package/src/components/Project/index.ts +0 -2
- /package/dist/components/{Project → Environment}/About.d.ts +0 -0
- /package/dist/components/{Project → Environment}/AddPackageDialog.d.ts +0 -0
- /package/dist/components/{Project → Environment}/ConnectionExplorer.d.ts +0 -0
- /package/dist/components/{Package → Environment}/Connections.d.ts +0 -0
- /package/dist/components/{Project → Environment}/DeletePackageDialog.d.ts +0 -0
- /package/dist/components/{Project → Environment}/EditPackageDialog.d.ts +0 -0
- /package/dist/components/{Project → Environment}/Packages.d.ts +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Tag } from '@malloydata/malloy-tag';
|
|
2
|
+
import { Theme } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Read a `theme.*` annotation block out of a parsed Malloy {@link Tag}
|
|
5
|
+
* and turn it into a partial {@link Theme} suitable for the cascade.
|
|
6
|
+
* Returns `undefined` if the tag has no `theme` namespace.
|
|
7
|
+
*
|
|
8
|
+
* Recognised annotation forms (all optional, all sit under `theme`):
|
|
9
|
+
*
|
|
10
|
+
* # theme.palette.series = ["#ff0080", "#ff6b00"]
|
|
11
|
+
* # theme.palette.background.light = "#fff"
|
|
12
|
+
* # theme.palette.background.dark = "#000"
|
|
13
|
+
* # theme.palette.tableHeader.light = "#666"
|
|
14
|
+
* # theme.palette.tableHeader.dark = "#aaa"
|
|
15
|
+
* # theme.font.family = "Roboto, sans-serif"
|
|
16
|
+
* # theme.font.size = 13
|
|
17
|
+
*
|
|
18
|
+
* Series and font are shared across modes; only the seven
|
|
19
|
+
* {@link PER_MODE_COLOR_KEYS} accept light/dark variants. Annotations
|
|
20
|
+
* with the wrong type are silently ignored. The goal is "worst-case a
|
|
21
|
+
* typo means no styling", not "a typo crashes the renderer."
|
|
22
|
+
*/
|
|
23
|
+
export declare function readChartAnnotations(tag: Tag | undefined): Theme | undefined;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ResolvedTheme, Theme, ThemeMode } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Collapse the layered theme cascade into a {@link ResolvedTheme} that
|
|
4
|
+
* downstream code can consume without null-checks or mode branches.
|
|
5
|
+
* Layer order is low → high precedence; later layers overwrite earlier
|
|
6
|
+
* ones for the keys they set. Per-mode colour objects merge per-mode
|
|
7
|
+
* (a layer that sets only `palette.tile.dark` doesn't clobber the
|
|
8
|
+
* instance-level `palette.tile.light`).
|
|
9
|
+
*
|
|
10
|
+
* The derived fields on ResolvedTheme (border, pinnedBorder,
|
|
11
|
+
* valueColor, foreground, axisFaint) are computed once here from the
|
|
12
|
+
* active mode so the three builders that consume the theme stop
|
|
13
|
+
* recomputing them with duplicated hex literals.
|
|
14
|
+
*/
|
|
15
|
+
export declare function resolveTheme(layers: Array<Theme | undefined>, mode: ThemeMode): ResolvedTheme;
|
|
16
|
+
/**
|
|
17
|
+
* Pick the active mode for a viewer given the operator's `defaultMode`,
|
|
18
|
+
* any persisted viewer choice, and a snapshot of the OS dark-mode
|
|
19
|
+
* preference. "auto" is resolved here; callers see only "light" or
|
|
20
|
+
* "dark".
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveMode(defaultMode: Theme["defaultMode"] | undefined, userChoice: ThemeMode | "auto" | undefined, prefersDark: boolean): ThemeMode;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Theme } from '../client';
|
|
2
|
+
export type { Theme };
|
|
3
|
+
export type ThemeMode = "light" | "dark";
|
|
4
|
+
/**
|
|
5
|
+
* A Theme with every field downstream consumers need actually filled in.
|
|
6
|
+
* Produced by `resolveTheme(layers, mode)`, which flattens the cascade
|
|
7
|
+
* and the per-mode colour split into a single mode-agnostic shape — so
|
|
8
|
+
* `buildTableCssVars`, `buildVegaThemeOverride`, and
|
|
9
|
+
* `buildMalloyExplicitTheme` never have to branch on mode themselves.
|
|
10
|
+
*
|
|
11
|
+
* The seven `palette.*` colour keys are stored per-mode on the raw Theme
|
|
12
|
+
* (one of light/dark per field) and collapse to the active mode here.
|
|
13
|
+
* The five "derived" fields (border, pinnedBorder, valueColor,
|
|
14
|
+
* foreground, axisFaint) are computed once from the resolved mode so
|
|
15
|
+
* the same hex literal isn't repeated across three builders.
|
|
16
|
+
*/
|
|
17
|
+
export interface ResolvedTheme {
|
|
18
|
+
mode: ThemeMode;
|
|
19
|
+
series: string[];
|
|
20
|
+
font: {
|
|
21
|
+
family: string;
|
|
22
|
+
size: number;
|
|
23
|
+
};
|
|
24
|
+
background: string;
|
|
25
|
+
tableHeader: string;
|
|
26
|
+
tableHeaderBackground: string;
|
|
27
|
+
tableBody: string;
|
|
28
|
+
tile: string;
|
|
29
|
+
tileTitle: string;
|
|
30
|
+
/**
|
|
31
|
+
* Saturated end of the gradient used by sequential color scales
|
|
32
|
+
* (choropleth maps, heatmaps). The renderer pairs it with a
|
|
33
|
+
* near-neutral low-end so the operator only picks the brand end.
|
|
34
|
+
*/
|
|
35
|
+
mapColor: string;
|
|
36
|
+
border: string;
|
|
37
|
+
pinnedBorder: string;
|
|
38
|
+
valueColor: string;
|
|
39
|
+
foreground: string;
|
|
40
|
+
axisFaint: string;
|
|
41
|
+
/**
|
|
42
|
+
* Background for the renderer's HTML chrome (the area between
|
|
43
|
+
* dashboard tiles). Mode-keyed and intentionally NOT
|
|
44
|
+
* operator-customizable — when an operator picks a bold accent
|
|
45
|
+
* for `palette.background` (the chart canvas), the surrounding
|
|
46
|
+
* panel should stay neutral so the accent reads cleanly. In dark
|
|
47
|
+
* mode it paints slate so the panel doesn't sit as a stark white
|
|
48
|
+
* box on the dark page chrome.
|
|
49
|
+
*/
|
|
50
|
+
dashboardRoot: string;
|
|
51
|
+
/**
|
|
52
|
+
* Colour a `# drill` cell takes on hover, when it reads as a link. A link
|
|
53
|
+
* blue rather than anything from `palette.series`, deliberately: the
|
|
54
|
+
* affordance has to stay legible as a link against whatever the operator
|
|
55
|
+
* picked for the data, and a drillable bar or cell should not look like it
|
|
56
|
+
* belongs to a series. Mode-keyed and not operator-customizable, like
|
|
57
|
+
* `dashboardRoot`.
|
|
58
|
+
*/
|
|
59
|
+
drillLink: string;
|
|
60
|
+
/**
|
|
61
|
+
* Background for the renderer's table interior. Follows the
|
|
62
|
+
* operator's `palette.background` (the chart canvas colour) so
|
|
63
|
+
* tables and charts share a single "viz surface" colour. In dark
|
|
64
|
+
* mode this also keeps the (light-slate) header/body text from
|
|
65
|
+
* painting unreadable light-on-white against the renderer's
|
|
66
|
+
* hardcoded default. Distinct from `dashboardRoot`, which is the
|
|
67
|
+
* panel BETWEEN tiles and stays mode-keyed / neutral.
|
|
68
|
+
*/
|
|
69
|
+
tableBackground: string;
|
|
70
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* postMessage `type` an embedded data app emits to its host frame as its
|
|
3
|
+
* content height changes, so the host can resize the iframe to avoid nested
|
|
4
|
+
* scrollbars. Payload shape is {@link PublisherResizeMessage}.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PUBLISHER_RESIZE_MESSAGE_TYPE = "publisher:resize";
|
|
7
|
+
/** Resize message posted by an embedded data app's publisher.js runtime. */
|
|
8
|
+
export interface PublisherResizeMessage {
|
|
9
|
+
type: typeof PUBLISHER_RESIZE_MESSAGE_TYPE;
|
|
10
|
+
/** Content height in CSS pixels. */
|
|
11
|
+
height: number;
|
|
12
|
+
}
|
|
13
|
+
/** Type guard for a {@link PublisherResizeMessage} arriving via postMessage. */
|
|
14
|
+
export declare function isPublisherResizeMessage(data: unknown): data is PublisherResizeMessage;
|
|
15
|
+
/**
|
|
16
|
+
* Derive the Publisher data origin (where static package files are served)
|
|
17
|
+
* from the configured API base URL by stripping the trailing `/api/v0`.
|
|
18
|
+
*
|
|
19
|
+
* The static-file routes live off the server root, not under the API prefix,
|
|
20
|
+
* and the data origin can differ from the SPA origin in multi-host
|
|
21
|
+
* deployments — so a data app's standalone URL is `serverBaseUrl(server)`
|
|
22
|
+
* joined with its root-relative `resource`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function serverBaseUrl(server: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Absolute URL of a file inside a package, as Publisher serves it:
|
|
27
|
+
* `<data origin>/environments/<env>/packages/<pkg>/<path>`.
|
|
28
|
+
*
|
|
29
|
+
* The one home for this string. Both the data app viewer's iframe and the
|
|
30
|
+
* "this is not a model" page point at it, and hand-building it in each place is
|
|
31
|
+
* how the two drift.
|
|
32
|
+
*
|
|
33
|
+
* `path` is relative to the package's `public/` directory and is inserted as
|
|
34
|
+
* given, since it may contain slashes. A leading `public/` is dropped, because
|
|
35
|
+
* the served path does not include it and a caller passing a path a reader typed
|
|
36
|
+
* would otherwise produce `public/public/<file>`, which 404s. The server's own
|
|
37
|
+
* redirect drops it for the same reason.
|
|
38
|
+
*/
|
|
39
|
+
export declare function packageFileUrl({ server, environmentName, packageName, path, }: {
|
|
40
|
+
server: string;
|
|
41
|
+
environmentName: string;
|
|
42
|
+
packageName: string;
|
|
43
|
+
path: string;
|
|
44
|
+
}): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escape a value for use inside a single-quoted Malloy string literal.
|
|
3
|
+
*
|
|
4
|
+
* Backslashes are escaped first, then quotes: doing it the other way round
|
|
5
|
+
* would re-escape the backslash that the quote escape introduced.
|
|
6
|
+
*/
|
|
7
|
+
export declare function escapeMalloyString(value: string): string;
|
package/dist/utils/parsing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const getEnvironmentDescription: (readme: string | undefined) => string;
|
|
2
|
+
export declare const generateEnvironmentReadme: (environment: {
|
|
3
3
|
name: string;
|
|
4
4
|
readme?: string;
|
|
5
5
|
}, description?: string) => string;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import { QueryClient } from '@tanstack/react-query';
|
|
2
2
|
export declare const globalQueryClient: QueryClient;
|
|
3
|
+
export declare const CHART_RESULT_QUERY_OPTIONS: {
|
|
4
|
+
readonly staleTime: number;
|
|
5
|
+
readonly refetchOnWindowFocus: false;
|
|
6
|
+
readonly refetchOnReconnect: false;
|
|
7
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloy-publisher/sdk",
|
|
3
3
|
"description": "Malloy Publisher SDK",
|
|
4
|
-
"version": "0.0
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"build": "bun generate-api-types && bunx vite build",
|
|
61
61
|
"postbuild": "cp ../../node_modules/@malloydata/malloy-explorer/dist/malloy-explorer.css ./dist/malloy-explorer.css && cp ../../node_modules/@uiw/react-md-editor/markdown-editor.css ./dist/markdown-editor.css && echo '/* SDK Styles */\n@import \"./malloy-explorer.css\";\n@import \"./markdown-editor.css\";' > ./dist/styles.css",
|
|
62
62
|
"test": "bun test",
|
|
63
|
-
"lint": "bunx eslint ./src --fix",
|
|
63
|
+
"lint": "bunx eslint ./src ./test --fix",
|
|
64
64
|
"format": "bunx prettier --write --parser typescript '**/*.{ts,tsx}'",
|
|
65
65
|
"analyze": "bunx vite-bundle-visualizer",
|
|
66
66
|
"generate-api-types": "bunx openapi-generator-cli generate -i ../../api-doc.yaml -g typescript-axios -o src/client/"
|
|
@@ -70,10 +70,12 @@
|
|
|
70
70
|
"react-dom": ">=19.1.0",
|
|
71
71
|
"react-router-dom": ">=7.6.2",
|
|
72
72
|
"@tanstack/react-query": ">=5.59.16",
|
|
73
|
-
"@malloydata/malloy-explorer": "
|
|
74
|
-
"@malloydata/malloy-
|
|
75
|
-
"@malloydata/malloy-
|
|
76
|
-
"@malloydata/
|
|
73
|
+
"@malloydata/malloy-explorer": "0.0.338-dev260215172810",
|
|
74
|
+
"@malloydata/malloy-filter": "^0.0.432",
|
|
75
|
+
"@malloydata/malloy-interfaces": "^0.0.432",
|
|
76
|
+
"@malloydata/malloy-query-builder": "^0.0.432",
|
|
77
|
+
"@malloydata/malloy-tag": "^0.0.432",
|
|
78
|
+
"@malloydata/render": "^0.0.432",
|
|
77
79
|
"@mui/icons-material": ">=7.1.1",
|
|
78
80
|
"@mui/x-date-pickers": ">=7.1.1",
|
|
79
81
|
"@mui/material": ">=7.1.1",
|
|
@@ -86,11 +88,22 @@
|
|
|
86
88
|
"@emotion/styled": "^11.14.0",
|
|
87
89
|
"@react-spring/web": "^10.0.1",
|
|
88
90
|
"@uiw/react-md-editor": "^4.0.6",
|
|
91
|
+
"cron-parser": "^5.6.2",
|
|
92
|
+
"cronstrue": "^2.50.0",
|
|
89
93
|
"markdown-to-jsx": "^7.7.6",
|
|
90
94
|
"dayjs": "^1.11.13"
|
|
91
95
|
},
|
|
92
96
|
"devDependencies": {
|
|
97
|
+
"@happy-dom/global-registrator": "^20.11.1",
|
|
98
|
+
"@malloydata/malloy-explorer": "0.0.338-dev260215172810",
|
|
99
|
+
"@malloydata/malloy-filter": "^0.0.432",
|
|
100
|
+
"@malloydata/malloy-query-builder": "^0.0.432",
|
|
101
|
+
"@malloydata/malloy-tag": "^0.0.432",
|
|
93
102
|
"@openapitools/openapi-generator-cli": "^2.20.2",
|
|
103
|
+
"@shikijs/langs": "^1.16.3",
|
|
104
|
+
"@shikijs/themes": "^1.16.3",
|
|
105
|
+
"@testing-library/dom": "^10.4.1",
|
|
106
|
+
"@testing-library/react": "^16.3.2",
|
|
94
107
|
"@types/bun": "^1.2.21",
|
|
95
108
|
"@types/k6": "^1.0.2",
|
|
96
109
|
"@types/react": "^19.1.7",
|
|
@@ -106,8 +119,6 @@
|
|
|
106
119
|
"eslint-plugin-react-hooks": "5.0.0",
|
|
107
120
|
"eslint-plugin-storybook": "^0.11.4",
|
|
108
121
|
"shiki": "^1.16.3",
|
|
109
|
-
"@shikijs/langs": "^1.16.3",
|
|
110
|
-
"@shikijs/themes": "^1.16.3",
|
|
111
122
|
"vite": "^6.3.2",
|
|
112
123
|
"vite-plugin-dts": "^4.5.3",
|
|
113
124
|
"vite-plugin-svgr": "^4.3.0"
|
package/src/client-entry.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// Copyright (c) Credible Data Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
1
4
|
import { Add, Launch } from "@mui/icons-material";
|
|
2
5
|
import {
|
|
3
6
|
Box,
|
|
@@ -230,13 +233,16 @@ export function AnalyzePackageButton({
|
|
|
230
233
|
</FormControl>
|
|
231
234
|
) : availableWorkspaces.length === 1 ? (
|
|
232
235
|
<Box
|
|
233
|
-
sx={{
|
|
236
|
+
sx={(theme) => ({
|
|
234
237
|
p: 2,
|
|
235
238
|
border: 1,
|
|
236
239
|
borderColor: "divider",
|
|
237
240
|
borderRadius: 1,
|
|
238
|
-
backgroundColor:
|
|
239
|
-
|
|
241
|
+
backgroundColor:
|
|
242
|
+
theme.palette.mode === "dark"
|
|
243
|
+
? "rgba(255, 255, 255, 0.04)"
|
|
244
|
+
: "grey.50",
|
|
245
|
+
})}
|
|
240
246
|
>
|
|
241
247
|
<Typography
|
|
242
248
|
variant="body2"
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// Copyright (c) Credible Data Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
1
4
|
import AddIcon from "@mui/icons-material/Add";
|
|
2
5
|
import DeleteIcon from "@mui/icons-material/Delete";
|
|
3
6
|
import Box from "@mui/material/Box";
|
|
@@ -27,6 +30,7 @@ import {
|
|
|
27
30
|
gcsAttachedDatabaseFields,
|
|
28
31
|
getAttachedDatabaseFields,
|
|
29
32
|
s3AttachedDatabaseFields,
|
|
33
|
+
uiCreatableConnectionTypes,
|
|
30
34
|
} from "./common";
|
|
31
35
|
|
|
32
36
|
type AddConnectionDialogProps = {
|
|
@@ -304,6 +308,21 @@ export default function AddConnectionDialog({
|
|
|
304
308
|
if (!connectionConfig.accessToken) {
|
|
305
309
|
throw new Error("Access Token is required");
|
|
306
310
|
}
|
|
311
|
+
} else if (type === "databricks") {
|
|
312
|
+
if (!connectionConfig.host) {
|
|
313
|
+
throw new Error("Host is required");
|
|
314
|
+
}
|
|
315
|
+
if (!connectionConfig.path) {
|
|
316
|
+
throw new Error("HTTP Path is required");
|
|
317
|
+
}
|
|
318
|
+
const hasOAuth =
|
|
319
|
+
connectionConfig.oauthClientId &&
|
|
320
|
+
connectionConfig.oauthClientSecret;
|
|
321
|
+
if (!connectionConfig.token && !hasOAuth) {
|
|
322
|
+
throw new Error(
|
|
323
|
+
"Either Access Token or OAuth Client ID + Secret is required",
|
|
324
|
+
);
|
|
325
|
+
}
|
|
307
326
|
}
|
|
308
327
|
|
|
309
328
|
connectionPayload = {
|
|
@@ -339,7 +358,16 @@ export default function AddConnectionDialog({
|
|
|
339
358
|
|
|
340
359
|
return (
|
|
341
360
|
<React.Fragment>
|
|
342
|
-
|
|
361
|
+
{/* Contained with a start icon, matching AddEnvironmentDialog and
|
|
362
|
+
AddPackageDialog. This was the only add-trigger of the three still
|
|
363
|
+
outlined and icon-less, which read as the secondary action on a
|
|
364
|
+
screen where it is the primary one. */}
|
|
365
|
+
<Button
|
|
366
|
+
variant="contained"
|
|
367
|
+
color="primary"
|
|
368
|
+
startIcon={<AddIcon />}
|
|
369
|
+
onClick={handleClickOpen}
|
|
370
|
+
>
|
|
343
371
|
Add Connection
|
|
344
372
|
</Button>
|
|
345
373
|
<Dialog open={open} onClose={handleClose}>
|
|
@@ -373,7 +401,7 @@ export default function AddConnectionDialog({
|
|
|
373
401
|
setType(event.target.value as ConnectionTypeEnum)
|
|
374
402
|
}
|
|
375
403
|
>
|
|
376
|
-
{
|
|
404
|
+
{uiCreatableConnectionTypes.map((type) => (
|
|
377
405
|
<MenuItem key={type} value={type}>
|
|
378
406
|
{type}
|
|
379
407
|
</MenuItem>
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// Copyright (c) Credible Data Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
1
4
|
import { Delete } from "@mui/icons-material";
|
|
2
5
|
import CloseIcon from "@mui/icons-material/Close";
|
|
3
6
|
import { Snackbar } from "@mui/material";
|
|
@@ -7,6 +10,9 @@ import DialogActions from "@mui/material/DialogActions";
|
|
|
7
10
|
import DialogContent from "@mui/material/DialogContent";
|
|
8
11
|
import DialogTitle from "@mui/material/DialogTitle";
|
|
9
12
|
import IconButton from "@mui/material/IconButton";
|
|
13
|
+
import ListItemIcon from "@mui/material/ListItemIcon";
|
|
14
|
+
import ListItemText from "@mui/material/ListItemText";
|
|
15
|
+
import MenuItem from "@mui/material/MenuItem";
|
|
10
16
|
import Typography from "@mui/material/Typography";
|
|
11
17
|
import React, { useState } from "react";
|
|
12
18
|
import { Connection } from "../../client";
|
|
@@ -34,14 +40,19 @@ export default function DeleteConnectionDialog({
|
|
|
34
40
|
|
|
35
41
|
return (
|
|
36
42
|
<React.Fragment>
|
|
37
|
-
<
|
|
43
|
+
<MenuItem
|
|
44
|
+
aria-label={`Delete connection ${connection?.name ?? ""}`.trim()}
|
|
38
45
|
onClick={(event) => {
|
|
39
46
|
event.stopPropagation();
|
|
40
47
|
handleClickOpen();
|
|
41
48
|
}}
|
|
49
|
+
sx={{ color: "error.main" }}
|
|
42
50
|
>
|
|
43
|
-
<
|
|
44
|
-
|
|
51
|
+
<ListItemIcon sx={{ color: "inherit" }}>
|
|
52
|
+
<Delete fontSize="small" />
|
|
53
|
+
</ListItemIcon>
|
|
54
|
+
<ListItemText>Delete</ListItemText>
|
|
55
|
+
</MenuItem>
|
|
45
56
|
|
|
46
57
|
<Dialog
|
|
47
58
|
onClose={handleClose}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// Copyright (c) Credible Data Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
1
4
|
import AddIcon from "@mui/icons-material/Add";
|
|
2
5
|
import DeleteIcon from "@mui/icons-material/Delete";
|
|
3
6
|
import Box from "@mui/material/Box";
|
|
@@ -8,6 +11,8 @@ import DialogContent from "@mui/material/DialogContent";
|
|
|
8
11
|
import DialogContentText from "@mui/material/DialogContentText";
|
|
9
12
|
import DialogTitle from "@mui/material/DialogTitle";
|
|
10
13
|
import IconButton from "@mui/material/IconButton";
|
|
14
|
+
import ListItemIcon from "@mui/material/ListItemIcon";
|
|
15
|
+
import ListItemText from "@mui/material/ListItemText";
|
|
11
16
|
import TextField from "@mui/material/TextField";
|
|
12
17
|
import Typography from "@mui/material/Typography";
|
|
13
18
|
import React, { useState } from "react";
|
|
@@ -28,12 +33,14 @@ import {
|
|
|
28
33
|
gcsAttachedDatabaseFields,
|
|
29
34
|
getAttachedDatabaseFields,
|
|
30
35
|
s3AttachedDatabaseFields,
|
|
36
|
+
uiCreatableConnectionTypes,
|
|
31
37
|
} from "./common";
|
|
32
38
|
|
|
33
39
|
type EditConnectionDialogProps = {
|
|
34
40
|
connection: Connection;
|
|
35
41
|
onSubmit: (connection: Connection) => Promise<unknown>;
|
|
36
42
|
isSubmitting: boolean;
|
|
43
|
+
onCloseDialog?: () => void;
|
|
37
44
|
};
|
|
38
45
|
|
|
39
46
|
function initAttachedDatabases(connection: Connection) {
|
|
@@ -56,6 +63,7 @@ export default function EditConnectionDialog({
|
|
|
56
63
|
connection,
|
|
57
64
|
onSubmit,
|
|
58
65
|
isSubmitting,
|
|
66
|
+
onCloseDialog,
|
|
59
67
|
}: EditConnectionDialogProps) {
|
|
60
68
|
const [open, setOpen] = useState(false);
|
|
61
69
|
const [type, setType] = useState<Connection["type"]>(connection.type);
|
|
@@ -83,6 +91,7 @@ export default function EditConnectionDialog({
|
|
|
83
91
|
|
|
84
92
|
const handleClose = () => {
|
|
85
93
|
setOpen(false);
|
|
94
|
+
onCloseDialog?.();
|
|
86
95
|
};
|
|
87
96
|
|
|
88
97
|
const handleSubmit = async (event: React.FormEvent<HTMLFormElement>) => {
|
|
@@ -362,6 +371,21 @@ export default function EditConnectionDialog({
|
|
|
362
371
|
if (!connectionConfig.accessToken) {
|
|
363
372
|
throw new Error("Access Token is required");
|
|
364
373
|
}
|
|
374
|
+
} else if (type === "databricks") {
|
|
375
|
+
if (!connectionConfig.host) {
|
|
376
|
+
throw new Error("Host is required");
|
|
377
|
+
}
|
|
378
|
+
if (!connectionConfig.path) {
|
|
379
|
+
throw new Error("HTTP Path is required");
|
|
380
|
+
}
|
|
381
|
+
const hasOAuth =
|
|
382
|
+
connectionConfig.oauthClientId &&
|
|
383
|
+
connectionConfig.oauthClientSecret;
|
|
384
|
+
if (!connectionConfig.token && !hasOAuth) {
|
|
385
|
+
throw new Error(
|
|
386
|
+
"Either Access Token or OAuth Client ID + Secret is required",
|
|
387
|
+
);
|
|
388
|
+
}
|
|
365
389
|
}
|
|
366
390
|
|
|
367
391
|
connectionPayload = {
|
|
@@ -431,15 +455,19 @@ export default function EditConnectionDialog({
|
|
|
431
455
|
|
|
432
456
|
return (
|
|
433
457
|
<React.Fragment>
|
|
434
|
-
<
|
|
458
|
+
<MenuItem
|
|
459
|
+
aria-label={`Edit connection ${connection?.name ?? ""}`.trim()}
|
|
435
460
|
onClick={(event) => {
|
|
436
461
|
event.preventDefault();
|
|
437
462
|
event.stopPropagation();
|
|
438
463
|
handleClickOpen();
|
|
439
464
|
}}
|
|
440
465
|
>
|
|
441
|
-
<
|
|
442
|
-
|
|
466
|
+
<ListItemIcon>
|
|
467
|
+
<Edit fontSize="small" />
|
|
468
|
+
</ListItemIcon>
|
|
469
|
+
<ListItemText>Edit</ListItemText>
|
|
470
|
+
</MenuItem>
|
|
443
471
|
<Dialog open={open} onClose={handleClose}>
|
|
444
472
|
<DialogTitle
|
|
445
473
|
onClick={(event) => {
|
|
@@ -482,7 +510,7 @@ export default function EditConnectionDialog({
|
|
|
482
510
|
setType(event.target.value as ConnectionTypeEnum)
|
|
483
511
|
}
|
|
484
512
|
>
|
|
485
|
-
{
|
|
513
|
+
{uiCreatableConnectionTypes.map((type) => (
|
|
486
514
|
<MenuItem key={type} value={type}>
|
|
487
515
|
{type}
|
|
488
516
|
</MenuItem>
|
|
@@ -722,6 +750,7 @@ export default function EditConnectionDialog({
|
|
|
722
750
|
Database {index + 1}
|
|
723
751
|
</Typography>
|
|
724
752
|
<IconButton
|
|
753
|
+
aria-label={`Remove attached database ${index + 1}`}
|
|
725
754
|
onClick={() =>
|
|
726
755
|
removeAttachedDatabase(index)
|
|
727
756
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
// Copyright (c) Credible Data Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
1
4
|
import { HTMLInputTypeAttribute } from "react";
|
|
5
|
+
import { ConnectionTypeEnum } from "../../client/api";
|
|
2
6
|
import type {
|
|
3
7
|
AzureConnection,
|
|
4
8
|
BigqueryConnection,
|
|
5
|
-
|
|
9
|
+
DatabricksConnection,
|
|
6
10
|
DucklakeConnection,
|
|
7
11
|
GCSConnection,
|
|
8
12
|
MotherDuckConnection,
|
|
@@ -19,6 +23,7 @@ type ConnectionField = {
|
|
|
19
23
|
BigqueryConnection &
|
|
20
24
|
SnowflakeConnection &
|
|
21
25
|
TrinoConnection &
|
|
26
|
+
DatabricksConnection &
|
|
22
27
|
MysqlConnection &
|
|
23
28
|
MotherDuckConnection &
|
|
24
29
|
S3Connection &
|
|
@@ -217,6 +222,50 @@ export const connectionFieldsByType: Record<
|
|
|
217
222
|
required: false, // Can be used instead of password for HTTPS
|
|
218
223
|
},
|
|
219
224
|
],
|
|
225
|
+
databricks: [
|
|
226
|
+
{
|
|
227
|
+
label: "Host",
|
|
228
|
+
name: "host",
|
|
229
|
+
type: "text",
|
|
230
|
+
required: true,
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
label: "HTTP Path",
|
|
234
|
+
name: "path",
|
|
235
|
+
type: "text",
|
|
236
|
+
required: true,
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
label: "Access Token",
|
|
240
|
+
name: "token",
|
|
241
|
+
type: "password",
|
|
242
|
+
required: false, // Either token or OAuth client credentials required
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
label: "OAuth Client ID",
|
|
246
|
+
name: "oauthClientId",
|
|
247
|
+
type: "text",
|
|
248
|
+
required: false, // Required with oauthClientSecret if no token
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
label: "OAuth Client Secret",
|
|
252
|
+
name: "oauthClientSecret",
|
|
253
|
+
type: "password",
|
|
254
|
+
required: false, // Required with oauthClientId if no token
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
label: "Default Catalog",
|
|
258
|
+
name: "defaultCatalog",
|
|
259
|
+
type: "text",
|
|
260
|
+
required: false,
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
label: "Default Schema",
|
|
264
|
+
name: "defaultSchema",
|
|
265
|
+
type: "text",
|
|
266
|
+
required: false,
|
|
267
|
+
},
|
|
268
|
+
],
|
|
220
269
|
mysql: [
|
|
221
270
|
{
|
|
222
271
|
label: "Host",
|
|
@@ -267,6 +316,9 @@ export const connectionFieldsByType: Record<
|
|
|
267
316
|
],
|
|
268
317
|
// DuckLake uses custom form rendering (catalog + storage dropdowns)
|
|
269
318
|
ducklake: [],
|
|
319
|
+
// Publisher connections are defined in publisher.config.json, not built from
|
|
320
|
+
// this form (see uiCreatableConnectionTypes).
|
|
321
|
+
publisher: [],
|
|
270
322
|
};
|
|
271
323
|
|
|
272
324
|
export const attributesFieldName: Record<ConnectionTypeEnum, string> = {
|
|
@@ -274,12 +326,23 @@ export const attributesFieldName: Record<ConnectionTypeEnum, string> = {
|
|
|
274
326
|
bigquery: "bigqueryConnection",
|
|
275
327
|
snowflake: "snowflakeConnection",
|
|
276
328
|
trino: "trinoConnection",
|
|
329
|
+
databricks: "databricksConnection",
|
|
277
330
|
mysql: "mysqlConnection",
|
|
278
331
|
duckdb: "duckdbConnection",
|
|
279
332
|
motherduck: "motherduckConnection",
|
|
280
333
|
ducklake: "ducklakeConnection",
|
|
334
|
+
publisher: "publisherConnection",
|
|
281
335
|
};
|
|
282
336
|
|
|
337
|
+
/**
|
|
338
|
+
* Connection types the Add/Edit dialogs offer as creatable. `publisher` proxy
|
|
339
|
+
* connections are configured in publisher.config.json rather than through the
|
|
340
|
+
* UI, so they are a valid ConnectionTypeEnum but not a form choice.
|
|
341
|
+
*/
|
|
342
|
+
export const uiCreatableConnectionTypes = Object.values(
|
|
343
|
+
ConnectionTypeEnum,
|
|
344
|
+
).filter((type) => type !== ConnectionTypeEnum.Publisher);
|
|
345
|
+
|
|
283
346
|
// Mapping for attached database types to their connection field names
|
|
284
347
|
export const attachedDatabaseConnectionFieldName: Record<string, string> = {
|
|
285
348
|
postgres: "postgresConnection",
|