@punks/backend-entity-manager 0.0.91 → 0.0.92

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/esm/index.js CHANGED
@@ -188,10 +188,16 @@ class EntitySerializer {
188
188
  return {
189
189
  fileName,
190
190
  contentType: "text/csv",
191
- content: Buffer.from(csvBuild(data, this.getDefinition().columns.map((c) => ({
192
- name: c.name,
193
- value: (item) => this.getColumnValue(item, c),
194
- }))), "utf-8"),
191
+ content: Buffer.from(csvBuild(data, [
192
+ {
193
+ name: "_type",
194
+ value: () => this.entityName,
195
+ },
196
+ ...this.getDefinition().columns.map((c) => ({
197
+ name: c.name,
198
+ value: (item) => this.getColumnValue(item, c),
199
+ })),
200
+ ]), "utf-8"),
195
201
  };
196
202
  case EntitySerializationFormat.Xlsx:
197
203
  return {
@@ -200,11 +206,17 @@ class EntitySerializer {
200
206
  content: Buffer.from(excelBuild({
201
207
  data,
202
208
  sheetName: this.entityName,
203
- columns: this.getDefinition().columns.map((c) => ({
204
- header: c.name,
205
- value: (item) => this.getColumnValue(item, c),
206
- headerSize: c.colSpan,
207
- })),
209
+ columns: [
210
+ {
211
+ header: "_type",
212
+ value: () => this.entityName,
213
+ },
214
+ ...this.getDefinition().columns.map((c) => ({
215
+ header: c.name,
216
+ value: (item) => this.getColumnValue(item, c),
217
+ headerSize: c.colSpan,
218
+ })),
219
+ ],
208
220
  })),
209
221
  };
210
222
  case EntitySerializationFormat.Json: