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>

207 lines (196 loc) 6.68 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { domainsClaimDomainOwnership } from "../funcs/domainsClaimDomainOwnership.js"; import { domainsCreateOrTransferDomain } from "../funcs/domainsCreateOrTransferDomain.js"; import { domainsDeleteDomain } from "../funcs/domainsDeleteDomain.js"; import { domainsGetDomain } from "../funcs/domainsGetDomain.js"; import { domainsGetDomainConfig } from "../funcs/domainsGetDomainConfig.js"; import { domainsGetDomainProjectDomains } from "../funcs/domainsGetDomainProjectDomains.js"; import { domainsGetDomains } from "../funcs/domainsGetDomains.js"; import { domainsGetDomainVerificationRecord } from "../funcs/domainsGetDomainVerificationRecord.js"; import { domainsPatchDomain } from "../funcs/domainsPatchDomain.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { ClaimDomainOwnershipRequest, ClaimDomainOwnershipResponseBody, } from "../models/claimdomainownershipop.js"; import { CreateOrTransferDomainRequest, CreateOrTransferDomainResponseBody, } from "../models/createortransferdomainop.js"; import { DeleteDomainRequest, DeleteDomainResponseBody, } from "../models/deletedomainop.js"; import { GetDomainConfigRequest, GetDomainConfigResponseBody, } from "../models/getdomainconfigop.js"; import { GetDomainRequest, GetDomainResponseBody, } from "../models/getdomainop.js"; import { GetDomainProjectDomainsRequest, GetDomainProjectDomainsResponseBody, } from "../models/getdomainprojectdomainsop.js"; import { GetDomainsRequest, GetDomainsResponseBody, } from "../models/getdomainsop.js"; import { GetDomainVerificationRecordRequest, GetDomainVerificationRecordResponseBody, } from "../models/getdomainverificationrecordop.js"; import { PatchDomainRequest, PatchDomainResponseBody, } from "../models/patchdomainop.js"; import { unwrapAsync } from "../types/fp.js"; export class Domains extends ClientSDK { /** * Get a Domain's configuration * * @remarks * Get a Domain's configuration. */ async getDomainConfig( request: GetDomainConfigRequest, options?: RequestOptions, ): Promise<GetDomainConfigResponseBody> { return unwrapAsync(domainsGetDomainConfig( this, request, options, )); } /** * Get Domain Verification Record * * @remarks * Get the TXT verification record needed to claim ownership of a domain for the authenticated team. The caller must add this TXT record to `_vercel.{domain}` in their DNS configuration, then call POST /domains/:domain/claim to complete the ownership transfer. */ async getDomainVerificationRecord( request: GetDomainVerificationRecordRequest, options?: RequestOptions, ): Promise<GetDomainVerificationRecordResponseBody> { return unwrapAsync(domainsGetDomainVerificationRecord( this, request, options, )); } /** * Claim Domain Ownership * * @remarks * Claim ownership of a domain for the authenticated team by verifying a TXT record. The caller must first add a TXT record to `_vercel.{domain}` (obtained from GET /domains/:domain/verification), then call this endpoint to complete the ownership transfer. If the TXT record is verified, the domain ownership will be transferred to the caller's team, even if the domain is currently owned by another user or team. */ async claimDomainOwnership( request: ClaimDomainOwnershipRequest, options?: RequestOptions, ): Promise<ClaimDomainOwnershipResponseBody> { return unwrapAsync(domainsClaimDomainOwnership( this, request, options, )); } /** * List Project Domains by Apex Domain * * @remarks * List all project domains associated with an apex domain owned by the authenticated account. */ async getDomainProjectDomains( request: GetDomainProjectDomainsRequest, options?: RequestOptions, ): Promise<GetDomainProjectDomainsResponseBody> { return unwrapAsync(domainsGetDomainProjectDomains( this, request, options, )); } /** * Get Information for a Single Domain * * @remarks * Get information for a single domain in an account or team. */ async getDomain( request: GetDomainRequest, options?: RequestOptions, ): Promise<GetDomainResponseBody> { return unwrapAsync(domainsGetDomain( this, request, options, )); } /** * List all the domains * * @remarks * Retrieves a list of domains registered for the authenticated user or team. By default it returns the last 20 domains if no limit is provided. */ async getDomains( request: GetDomainsRequest, options?: RequestOptions, ): Promise<GetDomainsResponseBody> { return unwrapAsync(domainsGetDomains( this, request, options, )); } /** * Add an existing domain to the Vercel platform * * @remarks * This endpoint is used for adding a new apex domain name with Vercel for the authenticating user. Note: This endpoint is no longer used for initiating domain transfers from external registrars to Vercel. For this, please use the endpoint [Transfer-in a domain](https://vercel.com/docs/rest-api/reference/endpoints/domains-registrar/transfer-in-a-domain). */ async createOrTransferDomain( request: CreateOrTransferDomainRequest, options?: RequestOptions, ): Promise<CreateOrTransferDomainResponseBody> { return unwrapAsync(domainsCreateOrTransferDomain( this, request, options, )); } /** * Update or move apex domain * * @remarks * Update or move apex domain. Note: This endpoint is no longer used for updating auto-renew or nameservers. For this, please use the endpoints [Update auto-renew for a domain](https://vercel.com/docs/rest-api/reference/endpoints/domains-registrar/update-auto-renew-for-a-domain) and [Update nameservers for a domain](https://vercel.com/docs/rest-api/reference/endpoints/domains-registrar/update-nameservers-for-a-domain). */ async patchDomain( request: PatchDomainRequest, options?: RequestOptions, ): Promise<PatchDomainResponseBody> { return unwrapAsync(domainsPatchDomain( this, request, options, )); } /** * Remove a domain by name * * @remarks * Delete a previously registered domain name from Vercel. Deleting a domain will automatically remove any associated aliases. */ async deleteDomain( request: DeleteDomainRequest, options?: RequestOptions, ): Promise<DeleteDomainResponseBody> { return unwrapAsync(domainsDeleteDomain( this, request, options, )); } }