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>

170 lines 7.92 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 GetRollingReleaseConfigRequest = { /** * 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; }; /** * An array of all the stages required during a deployment release. Each stage defines a target percentage and advancement rules. The final stage must always have targetPercentage: 100. */ export type GetRollingReleaseConfigStages = { /** * 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 | undefined; /** * Duration in minutes for automatic advancement to the next stage */ duration?: number | undefined; /** * Whether to linearly shift traffic over the duration of this stage */ linearShift?: boolean | undefined; }; /** * The metric this check evaluates. */ export declare const GetRollingReleaseConfigType: { readonly ErrorRate5xx: "error-rate-5xx"; }; /** * The metric this check evaluates. */ export type GetRollingReleaseConfigType = ClosedEnum<typeof GetRollingReleaseConfigType>; /** * The checks to evaluate. An empty array means nothing is evaluated. */ export type GetRollingReleaseConfigChecks = { /** * The metric this check evaluates. */ type: GetRollingReleaseConfigType; /** * Minimum number of requests required in the window before the check can fail. Below this, the check is inconclusive rather than failing, so low-traffic stages don't gate on noise. Defaults to `100` when omitted. */ minSampleSize?: number | undefined; /** * Response status codes to ignore entirely — dropped from both the numerator (errors) and the denominator (total requests). Defaults to `[]` when omitted. */ excludeStatusCodes?: Array<number> | undefined; /** * Request paths to ignore entirely — dropped from both the numerator (errors) and the denominator (total requests). Matched exactly against the request path with any query string removed; no prefix or glob matching. Defaults to `[]` when omitted. */ excludePaths?: Array<string> | undefined; /** * Seconds of ingest lag to allow for: the query's upper bound is `now() - this value`, so the check never reads a window that is still filling. Defaults to `30` when omitted. */ ingestWatermarkSeconds?: number | undefined; }; /** * What to do when the gate trips: pause the rollout, or roll it back. */ export declare const GetRollingReleaseConfigAction: { readonly Pause: "pause"; readonly Rollback: "rollback"; }; /** * What to do when the gate trips: pause the rollout, or roll it back. */ export type GetRollingReleaseConfigAction = ClosedEnum<typeof GetRollingReleaseConfigAction>; /** * Automated gating configuration. Omitted (the default) means no gating is configured, which is equivalent to `enabled: false`. */ export type GetRollingReleaseConfigGate = { /** * Whether automated gating is enabled for this project's rollouts. */ enabled: boolean; /** * The checks to evaluate. An empty array means nothing is evaluated. */ checks: Array<GetRollingReleaseConfigChecks>; /** * How many failing evaluations within {@link windowSize} trip the gate. Defaults to `3` when omitted. */ failureThreshold?: number | undefined; /** * How many of the most recent evaluations {@link failureThreshold} is counted against. Defaults to `5` when omitted. */ windowSize?: number | undefined; /** * What to do when the gate trips: pause the rollout, or roll it back. */ action: GetRollingReleaseConfigAction; /** * When true, a tripped gate is only reported — {@link action} is not taken. */ dryRun: boolean; }; /** * Project-level rolling release configuration that defines how deployments should be gradually rolled out */ export type GetRollingReleaseConfigRollingRelease = { /** * The environment that the release targets, currently only supports production. Adding in case we want to configure with alias groups or custom environments. */ target: string; /** * An array of all the stages required during a deployment release. Each stage defines a target percentage and advancement rules. The final stage must always have targetPercentage: 100. */ stages?: Array<GetRollingReleaseConfigStages> | null | undefined; /** * Whether the request served by a canary deployment should return a header indicating a canary was served. Defaults to `false` when omitted. */ canaryResponseHeader?: boolean | undefined; /** * Automated gating configuration. Omitted (the default) means no gating is configured, which is equivalent to `enabled: false`. */ gate?: GetRollingReleaseConfigGate | undefined; }; export type GetRollingReleaseConfigResponseBody = { /** * Project-level rolling release configuration that defines how deployments should be gradually rolled out */ rollingRelease: GetRollingReleaseConfigRollingRelease | null; }; /** @internal */ export type GetRollingReleaseConfigRequest$Outbound = { idOrName: string; teamId?: string | undefined; slug?: string | undefined; }; /** @internal */ export declare const GetRollingReleaseConfigRequest$outboundSchema: z.ZodType<GetRollingReleaseConfigRequest$Outbound, z.ZodTypeDef, GetRollingReleaseConfigRequest>; export declare function getRollingReleaseConfigRequestToJSON(getRollingReleaseConfigRequest: GetRollingReleaseConfigRequest): string; /** @internal */ export declare const GetRollingReleaseConfigStages$inboundSchema: z.ZodType<GetRollingReleaseConfigStages, z.ZodTypeDef, unknown>; export declare function getRollingReleaseConfigStagesFromJSON(jsonString: string): SafeParseResult<GetRollingReleaseConfigStages, SDKValidationError>; /** @internal */ export declare const GetRollingReleaseConfigType$inboundSchema: z.ZodNativeEnum<typeof GetRollingReleaseConfigType>; /** @internal */ export declare const GetRollingReleaseConfigChecks$inboundSchema: z.ZodType<GetRollingReleaseConfigChecks, z.ZodTypeDef, unknown>; export declare function getRollingReleaseConfigChecksFromJSON(jsonString: string): SafeParseResult<GetRollingReleaseConfigChecks, SDKValidationError>; /** @internal */ export declare const GetRollingReleaseConfigAction$inboundSchema: z.ZodNativeEnum<typeof GetRollingReleaseConfigAction>; /** @internal */ export declare const GetRollingReleaseConfigGate$inboundSchema: z.ZodType<GetRollingReleaseConfigGate, z.ZodTypeDef, unknown>; export declare function getRollingReleaseConfigGateFromJSON(jsonString: string): SafeParseResult<GetRollingReleaseConfigGate, SDKValidationError>; /** @internal */ export declare const GetRollingReleaseConfigRollingRelease$inboundSchema: z.ZodType<GetRollingReleaseConfigRollingRelease, z.ZodTypeDef, unknown>; export declare function getRollingReleaseConfigRollingReleaseFromJSON(jsonString: string): SafeParseResult<GetRollingReleaseConfigRollingRelease, SDKValidationError>; /** @internal */ export declare const GetRollingReleaseConfigResponseBody$inboundSchema: z.ZodType<GetRollingReleaseConfigResponseBody, z.ZodTypeDef, unknown>; export declare function getRollingReleaseConfigResponseBodyFromJSON(jsonString: string): SafeParseResult<GetRollingReleaseConfigResponseBody, SDKValidationError>; //# sourceMappingURL=getrollingreleaseconfigop.d.ts.map