@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>
741 lines • 32.5 kB
JavaScript
/*
* 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 { collectExtraKeys as collectExtraKeys$, safeParse, } from "../lib/schemas.js";
import * as types from "../types/primitives.js";
import { smartUnion } from "../types/smartUnion.js";
/**
* Controls whether directory sync events are processed. - 'SETUP': Directory connected but role mappings not yet configured. Events are acknowledged but not processed. - 'ACTIVE': Fully configured. Events are processed normally. - undefined: Legacy directory (pre-feature), treat as 'ACTIVE' for backwards compatibility.
*/
export const SyncState = {
Active: "ACTIVE",
Setup: "SETUP",
};
/**
* Controls whether directory sync events are processed. - 'SETUP': Directory connected but role mappings not yet configured. Events are acknowledged but not processed. - 'ACTIVE': Fully configured. Events are processed normally. - undefined: Legacy directory (pre-feature), treat as 'ACTIVE' for backwards compatibility.
*/
export const TeamSyncState = {
Active: "ACTIVE",
Setup: "SETUP",
};
/**
* The default redirect URI to use after successful SAML authentication.
*/
export const DefaultRedirectUri = {
V0App: "v0.app",
V0Dev: "v0.dev",
VercelCom: "vercel.com",
};
export const Roles2 = {
Billing: "BILLING",
Contributor: "CONTRIBUTOR",
Developer: "DEVELOPER",
Member: "MEMBER",
Owner: "OWNER",
Security: "SECURITY",
Viewer: "VIEWER",
ViewerForPlus: "VIEWER_FOR_PLUS",
};
export const Plan = {
Enterprise: "enterprise",
Hobby: "hobby",
Pro: "pro",
};
export const TeamTeamRoles = {
Billing: "BILLING",
Contributor: "CONTRIBUTOR",
Developer: "DEVELOPER",
Member: "MEMBER",
Owner: "OWNER",
Security: "SECURITY",
Viewer: "VIEWER",
ViewerForPlus: "VIEWER_FOR_PLUS",
};
export const TeamTeamPermissions = {
AiGatewayApiKeyOwnedBySelf: "AiGatewayApiKeyOwnedBySelf",
AiGatewayBudgetManager: "AiGatewayBudgetManager",
AiGatewayCredits: "AiGatewayCredits",
AiGatewaySettings: "AiGatewaySettings",
AiGatewayTranscriptsManager: "AiGatewayTranscriptsManager",
AiGatewayTranscriptsViewer: "AiGatewayTranscriptsViewer",
ConnectorManager: "ConnectorManager",
CreateProject: "CreateProject",
EnvVariableManager: "EnvVariableManager",
EnvironmentManager: "EnvironmentManager",
FullProductionDeployment: "FullProductionDeployment",
IntegrationManager: "IntegrationManager",
OrgAdmin: "OrgAdmin",
OrgViewer: "OrgViewer",
UsageViewer: "UsageViewer",
V0Builder: "V0Builder",
V0Chatter: "V0Chatter",
V0Viewer: "V0Viewer",
WorkflowDecryptor: "WorkflowDecryptor",
};
/**
* Default build machine type for new builds
*/
export const Default = {
Basic: "basic",
Elastic: "elastic",
Enhanced: "enhanced",
Standard: "standard",
Turbo: "turbo",
};
/**
* Default Passport configuration for new projects in this team.
*/
export const DeploymentType = {
All: "all",
AllExceptCustomDomains: "all_except_custom_domains",
Preview: "preview",
ProdDeploymentUrlsAndAllPreviews: "prod_deployment_urls_and_all_previews",
};
/**
* Whether toolbar is enabled on preview deployments
*/
export const EnablePreviewFeedback = {
Default: "default",
DefaultForce: "default-force",
Off: "off",
OffForce: "off-force",
On: "on",
OnForce: "on-force",
};
/**
* Whether toolbar is enabled on production deployments
*/
export const EnableProductionFeedback = {
Default: "default",
DefaultForce: "default-force",
Off: "off",
OffForce: "off-force",
On: "on",
OnForce: "on-force",
};
/**
* Sensitive environment variable policy for this team
*/
export const SensitiveEnvironmentVariablePolicy = {
Default: "default",
Off: "off",
On: "on",
};
/**
* Require production secrets to use a different value than preview or development.
*/
export const DisjunctiveProductionSecretPolicy = {
Default: "default",
Off: "off",
On: "on",
};
/**
* Controls who can request access to protected deployments.
*/
export const DpAccessRequestsMode = {
All: "all",
EmailDomain: "email-domain",
None: "none",
};
export const Preference = {
AutoApproval: "auto-approval",
Block: "block",
ManualApproval: "manual-approval",
};
export const SourcesProvider = {
Bitbucket: "bitbucket",
Github: "github",
};
export const EnvironmentsTarget = {
Preview: "preview",
Production: "production",
};
/**
* Customer-configurable deployment sources. Every deploy classifies to exactly one. JSON schema in `packages/deployment-policy/schemas/body.ts` enumerates exactly these values. - `'git'` — git provider webhook. - `'cli'` — Vercel CLI (legacy classic-token CLI and SIWV CLI both). - `'rest-api'` — direct user/team-token REST upload. Does NOT cover deploy hooks, Marketplace integrations, or first-party app tokens. - `'deploy-hook'` — project deploy-hook URL. The URL is the credential. - `'integration'` — third-party Marketplace actor: Marketplace integration token, user-delegated OAuth from a Marketplace app, or an unrecognized third-party Vercel App. First-party Vercel Apps are never `'integration'`. - `'v0'` — the v0 product surface (entitlement-gated). v0 deploys through the CLI under the hood, but classifies as its own source so a team can allow or deny v0 independently of `'cli'`. First-party Vercel apps (Toolbar, etc.) classify as `'first-party'` — see `ClassifiedSource` in `./checks`. They're not in this union because they aren't customer-configurable; they bypass `checkDeploymentSources` entirely. v0 is intentionally NOT among them: like the CLI, it's a real product surface and is policy-controllable.
*/
export const TeamSources = {
Cli: "cli",
DeployHook: "deploy-hook",
Git: "git",
Integration: "integration",
RestApi: "rest-api",
V0: "v0",
};
export const TeamEnvironmentsTarget = {
Preview: "preview",
Production: "production",
};
export const TeamRole = {
Billing: "BILLING",
Contributor: "CONTRIBUTOR",
Developer: "DEVELOPER",
Member: "MEMBER",
Owner: "OWNER",
Security: "SECURITY",
Viewer: "VIEWER",
ViewerForPlus: "VIEWER_FOR_PLUS",
};
export const TeamMembershipTeamRoles = {
Billing: "BILLING",
Contributor: "CONTRIBUTOR",
Developer: "DEVELOPER",
Member: "MEMBER",
Owner: "OWNER",
Security: "SECURITY",
Viewer: "VIEWER",
ViewerForPlus: "VIEWER_FOR_PLUS",
};
export const TeamMembershipTeamPermissions = {
AiGatewayApiKeyOwnedBySelf: "AiGatewayApiKeyOwnedBySelf",
AiGatewayBudgetManager: "AiGatewayBudgetManager",
AiGatewayCredits: "AiGatewayCredits",
AiGatewaySettings: "AiGatewaySettings",
AiGatewayTranscriptsManager: "AiGatewayTranscriptsManager",
AiGatewayTranscriptsViewer: "AiGatewayTranscriptsViewer",
ConnectorManager: "ConnectorManager",
CreateProject: "CreateProject",
EnvVariableManager: "EnvVariableManager",
EnvironmentManager: "EnvironmentManager",
FullProductionDeployment: "FullProductionDeployment",
IntegrationManager: "IntegrationManager",
OrgAdmin: "OrgAdmin",
OrgViewer: "OrgViewer",
UsageViewer: "UsageViewer",
V0Builder: "V0Builder",
V0Chatter: "V0Chatter",
V0Viewer: "V0Viewer",
WorkflowDecryptor: "WorkflowDecryptor",
};
export const TeamOrigin = {
AccountUpdate: "account-update",
Bitbucket: "bitbucket",
Dsync: "dsync",
Feedback: "feedback",
Github: "github",
Gitlab: "gitlab",
Import: "import",
Link: "link",
Mail: "mail",
NsnbAutoApprove: "nsnb-auto-approve",
NsnbHobbyUpgrade: "nsnb-hobby-upgrade",
NsnbInvite: "nsnb-invite",
NsnbRedeploy: "nsnb-redeploy",
NsnbRedeployAttributionCard: "nsnb-redeploy-attribution-card",
NsnbRequestAccess: "nsnb-request-access",
NsnbViewerUpgrade: "nsnb-viewer-upgrade",
OrganizationTeams: "organization-teams",
Saml: "saml",
Teams: "teams",
};
/** @internal */
export const Connect$inboundSchema = z.object({
enabled: types.optional(types.boolean()),
});
export function connectFromJSON(jsonString) {
return safeParse(jsonString, (x) => Connect$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Connect' from JSON`);
}
/** @internal */
export const SyncState$inboundSchema = z
.nativeEnum(SyncState);
/** @internal */
export const Connection$inboundSchema = z.object({
type: types.string(),
state: types.string(),
connectedAt: types.number(),
lastReceivedWebhookEvent: types.optional(types.number()),
lastSyncedAt: types.optional(types.number()),
syncState: types.optional(SyncState$inboundSchema),
status: types.string(),
});
export function connectionFromJSON(jsonString) {
return safeParse(jsonString, (x) => Connection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Connection' from JSON`);
}
/** @internal */
export const TeamSyncState$inboundSchema = z.nativeEnum(TeamSyncState);
/** @internal */
export const Directory$inboundSchema = z.object({
type: types.string(),
state: types.string(),
connectedAt: types.number(),
lastReceivedWebhookEvent: types.optional(types.number()),
lastSyncedAt: types.optional(types.number()),
syncState: types.optional(TeamSyncState$inboundSchema),
});
export function directoryFromJSON(jsonString) {
return safeParse(jsonString, (x) => Directory$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Directory' from JSON`);
}
/** @internal */
export const DefaultRedirectUri$inboundSchema = z.nativeEnum(DefaultRedirectUri);
/** @internal */
export const Roles2$inboundSchema = z
.nativeEnum(Roles2);
/** @internal */
export const Roles1$inboundSchema = z
.object({
accessGroupId: types.string(),
});
export function roles1FromJSON(jsonString) {
return safeParse(jsonString, (x) => Roles1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Roles1' from JSON`);
}
/** @internal */
export const Roles$inboundSchema = smartUnion([z.lazy(() => Roles1$inboundSchema), Roles2$inboundSchema]);
export function rolesFromJSON(jsonString) {
return safeParse(jsonString, (x) => Roles$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Roles' from JSON`);
}
/** @internal */
export const Saml$inboundSchema = z
.object({
connection: types.optional(z.lazy(() => Connection$inboundSchema)),
directory: types.optional(z.lazy(() => Directory$inboundSchema)),
enforced: types.boolean(),
defaultRedirectUri: types.optional(DefaultRedirectUri$inboundSchema),
roles: types.optional(z.record(smartUnion([
z.lazy(() => Roles1$inboundSchema),
Roles2$inboundSchema,
]))),
});
export function samlFromJSON(jsonString) {
return safeParse(jsonString, (x) => Saml$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Saml' from JSON`);
}
/** @internal */
export const Plan$inboundSchema = z.nativeEnum(Plan);
/** @internal */
export const Billing$inboundSchema = z.object({
plan: Plan$inboundSchema,
});
export function billingFromJSON(jsonString) {
return safeParse(jsonString, (x) => Billing$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Billing' from JSON`);
}
/** @internal */
export const TeamTeamRoles$inboundSchema = z.nativeEnum(TeamTeamRoles);
/** @internal */
export const TeamTeamPermissions$inboundSchema = z.nativeEnum(TeamTeamPermissions);
/** @internal */
export const DefaultRoles$inboundSchema = z.object({
teamRoles: types.optional(z.array(TeamTeamRoles$inboundSchema)),
teamPermissions: types.optional(z.array(TeamTeamPermissions$inboundSchema)),
});
export function defaultRolesFromJSON(jsonString) {
return safeParse(jsonString, (x) => DefaultRoles$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DefaultRoles' from JSON`);
}
/** @internal */
export const BuildEntitlements$inboundSchema = z.object({
enhancedBuilds: types.optional(types.boolean()),
});
export function buildEntitlementsFromJSON(jsonString) {
return safeParse(jsonString, (x) => BuildEntitlements$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BuildEntitlements' from JSON`);
}
/** @internal */
export const Default$inboundSchema = z
.nativeEnum(Default);
/** @internal */
export const BuildMachine$inboundSchema = z.object({
default: types.optional(Default$inboundSchema),
});
export function buildMachineFromJSON(jsonString) {
return safeParse(jsonString, (x) => BuildMachine$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BuildMachine' from JSON`);
}
/** @internal */
export const ResourceConfig$inboundSchema = z.object({
concurrentBuilds: types.optional(types.number()),
elasticConcurrencyEnabled: types.optional(types.boolean()),
edgeConfigSize: types.optional(types.number()),
edgeConfigs: types.optional(types.number()),
kvDatabases: types.optional(types.number()),
blobStores: types.optional(types.number()),
postgresDatabases: types.optional(types.number()),
customEnvironmentsPerProject: types.optional(types.number()),
serverlessFunctionMaxMemorySize: types.optional(types.number()),
buildEntitlements: types.optional(z.lazy(() => BuildEntitlements$inboundSchema)),
buildMachine: types.optional(z.lazy(() => BuildMachine$inboundSchema)),
});
export function resourceConfigFromJSON(jsonString) {
return safeParse(jsonString, (x) => ResourceConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResourceConfig' from JSON`);
}
/** @internal */
export const DisableHardAutoBlocks$inboundSchema = smartUnion([types.number(), types.boolean()]);
export function disableHardAutoBlocksFromJSON(jsonString) {
return safeParse(jsonString, (x) => DisableHardAutoBlocks$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DisableHardAutoBlocks' from JSON`);
}
/** @internal */
export const RemoteCaching$inboundSchema = z.object({
enabled: types.optional(types.boolean()),
});
export function remoteCachingFromJSON(jsonString) {
return safeParse(jsonString, (x) => RemoteCaching$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RemoteCaching' from JSON`);
}
/** @internal */
export const PasswordProtection$inboundSchema = z.object({
deploymentType: types.string(),
});
export function passwordProtectionFromJSON(jsonString) {
return safeParse(jsonString, (x) => PasswordProtection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PasswordProtection' from JSON`);
}
/** @internal */
export const SsoProtection$inboundSchema = z.object({
deploymentType: types.string(),
});
export function ssoProtectionFromJSON(jsonString) {
return safeParse(jsonString, (x) => SsoProtection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SsoProtection' from JSON`);
}
/** @internal */
export const DefaultDeploymentProtection$inboundSchema = z.object({
passwordProtection: z.nullable(z.lazy(() => PasswordProtection$inboundSchema))
.optional(),
ssoProtection: z.nullable(z.lazy(() => SsoProtection$inboundSchema))
.optional(),
});
export function defaultDeploymentProtectionFromJSON(jsonString) {
return safeParse(jsonString, (x) => DefaultDeploymentProtection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DefaultDeploymentProtection' from JSON`);
}
/** @internal */
export const DeploymentType$inboundSchema = z.nativeEnum(DeploymentType);
/** @internal */
export const DefaultPassport$inboundSchema = z.object({
connectorId: types.string(),
deploymentType: DeploymentType$inboundSchema,
});
export function defaultPassportFromJSON(jsonString) {
return safeParse(jsonString, (x) => DefaultPassport$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DefaultPassport' from JSON`);
}
/** @internal */
export const DefaultExpirationSettings$inboundSchema = z.object({
expirationDays: types.optional(types.number()),
expirationDaysProduction: types.optional(types.number()),
expirationDaysCanceled: types.optional(types.number()),
expirationDaysErrored: types.optional(types.number()),
deploymentsToKeep: types.optional(types.number()),
});
export function defaultExpirationSettingsFromJSON(jsonString) {
return safeParse(jsonString, (x) => DefaultExpirationSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DefaultExpirationSettings' from JSON`);
}
/** @internal */
export const Lint$inboundSchema = z
.object({
targets: z.array(types.string()),
});
export function lintFromJSON(jsonString) {
return safeParse(jsonString, (x) => Lint$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Lint' from JSON`);
}
/** @internal */
export const Typecheck$inboundSchema = z.object({
targets: z.array(types.string()),
});
export function typecheckFromJSON(jsonString) {
return safeParse(jsonString, (x) => Typecheck$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Typecheck' from JSON`);
}
/** @internal */
export const MfeConfigPresent$inboundSchema = z.object({
targets: z.array(types.string()),
});
export function mfeConfigPresentFromJSON(jsonString) {
return safeParse(jsonString, (x) => MfeConfigPresent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MfeConfigPresent' from JSON`);
}
/** @internal */
export const DefaultProjectJobs$inboundSchema = z.object({
lint: types.optional(z.lazy(() => Lint$inboundSchema)),
typecheck: types.optional(z.lazy(() => Typecheck$inboundSchema)),
"mfe-config-present": types.optional(z.lazy(() => MfeConfigPresent$inboundSchema)),
}).transform((v) => {
return remap$(v, {
"mfe-config-present": "mfeConfigPresent",
});
});
export function defaultProjectJobsFromJSON(jsonString) {
return safeParse(jsonString, (x) => DefaultProjectJobs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DefaultProjectJobs' from JSON`);
}
/** @internal */
export const EnablePreviewFeedback$inboundSchema = z.nativeEnum(EnablePreviewFeedback);
/** @internal */
export const EnableProductionFeedback$inboundSchema = z.nativeEnum(EnableProductionFeedback);
/** @internal */
export const SensitiveEnvironmentVariablePolicy$inboundSchema = z.nativeEnum(SensitiveEnvironmentVariablePolicy);
/** @internal */
export const DisjunctiveProductionSecretPolicy$inboundSchema = z.nativeEnum(DisjunctiveProductionSecretPolicy);
/** @internal */
export const DpAccessRequestsMode$inboundSchema = z.nativeEnum(DpAccessRequestsMode);
/** @internal */
export const IpBuckets$inboundSchema = z.object({
bucket: types.string(),
supportUntil: types.optional(types.number()),
default: types.optional(types.boolean()),
});
export function ipBucketsFromJSON(jsonString) {
return safeParse(jsonString, (x) => IpBuckets$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IpBuckets' from JSON`);
}
/** @internal */
export const StrictDeploymentProtectionSettings$inboundSchema = z.object({
enabled: types.boolean(),
updatedAt: types.number(),
});
export function strictDeploymentProtectionSettingsFromJSON(jsonString) {
return safeParse(jsonString, (x) => StrictDeploymentProtectionSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StrictDeploymentProtectionSettings' from JSON`);
}
/** @internal */
export const StrictShareableLinks$inboundSchema = z.object({
enabled: types.boolean(),
updatedAt: types.number(),
});
export function strictShareableLinksFromJSON(jsonString) {
return safeParse(jsonString, (x) => StrictShareableLinks$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StrictShareableLinks' from JSON`);
}
/** @internal */
export const StrictPasswordProtectionSettings$inboundSchema = z.object({
enabled: types.boolean(),
updatedAt: types.number(),
});
export function strictPasswordProtectionSettingsFromJSON(jsonString) {
return safeParse(jsonString, (x) => StrictPasswordProtectionSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StrictPasswordProtectionSettings' from JSON`);
}
/** @internal */
export const StrictConnectors$inboundSchema = z.object({
enabled: types.boolean(),
updatedAt: types.number(),
});
export function strictConnectorsFromJSON(jsonString) {
return safeParse(jsonString, (x) => StrictConnectors$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StrictConnectors' from JSON`);
}
/** @internal */
export const Preference$inboundSchema = z
.nativeEnum(Preference);
/** @internal */
export const NsnbConfig$inboundSchema = z.object({
preference: Preference$inboundSchema,
});
export function nsnbConfigFromJSON(jsonString) {
return safeParse(jsonString, (x) => NsnbConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NsnbConfig' from JSON`);
}
/** @internal */
export const Sources2$inboundSchema = z.object({
provider: types.literal("gitlab"),
namespace: types.string(),
project: types.optional(types.string()),
});
export function sources2FromJSON(jsonString) {
return safeParse(jsonString, (x) => Sources2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Sources2' from JSON`);
}
/** @internal */
export const SourcesProvider$inboundSchema = z.nativeEnum(SourcesProvider);
/** @internal */
export const Sources1$inboundSchema = z.object({
provider: SourcesProvider$inboundSchema,
org: types.string(),
repo: types.optional(types.string()),
});
export function sources1FromJSON(jsonString) {
return safeParse(jsonString, (x) => Sources1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Sources1' from JSON`);
}
/** @internal */
export const Sources$inboundSchema = z.union([
z.lazy(() => Sources1$inboundSchema).and(z.object({ provider: z.literal("bitbucket") })),
z.lazy(() => Sources1$inboundSchema).and(z.object({ provider: z.literal("github") })),
z.lazy(() => Sources2$inboundSchema),
]);
export function sourcesFromJSON(jsonString) {
return safeParse(jsonString, (x) => Sources$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Sources' from JSON`);
}
/** @internal */
export const Environments2$inboundSchema = z.object({
type: types.literal("custom"),
environmentId: types.string(),
});
export function environments2FromJSON(jsonString) {
return safeParse(jsonString, (x) => Environments2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Environments2' from JSON`);
}
/** @internal */
export const EnvironmentsTarget$inboundSchema = z.nativeEnum(EnvironmentsTarget);
/** @internal */
export const TeamEnvironments1$inboundSchema = z.object({
type: types.literal("system"),
target: EnvironmentsTarget$inboundSchema,
});
export function teamEnvironments1FromJSON(jsonString) {
return safeParse(jsonString, (x) => TeamEnvironments1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TeamEnvironments1' from JSON`);
}
/** @internal */
export const TeamEnvironments$inboundSchema = z.union([
z.lazy(() => TeamEnvironments1$inboundSchema),
z.lazy(() => Environments2$inboundSchema),
]);
export function teamEnvironmentsFromJSON(jsonString) {
return safeParse(jsonString, (x) => TeamEnvironments$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TeamEnvironments' from JSON`);
}
/** @internal */
export const GitSources$inboundSchema = z.object({
sources: z.array(z.union([
z.lazy(() => Sources1$inboundSchema).and(z.object({ provider: z.literal("bitbucket") })),
z.lazy(() => Sources1$inboundSchema).and(z.object({ provider: z.literal("github") })),
z.lazy(() => Sources2$inboundSchema),
])),
enabled: types.boolean(),
environments: z.array(z.union([
z.lazy(() => TeamEnvironments1$inboundSchema),
z.lazy(() => Environments2$inboundSchema),
])),
});
export function gitSourcesFromJSON(jsonString) {
return safeParse(jsonString, (x) => GitSources$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GitSources' from JSON`);
}
/** @internal */
export const TeamSources$inboundSchema = z
.nativeEnum(TeamSources);
/** @internal */
export const TeamEnvironments2$inboundSchema = z.object({
type: types.literal("custom"),
environmentId: types.string(),
});
export function teamEnvironments2FromJSON(jsonString) {
return safeParse(jsonString, (x) => TeamEnvironments2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TeamEnvironments2' from JSON`);
}
/** @internal */
export const TeamEnvironmentsTarget$inboundSchema = z.nativeEnum(TeamEnvironmentsTarget);
/** @internal */
export const TeamEnvironmentsDeploymentPolicy1$inboundSchema = z.object({
type: types.literal("system"),
target: TeamEnvironmentsTarget$inboundSchema,
});
export function teamEnvironmentsDeploymentPolicy1FromJSON(jsonString) {
return safeParse(jsonString, (x) => TeamEnvironmentsDeploymentPolicy1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TeamEnvironmentsDeploymentPolicy1' from JSON`);
}
/** @internal */
export const TeamDeploymentPolicyEnvironments$inboundSchema = z.union([
z.lazy(() => TeamEnvironmentsDeploymentPolicy1$inboundSchema),
z.lazy(() => TeamEnvironments2$inboundSchema),
]);
export function teamDeploymentPolicyEnvironmentsFromJSON(jsonString) {
return safeParse(jsonString, (x) => TeamDeploymentPolicyEnvironments$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TeamDeploymentPolicyEnvironments' from JSON`);
}
/** @internal */
export const DeploymentSources$inboundSchema = z.object({
sources: z.array(TeamSources$inboundSchema),
enabled: types.boolean(),
environments: z.array(z.union([
z.lazy(() => TeamEnvironmentsDeploymentPolicy1$inboundSchema),
z.lazy(() => TeamEnvironments2$inboundSchema),
])),
});
export function deploymentSourcesFromJSON(jsonString) {
return safeParse(jsonString, (x) => DeploymentSources$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentSources' from JSON`);
}
/** @internal */
export const DeploymentPolicy$inboundSchema = z.object({
gitSources: types.optional(z.array(z.lazy(() => GitSources$inboundSchema))),
deploymentSources: types.optional(z.array(z.lazy(() => DeploymentSources$inboundSchema))),
});
export function deploymentPolicyFromJSON(jsonString) {
return safeParse(jsonString, (x) => DeploymentPolicy$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentPolicy' from JSON`);
}
/** @internal */
export const Entitlements$inboundSchema = z.object({
entitlement: types.string(),
});
export function entitlementsFromJSON(jsonString) {
return safeParse(jsonString, (x) => Entitlements$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Entitlements' from JSON`);
}
/** @internal */
export const TeamRole$inboundSchema = z
.nativeEnum(TeamRole);
/** @internal */
export const TeamMembershipTeamRoles$inboundSchema = z.nativeEnum(TeamMembershipTeamRoles);
/** @internal */
export const TeamMembershipTeamPermissions$inboundSchema = z.nativeEnum(TeamMembershipTeamPermissions);
/** @internal */
export const TeamOrigin$inboundSchema = z
.nativeEnum(TeamOrigin);
/** @internal */
export const GitUserId$inboundSchema = smartUnion([types.string(), types.number()]);
export function gitUserIdFromJSON(jsonString) {
return safeParse(jsonString, (x) => GitUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GitUserId' from JSON`);
}
/** @internal */
export const JoinedFrom$inboundSchema = z.object({
origin: TeamOrigin$inboundSchema,
commitId: types.optional(types.string()),
repoId: types.optional(types.string()),
repoPath: types.optional(types.string()),
gitUserId: types.optional(smartUnion([types.string(), types.number()])),
gitUserLogin: types.optional(types.string()),
ssoUserId: types.optional(types.string()),
ssoConnectedAt: types.optional(types.number()),
idpUserId: types.optional(types.string()),
dsyncUserId: types.optional(types.string()),
dsyncConnectedAt: types.optional(types.number()),
});
export function joinedFromFromJSON(jsonString) {
return safeParse(jsonString, (x) => JoinedFrom$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JoinedFrom' from JSON`);
}
/** @internal */
export const Membership$inboundSchema = z.object({
uid: types.optional(types.string()),
entitlements: types.optional(z.array(z.lazy(() => Entitlements$inboundSchema))),
teamId: types.optional(types.string()),
confirmed: types.literal(true),
accessRequestedAt: types.optional(types.number()),
role: TeamRole$inboundSchema,
teamRoles: types.optional(z.array(TeamMembershipTeamRoles$inboundSchema)),
teamPermissions: types.optional(z.array(TeamMembershipTeamPermissions$inboundSchema)),
createdAt: types.number(),
created: types.number(),
joinedFrom: types.optional(z.lazy(() => JoinedFrom$inboundSchema)),
});
export function membershipFromJSON(jsonString) {
return safeParse(jsonString, (x) => Membership$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Membership' from JSON`);
}
/** @internal */
export const Team$inboundSchema = collectExtraKeys$(z.object({
connect: types.optional(z.lazy(() => Connect$inboundSchema)),
creatorId: types.string(),
updatedAt: types.number(),
emailDomain: z.nullable(types.string()).optional(),
saml: types.optional(z.lazy(() => Saml$inboundSchema)),
inviteCode: types.optional(types.string()),
billing: types.nullable(z.lazy(() => Billing$inboundSchema)),
description: types.nullable(types.string()),
defaultRoles: types.optional(z.lazy(() => DefaultRoles$inboundSchema)),
stagingPrefix: types.string(),
resourceConfig: types.optional(z.lazy(() => ResourceConfig$inboundSchema)),
previewDeploymentSuffix: z.nullable(types.string()).optional(),
platform: types.optional(types.boolean()),
disableHardAutoBlocks: types.optional(smartUnion([types.number(), types.boolean()])),
remoteCaching: types.optional(z.lazy(() => RemoteCaching$inboundSchema)),
defaultDeploymentProtection: types.optional(z.lazy(() => DefaultDeploymentProtection$inboundSchema)),
defaultPassport: z.nullable(z.lazy(() => DefaultPassport$inboundSchema))
.optional(),
defaultExpirationSettings: types.optional(z.lazy(() => DefaultExpirationSettings$inboundSchema)),
defaultProjectJobs: types.optional(z.lazy(() => DefaultProjectJobs$inboundSchema)),
enablePreviewFeedback: z.nullable(EnablePreviewFeedback$inboundSchema)
.optional(),
enableProductionFeedback: z.nullable(EnableProductionFeedback$inboundSchema).optional(),
sensitiveEnvironmentVariablePolicy: z.nullable(SensitiveEnvironmentVariablePolicy$inboundSchema).optional(),
disjunctiveProductionSecretPolicy: z.nullable(DisjunctiveProductionSecretPolicy$inboundSchema).optional(),
hideIpAddresses: z.nullable(types.boolean()).optional(),
hideIpAddressesInLogDrains: z.nullable(types.boolean()).optional(),
dpAccessRequestsMode: types.optional(DpAccessRequestsMode$inboundSchema),
ipBuckets: types.optional(z.array(z.lazy(() => IpBuckets$inboundSchema))),
requireVerifiedCommits: types.optional(types.boolean()),
disableRepositoryDispatchEvents: types.optional(types.boolean()),
strictDeploymentProtectionSettings: types.optional(z.lazy(() => StrictDeploymentProtectionSettings$inboundSchema)),
strictShareableLinks: types.optional(z.lazy(() => StrictShareableLinks$inboundSchema)),
strictPasswordProtectionSettings: types.optional(z.lazy(() => StrictPasswordProtectionSettings$inboundSchema)),
strictConnectors: types.optional(z.lazy(() => StrictConnectors$inboundSchema)),
nsnbConfig: types.optional(z.lazy(() => NsnbConfig$inboundSchema)),
deploymentPolicy: types.optional(z.lazy(() => DeploymentPolicy$inboundSchema)),
personalAccessTokensInvalidatedAt: types.optional(types.number()),
appTokensInvalidatedAt: types.optional(types.number()),
apiKeysInvalidatedAt: types.optional(types.number()),
integrationTokensInvalidatedAt: types.optional(types.number()),
id: types.string(),
slug: types.string(),
name: types.nullable(types.string()),
avatar: types.nullable(types.string()),
membership: types.optional(z.lazy(() => Membership$inboundSchema)),
createdAt: types.number(),
parentId: types.optional(types.string()),
orgRootTeamId: types.optional(types.string()),
}).catchall(z.any()), "additionalProperties", true);
export function teamFromJSON(jsonString) {
return safeParse(jsonString, (x) => Team$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Team' from JSON`);
}
//# sourceMappingURL=team.js.map