@bytebrand/export-cars 1.6.2 → 1.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/export-cars",
3
- "version": "1.6.2",
3
+ "version": "1.6.4",
4
4
  "description": "",
5
5
  "author": "bytebrand",
6
6
  "license": "UNLICENSED",
@@ -65,5 +65,5 @@
65
65
  "engines": {
66
66
  "node": ">=14.0.0"
67
67
  },
68
- "gitHead": "95ab8aaf997fbbcd4432a2a60bc42716bc9757bc"
68
+ "gitHead": "1cb44ad9125341127d75af38ebe51314f664f7af"
69
69
  }
@@ -1,4 +1,4 @@
1
- import { ExportType } from 'src/enums';
1
+ import { ExportType, FileType } from 'src/enums';
2
2
  import { Params } from '../interfaces/params.interface';
3
3
  import { Config } from './config';
4
4
 
@@ -9,5 +9,8 @@ export class EautoConfig extends Config {
9
9
  this.pathesConfig.localConvertedDirectory = `resources/${ExportType.EAUTO}-export`;
10
10
  this.imageUrl = `https://images.${this.domain}/carimage`;
11
11
  this.mappingSpreadsheetTitle = 'mobile_yescar';
12
+ this.outputFiles = [
13
+ `${this.pathesConfig.localConvertedDirectory}/416.${FileType.CSV}`
14
+ ]
12
15
  }
13
16
  }
@@ -31,6 +31,7 @@ export class RubrikkTransformer {
31
31
  images: ImboImageResponseInterface[];
32
32
  }): Promise<RubrikkXmlItem> {
33
33
  const autodeId = toString(get(car, '_id', ''));
34
+
34
35
  return {
35
36
  //Common Fields
36
37
  ad__all_imageurls: this.getImagesLinks(autodeId, images),
@@ -124,8 +125,7 @@ export class RubrikkTransformer {
124
125
  }
125
126
 
126
127
  private getCarLink(car: DataSchemes.Car): string {
127
- const autodeId = toString(get(car, '_id', ''));
128
- return `https://${this.configService.config.imageUrl}/search/vehicle/${autodeId}?source=classifieds&medium=listing&campaign=focus`;
128
+ return `https://${this.configService.config.domain}/search/vehicle/${car._id}?source=classifieds&medium=listing&campaign=focus`;
129
129
  }
130
130
 
131
131
  private getImageLink(car: DataSchemes.Car): string {
@@ -138,7 +138,7 @@ export class RubrikkTransformer {
138
138
  private getImagesLinks(carId: string, images: ImboImageResponseInterface[]): string[] {
139
139
  if (isNotEmptyArray(images)) {
140
140
  return images.map((image: ImboImageResponseInterface) => {
141
- return `https://${this.configService.config.baseImageUrl}/carimage/${carId}/${image.imageIdentifier}/large`;
141
+ return `${this.configService.config.baseImageUrl}/carimage/${carId}/${image.imageIdentifier}/large`;
142
142
  });
143
143
  }
144
144
  return [];