/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Wraps a compact-serialized JSON Web Encryption (JWE) token used for secure transmission of sensitive data (e.g., PCI information) through intermediaries. * * @remarks * This token is encrypted using the public key from /end-to-end-keys and wraps an AES key. For details and examples, refer to our * [GitHub repository](https://github.com/moovfinancial/moov-go/blob/main/examples/e2ee/e2ee_test.go). */ export type E2EEToken = { /** * An [RFC](https://datatracker.ietf.org/doc/html/rfc7516) compact-serialized JSON Web Encryption (JWE) token. */ token: string; }; /** @internal */ export const E2EEToken$inboundSchema: z.ZodType< E2EEToken, z.ZodTypeDef, unknown > = z.object({ token: z.string(), }); /** @internal */ export type E2EEToken$Outbound = { token: string; }; /** @internal */ export const E2EEToken$outboundSchema: z.ZodType< E2EEToken$Outbound, z.ZodTypeDef, E2EEToken > = z.object({ token: z.string(), }); export function e2EETokenToJSON(e2EEToken: E2EEToken): string { return JSON.stringify(E2EEToken$outboundSchema.parse(e2EEToken)); } export function e2EETokenFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => E2EEToken$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'E2EEToken' from JSON`, ); }