mblabs-roccato-backend-commons 1.0.21 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -75,6 +75,7 @@ export declare namespace AmazonS3 {
75
75
  folder?: string;
76
76
  isUpload?: boolean;
77
77
  expiresInHours?: number;
78
+ contentType?: string;
78
79
  };
79
80
  credentials: Credentials;
80
81
  }
@@ -117,8 +117,11 @@ class AmazonS3Service {
117
117
  region: credentials.region,
118
118
  });
119
119
  const payload = {
120
- Key: this.getBucketPath(data.filename, data.folder),
121
120
  Bucket: data.bucket,
121
+ Key: this.getBucketPath(data.filename, data.folder),
122
+ ...(data.isUpload && data?.contentType && ({
123
+ ContentType: data.contentType,
124
+ })),
122
125
  };
123
126
  const method = data.isUpload
124
127
  ? new client_s3_1.PutObjectCommand(payload)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mblabs-roccato-backend-commons",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -82,6 +82,7 @@ export namespace AmazonS3 {
82
82
  folder?: string;
83
83
  isUpload?: boolean;
84
84
  expiresInHours?: number;
85
+ contentType?: string;
85
86
  };
86
87
  credentials: Credentials;
87
88
  }
@@ -141,8 +141,11 @@ class AmazonS3Service implements IAmazonS3Service {
141
141
  });
142
142
 
143
143
  const payload = {
144
- Key: this.getBucketPath(data.filename, data.folder),
145
144
  Bucket: data.bucket,
145
+ Key: this.getBucketPath(data.filename, data.folder),
146
+ ...(data.isUpload && data?.contentType && ({
147
+ ContentType: data.contentType,
148
+ })),
146
149
  };
147
150
 
148
151
  const method = data.isUpload