feat: category export and API cleanup.

This commit is contained in:
mattia
2025-01-06 20:45:51 +01:00
parent 50ecb39cce
commit 99859177b3
16 changed files with 566 additions and 248 deletions

View File

@@ -13,7 +13,7 @@ export async function getSession(id: string): Promise<GetSessionResponse> {
const logEntries = await db
.selectFrom("log_entries")
.where("session_info_id", "=", id)
.select(["id", "message", "timestamp"])
.select(["id", "message", "timestamp", "category"])
.orderBy("timestamp", "asc")
.execute();
@@ -35,6 +35,7 @@ export async function getSession(id: string): Promise<GetSessionResponse> {
log_entries: logEntries.map((entry) => ({
message: entry.message,
timestamp: entry.timestamp,
category: entry.category,
metadata: metadata
.filter((m) => m.log_entry_id === entry.id)
.reduce((acc, m) => ({ ...acc, [m.key]: m.value }), {}),