mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-27 00:40:58 +01:00
19 lines
502 B
TypeScript
19 lines
502 B
TypeScript
import { z } from "zod";
|
|
|
|
const manageAppSchema = z.object({
|
|
name: z.string().min(1).max(64),
|
|
description: z.string().max(512).nullable(),
|
|
iconUrl: z.string().min(1),
|
|
href: z.string().nullable(),
|
|
});
|
|
|
|
const editAppSchema = manageAppSchema.and(z.object({ id: z.string() }));
|
|
|
|
export const appSchemas = {
|
|
manage: manageAppSchema,
|
|
createMany: z
|
|
.array(manageAppSchema.omit({ iconUrl: true }).and(z.object({ iconUrl: z.string().min(1).nullable() })))
|
|
.min(1),
|
|
edit: editAppSchema,
|
|
};
|