22 lines
906 B
TypeScript
22 lines
906 B
TypeScript
import { z } from "zod";
|
|
|
|
export const httpSchema = z.object({ host: z.string().default("127.0.0.1"), port: z.number(), token: z.string().min(1) });
|
|
|
|
export const dataCollectorSchema = z.object({
|
|
http: httpSchema,
|
|
sources: z.array(z.string()).default(["jobtread"]),
|
|
mirror: z.object({ maxSnapshotAgeMinutes: z.number().default(90) }).default({}),
|
|
retention: z
|
|
.object({
|
|
hourlyKeepHours: z.number().optional(),
|
|
dailyKeepDays: z.number().optional(),
|
|
dbSizeLimitGb: z.number().optional(),
|
|
reducedDaysSteps: z.array(z.number()).optional(),
|
|
failedKeepDays: z.number().optional(),
|
|
failedMaxPerDay: z.number().optional(),
|
|
})
|
|
.default({}),
|
|
holidays: z.object({ country: z.string().default("US"), state: z.string().default("FL"), yearsAhead: z.number().default(2) }).default({}),
|
|
});
|
|
export type DataCollectorSettings = z.infer<typeof dataCollectorSchema>;
|