/** * Shared TeamShare document source download (2026-09). * * A document's storage value (`urlOrKey`) is NOT reliably fetchable by the * bridge: local-storage deployments store `docs/` (relative), hosted * files may use signed `authenticated/...` Cloudinary URLs, and restricted * files require the API anyway. `GET /documents/:id/download` is the one * route that always works with an agent key - it streams local keys and * resolves the authenticated hosted URL server-side (same behaviour the * document-job runner has always used). * * Used by: document jobs (docx conversions) and the docx-to-pdf tool's * chain/agent paths. */ export interface SourceApi { baseUrl: string; apiKey?: string; } export type SourceLogger = (line: string) => void; /** * Download a document's bytes. * - `sourceUrl` (absolute http) is fetched directly (public Cloudinary). * - otherwise the API download route for `documentId` is used; a JSON * `{url}` response (hosted files) is followed to the storage URL. */ export declare function fetchDocumentSource(api: SourceApi, opts: { documentId?: string | null; sourceUrl?: string | null; }, log?: SourceLogger): Promise;