/* * 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 { Business, Business$inboundSchema, Business$Outbound, Business$outboundSchema, } from "./business.js"; import { Identity, Identity$inboundSchema, Identity$Outbound, Identity$outboundSchema, } from "./identity.js"; export type Signals = {}; export type V3VerifyResponse = { /** * Additional Identities found as part of the verification flow. */ additionalIdentities?: Array | undefined; /** * AddressMatchScore is the fuzzy address match score (0–100) produced during validate flow. * * @remarks * Absent when no address was provided in the request. * Only present for verificationType=validate. */ addressMatchScore?: number | undefined; /** * Businesses is used for business prefill. */ businesses?: Array | undefined; /** * The input ClientCustomerID. */ clientCustomerId?: string | undefined; /** * The input ClientHumanID. */ clientHumanId?: string | undefined; /** * The input ClientRequestID. */ clientRequestId?: string | undefined; /** * The unique ID that Prove generates for the flow. */ correlationId: string; /** * Policy evaluation outputs from Luna. May include authentication, identification, and risk categories. Omitted from the response when evaluation.includeEvaluation is not enabled. */ evaluation?: { [k: string]: any } | undefined; identity?: Identity | undefined; /** * IsEnrolled indicates whether the identity was successfully enrolled into Identity Manager. */ isEnrolled?: boolean | undefined; /** * NameMatchScore is the fuzzy name match score (0–100) produced during validate flow. * * @remarks * Absent when name scoring was not performed. * Only present for verificationType=validate. */ nameMatchScore?: number | undefined; /** * The input phone number. */ phoneNumber: string; /** * PreviousCorrelationID is the correlationId from the prefill response that preceded this * * @remarks * validate request. Set to an empty string when no preceding prefill was cached. * Only present for verificationType=validate. */ previousCorrelationId?: string | undefined; /** * A Prove-generated identifier for the consumer. */ proveId?: string | undefined; /** * A persistent ID that uniquely identifies a telephone subscriber. */ provePhoneAlias?: string | undefined; /** * Signals */ signals?: Array<{ [k: string]: Signals }> | undefined; /** * The result of verification. This can be "true" or "false". * * @remarks * Omitted from the response when blank. */ success?: string | undefined; /** * ValidationStatus indicates whether all configured thresholds passed. * * @remarks * Only present for verificationType=validate. */ validationStatus?: boolean | undefined; }; /** @internal */ export const Signals$inboundSchema: z.ZodType = z.object({}); /** @internal */ export type Signals$Outbound = {}; /** @internal */ export const Signals$outboundSchema: z.ZodType< Signals$Outbound, z.ZodTypeDef, Signals > = z.object({}); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Signals$ { /** @deprecated use `Signals$inboundSchema` instead. */ export const inboundSchema = Signals$inboundSchema; /** @deprecated use `Signals$outboundSchema` instead. */ export const outboundSchema = Signals$outboundSchema; /** @deprecated use `Signals$Outbound` instead. */ export type Outbound = Signals$Outbound; } export function signalsToJSON(signals: Signals): string { return JSON.stringify(Signals$outboundSchema.parse(signals)); } export function signalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Signals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Signals' from JSON`, ); } /** @internal */ export const V3VerifyResponse$inboundSchema: z.ZodType< V3VerifyResponse, z.ZodTypeDef, unknown > = z.object({ additionalIdentities: z.array(Identity$inboundSchema).optional(), addressMatchScore: z.number().int().optional(), businesses: z.array(Business$inboundSchema).optional(), clientCustomerId: z.string().optional(), clientHumanId: z.string().optional(), clientRequestId: z.string().optional(), correlationId: z.string(), evaluation: z.record(z.any()).optional(), identity: Identity$inboundSchema.optional(), isEnrolled: z.boolean().optional(), nameMatchScore: z.number().int().optional(), phoneNumber: z.string(), previousCorrelationId: z.string().optional(), proveId: z.string().optional(), provePhoneAlias: z.string().optional(), signals: z.array(z.record(z.lazy(() => Signals$inboundSchema))).optional(), success: z.string().optional(), validationStatus: z.boolean().optional(), }); /** @internal */ export type V3VerifyResponse$Outbound = { additionalIdentities?: Array | undefined; addressMatchScore?: number | undefined; businesses?: Array | undefined; clientCustomerId?: string | undefined; clientHumanId?: string | undefined; clientRequestId?: string | undefined; correlationId: string; evaluation?: { [k: string]: any } | undefined; identity?: Identity$Outbound | undefined; isEnrolled?: boolean | undefined; nameMatchScore?: number | undefined; phoneNumber: string; previousCorrelationId?: string | undefined; proveId?: string | undefined; provePhoneAlias?: string | undefined; signals?: Array<{ [k: string]: Signals$Outbound }> | undefined; success?: string | undefined; validationStatus?: boolean | undefined; }; /** @internal */ export const V3VerifyResponse$outboundSchema: z.ZodType< V3VerifyResponse$Outbound, z.ZodTypeDef, V3VerifyResponse > = z.object({ additionalIdentities: z.array(Identity$outboundSchema).optional(), addressMatchScore: z.number().int().optional(), businesses: z.array(Business$outboundSchema).optional(), clientCustomerId: z.string().optional(), clientHumanId: z.string().optional(), clientRequestId: z.string().optional(), correlationId: z.string(), evaluation: z.record(z.any()).optional(), identity: Identity$outboundSchema.optional(), isEnrolled: z.boolean().optional(), nameMatchScore: z.number().int().optional(), phoneNumber: z.string(), previousCorrelationId: z.string().optional(), proveId: z.string().optional(), provePhoneAlias: z.string().optional(), signals: z.array(z.record(z.lazy(() => Signals$outboundSchema))).optional(), success: z.string().optional(), validationStatus: z.boolean().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace V3VerifyResponse$ { /** @deprecated use `V3VerifyResponse$inboundSchema` instead. */ export const inboundSchema = V3VerifyResponse$inboundSchema; /** @deprecated use `V3VerifyResponse$outboundSchema` instead. */ export const outboundSchema = V3VerifyResponse$outboundSchema; /** @deprecated use `V3VerifyResponse$Outbound` instead. */ export type Outbound = V3VerifyResponse$Outbound; } export function v3VerifyResponseToJSON( v3VerifyResponse: V3VerifyResponse, ): string { return JSON.stringify( V3VerifyResponse$outboundSchema.parse(v3VerifyResponse), ); } export function v3VerifyResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3VerifyResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3VerifyResponse' from JSON`, ); }