@cloudcommerce/cli 2.48.16 → 2.48.18
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/lib/ext/import-feed.js +9 -3
- package/package.json +2 -2
package/lib/ext/import-feed.js
CHANGED
|
@@ -92,7 +92,7 @@ const mapCSVToFeed = (item) => {
|
|
|
92
92
|
const canManageStock = item['controlar-estoque'] !== 'N';
|
|
93
93
|
const quantity = Number(item['estoque-quantidade']) || 0;
|
|
94
94
|
return {
|
|
95
|
-
'g:id': item.sku
|
|
95
|
+
'g:id': `${item.sku}`,
|
|
96
96
|
'g:title': item.nome,
|
|
97
97
|
'g:description': item['descricao-completa'] || item['seo-tag-description'],
|
|
98
98
|
'g:image_link': item['imagem-1'],
|
|
@@ -142,8 +142,14 @@ const importFeed = async () => {
|
|
|
142
142
|
attributeNamePrefix: '',
|
|
143
143
|
});
|
|
144
144
|
const json = parser.parse(fs.readFileSync(argv.feed, 'utf8'));
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
json.rss?.channel?.item?.forEach?.((item) => {
|
|
146
|
+
if (item?.['g:id'] && item['g:title']) {
|
|
147
|
+
item['g:id'] = `${item['g:id']}`;
|
|
148
|
+
if (item['g:item_group_id']) {
|
|
149
|
+
item['g:item_group_id'] = `${item['g:item_group_id']}`;
|
|
150
|
+
}
|
|
151
|
+
_items.push(item);
|
|
152
|
+
}
|
|
147
153
|
});
|
|
148
154
|
} else if (fileExtension === '.tsv') {
|
|
149
155
|
const csvContent = fs.readFileSync(feedFilepath, 'utf8');
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.48.
|
|
4
|
+
"version": "2.48.18",
|
|
5
5
|
"description": "e-com.plus Cloud Commerce CLI tools",
|
|
6
6
|
"bin": {
|
|
7
7
|
"cloudcommerce": "./bin/run.mjs"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"md5": "^2.3.0",
|
|
40
40
|
"typescript": "~5.8.3",
|
|
41
41
|
"zx": "^8.7.1",
|
|
42
|
-
"@cloudcommerce/api": "2.48.
|
|
42
|
+
"@cloudcommerce/api": "2.48.18"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "bash ../../scripts/build-lib.sh"
|