diff --git a/packages/aws/src/clients/s3.client.ts b/packages/aws/src/clients/s3.client.ts index 4ad475590..30b3a17d3 100644 --- a/packages/aws/src/clients/s3.client.ts +++ b/packages/aws/src/clients/s3.client.ts @@ -60,7 +60,7 @@ export class S3Client implements S3ClientInterface { Key: key, }) try { - return this.getClient().send(command); + return await this.getClient().send(command); } catch (e) { this.logHandler.error("Error getting object from S3", {error: e}, AwsModuleKeyname); throw e; diff --git a/packages/aws/src/interfaces/s3-client.interface.ts b/packages/aws/src/interfaces/s3-client.interface.ts index 477e8ced1..6dccc24de 100644 --- a/packages/aws/src/interfaces/s3-client.interface.ts +++ b/packages/aws/src/interfaces/s3-client.interface.ts @@ -1,5 +1,5 @@ import {S3PresignedOperationTypeEnum} from "../enums/s3-presigned-operation-type.enum"; -import {S3Client as AWSS3Client, S3ClientConfig} from "@aws-sdk/client-s3"; +import {S3Client as AWSS3Client, S3ClientConfig, GetObjectCommandOutput} from "@aws-sdk/client-s3"; /** * The S3Client Interface defines the methods that an S3 client must implement. @@ -17,6 +17,13 @@ export interface S3ClientInterface { */ setClient(config: S3ClientConfig); + /** + * Retrieves the key from the S3 Bucket. + * @param bucketName + * @param key + */ + get(bucketName: string, key: string): Promise + /** * Gets an object's body as an array buffer from S3. * @param bucketName The bucket name where to get the object.