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