@dudousxd/nestjs-catalog-react 0.1.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/LICENSE-bklit +21 -0
- package/README.md +282 -0
- package/dist/AccessConsole.d.ts +40 -0
- package/dist/AccessConsole.js +160 -0
- package/dist/CatalogManager.d.ts +12 -0
- package/dist/CatalogManager.js +123 -0
- package/dist/ConnectionPanel.d.ts +41 -0
- package/dist/ConnectionPanel.js +228 -0
- package/dist/CoverageLedger.d.ts +16 -0
- package/dist/CoverageLedger.js +16 -0
- package/dist/DashboardBoard.d.ts +10 -0
- package/dist/DashboardBoard.js +206 -0
- package/dist/EditableField.d.ts +18 -0
- package/dist/EditableField.js +61 -0
- package/dist/FlowView.d.ts +13 -0
- package/dist/FlowView.js +93 -0
- package/dist/GovernanceTimeline.d.ts +16 -0
- package/dist/GovernanceTimeline.js +93 -0
- package/dist/ObjectExplorer.d.ts +9 -0
- package/dist/ObjectExplorer.js +153 -0
- package/dist/PipelineConsole.d.ts +20 -0
- package/dist/PipelineConsole.js +272 -0
- package/dist/QueryConsole.d.ts +11 -0
- package/dist/QueryConsole.js +144 -0
- package/dist/SavedQueryPanel.d.ts +16 -0
- package/dist/SavedQueryPanel.js +78 -0
- package/dist/TraceExplorer.d.ts +54 -0
- package/dist/TraceExplorer.js +342 -0
- package/dist/TransformEditor.d.ts +23 -0
- package/dist/TransformEditor.js +129 -0
- package/dist/WorkflowCanvas.d.ts +24 -0
- package/dist/WorkflowCanvas.js +701 -0
- package/dist/charts/bklit/animation.d.ts +19 -0
- package/dist/charts/bklit/animation.js +28 -0
- package/dist/charts/bklit/area-chart-loading.d.ts +33 -0
- package/dist/charts/bklit/area-chart-loading.js +30 -0
- package/dist/charts/bklit/area-chart.d.ts +47 -0
- package/dist/charts/bklit/area-chart.js +65 -0
- package/dist/charts/bklit/area-gradient-defs.d.ts +28 -0
- package/dist/charts/bklit/area-gradient-defs.js +23 -0
- package/dist/charts/bklit/area.d.ts +75 -0
- package/dist/charts/bklit/area.js +112 -0
- package/dist/charts/bklit/bar-chart-loading.d.ts +16 -0
- package/dist/charts/bklit/bar-chart-loading.js +22 -0
- package/dist/charts/bklit/bar-chart.d.ts +54 -0
- package/dist/charts/bklit/bar-chart.js +440 -0
- package/dist/charts/bklit/bar-depth-geometry.d.ts +41 -0
- package/dist/charts/bklit/bar-depth-geometry.js +46 -0
- package/dist/charts/bklit/bar-squares-layout.d.ts +36 -0
- package/dist/charts/bklit/bar-squares-layout.js +46 -0
- package/dist/charts/bklit/bar-squares.d.ts +48 -0
- package/dist/charts/bklit/bar-squares.js +206 -0
- package/dist/charts/bklit/bar-x-axis.d.ts +13 -0
- package/dist/charts/bklit/bar-x-axis.js +81 -0
- package/dist/charts/bklit/bar-y-axis.d.ts +11 -0
- package/dist/charts/bklit/bar-y-axis.js +72 -0
- package/dist/charts/bklit/bar.d.ts +40 -0
- package/dist/charts/bklit/bar.js +207 -0
- package/dist/charts/bklit/chart-child-passthrough.d.ts +25 -0
- package/dist/charts/bklit/chart-child-passthrough.js +82 -0
- package/dist/charts/bklit/chart-config-context.d.ts +34 -0
- package/dist/charts/bklit/chart-config-context.js +55 -0
- package/dist/charts/bklit/chart-context.d.ts +207 -0
- package/dist/charts/bklit/chart-context.js +200 -0
- package/dist/charts/bklit/chart-defs.d.ts +21 -0
- package/dist/charts/bklit/chart-defs.js +57 -0
- package/dist/charts/bklit/chart-formatters.d.ts +16 -0
- package/dist/charts/bklit/chart-formatters.js +26 -0
- package/dist/charts/bklit/chart-legend-hover.d.ts +21 -0
- package/dist/charts/bklit/chart-legend-hover.js +26 -0
- package/dist/charts/bklit/chart-loading-label.d.ts +9 -0
- package/dist/charts/bklit/chart-loading-label.js +29 -0
- package/dist/charts/bklit/chart-phase.d.ts +39 -0
- package/dist/charts/bklit/chart-phase.js +20 -0
- package/dist/charts/bklit/chart-reveal-clip.d.ts +32 -0
- package/dist/charts/bklit/chart-reveal-clip.js +23 -0
- package/dist/charts/bklit/dash-tail-stroke.d.ts +17 -0
- package/dist/charts/bklit/dash-tail-stroke.js +21 -0
- package/dist/charts/bklit/decimate-time-series.d.ts +18 -0
- package/dist/charts/bklit/decimate-time-series.js +120 -0
- package/dist/charts/bklit/fade-edges.d.ts +42 -0
- package/dist/charts/bklit/fade-edges.js +34 -0
- package/dist/charts/bklit/filter-data-by-x-domain.d.ts +13 -0
- package/dist/charts/bklit/filter-data-by-x-domain.js +50 -0
- package/dist/charts/bklit/generate-chart-skeleton-data.d.ts +24 -0
- package/dist/charts/bklit/generate-chart-skeleton-data.js +33 -0
- package/dist/charts/bklit/grid.d.ts +57 -0
- package/dist/charts/bklit/grid.js +88 -0
- package/dist/charts/bklit/highlight-segment-bounds.d.ts +26 -0
- package/dist/charts/bklit/highlight-segment-bounds.js +35 -0
- package/dist/charts/bklit/highlight-segment.d.ts +30 -0
- package/dist/charts/bklit/highlight-segment.js +22 -0
- package/dist/charts/bklit/indicator-fade.d.ts +23 -0
- package/dist/charts/bklit/indicator-fade.js +41 -0
- package/dist/charts/bklit/line-chart-loading.d.ts +33 -0
- package/dist/charts/bklit/line-chart-loading.js +30 -0
- package/dist/charts/bklit/line-chart.d.ts +45 -0
- package/dist/charts/bklit/line-chart.js +99 -0
- package/dist/charts/bklit/line-loading-pulse.d.ts +19 -0
- package/dist/charts/bklit/line-loading-pulse.js +132 -0
- package/dist/charts/bklit/line-loading-timing.d.ts +18 -0
- package/dist/charts/bklit/line-loading-timing.js +18 -0
- package/dist/charts/bklit/line-series-terminal-marker.d.ts +15 -0
- package/dist/charts/bklit/line-series-terminal-marker.js +54 -0
- package/dist/charts/bklit/line.d.ts +63 -0
- package/dist/charts/bklit/line.js +104 -0
- package/dist/charts/bklit/loading-sweep.d.ts +65 -0
- package/dist/charts/bklit/loading-sweep.js +182 -0
- package/dist/charts/bklit/motion-utils.d.ts +17 -0
- package/dist/charts/bklit/motion-utils.js +27 -0
- package/dist/charts/bklit/path-stroke-utils.d.ts +28 -0
- package/dist/charts/bklit/path-stroke-utils.js +64 -0
- package/dist/charts/bklit/pattern-area.d.ts +20 -0
- package/dist/charts/bklit/pattern-area.js +27 -0
- package/dist/charts/bklit/pattern-preset.d.ts +34 -0
- package/dist/charts/bklit/pattern-preset.js +82 -0
- package/dist/charts/bklit/projection-config.d.ts +19 -0
- package/dist/charts/bklit/projection-config.js +88 -0
- package/dist/charts/bklit/projection-line-end-marker.d.ts +14 -0
- package/dist/charts/bklit/projection-line-end-marker.js +35 -0
- package/dist/charts/bklit/projection-line.d.ts +39 -0
- package/dist/charts/bklit/projection-line.js +87 -0
- package/dist/charts/bklit/projection-utils.d.ts +54 -0
- package/dist/charts/bklit/projection-utils.js +252 -0
- package/dist/charts/bklit/reference-area-config.d.ts +18 -0
- package/dist/charts/bklit/reference-area-config.js +47 -0
- package/dist/charts/bklit/reference-area-registration-context.d.ts +7 -0
- package/dist/charts/bklit/reference-area-registration-context.js +15 -0
- package/dist/charts/bklit/series-bar-layout.d.ts +26 -0
- package/dist/charts/bklit/series-bar-layout.js +39 -0
- package/dist/charts/bklit/series-dash-tail-overlay.d.ts +16 -0
- package/dist/charts/bklit/series-dash-tail-overlay.js +47 -0
- package/dist/charts/bklit/series-highlight-layer.d.ts +31 -0
- package/dist/charts/bklit/series-highlight-layer.js +20 -0
- package/dist/charts/bklit/series-hover-dim.d.ts +28 -0
- package/dist/charts/bklit/series-hover-dim.js +34 -0
- package/dist/charts/bklit/series-markers.d.ts +13 -0
- package/dist/charts/bklit/series-markers.js +106 -0
- package/dist/charts/bklit/series-path-utils.d.ts +18 -0
- package/dist/charts/bklit/series-path-utils.js +68 -0
- package/dist/charts/bklit/series-point-marker.d.ts +47 -0
- package/dist/charts/bklit/series-point-marker.js +47 -0
- package/dist/charts/bklit/static-chart-preview-context.d.ts +15 -0
- package/dist/charts/bklit/static-chart-preview-context.js +20 -0
- package/dist/charts/bklit/time-series-chart-shell.d.ts +46 -0
- package/dist/charts/bklit/time-series-chart-shell.js +398 -0
- package/dist/charts/bklit/tooltip/chart-tooltip.d.ts +75 -0
- package/dist/charts/bklit/tooltip/chart-tooltip.js +158 -0
- package/dist/charts/bklit/tooltip/date-ticker.d.ts +10 -0
- package/dist/charts/bklit/tooltip/date-ticker.js +85 -0
- package/dist/charts/bklit/tooltip/index.d.ts +15 -0
- package/dist/charts/bklit/tooltip/index.js +15 -0
- package/dist/charts/bklit/tooltip/tooltip-box.d.ts +56 -0
- package/dist/charts/bklit/tooltip/tooltip-box.js +122 -0
- package/dist/charts/bklit/tooltip/tooltip-content.d.ts +26 -0
- package/dist/charts/bklit/tooltip/tooltip-content.js +8 -0
- package/dist/charts/bklit/tooltip/tooltip-dot.d.ts +27 -0
- package/dist/charts/bklit/tooltip/tooltip-dot.js +62 -0
- package/dist/charts/bklit/tooltip/tooltip-indicator.d.ts +44 -0
- package/dist/charts/bklit/tooltip/tooltip-indicator.js +73 -0
- package/dist/charts/bklit/use-animated-series-path.d.ts +18 -0
- package/dist/charts/bklit/use-animated-series-path.js +101 -0
- package/dist/charts/bklit/use-animated-y-domains.d.ts +13 -0
- package/dist/charts/bklit/use-animated-y-domains.js +158 -0
- package/dist/charts/bklit/use-chart-interaction.d.ts +40 -0
- package/dist/charts/bklit/use-chart-interaction.js +252 -0
- package/dist/charts/bklit/use-chart-phase-orchestrator.d.ts +22 -0
- package/dist/charts/bklit/use-chart-phase-orchestrator.js +147 -0
- package/dist/charts/bklit/use-enter-complete.d.ts +16 -0
- package/dist/charts/bklit/use-enter-complete.js +22 -0
- package/dist/charts/bklit/use-grid-shimmer.d.ts +15 -0
- package/dist/charts/bklit/use-grid-shimmer.js +71 -0
- package/dist/charts/bklit/use-highlight-segment.d.ts +22 -0
- package/dist/charts/bklit/use-highlight-segment.js +42 -0
- package/dist/charts/bklit/use-mount-progress.d.ts +12 -0
- package/dist/charts/bklit/use-mount-progress.js +30 -0
- package/dist/charts/bklit/use-scheduled-tooltip.d.ts +8 -0
- package/dist/charts/bklit/use-scheduled-tooltip.js +84 -0
- package/dist/charts/bklit/visx-pattern.d.ts +27 -0
- package/dist/charts/bklit/visx-pattern.js +28 -0
- package/dist/charts/bklit/x-axis.d.ts +26 -0
- package/dist/charts/bklit/x-axis.js +423 -0
- package/dist/charts/bklit/y-axis-scales.d.ts +34 -0
- package/dist/charts/bklit/y-axis-scales.js +80 -0
- package/dist/charts/bklit/y-axis-ticks.d.ts +20 -0
- package/dist/charts/bklit/y-axis-ticks.js +32 -0
- package/dist/charts/bklit/y-domain-utils.d.ts +26 -0
- package/dist/charts/bklit/y-domain-utils.js +96 -0
- package/dist/charts/bklit.d.ts +2 -0
- package/dist/charts/bklit.js +90 -0
- package/dist/charts/components/shimmering-text.d.ts +31 -0
- package/dist/charts/components/shimmering-text.js +39 -0
- package/dist/charts/css.d.ts +35 -0
- package/dist/charts/css.js +64 -0
- package/dist/charts/recharts.d.ts +28 -0
- package/dist/charts/recharts.js +48 -0
- package/dist/charts/registry.d.ts +34 -0
- package/dist/charts/registry.js +60 -0
- package/dist/charts/skeleton.d.ts +55 -0
- package/dist/charts/skeleton.js +66 -0
- package/dist/cn.d.ts +10 -0
- package/dist/cn.js +13 -0
- package/dist/context.d.ts +346 -0
- package/dist/context.js +95 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +65 -0
- package/dist/routes.d.ts +70 -0
- package/dist/routes.js +73 -0
- package/dist/source-fields.d.ts +111 -0
- package/dist/source-fields.js +204 -0
- package/dist/ui/chart.d.ts +54 -0
- package/dist/ui/chart.js +122 -0
- package/dist/ui/dialog.d.ts +27 -0
- package/dist/ui/dialog.js +24 -0
- package/dist/ui/field.d.ts +29 -0
- package/dist/ui/field.js +31 -0
- package/dist/ui/select.d.ts +42 -0
- package/dist/ui/select.js +30 -0
- package/dist/ui/sheet.d.ts +38 -0
- package/dist/ui/sheet.js +37 -0
- package/dist/ui/switch.d.ts +17 -0
- package/dist/ui/switch.js +14 -0
- package/dist/ui/tabs.d.ts +30 -0
- package/dist/ui/tabs.js +36 -0
- package/dist/ui/tooltip.d.ts +37 -0
- package/dist/ui/tooltip.js +43 -0
- package/dist/workflow/graph.d.ts +112 -0
- package/dist/workflow/graph.js +297 -0
- package/dist/workflow/index.d.ts +16 -0
- package/dist/workflow/index.js +16 -0
- package/dist/workflow/model.d.ts +151 -0
- package/dist/workflow/model.js +97 -0
- package/dist/workflow/name.d.ts +28 -0
- package/dist/workflow/name.js +28 -0
- package/dist/workflow/nodes.d.ts +40 -0
- package/dist/workflow/nodes.js +86 -0
- package/dist/workflow/validate.d.ts +104 -0
- package/dist/workflow/validate.js +199 -0
- package/package.json +148 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../cn';
|
|
3
|
+
/** Deterministic, so the skeleton does not reshuffle on every render. */
|
|
4
|
+
function heights(count) {
|
|
5
|
+
const pattern = [0.55, 0.8, 0.42, 0.95, 0.62, 0.74, 0.35, 0.86, 0.5, 0.68];
|
|
6
|
+
return Array.from({ length: count }, (_, index) => pattern[index % pattern.length]);
|
|
7
|
+
}
|
|
8
|
+
const BAR = 'bg-zinc-200 dark:bg-zinc-800';
|
|
9
|
+
const RAIL = 'bg-zinc-100 dark:bg-zinc-900';
|
|
10
|
+
const PULSE = 'motion-safe:animate-pulse';
|
|
11
|
+
export function ChartSkeleton({ kind, height = 220, points = 8, className }) {
|
|
12
|
+
// A table is not a chart and must not be given a chart's silhouette — a
|
|
13
|
+
// reader who sees bars appear and then a table has been told something wrong.
|
|
14
|
+
if (kind === 'table') {
|
|
15
|
+
return (_jsxs("div", { style: { height }, className: cn('flex flex-col gap-1.5 overflow-hidden', PULSE, className), "aria-hidden": true, children: [_jsx("div", { className: cn('h-5 w-full rounded-sm', BAR) }), heights(6).map((width, index) => (_jsx("div", { className: cn('h-4 rounded-sm', RAIL), style: { width: `${70 + width * 30}%` } }, index)))] }));
|
|
16
|
+
}
|
|
17
|
+
// A single number is a block of text, so its placeholder is a block of text —
|
|
18
|
+
// sized to where the digits will actually sit rather than centred in a box
|
|
19
|
+
// the real value will not fill the same way.
|
|
20
|
+
if (kind === 'number') {
|
|
21
|
+
return (_jsxs("div", { style: { height }, className: cn('flex flex-col items-center justify-center gap-3', PULSE, className), "aria-hidden": true, children: [_jsx("div", { className: cn('h-10 w-32 rounded-md', BAR) }), _jsx("div", { className: cn('h-3 w-20 rounded-sm', RAIL) })] }));
|
|
22
|
+
}
|
|
23
|
+
if (kind === 'bar') {
|
|
24
|
+
return (_jsx(Frame, { height: height, className: className, children: _jsx("div", { className: "flex h-full items-end gap-2", children: heights(points).map((fraction, index) => (_jsx("div", { className: cn('flex-1 rounded-t-sm', BAR), style: { height: `${fraction * 100}%` } }, index))) }) }));
|
|
25
|
+
}
|
|
26
|
+
// Line and area share a silhouette, because they are the same shape with and
|
|
27
|
+
// without a fill under it — which is exactly the difference drawn here.
|
|
28
|
+
const filled = kind === 'area';
|
|
29
|
+
const path = heights(points)
|
|
30
|
+
.map((fraction, index) => {
|
|
31
|
+
const x = (index / (points - 1)) * 100;
|
|
32
|
+
const y = 100 - fraction * 100;
|
|
33
|
+
return `${index === 0 ? 'M' : 'L'}${x.toFixed(1)},${y.toFixed(1)}`;
|
|
34
|
+
})
|
|
35
|
+
.join(' ');
|
|
36
|
+
return (_jsx(Frame, { height: height, className: className, children: _jsxs("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "h-full w-full", "aria-hidden": true, children: [_jsx("title", { children: "Loading" }), filled && (_jsx("path", { d: `${path} L100,100 L0,100 Z`, className: "fill-zinc-200/70 dark:fill-zinc-800/70" })), _jsx("path", { d: path, fill: "none",
|
|
37
|
+
// `vectorEffect` keeps the stroke one pixel wide despite the viewBox
|
|
38
|
+
// being stretched by `preserveAspectRatio="none"`. Without it, a wide
|
|
39
|
+
// card draws a hairline and a narrow one draws a slab.
|
|
40
|
+
vectorEffect: "non-scaling-stroke", strokeWidth: 2, className: "stroke-zinc-300 dark:stroke-zinc-700" })] }) }));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The axis rails and the plot area, which every non-table chart has.
|
|
44
|
+
*
|
|
45
|
+
* Drawn rather than left blank because they are most of what makes a loading
|
|
46
|
+
* card read as a chart rather than as a box that failed to render.
|
|
47
|
+
*/
|
|
48
|
+
function Frame({ height, className, children, }) {
|
|
49
|
+
return (_jsxs("div", { style: { height }, className: cn('flex flex-col', PULSE, className), "aria-hidden": true, children: [_jsxs("div", { className: "flex min-h-0 flex-1 gap-2", children: [_jsx("div", { className: "flex w-8 shrink-0 flex-col justify-between py-1", children: [0, 1, 2, 3].map((tick) => (_jsx("div", { className: cn('h-2 w-full rounded-sm', RAIL) }, tick))) }), _jsx("div", { className: "min-w-0 flex-1", children: children })] }), _jsx("div", { className: cn('mt-2 h-px w-full', BAR) }), _jsx("div", { className: "mt-1.5 flex justify-between", children: [0, 1, 2, 3, 4].map((tick) => (_jsx("div", { className: cn('h-2 w-8 rounded-sm', RAIL) }, tick))) })] }));
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* What a card shows when the query finished and there was nothing to draw.
|
|
53
|
+
*
|
|
54
|
+
* Beside the skeleton, in the same file, because the bug this pair exists to
|
|
55
|
+
* prevent is the one where they are confused: a query that returned no rows is
|
|
56
|
+
* not loading, and leaving it under a placeholder means a chart that will never
|
|
57
|
+
* arrive looks like a chart that is about to. This project treats a failure
|
|
58
|
+
* that looks like something else as its worst class of bug.
|
|
59
|
+
*/
|
|
60
|
+
export function ChartEmpty({ height = 220, message = 'The query ran and matched nothing.', }) {
|
|
61
|
+
return (_jsx("div", { style: { height }, className: "flex items-center justify-center px-4 text-center text-xs text-zinc-400 dark:text-zinc-500", children: message }));
|
|
62
|
+
}
|
|
63
|
+
/** And what it shows when the query failed, which is not the same thing at all. */
|
|
64
|
+
export function ChartFailed({ height = 220, message, onRetry, }) {
|
|
65
|
+
return (_jsxs("div", { style: { height }, className: "flex flex-col items-center justify-center gap-2 px-4 text-center", children: [_jsx("p", { className: "font-mono text-[11px] leading-relaxed text-red-600 dark:text-red-400", children: message }), onRetry && (_jsx("button", { type: "button", onClick: onRetry, className: "rounded-md border border-red-300 px-2.5 py-1 text-[11px] text-red-700 dark:border-red-800 dark:text-red-300", children: "Try again" }))] }));
|
|
66
|
+
}
|
package/dist/cn.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ClassValue } from 'clsx';
|
|
2
|
+
/**
|
|
3
|
+
* The shadcn/ui `cn`, matching what a host that already uses shadcn expects.
|
|
4
|
+
*
|
|
5
|
+
* tailwind-merge earns its place the moment a consumer passes `className` to
|
|
6
|
+
* override padding or colour: without it their class and ours both survive into
|
|
7
|
+
* the DOM and the winner is whichever Tailwind emitted last, which is not
|
|
8
|
+
* something a caller can reason about.
|
|
9
|
+
*/
|
|
10
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
package/dist/cn.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
/**
|
|
4
|
+
* The shadcn/ui `cn`, matching what a host that already uses shadcn expects.
|
|
5
|
+
*
|
|
6
|
+
* tailwind-merge earns its place the moment a consumer passes `className` to
|
|
7
|
+
* override padding or colour: without it their class and ours both survive into
|
|
8
|
+
* the DOM and the winner is whichever Tailwind emitted last, which is not
|
|
9
|
+
* something a caller can reason about.
|
|
10
|
+
*/
|
|
11
|
+
export function cn(...inputs) {
|
|
12
|
+
return twMerge(clsx(inputs));
|
|
13
|
+
}
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import type { CatalogAuditEvent, CatalogConnection, CatalogConnector, CatalogObjectPage, CatalogQueryRelation, CatalogQueryResult, CatalogSnapshot, CatalogTraceList, CatalogTransform, ConnectionCheck, ConnectorRun, Dashboard, DashboardCard, ObjectQueryParams, PropertyPatch, SaveQueryInput, SavedQuery, TraceQuery, TransformLanguage, TransformResult, TypePatch } from '@dudousxd/nestjs-catalog/client';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import type { CatalogWorkflow, WorkflowDurability, WorkflowInput, WorkflowRun } from './workflow/model';
|
|
4
|
+
/**
|
|
5
|
+
* How these screens talk to the server.
|
|
6
|
+
*
|
|
7
|
+
* A `transport` rather than a built-in HTTP client: every host that would
|
|
8
|
+
* install this already has one, with its own base URL, auth interceptors,
|
|
9
|
+
* retries and error reporting. Bringing a second one along would mean the
|
|
10
|
+
* console is the one screen in the app that authenticates differently.
|
|
11
|
+
*/
|
|
12
|
+
export interface CatalogTransport {
|
|
13
|
+
get<T>(path: string, params?: Record<string, unknown>): Promise<T>;
|
|
14
|
+
patch<T>(path: string, body: unknown): Promise<T>;
|
|
15
|
+
post<T>(path: string, body?: unknown): Promise<T>;
|
|
16
|
+
delete<T>(path: string): Promise<T>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* What this deployment can actually execute.
|
|
20
|
+
*
|
|
21
|
+
* Reported rather than assumed. A transform editor that offers Python on an
|
|
22
|
+
* image without a Python runtime turns a deployment difference into a traceback
|
|
23
|
+
* the transform's author cannot act on, and `pythonPackages` exists for the same
|
|
24
|
+
* reason: "pandas is available" is a property of the image, not of the library.
|
|
25
|
+
*/
|
|
26
|
+
export interface PipelineCapabilities {
|
|
27
|
+
languages: TransformLanguage[];
|
|
28
|
+
pythonPackages: string[];
|
|
29
|
+
/**
|
|
30
|
+
* Whether this deployment can checkpoint between the nodes of a workflow.
|
|
31
|
+
*
|
|
32
|
+
* Optional, and its absence is a third answer rather than a synonym for
|
|
33
|
+
* "no": a server older than this field has not been asked. The workflow
|
|
34
|
+
* canvas renders all three states separately, because a screen that implies a
|
|
35
|
+
* failed run will resume where it stopped — on a deployment with no durable
|
|
36
|
+
* engine — is the exact promise this project keeps having to remove.
|
|
37
|
+
*/
|
|
38
|
+
durable?: WorkflowDurability;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* What a caller may set on a connection.
|
|
42
|
+
*
|
|
43
|
+
* The server-owned fields — who created it, when, and the outcome of the last
|
|
44
|
+
* check — are deliberately absent. They are consequences, written by the server,
|
|
45
|
+
* and a form that could send them would let somebody claim a connection was
|
|
46
|
+
* reachable without ever reaching it.
|
|
47
|
+
*/
|
|
48
|
+
export interface ConnectionInput {
|
|
49
|
+
/** Present when editing. Absent creates a new connection. */
|
|
50
|
+
id?: string;
|
|
51
|
+
name: string;
|
|
52
|
+
description?: string;
|
|
53
|
+
kind: CatalogConnection['kind'];
|
|
54
|
+
config: Record<string, unknown>;
|
|
55
|
+
secretEnvVar?: string;
|
|
56
|
+
}
|
|
57
|
+
/** Same rule as {@link ConnectionInput}: authored fields only, never state. */
|
|
58
|
+
export interface ConnectorInput {
|
|
59
|
+
id?: string;
|
|
60
|
+
name: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
kind: CatalogConnector['kind'];
|
|
63
|
+
targetType: string;
|
|
64
|
+
config: Record<string, unknown>;
|
|
65
|
+
connectionId?: string;
|
|
66
|
+
secretEnvVar?: string;
|
|
67
|
+
transformId?: string;
|
|
68
|
+
schedule?: string;
|
|
69
|
+
mode?: 'full' | 'incremental';
|
|
70
|
+
enabled: boolean;
|
|
71
|
+
}
|
|
72
|
+
export interface TransformInput {
|
|
73
|
+
id?: string;
|
|
74
|
+
name: string;
|
|
75
|
+
description?: string;
|
|
76
|
+
language: TransformLanguage;
|
|
77
|
+
code: string;
|
|
78
|
+
}
|
|
79
|
+
/** The three answers a console can give somebody about what they may do. */
|
|
80
|
+
export type CatalogPersonRole = 'viewer' | 'curator' | 'admin';
|
|
81
|
+
/**
|
|
82
|
+
* Who the server thinks is calling, as the access screen needs it.
|
|
83
|
+
*
|
|
84
|
+
* A prop rather than something this package fetches, because signing in is not
|
|
85
|
+
* part of the catalog's surface: a host may use a session cookie, OIDC, a
|
|
86
|
+
* reverse proxy header or nothing at all, and a library that fetched
|
|
87
|
+
* `/auth/me` would be dictating the answer.
|
|
88
|
+
*
|
|
89
|
+
* `actor` carries the distinction the whole screen exists to make. Non-null
|
|
90
|
+
* means a person is behind this request and `principalId` names them; null means
|
|
91
|
+
* an application key is, and nothing anyone does will be attributable to a
|
|
92
|
+
* human.
|
|
93
|
+
*/
|
|
94
|
+
export interface CatalogIdentity {
|
|
95
|
+
principalId: string;
|
|
96
|
+
displayName: string;
|
|
97
|
+
actor: {
|
|
98
|
+
id: string;
|
|
99
|
+
displayName: string;
|
|
100
|
+
} | null;
|
|
101
|
+
scopes: string[];
|
|
102
|
+
writeTypes: string[];
|
|
103
|
+
/** Null means every type, which is not the same as an empty list. */
|
|
104
|
+
readTypes: string[] | null;
|
|
105
|
+
classifications: string[];
|
|
106
|
+
session: {
|
|
107
|
+
expiresAt: string;
|
|
108
|
+
idleMinutes: number;
|
|
109
|
+
} | null;
|
|
110
|
+
}
|
|
111
|
+
/** An application: holds a credential, acts on its own behalf. */
|
|
112
|
+
export interface CatalogPrincipalSummary {
|
|
113
|
+
id: string;
|
|
114
|
+
displayName: string;
|
|
115
|
+
scopes: string[];
|
|
116
|
+
writeTypes: string[];
|
|
117
|
+
readTypes: string[] | null;
|
|
118
|
+
classifications: string[];
|
|
119
|
+
active: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* How it authenticates. Never the credential itself — a console that can
|
|
122
|
+
* display one is a console that leaks it over somebody's shoulder.
|
|
123
|
+
*/
|
|
124
|
+
authMethod: 'key' | 'token' | 'session';
|
|
125
|
+
lastSeenAt: string | null;
|
|
126
|
+
ownedTypes: string[];
|
|
127
|
+
}
|
|
128
|
+
/** A person: signs in, and acts through an application that caps them. */
|
|
129
|
+
export interface CatalogPersonSummary {
|
|
130
|
+
email: string;
|
|
131
|
+
displayName: string;
|
|
132
|
+
role: CatalogPersonRole;
|
|
133
|
+
active: boolean;
|
|
134
|
+
/** Exactly the string their actions land in the audit trail as. */
|
|
135
|
+
principalId: string;
|
|
136
|
+
hasPassword: boolean;
|
|
137
|
+
createdAt: string;
|
|
138
|
+
lastLoginAt: string | null;
|
|
139
|
+
liveSessions: number;
|
|
140
|
+
/**
|
|
141
|
+
* The intersection with the application they sign in through, not the role in
|
|
142
|
+
* the abstract. An administrator whose console has had `catalog:admin` removed
|
|
143
|
+
* is not an administrator, and showing the role alone would say otherwise.
|
|
144
|
+
*/
|
|
145
|
+
effective: {
|
|
146
|
+
scopes: string[];
|
|
147
|
+
writeTypes: string[];
|
|
148
|
+
readTypes: string[] | null;
|
|
149
|
+
classifications: string[];
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
export interface PersonInput {
|
|
153
|
+
email: string;
|
|
154
|
+
displayName: string;
|
|
155
|
+
role: CatalogPersonRole;
|
|
156
|
+
password?: string;
|
|
157
|
+
active?: boolean;
|
|
158
|
+
}
|
|
159
|
+
export interface PersonUpsertResult {
|
|
160
|
+
email: string;
|
|
161
|
+
created: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Whether open sessions were invalidated. Surfaced because demoting somebody
|
|
164
|
+
* whose tabs keep working is the failure that makes people distrust the whole
|
|
165
|
+
* session system.
|
|
166
|
+
*/
|
|
167
|
+
sessionsRevoked: boolean;
|
|
168
|
+
}
|
|
169
|
+
export interface CatalogClient {
|
|
170
|
+
snapshot(): Promise<CatalogSnapshot>;
|
|
171
|
+
objects(type: string, params: ObjectQueryParams): Promise<CatalogObjectPage>;
|
|
172
|
+
patchType(name: string, patch: TypePatch): Promise<unknown>;
|
|
173
|
+
patchProperty(name: string, property: string, patch: PropertyPatch): Promise<unknown>;
|
|
174
|
+
reset(): Promise<CatalogSnapshot>;
|
|
175
|
+
queryRelations(): Promise<CatalogQueryRelation[]>;
|
|
176
|
+
runQuery(input: {
|
|
177
|
+
sql: string;
|
|
178
|
+
maxRows?: number;
|
|
179
|
+
}): Promise<CatalogQueryResult>;
|
|
180
|
+
workspaceCapabilities(): Promise<{
|
|
181
|
+
workspace: boolean;
|
|
182
|
+
query: boolean;
|
|
183
|
+
}>;
|
|
184
|
+
listSavedQueries(): Promise<SavedQuery[]>;
|
|
185
|
+
saveQuery(input: SaveQueryInput): Promise<SavedQuery>;
|
|
186
|
+
updateSavedQuery(id: string, input: Partial<SaveQueryInput>): Promise<SavedQuery>;
|
|
187
|
+
deleteSavedQuery(id: string): Promise<{
|
|
188
|
+
deleted: boolean;
|
|
189
|
+
}>;
|
|
190
|
+
runSavedQuery(id: string): Promise<{
|
|
191
|
+
savedQuery: SavedQuery;
|
|
192
|
+
result: CatalogQueryResult;
|
|
193
|
+
}>;
|
|
194
|
+
exportUrl(id: string): string;
|
|
195
|
+
listDashboards(): Promise<Dashboard[]>;
|
|
196
|
+
saveDashboard(input: {
|
|
197
|
+
name: string;
|
|
198
|
+
description?: string;
|
|
199
|
+
}): Promise<Dashboard>;
|
|
200
|
+
updateDashboard(id: string, input: Partial<{
|
|
201
|
+
name: string;
|
|
202
|
+
description: string;
|
|
203
|
+
cards: DashboardCard[];
|
|
204
|
+
}>): Promise<Dashboard>;
|
|
205
|
+
deleteDashboard(id: string): Promise<{
|
|
206
|
+
deleted: boolean;
|
|
207
|
+
}>;
|
|
208
|
+
listEvents(query: {
|
|
209
|
+
event?: string;
|
|
210
|
+
typeName?: string;
|
|
211
|
+
principalId?: string;
|
|
212
|
+
limit?: number;
|
|
213
|
+
}): Promise<CatalogAuditEvent[]>;
|
|
214
|
+
/**
|
|
215
|
+
* The same events, grouped into one causal story each.
|
|
216
|
+
*
|
|
217
|
+
* Beside `listEvents` rather than replacing it: a flat feed answers "what
|
|
218
|
+
* happened recently" and a trace answers "what happened during that load",
|
|
219
|
+
* and collapsing the two would cost the first question its answer.
|
|
220
|
+
*/
|
|
221
|
+
listTraces(query: TraceQuery): Promise<CatalogTraceList>;
|
|
222
|
+
/**
|
|
223
|
+
* Getting data in.
|
|
224
|
+
*
|
|
225
|
+
* On the same client as everything above rather than in a fetch module beside
|
|
226
|
+
* the screens, because a host configures its transport exactly once — base
|
|
227
|
+
* URL, auth, retries, error reporting — and a second module bound to a second
|
|
228
|
+
* transport makes the pipeline screens the ones that authenticate differently.
|
|
229
|
+
* That difference is invisible until the day a token refresh lands in one and
|
|
230
|
+
* not the other.
|
|
231
|
+
*/
|
|
232
|
+
pipelineCapabilities(): Promise<PipelineCapabilities>;
|
|
233
|
+
listConnections(): Promise<CatalogConnection[]>;
|
|
234
|
+
saveConnection(input: ConnectionInput): Promise<CatalogConnection>;
|
|
235
|
+
/**
|
|
236
|
+
* Reach it, and find out what answered.
|
|
237
|
+
*
|
|
238
|
+
* The server records the outcome as well as returning it, so the list can say
|
|
239
|
+
* which connections are known to work without every page load reaching every
|
|
240
|
+
* system it names.
|
|
241
|
+
*/
|
|
242
|
+
checkConnection(id: string): Promise<ConnectionCheck>;
|
|
243
|
+
/** Which connectors read through it. Named, so a refusal can say which. */
|
|
244
|
+
connectionConnectors(id: string): Promise<CatalogConnector[]>;
|
|
245
|
+
deleteConnection(id: string): Promise<{
|
|
246
|
+
deleted: boolean;
|
|
247
|
+
}>;
|
|
248
|
+
listConnectors(): Promise<CatalogConnector[]>;
|
|
249
|
+
saveConnector(input: ConnectorInput): Promise<CatalogConnector>;
|
|
250
|
+
deleteConnector(id: string): Promise<{
|
|
251
|
+
deleted: boolean;
|
|
252
|
+
}>;
|
|
253
|
+
runConnector(id: string): Promise<ConnectorRun>;
|
|
254
|
+
listRuns(connectorId?: string): Promise<ConnectorRun[]>;
|
|
255
|
+
listTransforms(): Promise<CatalogTransform[]>;
|
|
256
|
+
saveTransform(input: TransformInput): Promise<CatalogTransform>;
|
|
257
|
+
deleteTransform(id: string): Promise<{
|
|
258
|
+
deleted: boolean;
|
|
259
|
+
}>;
|
|
260
|
+
/**
|
|
261
|
+
* Run code against sample records without storing anything.
|
|
262
|
+
*
|
|
263
|
+
* The difference between a transform somebody can iterate on and one they can
|
|
264
|
+
* only test in production.
|
|
265
|
+
*/
|
|
266
|
+
tryTransform(input: {
|
|
267
|
+
language: TransformLanguage;
|
|
268
|
+
code: string;
|
|
269
|
+
records: unknown[];
|
|
270
|
+
}): Promise<TransformResult>;
|
|
271
|
+
/**
|
|
272
|
+
* Authored graphs: sources wired through transforms into sinks.
|
|
273
|
+
*
|
|
274
|
+
* `saveWorkflow` is the authority on whether a graph is legal. The canvas runs
|
|
275
|
+
* core's own `validateWorkflow` while somebody draws — literally the same
|
|
276
|
+
* function, shipped to the browser from `@dudousxd/nestjs-catalog/client` — so
|
|
277
|
+
* that a cycle or a dead-end branch is reported beside the node that caused it
|
|
278
|
+
* rather than as a toast a minute later. Sharing the code is not the same as
|
|
279
|
+
* trusting the client: this call is still made, and its refusal always wins.
|
|
280
|
+
*/
|
|
281
|
+
listWorkflows(): Promise<CatalogWorkflow[]>;
|
|
282
|
+
saveWorkflow(input: WorkflowInput): Promise<CatalogWorkflow>;
|
|
283
|
+
deleteWorkflow(id: string): Promise<{
|
|
284
|
+
deleted: boolean;
|
|
285
|
+
}>;
|
|
286
|
+
/**
|
|
287
|
+
* Execute it. When a durable engine is available each node runs as its own
|
|
288
|
+
* step, so a failure part-way resumes rather than restarts — see
|
|
289
|
+
* `PipelineCapabilities.durable`, which is what the screen states.
|
|
290
|
+
*/
|
|
291
|
+
runWorkflow(id: string): Promise<WorkflowRun>;
|
|
292
|
+
/**
|
|
293
|
+
* Who may do what.
|
|
294
|
+
*
|
|
295
|
+
* Reads only. Creating a person is a write and it is here too, because an
|
|
296
|
+
* account has to be creatable by somebody who is not holding a database
|
|
297
|
+
* client — but granting an *application* access to a type is deliberately not,
|
|
298
|
+
* for the reason it never was: it has real blast radius, and the moment it
|
|
299
|
+
* becomes a button it stops leaving a reviewable trail.
|
|
300
|
+
*/
|
|
301
|
+
listPrincipals(): Promise<CatalogPrincipalSummary[]>;
|
|
302
|
+
listPeople(): Promise<CatalogPersonSummary[]>;
|
|
303
|
+
upsertPerson(input: PersonInput): Promise<PersonUpsertResult>;
|
|
304
|
+
}
|
|
305
|
+
export interface CatalogProviderProps {
|
|
306
|
+
transport: CatalogTransport;
|
|
307
|
+
/**
|
|
308
|
+
* Where the host mounted the pipeline endpoints, relative to whatever base the
|
|
309
|
+
* transport prepends.
|
|
310
|
+
*
|
|
311
|
+
* A prop rather than a constant because, unlike `/catalog`, these are not
|
|
312
|
+
* paths this library serves — see `routes.ts` for the full argument. The
|
|
313
|
+
* default matches the shape the shipped screens document, so a host following
|
|
314
|
+
* the README passes nothing.
|
|
315
|
+
*/
|
|
316
|
+
pipelineBasePath?: string;
|
|
317
|
+
/** Same, for the access endpoints. */
|
|
318
|
+
accessBasePath?: string;
|
|
319
|
+
children: ReactNode;
|
|
320
|
+
}
|
|
321
|
+
export declare function CatalogProvider({ transport, pipelineBasePath, accessBasePath, children, }: CatalogProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
322
|
+
export declare function useCatalogClient(): CatalogClient;
|
|
323
|
+
/** Query keys, exported so a host can invalidate them from its own code. */
|
|
324
|
+
export declare const catalogQueryKeys: {
|
|
325
|
+
all: readonly ["nestjs-catalog"];
|
|
326
|
+
snapshot: readonly ["nestjs-catalog", "snapshot"];
|
|
327
|
+
objects: (type: string, params: ObjectQueryParams) => readonly ["nestjs-catalog", "objects", string, ObjectQueryParams];
|
|
328
|
+
/**
|
|
329
|
+
* The pipeline keys are nested under one prefix so a host — or a screen that
|
|
330
|
+
* just ran a connector — can invalidate the whole of it at once. Running a
|
|
331
|
+
* connector changes the runs, the connector's own last-run fields, and the
|
|
332
|
+
* catalog snapshot the load wrote into, and invalidating them one by one is
|
|
333
|
+
* how a list ends up showing a run that finished next to a connector that
|
|
334
|
+
* still says it never has.
|
|
335
|
+
*/
|
|
336
|
+
pipeline: readonly ["nestjs-catalog", "pipeline"];
|
|
337
|
+
capabilities: readonly ["nestjs-catalog", "pipeline", "capabilities"];
|
|
338
|
+
connections: readonly ["nestjs-catalog", "pipeline", "connections"];
|
|
339
|
+
connectors: readonly ["nestjs-catalog", "pipeline", "connectors"];
|
|
340
|
+
transforms: readonly ["nestjs-catalog", "pipeline", "transforms"];
|
|
341
|
+
runs: (connectorId?: string) => readonly ["nestjs-catalog", "pipeline", "runs", string];
|
|
342
|
+
workflows: readonly ["nestjs-catalog", "pipeline", "workflows"];
|
|
343
|
+
access: readonly ["nestjs-catalog", "access"];
|
|
344
|
+
principals: readonly ["nestjs-catalog", "access", "principals"];
|
|
345
|
+
people: readonly ["nestjs-catalog", "access", "people"];
|
|
346
|
+
};
|
package/dist/context.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { catalogRoutes } from '@dudousxd/nestjs-catalog/client';
|
|
3
|
+
import { createContext, useContext, useMemo } from 'react';
|
|
4
|
+
import { DEFAULT_ACCESS_BASE_PATH, DEFAULT_PIPELINE_BASE_PATH, accessRoutes, pipelineRoutes, } from './routes';
|
|
5
|
+
const CatalogContext = createContext(null);
|
|
6
|
+
export function CatalogProvider({ transport, pipelineBasePath = DEFAULT_PIPELINE_BASE_PATH, accessBasePath = DEFAULT_ACCESS_BASE_PATH, children, }) {
|
|
7
|
+
const client = useMemo(() => {
|
|
8
|
+
const pipeline = pipelineRoutes(pipelineBasePath);
|
|
9
|
+
const access = accessRoutes(accessBasePath);
|
|
10
|
+
return {
|
|
11
|
+
snapshot: () => transport.get(catalogRoutes.snapshot()),
|
|
12
|
+
objects: (type, params) => transport.get(catalogRoutes.objects(type), {
|
|
13
|
+
...params,
|
|
14
|
+
}),
|
|
15
|
+
patchType: (name, patch) => transport.patch(catalogRoutes.type(name), patch),
|
|
16
|
+
patchProperty: (name, property, patch) => transport.patch(catalogRoutes.property(name, property), patch),
|
|
17
|
+
reset: () => transport.post(catalogRoutes.reset()),
|
|
18
|
+
queryRelations: () => transport.get(catalogRoutes.queryRelations()),
|
|
19
|
+
runQuery: (input) => transport.post(catalogRoutes.query(), input),
|
|
20
|
+
workspaceCapabilities: () => transport.get(catalogRoutes.workspaceCapabilities()),
|
|
21
|
+
listSavedQueries: () => transport.get(catalogRoutes.savedQueries()),
|
|
22
|
+
saveQuery: (input) => transport.post(catalogRoutes.savedQueries(), input),
|
|
23
|
+
updateSavedQuery: (id, input) => transport.patch(catalogRoutes.savedQuery(id), input),
|
|
24
|
+
deleteSavedQuery: (id) => transport.delete(catalogRoutes.savedQuery(id)),
|
|
25
|
+
runSavedQuery: (id) => transport.post(catalogRoutes.runSavedQuery(id), {}),
|
|
26
|
+
// A URL rather than a fetch: an export the browser downloads itself can
|
|
27
|
+
// be a link, and a link can be copied, bookmarked or scheduled.
|
|
28
|
+
exportUrl: (id) => `/api${catalogRoutes.exportSavedQuery(id)}`,
|
|
29
|
+
listDashboards: () => transport.get(catalogRoutes.dashboards()),
|
|
30
|
+
saveDashboard: (input) => transport.post(catalogRoutes.dashboards(), input),
|
|
31
|
+
updateDashboard: (id, input) => transport.patch(catalogRoutes.dashboard(id), input),
|
|
32
|
+
deleteDashboard: (id) => transport.delete(catalogRoutes.dashboard(id)),
|
|
33
|
+
listEvents: (query) => transport.get(catalogRoutes.events(), { ...query }),
|
|
34
|
+
listTraces: (query) => transport.get(catalogRoutes.traces(), { ...query }),
|
|
35
|
+
pipelineCapabilities: () => transport.get(pipeline.capabilities()),
|
|
36
|
+
listConnections: () => transport.get(pipeline.connections()),
|
|
37
|
+
saveConnection: (input) => transport.post(pipeline.connections(), input),
|
|
38
|
+
checkConnection: (id) => transport.post(pipeline.checkConnection(id), {}),
|
|
39
|
+
connectionConnectors: (id) => transport.get(pipeline.connectionConnectors(id)),
|
|
40
|
+
deleteConnection: (id) => transport.delete(pipeline.connection(id)),
|
|
41
|
+
listConnectors: () => transport.get(pipeline.connectors()),
|
|
42
|
+
saveConnector: (input) => transport.post(pipeline.connectors(), input),
|
|
43
|
+
deleteConnector: (id) => transport.delete(pipeline.connector(id)),
|
|
44
|
+
runConnector: (id) => transport.post(pipeline.runConnector(id), {}),
|
|
45
|
+
// The parameter is omitted rather than sent empty when no connector is
|
|
46
|
+
// named, because a transport that serialises `connector=` turns "every
|
|
47
|
+
// run" into "runs of the connector whose id is the empty string", which
|
|
48
|
+
// is an empty list that looks like a system that has never run anything.
|
|
49
|
+
listRuns: (connectorId) => transport.get(pipeline.runs(), connectorId ? { connector: connectorId } : undefined),
|
|
50
|
+
listTransforms: () => transport.get(pipeline.transforms()),
|
|
51
|
+
saveTransform: (input) => transport.post(pipeline.transforms(), input),
|
|
52
|
+
deleteTransform: (id) => transport.delete(pipeline.transform(id)),
|
|
53
|
+
tryTransform: (input) => transport.post(pipeline.tryTransform(), input),
|
|
54
|
+
listWorkflows: () => transport.get(pipeline.workflows()),
|
|
55
|
+
saveWorkflow: (input) => transport.post(pipeline.workflows(), input),
|
|
56
|
+
deleteWorkflow: (id) => transport.delete(pipeline.workflow(id)),
|
|
57
|
+
runWorkflow: (id) => transport.post(pipeline.runWorkflow(id), {}),
|
|
58
|
+
listPrincipals: () => transport.get(access.principals()),
|
|
59
|
+
listPeople: () => transport.get(access.people()),
|
|
60
|
+
upsertPerson: (input) => transport.post(access.people(), input),
|
|
61
|
+
};
|
|
62
|
+
}, [transport, pipelineBasePath, accessBasePath]);
|
|
63
|
+
return _jsx(CatalogContext.Provider, { value: client, children: children });
|
|
64
|
+
}
|
|
65
|
+
export function useCatalogClient() {
|
|
66
|
+
const client = useContext(CatalogContext);
|
|
67
|
+
if (!client) {
|
|
68
|
+
throw new Error('Catalog screens must be rendered inside <CatalogProvider transport={...}>.');
|
|
69
|
+
}
|
|
70
|
+
return client;
|
|
71
|
+
}
|
|
72
|
+
/** Query keys, exported so a host can invalidate them from its own code. */
|
|
73
|
+
export const catalogQueryKeys = {
|
|
74
|
+
all: ['nestjs-catalog'],
|
|
75
|
+
snapshot: ['nestjs-catalog', 'snapshot'],
|
|
76
|
+
objects: (type, params) => ['nestjs-catalog', 'objects', type, params],
|
|
77
|
+
/**
|
|
78
|
+
* The pipeline keys are nested under one prefix so a host — or a screen that
|
|
79
|
+
* just ran a connector — can invalidate the whole of it at once. Running a
|
|
80
|
+
* connector changes the runs, the connector's own last-run fields, and the
|
|
81
|
+
* catalog snapshot the load wrote into, and invalidating them one by one is
|
|
82
|
+
* how a list ends up showing a run that finished next to a connector that
|
|
83
|
+
* still says it never has.
|
|
84
|
+
*/
|
|
85
|
+
pipeline: ['nestjs-catalog', 'pipeline'],
|
|
86
|
+
capabilities: ['nestjs-catalog', 'pipeline', 'capabilities'],
|
|
87
|
+
connections: ['nestjs-catalog', 'pipeline', 'connections'],
|
|
88
|
+
connectors: ['nestjs-catalog', 'pipeline', 'connectors'],
|
|
89
|
+
transforms: ['nestjs-catalog', 'pipeline', 'transforms'],
|
|
90
|
+
runs: (connectorId) => ['nestjs-catalog', 'pipeline', 'runs', connectorId ?? 'all'],
|
|
91
|
+
workflows: ['nestjs-catalog', 'pipeline', 'workflows'],
|
|
92
|
+
access: ['nestjs-catalog', 'access'],
|
|
93
|
+
principals: ['nestjs-catalog', 'access', 'principals'],
|
|
94
|
+
people: ['nestjs-catalog', 'access', 'people'],
|
|
95
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export { CatalogManager, type CatalogManagerProps } from './CatalogManager';
|
|
2
|
+
export { CoverageLedger } from './CoverageLedger';
|
|
3
|
+
export { EditableField } from './EditableField';
|
|
4
|
+
export { cn } from './cn';
|
|
5
|
+
export { ObjectExplorer, type ObjectExplorerProps } from './ObjectExplorer';
|
|
6
|
+
export { DashboardBoard } from './DashboardBoard';
|
|
7
|
+
export { CHART_COLORS, type ChartRenderer, type ChartRendererProps, getChartRenderer, registerChartRenderer, registeredChartLibraries, seriesFrom, } from './charts/registry';
|
|
8
|
+
export { ChartEmpty, ChartFailed, ChartSkeleton, type ChartSkeletonProps, } from './charts/skeleton';
|
|
9
|
+
export { CssBarChart, looksLikeTimeSeries } from './charts/css';
|
|
10
|
+
export { FlowView } from './FlowView';
|
|
11
|
+
export { GovernanceTimeline } from './GovernanceTimeline';
|
|
12
|
+
export { QueryConsole, type QueryConsoleProps } from './QueryConsole';
|
|
13
|
+
export { SavedQueryPanel } from './SavedQueryPanel';
|
|
14
|
+
export { CATALOG_EVENT_META, type CatalogTraceSource, eventMeta, TraceExplorer, useTraceSource, } from './TraceExplorer';
|
|
15
|
+
export { ConnectionPanel, type ConnectionPanelProps, connectionOptionsFor, describeConnection, } from './ConnectionPanel';
|
|
16
|
+
export { PipelineConsole, type PipelineConsoleProps } from './PipelineConsole';
|
|
17
|
+
export { TransformEditor, type TransformEditorProps } from './TransformEditor';
|
|
18
|
+
export { AccessConsole, type AccessConsoleProps } from './AccessConsole';
|
|
19
|
+
export { type CatalogWorkflow, describeDurability, isWorkflowNodeKind, newLocalId, nodeName, producedTypes, WORKFLOW_NODE_ID_PATTERN, WORKFLOW_NODE_KINDS, type WorkflowDurability, type WorkflowEdge, type WorkflowGraph, type WorkflowInput, type WorkflowNode, type WorkflowNodeKind, type WorkflowRun, type WorkflowRunNode, type WorkflowSinkNode, type WorkflowSourceNode, type WorkflowTransformNode, } from './workflow/model';
|
|
20
|
+
export { WORKFLOW_NAME } from './workflow/name';
|
|
21
|
+
export { canConnect, type ConnectionVerdict, edgeId, hasBlockingProblem, problemsByNode, validateWorkflow, type WorkflowProblem, type WorkflowProblemCode, wouldCycle, } from './workflow/validate';
|
|
22
|
+
export { type CatalogClient, type CatalogIdentity, type CatalogPersonRole, type CatalogPersonSummary, type CatalogPrincipalSummary, CatalogProvider, type CatalogProviderProps, type CatalogTransport, type ConnectionInput, type ConnectorInput, catalogQueryKeys, type PersonInput, type PersonUpsertResult, type PipelineCapabilities, type TransformInput, useCatalogClient, } from './context';
|
|
23
|
+
export { type AccessRoutes, accessRoutes, DEFAULT_ACCESS_BASE_PATH, DEFAULT_PIPELINE_BASE_PATH, type PipelineRoutes, pipelineRoutes, } from './routes';
|
|
24
|
+
export { ConfirmDialog } from './ui/dialog';
|
|
25
|
+
export { FieldGroup, TextAreaField, TextField } from './ui/field';
|
|
26
|
+
export { Select, SelectField, type SelectOption } from './ui/select';
|
|
27
|
+
export { Switch } from './ui/switch';
|
|
28
|
+
export { Sheet } from './ui/sheet';
|
|
29
|
+
export { Tabs, TabsList, TabsPanel, TabsTab } from './ui/tabs';
|
|
30
|
+
export { Tooltip, TooltipProvider } from './ui/tooltip';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export { CatalogManager } from './CatalogManager';
|
|
2
|
+
export { CoverageLedger } from './CoverageLedger';
|
|
3
|
+
export { EditableField } from './EditableField';
|
|
4
|
+
export { cn } from './cn';
|
|
5
|
+
export { ObjectExplorer } from './ObjectExplorer';
|
|
6
|
+
export { DashboardBoard } from './DashboardBoard';
|
|
7
|
+
export { CHART_COLORS, getChartRenderer, registerChartRenderer, registeredChartLibraries, seriesFrom, } from './charts/registry';
|
|
8
|
+
export { ChartEmpty, ChartFailed, ChartSkeleton, } from './charts/skeleton';
|
|
9
|
+
// The fallback every other renderer degrades to, and the guard that decides
|
|
10
|
+
// when a time-scale chart cannot draw what a saved query asked for.
|
|
11
|
+
export { CssBarChart, looksLikeTimeSeries } from './charts/css';
|
|
12
|
+
export { FlowView } from './FlowView';
|
|
13
|
+
export { GovernanceTimeline } from './GovernanceTimeline';
|
|
14
|
+
export { QueryConsole } from './QueryConsole';
|
|
15
|
+
export { SavedQueryPanel } from './SavedQueryPanel';
|
|
16
|
+
export { CATALOG_EVENT_META, eventMeta, TraceExplorer, useTraceSource, } from './TraceExplorer';
|
|
17
|
+
// Getting data in: connections, connectors and the code that reshapes what they
|
|
18
|
+
// fetch. These used to live in the consuming app, which meant any other host
|
|
19
|
+
// installing this package got a console with no way to manage a load.
|
|
20
|
+
export { ConnectionPanel, connectionOptionsFor, describeConnection, } from './ConnectionPanel';
|
|
21
|
+
export { PipelineConsole } from './PipelineConsole';
|
|
22
|
+
export { TransformEditor } from './TransformEditor';
|
|
23
|
+
export { AccessConsole } from './AccessConsole';
|
|
24
|
+
// The authored graph: sources wired through transforms into sinks.
|
|
25
|
+
//
|
|
26
|
+
// `<WorkflowCanvas />` itself is **not** exported here. It imports
|
|
27
|
+
// `@xyflow/react`, which is an optional peer, and anything reachable from this
|
|
28
|
+
// entry point is resolved by the host's bundler whether or not the host renders
|
|
29
|
+
// it — so exporting it here would make every consumer install React Flow to
|
|
30
|
+
// build at all. It lives on its own subpath instead, exactly as the chart
|
|
31
|
+
// renderers do:
|
|
32
|
+
//
|
|
33
|
+
// import { WorkflowCanvas } from "@dudousxd/nestjs-catalog-react/workflow";
|
|
34
|
+
//
|
|
35
|
+
// The model, the name and the validation rules have no React Flow import and
|
|
36
|
+
// stay here, so a host can talk about a workflow — or check one — without
|
|
37
|
+
// installing a canvas.
|
|
38
|
+
//
|
|
39
|
+
// Deliberately not named after `FlowView`, which derives lineage from what
|
|
40
|
+
// publishers actually did; this executes a graph somebody wrote.
|
|
41
|
+
//
|
|
42
|
+
// Most of what follows is re-exported from `@dudousxd/nestjs-catalog/client`
|
|
43
|
+
// rather than declared here — a node, an edge and a graph have one definition,
|
|
44
|
+
// and it belongs to the package that executes them. See `workflow/model.ts`.
|
|
45
|
+
export { describeDurability, isWorkflowNodeKind, newLocalId, nodeName, producedTypes, WORKFLOW_NODE_ID_PATTERN, WORKFLOW_NODE_KINDS, } from './workflow/model';
|
|
46
|
+
export { WORKFLOW_NAME } from './workflow/name';
|
|
47
|
+
// Core's rules, run in the browser, plus the two questions core cannot answer:
|
|
48
|
+
// whether a connection is legal mid-drag, and whether a node names a transform
|
|
49
|
+
// that still exists. Exported so a host can run the same checks before it offers
|
|
50
|
+
// a save — never so it can skip the server's, which is the authority.
|
|
51
|
+
export { canConnect, edgeId, hasBlockingProblem, problemsByNode, validateWorkflow, wouldCycle, } from './workflow/validate';
|
|
52
|
+
export { CatalogProvider, catalogQueryKeys, useCatalogClient, } from './context';
|
|
53
|
+
// The paths behind the pipeline and access screens, exported so a host can
|
|
54
|
+
// mount those endpoints wherever it likes and tell the provider where they are.
|
|
55
|
+
// See routes.ts for why they are here rather than in the server package.
|
|
56
|
+
export { accessRoutes, DEFAULT_ACCESS_BASE_PATH, DEFAULT_PIPELINE_BASE_PATH, pipelineRoutes, } from './routes';
|
|
57
|
+
// The vendored primitives. Exported because a host composing its own screen out
|
|
58
|
+
// of this package's parts should not have to rebuild a tooltip to match.
|
|
59
|
+
export { ConfirmDialog } from './ui/dialog';
|
|
60
|
+
export { FieldGroup, TextAreaField, TextField } from './ui/field';
|
|
61
|
+
export { Select, SelectField } from './ui/select';
|
|
62
|
+
export { Switch } from './ui/switch';
|
|
63
|
+
export { Sheet } from './ui/sheet';
|
|
64
|
+
export { Tabs, TabsList, TabsPanel, TabsTab } from './ui/tabs';
|
|
65
|
+
export { Tooltip, TooltipProvider } from './ui/tooltip';
|