Skip to content

Latest commit

 

History

History
1416 lines (1093 loc) · 98.2 KB

File metadata and controls

1416 lines (1093 loc) · 98.2 KB

Teams

Overview

Available Operations

getTeamMembers

Get a paginated list of team members for the provided team.

Example Usage

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

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

async function run() {
  const result = await vercel.teams.getTeamMembers({
    limit: 20,
    since: 1540095775951,
    until: 1540095775951,
    role: "OWNER",
    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 { teamsGetTeamMembers } from "@vercel/sdk/funcs/teamsGetTeamMembers.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 teamsGetTeamMembers(vercel, {
    limit: 20,
    since: 1540095775951,
    until: 1540095775951,
    role: "OWNER",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("teamsGetTeamMembers failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

inviteUserToTeam

Invite a user to join the team specified in the URL. The authenticated user needs to be an OWNER in order to successfully invoke this endpoint. The user to be invited must be specified by email.

Example Usage

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

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

async function run() {
  const result = await vercel.teams.inviteUserToTeam({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
    requestBody: [
      {
        email: "john@example.com",
        role: "DEVELOPER",
        projects: [
          {
            projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
            role: "ADMIN",
          },
          {
            projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
            role: "ADMIN",
          },
        ],
      },
    ],
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { teamsInviteUserToTeam } from "@vercel/sdk/funcs/teamsInviteUserToTeam.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 teamsInviteUserToTeam(vercel, {
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
    requestBody: [
      {
        email: "john@example.com",
        role: "DEVELOPER",
        projects: [
          {
            projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
            role: "ADMIN",
          },
          {
            projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
            role: "ADMIN",
          },
        ],
      },
    ],
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("teamsInviteUserToTeam failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

requestAccessToTeam

Request access to a team as a member. An owner has to approve the request. Only 10 users can request access to a team at the same time.

Example Usage

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

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

async function run() {
  const result = await vercel.teams.requestAccessToTeam({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    requestBody: {
      joinedFrom: {
        origin: "github",
        commitId: "f498d25d8bd654b578716203be73084b31130cd7",
        repoId: "67753070",
        repoPath: "jane-doe/example",
        gitUserId: 103053343,
        gitUserLogin: "jane-doe",
      },
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { teamsRequestAccessToTeam } from "@vercel/sdk/funcs/teamsRequestAccessToTeam.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 teamsRequestAccessToTeam(vercel, {
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    requestBody: {
      joinedFrom: {
        origin: "github",
        commitId: "f498d25d8bd654b578716203be73084b31130cd7",
        repoId: "67753070",
        repoPath: "jane-doe/example",
        gitUserId: 103053343,
        gitUserLogin: "jane-doe",
      },
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("teamsRequestAccessToTeam failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

getTeamAccessRequest

Check the status of a join request. It'll respond with a 404 if the request has been declined. If no userId path segment was provided, this endpoint will instead return the status of the authenticated user.

Example Usage

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

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

async function run() {
  const result = await vercel.teams.getTeamAccessRequest({
    userId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

run();

Parameters

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

Errors

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

joinTeam

Join a team with a provided invite code or team ID.

Example Usage

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

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

async function run() {
  const result = await vercel.teams.joinTeam({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    requestBody: {
      inviteCode: "fisdh38aejkeivn34nslfore9vjtn4ls",
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

run();

Parameters

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

Errors

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

updateTeamMember

Update the membership of a Team Member on the Team specified by teamId, such as changing the role of the member, or confirming a request to join the Team for an unconfirmed member. The authenticated user must be an OWNER of the Team.

Example Usage

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

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

async function run() {
  const result = await vercel.teams.updateTeamMember({
    uid: "ndfasllgPyCtREAqxxdyFKb",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    requestBody: {
      role: "VIEWER",
      teamPermissions: [
        "CreateProject",
        "FullProductionDeployment",
      ],
      projects: [
        {
          projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
          role: "ADMIN",
        },
        {
          projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
          role: "ADMIN",
        },
        {
          projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
          role: "ADMIN",
        },
      ],
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { teamsUpdateTeamMember } from "@vercel/sdk/funcs/teamsUpdateTeamMember.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 teamsUpdateTeamMember(vercel, {
    uid: "ndfasllgPyCtREAqxxdyFKb",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    requestBody: {
      role: "VIEWER",
      teamPermissions: [
        "CreateProject",
        "FullProductionDeployment",
      ],
      projects: [
        {
          projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
          role: "ADMIN",
        },
        {
          projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
          role: "ADMIN",
        },
        {
          projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
          role: "ADMIN",
        },
      ],
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("teamsUpdateTeamMember failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

removeTeamMember

Remove a Team Member from the Team, or dismiss a user that requested access, or leave 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.teams.removeTeamMember({
    uid: "ndlgr43fadlPyCtREAqxxdyFK",
    newDefaultTeamId: "team_nllPyCtREAqxxdyFKbbMDlxd",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { teamsRemoveTeamMember } from "@vercel/sdk/funcs/teamsRemoveTeamMember.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 teamsRemoveTeamMember(vercel, {
    uid: "ndlgr43fadlPyCtREAqxxdyFK",
    newDefaultTeamId: "team_nllPyCtREAqxxdyFKbbMDlxd",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("teamsRemoveTeamMember failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

getTeam

Get information for the Team specified by the teamId parameter.

Example Usage

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

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

async function run() {
  const result = await vercel.teams.getTeam({
    slug: "my-team-url-slug",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

run();

Parameters

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

Errors

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

patchTeam

Update the information of a Team specified by the teamId parameter. The request body should contain the information that will be updated on the Team.

Example Usage

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

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

async function run() {
  const result = await vercel.teams.patchTeam({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
    requestBody: {
      description: "Our mission is to make cloud computing accessible to everyone",
      emailDomain: "example.com",
      name: "My Team",
      previewDeploymentSuffix: "example.dev",
      regenerateInviteCode: true,
      saml: {
        enforced: true,
      },
      slug: "my-team",
      enablePreviewFeedback: "on",
      enableProductionFeedback: "on",
      sensitiveEnvironmentVariablePolicy: "on",
      remoteCaching: {
        enabled: true,
      },
      hideIpAddresses: false,
      hideIpAddressesInLogDrains: false,
      defaultExpirationSettings: {
        expiration: "1y",
        expirationProduction: "1y",
        expirationCanceled: "1y",
        expirationErrored: "1y",
      },
      strictDeploymentProtectionSettings: {
        enabled: true,
      },
      strictShareableLinks: {
        enabled: true,
      },
      resourceConfig: {
        buildMachine: {
          default: "standard",
        },
      },
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { teamsPatchTeam } from "@vercel/sdk/funcs/teamsPatchTeam.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 teamsPatchTeam(vercel, {
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
    requestBody: {
      description: "Our mission is to make cloud computing accessible to everyone",
      emailDomain: "example.com",
      name: "My Team",
      previewDeploymentSuffix: "example.dev",
      regenerateInviteCode: true,
      saml: {
        enforced: true,
      },
      slug: "my-team",
      enablePreviewFeedback: "on",
      enableProductionFeedback: "on",
      sensitiveEnvironmentVariablePolicy: "on",
      remoteCaching: {
        enabled: true,
      },
      hideIpAddresses: false,
      hideIpAddressesInLogDrains: false,
      defaultExpirationSettings: {
        expiration: "1y",
        expirationProduction: "1y",
        expirationCanceled: "1y",
        expirationErrored: "1y",
      },
      strictDeploymentProtectionSettings: {
        enabled: true,
      },
      strictShareableLinks: {
        enabled: true,
      },
      resourceConfig: {
        buildMachine: {
          default: "standard",
        },
      },
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("teamsPatchTeam failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

getTeams

Get a paginated list of all the Teams the authenticated User is a member of.

Example Usage

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

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

async function run() {
  const result = await vercel.teams.getTeams({
    limit: 20,
    since: 1540095775951,
    until: 1540095775951,
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { teamsGetTeams } from "@vercel/sdk/funcs/teamsGetTeams.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 teamsGetTeams(vercel, {
    limit: 20,
    since: 1540095775951,
    until: 1540095775951,
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("teamsGetTeams failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

createTeam

Create a new Team under your account. You need to send a POST request with the desired Team slug, and optionally the Team name.

Example Usage

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

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

async function run() {
  const result = await vercel.teams.createTeam({
    slug: "a-random-team",
    name: "A Random Team",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { teamsCreateTeam } from "@vercel/sdk/funcs/teamsCreateTeam.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 teamsCreateTeam(vercel, {
    slug: "a-random-team",
    name: "A Random Team",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("teamsCreateTeam failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

postTeamDsyncRoles

Update the Directory Sync role mappings for a Team. This endpoint allows updating the mapping between directory groups and team roles or access groups.

Example Usage

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

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

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

run();

Parameters

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

Errors

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

deleteTeam

Delete a team under your account. You need to send a DELETE request with the desired team id. An optional array of reasons for deletion may also be sent.

Example Usage

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

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

async function run() {
  const result = await vercel.teams.deleteTeam({
    newDefaultTeamId: "team_LLHUOMOoDlqOp8wPE4kFo9pE",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
    requestBody: {},
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

run();

Parameters

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

Errors

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

deleteTeamInviteCode

Delete an active Team invite code.

Example Usage

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

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

async function run() {
  const result = await vercel.teams.deleteTeamInviteCode({
    inviteId: "2wn2hudbr4chb1ecywo9dvzo7g9sscs6mzcz8htdde0txyom4l",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

run();

Parameters

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

Errors

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

updateMicrofrontendsGroup

Updates the name (and slug) of a microfrontends group.

Example Usage

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

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

async function run() {
  const result = await vercel.teams.updateMicrofrontendsGroup({
    groupId: "<id>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
    requestBody: {
      name: "MFE Group 1",
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

run();

Parameters

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

Errors

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

deleteMicrofrontendsGroup

Deletes a microfrontends group from the team associated with the group ID.

Example Usage

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

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

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

run();

Parameters

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

Errors

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