@punks/backend-entity-manager 0.0.153 → 0.0.154

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.
@@ -17,7 +17,7 @@ export declare abstract class EntitySerializer<TEntity, TEntityId, TEntitySearch
17
17
  createSample(format: EntitySerializationFormat): Promise<EntityExportFile>;
18
18
  private buildSampleFile;
19
19
  serialize(data: TSheetItem[], format: EntitySerializationFormat): Promise<EntityExportFile>;
20
- protected abstract getDefinition(): Promise<EntitySerializerSheetDefinition<TSheetItem>>;
20
+ protected abstract getDefinition(context: TContext): Promise<EntitySerializerSheetDefinition<TSheetItem>>;
21
21
  protected abstract loadEntities(filters?: TEntitySearchParameters): Promise<TEntity[]>;
22
22
  protected abstract convertToSheetItems(entities: TEntity[]): Promise<TSheetItem[]>;
23
23
  protected abstract importItem(item: TSheetItem, context: TContext): Promise<TEntity>;
package/dist/esm/index.js CHANGED
@@ -149,7 +149,8 @@ class EntitySerializer {
149
149
  this.logger.info(`Entities import -> completed (${items.length} items)`);
150
150
  }
151
151
  async parse(data, format) {
152
- const definition = await this.getDefinition();
152
+ const context = await this.getContext();
153
+ const definition = await this.getDefinition(context);
153
154
  switch (format) {
154
155
  case EntitySerializationFormat.Csv:
155
156
  return this.parseCsv(data, definition);
@@ -193,7 +194,8 @@ class EntitySerializer {
193
194
  format,
194
195
  refDate: new Date(),
195
196
  });
196
- const definition = await this.getDefinition();
197
+ const context = await this.getContext();
198
+ const definition = await this.getDefinition(context);
197
199
  switch (format) {
198
200
  case EntitySerializationFormat.Csv:
199
201
  return {
@@ -249,7 +251,8 @@ class EntitySerializer {
249
251
  format,
250
252
  refDate: new Date(),
251
253
  });
252
- const definition = await this.getDefinition();
254
+ const context = await this.getContext();
255
+ const definition = await this.getDefinition(context);
253
256
  switch (format) {
254
257
  case EntitySerializationFormat.Csv:
255
258
  return {