Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46,539 changes: 22,512 additions & 24,027 deletions public/seed/litellm-prices.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/app/api/admin/database/export/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { acquireBackupLock, releaseBackupLock } from "@/lib/database-backup/back
import { logger } from "@/lib/logger";
import { getSession } from "@/lib/auth";

// 需要数据库连接
export const runtime = "nodejs";

/**
* 导出数据库备份
*
Expand Down
3 changes: 3 additions & 0 deletions src/app/api/admin/database/import/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import {
import { logger } from "@/lib/logger";
import { getSession } from "@/lib/auth";

// 需要数据库连接
export const runtime = "nodejs";

// 文件大小限制(500MB)
const MAX_FILE_SIZE = 500 * 1024 * 1024;

Expand Down
3 changes: 3 additions & 0 deletions src/app/api/admin/database/status/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { logger } from "@/lib/logger";
import { getSession } from "@/lib/auth";
import type { DatabaseStatus } from "@/types/database-backup";

// 需要数据库连接
export const runtime = "nodejs";

/**
* 获取数据库状态信息
*
Expand Down
3 changes: 3 additions & 0 deletions src/app/api/admin/log-cleanup/manual/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { cleanupLogs, CleanupConditions } from "@/lib/log-cleanup/service";
import { logger } from "@/lib/logger";
import { z } from "zod";

// 需要数据库连接
export const runtime = "nodejs";

/**
* 清理请求参数校验 schema
*/
Expand Down
3 changes: 3 additions & 0 deletions src/app/api/admin/log-level/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { getSession } from "@/lib/auth";
import { logger, setLogLevel, getLogLevel, type LogLevel } from "@/lib/logger";

// 需要数据库连接
export const runtime = "nodejs";

/**
* GET /api/admin/log-level
* 获取当前日志级别
Expand Down
3 changes: 3 additions & 0 deletions src/app/api/admin/system-config/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { getSystemSettings, updateSystemSettings } from "@/repository/system-con
import { UpdateSystemSettingsSchema } from "@/lib/validation/schemas";
import { z } from "zod";

// 需要数据库连接
export const runtime = "nodejs";

/**
* GET /api/admin/system-config
* 获取系统配置
Expand Down
3 changes: 3 additions & 0 deletions src/app/api/auth/login/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { NextRequest, NextResponse } from "next/server";
import { logger } from "@/lib/logger";
import { validateKey, setAuthCookie } from "@/lib/auth";

// 需要数据库连接
export const runtime = "nodejs";

export async function POST(request: NextRequest) {
try {
const { key } = await request.json();
Expand Down
3 changes: 3 additions & 0 deletions src/app/api/internal/data-gen/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { getSession } from "@/lib/auth";
import { generateLogs } from "@/lib/data-generator/generator";
import type { GeneratorParams } from "@/lib/data-generator/types";

// 需要数据库连接
export const runtime = "nodejs";

export async function POST(request: NextRequest) {
const session = await getSession();

Expand Down
3 changes: 3 additions & 0 deletions src/app/api/leaderboard/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { getLeaderboardWithCache } from "@/lib/redis";
import { getSystemSettings } from "@/repository/system-config";
import { formatCurrency } from "@/lib/utils";

// 需要数据库连接
export const runtime = "nodejs";

/**
* 获取排行榜数据
* GET /api/leaderboard?period=daily|monthly
Expand Down
3 changes: 3 additions & 0 deletions src/app/api/proxy-status/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { logger } from "@/lib/logger";
import { ProxyStatusTracker } from "@/lib/proxy-status-tracker";
import { getSession } from "@/lib/auth";

// 需要数据库连接
export const runtime = "nodejs";

/**
* 获取所有用户的代理状态
* GET /api/proxy-status
Expand Down
2 changes: 2 additions & 0 deletions src/app/api/system-settings/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { NextResponse } from "next/server";
import { getSystemSettings } from "@/repository/system-config";

// 需要数据库连接
export const runtime = "nodejs";
export const dynamic = "force-dynamic";

/**
Expand Down
3 changes: 3 additions & 0 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { logger } from "@/lib/logger";
import { isDevelopment } from "@/lib/config/env.schema";
import { validateKey } from "@/lib/auth";

// 使用 Node.js runtime 以支持数据库连接(postgres-js 需要 net 模块)
export const runtime = "nodejs";

const PUBLIC_PATHS = [
"/login",
"/usage-doc",
Expand Down
Loading