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