refactor: Migrate config schema from Zod v3 to Zod v4 (#2357)

This commit is contained in:
Dermot Duffy
2026-02-18 21:47:43 -08:00
committed by GitHub
parent a15376602f
commit 529500ed94
51 changed files with 1110 additions and 443 deletions
+2 -2
View File
@@ -7,11 +7,11 @@ export const customSchema = z
type: z.string().superRefine((val, ctx) => {
if (!val.match(/^custom:(?!advanced-camera-card).+/)) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
code: 'custom',
message: 'advanced-camera-card custom elements must match specific schemas',
fatal: true,
});
}
}),
})
.passthrough();
.loose();
+2 -2
View File
@@ -8,8 +8,8 @@ export const imageSchema = elementsBaseSchema.extend({
image: z.string().optional(),
camera_image: z.string().optional(),
camera_view: z.string().optional(),
state_image: z.object({}).passthrough().optional(),
state_image: z.looseObject({}).optional(),
filter: z.string().optional(),
state_filter: z.object({}).passthrough().optional(),
state_filter: z.looseObject({}).optional(),
aspect_ratio: z.string().optional(),
});
@@ -8,5 +8,5 @@ export const serviceCallButtonSchema = elementsBaseSchema.extend({
// Title is required for service button.
title: z.string(),
service: z.string(),
service_data: z.object({}).passthrough().optional(),
service_data: z.looseObject({}).optional(),
});