@punks/backend-entity-manager 0.0.362 → 0.0.363

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.
@@ -1,5 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  export type FileData = {
3
+ fileId?: string;
3
4
  content: Buffer;
4
5
  contentType: string;
5
6
  fileName: string;
@@ -25,6 +26,7 @@ export type FilesReferenceData = {
25
26
  reference: string;
26
27
  providerId: string;
27
28
  metadata?: Record<string, any>;
29
+ fileId?: string;
28
30
  fileName: string;
29
31
  filePath: string;
30
32
  fileSize: number;
@@ -49,6 +51,7 @@ export type FileProviderReference = {
49
51
  reference: string;
50
52
  };
51
53
  export type FileProviderUploadData = {
54
+ fileId?: string;
52
55
  fileName: string;
53
56
  content: Buffer;
54
57
  contentType: string;
@@ -6,6 +6,6 @@ export declare class AppFileController {
6
6
  private readonly getDownloadUrlTemplate;
7
7
  private readonly fileUploadTemplate;
8
8
  constructor(getDownloadUrlTemplate: FileGetDownloadUrlTemplate, fileUploadTemplate: FileUploadTemplate);
9
- import(folderPath: string, file: Express.Multer.File): Promise<void>;
9
+ import(fileId: string | undefined, folderPath: string, file: Express.Multer.File): Promise<void>;
10
10
  getDownloadUrl(fileId: string): Promise<FileGetDownloadUrlResult>;
11
11
  }
package/dist/esm/index.js CHANGED
@@ -22644,11 +22644,13 @@ let FilesManager = class FilesManager {
22644
22644
  }
22645
22645
  async uploadFile(file) {
22646
22646
  const uploadResult = await this.defaultFileProvider.uploadFile({
22647
+ fileId: file.fileId,
22647
22648
  content: file.content,
22648
22649
  contentType: file.contentType,
22649
22650
  fileName: file.fileName,
22650
22651
  });
22651
22652
  const record = await this.referencesRepo.createReference({
22653
+ fileId: file.fileId,
22652
22654
  providerId: this.defaultFileProvider.getProviderId(),
22653
22655
  reference: uploadResult.reference,
22654
22656
  contentType: file.contentType,