@punks/backend-entity-manager 0.0.405 → 0.0.406

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.
@@ -7,7 +7,7 @@ export declare class DataExportService {
7
7
  downloadUrl: import("../../../../abstractions/files").FileProviderDownloadUrl;
8
8
  file: DataExportFile;
9
9
  }>;
10
- extractData<TSheetItem>(data: TSheetItem[], input: DataExportInput<TSheetItem>): Promise<DataExportFile>;
10
+ extractData<TSheetItem>(data: TSheetItem[], input: Omit<DataExportInput<TSheetItem>, "fileName">): Promise<DataExportFile>;
11
11
  private uploadExportFile;
12
12
  private buildExportFilePath;
13
13
  private get defaultFileProvider();
@@ -1,6 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  export type DataExportInput<TSheetItem> = {
3
- name: string;
3
+ dataName: string;
4
+ fileName: string;
4
5
  columns: DataSerializerColumnDefinition<TSheetItem>[];
5
6
  format: DataSerializationFormat;
6
7
  };
package/dist/esm/index.js CHANGED
@@ -22851,7 +22851,8 @@ let DataExportService = class DataExportService {
22851
22851
  async exportData(data, input) {
22852
22852
  const file = await this.extractData(data, input);
22853
22853
  const downloadUrl = await this.uploadExportFile(file, {
22854
- dataName: input.name,
22854
+ dataName: input.dataName,
22855
+ fileName: input.fileName,
22855
22856
  format: input.format,
22856
22857
  });
22857
22858
  return {
@@ -22863,15 +22864,15 @@ let DataExportService = class DataExportService {
22863
22864
  const content = new DataExportSerializer().serialize(data, {
22864
22865
  columns: input.columns,
22865
22866
  format: input.format,
22866
- name: input.name,
22867
+ name: input.dataName,
22867
22868
  });
22868
22869
  return {
22869
22870
  content: content.content,
22870
22871
  contentType: content.contentType,
22871
22872
  };
22872
22873
  }
22873
- async uploadExportFile(file, { dataName, format, }) {
22874
- const filePath = this.buildExportFilePath(dataName, format);
22874
+ async uploadExportFile(file, { dataName, fileName, format, }) {
22875
+ const filePath = this.buildExportFilePath(dataName, fileName, format);
22875
22876
  await this.defaultBucketProvider.fileUpload({
22876
22877
  bucket: this.defaultFileProvider.defaultBucket,
22877
22878
  filePath,
@@ -22882,8 +22883,8 @@ let DataExportService = class DataExportService {
22882
22883
  reference: filePath,
22883
22884
  });
22884
22885
  }
22885
- buildExportFilePath(dataName, format) {
22886
- return `/data-export/${dataName}/${createDayPath$2(new Date())}/${newUuid$1()}_${dataName}.${format}`;
22886
+ buildExportFilePath(dataName, fileName, format) {
22887
+ return `/data-export/${dataName}/${createDayPath$2(new Date())}/${newUuid$1()}_${fileName}.${format}`;
22887
22888
  }
22888
22889
  get defaultFileProvider() {
22889
22890
  return this.registry