This commit is contained in:
2024-12-24 09:43:23 -05:00
commit 7791baff20
11 changed files with 371 additions and 0 deletions

23
src/types.ts Normal file
View File

@@ -0,0 +1,23 @@
import {z} from "zod";
const commentsConfigSchema = z.object({
mail: z.object({
imap: z.object({
host: z.string(),
port: z.number({ coerce: true }),
auth: z.object({
user: z.string(),
pass: z.string(),
}),
}),
threads: z.object({
type: z.string(), // fixme : in validation
template: z.string(),
}),
}),
})
export type CommentsConfig = z.infer<typeof commentsConfigSchema>
export const castCommentsConfig = (what: unknown): CommentsConfig => {
return commentsConfigSchema.parse(what)
}