import ApiClient from './ApiClient'; export default class FileUploadsClient { async uploadFile( this: ApiClient, fileUploadId: string, uploadUrl: string, file: File, ): Promise { const response = await fetch(uploadUrl, { method: 'PUT', headers: { 'content-type': file.type, 'x-amz-meta-upload-id': fileUploadId, }, body: file, }); if (!response.ok) { throw new Error(`Error uploading file ${fileUploadId} to ${uploadUrl}.`); } } }