/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; export type Action3 = { type?: "INDEX" | undefined; index: number; }; export type Action2 = { type?: "REGEX" | undefined; pattern: string; }; export type Action1 = { type?: "SUBSTRING" | undefined; substring: string; }; export type Action = Action1 | Action2 | Action3; export type TabCommand = { thoughts?: string | undefined; /** * unique identifier to this step, used for step cache */ id: string; /** * Max seconds for the page to load */ loadTimeout?: number | undefined; type?: "TAB" | undefined; /** * deprecated field - new instances should use the discriminated union */ url?: string | undefined; action?: Action1 | Action2 | Action3 | undefined; }; /** @internal */ export const Action3$inboundSchema: z.ZodType = z.object({ type: z.literal("INDEX").optional(), index: z.number(), }); /** @internal */ export type Action3$Outbound = { type: "INDEX"; index: number; }; /** @internal */ export const Action3$outboundSchema: z.ZodType< Action3$Outbound, z.ZodTypeDef, Action3 > = z.object({ type: z.literal("INDEX").default("INDEX" as const), index: 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 Action3$ { /** @deprecated use `Action3$inboundSchema` instead. */ export const inboundSchema = Action3$inboundSchema; /** @deprecated use `Action3$outboundSchema` instead. */ export const outboundSchema = Action3$outboundSchema; /** @deprecated use `Action3$Outbound` instead. */ export type Outbound = Action3$Outbound; } /** @internal */ export const Action2$inboundSchema: z.ZodType = z.object({ type: z.literal("REGEX").optional(), pattern: z.string(), }); /** @internal */ export type Action2$Outbound = { type: "REGEX"; pattern: string; }; /** @internal */ export const Action2$outboundSchema: z.ZodType< Action2$Outbound, z.ZodTypeDef, Action2 > = z.object({ type: z.literal("REGEX").default("REGEX" as const), pattern: 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 Action2$ { /** @deprecated use `Action2$inboundSchema` instead. */ export const inboundSchema = Action2$inboundSchema; /** @deprecated use `Action2$outboundSchema` instead. */ export const outboundSchema = Action2$outboundSchema; /** @deprecated use `Action2$Outbound` instead. */ export type Outbound = Action2$Outbound; } /** @internal */ export const Action1$inboundSchema: z.ZodType = z.object({ type: z.literal("SUBSTRING").optional(), substring: z.string(), }); /** @internal */ export type Action1$Outbound = { type: "SUBSTRING"; substring: string; }; /** @internal */ export const Action1$outboundSchema: z.ZodType< Action1$Outbound, z.ZodTypeDef, Action1 > = z.object({ type: z.literal("SUBSTRING").default("SUBSTRING" as const), substring: 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 Action1$ { /** @deprecated use `Action1$inboundSchema` instead. */ export const inboundSchema = Action1$inboundSchema; /** @deprecated use `Action1$outboundSchema` instead. */ export const outboundSchema = Action1$outboundSchema; /** @deprecated use `Action1$Outbound` instead. */ export type Outbound = Action1$Outbound; } /** @internal */ export const Action$inboundSchema: z.ZodType = z .union([ z.lazy(() => Action1$inboundSchema), z.lazy(() => Action2$inboundSchema), z.lazy(() => Action3$inboundSchema), ]); /** @internal */ export type Action$Outbound = | Action1$Outbound | Action2$Outbound | Action3$Outbound; /** @internal */ export const Action$outboundSchema: z.ZodType< Action$Outbound, z.ZodTypeDef, Action > = z.union([ z.lazy(() => Action1$outboundSchema), z.lazy(() => Action2$outboundSchema), z.lazy(() => Action3$outboundSchema), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Action$ { /** @deprecated use `Action$inboundSchema` instead. */ export const inboundSchema = Action$inboundSchema; /** @deprecated use `Action$outboundSchema` instead. */ export const outboundSchema = Action$outboundSchema; /** @deprecated use `Action$Outbound` instead. */ export type Outbound = Action$Outbound; } /** @internal */ export const TabCommand$inboundSchema: z.ZodType< TabCommand, z.ZodTypeDef, unknown > = z.object({ thoughts: z.string().optional(), id: z.string(), loadTimeout: z.number().int().optional(), type: z.literal("TAB").optional(), url: z.string().optional(), action: z.union([ z.lazy(() => Action1$inboundSchema), z.lazy(() => Action2$inboundSchema), z.lazy(() => Action3$inboundSchema), ]).optional(), }); /** @internal */ export type TabCommand$Outbound = { thoughts?: string | undefined; id: string; loadTimeout?: number | undefined; type: "TAB"; url?: string | undefined; action?: Action1$Outbound | Action2$Outbound | Action3$Outbound | undefined; }; /** @internal */ export const TabCommand$outboundSchema: z.ZodType< TabCommand$Outbound, z.ZodTypeDef, TabCommand > = z.object({ thoughts: z.string().optional(), id: z.string(), loadTimeout: z.number().int().optional(), type: z.literal("TAB").default("TAB" as const), url: z.string().optional(), action: z.union([ z.lazy(() => Action1$outboundSchema), z.lazy(() => Action2$outboundSchema), z.lazy(() => Action3$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 TabCommand$ { /** @deprecated use `TabCommand$inboundSchema` instead. */ export const inboundSchema = TabCommand$inboundSchema; /** @deprecated use `TabCommand$outboundSchema` instead. */ export const outboundSchema = TabCommand$outboundSchema; /** @deprecated use `TabCommand$Outbound` instead. */ export type Outbound = TabCommand$Outbound; }