@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>
88 lines • 4.05 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { projectRoutesAddRoute } from "../funcs/projectRoutesAddRoute.js";
import { projectRoutesDeleteRoutes } from "../funcs/projectRoutesDeleteRoutes.js";
import { projectRoutesEditRoute } from "../funcs/projectRoutesEditRoute.js";
import { projectRoutesGenerateRoute } from "../funcs/projectRoutesGenerateRoute.js";
import { projectRoutesGetRoutes } from "../funcs/projectRoutesGetRoutes.js";
import { projectRoutesGetRouteVersions } from "../funcs/projectRoutesGetRouteVersions.js";
import { projectRoutesStageRoutes } from "../funcs/projectRoutesStageRoutes.js";
import { projectRoutesUpdateRouteVersions } from "../funcs/projectRoutesUpdateRouteVersions.js";
import { ClientSDK } from "../lib/sdks.js";
import { unwrapAsync } from "../types/fp.js";
export class ProjectRoutes extends ClientSDK {
/**
* Get project routing rules
*
* @remarks
* Get the routing rules for a project. Supports searching by name/ID/pattern, filtering by route type, and diffing staged changes against production.
*/
async getRoutes(request, options) {
return unwrapAsync(projectRoutesGetRoutes(this, request, options));
}
/**
* Stage routing rules
*
* @remarks
* Stage routing rules for a project. Set `overwrite` to true to replace all existing rules, or omit it to merge with existing rules by ID. Returns the new staged version.
*/
async stageRoutes(request, options) {
return unwrapAsync(projectRoutesStageRoutes(this, request, options));
}
/**
* Add a routing rule
*
* @remarks
* Add a single routing rule to a project at a specified position. Defaults to the end of the list if no position is provided. The route is enabled by default. Stages a new version with the added route.
*/
async addRoute(request, options) {
return unwrapAsync(projectRoutesAddRoute(this, request, options));
}
/**
* Delete routing rules
*
* @remarks
* Delete one or more routing rules from a project by ID. Stages a new version with the routes removed.
*/
async deleteRoutes(request, options) {
return unwrapAsync(projectRoutesDeleteRoutes(this, request, options));
}
/**
* Edit a routing rule
*
* @remarks
* Replace a routing rule identified by its ID, or restore it from the current production version. Stages a new version with the modified route.
*/
async editRoute(request, options) {
return unwrapAsync(projectRoutesEditRoute(this, request, options));
}
/**
* Generate a routing rule from natural language
*
* @remarks
* Generate a routing rule configuration from a natural language description. Returns a suggested route configuration that can be reviewed and saved.
*/
async generateRoute(request, options) {
return unwrapAsync(projectRoutesGenerateRoute(this, request, options));
}
/**
* Get routing rule version history
*
* @remarks
* Get the version history for a project's routing rules. Returns the staging version (if one exists) followed by production versions, most recent first. The staging version has `isStaging: true` and the current production version has `isLive: true`.
*/
async getRouteVersions(request, options) {
return unwrapAsync(projectRoutesGetRouteVersions(this, request, options));
}
/**
* Promote, restore, or discard a routing rule version
*
* @remarks
* Promote staged routing rules to production, restore a previous production version, or discard staged changes. - `promote`: Publishes the staging version to production. - `restore`: Rolls back to a previous production version. - `discard`: Removes the staging version without publishing.
*/
async updateRouteVersions(request, options) {
return unwrapAsync(projectRoutesUpdateRouteVersions(this, request, options));
}
}
//# sourceMappingURL=projectroutes.js.map