()
| 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 | } |
no test coverage detected