feat: complete stage 1 infrastructure

This commit is contained in:
Jason
2025-10-16 10:00:22 +08:00
parent 95e2d84655
commit cc0b7053aa
31 changed files with 2350 additions and 9 deletions

View File

@@ -0,0 +1,23 @@
import { z } from "zod";
export const providerSchema = z.object({
name: z.string().min(1, "请填写供应商名称"),
websiteUrl: z
.string()
.url("请输入有效的网址")
.optional()
.or(z.literal("")),
settingsConfig: z
.string()
.min(1, "请填写配置内容")
.refine((value) => {
try {
JSON.parse(value);
return true;
} catch {
return false;
}
}, "配置 JSON 格式错误"),
});
export type ProviderFormData = z.infer<typeof providerSchema>;