@solidstarters/solid-core 1.2.189 → 1.2.191
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidstarters/solid-core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.191",
|
|
4
4
|
"description": "This module is a NestJS module containing all the required core providers required by a Solid application",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -124,30 +124,7 @@ export class FileService {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
async copyToS3WithPublic(filePath: string, ContentType: string, fileName: string, bucketName: string): Promise<string> {
|
|
127
|
-
this.
|
|
128
|
-
try {
|
|
129
|
-
// Read Image File TO Fetch Buffer
|
|
130
|
-
const data = await this.readImageFile(filePath);
|
|
131
|
-
|
|
132
|
-
const params = {
|
|
133
|
-
Bucket: bucketName,
|
|
134
|
-
Key: fileName,
|
|
135
|
-
Body: data,
|
|
136
|
-
ContentType: ContentType, // Set the correct MIME type
|
|
137
|
-
ACL: "public-read" as ObjectCannedACL
|
|
138
|
-
};
|
|
139
|
-
// Upload it to S3
|
|
140
|
-
// const response = await this.s3.upload(params).promise();
|
|
141
|
-
const command = new PutObjectCommand(params);
|
|
142
|
-
const response = await this.s3Client.send(command);
|
|
143
|
-
|
|
144
|
-
// Return the URL file Name
|
|
145
|
-
// To access the file - https://rep-public-files.s3.amazonaws.com/${fileName}
|
|
146
|
-
return fileName
|
|
147
|
-
|
|
148
|
-
} catch (error) {
|
|
149
|
-
throw new Error(`${ERROR_MESSAGES.FILE_COPY_ERROR}: ${error.message}`);
|
|
150
|
-
}
|
|
127
|
+
return this.copyToS3(filePath, ContentType, fileName, bucketName);
|
|
151
128
|
}
|
|
152
129
|
|
|
153
130
|
async deleteFromS3(fileName: string, bucketName: string): Promise<string> {
|