@bytebrand/export-cars 1.10.3 → 1.10.5
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/formats/auto24-xml.builder.js +5 -1
- package/dist/formats/auto24-xml.builder.js.map +1 -1
- package/dist/transformers/fb.transformer.js +10 -2
- package/dist/transformers/fb.transformer.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/formats/auto24-xml.builder.ts +5 -1
- package/src/transformers/fb.transformer.ts +11 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytebrand/export-cars",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "bytebrand",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=14.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "aed8d58733fb5a6d84f1bd96739ddf423b0019d4"
|
|
64
64
|
}
|
|
@@ -37,7 +37,11 @@ export class Auto24XmlBuilder extends XMLBuilderBase {
|
|
|
37
37
|
item += this.getElement('mileage', car.mileage);
|
|
38
38
|
item += this.getElement('companyname', car.companyname, true);
|
|
39
39
|
item += this.getElement('extras', car.extras, true);
|
|
40
|
-
item += this.getElement('
|
|
40
|
+
item += this.getElement('condition', car.condition);
|
|
41
|
+
item += this.getElement('dealer_homepage_url', car.dealer_homepage_url);
|
|
42
|
+
item += this.getElement('dealer_email', car.dealer_email);
|
|
43
|
+
item += this.getElement('dealer_name', car.dealer_name);
|
|
44
|
+
item += this.getElement('dealer_phone', car.dealer_phone);
|
|
41
45
|
item += '</item>';
|
|
42
46
|
|
|
43
47
|
await this.write(item);
|
|
@@ -328,17 +328,23 @@ export class FbTransformer {
|
|
|
328
328
|
private async getLocationByInfo(info: { zip: number; city: string }): Promise<DePostalCodesEntryInterface> {
|
|
329
329
|
const cacheKey = `${info.city}_${info.zip}`;
|
|
330
330
|
|
|
331
|
-
let entry
|
|
332
|
-
if (entry) { return entry };
|
|
331
|
+
let entry = await this.cacheManager.get(cacheKey);
|
|
332
|
+
if (entry) { return entry as DePostalCodesEntryInterface; };
|
|
333
|
+
if (entry === 'no_data') { return undefined; }
|
|
333
334
|
|
|
334
335
|
entry = await this.postalCodesService.getLocationByPostalCode(info.zip);
|
|
335
|
-
await this.cacheManager.set(cacheKey, entry);
|
|
336
|
+
entry && await this.cacheManager.set(cacheKey, entry);
|
|
336
337
|
|
|
337
338
|
if (!entry) {
|
|
338
339
|
entry = await this.postalCodesService.getLocationByCity(info.city);
|
|
339
|
-
|
|
340
|
+
if (entry) {
|
|
341
|
+
await this.cacheManager.set(cacheKey, entry);
|
|
342
|
+
} else {
|
|
343
|
+
await this.cacheManager.set(cacheKey, 'no_data');
|
|
344
|
+
}
|
|
345
|
+
|
|
340
346
|
}
|
|
341
|
-
return entry;
|
|
347
|
+
return entry as DePostalCodesEntryInterface;
|
|
342
348
|
}
|
|
343
349
|
|
|
344
350
|
private getExteriorColor(car: DataSchemes.Car): string {
|