Skip to content

Latest commit

 

History

History
209 lines (136 loc) · 16.5 KB

README.md

File metadata and controls

209 lines (136 loc) · 16.5 KB

Vercel SDK

Overview

Vercel API: Vercel combines the best developer experience with an obsessive focus on end-user performance. Our platform enables frontend teams to do their best work.

Available Operations

listDeploymentBuilds

Retrieves the list of builds given their deployment's unique identifier. No longer listed as public API as of May 2023.

Example Usage

import { Vercel } from "@simplesagar/vercel";

const vercel = new Vercel();

async function run() {
  const result = await vercel.listDeploymentBuilds("<value>");
  
  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@simplesagar/vercel/core.js";
import { listDeploymentBuilds } from "@simplesagar/vercel/funcs/listDeploymentBuilds.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore();

async function run() {
  const res = await listDeploymentBuilds(vercel, "<value>");

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
deploymentId string ✔️ The deployment unique identifier
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ListDeploymentBuildsResponseBody>

Errors

Error Object Status Code Content Type
models.SDKError 4xx-5xx /

datacachePurgeall

Example Usage

import { Vercel } from "@simplesagar/vercel";

const vercel = new Vercel();

async function run() {
  await vercel.datacachePurgeall("<value>");
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@simplesagar/vercel/core.js";
import { datacachePurgeall } from "@simplesagar/vercel/funcs/datacachePurgeall.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore();

async function run() {
  const res = await datacachePurgeall(vercel, "<value>");

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description
projectIdOrName string ✔️ N/A
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Object Status Code Content Type
models.SDKError 4xx-5xx /

dataCacheBillingSettings

Example Usage

import { Vercel } from "@simplesagar/vercel";

const vercel = new Vercel();

async function run() {
  const result = await vercel.dataCacheBillingSettings();
  
  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@simplesagar/vercel/core.js";
import { dataCacheBillingSettings } from "@simplesagar/vercel/funcs/dataCacheBillingSettings.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore();

async function run() {
  const res = await dataCacheBillingSettings(vercel);

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request models.DataCacheBillingSettingsRequestBody ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.DataCacheBillingSettingsResponseBody>

Errors

Error Object Status Code Content Type
models.SDKError 4xx-5xx /