mirror of
https://github.com/morten-olsen/mini-loader.git
synced 2026-02-08 01:36:26 +01:00
init
This commit is contained in:
24
packages/server/src/repos/logs/logs.schemas.ts
Normal file
24
packages/server/src/repos/logs/logs.schemas.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
const addLogSchema = z.object({
|
||||
runId: z.string(),
|
||||
loadId: z.string(),
|
||||
severity: z.enum(['info', 'warning', 'error']),
|
||||
message: z.string(),
|
||||
data: z.any().optional(),
|
||||
});
|
||||
|
||||
const findLogsSchema = z.object({
|
||||
runId: z.string().optional(),
|
||||
loadId: z.string().optional(),
|
||||
severities: z.array(z.enum(['debug', 'info', 'warn', 'error'])).optional(),
|
||||
offset: z.number().optional(),
|
||||
limit: z.number().optional(),
|
||||
order: z.enum(['asc', 'desc']).optional(),
|
||||
});
|
||||
|
||||
type AddLogOptions = z.infer<typeof addLogSchema>;
|
||||
type FindLogsOptions = z.infer<typeof findLogsSchema>;
|
||||
|
||||
export type { AddLogOptions, FindLogsOptions };
|
||||
export { addLogSchema, findLogsSchema };
|
||||
Reference in New Issue
Block a user