[object Object]

← back to Designerwallcoverings

osborne roll-add-apply.mjs: prefer SHOPIFY_FULL_ACCESS_TOKEN for write_inventory (TK-11046)

28066e82b60624187fac65d9d02315be06eb39be · 2026-09-02 11:29:05 -0700 · Steve Abrams

The manual reprice-fix APPLIER's step 3 (inventorySetQuantities) read the narrow ADMIN token
(…7d19, no write_inventory) and would hit the permission wall if re-run. Apply the same
FULL-preferring token read (…2ea5) used on the golive scripts; falls back to ADMIN. Code-only,
does not run the tool. Clears the dw-golive-token-guard-canary baseline WARN.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QLAwoaNSg3benrUyFxHzLh

Files touched

Diff

commit 28066e82b60624187fac65d9d02315be06eb39be
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Sep 2 11:29:05 2026 -0700

    osborne roll-add-apply.mjs: prefer SHOPIFY_FULL_ACCESS_TOKEN for write_inventory (TK-11046)
    
    The manual reprice-fix APPLIER's step 3 (inventorySetQuantities) read the narrow ADMIN token
    (…7d19, no write_inventory) and would hit the permission wall if re-run. Apply the same
    FULL-preferring token read (…2ea5) used on the golive scripts; falls back to ADMIN. Code-only,
    does not run the tool. Clears the dw-golive-token-guard-canary baseline WARN.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01QLAwoaNSg3benrUyFxHzLh
---
 scripts/osborne-onboard/roll-add-apply.mjs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/osborne-onboard/roll-add-apply.mjs b/scripts/osborne-onboard/roll-add-apply.mjs
index 24e2f18..7f1e496 100644
--- a/scripts/osborne-onboard/roll-add-apply.mjs
+++ b/scripts/osborne-onboard/roll-add-apply.mjs
@@ -18,7 +18,12 @@ import { fileURLToPath } from 'node:url';
 const HERE = path.dirname(fileURLToPath(import.meta.url));
 const OUT = path.join(HERE, 'out');
 const STORE = process.env.SHOPIFY_STORE || 'designer-laboratory-sandbox.myshopify.com';
-const TOKEN = process.env.SHOPIFY_ADMIN_TOKEN;
+// TK-11046: step 3 does write_inventory (inventorySetQuantities) — a scope the narrow custom-app
+// ADMIN token (…7d19) LACKS. Prefer the FULL token (…2ea5) from env or the secrets file; fall
+// back to ADMIN. Mirrors go-live-*.js / lib/shopify.mjs; flagged by dw-golive-token-guard-canary.
+const _SEC = (() => { try { return fs.readFileSync(process.env.HOME + '/Projects/secrets-manager/.env', 'utf8'); } catch { return ''; } })();
+const _tok = (k) => { const v = (process.env[k] || (_SEC.match(new RegExp('^' + k + '=(.+)$', 'm')) || [])[1] || '').trim(); return v.replace(/^['"]|['"]$/g, ''); };
+const TOKEN = _tok('SHOPIFY_FULL_ACCESS_TOKEN') || _tok('SHOPIFY_ADMIN_TOKEN');
 const API = '2024-10';
 const LOCATION = 'gid://shopify/Location/5795643504';     // Ventura Blvd (same as go-live)
 const APPLY = process.argv.includes('--apply');

← 9bce15d auto-data-snapshot: 2026-09-02T10:48:45 (4 data files) — scr  ·  back to Designerwallcoverings  ·  auto-data-snapshot: 2026-09-02T12:07:47 (1 data files) — dat 23824b0 →