@punks/backend-entity-manager 0.0.85 → 0.0.87

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
@@ -129,8 +129,8 @@ class EntitySeeder {
129
129
  }
130
130
 
131
131
  class EntitySerializer {
132
- constructor(services) {
133
- this.services = services;
132
+ constructor(entityName) {
133
+ this.entityName = entityName;
134
134
  }
135
135
  async parse(data, format) {
136
136
  throw new Error("Method not implemented.");
@@ -159,7 +159,7 @@ class EntitySerializer {
159
159
  contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
160
160
  content: Buffer.from(backendCore.excelBuild({
161
161
  data: [{}],
162
- sheetName: this.services.getEntityName(),
162
+ sheetName: this.entityName,
163
163
  columns: this.getDefinition().columns.map((c) => ({
164
164
  header: c.name,
165
165
  value: () => c.sampleValue ?? "",
@@ -195,7 +195,7 @@ class EntitySerializer {
195
195
  contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
196
196
  content: Buffer.from(backendCore.excelBuild({
197
197
  data,
198
- sheetName: this.services.getEntityName(),
198
+ sheetName: this.entityName,
199
199
  columns: this.getDefinition().columns.map((c) => ({
200
200
  header: c.name,
201
201
  value: (item) => this.getColumnValue(item, c),
@@ -218,9 +218,7 @@ class EntitySerializer {
218
218
  : rawValue;
219
219
  }
220
220
  buildExportFileName(input) {
221
- return `${input.refDate
222
- .toISOString()
223
- .replaceAll(":", "_")}_${this.services.getEntityName()}.${input.format}`;
221
+ return `${input.refDate.toISOString().replaceAll(":", "_")}_${this.entityName}.${input.format}`;
224
222
  }
225
223
  }
226
224
 
@@ -263,8 +261,9 @@ class NestEntityManager {
263
261
  }
264
262
 
265
263
  class NestEntitySerializer extends EntitySerializer {
266
- constructor(services) {
267
- super(services);
264
+ constructor(entityName, registry) {
265
+ super(entityName);
266
+ // this.services = registry.resolveEntityServicesCollection(entityName)
268
267
  }
269
268
  }
270
269