@punks/backend-entity-manager 0.0.440 → 0.0.443

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/dist/cjs/index.js CHANGED
@@ -290,8 +290,6 @@ class EntitySerializer {
290
290
  const entity = (definition.autoColumns ? { ...record } : {});
291
291
  for (const column of definition.columns) {
292
292
  const columnName = [column.name, ...(column?.aliases ?? [])].find((x) => normalizeSheetColumn(x) in record) ?? null;
293
- console.log("name", columnName);
294
- console.log("record", entity);
295
293
  if (!columnName)
296
294
  continue;
297
295
  if (column.parseAction) {
@@ -967,7 +965,7 @@ class EntitiesImportCommand {
967
965
  contentType: input.file.contentType,
968
966
  fileName: input.file.fileName,
969
967
  });
970
- const importEntities = await this.parseImportFile(input.file.content, input.format);
968
+ const importEntities = await this.parseImportFile(input.file.content, input.format, input?.payload);
971
969
  const validEntities = importEntities.filter((x) => x.status.isValid);
972
970
  const invalidEntities = importEntities.filter((x) => !x.status.isValid);
973
971
  if (invalidEntities.length > 0 &&
@@ -976,7 +974,7 @@ class EntitiesImportCommand {
976
974
  .map((x) => x.id)
977
975
  .join(", ")}`);
978
976
  }
979
- await this.services.resolveSerializer().import(validEntities.map((x) => x.item), input.payload);
977
+ await this.services.resolveSerializer().import(validEntities.map((x) => x.item), input?.payload);
980
978
  return {
981
979
  statistics: {
982
980
  importedCount: validEntities.length,
@@ -987,8 +985,10 @@ class EntitiesImportCommand {
987
985
  },
988
986
  };
989
987
  }
990
- async parseImportFile(content, format) {
991
- return await this.services.resolveSerializer().parse(content, format);
988
+ async parseImportFile(content, format, payload) {
989
+ return await this.services
990
+ .resolveSerializer()
991
+ .parse(content, format, payload);
992
992
  }
993
993
  async uploadImportFile(file) {
994
994
  await this.bucket.fileUpload({