1- import { PNGWithMetadata , PNG } from 'pngjs' ;
1+ import { PNGWithMetadata } from 'pngjs' ;
22import { Logger } from '@nestjs/common' ;
33import { Static } from '../static.interface' ;
4- import { S3Client } from '@aws-sdk/client-s3' ;
4+ // import { S3Client } from '@aws-sdk/client-s3';
55
66
77export class AWSS3Service implements Static {
88 private readonly logger : Logger = new Logger ( AWSS3Service . name ) ;
9- private readonly AWS_ACCESS_KEY_ID = process . env . AWS_ACCESS_KEY_ID ;
10- private readonly AWS_SECRET_ACCESS_KEY = process . env . AWS_SECRET_ACCESS_KEY ;
11- private readonly AWS_REGION = process . env . AWS_REGION ;
12- private readonly AWS_S3_BUCKET_NAME = process . env . AWS_S3_BUCKET_NAME ;
9+ // private readonly AWS_ACCESS_KEY_ID = process.env.AWS_ACCESS_KEY_ID;
10+ // private readonly AWS_SECRET_ACCESS_KEY = process.env.AWS_SECRET_ACCESS_KEY;
11+ // private readonly AWS_REGION = process.env.AWS_REGION;
12+ // private readonly AWS_S3_BUCKET_NAME = process.env.AWS_S3_BUCKET_NAME;
1313
14- private s3Client : S3Client ;
14+ // private s3Client: S3Client;
1515
1616 constructor ( ) {
17- this . s3Client = new S3Client ( {
18- credentials : {
19- accessKeyId : this . AWS_ACCESS_KEY_ID ,
20- secretAccessKey : this . AWS_SECRET_ACCESS_KEY ,
21- } ,
22- region : this . AWS_REGION ,
23- } ) ;
17+ // this.s3Client = new S3Client({
18+ // credentials: {
19+ // accessKeyId: this.AWS_ACCESS_KEY_ID,
20+ // secretAccessKey: this.AWS_SECRET_ACCESS_KEY,
21+ // },
22+ // region: this.AWS_REGION,
23+ // });
2424 this . logger . log ( 'AWS S3 service is being used for file storage.' ) ;
2525 }
26-
27- async saveImage ( type : 'screenshot' | 'diff' | 'baseline' , imageBuffer : Buffer ) : Promise < string > {
28- // Implement your logic to save the image and return the file URL or path
29- return 'image-url-or-path' ;
26+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
27+ saveImage ( type : 'screenshot' | 'diff' | 'baseline' , imageBuffer : Buffer ) : Promise < string > {
28+ throw new Error ( 'Method not implemented.' ) ;
3029 }
3130
32- async getImage ( fileName : string ) : Promise < PNGWithMetadata > {
33- // Implement your logic to retrieve the image from S3 and return it as PNGWithMetadata
34- return PNG . sync . read ( Buffer . from ( [ ] ) ) ;
31+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
32+ getImage ( fileName : string ) : Promise < PNGWithMetadata > {
33+ throw new Error ( 'Method not implemented.' ) ;
3534 }
3635
37- async deleteImage ( imageName : string ) : Promise < boolean > {
38- // default
39- return false
36+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
37+ deleteImage ( imageName : string ) : Promise < boolean > {
38+ throw new Error ( 'Method not implemented.' ) ;
4039 }
40+
41+
4142}
0 commit comments