/* * 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 Three = { type?: "INDEX" | undefined; index: number; }; export type Two = { type?: "LABEL" | undefined; label: string; }; export type One = { type?: "VALUE" | undefined; value: string; }; /** * new field for selecting options, optional for backcompat */ export type Choice = One | Two | Three; export type SelectOptionCommand = { 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?: "SELECT_OPTION" | undefined; target: ElementTarget; cache?: SingleTargetCache | undefined; /** * option value, deprecated old field */ option?: string | undefined; /** * new field for selecting options, optional for backcompat */ choice?: One | Two | Three | undefined; }; /** @internal */ export const Three$inboundSchema: z.ZodType = z .object({ type: z.literal("INDEX").optional(), index: z.number().int(), }); /** @internal */ export type Three$Outbound = { type: "INDEX"; index: number; }; /** @internal */ export const Three$outboundSchema: z.ZodType< Three$Outbound, z.ZodTypeDef, Three > = z.object({ type: z.literal("INDEX").default("INDEX" as const), index: z.number().int(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Three$ { /** @deprecated use `Three$inboundSchema` instead. */ export const inboundSchema = Three$inboundSchema; /** @deprecated use `Three$outboundSchema` instead. */ export const outboundSchema = Three$outboundSchema; /** @deprecated use `Three$Outbound` instead. */ export type Outbound = Three$Outbound; } /** @internal */ export const Two$inboundSchema: z.ZodType = z .object({ type: z.literal("LABEL").optional(), label: z.string(), }); /** @internal */ export type Two$Outbound = { type: "LABEL"; label: string; }; /** @internal */ export const Two$outboundSchema: z.ZodType = z .object({ type: z.literal("LABEL").default("LABEL" as const), label: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Two$ { /** @deprecated use `Two$inboundSchema` instead. */ export const inboundSchema = Two$inboundSchema; /** @deprecated use `Two$outboundSchema` instead. */ export const outboundSchema = Two$outboundSchema; /** @deprecated use `Two$Outbound` instead. */ export type Outbound = Two$Outbound; } /** @internal */ export const One$inboundSchema: z.ZodType = z .object({ type: z.literal("VALUE").optional(), value: z.string(), }); /** @internal */ export type One$Outbound = { type: "VALUE"; value: string; }; /** @internal */ export const One$outboundSchema: z.ZodType = z .object({ type: z.literal("VALUE").default("VALUE" as const), value: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace One$ { /** @deprecated use `One$inboundSchema` instead. */ export const inboundSchema = One$inboundSchema; /** @deprecated use `One$outboundSchema` instead. */ export const outboundSchema = One$outboundSchema; /** @deprecated use `One$Outbound` instead. */ export type Outbound = One$Outbound; } /** @internal */ export const Choice$inboundSchema: z.ZodType = z .union([ z.lazy(() => One$inboundSchema), z.lazy(() => Two$inboundSchema), z.lazy(() => Three$inboundSchema), ]); /** @internal */ export type Choice$Outbound = One$Outbound | Two$Outbound | Three$Outbound; /** @internal */ export const Choice$outboundSchema: z.ZodType< Choice$Outbound, z.ZodTypeDef, Choice > = z.union([ z.lazy(() => One$outboundSchema), z.lazy(() => Two$outboundSchema), z.lazy(() => Three$outboundSchema), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Choice$ { /** @deprecated use `Choice$inboundSchema` instead. */ export const inboundSchema = Choice$inboundSchema; /** @deprecated use `Choice$outboundSchema` instead. */ export const outboundSchema = Choice$outboundSchema; /** @deprecated use `Choice$Outbound` instead. */ export type Outbound = Choice$Outbound; } /** @internal */ export const SelectOptionCommand$inboundSchema: z.ZodType< SelectOptionCommand, 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("SELECT_OPTION").optional(), target: ElementTarget$inboundSchema, cache: SingleTargetCache$inboundSchema.optional(), option: z.string().optional(), choice: z.union([ z.lazy(() => One$inboundSchema), z.lazy(() => Two$inboundSchema), z.lazy(() => Three$inboundSchema), ]).optional(), }); /** @internal */ export type SelectOptionCommand$Outbound = { thoughts?: string | undefined; id: string; useSelector?: boolean | undefined; force?: boolean | undefined; disableCache?: boolean | undefined; iframeUrl?: string | undefined; type: "SELECT_OPTION"; target: ElementTarget$Outbound; cache?: SingleTargetCache$Outbound | undefined; option?: string | undefined; choice?: One$Outbound | Two$Outbound | Three$Outbound | undefined; }; /** @internal */ export const SelectOptionCommand$outboundSchema: z.ZodType< SelectOptionCommand$Outbound, z.ZodTypeDef, SelectOptionCommand > = 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("SELECT_OPTION").default("SELECT_OPTION" as const), target: ElementTarget$outboundSchema, cache: SingleTargetCache$outboundSchema.optional(), option: z.string().optional(), choice: z.union([ z.lazy(() => One$outboundSchema), z.lazy(() => Two$outboundSchema), z.lazy(() => Three$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 SelectOptionCommand$ { /** @deprecated use `SelectOptionCommand$inboundSchema` instead. */ export const inboundSchema = SelectOptionCommand$inboundSchema; /** @deprecated use `SelectOptionCommand$outboundSchema` instead. */ export const outboundSchema = SelectOptionCommand$outboundSchema; /** @deprecated use `SelectOptionCommand$Outbound` instead. */ export type Outbound = SelectOptionCommand$Outbound; }