/* * 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"; import { PushToken, PushToken$inboundSchema, PushToken$Outbound, PushToken$outboundSchema, } from "./pushtoken.js"; export type AuthStartResponse = { /** * AuthID is the unique ID of the auth flow. To complete the auth flow, the `authId` will also be used for the * * @remarks * AuthFinish request. */ authId: string; /** * AuthToken is a bearer token for use by the Prove Auth SDK. */ authToken: string; /** * PushTokens is an array of Push Tokens for the customer to use to initiate push notifications via their own service. */ pushTokens?: Array | undefined; /** * UniversalRedirectURL is a Prove hosted endpoint for Universal Prove Key. URL query string also includes session authToken parameter. */ universalRedirectUrl?: string | undefined; }; /** @internal */ export const AuthStartResponse$inboundSchema: z.ZodType< AuthStartResponse, z.ZodTypeDef, unknown > = z.object({ authId: z.string(), authToken: z.string(), pushTokens: z.array(PushToken$inboundSchema).optional(), universalRedirectUrl: z.string().optional(), }); /** @internal */ export type AuthStartResponse$Outbound = { authId: string; authToken: string; pushTokens?: Array | undefined; universalRedirectUrl?: string | undefined; }; /** @internal */ export const AuthStartResponse$outboundSchema: z.ZodType< AuthStartResponse$Outbound, z.ZodTypeDef, AuthStartResponse > = z.object({ authId: z.string(), authToken: z.string(), pushTokens: z.array(PushToken$outboundSchema).optional(), universalRedirectUrl: 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 AuthStartResponse$ { /** @deprecated use `AuthStartResponse$inboundSchema` instead. */ export const inboundSchema = AuthStartResponse$inboundSchema; /** @deprecated use `AuthStartResponse$outboundSchema` instead. */ export const outboundSchema = AuthStartResponse$outboundSchema; /** @deprecated use `AuthStartResponse$Outbound` instead. */ export type Outbound = AuthStartResponse$Outbound; } export function authStartResponseToJSON( authStartResponse: AuthStartResponse, ): string { return JSON.stringify( AuthStartResponse$outboundSchema.parse(authStartResponse), ); } export function authStartResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AuthStartResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuthStartResponse' from JSON`, ); }