@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>
232 lines • 14.6 kB
JavaScript
/*
* 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";
import { smartUnion } from "../types/smartUnion.js";
import { GetProjectAbuse$inboundSchema, GetProjectDefaultResourceConfig$inboundSchema, GetProjectDeploymentPolicy$inboundSchema, GetProjectFeatures$inboundSchema, GetProjectGitComments$inboundSchema, GetProjectGitProviderOptions$inboundSchema, GetProjectInternalRoutesHas$inboundSchema, GetProjectInternalRoutesMitigate$inboundSchema, GetProjectLastAliasRequest$inboundSchema, GetProjectLastRollbackTarget$inboundSchema, GetProjectOidcTokenConfig$inboundSchema, GetProjectPermissions$inboundSchema, GetProjectProtectionBypass$inboundSchema, GetProjectSecurity$inboundSchema, GetProjectSsoProtection$inboundSchema, GetProjectStaticIps$inboundSchema, GetProjectTargets$inboundSchema, GetProjectTier$inboundSchema, GetProjectTrustedIps$inboundSchema, GetProjectTrustedSources$inboundSchema, GetProjectUsageStatus$inboundSchema, GetProjectWebAnalytics$inboundSchema, } from "./getprojectinternalroutesmitigate.js";
import { GetProjectAlias$inboundSchema, GetProjectAnalytics$inboundSchema, GetProjectBlobs$inboundSchema, GetProjectConnectConfigurations$inboundSchema, GetProjectCreator$inboundSchema, GetProjectCrons$inboundSchema, GetProjectCustomEnvironments$inboundSchema, GetProjectDataCache$inboundSchema, GetProjectDeploymentExpiration$inboundSchema, GetProjectEnv$inboundSchema, GetProjectExpiration$inboundSchema, GetProjectFramework$inboundSchema, GetProjectIntegrations$inboundSchema, GetProjectIpBuckets$inboundSchema, GetProjectJobs$inboundSchema, GetProjectLatestDeployments$inboundSchema, GetProjectLink$inboundSchema, GetProjectMicrofrontends$inboundSchema, GetProjectNodeVersion$inboundSchema, GetProjectOptionsAllowlist$inboundSchema, GetProjectPassport$inboundSchema, GetProjectPasswordProtection$inboundSchema, GetProjectProtectionConfig$inboundSchema, GetProjectResourceConfig$inboundSchema, GetProjectRollbackDescription$inboundSchema, GetProjectRollingRelease$inboundSchema, GetProjectSandbox$inboundSchema, GetProjectServices$inboundSchema, GetProjectSpeedInsights$inboundSchema, } from "./getprojectrollingrelease.js";
export const GetProjectAction = {
Accept: "accept",
Cancel: "cancel",
Delete: "delete",
};
export const GetProjectProjectsEnv = {
Preview: "preview",
Production: "production",
};
/**
* Which tracing destination this rule applies to. `internal` is the hidden Vercel production-tracing drain (internal delivery); `external` is any customer-configured drain. Derived from the owning drain's delivery type when project tracing is computed; absent on configs persisted before this field existed.
*/
export const GetProjectDestination = {
External: "external",
Internal: "internal",
};
/** @internal */
export const GetProjectInternalRoutes2$inboundSchema = z.object({
has: z.array(GetProjectInternalRoutesHas$inboundSchema),
mitigate: GetProjectInternalRoutesMitigate$inboundSchema,
src: types.optional(types.string()),
});
export function getProjectInternalRoutes2FromJSON(jsonString) {
return safeParse(jsonString, (x) => GetProjectInternalRoutes2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectInternalRoutes2' from JSON`);
}
/** @internal */
export const GetProjectInternalRoutes1$inboundSchema = z.object({
src: types.string(),
status: types.number(),
expiry: types.optional(types.number()),
});
export function getProjectInternalRoutes1FromJSON(jsonString) {
return safeParse(jsonString, (x) => GetProjectInternalRoutes1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectInternalRoutes1' from JSON`);
}
/** @internal */
export const GetProjectInternalRoutes$inboundSchema = smartUnion([
z.lazy(() => GetProjectInternalRoutes1$inboundSchema),
z.lazy(() => GetProjectInternalRoutes2$inboundSchema),
]);
export function getProjectInternalRoutesFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetProjectInternalRoutes$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectInternalRoutes' from JSON`);
}
/** @internal */
export const GetProjectAction$inboundSchema = z.nativeEnum(GetProjectAction);
/** @internal */
export const ValuePreviousValue$inboundSchema = smartUnion([types.string(), types.number(), types.boolean()]);
export function valuePreviousValueFromJSON(jsonString) {
return safeParse(jsonString, (x) => ValuePreviousValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ValuePreviousValue' from JSON`);
}
/** @internal */
export const ValueCurrentValue$inboundSchema = smartUnion([types.string(), types.number(), types.boolean()]);
export function valueCurrentValueFromJSON(jsonString) {
return safeParse(jsonString, (x) => ValueCurrentValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ValueCurrentValue' from JSON`);
}
/** @internal */
export const GetProjectValue3$inboundSchema = z.object({
previousValue: smartUnion([types.string(), types.number(), types.boolean()]),
currentValue: smartUnion([types.string(), types.number(), types.boolean()]),
});
export function getProjectValue3FromJSON(jsonString) {
return safeParse(jsonString, (x) => GetProjectValue3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectValue3' from JSON`);
}
/** @internal */
export const GetProjectValue$inboundSchema = smartUnion([
z.lazy(() => GetProjectValue3$inboundSchema),
types.string(),
types.number(),
types.boolean(),
]);
export function getProjectValueFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetProjectValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectValue' from JSON`);
}
/** @internal */
export const GetProjectDismissedToasts$inboundSchema = z.object({
key: types.string(),
dismissedAt: types.number(),
action: GetProjectAction$inboundSchema,
value: types.nullable(smartUnion([
z.lazy(() => GetProjectValue3$inboundSchema),
types.string(),
types.number(),
types.boolean(),
])),
});
export function getProjectDismissedToastsFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetProjectDismissedToasts$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectDismissedToasts' from JSON`);
}
/** @internal */
export const GetProjectProjectsEnv$inboundSchema = z.nativeEnum(GetProjectProjectsEnv);
/** @internal */
export const GetProjectDestination$inboundSchema = z.nativeEnum(GetProjectDestination);
/** @internal */
export const GetProjectSamplingRules$inboundSchema = z.object({
rate: types.number(),
env: types.optional(GetProjectProjectsEnv$inboundSchema),
requestPath: types.optional(types.string()),
destination: types.optional(GetProjectDestination$inboundSchema),
});
export function getProjectSamplingRulesFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetProjectSamplingRules$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectSamplingRules' from JSON`);
}
/** @internal */
export const GetProjectTracing$inboundSchema = z.object({
domains: types.optional(types.string()),
ignorePaths: types.optional(z.array(types.string())),
samplingRules: types.optional(z.array(z.lazy(() => GetProjectSamplingRules$inboundSchema))),
});
export function getProjectTracingFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetProjectTracing$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectTracing' from JSON`);
}
/** @internal */
export const GetProjectResponseBody$inboundSchema = z.object({
integrations: types.optional(z.array(GetProjectIntegrations$inboundSchema)),
accountId: types.string(),
creator: types.optional(GetProjectCreator$inboundSchema),
alias: z.array(GetProjectAlias$inboundSchema),
analytics: types.optional(GetProjectAnalytics$inboundSchema),
appliedCve55182Migration: types.optional(types.boolean()),
speedInsights: types.optional(GetProjectSpeedInsights$inboundSchema),
autoExposeSystemEnvs: types.optional(types.boolean()),
autoAssignCustomDomains: types.optional(types.boolean()),
autoAssignCustomDomainsUpdatedBy: types.optional(types.string()),
buildCommand: z.nullable(types.string()).optional(),
commandForIgnoringBuildStep: z.nullable(types.string()).optional(),
connectConfigurations: z.nullable(z.array(GetProjectConnectConfigurations$inboundSchema)).optional(),
connectConfigurationId: z.nullable(types.string()).optional(),
connectBuildsEnabled: types.optional(types.boolean()),
passiveConnectConfigurationId: z.nullable(types.string()).optional(),
createdAt: types.optional(types.number()),
customerSupportCodeVisibility: types.optional(types.boolean()),
crons: types.optional(GetProjectCrons$inboundSchema),
dataCache: types.optional(GetProjectDataCache$inboundSchema),
deploymentExpiration: GetProjectDeploymentExpiration$inboundSchema,
expiration: types.optional(GetProjectExpiration$inboundSchema),
devCommand: z.nullable(types.string()).optional(),
directoryListing: types.boolean(),
installCommand: z.nullable(types.string()).optional(),
env: types.optional(z.array(GetProjectEnv$inboundSchema)),
customEnvironments: types.optional(z.array(GetProjectCustomEnvironments$inboundSchema)),
framework: z.nullable(GetProjectFramework$inboundSchema).optional(),
services: types.optional(z.array(GetProjectServices$inboundSchema)),
gitForkProtection: types.optional(types.boolean()),
gitLFS: types.optional(types.boolean()),
id: types.string(),
ipBuckets: types.optional(z.array(GetProjectIpBuckets$inboundSchema)),
jobs: types.optional(GetProjectJobs$inboundSchema),
latestDeployments: types.optional(z.array(GetProjectLatestDeployments$inboundSchema)),
link: types.optional(GetProjectLink$inboundSchema),
blobs: types.optional(GetProjectBlobs$inboundSchema),
microfrontends: types.optional(GetProjectMicrofrontends$inboundSchema),
name: types.string(),
nodeVersion: GetProjectNodeVersion$inboundSchema,
optionsAllowlist: z.nullable(GetProjectOptionsAllowlist$inboundSchema)
.optional(),
outputDirectory: z.nullable(types.string()).optional(),
passwordProtection: z.nullable(GetProjectPasswordProtection$inboundSchema)
.optional(),
passport: z.nullable(GetProjectPassport$inboundSchema).optional(),
protectionConfig: types.optional(GetProjectProtectionConfig$inboundSchema),
sandbox: types.optional(GetProjectSandbox$inboundSchema),
productionDeploymentsFastLane: types.optional(types.boolean()),
resourceConfig: GetProjectResourceConfig$inboundSchema,
rollbackDescription: types.optional(GetProjectRollbackDescription$inboundSchema),
rollingRelease: z.nullable(GetProjectRollingRelease$inboundSchema).optional(),
defaultResourceConfig: GetProjectDefaultResourceConfig$inboundSchema,
rootDirectory: z.nullable(types.string()).optional(),
serverlessFunctionZeroConfigFailover: types.optional(types.boolean()),
skewProtectionBoundaryAt: types.optional(types.number()),
skewProtectionMaxAge: types.optional(types.number()),
skewProtectionAllowedDomains: types.optional(z.array(types.string())),
skipGitConnectDuringLink: types.optional(types.boolean()),
staticIps: types.optional(GetProjectStaticIps$inboundSchema),
sourceFilesOutsideRootDirectory: types.optional(types.boolean()),
enableAffectedProjectsDeployments: types.optional(types.boolean()),
enableExternalRewriteCaching: types.optional(types.boolean()),
ssoProtection: z.nullable(GetProjectSsoProtection$inboundSchema).optional(),
targets: types.optional(z.record(types.nullable(GetProjectTargets$inboundSchema))),
transferCompletedAt: types.optional(types.number()),
transferStartedAt: types.optional(types.number()),
transferToAccountId: types.optional(types.string()),
transferredFromAccountId: types.optional(types.string()),
updatedAt: types.optional(types.number()),
live: types.optional(types.boolean()),
enablePreviewFeedback: z.nullable(types.boolean()).optional(),
enableProductionFeedback: z.nullable(types.boolean()).optional(),
permissions: types.optional(GetProjectPermissions$inboundSchema),
lastRollbackTarget: z.nullable(GetProjectLastRollbackTarget$inboundSchema)
.optional(),
lastAliasRequest: z.nullable(GetProjectLastAliasRequest$inboundSchema)
.optional(),
protectionBypass: types.optional(z.record(GetProjectProtectionBypass$inboundSchema)),
hasActiveBranches: types.optional(types.boolean()),
trustedIps: z.nullable(GetProjectTrustedIps$inboundSchema).optional(),
trustedSources: z.nullable(GetProjectTrustedSources$inboundSchema).optional(),
gitComments: types.optional(GetProjectGitComments$inboundSchema),
gitProviderOptions: types.optional(GetProjectGitProviderOptions$inboundSchema),
paused: types.optional(types.boolean()),
concurrencyBucketName: types.optional(types.string()),
webAnalytics: types.optional(GetProjectWebAnalytics$inboundSchema),
security: types.optional(GetProjectSecurity$inboundSchema),
oidcTokenConfig: types.optional(GetProjectOidcTokenConfig$inboundSchema),
deploymentPolicy: z.nullable(GetProjectDeploymentPolicy$inboundSchema)
.optional(),
tier: types.optional(GetProjectTier$inboundSchema),
usageStatus: types.optional(GetProjectUsageStatus$inboundSchema),
features: types.optional(GetProjectFeatures$inboundSchema),
v0: types.optional(types.boolean()),
v0Created: types.optional(types.boolean()),
abuse: types.optional(GetProjectAbuse$inboundSchema),
internalRoutes: types.optional(z.array(smartUnion([
z.lazy(() => GetProjectInternalRoutes1$inboundSchema),
z.lazy(() => GetProjectInternalRoutes2$inboundSchema),
]))),
hasDeployments: types.optional(types.boolean()),
dismissedToasts: types.optional(z.array(z.lazy(() => GetProjectDismissedToasts$inboundSchema))),
protectedSourcemaps: types.optional(types.boolean()),
tracing: types.optional(z.lazy(() => GetProjectTracing$inboundSchema)),
avatar: z.nullable(types.string()).optional(),
});
export function getProjectResponseBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetProjectResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetProjectResponseBody' from JSON`);
}
//# sourceMappingURL=getprojectresponsebody.js.map