@dudousxd/nestjs-catalog-react 0.34.2 → 0.36.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 +1 -0
- package/dist/AccessConsole.d.ts +1 -1
- package/dist/AccessConsole.js +19 -19
- package/dist/CatalogManager.js +11 -11
- package/dist/ConnectionPanel.js +9 -9
- package/dist/CoverageLedger.js +1 -1
- package/dist/DashboardBoard.js +10 -10
- package/dist/EditableField.js +1 -1
- package/dist/FlowView.js +4 -4
- package/dist/GovernanceTimeline.d.ts +1 -1
- package/dist/GovernanceTimeline.js +10 -8
- package/dist/LoadExpectationSection.js +6 -6
- package/dist/LoadedBySection.d.ts +1 -1
- package/dist/LoadedBySection.js +4 -4
- package/dist/ObjectExplorer.js +20 -18
- package/dist/PipelineConsole.js +9 -9
- package/dist/QueryConsole.js +7 -7
- package/dist/SavedQueryPanel.js +7 -7
- package/dist/TraceExplorer.d.ts +3 -2
- package/dist/TraceExplorer.js +22 -14
- package/dist/TransformEditor.js +8 -8
- package/dist/WorkflowCanvas.js +30 -30
- package/dist/charts/bklit/area-chart-loading.d.ts +2 -2
- package/dist/charts/bklit/area-chart-loading.js +4 -4
- package/dist/charts/bklit/area-chart.d.ts +3 -3
- package/dist/charts/bklit/area-chart.js +7 -7
- package/dist/charts/bklit/area-gradient-defs.d.ts +1 -1
- package/dist/charts/bklit/area-gradient-defs.js +1 -1
- package/dist/charts/bklit/area.d.ts +4 -4
- package/dist/charts/bklit/area.js +11 -11
- package/dist/charts/bklit/bar-chart-loading.d.ts +1 -1
- package/dist/charts/bklit/bar-chart-loading.js +1 -1
- package/dist/charts/bklit/bar-chart.d.ts +2 -2
- package/dist/charts/bklit/bar-chart.js +12 -12
- package/dist/charts/bklit/bar-squares.d.ts +1 -1
- package/dist/charts/bklit/bar-squares.js +5 -5
- package/dist/charts/bklit/bar-x-axis.js +2 -2
- package/dist/charts/bklit/bar-y-axis.js +2 -2
- package/dist/charts/bklit/bar.js +4 -4
- package/dist/charts/bklit/chart-context.d.ts +4 -4
- package/dist/charts/bklit/chart-context.js +1 -1
- package/dist/charts/bklit/chart-loading-label.js +3 -3
- package/dist/charts/bklit/chart-reveal-clip.js +1 -1
- package/dist/charts/bklit/grid.js +3 -3
- package/dist/charts/bklit/highlight-segment-bounds.d.ts +2 -2
- package/dist/charts/bklit/line-chart-loading.d.ts +2 -2
- package/dist/charts/bklit/line-chart-loading.js +4 -4
- package/dist/charts/bklit/line-chart.d.ts +3 -3
- package/dist/charts/bklit/line-chart.js +6 -6
- package/dist/charts/bklit/line-loading-pulse.d.ts +1 -1
- package/dist/charts/bklit/line-loading-pulse.js +3 -3
- package/dist/charts/bklit/line-series-terminal-marker.js +2 -2
- package/dist/charts/bklit/line.d.ts +4 -4
- package/dist/charts/bklit/line.js +11 -11
- package/dist/charts/bklit/loading-sweep.js +2 -2
- package/dist/charts/bklit/motion-utils.js +1 -1
- package/dist/charts/bklit/pattern-area.js +1 -1
- package/dist/charts/bklit/pattern-preset.js +1 -1
- package/dist/charts/bklit/projection-config.d.ts +1 -1
- package/dist/charts/bklit/projection-config.js +3 -3
- package/dist/charts/bklit/projection-line-end-marker.d.ts +1 -1
- package/dist/charts/bklit/projection-line-end-marker.js +1 -1
- package/dist/charts/bklit/projection-line.d.ts +1 -1
- package/dist/charts/bklit/projection-line.js +2 -2
- package/dist/charts/bklit/reference-area-config.js +1 -1
- package/dist/charts/bklit/reference-area-registration-context.d.ts +1 -1
- package/dist/charts/bklit/series-dash-tail-overlay.js +2 -2
- package/dist/charts/bklit/series-highlight-layer.js +3 -3
- package/dist/charts/bklit/series-hover-dim.js +2 -2
- package/dist/charts/bklit/series-markers.d.ts +1 -1
- package/dist/charts/bklit/series-markers.js +4 -4
- package/dist/charts/bklit/series-point-marker.js +1 -1
- package/dist/charts/bklit/time-series-chart-shell.d.ts +2 -2
- package/dist/charts/bklit/time-series-chart-shell.js +20 -20
- package/dist/charts/bklit/tooltip/chart-tooltip.d.ts +4 -4
- package/dist/charts/bklit/tooltip/chart-tooltip.js +8 -8
- package/dist/charts/bklit/tooltip/index.d.ts +6 -6
- package/dist/charts/bklit/tooltip/index.js +6 -6
- package/dist/charts/bklit/tooltip/tooltip-box.d.ts +1 -1
- package/dist/charts/bklit/tooltip/tooltip-box.js +3 -3
- package/dist/charts/bklit/tooltip/tooltip-content.js +1 -1
- package/dist/charts/bklit/tooltip/tooltip-dot.d.ts +1 -1
- package/dist/charts/bklit/tooltip/tooltip-dot.js +2 -2
- package/dist/charts/bklit/tooltip/tooltip-indicator.d.ts +2 -2
- package/dist/charts/bklit/tooltip/tooltip-indicator.js +3 -3
- package/dist/charts/bklit/use-animated-series-path.js +2 -2
- package/dist/charts/bklit/use-animated-y-domains.d.ts +2 -2
- package/dist/charts/bklit/use-animated-y-domains.js +2 -2
- package/dist/charts/bklit/use-chart-interaction.d.ts +1 -1
- package/dist/charts/bklit/use-chart-interaction.js +2 -2
- package/dist/charts/bklit/use-chart-phase-orchestrator.d.ts +1 -1
- package/dist/charts/bklit/use-chart-phase-orchestrator.js +1 -1
- package/dist/charts/bklit/use-grid-shimmer.js +1 -1
- package/dist/charts/bklit/use-highlight-segment.js +3 -3
- package/dist/charts/bklit/use-mount-progress.js +1 -1
- package/dist/charts/bklit/x-axis.js +5 -5
- package/dist/charts/bklit/y-axis-scales.d.ts +1 -1
- package/dist/charts/bklit/y-domain-utils.d.ts +2 -2
- package/dist/charts/bklit/y-domain-utils.js +2 -2
- package/dist/charts/bklit.d.ts +1 -1
- package/dist/charts/bklit.js +11 -11
- package/dist/charts/body.js +4 -4
- package/dist/charts/components/shimmering-text.js +1 -1
- package/dist/charts/css.d.ts +2 -2
- package/dist/charts/css.js +1 -1
- package/dist/charts/recharts.d.ts +1 -1
- package/dist/charts/recharts.js +2 -2
- package/dist/charts/skeleton.js +1 -1
- package/dist/connection-form.js +3 -3
- package/dist/context.d.ts +50 -24
- package/dist/context.js +48 -16
- package/dist/diff/RevisionDiff.d.ts +1 -1
- package/dist/diff/RevisionDiff.js +7 -7
- package/dist/embed/EmbeddedChart.d.ts +2 -2
- package/dist/embed/EmbeddedChart.js +4 -4
- package/dist/embed/EmbeddedDashboard.d.ts +2 -2
- package/dist/embed/EmbeddedDashboard.js +6 -6
- package/dist/embed/actions.d.ts +1 -1
- package/dist/embed/actions.js +2 -2
- package/dist/embed/chart-card.d.ts +2 -2
- package/dist/embed/chart-card.js +7 -7
- package/dist/embed/index.d.ts +5 -5
- package/dist/embed/index.js +4 -4
- package/dist/embed/slots.js +1 -1
- package/dist/export/index.d.ts +6 -6
- package/dist/export/index.js +6 -6
- package/dist/export/pdf.d.ts +2 -2
- package/dist/export/pdf.js +2 -2
- package/dist/export/png.d.ts +1 -1
- package/dist/export/png.js +1 -1
- package/dist/export/serialize.js +1 -1
- package/dist/export/use-pdf-export.d.ts +2 -2
- package/dist/export/use-pdf-export.js +3 -3
- package/dist/export/use-png-export.d.ts +1 -1
- package/dist/export/use-png-export.js +1 -1
- package/dist/index.d.ts +46 -46
- package/dist/index.js +46 -46
- package/dist/routes.d.ts +3 -2
- package/dist/routes.js +4 -4
- package/dist/schema-discovery.js +2 -2
- package/dist/search-console.d.ts +2 -2
- package/dist/search-console.js +8 -8
- package/dist/sharing.js +2 -2
- package/dist/source-connection.d.ts +1 -1
- package/dist/source-connection.js +6 -6
- package/dist/source-fields.d.ts +2 -2
- package/dist/source-fields.js +6 -6
- package/dist/ui/button.js +1 -1
- package/dist/ui/chart.js +1 -1
- package/dist/ui/code-editor.d.ts +2 -2
- package/dist/ui/code-editor.js +2 -2
- package/dist/ui/combobox.js +1 -1
- package/dist/ui/data-table.js +1 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/field.js +1 -1
- package/dist/ui/rich-text-field.js +2 -2
- package/dist/ui/select.js +1 -1
- package/dist/ui/sheet.js +2 -2
- package/dist/ui/switch.js +1 -1
- package/dist/ui/tabs.js +1 -1
- package/dist/ui/tooltip.js +1 -1
- package/dist/workflow/canvas-menu.d.ts +1 -1
- package/dist/workflow/canvas-menu.js +4 -4
- package/dist/workflow/create.d.ts +1 -1
- package/dist/workflow/create.js +4 -4
- package/dist/workflow/edges.d.ts +1 -1
- package/dist/workflow/edges.js +1 -1
- package/dist/workflow/graph.d.ts +2 -2
- package/dist/workflow/graph.js +2 -2
- package/dist/workflow/history.d.ts +1 -1
- package/dist/workflow/history.js +6 -6
- package/dist/workflow/index.d.ts +4 -4
- package/dist/workflow/index.js +4 -4
- package/dist/workflow/lifecycle.d.ts +2 -2
- package/dist/workflow/lifecycle.js +8 -8
- package/dist/workflow/menu.d.ts +2 -2
- package/dist/workflow/menu.js +3 -3
- package/dist/workflow/nodes.d.ts +2 -2
- package/dist/workflow/nodes.js +3 -3
- package/dist/workflow/place.d.ts +1 -1
- package/dist/workflow/place.js +1 -1
- package/dist/workflow/removal.d.ts +1 -1
- package/dist/workflow/removal.js +1 -1
- package/dist/workflow/runs.js +6 -6
- package/dist/workflow/shape.d.ts +1 -1
- package/dist/workflow/shape.js +1 -1
- package/dist/workflow/validate.d.ts +1 -1
- package/dist/workflow/validate.js +3 -3
- package/dist/workflow/wiring.d.ts +1 -1
- package/dist/workflow/wiring.js +4 -4
- package/package.json +9 -6
package/README.md
CHANGED
|
@@ -132,6 +132,7 @@ These routes on top of the pipeline base path, listed by `pipelineRoutes()`:
|
|
|
132
132
|
| `POST {base}/workflows/:id/run` | execute, optionally carrying `expectShrink` |
|
|
133
133
|
| `PUT {base}/workflows/:id/schedule` | set the cron and whether it runs at all |
|
|
134
134
|
| `POST {base}/workflows/:id/nodes/:nodeId/discover` | ask one source what its columns are |
|
|
135
|
+
| `GET {base}/runs` | the newest runs, `filter[connector]=id` and `size`; answers `{ data }` |
|
|
135
136
|
|
|
136
137
|
**A connector is not one of them.** It is what a published graph runs as: minted
|
|
137
138
|
by `publish`, disabled by `unpublish`, removed with the graph, and there is no
|
package/dist/AccessConsole.d.ts
CHANGED
package/dist/AccessConsole.js
CHANGED
|
@@ -2,11 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
3
3
|
import { KeyRound, LogOut, ShieldCheck, ShieldHalf, UserRound } from 'lucide-react';
|
|
4
4
|
import { useState } from 'react';
|
|
5
|
-
import { cn } from './cn';
|
|
6
|
-
import { catalogQueryKeys, useCatalogClient, } from './context';
|
|
7
|
-
import { TextField } from './ui/field';
|
|
8
|
-
import { SelectField } from './ui/select';
|
|
9
|
-
import { Tooltip, TooltipProvider } from './ui/tooltip';
|
|
5
|
+
import { cn } from './cn.js';
|
|
6
|
+
import { catalogQueryKeys, useCatalogClient, } from './context.js';
|
|
7
|
+
import { TextField } from './ui/field.js';
|
|
8
|
+
import { SelectField } from './ui/select.js';
|
|
9
|
+
import { Tooltip, TooltipProvider } from './ui/tooltip.js';
|
|
10
10
|
const MUTED = 'text-zinc-400 dark:text-zinc-500';
|
|
11
11
|
const RULE = 'border-zinc-200 dark:border-zinc-800';
|
|
12
12
|
const PANEL = 'bg-white dark:bg-zinc-900';
|
|
@@ -21,14 +21,14 @@ function PeopleSearch({ value, onChange, }) {
|
|
|
21
21
|
* of UI on, because an operator who reads it as complete concludes somebody has
|
|
22
22
|
* no access when they were merely on the next page.
|
|
23
23
|
*/
|
|
24
|
-
function PageBar({ page,
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
function PageBar({ page, onPage, busy, }) {
|
|
25
|
+
const { total, perPage, currentPage, lastPage } = page.meta;
|
|
26
|
+
const offset = (currentPage - 1) * perPage;
|
|
27
|
+
const shown = page.data.length;
|
|
28
|
+
const first = total === 0 ? 0 : offset + 1;
|
|
29
|
+
const last = offset + shown;
|
|
30
|
+
const hasMore = currentPage < lastPage;
|
|
31
|
+
return (_jsxs("div", { className: cn('mt-3 flex items-center justify-between text-xs', MUTED), children: [_jsx("span", { children: total === 0 ? 'No people' : `Showing ${first}–${last} of ${total.toLocaleString()}` }), (currentPage > 1 || hasMore) && (_jsxs("span", { className: "flex gap-2", children: [_jsx("button", { type: "button", disabled: currentPage <= 1 || busy, onClick: () => onPage(Math.max(1, currentPage - 1)), className: "disabled:opacity-40", children: "Previous" }), _jsx("button", { type: "button", disabled: !hasMore || busy, onClick: () => onPage(currentPage + 1), className: "disabled:opacity-40", children: "Next" })] }))] }));
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* One page answering the two questions a shared catalog creates: which
|
|
@@ -52,10 +52,10 @@ export function AccessConsole({ identity, onSignOut, signOutPending, canAddPeopl
|
|
|
52
52
|
// what it will return regardless of what is asked for. The key carries the
|
|
53
53
|
// query so a search does not read a previous search's page from the cache.
|
|
54
54
|
const [search, setSearch] = useState('');
|
|
55
|
-
const [
|
|
55
|
+
const [page, setPage] = useState(1);
|
|
56
56
|
const people = useQuery({
|
|
57
|
-
queryKey: [...catalogQueryKeys.people, { search,
|
|
58
|
-
queryFn: () => client.listPeople({ ...(search ? { search } : {}),
|
|
57
|
+
queryKey: [...catalogQueryKeys.people, { search, page }],
|
|
58
|
+
queryFn: () => client.listPeople({ ...(search ? { search } : {}), page }),
|
|
59
59
|
staleTime: 30_000,
|
|
60
60
|
// The count and the page it describes must not be shown apart. Without
|
|
61
61
|
// this, typing into the search blanks the list to a spinner and then shows
|
|
@@ -67,11 +67,11 @@ export function AccessConsole({ identity, onSignOut, signOutPending, canAddPeopl
|
|
|
67
67
|
setSearch(next);
|
|
68
68
|
// Back to the first page. Staying on page 3 of the previous
|
|
69
69
|
// search shows an empty list for a search that has matches.
|
|
70
|
-
|
|
70
|
+
setPage(1);
|
|
71
71
|
} }), mayAdminister && _jsx(AddPerson, {}), people.isPending && _jsx(Placeholder, { children: "Reading people\u2026" }), people.isError && (_jsx(Failed, { message: people.error instanceof Error
|
|
72
72
|
? people.error.message
|
|
73
|
-
: 'Could not read the people list.', onRetry: () => people.refetch() })), people.data?.
|
|
74
|
-
(search ? (_jsxs(Placeholder, { children: ["Nobody matches \u201C", search, "\u201D."] })) : (_jsx(Placeholder, { children: "Nobody can sign in yet. Seed the first administrator from the environment before anybody can reach this console as a person." }))), people.data &&
|
|
73
|
+
: 'Could not read the people list.', onRetry: () => people.refetch() })), people.data?.data.map((person) => (_jsx(PersonCard, { person: person }, person.email))), people.data?.data.length === 0 &&
|
|
74
|
+
(search ? (_jsxs(Placeholder, { children: ["Nobody matches \u201C", search, "\u201D."] })) : (_jsx(Placeholder, { children: "Nobody can sign in yet. Seed the first administrator from the environment before anybody can reach this console as a person." }))), people.data && _jsx(PageBar, { page: people.data, onPage: setPage, busy: people.isFetching })] }), _jsxs(Section, { title: "Applications", note: "Provisioned by an operator \u2014 a console that could hand grants out is one that stops leaving a trail.", children: [applications.isPending && _jsx(Placeholder, { children: "Reading applications\u2026" }), applications.isError && (_jsx(Failed, { message: applications.error instanceof Error
|
|
75
75
|
? applications.error.message
|
|
76
76
|
: 'Could not read the application list.', onRetry: () => applications.refetch() })), applications.data?.map((principal) => (_jsx(PrincipalCard, { principal: principal }, principal.id))), applications.data?.length === 0 && (_jsx(Placeholder, { children: "No applications are provisioned." }))] })] }) }));
|
|
77
77
|
}
|
package/dist/CatalogManager.js
CHANGED
|
@@ -2,17 +2,17 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
3
3
|
import { ArrowLeft, ArrowRight, ArrowUpRight, Eye, EyeOff, RotateCcw, Search, Unlink, } from 'lucide-react';
|
|
4
4
|
import { useEffect, useMemo, useState } from 'react';
|
|
5
|
-
import { CoverageLedger } from './CoverageLedger';
|
|
6
|
-
import { EditableField } from './EditableField';
|
|
7
|
-
import { LoadExpectationSection } from './LoadExpectationSection';
|
|
8
|
-
import { LoadedBySection } from './LoadedBySection';
|
|
9
|
-
import { paramFromLocation } from './ObjectExplorer';
|
|
10
|
-
import { cn } from './cn';
|
|
11
|
-
import { catalogQueryKeys, useCatalogClient } from './context';
|
|
12
|
-
import { freshnessOf, isWorthFlagging } from './freshness';
|
|
13
|
-
import { DataTable } from './ui/data-table';
|
|
14
|
-
import { RichTextField } from './ui/rich-text-field';
|
|
15
|
-
import { Tooltip, TooltipProvider } from './ui/tooltip';
|
|
5
|
+
import { CoverageLedger } from './CoverageLedger.js';
|
|
6
|
+
import { EditableField } from './EditableField.js';
|
|
7
|
+
import { LoadExpectationSection } from './LoadExpectationSection.js';
|
|
8
|
+
import { LoadedBySection } from './LoadedBySection.js';
|
|
9
|
+
import { paramFromLocation } from './ObjectExplorer.js';
|
|
10
|
+
import { cn } from './cn.js';
|
|
11
|
+
import { catalogQueryKeys, useCatalogClient } from './context.js';
|
|
12
|
+
import { freshnessOf, isWorthFlagging } from './freshness.js';
|
|
13
|
+
import { DataTable } from './ui/data-table.js';
|
|
14
|
+
import { RichTextField } from './ui/rich-text-field.js';
|
|
15
|
+
import { Tooltip, TooltipProvider } from './ui/tooltip.js';
|
|
16
16
|
/**
|
|
17
17
|
* Browse and label the model.
|
|
18
18
|
*
|
package/dist/ConnectionPanel.js
CHANGED
|
@@ -2,15 +2,15 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
3
3
|
import { CircleCheck, CircleX, KeyRound, Loader2, Pencil, Plug, Plus, Trash2, Waypoints, } from 'lucide-react';
|
|
4
4
|
import { useState } from 'react';
|
|
5
|
-
import { cn } from './cn';
|
|
6
|
-
import { CONNECTION_KIND_OPTIONS, ConnectionCheckResult, ConnectionKindFields, connectionConfigFor, connectionDraftFrom, connectionIsIncomplete, configString as text, toConnectableKind, } from './connection-form';
|
|
7
|
-
import { catalogQueryKeys, useCatalogClient, } from './context';
|
|
8
|
-
import { ConfirmDialog } from './ui/dialog';
|
|
9
|
-
import { TextField } from './ui/field';
|
|
10
|
-
import { SelectField } from './ui/select';
|
|
11
|
-
import { Tooltip } from './ui/tooltip';
|
|
12
|
-
import { nodeName } from './workflow/model';
|
|
13
|
-
import { WORKFLOW_NAME } from './workflow/name';
|
|
5
|
+
import { cn } from './cn.js';
|
|
6
|
+
import { CONNECTION_KIND_OPTIONS, ConnectionCheckResult, ConnectionKindFields, connectionConfigFor, connectionDraftFrom, connectionIsIncomplete, configString as text, toConnectableKind, } from './connection-form.js';
|
|
7
|
+
import { catalogQueryKeys, useCatalogClient, } from './context.js';
|
|
8
|
+
import { ConfirmDialog } from './ui/dialog.js';
|
|
9
|
+
import { TextField } from './ui/field.js';
|
|
10
|
+
import { SelectField } from './ui/select.js';
|
|
11
|
+
import { Tooltip } from './ui/tooltip.js';
|
|
12
|
+
import { nodeName } from './workflow/model.js';
|
|
13
|
+
import { WORKFLOW_NAME } from './workflow/name.js';
|
|
14
14
|
const MUTED = 'text-zinc-400 dark:text-zinc-500';
|
|
15
15
|
const RULE = 'border-zinc-200 dark:border-zinc-800';
|
|
16
16
|
const PANEL = 'bg-white dark:bg-zinc-900';
|
package/dist/CoverageLedger.js
CHANGED
package/dist/DashboardBoard.js
CHANGED
|
@@ -5,16 +5,16 @@ import { CSS } from '@dnd-kit/utilities';
|
|
|
5
5
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
6
6
|
import { Download, GripVertical, LayoutGrid, Link2Off, Plus, RefreshCw, Trash2, } from 'lucide-react';
|
|
7
7
|
import { useEffect, useState } from 'react';
|
|
8
|
-
import { paramFromLocation } from './ObjectExplorer';
|
|
9
|
-
import { ChartBody } from './charts/body';
|
|
10
|
-
import { CHART_GRID, chartSpan } from './charts/grid';
|
|
11
|
-
import { registeredChartLibraries, visualizationFor } from './charts/registry';
|
|
12
|
-
import { ChartFailed, ChartSkeleton } from './charts/skeleton';
|
|
13
|
-
import { cn } from './cn';
|
|
14
|
-
import { useCatalogClient } from './context';
|
|
15
|
-
import { ShareControl } from './sharing';
|
|
16
|
-
import { Select } from './ui/select';
|
|
17
|
-
import { Tooltip, TooltipProvider } from './ui/tooltip';
|
|
8
|
+
import { paramFromLocation } from './ObjectExplorer.js';
|
|
9
|
+
import { ChartBody } from './charts/body.js';
|
|
10
|
+
import { CHART_GRID, chartSpan } from './charts/grid.js';
|
|
11
|
+
import { registeredChartLibraries, visualizationFor } from './charts/registry.js';
|
|
12
|
+
import { ChartFailed, ChartSkeleton } from './charts/skeleton.js';
|
|
13
|
+
import { cn } from './cn.js';
|
|
14
|
+
import { useCatalogClient } from './context.js';
|
|
15
|
+
import { ShareControl } from './sharing.js';
|
|
16
|
+
import { Select } from './ui/select.js';
|
|
17
|
+
import { Tooltip, TooltipProvider } from './ui/tooltip.js';
|
|
18
18
|
const MUTED = 'text-zinc-400 dark:text-zinc-500';
|
|
19
19
|
const RULE = 'border-zinc-200 dark:border-zinc-800';
|
|
20
20
|
const PANEL = 'bg-white dark:bg-zinc-900';
|
package/dist/EditableField.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Check, Pencil, X } from 'lucide-react';
|
|
3
3
|
import { useEffect, useRef, useState } from 'react';
|
|
4
|
-
import { cn } from './cn';
|
|
4
|
+
import { cn } from './cn.js';
|
|
5
5
|
/**
|
|
6
6
|
* Click to edit, Enter to save, Escape to cancel.
|
|
7
7
|
*
|
package/dist/FlowView.js
CHANGED
|
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useQuery } from '@tanstack/react-query';
|
|
3
3
|
import { ArrowRight, CircleAlert, CircleCheck, CircleDot, Link2 } from 'lucide-react';
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
|
-
import { cn } from './cn';
|
|
6
|
-
import { catalogQueryKeys, useCatalogClient } from './context';
|
|
7
|
-
import { Tooltip, TooltipProvider } from './ui/tooltip';
|
|
5
|
+
import { cn } from './cn.js';
|
|
6
|
+
import { catalogQueryKeys, useCatalogClient } from './context.js';
|
|
7
|
+
import { Tooltip, TooltipProvider } from './ui/tooltip.js';
|
|
8
8
|
const MUTED = 'text-zinc-400 dark:text-zinc-500';
|
|
9
9
|
const RULE = 'border-zinc-200 dark:border-zinc-800';
|
|
10
10
|
const PANEL = 'bg-white dark:bg-zinc-900';
|
|
@@ -28,7 +28,7 @@ export function FlowView() {
|
|
|
28
28
|
});
|
|
29
29
|
const { data: events = [], isLoading } = useQuery({
|
|
30
30
|
queryKey: ['catalog', 'flow-events'],
|
|
31
|
-
queryFn: () => client.listEvents({
|
|
31
|
+
queryFn: () => client.listEvents({ size: 500 }).then((page) => page.data),
|
|
32
32
|
refetchInterval: 20_000,
|
|
33
33
|
});
|
|
34
34
|
const lanes = useMemo(() => buildLanes(snapshot?.types ?? [], events), [snapshot, events]);
|
|
@@ -2,11 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useQuery } from '@tanstack/react-query';
|
|
3
3
|
import { List, Waypoints } from 'lucide-react';
|
|
4
4
|
import { useMemo, useState } from 'react';
|
|
5
|
-
import { CATALOG_EVENT_META, TraceExplorer, eventMeta, } from './TraceExplorer';
|
|
6
|
-
import { cn } from './cn';
|
|
7
|
-
import { useCatalogClient } from './context';
|
|
8
|
-
import { Select } from './ui/select';
|
|
9
|
-
import { Tooltip, TooltipProvider } from './ui/tooltip';
|
|
5
|
+
import { CATALOG_EVENT_META, TraceExplorer, eventMeta, } from './TraceExplorer.js';
|
|
6
|
+
import { cn } from './cn.js';
|
|
7
|
+
import { useCatalogClient } from './context.js';
|
|
8
|
+
import { Select } from './ui/select.js';
|
|
9
|
+
import { Tooltip, TooltipProvider } from './ui/tooltip.js';
|
|
10
10
|
const MUTED = 'text-zinc-400 dark:text-zinc-500';
|
|
11
11
|
const RULE = 'border-zinc-200 dark:border-zinc-800';
|
|
12
12
|
const PANEL = 'bg-white dark:bg-zinc-900';
|
|
@@ -38,11 +38,13 @@ export function GovernanceTimeline({ traceSource, } = {}) {
|
|
|
38
38
|
const [principal, setPrincipal] = useState('');
|
|
39
39
|
const { data: events = [], isLoading } = useQuery({
|
|
40
40
|
queryKey: ['catalog', 'events', event, principal],
|
|
41
|
-
queryFn: () => client
|
|
41
|
+
queryFn: () => client
|
|
42
|
+
.listEvents({
|
|
42
43
|
event: event || undefined,
|
|
43
44
|
principalId: principal || undefined,
|
|
44
|
-
|
|
45
|
-
})
|
|
45
|
+
size: 200,
|
|
46
|
+
})
|
|
47
|
+
.then((page) => page.data),
|
|
46
48
|
refetchInterval: 15_000,
|
|
47
49
|
});
|
|
48
50
|
const principals = useMemo(() => [...new Set(events.map((e) => e.principalId).filter(Boolean))], [events]);
|
|
@@ -3,12 +3,12 @@ import { DELETE_RECONCILIATION_STRATEGIES, isDeleteReconciliationStrategy, } fro
|
|
|
3
3
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
4
4
|
import { Lock } from 'lucide-react';
|
|
5
5
|
import { useMemo, useState } from 'react';
|
|
6
|
-
import { cn } from './cn';
|
|
7
|
-
import { catalogQueryKeys, useCatalogClient, } from './context';
|
|
8
|
-
import { Button } from './ui/button';
|
|
9
|
-
import { DataTable } from './ui/data-table';
|
|
10
|
-
import { TextAreaField, TextField } from './ui/field';
|
|
11
|
-
import { SelectField } from './ui/select';
|
|
6
|
+
import { cn } from './cn.js';
|
|
7
|
+
import { catalogQueryKeys, useCatalogClient, } from './context.js';
|
|
8
|
+
import { Button } from './ui/button.js';
|
|
9
|
+
import { DataTable } from './ui/data-table.js';
|
|
10
|
+
import { TextAreaField, TextField } from './ui/field.js';
|
|
11
|
+
import { SelectField } from './ui/select.js';
|
|
12
12
|
/**
|
|
13
13
|
* What a type promises about deletes and row counts, and the form that sets it.
|
|
14
14
|
*
|
package/dist/LoadedBySection.js
CHANGED
|
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useQuery } from '@tanstack/react-query';
|
|
3
3
|
import { ArrowUpRight, CalendarClock, PauseCircle } from 'lucide-react';
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
|
-
import { cn } from './cn';
|
|
6
|
-
import { catalogQueryKeys, useCatalogClient } from './context';
|
|
7
|
-
import { producedTypes } from './workflow/model';
|
|
8
|
-
import { WORKFLOW_NAME } from './workflow/name';
|
|
5
|
+
import { cn } from './cn.js';
|
|
6
|
+
import { catalogQueryKeys, useCatalogClient } from './context.js';
|
|
7
|
+
import { producedTypes } from './workflow/model.js';
|
|
8
|
+
import { WORKFLOW_NAME } from './workflow/name.js';
|
|
9
9
|
/**
|
|
10
10
|
* What loads this type — the answer the model screen could not give.
|
|
11
11
|
*
|
package/dist/ObjectExplorer.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { coerceFilterValue,
|
|
2
|
+
import { coerceFilterValue, filterOperatorTakesValue } from '@dudousxd/nestjs-catalog/client';
|
|
3
3
|
import { useQuery } from '@tanstack/react-query';
|
|
4
4
|
import { ArrowLeft, ChevronDown, ChevronLeft, ChevronRight, History, Search, X, } from 'lucide-react';
|
|
5
5
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
|
-
import { cn } from './cn';
|
|
7
|
-
import { catalogQueryKeys, useCatalogClient } from './context';
|
|
8
|
-
import { Button } from './ui/button';
|
|
9
|
-
import { DataTable } from './ui/data-table';
|
|
10
|
-
import { Select } from './ui/select';
|
|
6
|
+
import { cn } from './cn.js';
|
|
7
|
+
import { catalogQueryKeys, useCatalogClient } from './context.js';
|
|
8
|
+
import { Button } from './ui/button.js';
|
|
9
|
+
import { DataTable } from './ui/data-table.js';
|
|
10
|
+
import { Select } from './ui/select.js';
|
|
11
11
|
/**
|
|
12
12
|
* One table for every object type in the catalog.
|
|
13
13
|
*
|
|
@@ -146,19 +146,19 @@ export function ObjectExplorer({ type: typeProp, pageSize = 25, backHref, backLa
|
|
|
146
146
|
// than restarting its timer on every render. Back to page one whenever the
|
|
147
147
|
// filters change: page 7 of an unfiltered table is very often past the end of
|
|
148
148
|
// a filtered one, and a page past the end reads as "nothing matches".
|
|
149
|
-
const apply = useCallback((
|
|
150
|
-
setApplied(
|
|
149
|
+
const apply = useCallback((ready) => {
|
|
150
|
+
setApplied(ready);
|
|
151
151
|
setPage(1);
|
|
152
152
|
}, []);
|
|
153
153
|
const params = useMemo(() => ({
|
|
154
154
|
page,
|
|
155
155
|
size: pageSize,
|
|
156
156
|
search: debouncedSearch || undefined,
|
|
157
|
-
sort,
|
|
158
|
-
dir,
|
|
157
|
+
// The list API's sort: one column, `-` for descending.
|
|
158
|
+
sort: sort ? `${dir === 'desc' ? '-' : ''}${sort}` : undefined,
|
|
159
159
|
// Omitted rather than sent empty, so a screen with no filters asks the
|
|
160
160
|
// same question it always did.
|
|
161
|
-
|
|
161
|
+
filters: applied.length > 0 ? applied : undefined,
|
|
162
162
|
snapshot: snapshotId || undefined,
|
|
163
163
|
}), [page, pageSize, debouncedSearch, sort, dir, applied, snapshotId]);
|
|
164
164
|
const { data, isFetching, error } = useQuery({
|
|
@@ -240,10 +240,10 @@ export function ObjectExplorer({ type: typeProp, pageSize = 25, backHref, backLa
|
|
|
240
240
|
// The stale border is not decoration: the banner is at the top of a
|
|
241
241
|
// scrolling page, and somebody who came back to this tab after
|
|
242
242
|
// lunch may only ever see the grid.
|
|
243
|
-
stale ? 'border-amber-400 dark:border-amber-500/60' : RULE, PANEL, isFetching && 'opacity-60'), children: [_jsx(DataTable, { data: data?.
|
|
243
|
+
stale ? 'border-amber-400 dark:border-amber-500/60' : RULE, PANEL, isFetching && 'opacity-60'), children: [_jsx(DataTable, { data: data?.data ?? [], columns: columns, getRowId: (row, index) => String(row[selectedType?.primaryKey[0] ?? 'id'] ?? index), sort: { by: sort ?? null, dir, onSort: toggleSort }, numeric: (id) => numericColumns.has(id) }), data && data.data.length === 0 && (_jsx(EmptyState, { type: selectedType, search: debouncedSearch, filtered: applied.length > 0, onClear: () => {
|
|
244
244
|
setSearch('');
|
|
245
245
|
setFilters([]);
|
|
246
|
-
} }))] })), data && _jsx(Pager, { page: data.
|
|
246
|
+
} }))] })), data && _jsx(Pager, { page: data.meta.currentPage, pages: data.meta.lastPage, onPage: setPage })] })] }));
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
249
|
* The line under the title: the physical table, the row count, the columns.
|
|
@@ -254,7 +254,7 @@ export function ObjectExplorer({ type: typeProp, pageSize = 25, backHref, backLa
|
|
|
254
254
|
* different facts and only one of them is worth reacting to.
|
|
255
255
|
*/
|
|
256
256
|
function tableCaption(type, data) {
|
|
257
|
-
const rows = data ? `${data.total.toLocaleString()} rows` : '…';
|
|
257
|
+
const rows = data ? `${data.meta.total.toLocaleString()} rows` : '…';
|
|
258
258
|
return `${type?.tableName} · ${rows} · ${data?.columns.length ?? 0} columns from the catalog`;
|
|
259
259
|
}
|
|
260
260
|
/** The one control that searches every text column at once. */
|
|
@@ -330,17 +330,19 @@ function useSelectedType(types, typeProp) {
|
|
|
330
330
|
* it. A filter can only have been built out of a column that had already arrived.
|
|
331
331
|
*/
|
|
332
332
|
function useAppliedFilters(filters, columns, onApplied) {
|
|
333
|
-
const
|
|
333
|
+
const ready = useMemo(() => {
|
|
334
334
|
const byName = new Map((columns ?? []).map((column) => [column.name, column]));
|
|
335
335
|
return filters
|
|
336
336
|
.filter((filter) => filterIsReady(filter, byName.get(filter.property)))
|
|
337
|
-
.map((filter) =>
|
|
337
|
+
.map((filter) => filterOperatorTakesValue(filter.op)
|
|
338
|
+
? { property: filter.property, op: filter.op, value: filter.value ?? '' }
|
|
339
|
+
: { property: filter.property, op: filter.op });
|
|
338
340
|
}, [filters, columns]);
|
|
339
341
|
// One string, so the debounce below depends on a value rather than on an array
|
|
340
342
|
// identity that is new on every render.
|
|
341
|
-
const key =
|
|
343
|
+
const key = JSON.stringify(ready);
|
|
342
344
|
useEffect(() => {
|
|
343
|
-
const timer = setTimeout(() => onApplied(
|
|
345
|
+
const timer = setTimeout(() => onApplied(JSON.parse(key)), 250);
|
|
344
346
|
return () => clearTimeout(timer);
|
|
345
347
|
// `onApplied` has to be stable — a callback with a new identity every render
|
|
346
348
|
// would restart this timer on every render and never fire. The caller wraps it
|
package/dist/PipelineConsole.js
CHANGED
|
@@ -2,15 +2,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
3
3
|
import { Code2, Plug, Plus, Trash2 } from 'lucide-react';
|
|
4
4
|
import { useState } from 'react';
|
|
5
|
-
import { ConnectionPanel } from './ConnectionPanel';
|
|
6
|
-
import { TransformEditor } from './TransformEditor';
|
|
7
|
-
import { cn } from './cn';
|
|
8
|
-
import { catalogQueryKeys, useCatalogClient } from './context';
|
|
9
|
-
import { Button } from './ui/button';
|
|
10
|
-
import { ConfirmDialog } from './ui/dialog';
|
|
11
|
-
import { Tabs, TabsList, TabsPanel, TabsTab } from './ui/tabs';
|
|
12
|
-
import { Tooltip, TooltipProvider } from './ui/tooltip';
|
|
13
|
-
import { WORKFLOW_NAME } from './workflow/name';
|
|
5
|
+
import { ConnectionPanel } from './ConnectionPanel.js';
|
|
6
|
+
import { TransformEditor } from './TransformEditor.js';
|
|
7
|
+
import { cn } from './cn.js';
|
|
8
|
+
import { catalogQueryKeys, useCatalogClient } from './context.js';
|
|
9
|
+
import { Button } from './ui/button.js';
|
|
10
|
+
import { ConfirmDialog } from './ui/dialog.js';
|
|
11
|
+
import { Tabs, TabsList, TabsPanel, TabsTab } from './ui/tabs.js';
|
|
12
|
+
import { Tooltip, TooltipProvider } from './ui/tooltip.js';
|
|
13
|
+
import { WORKFLOW_NAME } from './workflow/name.js';
|
|
14
14
|
const MUTED = 'text-zinc-400 dark:text-zinc-500';
|
|
15
15
|
const RULE = 'border-zinc-200 dark:border-zinc-800';
|
|
16
16
|
const PANEL = 'bg-white dark:bg-zinc-900';
|
package/dist/QueryConsole.js
CHANGED
|
@@ -2,13 +2,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMutation, useQuery } from '@tanstack/react-query';
|
|
3
3
|
import { AlertTriangle, History, Layers, Link2Off, Play, Sparkles, TableIcon } from 'lucide-react';
|
|
4
4
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
5
|
-
import { paramFromLocation } from './ObjectExplorer';
|
|
6
|
-
import { SavedQueryPanel, savedQueryKeys } from './SavedQueryPanel';
|
|
7
|
-
import { cn } from './cn';
|
|
8
|
-
import { useCatalogClient } from './context';
|
|
9
|
-
import { CodeEditor } from './ui/code-editor';
|
|
10
|
-
import { DataTable, renderUnknown } from './ui/data-table';
|
|
11
|
-
import { Tooltip, TooltipProvider } from './ui/tooltip';
|
|
5
|
+
import { paramFromLocation } from './ObjectExplorer.js';
|
|
6
|
+
import { SavedQueryPanel, savedQueryKeys } from './SavedQueryPanel.js';
|
|
7
|
+
import { cn } from './cn.js';
|
|
8
|
+
import { useCatalogClient } from './context.js';
|
|
9
|
+
import { CodeEditor } from './ui/code-editor.js';
|
|
10
|
+
import { DataTable, renderUnknown } from './ui/data-table.js';
|
|
11
|
+
import { Tooltip, TooltipProvider } from './ui/tooltip.js';
|
|
12
12
|
const MUTED = 'text-zinc-400 dark:text-zinc-500';
|
|
13
13
|
const PANEL = 'bg-white dark:bg-zinc-900';
|
|
14
14
|
const RULE = 'border-zinc-200 dark:border-zinc-800';
|
package/dist/SavedQueryPanel.js
CHANGED
|
@@ -2,13 +2,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
3
3
|
import { Bookmark, Download, History, Timer, Trash2 } from 'lucide-react';
|
|
4
4
|
import { useMemo, useState } from 'react';
|
|
5
|
-
import { registeredChartLibraries } from './charts/registry';
|
|
6
|
-
import { cn } from './cn';
|
|
7
|
-
import { useCatalogClient } from './context';
|
|
8
|
-
import { RevisionHistorySheet } from './diff/RevisionDiff';
|
|
9
|
-
import { ShareBadge, ShareControl } from './sharing';
|
|
10
|
-
import { Select } from './ui/select';
|
|
11
|
-
import { Tooltip } from './ui/tooltip';
|
|
5
|
+
import { registeredChartLibraries } from './charts/registry.js';
|
|
6
|
+
import { cn } from './cn.js';
|
|
7
|
+
import { useCatalogClient } from './context.js';
|
|
8
|
+
import { RevisionHistorySheet } from './diff/RevisionDiff.js';
|
|
9
|
+
import { ShareBadge, ShareControl } from './sharing.js';
|
|
10
|
+
import { Select } from './ui/select.js';
|
|
11
|
+
import { Tooltip } from './ui/tooltip.js';
|
|
12
12
|
const MUTED = 'text-zinc-400 dark:text-zinc-500';
|
|
13
13
|
const RULE = 'border-zinc-200 dark:border-zinc-800';
|
|
14
14
|
export const savedQueryKeys = {
|
package/dist/TraceExplorer.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { CatalogTrace,
|
|
1
|
+
import type { CatalogTrace, CatalogTracePage } from '@dudousxd/nestjs-catalog';
|
|
2
2
|
import { Upload } from 'lucide-react';
|
|
3
|
+
import { type TraceListQuery } from './context.js';
|
|
3
4
|
/**
|
|
4
5
|
* Where this screen gets its traces.
|
|
5
6
|
*
|
|
@@ -9,7 +10,7 @@ import { Upload } from 'lucide-react';
|
|
|
9
10
|
* differently from the app around it is a console nobody trusts.
|
|
10
11
|
*/
|
|
11
12
|
export interface CatalogTraceSource {
|
|
12
|
-
listTraces(query:
|
|
13
|
+
listTraces(query: TraceListQuery): Promise<CatalogTracePage>;
|
|
13
14
|
/**
|
|
14
15
|
* One trace, with the payloads the list leaves in the database.
|
|
15
16
|
*
|
package/dist/TraceExplorer.js
CHANGED
|
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useQuery } from '@tanstack/react-query';
|
|
3
3
|
import { ChevronDown, ChevronRight, CircleCheck, CircleDot, Columns3, Flag, GitCommitVertical, LoaderCircle, OctagonX, Pencil, Play, RefreshCw, ScrollText, Trash2, TriangleAlert, Upload, } from 'lucide-react';
|
|
4
4
|
import { useMemo, useState } from 'react';
|
|
5
|
-
import { cn } from './cn';
|
|
6
|
-
import { useCatalogClient } from './context';
|
|
7
|
-
import { Tooltip, TooltipProvider } from './ui/tooltip';
|
|
5
|
+
import { cn } from './cn.js';
|
|
6
|
+
import { useCatalogClient } from './context.js';
|
|
7
|
+
import { Tooltip, TooltipProvider } from './ui/tooltip.js';
|
|
8
8
|
const MUTED = 'text-zinc-400 dark:text-zinc-500';
|
|
9
9
|
const RULE = 'border-zinc-200 dark:border-zinc-800';
|
|
10
10
|
const PANEL = 'bg-white dark:bg-zinc-900';
|
|
@@ -47,21 +47,29 @@ function toTraceList(value) {
|
|
|
47
47
|
if (typeof value !== 'object' || value === null) {
|
|
48
48
|
throw new Error('The trace endpoint answered with something that is not a trace list.');
|
|
49
49
|
}
|
|
50
|
-
const rawTraces = Reflect.get(value, '
|
|
50
|
+
const rawTraces = Reflect.get(value, 'data');
|
|
51
51
|
if (!Array.isArray(rawTraces)) {
|
|
52
52
|
throw new Error('The trace endpoint answered without a list of traces.');
|
|
53
53
|
}
|
|
54
54
|
const rawUnlinked = Reflect.get(value, 'unlinked');
|
|
55
55
|
const traces = rawTraces.filter(isTrace);
|
|
56
|
+
const rawMeta = Reflect.get(value, 'meta');
|
|
57
|
+
const meta = typeof rawMeta === 'object' && rawMeta !== null ? rawMeta : {};
|
|
58
|
+
// The server's own count when it sent one. Falling back to the page length
|
|
59
|
+
// is a deliberate under-claim: "showing 25 of 25" is wrong but harmless,
|
|
60
|
+
// where a fabricated larger total would put a page nobody can reach behind
|
|
61
|
+
// a control that promises one.
|
|
62
|
+
const total = numberOr(Reflect.get(meta, 'total'), traces.length);
|
|
63
|
+
const perPage = Math.max(1, numberOr(Reflect.get(meta, 'perPage'), traces.length || 1));
|
|
56
64
|
return {
|
|
57
|
-
traces,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
data: traces,
|
|
66
|
+
meta: {
|
|
67
|
+
total,
|
|
68
|
+
perPage,
|
|
69
|
+
currentPage: numberOr(Reflect.get(meta, 'currentPage'), 1),
|
|
70
|
+
lastPage: numberOr(Reflect.get(meta, 'lastPage'), Math.max(1, Math.ceil(total / perPage))),
|
|
71
|
+
firstPage: 1,
|
|
72
|
+
},
|
|
65
73
|
unlinked: Array.isArray(rawUnlinked) ? rawUnlinked.filter(isAuditEvent) : [],
|
|
66
74
|
unlinkedTotal: numberOr(Reflect.get(value, 'unlinkedTotal'), 0),
|
|
67
75
|
clockResolutionMs: numberOr(Reflect.get(value, 'clockResolutionMs'), 1),
|
|
@@ -230,7 +238,7 @@ export function TraceExplorer({ source } = {}) {
|
|
|
230
238
|
const { data, isLoading, isFetching, error, refetch } = useQuery({
|
|
231
239
|
queryKey: ['catalog', 'traces', outcome],
|
|
232
240
|
queryFn: () => traces
|
|
233
|
-
? traces.listTraces({ outcome: outcome || undefined,
|
|
241
|
+
? traces.listTraces({ outcome: outcome || undefined, size: 50 })
|
|
234
242
|
: Promise.reject(new Error('No trace source')),
|
|
235
243
|
enabled: traces !== undefined,
|
|
236
244
|
// Short, because a running trace is the case this screen exists for and a
|
|
@@ -244,7 +252,7 @@ export function TraceExplorer({ source } = {}) {
|
|
|
244
252
|
// throws. Nested providers are a no-op, so the shared case costs nothing.
|
|
245
253
|
return (_jsx(TooltipProvider, { children: _jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [OUTCOME_FILTERS.map((filter) => (_jsx("button", { type: "button", onClick: () => setOutcome(filter.id), className: cn('rounded-md border px-2.5 py-1 text-xs transition-colors', filter.id === outcome
|
|
246
254
|
? 'border-zinc-400 bg-zinc-100 text-zinc-950 dark:border-zinc-600 dark:bg-zinc-800 dark:text-zinc-50'
|
|
247
|
-
: cn(RULE, 'hover:bg-zinc-50 dark:hover:bg-zinc-800/60', MUTED)), children: filter.label }, filter.id || 'all'))), _jsx(Tooltip, { content: "Re-read the trail now", children: _jsx("button", { type: "button", onClick: () => void refetch(), "aria-label": "Refresh traces", className: cn('ml-auto rounded-md border p-1.5 transition-colors', RULE, 'hover:bg-zinc-50 dark:hover:bg-zinc-800/60'), children: _jsx(RefreshCw, { size: 13, className: cn(isFetching && 'animate-spin') }) }) })] }), isLoading && (_jsx("p", { className: cn('py-10 text-center font-mono text-sm', MUTED), children: "Reassembling the trail\u2026" })), error && (_jsx("p", { className: cn('rounded-lg border border-red-300 bg-red-50 px-4 py-3 text-sm text-red-700', 'dark:border-red-900 dark:bg-red-950/40 dark:text-red-300'), children: error instanceof Error ? error.message : String(error) })), data && data.
|
|
255
|
+
: cn(RULE, 'hover:bg-zinc-50 dark:hover:bg-zinc-800/60', MUTED)), children: filter.label }, filter.id || 'all'))), _jsx(Tooltip, { content: "Re-read the trail now", children: _jsx("button", { type: "button", onClick: () => void refetch(), "aria-label": "Refresh traces", className: cn('ml-auto rounded-md border p-1.5 transition-colors', RULE, 'hover:bg-zinc-50 dark:hover:bg-zinc-800/60'), children: _jsx(RefreshCw, { size: 13, className: cn(isFetching && 'animate-spin') }) }) })] }), isLoading && (_jsx("p", { className: cn('py-10 text-center font-mono text-sm', MUTED), children: "Reassembling the trail\u2026" })), error && (_jsx("p", { className: cn('rounded-lg border border-red-300 bg-red-50 px-4 py-3 text-sm text-red-700', 'dark:border-red-900 dark:bg-red-950/40 dark:text-red-300'), children: error instanceof Error ? error.message : String(error) })), data && data.data.length === 0 && (_jsx("p", { className: cn('rounded-lg border border-dashed px-4 py-12 text-center text-sm', RULE, MUTED), children: "No trace matches. Every trace is one snapshot id \u2014 publish something, or run a connector, and its whole story appears here." })), _jsx("div", { className: "space-y-2", children: (data?.data ?? []).map((trace) => (_jsx(TraceCard, { trace: trace, source: traces, expanded: open === trace.id, onToggle: () => setOpen(open === trace.id ? null : trace.id) }, trace.id))) }), data && data.meta.total > data.data.length && (_jsxs("p", { className: cn('text-center font-mono text-[10px]', MUTED), children: ["Showing ", data.data.length, " of ", data.meta.total, " traces."] })), data && data.unlinked.length > 0 && _jsx(Unlinked, { list: data.unlinked })] }) }));
|
|
248
256
|
}
|
|
249
257
|
/**
|
|
250
258
|
* The steps of one expanded trace.
|
package/dist/TransformEditor.js
CHANGED
|
@@ -3,14 +3,14 @@ import { isTransformLanguage, isTransformMode, recordModeRefusal, transformMode,
|
|
|
3
3
|
import { useMutation } from '@tanstack/react-query';
|
|
4
4
|
import { ArrowLeft, Play } from 'lucide-react';
|
|
5
5
|
import { useState } from 'react';
|
|
6
|
-
import { cn } from './cn';
|
|
7
|
-
import { useCatalogClient } from './context';
|
|
8
|
-
import { RevisionHistoryButton, RevisionHistorySheet } from './diff/RevisionDiff';
|
|
9
|
-
import { CodeEditor } from './ui/code-editor';
|
|
10
|
-
import { TRANSFORM_HIGHLIGHTED_AS } from './ui/code-languages';
|
|
11
|
-
import { TextField } from './ui/field';
|
|
12
|
-
import { SelectField } from './ui/select';
|
|
13
|
-
import { Tooltip } from './ui/tooltip';
|
|
6
|
+
import { cn } from './cn.js';
|
|
7
|
+
import { useCatalogClient } from './context.js';
|
|
8
|
+
import { RevisionHistoryButton, RevisionHistorySheet } from './diff/RevisionDiff.js';
|
|
9
|
+
import { CodeEditor } from './ui/code-editor.js';
|
|
10
|
+
import { TRANSFORM_HIGHLIGHTED_AS } from './ui/code-languages.js';
|
|
11
|
+
import { TextField } from './ui/field.js';
|
|
12
|
+
import { SelectField } from './ui/select.js';
|
|
13
|
+
import { Tooltip } from './ui/tooltip.js';
|
|
14
14
|
const MUTED = 'text-zinc-400 dark:text-zinc-500';
|
|
15
15
|
const RULE = 'border-zinc-200 dark:border-zinc-800';
|
|
16
16
|
const PANEL = 'bg-white dark:bg-zinc-900';
|