@bytebrand/export-cars 1.10.5 → 1.10.6
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/configs/config.d.ts +1 -0
- package/dist/configs/config.js +2 -0
- package/dist/configs/config.js.map +1 -1
- package/dist/services/images.service.js +1 -1
- package/dist/services/images.service.js.map +1 -1
- package/dist/transformers/facebook-shop.transformer.d.ts +3 -2
- package/dist/transformers/facebook-shop.transformer.js +2 -1
- package/dist/transformers/facebook-shop.transformer.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/configs/config.ts +2 -0
- package/src/services/images.service.ts +1 -1
- package/src/transformers/facebook-shop.transformer.ts +9 -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.6",
|
|
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": "612c022b995693ce437c548e3cc190de98545c91"
|
|
64
64
|
}
|
package/src/configs/config.ts
CHANGED
|
@@ -10,6 +10,7 @@ export class Config {
|
|
|
10
10
|
imboUrl: string;
|
|
11
11
|
imageUrl: string;
|
|
12
12
|
baseImageUrl: string;
|
|
13
|
+
marketingImageUrl: string;
|
|
13
14
|
imageType: ImageType;
|
|
14
15
|
isNewCar: boolean;
|
|
15
16
|
isCriteo: boolean;
|
|
@@ -59,6 +60,7 @@ export class Config {
|
|
|
59
60
|
this.cpc = params.cpc;
|
|
60
61
|
this.domain = this.environmentConfig[params.environment].domain;
|
|
61
62
|
this.baseImageUrl = this.environmentConfig[params.environment].baseImageUrl;
|
|
63
|
+
this.marketingImageUrl = this.environmentConfig[params.environment].imageUrl;
|
|
62
64
|
this.mappingSpreadsheetId = '147qz9sTgs1wi13ua8YKa0IgfxAn1X_qH6LkGnAnzeyY';
|
|
63
65
|
this.dealersSpreadsheetId = '1gWrcA-uRTpna1h66Mbe2Y7NA0tIhlUaQXBcS4a_UzOw';
|
|
64
66
|
this.dealersSpreadsheetTitle = 'dealers_mapping';
|
|
@@ -91,7 +91,7 @@ export class ImagesService {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
async getMarketingImages(images: any, carId: string): Promise<string[]> {
|
|
94
|
-
const imageUrl = this.configService.config.
|
|
94
|
+
const imageUrl = this.configService.config.marketingImageUrl;
|
|
95
95
|
const transformedImages = this.transformImagesArrayIntoObject(images);
|
|
96
96
|
|
|
97
97
|
const config = await this.userService.getMarketingImageConfig(this.configService.config.marketingImageConfigId);
|
|
@@ -3,6 +3,7 @@ import { Injectable } from '@nestjs/common';
|
|
|
3
3
|
import { escape, get, join, round, toString, trim } from 'lodash';
|
|
4
4
|
|
|
5
5
|
import { de, deVehicleDetailsPage, deVehicleProps } from '@bytebrand/i18n-dictionaries';
|
|
6
|
+
import { ImboImageResponseInterface } from '@bytebrand/chunkable';
|
|
6
7
|
import { TranslatorExtended } from '@bytebrand/schema-tools';
|
|
7
8
|
import { DataSchemes } from '@bytebrand/car-schema';
|
|
8
9
|
|
|
@@ -21,8 +22,15 @@ export class FacebookShopTransformer {
|
|
|
21
22
|
this.translator = new TranslatorExtended(dict);
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
async transform({
|
|
25
|
+
async transform({
|
|
26
|
+
car,
|
|
27
|
+
images,
|
|
28
|
+
}: {
|
|
29
|
+
car: DataSchemes.Car;
|
|
30
|
+
images: ImboImageResponseInterface[];
|
|
31
|
+
}): Promise<FacebookShopItem> {
|
|
25
32
|
const imageLinks = await this.imageService.getImages(car, images, this.configService.config.imageType);
|
|
33
|
+
images.length && console.log(imageLinks, this.configService.config.imageType);
|
|
26
34
|
|
|
27
35
|
return {
|
|
28
36
|
id: { value: get(car, 'metaData.vehicleId'), isGoogle: true },
|