diff --git a/packages/server/modules/blobstorage/objectStorage.ts b/packages/server/modules/blobstorage/objectStorage.ts index 50e0e43e4..c838f11e5 100644 --- a/packages/server/modules/blobstorage/objectStorage.ts +++ b/packages/server/modules/blobstorage/objectStorage.ts @@ -11,7 +11,8 @@ import { DeleteObjectCommand, CreateBucketCommand, S3ServiceException, - S3ClientConfig + S3ClientConfig, + ServiceOutputTypes } from '@aws-sdk/client-s3' import { Upload, Options as UploadOptions } from '@aws-sdk/lib-storage' import { @@ -61,14 +62,12 @@ const getObjectStorage = () => ({ createBucket: createS3Bucket() }) -const sendCommand = async ( +const sendCommand = async ( command: (Bucket: string) => Command ) => { const { client, Bucket } = getObjectStorage() try { - const ret = (await client.send( - command(Bucket) as Command - )) as CommandOutput + const ret = await client.send(command(Bucket)) return ret } catch (err) { if (err instanceof S3ServiceException && get(err, 'Code') === 'NoSuchKey')