@bytebrand/export-cars 1.21.27 → 1.21.28

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.21.27",
3
+ "version": "1.21.28",
4
4
  "description": "",
5
5
  "author": "bytebrand",
6
6
  "license": "UNLICENSED",
@@ -14,6 +14,10 @@ export class GoogleXmlBuilder extends XMLBuilderBase {
14
14
  if (key === 'installment') {
15
15
  return this.getInstallmentElement(key, data);
16
16
  }
17
+
18
+ if (['additional_image_link', 'vehicle_option'].includes(key))
19
+ data.map((value: string) => this.getElement(`g:${key}`, this.escapeXML(value)))
20
+
17
21
  return this.getElement(`g:${key}`, this.escapeXML(data));
18
22
  })
19
23
  .join('');
@@ -155,20 +155,20 @@ export interface GoogleXmlItem {
155
155
  energy_efficiency_class?: string;
156
156
  installment?: { paybackPeriod: any; monthlyInstallment: any };
157
157
 
158
- additional_image_link: string;
158
+ additional_image_link: string[];
159
159
  model: string;
160
160
  VIN: string;
161
161
  trim: string;
162
162
  year: number;
163
163
  mileage: string;
164
- vehicle_option: string;
164
+ vehicle_option: string[];
165
165
  body_style: string,
166
166
  engine: string,
167
167
  date_first_registered: string,
168
168
  fuel_consumption: string,
169
169
  energy_consumption: string,
170
170
  emissions_co2: string,
171
-
171
+ identifier_exists: string,
172
172
  ads_redirect?: string;
173
173
  "certified_pre-owned"?: boolean;
174
174
  custom_label_0?: string;
@@ -41,7 +41,7 @@ export class GoogleTransformer {
41
41
  VIN: this.transformService.vinCode(car),
42
42
  id: carId,
43
43
  image_link: transformedImages[0],
44
- additional_image_link: transformedImages.slice(1, 6).join(','),
44
+ additional_image_link: transformedImages.slice(1, 10),
45
45
  ads_redirect: this.getLink(car),
46
46
  link: this.getLink(car),
47
47
  condition: this.mapState(car),
@@ -61,6 +61,8 @@ export class GoogleTransformer {
61
61
  energy_consumption: this.getWLTP(car),
62
62
  emissions_co2: `${this.transformService.cO2Emission(car)}g/km`,
63
63
  description: (await this.getDescription(car)).substring(0, 4800),
64
+ identifier_exists: 'no',
65
+ availability: 'in_stock',
64
66
  // custom_label_0: '',
65
67
  // custom_label_1: '',
66
68
  // custom_label_2: '',
@@ -235,7 +237,7 @@ export class GoogleTransformer {
235
237
  return get(available, category);
236
238
  }
237
239
 
238
- private getExtrasField(car: DataSchemes.Car): string {
240
+ private getExtrasField(car: DataSchemes.Car): string[] {
239
241
  const booleanFields: string[] = [
240
242
  'engineData.startStopSystem',
241
243
  'window.panoramicGlassRoof',
@@ -300,8 +302,7 @@ export class GoogleTransformer {
300
302
  })
301
303
  .map((field: string) => {
302
304
  return field.substring(0, 200)
303
- })
304
- .join(', ');
305
+ });
305
306
  }
306
307
 
307
308
  private getTrim(car: DataSchemes.Car): string {