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

Method getUserStatus

src/client.js:1397–1420  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1395 // model allowlist + credit usage + trial end time. Replaces the
1396 // probe-based tier inference for accounts where this call succeeds.
1397 async getUserStatus() {
1398 acquireLsUseOrThrow(this.port);
1399 try {
1400 const proto = buildGetUserStatusRequest(this.apiKey);
1401 const resp = await grpcUnary(
1402 this.port, this.csrfToken,
1403 `${LS_SERVICE}/GetUserStatus`, grpcFrame(proto), 10000,
1404 );
1405 const userStatusBytes = extractUserStatusBytes(resp);
1406 const lsEntry = getLsEntryByPort(this.port);
1407 if (lsEntry && !lsEntry.sessionId) lsEntry.sessionId = randomUUID();
1408 const sessionId = lsEntry?.sessionId || null;
1409 const panelProto = buildUpdatePanelStateWithUserStatusRequest(this.apiKey, sessionId, userStatusBytes);
1410 grpcUnary(
1411 this.port, this.csrfToken,
1412 `${LS_SERVICE}/UpdatePanelStateWithUserStatus`, grpcFrame(panelProto), 5000,
1413 ).catch(err => {
1414 log.debug(`UpdatePanelStateWithUserStatus: ${err.message}`);
1415 });
1416 return parseGetUserStatusResponse(resp);
1417 } finally {
1418 endLsUse(this.port);
1419 }
1420 }
1421}

Callers 1

fetchUserStatusFunction · 0.95

Calls 9

grpcUnaryFunction · 0.90
grpcFrameFunction · 0.90
extractUserStatusBytesFunction · 0.90
getLsEntryByPortFunction · 0.90
endLsUseFunction · 0.90
acquireLsUseOrThrowFunction · 0.85

Tested by

no test coverage detected