GET /api/admin/member-extra?email= (Marty 2026-11-14, network hub member lookup): read-only, admin Bearer; what the member card leaves out: optedOut (drip unsubscribe), tank {inTank, ready {readyAt, holdUntil}, adoptions summary}. qa/member-extra.mjs in the member run (401 without/with a wrong password, 404 unknown, fields present). qa member: 57 passed 0 failed, member-extra 7/7

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-14 13:03:34 -06:00
parent e545343fe0
commit fb083b7085
3 changed files with 36 additions and 1 deletions
+12
View File
@@ -2287,6 +2287,18 @@ const server = http.createServer(async (req, res) => {
if (!a) return json(res, 404, { error: 'No member matches "' + q.slice(0, 60) + '".' });
return json(res, 200, await adminMember.view(a.email));
}
// -- admin: the network hub's member lookup (Marty 2026-11-14, read-only): what the member card leaves out. GET ?email=
if (p === '/api/admin/member-extra' && req.method === 'GET') {
if (!isAdmin(req)) return json(res, 401, { error: 'auth' });
const e = String(u.searchParams.get('email') || '').trim().toLowerCase();
const a = e ? await accounts.byEmail(e) : null;
if (!a) return json(res, 404, { error: 'no such account' });
const r = tank.readyRec(e);
return json(res, 200, {
optedOut: await drip.isUnsubscribed(e).catch(() => null),
tank: { inTank: tank.inTank(a), ready: r ? { readyAt: r.readyAt || null, holdUntil: r.readyAt ? r.readyAt + tank.READY_MS : null } : null, adoptions: await tank.summaryFor(e).catch(() => null) }
});
}
// admin-made tracked links for a member (2026-11-03, Marty: a standalone copy of the games page needs LinkSpin tracking
// on every outbound link, built while he was away from his sign-in). POST { email, sourceId? | source?: { name, site },
// links: [{ name, url, label }] } -> one rotation per link on that member's account, one destination each, attached to the