* Uploads a CSV/TSV straight to workspace storage (bypassing the server's request-body * cap) and returns its storage key. Shared by the async-import kickoff hooks.
( file: File, workspaceId: string, onProgress?: (percent: number) => void )
| 1450 | * cap) and returns its storage key. Shared by the async-import kickoff hooks. |
| 1451 | */ |
| 1452 | async function uploadCsvToWorkspaceStorage( |
| 1453 | file: File, |
| 1454 | workspaceId: string, |
| 1455 | onProgress?: (percent: number) => void |
| 1456 | ): Promise<string> { |
| 1457 | const upload = await runUploadStrategy({ |
| 1458 | file, |
| 1459 | workspaceId, |
| 1460 | context: 'workspace', |
| 1461 | presignedEndpoint: `/api/workspaces/${workspaceId}/files/presigned`, |
| 1462 | onProgress: onProgress ? (event) => onProgress(event.percent) : undefined, |
| 1463 | }) |
| 1464 | return upload.key |
| 1465 | } |
| 1466 | |
| 1467 | /** |
| 1468 | * Uploads a large CSV/TSV straight to storage, then kicks off a background import into a |
no test coverage detected