import type { Request } from "express";

export interface AuthSession {
  sessionId: string;
  userId: string;
  username: string;
  csrfToken: string;
  expiresAt: string;
}

export interface AuthenticatedRequest extends Request {
  auth?: AuthSession;
}

export type ApiErrorCode =
  | "AUTH_REQUIRED" | "CSRF_INVALID" | "VALIDATION_ERROR" | "NOT_FOUND"
  | "CONFLICT" | "RATE_LIMITED" | "LOCKED" | "SESSION_EXPIRED"
  | "PROJECT_INVALID" | "UPLOAD_REJECTED" | "INTERNAL_ERROR";
