@bytebrand/export-cars 1.10.2 → 1.10.4
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/transformers/fb.transformer.js +10 -2
- package/dist/transformers/fb.transformer.js.map +1 -1
- package/dist/transformers/modix.transformer.js +1 -1
- package/dist/transformers/modix.transformer.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/transformers/fb.transformer.ts +11 -5
- package/src/transformers/modix.transformer.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytebrand/export-cars",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.4",
|
|
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": "8328e981aadcc3aa3d6ac4e94da5928b6172e12e"
|
|
64
64
|
}
|
|
@@ -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 {
|
|
@@ -200,7 +200,7 @@ export class ModixTransformer {
|
|
|
200
200
|
|
|
201
201
|
private getImagesLinks(car: DataSchemes.Car, images: ImboImageResponseInterface[]): imageItem {
|
|
202
202
|
const car_id = toString(get(car, '_id', ''));
|
|
203
|
-
const url =
|
|
203
|
+
const url = `${this.configService.config.imageUrl}/carimage/${car_id}`;
|
|
204
204
|
|
|
205
205
|
const imageList: IModixWrapItem[] = [];
|
|
206
206
|
|