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>

532 lines 22 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 { smartUnion } from "../types/smartUnion.js"; export const PatchTeamRoles1 = { Owner: "OWNER", Member: "MEMBER", Developer: "DEVELOPER", Security: "SECURITY", Billing: "BILLING", Viewer: "VIEWER", ViewerForPlus: "VIEWER_FOR_PLUS", Contributor: "CONTRIBUTOR", }; /** * Controls who can request access to protected deployments. */ export const PatchTeamDpAccessRequestsMode = { All: "all", None: "none", EmailDomain: "email-domain", }; /** * Specify if the password will apply to every Deployment Target or just Preview */ export const PatchTeamDeploymentType = { All: "all", Preview: "preview", ProdDeploymentUrlsAndAllPreviews: "prod_deployment_urls_and_all_previews", AllExceptCustomDomains: "all_except_custom_domains", }; /** * Specify if the Vercel Authentication (SSO Protection) will apply to every Deployment Target or just Preview */ export const PatchTeamTeamsDeploymentType = { All: "all", Preview: "preview", ProdDeploymentUrlsAndAllPreviews: "prod_deployment_urls_and_all_previews", AllExceptCustomDomains: "all_except_custom_domains", }; export const PatchTeamTeamsRequestDeploymentType = { All: "all", Preview: "preview", ProdDeploymentUrlsAndAllPreviews: "prod_deployment_urls_and_all_previews", AllExceptCustomDomains: "all_except_custom_domains", }; /** * The time period to keep non-production deployments for */ export const PatchTeamExpiration = { Threey: "3y", Twoy: "2y", Oney: "1y", Sixm: "6m", Threem: "3m", Twom: "2m", Onem: "1m", Twow: "2w", Onew: "1w", Oned: "1d", Unlimited: "unlimited", }; /** * The time period to keep production deployments for */ export const ExpirationProduction = { Threey: "3y", Twoy: "2y", Oney: "1y", Sixm: "6m", Threem: "3m", Twom: "2m", Onem: "1m", Twow: "2w", Onew: "1w", Oned: "1d", Unlimited: "unlimited", }; /** * The time period to keep canceled deployments for */ export const ExpirationCanceled = { Oney: "1y", Sixm: "6m", Threem: "3m", Twom: "2m", Onem: "1m", Twow: "2w", Onew: "1w", Oned: "1d", Unlimited: "unlimited", }; /** * The time period to keep errored deployments for */ export const ExpirationErrored = { Oney: "1y", Sixm: "6m", Threem: "3m", Twom: "2m", Onem: "1m", Twow: "2w", Onew: "1w", Oned: "1d", Unlimited: "unlimited", }; export const PatchTeamEnvironmentsTarget = { Production: "production", Preview: "preview", }; export const PatchTeamSourcesProvider = { Github: "github", Bitbucket: "bitbucket", }; export const PatchTeamEnvironmentsTeamsTarget = { Production: "production", Preview: "preview", }; export const PatchTeamDeploymentSourcesSources = { Git: "git", Cli: "cli", RestApi: "rest-api", DeployHook: "deploy-hook", Integration: "integration", V0: "v0", }; /** * The NSNB preference for the team. */ export const NsnbConfigPreference = { AutoApproval: "auto-approval", ManualApproval: "manual-approval", Block: "block", }; /** * Default build machine type for new builds: standard, enhanced, turbo, or elastic. */ export const PatchTeamDefault = { Basic: "basic", Enhanced: "enhanced", Turbo: "turbo", Standard: "standard", Elastic: "elastic", }; /** @internal */ export const PatchTeamRoles2$outboundSchema = z.object({ accessGroupId: z.string(), }); export function patchTeamRoles2ToJSON(patchTeamRoles2) { return JSON.stringify(PatchTeamRoles2$outboundSchema.parse(patchTeamRoles2)); } /** @internal */ export const PatchTeamRoles1$outboundSchema = z.nativeEnum(PatchTeamRoles1); /** @internal */ export const PatchTeamRoles$outboundSchema = smartUnion([ z.lazy(() => PatchTeamRoles2$outboundSchema), PatchTeamRoles1$outboundSchema, ]); export function patchTeamRolesToJSON(patchTeamRoles) { return JSON.stringify(PatchTeamRoles$outboundSchema.parse(patchTeamRoles)); } /** @internal */ export const PatchTeamSaml$outboundSchema = z.object({ enforced: z.boolean().optional(), roles: z.record(smartUnion([ z.lazy(() => PatchTeamRoles2$outboundSchema), PatchTeamRoles1$outboundSchema, ])).optional(), }); export function patchTeamSamlToJSON(patchTeamSaml) { return JSON.stringify(PatchTeamSaml$outboundSchema.parse(patchTeamSaml)); } /** @internal */ export const PatchTeamRemoteCaching$outboundSchema = z.object({ enabled: z.boolean().optional(), }); export function patchTeamRemoteCachingToJSON(patchTeamRemoteCaching) { return JSON.stringify(PatchTeamRemoteCaching$outboundSchema.parse(patchTeamRemoteCaching)); } /** @internal */ export const PatchTeamDpAccessRequestsMode$outboundSchema = z.nativeEnum(PatchTeamDpAccessRequestsMode); /** @internal */ export const PatchTeamDeploymentType$outboundSchema = z.nativeEnum(PatchTeamDeploymentType); /** @internal */ export const PatchTeamPasswordProtection$outboundSchema = z.object({ deploymentType: PatchTeamDeploymentType$outboundSchema, password: z.nullable(z.string()).optional(), }); export function patchTeamPasswordProtectionToJSON(patchTeamPasswordProtection) { return JSON.stringify(PatchTeamPasswordProtection$outboundSchema.parse(patchTeamPasswordProtection)); } /** @internal */ export const PatchTeamTeamsDeploymentType$outboundSchema = z.nativeEnum(PatchTeamTeamsDeploymentType); /** @internal */ export const PatchTeamSsoProtection$outboundSchema = z.object({ deploymentType: PatchTeamTeamsDeploymentType$outboundSchema.default("preview"), }); export function patchTeamSsoProtectionToJSON(patchTeamSsoProtection) { return JSON.stringify(PatchTeamSsoProtection$outboundSchema.parse(patchTeamSsoProtection)); } /** @internal */ export const PatchTeamDefaultDeploymentProtection$outboundSchema = z.object({ passwordProtection: z.nullable(z.lazy(() => PatchTeamPasswordProtection$outboundSchema)).optional(), ssoProtection: z.nullable(z.lazy(() => PatchTeamSsoProtection$outboundSchema)) .optional(), }); export function patchTeamDefaultDeploymentProtectionToJSON(patchTeamDefaultDeploymentProtection) { return JSON.stringify(PatchTeamDefaultDeploymentProtection$outboundSchema.parse(patchTeamDefaultDeploymentProtection)); } /** @internal */ export const PatchTeamTeamsRequestDeploymentType$outboundSchema = z.nativeEnum(PatchTeamTeamsRequestDeploymentType); /** @internal */ export const PatchTeamDefaultPassport$outboundSchema = z.object({ connectorId: z.string(), deploymentType: PatchTeamTeamsRequestDeploymentType$outboundSchema.default("all"), }); export function patchTeamDefaultPassportToJSON(patchTeamDefaultPassport) { return JSON.stringify(PatchTeamDefaultPassport$outboundSchema.parse(patchTeamDefaultPassport)); } /** @internal */ export const PatchTeamExpiration$outboundSchema = z.nativeEnum(PatchTeamExpiration); /** @internal */ export const ExpirationProduction$outboundSchema = z.nativeEnum(ExpirationProduction); /** @internal */ export const ExpirationCanceled$outboundSchema = z.nativeEnum(ExpirationCanceled); /** @internal */ export const ExpirationErrored$outboundSchema = z.nativeEnum(ExpirationErrored); /** @internal */ export const PatchTeamDefaultExpirationSettings$outboundSchema = z.object({ expiration: PatchTeamExpiration$outboundSchema.optional(), expirationProduction: ExpirationProduction$outboundSchema.optional(), expirationCanceled: ExpirationCanceled$outboundSchema.optional(), expirationErrored: ExpirationErrored$outboundSchema.optional(), }); export function patchTeamDefaultExpirationSettingsToJSON(patchTeamDefaultExpirationSettings) { return JSON.stringify(PatchTeamDefaultExpirationSettings$outboundSchema.parse(patchTeamDefaultExpirationSettings)); } /** @internal */ export const PatchTeamEnvironments2$outboundSchema = z.object({ type: z.literal("custom"), environmentId: z.string(), }); export function patchTeamEnvironments2ToJSON(patchTeamEnvironments2) { return JSON.stringify(PatchTeamEnvironments2$outboundSchema.parse(patchTeamEnvironments2)); } /** @internal */ export const PatchTeamEnvironmentsTarget$outboundSchema = z.nativeEnum(PatchTeamEnvironmentsTarget); /** @internal */ export const PatchTeamEnvironments1$outboundSchema = z.object({ type: z.literal("system"), target: PatchTeamEnvironmentsTarget$outboundSchema, }); export function patchTeamEnvironments1ToJSON(patchTeamEnvironments1) { return JSON.stringify(PatchTeamEnvironments1$outboundSchema.parse(patchTeamEnvironments1)); } /** @internal */ export const PatchTeamGitSourcesEnvironments$outboundSchema = z.union([ z.lazy(() => PatchTeamEnvironments1$outboundSchema), z.lazy(() => PatchTeamEnvironments2$outboundSchema), ]); export function patchTeamGitSourcesEnvironmentsToJSON(patchTeamGitSourcesEnvironments) { return JSON.stringify(PatchTeamGitSourcesEnvironments$outboundSchema.parse(patchTeamGitSourcesEnvironments)); } /** @internal */ export const PatchTeamSources2$outboundSchema = z.object({ provider: z.literal("gitlab"), namespace: z.string(), project: z.string().optional(), }); export function patchTeamSources2ToJSON(patchTeamSources2) { return JSON.stringify(PatchTeamSources2$outboundSchema.parse(patchTeamSources2)); } /** @internal */ export const PatchTeamSourcesProvider$outboundSchema = z.nativeEnum(PatchTeamSourcesProvider); /** @internal */ export const PatchTeamSources1$outboundSchema = z.object({ provider: PatchTeamSourcesProvider$outboundSchema, org: z.string(), repo: z.string().optional(), }); export function patchTeamSources1ToJSON(patchTeamSources1) { return JSON.stringify(PatchTeamSources1$outboundSchema.parse(patchTeamSources1)); } /** @internal */ export const PatchTeamGitSourcesSources$outboundSchema = z.union([ z.lazy(() => PatchTeamSources1$outboundSchema).and(z.object({ provider: z.literal("github") })), z.lazy(() => PatchTeamSources1$outboundSchema).and(z.object({ provider: z.literal("bitbucket") })), z.lazy(() => PatchTeamSources2$outboundSchema), ]); export function patchTeamGitSourcesSourcesToJSON(patchTeamGitSourcesSources) { return JSON.stringify(PatchTeamGitSourcesSources$outboundSchema.parse(patchTeamGitSourcesSources)); } /** @internal */ export const PatchTeamGitSources1$outboundSchema = z.object({ enabled: z.boolean(), environments: z.array(z.union([ z.lazy(() => PatchTeamEnvironments1$outboundSchema), z.lazy(() => PatchTeamEnvironments2$outboundSchema), ])), sources: z.array(z.union([ z.lazy(() => PatchTeamSources1$outboundSchema).and(z.object({ provider: z.literal("github") })), z.lazy(() => PatchTeamSources1$outboundSchema).and(z.object({ provider: z.literal("bitbucket") })), z.lazy(() => PatchTeamSources2$outboundSchema), ])), }); export function patchTeamGitSources1ToJSON(patchTeamGitSources1) { return JSON.stringify(PatchTeamGitSources1$outboundSchema.parse(patchTeamGitSources1)); } /** @internal */ export const PatchTeamDeploymentPolicyGitSources$outboundSchema = smartUnion([ z.array(z.lazy(() => PatchTeamGitSources1$outboundSchema)), z.string(), ]); export function patchTeamDeploymentPolicyGitSourcesToJSON(patchTeamDeploymentPolicyGitSources) { return JSON.stringify(PatchTeamDeploymentPolicyGitSources$outboundSchema.parse(patchTeamDeploymentPolicyGitSources)); } /** @internal */ export const PatchTeamEnvironmentsTeams2$outboundSchema = z.object({ type: z.literal("custom"), environmentId: z.string(), }); export function patchTeamEnvironmentsTeams2ToJSON(patchTeamEnvironmentsTeams2) { return JSON.stringify(PatchTeamEnvironmentsTeams2$outboundSchema.parse(patchTeamEnvironmentsTeams2)); } /** @internal */ export const PatchTeamEnvironmentsTeamsTarget$outboundSchema = z.nativeEnum(PatchTeamEnvironmentsTeamsTarget); /** @internal */ export const PatchTeamEnvironmentsTeams1$outboundSchema = z.object({ type: z.literal("system"), target: PatchTeamEnvironmentsTeamsTarget$outboundSchema, }); export function patchTeamEnvironmentsTeams1ToJSON(patchTeamEnvironmentsTeams1) { return JSON.stringify(PatchTeamEnvironmentsTeams1$outboundSchema.parse(patchTeamEnvironmentsTeams1)); } /** @internal */ export const PatchTeamDeploymentSourcesEnvironments$outboundSchema = z.union([ z.lazy(() => PatchTeamEnvironmentsTeams1$outboundSchema), z.lazy(() => PatchTeamEnvironmentsTeams2$outboundSchema), ]); export function patchTeamDeploymentSourcesEnvironmentsToJSON(patchTeamDeploymentSourcesEnvironments) { return JSON.stringify(PatchTeamDeploymentSourcesEnvironments$outboundSchema.parse(patchTeamDeploymentSourcesEnvironments)); } /** @internal */ export const PatchTeamDeploymentSourcesSources$outboundSchema = z.nativeEnum(PatchTeamDeploymentSourcesSources); /** @internal */ export const PatchTeamDeploymentSources1$outboundSchema = z.object({ enabled: z.boolean(), environments: z.array(z.union([ z.lazy(() => PatchTeamEnvironmentsTeams1$outboundSchema), z.lazy(() => PatchTeamEnvironmentsTeams2$outboundSchema), ])), sources: z.array(PatchTeamDeploymentSourcesSources$outboundSchema), }); export function patchTeamDeploymentSources1ToJSON(patchTeamDeploymentSources1) { return JSON.stringify(PatchTeamDeploymentSources1$outboundSchema.parse(patchTeamDeploymentSources1)); } /** @internal */ export const PatchTeamDeploymentPolicyDeploymentSources$outboundSchema = smartUnion([ z.array(z.lazy(() => PatchTeamDeploymentSources1$outboundSchema)), z.string(), ]); export function patchTeamDeploymentPolicyDeploymentSourcesToJSON(patchTeamDeploymentPolicyDeploymentSources) { return JSON.stringify(PatchTeamDeploymentPolicyDeploymentSources$outboundSchema.parse(patchTeamDeploymentPolicyDeploymentSources)); } /** @internal */ export const PatchTeamDeploymentPolicy1$outboundSchema = z.object({ gitSources: smartUnion([ z.array(z.lazy(() => PatchTeamGitSources1$outboundSchema)), z.string(), ]).optional(), deploymentSources: smartUnion([ z.array(z.lazy(() => PatchTeamDeploymentSources1$outboundSchema)), z.string(), ]).optional(), }); export function patchTeamDeploymentPolicy1ToJSON(patchTeamDeploymentPolicy1) { return JSON.stringify(PatchTeamDeploymentPolicy1$outboundSchema.parse(patchTeamDeploymentPolicy1)); } /** @internal */ export const PatchTeamDeploymentPolicy$outboundSchema = smartUnion([ z.lazy(() => PatchTeamDeploymentPolicy1$outboundSchema), z.string(), ]); export function patchTeamDeploymentPolicyToJSON(patchTeamDeploymentPolicy) { return JSON.stringify(PatchTeamDeploymentPolicy$outboundSchema.parse(patchTeamDeploymentPolicy)); } /** @internal */ export const PatchTeamStrictDeploymentProtectionSettings$outboundSchema = z.object({ enabled: z.boolean(), }); export function patchTeamStrictDeploymentProtectionSettingsToJSON(patchTeamStrictDeploymentProtectionSettings) { return JSON.stringify(PatchTeamStrictDeploymentProtectionSettings$outboundSchema.parse(patchTeamStrictDeploymentProtectionSettings)); } /** @internal */ export const PatchTeamStrictShareableLinks$outboundSchema = z.object({ enabled: z.boolean(), }); export function patchTeamStrictShareableLinksToJSON(patchTeamStrictShareableLinks) { return JSON.stringify(PatchTeamStrictShareableLinks$outboundSchema.parse(patchTeamStrictShareableLinks)); } /** @internal */ export const PatchTeamStrictPasswordProtectionSettings$outboundSchema = z.object({ enabled: z.boolean(), }); export function patchTeamStrictPasswordProtectionSettingsToJSON(patchTeamStrictPasswordProtectionSettings) { return JSON.stringify(PatchTeamStrictPasswordProtectionSettings$outboundSchema.parse(patchTeamStrictPasswordProtectionSettings)); } /** @internal */ export const PatchTeamStrictConnectors$outboundSchema = z.object({ enabled: z.boolean(), }); export function patchTeamStrictConnectorsToJSON(patchTeamStrictConnectors) { return JSON.stringify(PatchTeamStrictConnectors$outboundSchema.parse(patchTeamStrictConnectors)); } /** @internal */ export const NsnbConfigPreference$outboundSchema = z.nativeEnum(NsnbConfigPreference); /** @internal */ export const NsnbConfig1$outboundSchema = z.object({ preference: NsnbConfigPreference$outboundSchema, }); export function nsnbConfig1ToJSON(nsnbConfig1) { return JSON.stringify(NsnbConfig1$outboundSchema.parse(nsnbConfig1)); } /** @internal */ export const PatchTeamNsnbConfig$outboundSchema = smartUnion([z.lazy(() => NsnbConfig1$outboundSchema), z.string()]); export function patchTeamNsnbConfigToJSON(patchTeamNsnbConfig) { return JSON.stringify(PatchTeamNsnbConfig$outboundSchema.parse(patchTeamNsnbConfig)); } /** @internal */ export const DefaultProjectJobsLint$outboundSchema = z.object({ targets: z.array(z.string()), }); export function defaultProjectJobsLintToJSON(defaultProjectJobsLint) { return JSON.stringify(DefaultProjectJobsLint$outboundSchema.parse(defaultProjectJobsLint)); } /** @internal */ export const DefaultProjectJobsTypecheck$outboundSchema = z.object({ targets: z.array(z.string()), }); export function defaultProjectJobsTypecheckToJSON(defaultProjectJobsTypecheck) { return JSON.stringify(DefaultProjectJobsTypecheck$outboundSchema.parse(defaultProjectJobsTypecheck)); } /** @internal */ export const DefaultProjectJobs1$outboundSchema = z.object({ lint: z.lazy(() => DefaultProjectJobsLint$outboundSchema).optional(), typecheck: z.lazy(() => DefaultProjectJobsTypecheck$outboundSchema) .optional(), }); export function defaultProjectJobs1ToJSON(defaultProjectJobs1) { return JSON.stringify(DefaultProjectJobs1$outboundSchema.parse(defaultProjectJobs1)); } /** @internal */ export const PatchTeamDefaultProjectJobs$outboundSchema = smartUnion([z.lazy(() => DefaultProjectJobs1$outboundSchema), z.string()]); export function patchTeamDefaultProjectJobsToJSON(patchTeamDefaultProjectJobs) { return JSON.stringify(PatchTeamDefaultProjectJobs$outboundSchema.parse(patchTeamDefaultProjectJobs)); } /** @internal */ export const PatchTeamDefault$outboundSchema = z.nativeEnum(PatchTeamDefault); /** @internal */ export const PatchTeamBuildMachine$outboundSchema = z.object({ default: PatchTeamDefault$outboundSchema.optional(), }); export function patchTeamBuildMachineToJSON(patchTeamBuildMachine) { return JSON.stringify(PatchTeamBuildMachine$outboundSchema.parse(patchTeamBuildMachine)); } /** @internal */ export const PatchTeamResourceConfig$outboundSchema = z.object({ buildMachine: z.lazy(() => PatchTeamBuildMachine$outboundSchema).optional(), }); export function patchTeamResourceConfigToJSON(patchTeamResourceConfig) { return JSON.stringify(PatchTeamResourceConfig$outboundSchema.parse(patchTeamResourceConfig)); } /** @internal */ export const PatchTeamRequestBody$outboundSchema = z.object({ avatar: z.nullable(z.string()).optional(), description: z.string().optional(), emailDomain: z.nullable(z.string()).optional(), name: z.string().optional(), previewDeploymentSuffix: z.nullable(z.string()).optional(), regenerateInviteCode: z.boolean().optional(), saml: z.lazy(() => PatchTeamSaml$outboundSchema).optional(), slug: z.string().optional(), enablePreviewFeedback: z.string().optional(), enableProductionFeedback: z.string().optional(), sensitiveEnvironmentVariablePolicy: z.string().optional(), disjunctiveProductionSecretPolicy: z.string().optional(), remoteCaching: z.lazy(() => PatchTeamRemoteCaching$outboundSchema).optional(), hideIpAddresses: z.boolean().optional(), hideIpAddressesInLogDrains: z.boolean().optional(), dpAccessRequestsMode: PatchTeamDpAccessRequestsMode$outboundSchema.optional(), requireVerifiedCommits: z.boolean().optional(), disableRepositoryDispatchEvents: z.boolean().optional(), defaultDeploymentProtection: z.lazy(() => PatchTeamDefaultDeploymentProtection$outboundSchema).optional(), defaultPassport: z.nullable(z.lazy(() => PatchTeamDefaultPassport$outboundSchema)).optional(), defaultExpirationSettings: z.lazy(() => PatchTeamDefaultExpirationSettings$outboundSchema).optional(), deploymentPolicy: smartUnion([ z.lazy(() => PatchTeamDeploymentPolicy1$outboundSchema), z.string(), ]).optional(), strictDeploymentProtectionSettings: z.lazy(() => PatchTeamStrictDeploymentProtectionSettings$outboundSchema).optional(), strictShareableLinks: z.lazy(() => PatchTeamStrictShareableLinks$outboundSchema).optional(), strictPasswordProtectionSettings: z.lazy(() => PatchTeamStrictPasswordProtectionSettings$outboundSchema).optional(), strictConnectors: z.lazy(() => PatchTeamStrictConnectors$outboundSchema) .optional(), nsnbConfig: smartUnion([z.lazy(() => NsnbConfig1$outboundSchema), z.string()]) .optional(), defaultProjectJobs: smartUnion([ z.lazy(() => DefaultProjectJobs1$outboundSchema), z.string(), ]).optional(), resourceConfig: z.lazy(() => PatchTeamResourceConfig$outboundSchema) .optional(), }); export function patchTeamRequestBodyToJSON(patchTeamRequestBody) { return JSON.stringify(PatchTeamRequestBody$outboundSchema.parse(patchTeamRequestBody)); } /** @internal */ export const PatchTeamRequest$outboundSchema = z.object({ teamId: z.string(), slug: z.string().optional(), requestBody: z.lazy(() => PatchTeamRequestBody$outboundSchema), }).transform((v) => { return remap$(v, { requestBody: "RequestBody", }); }); export function patchTeamRequestToJSON(patchTeamRequest) { return JSON.stringify(PatchTeamRequest$outboundSchema.parse(patchTeamRequest)); } //# sourceMappingURL=patchteamop.js.map