export type FileHashResult = { hash: string; size: number; }; export type FullScanManifestEntry = { hash: string; size: number; }; export type FullScanManifest = { algo: 'sha256'; files: Record; }; export type BlobRef = { hash: string; path: string; size: number; }; export type CreateFullScanFromManifestParams = { branch?: string | undefined; commit_hash?: string | undefined; commit_message?: string | undefined; committers?: string[] | undefined; ephemeral?: boolean | undefined; make_default_branch?: boolean | undefined; pull_request?: number | undefined; repo: string; scan_type?: string | undefined; set_as_pending_head?: boolean | undefined; workspace?: string | undefined; }; export type FullScanV1CreatedData = { branch: string; commit_hash: string; commit_message: string; committers: string[]; created_at: string; html_report_url: string; id: string; organization_id: string; pull_request: number; repository_id: string; scan_type: string; unsupported_files: BlobRef[]; updated_at: string; }; export type FullScanV1PendingData = { algo: string; missing: BlobRef[]; present: BlobRef[]; unsupported: BlobRef[]; }; export type CreateFullScanFromManifestResult = { cause: undefined; data: FullScanV1CreatedData; error: undefined; status: 201; success: true; } | { cause: undefined; data: FullScanV1PendingData; error: undefined; status: 202; success: true; }; export type BlobsUploadData = { already_existed: string[]; stored: string[]; }; export type UploadBlobsResult = { cause: undefined; data: BlobsUploadData; error: undefined; status: 200; success: true; }; export type BlobUploadEntry = { hash?: string | undefined; localPath: string; name?: string | undefined; }; export type ManifestLocalEntry = { absPath: string; hash: string; relPath: string; size: number; }; export type SkippedManifestPath = { path: string; reason: string; }; export type AssembledManifest = { entries: ManifestLocalEntry[]; manifest: FullScanManifest; skipped: SkippedManifestPath[]; }; /** * Build a v1 content-addressed manifest for `filepaths` (absolute paths) * relative to `basePath`. A path that cannot be represented in a v1 manifest * — outside `basePath`, absolute, or a duplicate of an already-included * relative path — is recorded in `skipped` instead of `entries`/`manifest`. * Every included file is streamed through `hashFile`, so peak memory stays * bounded regardless of file count or size. */ export declare function assembleManifest(basePath: string, filepaths: string[]): Promise; /** * Derive the v1 API base URL from a v0 base URL by swapping the trailing * `/v0/` segment for `/v1/`. Returns undefined when `baseUrl` does not end in * `/v0/` — a custom base with a different version segment has no known v1 * counterpart. */ export declare function deriveApiV1BaseUrl(baseUrl: string): string | undefined; /** * Stream-hash a file's contents with sha256 (1 MiB read chunks), never * buffering the whole file in memory. Returns the lowercase hex digest and * the total byte count read. */ export declare function hashFile(filePath: string): Promise;