@bytebrand/export-cars 1.6.5 → 1.6.6
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/configs/marktde.config.js +4 -0
- package/dist/configs/marktde.config.js.map +1 -1
- package/dist/export.command.js +12 -5
- package/dist/export.command.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -7
- package/src/configs/marktde.config.ts +5 -1
- package/src/export.command.ts +13 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytebrand/export-cars",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "bytebrand",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -17,13 +17,14 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@bytebrand/autode-request": "^1.9.0",
|
|
19
19
|
"@bytebrand/car-basic-data-scope": "^9.8.23",
|
|
20
|
-
"@bytebrand/car-description": "^1.7.
|
|
20
|
+
"@bytebrand/car-description": "^1.7.24",
|
|
21
21
|
"@bytebrand/car-schema": "^3.12.24",
|
|
22
|
-
"@bytebrand/chunkable": "^5.13.
|
|
23
|
-
"@bytebrand/cronicle-helper": "^1.15.
|
|
22
|
+
"@bytebrand/chunkable": "^5.13.2",
|
|
23
|
+
"@bytebrand/cronicle-helper": "^1.15.1",
|
|
24
24
|
"@bytebrand/fe-financing": "^5.4.3",
|
|
25
|
-
"@bytebrand/i18n-dictionaries": "^1.4.
|
|
26
|
-
"@bytebrand/
|
|
25
|
+
"@bytebrand/i18n-dictionaries": "^1.4.2",
|
|
26
|
+
"@bytebrand/import-helper": "^0.34.0",
|
|
27
|
+
"@bytebrand/schema-tools": "^3.13.24",
|
|
27
28
|
"@bytebrand/zipper": "^2.1.1",
|
|
28
29
|
"@nestjs/axios": "^0.1.0",
|
|
29
30
|
"@nestjs/common": "^9.0.0",
|
|
@@ -65,5 +66,5 @@
|
|
|
65
66
|
"engines": {
|
|
66
67
|
"node": ">=14.0.0"
|
|
67
68
|
},
|
|
68
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "3277f9bb7c9a77549373ee0cfa22cb42e5f426de"
|
|
69
70
|
}
|
|
@@ -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,9 @@ 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.outputFiles = [
|
|
13
|
+
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.MARKTDE}.${FileType.CSV}`,
|
|
14
|
+
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.MARKTDE}.${FileType.ZIP}`
|
|
15
|
+
]
|
|
12
16
|
}
|
|
13
17
|
}
|
package/src/export.command.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createInterface } from 'readline';
|
|
1
2
|
import { Command, CommandRunner, InquirerService } from 'nest-commander';
|
|
2
3
|
import { ConfigService } from './services/config.service';
|
|
3
4
|
import { Input } from './interfaces/input.interface';
|
|
@@ -20,12 +21,18 @@ export class ExportRunner extends CommandRunner {
|
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
async run(): Promise<void> {
|
|
23
|
-
const
|
|
24
|
+
const rl = createInterface({ input: process.stdin });
|
|
25
|
+
await new Promise<void>((resolve, reject) => {
|
|
26
|
+
rl.on('line', async (data: string) => {
|
|
27
|
+
const input = JSON.parse(data) as Input;
|
|
28
|
+
LoggerService.log(`Running job: ${input.id} - ${JSON.stringify(input)}\n`);
|
|
29
|
+
|
|
30
|
+
this.configService.config = new exportSchema[input.params.exportType].config(input.params);
|
|
31
|
+
const exporter = await this.moduleRef.create<Exporter>(exportSchema[input.params.exportType].exporter);
|
|
32
|
+
await exporter.export().catch(reject);
|
|
24
33
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const exporter = await this.moduleRef.create<Exporter>(exportSchema[input.params.exportType].exporter);
|
|
29
|
-
await exporter.export();
|
|
34
|
+
resolve(rl.close());
|
|
35
|
+
});
|
|
36
|
+
});
|
|
30
37
|
}
|
|
31
38
|
}
|