@solidstarters/solid-core 1.2.149 → 1.2.150

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.149",
3
+ "version": "1.2.150",
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",
@@ -84,7 +84,6 @@ export class MediaService extends CRUDService<Media> {
84
84
  const savedMedias = [];
85
85
  for (let i = 0; i < files.length; i++) {
86
86
 
87
-
88
87
  createDto['fieldMetadata'] = await this.fieldMetadataRepo.findOne({
89
88
  where: {
90
89
  id: createDto['fieldMetadataId']
@@ -113,9 +112,9 @@ export class MediaService extends CRUDService<Media> {
113
112
  const fileName = this.getFileName(file);
114
113
  let awsFileUrl;
115
114
  if (createDto.mediaStorageProviderMetadata.isPublic === true) {
116
- awsFileUrl = await this.fileService.copyToS3(file.path, file.mimetype, fileName, createDto.mediaStorageProviderMetadata.bucketName,);
117
- } else {
118
115
  awsFileUrl = await this.fileService.copyToS3WithPublic(file.path, file.mimetype, fileName, createDto.mediaStorageProviderMetadata.bucketName,);
116
+ } else {
117
+ awsFileUrl = await this.fileService.copyToS3(file.path, file.mimetype, fileName, createDto.mediaStorageProviderMetadata.bucketName,);
119
118
  }
120
119
  // createDto['relativeUri'] = this.getAwsS3FullFilePath(awsFileUrl, createDto.mediaStorageProviderMetadata.bucketName, createDto.mediaStorageProviderMetadata.region);
121
120
  createDto['relativeUri'] = awsFileUrl
@@ -60,7 +60,7 @@ export class FileS3StorageProvider<T> implements MediaStorageProvider<T> {
60
60
  throw new Error("Entity must be an instance of CommonEntity"); //FIXME This needs to be handled through generics. e.g T extends CommonEntity
61
61
  }
62
62
  const result: Media[] = [];
63
- files.forEach(async (file) => {
63
+ for (const file of files) {
64
64
  const fileName = this.getFileName(file);
65
65
  // Store the file in the configured S3 Bucket
66
66
  let awsFileUrl;
@@ -84,7 +84,7 @@ export class FileS3StorageProvider<T> implements MediaStorageProvider<T> {
84
84
  }) as unknown as Media;
85
85
  result.push(mediaEntity);
86
86
  this.logger.debug(`Stored media with`, mediaEntity);
87
- });
87
+ };
88
88
  return result;
89
89
  }
90
90
 
@@ -38,7 +38,7 @@ export class FileStorageProvider<T> implements MediaStorageProvider<T> {
38
38
  throw new Error("Entity must be an instance of CommonEntity"); //FIXME This needs to be handled through generics. e.g T extends CommonEntity
39
39
  }
40
40
  const result: Media[] = [];
41
- files.forEach(async (file) => {
41
+ for (const file of files) {
42
42
  // Store the file in the configured file storage directory
43
43
  const fileStoragePath = this.getFullFilePath(this.getFileName(file));
44
44
  await this.fileService.copyFile(file.path, fileStoragePath);
@@ -57,7 +57,7 @@ export class FileStorageProvider<T> implements MediaStorageProvider<T> {
57
57
  }) as unknown as Media;
58
58
  result.push(mediaEntity);
59
59
  this.logger.debug(`Stored media with`, mediaEntity);
60
- });
60
+ };
61
61
  return result;
62
62
  }
63
63
 
@@ -66,7 +66,7 @@ export class FileStorageProvider<T> implements MediaStorageProvider<T> {
66
66
  throw new Error("Entity must be an instance of CommonEntity"); //FIXME This needs to be handled through generics. e.g T extends CommonEntity
67
67
  }
68
68
  const result: Media[] = [];
69
- streamPairs.forEach(async (pair) => {
69
+ for (const pair of streamPairs) {
70
70
  const stream = pair[0];
71
71
  const fileName = pair[1];
72
72
  this.fileService.writeStreamToFile(stream, this.getFullFilePath(fileName));
@@ -78,7 +78,7 @@ export class FileStorageProvider<T> implements MediaStorageProvider<T> {
78
78
  fieldMetadataId: mediaFieldMetadata.id
79
79
  }) as unknown as Media;
80
80
  this.logger.debug(`Stored media with`, mediaEntity);
81
- });
81
+ };
82
82
  return result;
83
83
  }
84
84