← back to Designer Wallcoverings

mailers/cc-api/check-glitter-sparkle.js

25 lines

'use strict';
// Read-only: fetch the live campaign activity and report whether CC's STORED
// html_content is the NEW grid (leopard glitter + hsw-51510 + gls-106) or the
// OLD one (play-triangle glm9302 / metallics). Proves server state vs editor cache.
const cc = require('./cc-client');
const ID = 'd772eb69-b552-4b4b-9d9b-72a302eceb60';
(async () => {
  const a = await cc.getCampaignActivity(ID);
  const html = a && a.html_content || '';
  const has = (s) => html.includes(s);
  console.log('current_status :', a.current_status);
  console.log('subject        :', a.subject);
  console.log('html bytes     :', html.length);
  console.log('--- NEW markers (should all be true) ---');
  console.log('leopard-glitter-silver-blue :', has('leopard-glitter-wallcovering-silver-blue'));
  console.log('hollywood-sequin hsw-51510   :', has('hollywood-sequin-wallcoverings-hsw-51510'));
  console.log('sexy-sequin gls-106          :', has('sexy-sequin-wallcovering-blue-dazzle-gls-106'));
  console.log('--- OLD markers (should all be false) ---');
  console.log('play-triangle glm9302        :', has('glitterwalls-glm9302'));
  console.log('sharon-metallic-weave        :', has('sharon-metallic-weave'));
  console.log('sequin-wall-paper--blue      :', has('sequin-wall-paper--blue'));
  const ok = has('leopard-glitter-wallcovering-silver-blue') && !has('glitterwalls-glm9302');
  console.log('\nVERDICT:', ok ? 'SERVER HAS THE NEW GRID — the editor view is just cached.' : 'SERVER STILL HAS OLD CONTENT — PUT did not stick.');
})().catch(e => { console.error('ERROR:', e.message); process.exitCode = 1; });