import { ProjectOnboardingStatus } from "@stackframe/stack-shared/dist/schema-fields"; import { ProductionModeError } from "@stackframe/stack-shared/dist/helpers/production-mode"; import { AdminUserProjectsCrud, ProjectsCrud } from "@stackframe/stack-shared/dist/interface/crud/projects"; import { CompleteConfig, EnvironmentConfigOverrideOverride } from "@stackframe/stack-shared/dist/config/schema"; import { StackAdminApp } from "../apps/interfaces/admin-app"; import { AdminProjectConfig, AdminProjectConfigUpdateOptions, ProjectConfig } from "../project-configs"; //#region src/lib/stack-app/projects/index.d.ts /** * SDK type for pushed config source (camelCase for SDK). * Represents where the branch config was pushed from. */ type PushedConfigSource = { type: "pushed-from-github"; owner: string; repo: string; branch: string; commitHash: string; configFilePath: string; } | { type: "pushed-from-unknown"; } | { type: "unlinked"; }; type PushConfigOptions = { /** * The source of this config push. */ source: PushedConfigSource; }; type Project = { readonly id: string; readonly displayName: string; readonly config: ProjectConfig; }; type AdminProject = { readonly id: string; readonly displayName: string; readonly description: string | null; readonly createdAt: Date; readonly isProductionMode: boolean; readonly ownerTeamId: string | null; readonly onboardingStatus: ProjectOnboardingStatus; readonly logoUrl: string | null | undefined; readonly logoFullUrl: string | null | undefined; readonly logoDarkModeUrl: string | null | undefined; readonly logoFullDarkModeUrl: string | null | undefined; readonly config: AdminProjectConfig; update(this: AdminProject, update: AdminProjectUpdateOptions): Promise; delete(this: AdminProject): Promise; getConfig(this: AdminProject): Promise; useConfig(this: AdminProject): CompleteConfig; /** * Updates the environment's config by merging the provided config into the existing config. * * Changes made with `updateConfig` always take precedence over those made with `pushConfig`, even if the `pushConfig` * config was pushed after the changes were made with `updateConfig`. This is best for environment-specific * configuration like secrets, API keys, and other values that you wouldn't push into a source repository. */ updateConfig(this: AdminProject, config: EnvironmentConfigOverrideOverride): Promise; /** * Pushes a config, replacing any previous config pushed with `pushConfig`. * * **Note:** This function does **not** replace any changes made with `updateConfig`. Changes made with * `updateConfig` always take precedence over those made with `pushConfig`, even if the `pushConfig` * config was pushed after the changes were made with `updateConfig`. * * This is useful for programmatically deploying configuration. More often than not, you'll want to use * `updateConfig` instead. */ pushConfig(this: AdminProject, config: EnvironmentConfigOverrideOverride, options: PushConfigOptions): Promise; /** * Updates the pushed config by merging the provided config into the existing pushed config. * * **Warning:** This is almost always **not** the function you want to call. Changes made with * `updatePushedConfig` will be replaced entirely the next time `pushConfig` is called. Consider using * `pushConfig` to set the full pushed config, or `updateConfig` for environment-specific values that * should persist across pushes. * * This function is useful for making temporary modifications to the pushed config before the next push. */ updatePushedConfig(this: AdminProject, config: EnvironmentConfigOverrideOverride): Promise; /** * Gets the source metadata for the pushed config, indicating where it was pushed from. * * The source can be: * - `pushed-from-github`: Config was pushed from a GitHub repository * - `pushed-from-unknown`: Config was pushed via CLI but source details unknown * - `unlinked`: Config can be edited directly on the dashboard */ getPushedConfigSource(this: AdminProject): Promise; /** * Unlinks the pushed config source, setting it to "unlinked". * This allows the config to be edited directly on the dashboard without external push restrictions. */ unlinkPushedConfigSource(this: AdminProject): Promise; /** * Resets (removes) specific keys from the config override at the specified level. * Uses the same nested key logic as the override algorithm: resetting key "a.b" also resets "a.b.c". * * This is useful when updating the pushed config (branch level) and wanting to remove the same keys * from the environment config override so that the branch config values take precedence. */ resetConfigOverrideKeys(this: AdminProject, level: "branch" | "environment", keys: string[]): Promise; /** * Gets the raw config override at the specified level (before merging/defaults). * Useful for inspecting exactly what's been set at each level. */ getConfigOverride(this: AdminProject, level: "branch" | "environment"): Promise>; /** * Replaces the entire config override at the specified level. * For branch level, preserves the existing source metadata. */ replaceConfigOverride(this: AdminProject, level: "branch" | "environment", config: Record): Promise; getProductionModeErrors(this: AdminProject): Promise; useProductionModeErrors(this: AdminProject): ProductionModeError[]; } & Project; type AdminOwnedProject = { readonly app: StackAdminApp; } & AdminProject; type AdminProjectUpdateOptions = { displayName?: string; description?: string; isProductionMode?: boolean; onboardingStatus?: ProjectOnboardingStatus; /** * Updates `project.requirePublishableClientKey` in the project-level config override. */ requirePublishableClientKey?: boolean; logoUrl?: string | null; logoFullUrl?: string | null; logoDarkModeUrl?: string | null; logoFullDarkModeUrl?: string | null; config?: AdminProjectConfigUpdateOptions; }; declare function adminProjectUpdateOptionsToCrud(options: AdminProjectUpdateOptions): ProjectsCrud["Admin"]["Update"]; type AdminProjectCreateOptions = Omit & { displayName: string; teamId: string; }; declare function adminProjectCreateOptionsToCrud(options: AdminProjectCreateOptions): AdminUserProjectsCrud["Server"]["Create"]; //#endregion export { AdminOwnedProject, AdminProject, AdminProjectCreateOptions, AdminProjectUpdateOptions, Project, PushConfigOptions, PushedConfigSource, adminProjectCreateOptionsToCrud, adminProjectUpdateOptionsToCrud }; //# sourceMappingURL=index.d.ts.map