@bytebrand/export-cars 1.26.36 → 1.26.38
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/exporters/facebook-shop.exporter.js +1 -3
- package/dist/exporters/facebook-shop.exporter.js.map +1 -1
- package/dist/formats/facebook-shop.builder.d.ts +1 -1
- package/dist/formats/facebook-shop.builder.js +6 -9
- package/dist/formats/facebook-shop.builder.js.map +1 -1
- package/dist/services/publication-gate.js +1 -1
- package/dist/services/publication-gate.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/exporters/facebook-shop.exporter.ts +1 -3
- package/src/formats/facebook-shop.builder.ts +8 -9
- package/src/services/publication-gate.ts +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Injectable } from '@nestjs/common';
|
|
2
2
|
import { ModuleRef } from '@nestjs/core';
|
|
3
|
-
import { basename } from 'path';
|
|
4
3
|
|
|
5
4
|
import { CronicleUtils } from '@bytebrand/cronicle-helper';
|
|
6
5
|
import { FsChunkInterface } from '@bytebrand/chunkable';
|
|
@@ -25,9 +24,8 @@ export class FacebookShopExporter implements Exporter {
|
|
|
25
24
|
await CronicleUtils.ensureDir(this.configService.config.pathesConfig.localConvertedDirectory);
|
|
26
25
|
await CronicleUtils.emptyDir(this.configService.config.pathesConfig.localConvertedDirectory);
|
|
27
26
|
|
|
28
|
-
const selfUrl = `https://ftp.${this.configService.config.domain}/feeds/${basename(fileXml)}`;
|
|
29
27
|
const facebookShopXmlBuilder = new FacebookShopXmlBuilder(fileXml);
|
|
30
|
-
await facebookShopXmlBuilder.buildStart(
|
|
28
|
+
await facebookShopXmlBuilder.buildStart();
|
|
31
29
|
|
|
32
30
|
const facebookShopTransformer = await this.moduleRef.create(FacebookShopTransformer);
|
|
33
31
|
|
|
@@ -8,18 +8,17 @@ export class FacebookShopXmlBuilder extends XMLBuilderBase {
|
|
|
8
8
|
// No xmlns:g / g: prefixes here — that namespace belongs to the old Google Merchant /
|
|
9
9
|
// Facebook Shop product-catalog schema. Meta's Automotive Model Ads Vehicle Offers Feed
|
|
10
10
|
// uses plain, undecorated tag names (see facebook-shop.builder field reference above).
|
|
11
|
-
|
|
11
|
+
// Envelope is <listings>/<listing>, not RSS <rss><channel>/<item>: Meta Commerce Manager
|
|
12
|
+
// rejects the RSS form for a Vehicle Offers catalog as an invalid file format (ADV-369).
|
|
13
|
+
async buildStart(): Promise<void> {
|
|
12
14
|
await this.write(
|
|
13
|
-
'<?xml version="1.0" encoding="utf-8"?>\n<
|
|
14
|
-
'\n<
|
|
15
|
-
'\n<description>Automotive Model Ads Vehicle Offers Feed für auto.de</description>' +
|
|
16
|
-
'\n<link>https://www.auto.de/</link>' +
|
|
17
|
-
`\n<atom:link href="${escape(selfUrl)}" rel="self" type="application/rss+xml" />\n`,
|
|
15
|
+
'<?xml version="1.0" encoding="utf-8"?>\n<listings>' +
|
|
16
|
+
'\n<title>auto.de Vehicle Offers Feed</title>\n',
|
|
18
17
|
);
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
async addItem(car: FacebookShopItem): Promise<void> {
|
|
22
|
-
let item = '\n<
|
|
21
|
+
let item = '\n<listing>\n';
|
|
23
22
|
|
|
24
23
|
const { image, ...tags } = car;
|
|
25
24
|
|
|
@@ -32,7 +31,7 @@ export class FacebookShopXmlBuilder extends XMLBuilderBase {
|
|
|
32
31
|
.map((url: string) => `<image><url>${escape(url)}</url></image>\n`)
|
|
33
32
|
.join('');
|
|
34
33
|
|
|
35
|
-
item += '</
|
|
34
|
+
item += '</listing>';
|
|
36
35
|
|
|
37
36
|
await this.write(item);
|
|
38
37
|
}
|
|
@@ -53,7 +52,7 @@ export class FacebookShopXmlBuilder extends XMLBuilderBase {
|
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
async buildEnd(): Promise<void> {
|
|
56
|
-
await this.write('\n</
|
|
55
|
+
await this.write('\n</listings>\n');
|
|
57
56
|
await this.end();
|
|
58
57
|
}
|
|
59
58
|
}
|
|
@@ -18,8 +18,9 @@ import { GoogleEnvkvAttribute, googleEnvkvSourceFields } from '../transformers/g
|
|
|
18
18
|
// enforce estimated attributes are left out of the item (and recorded)
|
|
19
19
|
|
|
20
20
|
// finalValueSource values of CBD's enrichment log that are estimates: the CO2 estimator (EEA register /
|
|
21
|
-
// model), the make-model template sheet
|
|
22
|
-
|
|
21
|
+
// model), the make-model template sheet, the global defaults, and a weighted fuel / CO2 derived from
|
|
22
|
+
// its pair value.
|
|
23
|
+
export const ESTIMATE_SOURCES = ['co2-estimate', 'mmm', 'globalDefault', 'derived'];
|
|
23
24
|
|
|
24
25
|
// Every car field a Google EnVKV attribute can be taken from (google-feed-envkv picks).
|
|
25
26
|
export const GATED_FIELDS = [
|