Skip to content

Latest commit

 

History

History
798 lines (595 loc) · 59.4 KB

File metadata and controls

798 lines (595 loc) · 59.4 KB

ChecksV2

Overview

Available Operations

listProjectChecks

List all checks for a project, optionally filtered by target.

Example Usage

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

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.checksV2.listProjectChecks({
    projectIdOrName: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { checksV2ListProjectChecks } from "@vercel/sdk/funcs/checksV2ListProjectChecks.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await checksV2ListProjectChecks(vercel, {
    projectIdOrName: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("checksV2ListProjectChecks failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.ListProjectChecksRequest ✔️ 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.ListProjectChecksResponseBody>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

createProjectCheck

Creates a new check for a project.

Example Usage

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

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.checksV2.createProjectCheck({
    projectIdOrName: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { checksV2CreateProjectCheck } from "@vercel/sdk/funcs/checksV2CreateProjectCheck.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await checksV2CreateProjectCheck(vercel, {
    projectIdOrName: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("checksV2CreateProjectCheck failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.CreateProjectCheckRequest ✔️ 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.CreateProjectCheckResponseBody>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

getProjectCheck

Return a detailed response for a single check.

Example Usage

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

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.checksV2.getProjectCheck({
    projectIdOrName: "<value>",
    checkId: "stf_89ha9sdhh9a9",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { checksV2GetProjectCheck } from "@vercel/sdk/funcs/checksV2GetProjectCheck.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await checksV2GetProjectCheck(vercel, {
    projectIdOrName: "<value>",
    checkId: "stf_89ha9sdhh9a9",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("checksV2GetProjectCheck failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.GetProjectCheckRequest ✔️ 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.GetProjectCheckResponseBody>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

updateProjectCheck

Update an existing check.

Example Usage

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

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.checksV2.updateProjectCheck({
    projectIdOrName: "<value>",
    checkId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { checksV2UpdateProjectCheck } from "@vercel/sdk/funcs/checksV2UpdateProjectCheck.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await checksV2UpdateProjectCheck(vercel, {
    projectIdOrName: "<value>",
    checkId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("checksV2UpdateProjectCheck failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.UpdateProjectCheckRequest ✔️ 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.UpdateProjectCheckResponseBody>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

deleteProjectCheck

Delete an existing check and all of its runs.

Example Usage

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

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.checksV2.deleteProjectCheck({
    projectIdOrName: "<value>",
    checkId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { checksV2DeleteProjectCheck } from "@vercel/sdk/funcs/checksV2DeleteProjectCheck.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await checksV2DeleteProjectCheck(vercel, {
    projectIdOrName: "<value>",
    checkId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("checksV2DeleteProjectCheck failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.DeleteProjectCheckRequest ✔️ 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.DeleteProjectCheckResponseBody>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

listCheckRuns

List all runs associated with a given check.

Example Usage

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

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.checksV2.listCheckRuns({
    projectIdOrName: "<value>",
    checkId: "ckr_89ha9sdhh9a9",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { checksV2ListCheckRuns } from "@vercel/sdk/funcs/checksV2ListCheckRuns.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await checksV2ListCheckRuns(vercel, {
    projectIdOrName: "<value>",
    checkId: "ckr_89ha9sdhh9a9",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("checksV2ListCheckRuns failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.ListCheckRunsRequest ✔️ 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.ListCheckRunsResponseBody>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

listDeploymentCheckRuns

List all check runs for a deployment.

Example Usage

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

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.checksV2.listDeploymentCheckRuns({
    deploymentId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { checksV2ListDeploymentCheckRuns } from "@vercel/sdk/funcs/checksV2ListDeploymentCheckRuns.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await checksV2ListDeploymentCheckRuns(vercel, {
    deploymentId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("checksV2ListDeploymentCheckRuns failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.ListDeploymentCheckRunsRequest ✔️ 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.ListDeploymentCheckRunsResponseBody>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

createDeploymentCheckRun

Creates a new check run for a deployment.

Example Usage

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

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.checksV2.createDeploymentCheckRun({
    deploymentId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { checksV2CreateDeploymentCheckRun } from "@vercel/sdk/funcs/checksV2CreateDeploymentCheckRun.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await checksV2CreateDeploymentCheckRun(vercel, {
    deploymentId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("checksV2CreateDeploymentCheckRun failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.CreateDeploymentCheckRunRequest ✔️ 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.CreateDeploymentCheckRunResponseBody>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

getDeploymentCheckRun

Return a detailed response for a single check run.

Example Usage

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

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.checksV2.getDeploymentCheckRun({
    deploymentId: "<id>",
    checkRunId: "ckr_89ha9sdhh9a9",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { checksV2GetDeploymentCheckRun } from "@vercel/sdk/funcs/checksV2GetDeploymentCheckRun.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await checksV2GetDeploymentCheckRun(vercel, {
    deploymentId: "<id>",
    checkRunId: "ckr_89ha9sdhh9a9",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("checksV2GetDeploymentCheckRun failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.GetDeploymentCheckRunRequest ✔️ 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.GetDeploymentCheckRunResponseBody>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

updateDeploymentCheckRun

Update an existing check run for a deployment.

Example Usage

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

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.checksV2.updateDeploymentCheckRun({
    deploymentId: "<id>",
    checkRunId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { checksV2UpdateDeploymentCheckRun } from "@vercel/sdk/funcs/checksV2UpdateDeploymentCheckRun.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await checksV2UpdateDeploymentCheckRun(vercel, {
    deploymentId: "<id>",
    checkRunId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("checksV2UpdateDeploymentCheckRun failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.UpdateDeploymentCheckRunRequest ✔️ 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.UpdateDeploymentCheckRunResponseBody>

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*