craft-cli 0.2.0: signed-URL fix for Craft media blocks
craft-cli no longer auto-marks r.craft.do media as uploaded. Signed URLs rotate; storing them as-is meant the asset showed 'not available' once the signature expired. The API now re-signs on insert.
craft-cli 0.2.0 is out. Release on GitHub.
What changed
client.blocks.insert no longer auto-marks r.craft.do media blocks as uploaded: true. Those URLs are signed and time-limited - they rotate on every GET /blocks fetch. Storing them with uploaded: true told the API “trust this URL, do not re-fetch”, which worked at insert time but broke once the signature rotated. The asset would then display “not available”.
From 0.2.0, the API re-fetches and re-signs r.craft.do URLs on insert. The normalizeCraftMediaBlocks helper still exists for the rare case where you want to force-store a URL as-is - it is just no longer applied automatically.
Who this affects
Anyone using @1ar/craft-cli/lib or the craft blocks insert command to clone or migrate Craft documents that contain images, videos, or file attachments. Existing blocks already inserted with the old auto-injection behavior are unaffected - this only changes what new inserts store.
Upgrade
cd ~/dev/craft-cli && git pull && ./install.sh