@bytebrand/export-cars 1.0.17 → 1.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/export-cars",
3
- "version": "1.0.17",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "author": "bytebrand",
6
6
  "license": "UNLICENSED",
@@ -11,7 +11,8 @@
11
11
  "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
12
12
  "lint": "gts lint",
13
13
  "clean": "gts clean",
14
- "fix": "gts fix"
14
+ "fix": "gts fix",
15
+ "start:dev": "nest start --watch"
15
16
  },
16
17
  "dependencies": {
17
18
  "@bytebrand/autode-request": "^1.5.13",
@@ -64,5 +65,5 @@
64
65
  "engines": {
65
66
  "node": ">=14.0.0"
66
67
  },
67
- "gitHead": "a89952f7214cc5ca0453df1973e09ba73b0d8770"
68
+ "gitHead": "752e83a7226fdc7a01bd7bd42ea9c85091a67a7f"
68
69
  }
@@ -52,6 +52,7 @@ export class Auto24Exporter implements Exporter {
52
52
  });
53
53
 
54
54
  await xmlBuilder.buildEnd();
55
+ console.log(this.carService.counter.getCountedCars());
55
56
 
56
57
  if (fileGZ) {
57
58
  await Zipper.tar({ dest: fileGZ, fileList: [fileXml] });
@@ -15,7 +15,6 @@ export class Auto24XmlBuilder extends XMLBuilderBase {
15
15
  item += '\n<item>\n';
16
16
  item += this.getElement('autodeid', car.autodeid);
17
17
  item += this.getElement('userlink', car.userlink);
18
- item += this.getElement('apilink', car.apilink);
19
18
  item += this.getElement('brand', car.brand);
20
19
  item += this.getElement('modell', car.modell);
21
20
  item += this.getElement('cartype', car.cartype);
@@ -31,7 +31,6 @@ export interface FbXmlItem {
31
31
  export interface Auto24XmlItem {
32
32
  autodeid: string;
33
33
  userlink: string;
34
- apilink: string;
35
34
  brand: string;
36
35
  modell: string;
37
36
  cartype: string;
@@ -18,16 +18,16 @@ export class Auto24Transformer {
18
18
  }
19
19
 
20
20
  transform(car: DataSchemes.Car, imboImages: ImboImageResponseInterface[]): Auto24XmlItem {
21
- const autodeid = toString(get(car, '_id', ''));
22
- let userlink = `https://www.${this.configService.config.url}/search/vehicle/${autodeid}`;
21
+ const carId = toString(get(car, '_id', ''));
22
+
23
+ let userlink = `https://www.${this.configService.config.url}/search/vehicle/${carId}`;
23
24
  if (this.configService.config.campaign) {
24
25
  userlink += `?source=classifieds&medium=listing&campaign=${this.configService.config.campaign}`;
25
26
  }
26
27
 
27
28
  return {
28
- autodeid,
29
+ autodeid: get(car, 'metaData.vehicleId'),
29
30
  userlink,
30
- apilink: `https://www.${this.configService.config.url}/service/car-basic-data/api/v1/car/${autodeid}`,
31
31
  brand: toString(get(car, 'mainData.make', '')),
32
32
  modell: toString(get(car, 'mainData.model', '')),
33
33
  cartype: 'pkw',
@@ -37,9 +37,9 @@ export class Auto24Transformer {
37
37
  consumptionK: toString(get(car, 'consumption.consumptionCombined', '')),
38
38
  co2: toString(get(car, 'environmentEmissions.co2', '')),
39
39
  efficiencyclass: this.translateSelector(get(car, 'environmentEmissions.energyEfficiencyClass', '')),
40
- image: this.getImageField(autodeid, toString(get(car, 'metaData.mainImageId')), imboImages),
40
+ image: this.getImageField(carId, toString(get(car, 'metaData.mainImageId')), imboImages),
41
41
  registration: this.getRegistrationField(get(car, 'mainData.firstRegistration') as number),
42
- images: this.getImagesField(autodeid, imboImages),
42
+ images: this.getImagesField(carId, imboImages),
43
43
  price: toString(get(car, 'price.currentSalesPrice', '')),
44
44
  power: toString(get(car, 'engineData.powerKW', '')),
45
45
  zip: toString(get(car, 'location.zipCode', '')),