clickhouse-trigger-logs.ts at the two result.json() call sites in getTriggerLogs and getSingleTriggerLog cast raw ClickHouse rows directly as ClickHouseLogRow[] with no runtime validation. If the DB schema evolves or a field comes back in an unexpected shape, the bad data silently propagates into downstream decryption and response-building logic.
This PR defines ClickHouseLogRowSchema (a Zod object mirroring the ClickHouseLogRow interface, with safe defaults for every field) and replaces both rows as ClickHouseLogRow[] casts with parseClickHouseRows(rawRows, ClickHouseLogRowSchema). The parseClickHouseRows helper is imported from @/src/types/clickhouse, which is the same pattern already used in clickhouse-tool-logs.ts for ClickHouseToolExecutionLogRowSchema.
.optional().default(...) ensures Zod infers non-optional output types (no runtime breakage on optional fields); safeExecuteAsync correctly awaits the async parseClickHouseRows call; downstream field accesses (log.webhookEventId, log.createdAt, etc.) remain compatible with the schema-inferred type.webhookDeliveryStatus, sdkDeliveryStatus, cliDeliveryStatus are present in the interface but not selected in either query; they will always parse to their defaults (null), which is harmless.🤖 Generated with Claude Code