@bytebrand/export-cars 1.5.2 → 1.6.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/dist/{config → configs}/alleskralle.config.js +3 -5
- package/dist/configs/alleskralle.config.js.map +1 -0
- package/dist/{config → configs}/as24.config.js +3 -1
- package/dist/configs/as24.config.js.map +1 -0
- package/dist/{config → configs}/auto24.config.js +3 -3
- package/dist/configs/auto24.config.js.map +1 -0
- package/dist/configs/autoboerse.config.js +16 -0
- package/dist/configs/autoboerse.config.js.map +1 -0
- package/dist/{config → configs}/autouncle.config.js +3 -2
- package/dist/configs/autouncle.config.js.map +1 -0
- package/dist/{config → configs}/by-owner.config.js +2 -2
- package/dist/configs/by-owner.config.js.map +1 -0
- package/dist/{config → configs}/config.d.ts +8 -12
- package/dist/{config → configs}/config.js +14 -20
- package/dist/configs/config.js.map +1 -0
- package/dist/configs/criteo.config.js +16 -0
- package/dist/configs/criteo.config.js.map +1 -0
- package/dist/{config → configs}/dasparking.config.js +3 -5
- package/dist/configs/dasparking.config.js.map +1 -0
- package/dist/{config → configs}/eauto.config.js +4 -3
- package/dist/configs/eauto.config.js.map +1 -0
- package/dist/{config → configs}/fb.config.js +3 -2
- package/dist/configs/fb.config.js.map +1 -0
- package/dist/{config → configs}/google.config.js +3 -2
- package/dist/configs/google.config.js.map +1 -0
- package/dist/configs/index.d.ts +16 -0
- package/dist/configs/index.js +33 -0
- package/dist/configs/index.js.map +1 -0
- package/dist/{config/kleinanzeigeFocus.config.js → configs/kleinanzeigefocus.config.js} +3 -4
- package/dist/configs/kleinanzeigefocus.config.js.map +1 -0
- package/dist/{config → configs}/marktde.config.js +4 -3
- package/dist/configs/marktde.config.js.map +1 -0
- package/dist/{config → configs}/meinstadt.config.js +4 -4
- package/dist/configs/meinstadt.config.js.map +1 -0
- package/dist/{config → configs}/ooyyo.config.js +3 -4
- package/dist/configs/ooyyo.config.js.map +1 -0
- package/dist/{config → configs}/yescar.config.js +4 -3
- package/dist/configs/yescar.config.js.map +1 -0
- package/dist/enums/export-type.enum.d.ts +0 -1
- package/dist/enums/export-type.enum.js +0 -1
- package/dist/enums/export-type.enum.js.map +1 -1
- package/dist/enums/file-types.enum.d.ts +7 -7
- package/dist/enums/file-types.enum.js +11 -10
- package/dist/enums/file-types.enum.js.map +1 -1
- package/dist/export.schema.d.ts +4 -33
- package/dist/export.schema.js +32 -61
- package/dist/export.schema.js.map +1 -1
- package/dist/exporters/as24.exporter.d.ts +3 -5
- package/dist/exporters/as24.exporter.js +20 -22
- package/dist/exporters/as24.exporter.js.map +1 -1
- package/dist/exporters/auto24.exporter.d.ts +1 -1
- package/dist/exporters/auto24.exporter.js +8 -17
- package/dist/exporters/auto24.exporter.js.map +1 -1
- package/dist/exporters/autouncle.exporter.d.ts +3 -5
- package/dist/exporters/autouncle.exporter.js +19 -35
- package/dist/exporters/autouncle.exporter.js.map +1 -1
- package/dist/exporters/by-owner.exporter.d.ts +2 -3
- package/dist/exporters/by-owner.exporter.js +4 -7
- package/dist/exporters/by-owner.exporter.js.map +1 -1
- package/dist/exporters/fb.exporter.d.ts +2 -3
- package/dist/exporters/fb.exporter.js +10 -16
- package/dist/exporters/fb.exporter.js.map +1 -1
- package/dist/exporters/google.exporter.d.ts +3 -4
- package/dist/exporters/google.exporter.js +13 -19
- package/dist/exporters/google.exporter.js.map +1 -1
- package/dist/exporters/index.d.ts +10 -1
- package/dist/exporters/index.js +10 -1
- package/dist/exporters/index.js.map +1 -1
- package/dist/exporters/meinstadt.exporter.d.ts +1 -1
- package/dist/exporters/meinstadt.exporter.js +18 -34
- package/dist/exporters/meinstadt.exporter.js.map +1 -1
- package/dist/exporters/mobile.exporter.d.ts +2 -5
- package/dist/exporters/mobile.exporter.js +14 -44
- package/dist/exporters/mobile.exporter.js.map +1 -1
- package/dist/exporters/modix.exporter.d.ts +2 -2
- package/dist/exporters/modix.exporter.js +7 -11
- package/dist/exporters/modix.exporter.js.map +1 -1
- package/dist/exporters/ooyyo.exporter.js +6 -9
- package/dist/exporters/ooyyo.exporter.js.map +1 -1
- package/dist/exporters/rubrikk.exporter.js +8 -14
- package/dist/exporters/rubrikk.exporter.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/services/car.service.js +1 -4
- package/dist/services/car.service.js.map +1 -1
- package/dist/services/config.service.d.ts +1 -1
- package/dist/services/user.service.d.ts +0 -2
- package/dist/services/user.service.js +0 -3
- package/dist/services/user.service.js.map +1 -1
- package/dist/transformers/as24.transformer.d.ts +4 -2
- package/dist/transformers/as24.transformer.js +25 -3
- package/dist/transformers/as24.transformer.js.map +1 -1
- package/dist/transformers/auto24.transfomer.js +1 -1
- package/dist/transformers/auto24.transfomer.js.map +1 -1
- package/dist/transformers/autouncle.transformer.js +1 -1
- package/dist/transformers/autouncle.transformer.js.map +1 -1
- package/dist/transformers/fb.transformer.js +2 -2
- package/dist/transformers/fb.transformer.js.map +1 -1
- package/dist/transformers/google.transformer.js +3 -3
- package/dist/transformers/google.transformer.js.map +1 -1
- package/dist/transformers/meinstadt.transformer.js +1 -1
- package/dist/transformers/meinstadt.transformer.js.map +1 -1
- package/dist/transformers/mobile.transformer.js +1 -1
- package/dist/transformers/mobile.transformer.js.map +1 -1
- package/dist/transformers/modix.transformer.d.ts +1 -3
- package/dist/transformers/modix.transformer.js +4 -12
- package/dist/transformers/modix.transformer.js.map +1 -1
- package/dist/transformers/ooyyo.transformer.js +2 -2
- package/dist/transformers/ooyyo.transformer.js.map +1 -1
- package/dist/transformers/rubrikk.transformer.js +1 -1
- package/dist/transformers/rubrikk.transformer.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/src/configs/alleskralle.config.ts +12 -0
- package/src/{config → configs}/as24.config.ts +3 -1
- package/src/configs/auto24.config.ts +12 -0
- package/src/configs/autoboerse.config.ts +13 -0
- package/src/configs/autouncle.config.ts +11 -0
- package/src/configs/by-owner.config.ts +13 -0
- package/src/{config → configs}/config.ts +14 -21
- package/src/configs/criteo.config.ts +13 -0
- package/src/configs/dasparking.config.ts +12 -0
- package/src/{config → configs}/eauto.config.ts +4 -3
- package/src/{config → configs}/fb.config.ts +3 -2
- package/src/configs/google.config.ts +11 -0
- package/src/configs/index.ts +16 -0
- package/src/{config → configs}/kleinanzeigeFocus.config.ts +3 -4
- package/src/{config → configs}/marktde.config.ts +4 -3
- package/src/configs/meinstadt.config.ts +14 -0
- package/src/configs/ooyyo.config.ts +14 -0
- package/src/configs/yescar.config.ts +16 -0
- package/src/enums/export-type.enum.ts +12 -1
- package/src/enums/file-types.enum.ts +8 -8
- package/src/export.schema.ts +35 -33
- package/src/exporters/as24.exporter.ts +27 -30
- package/src/exporters/auto24.exporter.ts +15 -23
- package/src/exporters/autouncle.exporter.ts +27 -38
- package/src/exporters/by-owner.exporter.ts +7 -5
- package/src/exporters/fb.exporter.ts +11 -13
- package/src/exporters/google.exporter.ts +16 -17
- package/src/exporters/index.ts +10 -1
- package/src/exporters/meinstadt.exporter.ts +24 -41
- package/src/exporters/mobile.exporter.ts +21 -63
- package/src/exporters/modix.exporter.ts +15 -14
- package/src/exporters/ooyyo.exporter.ts +10 -11
- package/src/exporters/rubrikk.exporter.ts +11 -16
- package/src/main.ts +1 -1
- package/src/services/car.service.ts +3 -5
- package/src/services/config.service.ts +1 -1
- package/src/services/user.service.ts +1 -5
- package/src/transformers/as24.transformer.ts +29 -5
- package/src/transformers/auto24.transfomer.ts +1 -1
- package/src/transformers/autouncle.transformer.ts +1 -1
- package/src/transformers/fb.transformer.ts +2 -2
- package/src/transformers/google.transformer.ts +3 -3
- package/src/transformers/meinstadt.transformer.ts +1 -1
- package/src/transformers/mobile.transformer.ts +1 -1
- package/src/transformers/modix.transformer.ts +8 -17
- package/src/transformers/ooyyo.transformer.ts +2 -2
- package/src/transformers/rubrikk.transformer.ts +1 -1
- package/tsconfig.json +5 -3
- package/dist/config/alleskralle.config.js.map +0 -1
- package/dist/config/as24.config.js.map +0 -1
- package/dist/config/auto24.config.js.map +0 -1
- package/dist/config/autoboerse.config.js +0 -16
- package/dist/config/autoboerse.config.js.map +0 -1
- package/dist/config/autoborse.config.d.ts +0 -5
- package/dist/config/autoborse.config.js +0 -15
- package/dist/config/autoborse.config.js.map +0 -1
- package/dist/config/autouncle.config.js.map +0 -1
- package/dist/config/by-owner.config.js.map +0 -1
- package/dist/config/config.js.map +0 -1
- package/dist/config/criteo.config.js +0 -14
- package/dist/config/criteo.config.js.map +0 -1
- package/dist/config/dasparking.config.js.map +0 -1
- package/dist/config/eauto.config.js.map +0 -1
- package/dist/config/fb.config.js.map +0 -1
- package/dist/config/google.config.js.map +0 -1
- package/dist/config/index.d.ts +0 -1
- package/dist/config/index.js +0 -18
- package/dist/config/index.js.map +0 -1
- package/dist/config/kleinanzeigeFocus.config.js.map +0 -1
- package/dist/config/marktde.config.js.map +0 -1
- package/dist/config/meinstadt.config.js.map +0 -1
- package/dist/config/ooyyo.config.js.map +0 -1
- package/dist/config/yescar.config.js.map +0 -1
- package/src/config/alleskralle.config.ts +0 -14
- package/src/config/auto24.config.ts +0 -12
- package/src/config/autoboerse.config.ts +0 -13
- package/src/config/autoborse.config.ts +0 -12
- package/src/config/autouncle.config.ts +0 -10
- package/src/config/by-owner.config.ts +0 -10
- package/src/config/criteo.config.ts +0 -11
- package/src/config/dasparking.config.ts +0 -14
- package/src/config/google.config.ts +0 -10
- package/src/config/index.ts +0 -1
- package/src/config/meinstadt.config.ts +0 -15
- package/src/config/ooyyo.config.ts +0 -15
- package/src/config/yescar.config.ts +0 -12
- /package/dist/{config → configs}/alleskralle.config.d.ts +0 -0
- /package/dist/{config → configs}/as24.config.d.ts +0 -0
- /package/dist/{config → configs}/auto24.config.d.ts +0 -0
- /package/dist/{config → configs}/autoboerse.config.d.ts +0 -0
- /package/dist/{config → configs}/autouncle.config.d.ts +0 -0
- /package/dist/{config → configs}/by-owner.config.d.ts +0 -0
- /package/dist/{config → configs}/criteo.config.d.ts +0 -0
- /package/dist/{config → configs}/dasparking.config.d.ts +0 -0
- /package/dist/{config → configs}/eauto.config.d.ts +0 -0
- /package/dist/{config → configs}/fb.config.d.ts +0 -0
- /package/dist/{config → configs}/google.config.d.ts +0 -0
- /package/dist/{config/kleinanzeigeFocus.config.d.ts → configs/kleinanzeigefocus.config.d.ts} +0 -0
- /package/dist/{config → configs}/marktde.config.d.ts +0 -0
- /package/dist/{config → configs}/meinstadt.config.d.ts +0 -0
- /package/dist/{config → configs}/ooyyo.config.d.ts +0 -0
- /package/dist/{config → configs}/yescar.config.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytebrand/export-cars",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "bytebrand",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
"start:dev": "nest start --watch"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@bytebrand/autode-request": "^1.
|
|
19
|
-
"@bytebrand/car-basic-data-scope": "
|
|
20
|
-
"@bytebrand/car-description": "^1.
|
|
18
|
+
"@bytebrand/autode-request": "^1.9.0",
|
|
19
|
+
"@bytebrand/car-basic-data-scope": "^9.8.23",
|
|
20
|
+
"@bytebrand/car-description": "^1.7.23",
|
|
21
21
|
"@bytebrand/car-schema": "^3.12.24",
|
|
22
|
-
"@bytebrand/chunkable": "^5.
|
|
23
|
-
"@bytebrand/cronicle-helper": "^1.
|
|
24
|
-
"@bytebrand/fe-financing": "^5.3
|
|
25
|
-
"@bytebrand/i18n-dictionaries": "
|
|
26
|
-
"@bytebrand/schema-tools": "
|
|
27
|
-
"@bytebrand/zipper": "^2.1.
|
|
22
|
+
"@bytebrand/chunkable": "^5.13.1",
|
|
23
|
+
"@bytebrand/cronicle-helper": "^1.15.0",
|
|
24
|
+
"@bytebrand/fe-financing": "^5.4.3",
|
|
25
|
+
"@bytebrand/i18n-dictionaries": "^1.4.1",
|
|
26
|
+
"@bytebrand/schema-tools": "^3.13.23",
|
|
27
|
+
"@bytebrand/zipper": "^2.1.1",
|
|
28
28
|
"@nestjs/axios": "^0.1.0",
|
|
29
29
|
"@nestjs/common": "^9.0.0",
|
|
30
30
|
"@nestjs/core": "^9.0.0",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"engines": {
|
|
66
66
|
"node": ">=14.0.0"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "4a0ed79c501346cef400dec5595283cdde7d1c93"
|
|
69
69
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Params } from '../interfaces/params.interface';
|
|
2
|
+
import { Config } from './config';
|
|
3
|
+
import { ExportType, FileType } from '../enums';
|
|
4
|
+
|
|
5
|
+
export class AlleskralleConfig extends Config {
|
|
6
|
+
constructor(params: Params) {
|
|
7
|
+
super(params);
|
|
8
|
+
this.campaign = ExportType.ALLESKRALLE;
|
|
9
|
+
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.ALLESKRALLE}-export`;
|
|
10
|
+
this.outputFiles = [`api_export_cars_${ExportType.ALLESKRALLE}.${FileType.XML}`];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { ExportType, FileType } from 'src/enums';
|
|
1
2
|
import { Params } from '../interfaces/params.interface';
|
|
2
3
|
import { Config } from './config';
|
|
3
4
|
|
|
4
5
|
export class As24Config extends Config {
|
|
5
6
|
constructor(params: Params) {
|
|
6
7
|
super(params);
|
|
7
|
-
this.
|
|
8
|
+
this.campaign = ExportType.AS24;
|
|
9
|
+
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.AS24}-export`;
|
|
8
10
|
this.mappingSpreadsheetTitle = 'mobile';
|
|
9
11
|
}
|
|
10
12
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Params } from '../interfaces/params.interface';
|
|
2
|
+
import { Config } from './config';
|
|
3
|
+
import { ExportType, FileType } from '../enums';
|
|
4
|
+
|
|
5
|
+
export class Auto24Config extends Config {
|
|
6
|
+
constructor(params: Params) {
|
|
7
|
+
super(params);
|
|
8
|
+
this.campaign = ExportType.AUTO24;
|
|
9
|
+
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.AUTO24}-export`;
|
|
10
|
+
this.outputFiles = [`api_export_cars_${ExportType.AUTO24}.${FileType.XML}`, `autode.${FileType.TAR_GZ}`];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExportType, FileType } from 'src/enums';
|
|
2
|
+
import { Params } from '../interfaces/params.interface';
|
|
3
|
+
import { Config } from './config';
|
|
4
|
+
|
|
5
|
+
export class AutoboerseConfig extends Config {
|
|
6
|
+
constructor(params: Params) {
|
|
7
|
+
super(params);
|
|
8
|
+
this.campaign = ExportType.AUTOBOERSE;
|
|
9
|
+
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.AUTOBOERSE}-export`;
|
|
10
|
+
this.imageUrl = this.environmentConfig[params.environment].imageUrl;
|
|
11
|
+
this.outputFiles = [`api_export_cars_${ExportType.AUTOBOERSE}.${FileType.XML}`];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ExportType, FileType } from 'src/enums';
|
|
2
|
+
import { Params } from '../interfaces/params.interface';
|
|
3
|
+
import { Config } from './config';
|
|
4
|
+
|
|
5
|
+
export class AutouncleConfig extends Config {
|
|
6
|
+
constructor(params: Params) {
|
|
7
|
+
super(params);
|
|
8
|
+
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.AUTOUNCLE}-export`;
|
|
9
|
+
this.outputFiles = [`api_export_cars_${ExportType.AUTOUNCLE}.${FileType.JSON}`];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExportType } from 'src/enums';
|
|
2
|
+
import { Params } from '../interfaces/params.interface';
|
|
3
|
+
import { Config } from './config';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
8
|
+
export class ByOwnerConfig extends Config {
|
|
9
|
+
constructor(params: Params) {
|
|
10
|
+
super(params);
|
|
11
|
+
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.BY_OWNER}-export`;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -10,12 +10,10 @@ export class Config {
|
|
|
10
10
|
imboUrl: string;
|
|
11
11
|
imageUrl: string;
|
|
12
12
|
baseImageUrl: string;
|
|
13
|
-
isNewCar: boolean;
|
|
14
13
|
isCriteo: boolean;
|
|
15
|
-
|
|
16
|
-
location: string;
|
|
14
|
+
criteoMarketingImagesConfigId: number;
|
|
17
15
|
exportType: ExportType;
|
|
18
|
-
|
|
16
|
+
domain: string;
|
|
19
17
|
input: {
|
|
20
18
|
stringIN: string;
|
|
21
19
|
numberIN: string;
|
|
@@ -24,12 +22,10 @@ export class Config {
|
|
|
24
22
|
pathesConfig: {
|
|
25
23
|
localDirectory: string;
|
|
26
24
|
localConvertedDirectory: string;
|
|
27
|
-
remoteDirectory: string;
|
|
28
25
|
baseFileName: string;
|
|
29
26
|
};
|
|
30
27
|
outputFiles: string[];
|
|
31
28
|
cpc: string;
|
|
32
|
-
downloadImages: boolean;
|
|
33
29
|
mappingSpreadsheetId: string;
|
|
34
30
|
mappingSpreadsheetTitle: string;
|
|
35
31
|
dealersSpreadsheetId: string;
|
|
@@ -37,24 +33,24 @@ export class Config {
|
|
|
37
33
|
|
|
38
34
|
protected environmentConfig = {
|
|
39
35
|
[Environment.LOCAL]: {
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
domain: 'autode-dev.de',
|
|
37
|
+
criteoMarketingImagesConfigId: 12,
|
|
42
38
|
localConvertedDirectory: 'resources/csv_dev',
|
|
43
39
|
remoteDirectory: 'import_dev',
|
|
44
40
|
imageUrl: 'https://images.autode-dev.de/cache_test',
|
|
45
41
|
baseImageUrl: 'https://images.autode-dev.de',
|
|
46
42
|
},
|
|
47
43
|
[Environment.DEVELOP]: {
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
domain: 'autode-dev.de',
|
|
45
|
+
criteoMarketingImagesConfigId: 12,
|
|
50
46
|
localConvertedDirectory: 'resources/csv_dev',
|
|
51
47
|
remoteDirectory: 'import_dev',
|
|
52
48
|
imageUrl: 'https://images.autode-dev.de/cache_test',
|
|
53
49
|
baseImageUrl: 'https://images.autode-dev.de',
|
|
54
50
|
},
|
|
55
51
|
[Environment.PRODUCTION]: {
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
domain: 'auto.de',
|
|
53
|
+
criteoMarketingImagesConfigId: 3,
|
|
58
54
|
localConvertedDirectory: 'resources/csv_prod',
|
|
59
55
|
remoteDirectory: 'import',
|
|
60
56
|
imageUrl: 'https://images.auto.de/generated_images',
|
|
@@ -64,20 +60,18 @@ export class Config {
|
|
|
64
60
|
|
|
65
61
|
constructor(params: Params) {
|
|
66
62
|
this.apikey = params.apikey;
|
|
67
|
-
this.isNewCar = params.isNewCar;
|
|
68
|
-
this.isCriteo = params.isCriteo;
|
|
69
63
|
this.exportType = params.exportType;
|
|
70
64
|
this.cpc = params.cpc;
|
|
71
|
-
this.
|
|
72
|
-
this.
|
|
65
|
+
this.criteoMarketingImagesConfigId = this.environmentConfig[params.environment].criteoMarketingImagesConfigId;
|
|
66
|
+
this.domain = this.environmentConfig[params.environment].domain;
|
|
73
67
|
this.baseImageUrl = this.environmentConfig[params.environment].baseImageUrl;
|
|
74
68
|
this.mappingSpreadsheetId = '147qz9sTgs1wi13ua8YKa0IgfxAn1X_qH6LkGnAnzeyY';
|
|
75
69
|
this.dealersSpreadsheetId = '1gWrcA-uRTpna1h66Mbe2Y7NA0tIhlUaQXBcS4a_UzOw';
|
|
76
70
|
this.dealersSpreadsheetTitle = 'dealers_mapping';
|
|
77
|
-
this.userActionsUrl = `https://www.${this.
|
|
78
|
-
this.imboUrl = `https://www.${this.
|
|
79
|
-
this.imageUrl = `https://images.${this.
|
|
80
|
-
this.upaUrl = `https://www.${this.
|
|
71
|
+
this.userActionsUrl = `https://www.${this.domain}/service/user-actions`;
|
|
72
|
+
this.imboUrl = `https://www.${this.domain}/service/image-imbo`;
|
|
73
|
+
this.imageUrl = `https://images.${this.domain}`;
|
|
74
|
+
this.upaUrl = `https://www.${this.domain}/service/user-profile-admin`;
|
|
81
75
|
this.input = {
|
|
82
76
|
stringIN: params.String,
|
|
83
77
|
numberIN: params.Number,
|
|
@@ -86,7 +80,6 @@ export class Config {
|
|
|
86
80
|
this.pathesConfig = {
|
|
87
81
|
localDirectory: 'resources/cars-export',
|
|
88
82
|
localConvertedDirectory: 'resources/default-export',
|
|
89
|
-
remoteDirectory: '',
|
|
90
83
|
baseFileName: 'cars',
|
|
91
84
|
};
|
|
92
85
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExportType, FileType } from 'src/enums';
|
|
2
|
+
import { Params } from '../interfaces/params.interface';
|
|
3
|
+
import { Config } from './config';
|
|
4
|
+
|
|
5
|
+
export class CriteoConfig extends Config {
|
|
6
|
+
constructor(params: Params) {
|
|
7
|
+
super(params);
|
|
8
|
+
this.campaign = ExportType.CRITEO;
|
|
9
|
+
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.CRITEO}-export`;
|
|
10
|
+
this.outputFiles = [`api_export_cars_${ExportType.CRITEO}.${FileType.XML}`];
|
|
11
|
+
this.isCriteo = true;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Params } from '../interfaces/params.interface';
|
|
2
|
+
import { Config } from './config';
|
|
3
|
+
import { ExportType, FileType } from '../enums';
|
|
4
|
+
|
|
5
|
+
export class DasparkingConfig extends Config {
|
|
6
|
+
constructor(params: Params) {
|
|
7
|
+
super(params);
|
|
8
|
+
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.DASPARKING}-export`;
|
|
9
|
+
this.campaign = ExportType.DASPARKING;
|
|
10
|
+
this.outputFiles = [`api_export_cars_${ExportType.DASPARKING}.${FileType.XML}`];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { ExportType } from 'src/enums';
|
|
1
2
|
import { Params } from '../interfaces/params.interface';
|
|
2
3
|
import { Config } from './config';
|
|
3
4
|
|
|
4
5
|
export class EautoConfig extends Config {
|
|
5
6
|
constructor(params: Params) {
|
|
6
7
|
super(params);
|
|
7
|
-
this.campaign =
|
|
8
|
-
this.pathesConfig.localConvertedDirectory =
|
|
9
|
-
this.imageUrl = `https://images.${this.
|
|
8
|
+
this.campaign = ExportType.EAUTO;
|
|
9
|
+
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.EAUTO}-export`;
|
|
10
|
+
this.imageUrl = `https://images.${this.domain}/carimage`;
|
|
10
11
|
this.mappingSpreadsheetTitle = 'mobile_yescar';
|
|
11
12
|
}
|
|
12
13
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { ExportType, FileType } from 'src/enums';
|
|
1
2
|
import { Params } from '../interfaces/params.interface';
|
|
2
3
|
import { Config } from './config';
|
|
3
4
|
|
|
4
5
|
export class FbConfig extends Config {
|
|
5
6
|
constructor(params: Params) {
|
|
6
7
|
super(params);
|
|
7
|
-
this.pathesConfig.localConvertedDirectory =
|
|
8
|
-
this.pathesConfig.remoteDirectory = this.environmentConfig[params.environment].remoteDirectory;
|
|
8
|
+
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.FB}-export`;
|
|
9
9
|
this.imageUrl = this.environmentConfig[params.environment].imageUrl;
|
|
10
|
+
this.outputFiles = [`api_export_cars_${ExportType.FB}.${FileType.XML}`];
|
|
10
11
|
}
|
|
11
12
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ExportType, FileType } from 'src/enums';
|
|
2
|
+
import { Params } from '../interfaces/params.interface';
|
|
3
|
+
import { Config } from './config';
|
|
4
|
+
|
|
5
|
+
export class GoogleConfig extends Config {
|
|
6
|
+
constructor(params: Params) {
|
|
7
|
+
super(params);
|
|
8
|
+
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.GOOGLE}-export`;
|
|
9
|
+
this.outputFiles = [`api_export_cars_${ExportType.GOOGLE}.${FileType.XML}`];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './alleskralle.config';
|
|
2
|
+
export * from './as24.config';
|
|
3
|
+
export * from './auto24.config';
|
|
4
|
+
export * from './autouncle.config';
|
|
5
|
+
export * from './by-owner.config';
|
|
6
|
+
export * from './criteo.config';
|
|
7
|
+
export * from './dasparking.config';
|
|
8
|
+
export * from './eauto.config';
|
|
9
|
+
export * from './fb.config';
|
|
10
|
+
export * from './google.config';
|
|
11
|
+
export * from './kleinanzeigefocus.config';
|
|
12
|
+
export * from './marktde.config';
|
|
13
|
+
export * from './meinstadt.config';
|
|
14
|
+
export * from './ooyyo.config';
|
|
15
|
+
export * from './yescar.config';
|
|
16
|
+
export * from './autoboerse.config';
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Params } from '../interfaces/params.interface';
|
|
2
2
|
import { Config } from './config';
|
|
3
|
-
import { ExportType,
|
|
3
|
+
import { ExportType, FileType } from '../enums';
|
|
4
4
|
|
|
5
5
|
export class KleinanzeigeFocusConfig extends Config {
|
|
6
6
|
constructor(params: Params) {
|
|
7
7
|
super(params);
|
|
8
|
-
this.pathesConfig.localConvertedDirectory =
|
|
9
|
-
this.pathesConfig.remoteDirectory = this.environmentConfig[params.environment].remoteDirectory;
|
|
8
|
+
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.KLEINANZEIGE_FOCUS}-export`;
|
|
10
9
|
this.imageUrl = this.environmentConfig[params.environment].baseImageUrl;
|
|
11
|
-
this.outputFiles = [`api_export_cars_${ExportType.KLEINANZEIGE_FOCUS}.${
|
|
10
|
+
this.outputFiles = [`api_export_cars_${ExportType.KLEINANZEIGE_FOCUS}.${FileType.XML}`];
|
|
12
11
|
}
|
|
13
12
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { ExportType } from 'src/enums';
|
|
1
2
|
import { Params } from '../interfaces/params.interface';
|
|
2
3
|
import { Config } from './config';
|
|
3
4
|
|
|
4
5
|
export class MarktdeConfig extends Config {
|
|
5
6
|
constructor(params: Params) {
|
|
6
7
|
super(params);
|
|
7
|
-
this.campaign =
|
|
8
|
-
this.pathesConfig.localConvertedDirectory =
|
|
9
|
-
this.imageUrl = `https://images.${this.
|
|
8
|
+
this.campaign = ExportType.MARKTDE;
|
|
9
|
+
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.MARKTDE}-export`;
|
|
10
|
+
this.imageUrl = `https://images.${this.domain}/carimage`;
|
|
10
11
|
this.mappingSpreadsheetTitle = 'mobile_yescar';
|
|
11
12
|
}
|
|
12
13
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Params } from '../interfaces/params.interface';
|
|
2
|
+
import { Config } from './config';
|
|
3
|
+
import { ExportType, FileType } from '../enums';
|
|
4
|
+
|
|
5
|
+
export class MeinstadtConfig extends Config {
|
|
6
|
+
constructor(params: Params) {
|
|
7
|
+
super(params);
|
|
8
|
+
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.MEINSTADT}-export`;;
|
|
9
|
+
this.outputFiles = [
|
|
10
|
+
`api_export_cars_${ExportType.MEINSTADT}.${FileType.JSON}`,
|
|
11
|
+
`api_export_cars_${ExportType.MEINSTADT}.${FileType.ZIP}`,
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Params } from '../interfaces/params.interface';
|
|
2
|
+
import { Config } from './config';
|
|
3
|
+
import { ExportType, FileType } from '../enums';
|
|
4
|
+
|
|
5
|
+
export class OoyyoConfig extends Config {
|
|
6
|
+
constructor(params: Params) {
|
|
7
|
+
super(params);
|
|
8
|
+
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.OOYYO}-export`;
|
|
9
|
+
this.outputFiles = [
|
|
10
|
+
`api_export_cars_${ExportType.OOYYO}.${FileType.XML}`,
|
|
11
|
+
`autode-${ExportType.OOYYO}.${FileType.TAR_GZ}`,
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ExportType } from 'src/enums';
|
|
2
|
+
import { Params } from '../interfaces/params.interface';
|
|
3
|
+
import { Config } from './config';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
8
|
+
export class YescarConfig extends Config {
|
|
9
|
+
constructor(params: Params) {
|
|
10
|
+
super(params);
|
|
11
|
+
this.campaign = ExportType.YESCAR;
|
|
12
|
+
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.YESCAR}-export`;
|
|
13
|
+
this.imageUrl = `https://images.${this.domain}/carimage`;
|
|
14
|
+
this.mappingSpreadsheetTitle = 'mobile_yescar';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
export enum ExportType {
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated
|
|
4
|
+
*/
|
|
2
5
|
YESCAR = 'yescar',
|
|
3
6
|
MARKTDE = 'marktde',
|
|
4
7
|
EAUTO = 'eauto',
|
|
5
8
|
AUTOBOERSE = 'autoboerse',
|
|
6
9
|
GOOGLE = 'google',
|
|
7
10
|
FB = 'fb',
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated
|
|
13
|
+
*/
|
|
8
14
|
AUTO24 = 'auto24',
|
|
9
15
|
OOYYO = 'ooyyo',
|
|
10
16
|
MEINSTADT = 'meinstadt',
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated
|
|
19
|
+
*/
|
|
11
20
|
BY_OWNER = 'by-owner',
|
|
12
21
|
AUTOUNCLE = 'autouncle',
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated
|
|
24
|
+
*/
|
|
13
25
|
AS24 = 'as24',
|
|
14
26
|
ALLESKRALLE = 'alleskralle',
|
|
15
27
|
DASPARKING = 'dasparking',
|
|
16
28
|
KLEINANZEIGE_FOCUS = 'kleinanzeigefocus',
|
|
17
|
-
AUTOBORSE = 'autoborse',
|
|
18
29
|
CRITEO = 'criteo',
|
|
19
30
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export enum
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
1
|
+
export enum FileType {
|
|
2
|
+
CSV = 'csv',
|
|
3
|
+
XML = 'xml',
|
|
4
|
+
JSON = 'json',
|
|
5
|
+
ZIP = 'zip',
|
|
6
|
+
TAR_GZ = 'tar.gz',
|
|
7
|
+
JPG = 'jpg',
|
|
8
|
+
};
|
package/src/export.schema.ts
CHANGED
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
import { AlleskralleConfig } from './config/alleskralle.config';
|
|
2
|
-
import { As24Config } from './config/as24.config';
|
|
3
|
-
import { Auto24Config } from './config/auto24.config';
|
|
4
|
-
import { AutoboerseConfig } from './config/autoboerse.config';
|
|
5
|
-
import { AutouncleConfig } from './config/autouncle.config';
|
|
6
|
-
import { ByOwnerConfig } from './config/by-owner.config';
|
|
7
|
-
import { DasparkingConfig } from './config/dasparking.config';
|
|
8
|
-
import { EautoConfig } from './config/eauto.config';
|
|
9
|
-
import { FbConfig } from './config/fb.config';
|
|
10
|
-
import { GoogleConfig } from './config/google.config';
|
|
11
|
-
import { MarktdeConfig } from './config/marktde.config';
|
|
12
|
-
import { MeinstadtConfig } from './config/meinstadt.config';
|
|
13
|
-
import { OoyyoConfig } from './config/ooyyo.config';
|
|
14
|
-
import { YescarConfig } from './config/yescar.config';
|
|
15
|
-
import { KleinanzeigeFocusConfig } from './config/kleinanzeigeFocus.config';
|
|
16
1
|
import { ExportType } from './enums';
|
|
17
|
-
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
AlleskralleConfig,
|
|
5
|
+
As24Config,
|
|
6
|
+
Auto24Config,
|
|
7
|
+
AutouncleConfig,
|
|
8
|
+
DasparkingConfig,
|
|
9
|
+
EautoConfig,
|
|
10
|
+
FbConfig,
|
|
11
|
+
GoogleConfig,
|
|
12
|
+
MarktdeConfig,
|
|
13
|
+
MeinstadtConfig,
|
|
14
|
+
OoyyoConfig,
|
|
15
|
+
YescarConfig,
|
|
16
|
+
KleinanzeigeFocusConfig,
|
|
17
|
+
AutoboerseConfig,
|
|
18
|
+
ByOwnerConfig,
|
|
19
|
+
CriteoConfig
|
|
20
|
+
} from './configs';
|
|
21
|
+
import {
|
|
22
|
+
As24Exporter,
|
|
23
|
+
Auto24Exporter,
|
|
24
|
+
AutouncleExporter,
|
|
25
|
+
ByOwnerExporter,
|
|
26
|
+
FbExporter,
|
|
27
|
+
GoogleExporter,
|
|
28
|
+
MeinstadtExporter,
|
|
29
|
+
MobileExporter,
|
|
30
|
+
OoyyoExporter,
|
|
31
|
+
ModixExporter,
|
|
32
|
+
RubrikkExporter
|
|
33
|
+
} from './exporters';
|
|
34
|
+
|
|
29
35
|
|
|
30
36
|
export const exportSchema = {
|
|
31
37
|
[ExportType.EAUTO]: {
|
|
@@ -40,10 +46,6 @@ export const exportSchema = {
|
|
|
40
46
|
config: MarktdeConfig,
|
|
41
47
|
exporter: MobileExporter,
|
|
42
48
|
},
|
|
43
|
-
[ExportType.AUTOBOERSE]: {
|
|
44
|
-
config: AutoboerseConfig,
|
|
45
|
-
exporter: MobileExporter,
|
|
46
|
-
},
|
|
47
49
|
[ExportType.GOOGLE]: {
|
|
48
50
|
config: GoogleConfig,
|
|
49
51
|
exporter: GoogleExporter,
|
|
@@ -88,8 +90,8 @@ export const exportSchema = {
|
|
|
88
90
|
config: KleinanzeigeFocusConfig,
|
|
89
91
|
exporter: RubrikkExporter,
|
|
90
92
|
},
|
|
91
|
-
[ExportType.
|
|
92
|
-
config:
|
|
93
|
+
[ExportType.AUTOBOERSE]: {
|
|
94
|
+
config: AutoboerseConfig,
|
|
93
95
|
exporter: ModixExporter,
|
|
94
96
|
},
|
|
95
97
|
[ExportType.CRITEO]: {
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { writeFile } from 'fs/promises';
|
|
2
|
+
import { get, union } from 'lodash';
|
|
3
|
+
import { normalize } from 'path';
|
|
4
|
+
|
|
5
|
+
|
|
5
6
|
import { Injectable } from '@nestjs/common';
|
|
6
7
|
import { ModuleRef } from '@nestjs/core';
|
|
8
|
+
|
|
9
|
+
import { CronicleUtils } from '@bytebrand/cronicle-helper';
|
|
10
|
+
import { FsChunkInterface } from '@bytebrand/chunkable';
|
|
11
|
+
import { Zipper } from '@bytebrand/zipper';
|
|
12
|
+
|
|
13
|
+
import { ConfigService, LoaderService, RulesService, CarService } from '../services';
|
|
7
14
|
import { As24Transformer } from '../transformers/as24.transformer';
|
|
8
|
-
import {
|
|
15
|
+
import { Exporter } from '../interfaces/exporter.interface';
|
|
9
16
|
import { convertToCSV } from '../utils/converter.utils';
|
|
10
|
-
import {
|
|
11
|
-
import { normalize } from 'path';
|
|
12
|
-
import { Zipper } from '@bytebrand/zipper';
|
|
13
|
-
import { FileTypes } from '../enums';
|
|
14
|
-
import { RulesService, CarService } from '../services';
|
|
17
|
+
import { FileType } from '../enums';
|
|
15
18
|
|
|
16
19
|
@Injectable()
|
|
17
20
|
export class As24Exporter implements Exporter {
|
|
18
21
|
constructor(
|
|
19
22
|
private configService: ConfigService,
|
|
20
23
|
private loaderService: LoaderService,
|
|
21
|
-
private userService: UserService,
|
|
22
24
|
private moduleRef: ModuleRef,
|
|
23
25
|
private carService: CarService,
|
|
24
26
|
private readonly rulesService: RulesService,
|
|
25
|
-
) {}
|
|
27
|
+
) { }
|
|
26
28
|
|
|
27
29
|
async export(): Promise<any> {
|
|
28
30
|
await CronicleUtils.ensureDir(this.configService.config.pathesConfig.localConvertedDirectory);
|
|
29
31
|
await CronicleUtils.emptyDir(this.configService.config.pathesConfig.localConvertedDirectory);
|
|
30
32
|
|
|
31
33
|
const as24Transformer = await this.moduleRef.create(As24Transformer);
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
const processedDealers = [];
|
|
34
|
+
const processedDealers = new Set();
|
|
35
35
|
|
|
36
36
|
await this.loaderService.process(async (chunk: FsChunkInterface) => {
|
|
37
37
|
const chunkData = chunk.data.filter(car => this.carService.filterCar(car, this.rulesService.rules));
|
|
@@ -39,35 +39,32 @@ export class As24Exporter implements Exporter {
|
|
|
39
39
|
if (chunk && chunkData) {
|
|
40
40
|
for (let i = 0; i < chunk.data.length; i += 1) {
|
|
41
41
|
const data = chunk.data[i];
|
|
42
|
-
const ownerId = get(data.car, 'metaData.ownerId'
|
|
42
|
+
const ownerId = get(data.car, 'metaData.ownerId');
|
|
43
43
|
|
|
44
|
-
const transformedData = await as24Transformer.transform(data.car
|
|
44
|
+
const transformedData = await as24Transformer.transform(data.car);
|
|
45
45
|
const transformedDataCSV = `${convertToCSV(transformedData)}\n`;
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
Buffer.from(transformedDataCSV),
|
|
50
|
-
{ flag: 'a' },
|
|
51
|
-
);
|
|
47
|
+
const filename = `${this.configService.config.pathesConfig.localConvertedDirectory}/${ownerId}.${FileType.CSV}`
|
|
48
|
+
await writeFile(filename, Buffer.from(transformedDataCSV), { flag: 'a' },);
|
|
52
49
|
|
|
53
|
-
|
|
50
|
+
this.carService.counter.countCar(data.images);
|
|
51
|
+
processedDealers.add(ownerId);
|
|
54
52
|
}
|
|
55
|
-
|
|
53
|
+
|
|
56
54
|
}
|
|
57
55
|
});
|
|
58
56
|
|
|
59
57
|
for (const dealer of processedDealers) {
|
|
60
58
|
const now = new Date();
|
|
61
59
|
const d = `${now.getFullYear()}${now.getMonth() + 1}${now.getDate()}`;
|
|
62
|
-
const fileCSV = normalize(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const fileZIP = normalize(
|
|
66
|
-
`${this.configService.config.pathesConfig.localConvertedDirectory}/${d}_${dealer}.${FileTypes.zip}`,
|
|
67
|
-
);
|
|
60
|
+
const fileCSV = normalize(`${this.configService.config.pathesConfig.localConvertedDirectory}/${dealer}.${FileType.CSV}`);
|
|
61
|
+
const fileZIP = normalize(`${this.configService.config.pathesConfig.localConvertedDirectory}/${d}_${dealer}.${FileType.ZIP}`);
|
|
62
|
+
|
|
68
63
|
if (await CronicleUtils.exists(fileCSV)) {
|
|
69
64
|
await Zipper.zip({ fileList: [fileCSV], dest: fileZIP });
|
|
65
|
+
await CronicleUtils.unlinkIfExists(fileCSV);
|
|
70
66
|
}
|
|
71
67
|
}
|
|
68
|
+
console.log(this.carService.counter.getCountedCars());
|
|
72
69
|
}
|
|
73
70
|
}
|