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>

230 lines 9.93 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../lib/primitives.js"; import { safeParse } from "../lib/schemas.js"; import * as types from "../types/primitives.js"; /** * The current state of the rolling release */ export const StartRollingReleaseState = { Aborted: "ABORTED", Active: "ACTIVE", Complete: "COMPLETE", }; /** * When set to `PAUSED`, the rollout is frozen at the current percentage until continued. */ export const StartRollingReleaseSubstate = { Paused: "PAUSED", }; /** * The state of the deployment depending on the process of deploying, or if it is ready or in an error state */ export const StartRollingReleaseReadyState = { Blocked: "BLOCKED", Building: "BUILDING", Canceled: "CANCELED", Error: "ERROR", Initializing: "INITIALIZING", Queued: "QUEUED", Ready: "READY", }; /** * 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 const StartRollingReleaseTarget = { Production: "production", Staging: "staging", }; /** * Where was the deployment created from. Best-effort guess for metrics only — not authoritative; do not gate behavior on it. */ export const StartRollingReleaseSource = { ApiTriggerGitDeploy: "api-trigger-git-deploy", Cli: "cli", CloneRepo: "clone/repo", Drop: "drop", Git: "git", GitDeployHook: "git-deploy-hook", Import: "import", ImportRepo: "import/repo", Redeploy: "redeploy", V0Web: "v0-web", }; /** * The state of the deployment depending on the process of deploying, or if it is ready or in an error state */ export const StartRollingReleaseRollingReleaseReadyState = { Blocked: "BLOCKED", Building: "BUILDING", Canceled: "CANCELED", Error: "ERROR", Initializing: "INITIALIZING", Queued: "QUEUED", Ready: "READY", }; /** * 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 const StartRollingReleaseRollingReleaseTarget = { Production: "production", Staging: "staging", }; /** * Where was the deployment created from. Best-effort guess for metrics only — not authoritative; do not gate behavior on it. */ export const StartRollingReleaseRollingReleaseSource = { ApiTriggerGitDeploy: "api-trigger-git-deploy", Cli: "cli", CloneRepo: "clone/repo", Drop: "drop", Git: "git", GitDeployHook: "git-deploy-hook", Import: "import", ImportRepo: "import/repo", Redeploy: "redeploy", V0Web: "v0-web", }; /** * The advancement type of the rolling release */ export const StartRollingReleaseAdvancementType = { Automatic: "automatic", ManualApproval: "manual-approval", }; /** @internal */ export const StartRollingReleaseRequestBody$outboundSchema = z.object({ canaryDeploymentId: z.string(), }); export function startRollingReleaseRequestBodyToJSON(startRollingReleaseRequestBody) { return JSON.stringify(StartRollingReleaseRequestBody$outboundSchema.parse(startRollingReleaseRequestBody)); } /** @internal */ export const StartRollingReleaseRequest$outboundSchema = z.object({ idOrName: z.string(), teamId: z.string().optional(), slug: z.string().optional(), requestBody: z.lazy(() => StartRollingReleaseRequestBody$outboundSchema) .optional(), }).transform((v) => { return remap$(v, { requestBody: "RequestBody", }); }); export function startRollingReleaseRequestToJSON(startRollingReleaseRequest) { return JSON.stringify(StartRollingReleaseRequest$outboundSchema.parse(startRollingReleaseRequest)); } /** @internal */ export const StartRollingReleaseState$inboundSchema = z.nativeEnum(StartRollingReleaseState); /** @internal */ export const StartRollingReleaseSubstate$inboundSchema = z.nativeEnum(StartRollingReleaseSubstate); /** @internal */ export const StartRollingReleaseReadyState$inboundSchema = z.nativeEnum(StartRollingReleaseReadyState); /** @internal */ export const StartRollingReleaseTarget$inboundSchema = z.nativeEnum(StartRollingReleaseTarget); /** @internal */ export const StartRollingReleaseSource$inboundSchema = z.nativeEnum(StartRollingReleaseSource); /** @internal */ export const StartRollingReleaseCurrentDeployment$inboundSchema = z.object({ name: types.string(), createdAt: types.number(), readyState: StartRollingReleaseReadyState$inboundSchema, id: types.string(), target: z.nullable(StartRollingReleaseTarget$inboundSchema).optional(), readyStateAt: types.optional(types.number()), source: types.optional(StartRollingReleaseSource$inboundSchema), url: types.string(), }); export function startRollingReleaseCurrentDeploymentFromJSON(jsonString) { return safeParse(jsonString, (x) => StartRollingReleaseCurrentDeployment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StartRollingReleaseCurrentDeployment' from JSON`); } /** @internal */ export const StartRollingReleaseRollingReleaseReadyState$inboundSchema = z .nativeEnum(StartRollingReleaseRollingReleaseReadyState); /** @internal */ export const StartRollingReleaseRollingReleaseTarget$inboundSchema = z .nativeEnum(StartRollingReleaseRollingReleaseTarget); /** @internal */ export const StartRollingReleaseRollingReleaseSource$inboundSchema = z .nativeEnum(StartRollingReleaseRollingReleaseSource); /** @internal */ export const StartRollingReleaseCanaryDeployment$inboundSchema = z.object({ name: types.string(), createdAt: types.number(), readyState: StartRollingReleaseRollingReleaseReadyState$inboundSchema, id: types.string(), target: z.nullable(StartRollingReleaseRollingReleaseTarget$inboundSchema) .optional(), readyStateAt: types.optional(types.number()), source: types.optional(StartRollingReleaseRollingReleaseSource$inboundSchema), url: types.string(), }); export function startRollingReleaseCanaryDeploymentFromJSON(jsonString) { return safeParse(jsonString, (x) => StartRollingReleaseCanaryDeployment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StartRollingReleaseCanaryDeployment' from JSON`); } /** @internal */ export const StartRollingReleaseAdvancementType$inboundSchema = z.nativeEnum(StartRollingReleaseAdvancementType); /** @internal */ export const StartRollingReleaseStages$inboundSchema = z.object({ index: types.number(), isFinalStage: types.boolean(), targetPercentage: types.number(), requireApproval: types.boolean(), duration: types.nullable(types.number()), linearShift: types.optional(types.boolean()), }); export function startRollingReleaseStagesFromJSON(jsonString) { return safeParse(jsonString, (x) => StartRollingReleaseStages$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StartRollingReleaseStages' from JSON`); } /** @internal */ export const StartRollingReleaseActiveStage$inboundSchema = z.object({ index: types.number(), isFinalStage: types.boolean(), targetPercentage: types.number(), requireApproval: types.boolean(), duration: types.nullable(types.number()), linearShift: types.optional(types.boolean()), }); export function startRollingReleaseActiveStageFromJSON(jsonString) { return safeParse(jsonString, (x) => StartRollingReleaseActiveStage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StartRollingReleaseActiveStage' from JSON`); } /** @internal */ export const StartRollingReleaseNextStage$inboundSchema = z.object({ index: types.number(), isFinalStage: types.boolean(), targetPercentage: types.number(), requireApproval: types.boolean(), duration: types.nullable(types.number()), linearShift: types.optional(types.boolean()), }); export function startRollingReleaseNextStageFromJSON(jsonString) { return safeParse(jsonString, (x) => StartRollingReleaseNextStage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StartRollingReleaseNextStage' from JSON`); } /** @internal */ export const StartRollingReleaseRollingRelease$inboundSchema = z.object({ state: StartRollingReleaseState$inboundSchema, substate: types.nullable(StartRollingReleaseSubstate$inboundSchema), currentDeployment: types.nullable(z.lazy(() => StartRollingReleaseCurrentDeployment$inboundSchema)), canaryDeployment: types.nullable(z.lazy(() => StartRollingReleaseCanaryDeployment$inboundSchema)), queuedDeploymentId: types.nullable(types.string()), advancementType: StartRollingReleaseAdvancementType$inboundSchema, stages: z.array(z.lazy(() => StartRollingReleaseStages$inboundSchema)), activeStage: types.nullable(z.lazy(() => StartRollingReleaseActiveStage$inboundSchema)), nextStage: types.nullable(z.lazy(() => StartRollingReleaseNextStage$inboundSchema)), startedAt: types.number(), updatedAt: types.number(), currentCanaryPercentage: types.optional(types.number()), }); export function startRollingReleaseRollingReleaseFromJSON(jsonString) { return safeParse(jsonString, (x) => StartRollingReleaseRollingRelease$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StartRollingReleaseRollingRelease' from JSON`); } /** @internal */ export const StartRollingReleaseResponseBody$inboundSchema = z.object({ rollingRelease: types.nullable(z.lazy(() => StartRollingReleaseRollingRelease$inboundSchema)), }); export function startRollingReleaseResponseBodyFromJSON(jsonString) { return safeParse(jsonString, (x) => StartRollingReleaseResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StartRollingReleaseResponseBody' from JSON`); } //# sourceMappingURL=startrollingreleaseop.js.map