← back to Sister Parish Onboarding
sp: enrich_metafields v2 — fix dwc.content type to multi_line; 72/73 enriched with item_width/roll_size/repeats/match/country
62e1af10a49074ab2c8cf1156cda3fcd69a55e82 · 2026-05-18 11:10:07 -0700 · SteveStudio2
Files touched
M scripts/enrich_metafields.js
Diff
commit 62e1af10a49074ab2c8cf1156cda3fcd69a55e82
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date: Mon May 18 11:10:07 2026 -0700
sp: enrich_metafields v2 — fix dwc.content type to multi_line; 72/73 enriched with item_width/roll_size/repeats/match/country
---
scripts/enrich_metafields.js | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/scripts/enrich_metafields.js b/scripts/enrich_metafields.js
index 53e19e4..293e5b5 100644
--- a/scripts/enrich_metafields.js
+++ b/scripts/enrich_metafields.js
@@ -30,15 +30,15 @@ const RATE_DELAY_MS = 350;
const DRY = process.argv.includes('--dry-run') || process.argv.includes('--plan');
const sleep = ms => new Promise(r => setTimeout(r, ms));
-// source spec key -> metafield key
+// source spec key -> { key, type } (dwc.content has a multi_line definition)
const FIELD_MAP = {
- 'Item Width': 'item_width',
- 'Sold By': 'roll_size',
- 'Horizontal Repeat': 'repeat_horizontal',
- 'Vertical Repeat': 'repeat_vertical',
- 'Match': 'match',
- 'Country of Origin': 'country_of_origin',
- 'Content': 'content',
+ 'Item Width': { key: 'item_width', type: 'single_line_text_field' },
+ 'Sold By': { key: 'roll_size', type: 'single_line_text_field' },
+ 'Horizontal Repeat': { key: 'repeat_horizontal', type: 'single_line_text_field' },
+ 'Vertical Repeat': { key: 'repeat_vertical', type: 'single_line_text_field' },
+ 'Match': { key: 'match', type: 'single_line_text_field' },
+ 'Country of Origin': { key: 'country_of_origin', type: 'single_line_text_field' },
+ 'Content': { key: 'content', type: 'multi_line_text_field' },
};
const norm = s => (s || '').replace(/\s*\|\s*Sister Parish\s*$/i, '').trim().toLowerCase();
@@ -92,9 +92,9 @@ const nextPage = link => {
if (!raw) { unmatched++; console.log(`${stamp} ? no spec match: ${p.title}`); continue; }
const metafields = [];
- for (const [srcKey, mfKey] of Object.entries(FIELD_MAP)) {
+ for (const [srcKey, mf] of Object.entries(FIELD_MAP)) {
const v = (raw[srcKey] || '').trim();
- if (v) metafields.push({ namespace: 'dwc', key: mfKey, type: 'single_line_text_field', value: v });
+ if (v) metafields.push({ namespace: 'dwc', key: mf.key, type: mf.type, value: v });
}
if (metafields.length === 0) { skipped++; console.log(`${stamp} - no values: ${p.title}`); continue; }
← 6b8b0b8 sp: ran private_label — deleted 52 dupes, renumbered 73 keep
·
back to Sister Parish Onboarding
·
sp: set_variants.js — flatten 72 products to 2 variants (Rol 4280d5a →