/** * feature-react-file-upload – File upload API * * Provides programmatic APIs for file upload with progress tracking * and Salesforce ContentVersion integration. * * @packageDocumentation */ /** * Unified upload API that handles the complete upload flow: * 1. Gets upload config * 2. Uploads files with progress tracking * 3. Creates ContentVersion records (if recordId provided) * * Returns array of results with file names, sizes, and IDs. * Provides progress callbacks for each file through all stages. * * @example * ```tsx * const results = await upload({ * files: [file1, file2], * recordId: accountId, * onProgress: (progress) => { * console.log(`${progress.fileName}: ${progress.status} ${progress.progress}%`); * } * }); * ``` */ export { upload } from "./features/fileupload/api/fileUpload"; /** * Options for the upload API. * * @see upload */ export type { UploadOptions, FileUploadResult, FileUploadProgress, UploadStatus, } from "./features/fileupload/api/fileUpload"; /** * Create ContentVersion record programmatically. Useful when you need to create * ContentVersion separately from the file upload process (e.g., after uploading * file to a different location first). * * @param file - The file to create ContentVersion for * @param contentBodyId - The ContentBody ID from a previous upload * @param recordId - The record ID for FirstPublishLocationId (e.g., Account, Opportunity, or User ID) * @returns ContentVersion ID if successful * * @example * ```tsx * const contentBodyId = await uploadToUrl(file, token, uploadUrl, onProgress); * const contentVersionId = await createContentVersion(file, contentBodyId, recordId); * ``` */ export { createContentVersion, getCurrentUserId } from "./features/fileupload/api/fileUpload";