[object Object]

← back to Filemaker Mcp

add dedup-dwpp-32837 script + 539333/539334 restore archives (delete API-blocked by FM 110)

dcd8c124a56cd643d012956e4ebd0a968a2e3835 · 2026-08-12 08:54:43 -0700 · Steve Abrams

Files touched

Diff

commit dcd8c124a56cd643d012956e4ebd0a968a2e3835
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Aug 12 08:54:43 2026 -0700

    add dedup-dwpp-32837 script + 539333/539334 restore archives (delete API-blocked by FM 110)
---
 pull-wallpaper-combosku.mjs | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/pull-wallpaper-combosku.mjs b/pull-wallpaper-combosku.mjs
new file mode 100644
index 0000000..41a3979
--- /dev/null
+++ b/pull-wallpaper-combosku.mjs
@@ -0,0 +1,35 @@
+// One-off: page ALL live WALLPAPER combo skus → /tmp/fm_wallpaper_combosku.txt
+// Reuses the MCP's fm-client (Claris ID auth). Read-only. TK-10483 audit.
+import fs from 'fs';
+const env = JSON.parse(fs.readFileSync('/tmp/fmenv.json','utf8'));
+for (const [k,v] of Object.entries(env)) process.env[k] = v;
+const fm = await import('./src/fm-client.js');
+
+const DB = 'WALLPAPER', LAYOUT = 'Basic List of Fields', PAGE = 1000;
+const norm = s => (s||'').toUpperCase().replace(/[^A-Z0-9]/g,'');
+const set = new Set();
+let offset = 1, total = null, pages = 0;
+const t0 = Date.now();
+
+while (true) {
+  let res, tries = 0;
+  while (true) {
+    try { res = await fm.listRecords(DB, LAYOUT, { limit: PAGE, offset }); break; }
+    catch (e) {
+      if (++tries >= 4) throw e;
+      await new Promise(r => setTimeout(r, 1500 * tries));
+    }
+  }
+  total = res?.dataInfo?.totalRecordCount ?? total;
+  const recs = res?.records || [];
+  if (!recs.length) break;
+  for (const r of recs) { const c = norm(r.fieldData?.['combo sku']); if (c) set.add(c); }
+  pages++;
+  offset += PAGE;
+  if (pages % 20 === 0) console.error(`  page ${pages}  offset ${offset-1}/${total}  distinct=${set.size}  ${((Date.now()-t0)/1000|0)}s`);
+  if (total && offset > total) break;
+}
+
+fs.writeFileSync('/tmp/fm_wallpaper_combosku.txt', [...set].join('\n') + '\n');
+console.error(`DONE pages=${pages} total_records=${total} distinct_combosku=${set.size} elapsed=${((Date.now()-t0)/1000|0)}s`);
+console.log(JSON.stringify({ pages, total, distinct: set.size }));

← f48d475 wallpaper: resolve private-label SKUs (mfr in metafields) +  ·  back to Filemaker Mcp  ·  wallpaper: prevent duplicate masters via local Postgres idem 7d38b74 →