| 366 | } |
| 367 | |
| 368 | async uploadFile(file: File) { |
| 369 | const formData = new FormData(); |
| 370 | formData.append('file', file); |
| 371 | |
| 372 | // Use the typed client - it will automatically apply middleware (including auth headers) |
| 373 | // For multipart/form-data, openapi-fetch accepts FormData directly |
| 374 | return this.client.POST('/api/v1/files/upload', { |
| 375 | body: formData as any, // Type assertion needed as generated types expect { file?: string } but FormData works at runtime |
| 376 | // openapi-fetch will automatically set Content-Type for FormData |
| 377 | }); |
| 378 | } |
| 379 | |
| 380 | async getFileMetadata(id: string) { |
| 381 | return this.client.GET('/api/v1/files/{id}', { |