@lumerahq/ui 0.12.0 → 0.13.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -5
- package/dist/{RecordSheet-BuB-d3iw.js → RecordSheet-BwslIDfX.js} +360 -294
- package/dist/{automations-EgDXJ43_.js → automations-D4tZC_G7.js} +162 -1
- package/dist/components/audit-log/AuditLog.d.ts +3 -3
- package/dist/components/audit-log/AuditLog.d.ts.map +1 -1
- package/dist/components/audit-log/AuditLogEntry.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{highlighted-body-OFNGDK62-DkOFnnd1.js → highlighted-body-OFNGDK62-ClrpL6m7.js} +1 -1
- package/dist/hooks/index.js +2 -2
- package/dist/index.js +11 -4
- package/dist/lib/audit-log-core.d.ts +12 -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/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +8 -1
- package/dist/mermaid-GHXKKRXX-B_NhCUBg.js +4 -0
- package/dist/{use-automation-run-B2iPUXiG.js → use-automation-run-BHa7eyZU.js} +1 -142
- package/dist/{use-sql-table-DWHMqSIq.js → use-sql-table-CkRTvZmH.js} +1 -1
- package/package.json +1 -1
- package/dist/mermaid-GHXKKRXX-Dcx-81a_.js +0 -4
|
@@ -1035,6 +1035,155 @@ async function sendEmail(options) {
|
|
|
1035
1035
|
async function pbUpdateRecord(collectionId, recordId, data) {
|
|
1036
1036
|
return pbUpdate(collectionId, recordId, data);
|
|
1037
1037
|
}
|
|
1038
|
+
const AUDIT_LOG_EXPORT_LIMIT = 1e4;
|
|
1039
|
+
const AUDIT_LOG_MAX_COLLECTIONS = 20;
|
|
1040
|
+
const normalizeAuditLogPageSize = (value = 50) => Math.min(200, Math.max(1, Math.trunc(value) || 50));
|
|
1041
|
+
const normalizeAuditLogExportLimit = (value = AUDIT_LOG_EXPORT_LIMIT) => Math.min(AUDIT_LOG_EXPORT_LIMIT, Math.max(1, Math.trunc(value) || AUDIT_LOG_EXPORT_LIMIT));
|
|
1042
|
+
const auditLogActorLabel = (actor) => actor.name?.trim() || actor.email?.trim() || actor.type_label;
|
|
1043
|
+
function normalizeRecordAuditCollections(collections) {
|
|
1044
|
+
const normalized = [];
|
|
1045
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1046
|
+
for (const value of collections) {
|
|
1047
|
+
const collection = value.trim();
|
|
1048
|
+
if (!collection || seen.has(collection)) continue;
|
|
1049
|
+
seen.add(collection);
|
|
1050
|
+
normalized.push(collection);
|
|
1051
|
+
}
|
|
1052
|
+
return normalized;
|
|
1053
|
+
}
|
|
1054
|
+
function normalizeAuditLogFilterState(collections, filters = {}) {
|
|
1055
|
+
const available = normalizeRecordAuditCollections(collections);
|
|
1056
|
+
const allowed = new Set(available);
|
|
1057
|
+
const selected = normalizeRecordAuditCollections(filters.collections ?? available).filter(
|
|
1058
|
+
(name) => allowed.has(name)
|
|
1059
|
+
);
|
|
1060
|
+
return {
|
|
1061
|
+
collections: selected.length > 0 ? selected : available,
|
|
1062
|
+
event: filters.event,
|
|
1063
|
+
actor: filters.actor?.trim() || void 0,
|
|
1064
|
+
since: filters.since?.trim() || void 0,
|
|
1065
|
+
until: filters.until?.trim() || void 0
|
|
1066
|
+
};
|
|
1067
|
+
}
|
|
1068
|
+
function buildRecordAuditLogPath(params) {
|
|
1069
|
+
const collections = normalizeRecordAuditCollections(params.collections);
|
|
1070
|
+
if (collections.length === 0) {
|
|
1071
|
+
throw new Error("At least one collection is required");
|
|
1072
|
+
}
|
|
1073
|
+
if (collections.length > AUDIT_LOG_MAX_COLLECTIONS) {
|
|
1074
|
+
throw new Error(`At most ${AUDIT_LOG_MAX_COLLECTIONS} collections can be requested`);
|
|
1075
|
+
}
|
|
1076
|
+
const query = new URLSearchParams({
|
|
1077
|
+
domain: "record",
|
|
1078
|
+
limit: String(normalizeAuditLogPageSize(params.limit))
|
|
1079
|
+
});
|
|
1080
|
+
for (const collection of collections) query.append("collection", collection);
|
|
1081
|
+
if (params.cursor?.trim()) query.set("cursor", params.cursor.trim());
|
|
1082
|
+
if (params.event) query.set("event", params.event);
|
|
1083
|
+
if (params.actor?.trim()) query.set("actor", params.actor.trim());
|
|
1084
|
+
if (params.since?.trim()) query.set("since", params.since.trim());
|
|
1085
|
+
if (params.until?.trim()) query.set("until", params.until.trim());
|
|
1086
|
+
return `/audit-log?${query.toString()}`;
|
|
1087
|
+
}
|
|
1088
|
+
const auditLogDetailValue = (entry, label) => entry.details.find((field) => field.label === label)?.value ?? "";
|
|
1089
|
+
const auditLogRequestedCollectionName = (collection, statuses) => statuses.find((status) => status.name === collection)?.requested_name || collection;
|
|
1090
|
+
function auditLogSummaryWithCollectionLabel(entry, collectionLabel) {
|
|
1091
|
+
const label = collectionLabel.trim();
|
|
1092
|
+
if (!label) return entry.summary;
|
|
1093
|
+
const recordSegment = entry.summary.find((segment) => segment.emphasis === "strong");
|
|
1094
|
+
const suffixSegments = entry.summary.filter(
|
|
1095
|
+
(segment) => segment.emphasis === "none" && /^\(.+\)$/.test(segment.text.trim())
|
|
1096
|
+
);
|
|
1097
|
+
const eventLabel = entry.event[0].toUpperCase() + entry.event.slice(1);
|
|
1098
|
+
return [
|
|
1099
|
+
{ text: `${eventLabel} ${label}`, emphasis: "none" },
|
|
1100
|
+
...recordSegment ? [recordSegment] : [],
|
|
1101
|
+
...suffixSegments
|
|
1102
|
+
];
|
|
1103
|
+
}
|
|
1104
|
+
const collectionLabelFor = (collection, options = {}) => options.collectionLabels?.[collection]?.trim() || collection;
|
|
1105
|
+
const activityLabelFor = (collection, options = {}) => options.activityNouns?.[collection]?.trim() || options.collectionLabels?.[collection]?.trim() || "";
|
|
1106
|
+
const summaryText = (entry, options = {}) => {
|
|
1107
|
+
const collection = entry.collection;
|
|
1108
|
+
const collectionLabel = collection ? activityLabelFor(collection, options) : "";
|
|
1109
|
+
const summary = collectionLabel ? auditLogSummaryWithCollectionLabel(entry, collectionLabel) : entry.summary;
|
|
1110
|
+
return summary.map((segment) => segment.text).join(" ");
|
|
1111
|
+
};
|
|
1112
|
+
const protectSpreadsheetCell = (value) => /^[\t\r ]*[=+\-@]/.test(value) ? `'${value}` : value;
|
|
1113
|
+
const csvCell = (value) => `"${protectSpreadsheetCell(value).replaceAll('"', '""')}"`;
|
|
1114
|
+
function buildAuditLogCsv(entries, options = {}) {
|
|
1115
|
+
const rows = entries.map((entry) => {
|
|
1116
|
+
const collectionApiName = entry.collection;
|
|
1117
|
+
return [
|
|
1118
|
+
entry.occurred_at,
|
|
1119
|
+
collectionApiName ? collectionLabelFor(collectionApiName, options) : "",
|
|
1120
|
+
collectionApiName,
|
|
1121
|
+
auditLogActorLabel(entry.actor),
|
|
1122
|
+
entry.actor.type,
|
|
1123
|
+
entry.event,
|
|
1124
|
+
entry.record_id,
|
|
1125
|
+
summaryText(entry, options)
|
|
1126
|
+
].map(csvCell).join(",");
|
|
1127
|
+
});
|
|
1128
|
+
return [
|
|
1129
|
+
["time", "collection_label", "collection_api_name", "actor", "actor_type", "event", "record_id", "summary"].map(csvCell).join(","),
|
|
1130
|
+
...rows
|
|
1131
|
+
].join("\n");
|
|
1132
|
+
}
|
|
1133
|
+
async function listRecordAuditLog(params) {
|
|
1134
|
+
return requestApi(buildRecordAuditLogPath(params), { method: "GET" });
|
|
1135
|
+
}
|
|
1136
|
+
async function getRecordAuditLogSnapshot(id, store) {
|
|
1137
|
+
const normalizedID = id.trim();
|
|
1138
|
+
if (!normalizedID) {
|
|
1139
|
+
throw new Error("Audit log ID is required");
|
|
1140
|
+
}
|
|
1141
|
+
return requestApi(
|
|
1142
|
+
`/audit-log/${encodeURIComponent(normalizedID)}/snapshot?store=${encodeURIComponent(store)}`,
|
|
1143
|
+
{ method: "GET" }
|
|
1144
|
+
);
|
|
1145
|
+
}
|
|
1146
|
+
async function fetchRecordAuditLogCsv(params, maxRows = AUDIT_LOG_EXPORT_LIMIT, options = {}) {
|
|
1147
|
+
const limit = normalizeAuditLogExportLimit(maxRows);
|
|
1148
|
+
const entries = [];
|
|
1149
|
+
let cursor = "";
|
|
1150
|
+
let truncated = false;
|
|
1151
|
+
const requestedNames = /* @__PURE__ */ new Map();
|
|
1152
|
+
while (entries.length < limit) {
|
|
1153
|
+
const page = await listRecordAuditLog({
|
|
1154
|
+
...params,
|
|
1155
|
+
cursor: cursor || void 0,
|
|
1156
|
+
limit: Math.min(200, limit - entries.length)
|
|
1157
|
+
});
|
|
1158
|
+
entries.push(...page.audit_logs.slice(0, limit - entries.length));
|
|
1159
|
+
for (const status of page.record_collections ?? []) {
|
|
1160
|
+
requestedNames.set(status.name, status.requested_name);
|
|
1161
|
+
}
|
|
1162
|
+
if (!page.pagination.has_more) break;
|
|
1163
|
+
const nextCursor = page.pagination.next_cursor?.trim();
|
|
1164
|
+
if (!nextCursor || nextCursor === cursor) {
|
|
1165
|
+
throw new Error("Audit log export could not continue");
|
|
1166
|
+
}
|
|
1167
|
+
if (entries.length >= limit) {
|
|
1168
|
+
truncated = true;
|
|
1169
|
+
break;
|
|
1170
|
+
}
|
|
1171
|
+
cursor = nextCursor;
|
|
1172
|
+
}
|
|
1173
|
+
const withRequestedNameAliases = (values) => {
|
|
1174
|
+
if (!values) return void 0;
|
|
1175
|
+
const merged = { ...values };
|
|
1176
|
+
for (const [apiName, requestedName] of requestedNames) {
|
|
1177
|
+
if (!merged[apiName] && merged[requestedName]) merged[apiName] = merged[requestedName];
|
|
1178
|
+
}
|
|
1179
|
+
return merged;
|
|
1180
|
+
};
|
|
1181
|
+
const resolvedOptions = {
|
|
1182
|
+
collectionLabels: withRequestedNameAliases(options.collectionLabels),
|
|
1183
|
+
activityNouns: withRequestedNameAliases(options.activityNouns)
|
|
1184
|
+
};
|
|
1185
|
+
return { csv: buildAuditLogCsv(entries, resolvedOptions), count: entries.length, truncated };
|
|
1186
|
+
}
|
|
1038
1187
|
const API_PREFIX = "/api";
|
|
1039
1188
|
const TERMINAL_STATUSES = ["succeeded", "failed", "cancelled"];
|
|
1040
1189
|
const ACTIVE_STATUSES = ["preparing", "queued", "running", "cancelling"];
|
|
@@ -1264,6 +1413,7 @@ async function listRunsByExternalId(params) {
|
|
|
1264
1413
|
});
|
|
1265
1414
|
}
|
|
1266
1415
|
export {
|
|
1416
|
+
fetchRecordAuditLogCsv as $,
|
|
1267
1417
|
cancelAutomationRun as A,
|
|
1268
1418
|
BridgeError as B,
|
|
1269
1419
|
cancelRun as C,
|
|
@@ -1287,8 +1437,19 @@ export {
|
|
|
1287
1437
|
listRunsByExternalId as U,
|
|
1288
1438
|
pollAutomationRun as V,
|
|
1289
1439
|
pollRun as W,
|
|
1290
|
-
|
|
1440
|
+
AUDIT_LOG_EXPORT_LIMIT as X,
|
|
1441
|
+
AUDIT_LOG_MAX_COLLECTIONS as Y,
|
|
1442
|
+
auditLogActorLabel as Z,
|
|
1443
|
+
auditLogRequestedCollectionName as _,
|
|
1291
1444
|
getShareableAppUrl as a,
|
|
1445
|
+
getRecordAuditLogSnapshot as a0,
|
|
1446
|
+
listRecordAuditLog as a1,
|
|
1447
|
+
normalizeRecordAuditCollections as a2,
|
|
1448
|
+
normalizeAuditLogPageSize as a3,
|
|
1449
|
+
auditLogSummaryWithCollectionLabel as a4,
|
|
1450
|
+
auditLogDetailValue as a5,
|
|
1451
|
+
normalizeAuditLogFilterState as a6,
|
|
1452
|
+
normalizeAuditLogExportLimit as a7,
|
|
1292
1453
|
buildShareableAppUrl as b,
|
|
1293
1454
|
configureBridge as c,
|
|
1294
1455
|
parentApiStream as d,
|
|
@@ -4,11 +4,11 @@ export type AuditLogDensity = 'compact' | 'comfortable';
|
|
|
4
4
|
export type AuditLogFilterState = AuditLogFilterStateData;
|
|
5
5
|
export type AuditLogRecord = AuditLogEntryData;
|
|
6
6
|
export type AuditLogProps = {
|
|
7
|
-
/**
|
|
7
|
+
/** Project-local bare collection names (or physical API names outside a project), maximum 20. */
|
|
8
8
|
collections: readonly string[];
|
|
9
|
-
/** Friendly display names keyed by
|
|
9
|
+
/** Friendly display names keyed by the same bare or physical names used in collections. */
|
|
10
10
|
collectionLabels?: Readonly<Record<string, string>>;
|
|
11
|
-
/** Singular activity nouns keyed by
|
|
11
|
+
/** Singular activity nouns keyed by the same names used in collections, e.g. "invoice" or "payment". */
|
|
12
12
|
activityNouns?: Readonly<Record<string, string>>;
|
|
13
13
|
/** Controlled filter state. */
|
|
14
14
|
filters?: AuditLogFilterState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuditLog.d.ts","sourceRoot":"","sources":["../../../src/components/audit-log/AuditLog.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"AuditLog.d.ts","sourceRoot":"","sources":["../../../src/components/audit-log/AuditLog.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,SAAS,EAA+C,MAAM,OAAO,CAAC;AAmBpF,OAAO,EAGL,KAAK,aAAa,IAAI,iBAAiB,EAEvC,KAAK,mBAAmB,IAAI,uBAAuB,EAOpD,MAAM,iBAAiB,CAAC;AAGzB,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,aAAa,CAAC;AACxD,MAAM,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAC1D,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAE/C,MAAM,MAAM,aAAa,GAAG;IAC1B,iGAAiG;IACjG,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,2FAA2F;IAC3F,gBAAgB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACpD,wGAAwG;IACxG,aAAa,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACjD,+BAA+B;IAC/B,OAAO,CAAC,EAAE,mBA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,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,2CA+lBf"}
|
|
@@ -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,EAMxC,MAAM,iBAAiB,CAAC;AA6KzB,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,
|
|
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;AA6KzB,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,2CA8HpB"}
|
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-BwslIDfX.js";
|
|
2
2
|
export {
|
|
3
3
|
A as AgentChat,
|
|
4
4
|
a as ArtifactCard,
|
package/dist/{highlighted-body-OFNGDK62-DkOFnnd1.js → highlighted-body-OFNGDK62-ClrpL6m7.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-BwslIDfX.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,5 +1,5 @@
|
|
|
1
|
-
import { u, a, b, c } from "../use-automation-run-
|
|
2
|
-
import { u as u2, a as a2, b as b2, c as c2, d, e } from "../use-sql-table-
|
|
1
|
+
import { u, a, b, c } from "../use-automation-run-BHa7eyZU.js";
|
|
2
|
+
import { u as u2, a as a2, b as b2, c as c2, d, e } from "../use-sql-table-CkRTvZmH.js";
|
|
3
3
|
export {
|
|
4
4
|
u as useAgentChat,
|
|
5
5
|
a as useAgentChatSessions,
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
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-
|
|
3
|
-
import { u as u3, a as a3, b as b3, c as c3, d as d2, e as e2 } from "./use-sql-table-
|
|
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-
|
|
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-BwslIDfX.js";
|
|
2
|
+
import { u as u2, a as a2, b as b2, c as c2 } from "./use-automation-run-BHa7eyZU.js";
|
|
3
|
+
import { u as u3, a as a3, b as b3, c as c3, d as d2, e as e2 } from "./use-sql-table-CkRTvZmH.js";
|
|
4
|
+
import { X, Y, B, E, Z, _, 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, a0, M, O, N, a as a4, h as h2, P, i as i2, Q, R as R2, a1, 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-D4tZC_G7.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";
|
|
6
6
|
import { q as q3 } from "./query-client-DdOWay4_.js";
|
|
7
7
|
export {
|
|
8
|
+
X as AUDIT_LOG_EXPORT_LIMIT,
|
|
9
|
+
Y as AUDIT_LOG_MAX_COLLECTIONS,
|
|
8
10
|
A as AgentChat,
|
|
9
11
|
a as ArtifactCard,
|
|
10
12
|
e as AssistantChat,
|
|
@@ -21,6 +23,8 @@ export {
|
|
|
21
23
|
R as RecordSheet,
|
|
22
24
|
T as ToolCallCard,
|
|
23
25
|
b as ToolRenderersProvider,
|
|
26
|
+
Z as auditLogActorLabel,
|
|
27
|
+
_ as auditLogRequestedCollectionName,
|
|
24
28
|
z as automationStatuses,
|
|
25
29
|
b4 as buildShareableAppUrl,
|
|
26
30
|
A2 as cancelAutomationRun,
|
|
@@ -34,6 +38,7 @@ export {
|
|
|
34
38
|
d as defaultToolRenderers,
|
|
35
39
|
H as ensureAutomationRun,
|
|
36
40
|
I as ensureRun,
|
|
41
|
+
$ as fetchRecordAuditLogCsv,
|
|
37
42
|
f as findRenderer,
|
|
38
43
|
f3 as formatBoolean,
|
|
39
44
|
a5 as formatCellValue,
|
|
@@ -55,6 +60,7 @@ export {
|
|
|
55
60
|
L as getAutomationRunFileDownloadUrl,
|
|
56
61
|
g as getCollectionMap,
|
|
57
62
|
f2 as getDownloadUrl,
|
|
63
|
+
a0 as getRecordAuditLogSnapshot,
|
|
58
64
|
M as getRun,
|
|
59
65
|
O as getRunFileUrl,
|
|
60
66
|
N as getRunFiles,
|
|
@@ -67,6 +73,7 @@ export {
|
|
|
67
73
|
l as isMutatingToolCall,
|
|
68
74
|
Q as isTerminalStatus,
|
|
69
75
|
R2 as listAutomationRunFiles,
|
|
76
|
+
a1 as listRecordAuditLog,
|
|
70
77
|
S as listRuns,
|
|
71
78
|
T2 as listRunsByAgent,
|
|
72
79
|
U as listRunsByExternalId,
|
|
@@ -36,6 +36,13 @@ export type AuditLogEntry = {
|
|
|
36
36
|
actor: AuditLogActor;
|
|
37
37
|
summary: AuditLogSummarySegment[];
|
|
38
38
|
details: AuditLogField[];
|
|
39
|
+
/** Physical collection API name, suitable for API-level diagnostics. */
|
|
40
|
+
collection: string;
|
|
41
|
+
collection_id: string;
|
|
42
|
+
record_id: string;
|
|
43
|
+
record_label: string;
|
|
44
|
+
/** Raw field API names changed by an update; empty for create/delete events. */
|
|
45
|
+
changed_fields: string[];
|
|
39
46
|
has_snapshot: boolean;
|
|
40
47
|
store: AuditLogStore;
|
|
41
48
|
};
|
|
@@ -45,7 +52,10 @@ export type AuditLogPagination = {
|
|
|
45
52
|
next_cursor?: string;
|
|
46
53
|
};
|
|
47
54
|
export type AuditLogCollectionStatus = {
|
|
55
|
+
/** Physical collection API name. */
|
|
48
56
|
name: string;
|
|
57
|
+
/** Collection selector supplied by the caller, usually the project-local bare name. */
|
|
58
|
+
requested_name: string;
|
|
49
59
|
audit_enabled: boolean;
|
|
50
60
|
};
|
|
51
61
|
export type AuditLogListResponse = {
|
|
@@ -89,6 +99,8 @@ export declare function normalizeAuditLogFilterState(collections: readonly strin
|
|
|
89
99
|
/** Build a request scoped to one or more user-defined collections. */
|
|
90
100
|
export declare function buildRecordAuditLogPath(params: ListRecordAuditLogParams): string;
|
|
91
101
|
export declare const auditLogDetailValue: (entry: AuditLogEntry, label: string) => string;
|
|
102
|
+
/** Resolve a physical API name back to the collection selector supplied by the caller. */
|
|
103
|
+
export declare const auditLogRequestedCollectionName: (collection: string, statuses: readonly AuditLogCollectionStatus[]) => string;
|
|
92
104
|
export declare function auditLogSummaryWithCollectionLabel(entry: AuditLogEntry, collectionLabel: string): AuditLogSummarySegment[];
|
|
93
105
|
export declare function buildAuditLogCsv(entries: AuditLogEntry[], options?: AuditLogCsvOptions): string;
|
|
94
106
|
//# 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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,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,0FAA0F;AAC1F,eAAO,MAAM,+BAA+B,GAC1C,YAAY,MAAM,EAClB,UAAU,SAAS,wBAAwB,EAAE,KAC5C,MAA6F,CAAC;AAEjG,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,5 +1,5 @@
|
|
|
1
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';
|
|
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, type AuditLogPagination, type AuditLogSnapshot, type AuditLogSnapshotResponse, type AuditLogStore, auditLogActorLabel, auditLogDetailValue, auditLogRequestedCollectionName, auditLogSummaryWithCollectionLabel, type ListRecordAuditLogParams, normalizeAuditLogExportLimit, normalizeAuditLogFilterState, normalizeAuditLogPageSize, normalizeRecordAuditCollections, type RecordAuditLogCsvResult, } 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,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,
|
|
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,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,+BAA+B,EAC/B,kCAAkC,EAClC,KAAK,wBAAwB,EAC7B,4BAA4B,EAC5B,4BAA4B,EAC5B,yBAAyB,EACzB,+BAA+B,EAC/B,KAAK,uBAAuB,GAC7B,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,CA2ClC"}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
export { BridgeError, type BridgeRequest, type BridgeResponse, type BridgeRuntimeConfig, type BridgeStream, type BridgeStreamHandlers, type BridgeStreamOpen, type BridgeStreamResponse, buildShareableAppUrl, configureBridge, EXPECTED_PARENT_ORIGIN, getAppProjectExternalId, getShareableAppUrl, type HostPayload, isEmbedded, onInitMessage, parentApiRequest, parentApiStream, postReadyMessage, type ShareableAppRouter, type ShareableAppUrlOptions, serializeBridgeRuntimeConfig, } from './bridge';
|
|
7
7
|
export { type EmailSendRequest, type EmailSendResult, type FileDescriptor, getDownloadUrl, getUploadUrl, type PbBulkResult, type PbListOptions, type PbListResponse, type PbRecord, type PbSearchMetadata, type PbSearchOptions, type PbSearchResult, type PbSqlRequest, type PbSqlResponse, pbBulkDelete, pbBulkUpdate, pbCreate, pbDelete, pbGet, pbList, pbSearch, pbSql, pbUpdate, pbUpdateRecord, pbUpsert, sendEmail, type UploadOptions, type UploadUrlResponse, uploadFile, } from './api';
|
|
8
8
|
export { type Automation, type AutomationRun, type AutomationRunFile, type AutomationStatus, automationStatuses, type CreateRunOptions, cancelAutomationRun, cancelRun, clearAutomationCache, createAutomationRun, createRun, ensureAutomationRun, ensureRun, getAutomationByExternalId, getAutomationRun, getAutomationRunFileDownloadUrl, getRun, getRunFiles, getRunFileUrl, isActiveStatus, isTerminalStatus, type LegacyCreateRunOptions, type ListRunsOptions, listAutomationRunFiles, listRuns, listRunsByAgent, listRunsByExternalId, type PollOptions, pollAutomationRun, pollRun, } from './automations';
|
|
9
|
+
export { AUDIT_LOG_EXPORT_LIMIT, AUDIT_LOG_MAX_COLLECTIONS, type AuditLogActor, type AuditLogCollectionStatus, type AuditLogCsvOptions, type AuditLogEntry, type AuditLogEvent, type AuditLogField, type AuditLogFilters, type AuditLogListResponse, type AuditLogPagination, type AuditLogSnapshot, type AuditLogSnapshotResponse, type AuditLogStore, auditLogActorLabel, auditLogRequestedCollectionName, fetchRecordAuditLogCsv, getRecordAuditLogSnapshot, type ListRecordAuditLogParams, listRecordAuditLog, type RecordAuditLogCsvResult, } from './audit-log';
|
|
9
10
|
export { type ColumnType, type FileDescriptor as FormatterFileDescriptor, type FormatOptions, formatBoolean, formatCellValue, formatCurrency, formatDate, formatDateTime, formatEditor, formatFile, formatFileSize, formatJson, formatNumber, formatPercent, formatRelation, formatSelect, formatText, stripHtml, } from './formatters';
|
|
10
11
|
export { queryClient } from './query-client';
|
|
11
12
|
export { cn } from './utils';
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAEL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,oBAAoB,EAEpB,eAAe,EAEf,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAElB,KAAK,WAAW,EAChB,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,4BAA4B,GAC7B,MAAM,UAAU,CAAC;AAMlB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,cAAc,EAEd,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,cAAc,EAEnB,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,YAAY,EAEZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EAER,KAAK,EACL,MAAM,EACN,QAAQ,EAER,KAAK,EACL,QAAQ,EAER,cAAc,EACd,QAAQ,EAER,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,UAAU,GACX,MAAM,OAAO,CAAC;AAMf,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,mBAAmB,EACnB,SAAS,EAET,oBAAoB,EAEpB,mBAAmB,EAEnB,SAAS,EACT,mBAAmB,EACnB,SAAS,EAET,yBAAyB,EACzB,gBAAgB,EAChB,+BAA+B,EAC/B,MAAM,EAEN,WAAW,EACX,aAAa,EACb,cAAc,EAEd,gBAAgB,EAChB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,sBAAsB,EACtB,QAAQ,EACR,eAAe,EACf,oBAAoB,EACpB,KAAK,WAAW,EAChB,iBAAiB,EACjB,OAAO,GACR,MAAM,eAAe,CAAC;AAMvB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,cAAc,IAAI,uBAAuB,EAC9C,KAAK,aAAa,EAClB,aAAa,EACb,eAAe,EACf,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,cAAc,EACd,UAAU,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACd,YAAY,EACZ,UAAU,EACV,SAAS,GACV,MAAM,cAAc,CAAC;AAMtB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAM7C,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAEL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,oBAAoB,EAEpB,eAAe,EAEf,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAElB,KAAK,WAAW,EAChB,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,4BAA4B,GAC7B,MAAM,UAAU,CAAC;AAMlB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,cAAc,EAEd,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,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AMrB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,cAAc,IAAI,uBAAuB,EAC9C,KAAK,aAAa,EAClB,aAAa,EACb,eAAe,EACf,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,cAAc,EACd,UAAU,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACd,YAAY,EACZ,UAAU,EACV,SAAS,GACV,MAAM,cAAc,CAAC;AAMtB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAM7C,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/lib/index.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { B, E, z, b, A, C, D, c, F, G, H, I, g, J, K, L, f, M, O, N, a, h, P, i, Q, R, S, T, U, o, p, d, j, k, l, m, n, q, r, t, u, v, w, V, W, e, x, s, y } from "../automations-
|
|
1
|
+
import { X, Y, B, E, Z, _, z, b, A, C, D, c, F, G, H, I, $, g, J, K, L, f, a0, M, O, N, a, h, P, i, Q, R, a1, S, T, U, o, p, d, j, k, l, m, n, q, r, t, u, v, w, V, W, e, x, s, y } from "../automations-D4tZC_G7.js";
|
|
2
2
|
import { o as o2, f as f2, a as a2, b as b2, c as c2, d as d2, e as e2, g as g2, h as h2, i as i2, j as j2, k as k2, l as l2, m as m2, n as n2, s as s2 } from "../formatters-D4T821Dv.js";
|
|
3
3
|
import { q as q2 } from "../query-client-DdOWay4_.js";
|
|
4
4
|
export {
|
|
5
|
+
X as AUDIT_LOG_EXPORT_LIMIT,
|
|
6
|
+
Y as AUDIT_LOG_MAX_COLLECTIONS,
|
|
5
7
|
B as BridgeError,
|
|
6
8
|
E as EXPECTED_PARENT_ORIGIN,
|
|
9
|
+
Z as auditLogActorLabel,
|
|
10
|
+
_ as auditLogRequestedCollectionName,
|
|
7
11
|
z as automationStatuses,
|
|
8
12
|
b as buildShareableAppUrl,
|
|
9
13
|
A as cancelAutomationRun,
|
|
@@ -15,6 +19,7 @@ export {
|
|
|
15
19
|
G as createRun,
|
|
16
20
|
H as ensureAutomationRun,
|
|
17
21
|
I as ensureRun,
|
|
22
|
+
$ as fetchRecordAuditLogCsv,
|
|
18
23
|
f2 as formatBoolean,
|
|
19
24
|
a2 as formatCellValue,
|
|
20
25
|
b2 as formatCurrency,
|
|
@@ -34,6 +39,7 @@ export {
|
|
|
34
39
|
K as getAutomationRun,
|
|
35
40
|
L as getAutomationRunFileDownloadUrl,
|
|
36
41
|
f as getDownloadUrl,
|
|
42
|
+
a0 as getRecordAuditLogSnapshot,
|
|
37
43
|
M as getRun,
|
|
38
44
|
O as getRunFileUrl,
|
|
39
45
|
N as getRunFiles,
|
|
@@ -43,6 +49,7 @@ export {
|
|
|
43
49
|
i as isEmbedded,
|
|
44
50
|
Q as isTerminalStatus,
|
|
45
51
|
R as listAutomationRunFiles,
|
|
52
|
+
a1 as listRecordAuditLog,
|
|
46
53
|
S as listRuns,
|
|
47
54
|
T as listRunsByAgent,
|
|
48
55
|
U as listRunsByExternalId,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useState, useRef, useCallback, useMemo } from "react";
|
|
2
2
|
import { useInfiniteQuery, useQueryClient, useMutation, useQuery } from "@tanstack/react-query";
|
|
3
|
-
import {
|
|
3
|
+
import { a2 as normalizeRecordAuditCollections, a3 as normalizeAuditLogPageSize, a1 as listRecordAuditLog, H as ensureAutomationRun, F as createAutomationRun, A as cancelAutomationRun, z as automationStatuses, K as getAutomationRun } from "./automations-D4tZC_G7.js";
|
|
4
4
|
const QUEUED_DISCOVERY_POLL_MS = 2e3;
|
|
5
5
|
const IDLE_DISCOVERY_POLL_MS = 1e4;
|
|
6
6
|
const HIDDEN_DISCOVERY_POLL_MS = 3e4;
|
|
@@ -954,138 +954,6 @@ function replaceSession(sessions, next) {
|
|
|
954
954
|
});
|
|
955
955
|
return found ? updated : [next, ...updated];
|
|
956
956
|
}
|
|
957
|
-
const AUDIT_LOG_EXPORT_LIMIT = 1e4;
|
|
958
|
-
const AUDIT_LOG_MAX_COLLECTIONS = 20;
|
|
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));
|
|
961
|
-
const auditLogActorLabel = (actor) => actor.name?.trim() || actor.email?.trim() || actor.type_label;
|
|
962
|
-
function normalizeRecordAuditCollections(collections) {
|
|
963
|
-
const normalized = [];
|
|
964
|
-
const seen = /* @__PURE__ */ new Set();
|
|
965
|
-
for (const value of collections) {
|
|
966
|
-
const collection = value.trim();
|
|
967
|
-
if (!collection || seen.has(collection)) continue;
|
|
968
|
-
seen.add(collection);
|
|
969
|
-
normalized.push(collection);
|
|
970
|
-
}
|
|
971
|
-
return normalized;
|
|
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
|
-
}
|
|
987
|
-
function buildRecordAuditLogPath(params) {
|
|
988
|
-
const collections = normalizeRecordAuditCollections(params.collections);
|
|
989
|
-
if (collections.length === 0) {
|
|
990
|
-
throw new Error("At least one collection is required");
|
|
991
|
-
}
|
|
992
|
-
if (collections.length > AUDIT_LOG_MAX_COLLECTIONS) {
|
|
993
|
-
throw new Error(`At most ${AUDIT_LOG_MAX_COLLECTIONS} collections can be requested`);
|
|
994
|
-
}
|
|
995
|
-
const query = new URLSearchParams({
|
|
996
|
-
domain: "record",
|
|
997
|
-
limit: String(normalizeAuditLogPageSize(params.limit))
|
|
998
|
-
});
|
|
999
|
-
for (const collection of collections) query.append("collection", collection);
|
|
1000
|
-
if (params.cursor?.trim()) query.set("cursor", params.cursor.trim());
|
|
1001
|
-
if (params.event) query.set("event", params.event);
|
|
1002
|
-
if (params.actor?.trim()) query.set("actor", params.actor.trim());
|
|
1003
|
-
if (params.since?.trim()) query.set("since", params.since.trim());
|
|
1004
|
-
if (params.until?.trim()) query.set("until", params.until.trim());
|
|
1005
|
-
return `/audit-log?${query.toString()}`;
|
|
1006
|
-
}
|
|
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
|
-
};
|
|
1030
|
-
const protectSpreadsheetCell = (value) => /^[\t\r ]*[=+\-@]/.test(value) ? `'${value}` : value;
|
|
1031
|
-
const csvCell = (value) => `"${protectSpreadsheetCell(value).replaceAll('"', '""')}"`;
|
|
1032
|
-
function buildAuditLogCsv(entries, options = {}) {
|
|
1033
|
-
const rows = entries.map((entry) => {
|
|
1034
|
-
const collectionApiName = auditLogDetailValue(entry, "Collection");
|
|
1035
|
-
return [
|
|
1036
|
-
entry.occurred_at,
|
|
1037
|
-
collectionApiName ? collectionLabelFor(collectionApiName, options) : "",
|
|
1038
|
-
collectionApiName,
|
|
1039
|
-
auditLogActorLabel(entry.actor),
|
|
1040
|
-
entry.actor.type,
|
|
1041
|
-
entry.event,
|
|
1042
|
-
auditLogDetailValue(entry, "Record ID"),
|
|
1043
|
-
summaryText(entry, options)
|
|
1044
|
-
].map(csvCell).join(",");
|
|
1045
|
-
});
|
|
1046
|
-
return [
|
|
1047
|
-
["time", "collection_label", "collection_api_name", "actor", "actor_type", "event", "record_id", "summary"].map(csvCell).join(","),
|
|
1048
|
-
...rows
|
|
1049
|
-
].join("\n");
|
|
1050
|
-
}
|
|
1051
|
-
async function listRecordAuditLog(params) {
|
|
1052
|
-
return requestApi(buildRecordAuditLogPath(params), { method: "GET" });
|
|
1053
|
-
}
|
|
1054
|
-
async function getRecordAuditLogSnapshot(id, store) {
|
|
1055
|
-
const normalizedID = id.trim();
|
|
1056
|
-
if (!normalizedID) {
|
|
1057
|
-
throw new Error("Audit log ID is required");
|
|
1058
|
-
}
|
|
1059
|
-
return requestApi(
|
|
1060
|
-
`/audit-log/${encodeURIComponent(normalizedID)}/snapshot?store=${encodeURIComponent(store)}`,
|
|
1061
|
-
{ method: "GET" }
|
|
1062
|
-
);
|
|
1063
|
-
}
|
|
1064
|
-
async function fetchRecordAuditLogCsv(params, maxRows = AUDIT_LOG_EXPORT_LIMIT, options = {}) {
|
|
1065
|
-
const limit = normalizeAuditLogExportLimit(maxRows);
|
|
1066
|
-
const entries = [];
|
|
1067
|
-
let cursor = "";
|
|
1068
|
-
let truncated = false;
|
|
1069
|
-
while (entries.length < limit) {
|
|
1070
|
-
const page = await listRecordAuditLog({
|
|
1071
|
-
...params,
|
|
1072
|
-
cursor: cursor || void 0,
|
|
1073
|
-
limit: Math.min(200, limit - entries.length)
|
|
1074
|
-
});
|
|
1075
|
-
entries.push(...page.audit_logs.slice(0, limit - entries.length));
|
|
1076
|
-
if (!page.pagination.has_more) break;
|
|
1077
|
-
const nextCursor = page.pagination.next_cursor?.trim();
|
|
1078
|
-
if (!nextCursor || nextCursor === cursor) {
|
|
1079
|
-
throw new Error("Audit log export could not continue");
|
|
1080
|
-
}
|
|
1081
|
-
if (entries.length >= limit) {
|
|
1082
|
-
truncated = true;
|
|
1083
|
-
break;
|
|
1084
|
-
}
|
|
1085
|
-
cursor = nextCursor;
|
|
1086
|
-
}
|
|
1087
|
-
return { csv: buildAuditLogCsv(entries, options), count: entries.length, truncated };
|
|
1088
|
-
}
|
|
1089
957
|
function useAuditLog(collections, filters = {}, options = {}) {
|
|
1090
958
|
const normalizedCollections = normalizeRecordAuditCollections(collections);
|
|
1091
959
|
const pageSize = normalizeAuditLogPageSize(options.pageSize);
|
|
@@ -1259,17 +1127,8 @@ function useAutomationRun(options) {
|
|
|
1259
1127
|
};
|
|
1260
1128
|
}
|
|
1261
1129
|
export {
|
|
1262
|
-
AUDIT_LOG_MAX_COLLECTIONS as A,
|
|
1263
1130
|
useAgentChatSessions as a,
|
|
1264
1131
|
useAuditLog as b,
|
|
1265
1132
|
useAutomationRun as c,
|
|
1266
|
-
auditLogSummaryWithCollectionLabel as d,
|
|
1267
|
-
auditLogDetailValue as e,
|
|
1268
|
-
auditLogActorLabel as f,
|
|
1269
|
-
getRecordAuditLogSnapshot as g,
|
|
1270
|
-
normalizeAuditLogFilterState as h,
|
|
1271
|
-
fetchRecordAuditLogCsv as i,
|
|
1272
|
-
normalizeAuditLogExportLimit as j,
|
|
1273
|
-
normalizeRecordAuditCollections as n,
|
|
1274
1133
|
useAgentChat as u
|
|
1275
1134
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useQueryClient, useQuery, useMutation } from "@tanstack/react-query";
|
|
2
2
|
import { useState, useCallback, useEffect, useMemo } from "react";
|
|
3
|
-
import { T as listRunsByAgent, z as automationStatuses, F as createAutomationRun, y as uploadFile, o as onInitMessage, t as pbSql, v as pbUpdateRecord } from "./automations-
|
|
3
|
+
import { T as listRunsByAgent, z as automationStatuses, F as createAutomationRun, y as uploadFile, o as onInitMessage, t as pbSql, v as pbUpdateRecord } from "./automations-D4tZC_G7.js";
|
|
4
4
|
function useAutomationAgent({
|
|
5
5
|
agentId,
|
|
6
6
|
limit = 5,
|
package/package.json
CHANGED