@punks/backend-entity-manager 0.0.155 → 0.0.157
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 +6 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/abstractions/actions.d.ts +1 -1
- package/dist/cjs/types/abstractions/commands.d.ts +1 -1
- package/dist/cjs/types/abstractions/import.d.ts +2 -1
- package/dist/cjs/types/abstractions/serializer.d.ts +2 -2
- package/dist/cjs/types/actions/import.d.ts +1 -1
- package/dist/cjs/types/base/serializer.d.ts +3 -3
- package/dist/cjs/types/commands/import.d.ts +1 -1
- package/dist/cjs/types/converters/files.d.ts +3 -2
- package/dist/cjs/types/platforms/nest/__test__/server/entities/foos/foo.types.d.ts +2 -1
- package/dist/esm/index.js +6 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/abstractions/actions.d.ts +1 -1
- package/dist/esm/types/abstractions/commands.d.ts +1 -1
- package/dist/esm/types/abstractions/import.d.ts +2 -1
- package/dist/esm/types/abstractions/serializer.d.ts +2 -2
- package/dist/esm/types/actions/import.d.ts +1 -1
- package/dist/esm/types/base/serializer.d.ts +3 -3
- package/dist/esm/types/commands/import.d.ts +1 -1
- package/dist/esm/types/converters/files.d.ts +3 -2
- package/dist/esm/types/platforms/nest/__test__/server/entities/foos/foo.types.d.ts +2 -1
- package/dist/index.d.ts +12 -10
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -147,11 +147,11 @@ class EntitySerializer {
|
|
|
147
147
|
const entities = await this.loadEntities(filters ?? {});
|
|
148
148
|
return await this.convertToSheetItems(entities);
|
|
149
149
|
}
|
|
150
|
-
async import(items) {
|
|
150
|
+
async import(items, payload) {
|
|
151
151
|
this.logger.info(`Entities import -> started (${items.length} items)`);
|
|
152
152
|
const context = await this.getContext();
|
|
153
153
|
for (const [index, item] of items.entries()) {
|
|
154
|
-
await this.importItem(item, context);
|
|
154
|
+
await this.importItem(item, context, payload);
|
|
155
155
|
this.logger.info(`Entity imported -> ${index + 1}/${items.length}`);
|
|
156
156
|
}
|
|
157
157
|
this.logger.info(`Entities import -> completed (${items.length} items)`);
|
|
@@ -707,7 +707,9 @@ class EntitiesImportCommand {
|
|
|
707
707
|
fileName: input.file.fileName,
|
|
708
708
|
});
|
|
709
709
|
const importEntities = await this.parseImportFile(input.file.content, input.format);
|
|
710
|
-
await this.services
|
|
710
|
+
await this.services
|
|
711
|
+
.resolveSerializer()
|
|
712
|
+
.import(importEntities, input.payload);
|
|
711
713
|
return {
|
|
712
714
|
statistics: {
|
|
713
715
|
importedCount: importEntities.length,
|
|
@@ -2284,6 +2286,7 @@ const toEntitiesImportInput = (request) => ({
|
|
|
2284
2286
|
contentType: request.file.mimetype,
|
|
2285
2287
|
fileName: request.file.originalname,
|
|
2286
2288
|
},
|
|
2289
|
+
payload: request.payload,
|
|
2287
2290
|
});
|
|
2288
2291
|
|
|
2289
2292
|
class IEntityVersionsCursor {
|