@bytebrand/export-cars 1.0.17 → 1.1.1
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/api_export_cars_dasparking.xml +603 -0
- package/dist/exporters/auto24.exporter.js +1 -0
- package/dist/exporters/auto24.exporter.js.map +1 -1
- package/dist/formats/auto24-xml.builder.js +1 -3
- package/dist/formats/auto24-xml.builder.js.map +1 -1
- package/dist/interfaces/export-item.interface.d.ts +0 -1
- package/dist/transformers/auto24.transfomer.js +5 -6
- package/dist/transformers/auto24.transfomer.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -3
- package/src/exporters/auto24.exporter.ts +1 -0
- package/src/formats/auto24-xml.builder.ts +1 -3
- package/src/interfaces/export-item.interface.ts +0 -1
- package/src/transformers/auto24.transfomer.ts +6 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytebrand/export-cars",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
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": "
|
|
68
|
+
"gitHead": "4006e3bfe30c1ec48542fdf3d1f98e83cb5718e2"
|
|
68
69
|
}
|
|
@@ -5,8 +5,7 @@ export class Auto24XmlBuilder extends XMLBuilderBase {
|
|
|
5
5
|
async buildStart(totalResults = 0): Promise<void> {
|
|
6
6
|
await this.write(`<autode version="1.1" types="detail">
|
|
7
7
|
<link>https://www.auto.de</link>
|
|
8
|
-
<language>de</language
|
|
9
|
-
<index_totalResults>${totalResults}</index_totalResults>`);
|
|
8
|
+
<language>de</language>`);
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
async addItem(car: Auto24XmlItem, location = ''): Promise<void> {
|
|
@@ -15,7 +14,6 @@ export class Auto24XmlBuilder extends XMLBuilderBase {
|
|
|
15
14
|
item += '\n<item>\n';
|
|
16
15
|
item += this.getElement('autodeid', car.autodeid);
|
|
17
16
|
item += this.getElement('userlink', car.userlink);
|
|
18
|
-
item += this.getElement('apilink', car.apilink);
|
|
19
17
|
item += this.getElement('brand', car.brand);
|
|
20
18
|
item += this.getElement('modell', car.modell);
|
|
21
19
|
item += this.getElement('cartype', car.cartype);
|
|
@@ -18,16 +18,16 @@ export class Auto24Transformer {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
transform(car: DataSchemes.Car, imboImages: ImboImageResponseInterface[]): Auto24XmlItem {
|
|
21
|
-
const
|
|
22
|
-
|
|
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(
|
|
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(
|
|
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', '')),
|