UNPKG

@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>

422 lines 18 kB
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 CompleteRollingReleaseRequestBody = { /** * The ID of the canary deployment to complete */ canaryDeploymentId: string; }; export type CompleteRollingReleaseRequest = { /** * 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?: CompleteRollingReleaseRequestBody | undefined; }; /** * The current state of the rolling release */ export declare const CompleteRollingReleaseState: { readonly Aborted: "ABORTED"; readonly Active: "ACTIVE"; readonly Complete: "COMPLETE"; }; /** * The current state of the rolling release */ export type CompleteRollingReleaseState = ClosedEnum<typeof CompleteRollingReleaseState>; /** * When set to `PAUSED`, the rollout is frozen at the current percentage until continued. */ export declare const CompleteRollingReleaseSubstate: { readonly Paused: "PAUSED"; }; /** * When set to `PAUSED`, the rollout is frozen at the current percentage until continued. */ export type CompleteRollingReleaseSubstate = ClosedEnum<typeof CompleteRollingReleaseSubstate>; /** * 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 CompleteRollingReleaseTarget: { 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 CompleteRollingReleaseTarget = ClosedEnum<typeof CompleteRollingReleaseTarget>; /** * The state of the deployment depending on the process of deploying, or if it is ready or in an error state */ export declare const CompleteRollingReleaseReadyState: { 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 CompleteRollingReleaseReadyState = ClosedEnum<typeof CompleteRollingReleaseReadyState>; /** * Where was the deployment created from. Best-effort guess for metrics only — not authoritative; do not gate behavior on it. */ export declare const CompleteRollingReleaseSource: { readonly ApiTriggerGitDeploy: "api-trigger-git-deploy"; readonly Cli: "cli"; readonly CloneRepo: "clone/repo"; readonly Drop: "drop"; readonly Git: "git"; 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 CompleteRollingReleaseSource = ClosedEnum<typeof CompleteRollingReleaseSource>; /** * The current deployment receiving production traffic */ export type CompleteRollingReleaseCurrentDeployment = { /** * 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; /** * 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?: CompleteRollingReleaseTarget | null | undefined; /** * The state of the deployment depending on the process of deploying, or if it is ready or in an error state */ readyState: CompleteRollingReleaseReadyState; readyStateAt?: number | undefined; /** * Where was the deployment created from. Best-effort guess for metrics only — not authoritative; do not gate behavior on it. */ source?: CompleteRollingReleaseSource | undefined; /** * A string with the unique URL of the deployment */ url: 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. */ export declare const CompleteRollingReleaseRollingReleaseTarget: { 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 CompleteRollingReleaseRollingReleaseTarget = ClosedEnum<typeof CompleteRollingReleaseRollingReleaseTarget>; /** * The state of the deployment depending on the process of deploying, or if it is ready or in an error state */ export declare const CompleteRollingReleaseRollingReleaseReadyState: { 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 CompleteRollingReleaseRollingReleaseReadyState = ClosedEnum<typeof CompleteRollingReleaseRollingReleaseReadyState>; /** * Where was the deployment created from. Best-effort guess for metrics only — not authoritative; do not gate behavior on it. */ export declare const CompleteRollingReleaseRollingReleaseSource: { readonly ApiTriggerGitDeploy: "api-trigger-git-deploy"; readonly Cli: "cli"; readonly CloneRepo: "clone/repo"; readonly Drop: "drop"; readonly Git: "git"; 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 CompleteRollingReleaseRollingReleaseSource = ClosedEnum<typeof CompleteRollingReleaseRollingReleaseSource>; /** * The canary deployment being rolled out */ export type CompleteRollingReleaseCanaryDeployment = { /** * 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; /** * 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?: CompleteRollingReleaseRollingReleaseTarget | null | undefined; /** * The state of the deployment depending on the process of deploying, or if it is ready or in an error state */ readyState: CompleteRollingReleaseRollingReleaseReadyState; readyStateAt?: number | undefined; /** * Where was the deployment created from. Best-effort guess for metrics only — not authoritative; do not gate behavior on it. */ source?: CompleteRollingReleaseRollingReleaseSource | undefined; /** * A string with the unique URL of the deployment */ url: string; }; /** * The advancement type of the rolling release */ export declare const CompleteRollingReleaseAdvancementType: { readonly Automatic: "automatic"; readonly ManualApproval: "manual-approval"; }; /** * The advancement type of the rolling release */ export type CompleteRollingReleaseAdvancementType = ClosedEnum<typeof CompleteRollingReleaseAdvancementType>; /** * All stages configured for this rolling release */ export type CompleteRollingReleaseStages = { /** * 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 CompleteRollingReleaseActiveStage = { /** * 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 CompleteRollingReleaseNextStage = { /** * 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 CompleteRollingReleaseRollingRelease = { /** * The current state of the rolling release */ state: CompleteRollingReleaseState; /** * When set to `PAUSED`, the rollout is frozen at the current percentage until continued. */ substate: CompleteRollingReleaseSubstate | null; /** * The current deployment receiving production traffic */ currentDeployment: CompleteRollingReleaseCurrentDeployment | null; /** * The canary deployment being rolled out */ canaryDeployment: CompleteRollingReleaseCanaryDeployment | null; /** * The ID of a deployment queued for the next rolling release */ queuedDeploymentId: string | null; /** * The advancement type of the rolling release */ advancementType: CompleteRollingReleaseAdvancementType; /** * All stages configured for this rolling release */ stages: Array<CompleteRollingReleaseStages>; /** * The currently active stage, null if the rollout is aborted */ activeStage: CompleteRollingReleaseActiveStage | null; /** * The next stage to be activated, null if not in ACTIVE state */ nextStage: CompleteRollingReleaseNextStage | 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 CompleteRollingReleaseResponseBody = { /** * Rolling release information including configuration and document details, or null if no rolling release exists */ rollingRelease: CompleteRollingReleaseRollingRelease | null; }; /** @internal */ export type CompleteRollingReleaseRequestBody$Outbound = { canaryDeploymentId: string; }; /** @internal */ export declare const CompleteRollingReleaseRequestBody$outboundSchema: z.ZodType<CompleteRollingReleaseRequestBody$Outbound, z.ZodTypeDef, CompleteRollingReleaseRequestBody>; export declare function completeRollingReleaseRequestBodyToJSON(completeRollingReleaseRequestBody: CompleteRollingReleaseRequestBody): string; /** @internal */ export type CompleteRollingReleaseRequest$Outbound = { idOrName: string; teamId?: string | undefined; slug?: string | undefined; RequestBody?: CompleteRollingReleaseRequestBody$Outbound | undefined; }; /** @internal */ export declare const CompleteRollingReleaseRequest$outboundSchema: z.ZodType<CompleteRollingReleaseRequest$Outbound, z.ZodTypeDef, CompleteRollingReleaseRequest>; export declare function completeRollingReleaseRequestToJSON(completeRollingReleaseRequest: CompleteRollingReleaseRequest): string; /** @internal */ export declare const CompleteRollingReleaseState$inboundSchema: z.ZodNativeEnum<typeof CompleteRollingReleaseState>; /** @internal */ export declare const CompleteRollingReleaseSubstate$inboundSchema: z.ZodNativeEnum<typeof CompleteRollingReleaseSubstate>; /** @internal */ export declare const CompleteRollingReleaseTarget$inboundSchema: z.ZodNativeEnum<typeof CompleteRollingReleaseTarget>; /** @internal */ export declare const CompleteRollingReleaseReadyState$inboundSchema: z.ZodNativeEnum<typeof CompleteRollingReleaseReadyState>; /** @internal */ export declare const CompleteRollingReleaseSource$inboundSchema: z.ZodNativeEnum<typeof CompleteRollingReleaseSource>; /** @internal */ export declare const CompleteRollingReleaseCurrentDeployment$inboundSchema: z.ZodType<CompleteRollingReleaseCurrentDeployment, z.ZodTypeDef, unknown>; export declare function completeRollingReleaseCurrentDeploymentFromJSON(jsonString: string): SafeParseResult<CompleteRollingReleaseCurrentDeployment, SDKValidationError>; /** @internal */ export declare const CompleteRollingReleaseRollingReleaseTarget$inboundSchema: z.ZodNativeEnum<typeof CompleteRollingReleaseRollingReleaseTarget>; /** @internal */ export declare const CompleteRollingReleaseRollingReleaseReadyState$inboundSchema: z.ZodNativeEnum<typeof CompleteRollingReleaseRollingReleaseReadyState>; /** @internal */ export declare const CompleteRollingReleaseRollingReleaseSource$inboundSchema: z.ZodNativeEnum<typeof CompleteRollingReleaseRollingReleaseSource>; /** @internal */ export declare const CompleteRollingReleaseCanaryDeployment$inboundSchema: z.ZodType<CompleteRollingReleaseCanaryDeployment, z.ZodTypeDef, unknown>; export declare function completeRollingReleaseCanaryDeploymentFromJSON(jsonString: string): SafeParseResult<CompleteRollingReleaseCanaryDeployment, SDKValidationError>; /** @internal */ export declare const CompleteRollingReleaseAdvancementType$inboundSchema: z.ZodNativeEnum<typeof CompleteRollingReleaseAdvancementType>; /** @internal */ export declare const CompleteRollingReleaseStages$inboundSchema: z.ZodType<CompleteRollingReleaseStages, z.ZodTypeDef, unknown>; export declare function completeRollingReleaseStagesFromJSON(jsonString: string): SafeParseResult<CompleteRollingReleaseStages, SDKValidationError>; /** @internal */ export declare const CompleteRollingReleaseActiveStage$inboundSchema: z.ZodType<CompleteRollingReleaseActiveStage, z.ZodTypeDef, unknown>; export declare function completeRollingReleaseActiveStageFromJSON(jsonString: string): SafeParseResult<CompleteRollingReleaseActiveStage, SDKValidationError>; /** @internal */ export declare const CompleteRollingReleaseNextStage$inboundSchema: z.ZodType<CompleteRollingReleaseNextStage, z.ZodTypeDef, unknown>; export declare function completeRollingReleaseNextStageFromJSON(jsonString: string): SafeParseResult<CompleteRollingReleaseNextStage, SDKValidationError>; /** @internal */ export declare const CompleteRollingReleaseRollingRelease$inboundSchema: z.ZodType<CompleteRollingReleaseRollingRelease, z.ZodTypeDef, unknown>; export declare function completeRollingReleaseRollingReleaseFromJSON(jsonString: string): SafeParseResult<CompleteRollingReleaseRollingRelease, SDKValidationError>; /** @internal */ export declare const CompleteRollingReleaseResponseBody$inboundSchema: z.ZodType<CompleteRollingReleaseResponseBody, z.ZodTypeDef, unknown>; export declare function completeRollingReleaseResponseBodyFromJSON(jsonString: string): SafeParseResult<CompleteRollingReleaseResponseBody, SDKValidationError>; //# sourceMappingURL=completerollingreleaseop.d.ts.map