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>

226 lines 9.09 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../lib/schemas.js"; import * as types from "../types/primitives.js"; /** * Filter by rolling release state */ export const GetRollingReleaseQueryParamState = { Active: "ACTIVE", Complete: "COMPLETE", Aborted: "ABORTED", }; /** * The current state of the rolling release */ export const GetRollingReleaseState = { Aborted: "ABORTED", Active: "ACTIVE", Complete: "COMPLETE", }; /** * When set to `PAUSED`, the rollout is frozen at the current percentage until continued. */ export const Substate = { 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 GetRollingReleaseReadyState = { 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 GetRollingReleaseTarget = { 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 GetRollingReleaseSource = { 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 GetRollingReleaseRollingReleaseReadyState = { 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 GetRollingReleaseRollingReleaseTarget = { 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 GetRollingReleaseRollingReleaseSource = { 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 AdvancementType = { Automatic: "automatic", ManualApproval: "manual-approval", }; /** @internal */ export const GetRollingReleaseQueryParamState$outboundSchema = z.nativeEnum(GetRollingReleaseQueryParamState); /** @internal */ export const GetRollingReleaseRequest$outboundSchema = z.object({ idOrName: z.string(), state: GetRollingReleaseQueryParamState$outboundSchema.optional(), teamId: z.string().optional(), slug: z.string().optional(), }); export function getRollingReleaseRequestToJSON(getRollingReleaseRequest) { return JSON.stringify(GetRollingReleaseRequest$outboundSchema.parse(getRollingReleaseRequest)); } /** @internal */ export const GetRollingReleaseState$inboundSchema = z.nativeEnum(GetRollingReleaseState); /** @internal */ export const Substate$inboundSchema = z .nativeEnum(Substate); /** @internal */ export const GetRollingReleaseReadyState$inboundSchema = z.nativeEnum(GetRollingReleaseReadyState); /** @internal */ export const GetRollingReleaseTarget$inboundSchema = z.nativeEnum(GetRollingReleaseTarget); /** @internal */ export const GetRollingReleaseSource$inboundSchema = z.nativeEnum(GetRollingReleaseSource); /** @internal */ export const CurrentDeployment$inboundSchema = z.object({ name: types.string(), createdAt: types.number(), readyState: GetRollingReleaseReadyState$inboundSchema, id: types.string(), target: z.nullable(GetRollingReleaseTarget$inboundSchema).optional(), readyStateAt: types.optional(types.number()), source: types.optional(GetRollingReleaseSource$inboundSchema), url: types.string(), }); export function currentDeploymentFromJSON(jsonString) { return safeParse(jsonString, (x) => CurrentDeployment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CurrentDeployment' from JSON`); } /** @internal */ export const GetRollingReleaseRollingReleaseReadyState$inboundSchema = z .nativeEnum(GetRollingReleaseRollingReleaseReadyState); /** @internal */ export const GetRollingReleaseRollingReleaseTarget$inboundSchema = z.nativeEnum(GetRollingReleaseRollingReleaseTarget); /** @internal */ export const GetRollingReleaseRollingReleaseSource$inboundSchema = z.nativeEnum(GetRollingReleaseRollingReleaseSource); /** @internal */ export const CanaryDeployment$inboundSchema = z.object({ name: types.string(), createdAt: types.number(), readyState: GetRollingReleaseRollingReleaseReadyState$inboundSchema, id: types.string(), target: z.nullable(GetRollingReleaseRollingReleaseTarget$inboundSchema) .optional(), readyStateAt: types.optional(types.number()), source: types.optional(GetRollingReleaseRollingReleaseSource$inboundSchema), url: types.string(), }); export function canaryDeploymentFromJSON(jsonString) { return safeParse(jsonString, (x) => CanaryDeployment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CanaryDeployment' from JSON`); } /** @internal */ export const AdvancementType$inboundSchema = z.nativeEnum(AdvancementType); /** @internal */ export const GetRollingReleaseStages$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 getRollingReleaseStagesFromJSON(jsonString) { return safeParse(jsonString, (x) => GetRollingReleaseStages$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetRollingReleaseStages' from JSON`); } /** @internal */ export const ActiveStage$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 activeStageFromJSON(jsonString) { return safeParse(jsonString, (x) => ActiveStage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ActiveStage' from JSON`); } /** @internal */ export const NextStage$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 nextStageFromJSON(jsonString) { return safeParse(jsonString, (x) => NextStage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NextStage' from JSON`); } /** @internal */ export const GetRollingReleaseRollingRelease$inboundSchema = z.object({ state: GetRollingReleaseState$inboundSchema, substate: types.nullable(Substate$inboundSchema), currentDeployment: types.nullable(z.lazy(() => CurrentDeployment$inboundSchema)), canaryDeployment: types.nullable(z.lazy(() => CanaryDeployment$inboundSchema)), queuedDeploymentId: types.nullable(types.string()), advancementType: AdvancementType$inboundSchema, stages: z.array(z.lazy(() => GetRollingReleaseStages$inboundSchema)), activeStage: types.nullable(z.lazy(() => ActiveStage$inboundSchema)), nextStage: types.nullable(z.lazy(() => NextStage$inboundSchema)), startedAt: types.number(), updatedAt: types.number(), currentCanaryPercentage: types.optional(types.number()), }); export function getRollingReleaseRollingReleaseFromJSON(jsonString) { return safeParse(jsonString, (x) => GetRollingReleaseRollingRelease$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetRollingReleaseRollingRelease' from JSON`); } /** @internal */ export const GetRollingReleaseResponseBody$inboundSchema = z.object({ rollingRelease: types.nullable(z.lazy(() => GetRollingReleaseRollingRelease$inboundSchema)), }); export function getRollingReleaseResponseBodyFromJSON(jsonString) { return safeParse(jsonString, (x) => GetRollingReleaseResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetRollingReleaseResponseBody' from JSON`); } //# sourceMappingURL=getrollingreleaseop.js.map