@lumerahq/ui 0.12.0-dev.0 → 0.12.0-dev.1
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 +26 -0
- package/dist/{RecordSheet-DJoKhb3u.js → RecordSheet-gFscQDNL.js} +316 -142
- package/dist/components/audit-log/AuditLog.d.ts +38 -1
- package/dist/components/audit-log/AuditLog.d.ts.map +1 -1
- package/dist/components/audit-log/AuditLogEntry.d.ts +14 -2
- package/dist/components/audit-log/AuditLogEntry.d.ts.map +1 -1
- package/dist/components/audit-log/index.d.ts +1 -1
- package/dist/components/audit-log/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{highlighted-body-OFNGDK62-DD5EYZQR.js → highlighted-body-OFNGDK62-Dttr28i2.js} +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/use-audit-log.d.ts +2 -1
- package/dist/hooks/use-audit-log.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/audit-log-core.d.ts +11 -0
- package/dist/lib/audit-log-core.d.ts.map +1 -1
- package/dist/lib/audit-log.d.ts +1 -1
- package/dist/lib/audit-log.d.ts.map +1 -1
- package/dist/mermaid-GHXKKRXX-BxahFUxz.js +4 -0
- package/dist/ui.css +9 -4
- package/dist/{use-automation-run-BrghacFY.js → use-automation-run-D2HediFL.js} +20 -3
- package/package.json +1 -1
- package/dist/mermaid-GHXKKRXX-BdrbO7XD.js +0 -4
package/README.md
CHANGED
|
@@ -50,6 +50,32 @@ The stylesheet defines theme tokens as CSS custom properties. Override them on `
|
|
|
50
50
|
import { AutomationRunner, DataTable, RecordSheet } from '@lumerahq/ui';
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
+
### Record Audit Log
|
|
54
|
+
|
|
55
|
+
Show one globally ordered history across up to 20 audited collections:
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { AuditLog } from '@lumerahq/ui';
|
|
59
|
+
|
|
60
|
+
<AuditLog
|
|
61
|
+
collections={['finance__invoices', 'finance__payments']}
|
|
62
|
+
collectionLabels={{
|
|
63
|
+
finance__invoices: 'Invoices',
|
|
64
|
+
finance__payments: 'Payments',
|
|
65
|
+
}}
|
|
66
|
+
fieldLabels={{ customer_id: 'Customer' }}
|
|
67
|
+
showSystemFields={false}
|
|
68
|
+
exportFilename="finance-activity.csv"
|
|
69
|
+
/>;
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The component includes collection, date/time, event, and actor filters; lazy
|
|
73
|
+
before/after details; pagination; and CSV export. It also supports controlled
|
|
74
|
+
filters, column and density options, record navigation callbacks, and custom
|
|
75
|
+
loading, empty, and error states. If a selected collection has auditing turned
|
|
76
|
+
off, existing history remains visible and the component shows a warning that
|
|
77
|
+
future changes will not be recorded.
|
|
78
|
+
|
|
53
79
|
### Assistant Chat
|
|
54
80
|
|
|
55
81
|
Use `AssistantPage` for a full-page chat, `AssistantWidget` for a floating widget, or `AssistantChat` when embedding the chat surface inside custom chrome.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import React__default, { useContext, createContext, forwardRef, createElement, memo, useId as useId$1, useTransition, useMemo, useRef, useEffect, useState, cloneElement, isValidElement, useCallback, Suspense, lazy, Fragment as Fragment$1, useLayoutEffect } from "react";
|
|
4
|
-
import { u as useAgentChat, a as useAgentChatSessions, g as getRecordAuditLogSnapshot, d as auditLogDetailValue, e as auditLogActorLabel, n as normalizeRecordAuditCollections, A as AUDIT_LOG_MAX_COLLECTIONS, b as useAuditLog,
|
|
4
|
+
import { u as useAgentChat, a as useAgentChatSessions, g as getRecordAuditLogSnapshot, d as auditLogDetailValue, e as auditLogActorLabel, n as normalizeRecordAuditCollections, f as normalizeAuditLogFilterState, A as AUDIT_LOG_MAX_COLLECTIONS, b as useAuditLog, h as fetchRecordAuditLogCsv, i as normalizeAuditLogExportLimit, c as useAutomationRun } from "./use-automation-run-D2HediFL.js";
|
|
5
5
|
import { t as twMerge, p as clsx, o as cn$2, a as formatCellValue$2 } from "./formatters-D4T821Dv.js";
|
|
6
6
|
import { f as getDownloadUrl, t as pbSql, p as parentApiRequest, d as parentApiStream, B as BridgeError, z as automationStatuses, L as getAutomationRunFileDownloadUrl, R as listAutomationRunFiles } from "./automations-EgDXJ43_.js";
|
|
7
7
|
import * as ReactDOM from "react-dom";
|
|
@@ -86,24 +86,24 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
86
86
|
Component.displayName = toPascalCase(iconName);
|
|
87
87
|
return Component;
|
|
88
88
|
};
|
|
89
|
-
const __iconNode$
|
|
89
|
+
const __iconNode$K = [
|
|
90
90
|
["path", { d: "M12 5v14", key: "s699le" }],
|
|
91
91
|
["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
|
|
92
92
|
];
|
|
93
|
-
const ArrowDown = createLucideIcon("arrow-down", __iconNode$
|
|
94
|
-
const __iconNode$
|
|
93
|
+
const ArrowDown = createLucideIcon("arrow-down", __iconNode$K);
|
|
94
|
+
const __iconNode$J = [
|
|
95
95
|
["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
|
|
96
96
|
["path", { d: "M17 20V4", key: "1ejh1v" }],
|
|
97
97
|
["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
|
|
98
98
|
["path", { d: "M7 4v16", key: "1glfcx" }]
|
|
99
99
|
];
|
|
100
|
-
const ArrowUpDown = createLucideIcon("arrow-up-down", __iconNode$
|
|
101
|
-
const __iconNode$
|
|
100
|
+
const ArrowUpDown = createLucideIcon("arrow-up-down", __iconNode$J);
|
|
101
|
+
const __iconNode$I = [
|
|
102
102
|
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
103
103
|
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
104
104
|
];
|
|
105
|
-
const ArrowUp = createLucideIcon("arrow-up", __iconNode$
|
|
106
|
-
const __iconNode$
|
|
105
|
+
const ArrowUp = createLucideIcon("arrow-up", __iconNode$I);
|
|
106
|
+
const __iconNode$H = [
|
|
107
107
|
["path", { d: "M12 8V4H8", key: "hb8ula" }],
|
|
108
108
|
["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
|
|
109
109
|
["path", { d: "M2 14h2", key: "vft8re" }],
|
|
@@ -111,8 +111,8 @@ const __iconNode$G = [
|
|
|
111
111
|
["path", { d: "M15 13v2", key: "1xurst" }],
|
|
112
112
|
["path", { d: "M9 13v2", key: "rq6x2g" }]
|
|
113
113
|
];
|
|
114
|
-
const Bot = createLucideIcon("bot", __iconNode$
|
|
115
|
-
const __iconNode$
|
|
114
|
+
const Bot = createLucideIcon("bot", __iconNode$H);
|
|
115
|
+
const __iconNode$G = [
|
|
116
116
|
["path", { d: "M12 18V5", key: "adv99a" }],
|
|
117
117
|
["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
|
|
118
118
|
["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
|
|
@@ -122,27 +122,33 @@ const __iconNode$F = [
|
|
|
122
122
|
["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
|
|
123
123
|
["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
|
|
124
124
|
];
|
|
125
|
-
const Brain = createLucideIcon("brain", __iconNode$
|
|
126
|
-
const __iconNode$
|
|
127
|
-
const Check = createLucideIcon("check", __iconNode$
|
|
128
|
-
const __iconNode$
|
|
129
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$
|
|
130
|
-
const __iconNode$
|
|
131
|
-
const ChevronLeft = createLucideIcon("chevron-left", __iconNode$
|
|
132
|
-
const __iconNode$
|
|
133
|
-
const ChevronRight = createLucideIcon("chevron-right", __iconNode$
|
|
134
|
-
const __iconNode$
|
|
135
|
-
const ChevronUp = createLucideIcon("chevron-up", __iconNode$
|
|
136
|
-
const __iconNode$
|
|
125
|
+
const Brain = createLucideIcon("brain", __iconNode$G);
|
|
126
|
+
const __iconNode$F = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
127
|
+
const Check = createLucideIcon("check", __iconNode$F);
|
|
128
|
+
const __iconNode$E = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
129
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$E);
|
|
130
|
+
const __iconNode$D = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
|
|
131
|
+
const ChevronLeft = createLucideIcon("chevron-left", __iconNode$D);
|
|
132
|
+
const __iconNode$C = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
133
|
+
const ChevronRight = createLucideIcon("chevron-right", __iconNode$C);
|
|
134
|
+
const __iconNode$B = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
135
|
+
const ChevronUp = createLucideIcon("chevron-up", __iconNode$B);
|
|
136
|
+
const __iconNode$A = [
|
|
137
137
|
["path", { d: "m11 17-5-5 5-5", key: "13zhaf" }],
|
|
138
138
|
["path", { d: "m18 17-5-5 5-5", key: "h8a8et" }]
|
|
139
139
|
];
|
|
140
|
-
const ChevronsLeft = createLucideIcon("chevrons-left", __iconNode$
|
|
141
|
-
const __iconNode$
|
|
140
|
+
const ChevronsLeft = createLucideIcon("chevrons-left", __iconNode$A);
|
|
141
|
+
const __iconNode$z = [
|
|
142
142
|
["path", { d: "m6 17 5-5-5-5", key: "xnjwq" }],
|
|
143
143
|
["path", { d: "m13 17 5-5-5-5", key: "17xmmf" }]
|
|
144
144
|
];
|
|
145
|
-
const ChevronsRight = createLucideIcon("chevrons-right", __iconNode$
|
|
145
|
+
const ChevronsRight = createLucideIcon("chevrons-right", __iconNode$z);
|
|
146
|
+
const __iconNode$y = [
|
|
147
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
148
|
+
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
149
|
+
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
150
|
+
];
|
|
151
|
+
const CircleAlert = createLucideIcon("circle-alert", __iconNode$y);
|
|
146
152
|
const __iconNode$x = [
|
|
147
153
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
148
154
|
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
@@ -24035,7 +24041,7 @@ var lr = (e) => {
|
|
|
24035
24041
|
for (; t > 0 && e[t - 1] === `
|
|
24036
24042
|
`; ) t--;
|
|
24037
24043
|
return e.slice(0, t);
|
|
24038
|
-
}, cr = lazy(() => import("./highlighted-body-OFNGDK62-
|
|
24044
|
+
}, cr = lazy(() => import("./highlighted-body-OFNGDK62-Dttr28i2.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), st = ({ code: e, language: t, className: o, children: n, isIncomplete: r = false, startLine: s2, lineNumbers: a, ...l }) => {
|
|
24039
24045
|
let i = y2(), d2 = useMemo(() => lr(e), [e]), c2 = useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: d2.split(`
|
|
24040
24046
|
`).map((p2) => [{ content: p2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [d2]);
|
|
24041
24047
|
return jsx(nt.Provider, { value: { code: e }, children: jsxs(ot, { isIncomplete: r, language: t, children: [jsx(rt, { language: t }), n ? jsx("div", { className: i("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"), children: jsx("div", { className: i("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"), "data-streamdown": "code-block-actions", children: n }) }) : null, jsx(Suspense, { fallback: jsx(At, { className: o, language: t, lineNumbers: a, result: c2, startLine: s2, ...l }), children: jsx(cr, { className: o, code: d2, language: t, lineNumbers: a, raw: c2, startLine: s2, ...l }) })] }) });
|
|
@@ -24397,7 +24403,7 @@ var vo = ({ children: e, className: t, showControls: o, showCopy: n = true, show
|
|
|
24397
24403
|
let l = y2(), i = o && n, d2 = o && r, c2 = o && s2, p2 = i || d2 || c2;
|
|
24398
24404
|
return jsxs("div", { className: l("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"), "data-streamdown": "table-wrapper", children: [p2 ? jsxs("div", { className: l("flex items-center justify-end gap-1"), children: [i ? jsx(Te, {}) : null, d2 ? jsx(Pe, {}) : null, c2 ? jsx(Co, { showCopy: i, showDownload: d2, children: e }) : null] }) : null, jsx("div", { className: l("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"), children: jsx("table", { className: l("w-full divide-y divide-border", t), "data-streamdown": "table", ...a, children: e }) })] });
|
|
24399
24405
|
};
|
|
24400
|
-
var es = /startLine=(\d+)/, ts = /\bnoLineNumbers\b/, os = lazy(() => import("./mermaid-GHXKKRXX-
|
|
24406
|
+
var es = /startLine=(\d+)/, ts = /\bnoLineNumbers\b/, os = lazy(() => import("./mermaid-GHXKKRXX-BxahFUxz.js").then((e) => ({ default: e.Mermaid }))), ns = /language-([^\s]+)/;
|
|
24401
24407
|
function qe(e, t) {
|
|
24402
24408
|
if (!(e != null && e.position || t != null && t.position)) return true;
|
|
24403
24409
|
if (!(e != null && e.position && (t != null && t.position))) return false;
|
|
@@ -29533,6 +29539,25 @@ const markerStyles = {
|
|
|
29533
29539
|
updated: "bg-sky-500",
|
|
29534
29540
|
deleted: "bg-rose-500"
|
|
29535
29541
|
};
|
|
29542
|
+
const systemFieldKeys = /* @__PURE__ */ new Set([
|
|
29543
|
+
"id",
|
|
29544
|
+
"created",
|
|
29545
|
+
"updated",
|
|
29546
|
+
"created_by",
|
|
29547
|
+
"updated_by",
|
|
29548
|
+
"created_by_actor_type",
|
|
29549
|
+
"updated_by_actor_type",
|
|
29550
|
+
"external_id",
|
|
29551
|
+
"lm_provenance"
|
|
29552
|
+
]);
|
|
29553
|
+
const fieldKey = (field) => field.key?.trim().toLowerCase() || field.label.trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
29554
|
+
const displayFields = (fields, fieldLabels, showSystemFields) => {
|
|
29555
|
+
if (!fields) return null;
|
|
29556
|
+
return fields.filter((field) => showSystemFields || !systemFieldKeys.has(fieldKey(field))).map((field) => {
|
|
29557
|
+
const label = field.key && fieldLabels?.[field.key] || fieldLabels?.[field.label] || fieldLabels?.[fieldKey(field)];
|
|
29558
|
+
return label?.trim() ? { ...field, label: label.trim() } : field;
|
|
29559
|
+
});
|
|
29560
|
+
};
|
|
29536
29561
|
function FieldValue({ field }) {
|
|
29537
29562
|
if (field.json !== void 0) {
|
|
29538
29563
|
return /* @__PURE__ */ jsx("pre", { className: "max-h-48 overflow-auto rounded-lg bg-background p-3 text-xs", children: JSON.stringify(field.json, null, 2) });
|
|
@@ -29543,10 +29568,17 @@ function FieldValue({ field }) {
|
|
|
29543
29568
|
] });
|
|
29544
29569
|
}
|
|
29545
29570
|
function FieldList({ fields }) {
|
|
29546
|
-
return /* @__PURE__ */ jsx("dl", { className: "divide-y divide-border/70", children: fields.map((field, index2) => /* @__PURE__ */ jsxs(
|
|
29547
|
-
|
|
29548
|
-
|
|
29549
|
-
|
|
29571
|
+
return /* @__PURE__ */ jsx("dl", { className: "divide-y divide-border/70", children: fields.map((field, index2) => /* @__PURE__ */ jsxs(
|
|
29572
|
+
"div",
|
|
29573
|
+
{
|
|
29574
|
+
className: "grid gap-1 py-2.5 sm:grid-cols-[9rem_1fr] sm:gap-4",
|
|
29575
|
+
children: [
|
|
29576
|
+
/* @__PURE__ */ jsx("dt", { className: "text-xs font-medium text-muted-foreground", children: field.label }),
|
|
29577
|
+
/* @__PURE__ */ jsx("dd", { children: /* @__PURE__ */ jsx(FieldValue, { field }) })
|
|
29578
|
+
]
|
|
29579
|
+
},
|
|
29580
|
+
`${field.key || field.label}-${index2}`
|
|
29581
|
+
)) });
|
|
29550
29582
|
}
|
|
29551
29583
|
function SnapshotSide({ label, fields }) {
|
|
29552
29584
|
return /* @__PURE__ */ jsxs("div", { className: "min-w-0 rounded-xl border bg-background p-3", children: [
|
|
@@ -29554,7 +29586,18 @@ function SnapshotSide({ label, fields }) {
|
|
|
29554
29586
|
fields?.length ? /* @__PURE__ */ jsx(FieldList, { fields }) : /* @__PURE__ */ jsx("p", { className: "py-3 text-sm text-muted-foreground", children: "No values" })
|
|
29555
29587
|
] });
|
|
29556
29588
|
}
|
|
29557
|
-
function AuditLogEntry({
|
|
29589
|
+
function AuditLogEntry({
|
|
29590
|
+
entry,
|
|
29591
|
+
collectionLabel,
|
|
29592
|
+
density,
|
|
29593
|
+
showCollectionColumn,
|
|
29594
|
+
showActorColumn,
|
|
29595
|
+
showSystemFields,
|
|
29596
|
+
fieldLabels,
|
|
29597
|
+
columnCount,
|
|
29598
|
+
getRecordHref,
|
|
29599
|
+
onRecordClick
|
|
29600
|
+
}) {
|
|
29558
29601
|
const detailsID = `${useId$1()}-details`;
|
|
29559
29602
|
const [expanded, setExpanded] = useState(false);
|
|
29560
29603
|
const snapshotQuery = useQuery({
|
|
@@ -29564,45 +29607,102 @@ function AuditLogEntry({ entry }) {
|
|
|
29564
29607
|
staleTime: Number.POSITIVE_INFINITY,
|
|
29565
29608
|
retry: false
|
|
29566
29609
|
});
|
|
29610
|
+
const detailFields = displayFields(entry.details, fieldLabels, true) ?? [];
|
|
29611
|
+
const recordHref = getRecordHref?.(entry)?.trim();
|
|
29612
|
+
const rowPadding = density === "comfortable" ? "py-4" : void 0;
|
|
29613
|
+
const recordAction = recordHref ? /* @__PURE__ */ jsxs(
|
|
29614
|
+
"a",
|
|
29615
|
+
{
|
|
29616
|
+
href: recordHref,
|
|
29617
|
+
className: buttonVariants({ variant: "ghost", size: "icon-sm" }),
|
|
29618
|
+
title: "Open record",
|
|
29619
|
+
onClick: () => onRecordClick?.(entry),
|
|
29620
|
+
children: [
|
|
29621
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Open record" }),
|
|
29622
|
+
/* @__PURE__ */ jsx(ExternalLink, { "aria-hidden": true })
|
|
29623
|
+
]
|
|
29624
|
+
}
|
|
29625
|
+
) : onRecordClick ? /* @__PURE__ */ jsx(
|
|
29626
|
+
Button2,
|
|
29627
|
+
{
|
|
29628
|
+
type: "button",
|
|
29629
|
+
variant: "ghost",
|
|
29630
|
+
size: "icon-sm",
|
|
29631
|
+
"aria-label": "Open record",
|
|
29632
|
+
title: "Open record",
|
|
29633
|
+
onClick: () => onRecordClick(entry),
|
|
29634
|
+
children: /* @__PURE__ */ jsx(ExternalLink, {})
|
|
29635
|
+
}
|
|
29636
|
+
) : null;
|
|
29567
29637
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
29568
29638
|
/* @__PURE__ */ jsxs(TableRow, { "aria-expanded": expanded, children: [
|
|
29569
|
-
/* @__PURE__ */ jsx(TableCell, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx("time", { dateTime: entry.occurred_at, title: new Date(entry.occurred_at).toLocaleString(), children: relativeTime(entry.occurred_at) }) }),
|
|
29570
|
-
/* @__PURE__ */ jsx(
|
|
29571
|
-
|
|
29639
|
+
/* @__PURE__ */ jsx(TableCell, { className: cn$2("text-xs text-muted-foreground", rowPadding), children: /* @__PURE__ */ jsx("time", { dateTime: entry.occurred_at, title: new Date(entry.occurred_at).toLocaleString(), children: relativeTime(entry.occurred_at) }) }),
|
|
29640
|
+
showCollectionColumn ? /* @__PURE__ */ jsx(
|
|
29641
|
+
TableCell,
|
|
29642
|
+
{
|
|
29643
|
+
className: cn$2("max-w-48 truncate text-xs", rowPadding),
|
|
29644
|
+
title: auditLogDetailValue(entry, "Collection"),
|
|
29645
|
+
children: collectionLabel || "—"
|
|
29646
|
+
}
|
|
29647
|
+
) : null,
|
|
29648
|
+
/* @__PURE__ */ jsx(TableCell, { className: cn$2("min-w-64 whitespace-normal", rowPadding), children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2.5", children: [
|
|
29572
29649
|
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn$2("mt-1.5 size-2 shrink-0 rounded-full", markerStyles[entry.event]) }),
|
|
29573
29650
|
/* @__PURE__ */ jsx("span", { children: entry.summary.map((segment, index2) => /* @__PURE__ */ jsxs("span", { children: [
|
|
29574
29651
|
index2 > 0 ? " " : "",
|
|
29575
29652
|
/* @__PURE__ */ jsx("span", { className: segment.emphasis === "strong" ? "font-semibold" : void 0, children: segment.text })
|
|
29576
29653
|
] }, `${segment.text}-${index2}`)) })
|
|
29577
29654
|
] }) }),
|
|
29578
|
-
/* @__PURE__ */ jsx(TableCell, { className: "max-w-48 truncate text-xs", title: auditLogActorLabel(entry.actor), children: auditLogActorLabel(entry.actor) }),
|
|
29579
|
-
/* @__PURE__ */ jsx(TableCell, { className: "
|
|
29580
|
-
|
|
29581
|
-
|
|
29582
|
-
|
|
29583
|
-
|
|
29584
|
-
|
|
29585
|
-
|
|
29586
|
-
|
|
29587
|
-
|
|
29588
|
-
|
|
29589
|
-
|
|
29590
|
-
|
|
29591
|
-
|
|
29655
|
+
showActorColumn ? /* @__PURE__ */ jsx(TableCell, { className: cn$2("max-w-48 truncate text-xs", rowPadding), title: auditLogActorLabel(entry.actor), children: auditLogActorLabel(entry.actor) }) : null,
|
|
29656
|
+
/* @__PURE__ */ jsx(TableCell, { className: cn$2("text-right", rowPadding), children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-0.5", children: [
|
|
29657
|
+
recordAction,
|
|
29658
|
+
/* @__PURE__ */ jsx(
|
|
29659
|
+
Button2,
|
|
29660
|
+
{
|
|
29661
|
+
type: "button",
|
|
29662
|
+
variant: "ghost",
|
|
29663
|
+
size: "icon-sm",
|
|
29664
|
+
"aria-label": expanded ? "Hide audit details" : "Show audit details",
|
|
29665
|
+
"aria-expanded": expanded,
|
|
29666
|
+
"aria-controls": detailsID,
|
|
29667
|
+
onClick: () => setExpanded((value) => !value),
|
|
29668
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { "aria-hidden": true, className: cn$2("transition-transform", expanded && "rotate-180") })
|
|
29669
|
+
}
|
|
29670
|
+
)
|
|
29671
|
+
] }) })
|
|
29592
29672
|
] }),
|
|
29593
|
-
expanded ? /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsxs(
|
|
29594
|
-
|
|
29595
|
-
|
|
29596
|
-
|
|
29597
|
-
|
|
29598
|
-
|
|
29599
|
-
|
|
29600
|
-
|
|
29601
|
-
/* @__PURE__ */
|
|
29602
|
-
|
|
29603
|
-
|
|
29604
|
-
|
|
29605
|
-
|
|
29673
|
+
expanded ? /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsxs(
|
|
29674
|
+
TableCell,
|
|
29675
|
+
{
|
|
29676
|
+
id: detailsID,
|
|
29677
|
+
colSpan: columnCount,
|
|
29678
|
+
className: cn$2("bg-muted/20 whitespace-normal", density === "comfortable" ? "p-5" : "p-4"),
|
|
29679
|
+
children: [
|
|
29680
|
+
detailFields.length > 0 ? /* @__PURE__ */ jsx(FieldList, { fields: detailFields }) : null,
|
|
29681
|
+
entry.has_snapshot ? /* @__PURE__ */ jsxs("div", { className: cn$2(detailFields.length > 0 && "mt-4 border-t pt-4"), children: [
|
|
29682
|
+
/* @__PURE__ */ jsx("p", { className: "mb-3 text-sm font-medium", children: "Before and after" }),
|
|
29683
|
+
snapshotQuery.isLoading ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 py-4 text-sm text-muted-foreground", children: [
|
|
29684
|
+
/* @__PURE__ */ jsx(LoaderCircle, { className: "size-4 animate-spin" }),
|
|
29685
|
+
" Loading values…"
|
|
29686
|
+
] }) : snapshotQuery.isError ? /* @__PURE__ */ jsx("p", { className: "py-3 text-sm text-destructive", children: "Could not load the before and after values." }) : snapshotQuery.data?.snapshot ? /* @__PURE__ */ jsxs("div", { className: "grid gap-3 lg:grid-cols-2", children: [
|
|
29687
|
+
/* @__PURE__ */ jsx(
|
|
29688
|
+
SnapshotSide,
|
|
29689
|
+
{
|
|
29690
|
+
label: "Before",
|
|
29691
|
+
fields: displayFields(snapshotQuery.data.snapshot.before, fieldLabels, showSystemFields)
|
|
29692
|
+
}
|
|
29693
|
+
),
|
|
29694
|
+
/* @__PURE__ */ jsx(
|
|
29695
|
+
SnapshotSide,
|
|
29696
|
+
{
|
|
29697
|
+
label: "After",
|
|
29698
|
+
fields: displayFields(snapshotQuery.data.snapshot.after, fieldLabels, showSystemFields)
|
|
29699
|
+
}
|
|
29700
|
+
)
|
|
29701
|
+
] }) : /* @__PURE__ */ jsx("p", { className: "py-3 text-sm text-muted-foreground", children: "No before and after values are available." })
|
|
29702
|
+
] }) : null
|
|
29703
|
+
]
|
|
29704
|
+
}
|
|
29705
|
+
) }) : null
|
|
29606
29706
|
] });
|
|
29607
29707
|
}
|
|
29608
29708
|
const MenuPositionerContext = /* @__PURE__ */ React.createContext(void 0);
|
|
@@ -41961,6 +42061,13 @@ const dateTimeBoundary = (value) => {
|
|
|
41961
42061
|
const parsed = new Date(value);
|
|
41962
42062
|
return Number.isNaN(parsed.getTime()) ? void 0 : parsed.toISOString();
|
|
41963
42063
|
};
|
|
42064
|
+
const dateTimeInputValue = (value) => {
|
|
42065
|
+
if (!value) return "";
|
|
42066
|
+
const parsed = new Date(value);
|
|
42067
|
+
if (Number.isNaN(parsed.getTime())) return "";
|
|
42068
|
+
const local = new Date(parsed.getTime() - parsed.getTimezoneOffset() * 6e4);
|
|
42069
|
+
return local.toISOString().slice(0, 16);
|
|
42070
|
+
};
|
|
41964
42071
|
const filenameFor = (collections) => {
|
|
41965
42072
|
const prefix = collections.length === 1 ? collections[0] : "record";
|
|
41966
42073
|
const safePrefix = prefix.trim().replace(/[^a-zA-Z0-9_-]+/g, "-") || "record";
|
|
@@ -41976,41 +42083,67 @@ const downloadCsv = (filename, csv) => {
|
|
|
41976
42083
|
link2.remove();
|
|
41977
42084
|
setTimeout(() => URL.revokeObjectURL(url), 0);
|
|
41978
42085
|
};
|
|
41979
|
-
const
|
|
41980
|
-
|
|
41981
|
-
|
|
41982
|
-
|
|
41983
|
-
};
|
|
41984
|
-
function AuditLog({
|
|
42086
|
+
const defaultState = (icon, title, description) => /* @__PURE__ */ jsxs("div", { children: [
|
|
42087
|
+
icon,
|
|
42088
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: title }),
|
|
42089
|
+
/* @__PURE__ */ jsx("p", { className: "mx-auto mt-1 max-w-sm text-xs text-muted-foreground", children: description })
|
|
42090
|
+
] });
|
|
42091
|
+
function AuditLog({
|
|
42092
|
+
collections,
|
|
42093
|
+
collectionLabels,
|
|
42094
|
+
filters: controlledFilters,
|
|
42095
|
+
defaultFilters,
|
|
42096
|
+
onFiltersChange,
|
|
42097
|
+
pageSize = 50,
|
|
42098
|
+
exportMaxRows,
|
|
42099
|
+
exportFilename,
|
|
42100
|
+
title = "Activity",
|
|
42101
|
+
density = "compact",
|
|
42102
|
+
showCollectionColumn = true,
|
|
42103
|
+
showActorColumn = true,
|
|
42104
|
+
showSystemFields = true,
|
|
42105
|
+
fieldLabels,
|
|
42106
|
+
getRecordHref,
|
|
42107
|
+
onRecordClick,
|
|
42108
|
+
loadingState,
|
|
42109
|
+
emptyState,
|
|
42110
|
+
errorState,
|
|
42111
|
+
className
|
|
42112
|
+
}) {
|
|
41985
42113
|
const id = useId$1();
|
|
41986
42114
|
const fromID = `${id}-from`;
|
|
41987
|
-
const
|
|
42115
|
+
const untilID = `${id}-until`;
|
|
41988
42116
|
const eventID = `${id}-event`;
|
|
41989
42117
|
const actorID = `${id}-actor`;
|
|
41990
42118
|
const availableCollections = normalizeRecordAuditCollections(collections);
|
|
41991
42119
|
const availableKey = availableCollections.join("\0");
|
|
41992
|
-
const [
|
|
41993
|
-
|
|
42120
|
+
const [localFilters, setLocalFilters] = useState(() => ({
|
|
42121
|
+
key: availableKey,
|
|
42122
|
+
value: normalizeAuditLogFilterState(availableCollections, defaultFilters)
|
|
42123
|
+
}));
|
|
42124
|
+
const filterState = controlledFilters !== void 0 ? normalizeAuditLogFilterState(availableCollections, controlledFilters) : localFilters.key === availableKey ? normalizeAuditLogFilterState(availableCollections, localFilters.value) : normalizeAuditLogFilterState(availableCollections);
|
|
42125
|
+
const selectedCollections = filterState.collections;
|
|
41994
42126
|
const selectedKey = selectedCollections.join("\0");
|
|
41995
|
-
const
|
|
41996
|
-
const
|
|
41997
|
-
const
|
|
41998
|
-
const
|
|
42127
|
+
const event = filterState.event ?? "all";
|
|
42128
|
+
const actor = filterState.actor ?? "all";
|
|
42129
|
+
const fromDateTime = dateTimeInputValue(filterState.since);
|
|
42130
|
+
const untilDateTime = dateTimeInputValue(filterState.until);
|
|
41999
42131
|
const [isExporting, setIsExporting] = useState(false);
|
|
42000
42132
|
const [exportStatus, setExportStatus] = useState({ key: "", message: "" });
|
|
42001
|
-
const
|
|
42002
|
-
const filters = useMemo(
|
|
42133
|
+
const requestFilters = useMemo(
|
|
42003
42134
|
() => ({
|
|
42004
|
-
event: event
|
|
42005
|
-
actor: actor
|
|
42006
|
-
since:
|
|
42007
|
-
until:
|
|
42135
|
+
event: filterState.event,
|
|
42136
|
+
actor: filterState.actor,
|
|
42137
|
+
since: filterState.since,
|
|
42138
|
+
until: filterState.until
|
|
42008
42139
|
}),
|
|
42009
|
-
[actor, event,
|
|
42140
|
+
[filterState.actor, filterState.event, filterState.since, filterState.until]
|
|
42010
42141
|
);
|
|
42011
|
-
const filterKey = [selectedKey, event, actor,
|
|
42142
|
+
const filterKey = [selectedKey, event, actor, filterState.since, filterState.until].join("");
|
|
42012
42143
|
const configurationError = availableCollections.length === 0 ? "Add at least one collection to the component." : availableCollections.length > AUDIT_LOG_MAX_COLLECTIONS ? `Choose no more than ${AUDIT_LOG_MAX_COLLECTIONS} collections.` : "";
|
|
42013
|
-
const auditLog = useAuditLog(selectedCollections,
|
|
42144
|
+
const auditLog = useAuditLog(selectedCollections, requestFilters, { pageSize, enabled: !configurationError });
|
|
42145
|
+
const columnCount = 3 + Number(showCollectionColumn) + Number(showActorColumn);
|
|
42146
|
+
const labelForCollection = (collection) => collectionLabels?.[collection]?.trim() || collection;
|
|
42014
42147
|
const actorOptions = useMemo(() => {
|
|
42015
42148
|
const actors = /* @__PURE__ */ new Map();
|
|
42016
42149
|
for (const entry of auditLog.entries) {
|
|
@@ -42021,38 +42154,39 @@ function AuditLog({ collections, pageSize = 50, title = "Activity", className })
|
|
|
42021
42154
|
([, left], [, right]) => auditLogActorLabel(left).localeCompare(auditLogActorLabel(right))
|
|
42022
42155
|
);
|
|
42023
42156
|
}, [auditLog.entries]);
|
|
42024
|
-
const hasFilters = selectedCollections.length !== availableCollections.length || event
|
|
42157
|
+
const hasFilters = selectedCollections.length !== availableCollections.length || Boolean(filterState.event || filterState.actor || filterState.since || filterState.until);
|
|
42025
42158
|
const status = auditLog.error?.status;
|
|
42026
42159
|
const exportMessage = exportStatus.key === filterKey ? exportStatus.message : "";
|
|
42027
42160
|
const selectedActor = actorOptions.find(([actorID2]) => actorID2 === actor)?.[1];
|
|
42028
42161
|
const selectedActorLabel = actor === "all" ? "All actors" : selectedActor ? auditLogActorLabel(selectedActor) : "Selected actor";
|
|
42162
|
+
const disabledCollections = auditLog.collectionStatus.filter((collection) => !collection.audit_enabled).map((collection) => labelForCollection(collection.name));
|
|
42163
|
+
const collectionSelectionLabel = selectedCollections.length === availableCollections.length ? "All collections" : selectedCollections.length === 1 ? labelForCollection(selectedCollections[0]) : `${selectedCollections.length} collections`;
|
|
42164
|
+
const setFilters = (next2) => {
|
|
42165
|
+
const normalized = normalizeAuditLogFilterState(availableCollections, next2);
|
|
42166
|
+
if (controlledFilters === void 0) setLocalFilters({ key: availableKey, value: normalized });
|
|
42167
|
+
onFiltersChange?.(normalized);
|
|
42168
|
+
};
|
|
42029
42169
|
const toggleCollection = (collection, checked) => {
|
|
42030
42170
|
const next2 = new Set(selectedCollections);
|
|
42031
42171
|
if (checked) next2.add(collection);
|
|
42032
42172
|
else if (next2.size > 1) next2.delete(collection);
|
|
42033
|
-
|
|
42034
|
-
|
|
42035
|
-
|
|
42036
|
-
|
|
42173
|
+
setFilters({
|
|
42174
|
+
...filterState,
|
|
42175
|
+
collections: availableCollections.filter((value) => next2.has(value)),
|
|
42176
|
+
actor: void 0
|
|
42037
42177
|
});
|
|
42038
|
-
setActorFilter({ key: values.join("\0"), value: "all" });
|
|
42039
|
-
};
|
|
42040
|
-
const clearFilters = () => {
|
|
42041
|
-
setCollectionFilter({ key: availableKey, values: availableCollections });
|
|
42042
|
-
setEvent("all");
|
|
42043
|
-
setActorFilter({ key: availableKey, value: "all" });
|
|
42044
|
-
setFromDateTime("");
|
|
42045
|
-
setToDateTime("");
|
|
42046
42178
|
};
|
|
42179
|
+
const resetFilters = () => setFilters(normalizeAuditLogFilterState(availableCollections));
|
|
42047
42180
|
const handleExport = async () => {
|
|
42181
|
+
const limit = normalizeAuditLogExportLimit(exportMaxRows);
|
|
42048
42182
|
setIsExporting(true);
|
|
42049
42183
|
setExportStatus({ key: filterKey, message: "" });
|
|
42050
42184
|
try {
|
|
42051
|
-
const result = await fetchRecordAuditLogCsv({ collections: selectedCollections, ...
|
|
42052
|
-
downloadCsv(filenameFor(selectedCollections), result.csv);
|
|
42185
|
+
const result = await fetchRecordAuditLogCsv({ collections: selectedCollections, ...requestFilters }, limit);
|
|
42186
|
+
downloadCsv(exportFilename?.trim() || filenameFor(selectedCollections), result.csv);
|
|
42053
42187
|
setExportStatus({
|
|
42054
42188
|
key: filterKey,
|
|
42055
|
-
message: result.truncated ? `Exported the first ${
|
|
42189
|
+
message: result.truncated ? `Exported the first ${limit.toLocaleString()} entries.` : `Exported ${result.count.toLocaleString()} ${result.count === 1 ? "entry" : "entries"}.`
|
|
42056
42190
|
});
|
|
42057
42191
|
} catch {
|
|
42058
42192
|
setExportStatus({ key: filterKey, message: "Could not export the activity. Try again." });
|
|
@@ -42103,10 +42237,10 @@ function AuditLog({ collections, pageSize = 50, title = "Activity", className })
|
|
|
42103
42237
|
/* @__PURE__ */ jsxs(
|
|
42104
42238
|
DropdownMenuTrigger,
|
|
42105
42239
|
{
|
|
42106
|
-
render: /* @__PURE__ */ jsx(Button2, { type: "button", variant: "outline", size: "sm", className: "w-[
|
|
42240
|
+
render: /* @__PURE__ */ jsx(Button2, { type: "button", variant: "outline", size: "sm", className: "w-[11rem] justify-start" }),
|
|
42107
42241
|
children: [
|
|
42108
42242
|
/* @__PURE__ */ jsx(ListFilter, {}),
|
|
42109
|
-
/* @__PURE__ */ jsx("span", { className: "truncate", children:
|
|
42243
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: collectionSelectionLabel })
|
|
42110
42244
|
]
|
|
42111
42245
|
}
|
|
42112
42246
|
),
|
|
@@ -42120,7 +42254,7 @@ function AuditLog({ collections, pageSize = 50, title = "Activity", className })
|
|
|
42120
42254
|
checked,
|
|
42121
42255
|
disabled: checked && selectedCollections.length === 1,
|
|
42122
42256
|
onCheckedChange: (value) => toggleCollection(collection, value === true),
|
|
42123
|
-
children: /* @__PURE__ */ jsx("span", { className: "truncate
|
|
42257
|
+
children: /* @__PURE__ */ jsx("span", { className: "truncate", title: collection, children: labelForCollection(collection) })
|
|
42124
42258
|
},
|
|
42125
42259
|
collection
|
|
42126
42260
|
);
|
|
@@ -42134,80 +42268,120 @@ function AuditLog({ collections, pageSize = 50, title = "Activity", className })
|
|
|
42134
42268
|
Input2,
|
|
42135
42269
|
{
|
|
42136
42270
|
id: fromID,
|
|
42271
|
+
"aria-label": "From date and time in your local timezone",
|
|
42137
42272
|
type: "datetime-local",
|
|
42138
42273
|
step: "60",
|
|
42139
42274
|
value: fromDateTime,
|
|
42140
|
-
max:
|
|
42275
|
+
max: untilDateTime || void 0,
|
|
42141
42276
|
className: "h-8 w-[12rem] text-xs",
|
|
42142
|
-
onChange: (inputEvent) =>
|
|
42277
|
+
onChange: (inputEvent) => setFilters({ ...filterState, since: dateTimeBoundary(inputEvent.target.value) })
|
|
42143
42278
|
}
|
|
42144
42279
|
)
|
|
42145
42280
|
] }),
|
|
42146
42281
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
42147
|
-
/* @__PURE__ */ jsx(Label, { htmlFor:
|
|
42282
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: untilID, className: "text-xs text-muted-foreground", children: "Until" }),
|
|
42148
42283
|
/* @__PURE__ */ jsx(
|
|
42149
42284
|
Input2,
|
|
42150
42285
|
{
|
|
42151
|
-
id:
|
|
42286
|
+
id: untilID,
|
|
42287
|
+
"aria-label": "Until date and time in your local timezone",
|
|
42152
42288
|
type: "datetime-local",
|
|
42153
42289
|
step: "60",
|
|
42154
|
-
value:
|
|
42290
|
+
value: untilDateTime,
|
|
42155
42291
|
min: fromDateTime || void 0,
|
|
42156
42292
|
className: "h-8 w-[12rem] text-xs",
|
|
42157
|
-
onChange: (inputEvent) =>
|
|
42293
|
+
onChange: (inputEvent) => setFilters({ ...filterState, until: dateTimeBoundary(inputEvent.target.value) })
|
|
42158
42294
|
}
|
|
42159
42295
|
)
|
|
42160
42296
|
] }),
|
|
42161
42297
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
42162
42298
|
/* @__PURE__ */ jsx(Label, { htmlFor: eventID, className: "text-xs text-muted-foreground", children: "Event" }),
|
|
42163
|
-
/* @__PURE__ */ jsxs(
|
|
42164
|
-
|
|
42165
|
-
|
|
42166
|
-
|
|
42167
|
-
|
|
42168
|
-
|
|
42169
|
-
|
|
42170
|
-
|
|
42171
|
-
|
|
42299
|
+
/* @__PURE__ */ jsxs(
|
|
42300
|
+
Select,
|
|
42301
|
+
{
|
|
42302
|
+
value: event,
|
|
42303
|
+
onValueChange: (value) => value && setFilters({ ...filterState, event: value === "all" ? void 0 : value }),
|
|
42304
|
+
children: [
|
|
42305
|
+
/* @__PURE__ */ jsx(SelectTrigger2, { id: eventID, size: "sm", className: "w-[8.5rem] rounded-lg border-border bg-background", children: /* @__PURE__ */ jsx(SelectValue2, { children: event === "all" ? "All events" : `${event[0].toUpperCase()}${event.slice(1)}` }) }),
|
|
42306
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
42307
|
+
/* @__PURE__ */ jsx(SelectItem2, { value: "all", children: "All events" }),
|
|
42308
|
+
/* @__PURE__ */ jsx(SelectItem2, { value: "created", children: "Created" }),
|
|
42309
|
+
/* @__PURE__ */ jsx(SelectItem2, { value: "updated", children: "Updated" }),
|
|
42310
|
+
/* @__PURE__ */ jsx(SelectItem2, { value: "deleted", children: "Deleted" })
|
|
42311
|
+
] })
|
|
42312
|
+
]
|
|
42313
|
+
}
|
|
42314
|
+
)
|
|
42172
42315
|
] }),
|
|
42173
42316
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
42174
42317
|
/* @__PURE__ */ jsx(Label, { htmlFor: actorID, className: "text-xs text-muted-foreground", children: "Actor" }),
|
|
42175
|
-
/* @__PURE__ */ jsxs(
|
|
42176
|
-
|
|
42177
|
-
|
|
42178
|
-
|
|
42179
|
-
|
|
42180
|
-
|
|
42181
|
-
|
|
42318
|
+
/* @__PURE__ */ jsxs(
|
|
42319
|
+
Select,
|
|
42320
|
+
{
|
|
42321
|
+
value: actor,
|
|
42322
|
+
onValueChange: (value) => value && setFilters({ ...filterState, actor: value === "all" ? void 0 : value }),
|
|
42323
|
+
children: [
|
|
42324
|
+
/* @__PURE__ */ jsx(SelectTrigger2, { id: actorID, size: "sm", className: "w-[11rem] rounded-lg border-border bg-background", children: /* @__PURE__ */ jsx(SelectValue2, { children: selectedActorLabel }) }),
|
|
42325
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
42326
|
+
/* @__PURE__ */ jsx(SelectItem2, { value: "all", children: "All actors" }),
|
|
42327
|
+
actorOptions.map(([actorID2, option]) => /* @__PURE__ */ jsx(SelectItem2, { value: actorID2, children: auditLogActorLabel(option) }, actorID2))
|
|
42328
|
+
] })
|
|
42329
|
+
]
|
|
42330
|
+
}
|
|
42331
|
+
)
|
|
42182
42332
|
] }),
|
|
42183
|
-
|
|
42333
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 text-[11px] text-muted-foreground", children: "Dates use local time" }),
|
|
42334
|
+
hasFilters ? /* @__PURE__ */ jsxs(Button2, { type: "button", variant: "ghost", size: "sm", className: "mb-px", onClick: resetFilters, children: [
|
|
42184
42335
|
/* @__PURE__ */ jsx(FunnelX, {}),
|
|
42185
|
-
"
|
|
42336
|
+
" Reset filters"
|
|
42186
42337
|
] }) : null
|
|
42187
42338
|
] }),
|
|
42339
|
+
disabledCollections.length > 0 && !auditLog.error ? /* @__PURE__ */ jsxs("div", { className: "flex gap-2 border-b bg-amber-50 px-5 py-2.5 text-xs text-amber-950", role: "status", children: [
|
|
42340
|
+
/* @__PURE__ */ jsx(CircleAlert, { className: "mt-0.5 size-4 shrink-0" }),
|
|
42341
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
42342
|
+
"Auditing is off for ",
|
|
42343
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: disabledCollections.join(", ") }),
|
|
42344
|
+
". Existing history is still visible, but new changes will not be recorded."
|
|
42345
|
+
] })
|
|
42346
|
+
] }) : null,
|
|
42188
42347
|
/* @__PURE__ */ jsxs(Table, { children: [
|
|
42189
42348
|
/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { className: "hover:bg-transparent", children: [
|
|
42190
42349
|
/* @__PURE__ */ jsx(TableHead, { className: "w-32 text-xs text-muted-foreground", children: "Time" }),
|
|
42191
|
-
/* @__PURE__ */ jsx(TableHead, { className: "w-48 text-xs text-muted-foreground", children: "Collection" }),
|
|
42350
|
+
showCollectionColumn ? /* @__PURE__ */ jsx(TableHead, { className: "w-48 text-xs text-muted-foreground", children: "Collection" }) : null,
|
|
42192
42351
|
/* @__PURE__ */ jsx(TableHead, { className: "text-xs text-muted-foreground", children: "Activity" }),
|
|
42193
|
-
/* @__PURE__ */ jsx(TableHead, { className: "w-48 text-xs text-muted-foreground", children: "Actor" }),
|
|
42194
|
-
/* @__PURE__ */ jsx(TableHead, { className: "w-12", children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "
|
|
42352
|
+
showActorColumn ? /* @__PURE__ */ jsx(TableHead, { className: "w-48 text-xs text-muted-foreground", children: "Actor" }) : null,
|
|
42353
|
+
/* @__PURE__ */ jsx(TableHead, { className: getRecordHref || onRecordClick ? "w-20" : "w-12", children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Actions" }) })
|
|
42195
42354
|
] }) }),
|
|
42196
|
-
/* @__PURE__ */ jsx(TableBody, { children: auditLog.isLoading ? [0, 1, 2].map((item) => /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
42355
|
+
/* @__PURE__ */ jsx(TableBody, { children: auditLog.isLoading ? loadingState !== void 0 ? /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsx(TableCell, { colSpan: columnCount, className: "h-48 whitespace-normal text-center", children: loadingState }) }) : [0, 1, 2].map((item) => /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
42197
42356
|
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-20" }) }),
|
|
42198
|
-
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-28" }) }),
|
|
42357
|
+
showCollectionColumn ? /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-28" }) }) : null,
|
|
42199
42358
|
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-2/3" }) }),
|
|
42200
|
-
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" }) }),
|
|
42359
|
+
showActorColumn ? /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" }) }) : null,
|
|
42201
42360
|
/* @__PURE__ */ jsx(TableCell, {})
|
|
42202
|
-
] }, item)) : configurationError || auditLog.error ? /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */
|
|
42361
|
+
] }, item)) : configurationError || auditLog.error ? /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsx(TableCell, { colSpan: columnCount, className: "h-48 whitespace-normal text-center", children: auditLog.error && errorState ? errorState(auditLog.error) : defaultState(
|
|
42203
42362
|
/* @__PURE__ */ jsx(History, { className: "mx-auto mb-3 size-8 text-muted-foreground/60" }),
|
|
42204
|
-
|
|
42205
|
-
|
|
42206
|
-
|
|
42363
|
+
configurationError ? "Audit log is not configured" : status === 403 ? "Activity is not available" : "Could not load activity",
|
|
42364
|
+
configurationError || (status === 403 ? "You need read access to every selected collection." : "Refresh the activity to try again.")
|
|
42365
|
+
) }) }) : auditLog.entries.length === 0 ? /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsx(TableCell, { colSpan: columnCount, className: "h-48 whitespace-normal text-center", children: emptyState ?? defaultState(
|
|
42207
42366
|
/* @__PURE__ */ jsx(History, { className: "mx-auto mb-3 size-8 text-muted-foreground/60" }),
|
|
42208
|
-
|
|
42209
|
-
|
|
42210
|
-
|
|
42367
|
+
"No activity to show",
|
|
42368
|
+
disabledCollections.length > 0 ? "Auditing is off, and no existing changes match the current filters." : "No changes match the current filters."
|
|
42369
|
+
) }) }) : auditLog.entries.map((entry) => /* @__PURE__ */ jsx(
|
|
42370
|
+
AuditLogEntry,
|
|
42371
|
+
{
|
|
42372
|
+
entry,
|
|
42373
|
+
collectionLabel: labelForCollection(auditLogDetailValue(entry, "Collection")),
|
|
42374
|
+
density,
|
|
42375
|
+
showCollectionColumn,
|
|
42376
|
+
showActorColumn,
|
|
42377
|
+
showSystemFields,
|
|
42378
|
+
fieldLabels,
|
|
42379
|
+
columnCount,
|
|
42380
|
+
getRecordHref,
|
|
42381
|
+
onRecordClick
|
|
42382
|
+
},
|
|
42383
|
+
entry.id
|
|
42384
|
+
)) })
|
|
42211
42385
|
] }),
|
|
42212
42386
|
auditLog.hasMore ? /* @__PURE__ */ jsx("div", { className: "flex justify-center border-t p-4", children: /* @__PURE__ */ jsxs(
|
|
42213
42387
|
Button2,
|
|
@@ -43473,13 +43647,13 @@ function RecordSheet({
|
|
|
43473
43647
|
actions,
|
|
43474
43648
|
width = "max-w-lg"
|
|
43475
43649
|
}) {
|
|
43476
|
-
const
|
|
43650
|
+
const displayFields2 = fields ?? (record ? Object.keys(record).map((key) => ({ key, label: key })) : []);
|
|
43477
43651
|
return /* @__PURE__ */ jsx(Sheet, { open: open2, onOpenChange, children: /* @__PURE__ */ jsxs(SheetContent, { side: "right", className: `w-full ${width} overflow-y-auto`, children: [
|
|
43478
43652
|
/* @__PURE__ */ jsxs(SheetHeader, { children: [
|
|
43479
43653
|
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsx(SheetTitle, { children: title }) }),
|
|
43480
43654
|
description && /* @__PURE__ */ jsx(SheetDescription, { children: description })
|
|
43481
43655
|
] }),
|
|
43482
|
-
/* @__PURE__ */ jsx("div", { className: "mt-6 space-y-4 px-4", children: isLoading ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx(LoaderCircle, { className: "h-6 w-6 animate-spin text-muted-foreground" }) }) : !record ? /* @__PURE__ */ jsx("p", { className: "py-12 text-center text-muted-foreground", children: "No record selected" }) :
|
|
43656
|
+
/* @__PURE__ */ jsx("div", { className: "mt-6 space-y-4 px-4", children: isLoading ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx(LoaderCircle, { className: "h-6 w-6 animate-spin text-muted-foreground" }) }) : !record ? /* @__PURE__ */ jsx("p", { className: "py-12 text-center text-muted-foreground", children: "No record selected" }) : displayFields2.map((field) => {
|
|
43483
43657
|
const value = record[field.key];
|
|
43484
43658
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
43485
43659
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-muted-foreground", children: field.label }),
|
|
@@ -1,12 +1,49 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { AuditLogEntry as AuditLogEntryData, AuditLogFilterState as AuditLogFilterStateData } from '../../lib/audit-log';
|
|
3
|
+
export type AuditLogDensity = 'compact' | 'comfortable';
|
|
4
|
+
export type AuditLogFilterState = AuditLogFilterStateData;
|
|
5
|
+
export type AuditLogRecord = AuditLogEntryData;
|
|
1
6
|
export type AuditLogProps = {
|
|
2
7
|
/** Collections whose combined record history should be shown (maximum 20). */
|
|
3
8
|
collections: readonly string[];
|
|
9
|
+
/** Friendly display names keyed by collection API name. */
|
|
10
|
+
collectionLabels?: Readonly<Record<string, string>>;
|
|
11
|
+
/** Controlled filter state. */
|
|
12
|
+
filters?: AuditLogFilterState;
|
|
13
|
+
/** Initial filters when the component manages its own state. */
|
|
14
|
+
defaultFilters?: Partial<AuditLogFilterState>;
|
|
15
|
+
/** Called after any user filter change, in controlled and uncontrolled modes. */
|
|
16
|
+
onFiltersChange?: (filters: AuditLogFilterState) => void;
|
|
4
17
|
/** Rows fetched per page. Defaults to 50; the API maximum is 200. */
|
|
5
18
|
pageSize?: number;
|
|
19
|
+
/** Maximum rows in one CSV export. Defaults to 10,000 and cannot exceed it. */
|
|
20
|
+
exportMaxRows?: number;
|
|
21
|
+
/** Download name for CSV exports. Defaults to a date-stamped name. */
|
|
22
|
+
exportFilename?: string;
|
|
6
23
|
/** Header text. Defaults to "Activity". */
|
|
7
24
|
title?: string;
|
|
25
|
+
/** Row spacing. Defaults to "compact". */
|
|
26
|
+
density?: AuditLogDensity;
|
|
27
|
+
/** Show the collection column. Defaults to true. */
|
|
28
|
+
showCollectionColumn?: boolean;
|
|
29
|
+
/** Show the actor column. Defaults to true. */
|
|
30
|
+
showActorColumn?: boolean;
|
|
31
|
+
/** Include record system fields in before/after values. Defaults to true. */
|
|
32
|
+
showSystemFields?: boolean;
|
|
33
|
+
/** Friendly labels keyed by a field's API key or current label. */
|
|
34
|
+
fieldLabels?: Readonly<Record<string, string>>;
|
|
35
|
+
/** Return an app-specific destination for an audit entry's record. */
|
|
36
|
+
getRecordHref?: (entry: AuditLogEntryData) => string | undefined;
|
|
37
|
+
/** Called when the app-specific record action is selected. */
|
|
38
|
+
onRecordClick?: (entry: AuditLogEntryData) => void;
|
|
39
|
+
/** Optional replacement for the built-in loading state. */
|
|
40
|
+
loadingState?: ReactNode;
|
|
41
|
+
/** Optional replacement for the built-in empty state. */
|
|
42
|
+
emptyState?: ReactNode;
|
|
43
|
+
/** Optional replacement for an API error state. */
|
|
44
|
+
errorState?: (error: Error) => ReactNode;
|
|
8
45
|
/** Optional classes for the outer container. */
|
|
9
46
|
className?: string;
|
|
10
47
|
};
|
|
11
|
-
export declare function AuditLog({ collections, pageSize, title, className }: AuditLogProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare function AuditLog({ collections, collectionLabels, filters: controlledFilters, defaultFilters, onFiltersChange, pageSize, exportMaxRows, exportFilename, title, density, showCollectionColumn, showActorColumn, showSystemFields, fieldLabels, getRecordHref, onRecordClick, loadingState, emptyState, errorState, className, }: AuditLogProps): import("react/jsx-runtime").JSX.Element;
|
|
12
49
|
//# sourceMappingURL=AuditLog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuditLog.d.ts","sourceRoot":"","sources":["../../../src/components/audit-log/AuditLog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuditLog.d.ts","sourceRoot":"","sources":["../../../src/components/audit-log/AuditLog.tsx"],"names":[],"mappings":"AAC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AC;IAC/C,sEAAsE;IACtE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,MAAM,GAAG,SAAS,CAAC;IACjE,8DAA8D;IAC9D,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACnD,2DAA2D;IAC3D,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,yDAAyD;IACzD,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,mDAAmD;IACnD,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC;IACzC,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAyCF,wBAAgB,QAAQ,CAAC,EACvB,WAAW,EACX,gBAAgB,EAChB,OAAO,EAAE,iBAAiB,EAC1B,cAAc,EACd,eAAe,EACf,QAAa,EACb,aAAa,EACb,cAAc,EACd,KAAkB,EAClB,OAAmB,EACnB,oBAA2B,EAC3B,eAAsB,EACtB,gBAAuB,EACvB,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,UAAU,EACV,UAAU,EACV,SAAS,GACV,EAAE,aAAa,2CAoYf"}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
+
import { AuditLogDensity } from './AuditLog';
|
|
1
2
|
import { AuditLogEntry as AuditLogEntryData } from '../../lib/audit-log';
|
|
2
|
-
|
|
3
|
+
type AuditLogEntryProps = {
|
|
3
4
|
entry: AuditLogEntryData;
|
|
4
|
-
|
|
5
|
+
collectionLabel: string;
|
|
6
|
+
density: AuditLogDensity;
|
|
7
|
+
showCollectionColumn: boolean;
|
|
8
|
+
showActorColumn: boolean;
|
|
9
|
+
showSystemFields: boolean;
|
|
10
|
+
fieldLabels?: Readonly<Record<string, string>>;
|
|
11
|
+
columnCount: number;
|
|
12
|
+
getRecordHref?: (entry: AuditLogEntryData) => string | undefined;
|
|
13
|
+
onRecordClick?: (entry: AuditLogEntryData) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare function AuditLogEntry({ entry, collectionLabel, density, showCollectionColumn, showActorColumn, showSystemFields, fieldLabels, columnCount, getRecordHref, onRecordClick, }: AuditLogEntryProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
5
17
|
//# sourceMappingURL=AuditLogEntry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuditLogEntry.d.ts","sourceRoot":"","sources":["../../../src/components/audit-log/AuditLogEntry.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuditLogEntry.d.ts","sourceRoot":"","sources":["../../../src/components/audit-log/AuditLogEntry.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGvE,OAAO,EACL,KAAK,aAAa,IAAI,iBAAiB,EAKxC,MAAM,iBAAiB,CAAC;AA+GzB,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,iBAAiB,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,eAAe,CAAC;IACzB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,MAAM,GAAG,SAAS,CAAC;IACjE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACpD,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,eAAe,EACf,OAAO,EACP,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,GACd,EAAE,kBAAkB,2CA+HpB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AuditLog, type AuditLogProps } from './AuditLog';
|
|
1
|
+
export { AuditLog, type AuditLogDensity, type AuditLogFilterState, type AuditLogProps, type AuditLogRecord, } from './AuditLog';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/audit-log/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/audit-log/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,cAAc,GACpB,MAAM,YAAY,CAAC"}
|
|
@@ -2,7 +2,7 @@ export type { ColumnType, FormatOptions } from '../lib/formatters';
|
|
|
2
2
|
export type { AgentChatAbortRequest, AgentChatAction, AgentChatActionBlock, AgentChatActiveStatus, AgentChatAgentProfile, AgentChatAgentRequest, AgentChatBlockRendererProps, AgentChatCollectionMap, AgentChatComposerActions, AgentChatComposerRendererProps, AgentChatComposerState, AgentChatContentBlock, AgentChatCustomBlock, AgentChatFeatureFlags, AgentChatFile, AgentChatFileBlock, AgentChatHistoryPage, AgentChatHistoryRequest, AgentChatHistoryResult, AgentChatID, AgentChatInfoBlock, AgentChatLabels, AgentChatLoadEarlierRequest, AgentChatMessage, AgentChatMessageRendererProps, AgentChatMessageRole, AgentChatMetadata, AgentChatOperationStatus, AgentChatPendingFile, AgentChatPhase, AgentChatProps, AgentChatRenameSessionRequest, AgentChatRenderers, AgentChatResizableWidthOptions, AgentChatSession, AgentChatSessionListRequest, AgentChatSessionListResult, AgentChatStreamEvent, AgentChatStreamHandlers, AgentChatSubmitInput, AgentChatSubmitResult, AgentChatSubscription, AgentChatTerminalStatus, AgentChatTextBlock, AgentChatThinkingBlock, AgentChatTokenUsage, AgentChatToolCall, AgentChatToolCallBlock, AgentChatToolCallLike, AgentChatToolRenderer, AgentChatTransport, AgentChatTurn, AgentChatTurnStatus, LumeraAgentChatTransportOptions, } from './agent-chat';
|
|
3
3
|
export { AgentChat, ArtifactCard, createLumeraAgentChatTransport, defaultToolRenderers, findRenderer, getCollectionMap, humanizeCollectionName, isExploratoryToolCallError, ToolCallCard, type ToolCallCardProps, ToolRenderersProvider, warmCollectionCache, } from './agent-chat';
|
|
4
4
|
export { AssistantChat, type AssistantChatProps, AssistantPage, type AssistantPageProps, AssistantWidget, type AssistantWidgetProps, type ComposerChip as AssistantComposerChip, isMutatingToolCall, useDataSyncTransport, withDataSync, } from './assistant';
|
|
5
|
-
export { AuditLog, type AuditLogProps } from './audit-log';
|
|
5
|
+
export { AuditLog, type AuditLogDensity, type AuditLogFilterState, type AuditLogProps, type AuditLogRecord, } from './audit-log';
|
|
6
6
|
export { AutomationRunList } from './automation/AutomationRunList';
|
|
7
7
|
export { AutomationRunner } from './automation/AutomationRunner';
|
|
8
8
|
export { type ColumnDef, DataTable, DataTableFilters, type DataTableFiltersProps, DataTablePagination, type DataTablePaginationProps, type DataTableProps, type FilterColumn, RecordSheet, type RecordSheetProps, } from './data-table';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAClE,YAAY,EACV,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,EAC3B,sBAAsB,EACtB,wBAAwB,EACxB,8BAA8B,EAC9B,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,2BAA2B,EAC3B,gBAAgB,EAChB,6BAA6B,EAC7B,oBAAoB,EACpB,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,6BAA6B,EAC7B,kBAAkB,EAClB,8BAA8B,EAC9B,gBAAgB,EAChB,2BAA2B,EAC3B,0BAA0B,EAC1B,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,+BAA+B,GAChC,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,SAAS,EACT,YAAY,EACZ,8BAA8B,EAC9B,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,sBAAsB,EACtB,0BAA0B,EAC1B,YAAY,EACZ,KAAK,iBAAiB,EACtB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,aAAa,EACb,KAAK,kBAAkB,EACvB,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,YAAY,IAAI,qBAAqB,EAC1C,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAClE,YAAY,EACV,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,EAC3B,sBAAsB,EACtB,wBAAwB,EACxB,8BAA8B,EAC9B,sBAAsB,EACtB,qBAAqB,EACrB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M,+BAA+B,CAAC;AAEjE,OAAO,EACL,KAAK,SAAS,EACd,SAAS,EACT,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,WAAW,EACX,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, a, e, j, k, n, o, p, D, q, r, R, T, b, c, d, f, g, h, i, l, u, w, m } from "../RecordSheet-
|
|
1
|
+
import { A, a, e, j, k, n, o, p, D, q, r, R, T, b, c, d, f, g, h, i, l, u, w, m } from "../RecordSheet-gFscQDNL.js";
|
|
2
2
|
export {
|
|
3
3
|
A as AgentChat,
|
|
4
4
|
a as ArtifactCard,
|
package/dist/{highlighted-body-OFNGDK62-DD5EYZQR.js → highlighted-body-OFNGDK62-Dttr28i2.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as R$1, L as Li, v as At } from "./RecordSheet-
|
|
1
|
+
import { t as R$1, L as Li, v as At } from "./RecordSheet-gFscQDNL.js";
|
|
2
2
|
import { useContext, useState, useEffect } from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
var R = ({ code: s, language: e, raw: t, className: h, startLine: d, lineNumbers: m, ...p }) => {
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { AuditLogEntry, AuditLogFilters } from '../lib/audit-log';
|
|
1
|
+
import { AuditLogCollectionStatus, AuditLogEntry, AuditLogFilters } from '../lib/audit-log';
|
|
2
2
|
export type UseAuditLogOptions = {
|
|
3
3
|
pageSize?: number;
|
|
4
4
|
enabled?: boolean;
|
|
5
5
|
};
|
|
6
6
|
export type UseAuditLogResult = {
|
|
7
7
|
entries: AuditLogEntry[];
|
|
8
|
+
collectionStatus: AuditLogCollectionStatus[];
|
|
8
9
|
error: Error | null;
|
|
9
10
|
isLoading: boolean;
|
|
10
11
|
isFetching: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-audit-log.d.ts","sourceRoot":"","sources":["../../src/hooks/use-audit-log.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,eAAe,EAKrB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC;AAEF,wBAAgB,WAAW,CACzB,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,OAAO,GAAE,eAAoB,EAC7B,OAAO,GAAE,kBAAuB,GAC/B,iBAAiB,
|
|
1
|
+
{"version":3,"file":"use-audit-log.d.ts","sourceRoot":"","sources":["../../src/hooks/use-audit-log.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,KAAK,eAAe,EAKrB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,gBAAgB,EAAE,wBAAwB,EAAE,CAAC;IAC7C,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC;AAEF,wBAAgB,WAAW,CACzB,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,OAAO,GAAE,eAAoB,EAC7B,OAAO,GAAE,kBAAuB,GAC/B,iBAAiB,CA+CnB"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A, a, e, j, k, n, o, p, D, q, r, R, T, b, c, d, f, g, h, i, l, u, w, m } from "./RecordSheet-
|
|
2
|
-
import { u as u2, a as a2, b as b2, c as c2 } from "./use-automation-run-
|
|
1
|
+
import { A, a, e, j, k, n, o, p, D, q, r, R, T, b, c, d, f, g, h, i, l, u, w, m } from "./RecordSheet-gFscQDNL.js";
|
|
2
|
+
import { u as u2, a as a2, b as b2, c as c2 } from "./use-automation-run-D2HediFL.js";
|
|
3
3
|
import { u as u3, a as a3, b as b3, c as c3, d as d2, e as e2 } from "./use-sql-table-DWHMqSIq.js";
|
|
4
4
|
import { B, E, z, b as b4, A as A2, C, D as D2, c as c4, F, G, H, I, g as g2, J, K, L, f as f2, M, O, N, a as a4, h as h2, P, i as i2, Q, R as R2, S, T as T2, U, o as o2, p as p2, d as d3, j as j2, k as k2, l as l2, m as m2, n as n2, q as q2, r as r2, t, u as u4, v, w as w2, V, W, e as e3, x, s, y } from "./automations-EgDXJ43_.js";
|
|
5
5
|
import { o as o3, f as f3, a as a5, b as b5, c as c5, d as d4, e as e4, g as g3, h as h3, i as i3, j as j3, k as k3, l as l3, m as m3, n as n3, s as s2 } from "./formatters-D4T821Dv.js";
|
|
@@ -43,8 +43,13 @@ export type AuditLogPagination = {
|
|
|
43
43
|
has_more: boolean;
|
|
44
44
|
next_cursor?: string;
|
|
45
45
|
};
|
|
46
|
+
export type AuditLogCollectionStatus = {
|
|
47
|
+
name: string;
|
|
48
|
+
audit_enabled: boolean;
|
|
49
|
+
};
|
|
46
50
|
export type AuditLogListResponse = {
|
|
47
51
|
audit_logs: AuditLogEntry[];
|
|
52
|
+
record_collections?: AuditLogCollectionStatus[];
|
|
48
53
|
pagination: AuditLogPagination;
|
|
49
54
|
};
|
|
50
55
|
export type AuditLogSnapshotResponse = {
|
|
@@ -57,6 +62,9 @@ export type AuditLogFilters = {
|
|
|
57
62
|
since?: string;
|
|
58
63
|
until?: string;
|
|
59
64
|
};
|
|
65
|
+
export type AuditLogFilterState = AuditLogFilters & {
|
|
66
|
+
collections: string[];
|
|
67
|
+
};
|
|
60
68
|
export type ListRecordAuditLogParams = AuditLogFilters & {
|
|
61
69
|
collections: readonly string[];
|
|
62
70
|
cursor?: string;
|
|
@@ -68,8 +76,11 @@ export type RecordAuditLogCsvResult = {
|
|
|
68
76
|
truncated: boolean;
|
|
69
77
|
};
|
|
70
78
|
export declare const normalizeAuditLogPageSize: (value?: number) => number;
|
|
79
|
+
export declare const normalizeAuditLogExportLimit: (value?: number) => number;
|
|
71
80
|
export declare const auditLogActorLabel: (actor: AuditLogActor) => string;
|
|
72
81
|
export declare function normalizeRecordAuditCollections(collections: readonly string[]): string[];
|
|
82
|
+
/** Keep filter state valid when the component's available collections change. */
|
|
83
|
+
export declare function normalizeAuditLogFilterState(collections: readonly string[], filters?: Partial<AuditLogFilterState>): AuditLogFilterState;
|
|
73
84
|
/** Build a request scoped to one or more user-defined collections. */
|
|
74
85
|
export declare function buildRecordAuditLogPath(params: ListRecordAuditLogParams): string;
|
|
75
86
|
export declare const auditLogDetailValue: (entry: AuditLogEntry, label: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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B,GAAG,eAAe,GAAG;IACvD,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,cAAU,KAAG,MAA6D,CAAC;AAErH,eAAO,MAAM,4BAA4B,GAAI,cAA8B,KAAG,MACc,CAAC;AAE7F,eAAO,MAAM,kBAAkB,GAAI,OAAO,aAAa,KAAG,MACK,CAAC;AAEhE,wBAAgB,+BAA+B,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAUxF;AAED,iFAAiF;AACjF,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,OAAO,GAAE,OAAO,CAAC,mBAAmB,CAAM,GACzC,mBAAmB,CAcrB;AAED,sEAAsE;AACtE,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,wBAAwB,GAAG,MAAM,CAqBhF;AAID,eAAO,MAAM,mBAAmB,GAAI,OAAO,aAAa,EAAE,OAAO,MAAM,KAAG,MACP,CAAC;AAMpE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,MAAM,CAkBjE"}
|
package/dist/lib/audit-log.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AuditLogListResponse, AuditLogSnapshotResponse, AuditLogStore, ListRecordAuditLogParams, RecordAuditLogCsvResult } from './audit-log-core';
|
|
2
|
-
export { AUDIT_LOG_EXPORT_LIMIT, AUDIT_LOG_MAX_COLLECTIONS, type AuditLogActor, type AuditLogEntry, type AuditLogEvent, type AuditLogField, type AuditLogFilters, type AuditLogListResponse, auditLogActorLabel, auditLogDetailValue, normalizeAuditLogPageSize, normalizeRecordAuditCollections, } from './audit-log-core';
|
|
2
|
+
export { AUDIT_LOG_EXPORT_LIMIT, AUDIT_LOG_MAX_COLLECTIONS, type AuditLogActor, type AuditLogCollectionStatus, type AuditLogEntry, type AuditLogEvent, type AuditLogField, type AuditLogFilterState, type AuditLogFilters, type AuditLogListResponse, auditLogActorLabel, auditLogDetailValue, normalizeAuditLogExportLimit, normalizeAuditLogFilterState, normalizeAuditLogPageSize, normalizeRecordAuditCollections, } from './audit-log-core';
|
|
3
3
|
export declare function listRecordAuditLog(params: ListRecordAuditLogParams): Promise<AuditLogListResponse>;
|
|
4
4
|
export declare function getRecordAuditLogSnapshot(id: string, store: AuditLogStore): Promise<AuditLogSnapshotResponse>;
|
|
5
5
|
/** Fetch the current filtered feed page-by-page, capped defensively at 10,000 rows. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-log.d.ts","sourceRoot":"","sources":["../../src/lib/audit-log.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAGlB,KAAK,wBAAwB,
|
|
1
|
+
{"version":3,"file":"audit-log.d.ts","sourceRoot":"","sources":["../../src/lib/audit-log.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAGlB,KAAK,wBAAwB,EAE7B,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,EAC5B,4BAA4B,EAC5B,yBAAyB,EACzB,+BAA+B,GAChC,MAAM,kBAAkB,CAAC;AAE1B,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAExG;AAED,wBAAsB,yBAAyB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,wBAAwB,CAAC,CASnH;AAED,uFAAuF;AACvF,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,IAAI,CAAC,wBAAwB,EAAE,QAAQ,GAAG,OAAO,CAAC,EAC1D,OAAO,SAAyB,GAC/B,OAAO,CAAC,uBAAuB,CAAC,CA2BlC"}
|
package/dist/ui.css
CHANGED
|
@@ -105,6 +105,7 @@
|
|
|
105
105
|
--color-amber-500: oklch(76.9% .188 70.08);
|
|
106
106
|
--color-amber-600: oklch(66.6% .179 58.318);
|
|
107
107
|
--color-amber-800: oklch(47.3% .137 46.201);
|
|
108
|
+
--color-amber-950: oklch(27.9% .077 45.635);
|
|
108
109
|
--color-green-600: oklch(62.7% .194 149.214);
|
|
109
110
|
--color-emerald-50: oklch(97.9% .021 166.113);
|
|
110
111
|
--color-emerald-200: oklch(90.5% .093 164.15);
|
|
@@ -1106,10 +1107,6 @@
|
|
|
1106
1107
|
width: 8.5rem;
|
|
1107
1108
|
}
|
|
1108
1109
|
|
|
1109
|
-
.w-\[10\.5rem\] {
|
|
1110
|
-
width: 10.5rem;
|
|
1111
|
-
}
|
|
1112
|
-
|
|
1113
1110
|
.w-\[11rem\] {
|
|
1114
1111
|
width: 11rem;
|
|
1115
1112
|
}
|
|
@@ -2016,6 +2013,10 @@
|
|
|
2016
2013
|
padding: calc(var(--spacing) * 4);
|
|
2017
2014
|
}
|
|
2018
2015
|
|
|
2016
|
+
.p-5 {
|
|
2017
|
+
padding: calc(var(--spacing) * 5);
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2019
2020
|
.p-6 {
|
|
2020
2021
|
padding: calc(var(--spacing) * 6);
|
|
2021
2022
|
}
|
|
@@ -2292,6 +2293,10 @@
|
|
|
2292
2293
|
color: var(--color-amber-800);
|
|
2293
2294
|
}
|
|
2294
2295
|
|
|
2296
|
+
.text-amber-950 {
|
|
2297
|
+
color: var(--color-amber-950);
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2295
2300
|
.text-background {
|
|
2296
2301
|
color: var(--background);
|
|
2297
2302
|
}
|
|
@@ -957,6 +957,7 @@ function replaceSession(sessions, next) {
|
|
|
957
957
|
const AUDIT_LOG_EXPORT_LIMIT = 1e4;
|
|
958
958
|
const AUDIT_LOG_MAX_COLLECTIONS = 20;
|
|
959
959
|
const normalizeAuditLogPageSize = (value = 50) => Math.min(200, Math.max(1, Math.trunc(value) || 50));
|
|
960
|
+
const normalizeAuditLogExportLimit = (value = AUDIT_LOG_EXPORT_LIMIT) => Math.min(AUDIT_LOG_EXPORT_LIMIT, Math.max(1, Math.trunc(value) || AUDIT_LOG_EXPORT_LIMIT));
|
|
960
961
|
const auditLogActorLabel = (actor) => actor.name?.trim() || actor.email?.trim() || actor.type_label;
|
|
961
962
|
function normalizeRecordAuditCollections(collections) {
|
|
962
963
|
const normalized = [];
|
|
@@ -969,6 +970,20 @@ function normalizeRecordAuditCollections(collections) {
|
|
|
969
970
|
}
|
|
970
971
|
return normalized;
|
|
971
972
|
}
|
|
973
|
+
function normalizeAuditLogFilterState(collections, filters = {}) {
|
|
974
|
+
const available = normalizeRecordAuditCollections(collections);
|
|
975
|
+
const allowed = new Set(available);
|
|
976
|
+
const selected = normalizeRecordAuditCollections(filters.collections ?? available).filter(
|
|
977
|
+
(name) => allowed.has(name)
|
|
978
|
+
);
|
|
979
|
+
return {
|
|
980
|
+
collections: selected.length > 0 ? selected : available,
|
|
981
|
+
event: filters.event,
|
|
982
|
+
actor: filters.actor?.trim() || void 0,
|
|
983
|
+
since: filters.since?.trim() || void 0,
|
|
984
|
+
until: filters.until?.trim() || void 0
|
|
985
|
+
};
|
|
986
|
+
}
|
|
972
987
|
function buildRecordAuditLogPath(params) {
|
|
973
988
|
const collections = normalizeRecordAuditCollections(params.collections);
|
|
974
989
|
if (collections.length === 0) {
|
|
@@ -1024,7 +1039,7 @@ async function getRecordAuditLogSnapshot(id, store) {
|
|
|
1024
1039
|
);
|
|
1025
1040
|
}
|
|
1026
1041
|
async function fetchRecordAuditLogCsv(params, maxRows = AUDIT_LOG_EXPORT_LIMIT) {
|
|
1027
|
-
const limit =
|
|
1042
|
+
const limit = normalizeAuditLogExportLimit(maxRows);
|
|
1028
1043
|
const entries = [];
|
|
1029
1044
|
let cursor = "";
|
|
1030
1045
|
let truncated = false;
|
|
@@ -1078,6 +1093,7 @@ function useAuditLog(collections, filters = {}, options = {}) {
|
|
|
1078
1093
|
});
|
|
1079
1094
|
return {
|
|
1080
1095
|
entries: query.data?.pages.flatMap((page) => page.audit_logs) ?? [],
|
|
1096
|
+
collectionStatus: query.data?.pages[0]?.record_collections ?? [],
|
|
1081
1097
|
error: query.error,
|
|
1082
1098
|
isLoading: query.isLoading,
|
|
1083
1099
|
isFetching: query.isFetching,
|
|
@@ -1226,9 +1242,10 @@ export {
|
|
|
1226
1242
|
useAutomationRun as c,
|
|
1227
1243
|
auditLogDetailValue as d,
|
|
1228
1244
|
auditLogActorLabel as e,
|
|
1229
|
-
|
|
1245
|
+
normalizeAuditLogFilterState as f,
|
|
1230
1246
|
getRecordAuditLogSnapshot as g,
|
|
1231
|
-
|
|
1247
|
+
fetchRecordAuditLogCsv as h,
|
|
1248
|
+
normalizeAuditLogExportLimit as i,
|
|
1232
1249
|
normalizeRecordAuditCollections as n,
|
|
1233
1250
|
useAgentChat as u
|
|
1234
1251
|
};
|
package/package.json
CHANGED