import { ProductionModeError } from "@hexclave/shared/dist/helpers/production-mode"; import { AdminDeploymentDomainJson, AdminDeploymentDomainJson as AdminDeploymentDomainJson$1, AdminDeploymentEnvVarJson, AdminDeploymentJson, AdminDeploymentJson as AdminDeploymentJson$1, AdminDeploymentServiceJson, AdminDeploymentServiceJson as AdminDeploymentServiceJson$1, AdminDeploymentServiceOutcomeJson, AdminProjectSecretJson, AdminProjectSecretJson as AdminProjectSecretJson$1 } from "@hexclave/shared/dist/interface/admin-interface"; import { AdminUserProjectsCrud, ProjectsCrud } from "@hexclave/shared/dist/interface/crud/projects"; import { ProjectOnboardingStatus } from "@hexclave/shared/dist/schema-fields"; import { CompleteConfig, EnvironmentConfigOverrideOverride } from "@hexclave/shared/dist/config/schema"; import { StackAdminApp } from "../apps/interfaces/admin-app.js"; import { AdminProjectConfig, AdminProjectConfigUpdateOptions, ProjectConfig } from "../project-configs/index.js"; //#region src/lib/hexclave-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; workflowPath?: 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 isDevelopmentEnvironment: boolean; readonly pushedConfigError: { message: string; } | null; readonly configWarnings: { message: string; }[]; readonly config: ProjectConfig; }; type AdminProject = { readonly id: string; readonly displayName: string; readonly description: string | null; readonly createdAt: Date; readonly isProductionMode: boolean; readonly isDevelopmentEnvironment: boolean; readonly ownerTeamId: string | null; readonly onboardingStatus: ProjectOnboardingStatus; readonly onboardingState: NonNullable | null; 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; /** * 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; /** * Lists the project's deployment services (definitions as synced from the * config file's `services` export by `hexclave deploy`, merged with their * operational state: deploy status, env vars, domains). Definitions are * read-only through the SDK — the config file is the source of truth. */ listDeploymentServices(this: AdminProject): Promise; /** * Lists the project's stored secrets (keys and timestamps only — values are * write-only and can never be read back). */ listProjectSecrets(this: AdminProject): Promise; /** * Sets (or overwrites) the value of a project secret. Values are only read * server-side by the feature that consumes them — today, a deploy filling * `secret()` env vars. */ setProjectSecret(this: AdminProject, key: string, value: string): Promise; /** * Deletes a stored project secret value. */ deleteProjectSecret(this: AdminProject, key: string): Promise; /** * Lists the project's deployments (one per `hexclave deploy`) newest first, * each with the services it deployed and their runs. */ listDeployments(this: AdminProject, options?: { limit?: number; }): Promise; /** * Reads one deployment, including what each of its services did. */ getDeployment(this: AdminProject, deploymentId: string): Promise; /** * Returns the build logs of a deployment collected so far (the server follows * a running build for a while before returning). One deploy is one build, so * one log covers every service it shipped. */ getDeploymentBuildLogs(this: AdminProject, deploymentId: string, options?: { signal?: AbortSignal; }): Promise; /** * Adds a custom domain to a deployment service. */ addDeploymentServiceDomain(this: AdminProject, serviceId: string, hostname: string, options?: { isPrimary?: boolean; }): Promise; /** * Returns a domain's verification state and the DNS records the user must * create. Poll this until `verified` is true. */ getDeploymentServiceDomain(this: AdminProject, serviceId: string, hostname: string): Promise; /** * Removes a custom domain from a deployment service. */ deleteDeploymentServiceDomain(this: AdminProject, serviceId: string, hostname: string): Promise; } & 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; isDevelopmentEnvironment?: boolean; }; declare function adminProjectCreateOptionsToCrud(options: AdminProjectCreateOptions): AdminUserProjectsCrud["Server"]["Create"]; //#endregion export { type AdminDeploymentDomainJson, type AdminDeploymentEnvVarJson, type AdminDeploymentJson, type AdminDeploymentServiceJson, type AdminDeploymentServiceOutcomeJson, AdminOwnedProject, AdminProject, AdminProjectCreateOptions, type AdminProjectSecretJson, AdminProjectUpdateOptions, Project, PushConfigOptions, PushedConfigSource, adminProjectCreateOptionsToCrud, adminProjectUpdateOptionsToCrud }; //# sourceMappingURL=index.d.ts.map