3ce4292794
Pull hesupipe published products/news/cases from the CMS control-api
public endpoints (the same refined data src/content/{products,news,cases}.ts
fetch at build time; those TS files are fetchers, not literal arrays) and
sync them into SiteForge entries via login + PATCH/POST:
- match by route slug (product /product/<slug>/, post keeps legacy WP
route on update, slug-col truncation fallback), create when unmatched,
never delete SiteForge-only entries
- port wp-text.ts cleaning (Gutenberg comments, [caption] -> figure,
trailing form blocks, H1 -> H2, wrapInlineInP, excerpt) so bodies land
sanitized (bleach on the API side strips aligncenter classes/styles)
- upload CMS media (/v1/media/... and local /images/ design fallbacks)
through the SiteForge media API, rewriting body refs to media/<file>;
per-target temp-dir cache dedupes uploads across runs
- product fields: color/standard/category + specs dict flattened into
scalar keys (trade-pro Specifications table renders scalars only) +
gallery as semicolon list; post fields: publish_date/category/tags;
case fields: results/location/industry/gallery
- sync site name/tagline from site.ts SITE literal and set locale=en
via PUT /api/i18n/sites/{id}/locale
Verified against a local uvicorn on a temp snapshot of the container DB:
52 products (47 updated + 5 created), 129 posts updated, 0 failures,
181 media covers, idempotent re-run, theme registry tests unchanged
(30 pass, 1 pre-existing failure).
Co-Authored-By: Claude Code <noreply@anthropic.com>