@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>
54 lines (49 loc) • 1.36 kB
text/typescript
/*
* 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";
/**
* This object represents a public route in a Vercel Sandbox.
*/
export type SandboxPublicRoute = {
/**
* A public URL to access the corresponding port in the Sandbox.
*/
url: string;
/**
* The user port number that the route is mapped to.
*/
port: number;
/**
* The subdomain assigned to this route.
*/
subdomain: string;
/**
* Whether the route is reserved by the system (e.g. for internal use).
*/
system?: true | undefined;
};
/** @internal */
export const SandboxPublicRoute$inboundSchema: z.ZodType<
SandboxPublicRoute,
z.ZodTypeDef,
unknown
> = z.object({
url: types.string(),
port: types.number(),
subdomain: types.string(),
system: types.optional(types.literal(true)),
});
export function sandboxPublicRouteFromJSON(
jsonString: string,
): SafeParseResult<SandboxPublicRoute, SDKValidationError> {
return safeParse(
jsonString,
(x) => SandboxPublicRoute$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'SandboxPublicRoute' from JSON`,
);
}