25 lines
1.3 KiB
TypeScript
25 lines
1.3 KiB
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({}),
|
||
events: z.object({ backfillDays: z.number().default(90) }).default({}),
|
||
/** Сообщения людей в проектных каналах Slack (активность). Без токена загрузка пропускается. Токен бота - тот же, что у khbuild_assistant_prep. */
|
||
slack: z.object({ botToken: z.string().min(1), backfillDays: z.number().default(90) }).optional(),
|
||
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>;
|