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>

140 lines (128 loc) 4.36 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 GetProjectDomainRequest = { /** * The unique project identifier or the project name */ idOrName: string; /** * The project domain name */ domain: string; /** * The Team identifier to perform the request on behalf of. */ teamId?: string | undefined; /** * The Team slug to perform the request on behalf of. */ slug?: string | undefined; }; /** * A list of verification challenges, one of which must be completed to verify the domain for use on the project. After the challenge is complete `POST /projects/:idOrName/domains/:domain/verify` to verify the domain. Possible challenges: - If `verification.type = TXT` the `verification.domain` will be checked for a TXT record matching `verification.value`. */ export type Verification = { type: string; domain: string; value: string; reason: string; }; export type GetProjectDomainResponseBody = { name: string; apexName: string; projectId: string; redirect?: string | null | undefined; redirectStatusCode?: number | null | undefined; gitBranch?: string | null | undefined; customEnvironmentId?: string | null | undefined; updatedAt?: number | undefined; createdAt?: number | undefined; /** * `true` if the domain is verified for use with the project. If `false` it will not be used as an alias on this project until the challenge in `verification` is completed. */ verified: boolean; /** * A list of verification challenges, one of which must be completed to verify the domain for use on the project. After the challenge is complete `POST /projects/:idOrName/domains/:domain/verify` to verify the domain. Possible challenges: - If `verification.type = TXT` the `verification.domain` will be checked for a TXT record matching `verification.value`. */ verification?: Array<Verification> | undefined; }; /** @internal */ export type GetProjectDomainRequest$Outbound = { idOrName: string; domain: string; teamId?: string | undefined; slug?: string | undefined; }; /** @internal */ export const GetProjectDomainRequest$outboundSchema: z.ZodType< GetProjectDomainRequest$Outbound, z.ZodTypeDef, GetProjectDomainRequest > = z.object({ idOrName: z.string(), domain: z.string(), teamId: z.string().optional(), slug: z.string().optional(), }); export function getProjectDomainRequestToJSON( getProjectDomainRequest: GetProjectDomainRequest, ): string { return JSON.stringify( GetProjectDomainRequest$outboundSchema.parse(getProjectDomainRequest), ); } /** @internal */ export const Verification$inboundSchema: z.ZodType< Verification, z.ZodTypeDef, unknown > = z.object({ type: types.string(), domain: types.string(), value: types.string(), reason: types.string(), }); export function verificationFromJSON( jsonString: string, ): SafeParseResult<Verification, SDKValidationError> { return safeParse( jsonString, (x) => Verification$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Verification' from JSON`, ); } /** @internal */ export const GetProjectDomainResponseBody$inboundSchema: z.ZodType< GetProjectDomainResponseBody, z.ZodTypeDef, unknown > = z.object({ name: types.string(), apexName: types.string(), projectId: types.string(), redirect: z.nullable(types.string()).optional(), redirectStatusCode: z.nullable(types.number()).optional(), gitBranch: z.nullable(types.string()).optional(), customEnvironmentId: z.nullable(types.string()).optional(), updatedAt: types.optional(types.number()), createdAt: types.optional(types.number()), verified: types.boolean(), verification: types.optional( z.array(z.lazy(() => Verification$inboundSchema)), ), }); export function getProjectDomainResponseBodyFromJSON( jsonString: string, ): SafeParseResult<GetProjectDomainResponseBody, SDKValidationError> { return safeParse( jsonString, (x) => GetProjectDomainResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectDomainResponseBody' from JSON`, ); }