/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type V3StartRequest = { /** * If true, the customer can re-enter the OTP up to three times. Code must also be implemented. See client-side SDK guide for more details. */ allowOTPRetry?: boolean | undefined; /** * The date of birth in one of these formats: YYYY-MM-DD, YYYY-MM, or MM-DD. Acceptable characters are: numeric with symbol '-'. * * @remarks * * It is recommended you do NOT pass this value into the Start step. Prove will attempt to pre-fill data using phone number only. */ dob?: string | undefined; /** * The email address of the customer. Acceptable characters are: alphanumeric with symbols '@.+'. */ emailAddress?: string | undefined; /** * The URL where the end user will be redirected at the end of the Instant Link flow. Required only when `flowType=desktop`. Acceptable characters are: alphanumeric with symbols '-._+=/:?'. Max length is 128 characters. */ finalTargetUrl?: string | undefined; /** * The type of device being user - either `desktop` for desktop web or `mobile` for iOS/Android native apps and mobile web. */ flowType: string; /** * The IP address of the mobile device. Acceptable characters are: numeric with symbols ':.'. */ ipAddress?: string | undefined; /** * The number of the mobile phone. * * @remarks * US and Canada phone numbers can be passed in with or without a leading `+1`. * International phone numbers require a leading `+` followed by the country code. * Refer to the [Prove Pre-Fill Implementation guide](https://developer.prove.com/docs/prove-pre-fill-implementation-guide#implement-prove-pre-fill) and * [Prove Identity Implementation guide](https://developer.prove.com/docs/prove-identity-implementation-guide#implement-prove-identity) for situations * where this field is not required. Acceptable characters are: alphanumeric with symbols '+'. */ phoneNumber?: string | undefined; /** * The message body sent in the Instant Link (`flowType=desktop`) or OTP (`flowType=mobile`) SMS message. If not provided, the following default messages will be used: * * @remarks * * Instant Link: "Complete your verification. If you did not make this request, do not click the link. ####" _The verification URL replaces ####._ * * OTP: "#### is your temporary code to continue your application. Caution: for your security, don't share this code with anyone." _Use ####, #####, or ###### to generate 4-6 digit verification codes respectively._ * * Max length is 160 characters. Non-ASCII characters are allowed. */ smsMessage?: string | undefined; /** * The full or last 4 digits of the social security number. Acceptable characters are: numeric. * * @remarks * * It is recommended you do NOT pass this value into the Start step. Prove will attempt to pre-fill data using phone number only. */ ssn?: string | undefined; }; /** @internal */ export const V3StartRequest$inboundSchema: z.ZodType< V3StartRequest, z.ZodTypeDef, unknown > = z.object({ allowOTPRetry: z.boolean().optional(), dob: z.string().optional(), emailAddress: z.string().optional(), finalTargetUrl: z.string().optional(), flowType: z.string(), ipAddress: z.string().optional(), phoneNumber: z.string().optional(), smsMessage: z.string().optional(), ssn: z.string().optional(), }); /** @internal */ export type V3StartRequest$Outbound = { allowOTPRetry?: boolean | undefined; dob?: string | undefined; emailAddress?: string | undefined; finalTargetUrl?: string | undefined; flowType: string; ipAddress?: string | undefined; phoneNumber?: string | undefined; smsMessage?: string | undefined; ssn?: string | undefined; }; /** @internal */ export const V3StartRequest$outboundSchema: z.ZodType< V3StartRequest$Outbound, z.ZodTypeDef, V3StartRequest > = z.object({ allowOTPRetry: z.boolean().optional(), dob: z.string().optional(), emailAddress: z.string().optional(), finalTargetUrl: z.string().optional(), flowType: z.string(), ipAddress: z.string().optional(), phoneNumber: z.string().optional(), smsMessage: z.string().optional(), ssn: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace V3StartRequest$ { /** @deprecated use `V3StartRequest$inboundSchema` instead. */ export const inboundSchema = V3StartRequest$inboundSchema; /** @deprecated use `V3StartRequest$outboundSchema` instead. */ export const outboundSchema = V3StartRequest$outboundSchema; /** @deprecated use `V3StartRequest$Outbound` instead. */ export type Outbound = V3StartRequest$Outbound; } export function v3StartRequestToJSON(v3StartRequest: V3StartRequest): string { return JSON.stringify(V3StartRequest$outboundSchema.parse(v3StartRequest)); } export function v3StartRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3StartRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3StartRequest' from JSON`, ); }