import { MakeJWTConfig } from './auth'; export declare const DEFAULT_DOWNLOAD_FILENAME = "input.xpi"; /** * Error thrown when file download operations fail. * * @property extraInfo - Additional error details * @property status - HTTP status code to be used when returning the error * response to the client. This is not the HTTP status code received when trying * to download a file. */ export declare class DownloadFileError extends Error { status: number; extraInfo?: string; constructor(message: string, extraInfo?: string, status?: number); /** * Convert this error to AppError format. */ toAppError(): import("./error").AppError; } /** * Parameters for downloading a file from the AMO API with JWT authentication. * * @property downloadURL - URL to download from * @property tmpDir - Temporary directory for download (default: os.tmpdir()) * @property filename - Downloaded file name (default: 'input.xpi') */ export type DownloadFileParams = MakeJWTConfig & { downloadURL: string; tmpDir?: string; filename?: string; }; /** * Download a file from the AMO API, authenticating with a JWT token computed * from the `AMO_JWT_ISS_KEY` and `AMO_JWT_SECRET` environment variables. * * @returns Promise resolving to the file path of the downloaded file * @throws DownloadFileError if the download fails */ export declare const downloadFile: ({ downloadURL, tmpDir, filename, env, }: DownloadFileParams) => Promise; /** * Parameters for downloading a file upload. * * @property downloadURL - URL to download from * @property allowedOrigin - Allowed origin for the download URL * @property tmpDir - Temporary directory for download (default: os.tmpdir()) * @property filename - Downloaded file name (default: 'input.xpi') */ export type DownloadFileUploadParams = { downloadURL: string; allowedOrigin: string; tmpDir?: string; filename?: string; }; /** * Download a file from a URL to a temporary location. * * @returns Promise resolving to the file path of the downloaded file * @throws DownloadFileError if the download fails or URL origin doesn't match */ export declare const downloadFileUpload: ({ downloadURL, allowedOrigin, tmpDir, filename, }: DownloadFileUploadParams) => Promise;