@bytebrand/export-cars 1.4.0 → 1.4.1

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.4.0",
3
+ "version": "1.4.1",
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": "ee77993d281cdb3769d23e52f49556f6c5f93b78"
68
+ "gitHead": "94e66fef8bd92335708c9c00a08956c13e2ec237"
69
69
  }
@@ -9,6 +9,7 @@ export class Config {
9
9
  upaUrl: string;
10
10
  imboUrl: string;
11
11
  imageUrl: string;
12
+ baseImageUrl: string;
12
13
  isNewCar: boolean;
13
14
  isCriteo: boolean;
14
15
  criteoId: number;
@@ -41,6 +42,7 @@ export class Config {
41
42
  localConvertedDirectory: 'resources/csv_dev',
42
43
  remoteDirectory: 'import_dev',
43
44
  imageUrl: 'https://images.autode-dev.de/cache_test',
45
+ baseImageUrl: 'https://images.autode-dev.de',
44
46
  },
45
47
  [Environment.DEVELOP]: {
46
48
  url: 'autode-dev.de',
@@ -48,6 +50,7 @@ export class Config {
48
50
  localConvertedDirectory: 'resources/csv_dev',
49
51
  remoteDirectory: 'import_dev',
50
52
  imageUrl: 'https://images.autode-dev.de/cache_test',
53
+ baseImageUrl: 'https://images.autode-dev.de',
51
54
  },
52
55
  [Environment.PRODUCTION]: {
53
56
  url: 'auto.de',
@@ -55,6 +58,7 @@ export class Config {
55
58
  localConvertedDirectory: 'resources/csv_prod',
56
59
  remoteDirectory: 'import',
57
60
  imageUrl: 'https://images.auto.de/generated_images',
61
+ baseImageUrl: 'https://images.auto.de',
58
62
  },
59
63
  };
60
64
 
@@ -66,6 +70,7 @@ export class Config {
66
70
  this.cpc = params.cpc;
67
71
  this.criteoId = this.environmentConfig[params.environment].criteoId;
68
72
  this.url = this.environmentConfig[params.environment].url;
73
+ this.baseImageUrl = this.environmentConfig[params.environment].baseImageUrl;
69
74
  this.mappingSpreadsheetId = '147qz9sTgs1wi13ua8YKa0IgfxAn1X_qH6LkGnAnzeyY';
70
75
  this.dealersSpreadsheetId = '1gWrcA-uRTpna1h66Mbe2Y7NA0tIhlUaQXBcS4a_UzOw';
71
76
  this.dealersSpreadsheetTitle = 'dealers_mapping';
@@ -1,8 +1,6 @@
1
1
  import { Injectable } from '@nestjs/common';
2
2
  import { Exporter } from '../interfaces/exporter.interface';
3
- import { CarService } from '../services/car.service';
4
- import { ConfigService } from '../services/config.service';
5
- import { LoaderService } from '../services/loader.service';
3
+ import { CarService, ConfigService, LoaderService } from '../services';
6
4
  import { ModuleRef } from '@nestjs/core';
7
5
  import { CronicleUtils } from '@bytebrand/cronicle-helper';
8
6
  import { ModixXmlBuilder } from '../formats';
@@ -4,7 +4,7 @@ import { GoogleXmlItem, FbXmlItem } from '../interfaces';
4
4
  export class GoogleXmlBuilder extends XMLBuilderBase {
5
5
  async buildStart(url?: string): Promise<void> {
6
6
  await this.write(
7
- `<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:g="http://base.google.com/ns/1.0"><channel><title>Auto de feed</title><link>${url}<link/>`,
7
+ `<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:g="http://base.google.com/ns/1.0"><channel><title>Auto de feed</title><link>${url}</link>`,
8
8
  );
9
9
  }
10
10
 
@@ -7,7 +7,7 @@ import { TranslatorExtended } from '@bytebrand/schema-tools';
7
7
  import { DataSchemes } from '@bytebrand/car-schema';
8
8
 
9
9
  import { RubrikkXmlItem } from '../interfaces';
10
- import { ConfigService } from '../services/config.service';
10
+ import { ConfigService } from '../services';
11
11
  import * as moment from 'moment/moment';
12
12
  import { ImboImageResponseInterface } from '@bytebrand/chunkable';
13
13
  import { isNotEmptyArray } from '../utils/validator.utils';
@@ -31,7 +31,6 @@ export class RubrikkTransformer {
31
31
  images: ImboImageResponseInterface[];
32
32
  }): Promise<RubrikkXmlItem> {
33
33
  const autodeId = toString(get(car, '_id', ''));
34
-
35
34
  return {
36
35
  //Common Fields
37
36
  ad__all_imageurls: this.getImagesLinks(autodeId, images),
@@ -132,8 +131,8 @@ export class RubrikkTransformer {
132
131
  private getImageLink(car: DataSchemes.Car): string {
133
132
  const mainImageId = get(car, 'metaData.mainImageId', '');
134
133
  return mainImageId
135
- ? `${this.configService.config.imageUrl}carimage/${car._id}/${mainImageId}/large-cached.webp`
136
- : `${this.configService.config.imageUrl}/carimage/noimage/7pNvWELuWhZX/large-cached.jpeg`;
134
+ ? `${this.configService.config.baseImageUrl}/carimage/${car._id}/${mainImageId}/large-cached.webp`
135
+ : `${this.configService.config.baseImageUrl}/carimage/noimage/7pNvWELuWhZX/large-cached.jpeg`;
137
136
  }
138
137
 
139
138
  private getImagesLinks(carId: string, images: ImboImageResponseInterface[]): string[] {