[object Object]

← back to Dw Yolo Loop

Activate 14 1838 $4.25 sample-only drafts as Showroom Lines (tag+custom.showroom_line+inv2026, smart collection auto-includes); hold 2 mispriced paste-tub accessories

7e353c5d4daf72b0390c83c5b52a717c98cf94dd · 2026-06-16 17:12:40 -0700 · Steve Abrams

Files touched

Diff

commit 7e353c5d4daf72b0390c83c5b52a717c98cf94dd
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Tue Jun 16 17:12:40 2026 -0700

    Activate 14 1838 $4.25 sample-only drafts as Showroom Lines (tag+custom.showroom_line+inv2026, smart collection auto-includes); hold 2 mispriced paste-tub accessories
---
 scripts/activate-1838/activate-1838-showroom.mjs | 40 ++++++++++++++++++++++++
 scripts/activate-1838/showroom-run.json          | 26 +++++++++++++++
 2 files changed, 66 insertions(+)

diff --git a/scripts/activate-1838/activate-1838-showroom.mjs b/scripts/activate-1838/activate-1838-showroom.mjs
new file mode 100644
index 0000000..c709c5a
--- /dev/null
+++ b/scripts/activate-1838/activate-1838-showroom.mjs
@@ -0,0 +1,40 @@
+// Activate the 1838 $4.25 sample-only drafts as SHOWROOM LINES (Steve-authorized 2026-06-16).
+// Per [[showroom-lines-category]]: tag 'Showroom Line' + metafield custom.showroom_line=true(boolean)
+// → smart collection 'showroom-lines' auto-includes (vendor!=Phillip Jeffries). status ACTIVE +
+// inventory=2026 on ALL variants. EXCLUDES paste-tub accessories (wrong class + placeholder price).
+import fs from 'fs'; import os from 'os';
+const env={}; for(const l of fs.readFileSync(os.homedir()+'/Projects/secrets-manager/.env','utf8').split('\n')){const m=l.match(/^([A-Z0-9_]+)=(.*)$/);if(m)env[m[1]]=m[2].replace(/^["']|["']$/g,'');}
+const API=`https://${env.SHOPIFY_STORE}/admin/api/2024-10/graphql.json`;
+const LOCATION='gid://shopify/Location/5795643504';
+const APPLY=process.argv.includes('--apply');
+const sleep=ms=>new Promise(r=>setTimeout(r,ms));
+async function gql(q,v){for(let t=0;t<5;t++){const r=await fetch(API,{method:'POST',headers:{'X-Shopify-Access-Token':env.SHOPIFY_ADMIN_TOKEN,'Content-Type':'application/json'},body:JSON.stringify({query:q,variables:v||{}})});if(r.status===429){await sleep(2000);continue;}const j=await r.json();if(j.errors&&JSON.stringify(j.errors).includes('THROTTLED')){await sleep(2000);continue;}return j;}throw new Error('throttled out');}
+
+const sixteen=JSON.parse(fs.readFileSync('/tmp/sl16.json','utf8'));
+const isPaste=p=>/paste tub|paste\b.*accessory|accessory.*paste/i.test(p.title);
+const wallcoverings=sixteen.filter(p=>!isPaste(p));
+const held=sixteen.filter(isPaste);
+console.log(`16 sample-only: ${wallcoverings.length} wallcoverings → Showroom Lines | ${held.length} paste-tub accessories HELD`);
+held.forEach(p=>console.log(`  HOLD: ${p.title.slice(0,44)}`));
+console.log(`\n${APPLY?'APPLYING':'DRY-RUN'} on ${wallcoverings.length} wallcoverings\n`);
+if(!APPLY){wallcoverings.forEach(p=>console.log(`  would SL: ${p.title.slice(0,44)} | ${p.variants.nodes.length}var`));process.exit(0);}
+
+const M_TAG=`mutation($id:ID!,$tags:[String!]!){tagsAdd(id:$id,tags:$tags){userErrors{message}}}`;
+const M_MF=`mutation($mf:[MetafieldsSetInput!]!){metafieldsSet(metafields:$mf){userErrors{field message}}}`;
+const M_STATUS=`mutation($id:ID!){productUpdate(input:{id:$id,status:ACTIVE}){product{status} userErrors{message}}}`;
+const M_INV=`mutation($input:InventorySetQuantitiesInput!){inventorySetQuantities(input:$input){userErrors{message}}}`;
+let ok=0,fail=0;const errs=[];
+for(const p of wallcoverings){
+  try{
+    let r=await gql(M_TAG,{id:p.id,tags:['Showroom Line']}); if(r.data?.tagsAdd?.userErrors?.length)throw new Error('tag:'+JSON.stringify(r.data.tagsAdd.userErrors));
+    r=await gql(M_MF,{mf:[{ownerId:p.id,namespace:'custom',key:'showroom_line',value:'true',type:'boolean'}]}); if(r.data?.metafieldsSet?.userErrors?.length)throw new Error('mf:'+JSON.stringify(r.data.metafieldsSet.userErrors));
+    r=await gql(M_STATUS,{id:p.id}); if(r.data?.productUpdate?.userErrors?.length)throw new Error('status:'+JSON.stringify(r.data.productUpdate.userErrors));
+    const quantities=p.variants.nodes.map(v=>({inventoryItemId:v.inventoryItem.id,locationId:LOCATION,quantity:2026}));
+    r=await gql(M_INV,{input:{reason:'correction',name:'available',ignoreCompareQuantity:true,quantities}}); if(r.data?.inventorySetQuantities?.userErrors?.length)throw new Error('inv:'+JSON.stringify(r.data.inventorySetQuantities.userErrors));
+    ok++; console.log(`  ✓ ${p.title.slice(0,42)} | Showroom Line + ACTIVE + inv2026 x${quantities.length}`);
+  }catch(e){fail++;errs.push(`${p.handle}: ${e.message}`);console.log(`  ✗ ${p.title.slice(0,42)} — ${e.message.slice(0,90)}`);}
+  await sleep(350);
+}
+console.log(`\nDONE: ${ok} showroom-lined, ${fail} failed`);
+if(errs.length)console.log(errs.join('\n'));
+fs.writeFileSync('scripts/activate-1838/showroom-run.json',JSON.stringify({ts:new Date().toISOString(),ok,fail,held:held.map(h=>h.title),handles:wallcoverings.map(w=>w.handle),errs},null,2));
diff --git a/scripts/activate-1838/showroom-run.json b/scripts/activate-1838/showroom-run.json
new file mode 100644
index 0000000..42b1e1b
--- /dev/null
+++ b/scripts/activate-1838/showroom-run.json
@@ -0,0 +1,26 @@
+{
+  "ts": "2026-06-17T00:11:46.493Z",
+  "ok": 14,
+  "fail": 0,
+  "held": [
+    "5kg - Wallcovering Paste Tub Accessory | 1838 Wallcoverings",
+    "2.5kg - Wallcovering Paste Tub Accessory | 1838 Wallcoverings"
+  ],
+  "handles": [
+    "dwc-1001210",
+    "dwc-1001211",
+    "dwc-1001212",
+    "dwc-1001213",
+    "dwc-1001214",
+    "calico-shell-aqua-wallcovering-1838-wallcoverings",
+    "calico-shell-colbalt-blue-wallcovering-1838-wallcoverings",
+    "calico-shell-ivory-wallcovering-1838-wallcoverings",
+    "calico-shell-verde-green-wallcovering-1838-wallcoverings",
+    "charlotte-blush-pink-v-a-wallpaper-wallcovering-1838-wallcoverings",
+    "charlotte-primrose-wallcovering-1838-wallcoverings",
+    "charlotte-teal-wallcovering-1838-wallcoverings",
+    "floral-serenade-apricot-wallcovering-1838-wallcoverings",
+    "floral-serenade-sky-blue-wallcovering-1838-wallcoverings"
+  ],
+  "errs": []
+}
\ No newline at end of file

← d44cbed Activate 451 of 467 1838 Wallcoverings drafts (status ACTIVE  ·  back to Dw Yolo Loop  ·  isolate read-only yolo loop on its own worktree branch (yolo b5c27d7 →