UNPKG

@vercel/sdk

Version:

<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>

68 lines (59 loc) 1.77 kB
/* * 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 * as types from "../types/primitives.js"; import { SDKValidationError } from "./sdkvalidationerror.js"; export type DeleteAuthTokenRequest = { /** * The identifier of the token to invalidate. The special value "current" may be supplied, which invalidates the token that the HTTP request was authenticated with. */ tokenId: string; }; /** * Authentication token successfully deleted. */ export type DeleteAuthTokenResponseBody = { /** * The unique identifier of the token that was deleted. */ tokenId: string; }; /** @internal */ export type DeleteAuthTokenRequest$Outbound = { tokenId: string; }; /** @internal */ export const DeleteAuthTokenRequest$outboundSchema: z.ZodType< DeleteAuthTokenRequest$Outbound, z.ZodTypeDef, DeleteAuthTokenRequest > = z.object({ tokenId: z.string(), }); export function deleteAuthTokenRequestToJSON( deleteAuthTokenRequest: DeleteAuthTokenRequest, ): string { return JSON.stringify( DeleteAuthTokenRequest$outboundSchema.parse(deleteAuthTokenRequest), ); } /** @internal */ export const DeleteAuthTokenResponseBody$inboundSchema: z.ZodType< DeleteAuthTokenResponseBody, z.ZodTypeDef, unknown > = z.object({ tokenId: types.string(), }); export function deleteAuthTokenResponseBodyFromJSON( jsonString: string, ): SafeParseResult<DeleteAuthTokenResponseBody, SDKValidationError> { return safeParse( jsonString, (x) => DeleteAuthTokenResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteAuthTokenResponseBody' from JSON`, ); }