@bytebrand/export-cars 1.8.0 → 1.10.0
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/app.module.js +7 -5
- package/dist/app.module.js.map +1 -1
- package/dist/configs/alleskralle.config.js +4 -1
- package/dist/configs/alleskralle.config.js.map +1 -1
- package/dist/configs/as24.config.js +1 -0
- package/dist/configs/as24.config.js.map +1 -1
- package/dist/configs/auto24.config.js +1 -0
- package/dist/configs/auto24.config.js.map +1 -1
- package/dist/configs/autoboerse.config.js +2 -1
- package/dist/configs/autoboerse.config.js.map +1 -1
- package/dist/configs/autouncle.config.js +2 -1
- package/dist/configs/autouncle.config.js.map +1 -1
- package/dist/configs/by-owner.config.js +1 -0
- package/dist/configs/by-owner.config.js.map +1 -1
- package/dist/configs/config.d.ts +7 -1
- package/dist/configs/config.js +11 -4
- package/dist/configs/config.js.map +1 -1
- package/dist/configs/criteo.config.js +2 -1
- package/dist/configs/criteo.config.js.map +1 -1
- package/dist/configs/dasparking.config.js +2 -1
- package/dist/configs/dasparking.config.js.map +1 -1
- package/dist/configs/eauto.config.js +2 -3
- package/dist/configs/eauto.config.js.map +1 -1
- package/dist/configs/facebook-shop.config.js +1 -0
- package/dist/configs/facebook-shop.config.js.map +1 -1
- package/dist/configs/fb.config.js +2 -1
- package/dist/configs/fb.config.js.map +1 -1
- package/dist/configs/google.config.js +2 -1
- package/dist/configs/google.config.js.map +1 -1
- package/dist/configs/kleinanzeigefocus.config.js +2 -2
- package/dist/configs/kleinanzeigefocus.config.js.map +1 -1
- package/dist/configs/marktde.config.js +2 -1
- package/dist/configs/marktde.config.js.map +1 -1
- package/dist/configs/meinstadt.config.js +1 -1
- package/dist/configs/meinstadt.config.js.map +1 -1
- package/dist/configs/ooyyo.config.js +1 -0
- package/dist/configs/ooyyo.config.js.map +1 -1
- package/dist/configs/yescar.config.js +1 -0
- package/dist/configs/yescar.config.js.map +1 -1
- package/dist/constants/modix/index.d.ts +1 -0
- package/dist/constants/modix/index.js +1 -0
- package/dist/constants/modix/index.js.map +1 -1
- package/dist/enums/file-types.enum.js +0 -1
- package/dist/enums/file-types.enum.js.map +1 -1
- package/dist/enums/image-type.enum.d.ts +4 -0
- package/dist/enums/image-type.enum.js +9 -0
- package/dist/enums/image-type.enum.js.map +1 -0
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/index.js +1 -0
- package/dist/enums/index.js.map +1 -1
- package/dist/export.command.d.ts +1 -1
- package/dist/export.command.js +2 -2
- package/dist/export.command.js.map +1 -1
- package/dist/exporters/auto24.exporter.js +1 -1
- package/dist/exporters/auto24.exporter.js.map +1 -1
- package/dist/exporters/autouncle.exporter.js +0 -1
- package/dist/exporters/autouncle.exporter.js.map +1 -1
- package/dist/exporters/meinstadt.exporter.js +0 -1
- package/dist/exporters/meinstadt.exporter.js.map +1 -1
- package/dist/exporters/ooyyo.exporter.js +1 -1
- package/dist/exporters/ooyyo.exporter.js.map +1 -1
- package/dist/interfaces/export-item.interface.d.ts +5 -0
- package/dist/interfaces/params.interface.d.ts +1 -6
- package/dist/services/{marketing-images.service.d.ts → images.service.d.ts} +9 -5
- package/dist/services/images.service.js +153 -0
- package/dist/services/images.service.js.map +1 -0
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.js +1 -1
- package/dist/services/index.js.map +1 -1
- package/dist/transformers/as24.transformer.d.ts +1 -2
- package/dist/transformers/as24.transformer.js +3 -4
- package/dist/transformers/as24.transformer.js.map +1 -1
- package/dist/transformers/auto24.transfomer.d.ts +5 -6
- package/dist/transformers/auto24.transfomer.js +22 -26
- package/dist/transformers/auto24.transfomer.js.map +1 -1
- package/dist/transformers/autouncle.transformer.d.ts +5 -6
- package/dist/transformers/autouncle.transformer.js +9 -34
- package/dist/transformers/autouncle.transformer.js.map +1 -1
- package/dist/transformers/facebook-shop.transformer.d.ts +5 -4
- package/dist/transformers/facebook-shop.transformer.js +8 -11
- package/dist/transformers/facebook-shop.transformer.js.map +1 -1
- package/dist/transformers/fb.transformer.d.ts +2 -3
- package/dist/transformers/fb.transformer.js +12 -26
- package/dist/transformers/fb.transformer.js.map +1 -1
- package/dist/transformers/google.transformer.d.ts +5 -5
- package/dist/transformers/google.transformer.js +10 -26
- package/dist/transformers/google.transformer.js.map +1 -1
- package/dist/transformers/modix.transformer.js +1 -2
- package/dist/transformers/modix.transformer.js.map +1 -1
- package/dist/transformers/ooyyo.transformer.d.ts +4 -5
- package/dist/transformers/ooyyo.transformer.js +7 -17
- package/dist/transformers/ooyyo.transformer.js.map +1 -1
- package/dist/transformers/rubrikk.transformer.d.ts +4 -4
- package/dist/transformers/rubrikk.transformer.js +5 -13
- package/dist/transformers/rubrikk.transformer.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/app.module.ts +6 -12
- package/src/configs/alleskralle.config.ts +5 -2
- package/src/configs/as24.config.ts +2 -1
- package/src/configs/auto24.config.ts +3 -2
- package/src/configs/autoboerse.config.ts +3 -3
- package/src/configs/autouncle.config.ts +3 -2
- package/src/configs/by-owner.config.ts +4 -3
- package/src/configs/config.ts +8 -2
- package/src/configs/criteo.config.ts +3 -2
- package/src/configs/dasparking.config.ts +3 -2
- package/src/configs/eauto.config.ts +3 -4
- package/src/configs/facebook-shop.config.ts +2 -1
- package/src/configs/fb.config.ts +3 -2
- package/src/configs/google.config.ts +3 -2
- package/src/configs/{kleinanzeigefocus.config.ts → kleinanzeigeFocus.config.ts} +3 -3
- package/src/configs/marktde.config.ts +4 -3
- package/src/configs/meinstadt.config.ts +3 -2
- package/src/configs/ooyyo.config.ts +2 -1
- package/src/configs/yescar.config.ts +2 -1
- package/src/constants/modix/index.ts +1 -0
- package/src/enums/file-types.enum.ts +1 -1
- package/src/enums/image-type.enum.ts +4 -0
- package/src/enums/index.ts +1 -0
- package/src/export.command.ts +1 -1
- package/src/exporters/auto24.exporter.ts +2 -4
- package/src/exporters/autouncle.exporter.ts +7 -5
- package/src/exporters/meinstadt.exporter.ts +6 -4
- package/src/exporters/ooyyo.exporter.ts +3 -4
- package/src/interfaces/export-item.interface.ts +5 -0
- package/src/interfaces/params.interface.ts +1 -6
- package/src/services/images.service.ts +162 -0
- package/src/services/index.ts +1 -2
- package/src/transformers/as24.transformer.ts +2 -3
- package/src/transformers/auto24.transfomer.ts +20 -29
- package/src/transformers/autouncle.transformer.ts +11 -39
- package/src/transformers/facebook-shop.transformer.ts +7 -13
- package/src/transformers/fb.transformer.ts +24 -44
- package/src/transformers/google.transformer.ts +11 -28
- package/src/transformers/modix.transformer.ts +5 -3
- package/src/transformers/ooyyo.transformer.ts +4 -18
- package/src/transformers/rubrikk.transformer.ts +5 -16
- package/d.json +0 -1
- package/dist/services/marketing-images.service.js +0 -58
- package/dist/services/marketing-images.service.js.map +0 -1
- package/src/services/marketing-images.service.ts +0 -70
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytebrand/export-cars",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "bytebrand",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"engines": {
|
|
67
67
|
"node": ">=14.0.0"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "37593dea01bef934aa28dee2dfc50c29fad9aeef"
|
|
70
70
|
}
|
package/src/app.module.ts
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import { CacheModule, Module } from '@nestjs/common';
|
|
2
1
|
import Bottleneck from 'bottleneck';
|
|
3
2
|
|
|
3
|
+
import { CacheModule, Module } from '@nestjs/common';
|
|
4
|
+
|
|
5
|
+
import { ConfigService, RulesService, LoaderService, UserService, CarService, ImagesService } from './services';
|
|
6
|
+
import { RequestService } from './services/request.service';
|
|
7
|
+
import { MappingService } from './services/mapping.service';
|
|
4
8
|
import { InputQuestions } from './input.questions';
|
|
5
9
|
import { ExportRunner } from './export.command';
|
|
6
|
-
import {
|
|
7
|
-
ConfigService,
|
|
8
|
-
RequestService,
|
|
9
|
-
MappingService,
|
|
10
|
-
CarService,
|
|
11
|
-
UserService,
|
|
12
|
-
LoaderService,
|
|
13
|
-
RulesService,
|
|
14
|
-
MarketingImagesService
|
|
15
|
-
} from './services';
|
|
16
10
|
|
|
17
11
|
@Module({
|
|
18
12
|
imports: [
|
|
@@ -28,7 +22,7 @@ import {
|
|
|
28
22
|
UserService,
|
|
29
23
|
LoaderService,
|
|
30
24
|
RulesService,
|
|
31
|
-
|
|
25
|
+
ImagesService,
|
|
32
26
|
{
|
|
33
27
|
provide: Bottleneck,
|
|
34
28
|
useValue: new Bottleneck({ maxConcurrent: 10 }),
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { Params } from '../interfaces/params.interface';
|
|
2
2
|
import { Config } from './config';
|
|
3
|
-
import { ExportType, FileType } from '../enums';
|
|
3
|
+
import { ExportType, FileType, ImageType } from '../enums';
|
|
4
4
|
|
|
5
5
|
export class AlleskralleConfig extends Config {
|
|
6
6
|
constructor(params: Params) {
|
|
7
7
|
super(params);
|
|
8
8
|
this.campaign = ExportType.ALLESKRALLE;
|
|
9
9
|
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.ALLESKRALLE}-export`;
|
|
10
|
-
this.
|
|
10
|
+
this.imageType = ImageType.default;
|
|
11
|
+
this.outputFiles = [
|
|
12
|
+
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.ALLESKRALLE}.${FileType.XML}`,
|
|
13
|
+
];
|
|
11
14
|
}
|
|
12
15
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExportType,
|
|
1
|
+
import { ExportType, ImageType } from 'src/enums';
|
|
2
2
|
import { Params } from '../interfaces/params.interface';
|
|
3
3
|
import { Config } from './config';
|
|
4
4
|
|
|
@@ -6,6 +6,7 @@ export class As24Config extends Config {
|
|
|
6
6
|
constructor(params: Params) {
|
|
7
7
|
super(params);
|
|
8
8
|
this.campaign = ExportType.AS24;
|
|
9
|
+
this.imageType = ImageType.default;
|
|
9
10
|
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.AS24}-export`;
|
|
10
11
|
this.mappingSpreadsheetTitle = 'mobile';
|
|
11
12
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { Params } from '../interfaces/params.interface';
|
|
2
2
|
import { Config } from './config';
|
|
3
|
-
import { ExportType, FileType } from '../enums';
|
|
3
|
+
import { ExportType, FileType, ImageType } from '../enums';
|
|
4
4
|
|
|
5
5
|
export class Auto24Config extends Config {
|
|
6
6
|
constructor(params: Params) {
|
|
7
7
|
super(params);
|
|
8
8
|
this.campaign = ExportType.AUTO24;
|
|
9
|
+
this.imageType = ImageType.default;
|
|
9
10
|
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.AUTO24}-export`;
|
|
10
11
|
this.outputFiles = [
|
|
11
|
-
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.AUTO24}.${FileType.XML}`,
|
|
12
|
+
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.AUTO24}.${FileType.XML}`,
|
|
12
13
|
];
|
|
13
14
|
}
|
|
14
15
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExportType, FileType } from 'src/enums';
|
|
1
|
+
import { ExportType, FileType, ImageType } from 'src/enums';
|
|
2
2
|
import { Params } from '../interfaces/params.interface';
|
|
3
3
|
import { Config } from './config';
|
|
4
4
|
|
|
@@ -7,9 +7,9 @@ export class AutoboerseConfig extends Config {
|
|
|
7
7
|
super(params);
|
|
8
8
|
this.campaign = ExportType.AUTOBOERSE;
|
|
9
9
|
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.AUTOBOERSE}-export`;
|
|
10
|
-
|
|
10
|
+
this.imageType = ImageType.default;
|
|
11
11
|
this.outputFiles = [
|
|
12
|
-
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.AUTOBOERSE}.${FileType.XML}
|
|
12
|
+
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.AUTOBOERSE}.${FileType.XML}`,
|
|
13
13
|
];
|
|
14
14
|
this.imageUrl = this.environmentConfig[params.environment].imageUrl;
|
|
15
15
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExportType, FileType } from 'src/enums';
|
|
1
|
+
import { ExportType, FileType, ImageType } from 'src/enums';
|
|
2
2
|
import { Params } from '../interfaces/params.interface';
|
|
3
3
|
import { Config } from './config';
|
|
4
4
|
|
|
@@ -6,8 +6,9 @@ export class AutouncleConfig extends Config {
|
|
|
6
6
|
constructor(params: Params) {
|
|
7
7
|
super(params);
|
|
8
8
|
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.AUTOUNCLE}-export`;
|
|
9
|
+
this.imageType = ImageType.default;
|
|
9
10
|
this.outputFiles = [
|
|
10
|
-
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.AUTOUNCLE}.${FileType.JSON}
|
|
11
|
+
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.AUTOUNCLE}.${FileType.JSON}`,
|
|
11
12
|
];
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { ExportType } from 'src/enums';
|
|
1
|
+
import { ExportType, ImageType } from 'src/enums';
|
|
2
2
|
import { Params } from '../interfaces/params.interface';
|
|
3
3
|
import { Config } from './config';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* @deprecated
|
|
7
|
-
*/
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
8
8
|
export class ByOwnerConfig extends Config {
|
|
9
9
|
constructor(params: Params) {
|
|
10
10
|
super(params);
|
|
11
11
|
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.BY_OWNER}-export`;
|
|
12
|
+
this.imageType = ImageType.default;
|
|
12
13
|
}
|
|
13
14
|
}
|
package/src/configs/config.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { Environment } from '../enums
|
|
2
|
-
import { ExportType } from '../enums';
|
|
1
|
+
import { Environment, ExportType, ImageType } from '../enums';
|
|
3
2
|
import { Params } from '../interfaces/params.interface';
|
|
4
3
|
|
|
5
4
|
export class Config {
|
|
6
5
|
apikey: string;
|
|
7
6
|
campaign: string;
|
|
8
7
|
userActionsUrl: string;
|
|
8
|
+
marketingImageId: number;
|
|
9
9
|
upaUrl: string;
|
|
10
10
|
imboUrl: string;
|
|
11
11
|
imageUrl: string;
|
|
12
12
|
baseImageUrl: string;
|
|
13
|
+
imageType: ImageType;
|
|
14
|
+
isNewCar: boolean;
|
|
13
15
|
isCriteo: boolean;
|
|
14
16
|
criteoMarketingImagesConfigId: number;
|
|
15
17
|
exportType: ExportType;
|
|
@@ -39,6 +41,7 @@ export class Config {
|
|
|
39
41
|
remoteDirectory: 'import_dev',
|
|
40
42
|
imageUrl: 'https://images.autode-dev.de/cache_test',
|
|
41
43
|
baseImageUrl: 'https://images.autode-dev.de',
|
|
44
|
+
marketingImageId: 8,
|
|
42
45
|
},
|
|
43
46
|
[Environment.DEVELOP]: {
|
|
44
47
|
domain: 'autode-dev.de',
|
|
@@ -47,6 +50,7 @@ export class Config {
|
|
|
47
50
|
remoteDirectory: 'import_dev',
|
|
48
51
|
imageUrl: 'https://images.autode-dev.de/cache_test',
|
|
49
52
|
baseImageUrl: 'https://images.autode-dev.de',
|
|
53
|
+
marketingImageId: 8,
|
|
50
54
|
},
|
|
51
55
|
[Environment.PRODUCTION]: {
|
|
52
56
|
domain: 'auto.de',
|
|
@@ -55,6 +59,7 @@ export class Config {
|
|
|
55
59
|
remoteDirectory: 'import',
|
|
56
60
|
imageUrl: 'https://images.auto.de/generated_images',
|
|
57
61
|
baseImageUrl: 'https://images.auto.de',
|
|
62
|
+
marketingImageId: 1,
|
|
58
63
|
},
|
|
59
64
|
};
|
|
60
65
|
|
|
@@ -64,6 +69,7 @@ export class Config {
|
|
|
64
69
|
this.cpc = params.cpc;
|
|
65
70
|
this.criteoMarketingImagesConfigId = this.environmentConfig[params.environment].criteoMarketingImagesConfigId;
|
|
66
71
|
this.domain = this.environmentConfig[params.environment].domain;
|
|
72
|
+
this.marketingImageId = this.environmentConfig[params.environment].marketingImageId;
|
|
67
73
|
this.baseImageUrl = this.environmentConfig[params.environment].baseImageUrl;
|
|
68
74
|
this.mappingSpreadsheetId = '147qz9sTgs1wi13ua8YKa0IgfxAn1X_qH6LkGnAnzeyY';
|
|
69
75
|
this.dealersSpreadsheetId = '1gWrcA-uRTpna1h66Mbe2Y7NA0tIhlUaQXBcS4a_UzOw';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExportType, FileType } from 'src/enums';
|
|
1
|
+
import { ExportType, FileType, ImageType } from 'src/enums';
|
|
2
2
|
import { Params } from '../interfaces/params.interface';
|
|
3
3
|
import { Config } from './config';
|
|
4
4
|
|
|
@@ -7,8 +7,9 @@ export class CriteoConfig extends Config {
|
|
|
7
7
|
super(params);
|
|
8
8
|
this.campaign = ExportType.CRITEO;
|
|
9
9
|
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.CRITEO}-export`;
|
|
10
|
+
this.imageType = ImageType.marketing;
|
|
10
11
|
this.outputFiles = [
|
|
11
|
-
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.CRITEO}.${FileType.XML}
|
|
12
|
+
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.CRITEO}.${FileType.XML}`,
|
|
12
13
|
];
|
|
13
14
|
this.isCriteo = true;
|
|
14
15
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { Params } from '../interfaces/params.interface';
|
|
2
2
|
import { Config } from './config';
|
|
3
|
-
import { ExportType, FileType } from '../enums';
|
|
3
|
+
import { ExportType, FileType, ImageType } from '../enums';
|
|
4
4
|
|
|
5
5
|
export class DasparkingConfig extends Config {
|
|
6
6
|
constructor(params: Params) {
|
|
7
7
|
super(params);
|
|
8
8
|
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.DASPARKING}-export`;
|
|
9
9
|
this.campaign = ExportType.DASPARKING;
|
|
10
|
+
this.imageType = ImageType.default;
|
|
10
11
|
this.outputFiles = [
|
|
11
|
-
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.DASPARKING}.${FileType.XML}
|
|
12
|
+
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.DASPARKING}.${FileType.XML}`,
|
|
12
13
|
];
|
|
13
14
|
}
|
|
14
15
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExportType, FileType } from 'src/enums';
|
|
1
|
+
import { ExportType, FileType, ImageType } from 'src/enums';
|
|
2
2
|
import { Params } from '../interfaces/params.interface';
|
|
3
3
|
import { Config } from './config';
|
|
4
4
|
|
|
@@ -9,8 +9,7 @@ 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.
|
|
13
|
-
|
|
14
|
-
]
|
|
12
|
+
this.imageType = ImageType.default;
|
|
13
|
+
this.outputFiles = [`${this.pathesConfig.localConvertedDirectory}/416.${FileType.CSV}`];
|
|
15
14
|
}
|
|
16
15
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Params } from '../interfaces/params.interface';
|
|
2
2
|
import { Config } from './config';
|
|
3
|
-
import { ExportType, FileType } from '../enums';
|
|
3
|
+
import { ExportType, FileType, ImageType } from '../enums';
|
|
4
4
|
|
|
5
5
|
export class FacebookShopConfig extends Config {
|
|
6
6
|
constructor(params: Params) {
|
|
7
7
|
super(params);
|
|
8
8
|
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.FACEBOOK_SHOP}-export`;
|
|
9
9
|
this.imageUrl = this.environmentConfig[params.environment].baseImageUrl;
|
|
10
|
+
this.imageType = ImageType.marketing;
|
|
10
11
|
this.outputFiles = [
|
|
11
12
|
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.FACEBOOK_SHOP}.${FileType.XML}`,
|
|
12
13
|
];
|
package/src/configs/fb.config.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExportType, FileType } from 'src/enums';
|
|
1
|
+
import { ExportType, FileType, ImageType } from 'src/enums';
|
|
2
2
|
import { Params } from '../interfaces/params.interface';
|
|
3
3
|
import { Config } from './config';
|
|
4
4
|
|
|
@@ -7,8 +7,9 @@ export class FbConfig extends Config {
|
|
|
7
7
|
super(params);
|
|
8
8
|
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.FB}-export`;
|
|
9
9
|
this.imageUrl = this.environmentConfig[params.environment].imageUrl;
|
|
10
|
+
this.imageType = ImageType.marketing;
|
|
10
11
|
this.outputFiles = [
|
|
11
|
-
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.FB}.${FileType.XML}
|
|
12
|
+
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.FB}.${FileType.XML}`,
|
|
12
13
|
];
|
|
13
14
|
}
|
|
14
15
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExportType, FileType } from 'src/enums';
|
|
1
|
+
import { ExportType, FileType, ImageType } from 'src/enums';
|
|
2
2
|
import { Params } from '../interfaces/params.interface';
|
|
3
3
|
import { Config } from './config';
|
|
4
4
|
|
|
@@ -6,8 +6,9 @@ export class GoogleConfig extends Config {
|
|
|
6
6
|
constructor(params: Params) {
|
|
7
7
|
super(params);
|
|
8
8
|
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.GOOGLE}-export`;
|
|
9
|
+
this.imageType = ImageType.default;
|
|
9
10
|
this.outputFiles = [
|
|
10
|
-
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.GOOGLE}.${FileType.XML}
|
|
11
|
+
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.GOOGLE}.${FileType.XML}`,
|
|
11
12
|
];
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Params } from '../interfaces/params.interface';
|
|
2
2
|
import { Config } from './config';
|
|
3
|
-
import { ExportType, FileType } from '../enums';
|
|
3
|
+
import { ExportType, FileType, ImageType } from '../enums';
|
|
4
4
|
|
|
5
5
|
export class KleinanzeigeFocusConfig extends Config {
|
|
6
6
|
constructor(params: Params) {
|
|
7
7
|
super(params);
|
|
8
8
|
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.KLEINANZEIGE_FOCUS}-export`;
|
|
9
|
-
this.
|
|
9
|
+
this.imageType = ImageType.default;
|
|
10
10
|
this.outputFiles = [
|
|
11
|
-
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.KLEINANZEIGE_FOCUS}.${FileType.XML}
|
|
11
|
+
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.KLEINANZEIGE_FOCUS}.${FileType.XML}`,
|
|
12
12
|
];
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExportType, FileType } from 'src/enums';
|
|
1
|
+
import { ExportType, FileType, ImageType } from 'src/enums';
|
|
2
2
|
import { Params } from '../interfaces/params.interface';
|
|
3
3
|
import { Config } from './config';
|
|
4
4
|
|
|
@@ -9,9 +9,10 @@ export class MarktdeConfig extends Config {
|
|
|
9
9
|
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.MARKTDE}-export`;
|
|
10
10
|
this.imageUrl = `https://images.${this.domain}/carimage`;
|
|
11
11
|
this.mappingSpreadsheetTitle = 'mobile_yescar';
|
|
12
|
+
this.imageType = ImageType.default;
|
|
12
13
|
this.outputFiles = [
|
|
13
14
|
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.MARKTDE}.${FileType.CSV}`,
|
|
14
|
-
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.MARKTDE}.${FileType.ZIP}
|
|
15
|
-
]
|
|
15
|
+
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.MARKTDE}.${FileType.ZIP}`,
|
|
16
|
+
];
|
|
16
17
|
}
|
|
17
18
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Params } from '../interfaces/params.interface';
|
|
2
2
|
import { Config } from './config';
|
|
3
|
-
import { ExportType, FileType } from '../enums';
|
|
3
|
+
import { ExportType, FileType, ImageType } from '../enums';
|
|
4
4
|
|
|
5
5
|
export class MeinstadtConfig extends Config {
|
|
6
6
|
constructor(params: Params) {
|
|
7
7
|
super(params);
|
|
8
|
-
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.MEINSTADT}-export
|
|
8
|
+
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.MEINSTADT}-export`;
|
|
9
|
+
this.imageType = ImageType.default;
|
|
9
10
|
this.outputFiles = [
|
|
10
11
|
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.MEINSTADT}.${FileType.JSON}`,
|
|
11
12
|
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.MEINSTADT}.${FileType.ZIP}`,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Params } from '../interfaces/params.interface';
|
|
2
2
|
import { Config } from './config';
|
|
3
|
-
import { ExportType, FileType } from '../enums';
|
|
3
|
+
import { ExportType, FileType, ImageType } from '../enums';
|
|
4
4
|
|
|
5
5
|
export class OoyyoConfig extends Config {
|
|
6
6
|
constructor(params: Params) {
|
|
7
7
|
super(params);
|
|
8
8
|
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.OOYYO}-export`;
|
|
9
|
+
this.imageType = ImageType.default;
|
|
9
10
|
this.outputFiles = [
|
|
10
11
|
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.OOYYO}.${FileType.XML}`,
|
|
11
12
|
`${this.pathesConfig.localConvertedDirectory}/autode-${ExportType.OOYYO}.${FileType.TAR_GZ}`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExportType } from 'src/enums';
|
|
1
|
+
import { ExportType, ImageType } from 'src/enums';
|
|
2
2
|
import { Params } from '../interfaces/params.interface';
|
|
3
3
|
import { Config } from './config';
|
|
4
4
|
|
|
@@ -12,5 +12,6 @@ export class YescarConfig extends Config {
|
|
|
12
12
|
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.YESCAR}-export`;
|
|
13
13
|
this.imageUrl = `https://images.${this.domain}/carimage`;
|
|
14
14
|
this.mappingSpreadsheetTitle = 'mobile_yescar';
|
|
15
|
+
this.imageType = ImageType.default;
|
|
15
16
|
}
|
|
16
17
|
}
|
package/src/enums/index.ts
CHANGED
package/src/export.command.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createInterface } from 'readline';
|
|
2
2
|
import { Command, CommandRunner, InquirerService } from 'nest-commander';
|
|
3
|
-
import { ConfigService } from './services
|
|
3
|
+
import { ConfigService } from './services';
|
|
4
4
|
import { Input } from './interfaces/input.interface';
|
|
5
5
|
import { exportSchema } from './export.schema';
|
|
6
6
|
import { ModuleRef } from '@nestjs/core';
|
|
@@ -3,7 +3,6 @@ import { ModuleRef } from '@nestjs/core';
|
|
|
3
3
|
|
|
4
4
|
import { CronicleUtils } from '@bytebrand/cronicle-helper';
|
|
5
5
|
import { FsChunkInterface } from '@bytebrand/chunkable';
|
|
6
|
-
import { Zipper } from '@bytebrand/zipper';
|
|
7
6
|
|
|
8
7
|
import { CarService, RulesService, ConfigService, LoaderService } from '../services';
|
|
9
8
|
import { Auto24Transformer } from '../transformers/auto24.transfomer';
|
|
@@ -18,7 +17,7 @@ export class Auto24Exporter implements Exporter {
|
|
|
18
17
|
private loaderService: LoaderService,
|
|
19
18
|
private moduleRef: ModuleRef,
|
|
20
19
|
private rulesService: RulesService,
|
|
21
|
-
) {
|
|
20
|
+
) {}
|
|
22
21
|
|
|
23
22
|
async export(): Promise<void> {
|
|
24
23
|
const [fileXml] = this.configService.config.outputFiles;
|
|
@@ -37,10 +36,9 @@ export class Auto24Exporter implements Exporter {
|
|
|
37
36
|
for (let i = 0; i < chunk.data.length; i += 1) {
|
|
38
37
|
const data = chunk.data[i];
|
|
39
38
|
const { car, images } = data;
|
|
40
|
-
await xmlBuilder.addItem(auto24Transformer.transform(car, images), 'Deutschland');
|
|
39
|
+
await xmlBuilder.addItem(await auto24Transformer.transform(car, images), 'Deutschland');
|
|
41
40
|
this.carService.counter.countCar(images);
|
|
42
41
|
}
|
|
43
|
-
|
|
44
42
|
}
|
|
45
43
|
});
|
|
46
44
|
|
|
@@ -19,7 +19,7 @@ export class AutouncleExporter implements Exporter {
|
|
|
19
19
|
private loaderService: LoaderService,
|
|
20
20
|
private rulesService: RulesService,
|
|
21
21
|
private moduleRef: ModuleRef,
|
|
22
|
-
) {
|
|
22
|
+
) {}
|
|
23
23
|
|
|
24
24
|
async export(): Promise<void> {
|
|
25
25
|
const [fileName] = this.configService.config.outputFiles;
|
|
@@ -28,12 +28,12 @@ export class AutouncleExporter implements Exporter {
|
|
|
28
28
|
|
|
29
29
|
const autouncleJsonBuilder = new AutouncleJsonBuilder(fileName);
|
|
30
30
|
await autouncleJsonBuilder.buildStart();
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
const autouncleTransformer = await this.moduleRef.create(AutouncleTransformer);
|
|
33
33
|
|
|
34
34
|
let firstCar = true;
|
|
35
35
|
await this.loaderService.process(async (chunk: FsChunkInterface) => {
|
|
36
|
-
chunk.data = chunk.data.filter(e => this.carService.filterCar(e, this.rulesService.rules));
|
|
36
|
+
// chunk.data = chunk.data.filter(e => this.carService.filterCar(e, this.rulesService.rules));
|
|
37
37
|
|
|
38
38
|
for (const data of chunk.data) {
|
|
39
39
|
const ownerId = get(data.car, 'metaData.ownerId');
|
|
@@ -43,8 +43,10 @@ export class AutouncleExporter implements Exporter {
|
|
|
43
43
|
await autouncleJsonBuilder.addItem(car, firstCar);
|
|
44
44
|
|
|
45
45
|
this.carService.counter.countCar(data.images);
|
|
46
|
-
|
|
47
|
-
if (firstCar) {
|
|
46
|
+
|
|
47
|
+
if (firstCar) {
|
|
48
|
+
firstCar = false;
|
|
49
|
+
}
|
|
48
50
|
}
|
|
49
51
|
});
|
|
50
52
|
|
|
@@ -8,7 +8,7 @@ import { Zipper } from '@bytebrand/zipper';
|
|
|
8
8
|
import { CarService, RulesService, LoaderService, ConfigService } from '../services';
|
|
9
9
|
import { MeinstadtTransformer } from '../transformers/meinstadt.transformer';
|
|
10
10
|
import { MeinstadtJsonBuilder } from '../formats/meinstadt-json.builder';
|
|
11
|
-
import { MeinstadtJsonItem } from '../interfaces
|
|
11
|
+
import { MeinstadtJsonItem } from '../interfaces';
|
|
12
12
|
import { Exporter } from '../interfaces/exporter.interface';
|
|
13
13
|
|
|
14
14
|
@Injectable()
|
|
@@ -19,7 +19,7 @@ export class MeinstadtExporter implements Exporter {
|
|
|
19
19
|
private rulesService: RulesService,
|
|
20
20
|
private loaderService: LoaderService,
|
|
21
21
|
private moduleRef: ModuleRef,
|
|
22
|
-
) {
|
|
22
|
+
) {}
|
|
23
23
|
|
|
24
24
|
async export(): Promise<void> {
|
|
25
25
|
const [fileJson, fileGZ] = this.configService.config.outputFiles;
|
|
@@ -33,14 +33,16 @@ export class MeinstadtExporter implements Exporter {
|
|
|
33
33
|
|
|
34
34
|
let firstCar = true;
|
|
35
35
|
await this.loaderService.process(async (chunk: FsChunkInterface) => {
|
|
36
|
-
chunk.data = chunk.data.filter(e => this.carService.filterCar(e, this.rulesService.rules));
|
|
36
|
+
// chunk.data = chunk.data.filter(e => this.carService.filterCar(e, this.rulesService.rules));
|
|
37
37
|
|
|
38
38
|
for (const data of chunk.data) {
|
|
39
39
|
const car = await meinstadtTransformer.transform({ ...data });
|
|
40
40
|
await meinstadtJsonBuilder.addItem(car as MeinstadtJsonItem, firstCar);
|
|
41
41
|
this.carService.counter.countCar(data.images);
|
|
42
42
|
|
|
43
|
-
if (firstCar) {
|
|
43
|
+
if (firstCar) {
|
|
44
|
+
firstCar = false;
|
|
45
|
+
}
|
|
44
46
|
}
|
|
45
47
|
});
|
|
46
48
|
|
|
@@ -16,13 +16,13 @@ export class OoyyoExporter implements Exporter {
|
|
|
16
16
|
private loaderService: LoaderService,
|
|
17
17
|
private moduleRef: ModuleRef,
|
|
18
18
|
private rulesService: RulesService,
|
|
19
|
-
) {
|
|
19
|
+
) {}
|
|
20
20
|
|
|
21
21
|
async export(): Promise<void> {
|
|
22
22
|
const [fileXml, fileGZ] = this.configService.config.outputFiles;
|
|
23
23
|
await CronicleUtils.ensureDir(this.configService.config.pathesConfig.localConvertedDirectory);
|
|
24
24
|
await CronicleUtils.emptyDir(this.configService.config.pathesConfig.localConvertedDirectory);
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
const ooyyoXmlBuilder = new OoyyoXmlBuilder(fileXml);
|
|
27
27
|
await ooyyoXmlBuilder.buildStart();
|
|
28
28
|
|
|
@@ -35,11 +35,10 @@ export class OoyyoExporter implements Exporter {
|
|
|
35
35
|
for (let i = 0; i < chunk.data.length; i += 1) {
|
|
36
36
|
const data = chunk.data[i];
|
|
37
37
|
const { car, images } = data;
|
|
38
|
-
await ooyyoXmlBuilder.addItem(ooyyoTransformer.transform(car, images));
|
|
38
|
+
await ooyyoXmlBuilder.addItem(await ooyyoTransformer.transform(car, images));
|
|
39
39
|
|
|
40
40
|
this.carService.counter.countCar(images);
|
|
41
41
|
}
|
|
42
|
-
|
|
43
42
|
}
|
|
44
43
|
});
|
|
45
44
|
|
|
@@ -56,6 +56,11 @@ export interface Auto24XmlItem {
|
|
|
56
56
|
companyname: string;
|
|
57
57
|
extras: string;
|
|
58
58
|
sellertype: string;
|
|
59
|
+
condition: string;
|
|
60
|
+
dealer_homepage_url: string;
|
|
61
|
+
dealer_email: string;
|
|
62
|
+
dealer_name: string;
|
|
63
|
+
dealer_phone: string;
|
|
59
64
|
}
|
|
60
65
|
|
|
61
66
|
export interface OoyyoXmlItem extends FbXmlItem {
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Environment, ExportType } from '../enums';
|
|
2
2
|
|
|
3
3
|
export interface Params {
|
|
4
4
|
environment: Environment;
|
|
5
|
-
carDetailsUrl?: string;
|
|
6
5
|
exportType?: ExportType;
|
|
7
6
|
apikey?: string;
|
|
8
7
|
String?: string;
|
|
9
8
|
Number?: string;
|
|
10
9
|
Date?: string;
|
|
11
10
|
isNewCar?: boolean;
|
|
12
|
-
isCriteo?: boolean;
|
|
13
|
-
dealers?: string;
|
|
14
11
|
cpc?: string;
|
|
15
12
|
ownerId?: string;
|
|
16
|
-
fileName?: string;
|
|
17
|
-
googleSheetsApiKey?: string;
|
|
18
13
|
}
|