vegwatch-dzz — API
AccessRole
Section titled “AccessRole”export type AccessRole = "admin" | "analyst" | "viewer";UserProfile
Section titled “UserProfile”export type UserProfile = { id: string; email: string; displayName: string; role: AccessRole;};getOrCreateProfile
Section titled “getOrCreateProfile”export async function getOrCreateProfile(user: ChatGPTUser): Promise<UserProfile>getRequestProfile
Section titled “getRequestProfile”export async function getRequestProfile(): Promise<UserProfile | null>canUpload
Section titled “canUpload”export function canUpload(role: AccessRole)isLocalAuthEnabled
Section titled “isLocalAuthEnabled”export function isLocalAuthEnabled()normalizeEmail
Section titled “normalizeEmail”export function normalizeEmail(value: string)validatePassword
Section titled “validatePassword”export function validatePassword(value: string)getLocalAuthenticatedUser
Section titled “getLocalAuthenticatedUser”export async function getLocalAuthenticatedUser( requestHeaders: Pick<Headers, "get">,): Promise<ChatGPTUser | null>authenticateLocalUser
Section titled “authenticateLocalUser”export async function authenticateLocalUser( emailValue: string, password: string,): Promise<UserProfile | null>createLocalUser
Section titled “createLocalUser”export async function createLocalUser(input: { email: string; displayName: string; password: string; role: AccessRole;})createLocalSession
Section titled “createLocalSession”export async function createLocalSession(userId: string)deleteLocalSession
Section titled “deleteLocalSession”export async function deleteLocalSession(cookieHeader: string | null)sessionCookie
Section titled “sessionCookie”export function sessionCookie(token: string, request: Request)clearSessionCookie
Section titled “clearSessionCookie”export function clearSessionCookie(request: Request)export function cn(...inputs: ClassValue[]): stringSeriesPoint
Section titled “SeriesPoint”export type SeriesPoint = { date: string; label: string; value: number; baseline: number; lower: number; anomaly: boolean;};FieldZone
Section titled “FieldZone”export type FieldZone = { id: string; name: string; score: number; status: "normal" | "watch" | "critical"; path: string;};formatDate
Section titled “formatDate”export function formatDate(value: string)median
Section titled “median”export function median(values: number[])buildSeriesFromCsv
Section titled “buildSeriesFromCsv”export function buildSeriesFromCsv(text: string): SeriesPoint[]