Skip to content

Latest commit

 

History

History
896 lines (669 loc) · 68.4 KB

README.md

File metadata and controls

896 lines (669 loc) · 68.4 KB

Connect

Overview

Available Operations

listConnectors

List connectors that belong to a team.

Example Usage

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

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

async function run() {
  const result = await vercel.connect.listConnectors({
    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 { connectListConnectors } from "@vercel/sdk/funcs/connectListConnectors.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 connectListConnectors(vercel, {
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("connectListConnectors failed:", res.error);
  }
}

run();

Parameters

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

Errors

Error Type Status Code Content Type
models.ConnectError 400, 401, 403, 404, 409, 410, 422 application/json
models.SDKError 4XX, 5XX */*

getConnector

Get the connector by ID. Accepts a dashboard/team requester or a deployment's project OIDC token; project requesters may only read connectors linked to their project and environment.

Example Usage

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

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

async function run() {
  const result = await vercel.connect.getConnector({
    connector: "<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 { connectGetConnector } from "@vercel/sdk/funcs/connectGetConnector.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 connectGetConnector(vercel, {
    connector: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("connectGetConnector failed:", res.error);
  }
}

run();

Parameters

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

Errors

Error Type Status Code Content Type
models.ConnectError 400, 401, 403, 404, 409, 410, 422 application/json
models.SDKError 4XX, 5XX */*

deleteConnector

Delete a connector, its project connections, and its installation records.

Example Usage

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

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

async function run() {
  await vercel.connect.deleteConnector({
    connector: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });


}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { connectDeleteConnector } from "@vercel/sdk/funcs/connectDeleteConnector.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 connectDeleteConnector(vercel, {
    connector: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    
  } else {
    console.log("connectDeleteConnector failed:", res.error);
  }
}

run();

Parameters

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

Errors

Error Type Status Code Content Type
models.ConnectError 400, 401, 403, 404, 409, 410, 422 application/json
models.ConnectError 502 application/json
models.SDKError 4XX, 5XX */*

updateConnector

Update a connector and return the connector with any service-side update signals that the caller must handle.

Example Usage

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

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

async function run() {
  const result = await vercel.connect.updateConnector({
    connector: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
    connectUpdateConnectorRequest: {},
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { connectUpdateConnector } from "@vercel/sdk/funcs/connectUpdateConnector.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 connectUpdateConnector(vercel, {
    connector: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
    connectUpdateConnectorRequest: {},
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("connectUpdateConnector failed:", res.error);
  }
}

run();

Parameters

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

Errors

Error Type Status Code Content Type
models.ConnectError 400, 401, 403, 404, 409, 410, 422 application/json
models.ConnectError 500, 502 application/json
models.SDKError 4XX, 5XX */*

replaceConnectorTriggerDestinations

Replace the full set of destinations that receive trigger requests for a connector.

Example Usage

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

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

async function run() {
  const result = await vercel.connect.replaceConnectorTriggerDestinations({
    connector: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
    connectReplaceTriggerDestinationsRequest: {
      destinations: [],
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { connectReplaceConnectorTriggerDestinations } from "@vercel/sdk/funcs/connectReplaceConnectorTriggerDestinations.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 connectReplaceConnectorTriggerDestinations(vercel, {
    connector: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
    connectReplaceTriggerDestinationsRequest: {
      destinations: [],
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("connectReplaceConnectorTriggerDestinations failed:", res.error);
  }
}

run();

Parameters

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

Errors

Error Type Status Code Content Type
models.ConnectError 400, 401, 403, 404, 409, 410, 422 application/json
models.SDKError 4XX, 5XX */*

ejectManagedConnector

Disconnect a managed connector from its provider-side manager.

Example Usage

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

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

async function run() {
  const result = await vercel.connect.ejectManagedConnector({
    connector: "<value>",
    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 { connectEjectManagedConnector } from "@vercel/sdk/funcs/connectEjectManagedConnector.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 connectEjectManagedConnector(vercel, {
    connector: "<value>",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("connectEjectManagedConnector failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

listConnectorProjectConnections

List the projects connected to a connector and the environments where each connection is available.

Example Usage

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

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

async function run() {
  const result = await vercel.connect.listConnectorProjectConnections({
    connector: "<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 { connectListConnectorProjectConnections } from "@vercel/sdk/funcs/connectListConnectorProjectConnections.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 connectListConnectorProjectConnections(vercel, {
    connector: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("connectListConnectorProjectConnections failed:", res.error);
  }
}

run();

Parameters

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

Errors

Error Type Status Code Content Type
models.ConnectError 400, 401, 403, 404, 409, 410 application/json
models.SDKError 4XX, 5XX */*

getConnectorProjectConnection

Get the configuration that connects a connector to 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.connect.getConnectorProjectConnection({
    connector: "<value>",
    projectId: "<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 { connectGetConnectorProjectConnection } from "@vercel/sdk/funcs/connectGetConnectorProjectConnection.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 connectGetConnectorProjectConnection(vercel, {
    connector: "<value>",
    projectId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("connectGetConnectorProjectConnection failed:", res.error);
  }
}

run();

Parameters

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

Errors

Error Type Status Code Content Type
models.ConnectError 400, 401, 403, 404, 409, 410 application/json
models.SDKError 4XX, 5XX */*

upsertConnectorProjectConnection

Connect a connector to a project, or replace the environments on an existing project connection.

Example Usage

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

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

async function run() {
  const result = await vercel.connect.upsertConnectorProjectConnection({
    connector: "<value>",
    projectId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
    connectUpsertProjectConnectionRequest: {
      environments: [
        "<value>",
      ],
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { connectUpsertConnectorProjectConnection } from "@vercel/sdk/funcs/connectUpsertConnectorProjectConnection.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 connectUpsertConnectorProjectConnection(vercel, {
    connector: "<value>",
    projectId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
    connectUpsertProjectConnectionRequest: {
      environments: [
        "<value>",
      ],
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("connectUpsertConnectorProjectConnection failed:", res.error);
  }
}

run();

Parameters

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

Errors

Error Type Status Code Content Type
models.ConnectError 400, 401, 403, 404, 409, 410 application/json
models.SDKError 4XX, 5XX */*

deleteConnectorProjectConnection

Disconnect a connector from a project.

Example Usage

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

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

async function run() {
  await vercel.connect.deleteConnectorProjectConnection({
    connector: "<value>",
    projectId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });


}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { connectDeleteConnectorProjectConnection } from "@vercel/sdk/funcs/connectDeleteConnectorProjectConnection.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 connectDeleteConnectorProjectConnection(vercel, {
    connector: "<value>",
    projectId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    
  } else {
    console.log("connectDeleteConnectorProjectConnection failed:", res.error);
  }
}

run();

Parameters

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

Errors

Error Type Status Code Content Type
models.ConnectError 400, 401, 403, 404, 409, 410 application/json
models.SDKError 4XX, 5XX */*

listProjectConnectorConnections

List the connectors connected to a project and the environments where each connection is available.

Example Usage

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

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

async function run() {
  const result = await vercel.connect.listProjectConnectorConnections({
    projectId: "<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 { connectListProjectConnectorConnections } from "@vercel/sdk/funcs/connectListProjectConnectorConnections.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 connectListProjectConnectorConnections(vercel, {
    projectId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("connectListProjectConnectorConnections failed:", res.error);
  }
}

run();

Parameters

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

Errors

Error Type Status Code Content Type
models.ConnectError 400, 401, 403, 404, 410 application/json
models.SDKError 4XX, 5XX */*