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>

229 lines 10.5 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 ApproveRollingReleaseStageState = { Aborted: "ABORTED", Active: "ACTIVE", Complete: "COMPLETE", }; /** * When set to `PAUSED`, the rollout is frozen at the current percentage until continued. */ export const ApproveRollingReleaseStageSubstate = { Paused: "PAUSED", }; /** * 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 ApproveRollingReleaseStageTarget = { Production: "production", Staging: "staging", }; /** * The state of the deployment depending on the process of deploying, or if it is ready or in an error state */ export const ApproveRollingReleaseStageReadyState = { Blocked: "BLOCKED", Building: "BUILDING", Canceled: "CANCELED", Error: "ERROR", Initializing: "INITIALIZING", Queued: "QUEUED", Ready: "READY", }; /** * Where was the deployment created from. Best-effort guess for metrics only — not authoritative; do not gate behavior on it. */ export const ApproveRollingReleaseStageSource = { ApiTriggerGitDeploy: "api-trigger-git-deploy", Cli: "cli", CloneRepo: "clone/repo", Drop: "drop", Git: "git", Import: "import", ImportRepo: "import/repo", Redeploy: "redeploy", V0Web: "v0-web", }; /** * 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 ApproveRollingReleaseStageRollingReleaseTarget = { Production: "production", Staging: "staging", }; /** * The state of the deployment depending on the process of deploying, or if it is ready or in an error state */ export const ApproveRollingReleaseStageRollingReleaseReadyState = { Blocked: "BLOCKED", Building: "BUILDING", Canceled: "CANCELED", Error: "ERROR", Initializing: "INITIALIZING", Queued: "QUEUED", Ready: "READY", }; /** * Where was the deployment created from. Best-effort guess for metrics only — not authoritative; do not gate behavior on it. */ export const ApproveRollingReleaseStageRollingReleaseSource = { ApiTriggerGitDeploy: "api-trigger-git-deploy", Cli: "cli", CloneRepo: "clone/repo", Drop: "drop", Git: "git", Import: "import", ImportRepo: "import/repo", Redeploy: "redeploy", V0Web: "v0-web", }; /** * The advancement type of the rolling release */ export const ApproveRollingReleaseStageAdvancementType = { Automatic: "automatic", ManualApproval: "manual-approval", }; /** @internal */ export const ApproveRollingReleaseStageRequestBody$outboundSchema = z.object({ nextStageIndex: z.number(), canaryDeploymentId: z.string(), }); export function approveRollingReleaseStageRequestBodyToJSON(approveRollingReleaseStageRequestBody) { return JSON.stringify(ApproveRollingReleaseStageRequestBody$outboundSchema.parse(approveRollingReleaseStageRequestBody)); } /** @internal */ export const ApproveRollingReleaseStageRequest$outboundSchema = z.object({ idOrName: z.string(), teamId: z.string().optional(), slug: z.string().optional(), requestBody: z.lazy(() => ApproveRollingReleaseStageRequestBody$outboundSchema).optional(), }).transform((v) => { return remap$(v, { requestBody: "RequestBody", }); }); export function approveRollingReleaseStageRequestToJSON(approveRollingReleaseStageRequest) { return JSON.stringify(ApproveRollingReleaseStageRequest$outboundSchema.parse(approveRollingReleaseStageRequest)); } /** @internal */ export const ApproveRollingReleaseStageState$inboundSchema = z.nativeEnum(ApproveRollingReleaseStageState); /** @internal */ export const ApproveRollingReleaseStageSubstate$inboundSchema = z.nativeEnum(ApproveRollingReleaseStageSubstate); /** @internal */ export const ApproveRollingReleaseStageTarget$inboundSchema = z.nativeEnum(ApproveRollingReleaseStageTarget); /** @internal */ export const ApproveRollingReleaseStageReadyState$inboundSchema = z.nativeEnum(ApproveRollingReleaseStageReadyState); /** @internal */ export const ApproveRollingReleaseStageSource$inboundSchema = z.nativeEnum(ApproveRollingReleaseStageSource); /** @internal */ export const ApproveRollingReleaseStageCurrentDeployment$inboundSchema = z.object({ name: types.string(), createdAt: types.number(), id: types.string(), target: z.nullable(ApproveRollingReleaseStageTarget$inboundSchema) .optional(), readyState: ApproveRollingReleaseStageReadyState$inboundSchema, readyStateAt: types.optional(types.number()), source: types.optional(ApproveRollingReleaseStageSource$inboundSchema), url: types.string(), }); export function approveRollingReleaseStageCurrentDeploymentFromJSON(jsonString) { return safeParse(jsonString, (x) => ApproveRollingReleaseStageCurrentDeployment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApproveRollingReleaseStageCurrentDeployment' from JSON`); } /** @internal */ export const ApproveRollingReleaseStageRollingReleaseTarget$inboundSchema = z .nativeEnum(ApproveRollingReleaseStageRollingReleaseTarget); /** @internal */ export const ApproveRollingReleaseStageRollingReleaseReadyState$inboundSchema = z .nativeEnum(ApproveRollingReleaseStageRollingReleaseReadyState); /** @internal */ export const ApproveRollingReleaseStageRollingReleaseSource$inboundSchema = z .nativeEnum(ApproveRollingReleaseStageRollingReleaseSource); /** @internal */ export const ApproveRollingReleaseStageCanaryDeployment$inboundSchema = z.object({ name: types.string(), createdAt: types.number(), id: types.string(), target: z.nullable(ApproveRollingReleaseStageRollingReleaseTarget$inboundSchema).optional(), readyState: ApproveRollingReleaseStageRollingReleaseReadyState$inboundSchema, readyStateAt: types.optional(types.number()), source: types.optional(ApproveRollingReleaseStageRollingReleaseSource$inboundSchema), url: types.string(), }); export function approveRollingReleaseStageCanaryDeploymentFromJSON(jsonString) { return safeParse(jsonString, (x) => ApproveRollingReleaseStageCanaryDeployment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApproveRollingReleaseStageCanaryDeployment' from JSON`); } /** @internal */ export const ApproveRollingReleaseStageAdvancementType$inboundSchema = z .nativeEnum(ApproveRollingReleaseStageAdvancementType); /** @internal */ export const ApproveRollingReleaseStageStages$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 approveRollingReleaseStageStagesFromJSON(jsonString) { return safeParse(jsonString, (x) => ApproveRollingReleaseStageStages$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApproveRollingReleaseStageStages' from JSON`); } /** @internal */ export const ApproveRollingReleaseStageActiveStage$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 approveRollingReleaseStageActiveStageFromJSON(jsonString) { return safeParse(jsonString, (x) => ApproveRollingReleaseStageActiveStage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApproveRollingReleaseStageActiveStage' from JSON`); } /** @internal */ export const ApproveRollingReleaseStageNextStage$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 approveRollingReleaseStageNextStageFromJSON(jsonString) { return safeParse(jsonString, (x) => ApproveRollingReleaseStageNextStage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApproveRollingReleaseStageNextStage' from JSON`); } /** @internal */ export const ApproveRollingReleaseStageRollingRelease$inboundSchema = z.object({ state: ApproveRollingReleaseStageState$inboundSchema, substate: types.nullable(ApproveRollingReleaseStageSubstate$inboundSchema), currentDeployment: types.nullable(z.lazy(() => ApproveRollingReleaseStageCurrentDeployment$inboundSchema)), canaryDeployment: types.nullable(z.lazy(() => ApproveRollingReleaseStageCanaryDeployment$inboundSchema)), queuedDeploymentId: types.nullable(types.string()), advancementType: ApproveRollingReleaseStageAdvancementType$inboundSchema, stages: z.array(z.lazy(() => ApproveRollingReleaseStageStages$inboundSchema)), activeStage: types.nullable(z.lazy(() => ApproveRollingReleaseStageActiveStage$inboundSchema)), nextStage: types.nullable(z.lazy(() => ApproveRollingReleaseStageNextStage$inboundSchema)), startedAt: types.number(), updatedAt: types.number(), currentCanaryPercentage: types.optional(types.number()), }); export function approveRollingReleaseStageRollingReleaseFromJSON(jsonString) { return safeParse(jsonString, (x) => ApproveRollingReleaseStageRollingRelease$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApproveRollingReleaseStageRollingRelease' from JSON`); } /** @internal */ export const ApproveRollingReleaseStageResponseBody$inboundSchema = z.object({ rollingRelease: types.nullable(z.lazy(() => ApproveRollingReleaseStageRollingRelease$inboundSchema)), }); export function approveRollingReleaseStageResponseBodyFromJSON(jsonString) { return safeParse(jsonString, (x) => ApproveRollingReleaseStageResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApproveRollingReleaseStageResponseBody' from JSON`); } //# sourceMappingURL=approverollingreleasestageop.js.map