@punks/backend-entity-manager 0.0.444 → 0.0.446
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.
|
@@ -6,7 +6,7 @@ export declare class EntitiesParseCommand<TEntity> implements IEntitiesParseComm
|
|
|
6
6
|
private readonly services;
|
|
7
7
|
private readonly settings;
|
|
8
8
|
constructor(services: EntityServiceLocator<TEntity, unknown>, settings: EntitiesImportExportSettings);
|
|
9
|
-
execute(input: EntitiesParseInput<
|
|
9
|
+
execute<TPayload>(input: EntitiesParseInput<TPayload>): Promise<EntitiesParseResult<unknown>>;
|
|
10
10
|
private parseImportFile;
|
|
11
11
|
private uploadImportFile;
|
|
12
12
|
private buildAbsoluteBucketPath;
|
package/dist/esm/index.js
CHANGED
|
@@ -244,6 +244,7 @@ class EntitySerializer {
|
|
|
244
244
|
}
|
|
245
245
|
async parse(data, format, payload) {
|
|
246
246
|
const context = await this.getContext();
|
|
247
|
+
console.log("/serializer/base/parse", payload);
|
|
247
248
|
const definition = await this.getDefinition(context, payload);
|
|
248
249
|
switch (format) {
|
|
249
250
|
case EntitySerializationFormat.Csv:
|
|
@@ -950,6 +951,7 @@ class EntitiesImportCommand {
|
|
|
950
951
|
contentType: input.file.contentType,
|
|
951
952
|
fileName: input.file.fileName,
|
|
952
953
|
});
|
|
954
|
+
console.log("/commands/import/execute", input?.payload);
|
|
953
955
|
const importEntities = await this.parseImportFile(input.file.content, input.format, input?.payload);
|
|
954
956
|
const validEntities = importEntities.filter((x) => x.status.isValid);
|
|
955
957
|
const invalidEntities = importEntities.filter((x) => !x.status.isValid);
|
|
@@ -971,6 +973,7 @@ class EntitiesImportCommand {
|
|
|
971
973
|
};
|
|
972
974
|
}
|
|
973
975
|
async parseImportFile(content, format, payload) {
|
|
976
|
+
console.log("/import/command/parseImportFile", payload);
|
|
974
977
|
return await this.services
|
|
975
978
|
.resolveSerializer()
|
|
976
979
|
.parse(content, format, payload);
|
|
@@ -1002,13 +1005,15 @@ class EntitiesParseCommand {
|
|
|
1002
1005
|
contentType: input.file.contentType,
|
|
1003
1006
|
fileName: input.file.fileName,
|
|
1004
1007
|
});
|
|
1005
|
-
const entries = await this.parseImportFile(input.file.content, input.format);
|
|
1008
|
+
const entries = await this.parseImportFile(input.file.content, input.format, input?.payload);
|
|
1006
1009
|
return {
|
|
1007
1010
|
entries,
|
|
1008
1011
|
};
|
|
1009
1012
|
}
|
|
1010
|
-
async parseImportFile(content, format) {
|
|
1011
|
-
return await this.services
|
|
1013
|
+
async parseImportFile(content, format, payload) {
|
|
1014
|
+
return await this.services
|
|
1015
|
+
.resolveSerializer()
|
|
1016
|
+
.parse(content, format, payload);
|
|
1012
1017
|
}
|
|
1013
1018
|
async uploadImportFile(file) {
|
|
1014
1019
|
await this.bucket.fileUpload({
|