manifest 4.17.5 → 4.17.6
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.
|
@@ -41,7 +41,8 @@ exports.default = () => {
|
|
|
41
41
|
s3Endpoint: process.env.S3_ENDPOINT,
|
|
42
42
|
s3Region: process.env.S3_REGION,
|
|
43
43
|
s3AccessKeyId: process.env.S3_ACCESS_KEY_ID,
|
|
44
|
-
s3SecretAccessKey: process.env.S3_SECRET_ACCESS_KEY
|
|
44
|
+
s3SecretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
|
|
45
|
+
s3FolderPrefix: process.env.S3_FOLDER_PREFIX
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
48
|
};
|
|
@@ -72,6 +72,7 @@ let StorageService = class StorageService {
|
|
|
72
72
|
: this.s3Endpoint?.includes('digitalocean')
|
|
73
73
|
? 'digitalocean'
|
|
74
74
|
: 'other';
|
|
75
|
+
this.s3FolderPrefix = this.configService.get('storage.s3FolderPrefix') || '';
|
|
75
76
|
if (this.isS3Enabled) {
|
|
76
77
|
this.s3Client = new client_s3_1.S3Client({
|
|
77
78
|
region: this.s3Region,
|
|
@@ -141,14 +142,15 @@ let StorageService = class StorageService {
|
|
|
141
142
|
return `${this.configService.get('baseUrl')}/${constants_1.STORAGE_PATH}/${value}`;
|
|
142
143
|
}
|
|
143
144
|
async uploadToS3(key, buffer) {
|
|
145
|
+
const path = `${this.s3FolderPrefix}/${key}`;
|
|
144
146
|
await this.s3Client.send(new client_s3_1.PutObjectCommand({
|
|
145
147
|
Bucket: this.s3Bucket,
|
|
146
|
-
Key:
|
|
148
|
+
Key: path,
|
|
147
149
|
Body: buffer,
|
|
148
150
|
ChecksumAlgorithm: undefined,
|
|
149
151
|
ACL: this.s3provider === 'digitalocean' ? 'public-read' : undefined
|
|
150
152
|
}));
|
|
151
|
-
return `${this.s3Endpoint}/${this.s3Bucket}/${
|
|
153
|
+
return `${this.s3Endpoint}/${this.s3Bucket}/${path}`;
|
|
152
154
|
}
|
|
153
155
|
};
|
|
154
156
|
exports.StorageService = StorageService;
|