@punks/backend-entity-manager 0.0.350 → 0.0.351

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
@@ -194,8 +194,9 @@ class EntitySeeder {
194
194
 
195
195
  const DEFAULT_DELIMITER = ";";
196
196
  class EntitySerializer {
197
- constructor(services) {
197
+ constructor(services, options) {
198
198
  this.services = services;
199
+ this.options = options;
199
200
  this.entityName = services.getEntityName();
200
201
  this.logger = backendCore.Log.getLogger(`${services.getEntityName()} -> Serializer`);
201
202
  }
@@ -287,10 +288,14 @@ class EntitySerializer {
287
288
  fileName,
288
289
  contentType: "text/csv",
289
290
  content: Buffer.from(backendCore.csvBuild([{}], [
290
- {
291
- name: "_type",
292
- value: () => this.entityName,
293
- },
291
+ ...(this.options?.useTypeColumn
292
+ ? [
293
+ {
294
+ name: "_type",
295
+ value: () => this.entityName,
296
+ },
297
+ ]
298
+ : []),
294
299
  ...definition.columns.map((c) => ({
295
300
  name: c.name,
296
301
  value: () => c.sampleValue ?? "",
@@ -307,10 +312,14 @@ class EntitySerializer {
307
312
  data: [{}],
308
313
  sheetName: this.entityName,
309
314
  columns: [
310
- {
311
- header: "_type",
312
- value: () => this.entityName,
313
- },
315
+ ...(this.options?.useTypeColumn
316
+ ? [
317
+ {
318
+ header: "_type",
319
+ value: () => this.entityName,
320
+ },
321
+ ]
322
+ : []),
314
323
  ...definition.columns.map((c) => ({
315
324
  header: c.name,
316
325
  value: () => c.sampleValue ?? "",