@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>
4,062 lines • 115 kB
text/typescript
/*
* 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 { safeParse } from "../lib/schemas.js";
import { ClosedEnum } from "../types/enums.js";
import { Result as SafeParseResult } from "../types/fp.js";
import * as types from "../types/primitives.js";
import { smartUnion } from "../types/smartUnion.js";
import { RemovedUsers, RemovedUsers$inboundSchema } from "./removedusers.js";
import { SDKValidationError } from "./sdkvalidationerror.js";
/**
* The payload of the event, if requested.
*/
export type OneHundredAndSeventyFour = {
plan: string;
removedUsers?: { [k: string]: RemovedUsers } | undefined;
prevPlan?: string | undefined;
priorPlan?: string | undefined;
isDowngrade?: boolean | undefined;
userAgent?: string | undefined;
isReactivate?: boolean | undefined;
isTrialUpgrade?: boolean | undefined;
/**
* Whether the plan change was system-initiated rather than human-initiated.
*/
automated?: boolean | undefined;
/**
* Why the plan changed. For downgrades, this is a {@link DowngradeReason} from `@api/pubsub-types` (e.g. `user_downgrade`, `trial_expired`).
*/
reason?: string | undefined;
timestamp?: number | undefined;
removedMemberCount?: number | undefined;
};
export const UserEventPayloadDeploymentType = {
All: "all",
AllExceptCustomDomains: "all_except_custom_domains",
Preview: "preview",
ProdDeploymentUrlsAndAllPreviews: "prod_deployment_urls_and_all_previews",
} as const;
export type UserEventPayloadDeploymentType = ClosedEnum<
typeof UserEventPayloadDeploymentType
>;
export type UserEventPayloadPassport = {
connectorId: string;
deploymentType: UserEventPayloadDeploymentType;
};
export type UserEventPayloadPrevious = {
passport?: UserEventPayloadPassport | null | undefined;
};
export const UserEventPayload173DeploymentType = {
All: "all",
AllExceptCustomDomains: "all_except_custom_domains",
Preview: "preview",
ProdDeploymentUrlsAndAllPreviews: "prod_deployment_urls_and_all_previews",
} as const;
export type UserEventPayload173DeploymentType = ClosedEnum<
typeof UserEventPayload173DeploymentType
>;
export type UserEventPayload173Passport = {
connectorId: string;
deploymentType: UserEventPayload173DeploymentType;
};
export type UserEventPayloadNext = {
passport?: UserEventPayload173Passport | null | undefined;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndSeventyThree = {
previous: UserEventPayloadPrevious;
next: UserEventPayloadNext;
};
export const UserEventPayload172DeploymentType = {
All: "all",
AllExceptCustomDomains: "all_except_custom_domains",
Preview: "preview",
ProdDeploymentUrlsAndAllPreviews: "prod_deployment_urls_and_all_previews",
} as const;
export type UserEventPayload172DeploymentType = ClosedEnum<
typeof UserEventPayload172DeploymentType
>;
export type Passport = {
connectorId: string;
deploymentType: UserEventPayload172DeploymentType;
};
export type PayloadPrevious = {
passport?: Passport | null | undefined;
};
export const PayloadDeploymentType = {
All: "all",
AllExceptCustomDomains: "all_except_custom_domains",
Preview: "preview",
ProdDeploymentUrlsAndAllPreviews: "prod_deployment_urls_and_all_previews",
} as const;
export type PayloadDeploymentType = ClosedEnum<typeof PayloadDeploymentType>;
export type PayloadPassport = {
connectorId: string;
deploymentType: PayloadDeploymentType;
};
export type PayloadNext = {
passport?: PayloadPassport | null | undefined;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndSeventyTwo = {
projectId: string;
projectName: string;
previous: PayloadPrevious;
next: PayloadNext;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndSeventyOne = {
oldName: string;
newName: string;
};
export const PayloadKind = {
ConnectSrc: "connectSrc",
Script: "script",
} as const;
export type PayloadKind = ClosedEnum<typeof PayloadKind>;
/**
* The payload of the event, if requested.
*/
export type OneHundredAndSeventy = {
projectId: string;
url?: string | undefined;
headerName?: string | undefined;
previousStatus: string;
justification: string | null;
kind?: PayloadKind | undefined;
};
export const UserEventPayload169Type = {
ConnectSrc: "connectSrc",
} as const;
export type UserEventPayload169Type = ClosedEnum<
typeof UserEventPayload169Type
>;
/**
* The payload of the event, if requested.
*/
export type OneHundredAndSixtyNine = {
projectId: string;
type: UserEventPayload169Type;
resourceUrl: string;
};
export const UserEventPayload168Type = {
Header: "header",
} as const;
export type UserEventPayload168Type = ClosedEnum<
typeof UserEventPayload168Type
>;
/**
* The payload of the event, if requested.
*/
export type OneHundredAndSixtyEight = {
projectId: string;
type: UserEventPayload168Type;
headerName: string;
};
export const UserEventPayloadType = {
Script: "script",
} as const;
export type UserEventPayloadType = ClosedEnum<typeof UserEventPayloadType>;
/**
* The payload of the event, if requested.
*/
export type OneHundredAndSixtySeven = {
projectId: string;
type: UserEventPayloadType;
resourceUrl: string;
};
export const UserEventPayloadKind = {
ConnectSrc: "connectSrc",
Script: "script",
} as const;
export type UserEventPayloadKind = ClosedEnum<typeof UserEventPayloadKind>;
/**
* The payload of the event, if requested.
*/
export type OneHundredAndSixtySix = {
projectId: string;
url: string;
previousStatus: string;
justification: string;
kind?: UserEventPayloadKind | undefined;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndSixtyFive = {
projectId: string;
projectName: string;
deletedCount: number;
scriptCount: number;
connectSrcCount: number;
connectSrcOriginCount: number;
headerCount: number;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndSixtyFour = {
projectId: string;
headerName: string;
previousStatus: string;
justification: string;
};
export const NewResourceBlockingPolicy = {
Allow: "allow",
Block: "block",
} as const;
export type NewResourceBlockingPolicy = ClosedEnum<
typeof NewResourceBlockingPolicy
>;
export type Previous = {
enabled: boolean;
mode: string;
enforcePercentage: number;
newResourceBlockingPolicy: NewResourceBlockingPolicy;
allowUnsafeScriptSrcKeywords: boolean;
};
export const PayloadNewResourceBlockingPolicy = {
Allow: "allow",
Block: "block",
} as const;
export type PayloadNewResourceBlockingPolicy = ClosedEnum<
typeof PayloadNewResourceBlockingPolicy
>;
export type Next = {
enabled: boolean;
mode: string;
enforcePercentage: number;
newResourceBlockingPolicy: PayloadNewResourceBlockingPolicy;
allowUnsafeScriptSrcKeywords: boolean;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndSixtyThree = {
projectId: string;
previous: Previous | null;
next: Next;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndSixtyTwo = {
ownerId: string;
source: string;
cause: string;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndSixtyOne = {
ownerId: string;
source: string;
cause: string;
blockReason?: string | undefined;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndSixty = {
ownerId: string;
source: string;
cause: string;
reason?: string | null | undefined;
};
export type SiftRoute = {
name: string;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFiftyNine = {
ownerId: string;
source: string;
cause: string;
blockReason?: string | undefined;
siftRoute?: SiftRoute | undefined;
};
export const BillingPlan = {
Enterprise: "enterprise",
Platform: "platform",
} as const;
export type BillingPlan = ClosedEnum<typeof BillingPlan>;
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFiftyEight = {
organizationId: string;
teamId: string;
billingPlan: BillingPlan;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFiftySeven = {
projectId?: string | undefined;
projectName: string;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFiftySix = {
alertId: string;
alertName: string;
};
export type Microfrontends3 = {
updatedAt: number;
groupIds: Array<any>;
enabled: false;
freeProjectForLegacyLimits?: boolean | undefined;
};
export type Microfrontends2 = {
isDefaultApp?: false | undefined;
/**
* Whether observability data should be routed to this microfrontend project or a root project.
*/
routeObservabilityToThisProject?: boolean | undefined;
/**
* Whether to add microfrontends routing to aliases. This means domains in this project will route as a microfrontend.
*/
doNotRouteWithMicrofrontendsRouting?: boolean | undefined;
/**
* Timestamp when the microfrontends settings were last updated.
*/
updatedAt: number;
/**
* The group IDs of microfrontends that this project belongs to. Each microfrontend project must belong to a microfrontends group that is the set of microfrontends that are used together.
*/
groupIds: Array<string>;
/**
* Whether microfrontends are enabled for this project.
*/
enabled: true;
/**
* A path that is used to take screenshots and as the default path in preview links when a domain for this microfrontend is shown in the UI. Includes the leading slash, e.g. `/docs`
*/
defaultRoute?: string | undefined;
/**
* Whether the project was part of the legacy limits for hobby and pro-trial before billing was added. This field is only set when the team is upgraded to a paid plan and we are backfilling the subscription status. We cap the subscription to 2 projects and set this field for the 3rd project. When this field is set, the project is not charged for and we do not call any billing APIs for this project.
*/
freeProjectForLegacyLimits?: boolean | undefined;
};
export type Microfrontends1 = {
isDefaultApp: true;
/**
* Timestamp when the microfrontends settings were last updated.
*/
updatedAt: number;
/**
* The group IDs of microfrontends that this project belongs to. Each microfrontend project must belong to a microfrontends group that is the set of microfrontends that are used together.
*/
groupIds: Array<string>;
/**
* Whether microfrontends are enabled for this project.
*/
enabled: true;
/**
* A path that is used to take screenshots and as the default path in preview links when a domain for this microfrontend is shown in the UI. Includes the leading slash, e.g. `/docs`
*/
defaultRoute?: string | undefined;
/**
* Whether the project was part of the legacy limits for hobby and pro-trial before billing was added. This field is only set when the team is upgraded to a paid plan and we are backfilling the subscription status. We cap the subscription to 2 projects and set this field for the 3rd project. When this field is set, the project is not charged for and we do not call any billing APIs for this project.
*/
freeProjectForLegacyLimits?: boolean | undefined;
};
export type Microfrontends =
| Microfrontends1
| Microfrontends2
| Microfrontends3;
export type UserEventPayload155Project = {
id: string;
name: string;
microfrontends?:
| Microfrontends1
| Microfrontends2
| Microfrontends3
| undefined;
};
export type UserEventMicrofrontends3 = {
updatedAt: number;
groupIds: Array<any>;
enabled: false;
freeProjectForLegacyLimits?: boolean | undefined;
};
export type UserEventMicrofrontends2 = {
isDefaultApp?: false | undefined;
/**
* Whether observability data should be routed to this microfrontend project or a root project.
*/
routeObservabilityToThisProject?: boolean | undefined;
/**
* Whether to add microfrontends routing to aliases. This means domains in this project will route as a microfrontend.
*/
doNotRouteWithMicrofrontendsRouting?: boolean | undefined;
/**
* Timestamp when the microfrontends settings were last updated.
*/
updatedAt: number;
/**
* The group IDs of microfrontends that this project belongs to. Each microfrontend project must belong to a microfrontends group that is the set of microfrontends that are used together.
*/
groupIds: Array<string>;
/**
* Whether microfrontends are enabled for this project.
*/
enabled: true;
/**
* A path that is used to take screenshots and as the default path in preview links when a domain for this microfrontend is shown in the UI. Includes the leading slash, e.g. `/docs`
*/
defaultRoute?: string | undefined;
/**
* Whether the project was part of the legacy limits for hobby and pro-trial before billing was added. This field is only set when the team is upgraded to a paid plan and we are backfilling the subscription status. We cap the subscription to 2 projects and set this field for the 3rd project. When this field is set, the project is not charged for and we do not call any billing APIs for this project.
*/
freeProjectForLegacyLimits?: boolean | undefined;
};
export type UserEventMicrofrontends1 = {
isDefaultApp: true;
/**
* Timestamp when the microfrontends settings were last updated.
*/
updatedAt: number;
/**
* The group IDs of microfrontends that this project belongs to. Each microfrontend project must belong to a microfrontends group that is the set of microfrontends that are used together.
*/
groupIds: Array<string>;
/**
* Whether microfrontends are enabled for this project.
*/
enabled: true;
/**
* A path that is used to take screenshots and as the default path in preview links when a domain for this microfrontend is shown in the UI. Includes the leading slash, e.g. `/docs`
*/
defaultRoute?: string | undefined;
/**
* Whether the project was part of the legacy limits for hobby and pro-trial before billing was added. This field is only set when the team is upgraded to a paid plan and we are backfilling the subscription status. We cap the subscription to 2 projects and set this field for the 3rd project. When this field is set, the project is not charged for and we do not call any billing APIs for this project.
*/
freeProjectForLegacyLimits?: boolean | undefined;
};
export type PayloadMicrofrontends =
| UserEventMicrofrontends1
| UserEventMicrofrontends2
| UserEventMicrofrontends3;
export type UserEventPayload155PrevProject = {
microfrontends?:
| UserEventMicrofrontends1
| UserEventMicrofrontends2
| UserEventMicrofrontends3
| undefined;
};
export type PayloadPrev = {
project: UserEventPayload155PrevProject;
};
export type PayloadGroup = {
id: string;
slug: string;
name: string;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFiftyFive = {
project: UserEventPayload155Project;
prev: PayloadPrev;
group: PayloadGroup;
};
export type UserEventPayload154Project = {
id: string;
name: string;
};
export type Group = {
id: string;
slug: string;
name: string;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFiftyFour = {
project: UserEventPayload154Project;
group: Group;
};
export type Prev = {
name: string;
slug: string;
fallbackEnvironment: string;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFiftyThree = {
id: string;
slug?: string | undefined;
name?: string | undefined;
fallbackEnvironment?: string | undefined;
prev: Prev;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFiftyTwo = {
id: string;
slug: string;
name: string;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFiftyOne = {
enabled: boolean;
allowedIntegrationCount?: number | undefined;
allowedIntegrationIds?: Array<string> | undefined;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFifty = {
projectId: string;
toDeploymentId: string;
projectName: string;
};
export type Names = {
en: string;
};
export type City = {
names: Names;
};
export type PayloadNames = {
en: string;
};
export type Country = {
names: PayloadNames;
};
export type UserEventPayloadNames = {
en: string;
};
export type MostSpecificSubdivision = {
names: UserEventPayloadNames;
};
export type Geolocation = {
city?: City | undefined;
country: Country;
mostSpecificSubdivision?: MostSpecificSubdivision | undefined;
regionName?: string | undefined;
};
export const UserEvent2Origin = {
RecoveryCode: "recovery-code",
Totp: "totp",
Webauthn: "webauthn",
} as const;
export type UserEvent2Origin = ClosedEnum<typeof UserEvent2Origin>;
export type Two2 = {
origin: UserEvent2Origin;
};
export const TwoOrigin = {
Apple: "apple",
Bitbucket: "bitbucket",
Chatgpt: "chatgpt",
Email: "email",
Github: "github",
Gitlab: "gitlab",
Google: "google",
Invite: "invite",
MagicLink: "magic-link",
Otp: "otp",
OtpLink: "otp-link",
Saml: "saml",
Webauthn: "webauthn",
} as const;
export type TwoOrigin = ClosedEnum<typeof TwoOrigin>;
export type Two1 = {
origin: TwoOrigin;
username?: string | undefined;
teamId?: string | undefined;
legacy?: boolean | undefined;
ssoType?: string | undefined;
};
export type Factors2 = Two1 | Two2;
export const OneOrigin = {
Apple: "apple",
Bitbucket: "bitbucket",
Chatgpt: "chatgpt",
Email: "email",
Github: "github",
Gitlab: "gitlab",
Google: "google",
Invite: "invite",
MagicLink: "magic-link",
Otp: "otp",
OtpLink: "otp-link",
Saml: "saml",
Webauthn: "webauthn",
} as const;
export type OneOrigin = ClosedEnum<typeof OneOrigin>;
export type One1 = {
origin: OneOrigin;
username?: string | undefined;
teamId?: string | undefined;
legacy?: boolean | undefined;
ssoType?: string | undefined;
};
export type Factors1 = One1;
export type Factors = Array<One1> | Array<Two1 | Two2>;
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFortyNine = {
userAgent?: string | undefined;
geolocation?: Geolocation | null | undefined;
env?: string | undefined;
os?: string | undefined;
username?: string | undefined;
ssoType?: string | undefined;
factors?: Array<One1> | Array<Two1 | Two2> | undefined;
viaOTP?: boolean | undefined;
viaGithub?: boolean | undefined;
viaGitlab?: boolean | undefined;
viaBitbucket?: boolean | undefined;
viaGoogle?: boolean | undefined;
viaApple?: boolean | undefined;
viaSamlSso?: boolean | undefined;
viaPasskey?: boolean | undefined;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFortyEight = {
logDrainUrl: string;
integrationName?: string | undefined;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFortySeven = {
logDrainUrl: string | null;
integrationName?: string | undefined;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFortySix = {
integrationId: string;
integrationSlug: string;
integrationName: string;
};
export const QueryType = {
DataEdit: "data-edit",
DataView: "data-view",
Schema: "schema",
User: "user",
} as const;
export type QueryType = ClosedEnum<typeof QueryType>;
export type PrimaryKey = {
column: string;
value: string | null;
};
export type Queries = {
command: string | null;
rowCount?: number | undefined;
tables?: Array<string> | undefined;
primaryKey?: Array<PrimaryKey> | undefined;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFortyFive = {
resourceId: string;
integrationId: string;
integrationSlug: string;
integrationProductSlug: string;
configurationId: string;
databaseName: string;
queryType: QueryType;
readonly: boolean;
rolledBack: boolean;
failedQueryIndex: number | null;
errorCode: string | null;
queryCount: number;
queries: Array<Queries>;
};
export const ProjectIds2 = {
All: "all",
} as const;
export type ProjectIds2 = ClosedEnum<typeof ProjectIds2>;
export type ProjectIds = Array<string> | ProjectIds2;
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFortyFour = {
integrationId: string;
configurationId: string;
integrationSlug: string;
integrationName: string;
ownerId: string;
projectIds?: Array<string> | ProjectIds2 | undefined;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFortyThree = {
integrationId: string;
configurationId: string;
integrationSlug: string;
integrationName: string;
ownerId: string;
billingPlanId: string;
billingPlanName?: string | undefined;
};
export type Configurations = {
integrationId: string;
configurationId: string;
integrationSlug: string;
integrationName?: string | undefined;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFortyTwo = {
configurations: Array<Configurations>;
ownerId: string;
};
export type PayloadIntegration = {
id: string;
slug: string;
name: string;
configurationId: string;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndFortyOne = {
integration: PayloadIntegration;
originTeamId: string;
originTeamName: string;
};
export type Integration = {
id: string;
slug: string;
name: string;
configurationId: string;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndForty = {
integration: Integration;
destinationTeamId: string;
destinationTeamName: string;
};
/**
* The payload of the event, if requested.
*/
export type OneHundredAndThirtyNine = {
integrationId: string;
configurationId: string;
integrationSlug: string;
integrationName: string;
ownerId: string;
projectIds?: Array<string> | undefined;
confirmedScopes: Array<string>;
};
export const UserEventPayload138Action = {
Blocked: "blocked",
HardBlocked: "hard-blocked",
SoftBlocked: "soft-blocked",
Unblocked: "unblocked",
} as const;
export type UserEventPayload138Action = ClosedEnum<
typeof UserEventPayload138Action
>;
/**
* Since June 2023
*/
export type BlockHistory = {
action: UserEventPayload138Action;
createdAt: number;
caseId?: string | undefined;
reason: string;
actor?: string | undefined;
statusCode?: number | undefined;
comment?: string | undefined;
ineligibleForAppeal?: boolean | undefined;
};
/**
* (scanner history). Since November 2021. First element is newest.
*/
export type History = {
scanner: string;
reason: string;
by: string;
byId: string;
at: number;
};
/**
* Since June 2026. A hard block that is scheduled (the delay varies by source; see `executeAt`) but not yet executed. Powers admin visibility, scheduler dedup, and cancellation. Cleared on execution or when the team is unblocked/reviewed before `executeAt`; the executor treats its absence as "block cancelled".
*/
export type ScheduledBlock = {
/**
* Unix ms timestamp of the scheduled EventBridge execution.
*/
executeAt: number;
/**
* Violation reason (string value of the `Violation` enum).
*/
reason: string;
/**
* What triggered the scheduled block (string value of `TeamBlockSource`).
*/
source: string;
/**
* Unix ms timestamp of when the marker was written.
*/
createdAt: number;
/**
* Absent from the automated evaluation path, which has no case.
*/
caseId?: string | undefined;
/**
* EventBridge schedule name, persisted so the pending event can be cancelled.
*/
scheduleName?: string | undefined;
};
export type Abuse = {
/**
* Since June 2023
*/
blockHistory?: Array<BlockHistory> | undefined;
/**
* Since March 2022. Helps abuse checks by tracking git auths. Format: `<platform>:<detail>:<value>`
*/
gitAuthHistory?: Array<string> | undefined;
/**
* (scanner history). Since November 2021. First element is newest.
*/
history?: Array<History> | undefined;
/**
* Since September 2023. How often did this owner trigger an actual git lineage deploy block?
*/
gitLineageBlocks?: number | undefined;
/**
* Since September 2023. How often did this owner trigger a git lineage deploy block dry run?
*/
gitLineageBlocksDry?: number | undefined;
/**
* Since November 2021. Guides the abuse scanner in build container.
*/
scanner?: string | undefined;
/**
* Since December 2025. UTC timestamp string of when an auto-unblock is scheduled. Format: "Wed, 03 Dec 2025 20:32:13 GMT"
*/
scheduledUnblockAt?: string | undefined;
/**
* Since June 2026. A hard block that is scheduled (the delay varies by source; see `executeAt`) but not yet executed. Powers admin visibility, scheduler dedup, and cancellation. Cleared on execution or when the team is unblocked/reviewed before `executeAt`; the executor treats its absence as "block cancelled".
*/
scheduledBlock?: ScheduledBlock | undefined;
/**
* Since November 2021
*/
updatedAt: number;
creationUserAgent?: string | undefined;
creationIp?: string | undefined;
removedPhoneNumbers?: string | undefined;
};
export const UserEventPayloadPlan = {
Enterprise: "enterprise",
Hobby: "hobby",
Pro: "pro",
} as const;
export type UserEventPayloadPlan = ClosedEnum<typeof UserEventPayloadPlan>;
export type PayloadBilling = {
plan: UserEventPayloadPlan;
};
export type Credentials2 = {
type: "github-oauth-custom-host";
host: string;
id: string;
};
export const CredentialsType = {
Apple: "apple",
Bitbucket: "bitbucket",
Chatgpt: "chatgpt",
GithubOauth: "github-oauth",
GithubOauthLimited: "github-oauth-limited",
Gitlab: "gitlab",
Google: "google",
Vercel: "vercel",
} as const;
export type CredentialsType = ClosedEnum<typeof CredentialsType>;
export type Credentials1 = {
type: CredentialsType;
id: string;
};
export type Credentials =
| (Credentials1 & { type: "apple" })
| (Credentials1 & { type: "bitbucket" })
| (Credentials1 & { type: "chatgpt" })
| (Credentials1 & { type: "github-oauth" })
| (Credentials1 & { type: "github-oauth-limited" })
| (Credentials1 & { type: "gitlab" })
| (Credentials1 & { type: "google" })
| (Credentials1 & { type: "vercel" })
| Credentials2;
export type PayloadDataCache = {
excessBillingEnabled?: boolean | undefined;
};
export type PayloadDismissals = {
scopeId: string;
createdAt: number;
};
export type PayloadDismissedToasts = {
name: string;
dismissals: Array<PayloadDismissals>;
};
export type PayloadFavoriteProjectsAndSpaces = {
teamId: string;
projectId: string;
};
export type PayloadImportFlowGitNamespace = string | number;
export type PayloadImportFlowGitNamespaceId = string | number;
export const PayloadImportFlowGitProvider = {
Bitbucket: "bitbucket",
Github: "github",
GithubCustomHost: "github-custom-host",
GithubLimited: "github-limited",
Gitlab: "gitlab",
Vercel: "vercel",
} as const;
export type PayloadImportFlowGitProvider = ClosedEnum<
typeof PayloadImportFlowGitProvider
>;
export type PayloadGitNamespaceId = string | number;
export type PayloadPreferredScopesAndGitNamespaces = {
scopeId: string;
gitNamespaceId: string | number | null;
};
export type PreventAutoBlocking = number | boolean;
/**
* Represents configuration for remote caching
*/
export type UserEventPayloadRemoteCaching = {
enabled?: boolean | undefined;
};
export type PayloadBuildEntitlements = {
enhancedBuilds?: boolean | undefined;
};
export const UserEventPayload138Configuration = {
SkipNamespaceQueue: "SKIP_NAMESPACE_QUEUE",
WaitForNamespaceQueue: "WAIT_FOR_NAMESPACE_QUEUE",
} as const;
export type UserEventPayload138Configuration = ClosedEnum<
typeof UserEventPayload138Configuration
>;
export type PayloadBuildQueue = {
configuration?: UserEventPayload138Configuration | undefined;
};
export type PayloadSecurity = {
customRules?: number | undefined;
ipBlocks?: number | undefined;
ipBypass?: number | undefined;
rateLimit?: number | undefined;
};
/**
* Default build machine type for new deployments. This must be used in combination with the buildEntitlements field. It is respected over Vercel's notion of the default build machine, and was originally implemented to allow Teams to "downgrade". - Hobby customers cannot set this, because they only have access to one machine type - Pro customers get Turbo machines by default, so this field is effectively for downgrading - ENT customers cannot set this (yet), because their default is based on their contract. https://linear.app/vercel/project/self-serve-build-machines-for-enterprise-customers-0cbc357e26d2/overview
*/
export const PayloadDefault = {
Elastic: "elastic",
Enhanced: "enhanced",
Standard: "standard",
Turbo: "turbo",
} as const;
/**
* Default build machine type for new deployments. This must be used in combination with the buildEntitlements field. It is respected over Vercel's notion of the default build machine, and was originally implemented to allow Teams to "downgrade". - Hobby customers cannot set this, because they only have access to one machine type - Pro customers get Turbo machines by default, so this field is effectively for downgrading - ENT customers cannot set this (yet), because their default is based on their contract. https://linear.app/vercel/project/self-serve-build-machines-for-enterprise-customers-0cbc357e26d2/overview
*/
export type PayloadDefault = ClosedEnum<typeof PayloadDefault>;
/**
* Build machine configuration recorded on a team or user `resourceConfig`. This is deliberately separate from the build machine config recorded on a deployment (`DeploymentBuildMachine` in `@api/deployments-types`). A team/user only expresses its default machine for new deployments; the per-build fields (`purchaseType`, `defaultPurchaseType`, `machineSelectionType`, `cores`, `memory`) are recorded on the deployment record when a build actually runs and never belong on a team/user document.
*/
export type PayloadBuildMachine = {
/**
* Default build machine type for new deployments. This must be used in combination with the buildEntitlements field. It is respected over Vercel's notion of the default build machine, and was originally implemented to allow Teams to "downgrade". - Hobby customers cannot set this, because they only have access to one machine type - Pro customers get Turbo machines by default, so this field is effectively for downgrading - ENT customers cannot set this (yet), because their default is based on their contract. https://linear.app/vercel/project/self-serve-build-machines-for-enterprise-customers-0cbc357e26d2/overview
*/
default?: PayloadDefault | undefined;
};
export type PayloadResourceConfig = {
nodeType?: string | undefined;
concurrentBuilds?: number | undefined;
elasticConcurrencyEnabled?: boolean | undefined;
buildEntitlements?: PayloadBuildEntitlements | undefined;
buildQueue?: PayloadBuildQueue | undefined;
awsAccountType?: string | undefined;
awsAccountIds?: Array<string> | undefined;
cfZoneName?: string | undefined;
imageOptimizationType?: string | undefined;
edgeConfigs?: number | undefined;
edgeConfigSize?: number | undefined;
edgeFunctionMaxSizeBytes?: number | undefined;
edgeFunctionExecutionTimeoutMs?: number | undefined;
serverlessFunctionMaxMemorySize?: number | undefined;
kvDatabases?: number | undefined;
postgresDatabases?: number | undefined;
blobStores?: number | undefined;
integrationStores?: number | undefined;
cronJobsPerProject?: number | undefined;
microfrontendGroupsPerTeam?: number | undefined;
microfrontendProjectsPerGroup?: number | undefined;
flagsExplorerOverridesThreshold?: number | undefined;
flagsExplorerUnlimitedOverrides?: boolean | undefined;
customEnvironmentsPerProject?: number | undefined;
security?: PayloadSecurity | undefined;
bulkRedirectsFreeLimitOverride?: number | undefined;
/**
* Build machine configuration recorded on a team or user `resourceConfig`. This is deliberately separate from the build machine config recorded on a deployment (`DeploymentBuildMachine` in `@api/deployments-types`). A team/user only expresses its default machine for new deployments; the per-build fields (`purchaseType`, `defaultPurchaseType`, `machineSelectionType`, `cores`, `memory`) are recorded on the deployment record when a build actually runs and never belong on a team/user document.
*/
buildMachine?: PayloadBuildMachine | undefined;
};
export type ResourceLimits = {
max: number;
duration: number;
};
export const PayloadViewPreference = {
Cards: "cards",
List: "list",
} as const;
export type PayloadViewPreference = ClosedEnum<typeof PayloadViewPreference>;
export const PayloadFavoritesViewPreference = {
Closed: "closed",
Open: "open",
} as const;
export type PayloadFavoritesViewPreference = ClosedEnum<
typeof PayloadFavoritesViewPreference
>;
export const PayloadRecentsViewPreference = {
Closed: "closed",
Open: "open",
} as const;
export type PayloadRecentsViewPreference = ClosedEnum<
typeof PayloadRecentsViewPreference
>;
export type PayloadActiveDashboardViews = {
scopeId: string;
viewPreference?: PayloadViewPreference | null | undefined;
favoritesViewPreference?: PayloadFavoritesViewPreference | null | undefined;
recentsViewPreference?: PayloadRecentsViewPreference | null | undefined;
};
export type SecondaryEmails = {
email: string;
verified: boolean;
};
export type PayloadRules = {
email: string;
};
export type EmailNotifications = {
rules?: { [k: string]: PayloadRules } | undefined;
};
export type PayloadReasons = {
name: string;
value: string;
};
export type SiftScores = {
score: number;
reasons: Array<PayloadReasons>;
};
export const UserEventPayloadName = {
String: "string",
} as const;
export type UserEventPayloadName = ClosedEnum<typeof UserEventPayloadName>;
export type PayloadSiftRoute = {
name: UserEventPayloadName;
};
export const UserEventPayloadReason = {
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",
} as const;
export type UserEventPayloadReason = ClosedEnum<typeof UserEventPayloadReason>;
export const PayloadBlockedDueToOverageType = {
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",
} as const;
export type PayloadBlockedDueToOverageType = ClosedEnum<
typeof PayloadBlockedDueToOverageType
>;
export type PayloadSoftBlock = {
blockedAt: number;
reason: UserEventPayloadReason;
blockedDueToOverageType?: PayloadBlockedDueToOverageType | undefined;
};
export const UserEventPayload138Role = {
Billing: "BILLING",
Contributor: "CONTRIBUTOR",
Developer: "DEVELOPER",
Member: "MEMBER",
Owner: "OWNER",
Security: "SECURITY",
Viewer: "VIEWER",
ViewerForPlus: "VIEWER_FOR_PLUS",
} as const;
export type UserEventPayload138Role = ClosedEnum<
typeof UserEventPayload138Role
>;
export const PayloadTeamRoles = {
Billing: "BILLING",
Contributor: "CONTRIBUTOR",
Developer: "DEVELOPER",
Member: "MEMBER",
Owner: "OWNER",
Security: "SECURITY",
Viewer: "VIEWER",
ViewerForPlus: "VIEWER_FOR_PLUS",
} as const;
export type PayloadTeamRoles = ClosedEnum<typeof PayloadTeamRoles>;
export const PayloadTeamPermissions = {
CreateProject: "CreateProject",
EnvVariableManager: "EnvVariableManager",
EnvironmentManager: "EnvironmentManager",
FullProductionDeployment: "FullProductionDeployment",
IntegrationManager: "IntegrationManager",
OrgAdmin: "OrgAdmin",
OrgViewer: "OrgViewer",
UsageViewer: "UsageViewer",
V0Builder: "V0Builder",
V0Chatter: "V0Chatter",
V0Viewer: "V0Viewer",
} as const;
export type PayloadTeamPermissions = ClosedEnum<typeof PayloadTeamPermissions>;
export const UserEventPayload138Origin = {
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",
} as const;
export type UserEventPayload138Origin = ClosedEnum<
typeof UserEventPayload138Origin
>;
export type UserEventPayloadGitUserId = string | number;
export type UserEventPayloadJoinedFrom = {
origin: UserEventPayload138Origin;
commitId?: string | undefined;
repoId?: string | undefined;
repoPath?: string | undefined;
gitUserId?: string | number | undefined;
gitUserLogin?: string | undefined;
ssoUserId?: string | undefined;
ssoConnectedAt?: number | undefined;
idpUserId?: string | undefined;
dsyncUserId?: string | undefined;
dsyncConnectedAt?: number | undefined;
};
export type Teams = {
teamId: string;
createdAt: number;
role: UserEventPayload138Role;
confirmed: true;
confirmedAt: number;
accessRequestedAt?: number | undefined;
teamRoles?: Array<PayloadTeamRoles> | undefined;
teamPermissions?: Array<PayloadTeamPermissions> | undefined;
created: number;
joinedFrom?: UserEventPayloadJoinedFrom | undefined;
};
export const UserEventPayload138Type = {
User: "user",
} as const;
export type UserEventPayload138Type = ClosedEnum<
typeof UserEventPayload138Type
>;
/** @internal */
export const OneHundredAndSeventyFour$inboundSchema: z.ZodType<
OneHundredAndSeventyFour,
z.ZodTypeDef,
unknown
> = z.object({
plan: types.string(),
removedUsers: types.optional(z.record(RemovedUsers$inboundSchema)),
prevPlan: types.optional(types.string()),
priorPlan: types.optional(types.string()),
isDowngrade: types.optional(types.boolean()),
userAgent: types.optional(types.string()),
isReactivate: types.optional(types.boolean()),
isTrialUpgrade: types.optional(types.boolean()),
automated: types.optional(types.boolean()),
reason: types.optional(types.string()),
timestamp: types.optional(types.number()),
removedMemberCount: types.optional(types.number()),
});
export function oneHundredAndSeventyFourFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndSeventyFour, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndSeventyFour$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndSeventyFour' from JSON`,
);
}
/** @internal */
export const UserEventPayloadDeploymentType$inboundSchema: z.ZodNativeEnum<
typeof UserEventPayloadDeploymentType
> = z.nativeEnum(UserEventPayloadDeploymentType);
/** @internal */
export const UserEventPayloadPassport$inboundSchema: z.ZodType<
UserEventPayloadPassport,
z.ZodTypeDef,
unknown
> = z.object({
connectorId: types.string(),
deploymentType: UserEventPayloadDeploymentType$inboundSchema,
});
export function userEventPayloadPassportFromJSON(
jsonString: string,
): SafeParseResult<UserEventPayloadPassport, SDKValidationError> {
return safeParse(
jsonString,
(x) => UserEventPayloadPassport$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'UserEventPayloadPassport' from JSON`,
);
}
/** @internal */
export const UserEventPayloadPrevious$inboundSchema: z.ZodType<
UserEventPayloadPrevious,
z.ZodTypeDef,
unknown
> = z.object({
passport: z.nullable(z.lazy(() => UserEventPayloadPassport$inboundSchema))
.optional(),
});
export function userEventPayloadPreviousFromJSON(
jsonString: string,
): SafeParseResult<UserEventPayloadPrevious, SDKValidationError> {
return safeParse(
jsonString,
(x) => UserEventPayloadPrevious$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'UserEventPayloadPrevious' from JSON`,
);
}
/** @internal */
export const UserEventPayload173DeploymentType$inboundSchema: z.ZodNativeEnum<
typeof UserEventPayload173DeploymentType
> = z.nativeEnum(UserEventPayload173DeploymentType);
/** @internal */
export const UserEventPayload173Passport$inboundSchema: z.ZodType<
UserEventPayload173Passport,
z.ZodTypeDef,
unknown
> = z.object({
connectorId: types.string(),
deploymentType: UserEventPayload173DeploymentType$inboundSchema,
});
export function userEventPayload173PassportFromJSON(
jsonString: string,
): SafeParseResult<UserEventPayload173Passport, SDKValidationError> {
return safeParse(
jsonString,
(x) => UserEventPayload173Passport$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'UserEventPayload173Passport' from JSON`,
);
}
/** @internal */
export const UserEventPayloadNext$inboundSchema: z.ZodType<
UserEventPayloadNext,
z.ZodTypeDef,
unknown
> = z.object({
passport: z.nullable(z.lazy(() => UserEventPayload173Passport$inboundSchema))
.optional(),
});
export function userEventPayloadNextFromJSON(
jsonString: string,
): SafeParseResult<UserEventPayloadNext, SDKValidationError> {
return safeParse(
jsonString,
(x) => UserEventPayloadNext$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'UserEventPayloadNext' from JSON`,
);
}
/** @internal */
export const OneHundredAndSeventyThree$inboundSchema: z.ZodType<
OneHundredAndSeventyThree,
z.ZodTypeDef,
unknown
> = z.object({
previous: z.lazy(() => UserEventPayloadPrevious$inboundSchema),
next: z.lazy(() => UserEventPayloadNext$inboundSchema),
});
export function oneHundredAndSeventyThreeFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndSeventyThree, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndSeventyThree$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndSeventyThree' from JSON`,
);
}
/** @internal */
export const UserEventPayload172DeploymentType$inboundSchema: z.ZodNativeEnum<
typeof UserEventPayload172DeploymentType
> = z.nativeEnum(UserEventPayload172DeploymentType);
/** @internal */
export const Passport$inboundSchema: z.ZodType<
Passport,
z.ZodTypeDef,
unknown
> = z.object({
connectorId: types.string(),
deploymentType: UserEventPayload172DeploymentType$inboundSchema,
});
export function passportFromJSON(
jsonString: string,
): SafeParseResult<Passport, SDKValidationError> {
return safeParse(
jsonString,
(x) => Passport$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Passport' from JSON`,
);
}
/** @internal */
export const PayloadPrevious$inboundSchema: z.ZodType<
PayloadPrevious,
z.ZodTypeDef,
unknown
> = z.object({
passport: z.nullable(z.lazy(() => Passport$inboundSchema)).optional(),
});
export function payloadPreviousFromJSON(
jsonString: string,
): SafeParseResult<PayloadPrevious, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadPrevious$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadPrevious' from JSON`,
);
}
/** @internal */
export const PayloadDeploymentType$inboundSchema: z.ZodNativeEnum<
typeof PayloadDeploymentType
> = z.nativeEnum(PayloadDeploymentType);
/** @internal */
export const PayloadPassport$inboundSchema: z.ZodType<
PayloadPassport,
z.ZodTypeDef,
unknown
> = z.object({
connectorId: types.string(),
deploymentType: PayloadDeploymentType$inboundSchema,
});
export function payloadPassportFromJSON(
jsonString: string,
): SafeParseResult<PayloadPassport, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadPassport$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadPassport' from JSON`,
);
}
/** @internal */
export const PayloadNext$inboundSchema: z.ZodType<
PayloadNext,
z.ZodTypeDef,
unknown
> = z.object({
passport: z.nullable(z.lazy(() => PayloadPassport$inboundSchema)).optional(),
});
export function payloadNextFromJSON(
jsonString: string,
): SafeParseResult<PayloadNext, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadNext$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadNext' from JSON`,
);
}
/** @internal */
export const OneHundredAndSeventyTwo$inboundSchema: z.ZodType<
OneHundredAndSeventyTwo,
z.ZodTypeDef,
unknown
> = z.object({
projectId: types.string(),
projectName: types.string(),
previous: z.lazy(() => PayloadPrevious$inboundSchema),
next: z.lazy(() => PayloadNext$inboundSchema),
});
export function oneHundredAndSeventyTwoFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndSeventyTwo, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndSeventyTwo$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndSeventyTwo' from JSON`,
);
}
/** @internal */
export const OneHundredAndSeventyOne$inboundSchema: z.ZodType<
OneHundredAndSeventyOne,
z.ZodTypeDef,
unknown
> = z.object({
oldName: types.string(),
newName: types.string(),
});
export function oneHundredAndSeventyOneFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndSeventyOne, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndSeventyOne$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndSeventyOne' from JSON`,
);
}
/** @internal */
export const PayloadKind$inboundSchema: z.ZodNativeEnum<typeof PayloadKind> = z
.nativeEnum(PayloadKind);
/** @internal */
export const OneHundredAndSeventy$inboundSchema: z.ZodType<
OneHundredAndSeventy,
z.ZodTypeDef,
unknown
> = z.object({
projectId: types.string(),
url: types.optional(types.string()),
headerName: types.optional(types.string()),
previousStatus: types.string(),
justification: types.nullable(types.string()),
kind: types.optional(PayloadKind$inboundSchema),
});
export function oneHundredAndSeventyFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndSeventy, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndSeventy$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndSeventy' from JSON`,
);
}
/** @internal */
export const UserEventPayload169Type$inboundSchema: z.ZodNativeEnum<
typeof UserEventPayload169Type
> = z.nativeEnum(UserEventPayload169Type);
/** @internal */
export const OneHundredAndSixtyNine$inboundSchema: z.ZodType<
OneHundredAndSixtyNine,
z.ZodTypeDef,
unknown
> = z.object({
projectId: types.string(),
type: UserEventPayload169Type$inboundSchema,
resourceUrl: types.string(),
});
export function oneHundredAndSixtyNineFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndSixtyNine, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndSixtyNine$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndSixtyNine' from JSON`,
);
}
/** @internal */
export const UserEventPayload168Type$inboundSchema: z.ZodNativeEnum<
typeof UserEventPayload168Type
> = z.nativeEnum(UserEventPayload168Type);
/** @internal */
export const OneHundredAndSixtyEight$inboundSchema: z.ZodType<
OneHundredAndSixtyEight,
z.ZodTypeDef,
unknown
> = z.object({
projectId: types.string(),
type: UserEventPayload168Type$inboundSchema,
headerName: types.string(),
});
export function oneHundredAndSixtyEightFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndSixtyEight, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndSixtyEight$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndSixtyEight' from JSON`,
);
}
/** @internal */
export const UserEventPayloadType$inboundSchema: z.ZodNativeEnum<
typeof UserEventPayloadType
> = z.nativeEnum(UserEventPayloadType);
/** @internal */
export const OneHundredAndSixtySeven$inboundSchema: z.ZodType<
OneHundredAndSixtySeven,
z.ZodTypeDef,
unknown
> = z.object({
projectId: types.string(),
type: UserEventPayloadType$inboundSchema,
resourceUrl: types.string(),
});
export function oneHundredAndSixtySevenFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndSixtySeven, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndSixtySeven$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndSixtySeven' from JSON`,
);
}
/** @internal */
export const UserEventPayloadKind$inboundSchema: z.ZodNativeEnum<
typeof UserEventPayloadKind
> = z.nativeEnum(UserEventPayloadKind);
/** @internal */
export const OneHundredAndSixtySix$inboundSchema: z.ZodType<
OneHundredAndSixtySix,
z.ZodTypeDef,
unknown
> = z.object({
projectId: types.string(),
url: types.string(),
previousStatus: types.string(),
justification: types.string(),
kind: types.optional(UserEventPayloadKind$inboundSchema),
});
export function oneHundredAndSixtySixFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndSixtySix, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndSixtySix$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndSixtySix' from JSON`,
);
}
/** @internal */
export const OneHundredAndSixtyFive$inboundSchema: z.ZodType<
OneHundredAndSixtyFive,
z.ZodTypeDef,
unknown
> = z.object({
projectId: types.string(),
projectName: types.string(),
deletedCount: types.number(),
scriptCount: types.number(),
connectSrcCount: types.number(),
connectSrcOriginCount: types.number(),
headerCount: types.number(),
});
export function oneHundredAndSixtyFiveFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndSixtyFive, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndSixtyFive$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndSixtyFive' from JSON`,
);
}
/** @internal */
export const OneHundredAndSixtyFour$inboundSchema: z.ZodType<
OneHundredAndSixtyFour,
z.ZodTypeDef,
unknown
> = z.object({
projectId: types.string(),
headerName: types.string(),
previousStatus: types.string(),
justification: types.string(),
});
export function oneHundredAndSixtyFourFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndSixtyFour, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndSixtyFour$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndSixtyFour' from JSON`,
);
}
/** @internal */
export const NewResourceBlockingPolicy$inboundSchema: z.ZodNativeEnum<
typeof NewResourceBlockingPolicy
> = z.nativeEnum(NewResourceBlockingPolicy);
/** @internal */
export const Previous$inboundSchema: z.ZodType<
Previous,
z.ZodTypeDef,
unknown
> = z.object({
enabled: types.boolean(),
mode: types.string(),
enforcePercentage: types.number(),
newResourceBlockingPolicy: NewResourceBlockingPolicy$inboundSchema,
allowUnsafeScriptSrcKeywords: types.boolean(),
});
export function previousFromJSON(
jsonString: string,
): SafeParseResult<Previous, SDKValidationError> {
return safeParse(
jsonString,
(x) => Previous$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Previous' from JSON`,
);
}
/** @internal */
export const PayloadNewResourceBlockingPolicy$inboundSchema: z.ZodNativeEnum<
typeof PayloadNewResourceBlockingPolicy
> = z.nativeEnum(PayloadNewResourceBlockingPolicy);
/** @internal */
export const Next$inboundSchema: z.ZodType<Next, z.ZodTypeDef, unknown> = z
.object({
enabled: types.boolean(),
mode: types.string(),
enforcePercentage: types.number(),
newResourceBlockingPolicy: PayloadNewResourceBlockingPolicy$inboundSchema,
allowUnsafeScriptSrcKeywords: types.boolean(),
});
export function nextFromJSON(
jsonString: string,
): SafeParseResult<Next, SDKValidationError> {
return safeParse(
jsonString,
(x) => Next$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Next' from JSON`,
);
}
/** @internal */
export const OneHundredAndSixtyThree$inboundSchema: z.ZodType<
OneHundredAndSixtyThree,
z.ZodTypeDef,
unknown
> = z.object({
projectId: types.string(),
previous: types.nullable(z.lazy(() => Previous$inboundSchema)),
next: z.lazy(() => Next$inboundSchema),
});
export function oneHundredAndSixtyThreeFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndSixtyThree, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndSixtyThree$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndSixtyThree' from JSON`,
);
}
/** @internal */
export const OneHundredAndSixtyTwo$inboundSchema: z.ZodType<
OneHundredAndSixtyTwo,
z.ZodTypeDef,
unknown
> = z.object({
ownerId: types.string(),
source: types.string(),
cause: types.string(),
});
export function oneHundredAndSixtyTwoFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndSixtyTwo, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndSixtyTwo$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndSixtyTwo' from JSON`,
);
}
/** @internal */
export const OneHundredAndSixtyOne$inboundSchema: z.ZodType<
OneHundredAndSixtyOne,
z.ZodTypeDef,
unknown
> = z.object({
ownerId: types.string(),
source: types.string(),
cause: types.string(),
blockReason: types.optional(types.string()),
});
export function oneHundredAndSixtyOneFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndSixtyOne, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndSixtyOne$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndSixtyOne' from JSON`,
);
}
/** @internal */
export const OneHundredAndSixty$inboundSchema: z.ZodType<
OneHundredAndSixty,
z.ZodTypeDef,
unknown
> = z.object({
ownerId: types.string(),
source: types.string(),
cause: types.string(),
reason: z.nullable(types.string()).optional(),
});
export function oneHundredAndSixtyFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndSixty, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndSixty$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndSixty' from JSON`,
);
}
/** @internal */
export const SiftRoute$inboundSchema: z.ZodType<
SiftRoute,
z.ZodTypeDef,
unknown
> = z.object({
name: types.string(),
});
export function siftRouteFromJSON(
jsonString: string,
): SafeParseResult<SiftRoute, SDKValidationError> {
return safeParse(
jsonString,
(x) => SiftRoute$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'SiftRoute' from JSON`,
);
}
/** @internal */
export const OneHundredAndFiftyNine$inboundSchema: z.ZodType<
OneHundredAndFiftyNine,
z.ZodTypeDef,
unknown
> = z.object({
ownerId: types.string(),
source: types.string(),
cause: types.string(),
blockReason: types.optional(types.string()),
siftRoute: types.optional(z.lazy(() => SiftRoute$inboundSchema)),
});
export function oneHundredAndFiftyNineFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFiftyNine, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFiftyNine$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFiftyNine' from JSON`,
);
}
/** @internal */
export const BillingPlan$inboundSchema: z.ZodNativeEnum<typeof BillingPlan> = z
.nativeEnum(BillingPlan);
/** @internal */
export const OneHundredAndFiftyEight$inboundSchema: z.ZodType<
OneHundredAndFiftyEight,
z.ZodTypeDef,
unknown
> = z.object({
organizationId: types.string(),
teamId: types.string(),
billingPlan: BillingPlan$inboundSchema,
});
export function oneHundredAndFiftyEightFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFiftyEight, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFiftyEight$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFiftyEight' from JSON`,
);
}
/** @internal */
export const OneHundredAndFiftySeven$inboundSchema: z.ZodType<
OneHundredAndFiftySeven,
z.ZodTypeDef,
unknown
> = z.object({
projectId: types.optional(types.string()),
projectName: types.string(),
});
export function oneHundredAndFiftySevenFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFiftySeven, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFiftySeven$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFiftySeven' from JSON`,
);
}
/** @internal */
export const OneHundredAndFiftySix$inboundSchema: z.ZodType<
OneHundredAndFiftySix,
z.ZodTypeDef,
unknown
> = z.object({
alertId: types.string(),
alertName: types.string(),
});
export function oneHundredAndFiftySixFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFiftySix, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFiftySix$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFiftySix' from JSON`,
);
}
/** @internal */
export const Microfrontends3$inboundSchema: z.ZodType<
Microfrontends3,
z.ZodTypeDef,
unknown
> = z.object({
updatedAt: types.number(),
groupIds: z.array(z.any()),
enabled: types.literal(false),
freeProjectForLegacyLimits: types.optional(types.boolean()),
});
export function microfrontends3FromJSON(
jsonString: string,
): SafeParseResult<Microfrontends3, SDKValidationError> {
return safeParse(
jsonString,
(x) => Microfrontends3$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Microfrontends3' from JSON`,
);
}
/** @internal */
export const Microfrontends2$inboundSchema: z.ZodType<
Microfrontends2,
z.ZodTypeDef,
unknown
> = z.object({
isDefaultApp: types.optional(types.literal(false)),
routeObservabilityToThisProject: types.optional(types.boolean()),
doNotRouteWithMicrofrontendsRouting: types.optional(types.boolean()),
updatedAt: types.number(),
groupIds: z.array(types.string()),
enabled: types.literal(true),
defaultRoute: types.optional(types.string()),
freeProjectForLegacyLimits: types.optional(types.boolean()),
});
export function microfrontends2FromJSON(
jsonString: string,
): SafeParseResult<Microfrontends2, SDKValidationError> {
return safeParse(
jsonString,
(x) => Microfrontends2$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Microfrontends2' from JSON`,
);
}
/** @internal */
export const Microfrontends1$inboundSchema: z.ZodType<
Microfrontends1,
z.ZodTypeDef,
unknown
> = z.object({
isDefaultApp: types.literal(true),
updatedAt: types.number(),
groupIds: z.array(types.string()),
enabled: types.literal(true),
defaultRoute: types.optional(types.string()),
freeProjectForLegacyLimits: types.optional(types.boolean()),
});
export function microfrontends1FromJSON(
jsonString: string,
): SafeParseResult<Microfrontends1, SDKValidationError> {
return safeParse(
jsonString,
(x) => Microfrontends1$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Microfrontends1' from JSON`,
);
}
/** @internal */
export const Microfrontends$inboundSchema: z.ZodType<
Microfrontends,
z.ZodTypeDef,
unknown
> = smartUnion([
z.lazy(() => Microfrontends1$inboundSchema),
z.lazy(() => Microfrontends2$inboundSchema),
z.lazy(() => Microfrontends3$inboundSchema),
]);
export function microfrontendsFromJSON(
jsonString: string,
): SafeParseResult<Microfrontends, SDKValidationError> {
return safeParse(
jsonString,
(x) => Microfrontends$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Microfrontends' from JSON`,
);
}
/** @internal */
export const UserEventPayload155Project$inboundSchema: z.ZodType<
UserEventPayload155Project,
z.ZodTypeDef,
unknown
> = z.object({
id: types.string(),
name: types.string(),
microfrontends: types.optional(
smartUnion([
z.lazy(() => Microfrontends1$inboundSchema),
z.lazy(() => Microfrontends2$inboundSchema),
z.lazy(() => Microfrontends3$inboundSchema),
]),
),
});
export function userEventPayload155ProjectFromJSON(
jsonString: string,
): SafeParseResult<UserEventPayload155Project, SDKValidationError> {
return safeParse(
jsonString,
(x) => UserEventPayload155Project$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'UserEventPayload155Project' from JSON`,
);
}
/** @internal */
export const UserEventMicrofrontends3$inboundSchema: z.ZodType<
UserEventMicrofrontends3,
z.ZodTypeDef,
unknown
> = z.object({
updatedAt: types.number(),
groupIds: z.array(z.any()),
enabled: types.literal(false),
freeProjectForLegacyLimits: types.optional(types.boolean()),
});
export function userEventMicrofrontends3FromJSON(
jsonString: string,
): SafeParseResult<UserEventMicrofrontends3, SDKValidationError> {
return safeParse(
jsonString,
(x) => UserEventMicrofrontends3$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'UserEventMicrofrontends3' from JSON`,
);
}
/** @internal */
export const UserEventMicrofrontends2$inboundSchema: z.ZodType<
UserEventMicrofrontends2,
z.ZodTypeDef,
unknown
> = z.object({
isDefaultApp: types.optional(types.literal(false)),
routeObservabilityToThisProject: types.optional(types.boolean()),
doNotRouteWithMicrofrontendsRouting: types.optional(types.boolean()),
updatedAt: types.number(),
groupIds: z.array(types.string()),
enabled: types.literal(true),
defaultRoute: types.optional(types.string()),
freeProjectForLegacyLimits: types.optional(types.boolean()),
});
export function userEventMicrofrontends2FromJSON(
jsonString: string,
): SafeParseResult<UserEventMicrofrontends2, SDKValidationError> {
return safeParse(
jsonString,
(x) => UserEventMicrofrontends2$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'UserEventMicrofrontends2' from JSON`,
);
}
/** @internal */
export const UserEventMicrofrontends1$inboundSchema: z.ZodType<
UserEventMicrofrontends1,
z.ZodTypeDef,
unknown
> = z.object({
isDefaultApp: types.literal(true),
updatedAt: types.number(),
groupIds: z.array(types.string()),
enabled: types.literal(true),
defaultRoute: types.optional(types.string()),
freeProjectForLegacyLimits: types.optional(types.boolean()),
});
export function userEventMicrofrontends1FromJSON(
jsonString: string,
): SafeParseResult<UserEventMicrofrontends1, SDKValidationError> {
return safeParse(
jsonString,
(x) => UserEventMicrofrontends1$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'UserEventMicrofrontends1' from JSON`,
);
}
/** @internal */
export const PayloadMicrofrontends$inboundSchema: z.ZodType<
PayloadMicrofrontends,
z.ZodTypeDef,
unknown
> = smartUnion([
z.lazy(() => UserEventMicrofrontends1$inboundSchema),
z.lazy(() => UserEventMicrofrontends2$inboundSchema),
z.lazy(() => UserEventMicrofrontends3$inboundSchema),
]);
export function payloadMicrofrontendsFromJSON(
jsonString: string,
): SafeParseResult<PayloadMicrofrontends, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadMicrofrontends$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadMicrofrontends' from JSON`,
);
}
/** @internal */
export const UserEventPayload155PrevProject$inboundSchema: z.ZodType<
UserEventPayload155PrevProject,
z.ZodTypeDef,
unknown
> = z.object({
microfrontends: types.optional(
smartUnion([
z.lazy(() => UserEventMicrofrontends1$inboundSchema),
z.lazy(() => UserEventMicrofrontends2$inboundSchema),
z.lazy(() => UserEventMicrofrontends3$inboundSchema),
]),
),
});
export function userEventPayload155PrevProjectFromJSON(
jsonString: string,
): SafeParseResult<UserEventPayload155PrevProject, SDKValidationError> {
return safeParse(
jsonString,
(x) => UserEventPayload155PrevProject$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'UserEventPayload155PrevProject' from JSON`,
);
}
/** @internal */
export const PayloadPrev$inboundSchema: z.ZodType<
PayloadPrev,
z.ZodTypeDef,
unknown
> = z.object({
project: z.lazy(() => UserEventPayload155PrevProject$inboundSchema),
});
export function payloadPrevFromJSON(
jsonString: string,
): SafeParseResult<PayloadPrev, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadPrev$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadPrev' from JSON`,
);
}
/** @internal */
export const PayloadGroup$inboundSchema: z.ZodType<
PayloadGroup,
z.ZodTypeDef,
unknown
> = z.object({
id: types.string(),
slug: types.string(),
name: types.string(),
});
export function payloadGroupFromJSON(
jsonString: string,
): SafeParseResult<PayloadGroup, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadGroup$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadGroup' from JSON`,
);
}
/** @internal */
export const OneHundredAndFiftyFive$inboundSchema: z.ZodType<
OneHundredAndFiftyFive,
z.ZodTypeDef,
unknown
> = z.object({
project: z.lazy(() => UserEventPayload155Project$inboundSchema),
prev: z.lazy(() => PayloadPrev$inboundSchema),
group: z.lazy(() => PayloadGroup$inboundSchema),
});
export function oneHundredAndFiftyFiveFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFiftyFive, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFiftyFive$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFiftyFive' from JSON`,
);
}
/** @internal */
export const UserEventPayload154Project$inboundSchema: z.ZodType<
UserEventPayload154Project,
z.ZodTypeDef,
unknown
> = z.object({
id: types.string(),
name: types.string(),
});
export function userEventPayload154ProjectFromJSON(
jsonString: string,
): SafeParseResult<UserEventPayload154Project, SDKValidationError> {
return safeParse(
jsonString,
(x) => UserEventPayload154Project$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'UserEventPayload154Project' from JSON`,
);
}
/** @internal */
export const Group$inboundSchema: z.ZodType<Group, z.ZodTypeDef, unknown> = z
.object({
id: types.string(),
slug: types.string(),
name: types.string(),
});
export function groupFromJSON(
jsonString: string,
): SafeParseResult<Group, SDKValidationError> {
return safeParse(
jsonString,
(x) => Group$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Group' from JSON`,
);
}
/** @internal */
export const OneHundredAndFiftyFour$inboundSchema: z.ZodType<
OneHundredAndFiftyFour,
z.ZodTypeDef,
unknown
> = z.object({
project: z.lazy(() => UserEventPayload154Project$inboundSchema),
group: z.lazy(() => Group$inboundSchema),
});
export function oneHundredAndFiftyFourFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFiftyFour, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFiftyFour$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFiftyFour' from JSON`,
);
}
/** @internal */
export const Prev$inboundSchema: z.ZodType<Prev, z.ZodTypeDef, unknown> = z
.object({
name: types.string(),
slug: types.string(),
fallbackEnvironment: types.string(),
});
export function prevFromJSON(
jsonString: string,
): SafeParseResult<Prev, SDKValidationError> {
return safeParse(
jsonString,
(x) => Prev$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Prev' from JSON`,
);
}
/** @internal */
export const OneHundredAndFiftyThree$inboundSchema: z.ZodType<
OneHundredAndFiftyThree,
z.ZodTypeDef,
unknown
> = z.object({
id: types.string(),
slug: types.optional(types.string()),
name: types.optional(types.string()),
fallbackEnvironment: types.optional(types.string()),
prev: z.lazy(() => Prev$inboundSchema),
});
export function oneHundredAndFiftyThreeFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFiftyThree, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFiftyThree$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFiftyThree' from JSON`,
);
}
/** @internal */
export const OneHundredAndFiftyTwo$inboundSchema: z.ZodType<
OneHundredAndFiftyTwo,
z.ZodTypeDef,
unknown
> = z.object({
id: types.string(),
slug: types.string(),
name: types.string(),
});
export function oneHundredAndFiftyTwoFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFiftyTwo, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFiftyTwo$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFiftyTwo' from JSON`,
);
}
/** @internal */
export const OneHundredAndFiftyOne$inboundSchema: z.ZodType<
OneHundredAndFiftyOne,
z.ZodTypeDef,
unknown
> = z.object({
enabled: types.boolean(),
allowedIntegrationCount: types.optional(types.number()),
allowedIntegrationIds: types.optional(z.array(types.string())),
});
export function oneHundredAndFiftyOneFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFiftyOne, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFiftyOne$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFiftyOne' from JSON`,
);
}
/** @internal */
export const OneHundredAndFifty$inboundSchema: z.ZodType<
OneHundredAndFifty,
z.ZodTypeDef,
unknown
> = z.object({
projectId: types.string(),
toDeploymentId: types.string(),
projectName: types.string(),
});
export function oneHundredAndFiftyFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFifty, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFifty$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFifty' from JSON`,
);
}
/** @internal */
export const Names$inboundSchema: z.ZodType<Names, z.ZodTypeDef, unknown> = z
.object({
en: types.string(),
});
export function namesFromJSON(
jsonString: string,
): SafeParseResult<Names, SDKValidationError> {
return safeParse(
jsonString,
(x) => Names$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Names' from JSON`,
);
}
/** @internal */
export const City$inboundSchema: z.ZodType<City, z.ZodTypeDef, unknown> = z
.object({
names: z.lazy(() => Names$inboundSchema),
});
export function cityFromJSON(
jsonString: string,
): SafeParseResult<City, SDKValidationError> {
return safeParse(
jsonString,
(x) => City$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'City' from JSON`,
);
}
/** @internal */
export const PayloadNames$inboundSchema: z.ZodType<
PayloadNames,
z.ZodTypeDef,
unknown
> = z.object({
en: types.string(),
});
export function payloadNamesFromJSON(
jsonString: string,
): SafeParseResult<PayloadNames, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadNames$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadNames' from JSON`,
);
}
/** @internal */
export const Country$inboundSchema: z.ZodType<Country, z.ZodTypeDef, unknown> =
z.object({
names: z.lazy(() => PayloadNames$inboundSchema),
});
export function countryFromJSON(
jsonString: string,
): SafeParseResult<Country, SDKValidationError> {
return safeParse(
jsonString,
(x) => Country$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Country' from JSON`,
);
}
/** @internal */
export const UserEventPayloadNames$inboundSchema: z.ZodType<
UserEventPayloadNames,
z.ZodTypeDef,
unknown
> = z.object({
en: types.string(),
});
export function userEventPayloadNamesFromJSON(
jsonString: string,
): SafeParseResult<UserEventPayloadNames, SDKValidationError> {
return safeParse(
jsonString,
(x) => UserEventPayloadNames$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'UserEventPayloadNames' from JSON`,
);
}
/** @internal */
export const MostSpecificSubdivision$inboundSchema: z.ZodType<
MostSpecificSubdivision,
z.ZodTypeDef,
unknown
> = z.object({
names: z.lazy(() => UserEventPayloadNames$inboundSchema),
});
export function mostSpecificSubdivisionFromJSON(
jsonString: string,
): SafeParseResult<MostSpecificSubdivision, SDKValidationError> {
return safeParse(
jsonString,
(x) => MostSpecificSubdivision$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'MostSpecificSubdivision' from JSON`,
);
}
/** @internal */
export const Geolocation$inboundSchema: z.ZodType<
Geolocation,
z.ZodTypeDef,
unknown
> = z.object({
city: types.optional(z.lazy(() => City$inboundSchema)),
country: z.lazy(() => Country$inboundSchema),
most_specific_subdivision: types.optional(
z.lazy(() => MostSpecificSubdivision$inboundSchema),
),
regionName: types.optional(types.string()),
}).transform((v) => {
return remap$(v, {
"most_specific_subdivision": "mostSpecificSubdivision",
});
});
export function geolocationFromJSON(
jsonString: string,
): SafeParseResult<Geolocation, SDKValidationError> {
return safeParse(
jsonString,
(x) => Geolocation$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Geolocation' from JSON`,
);
}
/** @internal */
export const UserEvent2Origin$inboundSchema: z.ZodNativeEnum<
typeof UserEvent2Origin
> = z.nativeEnum(UserEvent2Origin);
/** @internal */
export const Two2$inboundSchema: z.ZodType<Two2, z.ZodTypeDef, unknown> = z
.object({
origin: UserEvent2Origin$inboundSchema,
});
export function two2FromJSON(
jsonString: string,
): SafeParseResult<Two2, SDKValidationError> {
return safeParse(
jsonString,
(x) => Two2$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Two2' from JSON`,
);
}
/** @internal */
export const TwoOrigin$inboundSchema: z.ZodNativeEnum<typeof TwoOrigin> = z
.nativeEnum(TwoOrigin);
/** @internal */
export const Two1$inboundSchema: z.ZodType<Two1, z.ZodTypeDef, unknown> = z
.object({
origin: TwoOrigin$inboundSchema,
username: types.optional(types.string()),
teamId: types.optional(types.string()),
legacy: types.optional(types.boolean()),
ssoType: types.optional(types.string()),
});
export function two1FromJSON(
jsonString: string,
): SafeParseResult<Two1, SDKValidationError> {
return safeParse(
jsonString,
(x) => Two1$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Two1' from JSON`,
);
}
/** @internal */
export const Factors2$inboundSchema: z.ZodType<
Factors2,
z.ZodTypeDef,
unknown
> = smartUnion([
z.lazy(() => Two1$inboundSchema),
z.lazy(() => Two2$inboundSchema),
]);
export function factors2FromJSON(
jsonString: string,
): SafeParseResult<Factors2, SDKValidationError> {
return safeParse(
jsonString,
(x) => Factors2$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Factors2' from JSON`,
);
}
/** @internal */
export const OneOrigin$inboundSchema: z.ZodNativeEnum<typeof OneOrigin> = z
.nativeEnum(OneOrigin);
/** @internal */
export const One1$inboundSchema: z.ZodType<One1, z.ZodTypeDef, unknown> = z
.object({
origin: OneOrigin$inboundSchema,
username: types.optional(types.string()),
teamId: types.optional(types.string()),
legacy: types.optional(types.boolean()),
ssoType: types.optional(types.string()),
});
export function one1FromJSON(
jsonString: string,
): SafeParseResult<One1, SDKValidationError> {
return safeParse(
jsonString,
(x) => One1$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'One1' from JSON`,
);
}
/** @internal */
export const Factors1$inboundSchema: z.ZodType<
Factors1,
z.ZodTypeDef,
unknown
> = z.lazy(() => One1$inboundSchema);
export function factors1FromJSON(
jsonString: string,
): SafeParseResult<Factors1, SDKValidationError> {
return safeParse(
jsonString,
(x) => Factors1$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Factors1' from JSON`,
);
}
/** @internal */
export const Factors$inboundSchema: z.ZodType<Factors, z.ZodTypeDef, unknown> =
smartUnion([
z.array(z.lazy(() => One1$inboundSchema)),
z.array(smartUnion([
z.lazy(() => Two1$inboundSchema),
z.lazy(() => Two2$inboundSchema),
])),
]);
export function factorsFromJSON(
jsonString: string,
): SafeParseResult<Factors, SDKValidationError> {
return safeParse(
jsonString,
(x) => Factors$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Factors' from JSON`,
);
}
/** @internal */
export const OneHundredAndFortyNine$inboundSchema: z.ZodType<
OneHundredAndFortyNine,
z.ZodTypeDef,
unknown
> = z.object({
userAgent: types.optional(types.string()),
geolocation: z.nullable(z.lazy(() => Geolocation$inboundSchema)).optional(),
env: types.optional(types.string()),
os: types.optional(types.string()),
username: types.optional(types.string()),
ssoType: types.optional(types.string()),
factors: types.optional(
smartUnion([
z.array(z.lazy(() => One1$inboundSchema)),
z.array(smartUnion([
z.lazy(() => Two1$inboundSchema),
z.lazy(() => Two2$inboundSchema),
])),
]),
),
viaOTP: types.optional(types.boolean()),
viaGithub: types.optional(types.boolean()),
viaGitlab: types.optional(types.boolean()),
viaBitbucket: types.optional(types.boolean()),
viaGoogle: types.optional(types.boolean()),
viaApple: types.optional(types.boolean()),
viaSamlSso: types.optional(types.boolean()),
viaPasskey: types.optional(types.boolean()),
});
export function oneHundredAndFortyNineFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFortyNine, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFortyNine$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFortyNine' from JSON`,
);
}
/** @internal */
export const OneHundredAndFortyEight$inboundSchema: z.ZodType<
OneHundredAndFortyEight,
z.ZodTypeDef,
unknown
> = z.object({
logDrainUrl: types.string(),
integrationName: types.optional(types.string()),
});
export function oneHundredAndFortyEightFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFortyEight, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFortyEight$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFortyEight' from JSON`,
);
}
/** @internal */
export const OneHundredAndFortySeven$inboundSchema: z.ZodType<
OneHundredAndFortySeven,
z.ZodTypeDef,
unknown
> = z.object({
logDrainUrl: types.nullable(types.string()),
integrationName: types.optional(types.string()),
});
export function oneHundredAndFortySevenFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFortySeven, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFortySeven$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFortySeven' from JSON`,
);
}
/** @internal */
export const OneHundredAndFortySix$inboundSchema: z.ZodType<
OneHundredAndFortySix,
z.ZodTypeDef,
unknown
> = z.object({
integrationId: types.string(),
integrationSlug: types.string(),
integrationName: types.string(),
});
export function oneHundredAndFortySixFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFortySix, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFortySix$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFortySix' from JSON`,
);
}
/** @internal */
export const QueryType$inboundSchema: z.ZodNativeEnum<typeof QueryType> = z
.nativeEnum(QueryType);
/** @internal */
export const PrimaryKey$inboundSchema: z.ZodType<
PrimaryKey,
z.ZodTypeDef,
unknown
> = z.object({
column: types.string(),
value: types.nullable(types.string()),
});
export function primaryKeyFromJSON(
jsonString: string,
): SafeParseResult<PrimaryKey, SDKValidationError> {
return safeParse(
jsonString,
(x) => PrimaryKey$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PrimaryKey' from JSON`,
);
}
/** @internal */
export const Queries$inboundSchema: z.ZodType<Queries, z.ZodTypeDef, unknown> =
z.object({
command: types.nullable(types.string()),
rowCount: types.optional(types.number()),
tables: types.optional(z.array(types.string())),
primaryKey: types.optional(z.array(z.lazy(() => PrimaryKey$inboundSchema))),
});
export function queriesFromJSON(
jsonString: string,
): SafeParseResult<Queries, SDKValidationError> {
return safeParse(
jsonString,
(x) => Queries$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Queries' from JSON`,
);
}
/** @internal */
export const OneHundredAndFortyFive$inboundSchema: z.ZodType<
OneHundredAndFortyFive,
z.ZodTypeDef,
unknown
> = z.object({
resourceId: types.string(),
integrationId: types.string(),
integrationSlug: types.string(),
integrationProductSlug: types.string(),
configurationId: types.string(),
databaseName: types.string(),
queryType: QueryType$inboundSchema,
readonly: types.boolean(),
rolledBack: types.boolean(),
failedQueryIndex: types.nullable(types.number()),
errorCode: types.nullable(types.string()),
queryCount: types.number(),
queries: z.array(z.lazy(() => Queries$inboundSchema)),
});
export function oneHundredAndFortyFiveFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFortyFive, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFortyFive$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFortyFive' from JSON`,
);
}
/** @internal */
export const ProjectIds2$inboundSchema: z.ZodNativeEnum<typeof ProjectIds2> = z
.nativeEnum(ProjectIds2);
/** @internal */
export const ProjectIds$inboundSchema: z.ZodType<
ProjectIds,
z.ZodTypeDef,
unknown
> = smartUnion([z.array(types.string()), ProjectIds2$inboundSchema]);
export function projectIdsFromJSON(
jsonString: string,
): SafeParseResult<ProjectIds, SDKValidationError> {
return safeParse(
jsonString,
(x) => ProjectIds$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'ProjectIds' from JSON`,
);
}
/** @internal */
export const OneHundredAndFortyFour$inboundSchema: z.ZodType<
OneHundredAndFortyFour,
z.ZodTypeDef,
unknown
> = z.object({
integrationId: types.string(),
configurationId: types.string(),
integrationSlug: types.string(),
integrationName: types.string(),
ownerId: types.string(),
projectIds: types.optional(
smartUnion([z.array(types.string()), ProjectIds2$inboundSchema]),
),
});
export function oneHundredAndFortyFourFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFortyFour, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFortyFour$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFortyFour' from JSON`,
);
}
/** @internal */
export const OneHundredAndFortyThree$inboundSchema: z.ZodType<
OneHundredAndFortyThree,
z.ZodTypeDef,
unknown
> = z.object({
integrationId: types.string(),
configurationId: types.string(),
integrationSlug: types.string(),
integrationName: types.string(),
ownerId: types.string(),
billingPlanId: types.string(),
billingPlanName: types.optional(types.string()),
});
export function oneHundredAndFortyThreeFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFortyThree, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFortyThree$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFortyThree' from JSON`,
);
}
/** @internal */
export const Configurations$inboundSchema: z.ZodType<
Configurations,
z.ZodTypeDef,
unknown
> = z.object({
integrationId: types.string(),
configurationId: types.string(),
integrationSlug: types.string(),
integrationName: types.optional(types.string()),
});
export function configurationsFromJSON(
jsonString: string,
): SafeParseResult<Configurations, SDKValidationError> {
return safeParse(
jsonString,
(x) => Configurations$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Configurations' from JSON`,
);
}
/** @internal */
export const OneHundredAndFortyTwo$inboundSchema: z.ZodType<
OneHundredAndFortyTwo,
z.ZodTypeDef,
unknown
> = z.object({
configurations: z.array(z.lazy(() => Configurations$inboundSchema)),
ownerId: types.string(),
});
export function oneHundredAndFortyTwoFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFortyTwo, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFortyTwo$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFortyTwo' from JSON`,
);
}
/** @internal */
export const PayloadIntegration$inboundSchema: z.ZodType<
PayloadIntegration,
z.ZodTypeDef,
unknown
> = z.object({
id: types.string(),
slug: types.string(),
name: types.string(),
configurationId: types.string(),
});
export function payloadIntegrationFromJSON(
jsonString: string,
): SafeParseResult<PayloadIntegration, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadIntegration$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadIntegration' from JSON`,
);
}
/** @internal */
export const OneHundredAndFortyOne$inboundSchema: z.ZodType<
OneHundredAndFortyOne,
z.ZodTypeDef,
unknown
> = z.object({
integration: z.lazy(() => PayloadIntegration$inboundSchema),
originTeamId: types.string(),
originTeamName: types.string(),
});
export function oneHundredAndFortyOneFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndFortyOne, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndFortyOne$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndFortyOne' from JSON`,
);
}
/** @internal */
export const Integration$inboundSchema: z.ZodType<
Integration,
z.ZodTypeDef,
unknown
> = z.object({
id: types.string(),
slug: types.string(),
name: types.string(),
configurationId: types.string(),
});
export function integrationFromJSON(
jsonString: string,
): SafeParseResult<Integration, SDKValidationError> {
return safeParse(
jsonString,
(x) => Integration$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Integration' from JSON`,
);
}
/** @internal */
export const OneHundredAndForty$inboundSchema: z.ZodType<
OneHundredAndForty,
z.ZodTypeDef,
unknown
> = z.object({
integration: z.lazy(() => Integration$inboundSchema),
destinationTeamId: types.string(),
destinationTeamName: types.string(),
});
export function oneHundredAndFortyFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndForty, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndForty$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndForty' from JSON`,
);
}
/** @internal */
export const OneHundredAndThirtyNine$inboundSchema: z.ZodType<
OneHundredAndThirtyNine,
z.ZodTypeDef,
unknown
> = z.object({
integrationId: types.string(),
configurationId: types.string(),
integrationSlug: types.string(),
integrationName: types.string(),
ownerId: types.string(),
projectIds: types.optional(z.array(types.string())),
confirmedScopes: z.array(types.string()),
});
export function oneHundredAndThirtyNineFromJSON(
jsonString: string,
): SafeParseResult<OneHundredAndThirtyNine, SDKValidationError> {
return safeParse(
jsonString,
(x) => OneHundredAndThirtyNine$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'OneHundredAndThirtyNine' from JSON`,
);
}
/** @internal */
export const UserEventPayload138Action$inboundSchema: z.ZodNativeEnum<
typeof UserEventPayload138Action
> = z.nativeEnum(UserEventPayload138Action);
/** @internal */
export const BlockHistory$inboundSchema: z.ZodType<
BlockHistory,
z.ZodTypeDef,
unknown
> = z.object({
action: UserEventPayload138Action$inboundSchema,
createdAt: types.number(),
caseId: types.optional(types.string()),
reason: types.string(),
actor: types.optional(types.string()),
statusCode: types.optional(types.number()),
comment: types.optional(types.string()),
ineligibleForAppeal: types.optional(types.boolean()),
});
export function blockHistoryFromJSON(
jsonString: string,
): SafeParseResult<BlockHistory, SDKValidationError> {
return safeParse(
jsonString,
(x) => BlockHistory$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'BlockHistory' from JSON`,
);
}
/** @internal */
export const History$inboundSchema: z.ZodType<History, z.ZodTypeDef, unknown> =
z.object({
scanner: types.string(),
reason: types.string(),
by: types.string(),
byId: types.string(),
at: types.number(),
});
export function historyFromJSON(
jsonString: string,
): SafeParseResult<History, SDKValidationError> {
return safeParse(
jsonString,
(x) => History$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'History' from JSON`,
);
}
/** @internal */
export const ScheduledBlock$inboundSchema: z.ZodType<
ScheduledBlock,
z.ZodTypeDef,
unknown
> = z.object({
executeAt: types.number(),
reason: types.string(),
source: types.string(),
createdAt: types.number(),
caseId: types.optional(types.string()),
scheduleName: types.optional(types.string()),
});
export function scheduledBlockFromJSON(
jsonString: string,
): SafeParseResult<ScheduledBlock, SDKValidationError> {
return safeParse(
jsonString,
(x) => ScheduledBlock$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'ScheduledBlock' from JSON`,
);
}
/** @internal */
export const Abuse$inboundSchema: z.ZodType<Abuse, z.ZodTypeDef, unknown> = z
.object({
blockHistory: types.optional(
z.array(z.lazy(() => BlockHistory$inboundSchema)),
),
gitAuthHistory: types.optional(z.array(types.string())),
history: types.optional(z.array(z.lazy(() => History$inboundSchema))),
gitLineageBlocks: types.optional(types.number()),
gitLineageBlocksDry: types.optional(types.number()),
scanner: types.optional(types.string()),
scheduledUnblockAt: types.optional(types.string()),
scheduledBlock: types.optional(z.lazy(() => ScheduledBlock$inboundSchema)),
updatedAt: types.number(),
creationUserAgent: types.optional(types.string()),
creationIp: types.optional(types.string()),
removedPhoneNumbers: types.optional(types.string()),
});
export function abuseFromJSON(
jsonString: string,
): SafeParseResult<Abuse, SDKValidationError> {
return safeParse(
jsonString,
(x) => Abuse$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Abuse' from JSON`,
);
}
/** @internal */
export const UserEventPayloadPlan$inboundSchema: z.ZodNativeEnum<
typeof UserEventPayloadPlan
> = z.nativeEnum(UserEventPayloadPlan);
/** @internal */
export const PayloadBilling$inboundSchema: z.ZodType<
PayloadBilling,
z.ZodTypeDef,
unknown
> = z.object({
plan: UserEventPayloadPlan$inboundSchema,
});
export function payloadBillingFromJSON(
jsonString: string,
): SafeParseResult<PayloadBilling, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadBilling$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadBilling' from JSON`,
);
}
/** @internal */
export const Credentials2$inboundSchema: z.ZodType<
Credentials2,
z.ZodTypeDef,
unknown
> = z.object({
type: types.literal("github-oauth-custom-host"),
host: types.string(),
id: types.string(),
});
export function credentials2FromJSON(
jsonString: string,
): SafeParseResult<Credentials2, SDKValidationError> {
return safeParse(
jsonString,
(x) => Credentials2$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Credentials2' from JSON`,
);
}
/** @internal */
export const CredentialsType$inboundSchema: z.ZodNativeEnum<
typeof CredentialsType
> = z.nativeEnum(CredentialsType);
/** @internal */
export const Credentials1$inboundSchema: z.ZodType<
Credentials1,
z.ZodTypeDef,
unknown
> = z.object({
type: CredentialsType$inboundSchema,
id: types.string(),
});
export function credentials1FromJSON(
jsonString: string,
): SafeParseResult<Credentials1, SDKValidationError> {
return safeParse(
jsonString,
(x) => Credentials1$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Credentials1' from JSON`,
);
}
/** @internal */
export const Credentials$inboundSchema: z.ZodType<
Credentials,
z.ZodTypeDef,
unknown
> = z.union([
z.lazy(() => Credentials1$inboundSchema).and(
z.object({ type: z.literal("apple") }),
),
z.lazy(() => Credentials1$inboundSchema).and(
z.object({ type: z.literal("bitbucket") }),
),
z.lazy(() => Credentials1$inboundSchema).and(
z.object({ type: z.literal("chatgpt") }),
),
z.lazy(() => Credentials1$inboundSchema).and(
z.object({ type: z.literal("github-oauth") }),
),
z.lazy(() => Credentials1$inboundSchema).and(
z.object({ type: z.literal("github-oauth-limited") }),
),
z.lazy(() => Credentials1$inboundSchema).and(
z.object({ type: z.literal("gitlab") }),
),
z.lazy(() => Credentials1$inboundSchema).and(
z.object({ type: z.literal("google") }),
),
z.lazy(() => Credentials1$inboundSchema).and(
z.object({ type: z.literal("vercel") }),
),
z.lazy(() => Credentials2$inboundSchema),
]);
export function credentialsFromJSON(
jsonString: string,
): SafeParseResult<Credentials, SDKValidationError> {
return safeParse(
jsonString,
(x) => Credentials$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Credentials' from JSON`,
);
}
/** @internal */
export const PayloadDataCache$inboundSchema: z.ZodType<
PayloadDataCache,
z.ZodTypeDef,
unknown
> = z.object({
excessBillingEnabled: types.optional(types.boolean()),
});
export function payloadDataCacheFromJSON(
jsonString: string,
): SafeParseResult<PayloadDataCache, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadDataCache$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadDataCache' from JSON`,
);
}
/** @internal */
export const PayloadDismissals$inboundSchema: z.ZodType<
PayloadDismissals,
z.ZodTypeDef,
unknown
> = z.object({
scopeId: types.string(),
createdAt: types.number(),
});
export function payloadDismissalsFromJSON(
jsonString: string,
): SafeParseResult<PayloadDismissals, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadDismissals$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadDismissals' from JSON`,
);
}
/** @internal */
export const PayloadDismissedToasts$inboundSchema: z.ZodType<
PayloadDismissedToasts,
z.ZodTypeDef,
unknown
> = z.object({
name: types.string(),
dismissals: z.array(z.lazy(() => PayloadDismissals$inboundSchema)),
});
export function payloadDismissedToastsFromJSON(
jsonString: string,
): SafeParseResult<PayloadDismissedToasts, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadDismissedToasts$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadDismissedToasts' from JSON`,
);
}
/** @internal */
export const PayloadFavoriteProjectsAndSpaces$inboundSchema: z.ZodType<
PayloadFavoriteProjectsAndSpaces,
z.ZodTypeDef,
unknown
> = z.object({
teamId: types.string(),
projectId: types.string(),
});
export function payloadFavoriteProjectsAndSpacesFromJSON(
jsonString: string,
): SafeParseResult<PayloadFavoriteProjectsAndSpaces, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadFavoriteProjectsAndSpaces$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadFavoriteProjectsAndSpaces' from JSON`,
);
}
/** @internal */
export const PayloadImportFlowGitNamespace$inboundSchema: z.ZodType<
PayloadImportFlowGitNamespace,
z.ZodTypeDef,
unknown
> = smartUnion([types.string(), types.number()]);
export function payloadImportFlowGitNamespaceFromJSON(
jsonString: string,
): SafeParseResult<PayloadImportFlowGitNamespace, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadImportFlowGitNamespace$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadImportFlowGitNamespace' from JSON`,
);
}
/** @internal */
export const PayloadImportFlowGitNamespaceId$inboundSchema: z.ZodType<
PayloadImportFlowGitNamespaceId,
z.ZodTypeDef,
unknown
> = smartUnion([types.string(), types.number()]);
export function payloadImportFlowGitNamespaceIdFromJSON(
jsonString: string,
): SafeParseResult<PayloadImportFlowGitNamespaceId, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadImportFlowGitNamespaceId$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadImportFlowGitNamespaceId' from JSON`,
);
}
/** @internal */
export const PayloadImportFlowGitProvider$inboundSchema: z.ZodNativeEnum<
typeof PayloadImportFlowGitProvider
> = z.nativeEnum(PayloadImportFlowGitProvider);
/** @internal */
export const PayloadGitNamespaceId$inboundSchema: z.ZodType<
PayloadGitNamespaceId,
z.ZodTypeDef,
unknown
> = smartUnion([types.string(), types.number()]);
export function payloadGitNamespaceIdFromJSON(
jsonString: string,
): SafeParseResult<PayloadGitNamespaceId, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadGitNamespaceId$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadGitNamespaceId' from JSON`,
);
}
/** @internal */
export const PayloadPreferredScopesAndGitNamespaces$inboundSchema: z.ZodType<
PayloadPreferredScopesAndGitNamespaces,
z.ZodTypeDef,
unknown
> = z.object({
scopeId: types.string(),
gitNamespaceId: types.nullable(smartUnion([types.string(), types.number()])),
});
export function payloadPreferredScopesAndGitNamespacesFromJSON(
jsonString: string,
): SafeParseResult<PayloadPreferredScopesAndGitNamespaces, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PayloadPreferredScopesAndGitNamespaces$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadPreferredScopesAndGitNamespaces' from JSON`,
);
}
/** @internal */
export const PreventAutoBlocking$inboundSchema: z.ZodType<
PreventAutoBlocking,
z.ZodTypeDef,
unknown
> = smartUnion([types.number(), types.boolean()]);
export function preventAutoBlockingFromJSON(
jsonString: string,
): SafeParseResult<PreventAutoBlocking, SDKValidationError> {
return safeParse(
jsonString,
(x) => PreventAutoBlocking$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PreventAutoBlocking' from JSON`,
);
}
/** @internal */
export const UserEventPayloadRemoteCaching$inboundSchema: z.ZodType<
UserEventPayloadRemoteCaching,
z.ZodTypeDef,
unknown
> = z.object({
enabled: types.optional(types.boolean()),
});
export function userEventPayloadRemoteCachingFromJSON(
jsonString: string,
): SafeParseResult<UserEventPayloadRemoteCaching, SDKValidationError> {
return safeParse(
jsonString,
(x) => UserEventPayloadRemoteCaching$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'UserEventPayloadRemoteCaching' from JSON`,
);
}
/** @internal */
export const PayloadBuildEntitlements$inboundSchema: z.ZodType<
PayloadBuildEntitlements,
z.ZodTypeDef,
unknown
> = z.object({
enhancedBuilds: types.optional(types.boolean()),
});
export function payloadBuildEntitlementsFromJSON(
jsonString: string,
): SafeParseResult<PayloadBuildEntitlements, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadBuildEntitlements$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadBuildEntitlements' from JSON`,
);
}
/** @internal */
export const UserEventPayload138Configuration$inboundSchema: z.ZodNativeEnum<
typeof UserEventPayload138Configuration
> = z.nativeEnum(UserEventPayload138Configuration);
/** @internal */
export const PayloadBuildQueue$inboundSchema: z.ZodType<
PayloadBuildQueue,
z.ZodTypeDef,
unknown
> = z.object({
configuration: types.optional(UserEventPayload138Configuration$inboundSchema),
});
export function payloadBuildQueueFromJSON(
jsonString: string,
): SafeParseResult<PayloadBuildQueue, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadBuildQueue$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadBuildQueue' from JSON`,
);
}
/** @internal */
export const PayloadSecurity$inboundSchema: z.ZodType<
PayloadSecurity,
z.ZodTypeDef,
unknown
> = z.object({
customRules: types.optional(types.number()),
ipBlocks: types.optional(types.number()),
ipBypass: types.optional(types.number()),
rateLimit: types.optional(types.number()),
});
export function payloadSecurityFromJSON(
jsonString: string,
): SafeParseResult<PayloadSecurity, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadSecurity$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadSecurity' from JSON`,
);
}
/** @internal */
export const PayloadDefault$inboundSchema: z.ZodNativeEnum<
typeof PayloadDefault
> = z.nativeEnum(PayloadDefault);
/** @internal */
export const PayloadBuildMachine$inboundSchema: z.ZodType<
PayloadBuildMachine,
z.ZodTypeDef,
unknown
> = z.object({
default: types.optional(PayloadDefault$inboundSchema),
});
export function payloadBuildMachineFromJSON(
jsonString: string,
): SafeParseResult<PayloadBuildMachine, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadBuildMachine$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadBuildMachine' from JSON`,
);
}
/** @internal */
export const PayloadResourceConfig$inboundSchema: z.ZodType<
PayloadResourceConfig,
z.ZodTypeDef,
unknown
> = z.object({
nodeType: types.optional(types.string()),
concurrentBuilds: types.optional(types.number()),
elasticConcurrencyEnabled: types.optional(types.boolean()),
buildEntitlements: types.optional(
z.lazy(() => PayloadBuildEntitlements$inboundSchema),
),
buildQueue: types.optional(z.lazy(() => PayloadBuildQueue$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(() => PayloadSecurity$inboundSchema)),
bulkRedirectsFreeLimitOverride: types.optional(types.number()),
buildMachine: types.optional(z.lazy(() => PayloadBuildMachine$inboundSchema)),
});
export function payloadResourceConfigFromJSON(
jsonString: string,
): SafeParseResult<PayloadResourceConfig, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadResourceConfig$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadResourceConfig' from JSON`,
);
}
/** @internal */
export const ResourceLimits$inboundSchema: z.ZodType<
ResourceLimits,
z.ZodTypeDef,
unknown
> = z.object({
max: types.number(),
duration: types.number(),
});
export function resourceLimitsFromJSON(
jsonString: string,
): SafeParseResult<ResourceLimits, SDKValidationError> {
return safeParse(
jsonString,
(x) => ResourceLimits$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'ResourceLimits' from JSON`,
);
}
/** @internal */
export const PayloadViewPreference$inboundSchema: z.ZodNativeEnum<
typeof PayloadViewPreference
> = z.nativeEnum(PayloadViewPreference);
/** @internal */
export const PayloadFavoritesViewPreference$inboundSchema: z.ZodNativeEnum<
typeof PayloadFavoritesViewPreference
> = z.nativeEnum(PayloadFavoritesViewPreference);
/** @internal */
export const PayloadRecentsViewPreference$inboundSchema: z.ZodNativeEnum<
typeof PayloadRecentsViewPreference
> = z.nativeEnum(PayloadRecentsViewPreference);
/** @internal */
export const PayloadActiveDashboardViews$inboundSchema: z.ZodType<
PayloadActiveDashboardViews,
z.ZodTypeDef,
unknown
> = z.object({
scopeId: types.string(),
viewPreference: z.nullable(PayloadViewPreference$inboundSchema).optional(),
favoritesViewPreference: z.nullable(
PayloadFavoritesViewPreference$inboundSchema,
).optional(),
recentsViewPreference: z.nullable(PayloadRecentsViewPreference$inboundSchema)
.optional(),
});
export function payloadActiveDashboardViewsFromJSON(
jsonString: string,
): SafeParseResult<PayloadActiveDashboardViews, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadActiveDashboardViews$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadActiveDashboardViews' from JSON`,
);
}
/** @internal */
export const SecondaryEmails$inboundSchema: z.ZodType<
SecondaryEmails,
z.ZodTypeDef,
unknown
> = z.object({
email: types.string(),
verified: types.boolean(),
});
export function secondaryEmailsFromJSON(
jsonString: string,
): SafeParseResult<SecondaryEmails, SDKValidationError> {
return safeParse(
jsonString,
(x) => SecondaryEmails$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'SecondaryEmails' from JSON`,
);
}
/** @internal */
export const PayloadRules$inboundSchema: z.ZodType<
PayloadRules,
z.ZodTypeDef,
unknown
> = z.object({
email: types.string(),
});
export function payloadRulesFromJSON(
jsonString: string,
): SafeParseResult<PayloadRules, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadRules$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadRules' from JSON`,
);
}
/** @internal */
export const EmailNotifications$inboundSchema: z.ZodType<
EmailNotifications,
z.ZodTypeDef,
unknown
> = z.object({
rules: types.optional(z.record(z.lazy(() => PayloadRules$inboundSchema))),
});
export function emailNotificationsFromJSON(
jsonString: string,
): SafeParseResult<EmailNotifications, SDKValidationError> {
return safeParse(
jsonString,
(x) => EmailNotifications$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'EmailNotifications' from JSON`,
);
}
/** @internal */
export const PayloadReasons$inboundSchema: z.ZodType<
PayloadReasons,
z.ZodTypeDef,
unknown
> = z.object({
name: types.string(),
value: types.string(),
});
export function payloadReasonsFromJSON(
jsonString: string,
): SafeParseResult<PayloadReasons, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadReasons$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadReasons' from JSON`,
);
}
/** @internal */
export const SiftScores$inboundSchema: z.ZodType<
SiftScores,
z.ZodTypeDef,
unknown
> = z.object({
score: types.number(),
reasons: z.array(z.lazy(() => PayloadReasons$inboundSchema)),
});
export function siftScoresFromJSON(
jsonString: string,
): SafeParseResult<SiftScores, SDKValidationError> {
return safeParse(
jsonString,
(x) => SiftScores$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'SiftScores' from JSON`,
);
}
/** @internal */
export const UserEventPayloadName$inboundSchema: z.ZodNativeEnum<
typeof UserEventPayloadName
> = z.nativeEnum(UserEventPayloadName);
/** @internal */
export const PayloadSiftRoute$inboundSchema: z.ZodType<
PayloadSiftRoute,
z.ZodTypeDef,
unknown
> = z.object({
name: UserEventPayloadName$inboundSchema,
});
export function payloadSiftRouteFromJSON(
jsonString: string,
): SafeParseResult<PayloadSiftRoute, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadSiftRoute$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadSiftRoute' from JSON`,
);
}
/** @internal */
export const UserEventPayloadReason$inboundSchema: z.ZodNativeEnum<
typeof UserEventPayloadReason
> = z.nativeEnum(UserEventPayloadReason);
/** @internal */
export const PayloadBlockedDueToOverageType$inboundSchema: z.ZodNativeEnum<
typeof PayloadBlockedDueToOverageType
> = z.nativeEnum(PayloadBlockedDueToOverageType);
/** @internal */
export const PayloadSoftBlock$inboundSchema: z.ZodType<
PayloadSoftBlock,
z.ZodTypeDef,
unknown
> = z.object({
blockedAt: types.number(),
reason: UserEventPayloadReason$inboundSchema,
blockedDueToOverageType: types.optional(
PayloadBlockedDueToOverageType$inboundSchema,
),
});
export function payloadSoftBlockFromJSON(
jsonString: string,
): SafeParseResult<PayloadSoftBlock, SDKValidationError> {
return safeParse(
jsonString,
(x) => PayloadSoftBlock$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PayloadSoftBlock' from JSON`,
);
}
/** @internal */
export const UserEventPayload138Role$inboundSchema: z.ZodNativeEnum<
typeof UserEventPayload138Role
> = z.nativeEnum(UserEventPayload138Role);
/** @internal */
export const PayloadTeamRoles$inboundSchema: z.ZodNativeEnum<
typeof PayloadTeamRoles
> = z.nativeEnum(PayloadTeamRoles);
/** @internal */
export const PayloadTeamPermissions$inboundSchema: z.ZodNativeEnum<
typeof PayloadTeamPermissions
> = z.nativeEnum(PayloadTeamPermissions);
/** @internal */
export const UserEventPayload138Origin$inboundSchema: z.ZodNativeEnum<
typeof UserEventPayload138Origin
> = z.nativeEnum(UserEventPayload138Origin);
/** @internal */
export const UserEventPayloadGitUserId$inboundSchema: z.ZodType<
UserEventPayloadGitUserId,
z.ZodTypeDef,
unknown
> = smartUnion([types.string(), types.number()]);
export function userEventPayloadGitUserIdFromJSON(
jsonString: string,
): SafeParseResult<UserEventPayloadGitUserId, SDKValidationError> {
return safeParse(
jsonString,
(x) => UserEventPayloadGitUserId$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'UserEventPayloadGitUserId' from JSON`,
);
}
/** @internal */
export const UserEventPayloadJoinedFrom$inboundSchema: z.ZodType<
UserEventPayloadJoinedFrom,
z.ZodTypeDef,
unknown
> = z.object({
origin: UserEventPayload138Origin$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 userEventPayloadJoinedFromFromJSON(
jsonString: string,
): SafeParseResult<UserEventPayloadJoinedFrom, SDKValidationError> {
return safeParse(
jsonString,
(x) => UserEventPayloadJoinedFrom$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'UserEventPayloadJoinedFrom' from JSON`,
);
}
/** @internal */
export const Teams$inboundSchema: z.ZodType<Teams, z.ZodTypeDef, unknown> = z
.object({
teamId: types.string(),
createdAt: types.number(),
role: UserEventPayload138Role$inboundSchema,
confirmed: types.literal(true),
confirmedAt: types.number(),
accessRequestedAt: types.optional(types.number()),
teamRoles: types.optional(z.array(PayloadTeamRoles$inboundSchema)),
teamPermissions: types.optional(
z.array(PayloadTeamPermissions$inboundSchema),
),
created: types.number(),
joinedFrom: types.optional(
z.lazy(() => UserEventPayloadJoinedFrom$inboundSchema),
),
});
export function teamsFromJSON(
jsonString: string,
): SafeParseResult<Teams, SDKValidationError> {
return safeParse(
jsonString,
(x) => Teams$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Teams' from JSON`,
);
}
/** @internal */
export const UserEventPayload138Type$inboundSchema: z.ZodNativeEnum<
typeof UserEventPayload138Type
> = z.nativeEnum(UserEventPayload138Type);