@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 +21 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +21 -9
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
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,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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:
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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:
|