Engine Room panel on the LinkSpin Ads screen (Fuel Your Offers stage 4, Marty approved 2026-10-24): engine.js + engine-room.js are the same files as InstantAdPay's. LinkSpin's facts (credits, campaigns, clicks this week and last via coach.clicksSince, free login slots, conversion-pixel goals this month from the Central 1st via convtrack.countSince, conversions in 30 days, and the Banner Spin / spin link / page / testing part states from bannerspin, rotator and pages) are combined with InstantAdPay's facts and the streak from signed /api/partner/engine on InstantAdPay (cached a minute; when it does not answer the panel says so). LinkSpin answers /api/partner/engine for InstantAdPay's tab. /api/my/engine, /api/my/engine/goal (forwarded to InstantAdPay, where the goal lives with the streak). Hidden while refuelStreak is off; greyed "Refuel to start your engine" until the first counted refuel. Chatbot CANNED + FACTS cover it. qa/refuel-engine.test.cjs checks the shared files have not drifted from InstantAdPay's and runs its engine test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+3
-1
@@ -228,6 +228,8 @@ async function report(owner, days, opts) {
|
||||
byGoal: out, methods, total: conv.length, selfTests };
|
||||
}
|
||||
// InstantAdPay's view: goals + per IAP campaign conversions (and clicks) for this owner
|
||||
// goal conversions (not the owner's own tests) since a moment, for the Engine Room's goals dial (2026-10-24)
|
||||
function countSince(owner, since) { const o = norm(owner); return load().conv.filter(c => c.owner === o && c.ts >= since && !c.self).length; }
|
||||
function partnerSummary(owner, days) {
|
||||
const o = norm(owner); const since = Date.now() - (Math.max(1, Math.min(90, Number(days) || 30))) * DAY; const st = load();
|
||||
const conv = st.conv.filter(c => c.owner === o && c.ts >= since && !c.self);
|
||||
@@ -249,4 +251,4 @@ function csv(owner, days) {
|
||||
// "Send a test conversion" from a screen (InstantAdPay's partner call, or the Control Room when it cannot load the image)
|
||||
function testGoal(owner, px) { const g = goal(px); if (!g || g.owner !== norm(owner)) return { error: 'No such goal.' }; load().tests[g.px] = Date.now(); save(); flush(); return { ok: true, at: load().tests[g.px] }; }
|
||||
function adminCounts() { const st = load(); return { goals: Object.keys(st.goals).length, clicks: Object.keys(st.clicks).length, conversions: st.conv.length }; }
|
||||
module.exports = { init, flush, prune, softKey, isPx, isClickId, isAdId, cleanName, cleanValue, goalsOf, goal, createGoal, updateGoal, recordAdClick, importClicks, lookup, record, postbackCtx, landing, report, partnerSummary, csv, adminCounts, testGoal, LIMITS, WINDOW_MS, SOFT_MS };
|
||||
module.exports = { countSince, init, flush, prune, softKey, isPx, isClickId, isAdId, cleanName, cleanValue, goalsOf, goal, createGoal, updateGoal, recordAdClick, importClicks, lookup, record, postbackCtx, landing, report, partnerSummary, csv, adminCounts, testGoal, LIMITS, WINDOW_MS, SOFT_MS };
|
||||
|
||||
Reference in New Issue
Block a user