import { type EnsureStyleArtifactBuildInput, type FileDetail, type FileListResult, type GetFileOptions, type ListFilesOptions, type ProjectStyleArtifactResolution, type ResolveStyleArtifactInput, type UpsertStyleArtifactInput, VeryfrontAPIOperations } from "./operations.js"; import { type VeryfrontAPIConfig } from "./types.js"; import type { DependencyArtifactBuildResultBody, DependencyArtifactContentType } from "../../../release-assets/dependency-artifact-contracts.js"; /** * File context for API operations. * - branch: Draft/working copy from a specific branch * - environment: Deployed content from an environment (production, preview, staging) * - release: Specific release version */ export type FileContext = { type: "branch"; name: string; } | { type: "environment"; name: string; } | { type: "release"; version: string; }; export declare class VeryfrontApiClient { private config; private operations; private requestToken?; private requestProjectSlug?; private requestContext?; private requestBranch?; private initialized; private initializingPromise?; /** Cached project data from initialization - avoids redundant API calls */ private cachedProjectData?; constructor(config: VeryfrontAPIConfig); isProxyMode(): boolean; setRequestToken(token: string): void; clearRequestToken(): void; setProjectSlug(slug: string): void; getProjectSlug(): string | undefined; /** Throws a structured error when no project slug is configured, instead of passing `undefined` to API calls. */ private requireProjectSlug; clearProjectSlug(): void; setContext(context: FileContext): void; getContext(): FileContext; clearContext(): void; getToken(): string; isInitialized(): boolean; setRequestBranch(branch: string | null): void; getRequestBranch(): string | null | undefined; clearRequestBranch(): void; initialize(): Promise; private doInitialize; reset(): void; getProjectId(): string; /** * Get the cached project data from initialization. * Returns undefined if not yet initialized or if projectId was provided in config. * Use this instead of calling getProject() to avoid redundant API calls. */ getCachedProject(): Awaited> | undefined; listProjects(): Promise; name: import("../../../internal-agents/schema.js").Schema; slug: import("../../../internal-agents/schema.js").Schema; description: import("../../../internal-agents/schema.js").Schema; created_at: import("../../../internal-agents/schema.js").Schema; updated_at: import("../../../internal-agents/schema.js").Schema; provider: import("../../../internal-agents/schema.js").Schema; provider_id: import("../../../internal-agents/schema.js").Schema; layout: import("../../../internal-agents/schema.js").Schema; layout_id: import("../../../internal-agents/schema.js").Schema; config: import("../../../internal-agents/schema.js").Schema | undefined>; }>[]>; getProject(projectRef?: string): Promise; name: import("../../../internal-agents/schema.js").Schema; slug: import("../../../internal-agents/schema.js").Schema; description: import("../../../internal-agents/schema.js").Schema; created_at: import("../../../internal-agents/schema.js").Schema; updated_at: import("../../../internal-agents/schema.js").Schema; provider: import("../../../internal-agents/schema.js").Schema; provider_id: import("../../../internal-agents/schema.js").Schema; layout: import("../../../internal-agents/schema.js").Schema; layout_id: import("../../../internal-agents/schema.js").Schema; config: import("../../../internal-agents/schema.js").Schema | undefined>; }>>; listFiles(options?: ListFilesOptions): Promise; listAllFiles(options?: Omit): Promise; version_id: import("../../../internal-agents/schema.js").Schema; path: import("../../../internal-agents/schema.js").Schema; content: import("../../../internal-agents/schema.js").Schema; size: import("../../../internal-agents/schema.js").Schema; type: import("../../../internal-agents/schema.js").Schema<"function" | "file" | "page" | "component">; updated_at: import("../../../internal-agents/schema.js").Schema; }>[]>; getFile(pathOrId: string, options?: { expectedMissing?: boolean; }): Promise; getFileContent(pathOrId: string): Promise; getFileContentBytesWithinLimit(pathOrId: string, maximumBytes: number, options?: GetFileOptions): Promise; getOptionalFileContent(pathOrId: string): Promise; listBranchFiles(branchName?: string, options?: ListFilesOptions): Promise; getBranchFile(branchName: string, pathOrId: string): Promise; listEnvironmentFiles(environmentName?: string, options?: ListFilesOptions): Promise; listAllEnvironmentFiles(environmentName?: string, options?: Omit): Promise; version_id: import("../../../internal-agents/schema.js").Schema; path: import("../../../internal-agents/schema.js").Schema; content: import("../../../internal-agents/schema.js").Schema; size: import("../../../internal-agents/schema.js").Schema; type: import("../../../internal-agents/schema.js").Schema<"function" | "file" | "page" | "component">; updated_at: import("../../../internal-agents/schema.js").Schema; }>[]>; getEnvironmentFile(environmentName: string, pathOrId: string): Promise; listReleaseFiles(version?: string, options?: ListFilesOptions): Promise; listAllReleaseFiles(version?: string, options?: Omit): Promise; version_id: import("../../../internal-agents/schema.js").Schema; path: import("../../../internal-agents/schema.js").Schema; content: import("../../../internal-agents/schema.js").Schema; size: import("../../../internal-agents/schema.js").Schema; type: import("../../../internal-agents/schema.js").Schema<"function" | "file" | "page" | "component">; updated_at: import("../../../internal-agents/schema.js").Schema; }>[]>; getReleaseFile(version: string, pathOrId: string): Promise; lookupProjectByDomain(domain: string): Promise; project_slug: import("../../../internal-agents/schema.js").Schema; project_name: import("../../../internal-agents/schema.js").Schema; environment: import("../../../internal-agents/schema.js").Schema; name: import("../../../internal-agents/schema.js").Schema; }> | null>; release_id: import("../../../internal-agents/schema.js").Schema; }> | null>; resolveStyleArtifact(input: ResolveStyleArtifactInput, projectRef?: string): Promise; ensureStyleArtifactBuild(input: EnsureStyleArtifactBuildInput, projectRef?: string): Promise; upsertStyleArtifact(input: UpsertStyleArtifactInput, projectRef?: string): Promise; uploadDependencyArtifactAsset(artifactId: string, attemptCount: number, contentHash: string, contentType: DependencyArtifactContentType, bytes: Uint8Array): Promise; existed: import("../../../internal-agents/schema.js").Schema; }>>; reportDependencyArtifactBuildResult(artifactId: string, attemptCount: number, result: DependencyArtifactBuildResultBody): Promise; state: import("../../../internal-agents/schema.js").Schema<"failed" | "ready">; }>>; beginReleaseAssetManifestBuild(version: string, projectRef?: string): Promise; manifest_version: import("../../../internal-agents/schema.js").Schema; state: import("../../../internal-agents/schema.js").Schema<"failed" | "partial" | "ready" | "building" | "queued" | "superseded">; }>>; uploadReleaseAsset(version: string, contentHash: string, contentType: string, bytes: Uint8Array, projectRef?: string): Promise; existed: import("../../../internal-agents/schema.js").Schema; }>>; putReleaseAssetManifest(version: string, manifest: unknown, projectRef?: string): Promise; manifest_version: import("../../../internal-agents/schema.js").Schema; }>>; reportReleaseAssetManifestState(version: string, state: "partial" | "failed", error?: string, projectRef?: string): Promise; manifest_version: import("../../../internal-agents/schema.js").Schema; }>>; getReleaseAssetManifest(version: string, projectRef?: string, signal?: AbortSignal): Promise; manifest_version: import("../../../internal-agents/schema.js").Schema; manifest: import("../../../internal-agents/schema.js").Schema | null>; }>>; getFileById(entityId: string): Promise<{ path: string; content: string; } | null>; searchFiles(pattern: string): Promise<{ id?: string; path: string; }[]>; /** * Search for files matching a pattern and return them with content. * Useful for batch-loading files without knowing exact extensions. * * Example: searchFilesWithContent("components/Button.*") returns all files * like Button.tsx, Button.ts, Button.jsx etc. with their content. * * @param pattern - Glob pattern to match files (e.g., "path/file.*" or "pages/_error.*") * @returns Array of files with path and content */ searchFilesWithContent(pattern: string): Promise>; private listFilesByContext; /** * Resolve a file path without extension by searching for all possible extensions. * Returns the first match based on extension priority. * * @param basePath - Path without extension (e.g., "components/Button") * @param extensionPriority - Preferred extension order (default: .tsx, .ts, .jsx, .js, .mdx, .md) * @returns The resolved file with content, or null if not found */ resolveFileWithExtension(basePath: string, extensionPriority?: string[]): Promise<{ path: string; content: string; } | null>; listPublishedFiles(_projectId?: string, releaseId?: string, environmentName?: string): Promise; version_id: import("../../../internal-agents/schema.js").Schema; path: import("../../../internal-agents/schema.js").Schema; content: import("../../../internal-agents/schema.js").Schema; size: import("../../../internal-agents/schema.js").Schema; type: import("../../../internal-agents/schema.js").Schema<"function" | "file" | "page" | "component">; updated_at: import("../../../internal-agents/schema.js").Schema; }>[]>; getPublishedFileContent(path: string, releaseId?: string, environmentName?: string): Promise; getPublishedFileContentBytesWithinLimit(path: string, maximumBytes: number, releaseId?: string, environmentName?: string, options?: GetFileOptions): Promise; } //# sourceMappingURL=client.d.ts.map