mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-16 12:45:56 +08:00
fixed zod validation for wait
This commit is contained in:
parent
80beedb46f
commit
28db4dd3b5
@ -61,9 +61,14 @@ export type ExtractOptions = z.infer<typeof extractOptions>;
|
|||||||
export const actionsSchema = z.array(z.union([
|
export const actionsSchema = z.array(z.union([
|
||||||
z.object({
|
z.object({
|
||||||
type: z.literal("wait"),
|
type: z.literal("wait"),
|
||||||
milliseconds: z.number().int().positive().finite(),
|
milliseconds: z.number().int().positive().finite().optional(),
|
||||||
selector: z.string().optional(),
|
selector: z.string().optional(),
|
||||||
}),
|
}).refine(
|
||||||
|
(data) => (data.milliseconds !== undefined || data.selector !== undefined) && !(data.milliseconds !== undefined && data.selector !== undefined),
|
||||||
|
{
|
||||||
|
message: "Either 'milliseconds' or 'selector' must be provided, but not both.",
|
||||||
|
}
|
||||||
|
),
|
||||||
z.object({
|
z.object({
|
||||||
type: z.literal("click"),
|
type: z.literal("click"),
|
||||||
selector: z.string(),
|
selector: z.string(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user