- Activity page: "Delete all" empties the open tab (api/admin/logs/clear-logs, super admin only, logged under system) - Stop logging every WebSocket connect - Log unexpected API errors (safeErrorMessage -> logUnexpectedError), every failed bot job attempt and every job the queue lost - Drop the cron jobs' console output; a failed model sync goes to the logs Co-Authored-By: Claude Opus 5.5 <[email protected]>
18 lines
561 B
TypeScript
18 lines
561 B
TypeScript
import { z } from "zod";
|
|
import { LogCategories } from "@/src/dict/log-categories";
|
|
|
|
const LogCategoryValues = LogCategories.map((lc) => lc.value) as [
|
|
(typeof LogCategories)[number]["value"],
|
|
...(typeof LogCategories)[number]["value"][],
|
|
];
|
|
|
|
/**
|
|
* `POST api/admin/logs/clear-logs`: deletes every log in one category, or
|
|
* every log when it is left out (the "All" tab).
|
|
*/
|
|
export const ClearLogsRequestSchema = z.object({
|
|
category: z.enum(LogCategoryValues).optional(),
|
|
});
|
|
|
|
export type ClearLogsRequest = z.infer<typeof ClearLogsRequestSchema>;
|