* Fetch the current user's overage credit grant eligibility from the backend. * The backend resolves tier-specific amounts and role-based claim permission, * so the CLI just reads the response without replicating that logic.
()
| 57 | * so the CLI just reads the response without replicating that logic. |
| 58 | */ |
| 59 | async function fetchOverageCreditGrant(): Promise<OverageCreditGrantInfo | null> { |
| 60 | try { |
| 61 | const { accessToken, orgUUID } = await prepareApiRequest() |
| 62 | const url = buildNoumenaPlatformUrl( |
| 63 | `/api/oauth/organizations/${orgUUID}/overage_credit_grant`, |
| 64 | ) |
| 65 | const response = await axios.get<OverageCreditGrantInfo>(url, { |
| 66 | headers: getOAuthHeaders(accessToken), |
| 67 | }) |
| 68 | return response.data |
| 69 | } catch (err) { |
| 70 | logError(err) |
| 71 | return null |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Get cached grant info. Returns null if no cache or cache is stale. |
no test coverage detected