@lumerahq/ui 0.12.0-dev.1 → 0.12.0-dev.3
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 +14 -6
- package/dist/{RecordSheet-gFscQDNL.js → RecordSheet-DknloKD2.js} +406 -86
- package/dist/components/audit-log/AuditLog.d.ts +3 -1
- package/dist/components/audit-log/AuditLog.d.ts.map +1 -1
- package/dist/components/audit-log/AuditLogEntry.d.ts +3 -1
- package/dist/components/audit-log/AuditLogEntry.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{highlighted-body-OFNGDK62-Dttr28i2.js → highlighted-body-OFNGDK62-BLfYHDYi.js} +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/audit-log-core.d.ts +6 -1
- package/dist/lib/audit-log-core.d.ts.map +1 -1
- package/dist/lib/audit-log.d.ts +3 -3
- package/dist/lib/audit-log.d.ts.map +1 -1
- package/dist/mermaid-GHXKKRXX-2xNwWUyn.js +4 -0
- package/dist/ui.css +49 -5
- package/dist/{use-automation-run-D2HediFL.js → use-automation-run-B2iPUXiG.js} +40 -16
- package/package.json +1 -1
- package/dist/mermaid-GHXKKRXX-BxahFUxz.js +0 -4
package/README.md
CHANGED
|
@@ -63,18 +63,26 @@ import { AuditLog } from '@lumerahq/ui';
|
|
|
63
63
|
finance__invoices: 'Invoices',
|
|
64
64
|
finance__payments: 'Payments',
|
|
65
65
|
}}
|
|
66
|
+
activityNouns={{
|
|
67
|
+
finance__invoices: 'invoice',
|
|
68
|
+
finance__payments: 'payment',
|
|
69
|
+
}}
|
|
66
70
|
fieldLabels={{ customer_id: 'Customer' }}
|
|
67
71
|
showSystemFields={false}
|
|
68
72
|
exportFilename="finance-activity.csv"
|
|
69
73
|
/>;
|
|
70
74
|
```
|
|
71
75
|
|
|
72
|
-
The component includes collection, date/time, event, and actor filters
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
The component includes collection, date/time, event, and actor filters with
|
|
77
|
+
visible active-filter chips, quick date presets, lazy before/after details,
|
|
78
|
+
pagination, and CSV export with filename/count/truncation feedback. It also
|
|
79
|
+
supports controlled filters, column and density options, record navigation
|
|
80
|
+
callbacks, and custom loading, empty, and error states. Friendly collection
|
|
81
|
+
labels are used in the collection column and CSV export. Optional
|
|
82
|
+
`activityNouns` make activity text read naturally, for example "Updated
|
|
83
|
+
invoice" instead of "Updated Invoices". If a selected collection has auditing
|
|
84
|
+
turned off, existing history remains visible and the component shows a warning
|
|
85
|
+
that future changes will not be recorded.
|
|
78
86
|
|
|
79
87
|
### Assistant Chat
|
|
80
88
|
|
|
@@ -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
|
|
4
|
+
import { u as useAgentChat, a as useAgentChatSessions, g as getRecordAuditLogSnapshot, d as auditLogSummaryWithCollectionLabel, e as auditLogDetailValue, f as auditLogActorLabel, n as normalizeRecordAuditCollections, h as normalizeAuditLogFilterState, A as AUDIT_LOG_MAX_COLLECTIONS, b as useAuditLog, i as fetchRecordAuditLogCsv, j as normalizeAuditLogExportLimit, c as useAutomationRun } from "./use-automation-run-B2iPUXiG.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$L = [
|
|
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$L);
|
|
94
|
+
const __iconNode$K = [
|
|
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$K);
|
|
101
|
+
const __iconNode$J = [
|
|
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$J);
|
|
106
|
+
const __iconNode$I = [
|
|
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$H = [
|
|
|
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$I);
|
|
115
|
+
const __iconNode$H = [
|
|
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,7 +122,16 @@ const __iconNode$G = [
|
|
|
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$
|
|
125
|
+
const Brain = createLucideIcon("brain", __iconNode$H);
|
|
126
|
+
const __iconNode$G = [
|
|
127
|
+
["path", { d: "M16 14v2.2l1.6 1", key: "fo4ql5" }],
|
|
128
|
+
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
129
|
+
["path", { d: "M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5", key: "1osxxc" }],
|
|
130
|
+
["path", { d: "M3 10h5", key: "r794hk" }],
|
|
131
|
+
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
132
|
+
["circle", { cx: "16", cy: "16", r: "6", key: "qoo3c4" }]
|
|
133
|
+
];
|
|
134
|
+
const CalendarClock = createLucideIcon("calendar-clock", __iconNode$G);
|
|
126
135
|
const __iconNode$F = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
127
136
|
const Check = createLucideIcon("check", __iconNode$F);
|
|
128
137
|
const __iconNode$E = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
@@ -24041,7 +24050,7 @@ var lr = (e) => {
|
|
|
24041
24050
|
for (; t > 0 && e[t - 1] === `
|
|
24042
24051
|
`; ) t--;
|
|
24043
24052
|
return e.slice(0, t);
|
|
24044
|
-
}, cr = lazy(() => import("./highlighted-body-OFNGDK62-
|
|
24053
|
+
}, cr = lazy(() => import("./highlighted-body-OFNGDK62-BLfYHDYi.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), st = ({ code: e, language: t, className: o, children: n, isIncomplete: r = false, startLine: s2, lineNumbers: a, ...l }) => {
|
|
24045
24054
|
let i = y2(), d2 = useMemo(() => lr(e), [e]), c2 = useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: d2.split(`
|
|
24046
24055
|
`).map((p2) => [{ content: p2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [d2]);
|
|
24047
24056
|
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 }) })] }) });
|
|
@@ -24403,7 +24412,7 @@ var vo = ({ children: e, className: t, showControls: o, showCopy: n = true, show
|
|
|
24403
24412
|
let l = y2(), i = o && n, d2 = o && r, c2 = o && s2, p2 = i || d2 || c2;
|
|
24404
24413
|
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 }) })] });
|
|
24405
24414
|
};
|
|
24406
|
-
var es = /startLine=(\d+)/, ts = /\bnoLineNumbers\b/, os = lazy(() => import("./mermaid-GHXKKRXX-
|
|
24415
|
+
var es = /startLine=(\d+)/, ts = /\bnoLineNumbers\b/, os = lazy(() => import("./mermaid-GHXKKRXX-2xNwWUyn.js").then((e) => ({ default: e.Mermaid }))), ns = /language-([^\s]+)/;
|
|
24407
24416
|
function qe(e, t) {
|
|
24408
24417
|
if (!(e != null && e.position || t != null && t.position)) return true;
|
|
24409
24418
|
if (!(e != null && e.position && (t != null && t.position))) return false;
|
|
@@ -29550,12 +29559,20 @@ const systemFieldKeys = /* @__PURE__ */ new Set([
|
|
|
29550
29559
|
"external_id",
|
|
29551
29560
|
"lm_provenance"
|
|
29552
29561
|
]);
|
|
29562
|
+
const identityFieldKeys = /* @__PURE__ */ new Set(["collection", "collection_id", "record_id"]);
|
|
29553
29563
|
const fieldKey = (field) => field.key?.trim().toLowerCase() || field.label.trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
29554
|
-
const displayFields = (fields, fieldLabels, showSystemFields) => {
|
|
29564
|
+
const displayFields = (fields, fieldLabels, showSystemFields, options = {}) => {
|
|
29555
29565
|
if (!fields) return null;
|
|
29556
29566
|
return fields.filter((field) => showSystemFields || !systemFieldKeys.has(fieldKey(field))).map((field) => {
|
|
29557
|
-
const
|
|
29558
|
-
|
|
29567
|
+
const key = fieldKey(field);
|
|
29568
|
+
const friendlyCollection = key === "collection" && options.collectionLabel?.trim() && options.collectionApiName?.trim() ? {
|
|
29569
|
+
...field,
|
|
29570
|
+
value: options.collectionLabel.trim(),
|
|
29571
|
+
secondary: options.collectionLabel.trim() === options.collectionApiName.trim() ? field.secondary : options.collectionApiName.trim(),
|
|
29572
|
+
mono: false
|
|
29573
|
+
} : field;
|
|
29574
|
+
const label = field.key && fieldLabels?.[field.key] || fieldLabels?.[field.label] || fieldLabels?.[key];
|
|
29575
|
+
return label?.trim() ? { ...friendlyCollection, label: label.trim() } : friendlyCollection;
|
|
29559
29576
|
});
|
|
29560
29577
|
};
|
|
29561
29578
|
function FieldValue({ field }) {
|
|
@@ -29580,6 +29597,25 @@ function FieldList({ fields }) {
|
|
|
29580
29597
|
`${field.key || field.label}-${index2}`
|
|
29581
29598
|
)) });
|
|
29582
29599
|
}
|
|
29600
|
+
function FieldGroups({ fields }) {
|
|
29601
|
+
const groups = [
|
|
29602
|
+
{ title: "Changed fields", fields: [] },
|
|
29603
|
+
{ title: "Record identity", fields: [] },
|
|
29604
|
+
{ title: "System/debug fields", fields: [] },
|
|
29605
|
+
{ title: "Other details", fields: [] }
|
|
29606
|
+
];
|
|
29607
|
+
for (const field of fields) {
|
|
29608
|
+
const key = fieldKey(field);
|
|
29609
|
+
if (field.changed || field.value.includes("→")) groups[0].fields.push(field);
|
|
29610
|
+
else if (identityFieldKeys.has(key)) groups[1].fields.push(field);
|
|
29611
|
+
else if (systemFieldKeys.has(key)) groups[2].fields.push(field);
|
|
29612
|
+
else groups[3].fields.push(field);
|
|
29613
|
+
}
|
|
29614
|
+
return /* @__PURE__ */ jsx("div", { className: "grid gap-4", children: groups.filter((group) => group.fields.length > 0).map((group) => /* @__PURE__ */ jsxs("section", { className: "min-w-0", children: [
|
|
29615
|
+
/* @__PURE__ */ jsx("p", { className: "mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: group.title }),
|
|
29616
|
+
/* @__PURE__ */ jsx(FieldList, { fields: group.fields })
|
|
29617
|
+
] }, group.title)) });
|
|
29618
|
+
}
|
|
29583
29619
|
function SnapshotSide({ label, fields }) {
|
|
29584
29620
|
return /* @__PURE__ */ jsxs("div", { className: "min-w-0 rounded-xl border bg-background p-3", children: [
|
|
29585
29621
|
/* @__PURE__ */ jsx("p", { className: "mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
|
|
@@ -29588,7 +29624,9 @@ function SnapshotSide({ label, fields }) {
|
|
|
29588
29624
|
}
|
|
29589
29625
|
function AuditLogEntry({
|
|
29590
29626
|
entry,
|
|
29627
|
+
collectionApiName,
|
|
29591
29628
|
collectionLabel,
|
|
29629
|
+
activityCollectionLabel,
|
|
29592
29630
|
density,
|
|
29593
29631
|
showCollectionColumn,
|
|
29594
29632
|
showActorColumn,
|
|
@@ -29607,33 +29645,26 @@ function AuditLogEntry({
|
|
|
29607
29645
|
staleTime: Number.POSITIVE_INFINITY,
|
|
29608
29646
|
retry: false
|
|
29609
29647
|
});
|
|
29610
|
-
const detailFields = displayFields(entry.details, fieldLabels,
|
|
29648
|
+
const detailFields = displayFields(entry.details, fieldLabels, showSystemFields, { collectionApiName, collectionLabel }) ?? [];
|
|
29611
29649
|
const recordHref = getRecordHref?.(entry)?.trim();
|
|
29612
29650
|
const rowPadding = density === "comfortable" ? "py-4" : void 0;
|
|
29651
|
+
const summary = activityCollectionLabel ? auditLogSummaryWithCollectionLabel(entry, activityCollectionLabel) : entry.summary;
|
|
29613
29652
|
const recordAction = recordHref ? /* @__PURE__ */ jsxs(
|
|
29614
29653
|
"a",
|
|
29615
29654
|
{
|
|
29616
29655
|
href: recordHref,
|
|
29617
|
-
className: buttonVariants({ variant: "ghost", size: "
|
|
29656
|
+
className: buttonVariants({ variant: "ghost", size: "xs", className: "text-xs" }),
|
|
29618
29657
|
title: "Open record",
|
|
29619
29658
|
onClick: () => onRecordClick?.(entry),
|
|
29620
29659
|
children: [
|
|
29621
|
-
/* @__PURE__ */ jsx(
|
|
29622
|
-
/* @__PURE__ */ jsx(
|
|
29660
|
+
/* @__PURE__ */ jsx(ExternalLink, { "aria-hidden": true }),
|
|
29661
|
+
/* @__PURE__ */ jsx("span", { children: "Open record" })
|
|
29623
29662
|
]
|
|
29624
29663
|
}
|
|
29625
|
-
) : onRecordClick ? /* @__PURE__ */
|
|
29626
|
-
|
|
29627
|
-
|
|
29628
|
-
|
|
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;
|
|
29664
|
+
) : onRecordClick ? /* @__PURE__ */ jsxs(Button2, { type: "button", variant: "ghost", size: "xs", title: "Open record", onClick: () => onRecordClick(entry), children: [
|
|
29665
|
+
/* @__PURE__ */ jsx(ExternalLink, {}),
|
|
29666
|
+
"Open record"
|
|
29667
|
+
] }) : null;
|
|
29637
29668
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
29638
29669
|
/* @__PURE__ */ jsxs(TableRow, { "aria-expanded": expanded, children: [
|
|
29639
29670
|
/* @__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) }) }),
|
|
@@ -29647,7 +29678,7 @@ function AuditLogEntry({
|
|
|
29647
29678
|
) : null,
|
|
29648
29679
|
/* @__PURE__ */ jsx(TableCell, { className: cn$2("min-w-64 whitespace-normal", rowPadding), children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2.5", children: [
|
|
29649
29680
|
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn$2("mt-1.5 size-2 shrink-0 rounded-full", markerStyles[entry.event]) }),
|
|
29650
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
29681
|
+
/* @__PURE__ */ jsx("span", { children: summary.map((segment, index2) => /* @__PURE__ */ jsxs("span", { children: [
|
|
29651
29682
|
index2 > 0 ? " " : "",
|
|
29652
29683
|
/* @__PURE__ */ jsx("span", { className: segment.emphasis === "strong" ? "font-semibold" : void 0, children: segment.text })
|
|
29653
29684
|
] }, `${segment.text}-${index2}`)) })
|
|
@@ -29677,7 +29708,7 @@ function AuditLogEntry({
|
|
|
29677
29708
|
colSpan: columnCount,
|
|
29678
29709
|
className: cn$2("bg-muted/20 whitespace-normal", density === "comfortable" ? "p-5" : "p-4"),
|
|
29679
29710
|
children: [
|
|
29680
|
-
detailFields.length > 0 ? /* @__PURE__ */ jsx(
|
|
29711
|
+
detailFields.length > 0 ? /* @__PURE__ */ jsx(FieldGroups, { fields: detailFields }) : null,
|
|
29681
29712
|
entry.has_snapshot ? /* @__PURE__ */ jsxs("div", { className: cn$2(detailFields.length > 0 && "mt-4 border-t pt-4"), children: [
|
|
29682
29713
|
/* @__PURE__ */ jsx("p", { className: "mb-3 text-sm font-medium", children: "Before and after" }),
|
|
29683
29714
|
snapshotQuery.isLoading ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 py-4 text-sm text-muted-foreground", children: [
|
|
@@ -30518,6 +30549,51 @@ const MenuGroupLabel = /* @__PURE__ */ React.forwardRef(function MenuGroupLabelC
|
|
|
30518
30549
|
});
|
|
30519
30550
|
});
|
|
30520
30551
|
if (process.env.NODE_ENV !== "production") MenuGroupLabel.displayName = "MenuGroupLabel";
|
|
30552
|
+
const MenuItem = /* @__PURE__ */ React.forwardRef(function MenuItem2(componentProps, forwardedRef) {
|
|
30553
|
+
const {
|
|
30554
|
+
render,
|
|
30555
|
+
className,
|
|
30556
|
+
id: idProp,
|
|
30557
|
+
label,
|
|
30558
|
+
nativeButton = false,
|
|
30559
|
+
disabled = false,
|
|
30560
|
+
closeOnClick = true,
|
|
30561
|
+
...elementProps
|
|
30562
|
+
} = componentProps;
|
|
30563
|
+
const listItem2 = useCompositeListItem({
|
|
30564
|
+
label
|
|
30565
|
+
});
|
|
30566
|
+
const menuPositionerContext = useMenuPositionerContext(true);
|
|
30567
|
+
const id = useBaseUiId(idProp);
|
|
30568
|
+
const {
|
|
30569
|
+
store
|
|
30570
|
+
} = useMenuRootContext();
|
|
30571
|
+
const highlighted = store.useState("isActive", listItem2.index);
|
|
30572
|
+
const itemProps = store.useState("itemProps");
|
|
30573
|
+
const {
|
|
30574
|
+
getItemProps,
|
|
30575
|
+
itemRef
|
|
30576
|
+
} = useMenuItem({
|
|
30577
|
+
closeOnClick,
|
|
30578
|
+
disabled,
|
|
30579
|
+
highlighted,
|
|
30580
|
+
id,
|
|
30581
|
+
store,
|
|
30582
|
+
nativeButton,
|
|
30583
|
+
nodeId: menuPositionerContext?.nodeId,
|
|
30584
|
+
itemMetadata: REGULAR_ITEM
|
|
30585
|
+
});
|
|
30586
|
+
const state = React.useMemo(() => ({
|
|
30587
|
+
disabled,
|
|
30588
|
+
highlighted
|
|
30589
|
+
}), [disabled, highlighted]);
|
|
30590
|
+
return useRenderElement("div", componentProps, {
|
|
30591
|
+
state,
|
|
30592
|
+
props: [itemProps, elementProps, getItemProps],
|
|
30593
|
+
ref: [itemRef, forwardedRef, listItem2.ref]
|
|
30594
|
+
});
|
|
30595
|
+
});
|
|
30596
|
+
if (process.env.NODE_ENV !== "production") MenuItem.displayName = "MenuItem";
|
|
30521
30597
|
const EMPTY = 0;
|
|
30522
30598
|
class Timeout {
|
|
30523
30599
|
static create() {
|
|
@@ -39681,6 +39757,26 @@ function DropdownMenuLabel({
|
|
|
39681
39757
|
}
|
|
39682
39758
|
);
|
|
39683
39759
|
}
|
|
39760
|
+
function DropdownMenuItem({
|
|
39761
|
+
className,
|
|
39762
|
+
inset,
|
|
39763
|
+
variant = "default",
|
|
39764
|
+
...props
|
|
39765
|
+
}) {
|
|
39766
|
+
return /* @__PURE__ */ jsx(
|
|
39767
|
+
MenuItem,
|
|
39768
|
+
{
|
|
39769
|
+
"data-slot": "dropdown-menu-item",
|
|
39770
|
+
"data-inset": inset,
|
|
39771
|
+
"data-variant": variant,
|
|
39772
|
+
className: cn$2(
|
|
39773
|
+
"group/dropdown-menu-item relative flex cursor-default items-center gap-2.5 rounded-2xl px-3 py-2 text-sm font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-9.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",
|
|
39774
|
+
className
|
|
39775
|
+
),
|
|
39776
|
+
...props
|
|
39777
|
+
}
|
|
39778
|
+
);
|
|
39779
|
+
}
|
|
39684
39780
|
function DropdownMenuCheckboxItem({
|
|
39685
39781
|
className,
|
|
39686
39782
|
children: children2,
|
|
@@ -39713,6 +39809,16 @@ function DropdownMenuCheckboxItem({
|
|
|
39713
39809
|
}
|
|
39714
39810
|
);
|
|
39715
39811
|
}
|
|
39812
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
39813
|
+
return /* @__PURE__ */ jsx(
|
|
39814
|
+
Separator$1,
|
|
39815
|
+
{
|
|
39816
|
+
"data-slot": "dropdown-menu-separator",
|
|
39817
|
+
className: cn$2("-mx-1.5 my-1.5 h-px bg-border/50", className),
|
|
39818
|
+
...props
|
|
39819
|
+
}
|
|
39820
|
+
);
|
|
39821
|
+
}
|
|
39716
39822
|
let FieldControlDataAttributes = /* @__PURE__ */ (function(FieldControlDataAttributes2) {
|
|
39717
39823
|
FieldControlDataAttributes2["disabled"] = "data-disabled";
|
|
39718
39824
|
FieldControlDataAttributes2["valid"] = "data-valid";
|
|
@@ -42068,6 +42174,18 @@ const dateTimeInputValue = (value) => {
|
|
|
42068
42174
|
const local = new Date(parsed.getTime() - parsed.getTimezoneOffset() * 6e4);
|
|
42069
42175
|
return local.toISOString().slice(0, 16);
|
|
42070
42176
|
};
|
|
42177
|
+
const formatDateTime = (value) => {
|
|
42178
|
+
if (!value) return "";
|
|
42179
|
+
const parsed = new Date(value);
|
|
42180
|
+
if (Number.isNaN(parsed.getTime())) return value;
|
|
42181
|
+
return new Intl.DateTimeFormat(void 0, {
|
|
42182
|
+
month: "short",
|
|
42183
|
+
day: "numeric",
|
|
42184
|
+
year: "numeric",
|
|
42185
|
+
hour: "numeric",
|
|
42186
|
+
minute: "2-digit"
|
|
42187
|
+
}).format(parsed);
|
|
42188
|
+
};
|
|
42071
42189
|
const filenameFor = (collections) => {
|
|
42072
42190
|
const prefix = collections.length === 1 ? collections[0] : "record";
|
|
42073
42191
|
const safePrefix = prefix.trim().replace(/[^a-zA-Z0-9_-]+/g, "-") || "record";
|
|
@@ -42083,14 +42201,52 @@ const downloadCsv = (filename, csv) => {
|
|
|
42083
42201
|
link2.remove();
|
|
42084
42202
|
setTimeout(() => URL.revokeObjectURL(url), 0);
|
|
42085
42203
|
};
|
|
42086
|
-
const defaultState = (icon, title, description) => /* @__PURE__ */ jsxs("div", { children: [
|
|
42204
|
+
const defaultState = (icon, title, description, action) => /* @__PURE__ */ jsxs("div", { children: [
|
|
42087
42205
|
icon,
|
|
42088
42206
|
/* @__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 })
|
|
42207
|
+
/* @__PURE__ */ jsx("p", { className: "mx-auto mt-1 max-w-sm text-xs text-muted-foreground", children: description }),
|
|
42208
|
+
action ? /* @__PURE__ */ jsx("div", { className: "mt-3 flex justify-center gap-2", children: action }) : null
|
|
42090
42209
|
] });
|
|
42210
|
+
const errorCopyFor = (status) => {
|
|
42211
|
+
if (status === 400) {
|
|
42212
|
+
return {
|
|
42213
|
+
title: "Current filters could not be applied",
|
|
42214
|
+
description: "The audit API rejected the current filter values. Reset filters or adjust the date range."
|
|
42215
|
+
};
|
|
42216
|
+
}
|
|
42217
|
+
if (status === 401) {
|
|
42218
|
+
return {
|
|
42219
|
+
title: "Session is not authorized",
|
|
42220
|
+
description: "Refresh the app and sign in again before loading audit activity."
|
|
42221
|
+
};
|
|
42222
|
+
}
|
|
42223
|
+
if (status === 403) {
|
|
42224
|
+
return {
|
|
42225
|
+
title: "Activity is not available",
|
|
42226
|
+
description: "You need read access to every selected collection."
|
|
42227
|
+
};
|
|
42228
|
+
}
|
|
42229
|
+
if (status === 404) {
|
|
42230
|
+
return {
|
|
42231
|
+
title: "Selected collection was not found",
|
|
42232
|
+
description: "Check the selected collection names or reset filters."
|
|
42233
|
+
};
|
|
42234
|
+
}
|
|
42235
|
+
if (status && status >= 500) {
|
|
42236
|
+
return {
|
|
42237
|
+
title: "Audit endpoint is unavailable",
|
|
42238
|
+
description: "Refresh activity. If it still fails, the audit service may be down."
|
|
42239
|
+
};
|
|
42240
|
+
}
|
|
42241
|
+
return {
|
|
42242
|
+
title: "Could not reach audit activity",
|
|
42243
|
+
description: "Refresh activity or reset filters and try again."
|
|
42244
|
+
};
|
|
42245
|
+
};
|
|
42091
42246
|
function AuditLog({
|
|
42092
42247
|
collections,
|
|
42093
42248
|
collectionLabels,
|
|
42249
|
+
activityNouns,
|
|
42094
42250
|
filters: controlledFilters,
|
|
42095
42251
|
defaultFilters,
|
|
42096
42252
|
onFiltersChange,
|
|
@@ -42129,7 +42285,7 @@ function AuditLog({
|
|
|
42129
42285
|
const fromDateTime = dateTimeInputValue(filterState.since);
|
|
42130
42286
|
const untilDateTime = dateTimeInputValue(filterState.until);
|
|
42131
42287
|
const [isExporting, setIsExporting] = useState(false);
|
|
42132
|
-
const [exportStatus, setExportStatus] = useState({ key: "", message: "" });
|
|
42288
|
+
const [exportStatus, setExportStatus] = useState({ key: "", message: "", tone: "success" });
|
|
42133
42289
|
const requestFilters = useMemo(
|
|
42134
42290
|
() => ({
|
|
42135
42291
|
event: filterState.event,
|
|
@@ -42144,6 +42300,7 @@ function AuditLog({
|
|
|
42144
42300
|
const auditLog = useAuditLog(selectedCollections, requestFilters, { pageSize, enabled: !configurationError });
|
|
42145
42301
|
const columnCount = 3 + Number(showCollectionColumn) + Number(showActorColumn);
|
|
42146
42302
|
const labelForCollection = (collection) => collectionLabels?.[collection]?.trim() || collection;
|
|
42303
|
+
const activityLabelForCollection = (collection) => activityNouns?.[collection]?.trim() || collectionLabels?.[collection]?.trim();
|
|
42147
42304
|
const actorOptions = useMemo(() => {
|
|
42148
42305
|
const actors = /* @__PURE__ */ new Map();
|
|
42149
42306
|
for (const entry of auditLog.entries) {
|
|
@@ -42155,8 +42312,10 @@ function AuditLog({
|
|
|
42155
42312
|
);
|
|
42156
42313
|
}, [auditLog.entries]);
|
|
42157
42314
|
const hasFilters = selectedCollections.length !== availableCollections.length || Boolean(filterState.event || filterState.actor || filterState.since || filterState.until);
|
|
42315
|
+
const hasDateFilter = Boolean(filterState.since || filterState.until);
|
|
42158
42316
|
const status = auditLog.error?.status;
|
|
42159
|
-
const
|
|
42317
|
+
const errorCopy = errorCopyFor(status);
|
|
42318
|
+
const exportStatusForFilters = exportStatus.key === filterKey && exportStatus.message ? exportStatus : null;
|
|
42160
42319
|
const selectedActor = actorOptions.find(([actorID2]) => actorID2 === actor)?.[1];
|
|
42161
42320
|
const selectedActorLabel = actor === "all" ? "All actors" : selectedActor ? auditLogActorLabel(selectedActor) : "Selected actor";
|
|
42162
42321
|
const disabledCollections = auditLog.collectionStatus.filter((collection) => !collection.audit_enabled).map((collection) => labelForCollection(collection.name));
|
|
@@ -42177,19 +42336,82 @@ function AuditLog({
|
|
|
42177
42336
|
});
|
|
42178
42337
|
};
|
|
42179
42338
|
const resetFilters = () => setFilters(normalizeAuditLogFilterState(availableCollections));
|
|
42339
|
+
const resetFiltersFromPointer = () => resetFilters();
|
|
42340
|
+
const applyDatePreset = (preset) => {
|
|
42341
|
+
if (preset === "clear") {
|
|
42342
|
+
setFilters({ ...filterState, since: void 0, until: void 0 });
|
|
42343
|
+
return;
|
|
42344
|
+
}
|
|
42345
|
+
const now = /* @__PURE__ */ new Date();
|
|
42346
|
+
if (preset === "today") {
|
|
42347
|
+
const start = new Date(now);
|
|
42348
|
+
start.setHours(0, 0, 0, 0);
|
|
42349
|
+
const end = new Date(now);
|
|
42350
|
+
end.setHours(23, 59, 59, 999);
|
|
42351
|
+
setFilters({ ...filterState, since: start.toISOString(), until: end.toISOString() });
|
|
42352
|
+
return;
|
|
42353
|
+
}
|
|
42354
|
+
const hours = preset === "last-24-hours" ? 24 : 24 * 7;
|
|
42355
|
+
const since = new Date(now.getTime() - hours * 60 * 60 * 1e3);
|
|
42356
|
+
setFilters({ ...filterState, since: since.toISOString(), until: void 0 });
|
|
42357
|
+
};
|
|
42358
|
+
const filterChips = [];
|
|
42359
|
+
if (selectedCollections.length !== availableCollections.length) {
|
|
42360
|
+
const labels = selectedCollections.map(labelForCollection);
|
|
42361
|
+
filterChips.push({
|
|
42362
|
+
key: "collections",
|
|
42363
|
+
label: `Collections: ${labels.length <= 2 ? labels.join(", ") : `${labels.length} collections`}`,
|
|
42364
|
+
onClear: () => setFilters({ ...filterState, collections: availableCollections, actor: void 0 })
|
|
42365
|
+
});
|
|
42366
|
+
}
|
|
42367
|
+
if (filterState.since) {
|
|
42368
|
+
filterChips.push({
|
|
42369
|
+
key: "since",
|
|
42370
|
+
label: `From ${formatDateTime(filterState.since)}`,
|
|
42371
|
+
onClear: () => setFilters({ ...filterState, since: void 0 })
|
|
42372
|
+
});
|
|
42373
|
+
}
|
|
42374
|
+
if (filterState.until) {
|
|
42375
|
+
filterChips.push({
|
|
42376
|
+
key: "until",
|
|
42377
|
+
label: `Until ${formatDateTime(filterState.until)}`,
|
|
42378
|
+
onClear: () => setFilters({ ...filterState, until: void 0 })
|
|
42379
|
+
});
|
|
42380
|
+
}
|
|
42381
|
+
if (filterState.event) {
|
|
42382
|
+
filterChips.push({
|
|
42383
|
+
key: "event",
|
|
42384
|
+
label: `Event: ${filterState.event[0].toUpperCase()}${filterState.event.slice(1)}`,
|
|
42385
|
+
onClear: () => setFilters({ ...filterState, event: void 0 })
|
|
42386
|
+
});
|
|
42387
|
+
}
|
|
42388
|
+
if (filterState.actor) {
|
|
42389
|
+
filterChips.push({
|
|
42390
|
+
key: "actor",
|
|
42391
|
+
label: `Actor: ${selectedActorLabel}`,
|
|
42392
|
+
onClear: () => setFilters({ ...filterState, actor: void 0 })
|
|
42393
|
+
});
|
|
42394
|
+
}
|
|
42395
|
+
const filterSummary = filterChips.map((chip) => chip.label).join("; ") || "No filters applied";
|
|
42180
42396
|
const handleExport = async () => {
|
|
42181
42397
|
const limit = normalizeAuditLogExportLimit(exportMaxRows);
|
|
42182
42398
|
setIsExporting(true);
|
|
42183
|
-
setExportStatus({ key: filterKey, message: "" });
|
|
42399
|
+
setExportStatus({ key: filterKey, message: "", tone: "success" });
|
|
42184
42400
|
try {
|
|
42185
|
-
const result = await fetchRecordAuditLogCsv({ collections: selectedCollections, ...requestFilters }, limit
|
|
42186
|
-
|
|
42401
|
+
const result = await fetchRecordAuditLogCsv({ collections: selectedCollections, ...requestFilters }, limit, {
|
|
42402
|
+
collectionLabels,
|
|
42403
|
+
activityNouns
|
|
42404
|
+
});
|
|
42405
|
+
const filename = exportFilename?.trim() || filenameFor(selectedCollections);
|
|
42406
|
+
downloadCsv(filename, result.csv);
|
|
42407
|
+
const rowText = `${result.count.toLocaleString()} ${result.count === 1 ? "row" : "rows"}`;
|
|
42187
42408
|
setExportStatus({
|
|
42188
42409
|
key: filterKey,
|
|
42189
|
-
|
|
42410
|
+
tone: "success",
|
|
42411
|
+
message: `${filename}: exported ${rowText}; ${result.truncated ? `truncated to first ${limit.toLocaleString()} rows` : "not truncated"}; ${hasFilters ? `filters: ${filterSummary}` : "no filters applied"}.`
|
|
42190
42412
|
});
|
|
42191
42413
|
} catch {
|
|
42192
|
-
setExportStatus({ key: filterKey, message: "Could not export the activity. Try again." });
|
|
42414
|
+
setExportStatus({ key: filterKey, message: "Could not export the activity. Try again.", tone: "error" });
|
|
42193
42415
|
} finally {
|
|
42194
42416
|
setIsExporting(false);
|
|
42195
42417
|
}
|
|
@@ -42230,6 +42452,21 @@ function AuditLog({
|
|
|
42230
42452
|
)
|
|
42231
42453
|
] })
|
|
42232
42454
|
] }),
|
|
42455
|
+
exportStatusForFilters ? /* @__PURE__ */ jsxs(
|
|
42456
|
+
"div",
|
|
42457
|
+
{
|
|
42458
|
+
className: cn$2(
|
|
42459
|
+
"flex gap-2 border-b px-5 py-2.5 text-xs",
|
|
42460
|
+
exportStatusForFilters.tone === "success" ? "bg-emerald-50 text-emerald-950" : "bg-rose-50 text-rose-950"
|
|
42461
|
+
),
|
|
42462
|
+
role: "status",
|
|
42463
|
+
"aria-live": "polite",
|
|
42464
|
+
children: [
|
|
42465
|
+
exportStatusForFilters.tone === "success" ? /* @__PURE__ */ jsx(CircleCheck, { className: "mt-0.5 size-4 shrink-0" }) : /* @__PURE__ */ jsx(CircleAlert, { className: "mt-0.5 size-4 shrink-0" }),
|
|
42466
|
+
/* @__PURE__ */ jsx("p", { children: exportStatusForFilters.message })
|
|
42467
|
+
]
|
|
42468
|
+
}
|
|
42469
|
+
) : null,
|
|
42233
42470
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-end gap-2 border-b bg-muted/20 px-5 py-3", children: [
|
|
42234
42471
|
availableCollections.length > 1 ? /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
42235
42472
|
/* @__PURE__ */ jsx(Label, { className: "text-xs text-muted-foreground", children: "Collections" }),
|
|
@@ -42244,22 +42481,31 @@ function AuditLog({
|
|
|
42244
42481
|
]
|
|
42245
42482
|
}
|
|
42246
42483
|
),
|
|
42247
|
-
/* @__PURE__ */
|
|
42248
|
-
/* @__PURE__ */
|
|
42249
|
-
|
|
42250
|
-
|
|
42251
|
-
|
|
42252
|
-
|
|
42253
|
-
|
|
42254
|
-
|
|
42255
|
-
|
|
42256
|
-
|
|
42257
|
-
|
|
42258
|
-
|
|
42259
|
-
|
|
42260
|
-
|
|
42261
|
-
|
|
42262
|
-
|
|
42484
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", className: "w-64", children: [
|
|
42485
|
+
/* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
|
|
42486
|
+
/* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Select collections" }),
|
|
42487
|
+
availableCollections.map((collection) => {
|
|
42488
|
+
const checked = selectedCollections.includes(collection);
|
|
42489
|
+
return /* @__PURE__ */ jsx(
|
|
42490
|
+
DropdownMenuCheckboxItem,
|
|
42491
|
+
{
|
|
42492
|
+
checked,
|
|
42493
|
+
disabled: checked && selectedCollections.length === 1,
|
|
42494
|
+
onCheckedChange: (value) => toggleCollection(collection, value === true),
|
|
42495
|
+
children: /* @__PURE__ */ jsx("span", { className: "truncate", title: collection, children: labelForCollection(collection) })
|
|
42496
|
+
},
|
|
42497
|
+
collection
|
|
42498
|
+
);
|
|
42499
|
+
})
|
|
42500
|
+
] }),
|
|
42501
|
+
hasFilters ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42502
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
42503
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: resetFilters, children: [
|
|
42504
|
+
/* @__PURE__ */ jsx(FunnelX, {}),
|
|
42505
|
+
"Reset filters"
|
|
42506
|
+
] })
|
|
42507
|
+
] }) : null
|
|
42508
|
+
] })
|
|
42263
42509
|
] })
|
|
42264
42510
|
] }) : null,
|
|
42265
42511
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
@@ -42294,6 +42540,28 @@ function AuditLog({
|
|
|
42294
42540
|
}
|
|
42295
42541
|
)
|
|
42296
42542
|
] }),
|
|
42543
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
42544
|
+
/* @__PURE__ */ jsx(Label, { className: "text-xs text-muted-foreground", children: "Date presets" }),
|
|
42545
|
+
/* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
42546
|
+
/* @__PURE__ */ jsxs(
|
|
42547
|
+
DropdownMenuTrigger,
|
|
42548
|
+
{
|
|
42549
|
+
render: /* @__PURE__ */ jsx(Button2, { type: "button", variant: "outline", size: "sm", className: "w-[10rem] justify-start" }),
|
|
42550
|
+
children: [
|
|
42551
|
+
/* @__PURE__ */ jsx(CalendarClock, {}),
|
|
42552
|
+
"Quick range"
|
|
42553
|
+
]
|
|
42554
|
+
}
|
|
42555
|
+
),
|
|
42556
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", children: [
|
|
42557
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => applyDatePreset("last-24-hours"), children: "Last 24 hours" }),
|
|
42558
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => applyDatePreset("last-7-days"), children: "Last 7 days" }),
|
|
42559
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => applyDatePreset("today"), children: "Today" }),
|
|
42560
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
42561
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => applyDatePreset("clear"), children: "Clear date range" })
|
|
42562
|
+
] })
|
|
42563
|
+
] })
|
|
42564
|
+
] }),
|
|
42297
42565
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
42298
42566
|
/* @__PURE__ */ jsx(Label, { htmlFor: eventID, className: "text-xs text-muted-foreground", children: "Event" }),
|
|
42299
42567
|
/* @__PURE__ */ jsxs(
|
|
@@ -42331,11 +42599,45 @@ function AuditLog({
|
|
|
42331
42599
|
)
|
|
42332
42600
|
] }),
|
|
42333
42601
|
/* @__PURE__ */ jsx("span", { className: "mb-2 text-[11px] text-muted-foreground", children: "Dates use local time" }),
|
|
42334
|
-
hasFilters ? /* @__PURE__ */ jsxs(
|
|
42335
|
-
|
|
42336
|
-
|
|
42337
|
-
|
|
42602
|
+
hasFilters ? /* @__PURE__ */ jsxs(
|
|
42603
|
+
Button2,
|
|
42604
|
+
{
|
|
42605
|
+
type: "button",
|
|
42606
|
+
variant: "ghost",
|
|
42607
|
+
size: "sm",
|
|
42608
|
+
className: "mb-px",
|
|
42609
|
+
onPointerDown: resetFiltersFromPointer,
|
|
42610
|
+
onClick: resetFilters,
|
|
42611
|
+
children: [
|
|
42612
|
+
/* @__PURE__ */ jsx(FunnelX, {}),
|
|
42613
|
+
" Reset filters"
|
|
42614
|
+
]
|
|
42615
|
+
}
|
|
42616
|
+
) : null
|
|
42338
42617
|
] }),
|
|
42618
|
+
filterChips.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2 border-b bg-muted/10 px-5 py-2 text-xs", children: [
|
|
42619
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-muted-foreground", children: "Active filters" }),
|
|
42620
|
+
filterChips.map((chip) => /* @__PURE__ */ jsxs(
|
|
42621
|
+
"span",
|
|
42622
|
+
{
|
|
42623
|
+
className: "inline-flex h-6 max-w-full items-center gap-1 rounded-full border bg-background px-2 text-foreground",
|
|
42624
|
+
children: [
|
|
42625
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: chip.label }),
|
|
42626
|
+
/* @__PURE__ */ jsx(
|
|
42627
|
+
"button",
|
|
42628
|
+
{
|
|
42629
|
+
type: "button",
|
|
42630
|
+
className: "rounded-full text-muted-foreground hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:outline-none",
|
|
42631
|
+
"aria-label": `Clear ${chip.label}`,
|
|
42632
|
+
onClick: chip.onClear,
|
|
42633
|
+
children: /* @__PURE__ */ jsx(X$2, { className: "size-3" })
|
|
42634
|
+
}
|
|
42635
|
+
)
|
|
42636
|
+
]
|
|
42637
|
+
},
|
|
42638
|
+
chip.key
|
|
42639
|
+
))
|
|
42640
|
+
] }) : null,
|
|
42339
42641
|
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
42642
|
/* @__PURE__ */ jsx(CircleAlert, { className: "mt-0.5 size-4 shrink-0" }),
|
|
42341
42643
|
/* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -42350,7 +42652,7 @@ function AuditLog({
|
|
|
42350
42652
|
showCollectionColumn ? /* @__PURE__ */ jsx(TableHead, { className: "w-48 text-xs text-muted-foreground", children: "Collection" }) : null,
|
|
42351
42653
|
/* @__PURE__ */ jsx(TableHead, { className: "text-xs text-muted-foreground", children: "Activity" }),
|
|
42352
42654
|
showActorColumn ? /* @__PURE__ */ jsx(TableHead, { className: "w-48 text-xs text-muted-foreground", children: "Actor" }) : null,
|
|
42353
|
-
/* @__PURE__ */ jsx(TableHead, { className: getRecordHref || onRecordClick ? "w-
|
|
42655
|
+
/* @__PURE__ */ jsx(TableHead, { className: getRecordHref || onRecordClick ? "w-36" : "w-12", children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Actions" }) })
|
|
42354
42656
|
] }) }),
|
|
42355
42657
|
/* @__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: [
|
|
42356
42658
|
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-20" }) }),
|
|
@@ -42360,28 +42662,47 @@ function AuditLog({
|
|
|
42360
42662
|
/* @__PURE__ */ jsx(TableCell, {})
|
|
42361
42663
|
] }, 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(
|
|
42362
42664
|
/* @__PURE__ */ jsx(History, { className: "mx-auto mb-3 size-8 text-muted-foreground/60" }),
|
|
42363
|
-
configurationError ? "Audit log is not configured" :
|
|
42364
|
-
configurationError ||
|
|
42665
|
+
configurationError ? "Audit log is not configured" : errorCopy.title,
|
|
42666
|
+
configurationError || `${errorCopy.description} Filters: ${filterSummary}.`,
|
|
42667
|
+
configurationError ? void 0 : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42668
|
+
hasFilters ? /* @__PURE__ */ jsxs(Button2, { type: "button", variant: "outline", size: "sm", onClick: resetFilters, children: [
|
|
42669
|
+
/* @__PURE__ */ jsx(FunnelX, {}),
|
|
42670
|
+
" Reset filters"
|
|
42671
|
+
] }) : null,
|
|
42672
|
+
/* @__PURE__ */ jsxs(Button2, { type: "button", variant: "ghost", size: "sm", onClick: () => void auditLog.refresh(), children: [
|
|
42673
|
+
/* @__PURE__ */ jsx(RefreshCw, {}),
|
|
42674
|
+
" Refresh"
|
|
42675
|
+
] })
|
|
42676
|
+
] })
|
|
42365
42677
|
) }) }) : 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(
|
|
42366
42678
|
/* @__PURE__ */ jsx(History, { className: "mx-auto mb-3 size-8 text-muted-foreground/60" }),
|
|
42367
|
-
"No activity to show",
|
|
42368
|
-
disabledCollections.length > 0 ? "Auditing is off, and no existing changes match the current filters." : "No changes
|
|
42369
|
-
|
|
42370
|
-
|
|
42371
|
-
|
|
42372
|
-
|
|
42373
|
-
|
|
42374
|
-
|
|
42375
|
-
|
|
42376
|
-
|
|
42377
|
-
|
|
42378
|
-
|
|
42379
|
-
|
|
42380
|
-
|
|
42381
|
-
|
|
42382
|
-
|
|
42383
|
-
|
|
42384
|
-
|
|
42679
|
+
hasDateFilter ? "No activity in this date range" : hasFilters ? "No activity matches these filters" : "No activity to show",
|
|
42680
|
+
hasDateFilter ? "Try expanding the date range or reset filters." : disabledCollections.length > 0 ? "Auditing is off, and no existing changes match the current filters." : hasFilters ? "Try removing a filter or reset filters." : "No record changes have been logged yet.",
|
|
42681
|
+
hasFilters ? /* @__PURE__ */ jsxs(Button2, { type: "button", variant: "outline", size: "sm", onClick: resetFilters, children: [
|
|
42682
|
+
/* @__PURE__ */ jsx(FunnelX, {}),
|
|
42683
|
+
" Reset filters"
|
|
42684
|
+
] }) : void 0
|
|
42685
|
+
) }) }) : auditLog.entries.map((entry) => {
|
|
42686
|
+
const collectionApiName = auditLogDetailValue(entry, "Collection");
|
|
42687
|
+
return /* @__PURE__ */ jsx(
|
|
42688
|
+
AuditLogEntry,
|
|
42689
|
+
{
|
|
42690
|
+
entry,
|
|
42691
|
+
collectionApiName,
|
|
42692
|
+
collectionLabel: labelForCollection(collectionApiName),
|
|
42693
|
+
activityCollectionLabel: activityLabelForCollection(collectionApiName),
|
|
42694
|
+
density,
|
|
42695
|
+
showCollectionColumn,
|
|
42696
|
+
showActorColumn,
|
|
42697
|
+
showSystemFields,
|
|
42698
|
+
fieldLabels,
|
|
42699
|
+
columnCount,
|
|
42700
|
+
getRecordHref,
|
|
42701
|
+
onRecordClick
|
|
42702
|
+
},
|
|
42703
|
+
entry.id
|
|
42704
|
+
);
|
|
42705
|
+
}) })
|
|
42385
42706
|
] }),
|
|
42386
42707
|
auditLog.hasMore ? /* @__PURE__ */ jsx("div", { className: "flex justify-center border-t p-4", children: /* @__PURE__ */ jsxs(
|
|
42387
42708
|
Button2,
|
|
@@ -42396,8 +42717,7 @@ function AuditLog({
|
|
|
42396
42717
|
"Load more"
|
|
42397
42718
|
]
|
|
42398
42719
|
}
|
|
42399
|
-
) }) : null
|
|
42400
|
-
/* @__PURE__ */ jsx("p", { className: "min-h-7 px-5 py-1 text-right text-[11px] text-muted-foreground", "aria-live": "polite", children: exportMessage })
|
|
42720
|
+
) }) : null
|
|
42401
42721
|
] });
|
|
42402
42722
|
}
|
|
42403
42723
|
function RunDownloadAction({ run }) {
|
|
@@ -8,6 +8,8 @@ export type AuditLogProps = {
|
|
|
8
8
|
collections: readonly string[];
|
|
9
9
|
/** Friendly display names keyed by collection API name. */
|
|
10
10
|
collectionLabels?: Readonly<Record<string, string>>;
|
|
11
|
+
/** Singular activity nouns keyed by collection API name, e.g. "invoice" or "payment". */
|
|
12
|
+
activityNouns?: Readonly<Record<string, string>>;
|
|
11
13
|
/** Controlled filter state. */
|
|
12
14
|
filters?: AuditLogFilterState;
|
|
13
15
|
/** Initial filters when the component manages its own state. */
|
|
@@ -45,5 +47,5 @@ export type AuditLogProps = {
|
|
|
45
47
|
/** Optional classes for the outer container. */
|
|
46
48
|
className?: string;
|
|
47
49
|
};
|
|
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;
|
|
50
|
+
export declare function AuditLog({ collections, collectionLabels, activityNouns, 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;
|
|
49
51
|
//# 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.ts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AAC,EAAE,OAAO,CAAC;IAC3B,mEAAmE;IACnE,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;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;AA4FF,wBAAgB,QAAQ,CAAC,EACvB,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,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,2CAyiBf"}
|
|
@@ -2,7 +2,9 @@ import { AuditLogDensity } from './AuditLog';
|
|
|
2
2
|
import { AuditLogEntry as AuditLogEntryData } from '../../lib/audit-log';
|
|
3
3
|
type AuditLogEntryProps = {
|
|
4
4
|
entry: AuditLogEntryData;
|
|
5
|
+
collectionApiName: string;
|
|
5
6
|
collectionLabel: string;
|
|
7
|
+
activityCollectionLabel?: string;
|
|
6
8
|
density: AuditLogDensity;
|
|
7
9
|
showCollectionColumn: boolean;
|
|
8
10
|
showActorColumn: boolean;
|
|
@@ -12,6 +14,6 @@ type AuditLogEntryProps = {
|
|
|
12
14
|
getRecordHref?: (entry: AuditLogEntryData) => string | undefined;
|
|
13
15
|
onRecordClick?: (entry: AuditLogEntryData) => void;
|
|
14
16
|
};
|
|
15
|
-
export declare function AuditLogEntry({ entry, collectionLabel, density, showCollectionColumn, showActorColumn, showSystemFields, fieldLabels, columnCount, getRecordHref, onRecordClick, }: AuditLogEntryProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function AuditLogEntry({ entry, collectionApiName, collectionLabel, activityCollectionLabel, density, showCollectionColumn, showActorColumn, showSystemFields, fieldLabels, columnCount, getRecordHref, onRecordClick, }: AuditLogEntryProps): import("react/jsx-runtime").JSX.Element;
|
|
16
18
|
export {};
|
|
17
19
|
//# sourceMappingURL=AuditLogEntry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,EAMxC,MAAM,iBAAiB,CAAC;AA4JzB,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,iBAAiB,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,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,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,OAAO,EACP,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,GACd,EAAE,kBAAkB,2CA6HpB"}
|
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-DknloKD2.js";
|
|
2
2
|
export {
|
|
3
3
|
A as AgentChat,
|
|
4
4
|
a as ArtifactCard,
|
package/dist/{highlighted-body-OFNGDK62-Dttr28i2.js → highlighted-body-OFNGDK62-BLfYHDYi.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-DknloKD2.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
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-DknloKD2.js";
|
|
2
|
+
import { u as u2, a as a2, b as b2, c as c2 } from "./use-automation-run-B2iPUXiG.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";
|
|
@@ -75,6 +75,10 @@ export type RecordAuditLogCsvResult = {
|
|
|
75
75
|
count: number;
|
|
76
76
|
truncated: boolean;
|
|
77
77
|
};
|
|
78
|
+
export type AuditLogCsvOptions = {
|
|
79
|
+
collectionLabels?: Readonly<Record<string, string>>;
|
|
80
|
+
activityNouns?: Readonly<Record<string, string>>;
|
|
81
|
+
};
|
|
78
82
|
export declare const normalizeAuditLogPageSize: (value?: number) => number;
|
|
79
83
|
export declare const normalizeAuditLogExportLimit: (value?: number) => number;
|
|
80
84
|
export declare const auditLogActorLabel: (actor: AuditLogActor) => string;
|
|
@@ -84,5 +88,6 @@ export declare function normalizeAuditLogFilterState(collections: readonly strin
|
|
|
84
88
|
/** Build a request scoped to one or more user-defined collections. */
|
|
85
89
|
export declare function buildRecordAuditLogPath(params: ListRecordAuditLogParams): string;
|
|
86
90
|
export declare const auditLogDetailValue: (entry: AuditLogEntry, label: string) => string;
|
|
87
|
-
export declare function
|
|
91
|
+
export declare function auditLogSummaryWithCollectionLabel(entry: AuditLogEntry, collectionLabel: string): AuditLogSummarySegment[];
|
|
92
|
+
export declare function buildAuditLogCsv(entries: AuditLogEntry[], options?: AuditLogCsvOptions): string;
|
|
88
93
|
//# sourceMappingURL=audit-log-core.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-log-core.d.ts","sourceRoot":"","sources":["../../src/lib/audit-log-core.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAC7C,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEhD,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,gBAAgB,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,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;AAED,eAAO,MAAM,mBAAmB,GAAI,OAAO,aAAa,EAAE,OAAO,MAAM,KAAG,MACP,CAAC;AAEpE,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,aAAa,EACpB,eAAe,EAAE,MAAM,GACtB,sBAAsB,EAAE,CAe1B;AAmBD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,OAAO,GAAE,kBAAuB,GAAG,MAAM,CAsBnG"}
|
package/dist/lib/audit-log.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AuditLogListResponse, AuditLogSnapshotResponse, AuditLogStore, ListRecordAuditLogParams, RecordAuditLogCsvResult } 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';
|
|
1
|
+
import { AuditLogCsvOptions, AuditLogListResponse, AuditLogSnapshotResponse, AuditLogStore, ListRecordAuditLogParams, RecordAuditLogCsvResult } from './audit-log-core';
|
|
2
|
+
export { AUDIT_LOG_EXPORT_LIMIT, AUDIT_LOG_MAX_COLLECTIONS, type AuditLogActor, type AuditLogCollectionStatus, type AuditLogCsvOptions, type AuditLogEntry, type AuditLogEvent, type AuditLogField, type AuditLogFilterState, type AuditLogFilters, type AuditLogListResponse, auditLogActorLabel, auditLogDetailValue, auditLogSummaryWithCollectionLabel, 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. */
|
|
6
|
-
export declare function fetchRecordAuditLogCsv(params: Omit<ListRecordAuditLogParams, 'cursor' | 'limit'>, maxRows?: number): Promise<RecordAuditLogCsvResult>;
|
|
6
|
+
export declare function fetchRecordAuditLogCsv(params: Omit<ListRecordAuditLogParams, 'cursor' | 'limit'>, maxRows?: number, options?: AuditLogCsvOptions): Promise<RecordAuditLogCsvResult>;
|
|
7
7
|
//# sourceMappingURL=audit-log.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-log.d.ts","sourceRoot":"","sources":["../../src/lib/audit-log.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"audit-log.d.ts","sourceRoot":"","sources":["../../src/lib/audit-log.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,kBAAkB,EAEvB,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,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,kCAAkC,EAClC,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,EAChC,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,uBAAuB,CAAC,CA2BlC"}
|
package/dist/ui.css
CHANGED
|
@@ -112,13 +112,16 @@
|
|
|
112
112
|
--color-emerald-500: oklch(69.6% .17 162.48);
|
|
113
113
|
--color-emerald-600: oklch(59.6% .145 163.225);
|
|
114
114
|
--color-emerald-800: oklch(43.2% .095 166.913);
|
|
115
|
+
--color-emerald-950: oklch(26.2% .051 172.552);
|
|
115
116
|
--color-sky-500: oklch(68.5% .169 237.323);
|
|
116
117
|
--color-blue-50: oklch(97% .014 254.604);
|
|
117
118
|
--color-blue-200: oklch(88.2% .059 254.128);
|
|
118
119
|
--color-blue-600: oklch(54.6% .245 262.881);
|
|
119
120
|
--color-blue-800: oklch(42.4% .199 265.638);
|
|
121
|
+
--color-rose-50: oklch(96.9% .015 12.422);
|
|
120
122
|
--color-rose-100: oklch(94.1% .03 12.58);
|
|
121
123
|
--color-rose-500: oklch(64.5% .246 16.439);
|
|
124
|
+
--color-rose-950: oklch(27.1% .105 12.094);
|
|
122
125
|
--color-slate-500: oklch(55.4% .046 257.417);
|
|
123
126
|
--color-slate-800: oklch(27.9% .041 260.031);
|
|
124
127
|
--color-black: #000;
|
|
@@ -991,10 +994,6 @@
|
|
|
991
994
|
min-height: calc(var(--spacing) * 0);
|
|
992
995
|
}
|
|
993
996
|
|
|
994
|
-
.min-h-7 {
|
|
995
|
-
min-height: calc(var(--spacing) * 7);
|
|
996
|
-
}
|
|
997
|
-
|
|
998
997
|
.min-h-9 {
|
|
999
998
|
min-height: calc(var(--spacing) * 9);
|
|
1000
999
|
}
|
|
@@ -1087,6 +1086,10 @@
|
|
|
1087
1086
|
width: calc(var(--spacing) * 32);
|
|
1088
1087
|
}
|
|
1089
1088
|
|
|
1089
|
+
.w-36 {
|
|
1090
|
+
width: calc(var(--spacing) * 36);
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1090
1093
|
.w-48 {
|
|
1091
1094
|
width: calc(var(--spacing) * 48);
|
|
1092
1095
|
}
|
|
@@ -1107,6 +1110,10 @@
|
|
|
1107
1110
|
width: 8.5rem;
|
|
1108
1111
|
}
|
|
1109
1112
|
|
|
1113
|
+
.w-\[10rem\] {
|
|
1114
|
+
width: 10rem;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1110
1117
|
.w-\[11rem\] {
|
|
1111
1118
|
width: 11rem;
|
|
1112
1119
|
}
|
|
@@ -1848,7 +1855,17 @@
|
|
|
1848
1855
|
}
|
|
1849
1856
|
}
|
|
1850
1857
|
|
|
1851
|
-
.bg-muted, .bg-muted\/
|
|
1858
|
+
.bg-muted, .bg-muted\/10 {
|
|
1859
|
+
background-color: var(--muted);
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1863
|
+
.bg-muted\/10 {
|
|
1864
|
+
background-color: color-mix(in oklab, var(--muted) 10%, transparent);
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
.bg-muted\/20 {
|
|
1852
1869
|
background-color: var(--muted);
|
|
1853
1870
|
}
|
|
1854
1871
|
|
|
@@ -1906,6 +1923,10 @@
|
|
|
1906
1923
|
background-color: var(--color-red-50);
|
|
1907
1924
|
}
|
|
1908
1925
|
|
|
1926
|
+
.bg-rose-50 {
|
|
1927
|
+
background-color: var(--color-rose-50);
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1909
1930
|
.bg-rose-500 {
|
|
1910
1931
|
background-color: var(--color-rose-500);
|
|
1911
1932
|
}
|
|
@@ -2329,6 +2350,10 @@
|
|
|
2329
2350
|
color: var(--color-emerald-800);
|
|
2330
2351
|
}
|
|
2331
2352
|
|
|
2353
|
+
.text-emerald-950 {
|
|
2354
|
+
color: var(--color-emerald-950);
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2332
2357
|
.text-foreground, .text-foreground\/80 {
|
|
2333
2358
|
color: var(--foreground);
|
|
2334
2359
|
}
|
|
@@ -2423,6 +2448,10 @@
|
|
|
2423
2448
|
color: var(--color-rose-100);
|
|
2424
2449
|
}
|
|
2425
2450
|
|
|
2451
|
+
.text-rose-950 {
|
|
2452
|
+
color: var(--color-rose-950);
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2426
2455
|
.text-secondary-foreground {
|
|
2427
2456
|
color: var(--secondary-foreground);
|
|
2428
2457
|
}
|
|
@@ -3201,6 +3230,16 @@
|
|
|
3201
3230
|
}
|
|
3202
3231
|
}
|
|
3203
3232
|
|
|
3233
|
+
.focus-visible\:ring-ring\/40:focus-visible {
|
|
3234
|
+
--tw-ring-color: var(--ring);
|
|
3235
|
+
}
|
|
3236
|
+
|
|
3237
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
3238
|
+
.focus-visible\:ring-ring\/40:focus-visible {
|
|
3239
|
+
--tw-ring-color: color-mix(in oklab, var(--ring) 40%, transparent);
|
|
3240
|
+
}
|
|
3241
|
+
}
|
|
3242
|
+
|
|
3204
3243
|
.focus-visible\:ring-ring\/50:focus-visible {
|
|
3205
3244
|
--tw-ring-color: var(--ring);
|
|
3206
3245
|
}
|
|
@@ -3211,6 +3250,11 @@
|
|
|
3211
3250
|
}
|
|
3212
3251
|
}
|
|
3213
3252
|
|
|
3253
|
+
.focus-visible\:outline-none:focus-visible {
|
|
3254
|
+
--tw-outline-style: none;
|
|
3255
|
+
outline-style: none;
|
|
3256
|
+
}
|
|
3257
|
+
|
|
3214
3258
|
.active\:scale-95:active {
|
|
3215
3259
|
--tw-scale-x: 95%;
|
|
3216
3260
|
--tw-scale-y: 95%;
|
|
@@ -1004,24 +1004,47 @@ function buildRecordAuditLogPath(params) {
|
|
|
1004
1004
|
if (params.until?.trim()) query.set("until", params.until.trim());
|
|
1005
1005
|
return `/audit-log?${query.toString()}`;
|
|
1006
1006
|
}
|
|
1007
|
-
const summaryText = (entry) => entry.summary.map((segment) => segment.text).join(" ");
|
|
1008
1007
|
const auditLogDetailValue = (entry, label) => entry.details.find((field) => field.label === label)?.value ?? "";
|
|
1008
|
+
function auditLogSummaryWithCollectionLabel(entry, collectionLabel) {
|
|
1009
|
+
const label = collectionLabel.trim();
|
|
1010
|
+
if (!label) return entry.summary;
|
|
1011
|
+
const recordSegment = entry.summary.find((segment) => segment.emphasis === "strong");
|
|
1012
|
+
const suffixSegments = entry.summary.filter(
|
|
1013
|
+
(segment) => segment.emphasis === "none" && /^\(.+\)$/.test(segment.text.trim())
|
|
1014
|
+
);
|
|
1015
|
+
const eventLabel = entry.event[0].toUpperCase() + entry.event.slice(1);
|
|
1016
|
+
return [
|
|
1017
|
+
{ text: `${eventLabel} ${label}`, emphasis: "none" },
|
|
1018
|
+
...recordSegment ? [recordSegment] : [],
|
|
1019
|
+
...suffixSegments
|
|
1020
|
+
];
|
|
1021
|
+
}
|
|
1022
|
+
const collectionLabelFor = (collection, options = {}) => options.collectionLabels?.[collection]?.trim() || collection;
|
|
1023
|
+
const activityLabelFor = (collection, options = {}) => options.activityNouns?.[collection]?.trim() || options.collectionLabels?.[collection]?.trim() || "";
|
|
1024
|
+
const summaryText = (entry, options = {}) => {
|
|
1025
|
+
const collection = auditLogDetailValue(entry, "Collection");
|
|
1026
|
+
const collectionLabel = collection ? activityLabelFor(collection, options) : "";
|
|
1027
|
+
const summary = collectionLabel ? auditLogSummaryWithCollectionLabel(entry, collectionLabel) : entry.summary;
|
|
1028
|
+
return summary.map((segment) => segment.text).join(" ");
|
|
1029
|
+
};
|
|
1009
1030
|
const protectSpreadsheetCell = (value) => /^[\t\r ]*[=+\-@]/.test(value) ? `'${value}` : value;
|
|
1010
1031
|
const csvCell = (value) => `"${protectSpreadsheetCell(value).replaceAll('"', '""')}"`;
|
|
1011
|
-
function buildAuditLogCsv(entries) {
|
|
1012
|
-
const rows = entries.map(
|
|
1013
|
-
(entry)
|
|
1032
|
+
function buildAuditLogCsv(entries, options = {}) {
|
|
1033
|
+
const rows = entries.map((entry) => {
|
|
1034
|
+
const collectionApiName = auditLogDetailValue(entry, "Collection");
|
|
1035
|
+
return [
|
|
1014
1036
|
entry.occurred_at,
|
|
1015
|
-
|
|
1037
|
+
collectionApiName ? collectionLabelFor(collectionApiName, options) : "",
|
|
1038
|
+
collectionApiName,
|
|
1016
1039
|
auditLogActorLabel(entry.actor),
|
|
1017
1040
|
entry.actor.type,
|
|
1018
1041
|
entry.event,
|
|
1019
1042
|
auditLogDetailValue(entry, "Record ID"),
|
|
1020
|
-
summaryText(entry)
|
|
1021
|
-
].map(csvCell).join(",")
|
|
1022
|
-
);
|
|
1043
|
+
summaryText(entry, options)
|
|
1044
|
+
].map(csvCell).join(",");
|
|
1045
|
+
});
|
|
1023
1046
|
return [
|
|
1024
|
-
["time", "
|
|
1047
|
+
["time", "collection_label", "collection_api_name", "actor", "actor_type", "event", "record_id", "summary"].map(csvCell).join(","),
|
|
1025
1048
|
...rows
|
|
1026
1049
|
].join("\n");
|
|
1027
1050
|
}
|
|
@@ -1038,7 +1061,7 @@ async function getRecordAuditLogSnapshot(id, store) {
|
|
|
1038
1061
|
{ method: "GET" }
|
|
1039
1062
|
);
|
|
1040
1063
|
}
|
|
1041
|
-
async function fetchRecordAuditLogCsv(params, maxRows = AUDIT_LOG_EXPORT_LIMIT) {
|
|
1064
|
+
async function fetchRecordAuditLogCsv(params, maxRows = AUDIT_LOG_EXPORT_LIMIT, options = {}) {
|
|
1042
1065
|
const limit = normalizeAuditLogExportLimit(maxRows);
|
|
1043
1066
|
const entries = [];
|
|
1044
1067
|
let cursor = "";
|
|
@@ -1061,7 +1084,7 @@ async function fetchRecordAuditLogCsv(params, maxRows = AUDIT_LOG_EXPORT_LIMIT)
|
|
|
1061
1084
|
}
|
|
1062
1085
|
cursor = nextCursor;
|
|
1063
1086
|
}
|
|
1064
|
-
return { csv: buildAuditLogCsv(entries), count: entries.length, truncated };
|
|
1087
|
+
return { csv: buildAuditLogCsv(entries, options), count: entries.length, truncated };
|
|
1065
1088
|
}
|
|
1066
1089
|
function useAuditLog(collections, filters = {}, options = {}) {
|
|
1067
1090
|
const normalizedCollections = normalizeRecordAuditCollections(collections);
|
|
@@ -1240,12 +1263,13 @@ export {
|
|
|
1240
1263
|
useAgentChatSessions as a,
|
|
1241
1264
|
useAuditLog as b,
|
|
1242
1265
|
useAutomationRun as c,
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1266
|
+
auditLogSummaryWithCollectionLabel as d,
|
|
1267
|
+
auditLogDetailValue as e,
|
|
1268
|
+
auditLogActorLabel as f,
|
|
1246
1269
|
getRecordAuditLogSnapshot as g,
|
|
1247
|
-
|
|
1248
|
-
|
|
1270
|
+
normalizeAuditLogFilterState as h,
|
|
1271
|
+
fetchRecordAuditLogCsv as i,
|
|
1272
|
+
normalizeAuditLogExportLimit as j,
|
|
1249
1273
|
normalizeRecordAuditCollections as n,
|
|
1250
1274
|
useAgentChat as u
|
|
1251
1275
|
};
|
package/package.json
CHANGED