apps/web/lib/gateway-server.ts
Metadata
- Purpose: Frontend data/service utility module.
- Domain:
applications - Language:
ts - Bytes: 2135
- Lines: 73
- Content hash (short):
9e12b82b - Source (start): apps/web/lib/gateway-server.ts:1
- Source (end): apps/web/lib/gateway-server.ts:73
Indexed Symbols
No indexed functions/methods detected in this file.
Markdown Headings (if applicable)
No markdown headings detected.
Source Preview
import "server-only";
import { randomUUID } from "node:crypto";
import { resolveOperatorAuthToken } from "./operator-session";
const apiBaseUrl = process.env.API_BASE_URL ?? process.env.NEXT_PUBLIC_API_BASE_URL ?? "http://localhost:8080";
export type GatewayRole =
| "msp_admin"
| "ops_engineer"
| "automation_operator"
| "billing"
| "data_admin"
| "viewer"
| "platform_admin"
| "integration_admin"
| "endpoint_agent"
| "client_portal";
type RequestOptions = {
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
body?: unknown;
requireIdempotency?: boolean;
acceptedRoles?: GatewayRole[];
authToken?: string | null;