@bytebrand/export-cars 1.21.20 → 1.21.22
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/formats/google-xml.builder.d.ts +1 -0
- package/dist/formats/google-xml.builder.js +8 -1
- package/dist/formats/google-xml.builder.js.map +1 -1
- package/dist/interfaces/export-item.interface.d.ts +4 -4
- package/dist/transformers/google.transformer.js +2 -6
- package/dist/transformers/google.transformer.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/formats/google-xml.builder.ts +9 -1
- package/src/interfaces/export-item.interface.ts +5 -4
- package/src/transformers/google.transformer.ts +7 -7
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ export class GoogleXmlBuilder extends XMLBuilderBase {
|
|
|
14
14
|
if (key === 'installment') {
|
|
15
15
|
return this.getInstallmentElement(key, data);
|
|
16
16
|
}
|
|
17
|
-
return this.getElement(`g:${key}`, data);
|
|
17
|
+
return this.getElement(`g:${key}`, this.escapeXML(data));
|
|
18
18
|
})
|
|
19
19
|
.join('');
|
|
20
20
|
|
|
@@ -32,4 +32,12 @@ export class GoogleXmlBuilder extends XMLBuilderBase {
|
|
|
32
32
|
<g:amount>${data.monthlyInstallment} EUR</g:amount>
|
|
33
33
|
</g:${rootTag}>`;
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
private escapeXML(str: string): string {
|
|
37
|
+
return str.replace(/&/g, '&')
|
|
38
|
+
.replace(/</g, '<')
|
|
39
|
+
.replace(/>/g, '>')
|
|
40
|
+
.replace(/"/g, '"')
|
|
41
|
+
.replace(/'/g, ''');
|
|
42
|
+
}
|
|
35
43
|
}
|
|
@@ -146,13 +146,14 @@ export interface GoogleXmlItem {
|
|
|
146
146
|
link: string;
|
|
147
147
|
image_link: string;
|
|
148
148
|
condition: string;
|
|
149
|
-
availability: string;
|
|
150
149
|
brand: any;
|
|
151
150
|
price: string;
|
|
152
|
-
sale_price: string;
|
|
153
|
-
energy_efficiency_class: string;
|
|
154
151
|
color: string;
|
|
155
|
-
|
|
152
|
+
|
|
153
|
+
sale_price?: string;
|
|
154
|
+
availability?: string;
|
|
155
|
+
energy_efficiency_class?: string;
|
|
156
|
+
installment?: { paybackPeriod: any; monthlyInstallment: any };
|
|
156
157
|
|
|
157
158
|
additional_image_link: string;
|
|
158
159
|
model: string;
|
|
@@ -42,8 +42,8 @@ export class GoogleTransformer {
|
|
|
42
42
|
id: carId,
|
|
43
43
|
image_link: transformedImages[0],
|
|
44
44
|
additional_image_link: transformedImages.slice(1).join(','),
|
|
45
|
-
|
|
46
|
-
link: this.
|
|
45
|
+
ads_redirect: this.getLink(car),
|
|
46
|
+
link: this.getLink(car),
|
|
47
47
|
condition: this.mapState(car),
|
|
48
48
|
price: this.getPrice(car),
|
|
49
49
|
// certified_pre-owned: '',
|
|
@@ -67,11 +67,11 @@ export class GoogleTransformer {
|
|
|
67
67
|
// custom_label_3: '',
|
|
68
68
|
// custom_label_4: '',
|
|
69
69
|
|
|
70
|
-
availability: this.getAvailability(car),
|
|
71
|
-
sale_price: this.getPrice(car),
|
|
72
|
-
energy_efficiency_class: this.getEnergyClass(car),
|
|
73
|
-
installment: this.getInstallment(car),
|
|
74
|
-
custom_label_0: `${this.getInstallment(car)} EUR mtl.`,
|
|
70
|
+
// availability: this.getAvailability(car),
|
|
71
|
+
// sale_price: this.getPrice(car),
|
|
72
|
+
// energy_efficiency_class: this.getEnergyClass(car),
|
|
73
|
+
// installment: this.getInstallment(car),
|
|
74
|
+
// custom_label_0: `${this.getInstallment(car)} EUR mtl.`,
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
|