@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>
424 lines • 17.8 kB
TypeScript
import * as z from "zod/v3";
import { ClosedEnum } from "../types/enums.js";
import { Result as SafeParseResult } from "../types/fp.js";
import { SDKValidationError } from "./sdkvalidationerror.js";
export type StartRollingReleaseRequestBody = {
/**
* The ID of the canary deployment to start the rolling release for
*/
canaryDeploymentId: string;
};
export type StartRollingReleaseRequest = {
/**
* Project ID or project name (URL-encoded)
*/
idOrName: string;
/**
* The Team identifier to perform the request on behalf of.
*/
teamId?: string | undefined;
/**
* The Team slug to perform the request on behalf of.
*/
slug?: string | undefined;
requestBody?: StartRollingReleaseRequestBody | undefined;
};
/**
* The current state of the rolling release
*/
export declare const StartRollingReleaseState: {
readonly Aborted: "ABORTED";
readonly Active: "ACTIVE";
readonly Complete: "COMPLETE";
};
/**
* The current state of the rolling release
*/
export type StartRollingReleaseState = ClosedEnum<typeof StartRollingReleaseState>;
/**
* When set to `PAUSED`, the rollout is frozen at the current percentage until continued.
*/
export declare const StartRollingReleaseSubstate: {
readonly Paused: "PAUSED";
};
/**
* When set to `PAUSED`, the rollout is frozen at the current percentage until continued.
*/
export type StartRollingReleaseSubstate = ClosedEnum<typeof StartRollingReleaseSubstate>;
/**
* The state of the deployment depending on the process of deploying, or if it is ready or in an error state
*/
export declare const StartRollingReleaseReadyState: {
readonly Blocked: "BLOCKED";
readonly Building: "BUILDING";
readonly Canceled: "CANCELED";
readonly Error: "ERROR";
readonly Initializing: "INITIALIZING";
readonly Queued: "QUEUED";
readonly Ready: "READY";
};
/**
* The state of the deployment depending on the process of deploying, or if it is ready or in an error state
*/
export type StartRollingReleaseReadyState = ClosedEnum<typeof StartRollingReleaseReadyState>;
/**
* If defined, either `staging` if a staging alias in the format `<project>.<team>.now.sh` was assigned upon creation, or `production` if the aliases from `alias` were assigned. `null` value indicates the "preview" deployment.
*/
export declare const StartRollingReleaseTarget: {
readonly Production: "production";
readonly Staging: "staging";
};
/**
* If defined, either `staging` if a staging alias in the format `<project>.<team>.now.sh` was assigned upon creation, or `production` if the aliases from `alias` were assigned. `null` value indicates the "preview" deployment.
*/
export type StartRollingReleaseTarget = ClosedEnum<typeof StartRollingReleaseTarget>;
/**
* Where was the deployment created from. Best-effort guess for metrics only — not authoritative; do not gate behavior on it.
*/
export declare const StartRollingReleaseSource: {
readonly ApiTriggerGitDeploy: "api-trigger-git-deploy";
readonly Cli: "cli";
readonly CloneRepo: "clone/repo";
readonly Drop: "drop";
readonly Git: "git";
readonly GitDeployHook: "git-deploy-hook";
readonly Import: "import";
readonly ImportRepo: "import/repo";
readonly Redeploy: "redeploy";
readonly V0Web: "v0-web";
};
/**
* Where was the deployment created from. Best-effort guess for metrics only — not authoritative; do not gate behavior on it.
*/
export type StartRollingReleaseSource = ClosedEnum<typeof StartRollingReleaseSource>;
/**
* The current deployment receiving production traffic
*/
export type StartRollingReleaseCurrentDeployment = {
/**
* The name of the project associated with the deployment at the time that the deployment was created
*/
name: string;
/**
* A number containing the date when the deployment was created in milliseconds
*/
createdAt: number;
/**
* The state of the deployment depending on the process of deploying, or if it is ready or in an error state
*/
readyState: StartRollingReleaseReadyState;
/**
* A string holding the unique ID of the deployment
*/
id: string;
/**
* If defined, either `staging` if a staging alias in the format `<project>.<team>.now.sh` was assigned upon creation, or `production` if the aliases from `alias` were assigned. `null` value indicates the "preview" deployment.
*/
target?: StartRollingReleaseTarget | null | undefined;
readyStateAt?: number | undefined;
/**
* Where was the deployment created from. Best-effort guess for metrics only — not authoritative; do not gate behavior on it.
*/
source?: StartRollingReleaseSource | undefined;
/**
* A string with the unique URL of the deployment
*/
url: string;
};
/**
* The state of the deployment depending on the process of deploying, or if it is ready or in an error state
*/
export declare const StartRollingReleaseRollingReleaseReadyState: {
readonly Blocked: "BLOCKED";
readonly Building: "BUILDING";
readonly Canceled: "CANCELED";
readonly Error: "ERROR";
readonly Initializing: "INITIALIZING";
readonly Queued: "QUEUED";
readonly Ready: "READY";
};
/**
* The state of the deployment depending on the process of deploying, or if it is ready or in an error state
*/
export type StartRollingReleaseRollingReleaseReadyState = ClosedEnum<typeof StartRollingReleaseRollingReleaseReadyState>;
/**
* If defined, either `staging` if a staging alias in the format `<project>.<team>.now.sh` was assigned upon creation, or `production` if the aliases from `alias` were assigned. `null` value indicates the "preview" deployment.
*/
export declare const StartRollingReleaseRollingReleaseTarget: {
readonly Production: "production";
readonly Staging: "staging";
};
/**
* If defined, either `staging` if a staging alias in the format `<project>.<team>.now.sh` was assigned upon creation, or `production` if the aliases from `alias` were assigned. `null` value indicates the "preview" deployment.
*/
export type StartRollingReleaseRollingReleaseTarget = ClosedEnum<typeof StartRollingReleaseRollingReleaseTarget>;
/**
* Where was the deployment created from. Best-effort guess for metrics only — not authoritative; do not gate behavior on it.
*/
export declare const StartRollingReleaseRollingReleaseSource: {
readonly ApiTriggerGitDeploy: "api-trigger-git-deploy";
readonly Cli: "cli";
readonly CloneRepo: "clone/repo";
readonly Drop: "drop";
readonly Git: "git";
readonly GitDeployHook: "git-deploy-hook";
readonly Import: "import";
readonly ImportRepo: "import/repo";
readonly Redeploy: "redeploy";
readonly V0Web: "v0-web";
};
/**
* Where was the deployment created from. Best-effort guess for metrics only — not authoritative; do not gate behavior on it.
*/
export type StartRollingReleaseRollingReleaseSource = ClosedEnum<typeof StartRollingReleaseRollingReleaseSource>;
/**
* The canary deployment being rolled out
*/
export type StartRollingReleaseCanaryDeployment = {
/**
* The name of the project associated with the deployment at the time that the deployment was created
*/
name: string;
/**
* A number containing the date when the deployment was created in milliseconds
*/
createdAt: number;
/**
* The state of the deployment depending on the process of deploying, or if it is ready or in an error state
*/
readyState: StartRollingReleaseRollingReleaseReadyState;
/**
* A string holding the unique ID of the deployment
*/
id: string;
/**
* If defined, either `staging` if a staging alias in the format `<project>.<team>.now.sh` was assigned upon creation, or `production` if the aliases from `alias` were assigned. `null` value indicates the "preview" deployment.
*/
target?: StartRollingReleaseRollingReleaseTarget | null | undefined;
readyStateAt?: number | undefined;
/**
* Where was the deployment created from. Best-effort guess for metrics only — not authoritative; do not gate behavior on it.
*/
source?: StartRollingReleaseRollingReleaseSource | undefined;
/**
* A string with the unique URL of the deployment
*/
url: string;
};
/**
* The advancement type of the rolling release
*/
export declare const StartRollingReleaseAdvancementType: {
readonly Automatic: "automatic";
readonly ManualApproval: "manual-approval";
};
/**
* The advancement type of the rolling release
*/
export type StartRollingReleaseAdvancementType = ClosedEnum<typeof StartRollingReleaseAdvancementType>;
/**
* All stages configured for this rolling release
*/
export type StartRollingReleaseStages = {
/**
* The zero-based index of the stage
*/
index: number;
/**
* Whether or not this stage is the final stage (targetPercentage === 100)
*/
isFinalStage: boolean;
/**
* The percentage of traffic to serve to the canary deployment (0-100)
*/
targetPercentage: number;
/**
* Whether or not this stage requires manual approval to proceed
*/
requireApproval: boolean;
/**
* Duration in seconds for automatic advancement, null for manual stages or the final stage
*/
duration: number | null;
/**
* Whether to linearly shift traffic over the duration of this stage
*/
linearShift?: boolean | undefined;
};
/**
* The currently active stage, null if the rollout is aborted
*/
export type StartRollingReleaseActiveStage = {
/**
* The zero-based index of the stage
*/
index: number;
/**
* Whether or not this stage is the final stage (targetPercentage === 100)
*/
isFinalStage: boolean;
/**
* The percentage of traffic to serve to the canary deployment (0-100)
*/
targetPercentage: number;
/**
* Whether or not this stage requires manual approval to proceed
*/
requireApproval: boolean;
/**
* Duration in seconds for automatic advancement, null for manual stages or the final stage
*/
duration: number | null;
/**
* Whether to linearly shift traffic over the duration of this stage
*/
linearShift?: boolean | undefined;
};
/**
* The next stage to be activated, null if not in ACTIVE state
*/
export type StartRollingReleaseNextStage = {
/**
* The zero-based index of the stage
*/
index: number;
/**
* Whether or not this stage is the final stage (targetPercentage === 100)
*/
isFinalStage: boolean;
/**
* The percentage of traffic to serve to the canary deployment (0-100)
*/
targetPercentage: number;
/**
* Whether or not this stage requires manual approval to proceed
*/
requireApproval: boolean;
/**
* Duration in seconds for automatic advancement, null for manual stages or the final stage
*/
duration: number | null;
/**
* Whether to linearly shift traffic over the duration of this stage
*/
linearShift?: boolean | undefined;
};
/**
* Rolling release information including configuration and document details, or null if no rolling release exists
*/
export type StartRollingReleaseRollingRelease = {
/**
* The current state of the rolling release
*/
state: StartRollingReleaseState;
/**
* When set to `PAUSED`, the rollout is frozen at the current percentage until continued.
*/
substate: StartRollingReleaseSubstate | null;
/**
* The current deployment receiving production traffic
*/
currentDeployment: StartRollingReleaseCurrentDeployment | null;
/**
* The canary deployment being rolled out
*/
canaryDeployment: StartRollingReleaseCanaryDeployment | null;
/**
* The ID of a deployment queued for the next rolling release
*/
queuedDeploymentId: string | null;
/**
* The advancement type of the rolling release
*/
advancementType: StartRollingReleaseAdvancementType;
/**
* All stages configured for this rolling release
*/
stages: Array<StartRollingReleaseStages>;
/**
* The currently active stage, null if the rollout is aborted
*/
activeStage: StartRollingReleaseActiveStage | null;
/**
* The next stage to be activated, null if not in ACTIVE state
*/
nextStage: StartRollingReleaseNextStage | null;
/**
* Unix timestamp in milliseconds when the rolling release started
*/
startedAt: number;
/**
* Unix timestamp in milliseconds when the rolling release was last updated
*/
updatedAt: number;
/**
* When set (for example while {@link substate} is `PAUSED`), the canary traffic percentage persisted on the rollout document — use for dashboard display when linear shift is active.
*/
currentCanaryPercentage?: number | undefined;
};
/**
* The response format for rolling release endpoints that return rolling release information
*/
export type StartRollingReleaseResponseBody = {
/**
* Rolling release information including configuration and document details, or null if no rolling release exists
*/
rollingRelease: StartRollingReleaseRollingRelease | null;
};
/** @internal */
export type StartRollingReleaseRequestBody$Outbound = {
canaryDeploymentId: string;
};
/** @internal */
export declare const StartRollingReleaseRequestBody$outboundSchema: z.ZodType<StartRollingReleaseRequestBody$Outbound, z.ZodTypeDef, StartRollingReleaseRequestBody>;
export declare function startRollingReleaseRequestBodyToJSON(startRollingReleaseRequestBody: StartRollingReleaseRequestBody): string;
/** @internal */
export type StartRollingReleaseRequest$Outbound = {
idOrName: string;
teamId?: string | undefined;
slug?: string | undefined;
RequestBody?: StartRollingReleaseRequestBody$Outbound | undefined;
};
/** @internal */
export declare const StartRollingReleaseRequest$outboundSchema: z.ZodType<StartRollingReleaseRequest$Outbound, z.ZodTypeDef, StartRollingReleaseRequest>;
export declare function startRollingReleaseRequestToJSON(startRollingReleaseRequest: StartRollingReleaseRequest): string;
/** @internal */
export declare const StartRollingReleaseState$inboundSchema: z.ZodNativeEnum<typeof StartRollingReleaseState>;
/** @internal */
export declare const StartRollingReleaseSubstate$inboundSchema: z.ZodNativeEnum<typeof StartRollingReleaseSubstate>;
/** @internal */
export declare const StartRollingReleaseReadyState$inboundSchema: z.ZodNativeEnum<typeof StartRollingReleaseReadyState>;
/** @internal */
export declare const StartRollingReleaseTarget$inboundSchema: z.ZodNativeEnum<typeof StartRollingReleaseTarget>;
/** @internal */
export declare const StartRollingReleaseSource$inboundSchema: z.ZodNativeEnum<typeof StartRollingReleaseSource>;
/** @internal */
export declare const StartRollingReleaseCurrentDeployment$inboundSchema: z.ZodType<StartRollingReleaseCurrentDeployment, z.ZodTypeDef, unknown>;
export declare function startRollingReleaseCurrentDeploymentFromJSON(jsonString: string): SafeParseResult<StartRollingReleaseCurrentDeployment, SDKValidationError>;
/** @internal */
export declare const StartRollingReleaseRollingReleaseReadyState$inboundSchema: z.ZodNativeEnum<typeof StartRollingReleaseRollingReleaseReadyState>;
/** @internal */
export declare const StartRollingReleaseRollingReleaseTarget$inboundSchema: z.ZodNativeEnum<typeof StartRollingReleaseRollingReleaseTarget>;
/** @internal */
export declare const StartRollingReleaseRollingReleaseSource$inboundSchema: z.ZodNativeEnum<typeof StartRollingReleaseRollingReleaseSource>;
/** @internal */
export declare const StartRollingReleaseCanaryDeployment$inboundSchema: z.ZodType<StartRollingReleaseCanaryDeployment, z.ZodTypeDef, unknown>;
export declare function startRollingReleaseCanaryDeploymentFromJSON(jsonString: string): SafeParseResult<StartRollingReleaseCanaryDeployment, SDKValidationError>;
/** @internal */
export declare const StartRollingReleaseAdvancementType$inboundSchema: z.ZodNativeEnum<typeof StartRollingReleaseAdvancementType>;
/** @internal */
export declare const StartRollingReleaseStages$inboundSchema: z.ZodType<StartRollingReleaseStages, z.ZodTypeDef, unknown>;
export declare function startRollingReleaseStagesFromJSON(jsonString: string): SafeParseResult<StartRollingReleaseStages, SDKValidationError>;
/** @internal */
export declare const StartRollingReleaseActiveStage$inboundSchema: z.ZodType<StartRollingReleaseActiveStage, z.ZodTypeDef, unknown>;
export declare function startRollingReleaseActiveStageFromJSON(jsonString: string): SafeParseResult<StartRollingReleaseActiveStage, SDKValidationError>;
/** @internal */
export declare const StartRollingReleaseNextStage$inboundSchema: z.ZodType<StartRollingReleaseNextStage, z.ZodTypeDef, unknown>;
export declare function startRollingReleaseNextStageFromJSON(jsonString: string): SafeParseResult<StartRollingReleaseNextStage, SDKValidationError>;
/** @internal */
export declare const StartRollingReleaseRollingRelease$inboundSchema: z.ZodType<StartRollingReleaseRollingRelease, z.ZodTypeDef, unknown>;
export declare function startRollingReleaseRollingReleaseFromJSON(jsonString: string): SafeParseResult<StartRollingReleaseRollingRelease, SDKValidationError>;
/** @internal */
export declare const StartRollingReleaseResponseBody$inboundSchema: z.ZodType<StartRollingReleaseResponseBody, z.ZodTypeDef, unknown>;
export declare function startRollingReleaseResponseBodyFromJSON(jsonString: string): SafeParseResult<StartRollingReleaseResponseBody, SDKValidationError>;
//# sourceMappingURL=startrollingreleaseop.d.ts.map