@punks/backend-entity-manager 0.0.445 → 0.0.447
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,7 +244,6 @@ 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);
|
|
248
247
|
const definition = await this.getDefinition(context, payload);
|
|
249
248
|
switch (format) {
|
|
250
249
|
case EntitySerializationFormat.Csv:
|
|
@@ -951,7 +950,6 @@ class EntitiesImportCommand {
|
|
|
951
950
|
contentType: input.file.contentType,
|
|
952
951
|
fileName: input.file.fileName,
|
|
953
952
|
});
|
|
954
|
-
console.log("/commands/import/execute", input?.payload);
|
|
955
953
|
const importEntities = await this.parseImportFile(input.file.content, input.format, input?.payload);
|
|
956
954
|
const validEntities = importEntities.filter((x) => x.status.isValid);
|
|
957
955
|
const invalidEntities = importEntities.filter((x) => !x.status.isValid);
|
|
@@ -973,7 +971,6 @@ class EntitiesImportCommand {
|
|
|
973
971
|
};
|
|
974
972
|
}
|
|
975
973
|
async parseImportFile(content, format, payload) {
|
|
976
|
-
console.log("/import/command/parseImportFile", payload);
|
|
977
974
|
return await this.services
|
|
978
975
|
.resolveSerializer()
|
|
979
976
|
.parse(content, format, payload);
|
|
@@ -1005,13 +1002,15 @@ class EntitiesParseCommand {
|
|
|
1005
1002
|
contentType: input.file.contentType,
|
|
1006
1003
|
fileName: input.file.fileName,
|
|
1007
1004
|
});
|
|
1008
|
-
const entries = await this.parseImportFile(input.file.content, input.format);
|
|
1005
|
+
const entries = await this.parseImportFile(input.file.content, input.format, input?.payload);
|
|
1009
1006
|
return {
|
|
1010
1007
|
entries,
|
|
1011
1008
|
};
|
|
1012
1009
|
}
|
|
1013
|
-
async parseImportFile(content, format) {
|
|
1014
|
-
return await this.services
|
|
1010
|
+
async parseImportFile(content, format, payload) {
|
|
1011
|
+
return await this.services
|
|
1012
|
+
.resolveSerializer()
|
|
1013
|
+
.parse(content, format, payload);
|
|
1015
1014
|
}
|
|
1016
1015
|
async uploadImportFile(file) {
|
|
1017
1016
|
await this.bucket.fileUpload({
|