@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>
288 lines • 14 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { projectsAcceptProjectTransferRequest } from "../funcs/projectsAcceptProjectTransferRequest.js";
import { projectsAddProjectDomain } from "../funcs/projectsAddProjectDomain.js";
import { projectsBatchRemoveProjectEnv } from "../funcs/projectsBatchRemoveProjectEnv.js";
import { projectsCreateProject } from "../funcs/projectsCreateProject.js";
import { projectsCreateProjectEnv } from "../funcs/projectsCreateProjectEnv.js";
import { projectsCreateProjectTransferRequest } from "../funcs/projectsCreateProjectTransferRequest.js";
import { projectsDeleteProject } from "../funcs/projectsDeleteProject.js";
import { projectsEditProjectEnv } from "../funcs/projectsEditProjectEnv.js";
import { projectsFilterProjectEnvs } from "../funcs/projectsFilterProjectEnvs.js";
import { projectsGetProjectDomain } from "../funcs/projectsGetProjectDomain.js";
import { projectsGetProjectDomains } from "../funcs/projectsGetProjectDomains.js";
import { projectsGetProjectEnv } from "../funcs/projectsGetProjectEnv.js";
import { projectsGetProjects } from "../funcs/projectsGetProjects.js";
import { projectsListPromoteAliases } from "../funcs/projectsListPromoteAliases.js";
import { projectsMoveProjectDomain } from "../funcs/projectsMoveProjectDomain.js";
import { projectsPauseProject } from "../funcs/projectsPauseProject.js";
import { projectsRemoveProjectDomain } from "../funcs/projectsRemoveProjectDomain.js";
import { projectsRemoveProjectEnv } from "../funcs/projectsRemoveProjectEnv.js";
import { projectsRequestPromote } from "../funcs/projectsRequestPromote.js";
import { projectsRequestRollback } from "../funcs/projectsRequestRollback.js";
import { projectsUnpauseProject } from "../funcs/projectsUnpauseProject.js";
import { projectsUpdateMicrofrontends } from "../funcs/projectsUpdateMicrofrontends.js";
import { projectsUpdateProject } from "../funcs/projectsUpdateProject.js";
import { projectsUpdateProjectDomain } from "../funcs/projectsUpdateProjectDomain.js";
import { projectsUpdateProjectProtectionBypass } from "../funcs/projectsUpdateProjectProtectionBypass.js";
import { projectsUpdateProjectsByProjectIdRollbackByDeploymentIdUpdateDescription } from "../funcs/projectsUpdateProjectsByProjectIdRollbackByDeploymentIdUpdateDescription.js";
import { projectsUploadProjectAvatar } from "../funcs/projectsUploadProjectAvatar.js";
import { projectsVerifyProjectDomain } from "../funcs/projectsVerifyProjectDomain.js";
import { ClientSDK } from "../lib/sdks.js";
import { unwrapAsync } from "../types/fp.js";
export class Projects extends ClientSDK {
/**
* Retrieve a list of projects
*
* @remarks
* Allows to retrieve the list of projects of the authenticated user or team. The list will be paginated and the provided query parameters allow filtering the returned projects.
*/
async getProjects(request, options) {
return unwrapAsync(projectsGetProjects(this, request, options));
}
/**
* Create a new project
*
* @remarks
* Allows to create a new project with the provided configuration. It only requires the project `name` but more configuration can be provided to override the defaults.
*/
async createProject(request, options) {
return unwrapAsync(projectsCreateProject(this, request, options));
}
/**
* Update an existing project
*
* @remarks
* Update the fields of a project using either its `name` or `id`.
*/
async updateProject(request, options) {
return unwrapAsync(projectsUpdateProject(this, request, options));
}
/**
* Delete a Project
*
* @remarks
* Delete a specific project by passing either the project `id` or `name` in the URL.
*/
async deleteProject(request, options) {
return unwrapAsync(projectsDeleteProject(this, request, options));
}
/**
* Upload a project avatar
*
* @remarks
* Upload an image as the avatar of the project identified by `idOrName`. The request body is the raw bytes of a JPG, PNG, or SVG image; the `Content-Type` header must declare which. SVG payloads are sanitized and optimized server-side before storage. The final SHA-1 of the stored bytes becomes the project's `avatar` value. The actual upload pipeline (validation, sanitization, S3 write, conditional `updateProject`, and event emission) lives in the shared `@api/project-avatar-upload` helper so it can be reused by background workers.
*/
async uploadProjectAvatar(request, options) {
return unwrapAsync(projectsUploadProjectAvatar(this, request, options));
}
/**
* Retrieve project domains by project by id or name
*
* @remarks
* Retrieve the domains associated with a given project by passing either the project `id` or `name` in the URL.
*/
async getProjectDomains(request, options) {
return unwrapAsync(projectsGetProjectDomains(this, request, options));
}
/**
* Get a project domain
*
* @remarks
* Get project domain by project id/name and domain name.
*/
async getProjectDomain(request, options) {
return unwrapAsync(projectsGetProjectDomain(this, request, options));
}
/**
* Update a project domain
*
* @remarks
* Update a project domain's configuration, including the name, git branch and redirect of the domain.
*/
async updateProjectDomain(request, options) {
return unwrapAsync(projectsUpdateProjectDomain(this, request, options));
}
/**
* Remove a domain from a project
*
* @remarks
* Remove a domain from a project by passing the domain name and by specifying the project by either passing the project `id` or `name` in the URL.
*/
async removeProjectDomain(request, options) {
return unwrapAsync(projectsRemoveProjectDomain(this, request, options));
}
/**
* Add a domain to a project
*
* @remarks
* Add a domain to the project by passing its domain name and by specifying the project by either passing the project `id` or `name` in the URL. If the domain is not yet verified to be used on this project, the request will return `verified = false`, and the domain will need to be verified according to the `verification` challenge via `POST /projects/:idOrName/domains/:domain/verify`. If the domain already exists on the project, the request will fail with a `400` status code.
*/
async addProjectDomain(request, options) {
return unwrapAsync(projectsAddProjectDomain(this, request, options));
}
/**
* Move a project domain
*
* @remarks
* Move one project's domain to another project. Also allows the move of all redirects pointed to that domain in the same project.
*/
async moveProjectDomain(request, options) {
return unwrapAsync(projectsMoveProjectDomain(this, request, options));
}
/**
* Verify project domain
*
* @remarks
* Attempts to verify a project domain with `verified = false` by checking the correctness of the project domain's `verification` challenge.
*/
async verifyProjectDomain(request, options) {
return unwrapAsync(projectsVerifyProjectDomain(this, request, options));
}
/**
* Retrieve the environment variables of a project by id or name
*
* @remarks
* Retrieve the environment variables for a given project by passing either the project `id` or `name` in the URL.
*/
async filterProjectEnvs(request, options) {
return unwrapAsync(projectsFilterProjectEnvs(this, request, options));
}
/**
* Create one or more environment variables
*
* @remarks
* Create one or more environment variables for a project by passing its `key`, `value`, `type` and `target` and by specifying the project by either passing the project `id` or `name` in the URL. If you include `upsert=true` as a query parameter, a new environment variable will not be created if it already exists but, the existing variable's value will be updated.
*/
async createProjectEnv(request, options) {
return unwrapAsync(projectsCreateProjectEnv(this, request, options));
}
/**
* Retrieve the decrypted value of an environment variable of a project by id
*
* @remarks
* Retrieve the environment variable for a given project.
*/
async getProjectEnv(request, options) {
return unwrapAsync(projectsGetProjectEnv(this, request, options));
}
/**
* Remove an environment variable
*
* @remarks
* Delete a specific environment variable for a given project by passing the environment variable identifier and either passing the project `id` or `name` in the URL.
*/
async removeProjectEnv(request, options) {
return unwrapAsync(projectsRemoveProjectEnv(this, request, options));
}
/**
* Edit an environment variable
*
* @remarks
* Edit a specific environment variable for a given project by passing the environment variable identifier and either passing the project `id` or `name` in the URL.
*/
async editProjectEnv(request, options) {
return unwrapAsync(projectsEditProjectEnv(this, request, options));
}
/**
* Batch remove environment variables
*
* @remarks
* Delete multiple environment variables for a given project in a single batch operation.
*/
async batchRemoveProjectEnv(request, options) {
return unwrapAsync(projectsBatchRemoveProjectEnv(this, request, options));
}
/**
* Create project transfer request
*
* @remarks
* Initiates a project transfer request from one team to another. <br/> Returns a `code` that remains valid for 24 hours and can be used to accept the transfer request by another team using the `PUT /projects/transfer-request/:code` endpoint. <br/> Users can also accept the project transfer request using the claim URL: `https://vercel.com/claim-deployment?code=<code>&returnUrl=<returnUrl>`. <br/> The `code` parameter specifies the project transfer request code generated using this endpoint. <br/> The `returnUrl` parameter redirects users to a specific page of the application if the claim URL is invalid or expired.
*/
async createProjectTransferRequest(request, options) {
return unwrapAsync(projectsCreateProjectTransferRequest(this, request, options));
}
/**
* Accept project transfer request
*
* @remarks
* Accept a project transfer request initated by another team. <br/> The `code` is generated using the `POST /projects/:idOrName/transfer-request` endpoint.
*/
async acceptProjectTransferRequest(request, options) {
return unwrapAsync(projectsAcceptProjectTransferRequest(this, request, options));
}
/**
* Update Protection Bypass for Automation
*
* @remarks
* Update the deployment protection automation bypass for a project
*/
async updateProjectProtectionBypass(request, options) {
return unwrapAsync(projectsUpdateProjectProtectionBypass(this, request, options));
}
/**
* Point production traffic to a previous production deployment by ID
*
* @remarks
* Allows users to rollback to a deployment.
*/
async requestRollback(request, options) {
return unwrapAsync(projectsRequestRollback(this, request, options));
}
/**
* Updates the description for a rollback
*
* @remarks
* Updates the reason for a rollback, without changing the rollback status itself.
*/
async updateProjectsByProjectIdRollbackByDeploymentIdUpdateDescription(request, options) {
return unwrapAsync(projectsUpdateProjectsByProjectIdRollbackByDeploymentIdUpdateDescription(this, request, options));
}
/**
* Update the microfrontends settings
*
* @remarks
* Update the microfrontends settings for a project.
*/
async updateMicrofrontends(request, options) {
return unwrapAsync(projectsUpdateMicrofrontends(this, request, options));
}
/**
* Point production traffic to a given deployment
*
* @remarks
* Allows users to promote a deployment to production. Note: This does NOT rebuild the deployment. If you need that, then call create-deployments endpoint.
*/
async requestPromote(request, options) {
return unwrapAsync(projectsRequestPromote(this, request, options));
}
/**
* Gets a list of aliases with status for the current promote
*
* @remarks
* Get a list of aliases related to the last promote request with their mapping status
*/
async listPromoteAliases(request, options) {
return unwrapAsync(projectsListPromoteAliases(this, request, options));
}
/**
* Pause a project
*
* @remarks
* Pause a project by passing its project `id` in the URL. If the project does not exist given the id then the request will fail with 400 status code. If the project disables auto assigning custom production domains and blocks the active Production Deployment then the request will return with 200 status code.
*/
async pauseProject(request, options) {
return unwrapAsync(projectsPauseProject(this, request, options));
}
/**
* Unpause a project
*
* @remarks
* Unpause a project by passing its project `id` in the URL. If the project does not exist given the id then the request will fail with 400 status code. If the project enables auto assigning custom production domains and unblocks the active Production Deployment then the request will return with 200 status code.
*/
async unpauseProject(request, options) {
return unwrapAsync(projectsUnpauseProject(this, request, options));
}
}
//# sourceMappingURL=projects.js.map