@punks/backend-entity-manager 0.0.448 → 0.0.450

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.
@@ -26,7 +26,7 @@ export declare abstract class EntitySerializer<TEntity, TEntityId, TEntitySearch
26
26
  private parseColumnValue;
27
27
  createSample(format: EntitySerializationFormat): Promise<EntityExportFile>;
28
28
  private buildSampleFile;
29
- serialize(data: TSheetItem[], format: EntitySerializationFormat): Promise<EntityExportFile>;
29
+ serialize(data: TSheetItem[], format: EntitySerializationFormat, payload?: TPayload): Promise<EntityExportFile>;
30
30
  protected abstract getDefinition(context: TContext, payload?: TPayload): Promise<EntitySerializerSheetDefinition<TSheetItem>>;
31
31
  protected abstract loadEntities(filters?: TEntitySearchParameters): Promise<TEntity[]>;
32
32
  protected abstract convertToSheetItems(entities: TEntity[]): Promise<TSheetItem[]>;
package/dist/esm/index.js CHANGED
@@ -244,7 +244,6 @@ class EntitySerializer {
244
244
  }
245
245
  async parse(data, format, payload) {
246
246
  const context = await this.getContext();
247
- console.log("/serializer/base/parse", payload);
248
247
  const definition = await this.getDefinition(context, payload);
249
248
  switch (format) {
250
249
  case EntitySerializationFormat.Csv:
@@ -341,7 +340,6 @@ class EntitySerializer {
341
340
  refDate: new Date(),
342
341
  });
343
342
  const context = await this.getContext();
344
- console.log("buildSampleFile", "definition call");
345
343
  const definition = await this.getDefinition(context);
346
344
  switch (format) {
347
345
  case EntitySerializationFormat.Csv:
@@ -393,8 +391,8 @@ class EntitySerializer {
393
391
  throw new Error("Json sample not implemented");
394
392
  }
395
393
  }
396
- async serialize(data, format) {
397
- return await this.buildExportFile(data, format);
394
+ async serialize(data, format, payload) {
395
+ return await this.buildExportFile(data, format, payload);
398
396
  }
399
397
  validateSheetItem(item, allItems, context) { }
400
398
  async getContext() {
@@ -402,14 +400,13 @@ class EntitySerializer {
402
400
  .resolveAuthenticationContextProvider()
403
401
  ?.getContext());
404
402
  }
405
- async buildExportFile(data, format) {
403
+ async buildExportFile(data, format, payload) {
406
404
  const fileName = this.buildExportFileName({
407
405
  format,
408
406
  refDate: new Date(),
409
407
  });
410
408
  const context = await this.getContext();
411
- console.log("buildExportFile", "definition call");
412
- const definition = await this.getDefinition(context);
409
+ const definition = await this.getDefinition(context, payload);
413
410
  switch (format) {
414
411
  case EntitySerializationFormat.Csv:
415
412
  return {