@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>
307 lines • 14.9 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";
export const Reason = {
BlockedForPlatformAbuse: "BLOCKED_FOR_PLATFORM_ABUSE",
EnterpriseTrialEnded: "ENTERPRISE_TRIAL_ENDED",
EnterpriseUnpaidInvoice: "ENTERPRISE_UNPAID_INVOICE",
ExposureCapExceeded: "EXPOSURE_CAP_EXCEEDED",
FairUseLimitsExceeded: "FAIR_USE_LIMITS_EXCEEDED",
SubscriptionCanceled: "SUBSCRIPTION_CANCELED",
SubscriptionExpired: "SUBSCRIPTION_EXPIRED",
UnpaidInvoice: "UNPAID_INVOICE",
};
export const BlockedDueToOverageType = {
AnalyticsUsage: "analyticsUsage",
Artifacts: "artifacts",
Bandwidth: "bandwidth",
BlobDataTransfer: "blobDataTransfer",
BlobTotalAdvancedRequests: "blobTotalAdvancedRequests",
BlobTotalAvgSizeInBytes: "blobTotalAvgSizeInBytes",
BlobTotalGetResponseObjectSizeInBytes: "blobTotalGetResponseObjectSizeInBytes",
BlobTotalSimpleRequests: "blobTotalSimpleRequests",
ConnectDataTransfer: "connectDataTransfer",
DataCacheRead: "dataCacheRead",
DataCacheWrite: "dataCacheWrite",
EdgeConfigRead: "edgeConfigRead",
EdgeConfigWrite: "edgeConfigWrite",
EdgeFunctionExecutionUnits: "edgeFunctionExecutionUnits",
EdgeMiddlewareInvocations: "edgeMiddlewareInvocations",
EdgeRequest: "edgeRequest",
EdgeRequestAdditionalCpuDuration: "edgeRequestAdditionalCpuDuration",
ElasticConcurrencyBuildSlots: "elasticConcurrencyBuildSlots",
FastDataTransfer: "fastDataTransfer",
FastOriginTransfer: "fastOriginTransfer",
FluidCpuDuration: "fluidCpuDuration",
FluidDuration: "fluidDuration",
FunctionDuration: "functionDuration",
FunctionInvocation: "functionInvocation",
ImageOptimizationCacheRead: "imageOptimizationCacheRead",
ImageOptimizationCacheWrite: "imageOptimizationCacheWrite",
ImageOptimizationTransformation: "imageOptimizationTransformation",
LogDrainsVolume: "logDrainsVolume",
MonitoringMetric: "monitoringMetric",
ObservabilityEvent: "observabilityEvent",
OnDemandConcurrencyMinutes: "onDemandConcurrencyMinutes",
RuntimeCacheRead: "runtimeCacheRead",
RuntimeCacheWrite: "runtimeCacheWrite",
ServerlessFunctionExecution: "serverlessFunctionExecution",
SourceImages: "sourceImages",
WafOwaspExcessBytes: "wafOwaspExcessBytes",
WafOwaspRequests: "wafOwaspRequests",
WafRateLimitRequest: "wafRateLimitRequest",
WebAnalyticsEvent: "webAnalyticsEvent",
};
/**
* An object containing infomation related to the amount of platform resources may be allocated to the User account.
*/
export const AuthUserConfiguration = {
SkipNamespaceQueue: "SKIP_NAMESPACE_QUEUE",
WaitForNamespaceQueue: "WAIT_FOR_NAMESPACE_QUEUE",
};
export const ViewPreference = {
Cards: "cards",
List: "list",
};
export const FavoritesViewPreference = {
Closed: "closed",
Open: "open",
};
export const RecentsViewPreference = {
Closed: "closed",
Open: "open",
};
export const ImportFlowGitProvider = {
Bitbucket: "bitbucket",
Github: "github",
GithubCustomHost: "github-custom-host",
GithubLimited: "github-limited",
Gitlab: "gitlab",
Vercel: "vercel",
};
/** @internal */
export const Reason$inboundSchema = z
.nativeEnum(Reason);
/** @internal */
export const BlockedDueToOverageType$inboundSchema = z.nativeEnum(BlockedDueToOverageType);
/** @internal */
export const SoftBlock$inboundSchema = z.object({
blockedAt: types.number(),
reason: Reason$inboundSchema,
blockedDueToOverageType: types.optional(BlockedDueToOverageType$inboundSchema),
});
export function softBlockFromJSON(jsonString) {
return safeParse(jsonString, (x) => SoftBlock$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SoftBlock' from JSON`);
}
/** @internal */
export const Billing$inboundSchema = z.object({});
export function billingFromJSON(jsonString) {
return safeParse(jsonString, (x) => Billing$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Billing' from JSON`);
}
/** @internal */
export const AuthUserBuildEntitlements$inboundSchema = z.object({
enhancedBuilds: types.optional(types.boolean()),
});
export function authUserBuildEntitlementsFromJSON(jsonString) {
return safeParse(jsonString, (x) => AuthUserBuildEntitlements$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuthUserBuildEntitlements' from JSON`);
}
/** @internal */
export const AuthUserConfiguration$inboundSchema = z.nativeEnum(AuthUserConfiguration);
/** @internal */
export const BuildQueue$inboundSchema = z.object({
configuration: types.optional(AuthUserConfiguration$inboundSchema),
});
export function buildQueueFromJSON(jsonString) {
return safeParse(jsonString, (x) => BuildQueue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BuildQueue' from JSON`);
}
/** @internal */
export const AuthUserSecurity$inboundSchema = z.object({
customRules: types.optional(types.number()),
ipBlocks: types.optional(types.number()),
ipBypass: types.optional(types.number()),
rateLimit: types.optional(types.number()),
});
export function authUserSecurityFromJSON(jsonString) {
return safeParse(jsonString, (x) => AuthUserSecurity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuthUserSecurity' from JSON`);
}
/** @internal */
export const AuthUserResourceConfig$inboundSchema = z.object({
nodeType: types.optional(types.string()),
concurrentBuilds: types.optional(types.number()),
elasticConcurrencyEnabled: types.optional(types.boolean()),
buildEntitlements: types.optional(z.lazy(() => AuthUserBuildEntitlements$inboundSchema)),
buildQueue: types.optional(z.lazy(() => BuildQueue$inboundSchema)),
awsAccountType: types.optional(types.string()),
awsAccountIds: types.optional(z.array(types.string())),
cfZoneName: types.optional(types.string()),
imageOptimizationType: types.optional(types.string()),
edgeConfigs: types.optional(types.number()),
edgeConfigSize: types.optional(types.number()),
edgeFunctionMaxSizeBytes: types.optional(types.number()),
edgeFunctionExecutionTimeoutMs: types.optional(types.number()),
serverlessFunctionMaxMemorySize: types.optional(types.number()),
kvDatabases: types.optional(types.number()),
postgresDatabases: types.optional(types.number()),
blobStores: types.optional(types.number()),
integrationStores: types.optional(types.number()),
cronJobsPerProject: types.optional(types.number()),
microfrontendGroupsPerTeam: types.optional(types.number()),
microfrontendProjectsPerGroup: types.optional(types.number()),
flagsExplorerOverridesThreshold: types.optional(types.number()),
flagsExplorerUnlimitedOverrides: types.optional(types.boolean()),
customEnvironmentsPerProject: types.optional(types.number()),
security: types.optional(z.lazy(() => AuthUserSecurity$inboundSchema)),
bulkRedirectsFreeLimitOverride: types.optional(types.number()),
});
export function authUserResourceConfigFromJSON(jsonString) {
return safeParse(jsonString, (x) => AuthUserResourceConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuthUserResourceConfig' from JSON`);
}
/** @internal */
export const ViewPreference$inboundSchema = z.nativeEnum(ViewPreference);
/** @internal */
export const FavoritesViewPreference$inboundSchema = z.nativeEnum(FavoritesViewPreference);
/** @internal */
export const RecentsViewPreference$inboundSchema = z.nativeEnum(RecentsViewPreference);
/** @internal */
export const ActiveDashboardViews$inboundSchema = z.object({
scopeId: types.string(),
viewPreference: z.nullable(ViewPreference$inboundSchema).optional(),
favoritesViewPreference: z.nullable(FavoritesViewPreference$inboundSchema)
.optional(),
recentsViewPreference: z.nullable(RecentsViewPreference$inboundSchema)
.optional(),
});
export function activeDashboardViewsFromJSON(jsonString) {
return safeParse(jsonString, (x) => ActiveDashboardViews$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ActiveDashboardViews' from JSON`);
}
/** @internal */
export const ImportFlowGitNamespace$inboundSchema = smartUnion([types.string(), types.number()]);
export function importFlowGitNamespaceFromJSON(jsonString) {
return safeParse(jsonString, (x) => ImportFlowGitNamespace$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImportFlowGitNamespace' from JSON`);
}
/** @internal */
export const ImportFlowGitNamespaceId$inboundSchema = smartUnion([types.string(), types.number()]);
export function importFlowGitNamespaceIdFromJSON(jsonString) {
return safeParse(jsonString, (x) => ImportFlowGitNamespaceId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ImportFlowGitNamespaceId' from JSON`);
}
/** @internal */
export const ImportFlowGitProvider$inboundSchema = z.nativeEnum(ImportFlowGitProvider);
/** @internal */
export const GitNamespaceId$inboundSchema = smartUnion([types.string(), types.number()]);
export function gitNamespaceIdFromJSON(jsonString) {
return safeParse(jsonString, (x) => GitNamespaceId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GitNamespaceId' from JSON`);
}
/** @internal */
export const PreferredScopesAndGitNamespaces$inboundSchema = z.object({
scopeId: types.string(),
gitNamespaceId: types.nullable(smartUnion([types.string(), types.number()])),
});
export function preferredScopesAndGitNamespacesFromJSON(jsonString) {
return safeParse(jsonString, (x) => PreferredScopesAndGitNamespaces$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PreferredScopesAndGitNamespaces' from JSON`);
}
/** @internal */
export const Dismissals$inboundSchema = z.object({
scopeId: types.string(),
createdAt: types.number(),
});
export function dismissalsFromJSON(jsonString) {
return safeParse(jsonString, (x) => Dismissals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Dismissals' from JSON`);
}
/** @internal */
export const DismissedToasts$inboundSchema = z.object({
name: types.string(),
dismissals: z.array(z.lazy(() => Dismissals$inboundSchema)),
});
export function dismissedToastsFromJSON(jsonString) {
return safeParse(jsonString, (x) => DismissedToasts$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DismissedToasts' from JSON`);
}
/** @internal */
export const FavoriteProjectsAndSpaces$inboundSchema = z.object({
teamId: types.string(),
projectId: types.string(),
});
export function favoriteProjectsAndSpacesFromJSON(jsonString) {
return safeParse(jsonString, (x) => FavoriteProjectsAndSpaces$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FavoriteProjectsAndSpaces' from JSON`);
}
/** @internal */
export const AuthUserRemoteCaching$inboundSchema = z.object({
enabled: types.optional(types.boolean()),
});
export function authUserRemoteCachingFromJSON(jsonString) {
return safeParse(jsonString, (x) => AuthUserRemoteCaching$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuthUserRemoteCaching' from JSON`);
}
/** @internal */
export const DataCache$inboundSchema = z.object({
excessBillingEnabled: types.optional(types.boolean()),
});
export function dataCacheFromJSON(jsonString) {
return safeParse(jsonString, (x) => DataCache$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DataCache' from JSON`);
}
/** @internal */
export const WebAnalytics$inboundSchema = z.object({
blockedFrom: types.optional(types.number()),
blockedUntil: types.optional(types.number()),
isCurrentlyBlocked: types.boolean(),
});
export function webAnalyticsFromJSON(jsonString) {
return safeParse(jsonString, (x) => WebAnalytics$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebAnalytics' from JSON`);
}
/** @internal */
export const FeatureBlocks$inboundSchema = z.object({
webAnalytics: types.optional(z.lazy(() => WebAnalytics$inboundSchema)),
});
export function featureBlocksFromJSON(jsonString) {
return safeParse(jsonString, (x) => FeatureBlocks$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FeatureBlocks' from JSON`);
}
/** @internal */
export const ManagedTeams$inboundSchema = z.object({
name: types.string(),
avatar: types.nullable(types.string()),
});
export function managedTeamsFromJSON(jsonString) {
return safeParse(jsonString, (x) => ManagedTeams$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ManagedTeams' from JSON`);
}
/** @internal */
export const AccountUpdateContext$inboundSchema = z.object({
managedTeams: z.array(z.lazy(() => ManagedTeams$inboundSchema)),
});
export function accountUpdateContextFromJSON(jsonString) {
return safeParse(jsonString, (x) => AccountUpdateContext$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountUpdateContext' from JSON`);
}
/** @internal */
export const AuthUser$inboundSchema = z.object({
createdAt: types.number(),
softBlock: types.nullable(z.lazy(() => SoftBlock$inboundSchema)),
billing: types.nullable(z.lazy(() => Billing$inboundSchema)),
resourceConfig: z.lazy(() => AuthUserResourceConfig$inboundSchema),
stagingPrefix: types.string(),
activeDashboardViews: types.optional(z.array(z.lazy(() => ActiveDashboardViews$inboundSchema))),
importFlowGitNamespace: z.nullable(smartUnion([types.string(), types.number()])).optional(),
importFlowGitNamespaceId: z.nullable(smartUnion([types.string(), types.number()])).optional(),
importFlowGitProvider: z.nullable(ImportFlowGitProvider$inboundSchema)
.optional(),
preferredScopesAndGitNamespaces: types.optional(z.array(z.lazy(() => PreferredScopesAndGitNamespaces$inboundSchema))),
dismissedToasts: types.optional(z.array(z.lazy(() => DismissedToasts$inboundSchema))),
favoriteProjectsAndSpaces: types.optional(z.array(z.lazy(() => FavoriteProjectsAndSpaces$inboundSchema))),
hasTrialAvailable: types.boolean(),
remoteCaching: types.optional(z.lazy(() => AuthUserRemoteCaching$inboundSchema)),
dataCache: types.optional(z.lazy(() => DataCache$inboundSchema)),
featureBlocks: types.optional(z.lazy(() => FeatureBlocks$inboundSchema)),
isAccountUpdateRequired: types.optional(types.boolean()),
accountUpdateContext: types.optional(z.lazy(() => AccountUpdateContext$inboundSchema)),
id: types.string(),
email: types.string(),
name: types.nullable(types.string()),
username: types.string(),
avatar: types.nullable(types.string()),
defaultTeamId: types.nullable(types.string()),
isEnterpriseManaged: types.optional(types.boolean()),
});
export function authUserFromJSON(jsonString) {
return safeParse(jsonString, (x) => AuthUser$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuthUser' from JSON`);
}
//# sourceMappingURL=authuser.js.map