@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/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,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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:
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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:
|