Basic request log working

This commit is contained in:
Owen
2025-10-22 12:23:48 -07:00
parent fdd4d5244f
commit f748c5dbe4
16 changed files with 793 additions and 52 deletions

View File

@@ -0,0 +1,16 @@
export function generateCSV(data: any[]): string {
if (data.length === 0) {
return "orgId,action,actorType,timestamp,actor\n";
}
const headers = Object.keys(data[0]).join(",");
const rows = data.map(row =>
Object.values(row).map(value =>
typeof value === 'string' && value.includes(',')
? `"${value.replace(/"/g, '""')}"`
: value
).join(",")
);
return [headers, ...rows].join("\n");
}