({
Key,
Body,
CacheControl = 'max-age=15557000, stale-if-error=31536000',
}: UploadFileInput)
| 29 | >; |
| 30 | |
| 31 | export async function uploadFile({ |
| 32 | Key, |
| 33 | Body, |
| 34 | CacheControl = 'max-age=15557000, stale-if-error=31536000', |
| 35 | }: UploadFileInput) { |
| 36 | try { |
| 37 | const command = new PutObjectCommand({ |
| 38 | Bucket, |
| 39 | Key, |
| 40 | Body, |
| 41 | ContentType: getMimeType(path.extname(Key!)), |
| 42 | CacheControl, |
| 43 | }); |
| 44 | return await s3Client.send(command); |
| 45 | } catch (error) { |
| 46 | console.error(error); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | export async function deleteFiles( |
| 51 | Objects: { |
no test coverage detected