@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>
428 lines • 16.9 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";
/**
* Filter by rolling release state
*/
export declare const GetRollingReleaseQueryParamState: {
readonly Active: "ACTIVE";
readonly Complete: "COMPLETE";
readonly Aborted: "ABORTED";
};
/**
* Filter by rolling release state
*/
export type GetRollingReleaseQueryParamState = ClosedEnum<typeof GetRollingReleaseQueryParamState>;
export type GetRollingReleaseRequest = {
/**
* Project ID or project name (URL-encoded)
*/
idOrName: string;
/**
* Filter by rolling release state
*/
state?: GetRollingReleaseQueryParamState | undefined;
/**
* 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;
};
/**
* The current state of the rolling release
*/
export declare const GetRollingReleaseState: {
readonly Aborted: "ABORTED";
readonly Active: "ACTIVE";
readonly Complete: "COMPLETE";
};
/**
* The current state of the rolling release
*/
export type GetRollingReleaseState = ClosedEnum<typeof GetRollingReleaseState>;
/**
* When set to `PAUSED`, the rollout is frozen at the current percentage until continued.
*/
export declare const Substate: {
readonly Paused: "PAUSED";
};
/**
* When set to `PAUSED`, the rollout is frozen at the current percentage until continued.
*/
export type Substate = ClosedEnum<typeof Substate>;
/**
* The state of the deployment depending on the process of deploying, or if it is ready or in an error state
*/
export declare const GetRollingReleaseReadyState: {
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 GetRollingReleaseReadyState = ClosedEnum<typeof GetRollingReleaseReadyState>;
/**
* 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 GetRollingReleaseTarget: {
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 GetRollingReleaseTarget = ClosedEnum<typeof GetRollingReleaseTarget>;
/**
* Where was the deployment created from. Best-effort guess for metrics only — not authoritative; do not gate behavior on it.
*/
export declare const GetRollingReleaseSource: {
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 GetRollingReleaseSource = ClosedEnum<typeof GetRollingReleaseSource>;
/**
* The current deployment receiving production traffic
*/
export type CurrentDeployment = {
/**
* 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: GetRollingReleaseReadyState;
/**
* 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?: GetRollingReleaseTarget | 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?: GetRollingReleaseSource | 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 GetRollingReleaseRollingReleaseReadyState: {
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 GetRollingReleaseRollingReleaseReadyState = ClosedEnum<typeof GetRollingReleaseRollingReleaseReadyState>;
/**
* 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 GetRollingReleaseRollingReleaseTarget: {
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 GetRollingReleaseRollingReleaseTarget = ClosedEnum<typeof GetRollingReleaseRollingReleaseTarget>;
/**
* Where was the deployment created from. Best-effort guess for metrics only — not authoritative; do not gate behavior on it.
*/
export declare const GetRollingReleaseRollingReleaseSource: {
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 GetRollingReleaseRollingReleaseSource = ClosedEnum<typeof GetRollingReleaseRollingReleaseSource>;
/**
* The canary deployment being rolled out
*/
export type CanaryDeployment = {
/**
* 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: GetRollingReleaseRollingReleaseReadyState;
/**
* 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?: GetRollingReleaseRollingReleaseTarget | 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?: GetRollingReleaseRollingReleaseSource | undefined;
/**
* A string with the unique URL of the deployment
*/
url: string;
};
/**
* The advancement type of the rolling release
*/
export declare const AdvancementType: {
readonly Automatic: "automatic";
readonly ManualApproval: "manual-approval";
};
/**
* The advancement type of the rolling release
*/
export type AdvancementType = ClosedEnum<typeof AdvancementType>;
/**
* All stages configured for this rolling release
*/
export type GetRollingReleaseStages = {
/**
* 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 ActiveStage = {
/**
* 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 NextStage = {
/**
* 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 GetRollingReleaseRollingRelease = {
/**
* The current state of the rolling release
*/
state: GetRollingReleaseState;
/**
* When set to `PAUSED`, the rollout is frozen at the current percentage until continued.
*/
substate: Substate | null;
/**
* The current deployment receiving production traffic
*/
currentDeployment: CurrentDeployment | null;
/**
* The canary deployment being rolled out
*/
canaryDeployment: CanaryDeployment | null;
/**
* The ID of a deployment queued for the next rolling release
*/
queuedDeploymentId: string | null;
/**
* The advancement type of the rolling release
*/
advancementType: AdvancementType;
/**
* All stages configured for this rolling release
*/
stages: Array<GetRollingReleaseStages>;
/**
* The currently active stage, null if the rollout is aborted
*/
activeStage: ActiveStage | null;
/**
* The next stage to be activated, null if not in ACTIVE state
*/
nextStage: NextStage | 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 GetRollingReleaseResponseBody = {
/**
* Rolling release information including configuration and document details, or null if no rolling release exists
*/
rollingRelease: GetRollingReleaseRollingRelease | null;
};
/** @internal */
export declare const GetRollingReleaseQueryParamState$outboundSchema: z.ZodNativeEnum<typeof GetRollingReleaseQueryParamState>;
/** @internal */
export type GetRollingReleaseRequest$Outbound = {
idOrName: string;
state?: string | undefined;
teamId?: string | undefined;
slug?: string | undefined;
};
/** @internal */
export declare const GetRollingReleaseRequest$outboundSchema: z.ZodType<GetRollingReleaseRequest$Outbound, z.ZodTypeDef, GetRollingReleaseRequest>;
export declare function getRollingReleaseRequestToJSON(getRollingReleaseRequest: GetRollingReleaseRequest): string;
/** @internal */
export declare const GetRollingReleaseState$inboundSchema: z.ZodNativeEnum<typeof GetRollingReleaseState>;
/** @internal */
export declare const Substate$inboundSchema: z.ZodNativeEnum<typeof Substate>;
/** @internal */
export declare const GetRollingReleaseReadyState$inboundSchema: z.ZodNativeEnum<typeof GetRollingReleaseReadyState>;
/** @internal */
export declare const GetRollingReleaseTarget$inboundSchema: z.ZodNativeEnum<typeof GetRollingReleaseTarget>;
/** @internal */
export declare const GetRollingReleaseSource$inboundSchema: z.ZodNativeEnum<typeof GetRollingReleaseSource>;
/** @internal */
export declare const CurrentDeployment$inboundSchema: z.ZodType<CurrentDeployment, z.ZodTypeDef, unknown>;
export declare function currentDeploymentFromJSON(jsonString: string): SafeParseResult<CurrentDeployment, SDKValidationError>;
/** @internal */
export declare const GetRollingReleaseRollingReleaseReadyState$inboundSchema: z.ZodNativeEnum<typeof GetRollingReleaseRollingReleaseReadyState>;
/** @internal */
export declare const GetRollingReleaseRollingReleaseTarget$inboundSchema: z.ZodNativeEnum<typeof GetRollingReleaseRollingReleaseTarget>;
/** @internal */
export declare const GetRollingReleaseRollingReleaseSource$inboundSchema: z.ZodNativeEnum<typeof GetRollingReleaseRollingReleaseSource>;
/** @internal */
export declare const CanaryDeployment$inboundSchema: z.ZodType<CanaryDeployment, z.ZodTypeDef, unknown>;
export declare function canaryDeploymentFromJSON(jsonString: string): SafeParseResult<CanaryDeployment, SDKValidationError>;
/** @internal */
export declare const AdvancementType$inboundSchema: z.ZodNativeEnum<typeof AdvancementType>;
/** @internal */
export declare const GetRollingReleaseStages$inboundSchema: z.ZodType<GetRollingReleaseStages, z.ZodTypeDef, unknown>;
export declare function getRollingReleaseStagesFromJSON(jsonString: string): SafeParseResult<GetRollingReleaseStages, SDKValidationError>;
/** @internal */
export declare const ActiveStage$inboundSchema: z.ZodType<ActiveStage, z.ZodTypeDef, unknown>;
export declare function activeStageFromJSON(jsonString: string): SafeParseResult<ActiveStage, SDKValidationError>;
/** @internal */
export declare const NextStage$inboundSchema: z.ZodType<NextStage, z.ZodTypeDef, unknown>;
export declare function nextStageFromJSON(jsonString: string): SafeParseResult<NextStage, SDKValidationError>;
/** @internal */
export declare const GetRollingReleaseRollingRelease$inboundSchema: z.ZodType<GetRollingReleaseRollingRelease, z.ZodTypeDef, unknown>;
export declare function getRollingReleaseRollingReleaseFromJSON(jsonString: string): SafeParseResult<GetRollingReleaseRollingRelease, SDKValidationError>;
/** @internal */
export declare const GetRollingReleaseResponseBody$inboundSchema: z.ZodType<GetRollingReleaseResponseBody, z.ZodTypeDef, unknown>;
export declare function getRollingReleaseResponseBodyFromJSON(jsonString: string): SafeParseResult<GetRollingReleaseResponseBody, SDKValidationError>;
//# sourceMappingURL=getrollingreleaseop.d.ts.map