rez_core 1.0.50 → 1.0.52

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": "rez_core",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -54,11 +54,11 @@ export class MediaController {
54
54
  try {
55
55
 
56
56
 
57
- const downloadUrl = await this.mediaDataService.getMediaDownloadUrl(id);
57
+ const data = await this.mediaDataService.getMediaDownloadUrl(id);
58
58
  res.status(HttpStatus.OK).json({
59
59
  message: 'Download URL fetched successfully',
60
60
  success: true,
61
- data: { downloadUrl },
61
+ data:data,
62
62
  });
63
63
  } catch (error) {
64
64
  res.status(HttpStatus.INTERNAL_SERVER_ERROR).json({
@@ -52,6 +52,7 @@ export class MediaDataService extends EntityServiceImpl {
52
52
  });
53
53
 
54
54
  let mediaData = new MediaData();
55
+ mediaData.file_name = fileName;
55
56
  mediaData.mapped_attribute_key = mappedAttributeKey;
56
57
  mediaData.status = STATUS_PENDING;
57
58
  if (mappedEntityType) {
@@ -115,7 +116,7 @@ export class MediaDataService extends EntityServiceImpl {
115
116
  }
116
117
 
117
118
  // New method to get the signed URL for the media (download link)
118
- async getMediaDownloadUrl(id: number): Promise<string> {
119
+ async getMediaDownloadUrl(id: number) {
119
120
  try {
120
121
  const entityData = await this.getEntityData(ENTITYTYPE_MEDIA, id);
121
122
  let mediaData = entityData as MediaData;
@@ -124,7 +125,7 @@ export class MediaDataService extends EntityServiceImpl {
124
125
  Key: mediaData.media_url,
125
126
  Expires: 60 * 5, // URL valid for 5 mins
126
127
  });
127
- return signedUrl;
128
+ return {signedUrl,fileName: mediaData.file_name};
128
129
  } catch (error) {
129
130
  console.error('Error generating signed URL for media:', error);
130
131
  throw new Error('Failed to generate signed URL');