@punks/backend-entity-manager 0.0.487 → 0.0.488

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
@@ -259,10 +259,7 @@ class EntitySerializer {
259
259
  async import(items, payload) {
260
260
  this.logger.info(`Entities import -> started (${items.length} items)`);
261
261
  const context = await this.getContext();
262
- for (const [index, item] of items.entries()) {
263
- await this.importItem(item, context, payload);
264
- this.logger.info(`Entity imported -> ${index + 1}/${items.length}`);
265
- }
262
+ await this.importItems(items, context, payload);
266
263
  this.logger.info(`Entities import -> completed (${items.length} items)`);
267
264
  }
268
265
  async parse(data, format, payload) {
@@ -277,6 +274,12 @@ class EntitySerializer {
277
274
  throw new Error(`Format ${format} not supported`);
278
275
  }
279
276
  }
277
+ async importItems(items, context, payload) {
278
+ for (const [index, item] of items.entries()) {
279
+ await this.importItem(item, context, payload);
280
+ this.logger.info(`Entity imported -> ${index + 1}/${items.length}`);
281
+ }
282
+ }
280
283
  parseCsv(data, definition) {
281
284
  const records = backendCore.csvParse(data, DEFAULT_DELIMITER$1);
282
285
  return records.map((x, i) => this.convertSheetRecord(x, definition, i));