import { DayInterval } from "../utils/dates.js"; import { DeepMerge } from "../utils/objects.js"; import { Result } from "../utils/results.js"; import { CollapseObjectUnion, Expand, IsUnion } from "../utils/types.js"; import { Config, NormalizesTo } from "./format.js"; import * as yup from "yup"; //#region src/config/schema.d.ts declare const configLevels: readonly ["project", "branch", "environment", "organization"]; type ConfigLevel = typeof configLevels[number]; declare module "yup" { interface CustomSchemaMetadata { stackConfigCanNoLongerBeOverridden?: true; } } /** * All fields that can be overridden at this level. */ declare const projectConfigSchema: yup.ObjectSchema<{ sourceOfTruth: { type: "hosted"; } | { type: "neon"; connectionStrings: Record; } | { type: "postgres"; connectionString: string; }; project: { requirePublishableClientKey?: boolean | undefined; }; }, yup.AnyObject, { sourceOfTruth: undefined; project: { requirePublishableClientKey: undefined; }; }, "">; declare const branchPaymentsSchema: yup.ObjectSchema<{ blockNewPurchases: boolean | undefined; autoPay: { interval?: DayInterval | undefined; } | undefined; productLines: Record; products: Record | undefined; prices: "include-by-default" | Record; customerType: "user" | "team" | "custom"; includedItems: Record; }>; items: Record; } | undefined, yup.AnyObject, { blockNewPurchases: undefined; autoPay: { interval: undefined; }; productLines: undefined; products: undefined; items: undefined; }, "">; declare const branchConfigSchema: yup.Schema; } | { type: "postgres"; connectionString: string; }; }, string>, "teams" | "emails" | "domains" | "auth" | "onboarding" | "rbac" | "payments" | "users" | "apiKeys" | "apps" | "dbSync" | "dataVault"> & { payments?: { blockNewPurchases?: boolean | undefined; autoPay?: { interval?: DayInterval | undefined; } | undefined; items: Record; productLines: Record; products: Record | undefined; prices: "include-by-default" | Record; customerType: "user" | "team" | "custom"; includedItems: Record; }>; } | undefined; teams: { createPersonalTeamOnSignUp?: boolean | undefined; allowClientTeamCreation?: boolean | undefined; }; emails: { selectedThemeId?: string | undefined; themes: Record; templates: Record; }; domains: {}; auth: { allowSignUp?: boolean | undefined; signUpRulesDefaultAction?: string | undefined; password: { allowSignIn?: boolean | undefined; }; otp: { allowSignIn?: boolean | undefined; }; oauth: { accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined; providers: Record; }; passkey: { allowSignIn?: boolean | undefined; }; signUpRules: Record; }; onboarding: { requireEmailVerification?: boolean | undefined; }; rbac: { permissions: Record | undefined; } | undefined>; defaultPermissions: { teamCreator: Record; teamMember: Record; signUp: Record; }; }; users: { allowClientUserDeletion?: boolean | undefined; }; apiKeys: { enabled: { user?: boolean | undefined; team?: boolean | undefined; }; }; apps: { installed: Record<"teams" | "emails" | "authentication" | "fraud-protection" | "onboarding" | "rbac" | "api-keys" | "payments" | "email-api" | "data-vault" | "webhooks" | "tv-mode" | "launch-checklist" | "catalyst" | "neon" | "convex" | "vercel" | "analytics", { enabled?: boolean | undefined; }>; }; dbSync: { externalDatabases: Record; }; dataVault: { stores: Record; }; }, yup.AnyObject, Omit, "teams" | "emails" | "domains" | "auth" | "onboarding" | "rbac" | "payments" | "users" | "apiKeys" | "apps" | "dbSync" | "dataVault"> & { rbac: { permissions: undefined; defaultPermissions: { teamCreator: undefined; teamMember: undefined; signUp: undefined; }; }; teams: { createPersonalTeamOnSignUp: undefined; allowClientTeamCreation: undefined; }; users: { allowClientUserDeletion: undefined; }; onboarding: { requireEmailVerification: undefined; }; apiKeys: { enabled: { team: undefined; user: undefined; }; }; apps: { installed: undefined; }; domains: {}; auth: { allowSignUp: undefined; password: { allowSignIn: undefined; }; otp: { allowSignIn: undefined; }; passkey: { allowSignIn: undefined; }; oauth: { accountMergeStrategy: undefined; providers: undefined; }; signUpRules: undefined; signUpRulesDefaultAction: undefined; }; emails: { selectedThemeId: undefined; themes: undefined; templates: undefined; }; payments: { blockNewPurchases: undefined; autoPay: { interval: undefined; }; productLines: undefined; products: undefined; items: undefined; }; dbSync: { externalDatabases: undefined; }; dataVault: { stores: undefined; }; }, "">; declare const environmentConfigSchema: yup.Schema; } | { type: "postgres"; connectionString: string; }; }, string>, "teams" | "emails" | "domains" | "auth" | "onboarding" | "rbac" | "payments" | "users" | "apiKeys" | "apps" | "dbSync" | "dataVault"> & { payments?: { blockNewPurchases?: boolean | undefined; autoPay?: { interval?: DayInterval | undefined; } | undefined; items: Record; productLines: Record; products: Record | undefined; prices: "include-by-default" | Record; customerType: "user" | "team" | "custom"; includedItems: Record; }>; } | undefined; teams: { createPersonalTeamOnSignUp?: boolean | undefined; allowClientTeamCreation?: boolean | undefined; }; emails: { selectedThemeId?: string | undefined; themes: Record; templates: Record; }; domains: {}; auth: { allowSignUp?: boolean | undefined; signUpRulesDefaultAction?: string | undefined; password: { allowSignIn?: boolean | undefined; }; otp: { allowSignIn?: boolean | undefined; }; oauth: { accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined; providers: Record; }; passkey: { allowSignIn?: boolean | undefined; }; signUpRules: Record; }; onboarding: { requireEmailVerification?: boolean | undefined; }; rbac: { permissions: Record | undefined; } | undefined>; defaultPermissions: { teamCreator: Record; teamMember: Record; signUp: Record; }; }; users: { allowClientUserDeletion?: boolean | undefined; }; apiKeys: { enabled: { user?: boolean | undefined; team?: boolean | undefined; }; }; apps: { installed: Record<"teams" | "emails" | "authentication" | "fraud-protection" | "onboarding" | "rbac" | "api-keys" | "payments" | "email-api" | "data-vault" | "webhooks" | "tv-mode" | "launch-checklist" | "catalyst" | "neon" | "convex" | "vercel" | "analytics", { enabled?: boolean | undefined; }>; }; dbSync: { externalDatabases: Record; }; dataVault: { stores: Record; }; }>, "emails" | "domains" | "auth" | "payments" | "analytics" | "customDashboards"> & { payments?: (Omit<{ blockNewPurchases?: boolean | undefined; autoPay?: { interval?: DayInterval | undefined; } | undefined; items: Record; productLines: Record; products: Record | undefined; prices: "include-by-default" | Record; customerType: "user" | "team" | "custom"; includedItems: Record; }>; }, "testMode"> & { testMode?: boolean | undefined; }) | undefined; emails: Omit<{ selectedThemeId?: string | undefined; themes: Record; templates: Record; }, "server"> & { server: { password?: string | undefined; provider?: "resend" | "smtp" | "managed" | undefined; host?: string | undefined; port?: number | undefined; username?: string | undefined; isShared?: boolean | undefined; senderName?: string | undefined; senderEmail?: string | undefined; managedSubdomain?: string | undefined; managedSenderLocalPart?: string | undefined; }; }; domains: Omit<{}, "allowLocalhost" | "trustedDomains"> & { allowLocalhost?: boolean | undefined; trustedDomains: Record; }; auth: Omit<{ allowSignUp?: boolean | undefined; signUpRulesDefaultAction?: string | undefined; password: { allowSignIn?: boolean | undefined; }; otp: { allowSignIn?: boolean | undefined; }; oauth: { accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined; providers: Record; }; passkey: { allowSignIn?: boolean | undefined; }; signUpRules: Record; }, "oauth"> & { oauth: Omit<{ accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined; providers: Record; }, "providers"> & { providers: Record | undefined; }>; }; }; analytics: { queryFolders: Record; }>; }; customDashboards: Record; }, yup.AnyObject, Omit, "teams" | "emails" | "domains" | "auth" | "onboarding" | "rbac" | "payments" | "users" | "apiKeys" | "apps" | "dbSync" | "dataVault"> & { rbac: { permissions: undefined; defaultPermissions: { teamCreator: undefined; teamMember: undefined; signUp: undefined; }; }; teams: { createPersonalTeamOnSignUp: undefined; allowClientTeamCreation: undefined; }; users: { allowClientUserDeletion: undefined; }; onboarding: { requireEmailVerification: undefined; }; apiKeys: { enabled: { team: undefined; user: undefined; }; }; apps: { installed: undefined; }; domains: {}; auth: { allowSignUp: undefined; password: { allowSignIn: undefined; }; otp: { allowSignIn: undefined; }; passkey: { allowSignIn: undefined; }; oauth: { accountMergeStrategy: undefined; providers: undefined; }; signUpRules: undefined; signUpRulesDefaultAction: undefined; }; emails: { selectedThemeId: undefined; themes: undefined; templates: undefined; }; payments: { blockNewPurchases: undefined; autoPay: { interval: undefined; }; productLines: undefined; products: undefined; items: undefined; }; dbSync: { externalDatabases: undefined; }; dataVault: { stores: undefined; }; }>, "emails" | "domains" | "auth" | "payments" | "analytics" | "customDashboards"> & { auth: Omit, "teams" | "emails" | "domains" | "auth" | "onboarding" | "rbac" | "payments" | "users" | "apiKeys" | "apps" | "dbSync" | "dataVault"> & { rbac: { permissions: undefined; defaultPermissions: { teamCreator: undefined; teamMember: undefined; signUp: undefined; }; }; teams: { createPersonalTeamOnSignUp: undefined; allowClientTeamCreation: undefined; }; users: { allowClientUserDeletion: undefined; }; onboarding: { requireEmailVerification: undefined; }; apiKeys: { enabled: { team: undefined; user: undefined; }; }; apps: { installed: undefined; }; domains: {}; auth: { allowSignUp: undefined; password: { allowSignIn: undefined; }; otp: { allowSignIn: undefined; }; passkey: { allowSignIn: undefined; }; oauth: { accountMergeStrategy: undefined; providers: undefined; }; signUpRules: undefined; signUpRulesDefaultAction: undefined; }; emails: { selectedThemeId: undefined; themes: undefined; templates: undefined; }; payments: { blockNewPurchases: undefined; autoPay: { interval: undefined; }; productLines: undefined; products: undefined; items: undefined; }; dbSync: { externalDatabases: undefined; }; dataVault: { stores: undefined; }; }>, "oauth"> & { oauth: Omit, "teams" | "emails" | "domains" | "auth" | "onboarding" | "rbac" | "payments" | "users" | "apiKeys" | "apps" | "dbSync" | "dataVault"> & { rbac: { permissions: undefined; defaultPermissions: { teamCreator: undefined; teamMember: undefined; signUp: undefined; }; }; teams: { createPersonalTeamOnSignUp: undefined; allowClientTeamCreation: undefined; }; users: { allowClientUserDeletion: undefined; }; onboarding: { requireEmailVerification: undefined; }; apiKeys: { enabled: { team: undefined; user: undefined; }; }; apps: { installed: undefined; }; domains: {}; auth: { allowSignUp: undefined; password: { allowSignIn: undefined; }; otp: { allowSignIn: undefined; }; passkey: { allowSignIn: undefined; }; oauth: { accountMergeStrategy: undefined; providers: undefined; }; signUpRules: undefined; signUpRulesDefaultAction: undefined; }; emails: { selectedThemeId: undefined; themes: undefined; templates: undefined; }; payments: { blockNewPurchases: undefined; autoPay: { interval: undefined; }; productLines: undefined; products: undefined; items: undefined; }; dbSync: { externalDatabases: undefined; }; dataVault: { stores: undefined; }; }>, "providers"> & { providers: undefined; }; }; emails: Omit, "teams" | "emails" | "domains" | "auth" | "onboarding" | "rbac" | "payments" | "users" | "apiKeys" | "apps" | "dbSync" | "dataVault"> & { rbac: { permissions: undefined; defaultPermissions: { teamCreator: undefined; teamMember: undefined; signUp: undefined; }; }; teams: { createPersonalTeamOnSignUp: undefined; allowClientTeamCreation: undefined; }; users: { allowClientUserDeletion: undefined; }; onboarding: { requireEmailVerification: undefined; }; apiKeys: { enabled: { team: undefined; user: undefined; }; }; apps: { installed: undefined; }; domains: {}; auth: { allowSignUp: undefined; password: { allowSignIn: undefined; }; otp: { allowSignIn: undefined; }; passkey: { allowSignIn: undefined; }; oauth: { accountMergeStrategy: undefined; providers: undefined; }; signUpRules: undefined; signUpRulesDefaultAction: undefined; }; emails: { selectedThemeId: undefined; themes: undefined; templates: undefined; }; payments: { blockNewPurchases: undefined; autoPay: { interval: undefined; }; productLines: undefined; products: undefined; items: undefined; }; dbSync: { externalDatabases: undefined; }; dataVault: { stores: undefined; }; }>, "server"> & { server: { isShared: undefined; provider: undefined; host: undefined; port: undefined; username: undefined; password: undefined; senderName: undefined; senderEmail: undefined; managedSubdomain: undefined; managedSenderLocalPart: undefined; }; }; domains: Omit, "teams" | "emails" | "domains" | "auth" | "onboarding" | "rbac" | "payments" | "users" | "apiKeys" | "apps" | "dbSync" | "dataVault"> & { rbac: { permissions: undefined; defaultPermissions: { teamCreator: undefined; teamMember: undefined; signUp: undefined; }; }; teams: { createPersonalTeamOnSignUp: undefined; allowClientTeamCreation: undefined; }; users: { allowClientUserDeletion: undefined; }; onboarding: { requireEmailVerification: undefined; }; apiKeys: { enabled: { team: undefined; user: undefined; }; }; apps: { installed: undefined; }; domains: {}; auth: { allowSignUp: undefined; password: { allowSignIn: undefined; }; otp: { allowSignIn: undefined; }; passkey: { allowSignIn: undefined; }; oauth: { accountMergeStrategy: undefined; providers: undefined; }; signUpRules: undefined; signUpRulesDefaultAction: undefined; }; emails: { selectedThemeId: undefined; themes: undefined; templates: undefined; }; payments: { blockNewPurchases: undefined; autoPay: { interval: undefined; }; productLines: undefined; products: undefined; items: undefined; }; dbSync: { externalDatabases: undefined; }; dataVault: { stores: undefined; }; }>, "allowLocalhost" | "trustedDomains"> & { allowLocalhost: undefined; trustedDomains: undefined; }; payments: Omit, "teams" | "emails" | "domains" | "auth" | "onboarding" | "rbac" | "payments" | "users" | "apiKeys" | "apps" | "dbSync" | "dataVault"> & { rbac: { permissions: undefined; defaultPermissions: { teamCreator: undefined; teamMember: undefined; signUp: undefined; }; }; teams: { createPersonalTeamOnSignUp: undefined; allowClientTeamCreation: undefined; }; users: { allowClientUserDeletion: undefined; }; onboarding: { requireEmailVerification: undefined; }; apiKeys: { enabled: { team: undefined; user: undefined; }; }; apps: { installed: undefined; }; domains: {}; auth: { allowSignUp: undefined; password: { allowSignIn: undefined; }; otp: { allowSignIn: undefined; }; passkey: { allowSignIn: undefined; }; oauth: { accountMergeStrategy: undefined; providers: undefined; }; signUpRules: undefined; signUpRulesDefaultAction: undefined; }; emails: { selectedThemeId: undefined; themes: undefined; templates: undefined; }; payments: { blockNewPurchases: undefined; autoPay: { interval: undefined; }; productLines: undefined; products: undefined; items: undefined; }; dbSync: { externalDatabases: undefined; }; dataVault: { stores: undefined; }; }>, "testMode"> & { testMode: undefined; }; analytics: { queryFolders: undefined; }; customDashboards: undefined; }, "">; declare const organizationConfigSchema: yup.Schema; } | { type: "postgres"; connectionString: string; }; }, string>, "teams" | "emails" | "domains" | "auth" | "onboarding" | "rbac" | "payments" | "users" | "apiKeys" | "apps" | "dbSync" | "dataVault"> & { payments?: { blockNewPurchases?: boolean | undefined; autoPay?: { interval?: DayInterval | undefined; } | undefined; items: Record; productLines: Record; products: Record | undefined; prices: "include-by-default" | Record; customerType: "user" | "team" | "custom"; includedItems: Record; }>; } | undefined; teams: { createPersonalTeamOnSignUp?: boolean | undefined; allowClientTeamCreation?: boolean | undefined; }; emails: { selectedThemeId?: string | undefined; themes: Record; templates: Record; }; domains: {}; auth: { allowSignUp?: boolean | undefined; signUpRulesDefaultAction?: string | undefined; password: { allowSignIn?: boolean | undefined; }; otp: { allowSignIn?: boolean | undefined; }; oauth: { accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined; providers: Record; }; passkey: { allowSignIn?: boolean | undefined; }; signUpRules: Record; }; onboarding: { requireEmailVerification?: boolean | undefined; }; rbac: { permissions: Record | undefined; } | undefined>; defaultPermissions: { teamCreator: Record; teamMember: Record; signUp: Record; }; }; users: { allowClientUserDeletion?: boolean | undefined; }; apiKeys: { enabled: { user?: boolean | undefined; team?: boolean | undefined; }; }; apps: { installed: Record<"teams" | "emails" | "authentication" | "fraud-protection" | "onboarding" | "rbac" | "api-keys" | "payments" | "email-api" | "data-vault" | "webhooks" | "tv-mode" | "launch-checklist" | "catalyst" | "neon" | "convex" | "vercel" | "analytics", { enabled?: boolean | undefined; }>; }; dbSync: { externalDatabases: Record; }; dataVault: { stores: Record; }; }>, "emails" | "domains" | "auth" | "payments" | "analytics" | "customDashboards"> & { payments?: (Omit<{ blockNewPurchases?: boolean | undefined; autoPay?: { interval?: DayInterval | undefined; } | undefined; items: Record; productLines: Record; products: Record | undefined; prices: "include-by-default" | Record; customerType: "user" | "team" | "custom"; includedItems: Record; }>; }, "testMode"> & { testMode?: boolean | undefined; }) | undefined; emails: Omit<{ selectedThemeId?: string | undefined; themes: Record; templates: Record; }, "server"> & { server: { password?: string | undefined; provider?: "resend" | "smtp" | "managed" | undefined; host?: string | undefined; port?: number | undefined; username?: string | undefined; isShared?: boolean | undefined; senderName?: string | undefined; senderEmail?: string | undefined; managedSubdomain?: string | undefined; managedSenderLocalPart?: string | undefined; }; }; domains: Omit<{}, "allowLocalhost" | "trustedDomains"> & { allowLocalhost?: boolean | undefined; trustedDomains: Record; }; auth: Omit<{ allowSignUp?: boolean | undefined; signUpRulesDefaultAction?: string | undefined; password: { allowSignIn?: boolean | undefined; }; otp: { allowSignIn?: boolean | undefined; }; oauth: { accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined; providers: Record; }; passkey: { allowSignIn?: boolean | undefined; }; signUpRules: Record; }, "oauth"> & { oauth: Omit<{ accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined; providers: Record; }, "providers"> & { providers: Record | undefined; }>; }; }; analytics: { queryFolders: Record; }>; }; customDashboards: Record; }>, never> & {}, yup.AnyObject, Omit, "teams" | "emails" | "domains" | "auth" | "onboarding" | "rbac" | "payments" | "users" | "apiKeys" | "apps" | "dbSync" | "dataVault"> & { rbac: { permissions: undefined; defaultPermissions: { teamCreator: undefined; teamMember: undefined; signUp: undefined; }; }; teams: { createPersonalTeamOnSignUp: undefined; allowClientTeamCreation: undefined; }; users: { allowClientUserDeletion: undefined; }; onboarding: { requireEmailVerification: undefined; }; apiKeys: { enabled: { team: undefined; user: undefined; }; }; apps: { installed: undefined; }; domains: {}; auth: { allowSignUp: undefined; password: { allowSignIn: undefined; }; otp: { allowSignIn: undefined; }; passkey: { allowSignIn: undefined; }; oauth: { accountMergeStrategy: undefined; providers: undefined; }; signUpRules: undefined; signUpRulesDefaultAction: undefined; }; emails: { selectedThemeId: undefined; themes: undefined; templates: undefined; }; payments: { blockNewPurchases: undefined; autoPay: { interval: undefined; }; productLines: undefined; products: undefined; items: undefined; }; dbSync: { externalDatabases: undefined; }; dataVault: { stores: undefined; }; }>, "emails" | "domains" | "auth" | "payments" | "analytics" | "customDashboards"> & { auth: Omit, "teams" | "emails" | "domains" | "auth" | "onboarding" | "rbac" | "payments" | "users" | "apiKeys" | "apps" | "dbSync" | "dataVault"> & { rbac: { permissions: undefined; defaultPermissions: { teamCreator: undefined; teamMember: undefined; signUp: undefined; }; }; teams: { createPersonalTeamOnSignUp: undefined; allowClientTeamCreation: undefined; }; users: { allowClientUserDeletion: undefined; }; onboarding: { requireEmailVerification: undefined; }; apiKeys: { enabled: { team: undefined; user: undefined; }; }; apps: { installed: undefined; }; domains: {}; auth: { allowSignUp: undefined; password: { allowSignIn: undefined; }; otp: { allowSignIn: undefined; }; passkey: { allowSignIn: undefined; }; oauth: { accountMergeStrategy: undefined; providers: undefined; }; signUpRules: undefined; signUpRulesDefaultAction: undefined; }; emails: { selectedThemeId: undefined; themes: undefined; templates: undefined; }; payments: { blockNewPurchases: undefined; autoPay: { interval: undefined; }; productLines: undefined; products: undefined; items: undefined; }; dbSync: { externalDatabases: undefined; }; dataVault: { stores: undefined; }; }>, "oauth"> & { oauth: Omit, "teams" | "emails" | "domains" | "auth" | "onboarding" | "rbac" | "payments" | "users" | "apiKeys" | "apps" | "dbSync" | "dataVault"> & { rbac: { permissions: undefined; defaultPermissions: { teamCreator: undefined; teamMember: undefined; signUp: undefined; }; }; teams: { createPersonalTeamOnSignUp: undefined; allowClientTeamCreation: undefined; }; users: { allowClientUserDeletion: undefined; }; onboarding: { requireEmailVerification: undefined; }; apiKeys: { enabled: { team: undefined; user: undefined; }; }; apps: { installed: undefined; }; domains: {}; auth: { allowSignUp: undefined; password: { allowSignIn: undefined; }; otp: { allowSignIn: undefined; }; passkey: { allowSignIn: undefined; }; oauth: { accountMergeStrategy: undefined; providers: undefined; }; signUpRules: undefined; signUpRulesDefaultAction: undefined; }; emails: { selectedThemeId: undefined; themes: undefined; templates: undefined; }; payments: { blockNewPurchases: undefined; autoPay: { interval: undefined; }; productLines: undefined; products: undefined; items: undefined; }; dbSync: { externalDatabases: undefined; }; dataVault: { stores: undefined; }; }>, "providers"> & { providers: undefined; }; }; emails: Omit, "teams" | "emails" | "domains" | "auth" | "onboarding" | "rbac" | "payments" | "users" | "apiKeys" | "apps" | "dbSync" | "dataVault"> & { rbac: { permissions: undefined; defaultPermissions: { teamCreator: undefined; teamMember: undefined; signUp: undefined; }; }; teams: { createPersonalTeamOnSignUp: undefined; allowClientTeamCreation: undefined; }; users: { allowClientUserDeletion: undefined; }; onboarding: { requireEmailVerification: undefined; }; apiKeys: { enabled: { team: undefined; user: undefined; }; }; apps: { installed: undefined; }; domains: {}; auth: { allowSignUp: undefined; password: { allowSignIn: undefined; }; otp: { allowSignIn: undefined; }; passkey: { allowSignIn: undefined; }; oauth: { accountMergeStrategy: undefined; providers: undefined; }; signUpRules: undefined; signUpRulesDefaultAction: undefined; }; emails: { selectedThemeId: undefined; themes: undefined; templates: undefined; }; payments: { blockNewPurchases: undefined; autoPay: { interval: undefined; }; productLines: undefined; products: undefined; items: undefined; }; dbSync: { externalDatabases: undefined; }; dataVault: { stores: undefined; }; }>, "server"> & { server: { isShared: undefined; provider: undefined; host: undefined; port: undefined; username: undefined; password: undefined; senderName: undefined; senderEmail: undefined; managedSubdomain: undefined; managedSenderLocalPart: undefined; }; }; domains: Omit, "teams" | "emails" | "domains" | "auth" | "onboarding" | "rbac" | "payments" | "users" | "apiKeys" | "apps" | "dbSync" | "dataVault"> & { rbac: { permissions: undefined; defaultPermissions: { teamCreator: undefined; teamMember: undefined; signUp: undefined; }; }; teams: { createPersonalTeamOnSignUp: undefined; allowClientTeamCreation: undefined; }; users: { allowClientUserDeletion: undefined; }; onboarding: { requireEmailVerification: undefined; }; apiKeys: { enabled: { team: undefined; user: undefined; }; }; apps: { installed: undefined; }; domains: {}; auth: { allowSignUp: undefined; password: { allowSignIn: undefined; }; otp: { allowSignIn: undefined; }; passkey: { allowSignIn: undefined; }; oauth: { accountMergeStrategy: undefined; providers: undefined; }; signUpRules: undefined; signUpRulesDefaultAction: undefined; }; emails: { selectedThemeId: undefined; themes: undefined; templates: undefined; }; payments: { blockNewPurchases: undefined; autoPay: { interval: undefined; }; productLines: undefined; products: undefined; items: undefined; }; dbSync: { externalDatabases: undefined; }; dataVault: { stores: undefined; }; }>, "allowLocalhost" | "trustedDomains"> & { allowLocalhost: undefined; trustedDomains: undefined; }; payments: Omit, "teams" | "emails" | "domains" | "auth" | "onboarding" | "rbac" | "payments" | "users" | "apiKeys" | "apps" | "dbSync" | "dataVault"> & { rbac: { permissions: undefined; defaultPermissions: { teamCreator: undefined; teamMember: undefined; signUp: undefined; }; }; teams: { createPersonalTeamOnSignUp: undefined; allowClientTeamCreation: undefined; }; users: { allowClientUserDeletion: undefined; }; onboarding: { requireEmailVerification: undefined; }; apiKeys: { enabled: { team: undefined; user: undefined; }; }; apps: { installed: undefined; }; domains: {}; auth: { allowSignUp: undefined; password: { allowSignIn: undefined; }; otp: { allowSignIn: undefined; }; passkey: { allowSignIn: undefined; }; oauth: { accountMergeStrategy: undefined; providers: undefined; }; signUpRules: undefined; signUpRulesDefaultAction: undefined; }; emails: { selectedThemeId: undefined; themes: undefined; templates: undefined; }; payments: { blockNewPurchases: undefined; autoPay: { interval: undefined; }; productLines: undefined; products: undefined; items: undefined; }; dbSync: { externalDatabases: undefined; }; dataVault: { stores: undefined; }; }>, "testMode"> & { testMode: undefined; }; analytics: { queryFolders: undefined; }; customDashboards: undefined; }>, never> & {}, "">; declare function migrateConfigOverride(type: "project" | "branch" | "environment" | "organization", oldUnmigratedConfigOverride: any): any; declare const projectConfigDefaults: { readonly sourceOfTruth: { readonly type: "hosted"; readonly connectionStrings: undefined; readonly connectionString: undefined; }; readonly project: { readonly requirePublishableClientKey: false; }; }; declare const branchConfigDefaults: {}; declare const environmentConfigDefaults: {}; declare const organizationConfigDefaults: { readonly rbac: { readonly permissions: (key: string) => { containedPermissionIds: (key: string) => undefined; description: undefined; scope: undefined; }; readonly defaultPermissions: { readonly teamCreator: (key: string) => undefined; readonly teamMember: (key: string) => undefined; readonly signUp: (key: string) => undefined; }; }; readonly apiKeys: { readonly enabled: { readonly team: false; readonly user: false; }; }; readonly apps: { readonly installed: Record; }; readonly teams: { readonly createPersonalTeamOnSignUp: false; readonly allowClientTeamCreation: false; }; readonly users: { readonly allowClientUserDeletion: false; }; readonly onboarding: { readonly requireEmailVerification: false; }; readonly domains: { readonly allowLocalhost: false; readonly trustedDomains: (key: string) => { readonly baseUrl: undefined; readonly handlerPath: "/handler"; }; }; readonly auth: { readonly allowSignUp: true; readonly password: { readonly allowSignIn: false; }; readonly otp: { readonly allowSignIn: false; }; readonly passkey: { readonly allowSignIn: false; }; readonly oauth: { readonly accountMergeStrategy: "link_method"; readonly providers: (key: string) => { type: undefined; isShared: true; allowSignIn: false; allowConnectedAccounts: false; clientId: undefined; clientSecret: undefined; facebookConfigId: undefined; microsoftTenantId: undefined; appleBundles: undefined; }; }; readonly signUpRules: (key: string) => { enabled: false; displayName: undefined; priority: number; condition: undefined; action: { type: "allow"; message: undefined; }; }; readonly signUpRulesDefaultAction: "allow"; }; readonly emails: { readonly server: { readonly isShared: true; readonly provider: "smtp"; readonly host: undefined; readonly port: undefined; readonly username: undefined; readonly password: undefined; readonly senderName: undefined; readonly senderEmail: undefined; readonly managedSubdomain: undefined; readonly managedSenderLocalPart: undefined; }; readonly selectedThemeId: "1df07ae6-abf3-4a40-83a5-a1a2cbe336ac"; readonly themes: ((key: string) => { displayName: string; tsxSource: string; }) & { "1df07ae6-abf3-4a40-83a5-a1a2cbe336ac": { displayName: string; tsxSource: string; }; "a0172b5d-cff0-463b-83bb-85124697373a": { displayName: string; tsxSource: string; }; "c7e2d94f-8a1b-4e6d-b3f5-9d0a2e7c1b8f": { displayName: string; tsxSource: string; }; }; readonly templates: ((key: string) => { displayName: string; tsxSource: string; themeId: undefined; }) & { "e7d009ce-8d47-4528-b245-5bf119f2ffa3": { displayName: string; tsxSource: string; themeId: undefined; }; "a70fb3a4-56c1-4e42-af25-49d25603abd0": { displayName: string; tsxSource: string; themeId: undefined; }; "822687fe-8d0a-4467-a0d1-416b6e639478": { displayName: string; tsxSource: string; themeId: undefined; }; "e84de395-2076-4831-9c19-8e9a96a868e4": { displayName: string; tsxSource: string; themeId: undefined; }; "066dd73c-36da-4fd0-b6d6-ebf87683f8bc": { displayName: string; tsxSource: string; themeId: undefined; }; "70372aee-0441-4d80-974c-2e858e40123a": { displayName: string; tsxSource: string; themeId: undefined; }; "f64b1afe-27ec-4a28-a277-7178f3261f9a": { displayName: string; tsxSource: string; themeId: undefined; }; }; }; readonly payments: { readonly blockNewPurchases: false; readonly testMode: true; readonly autoPay: undefined; readonly productLines: (key: string) => { displayName: undefined; customerType: undefined; }; readonly products: (key: string) => { readonly displayName: string; readonly productLineId: undefined; readonly customerType: "user"; readonly freeTrial: undefined; readonly serverOnly: false; readonly stackable: undefined; readonly isAddOnTo: false; readonly prices: (key: string) => { interval: undefined; serverOnly: false; freeTrial: undefined; USD: undefined; EUR: undefined; GBP: undefined; JPY: undefined; INR: undefined; AUD: undefined; CAD: undefined; }; readonly includedItems: (key: string) => { quantity: number; repeat: "never"; expires: "when-repeated"; }; }; readonly items: (key: string) => { readonly displayName: string; readonly customerType: "user"; }; }; readonly dbSync: { readonly externalDatabases: (key: string) => { type: undefined; connectionString: undefined; }; }; readonly dataVault: { readonly stores: (key: string) => { displayName: string; }; }; readonly analytics: { readonly queryFolders: (key: string) => { displayName: string; sortOrder: number; queries: (queryKey: string) => { displayName: string; sqlQuery: string; description: undefined; }; }; }; readonly customDashboards: (key: string) => { displayName: string; tsxSource: string; }; }; type ReplaceFunctionsWithObjects = T & (T extends ((arg: infer K extends string) => infer R) ? Record & object : unknown); type DeepReplaceFunctionsWithObjects = T extends object ? { [K in keyof ReplaceFunctionsWithObjects]: DeepReplaceFunctionsWithObjects[K]> } : T; type ApplyDefaults unknown), C extends object> = {} extends D ? C : DeepMerge, C>; declare function applyProjectDefaults(config: T): DeepMerge<{ readonly sourceOfTruth: { readonly type: "hosted"; readonly connectionStrings: undefined; readonly connectionString: undefined; }; readonly project: { readonly requirePublishableClientKey: false; }; }, T>; declare function applyBranchDefaults(config: T): DeepMerge<{ readonly sourceOfTruth: { readonly type: "hosted"; readonly connectionStrings: undefined; readonly connectionString: undefined; }; readonly project: { readonly requirePublishableClientKey: false; }; }, T>; declare function applyEnvironmentDefaults(config: T): ApplyDefaults>>; declare function applyOrganizationDefaults(config: OrganizationRenderedConfigBeforeDefaults): ApplyDefaults>>>; declare function sanitizeProjectConfig(config: T): Promise; declare function sanitizeBranchConfig(config: T): Promise; declare function sanitizeEnvironmentConfig(config: T): Promise; declare function sanitizeOrganizationConfig(config: OrganizationRenderedConfigBeforeSanitization): Promise<{ auth: { oauth: { providers: Record; accountMergeStrategy: "link_method" | "raise_error" | "allow_duplicates"; }; signUpRules: Record; password: { allowSignIn: boolean; }; otp: { allowSignIn: boolean; }; passkey: { allowSignIn: boolean; }; allowSignUp: boolean; signUpRulesDefaultAction: string; }; emails: { selectedThemeId: string; themes: { [x: string]: { displayName: string; tsxSource: string; }; }; templates: { [x: string]: { displayName: string; tsxSource: string; themeId: string | false | undefined; }; }; server: { password: string | undefined; provider: "resend" | "smtp" | "managed"; host: string | undefined; port: number | undefined; username: string | undefined; isShared: boolean; senderName: string | undefined; senderEmail: string | undefined; managedSubdomain: string | undefined; managedSenderLocalPart: string | undefined; }; }; payments: { products: Record; prices: "include-by-default" | Record; stackable: boolean | undefined; displayName: string; serverOnly: boolean; freeTrial: [number, "day" | "week" | "month" | "year"] | undefined; productLineId: string | undefined; customerType: "user" | "team" | "custom"; includedItems: { [x: string]: { repeat: "never" | [number, "day" | "week" | "month" | "year"]; quantity: number; expires: "never" | "when-purchase-expires" | "when-repeated"; }; }; }>; items: { [x: string]: { displayName: string; customerType: "user" | "team" | "custom"; }; }; blockNewPurchases: boolean; autoPay: { interval?: [number, "day" | "week" | "month" | "year"] | undefined; } | undefined; productLines: { [x: string]: { displayName: string | undefined; customerType: "user" | "team" | "custom" | undefined; }; }; testMode: boolean; }; apps: { installed: Record; }; project: { requirePublishableClientKey: boolean; }; sourceOfTruth: { type: "neon" | "hosted" | "postgres"; connectionString: string | undefined; connectionStrings: { [x: string]: string | undefined; } | undefined; } & ({ readonly type: "neon"; readonly connectionStrings: { readonly [x: string]: string; }; readonly connectionString?: undefined; } | { readonly type: "postgres"; readonly connectionString: string; readonly connectionStrings?: undefined; } | { readonly type: "hosted"; readonly connectionStrings?: undefined; readonly connectionString?: undefined; }); teams: { createPersonalTeamOnSignUp: boolean; allowClientTeamCreation: boolean; }; domains: { allowLocalhost: boolean; trustedDomains: { [x: string]: { baseUrl: string | undefined; handlerPath: string; }; }; }; onboarding: { requireEmailVerification: boolean; }; rbac: { permissions: { [x: string]: { description: string | undefined; scope: "team" | "project" | undefined; containedPermissionIds: { [x: string]: true | undefined; }; }; }; defaultPermissions: { teamCreator: { [x: string]: true | undefined; }; teamMember: { [x: string]: true | undefined; }; signUp: { [x: string]: true | undefined; }; }; }; analytics: { queryFolders: { [x: string]: { displayName: string; sortOrder: number; queries: { [x: string]: { description: string | undefined; displayName: string; sqlQuery: string; }; }; }; }; }; users: { allowClientUserDeletion: boolean; }; apiKeys: { enabled: { user: boolean; team: boolean; }; }; dbSync: { externalDatabases: { [x: string]: { type: "postgres" | undefined; connectionString: string | undefined; }; }; }; dataVault: { stores: { [x: string]: { displayName: string; }; }; }; customDashboards: { [x: string]: { displayName: string; tsxSource: string; }; }; }>; /** * Does not require a base config, and hence solely relies on the override itself to validate the config. If it returns * no error, you know that the * * It's crucial that our DB never contains any configs that are not valid according to this function, as this would mean * that the config object does not satisfy the ValidatedToHaveNoConfigOverrideErrors type (which is used as an assumption * in a whole bunch of places in the code). */ declare function getConfigOverrideErrors(schema: T, configOverride: unknown, options?: { allowPropertiesThatCanNoLongerBeOverridden?: boolean; }): Promise>; declare function assertNoConfigOverrideErrors(schema: T, config: unknown, options?: { allowPropertiesThatCanNoLongerBeOverridden?: boolean; extraInfo?: any; }): Promise; type _ValidatedToHaveNoConfigOverrideErrorsImpl = IsUnion extends true ? _ValidatedToHaveNoConfigOverrideErrorsImpl | Exclude> : T extends object ? (T extends any[] ? T : { [K in keyof T]+?: _ValidatedToHaveNoConfigOverrideErrorsImpl }) : T; type ValidatedToHaveNoConfigOverrideErrors = _ValidatedToHaveNoConfigOverrideErrorsImpl>; /** * Checks whether there are any warnings in the incomplete config. A warning doesn't stop the config from being valid, * but may require action regardless. * * The DB can contain configs that are not valid according to this function, as long as they are valid according to * the getConfigOverrideErrors function. (This is necessary, because a changing base config may make an override invalid * that was previously valid.) */ declare function getIncompleteConfigWarnings(schema: T, incompleteConfig: Config): Promise>; type ValidatedToHaveNoIncompleteConfigWarnings = yup.InferType; type ProjectConfigNormalizedOverride = Expand>; type BranchConfigNormalizedOverride = Expand>; type EnvironmentConfigNormalizedOverride = Expand>; type OrganizationConfigNormalizedOverride = Expand>; type ProjectConfigOverride = NormalizesTo; type BranchConfigOverride = NormalizesTo; type EnvironmentConfigOverride = NormalizesTo; type OrganizationConfigOverride = NormalizesTo; type ProjectConfigOverrideOverride = ProjectConfigOverride; type BranchConfigOverrideOverride = BranchConfigOverride; type EnvironmentConfigOverrideOverride = EnvironmentConfigOverride; type OrganizationConfigOverrideOverride = OrganizationConfigOverride; type ProjectIncompleteConfig = Expand; type BranchIncompleteConfig = Expand; type EnvironmentIncompleteConfig = Expand; type OrganizationIncompleteConfig = Expand; type ProjectRenderedConfigBeforeDefaults = Omit; type BranchRenderedConfigBeforeDefaults = Omit; type EnvironmentRenderedConfigBeforeDefaults = Omit; type OrganizationRenderedConfigBeforeDefaults = OrganizationIncompleteConfig; type ProjectRenderedConfigBeforeSanitization = Expand>>>; type BranchRenderedConfigBeforeSanitization = Expand>>>; type EnvironmentRenderedConfigBeforeSanitization = Expand>>>; type OrganizationRenderedConfigBeforeSanitization = Expand>>; type ProjectRenderedConfig = Expand>>>; type BranchRenderedConfig = Expand>>>; type EnvironmentRenderedConfig = Expand>>>; type OrganizationRenderedConfig = Expand>>; type CompleteConfig = OrganizationRenderedConfig; //#endregion export { BranchConfigNormalizedOverride, BranchConfigOverride, BranchConfigOverrideOverride, BranchIncompleteConfig, BranchRenderedConfig, CompleteConfig, ConfigLevel, EnvironmentConfigNormalizedOverride, EnvironmentConfigOverride, EnvironmentConfigOverrideOverride, EnvironmentIncompleteConfig, EnvironmentRenderedConfig, OrganizationConfigNormalizedOverride, OrganizationConfigOverride, OrganizationConfigOverrideOverride, OrganizationIncompleteConfig, OrganizationRenderedConfig, ProjectConfigNormalizedOverride, ProjectConfigOverride, ProjectConfigOverrideOverride, ProjectIncompleteConfig, ProjectRenderedConfig, ValidatedToHaveNoConfigOverrideErrors, ValidatedToHaveNoIncompleteConfigWarnings, applyBranchDefaults, applyEnvironmentDefaults, applyOrganizationDefaults, applyProjectDefaults, assertNoConfigOverrideErrors, branchConfigSchema, branchPaymentsSchema, configLevels, environmentConfigSchema, getConfigOverrideErrors, getIncompleteConfigWarnings, migrateConfigOverride, organizationConfigSchema, projectConfigSchema, sanitizeBranchConfig, sanitizeEnvironmentConfig, sanitizeOrganizationConfig, sanitizeProjectConfig }; //# sourceMappingURL=schema.d.ts.map