@bytebrand/export-cars 1.15.0 → 1.16.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/app.module.js +0 -2
- package/dist/app.module.js.map +1 -1
- package/dist/configs/autoboerse.config.js +1 -1
- package/dist/configs/autoboerse.config.js.map +1 -1
- package/dist/constants/modix/usage-type.constant.js +2 -2
- package/dist/constants/modix/usage-type.constant.js.map +1 -1
- package/dist/constants/modix/vehicle-class.constant.js +1 -1
- package/dist/constants/modix/vehicle-class.constant.js.map +1 -1
- package/dist/formats/modix-xml.builder.js +3 -8
- package/dist/formats/modix-xml.builder.js.map +1 -1
- package/dist/transformers/modix.transformer.js +6 -6
- package/dist/transformers/modix.transformer.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/src/app.module.ts +0 -2
- package/src/configs/autoboerse.config.ts +1 -1
- package/src/constants/modix/usage-type.constant.ts +2 -2
- package/src/constants/modix/vehicle-class.constant.ts +1 -1
- package/src/formats/modix-xml.builder.ts +3 -9
- package/src/transformers/modix.transformer.ts +7 -7
- package/dist/input.questions.d.ts +0 -3
- package/dist/input.questions.js +0 -32
- package/dist/input.questions.js.map +0 -1
- package/src/input.questions.ts +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytebrand/export-cars",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "bytebrand",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
"start:dev": "nest start --watch"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@bytebrand/autode-request": "^1.14.
|
|
19
|
-
"@bytebrand/car-basic-data-scope": "^9.11.
|
|
20
|
-
"@bytebrand/car-description": "^1.
|
|
21
|
-
"@bytebrand/car-schema": "^3.14.
|
|
22
|
-
"@bytebrand/chunkable": "^5.15.
|
|
23
|
-
"@bytebrand/cronicle-helper": "^1.17.
|
|
18
|
+
"@bytebrand/autode-request": "^1.14.17",
|
|
19
|
+
"@bytebrand/car-basic-data-scope": "^9.11.8",
|
|
20
|
+
"@bytebrand/car-description": "^1.12.1",
|
|
21
|
+
"@bytebrand/car-schema": "^3.14.7",
|
|
22
|
+
"@bytebrand/chunkable": "^5.15.19",
|
|
23
|
+
"@bytebrand/cronicle-helper": "^1.17.20",
|
|
24
24
|
"@bytebrand/i18n-dictionaries": "^1.4.3",
|
|
25
|
-
"@bytebrand/import-helper": "^0.42.
|
|
26
|
-
"@bytebrand/schema-tools": "^3.
|
|
25
|
+
"@bytebrand/import-helper": "^0.42.8",
|
|
26
|
+
"@bytebrand/schema-tools": "^3.17.1",
|
|
27
27
|
"@bytebrand/zipper": "^2.1.2",
|
|
28
28
|
"@nestjs/common": "^9.0.0",
|
|
29
29
|
"@nestjs/core": "^9.0.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"google-spreadsheet": "^3.3.0",
|
|
34
34
|
"lodash": "^4.17.21",
|
|
35
35
|
"moment": "^2.29.4",
|
|
36
|
-
"nest-commander": "^3.
|
|
36
|
+
"nest-commander": "^3.11.0",
|
|
37
37
|
"reflect-metadata": "^0.1.13",
|
|
38
38
|
"vin-generator": "^1.0.1"
|
|
39
39
|
},
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=14.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "176c968f9007bf8291198d399c82981869307f5b"
|
|
64
64
|
}
|
package/src/app.module.ts
CHANGED
|
@@ -13,13 +13,11 @@ import {
|
|
|
13
13
|
CarService,
|
|
14
14
|
ImagesService,
|
|
15
15
|
} from './services';
|
|
16
|
-
import { InputQuestions } from './input.questions';
|
|
17
16
|
import { ExportRunner } from './export.command';
|
|
18
17
|
|
|
19
18
|
@Module({
|
|
20
19
|
imports: [CacheModule.register()],
|
|
21
20
|
providers: [
|
|
22
|
-
InputQuestions,
|
|
23
21
|
ExportRunner,
|
|
24
22
|
ConfigService,
|
|
25
23
|
RequestService,
|
|
@@ -11,6 +11,6 @@ export class AutoboerseConfig extends Config {
|
|
|
11
11
|
this.outputFiles = [
|
|
12
12
|
`${this.pathesConfig.localConvertedDirectory}/api_export_cars_${ExportType.AUTOBOERSE}.${FileType.XML}`,
|
|
13
13
|
];
|
|
14
|
-
this.imageUrl = this.environmentConfig[params.environment].
|
|
14
|
+
this.imageUrl = this.environmentConfig[params.environment].baseImageUrl;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IModixItemsList } from '../../interfaces';
|
|
2
2
|
|
|
3
3
|
export const UsageTypeList: IModixItemsList = {
|
|
4
|
-
selector_usageType_preRegistration: { value: '' },
|
|
4
|
+
selector_usageType_preRegistration: { value: 'One-day registration', atributes: { id: 6 } },
|
|
5
5
|
selector_usageType_demonstrationCar: { value: 'Demonstration car', atributes: { id: 5 } },
|
|
6
6
|
selector_usageType_employeesCar: { value: "Employee's car", atributes: { id: 3 } },
|
|
7
7
|
};
|
|
@@ -9,5 +9,5 @@ export const UsageTypeList: IModixItemsList = {
|
|
|
9
9
|
export const UsageConditionList: IModixItemsList = {
|
|
10
10
|
selector_condition_used: { value: 'Used vehicle', atributes: { id: 2 } },
|
|
11
11
|
selector_condition_new: { value: 'New vehicle', atributes: { id: 1 } },
|
|
12
|
-
selector_unknown: { value: '
|
|
12
|
+
selector_unknown: { value: 'Used vehicle', atributes: { id: 2 } },
|
|
13
13
|
};
|
|
@@ -10,7 +10,7 @@ export const VehicleClassList: IModixItemsList = {
|
|
|
10
10
|
selector_vehicleClass_motorBike: { value: 'Motorbike', atributes: { id: 5 } },
|
|
11
11
|
selector_vehicleClass_forklift: { value: 'Forklift', atributes: { id: 13 } },
|
|
12
12
|
selector_vehicleClass_camperVan: { value: 'Caravan', atributes: { id: 4 } },
|
|
13
|
-
selector_vehicleClass_car: { value: '
|
|
13
|
+
selector_vehicleClass_car: { value: 'Passenger car', atributes: { id: 1 } },
|
|
14
14
|
selector_vehicleClass_trailer: { value: 'Trailer', atributes: { id: 8 } },
|
|
15
15
|
selector_vehicleClass_bus: { value: 'Bus', atributes: { id: 11 } },
|
|
16
16
|
selector_unknown: { value: 'Passenger car', atributes: { id: 1 } },
|
|
@@ -129,23 +129,17 @@ export class ModixXmlBuilder extends XMLBuilderBase {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
mapPrice({ grossPrice, vatReclaimable }: priceItem) {
|
|
132
|
-
let item = `\n<prices>\n<price vatReclaimable="${vatReclaimable}" currency="EUR" type="
|
|
132
|
+
let item = `\n<prices>\n<price vatReclaimable="${vatReclaimable}" currency="EUR" type="2">\n`;
|
|
133
133
|
item += this.getElement('grossPrice', grossPrice.value, false, grossPrice.atributes);
|
|
134
134
|
item += '</price>\n</prices>\n';
|
|
135
135
|
return item;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
mapImages(imageData: imageItem) {
|
|
139
|
-
let item = `\n<media>\n<images url="${imageData.url}">\n`;
|
|
139
|
+
let item = `\n<media>\n<images url="${imageData.url}/">\n`;
|
|
140
140
|
|
|
141
|
-
item += '\n<meta>\n';
|
|
142
141
|
imageData.imageList.forEach(image => {
|
|
143
|
-
item += `<
|
|
144
|
-
});
|
|
145
|
-
item += '\n</meta>\n';
|
|
146
|
-
|
|
147
|
-
imageData.imageList.forEach(image => {
|
|
148
|
-
item += `<media name="${image.atributes?.name}" position="${image.atributes?.position}" />\n`;
|
|
142
|
+
item += `<image name="${image.atributes?.name}" />\n`;
|
|
149
143
|
});
|
|
150
144
|
|
|
151
145
|
item += '\n</images>\n</media>';
|
|
@@ -138,20 +138,20 @@ export class ModixTransformer {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
private getAccident(car: DataSchemes.Car): IAtributeWrapItem {
|
|
141
|
-
const accident = get(car, '
|
|
141
|
+
const accident = get(car, 'mainData.accidentDamaged', null);
|
|
142
142
|
|
|
143
143
|
return { value: accident };
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
private getUsageData(car: DataSchemes.Car): IAtributeWrapItem {
|
|
147
|
-
const usageType = get(car, '
|
|
148
|
-
const
|
|
147
|
+
const usageType = get(car, 'mainData.usageType', '');
|
|
148
|
+
const usageBySelector = get(UsageTypeList, usageType);
|
|
149
149
|
|
|
150
|
-
if (
|
|
151
|
-
return
|
|
150
|
+
if (usageBySelector) {
|
|
151
|
+
return usageBySelector;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
const condition = get(car, '
|
|
154
|
+
const condition = get(car, 'mainData.condition', 'selector_unknown');
|
|
155
155
|
return get(UsageConditionList, condition);
|
|
156
156
|
}
|
|
157
157
|
|
|
@@ -165,7 +165,7 @@ export class ModixTransformer {
|
|
|
165
165
|
return metallic ? { value: 'metallic', atributes: { id: 3 } } : { value: 'solid', atributes: { id: 1 } };
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
private getColorNameData(car): IAtributeWrapItem {
|
|
168
|
+
private getColorNameData(car: DataSchemes.Car): IAtributeWrapItem {
|
|
169
169
|
const colorSelection = get(car, 'exterior.exteriorColor', 'selector_unknown');
|
|
170
170
|
return get(BodyColorList, colorSelection);
|
|
171
171
|
}
|
package/dist/input.questions.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.InputQuestions = void 0;
|
|
13
|
-
const nest_commander_1 = require("nest-commander");
|
|
14
|
-
let InputQuestions = class InputQuestions {
|
|
15
|
-
parseInput(input) {
|
|
16
|
-
return JSON.parse(input);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
__decorate([
|
|
20
|
-
(0, nest_commander_1.Question)({
|
|
21
|
-
message: 'Input:',
|
|
22
|
-
name: 'input',
|
|
23
|
-
}),
|
|
24
|
-
__metadata("design:type", Function),
|
|
25
|
-
__metadata("design:paramtypes", [String]),
|
|
26
|
-
__metadata("design:returntype", void 0)
|
|
27
|
-
], InputQuestions.prototype, "parseInput", null);
|
|
28
|
-
InputQuestions = __decorate([
|
|
29
|
-
(0, nest_commander_1.QuestionSet)({ name: 'input-questions' })
|
|
30
|
-
], InputQuestions);
|
|
31
|
-
exports.InputQuestions = InputQuestions;
|
|
32
|
-
//# sourceMappingURL=input.questions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input.questions.js","sourceRoot":"","sources":["../src/input.questions.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAuD;AAGhD,IAAM,cAAc,GAApB,MAAM,cAAc;IAKzB,UAAU,CAAC,KAAa;QACtB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;CACF,CAAA;AAPC;IAAC,IAAA,yBAAQ,EAAC;QACR,OAAO,EAAE,QAAQ;QACjB,IAAI,EAAE,OAAO;KACd,CAAC;;;;gDAGD;AAPU,cAAc;IAD1B,IAAA,4BAAW,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;GAC5B,cAAc,CAQ1B;AARY,wCAAc"}
|
package/src/input.questions.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Question, QuestionSet } from 'nest-commander';
|
|
2
|
-
|
|
3
|
-
@QuestionSet({ name: 'input-questions' })
|
|
4
|
-
export class InputQuestions {
|
|
5
|
-
@Question({
|
|
6
|
-
message: 'Input:',
|
|
7
|
-
name: 'input',
|
|
8
|
-
})
|
|
9
|
-
parseInput(input: string) {
|
|
10
|
-
return JSON.parse(input);
|
|
11
|
-
}
|
|
12
|
-
}
|