@bytebrand/export-cars 1.10.10 → 1.10.12

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.
@@ -1 +1,2 @@
1
1
  export declare function convertToCSV(data: unknown): string;
2
+ export declare const ampersandReplacer: (str: string) => string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.convertToCSV = void 0;
3
+ exports.ampersandReplacer = exports.convertToCSV = void 0;
4
4
  const lodash_1 = require("lodash");
5
5
  function convertToCSV(data) {
6
6
  const converted = [];
@@ -12,4 +12,8 @@ function convertToCSV(data) {
12
12
  return converted.join(';');
13
13
  }
14
14
  exports.convertToCSV = convertToCSV;
15
+ const ampersandReplacer = (str) => {
16
+ return typeof str === 'string' ? str.replace(/&/g, '&') : '';
17
+ };
18
+ exports.ampersandReplacer = ampersandReplacer;
15
19
  //# sourceMappingURL=converter.utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"converter.utils.js","sourceRoot":"","sources":["../../src/utils/converter.utils.ts"],"names":[],"mappings":";;;AAAA,mCAA6B;AAE7B,SAAgB,YAAY,CAAC,IAAa;IACxC,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QAC/B,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAa,CAAC;QAC7B,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;QAChE,IAAA,YAAG,EAAC,SAAS,EAAE,CAAC,EAAE,IAAI,QAAQ,GAAG,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC;AARD,oCAQC"}
1
+ {"version":3,"file":"converter.utils.js","sourceRoot":"","sources":["../../src/utils/converter.utils.ts"],"names":[],"mappings":";;;AAAA,mCAA6B;AAE7B,SAAgB,YAAY,CAAC,IAAa;IACxC,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QAC/B,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAa,CAAC;QAC7B,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;QAChE,IAAA,YAAG,EAAC,SAAS,EAAE,CAAC,EAAE,IAAI,QAAQ,GAAG,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC;AARD,oCAQC;AAEM,MAAM,iBAAiB,GAAG,CAAC,GAAW,EAAU,EAAE;IACvD,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACnE,CAAC,CAAC;AAFW,QAAA,iBAAiB,qBAE5B"}
@@ -0,0 +1,3 @@
1
+ export * from './converter.utils';
2
+ export * from './validator.utils';
3
+ export * from './date-time.utils';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./converter.utils"), exports);
18
+ __exportStar(require("./validator.utils"), exports);
19
+ __exportStar(require("./date-time.utils"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,oDAAkC;AAClC,oDAAkC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/export-cars",
3
- "version": "1.10.10",
3
+ "version": "1.10.12",
4
4
  "description": "",
5
5
  "author": "bytebrand",
6
6
  "license": "UNLICENSED",
@@ -60,5 +60,5 @@
60
60
  "engines": {
61
61
  "node": ">=14.0.0"
62
62
  },
63
- "gitHead": "45f8d5dbc712cd3f62ce8f4ee068ae5322930e10"
63
+ "gitHead": "01481a7e09592bf8443a96551eef596ac6d1917a"
64
64
  }
@@ -97,7 +97,7 @@ export interface MeinstadtJsonItem {
97
97
  sellerType: string;
98
98
  usageState: string;
99
99
  imagesCount: number;
100
- images: string[];
100
+ images: string;
101
101
  power: number;
102
102
  'transmissionType/transmission': string;
103
103
  'customerType/sellerType': string;
@@ -47,7 +47,7 @@ export class MeinstadtTransformer {
47
47
  imagesCount: carImages.length,
48
48
  'customerType/sellerType': 'Händler',
49
49
  usageState: this.translate(this.getUsageState(car)),
50
- images: carImages,
50
+ images: carImages[0],
51
51
  };
52
52
  }
53
53
 
@@ -10,7 +10,7 @@ import { ImportOrigins } from '@bytebrand/cronicle-helper';
10
10
  import { DataSchemes } from '@bytebrand/car-schema';
11
11
 
12
12
  import { imageItem, IModixWrapItem, ModixXmlItem } from '../interfaces';
13
- import { isNotEmptyArray, isValidVin } from '../utils/validator.utils';
13
+ import { isNotEmptyArray, isValidVin, ampersandReplacer } from '../utils';
14
14
  import { ConfigService } from '../services';
15
15
  import {
16
16
  BodyColorList,
@@ -38,8 +38,9 @@ export class ModixTransformer {
38
38
  maindata: {
39
39
  category: this.getCategoryData(car),
40
40
  manufacturer: this.getManufactureData(car),
41
- model: { value: toString(get(car, 'mainData.model', '')) },
42
- submodel: { value: get(car, 'mainData.subModel', '') },
41
+ model: { value: ampersandReplacer(get(car, 'mainData.model', '')) },
42
+ // NOTES:: replace angle brackets to make xml valid
43
+ submodel: { value: ampersandReplacer(get(car, 'mainData.subModel', '')).replace(/[<>]/g, '') },
43
44
  mileage: { value: toNumber(get(car, 'mainData.mileage', null)), atributes: { scaleUnit: 'km' } },
44
45
  cylinderCapacity: { value: toString(get(car, 'engineData.cylinders', null)) },
45
46
  enginePower: { value: toNumber(get(car, 'engineData.powerKW', null)), atributes: { scaleUnit: 'kW' } },
@@ -9,3 +9,7 @@ export function convertToCSV(data: unknown): string {
9
9
  });
10
10
  return converted.join(';');
11
11
  }
12
+
13
+ export const ampersandReplacer = (str: string): string => {
14
+ return typeof str === 'string' ? str.replace(/&/g, '&amp;') : '';
15
+ };
@@ -0,0 +1,3 @@
1
+ export * from './converter.utils';
2
+ export * from './validator.utils';
3
+ export * from './date-time.utils';