Files
khb_microservices/packages/data_collector/src/settings.ts
Yuri Yaryshev ebb1cb7950
Some checks failed
ci / test (push) Failing after 20s
ci / deploy (push) Has been skipped
Каркас monorepo: scheduler, data_collector, khbuild_assistant_prep, khb_common; миграции; CI/CD
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 09:44:55 +03:00

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>;