@punks/backend-entity-manager 0.0.90 → 0.0.91

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
@@ -148,10 +148,16 @@ class EntitySerializer {
148
148
  return {
149
149
  fileName,
150
150
  contentType: "text/csv",
151
- content: Buffer.from(backendCore.csvBuild([{}], this.getDefinition().columns.map((c) => ({
152
- name: c.name,
153
- value: () => c.sampleValue ?? "",
154
- }))), "utf-8"),
151
+ content: Buffer.from(backendCore.csvBuild([{}], [
152
+ {
153
+ name: "_type",
154
+ value: () => this.entityName,
155
+ },
156
+ ...this.getDefinition().columns.map((c) => ({
157
+ name: c.name,
158
+ value: () => c.sampleValue ?? "",
159
+ })),
160
+ ]), "utf-8"),
155
161
  };
156
162
  case exports.EntitySerializationFormat.Xlsx:
157
163
  return {
@@ -160,11 +166,17 @@ class EntitySerializer {
160
166
  content: Buffer.from(backendCore.excelBuild({
161
167
  data: [{}],
162
168
  sheetName: this.entityName,
163
- columns: this.getDefinition().columns.map((c) => ({
164
- header: c.name,
165
- value: () => c.sampleValue ?? "",
166
- headerSize: c.colSpan,
167
- })),
169
+ columns: [
170
+ {
171
+ header: "_type",
172
+ value: () => this.entityName,
173
+ },
174
+ ...this.getDefinition().columns.map((c) => ({
175
+ header: c.name,
176
+ value: () => c.sampleValue ?? "",
177
+ headerSize: c.colSpan,
178
+ })),
179
+ ],
168
180
  })),
169
181
  };
170
182
  case exports.EntitySerializationFormat.Json: