@bytebrand/export-cars 1.12.12 → 1.13.0
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/exporters/as24.exporter.js +9 -11
- package/dist/exporters/as24.exporter.js.map +1 -1
- package/dist/exporters/auto24.exporter.js +5 -7
- package/dist/exporters/auto24.exporter.js.map +1 -1
- package/dist/exporters/autouncle.exporter.js +1 -0
- package/dist/exporters/autouncle.exporter.js.map +1 -1
- package/dist/exporters/facebook-shop.exporter.js +5 -7
- package/dist/exporters/facebook-shop.exporter.js.map +1 -1
- package/dist/exporters/ooyyo.exporter.js +4 -7
- package/dist/exporters/ooyyo.exporter.js.map +1 -1
- package/dist/exporters/rubrikk.exporter.js +5 -7
- package/dist/exporters/rubrikk.exporter.js.map +1 -1
- package/dist/exporters/trovit.exporter.js +6 -8
- package/dist/exporters/trovit.exporter.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/exporters/as24.exporter.ts +10 -13
- package/src/exporters/auto24.exporter.ts +6 -8
- package/src/exporters/autouncle.exporter.ts +1 -1
- package/src/exporters/facebook-shop.exporter.ts +6 -8
- package/src/exporters/ooyyo.exporter.ts +2 -5
- package/src/exporters/rubrikk.exporter.ts +5 -7
- package/src/exporters/trovit.exporter.ts +7 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytebrand/export-cars",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "bytebrand",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
"start:dev": "nest start --watch"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@bytebrand/autode-request": "^1.
|
|
19
|
-
"@bytebrand/car-basic-data-scope": "^9.
|
|
20
|
-
"@bytebrand/car-description": "^1.
|
|
21
|
-
"@bytebrand/car-schema": "^3.
|
|
22
|
-
"@bytebrand/chunkable": "^5.
|
|
23
|
-
"@bytebrand/cronicle-helper": "^1.
|
|
18
|
+
"@bytebrand/autode-request": "^1.14.0",
|
|
19
|
+
"@bytebrand/car-basic-data-scope": "^9.11.0",
|
|
20
|
+
"@bytebrand/car-description": "^1.10.0",
|
|
21
|
+
"@bytebrand/car-schema": "^3.14.0",
|
|
22
|
+
"@bytebrand/chunkable": "^5.15.0",
|
|
23
|
+
"@bytebrand/cronicle-helper": "^1.17.0",
|
|
24
24
|
"@bytebrand/i18n-dictionaries": "^1.4.2",
|
|
25
|
-
"@bytebrand/import-helper": "^0.
|
|
26
|
-
"@bytebrand/schema-tools": "^3.
|
|
25
|
+
"@bytebrand/import-helper": "^0.39.1",
|
|
26
|
+
"@bytebrand/schema-tools": "^3.16.0",
|
|
27
27
|
"@bytebrand/zipper": "^2.1.2",
|
|
28
28
|
"@nestjs/common": "^9.0.0",
|
|
29
29
|
"@nestjs/core": "^9.0.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=14.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "9019d2088805fb0bd1138c4109a7f2eb3af2b215"
|
|
64
64
|
}
|
|
@@ -36,21 +36,18 @@ export class As24Exporter implements Exporter {
|
|
|
36
36
|
await this.loaderService.process(async (chunk: FsChunkInterface) => {
|
|
37
37
|
const chunkData = chunk.data.filter(car => this.carService.filterCar(car, this.rulesService.rules));
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const ownerId = get(data.car, 'metaData.ownerId');
|
|
39
|
+
for (let i = 0; i < chunkData.length; i += 1) {
|
|
40
|
+
const data = chunkData[i];
|
|
41
|
+
const ownerId = get(data.car, 'metaData.ownerId');
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
const transformedData = await as24Transformer.transform(data.car);
|
|
44
|
+
const transformedDataCSV = `${convertToCSV(transformedData)}\n`;
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
this.carService.counter.countCar(data.images);
|
|
51
|
-
processedDealers.add(ownerId);
|
|
52
|
-
}
|
|
46
|
+
const filename = `${this.configService.config.pathesConfig.localConvertedDirectory}/${ownerId}.${FileType.CSV}`
|
|
47
|
+
await writeFile(filename, Buffer.from(transformedDataCSV), { flag: 'a' },);
|
|
53
48
|
|
|
49
|
+
this.carService.counter.countCar(data.images);
|
|
50
|
+
processedDealers.add(ownerId);
|
|
54
51
|
}
|
|
55
52
|
});
|
|
56
53
|
|
|
@@ -59,7 +56,7 @@ export class As24Exporter implements Exporter {
|
|
|
59
56
|
const d = `${now.getFullYear()}${now.getMonth() + 1}${now.getDate()}`;
|
|
60
57
|
const fileCSV = normalize(`${this.configService.config.pathesConfig.localConvertedDirectory}/${dealer}.${FileType.CSV}`);
|
|
61
58
|
const fileZIP = normalize(`${this.configService.config.pathesConfig.localConvertedDirectory}/${d}_${dealer}.${FileType.ZIP}`);
|
|
62
|
-
|
|
59
|
+
|
|
63
60
|
if (await CronicleUtils.exists(fileCSV)) {
|
|
64
61
|
await Zipper.zip({ fileList: [fileCSV], dest: fileZIP });
|
|
65
62
|
await CronicleUtils.unlinkIfExists(fileCSV);
|
|
@@ -17,7 +17,7 @@ export class Auto24Exporter implements Exporter {
|
|
|
17
17
|
private loaderService: LoaderService,
|
|
18
18
|
private moduleRef: ModuleRef,
|
|
19
19
|
private rulesService: RulesService,
|
|
20
|
-
) {}
|
|
20
|
+
) { }
|
|
21
21
|
|
|
22
22
|
async export(): Promise<void> {
|
|
23
23
|
const [fileXml] = this.configService.config.outputFiles;
|
|
@@ -32,13 +32,11 @@ export class Auto24Exporter implements Exporter {
|
|
|
32
32
|
await this.loaderService.process(async (chunk: FsChunkInterface) => {
|
|
33
33
|
const chunkData = chunk.data.filter(car => this.carService.filterCar(car, this.rulesService.rules));
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
this.carService.counter.countCar(images);
|
|
41
|
-
}
|
|
35
|
+
for (let i = 0; i < chunkData.length; i += 1) {
|
|
36
|
+
const data = chunk.data[i];
|
|
37
|
+
const { car, images } = data;
|
|
38
|
+
await xmlBuilder.addItem(await auto24Transformer.transform(car, images), 'Deutschland');
|
|
39
|
+
this.carService.counter.countCar(images);
|
|
42
40
|
}
|
|
43
41
|
});
|
|
44
42
|
|
|
@@ -33,7 +33,7 @@ export class AutouncleExporter implements Exporter {
|
|
|
33
33
|
|
|
34
34
|
let firstCar = true;
|
|
35
35
|
await this.loaderService.process(async (chunk: FsChunkInterface) => {
|
|
36
|
-
|
|
36
|
+
chunk.data = chunk.data.filter(e => this.carService.filterCar(e, this.rulesService.rules));
|
|
37
37
|
|
|
38
38
|
for (const data of chunk.data) {
|
|
39
39
|
const ownerId = get(data.car, 'metaData.ownerId');
|
|
@@ -17,7 +17,7 @@ export class FacebookShopExporter implements Exporter {
|
|
|
17
17
|
private loaderService: LoaderService,
|
|
18
18
|
private moduleRef: ModuleRef,
|
|
19
19
|
private rulesService: RulesService,
|
|
20
|
-
) {}
|
|
20
|
+
) { }
|
|
21
21
|
|
|
22
22
|
async export(): Promise<void> {
|
|
23
23
|
const [fileXml] = this.configService.config.outputFiles;
|
|
@@ -32,15 +32,13 @@ export class FacebookShopExporter implements Exporter {
|
|
|
32
32
|
await this.loaderService.process(async (chunk: FsChunkInterface) => {
|
|
33
33
|
const chunkData = chunk.data.filter(car => this.carService.filterCar(car, this.rulesService.rules));
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const data = chunk.data[i];
|
|
35
|
+
for (let i = 0; i < chunkData.length; i += 1) {
|
|
36
|
+
const data = chunk.data[i];
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
const transformedCar = await facebookShopTransformer.transform(data);
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
40
|
+
await facebookShopXmkBuilder.addItem(transformedCar);
|
|
41
|
+
this.carService.counter.countCar(data.images);
|
|
44
42
|
}
|
|
45
43
|
});
|
|
46
44
|
|
|
@@ -31,15 +31,12 @@ export class OoyyoExporter implements Exporter {
|
|
|
31
31
|
await this.loaderService.process(async (chunk: FsChunkInterface) => {
|
|
32
32
|
const chunkData = chunk.data.filter(car => this.carService.filterCar(car, this.rulesService.rules));
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const data = chunk.data[i];
|
|
37
|
-
const { car, images } = data;
|
|
34
|
+
for (let i = 0; i < chunkData.length; i += 1) {
|
|
35
|
+
const { car, images } = chunkData[i];
|
|
38
36
|
await ooyyoXmlBuilder.addItem(await ooyyoTransformer.transform(car, images));
|
|
39
37
|
|
|
40
38
|
this.carService.counter.countCar(images);
|
|
41
39
|
}
|
|
42
|
-
}
|
|
43
40
|
});
|
|
44
41
|
|
|
45
42
|
await ooyyoXmlBuilder.buildEnd();
|
|
@@ -33,15 +33,13 @@ export class RubrikkExporter implements Exporter {
|
|
|
33
33
|
await this.loaderService.process(async (chunk: FsChunkInterface) => {
|
|
34
34
|
const chunkData = chunk.data.filter(car => this.carService.filterCar(car, this.rulesService.rules));
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const data = chunk.data[i];
|
|
36
|
+
for (let i = 0; i < chunkData.length; i += 1) {
|
|
37
|
+
const data = chunkData[i];
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
const transformedCar = await rubrikkTransformer.transform(data);
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
41
|
+
await rubrikkXmlBuilder.addItem(transformedCar);
|
|
42
|
+
this.carService.counter.countCar(data.images);
|
|
45
43
|
}
|
|
46
44
|
});
|
|
47
45
|
|
|
@@ -17,7 +17,7 @@ export class TrovitExporter implements Exporter {
|
|
|
17
17
|
private loaderService: LoaderService,
|
|
18
18
|
private moduleRef: ModuleRef,
|
|
19
19
|
private rulesService: RulesService,
|
|
20
|
-
) {}
|
|
20
|
+
) { }
|
|
21
21
|
|
|
22
22
|
async export(): Promise<void> {
|
|
23
23
|
const [fileXml] = this.configService.config.outputFiles;
|
|
@@ -30,17 +30,15 @@ export class TrovitExporter implements Exporter {
|
|
|
30
30
|
const trovitTransformer = await this.moduleRef.create(TrovitTransformer);
|
|
31
31
|
|
|
32
32
|
await this.loaderService.process(async (chunk: FsChunkInterface) => {
|
|
33
|
-
|
|
33
|
+
chunk.data = chunk.data.filter(car => this.carService.filterCar(car, this.rulesService.rules));
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const data = chunk.data[i];
|
|
35
|
+
for (let i = 0; i < chunk.data.length; i += 1) {
|
|
36
|
+
const data = chunk.data[i];
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
const transformedCar = await trovitTransformer.transform(data);
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
40
|
+
await trovitXmlBuilder.addItem(transformedCar);
|
|
41
|
+
this.carService.counter.countCar(data.images);
|
|
44
42
|
}
|
|
45
43
|
});
|
|
46
44
|
|