/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { ElementTarget, ElementTarget$inboundSchema, ElementTarget$Outbound, ElementTarget$outboundSchema, } from "./elementtarget.js"; import { SingleTargetCache, SingleTargetCache$inboundSchema, SingleTargetCache$Outbound, SingleTargetCache$outboundSchema, } from "./singletargetcache.js"; export type Screenshot = { /** * s3 url to a jpg */ data: string; width: number; height: number; }; export type VisualDiffCommand = { thoughts?: string | undefined; /** * unique identifier to this step, used for step cache */ id: string; useSelector?: boolean | undefined; force?: boolean | undefined; /** * disable element caching for this step */ disableCache?: boolean | undefined; /** * url or url regex for the iframe */ iframeUrl?: string | undefined; type?: "VISUAL_DIFF" | undefined; /** * default 0.1 */ threshold?: number | undefined; target?: ElementTarget | undefined; screenshot?: Screenshot | undefined; cache?: SingleTargetCache | undefined; }; /** @internal */ export const Screenshot$inboundSchema: z.ZodType< Screenshot, z.ZodTypeDef, unknown > = z.object({ data: z.string(), width: z.number(), height: z.number(), }); /** @internal */ export type Screenshot$Outbound = { data: string; width: number; height: number; }; /** @internal */ export const Screenshot$outboundSchema: z.ZodType< Screenshot$Outbound, z.ZodTypeDef, Screenshot > = z.object({ data: z.string(), width: z.number(), height: z.number(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Screenshot$ { /** @deprecated use `Screenshot$inboundSchema` instead. */ export const inboundSchema = Screenshot$inboundSchema; /** @deprecated use `Screenshot$outboundSchema` instead. */ export const outboundSchema = Screenshot$outboundSchema; /** @deprecated use `Screenshot$Outbound` instead. */ export type Outbound = Screenshot$Outbound; } /** @internal */ export const VisualDiffCommand$inboundSchema: z.ZodType< VisualDiffCommand, z.ZodTypeDef, unknown > = z.object({ thoughts: z.string().optional(), id: z.string(), useSelector: z.boolean().optional(), force: z.boolean().optional(), disableCache: z.boolean().optional(), iframeUrl: z.string().optional(), type: z.literal("VISUAL_DIFF").optional(), threshold: z.number().optional(), target: ElementTarget$inboundSchema.optional(), screenshot: z.lazy(() => Screenshot$inboundSchema).optional(), cache: SingleTargetCache$inboundSchema.optional(), }); /** @internal */ export type VisualDiffCommand$Outbound = { thoughts?: string | undefined; id: string; useSelector?: boolean | undefined; force?: boolean | undefined; disableCache?: boolean | undefined; iframeUrl?: string | undefined; type: "VISUAL_DIFF"; threshold?: number | undefined; target?: ElementTarget$Outbound | undefined; screenshot?: Screenshot$Outbound | undefined; cache?: SingleTargetCache$Outbound | undefined; }; /** @internal */ export const VisualDiffCommand$outboundSchema: z.ZodType< VisualDiffCommand$Outbound, z.ZodTypeDef, VisualDiffCommand > = z.object({ thoughts: z.string().optional(), id: z.string(), useSelector: z.boolean().optional(), force: z.boolean().optional(), disableCache: z.boolean().optional(), iframeUrl: z.string().optional(), type: z.literal("VISUAL_DIFF").default("VISUAL_DIFF" as const), threshold: z.number().optional(), target: ElementTarget$outboundSchema.optional(), screenshot: z.lazy(() => Screenshot$outboundSchema).optional(), cache: SingleTargetCache$outboundSchema.optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace VisualDiffCommand$ { /** @deprecated use `VisualDiffCommand$inboundSchema` instead. */ export const inboundSchema = VisualDiffCommand$inboundSchema; /** @deprecated use `VisualDiffCommand$outboundSchema` instead. */ export const outboundSchema = VisualDiffCommand$outboundSchema; /** @deprecated use `VisualDiffCommand$Outbound` instead. */ export type Outbound = VisualDiffCommand$Outbound; }