@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>
39 lines • 1.61 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { remap as remap$ } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
import * as types from "../types/primitives.js";
import { AuthToken$inboundSchema } from "./authtoken.js";
/** @internal */
export const CreateAuthTokenRequestBody$outboundSchema = z.object({
name: z.string(),
expiresAt: z.number().optional(),
projectId: z.string().optional(),
});
export function createAuthTokenRequestBodyToJSON(createAuthTokenRequestBody) {
return JSON.stringify(CreateAuthTokenRequestBody$outboundSchema.parse(createAuthTokenRequestBody));
}
/** @internal */
export const CreateAuthTokenRequest$outboundSchema = z.object({
teamId: z.string().optional(),
slug: z.string().optional(),
requestBody: z.lazy(() => CreateAuthTokenRequestBody$outboundSchema),
}).transform((v) => {
return remap$(v, {
requestBody: "RequestBody",
});
});
export function createAuthTokenRequestToJSON(createAuthTokenRequest) {
return JSON.stringify(CreateAuthTokenRequest$outboundSchema.parse(createAuthTokenRequest));
}
/** @internal */
export const CreateAuthTokenResponseBody$inboundSchema = z.object({
token: AuthToken$inboundSchema,
bearerToken: types.string(),
});
export function createAuthTokenResponseBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => CreateAuthTokenResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateAuthTokenResponseBody' from JSON`);
}
//# sourceMappingURL=createauthtokenop.js.map