MCPcopy Create free account
hub / github.com/dwgx/WindsurfAPI / refreshAllCredits

Function refreshAllCredits

src/auth.js:1458–1473  ·  view source on GitHub ↗
({ skipBusy = false } = {})

Source from the content-addressed store, hash-verified

1456}
1457
1458export async function refreshAllCredits({ skipBusy = false } = {}) {
1459 const results = [];
1460 for (const a of accounts) {
1461 if (a.status !== 'active') continue;
1462 if (skipBusy) {
1463 const busyReason = maintenanceBusyReason(a);
1464 if (busyReason) {
1465 results.push({ id: a.id, email: a.email, ok: false, skipped: true, reason: busyReason });
1466 continue;
1467 }
1468 }
1469 const r = await refreshCredits(a.id);
1470 results.push({ id: a.id, email: a.email, ok: r.ok, error: r.error });
1471 }
1472 return results;
1473}
1474
1475/**
1476 * Update the capability of an account for a specific model.

Callers 2

handleDashboardApiFunction · 0.90
initAuthFunction · 0.85

Calls 3

maintenanceBusyReasonFunction · 0.85
refreshCreditsFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected