import { Context } from "../../bundler/context.js"; import { TypescriptCompiler } from "./typecheck.js"; import { Bundle, BundleHash } from "../../bundler/index.js"; import { NodeDependency } from "./deployApi/modules.js"; import { ComponentDefinitionPath } from "./components/definition/directoryStructure.js"; import { DeploymentType } from "./api.js"; export { productionProvisionHost, provisionHost } from "./utils/utils.js"; /** Type representing WorkOS AuthKit integration configuration. */ export interface AuthKitConfigureSettings { redirectUris?: string[]; appHomepageUrl?: string; corsOrigins?: string[]; } export interface AuthKitEnvironmentConfig { environmentType?: "development" | "staging" | "production"; configure?: false | AuthKitConfigureSettings; localEnvVars?: false | Record; } export interface AuthKitConfig { dev?: AuthKitEnvironmentConfig; preview?: AuthKitEnvironmentConfig; prod?: AuthKitEnvironmentConfig; } /** * convex.json file parsing notes * * - Unknown fields at the top level and in node and codegen are preserved * so that older CLI versions can deploy new projects (this functionality * will be removed in the future). * - convex.json does not allow comments, but this could change in the future. * Previously it contained automatically set values like productionUrl * but it's more like a config file now. */ /** Type representing Convex project configuration. */ export interface ProjectConfig { functions: string; node: { externalPackages: string[]; nodeVersion?: string | undefined; }; generateCommonJSApi: boolean; codegen: { staticApi: boolean; staticDataModel: boolean; legacyComponentApi?: boolean; fileType?: "ts" | "js/dts"; }; bundler?: { includeSourcesContent?: boolean; }; typescriptCompiler?: TypescriptCompiler; authKit?: AuthKitConfig | undefined; aiFiles?: { enabled?: boolean; disableStalenessMessage?: boolean; skills?: { agents?: string[]; }; }; } export interface Config { projectConfig: ProjectConfig; modules: Bundle[]; nodeDependencies: NodeDependency[]; schemaId?: string; udfServerVersion?: string; nodeVersion?: string | undefined; } export interface ConfigWithModuleHashes { projectConfig: ProjectConfig; moduleHashes: BundleHash[]; nodeDependencies: NodeDependency[]; schemaId?: string; udfServerVersion?: string; } /** Whether .ts file extensions should be used for generated code (default is false). */ export declare function usesTypeScriptCodegen(projectConfig: ProjectConfig): boolean; /** Whether the new component API import style should be used */ export declare function usesComponentApiImports(projectConfig: ProjectConfig): boolean; /** * Get the authKit configuration from convex.json. */ export declare function getAuthKitConfig(ctx: Context, projectConfig: ProjectConfig): Promise; export declare function getAuthKitEnvironmentConfig(ctx: Context, projectConfig: ProjectConfig, deploymentType: "dev" | "preview" | "prod"): Promise; export declare function resetUnknownKeyWarnings(): void; /** Parse object to ProjectConfig. */ export declare function parseProjectConfig(ctx: Context, obj: any): Promise; export declare function configName(): string; export declare function configFilepath(ctx: Context): Promise; export declare function getFunctionsDirectoryPath(ctx: Context): Promise; /** Read configuration from a local `convex.json` file. */ export declare function readProjectConfig(ctx: Context): Promise<{ projectConfig: ProjectConfig; configPath: string; }>; /** * Given a {@link ProjectConfig}, add in the bundled modules to produce the * complete config. */ export declare function configFromProjectConfig(ctx: Context, projectConfig: ProjectConfig, configPath: string, verbose: boolean): Promise<{ config: Config; bundledModuleInfos: BundledModuleInfo[]; }>; /** * Bundle modules one by one for good bundler errors. */ export declare function debugIsolateEndpointBundles(ctx: Context, projectConfig: ProjectConfig, configPath: string): Promise; /** * Read the config from `convex.json` and bundle all the modules. */ export declare function readConfig(ctx: Context, verbose: boolean): Promise<{ config: Config; configPath: string; bundledModuleInfos: BundledModuleInfo[]; }>; /** * Ensure the functions directory exists. * * Note: convex.json is treated as user-owned and is not modified by the CLI. * Use writeAiFilesConfig() to explicitly patch the aiFiles section. */ export declare function ensureConvexFunctionsDir(ctx: Context, projectConfig: ProjectConfig): Promise; export declare function removedExistingConfig(ctx: Context, configPath: string, options: { allowExistingConfig?: boolean; }): boolean; /** Pull configuration for the root app component from the given remote origin. */ export declare function pullConfig(ctx: Context, project: string | undefined, team: string | undefined, origin: string, adminKey: string): Promise; interface BundledModuleInfo { name: string; platform: "node" | "convex"; } /** * A component definition spec contains enough information to create bundles * of code that must be analyzed in order to construct a ComponentDefinition. * * Most paths are relative to the directory of the definitionPath. */ export type ComponentDefinitionSpec = { /** This path is relative to the app (root component) directory. */ definitionPath: ComponentDefinitionPath; /** Dependencies are paths to the directory of the dependency component definition from the app (root component) directory */ dependencies: ComponentDefinitionPath[]; definition: Bundle; schema: Bundle; functions: Bundle[]; }; export type AppDefinitionSpec = Omit & { auth: Bundle | null; }; export type ComponentDefinitionSpecWithoutImpls = Omit; export type AppDefinitionSpecWithoutImpls = Omit; /** Generate a human-readable diff between the two configs. */ export declare function diffConfig(oldConfig: ConfigWithModuleHashes, newConfig: Config): { diffString: string; }; /** Handle an error from * legacy push path: * - /api/push_config * modern push paths: * - /api/deploy2/evaluate_push * - /api/deploy2/start_push * - /api/deploy2/finish_push * * finish_push errors are different from start_push errors and in theory could * be handled differently, but starting over works for all of them. */ export declare function handlePushConfigError(ctx: Context, error: unknown, defaultMessage: string, deploymentName: string | null, deployment: { deploymentUrl: string; adminKey: string; deploymentNotice: string; } | undefined, _deploymentType: DeploymentType | undefined): Promise; export type AiFilesProjectConfig = NonNullable; /** * Write the `aiFiles` section of `convex.json`, preserving all other keys. * Writes the given object as-is with no merging or default logic. * If `aiFiles` is undefined, the key is removed from the file. */ export declare function writeAiFilesConfig({ projectDir, aiFiles, }: { projectDir: string; aiFiles: AiFilesProjectConfig | undefined; }): Promise; //# sourceMappingURL=config.d.ts.map